$ git clone this_repository.git
$ cd this_repository
$ mkdir build; cd build
$ cmake .. && make
$ make install
- Path to the headers should be searchable by the compiler
- In your LLVM IR pass:
- Include the header file,
ValueContext/ValueContext.h
- Use namespace
ValueContextUtil
- Include the header file,
Initialize the ValueContext
object with the datatype of your dataflow value
ValueContext<AliasMap> VC(BI, Top);
Initailize a context for a given llvm::Function F
and initial dataflow value Initial
as follows:
Context C = VC.initializeContext(F, Initial);
Manipulate data structures storing dataflow values directly through getDataFlowIn
and getDataFlowOut
auto DataflowValue = VC.getDataFlowIn[Context][Instruction];
You may want to update the context graph after initializing a new context.
VC.updateContextGraph(InitialContext, NewContext, CallSite);
To get the previously saved context for a given llvm::Function F
and initial dataflow value Initial
do as follow:
auto SavedContext = VC.getSavedContext(F, Initial);
if the value of SavedContext
is less than 0, implies that this context was not saved previously.
When you reach the boundary instruction, you may want to update the result for the context C
VC.setResult(C, DataflowResutant);
To iterate over all the contexts which invoked this context using a function call
for (auto T : VC.getContextChild(C)) {
// For a context Child which called the context C though callsite Inst
// T is the pair of Child and Inst
}