Package sootup.core.graph
Class MutableBasicBlockImpl
java.lang.Object
sootup.core.graph.MutableBasicBlockImpl
- All Implemented Interfaces:
BasicBlock<MutableBasicBlock>,MutableBasicBlock
-
Constructor Summary
ConstructorsConstructorDescriptionMutableBasicBlockImpl(List<Stmt> stmts, Map<ClassType, MutableBasicBlock> exceptionMap) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPredecessorBlock(@NonNull MutableBasicBlock block) voidvoidvoidvoidcollectExceptionalSuccessorBlocks(@NonNull MutableBasicBlock block) voidcopyExceptionalFlowFrom(MutableBasicBlock sourceBlock) boolean@NonNull Map<ClassType,MutableBasicBlock> @NonNull StmtgetHead()@NonNull List<MutableBasicBlock>intgetStmts()@NonNull List<MutableBasicBlock>@NonNull StmtgetTail()voidlinkExceptionalSuccessorBlock(@NonNull ClassType exception, MutableBasicBlock b) voidlinkSuccessor(int successorIdx, MutableBasicBlock blockB) makes blockA the predecessor of BlockB and BlockB the Successor of BlockA in a combined MethodvoidremoveExceptionalSuccessorBlock(@NonNull ClassType exception) voidremoveFromSuccessorBlocks(@NonNull MutableBasicBlock b) booleanremovePredecessorBlock(@NonNull MutableBasicBlock b) voidremoveStmt(int idx) voidremoveStmt(@NonNull Stmt stmt) booleanreplacePredecessorBlock(MutableBasicBlock oldBlock, MutableBasicBlock newBlock) voidreplaceStmt(int idx, Stmt newStmt) voidreplaceStmt(Stmt oldStmt, Stmt newStmt) replaceSuccessorBlock(@NonNull MutableBasicBlock oldBlock, @Nullable MutableBasicBlock newBlock) set newBlock to null to unset..voidsetSuccessorBlock(int successorIdx, @Nullable MutableBasicBlock block) @NonNull MutableBasicBlockImplsplitBlockLinked(int splitIdx) @NonNull MutableBasicBlockImplsplitBlockLinked(@NonNull Stmt splitStmt, boolean shouldBeNewHead) splits a BasicBlock into first|second we know splitStmt must be a FallsThroughStmtsplitBlockUnlinked(int splitIdx) splitBlockUnlinked(@NonNull Stmt newTail, @NonNull 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. this method does not link the splitted blocks.toString()protected voidupdateSuccessorContainer(@NonNull Stmt newStmt) Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface sootup.core.graph.BasicBlock
equivTo, isEmpty
-
Constructor Details
-
MutableBasicBlockImpl
public MutableBasicBlockImpl() -
MutableBasicBlockImpl
-
-
Method Details
-
equals
-
addStmt
- Specified by:
addStmtin interfaceMutableBasicBlock
-
removeStmt
public void removeStmt(int idx) - Specified by:
removeStmtin interfaceMutableBasicBlock
-
removeStmt
- Specified by:
removeStmtin interfaceMutableBasicBlock
-
replaceStmt
- Specified by:
replaceStmtin interfaceMutableBasicBlock
-
replaceStmt
- Specified by:
replaceStmtin interfaceMutableBasicBlock
-
updateSuccessorContainer
-
addPredecessorBlock
- Specified by:
addPredecessorBlockin interfaceMutableBasicBlock
-
linkSuccessor
makes blockA the predecessor of BlockB and BlockB the Successor of BlockA in a combined Method- Specified by:
linkSuccessorin interfaceMutableBasicBlock
-
setSuccessorBlock
- Specified by:
setSuccessorBlockin interfaceMutableBasicBlock
-
removePredecessorBlock
- Specified by:
removePredecessorBlockin interfaceMutableBasicBlock
-
removeFromSuccessorBlocks
- Specified by:
removeFromSuccessorBlocksin interfaceMutableBasicBlock
-
linkExceptionalSuccessorBlock
- Specified by:
linkExceptionalSuccessorBlockin interfaceMutableBasicBlock
-
removeExceptionalSuccessorBlock
- Specified by:
removeExceptionalSuccessorBlockin interfaceMutableBasicBlock
-
collectExceptionalSuccessorBlocks
- Specified by:
collectExceptionalSuccessorBlocksin interfaceMutableBasicBlock
-
getPredecessors
- Specified by:
getPredecessorsin interfaceBasicBlock<MutableBasicBlock>- Specified by:
getPredecessorsin interfaceMutableBasicBlock
-
getSuccessors
- Specified by:
getSuccessorsin interfaceBasicBlock<MutableBasicBlock>- Specified by:
getSuccessorsin interfaceMutableBasicBlock
-
getExceptionalPredecessors
- Specified by:
getExceptionalPredecessorsin interfaceBasicBlock<MutableBasicBlock>- Specified by:
getExceptionalPredecessorsin interfaceMutableBasicBlock
-
getExceptionalSuccessors
- Specified by:
getExceptionalSuccessorsin interfaceBasicBlock<MutableBasicBlock>- Specified by:
getExceptionalSuccessorsin interfaceMutableBasicBlock
-
getStmts
- Specified by:
getStmtsin interfaceBasicBlock<MutableBasicBlock>- Specified by:
getStmtsin interfaceMutableBasicBlock
-
getStmtCount
public int getStmtCount()- Specified by:
getStmtCountin interfaceBasicBlock<MutableBasicBlock>- Specified by:
getStmtCountin interfaceMutableBasicBlock
-
getHead
- Specified by:
getHeadin interfaceBasicBlock<MutableBasicBlock>- Specified by:
getHeadin interfaceMutableBasicBlock
-
getTail
- Specified by:
getTailin interfaceBasicBlock<MutableBasicBlock>- Specified by:
getTailin 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:
splitBlockUnlinkedin interfaceMutableBasicBlock
-
splitBlockUnlinked
- Specified by:
splitBlockUnlinkedin interfaceMutableBasicBlock- Parameters:
splitIdx- should be in [1, stmts.size()-1]
-
splitBlockLinked
public @NonNull MutableBasicBlockImpl splitBlockLinked(@NonNull Stmt splitStmt, boolean shouldBeNewHead) splits a BasicBlock into first|second we know splitStmt must be a FallsThroughStmt- Specified by:
splitBlockLinkedin 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:
splitBlockLinkedin interfaceMutableBasicBlock
-
copyExceptionalFlowFrom
- Specified by:
copyExceptionalFlowFromin interfaceMutableBasicBlock
-
clearSuccessorBlocks
public void clearSuccessorBlocks()- Specified by:
clearSuccessorBlocksin interfaceMutableBasicBlock
-
clearExceptionalSuccessorBlocks
public void clearExceptionalSuccessorBlocks()- Specified by:
clearExceptionalSuccessorBlocksin interfaceMutableBasicBlock
-
clearPredecessorBlocks
public void clearPredecessorBlocks()- Specified by:
clearPredecessorBlocksin interfaceMutableBasicBlock
-
toString
-
replaceSuccessorBlock
public List<Integer> replaceSuccessorBlock(@NonNull MutableBasicBlock oldBlock, @Nullable MutableBasicBlock newBlock) set newBlock to null to unset..- Specified by:
replaceSuccessorBlockin interfaceMutableBasicBlock
-
replacePredecessorBlock
- Specified by:
replacePredecessorBlockin interfaceMutableBasicBlock
-