This program is to generate a program dependence graph.
https://releases.llvm.org/download.html
https://bitbucket.org/psu_soslab/program-dependence-graph-in-llvm/src/master/
https://stackoverflow.com/questions/5101193/program-dependence-graphs-pdg/39950158#39950158
http://www.cse.psu.edu/~gxt29/papers/ptrsplit.pdf author = {Shen Liu and Gang Tan and Trent Jaeger}, title = {{PtrSplit}: Supporting General Pointers in Automatic Program Partitioning}, booktitle = {24th ACM Conference on Computer and Communications Security ({CCS})},
<!--- Unpack LLVM9 into ~/clang_llvm_9.0.0 directory -->
export PATH=$HOME/clang_llvm_9.0.0/bin:$PATH
clang -emit-llvm -S hello.c -o hello.bc
mkdir build
mv hello.bc build
cd build
cmake ..
make
opt -load libpdg.so -dot-pdg < hello.bc
dot -Tpng pdgragh.main.dot -o hello.png
The last operation is using dot command to read in the dotfile and output a png file.
Dot command is downloaded from Graphviz.