Package com.ibm.wala.ipa.callgraph.impl
Class Util
- java.lang.Object
-
- com.ibm.wala.ipa.callgraph.impl.Util
-
public class Util extends Object
Call graph utilities
-
-
Field Summary
Fields Modifier and Type Field Description static String
nativeSpec
TODO: Make these properties?
-
Constructor Summary
Constructors Constructor Description Util()
-
Method Summary
-
-
-
Field Detail
-
nativeSpec
public static String nativeSpec
TODO: Make these properties?
-
-
Method Detail
-
setNativeSpec
public static void setNativeSpec(String xmlFile)
BEGIN Custom change: change native spec
-
getNativeSpec
public static String getNativeSpec()
-
addDefaultSelectors
public static void addDefaultSelectors(AnalysisOptions options, IClassHierarchy cha)
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, AnalysisScope scope, 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, AnalysisScope scope, ClassLoader cl, XMLMethodSummaryReader summary, IClassHierarchy cha) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
makeMainEntrypoints
public static Iterable<Entrypoint> makeMainEntrypoints(AnalysisScope scope, IClassHierarchy cha)
- Parameters:
scope
-cha
-- 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
public static Iterable<Entrypoint> makeMainEntrypoints(AnalysisScope scope, IClassHierarchy cha, String className)
- Returns:
- Entrypoints object for a Main J2SE class
-
makeMainEntrypoints
public static Iterable<Entrypoint> makeMainEntrypoints(AnalysisScope scope, IClassHierarchy cha, String[] classNames)
-
makeMainEntrypoints
public static Iterable<Entrypoint> makeMainEntrypoints(ClassLoaderReference loaderRef, IClassHierarchy cha, String[] classNames) throws IllegalArgumentException, IllegalArgumentException, 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
public static <T> Set<T> setify(Iterator<? extends T> x)
create a set holding the contents of anIterator
-
checkGraphSubset
public static <T> void checkGraphSubset(Graph<T> supG, Graph<T> subG)
- Parameters:
supG
-subG
-- Throws:
IllegalArgumentException
- if subG is nullIllegalArgumentException
- if supG is null
-
makeRTABuilder
public static CallGraphBuilder makeRTABuilder(AnalysisOptions options, AnalysisCache cache, IClassHierarchy cha, AnalysisScope scope)
- Parameters:
options
- options that govern call graph constructioncha
- governing class hierarchyscope
- representation of the analysis scope- Returns:
- an RTA Call Graph builder.
-
makeZeroCFABuilder
public static SSAPropagationCallGraphBuilder makeZeroCFABuilder(AnalysisOptions options, AnalysisCache cache, IClassHierarchy cha, AnalysisScope scope)
- Parameters:
options
- options that govern call graph constructioncha
- governing class hierarchyscope
- representation of the analysis scope- Returns:
- a 0-CFA Call Graph Builder.
-
makeZeroCFABuilder
public static SSAPropagationCallGraphBuilder makeZeroCFABuilder(AnalysisOptions options, AnalysisCache cache, IClassHierarchy cha, AnalysisScope scope, ContextSelector customSelector, SSAContextInterpreter customInterpreter)
- Parameters:
options
- options that govern call graph constructioncha
- governing class hierarchyscope
- representation of the analysis scopecustomSelector
- 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(AnalysisOptions options, AnalysisCache cache, IClassHierarchy cha, AnalysisScope scope)
- Parameters:
options
- options that govern call graph constructioncha
- governing class hierarchyscope
- representation of the analysis scope- Returns:
- a 0-1-CFA Call Graph Builder.
-
makeVanillaZeroOneCFABuilder
public static SSAPropagationCallGraphBuilder makeVanillaZeroOneCFABuilder(AnalysisOptions options, AnalysisCache cache, IClassHierarchy cha, AnalysisScope scope, ContextSelector customSelector, SSAContextInterpreter customInterpreter)
- Parameters:
options
- options that govern call graph constructioncha
- governing class hierarchyscope
- representation of the analysis scopecustomSelector
- 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(AnalysisOptions options, AnalysisCache cache, IClassHierarchy cha, AnalysisScope scope)
- Parameters:
options
- options that govern call graph constructioncha
- governing class hierarchyscope
- representation of the analysis scope- Returns:
- a 0-1-CFA Call Graph Builder.
-
makeZeroOneCFABuilder
public static SSAPropagationCallGraphBuilder makeZeroOneCFABuilder(AnalysisOptions options, AnalysisCache cache, IClassHierarchy cha, AnalysisScope scope, ContextSelector customSelector, SSAContextInterpreter customInterpreter)
- Parameters:
options
- options that govern call graph constructioncha
- governing class hierarchyscope
- representation of the analysis scopecustomSelector
- 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, AnalysisCache cache, IClassHierarchy cha, AnalysisScope scope)
- Parameters:
options
- options that govern call graph constructioncha
- governing class hierarchyscope
- representation of the analysis scope- 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, AnalysisCache cache, IClassHierarchy cha, AnalysisScope scope)
- Parameters:
options
- options that govern call graph constructioncha
- governing class hierarchyscope
- representation of the analysis scope- 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, AnalysisCache cache, IClassHierarchy cha, AnalysisScope scope, ContextSelector appSelector, SSAContextInterpreter appInterpreter)
-
makeNCFABuilder
public static SSAPropagationCallGraphBuilder makeNCFABuilder(int n, AnalysisOptions options, AnalysisCache cache, IClassHierarchy cha, AnalysisScope scope)
make aCallGraphBuilder
that uses call-string context sensitivity, with call-string length limited to n, and a context-sensitive allocation-site-based heap abstraction.
-
makeVanillaNCFABuilder
public static SSAPropagationCallGraphBuilder makeVanillaNCFABuilder(int n, AnalysisOptions options, AnalysisCache cache, IClassHierarchy cha, AnalysisScope scope)
make aCallGraphBuilder
that 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, AnalysisCache cache, IClassHierarchy cha, AnalysisScope scope)
- Parameters:
options
- options that govern call graph constructioncha
- governing class hierarchyscope
- representation of the analysis scope- 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, AnalysisScope scope, ClassLoader cl, IClassHierarchy cha)
-
-