🚀 Feature
This feature request is to make it easy to construct ProGraML from subsets of LLVM-IRs by integrating with llvm-extract.
Motivation
For some use cases, we may want to construct a partial graph of a program. E.g. to construct the graph for a single function. This is easy to do using llvm-extract, but is not part of the ProGraML API. Lets say we have a program with two functions 'A' and 'B'. First compile the program down to LLVM-IR:
$ echo 'int A() { return 5; } int B() { return 10; }' | clang -xc - -emit-llvm -c -S -o ir.ll
Then use llvm-extract tool to pull out only the function you want. We can then use the normal ProGraML llvm2graph tool to generate the graph of just this function (and its transitive deps):
$ llvm-extract --func=A ir.ll -S | llvm2graph
Pitch
Add a set of arguments to the LLVM creation ops that automatically invoke llvm-extract to pull out the required program fragment. E.g.
G = programl.from_llvm_ir(my_program, function="A")
🚀 Feature
This feature request is to make it easy to construct ProGraML from subsets of LLVM-IRs by integrating with llvm-extract.
Motivation
For some use cases, we may want to construct a partial graph of a program. E.g. to construct the graph for a single function. This is easy to do using llvm-extract, but is not part of the ProGraML API. Lets say we have a program with two functions 'A' and 'B'. First compile the program down to LLVM-IR:
Then use
llvm-extracttool to pull out only the function you want. We can then use the normal ProGraML llvm2graph tool to generate the graph of just this function (and its transitive deps):Pitch
Add a set of arguments to the LLVM creation ops that automatically invoke llvm-extract to pull out the required program fragment. E.g.