This is a dynamic LLVM Pass which is to give the basicblocks id and profile the ids. This is the example of how to use llvm pass transform the bc
file and call the runtime library.
-
create a folder by
mkdir build
-
cd the build folder and build it:
cd build && cmake ../
-
make the project:
make
opt -load /the/path/of/libsynamicBBPass.so -pathProfiling /the/path/of/llvm/IR/file -S -o /new/file
clang++ -o /new/file /output/IR/file /the/path/of/libdynamic-rt.a
./executefilename
will output a file which record the BasicBlocks' execution path