dk.brics.string.intermediate.operations
Class LivenessAnalysis

java.lang.Object
  extended by dk.brics.string.intermediate.operations.LivenessAnalysis
All Implemented Interfaces:
FlowAnalysis

public class LivenessAnalysis
extends Object
implements FlowAnalysis

Intra-procedural liveness analysis performed on a set of methods.

The formal parameters of a method are always considered live.


Constructor Summary
LivenessAnalysis(Application app)
          Performs liveness analysis.
 
Method Summary
 boolean addLiveAfter(Statement s, Set<Variable> live)
          Adds live variables to he program point after the given statement.
 Set<Variable> getLiveAfter(Statement s)
          Returns the (unmodifiable) set of live variables as inferred just after the given statement.
 Set<Variable> getLiveBefore(Statement s)
          Returns the (unmodifiable) set of live variables as inferred just before the given statement.
 void transfer(Statement s)
          The transfer function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LivenessAnalysis

public LivenessAnalysis(Application app)
Performs liveness analysis.

Method Detail

addLiveAfter

public boolean addLiveAfter(Statement s,
                            Set<Variable> live)
Adds live variables to he program point after the given statement.

Parameters:
s - statement
live - live variables to add
Returns:
true if the set changed

getLiveAfter

public Set<Variable> getLiveAfter(Statement s)
Returns the (unmodifiable) set of live variables as inferred just after the given statement. The result is sorted if in test mode.

Parameters:
s - the statement.
Returns:
a set of Variable objects.

getLiveBefore

public Set<Variable> getLiveBefore(Statement s)
Returns the (unmodifiable) set of live variables as inferred just before the given statement. The result is sorted if in test mode.

Parameters:
s - the statement.
Returns:
a set of Variable objects.

transfer

public void transfer(Statement s)
Description copied from interface: FlowAnalysis
The transfer function.

Specified by:
transfer in interface FlowAnalysis
Parameters:
s - the statement to transfer through.


Copyright © 2003-2009 Anders Møller, Aske Simon Christensen, Asger Feldthaus.