|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcfg.TACInst
cfg.PhiInst
public class PhiInst
A class representing a three-address code Phi instruction (BinaryPhiInst). A phi instruction consists of a destination variable and a number of source operands, one for each predecessor.
Field Summary |
---|
Fields inherited from class cfg.TACInst |
---|
BINADD, BINAND, BINDIV, BINMOD, BINMUL, BINOR, BINSUB, comments, DIRCALL, ERRPARAM, IF, INDIRCALL, LDADDR, LDCONST, LDENTRY, LDVAR, NUM_INSN_TYPES, opcode, PHI, REFPARAM, RETN, STDPARAM, STENTRY, UNNEG, UNNOT |
Constructor Summary | |
---|---|
PhiInst(java.lang.String destination,
java.lang.String orgVar,
int initialParams)
BinaryPhiInst constructor |
Method Summary | ||
---|---|---|
|
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 |
isRedundant()
Returns true, if phi-instruction is of general form x = phi(x, ..., x, y, x, ..., x). |
|
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. |
Methods inherited from class cfg.TACInst |
---|
addComment, checkBoolConst, checkConst, checkIntConst, checkLabel, checkStrConst, checkVar, getBinaryOpcode, getComments, getOp, getOpcode, getUnaryOpcode, isBinary, isCall, isIf, isLoad, isParam, isReturn, isStore, isUnary, isValidID, removeComments, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PhiInst(java.lang.String destination, java.lang.String orgVar, int initialParams)
destination
- destination variableorgVar
- original variableinitialParams
- initial number of source operandsMethod Detail |
---|
public java.lang.String getDestination()
public void setDestination(java.lang.String dest)
dest
- destinationpublic int getNumParams()
public java.lang.String getNthSource(int n)
n
- nth param
public void setNthSource(int n, java.lang.String source)
n
- nth paramsource
- new source operandpublic <ReturnType,ArgumentType> ReturnType accept(TACInstVisitor<ReturnType,ArgumentType> visitor, ArgumentType o)
TACInst
accept
in class TACInst
visitor
- TACInstVisitor.o
- Data to pass down.
public java.lang.String getOriginalVar()
public java.lang.String getString()
getString
in class TACInst
public boolean isCompletelyRedundant()
public boolean isRedundant()
public int getNonRedundantParam()
public boolean equals(java.lang.Object o)
TACInst
equals
in class TACInst
o
- object to compare the reference object with
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |