dk.brics.xact.analysis.transformations
Class ReachingDefinitionsAnalysis

java.lang.Object
  extended by dk.brics.xact.analysis.transformations.ReachingDefinitionsAnalysis
All Implemented Interfaces:
AnalysisInterface<Map<Variable,Set<Assignment>>>

public class ReachingDefinitionsAnalysis
extends Object
implements AnalysisInterface<Map<Variable,Set<Assignment>>>

Lattice and transfer functions for reaching definitions analysis. Maps each variable to a set of all statements that may assign to that variable.


Constructor Summary
ReachingDefinitionsAnalysis()
          Constructs a new analysis object.
 
Method Summary
 boolean merge(Map<Variable,Set<Assignment>> source, VariableFilter filter, Map<Variable,Set<Assignment>> dest)
          Computes the least upper bound of two lattice elements.
 Map<Variable,Set<Assignment>> newBottomElement()
          Constructs a new lattice bottom element.
 boolean transfer(Map<Variable,Set<Assignment>> in, Statement s, Map<Variable,Set<Assignment>> out)
          Computes the lattice element resulting from flowing through the given statement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReachingDefinitionsAnalysis

public ReachingDefinitionsAnalysis()
Constructs a new analysis object.

Method Detail

merge

public boolean merge(Map<Variable,Set<Assignment>> source,
                     VariableFilter filter,
                     Map<Variable,Set<Assignment>> dest)
Description copied from interface: AnalysisInterface
Computes the least upper bound of two lattice elements.

Specified by:
merge in interface AnalysisInterface<Map<Variable,Set<Assignment>>>
Parameters:
source - the first element
filter - the filter to merge through
dest - the second element and destination for the result
Returns:
true if the new value of dest is changed

newBottomElement

public Map<Variable,Set<Assignment>> newBottomElement()
Description copied from interface: AnalysisInterface
Constructs a new lattice bottom element.

Specified by:
newBottomElement in interface AnalysisInterface<Map<Variable,Set<Assignment>>>

transfer

public boolean transfer(Map<Variable,Set<Assignment>> in,
                        Statement s,
                        Map<Variable,Set<Assignment>> out)
Description copied from interface: AnalysisInterface
Computes the lattice element resulting from flowing through the given statement.

Specified by:
transfer in interface AnalysisInterface<Map<Variable,Set<Assignment>>>
Parameters:
in - the flow before the statement
out - destination for the result
Returns:
true if the new value of out is changed


Copyright © 2005-2008 Aarhus University.