I have a pass that is analyzing the entire module (using runOnFunction()
). But I want to apply it on each execution path. By execution path I mean the sequence of instructions starting from a point in the program (annotated with start) till a termination point of the program (annotated with end).
I assume I have to divide my module into functions by constructing a CallGraph and then divide every function into instructions by construction CFG-s in the nodes of the previous mentioned CallGraph. I assume that the execution paths from a node that I choose are all the paths finishing in the CallGraph leaves (I should be able to communicate between CFG-s). From that node I can see all the paths by using a graph search algorithm.
Is there a possibility to replace the runOnFunction()
/ runOnModule()
method with something user defined, like runOnExecutionPath()
? And if so, there is in LLVM a structure that is appropriate to store execution paths?
Another possibility can be to use getAnalysis<CallGraph>
or getAnalysis<CFG>
? I am confused.
Thank you a lot for any advice !