Class StructuralAnalyzer.RegionInfo
- java.lang.Object
-
- com.tonic.analysis.source.recovery.StructuralAnalyzer.RegionInfo
-
- Enclosing class:
- StructuralAnalyzer
public static class StructuralAnalyzer.RegionInfo extends Object
Information about a structured region.
-
-
Constructor Summary
Constructors Constructor Description RegionInfo(ControlFlowContext.StructuredRegion type, IRBlock header)
-
Method Summary
-
-
-
Constructor Detail
-
RegionInfo
public RegionInfo(ControlFlowContext.StructuredRegion type, IRBlock header)
-
-
Method Detail
-
getType
public ControlFlowContext.StructuredRegion getType()
- Returns:
- the type
-
getHeader
public IRBlock getHeader()
- Returns:
- the header
-
getThenBlock
public IRBlock getThenBlock()
- Returns:
- the then block
-
getElseBlock
public IRBlock getElseBlock()
- Returns:
- the else block
-
getMergeBlock
public IRBlock getMergeBlock()
- Returns:
- the merge block
-
setConditionBlocks
public void setConditionBlocks(Set<IRBlock> conditionBlocks)
- Parameters:
conditionBlocks- blocks making up a short-circuit condition spine
-
isConditionNegated
public boolean isConditionNegated()
- Returns:
- whether condition negated
-
getLoopBody
public IRBlock getLoopBody()
- Returns:
- the loop body
-
getLoopExit
public IRBlock getLoopExit()
- Returns:
- the loop exit
-
getLoop
public LoopAnalysis.Loop getLoop()
- Returns:
- the loop
-
getContinueTarget
public IRBlock getContinueTarget()
- Returns:
- the continue target
-
getLatchBlock
public IRBlock getLatchBlock()
- Returns:
- the bottom-test block of a do-while whose header carries body control flow, else null
-
setLatchBlock
public void setLatchBlock(IRBlock latchBlock)
- Parameters:
latchBlock- bottom-test block of a do-while whose header carries body control flow
-
getHeaderConditional
public StructuralAnalyzer.RegionInfo getHeaderConditional()
- Returns:
- the header's own conditional region when the loop test lives in the latch, else null
-
setHeaderConditional
public void setHeaderConditional(StructuralAnalyzer.RegionInfo headerConditional)
- Parameters:
headerConditional- the header's own conditional region when the test lives in the latch
-
getDefaultTarget
public IRBlock getDefaultTarget()
- Returns:
- the default target
-
getSwitchSelector
public SSAValue getSwitchSelector()
- Returns:
- the selector of a comparison-chain switch, whose header terminator is a branch rather than a SwitchInstruction
-
getSwitchSpineBlocks
public Set<IRBlock> getSwitchSpineBlocks()
- Returns:
- the comparison blocks forming the dispatch spine, used as stop blocks so case bodies cannot bleed into them
-
getInductionVariable
public SSAValue getInductionVariable()
- Returns:
- the induction variable
-
getIncrementBlock
public IRBlock getIncrementBlock()
- Returns:
- the increment block
-
getInductionLocalIndex
public int getInductionLocalIndex()
- Returns:
- the induction local index
-
setThenBlock
public void setThenBlock(IRBlock thenBlock)
- Parameters:
thenBlock- first block of the then arm
-
setElseBlock
public void setElseBlock(IRBlock elseBlock)
- Parameters:
elseBlock- first block of the else arm, or null when there is none
-
setMergeBlock
public void setMergeBlock(IRBlock mergeBlock)
- Parameters:
mergeBlock- block where the arms rejoin
-
setLoopBody
public void setLoopBody(IRBlock loopBody)
- Parameters:
loopBody- first block of the loop body
-
setLoopExit
public void setLoopExit(IRBlock loopExit)
- Parameters:
loopExit- first block after the loop
-
setLoop
public void setLoop(LoopAnalysis.Loop loop)
- Parameters:
loop- the natural loop this region structures
-
setContinueTarget
public void setContinueTarget(IRBlock continueTarget)
- Parameters:
continueTarget- block a continue in this loop jumps to
-
setSwitchCases
public void setSwitchCases(Map<Integer,IRBlock> switchCases)
- Parameters:
switchCases- case key to the block that arm enters
-
setDefaultTarget
public void setDefaultTarget(IRBlock defaultTarget)
- Parameters:
defaultTarget- block the default arm enters
-
setSwitchSelector
public void setSwitchSelector(SSAValue switchSelector)
- Parameters:
switchSelector- value tested by a comparison-chain switch
-
setSwitchSpineBlocks
public void setSwitchSpineBlocks(Set<IRBlock> switchSpineBlocks)
- Parameters:
switchSpineBlocks- comparison blocks forming the dispatch chain, used as stop blocks
-
setConditionNegated
public void setConditionNegated(boolean conditionNegated)
- Parameters:
conditionNegated- whether the source condition is the negation of the branch test
-
setInductionVariable
public void setInductionVariable(SSAValue inductionVariable)
- Parameters:
inductionVariable- the counter a for loop advances
-
setIncrementBlock
public void setIncrementBlock(IRBlock incrementBlock)
- Parameters:
incrementBlock- block holding the for-loop update
-
setInductionLocalIndex
public void setInductionLocalIndex(int inductionLocalIndex)
- Parameters:
inductionLocalIndex- local slot holding the induction variable, or -1 if unknown
-
-