private static Pair<CallGraph, PointerAnalysis<InstanceKey>> buildCallGraph(AnalysisScope scope, ClassHierarchy cha, AnalysisOptions options)
throws IllegalArgumentException, CancelException {
CallGraph retCG = null;
PointerAnalysis<InstanceKey> retPA = null;
final IAnalysisCacheView cache = new AnalysisCacheImpl();
CallGraphBuilder<InstanceKey> builder;
if (CHEAP_CG) {
builder = Util.makeZeroCFABuilder(Language.JAVA, options, cache, cha, scope);
heapModel = Util.makeVanillaZeroOneCFABuilder(Language.JAVA, options, cache, cha, scope);
} else {
builder = Util.makeZeroOneContainerCFABuilder(options, cache, cha, scope);
heapModel = (HeapModel) builder;
}
ProgressMaster master = ProgressMaster.make(new NullProgressMonitor(), 360000, false);
master.beginTask("runSolver", 1);
try {
retCG = builder.makeCallGraph(options, master);
retPA = builder.getPointerAnalysis();
} catch (CallGraphBuilderCancelException e) {
System.err.println("TIMED OUT!!");
retCG = e.getPartialCallGraph();
retPA = e.getPartialPointerAnalysis();
}
return Pair.make(retCG, retPA);
}