Class SSAConstructionInfo
java.lang.Object
EDU.purdue.cs.bloat.ssa.SSAConstructionInfo
SSAConstructionInfo contains information needed to convert a CFG
into SSA form. Each variable (VarExpr) has an SSAConstructionInfo associated
with it. Each SSAConstructionInfo keeps track of information such
as the PhiStmts that define copies of the variable, the
Blocks in which the variable is defined, and the occurrences
(uses) of the variable in both phi and non-phi statements. Note that no
PhiStmt is really inserted into a basic block. We just keep track
of the mapping. It should also be noted that once a phi statement for a given
variable is "inserted" into a block, no other phi statement for that variable
is inserted. Thus, the order of insertion determines the precedence of the
phi statements: PhiReturnStmt > PhiCatchStmt >
PhiJoinStmt.
Additionally, SSAConstruction has methods to insert various flavors of PhiStmts whose targets are the variable associated with the SSAConstruction into Blocks.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCatchPhi(Block block) Inserts a PhiCatchStmt (whose target is the variable represented by this SSAConstructionInfo) into a given Block.voidaddDefBlock(Block block) Makes note of a Block in which the variable is defined by a PhiStmt.voidAdds a PhiJoinStmt for the variable represented by this SSAConstructionInfo to a given Block.voidNotes a real occurrence (that is, a use that is not an operand to a phi statement) of the variable represented by this SSAConstructionInfo.voidaddRetPhis(Subroutine sub) Adds a PhiReturnStmt to all of the Blocks that are executed upon returning from a given Subroutine.Returns the Blocks containing a definition of the variable represented by this SSAConstruction info.phiAtBlock(Block block) Returns the phi statement for the variable represented by this SSAConstructionInfo at a given block in the CFG.Returns the program variable associated with this SSAConstructionInfo.reals()Returns all of the real occurrences of this variable.realsAtBlock(Block block) Returns all of the real occurrences of this variable in a given block.voidremovePhiAtBlock(Block block) Removes the phi statement for this variable at a given block.
-
Constructor Details
-
SSAConstructionInfo
-
-
Method Details
-
prototype
Returns the program variable associated with this SSAConstructionInfo. -
addDefBlock
Makes note of a Block in which the variable is defined by a PhiStmt. -
phiAtBlock
-
removePhiAtBlock
Removes the phi statement for this variable at a given block. -
addPhi
Adds a PhiJoinStmt for the variable represented by this SSAConstructionInfo to a given Block. -
addRetPhis
Adds a PhiReturnStmt to all of the Blocks that are executed upon returning from a given Subroutine.- See Also:
-
addCatchPhi
Inserts a PhiCatchStmt (whose target is the variable represented by this SSAConstructionInfo) into a given Block.- See Also:
-
addReal
Notes a real occurrence (that is, a use that is not an operand to a phi statement) of the variable represented by this SSAConstructionInfo.- See Also:
-
reals
Returns all of the real occurrences of this variable. -
realsAtBlock
Returns all of the real occurrences of this variable in a given block. -
defBlocks
Returns the Blocks containing a definition of the variable represented by this SSAConstruction info.
-