public class IfInst extends TACInst
Modifier and Type | Field and Description |
---|---|
static int |
EQ
Equals ('==') condition type ID
|
protected BasicBlock |
falseTarg
Target block when condition is false (fall through target)
|
static int |
GE
Equals ('>=') condition type ID
|
static int |
GT
Equals ('>') condition type ID
|
static int |
LE
Equals ('<=') condition type ID
|
protected java.lang.String |
leftSource
Left source operand in condition
|
static int |
LT
Equals ('<') condition type ID
|
static int |
NE
Equals ('!
|
protected java.lang.String |
rightSource
Right source operand in condition
|
protected BasicBlock |
trueTarg
Target block when condition is true (jump target)
|
protected int |
type
Type of condition (e.g., IfInst.EQ for '==', etc.)
|
Constructor and Description |
---|
IfInst(int type,
java.lang.String leftSource,
java.lang.String rightSource,
BasicBlock trueTarg,
BasicBlock falseTarg)
IfInst constructor
|
Modifier and Type | Method and Description |
---|---|
<ReturnType,ArgumentType> |
accept(TACInstVisitor<ReturnType,ArgumentType> visitor,
ArgumentType o)
Abstract visitor method.
|
boolean |
equals(java.lang.Object o)
Compares this object with the parameter object
|
BasicBlock |
getFalseTarg()
Get the false target block
|
java.lang.String |
getLeftSource()
Get the left source operand
|
java.lang.String |
getRightSource()
Get the right source operand
|
java.lang.String |
getString()
Get string representation of instruction (without comments)
(note: in general, you want to use toString() to get instruction string)
|
BasicBlock |
getTrueTarg()
Get the true target block
|
int |
getType()
Get the type of If condition
|
void |
setFalseTarg(BasicBlock falseTarg)
Get the false target block
|
void |
setLeftSource(java.lang.String leftSource)
Set the left soure operand
|
void |
setRightSource(java.lang.String rightSource)
Set the right soure operand
|
void |
setTrueTarg(BasicBlock trueTarg)
Set the true target block
|
void |
setType(int type)
Set the type of If condition
|
addComment, checkBoolConst, checkConst, checkIntConst, checkLabel, checkStrConst, checkVar, getBinaryOpcode, getComments, getOp, getOpcode, getUnaryOpcode, isBinary, isCall, isIf, isLoad, isParam, isPhi, isReturn, isStore, isUnary, isValidID, removeComments, toString
public static final int EQ
public static final int NE
public static final int LT
public static final int LE
public static final int GT
public static final int GE
protected int type
protected java.lang.String leftSource
protected java.lang.String rightSource
protected BasicBlock trueTarg
protected BasicBlock falseTarg
public IfInst(int type, java.lang.String leftSource, java.lang.String rightSource, BasicBlock trueTarg, BasicBlock falseTarg)
type
- type of condition (e.g., IfInst.EQ for '==', etc.)leftSource
- left source operand in conditionrightSource
- right source operand in conditiontrueTarg
- target block when condition is true (jump target)falseTarg
- target block when condition is false (fall through target)public int getType()
public void setType(int type)
type
- the new type of Ifpublic java.lang.String getLeftSource()
public void setLeftSource(java.lang.String leftSource)
leftSource
- new left source operandpublic java.lang.String getRightSource()
public void setRightSource(java.lang.String rightSource)
rightSource
- new right source operandpublic BasicBlock getTrueTarg()
public void setTrueTarg(BasicBlock trueTarg)
trueTarg
- new true target blockpublic BasicBlock getFalseTarg()
public void setFalseTarg(BasicBlock falseTarg)
falseTarg
- new false target blockpublic boolean equals(java.lang.Object o)
public java.lang.String getString()
public <ReturnType,ArgumentType> ReturnType accept(TACInstVisitor<ReturnType,ArgumentType> visitor, ArgumentType o)
TACInst