harpoon.Analysis.Maps
Interface ConstMap

All Known Implementing Classes:
BitWidthAnalysis, ConstMapProxy, DefaultMap, SCCAnalysis, SimpleConstMap

public interface ConstMap

ConstMap is a mapping from temporaries to their constant values.

Version:
$Id: ConstMap.java,v 1.3 2002/02/25 20:58:09 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>

Method Summary
 Object constMap(HCodeElement hce, Temp t)
          Determine the constant value of a given temporary in the context of a specific definition.
 boolean isConst(HCodeElement hce, Temp t)
          Determine whether a given temporary has a constant value at the specified definition point.
 

Method Detail

isConst

public boolean isConst(HCodeElement hce,
                       Temp t)
Determine whether a given temporary has a constant value at the specified definition point.

Parameters:
hce - the definition point.
t - the Temp to be examined.
Returns:
true is the given definition point can be proven to give the specified Temp a constant value, false otherwise.

constMap

public Object constMap(HCodeElement hce,
                       Temp t)
Determine the constant value of a given temporary in the context of a specific definition.

Parameters:
hce - the definition point.
t - the temporary to be examined.
Returns:
an object corresponding to the constant value of this temporary defined at this point. Values of base types get wrapped in objects in the standard way.
Throws:
Error - if isConst(hce, t) is false.