Class Util
java.lang.Object
com.ibm.wala.ipa.callgraph.impl.Util
Call graph utilities
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddBypassLogic(AnalysisOptions options, ClassLoader cl, XMLMethodSummaryReader summary, IClassHierarchy cha) static voidaddBypassLogic(AnalysisOptions options, ClassLoader cl, String xmlFile, IClassHierarchy cha) Modify an options object to include bypass logic as specified by a an XML file.static voidaddDefaultBypassLogic(AnalysisOptions options, ClassLoader cl, IClassHierarchy cha) static voidaddDefaultSelectors(AnalysisOptions options, IClassHierarchy cha) Set up an AnalysisOptions object with default selectors, corresponding to class hierarchy lookupstatic voidaddSummaryClassShells(SummaryClassShellLoader loader, XMLMethodSummaryReader summary) Materialize class shells for the summary-modeled classes that opt in by declaring a superclass (seeXMLMethodSummaryReader.getClassSuperclasses()), registering each intoloader.static <T> voidcheckGraphSubset(Graph<T> supG, Graph<T> subG) static Stringstatic Iterable<Entrypoint> static Iterable<Entrypoint> makeMainEntrypoints(IClassHierarchy cha, String className) static Iterable<Entrypoint> makeMainEntrypoints(IClassHierarchy cha, String[] classNames) static Iterable<Entrypoint> static Iterable<Entrypoint> makeMainEntrypoints(ClassLoaderReference loaderRef, IClassHierarchy cha, String[] classNames) makeNCFABuilder(int n, Language l, AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha) make aCallGraphBuilderthat uses call-string context sensitivity, with call-string length limited to n, and a context-sensitive allocation-site-based heap abstraction.makeNObjBuilder(int n, AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha) make aCallGraphBuilderthat uses object context sensitivity, with allocation-string length limited to nstatic CallGraphBuilder<InstanceKey> makeRTABuilder(AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha) makeVanillaNCFABuilder(int n, AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha) make aCallGraphBuilderthat uses call-string context sensitivity, with call-string length limited to n, and a context-sensitive allocation-site-based heap abstraction.makeVanillaNObjBuilder(int n, AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha) make aCallGraphBuilderthat uses object context sensitivity, with allocation-string length limited to nmakeVanillaZeroOneCFABuilder(Language l, AnalysisOptions options, IAnalysisCacheView analysisCache, IClassHierarchy cha) makeVanillaZeroOneCFABuilder(Language l, AnalysisOptions options, IAnalysisCacheView analysisCache, IClassHierarchy cha, ContextSelector customSelector, SSAContextInterpreter customInterpreter) makeVanillaZeroOneContainerCFABuilder(AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha) makeZeroCFABuilder(Language l, AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha) makeZeroCFABuilder(Language l, AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha, ContextSelector customSelector, SSAContextInterpreter customInterpreter) makeZeroContainerCFABuilder(AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha) makeZeroOneCFABuilder(Language l, AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha) makeZeroOneCFABuilder(Language l, AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha, ContextSelector customSelector, SSAContextInterpreter customInterpreter) makeZeroOneContainerCFABuilder(AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha) makeZeroOneContainerCFABuilder(AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha, ContextSelector appSelector, SSAContextInterpreter appInterpreter) static <T> Set<T> create a set holding the contents of anIteratorstatic voidsetNativeSpec(String xmlFile)
-
Field Details
-
nativeSpec
TODO: Make these properties?
-
-
Constructor Details
-
Util
public Util()
-
-
Method Details
-
setNativeSpec
-
getNativeSpec
-
addDefaultSelectors
Set up an AnalysisOptions object with default selectors, corresponding to class hierarchy lookup- Throws:
IllegalArgumentException- if options is null
-
addBypassLogic
public static void addBypassLogic(AnalysisOptions options, ClassLoader cl, String xmlFile, IClassHierarchy cha) throws IllegalArgumentException Modify an options object to include bypass logic as specified by a an XML file.- Throws:
IllegalArgumentException- if scope is nullIllegalArgumentException- if cl is nullIllegalArgumentException- if options is nullIllegalArgumentException- if scope is null
-
addBypassLogic
public static void addBypassLogic(AnalysisOptions options, ClassLoader cl, XMLMethodSummaryReader summary, IClassHierarchy cha) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
addSummaryClassShells
public static void addSummaryClassShells(SummaryClassShellLoader loader, XMLMethodSummaryReader summary) Materialize class shells for the summary-modeled classes that opt in by declaring a superclass (seeXMLMethodSummaryReader.getClassSuperclasses()), registering each intoloader. Only the classes whose declaring loader isloaderare registered.Call this before building the
IClassHierarchy(and before translating source classes that subclass a summary-modeled type), so that those subclasses resolve their base at definition time rather than falling back to the language root. See #1957.- Throws:
IllegalArgumentException- ifloaderorsummaryis null
-
makeMainEntrypoints
- Returns:
- set of all eligible Main classes in the class hierarchy
- Throws:
IllegalArgumentException- if scope is null
-
makeMainEntrypoints
public static Iterable<Entrypoint> makeMainEntrypoints(ClassLoaderReference clr, IClassHierarchy cha) -
makeMainEntrypoints
- Returns:
- Entrypoints for a set of J2SE Main classes
-
makeMainEntrypoints
- Returns:
- Entrypoints for a set of J2SE Main classes
-
makeMainEntrypoints
public static Iterable<Entrypoint> makeMainEntrypoints(ClassLoaderReference loaderRef, IClassHierarchy cha, String[] classNames) throws IllegalArgumentException - Returns:
- Entrypoints for a set of J2SE Main classes
- Throws:
IllegalArgumentException- if classNames == nullIllegalArgumentException- if (classNames != null) and (0 < classNames.length) and (classNames[0] == null)IllegalArgumentException- if classNames.length == 0
-
setify
-
checkGraphSubset
- Throws:
IllegalArgumentException- if subG is nullIllegalArgumentException- if supG is null
-
makeRTABuilder
public static CallGraphBuilder<InstanceKey> makeRTABuilder(AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha) - Parameters:
options- options that govern call graph constructioncha- governing class hierarchy- Returns:
- an RTA Call Graph builder.
-
makeZeroCFABuilder
public static SSAPropagationCallGraphBuilder makeZeroCFABuilder(Language l, AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha) - Parameters:
options- options that govern call graph constructioncha- governing class hierarchy- Returns:
- a 0-CFA Call Graph Builder.
-
makeZeroCFABuilder
public static SSAPropagationCallGraphBuilder makeZeroCFABuilder(Language l, AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha, ContextSelector customSelector, SSAContextInterpreter customInterpreter) - Parameters:
options- options that govern call graph constructioncha- governing class hierarchycustomSelector- user-defined context selector, or null if nonecustomInterpreter- user-defined context interpreter, or null if none- Returns:
- a 0-CFA Call Graph Builder.
- Throws:
IllegalArgumentException- if options is null
-
makeZeroOneCFABuilder
public static SSAPropagationCallGraphBuilder makeZeroOneCFABuilder(Language l, AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha) - Parameters:
options- options that govern call graph constructioncha- governing class hierarchy- Returns:
- a 0-1-CFA Call Graph Builder.
-
makeVanillaZeroOneCFABuilder
public static SSAPropagationCallGraphBuilder makeVanillaZeroOneCFABuilder(Language l, AnalysisOptions options, IAnalysisCacheView analysisCache, IClassHierarchy cha, ContextSelector customSelector, SSAContextInterpreter customInterpreter) - Parameters:
options- options that govern call graph constructioncha- governing class hierarchycustomSelector- user-defined context selector, or null if nonecustomInterpreter- user-defined context interpreter, or null if none- Returns:
- a 0-1-CFA Call Graph Builder.
- Throws:
IllegalArgumentException- if options is null
-
makeVanillaZeroOneCFABuilder
public static SSAPropagationCallGraphBuilder makeVanillaZeroOneCFABuilder(Language l, AnalysisOptions options, IAnalysisCacheView analysisCache, IClassHierarchy cha) - Parameters:
options- options that govern call graph constructioncha- governing class hierarchy- Returns:
- a 0-1-CFA Call Graph Builder.
-
makeZeroOneCFABuilder
public static SSAPropagationCallGraphBuilder makeZeroOneCFABuilder(Language l, AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha, ContextSelector customSelector, SSAContextInterpreter customInterpreter) - Parameters:
options- options that govern call graph constructioncha- governing class hierarchycustomSelector- user-defined context selector, or null if nonecustomInterpreter- user-defined context interpreter, or null if none- Returns:
- a 0-1-CFA Call Graph Builder.
- Throws:
IllegalArgumentException- if options is null
-
makeZeroContainerCFABuilder
public static SSAPropagationCallGraphBuilder makeZeroContainerCFABuilder(AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha) - Parameters:
options- options that govern call graph constructioncha- governing class hierarchy- Returns:
- a 0-CFA Call Graph Builder augmented with extra logic for containers
- Throws:
IllegalArgumentException- if options is null
-
makeZeroOneContainerCFABuilder
public static SSAPropagationCallGraphBuilder makeZeroOneContainerCFABuilder(AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha) - Parameters:
options- options that govern call graph constructioncha- governing class hierarchy- Returns:
- a 0-1-CFA Call Graph Builder augmented with extra logic for containers
- Throws:
IllegalArgumentException- if options is null
-
makeZeroOneContainerCFABuilder
public static SSAPropagationCallGraphBuilder makeZeroOneContainerCFABuilder(AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha, ContextSelector appSelector, SSAContextInterpreter appInterpreter) -
makeNCFABuilder
public static SSAPropagationCallGraphBuilder makeNCFABuilder(int n, Language l, AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha) make aCallGraphBuilderthat uses call-string context sensitivity, with call-string length limited to n, and a context-sensitive allocation-site-based heap abstraction. -
makeNObjBuilder
public static SSAPropagationCallGraphBuilder makeNObjBuilder(int n, AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha) make aCallGraphBuilderthat uses object context sensitivity, with allocation-string length limited to n -
makeVanillaNObjBuilder
public static SSAPropagationCallGraphBuilder makeVanillaNObjBuilder(int n, AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha) make aCallGraphBuilderthat uses object context sensitivity, with allocation-string length limited to n -
makeVanillaNCFABuilder
public static SSAPropagationCallGraphBuilder makeVanillaNCFABuilder(int n, AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha) make aCallGraphBuilderthat uses call-string context sensitivity, with call-string length limited to n, and a context-sensitive allocation-site-based heap abstraction. Standard optimizations in the heap abstraction like smushing of strings are disabled. -
makeVanillaZeroOneContainerCFABuilder
public static SSAPropagationCallGraphBuilder makeVanillaZeroOneContainerCFABuilder(AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha) - Parameters:
options- options that govern call graph constructioncha- governing class hierarchy- Returns:
- a 0-1-CFA Call Graph Builder augmented with extra logic for containers
- Throws:
IllegalArgumentException- if options is null
-
addDefaultBypassLogic
public static void addDefaultBypassLogic(AnalysisOptions options, ClassLoader cl, IClassHierarchy cha)
-