1 cananian 1.1 // ConstMap.java, created Wed Aug 19 01:05:58 1998 by cananian 2 cananian 1.2 // Copyright (C) 1998 C. Scott Ananian <cananian@alumni.princeton.edu> 3 cananian 1.2 // Licensed under the terms of the GNU GPL; see COPYING for details. 4 cananian 1.1 package harpoon.Analysis.Maps; 5 cananian 1.1 6 cananian 1.1 import harpoon.Temp.Temp; 7 cananian 1.2.2.1 import harpoon.ClassFile.HCodeElement; 8 cananian 1.1 /** 9 cananian 1.1 * <code>ConstMap</code> is a mapping from temporaries to their constant 10 cananian 1.1 * values. 11 cananian 1.1 * 12 cananian 1.1 * @author C. Scott Ananian <cananian@alumni.princeton.edu> 13 cananian 1.4 * @version $Id: ConstMap.java,v 1.4 2002/09/02 19:23:26 cananian Exp $ 14 cananian 1.1 */ 15 cananian 1.1 16 cananian 1.4 public interface ConstMap<HCE extends HCodeElement> { 17 cananian 1.1 /** 18 cananian 1.2.2.1 * Determine whether a given temporary has a constant value at 19 cananian 1.2.2.1 * the specified definition point. 20 cananian 1.2.2.1 * @param hce the definition point. 21 cananian 1.1 * @param t the <code>Temp</code> to be examined. 22 cananian 1.2.2.1 * @return <code>true</code> is the given definition point can 23 cananian 1.2.2.1 * be proven to give the specified <code>Temp</code> a 24 cananian 1.2.2.1 * constant value, <code>false</code> otherwise. 25 cananian 1.1 */ 26 cananian 1.4 public boolean isConst(HCE hce, Temp t); 27 cananian 1.1 /** 28 cananian 1.2.2.1 * Determine the constant value of a given temporary in the 29 cananian 1.2.2.1 * context of a specific definition. 30 cananian 1.2.2.1 * @param hce the definition point. 31 cananian 1.1 * @param t the temporary to be examined. 32 cananian 1.1 * @return an object corresponding to the constant value of this 33 cananian 1.2.2.1 * temporary defined at this point. Values of base types 34 cananian 1.2.2.1 * get wrapped in objects in the standard way. 35 cananian 1.2.2.1 * @exception Error if <code>isConst(hce, t)</code> is false. 36 cananian 1.1 */ 37 cananian 1.4 public Object constMap(HCE hce, Temp t); 38 cananian 1.1 }