Open msridhar opened 9 years ago
There is the class NullPointerAnalysis which provides several utility methods to accomplish something like that: Through the method computeInterprocAnalysis(...) you can get an InterprocAnalysisResult instance from which you can get the pruned control flow graph for each call graph node (@jgf, correct me if I'm wrong). Maybe we can add another facade to simplify the usage.
@msridhar I support the idea of making it more visible, but I'm unsure about which form the standard API should have. Do you already have something in mind?
We have the class PrunedCFG which gives a standard way to prune edges from a ControlFlowGraph
. ExceptionPrunedCFG shows a use of the class, to prune all exceptional edges from a CFG. We could maybe create a class or method that creates a PrunedCFG
with just infeasible exceptional edges pruned.
For the inter-procedural case, perhaps we could change InterproceduralCFG to optionally make use of the pruned control-flow graphs as constructed above. This way, any analysis operating on an InterproceduralCFG (e.g., any IFDS analysis using an ICFGSupergraph) could take advantage of having more precise control-flow graphs.
Just my initial thoughts, I'm open to other suggestions.
@mohrm talked about pruning certain imprecise exceptional edges from control-flow graphs based on a null-pointer analysis in the Workshop on WALA. I found the NullPointerAnalysis and InterprocNullPointerAnalysis classes in WALA, but I didn't see any uses of them. Maybe we can provide a standard API for computing pruned CFGs based on these analyses and make it more visible?