Package edu.umd.cs.findbugs.ba
Class BetterCFGBuilder2.Context
java.lang.Object
edu.umd.cs.findbugs.ba.BetterCFGBuilder2.Context
- Enclosing class:
BetterCFGBuilder2
Inlining 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
FieldsModifier and TypeFieldDescriptionprivate final IdentityHashMap
<BasicBlock, BasicBlock> private final BetterCFGBuilder2.Context
private final CFG
private final BetterCFGBuilder2.Subroutine
private final LinkedList
<BasicBlock> -
Constructor Summary
ConstructorsConstructorDescriptionContext
(BetterCFGBuilder2.Context caller, BetterCFGBuilder2.Subroutine subroutine, CFG result) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Check to ensure that this context is not the result of recursion.getBlock
(BasicBlock subBlock) Get the block in the result CFG corresponding to the given subroutine block.Get the calling context.Get the result CFG.Get the subroutine being inlined.boolean
Are there more work list items?void
mapBlock
(BasicBlock subBlock, BasicBlock resultBlock) Map a basic block in a subroutine to the corresponding block in the resulting CFG.nextItem()
Get the next work list item (basic block to be inlined).
-
Field Details
-
caller
-
subroutine
-
result
-
blockMap
-
workList
-
-
Constructor Details
-
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 Details
-
getCaller
Get the calling context. -
getSubroutine
Get the subroutine being inlined. -
getResult
Get the result CFG. -
hasMoreWork
public boolean hasMoreWork()Are there more work list items? -
nextItem
Get the next work list item (basic block to be inlined). -
mapBlock
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
Get the block in the result CFG corresponding to the given subroutine block.- Parameters:
subBlock
- the subroutine block- Returns:
- the result CFG block
-
checkForRecursion
Check to ensure that this context is not the result of recursion.- Throws:
CFGBuilderException
-