Remove incorrect methods from ICFGSupergraph

These methods were constructing an IR based on some default
AnalysisOptions, which may not match the options used when constructing
the underlying CallGraph.  This mismatch can lead to bad bugs.
Instead of these methods, analyses should get IR directory from the
CGNodes via CGNode.getIR().

Ideally we would fix the methods and not change the interface, but
that would require knowing the right AnalysisOptions, which itself
would necessitate an interface change.
This commit is contained in:
Manu Sridharan 2016-08-11 11:24:25 -07:00
parent 7d7dd17a47
commit d0fdd2cdf0
1 changed files with 0 additions and 14 deletions

View File

@ -56,8 +56,6 @@ public class ICFGSupergraph implements ISupergraph<BasicBlockInContext<IExploded
private final AnalysisCache analysisCache;
private final AnalysisOptions options = new AnalysisOptions();
private final ExplodedInterproceduralCFG icfg;
protected ICFGSupergraph(ExplodedInterproceduralCFG icfg, AnalysisCache cache) {
@ -79,18 +77,6 @@ public class ICFGSupergraph implements ISupergraph<BasicBlockInContext<IExploded
return icfg.getCallGraph().getClassHierarchy();
}
public IR getIR(IMethod m, Context c) {
//AnalysisOptions options = new AnalysisOptions();
IR ir = analysisCache.getSSACache().findOrCreateIR(m, c, options.getSSAOptions());
return ir;
}
public IR getIR(CGNode n) {
//AnalysisOptions options = new AnalysisOptions();
IR ir = analysisCache.getSSACache().findOrCreateIR(n.getMethod(), n.getContext(), options.getSSAOptions());
return ir;
}
@Override
public byte classifyEdge(BasicBlockInContext<IExplodedBasicBlock> src, BasicBlockInContext<IExplodedBasicBlock> dest) {
if (isCall(src)) {