fix compile error
[walaincubator.git] / com.ibm.wala.eclipse / src / com / ibm / wala / eclipse / cg / model / WalaJarFileCGModelWithMain.java
blobd5f4c6e7214d2c3e54eefc104db9cd8bb9e53479
1 /*******************************************************************************
2 * Copyright (c) 2002 - 2006 IBM Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
8 * Contributors:
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package com.ibm.wala.eclipse.cg.model;
13 import java.util.Collection;
15 import com.ibm.wala.cast.ir.ssa.AstIRFactory;
16 import com.ibm.wala.eclipse.util.CancelException;
17 import com.ibm.wala.ipa.callgraph.*;
18 import com.ibm.wala.ipa.callgraph.impl.Util;
19 import com.ibm.wala.ipa.cha.ClassHierarchy;
20 import com.ibm.wala.ipa.cha.IClassHierarchy;
21 import com.ibm.wala.util.graph.InferGraphRoots;
22 import com.ibm.wala.util.warnings.WalaException;
24 /**
25 * @author aying
27 public class WalaJarFileCGModelWithMain extends WalaJarFileCGModel {
30 * @see WalaCGModel
32 public WalaJarFileCGModelWithMain(String appJar) {
33 super(appJar);
36 /**
37 * @see SWTCallGraph
39 @Override
40 protected CallGraph createCallGraph(AnalysisScope scope) throws WalaException, CancelException {
42 IClassHierarchy cha = ClassHierarchy.make(scope);
44 Iterable<Entrypoint> entrypoints = com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope, cha);
45 AnalysisOptions options = new AnalysisOptions(scope, entrypoints);
47 // //
48 // build the call graph
49 // //
50 com.ibm.wala.ipa.callgraph.CallGraphBuilder builder = Util.makeZeroCFABuilder(options, new AnalysisCache(AstIRFactory
51 .makeDefaultFactory(true)), cha, scope, null, null);
52 CallGraph cg = builder.makeCallGraph(options, null);
53 return cg;
56 /**
57 * @see SWTCallGraph
59 @Override
60 protected Collection inferRoots(CallGraph cg) throws WalaException {
61 return InferGraphRoots.inferRoots(cg);