|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectic.dfa.DataFlowAnalysis<Boolean>
ic.dfa.ReachableAnalysis
public class ReachableAnalysis
A simple analysis to determine whether there are unreachable statements in a program. That is it, determines whether there is a path from the entry to each program point. For example:
void main(string[] a) { boolean b; int y,z; if (b) { return; z = z + 1; // NOT REACHABLE } y = y + 1; }In this code, the assignment following the return is not reachable. The analysis is defined as follows:
D : forward V : { true, false } where true < false. Top: false. /\ : boolean || f : f_I(s) = s for all instructions I boundary: OUT[in] = trueAfter dataflow analysis, unreachable blocks will have IN[b] == false.
Field Summary |
---|
Fields inherited from class ic.dfa.DataFlowAnalysis |
---|
cfg, in, out |
Constructor Summary | |
---|---|
ReachableAnalysis(ControlFlowGraph cfg)
|
Method Summary | |
---|---|
Boolean |
boundary()
Initial value for out[enter] or in[exit], depending on direction. |
boolean |
equals(Boolean t1,
Boolean t2)
Return true if t1 and t2 are equivalent. |
boolean |
isForward()
Return true iff the analysis is a forward analysis. |
Boolean |
meet(Boolean t1,
Boolean t2)
Return the meet of t1 and t2 in the lattice. |
Boolean |
top()
Top value in the lattice of T elements. |
Boolean |
transfer(ic.tac.TInstr instr,
Boolean t)
Return the result of applying the transfer function for instr to t. |
Methods inherited from class ic.dfa.DataFlowAnalysis |
---|
in, out, solve, solveBackward, solveForward, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ReachableAnalysis(ControlFlowGraph cfg)
Method Detail |
---|
public Boolean boundary()
DataFlowAnalysis
boundary
in class DataFlowAnalysis<Boolean>
public Boolean top()
DataFlowAnalysis
top
in class DataFlowAnalysis<Boolean>
public boolean equals(Boolean t1, Boolean t2)
DataFlowAnalysis
equals
in class DataFlowAnalysis<Boolean>
public boolean isForward()
DataFlowAnalysis
isForward
in class DataFlowAnalysis<Boolean>
public Boolean meet(Boolean t1, Boolean t2)
DataFlowAnalysis
meet
in class DataFlowAnalysis<Boolean>
public Boolean transfer(ic.tac.TInstr instr, Boolean t)
DataFlowAnalysis
transfer
in class DataFlowAnalysis<Boolean>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |