public SDG<? super I> getSDG(DataDependenceOptions data, ControlDependenceOptions ctrl) { return new SDG<>(getCallGraph(), getPointerAnalysis(), data, ctrl); }
/** * 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); }
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()); }
/** * Set up the AnalysisScope object */ public void buildAnalysisScope() throws IOException { if (j2seLibs == null) { Assertions.UNREACHABLE("no j2selibs specified. You probably did not call AppAnalysisEngine.setJ2SELibrary."); } scope = AnalysisScopeReader.readJavaScope(SYNTHETIC_J2SE_MODEL, (new FileProvider()).getFile(getExclusionsFile()), getClass() .getClassLoader()); // add standard libraries for (Module j2seLib : j2seLibs) { scope.addToScope(scope.getPrimordialLoader(), j2seLib); } // add user stuff addApplicationModulesToScope(); }
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); }
/** * Set up the AnalysisScope object */ public void buildAnalysisScope() throws IOException { if (j2seLibs == null) { Assertions.UNREACHABLE("no j2selibs specified. You probably did not call AppAnalysisEngine.setJ2SELibrary."); } scope = AnalysisScopeReader.readJavaScope(SYNTHETIC_J2SE_MODEL, (new FileProvider()).getFile(getExclusionsFile()), getClass() .getClassLoader()); // add standard libraries for (Module j2seLib : j2seLibs) { scope.addToScope(scope.getPrimordialLoader(), j2seLib); } // add user stuff addApplicationModulesToScope(); }
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); }
/** * 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); }
public SDG<? super I> getSDG(DataDependenceOptions data, ControlDependenceOptions ctrl) { return new SDG<>(getCallGraph(), getPointerAnalysis(), data, ctrl); }