public class PhiInst extends TACInst
Constructor and Description |
---|
PhiInst(java.lang.String destination,
java.lang.String orgVar,
int initialParams)
BinaryPhiInst 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
|
java.lang.String |
getDestination()
Returns the destination.
|
int |
getNonRedundantParam()
Returns the index of the first parameter which is not equal
to the destination.
|
java.lang.String |
getNthSource(int n)
Returns the nth source operand of the phi-instruction.
|
int |
getNumParams()
Returns the number of params.
|
java.lang.String |
getOriginalVar()
Returns the name of the original variable this phi assignment
is for.
|
java.lang.String |
getString()
Get string representation of instruction (without comments)
(note: in general, you want to use toString() to get instruction string)
|
boolean |
isCompletelyRedundant()
Returns true, if phi-instruction is of general form
x = phi(x, x, ..., x).
|
boolean |
isJustCopy()
Returns true, if all branches of the phi-node point to the same
var, i.e. the phi-instruction is just a copy of that var.
|
boolean |
isRedundant()
Returns true, if phi-instruction is of general form
x = phi(x, ..., x, y, x, ..., x).
|
void |
remNthSource(int n)
Removes the nth source operand of the phi-instruction.
|
void |
setDestination(java.lang.String dest)
Sets the destination.
|
void |
setNthSource(int n,
java.lang.String source)
Sets the nth source operand of the phi-instruction.
|
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 PhiInst(java.lang.String destination, java.lang.String orgVar, int initialParams)
destination
- destination variableorgVar
- original variableinitialParams
- initial number of source operandspublic java.lang.String getDestination()
public void setDestination(java.lang.String dest)
dest
- destinationpublic int getNumParams()
public java.lang.String getNthSource(int n)
n
- nth parampublic void setNthSource(int n, java.lang.String source)
n
- nth paramsource
- new source operandpublic void remNthSource(int n)
n
- public <ReturnType,ArgumentType> ReturnType accept(TACInstVisitor<ReturnType,ArgumentType> visitor, ArgumentType o)
TACInst
public java.lang.String getOriginalVar()
public java.lang.String getString()
public boolean isCompletelyRedundant()
public boolean isRedundant()
public boolean isJustCopy()
public int getNonRedundantParam()