Package proguard.analysis.cpa.defaults
Class Cfa<CfaNodeT extends CfaNode<CfaEdgeT,SignatureT>,CfaEdgeT extends CfaEdge<CfaNodeT>,SignatureT extends Signature>
java.lang.Object
proguard.analysis.cpa.defaults.Cfa<CfaNodeT,CfaEdgeT,SignatureT>
- Direct Known Subclasses:
JvmCfa
public abstract class Cfa<CfaNodeT extends CfaNode<CfaEdgeT,SignatureT>,CfaEdgeT extends CfaEdge<CfaNodeT>,SignatureT extends Signature>
extends Object
A
Cfa is a control flow automaton with nodes <CfaNodeT> and edges
<CfaEdgeT>. It can be used for different programming languages with functions identified by
<SignatureT>.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFunctionEntryNode(SignatureT signature, CfaNodeT node) Add an entry node to the graph for a specified function (with offset 0).voidaddFunctionNode(SignatureT signature, CfaNodeT node, int offset) Add a node to the graph for a specified function.Returns a stream of all the nodes present in the graph.getFunctionEntryNode(SignatureT signature) Returns the entry node of a specific function (with offset 0), returns null if the function or its entry node are not in the graph.Returns a collection of the entry nodes (with offset 0) of all the functions present in the graph, returns an empty collection if the graph is empty.getFunctionNode(Clazz clazz, Method method, int offset) Returns the node of a function at a specific code offset, returns null if the function or the specific node are not in the graph.getFunctionNode(SignatureT signature, int offset) Returns the node of a function at a specific code offset, returns null if the function or the specific node are not in the graph.getFunctionNodes(SignatureT signature) Returns all the nodes of a specific function, returns an empty collection if the function is not in the graph or if it has no nodes.booleanisEmpty()Returns true if there are no nodes in the CFA, false otherwise.
-
Field Details
-
functionNodes
protected final Map<SignatureT extends Signature,Map<Integer, functionNodesCfaNodeT extends CfaNode<CfaEdgeT, SignatureT>>>
-
-
Constructor Details
-
Cfa
public Cfa()
-
-
Method Details
-
isEmpty
public boolean isEmpty()Returns true if there are no nodes in the CFA, false otherwise. -
getAllNodes
Returns a stream of all the nodes present in the graph.Note: a
Streamis provided to avoid creating new collections unnecessarily. -
getFunctionEntryNodes
Returns a collection of the entry nodes (with offset 0) of all the functions present in the graph, returns an empty collection if the graph is empty. -
getFunctionEntryNode
Returns the entry node of a specific function (with offset 0), returns null if the function or its entry node are not in the graph.- Parameters:
signature- The signature of the function.
-
getFunctionNodes
Returns all the nodes of a specific function, returns an empty collection if the function is not in the graph or if it has no nodes.- Parameters:
signature- The signature of the function.
-
getFunctionNode
Returns the node of a function at a specific code offset, returns null if the function or the specific node are not in the graph.- Parameters:
signature- The signature of the function.offset- The offset of the code location represented by the node.
-
getFunctionNode
Returns the node of a function at a specific code offset, returns null if the function or the specific node are not in the graph. -
addFunctionEntryNode
Add an entry node to the graph for a specified function (with offset 0).- Parameters:
signature- The signature of the function,.node- The entry node to add.
-
addFunctionNode
Add a node to the graph for a specified function.- Parameters:
signature- The signature of the function.node- The node to add.
-