harpoon.Analysis.Quads.SCC
Class SCCOptimize

java.lang.Object
  extended by harpoon.Analysis.Quads.SCC.SCCOptimize
All Implemented Interfaces:
ExecMap

public final class SCCOptimize
extends Object
implements ExecMap

SCCOptimize optimizes the code after SCCAnalysis. The optimization invalidates the ExecMap used. All edges in the graph after optimization are executable. (Edges leaving a CALL quad may be an exception if your ExecMap marks one or both of the edges leaving the CALL non-executable.)

Version:
$Id: SCCOptimize.java,v 1.6 2004/02/08 01:53:44 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>

Constructor Summary
SCCOptimize(SCCAnalysis scc)
           
SCCOptimize(TypeMap ti, ConstMap cm, ExecMap em)
          Creates an SCCOptimize.
 
Method Summary
static HCodeFactory codeFactory(HCodeFactory parent)
          Returns a code factory that uses SCCOptimize.
 boolean execMap(HCodeEdge e)
          Returns the executable status of an HCodeEdge.
 boolean execMap(HCodeElement node)
          Returns the executable status of an HCodeElement.
 void optimize(HCode hc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SCCOptimize

public SCCOptimize(TypeMap ti,
                   ConstMap cm,
                   ExecMap em)
Creates an SCCOptimize.


SCCOptimize

public SCCOptimize(SCCAnalysis scc)
Method Detail

codeFactory

public static HCodeFactory codeFactory(HCodeFactory parent)
Returns a code factory that uses SCCOptimize.


execMap

public boolean execMap(HCodeEdge e)
Description copied from interface: ExecMap
Returns the executable status of an HCodeEdge.

Specified by:
execMap in interface ExecMap
Parameters:
e - An edge between two HCodeElements in some HCode.
Returns:
true if it is possible to traverse this edge during execution, or false if it can be proved that this edge will never be followed.

execMap

public boolean execMap(HCodeElement node)
Description copied from interface: ExecMap
Returns the executable status of an HCodeElement.

Specified by:
execMap in interface ExecMap
Parameters:
node - The HCodeElement to examine.
Returns:
true if it is possible to execute this HCodeElement; or false if it can be proved that this HCodeElement will never be executed.

optimize

public void optimize(HCode hc)