Package EDU.purdue.cs.bloat.codegen
Class Liveness
- java.lang.Object
-
- EDU.purdue.cs.bloat.codegen.Liveness
-
public class Liveness extends java.lang.ObjectLiveness represents the interference graph of the local variables contained in a control flow graph. When the liveness of two variables overlap each other, the two variables are said to interfere with each other. The interference graph represents this relationship between variables. There is an (un-directed) edge between variables a and b in the interference graph if variable a interferes with variable b.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collectiondefs()Returns the LocalExprs (variables) that occur in the CFG.java.util.Iteratorintersections(VarExpr a)Returns an Iterator of LocalExprs that interfere with a given VarExpr.booleanliveAtEndOfBlock(VarExpr isLive, Block block)Should not be called.booleanliveAtStartOfBlock(VarExpr isLive, Block block)Should not be called.booleanliveAtUse(VarExpr isLive, VarExpr at, boolean after)Should not be called.booleanliveRangesIntersect(VarExpr a, VarExpr b)Determines whether or not two variables interfere with one another.voidremoveVar(LocalExpr expr)Removes a local expression from the interference graph.
-
-
-
Field Detail
-
DEBUG
public static boolean DEBUG
-
UNIQUE
public static boolean UNIQUE
-
BEFORE
public static final boolean BEFORE
- See Also:
- Constant Field Values
-
AFTER
public static final boolean AFTER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Liveness
public Liveness(FlowGraph cfg)
Constructor.- Parameters:
cfg- Control flow graph on which to perform liveness analysis.
-
-
Method Detail
-
removeVar
public void removeVar(LocalExpr expr)
Removes a local expression from the interference graph.
-
liveAtUse
public boolean liveAtUse(VarExpr isLive, VarExpr at, boolean after)
Should not be called.
-
liveAtStartOfBlock
public boolean liveAtStartOfBlock(VarExpr isLive, Block block)
Should not be called.
-
liveAtEndOfBlock
public boolean liveAtEndOfBlock(VarExpr isLive, Block block)
Should not be called.
-
defs
public java.util.Collection defs()
Returns the LocalExprs (variables) that occur in the CFG. They correspond to nodes in the interference graph.
-
intersections
public java.util.Iterator intersections(VarExpr a)
Returns an Iterator of LocalExprs that interfere with a given VarExpr.
-
-