Interface Solver
- All Known Implementing Classes:
DefaultSolver
public interface Solver
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCallEdge
(Edge<CSCallSite, CSMethod> edge) Adds a call edge.void
addCSMethod
(CSMethod csMethod) Adds a context-sensitive method.void
addEntryPoint
(EntryPoint entryPoint) Adds an entry point.void
addIgnoredMethod
(JMethod method) If a plugin takes over the analysis of a method, and wants this solver to ignore the method (for precision and/or efficiency reasons), then it could call this API with the method.default void
addPFGEdge
(Pointer source, Pointer target, FlowKind kind) Adds an edge "source -> target" to the PFG.void
addPFGEdge
(Pointer source, Pointer target, FlowKind kind, Transfer transfer) Adds an edge "source -> target" (with edge transfer) to the PFG.default void
addPFGEdge
(Pointer source, Pointer target, FlowKind kind, Type type) Adds an edge "source -> target" to the PFG.void
addPointerFilter
(Pointer pointer, Predicate<CSObj> filter) Adds an object filter to given pointer.void
addPointsTo
(Pointer pointer, Context heapContext, Obj obj) void
addPointsTo
(Pointer pointer, CSObj csObj) default void
addPointsTo
(Pointer pointer, Obj obj) Convenient API to add points-to relation for object with empty heap context.void
addPointsTo
(Pointer pointer, PointsToSet pts) void
addStmts
(CSMethod csMethod, Collection<Stmt> stmts) Adds stmts to the analyzed program.void
addVarPointsTo
(Context context, Var var, Context heapContext, Obj obj) void
addVarPointsTo
(Context context, Var var, CSObj csObj) default void
addVarPointsTo
(Context context, Var var, Obj obj) Convenient API to add var points-to relation for object with empty heap context.void
addVarPointsTo
(Context context, Var var, PointsToSet pts) getPointsToSetOf
(Pointer pointer) Returns the points-to set of given pointer.void
initializeClass
(JClass cls) Analyzes the static initializer (i.e., <clinit>) of given class.Creates a new empty points-to set.void
Sets plugin to this solver.void
solve()
Starts this solver.
-
Method Details
-
getOptions
AnalysisOptions getOptions() -
getHierarchy
ClassHierarchy getHierarchy() -
getTypeSystem
TypeSystem getTypeSystem() -
getHeapModel
HeapModel getHeapModel() -
getCSManager
CSManager getCSManager() -
getContextSelector
ContextSelector getContextSelector() -
getCallGraph
CallGraph<CSCallSite,CSMethod> getCallGraph() -
getPointsToSetOf
Returns the points-to set of given pointer. If the pointer has not been associated with a points-to set, this method will create a new set and associate it with the pointer. -
makePointsToSet
PointsToSet makePointsToSet()Creates a new empty points-to set. -
setPlugin
Sets plugin to this solver. -
solve
void solve()Starts this solver. -
addPointsTo
-
addPointsTo
-
addPointsTo
-
addPointsTo
Convenient API to add points-to relation for object with empty heap context. -
addVarPointsTo
-
addVarPointsTo
-
addVarPointsTo
-
addVarPointsTo
Convenient API to add var points-to relation for object with empty heap context. -
addPointerFilter
Adds an object filter to given pointer. Note that the filter works only after it is added to the pointer, and it cannot filter out the objects pointed to by the pointer before it is added. -
addPFGEdge
Adds an edge "source -> target" to the PFG. -
addPFGEdge
Adds an edge "source -> target" to the PFG. For the objects pointed to by "source", only the ones whose types are subtypes of given type are propagated to "target". -
addPFGEdge
Adds an edge "source -> target" (with edge transfer) to the PFG. -
addEntryPoint
Adds an entry point. Notes that the method in entry point will be set as an entry inCallGraph
-
addCallEdge
Adds a call edge.- Parameters:
edge
- the added edge.
-
addCSMethod
Adds a context-sensitive method.- Parameters:
csMethod
- the added context-sensitive method.
-
addStmts
Adds stmts to the analyzed program. Solver will process given stmts.- Parameters:
csMethod
- the container method of the stmtsstmts
- the added stmts
-
addIgnoredMethod
If a plugin takes over the analysis of a method, and wants this solver to ignore the method (for precision and/or efficiency reasons), then it could call this API with the method. After that, this solver will not process the method body.Typically, this API should be called at the initial stage of pointer analysis, i.e., in
Plugin.onStart()
.- Parameters:
method
- the method to be ignored.
-
initializeClass
Analyzes the static initializer (i.e., <clinit>) of given class.- Parameters:
cls
- the class to be initialized.
-
getResult
PointerAnalysisResult getResult()- Returns:
- pointer analysis result.
-