-dot-callgraph
:
Print Call Graph to “dot” fileThis pass, only available in opt
, prints the
call graph into a .dot
graph. This graph can then
be processed with the “dot” tool to convert it to postscript
or some other suitable format.
-dot-cfg
:
Print CFG of function to “dot” fileThis pass, only available in opt
, prints the
control flow graph into a .dot
graph.
This graph can then be processed with the dot tool to convert it to
postscript or some other suitable format.
-dot-cfg-only
:
Print CFG of function to “dot” file (with no function
bodies)This pass, only available in opt
, prints the
control flow graph into a .dot
graph,
omitting the function bodies. This graph can then be processed
with the dot tool to convert
it to postscript or some other suitable format.
-dot-dom
:
Print dominance tree of function to “dot” fileThis pass, only available in opt
, prints the
dominator tree into a .dot
graph.
This graph can then be processed with the dot tool to convert it to
postscript or some other suitable format.
-dot-dom-only
:
Print dominance tree of function to “dot” file (with no
function bodies)This pass, only available in opt
, prints the
dominator tree into a .dot
graph,
omitting the function bodies. This graph can then be processed
with the dot tool to convert
it to postscript or some other suitable format.
-dot-postdom
:
Print postdominance tree of function to “dot” fileThis pass, only available in opt
, prints the
post dominator tree into a .dot
graph.
This graph can then be processed with the dot tool to convert it to
postscript or some other suitable format.
-dot-postdom-only
:
Print postdominance tree of function to “dot” file (with no
function bodies)This pass, only available in opt
, prints the
post dominator tree into a .dot
graph,
omitting the function bodies. This graph can then be processed
with the dot tool to convert
it to postscript or some other suitable format.
And these dot files can be used with gml4gtk
without problems.
/* llvm opt generated data */
digraph "CFG for 'dp_clredges_r' function" {
label="CFG for 'dp_clredges_r' function";
Node0x14dc6f0 [shape=record,label="{%0|{<s0>T|<s1>F}}"];
Node0x14dc6f0:s0 -> Node0x14dc9a0;
Node0x14dc6f0:s1 -> Node0x14dc9f0;
Node0x14dc9a0 [shape=record,label="{%4}"];
Node0x14dc9a0 -> Node0x14dcc20;
Node0x14dc9f0 [shape=record,label="{%5}"];
Node0x14dc9f0 -> Node0x14dca40;
Node0x14dca40 [shape=record,label="{%9|{<s0>T|<s1>F}}"];
Node0x14dca40:s0 -> Node0x14dca90;
Node0x14dca40:s1 -> Node0x14dcae0;
Node0x14dca90 [shape=record,label="{%12}"];
Node0x14dca90 -> Node0x14dca40;
Node0x14dcae0 [shape=record,label="{%19}"];
Node0x14dcae0 -> Node0x14dcb30;
Node0x14dcb30 [shape=record,label="{%23|{<s0>T|<s1>F}}"];
Node0x14dcb30:s0 -> Node0x14dcb80;
Node0x14dcb30:s1 -> Node0x14dcbd0;
Node0x14dcb80 [shape=record,label="{%26}"];
Node0x14dcb80 -> Node0x14dcb30;
Node0x14dcbd0 [shape=record,label="{%33}"];
Node0x14dcbd0 -> Node0x14dcc20;
Node0x14dcc20 [shape=record,label="{%38}"];
}
examples of high level concepts in programming langs (e.g. if/else, object methods, etc) and shows you how you might generate LLVM IR to support that feature
https://mapping-high-level-constructs-to-llvm-ir.readthedocs.io/en/latest/README.html
The tinycc compiler is GNU GPL Free and includes assembler and
linker
to generate Linux or windows binaries and has windows api headers
an windows versions at
With libtcc, you can use TCC as a backend for dynamic code
generation
https://savannah.nongnu.org/projects/tinycc
mutation testing is another way to scan for bugs using llvm, for
c, c++ at
https://mull.readthedocs.io/en/latest/GettingStarted.html
this is a list of similar tools
at
https://awesomeopensource.com/projects/mutation-testing
Google has a summary on safer c++
progrmming which is technially imposible
https://docs.google.com/document/d/e/2PACX-1vRZr-HJcYmf2Y76DhewaiJOhRNpjGHCxliAQTBhFxzv1QTae9o8mhBmDl32CRIuaWZLt5kVeH9e9jXv/pub
compile simpel javascript to llvm
assembly
https://github.com/wizardpisces/js-ziju
Otrher wsome compilers at
https://github.com/wizardpisces/awesome-compilers
c and c++ source code
improvements ideas from intel
https://software.intel.com/content/www/us/en/develop/articles/the-ultimate-question-of-programming-refactoring-and-everything.html
undefined in c++ summary
https://github.com/shafik/cpp_undefined_behavior_enumerated
Polygeist MLIR Polyhedral Compiler for C/C++
https://polygeist.mit.edu/
there is GCC and clang and glibc and that may
cause extra issues at
https://www.collabora.com/news-and-blog/blog/2021/09/30/a-tale-of-two-toolchains-and-glibc/