Skip to content

Latest commit

 

History

History

CFGPass

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

this pass is based on llvm-13

you can build it like this:

export LLVM_DIR=<installation/dir/of/llvm/13>
mkdir build
cd build
cmake -DLT_LLVM_INSTALL_DIR=$LLVM_DIR <source/dir/llvm/CFGPass>
make

after these commends you will get a file named libCFGPass.so

then you can use clang to translate test.c to IR:

cd ../test
clang-13 -O0 -S -emit-llvm test.c -o test.ll

now we can analyse the IR by CFGPass:

opt-13 -load-pass-plugin ../build/libCFGPass.so -passes=CFGPass -disable-output test.ll

look at the test directory, there are some .dot file, let translate ff3.dot to .png:

dot -Tpng ff3.dot -o ff3.png

you will get a picture named ff3.png