llvmgraph icon indicating copy to clipboard operation
llvmgraph copied to clipboard

Ocamlgraph overlay for llvm

llvmgraph Build Status

Ocamlgraph overlay for llvm

The overlay allows you to read and walk (but not write) the control flow graph of an llvm function using the same interface as an ocamlgraph. In particular, read-only ocamlgraph's algorithm can be applied.

It is also possible to use the Map functor and another graph structure to translate an llvm control flow graph to another graph.

All Ocamlgraph functors that work on read-only graph have been pre-applied, to ease usage of the library.

See the interface for more details.

Dependencies

  • llvm
  • ocamlgraph
  • str for the colordot test.

Examples and How-to

The test folder may be consulted to find some interesting uses of this library. In particular, the colordot example is annotated with detailed explanations.

Here is the result on example.c: colordot.dot

Other examples are very welcome.