|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcfg.TACInst
cfg.CallInst
public abstract class CallInst
A generic class representing a three-address code call instruction (CallInst). It is extended by two specific call instructions: InDirCallInst and DirCallInst. A call instruction consists of a target (possibly a variable or address) to jump to, an optional destination variable to assign the result of the call to, and the number of parameters (ref. and standard) used by the call. From TACInst it also inherits an opcode. Note about parameters: if at least one parameter is used, then a reference parameter must be supplied. For indirect calls, a reference parameter must always be supplied. If parameters are supplied (excluding error parameters), then the reference parameter must be supplied first followed by the standard parameters in the order that they were listed in the source program. the ordering of error parameters does not matter.
Field Summary | |
---|---|
protected java.lang.String |
callType
Type of call (e.g., "indircall", "dircall") |
protected java.lang.String |
destVar
(Optional) destination variable to assign result of call (null if none) |
protected java.lang.String |
target
Target to jump to |
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 | |
---|---|
CallInst(int opcode,
java.lang.String callType,
java.lang.String target,
java.lang.String destVar,
int numParams)
CallInst constructor |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Compares this object with the parameter object |
java.lang.String |
getDestVar()
Get the destination variable (variable to assign result to -- null if none) |
int |
getNumParam()
Get the number of parameters (both ref. |
java.lang.String |
getString()
Get string representation of instruction (without comments) (note: in general, you want to use toString() to get instruction string) |
java.lang.String |
getTarget()
Get the target of the call |
void |
setDestVar(java.lang.String destVar)
Set the destination variable (variable to assign result to -- null if none) |
void |
setNumParam(int numParams)
Set the number of parameters (both ref. |
abstract void |
setTarget(java.lang.String target)
Set the target of the call |
Methods inherited from class cfg.TACInst |
---|
accept, 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 |
Field Detail |
---|
protected java.lang.String callType
protected java.lang.String target
protected java.lang.String destVar
Constructor Detail |
---|
public CallInst(int opcode, java.lang.String callType, java.lang.String target, java.lang.String destVar, int numParams)
opcode
- opcode of call instructioncallType
- type of call (e.g., "indircall", "dircall")target
- target to jump todestVar
- (Optional) destination variable to assign result of call
(null if none)numParams
- number of parameters (both ref. and standard but not
error)Method Detail |
---|
public java.lang.String getTarget()
public abstract void setTarget(java.lang.String target)
target
- new targetpublic java.lang.String getDestVar()
public void setDestVar(java.lang.String destVar)
destVar
- new destination variablepublic int getNumParam()
public void setNumParam(int numParams)
numParams
- new number of parameterspublic boolean equals(java.lang.Object o)
equals
in class TACInst
o
- object to compare the reference object with
public java.lang.String getString()
getString
in class TACInst
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |