Package sootup.core.graph
Class MutableBasicBlockImpl
java.lang.Object
sootup.core.graph.MutableBasicBlockImpl
- All Implemented Interfaces:
BasicBlock<MutableBasicBlock>
,MutableBasicBlock
-
Constructor Summary
ConstructorDescriptionMutableBasicBlockImpl
(List<Stmt> stmts, Map<ClassType, MutableBasicBlock> exceptionMap) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
void
void
void
copyExceptionalFlowFrom
(MutableBasicBlock sourceBlock) boolean
getHead()
int
getStmts()
getTail()
void
linkExceptionalSuccessorBlock
(ClassType exception, MutableBasicBlock b) void
linkSuccessor
(int successorIdx, MutableBasicBlock blockB) makes blockA the predecessor of BlockB and BlockB the Successor of BlockA in a combined Methodvoid
removeExceptionalSuccessorBlock
(ClassType exception) void
boolean
void
removeStmt
(int idx) void
removeStmt
(Stmt stmt) boolean
replacePredecessorBlock
(MutableBasicBlock oldBlock, MutableBasicBlock newBlock) void
replaceStmt
(int idx, Stmt newStmt) void
replaceStmt
(Stmt oldStmt, Stmt newStmt) replaceSuccessorBlock
(MutableBasicBlock oldBlock, MutableBasicBlock newBlock) set newBlock to null to unset..void
setSuccessorBlock
(int successorIdx, MutableBasicBlock block) splitBlockLinked
(int splitIdx) splitBlockLinked
(Stmt splitStmt, boolean shouldBeNewHead) splits a BasicBlock into first|second we know splitStmt must be a FallsThroughStmtsplitBlockUnlinked
(int splitIdx) splitBlockUnlinked
(Stmt newTail, Stmt newHead) splits a single MutableBasicBlock into two at splitIndex position, so that the Stmt at the splitIdx is the Head of the second MutableBasicBlock.toString()
protected void
updateSuccessorContainer
(Stmt newStmt) Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface sootup.core.graph.BasicBlock
equivTo, isEmpty
-
Constructor Details
-
MutableBasicBlockImpl
public MutableBasicBlockImpl() -
MutableBasicBlockImpl
-
-
Method Details
-
equals
-
addStmt
- Specified by:
addStmt
in interfaceMutableBasicBlock
-
removeStmt
public void removeStmt(int idx) - Specified by:
removeStmt
in interfaceMutableBasicBlock
-
removeStmt
- Specified by:
removeStmt
in interfaceMutableBasicBlock
-
replaceStmt
- Specified by:
replaceStmt
in interfaceMutableBasicBlock
-
replaceStmt
- Specified by:
replaceStmt
in interfaceMutableBasicBlock
-
updateSuccessorContainer
-
addPredecessorBlock
- Specified by:
addPredecessorBlock
in interfaceMutableBasicBlock
-
linkSuccessor
makes blockA the predecessor of BlockB and BlockB the Successor of BlockA in a combined Method- Specified by:
linkSuccessor
in interfaceMutableBasicBlock
-
setSuccessorBlock
- Specified by:
setSuccessorBlock
in interfaceMutableBasicBlock
-
removePredecessorBlock
- Specified by:
removePredecessorBlock
in interfaceMutableBasicBlock
-
removeFromSuccessorBlocks
- Specified by:
removeFromSuccessorBlocks
in interfaceMutableBasicBlock
-
linkExceptionalSuccessorBlock
- Specified by:
linkExceptionalSuccessorBlock
in interfaceMutableBasicBlock
-
removeExceptionalSuccessorBlock
- Specified by:
removeExceptionalSuccessorBlock
in interfaceMutableBasicBlock
-
collectExceptionalSuccessorBlocks
- Specified by:
collectExceptionalSuccessorBlocks
in interfaceMutableBasicBlock
-
getPredecessors
- Specified by:
getPredecessors
in interfaceBasicBlock<MutableBasicBlock>
- Specified by:
getPredecessors
in interfaceMutableBasicBlock
-
getSuccessors
- Specified by:
getSuccessors
in interfaceBasicBlock<MutableBasicBlock>
- Specified by:
getSuccessors
in interfaceMutableBasicBlock
-
getExceptionalPredecessors
- Specified by:
getExceptionalPredecessors
in interfaceBasicBlock<MutableBasicBlock>
- Specified by:
getExceptionalPredecessors
in interfaceMutableBasicBlock
-
getExceptionalSuccessors
- Specified by:
getExceptionalSuccessors
in interfaceBasicBlock<MutableBasicBlock>
- Specified by:
getExceptionalSuccessors
in interfaceMutableBasicBlock
-
getStmts
- Specified by:
getStmts
in interfaceBasicBlock<MutableBasicBlock>
- Specified by:
getStmts
in interfaceMutableBasicBlock
-
getStmtCount
public int getStmtCount()- Specified by:
getStmtCount
in interfaceBasicBlock<MutableBasicBlock>
- Specified by:
getStmtCount
in interfaceMutableBasicBlock
-
getHead
- Specified by:
getHead
in interfaceBasicBlock<MutableBasicBlock>
- Specified by:
getHead
in interfaceMutableBasicBlock
-
getTail
- Specified by:
getTail
in interfaceBasicBlock<MutableBasicBlock>
- Specified by:
getTail
in interfaceMutableBasicBlock
-
splitBlockUnlinked
splits a single MutableBasicBlock into two at splitIndex position, so that the Stmt at the splitIdx is the Head of the second MutableBasicBlock. this method does not link the splitted blocks.- Specified by:
splitBlockUnlinked
in interfaceMutableBasicBlock
-
splitBlockUnlinked
- Specified by:
splitBlockUnlinked
in interfaceMutableBasicBlock
- Parameters:
splitIdx
- should be in [1, stmts.size()-1]
-
splitBlockLinked
@Nonnull public MutableBasicBlockImpl splitBlockLinked(@Nonnull Stmt splitStmt, boolean shouldBeNewHead) splits a BasicBlock into first|second we know splitStmt must be a FallsThroughStmt- Specified by:
splitBlockLinked
in interfaceMutableBasicBlock
- Parameters:
shouldBeNewHead
- if true: splitStmt is the Head of the second BasicBlock. if shouldBeNewHead is false splitStmt is the tail of the first BasicBlocksplitStmt
- the stmt which determines where to split the BasicBlock- Returns:
- BasicBlock with the second part of Stmts
-
splitBlockLinked
- Specified by:
splitBlockLinked
in interfaceMutableBasicBlock
-
copyExceptionalFlowFrom
- Specified by:
copyExceptionalFlowFrom
in interfaceMutableBasicBlock
-
clearSuccessorBlocks
public void clearSuccessorBlocks()- Specified by:
clearSuccessorBlocks
in interfaceMutableBasicBlock
-
clearExceptionalSuccessorBlocks
public void clearExceptionalSuccessorBlocks()- Specified by:
clearExceptionalSuccessorBlocks
in interfaceMutableBasicBlock
-
clearPredecessorBlocks
public void clearPredecessorBlocks()- Specified by:
clearPredecessorBlocks
in interfaceMutableBasicBlock
-
toString
-
replaceSuccessorBlock
public List<Integer> replaceSuccessorBlock(@Nonnull MutableBasicBlock oldBlock, @Nullable MutableBasicBlock newBlock) set newBlock to null to unset..- Specified by:
replaceSuccessorBlock
in interfaceMutableBasicBlock
-
replacePredecessorBlock
- Specified by:
replacePredecessorBlock
in interfaceMutableBasicBlock
-