2007-02-02 17:25:09 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* Copyright (c) 2002 - 2006 IBM Corporation.
|
|
|
|
* All rights reserved. This program and the accompanying materials
|
|
|
|
* are made available under the terms of the Eclipse Public License v1.0
|
|
|
|
* which accompanies this distribution, and is available at
|
|
|
|
* http://www.eclipse.org/legal/epl-v10.html
|
|
|
|
*
|
|
|
|
* Contributors:
|
|
|
|
* IBM Corporation - initial API and implementation
|
|
|
|
*****************************************************************************/
|
|
|
|
package com.ibm.wala.cast.js.client.impl;
|
|
|
|
|
2007-02-08 19:07:30 +00:00
|
|
|
import com.ibm.wala.cast.ipa.callgraph.StandardFunctionTargetSelector;
|
2012-01-06 21:48:01 +00:00
|
|
|
import com.ibm.wala.cast.js.ipa.callgraph.JSAnalysisOptions;
|
2007-11-16 20:57:58 +00:00
|
|
|
import com.ibm.wala.cast.js.ipa.callgraph.JSZeroOrOneXCFABuilder;
|
2007-07-20 15:20:23 +00:00
|
|
|
import com.ibm.wala.ipa.callgraph.AnalysisCache;
|
2007-02-08 19:07:30 +00:00
|
|
|
import com.ibm.wala.ipa.callgraph.AnalysisScope;
|
|
|
|
import com.ibm.wala.ipa.callgraph.CallGraphBuilder;
|
|
|
|
import com.ibm.wala.ipa.callgraph.propagation.cfa.ZeroXInstanceKeys;
|
2007-06-01 03:32:56 +00:00
|
|
|
import com.ibm.wala.ipa.cha.IClassHierarchy;
|
2007-02-02 17:25:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Julian Dolby (dolby@us.ibm.com)
|
|
|
|
*
|
|
|
|
* A factory to create call graph builders using 0-CFA
|
|
|
|
*/
|
2008-01-24 22:38:50 +00:00
|
|
|
public class ZeroCFABuilderFactory {
|
2007-02-02 17:25:09 +00:00
|
|
|
|
2012-01-06 21:48:01 +00:00
|
|
|
public CallGraphBuilder make(JSAnalysisOptions options, AnalysisCache cache, IClassHierarchy cha, AnalysisScope scope,
|
2007-07-20 15:20:23 +00:00
|
|
|
boolean keepPointsTo) {
|
2007-07-06 22:09:08 +00:00
|
|
|
com.ibm.wala.ipa.callgraph.impl.Util.addDefaultSelectors(options, cha);
|
2007-02-02 17:25:09 +00:00
|
|
|
options.setSelector(new StandardFunctionTargetSelector(cha, options.getMethodTargetSelector()));
|
|
|
|
|
2010-05-12 17:19:54 +00:00
|
|
|
return new JSZeroOrOneXCFABuilder(cha, options, cache, null, null, ZeroXInstanceKeys.NONE, false);
|
2007-02-02 17:25:09 +00:00
|
|
|
}
|
|
|
|
}
|