Package edu.umd.cs.findbugs.ba
Class BetterCFGBuilder2.Context
- java.lang.Object
-
- edu.umd.cs.findbugs.ba.BetterCFGBuilder2.Context
-
- Enclosing class:
- BetterCFGBuilder2
private static class BetterCFGBuilder2.Context extends java.lang.ObjectInlining context. This essentially consists of a inlining site and a subroutine to be inlined. A stack of calling contexts is maintained in order to resolve EscapeTargets.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.IdentityHashMap<BasicBlock,BasicBlock>blockMapprivate BetterCFGBuilder2.Contextcallerprivate CFGresultprivate BetterCFGBuilder2.Subroutinesubroutineprivate java.util.LinkedList<BasicBlock>workList
-
Constructor Summary
Constructors Constructor Description Context(BetterCFGBuilder2.Context caller, BetterCFGBuilder2.Subroutine subroutine, CFG result)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckForRecursion()Check to ensure that this context is not the result of recursion.BasicBlockgetBlock(BasicBlock subBlock)Get the block in the result CFG corresponding to the given subroutine block.BetterCFGBuilder2.ContextgetCaller()Get the calling context.CFGgetResult()Get the result CFG.BetterCFGBuilder2.SubroutinegetSubroutine()Get the subroutine being inlined.booleanhasMoreWork()Are there more work list items?voidmapBlock(BasicBlock subBlock, BasicBlock resultBlock)Map a basic block in a subroutine to the corresponding block in the resulting CFG.BasicBlocknextItem()Get the next work list item (basic block to be inlined).
-
-
-
Field Detail
-
caller
private final BetterCFGBuilder2.Context caller
-
subroutine
private final BetterCFGBuilder2.Subroutine subroutine
-
result
private final CFG result
-
blockMap
private final java.util.IdentityHashMap<BasicBlock,BasicBlock> blockMap
-
workList
private final java.util.LinkedList<BasicBlock> workList
-
-
Constructor Detail
-
Context
public Context(@Nullable BetterCFGBuilder2.Context caller, BetterCFGBuilder2.Subroutine subroutine, CFG result)Constructor.- Parameters:
caller- the calling contextsubroutine- the subroutine being inlinedresult- the result CFG
-
-
Method Detail
-
getCaller
public BetterCFGBuilder2.Context getCaller()
Get the calling context.
-
getSubroutine
public BetterCFGBuilder2.Subroutine getSubroutine()
Get the subroutine being inlined.
-
getResult
public CFG getResult()
Get the result CFG.
-
hasMoreWork
public boolean hasMoreWork()
Are there more work list items?
-
nextItem
public BasicBlock nextItem()
Get the next work list item (basic block to be inlined).
-
mapBlock
public void mapBlock(BasicBlock subBlock, BasicBlock resultBlock)
Map a basic block in a subroutine to the corresponding block in the resulting CFG.- Parameters:
subBlock- the subroutine blockresultBlock- the result CFG block
-
getBlock
public BasicBlock getBlock(BasicBlock subBlock)
Get the block in the result CFG corresponding to the given subroutine block.- Parameters:
subBlock- the subroutine block- Returns:
- the result CFG block
-
checkForRecursion
public void checkForRecursion() throws CFGBuilderExceptionCheck to ensure that this context is not the result of recursion.- Throws:
CFGBuilderException
-
-