// $Id: IntImmedExpr.java,v 1.1.1.1 1999/12/05 22:19:51 mpp Exp $

package IR2;

import java.util.*;

public class IntImmedExpr extends ImmedExpr {
  protected long value;

  public IntImmedExpr(long v) { value = v; }
  public IntImmedExpr(int v)  { value = v; }

  public String desc() { return "" + value; }

  public DelocalizedRValue generate_rvalue_asm
    (MethodDescriptor d, Codegen c, CFG output) {
    return new DelocalizedImmed(value);
  }


  /* Part of the crude hack in NegOpExpr to deal with MININT.  Kill it later.*/
  /* OK, it's going to stick around after all.  It's also used in the
   * algebraic_simplify() optimization, and hell, it'll probably be
   * used elsewhere. --Chris */
  public long get_value() { return value; }


  /* Typed implementation. */
  public int get_type() { return Typed.INT; }

  /* Walkable implementation. */
  public String node_name() {
	return "int_immed_expr " + value;
  }
  public Enumeration neighbors() {
	return new ShortEnumeration();
  }

}
