Package EDU.purdue.cs.bloat.tree
Class PhiCatchStmt
- java.lang.Object
-
- EDU.purdue.cs.bloat.tree.Node
-
- EDU.purdue.cs.bloat.tree.Stmt
-
- EDU.purdue.cs.bloat.tree.PhiStmt
-
- EDU.purdue.cs.bloat.tree.PhiCatchStmt
-
- All Implemented Interfaces:
Assign
public class PhiCatchStmt extends PhiStmt
A PhiCatchStmt is used to handle variables that are used inside an exception handler. Inside a try block a variable may be used several times. It may be updated, may be invovled in a phi-function, etc. A PhiCatchStmt is placed at the beginning of each expection handling (catch) block to factor together the variables that are live within the protected region.
-
-
Constructor Summary
Constructors Constructor Description PhiCatchStmt(LocalExpr target)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddOperand(LocalExpr operand)Add a local variable to the operand list for this phi-function.booleanhasOperandDef(LocalExpr def)Searches the list of operands for a local variable.intnumOperands()Returns the number of operands to this phi-function.ExproperandAt(int i)Returns the operand at a given index.java.util.Collectionoperands()Returns the operands to this phi-function.voidsetOperandAt(int i, Expr expr)Sets the value of one of this phi-function's operands.voidvisit(TreeVisitor visitor)voidvisitForceChildren(TreeVisitor visitor)Visit the children of this node.-
Methods inherited from class EDU.purdue.cs.bloat.tree.Stmt
cleanupOnly
-
Methods inherited from class EDU.purdue.cs.bloat.tree.Node
block, cleanup, copyInto, hasParent, key, parent, replaceWith, replaceWith, setKey, setParent, setValueNumber, toString, valueNumber, visitChildren, visitOnly
-
-
-
-
Constructor Detail
-
PhiCatchStmt
public PhiCatchStmt(LocalExpr target)
Constructor.- Parameters:
target- Local variable to which the result of this phi-function is to be assigned.
-
-
Method Detail
-
visitForceChildren
public void visitForceChildren(TreeVisitor visitor)
Description copied from class:NodeVisit the children of this node. Not all Nodes will have children to visit.- Specified by:
visitForceChildrenin classNode
-
visit
public void visit(TreeVisitor visitor)
-
hasOperandDef
public boolean hasOperandDef(LocalExpr def)
Searches the list of operands for a local variable.- Parameters:
def- The local variable definition to search for.- Returns:
- True, if def is found, otherwise, false.
-
addOperand
public void addOperand(LocalExpr operand)
Add a local variable to the operand list for this phi-function.- Parameters:
operand- An operand of this phi-function.
-
operands
public java.util.Collection operands()
Returns the operands to this phi-function.
-
numOperands
public int numOperands()
Returns the number of operands to this phi-function.
-
setOperandAt
public void setOperandAt(int i, Expr expr)Sets the value of one of this phi-function's operands.- Parameters:
i- The number parameter to set.expr- The new value of the parameter.
-
operandAt
public Expr operandAt(int i)
Returns the operand at a given index.
-
-