Class IfStatement
- java.lang.Object
-
- org.benf.cfr.reader.bytecode.analysis.parse.statement.AbstractStatement
-
- org.benf.cfr.reader.bytecode.analysis.parse.statement.JumpingStatement
-
- org.benf.cfr.reader.bytecode.analysis.parse.statement.GotoStatement
-
- org.benf.cfr.reader.bytecode.analysis.parse.statement.IfStatement
-
- All Implemented Interfaces:
HasByteCodeLoc
,DeepCloneable<Statement>
,Statement
,ComparableUnderEC
,Dumpable
public class IfStatement extends GotoStatement
-
-
Field Summary
Fields Modifier and Type Field Description private ConditionalExpression
condition
private static int
JUMP_NOT_TAKEN
private static int
JUMP_TAKEN
private BlockIdentifier
knownElseBlock
private BlockIdentifier
knownIfBlock
-
Constructor Summary
Constructors Constructor Description IfStatement(BytecodeLoc loc, ConditionalExpression conditionalExpression)
-
Method Summary
-
Methods inherited from class org.benf.cfr.reader.bytecode.analysis.parse.statement.GotoStatement
deepClone, equivalentUnder, fallsToNext, getJumpType, getTargetStartBlock, setJumpType
-
Methods inherited from class org.benf.cfr.reader.bytecode.analysis.parse.statement.AbstractStatement
addLoc, collectLocallyMutatedVariables, collectLValueAssignments, collectObjectCreation, doesBlackListLValueReplacement, getCompoundParts, getContainer, getCreatedLValue, getLoc, getRValue, getTargetStatement, isCompound, outerDeepClone, setContainer, setLifetimeHint, toString, wantsLifetimeHint
-
-
-
-
Field Detail
-
JUMP_NOT_TAKEN
private static final int JUMP_NOT_TAKEN
- See Also:
- Constant Field Values
-
JUMP_TAKEN
private static final int JUMP_TAKEN
- See Also:
- Constant Field Values
-
condition
private ConditionalExpression condition
-
knownIfBlock
private BlockIdentifier knownIfBlock
-
knownElseBlock
private BlockIdentifier knownElseBlock
-
-
Constructor Detail
-
IfStatement
public IfStatement(BytecodeLoc loc, ConditionalExpression conditionalExpression)
-
-
Method Detail
-
getCombinedLoc
public BytecodeLoc getCombinedLoc()
- Specified by:
getCombinedLoc
in interfaceHasByteCodeLoc
- Overrides:
getCombinedLoc
in classGotoStatement
-
dump
public Dumper dump(Dumper dumper)
- Specified by:
dump
in interfaceDumpable
- Overrides:
dump
in classGotoStatement
-
replaceSingleUsageLValues
public void replaceSingleUsageLValues(LValueRewriter lValueRewriter, SSAIdentifiers ssaIdentifiers)
- Specified by:
replaceSingleUsageLValues
in interfaceStatement
- Overrides:
replaceSingleUsageLValues
in classGotoStatement
-
rewriteExpressions
public void rewriteExpressions(ExpressionRewriter expressionRewriter, SSAIdentifiers ssaIdentifiers)
- Specified by:
rewriteExpressions
in interfaceStatement
- Overrides:
rewriteExpressions
in classGotoStatement
-
collectLValueUsage
public void collectLValueUsage(LValueUsageCollector lValueUsageCollector)
- Specified by:
collectLValueUsage
in interfaceStatement
- Overrides:
collectLValueUsage
in classGotoStatement
-
getCondition
public ConditionalExpression getCondition()
-
setCondition
public void setCondition(ConditionalExpression condition)
-
simplifyCondition
public void simplifyCondition()
-
negateCondition
public void negateCondition()
-
replaceWithWhileLoopStart
public void replaceWithWhileLoopStart(BlockIdentifier blockIdentifier)
-
replaceWithWhileLoopEnd
public void replaceWithWhileLoopEnd(BlockIdentifier blockIdentifier)
-
getJumpTarget
public Statement getJumpTarget()
- Overrides:
getJumpTarget
in classGotoStatement
-
isConditional
public boolean isConditional()
- Overrides:
isConditional
in classGotoStatement
-
canThrow
public boolean canThrow(ExceptionCheck caught)
- Specified by:
canThrow
in interfaceStatement
- Overrides:
canThrow
in classGotoStatement
-
getStructuredStatement
public StructuredStatement getStructuredStatement()
- Specified by:
getStructuredStatement
in interfaceStatement
- Overrides:
getStructuredStatement
in classGotoStatement
-
setKnownBlocks
public void setKnownBlocks(BlockIdentifier ifBlock, BlockIdentifier elseBlock)
-
getBlocks
public Pair<BlockIdentifier,BlockIdentifier> getBlocks()
-
getKnownIfBlock
public BlockIdentifier getKnownIfBlock()
-
hasElseBlock
public boolean hasElseBlock()
-
optimiseForTypes
public void optimiseForTypes()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classGotoStatement
-
-