/** * Builds the call graph for the analysis scope in effect, using all of the given entry points. */ public CallGraphBuilder<? super I> defaultCallGraphBuilder() throws IllegalArgumentException, CancelException, IOException { buildAnalysisScope(); IClassHierarchy cha = buildClassHierarchy(); setClassHierarchy(cha); Iterable<Entrypoint> eps = entrypointBuilder.createEntrypoints(scope, cha); options = getDefaultOptions(eps); cache = makeDefaultCache(); return buildCallGraph(cha, options, true, null); }
protected AbstractEngineStopwatch() { stopwatch = new StopwatchGC[getNumberOfCategories()]; for (int i = 0; i < getNumberOfCategories(); i++) { stopwatch[i] = new StopwatchGC(getCategoryNames()[i]); } }
public SDG<? super I> getSDG(DataDependenceOptions data, ControlDependenceOptions ctrl) { return new SDG<>(getCallGraph(), getPointerAnalysis(), data, ctrl); }
public <I extends InstanceKey> Pair<CallGraph, PointerAnalysis<? extends InstanceKey>> runTest(Collection<String> sources, List<String> libs, String[] mainClassDescriptors, List<? extends IRAssertion> ca, boolean assertReachable, String exclusionsFile) throws IllegalArgumentException, CancelException, IOException { AbstractAnalysisEngine<I, CallGraphBuilder<I>, ?> engine = getAnalysisEngine(mainClassDescriptors, sources, libs); if (exclusionsFile != null) { engine.setExclusionsFile(exclusionsFile); } CallGraph callGraph; callGraph = engine.buildDefaultCallGraph(); //System.err.println(callGraph.toString()); // If we've gotten this far, IR has been produced. if (dump) { dumpIR(callGraph, sources, assertReachable); } // Now check any assertions as to source mapping for (IRAssertion IRAssertion : ca) { IRAssertion.check(callGraph); } return Pair.make(callGraph, engine.getPointerAnalysis()); }
/** * @return a IClassHierarchy object for this analysis scope */ public IClassHierarchy buildClassHierarchy() { IClassHierarchy cha = null; ClassLoaderFactory factory = makeClassLoaderFactory(getScope().getExclusions()); try { cha = ClassHierarchyFactory.make(getScope(), factory); } catch (ClassHierarchyException e) { System.err.println("Class Hierarchy construction failed"); System.err.println(e.toString()); e.printStackTrace(); } return cha; }
public HeapGraph getHeapGraph() { if (heapGraph == null) { heapGraph = new BasicHeapGraph<>(getPointerAnalysis(), cg); } return heapGraph; }
protected CallGraphBuilder<? super I> buildCallGraph(IClassHierarchy cha, AnalysisOptions options, boolean savePointerAnalysis, IProgressMonitor monitor) throws IllegalArgumentException, CancelException { CallGraphBuilder<? super I> builder = getCallGraphBuilder(cha, options, cache); cg = builder.makeCallGraph(options, monitor); if (savePointerAnalysis) { pointerAnalysis = builder.getPointerAnalysis(); } return builder; }
public CallGraph buildDefaultCallGraph() throws IllegalArgumentException, CancelException, IOException { return defaultCallGraphBuilder().makeCallGraph(options, null); }
@Override public AnalysisOptions getDefaultOptions(Iterable<Entrypoint> entrypoints) { return new AnalysisOptions(getScope(), entrypoints); }
@Override public IClassHierarchy getClassHierarchy() { if (super.getClassHierarchy() == null) { setClassHierarchy( buildClassHierarchy() ); } return super.getClassHierarchy(); }
/** * Builds the call graph for the analysis scope in effect, using all of the given entry points. */ public CallGraphBuilder<? super I> defaultCallGraphBuilder() throws IllegalArgumentException, CancelException, IOException { buildAnalysisScope(); IClassHierarchy cha = buildClassHierarchy(); setClassHierarchy(cha); Iterable<Entrypoint> eps = entrypointBuilder.createEntrypoints(scope, cha); options = getDefaultOptions(eps); cache = makeDefaultCache(); return buildCallGraph(cha, options, true, null); }
protected AbstractEngineStopwatch() { stopwatch = new StopwatchGC[getNumberOfCategories()]; for (int i = 0; i < getNumberOfCategories(); i++) { stopwatch[i] = new StopwatchGC(getCategoryNames()[i]); } }
public SDG<? super I> getSDG(DataDependenceOptions data, ControlDependenceOptions ctrl) { return new SDG<>(getCallGraph(), getPointerAnalysis(), data, ctrl); }
/** * @return a IClassHierarchy object for this analysis scope */ public IClassHierarchy buildClassHierarchy() { IClassHierarchy cha = null; ClassLoaderFactory factory = makeClassLoaderFactory(getScope().getExclusions()); try { cha = ClassHierarchyFactory.make(getScope(), factory); } catch (ClassHierarchyException e) { System.err.println("Class Hierarchy construction failed"); System.err.println(e.toString()); e.printStackTrace(); } return cha; }
public HeapGraph getHeapGraph() { if (heapGraph == null) { heapGraph = new BasicHeapGraph<>(getPointerAnalysis(), cg); } return heapGraph; }
protected CallGraphBuilder<? super I> buildCallGraph(IClassHierarchy cha, AnalysisOptions options, boolean savePointerAnalysis, IProgressMonitor monitor) throws IllegalArgumentException, CancelException { CallGraphBuilder<? super I> builder = getCallGraphBuilder(cha, options, cache); cg = builder.makeCallGraph(options, monitor); if (savePointerAnalysis) { pointerAnalysis = builder.getPointerAnalysis(); } return builder; }
public CallGraph buildDefaultCallGraph() throws IllegalArgumentException, CancelException, IOException { return defaultCallGraphBuilder().makeCallGraph(options, null); }
@Override public AnalysisOptions getDefaultOptions(Iterable<Entrypoint> entrypoints) { return new AnalysisOptions(getScope(), entrypoints); }
@Override public final String report() { StringBuilder result = new StringBuilder(); long total = 0; for (int i = 0; i < getNumberOfCategories(); i++) { total += stopwatch[i].getElapsedMillis(); result.append(getCategoryNames()[i]).append(": ").append(stopwatch[i].getElapsedMillis()).append('\n'); } result.append("Total : ").append(total).append('\n'); return result.toString(); }
@Override public final String report() { StringBuilder result = new StringBuilder(); long total = 0; for (int i = 0; i < getNumberOfCategories(); i++) { total += stopwatch[i].getElapsedMillis(); result.append(getCategoryNames()[i]).append(": ").append(stopwatch[i].getElapsedMillis()).append('\n'); } result.append("Total : ").append(total).append('\n'); return result.toString(); }