Package sootup.core.graph
Class ForwardingStmtGraph<V extends BasicBlock<V>>
java.lang.Object
sootup.core.graph.StmtGraph<V>
sootup.core.graph.ForwardingStmtGraph<V>
- Direct Known Subclasses:
BackwardsStmtGraph
forwarding implementation for encapsulating a StmtGraph.
- Author:
- Markus Schmidt
-
Nested Class Summary
Nested classes/interfaces inherited from class sootup.core.graph.StmtGraph
StmtGraph.BlockGraphIterator, StmtGraph.BlockGraphIteratorAndTrapAggregator
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionreturns a (reconstructed) list of traps like the traptable in the bytecodeboolean
containsNode
(Stmt node) int
returns the amount of flows with node as source or target.exceptionalPredecessors
(Stmt node) it is possible to reach traphandlers through inline code i.e.exceptionalSuccessors
(Stmt node) BasicBlock<?>
getBlockOf
(Stmt stmt) Collection<? extends BasicBlock<?>>
List<? extends BasicBlock<?>>
getNodes()
returns the nodes in this graph in a non-deterministic order (->Set) to get the nodes in linearized, ordered manner use iterator() or getStmts.BasicBlock<?>
boolean
hasEdgeConnecting
(Stmt from, Stmt to) returns true if there is a flow between source and target throws an Exception if at least one of the parameters is not contained in the graph.int
returns the amount of ingoing flows into nodeiterator()
int
returns the amount of flows that start from nodepredecessors
(Stmt stmt) returns the ingoing flows to node as an List with no reliable/specific order and possibly duplicate entries i.e.void
removeExceptionalFlowFromAllBlocks
(ClassType exceptionType, Stmt exceptionHandlerStmt) Removes the specified exceptional flow from all blocks.successors
(Stmt stmt) returns the outgoing flows of node as ordered List.Methods inherited from class sootup.core.graph.StmtGraph
equals, getAllSuccessors, getBlockIterator, getBranchTargetsOf, getEntrypoints, getExtendedBasicBlockPathBetween, getLabeledStmts, getStmts, getTails, isStmtBranchTarget, toString, validateStmtConnectionsInGraph
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
backingGraph
-
-
Constructor Details
-
ForwardingStmtGraph
-
-
Method Details
-
getStartingStmt
- Specified by:
getStartingStmt
in classStmtGraph<V extends BasicBlock<V>>
-
getStartingStmtBlock
- Specified by:
getStartingStmtBlock
in classStmtGraph<V extends BasicBlock<V>>
-
getBlockOf
- Specified by:
getBlockOf
in classStmtGraph<V extends BasicBlock<V>>
-
getNodes
Description copied from class:StmtGraph
returns the nodes in this graph in a non-deterministic order (->Set) to get the nodes in linearized, ordered manner use iterator() or getStmts.- Specified by:
getNodes
in classStmtGraph<V extends BasicBlock<V>>
-
getBlocks
- Specified by:
getBlocks
in classStmtGraph<V extends BasicBlock<V>>
-
getBlocksSorted
- Specified by:
getBlocksSorted
in classStmtGraph<V extends BasicBlock<V>>
-
containsNode
- Specified by:
containsNode
in classStmtGraph<V extends BasicBlock<V>>
-
predecessors
Description copied from class:StmtGraph
returns the ingoing flows to node as an List with no reliable/specific order and possibly duplicate entries i.e. if a JSwitchStmt has multiple cases that brnach to `node`- Specified by:
predecessors
in classStmtGraph<V extends BasicBlock<V>>
-
exceptionalPredecessors
Description copied from class:StmtGraph
it is possible to reach traphandlers through inline code i.e. without any exceptional flow- Specified by:
exceptionalPredecessors
in classStmtGraph<V extends BasicBlock<V>>
-
successors
Description copied from class:StmtGraph
returns the outgoing flows of node as ordered List. The List can have duplicate entries!- Specified by:
successors
in classStmtGraph<V extends BasicBlock<V>>
-
exceptionalSuccessors
- Specified by:
exceptionalSuccessors
in classStmtGraph<V extends BasicBlock<V>>
-
degree
Description copied from class:StmtGraph
returns the amount of flows with node as source or target.- Overrides:
degree
in classStmtGraph<V extends BasicBlock<V>>
-
inDegree
Description copied from class:StmtGraph
returns the amount of ingoing flows into node- Specified by:
inDegree
in classStmtGraph<V extends BasicBlock<V>>
-
outDegree
Description copied from class:StmtGraph
returns the amount of flows that start from node- Specified by:
outDegree
in classStmtGraph<V extends BasicBlock<V>>
-
hasEdgeConnecting
Description copied from class:StmtGraph
returns true if there is a flow between source and target throws an Exception if at least one of the parameters is not contained in the graph.- Specified by:
hasEdgeConnecting
in classStmtGraph<V extends BasicBlock<V>>
-
iterator
- Specified by:
iterator
in interfaceIterable<V extends BasicBlock<V>>
- Overrides:
iterator
in classStmtGraph<V extends BasicBlock<V>>
-
buildTraps
Description copied from class:StmtGraph
returns a (reconstructed) list of traps like the traptable in the bytecodeNote: if you need exceptionional flow information in more augmented with the affected blocks/stmts and not just a (reconstructed, possibly more verbose) traptable - have a look at BasicBlock.getExceptionalSuccessor()
- Specified by:
buildTraps
in classStmtGraph<V extends BasicBlock<V>>
-
removeExceptionalFlowFromAllBlocks
public void removeExceptionalFlowFromAllBlocks(@Nonnull ClassType exceptionType, @Nonnull Stmt exceptionHandlerStmt) Description copied from class:StmtGraph
Removes the specified exceptional flow from all blocks.- Specified by:
removeExceptionalFlowFromAllBlocks
in classStmtGraph<V extends BasicBlock<V>>
- Parameters:
exceptionType
- The class type of the exceptional flow.exceptionHandlerStmt
- The handler statement of the exceptional flow.
-