com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(9.5k)|赞(0)|评价(0)|浏览(142)

本文整理了Java中com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints()方法的一些代码示例,展示了Util.makeMainEntrypoints()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.makeMainEntrypoints()方法的具体详情如下:
包路径:com.ibm.wala.ipa.callgraph.impl.Util
类名称:Util
方法名:makeMainEntrypoints

Util.makeMainEntrypoints介绍

暂无

代码示例

代码示例来源:origin: wala/WALA

  1. /**
  2. * @return Entrypoints object for a Main J2SE class
  3. */
  4. public static Iterable<Entrypoint> makeMainEntrypoints(AnalysisScope scope, final IClassHierarchy cha, String className) {
  5. return makeMainEntrypoints(scope, cha, new String[] { className });
  6. }

代码示例来源:origin: com.ibm.wala/com.ibm.wala.core

  1. /**
  2. * @return Entrypoints object for a Main J2SE class
  3. */
  4. public static Iterable<Entrypoint> makeMainEntrypoints(AnalysisScope scope, final IClassHierarchy cha, String className) {
  5. return makeMainEntrypoints(scope, cha, new String[] { className });
  6. }

代码示例来源:origin: com.ibm.wala/com.ibm.wala.cast.java

  1. @Override
  2. protected Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope, IClassHierarchy cha) {
  3. return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE, cha);
  4. }

代码示例来源:origin: wala/WALA

  1. public static Iterable<Entrypoint> makeMainEntrypoints(final AnalysisScope scope, final IClassHierarchy cha,
  2. final String[] classNames) {
  3. if (scope == null) {
  4. throw new IllegalArgumentException("scope is null");
  5. }
  6. return makeMainEntrypoints(scope.getApplicationLoader(), cha, classNames);
  7. }

代码示例来源:origin: com.ibm.wala/com.ibm.wala.core

  1. public static Iterable<Entrypoint> makeMainEntrypoints(final AnalysisScope scope, final IClassHierarchy cha,
  2. final String[] classNames) {
  3. if (scope == null) {
  4. throw new IllegalArgumentException("scope is null");
  5. }
  6. return makeMainEntrypoints(scope.getApplicationLoader(), cha, classNames);
  7. }

代码示例来源:origin: wala/WALA

  1. /**
  2. * @return set of all eligible Main classes in the class hierarchy
  3. * @throws IllegalArgumentException if scope is null
  4. */
  5. public static Iterable<Entrypoint> makeMainEntrypoints(AnalysisScope scope, IClassHierarchy cha) {
  6. if (scope == null) {
  7. throw new IllegalArgumentException("scope is null");
  8. }
  9. return makeMainEntrypoints(scope.getApplicationLoader(), cha);
  10. }

代码示例来源:origin: wala/WALA

  1. @Override
  2. protected Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope, IClassHierarchy cha) {
  3. return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE, cha, mainClassDescriptors);
  4. }
  5. };

代码示例来源:origin: wala/WALA

  1. @Override
  2. protected Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope, IClassHierarchy cha) {
  3. return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE, cha, mainClassDescriptors);
  4. }
  5. };

代码示例来源:origin: com.ibm.wala/com.ibm.wala.core

  1. /**
  2. * @return set of all eligible Main classes in the class hierarchy
  3. * @throws IllegalArgumentException if scope is null
  4. */
  5. public static Iterable<Entrypoint> makeMainEntrypoints(AnalysisScope scope, IClassHierarchy cha) {
  6. if (scope == null) {
  7. throw new IllegalArgumentException("scope is null");
  8. }
  9. return makeMainEntrypoints(scope.getApplicationLoader(), cha);
  10. }

代码示例来源:origin: wala/WALA

  1. @Override
  2. protected Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope, IClassHierarchy cha) {
  3. return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE, cha, mainClassDescriptors);
  4. }

代码示例来源:origin: wala/WALA

  1. public static CallGraph testCHA(String scopeFile,
  2. String exclusionsFile,
  3. Function<IClassHierarchy, Iterable<Entrypoint>> makeEntrypoints)
  4. throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException
  5. {
  6. AnalysisScope scope = CallGraphTestUtil.makeJ2SEAnalysisScope(scopeFile, exclusionsFile);
  7. IClassHierarchy cha = ClassHierarchyFactory.make(scope);
  8. CHACallGraph CG = new CHACallGraph(cha);
  9. CG.init(makeEntrypoints.apply(cha));
  10. return CG;
  11. }

代码示例来源:origin: wala/WALA

  1. private static CallGraph staticCG(String mainClass, String exclusionsFile) throws IOException, ClassHierarchyException, IllegalArgumentException, CancelException {
  2. AnalysisScope scope = CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.WALA_TESTDATA, exclusionsFile != null? exclusionsFile: CallGraphTestUtil.REGRESSION_EXCLUSIONS);
  3. ClassHierarchy cha = ClassHierarchyFactory.make(scope);
  4. Iterable<Entrypoint> entrypoints = com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope, cha, mainClass);
  5. AnalysisOptions options = CallGraphTestUtil.makeAnalysisOptions(scope, entrypoints);
  6. return CallGraphTestUtil.buildZeroOneCFA(options, new AnalysisCacheImpl(), cha, scope, false);
  7. }

代码示例来源:origin: wala/WALA

  1. @Test public void testRecursion() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
  2. AnalysisScope scope = CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.WALA_TESTDATA,
  3. CallGraphTestUtil.REGRESSION_EXCLUSIONS);
  4. ClassHierarchy cha = ClassHierarchyFactory.make(scope);
  5. Iterable<Entrypoint> entrypoints = com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope, cha,
  6. TestConstants.RECURSE_MAIN);
  7. AnalysisOptions options = CallGraphTestUtil.makeAnalysisOptions(scope, entrypoints);
  8. doCallGraphs(options, new AnalysisCacheImpl(), cha, scope);
  9. }

代码示例来源:origin: wala/WALA

  1. @Test public void testBug144() throws IOException, ClassHierarchyException, IllegalArgumentException, CancelException {
  2. AnalysisScope scope = CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.WALA_TESTDATA, CallGraphTestUtil.REGRESSION_EXCLUSIONS);
  3. ClassHierarchy cha = ClassHierarchyFactory.make(scope);
  4. Iterable<Entrypoint> entrypoints = com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope, cha,
  5. "Lbug144/A");
  6. AnalysisOptions options = CallGraphTestUtil.makeAnalysisOptions(scope, entrypoints);
  7. @SuppressWarnings("unused")
  8. CallGraph cg = CallGraphTestUtil.buildZeroCFA(options, new AnalysisCacheImpl(), cha, scope, false);
  9. }

代码示例来源:origin: wala/WALA

  1. @Test public void testJLex() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
  2. AnalysisScope scope = CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.JLEX, CallGraphTestUtil.REGRESSION_EXCLUSIONS);
  3. ClassHierarchy cha = ClassHierarchyFactory.make(scope);
  4. Iterable<Entrypoint> entrypoints = com.ibm.wala.ipa.callgraph.impl.Util
  5. .makeMainEntrypoints(scope, cha, TestConstants.JLEX_MAIN);
  6. AnalysisOptions options = CallGraphTestUtil.makeAnalysisOptions(scope, entrypoints);
  7. doCallGraphs(options, new AnalysisCacheImpl(), cha, scope);
  8. }

代码示例来源:origin: wala/WALA

  1. @Test public void testBcelVerifier() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
  2. AnalysisScope scope = CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.BCEL, CallGraphTestUtil.REGRESSION_EXCLUSIONS);
  3. ClassHierarchy cha = ClassHierarchyFactory.make(scope);
  4. Iterable<Entrypoint> entrypoints = com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope, cha,
  5. TestConstants.BCEL_VERIFIER_MAIN);
  6. AnalysisOptions options = CallGraphTestUtil.makeAnalysisOptions(scope, entrypoints);
  7. // this speeds up the test
  8. options.setReflectionOptions(ReflectionOptions.NONE);
  9. doCallGraphs(options, new AnalysisCacheImpl(), cha, scope);
  10. }

代码示例来源:origin: wala/WALA

  1. @Test public void testJava_cup() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
  2. AnalysisScope scope = CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.JAVA_CUP, CallGraphTestUtil.REGRESSION_EXCLUSIONS);
  3. ClassHierarchy cha = ClassHierarchyFactory.make(scope);
  4. Iterable<Entrypoint> entrypoints = com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope, cha,
  5. TestConstants.JAVA_CUP_MAIN);
  6. AnalysisOptions options = CallGraphTestUtil.makeAnalysisOptions(scope, entrypoints);
  7. doCallGraphs(options, new AnalysisCacheImpl(), cha, scope, useShortProfile());
  8. }

代码示例来源:origin: wala/WALA

  1. @Test public void testHello() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
  2. if (analyzingJar()) return;
  3. AnalysisScope scope = CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.HELLO, CallGraphTestUtil.REGRESSION_EXCLUSIONS);
  4. ClassHierarchy cha = ClassHierarchyFactory.make(scope);
  5. Iterable<Entrypoint> entrypoints = com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope, cha,
  6. TestConstants.HELLO_MAIN);
  7. AnalysisOptions options = CallGraphTestUtil.makeAnalysisOptions(scope, entrypoints);
  8. doCallGraphs(options, new AnalysisCacheImpl(), cha, scope);
  9. }

代码示例来源:origin: wala/WALA

  1. private static Pair<CallGraph,PointerAnalysis<InstanceKey>> makeJavaBuilder(String scopeFile, String mainClass) throws IOException, ClassHierarchyException, IllegalArgumentException, CancelException {
  2. AnalysisScope scope = CallGraphTestUtil.makeJ2SEAnalysisScope(scopeFile, CallGraphTestUtil.REGRESSION_EXCLUSIONS);
  3. ClassHierarchy cha = ClassHierarchyFactory.make(scope);
  4. Iterable<Entrypoint> entrypoints = com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope, cha, mainClass);
  5. AnalysisOptions options = CallGraphTestUtil.makeAnalysisOptions(scope, entrypoints);
  6. SSAPropagationCallGraphBuilder builder = Util.makeZeroCFABuilder(Language.JAVA, options, new AnalysisCacheImpl(), cha, scope);
  7. CallGraph CG = builder.makeCallGraph(options);
  8. return Pair.make(CG, builder.getPointerAnalysis());
  9. }

代码示例来源:origin: wala/WALA

  1. private static CallGraph doGraph(boolean usePiNodes) throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
  2. AnalysisScope scope = CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.WALA_TESTDATA, CallGraphTestUtil.REGRESSION_EXCLUSIONS);
  3. ClassHierarchy cha = ClassHierarchyFactory.make(scope);
  4. Iterable<Entrypoint> entrypoints = com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope, cha,
  5. TestConstants.PI_TEST_MAIN);
  6. AnalysisOptions options = CallGraphTestUtil.makeAnalysisOptions(scope, entrypoints);
  7. SSAPiNodePolicy policy = usePiNodes ? SSAOptions.getAllBuiltInPiNodes() : null;
  8. options.getSSAOptions().setPiNodePolicy(policy);
  9. return CallGraphTestUtil.buildZeroCFA(options, new AnalysisCacheImpl(new DefaultIRFactory(), options.getSSAOptions()), cha, scope, false);
  10. }

相关文章