enochii / simple-pointer-analysis

Implement pointer analysis prototype(currently including anderson, steensgard)~

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pointer analysis

A simple prototype of pointer analysis which trys to be as simple as possible to learn the basic algorithm. It currently includes:

  • anderson/inclusion pointer analysis
  • steensgard/unification pointer analysis

the default chosen algorithm is anderson, you can change to steensgard by adding command line argument -steen.

Build & run

Hint: You may need to change the hard-coded llvm path in CMakeList.txt!

  mkdir build
  cd build
  cmake .. 

  # run a simple test
  chmod +x run.sh
  ./run.sh bc/test00.bc
  # for steensgard/unification pointer analysis, type
  ./run.sh bc/test00.bc -steen

the points-to-graph will output as a ".png" file if you have graphviz installed. The sample figure(steensgard with test00.c):

other command line arguments:

  • -dump-module: dump module
  • -dump-cons: dump constraints

reference

https://github.com/grievejia/andersen : A really good anderson implementation for study, but it's more complicated.

About

Implement pointer analysis prototype(currently including anderson, steensgard)~


Languages

Language:C++ 90.7%Language:C 4.5%Language:CMake 2.8%Language:Shell 1.9%