// $Id: DelocalizedImmed.java,v 1.4 1999/12/10 12:27:19 mpp Exp $

package IR2;

import java.util.Enumeration;

public class DelocalizedImmed implements DelocalizedRValue {
  private long value;

  public DelocalizedImmed(long v) {
    value = v;
  }

  /* Yeah, I'm breaking abstraction barriers.  At this point, who cares? */
  public long get_value() { return value; }

  /* DelocalizedRValue */
  // The proxy is a "real" variable to use instead of this "imaginary" one.
  protected DelocalizedRValue proxy = null;
  public DelocalizedRValue rproxy() {
    return proxy != null ? proxy.rproxy() : this;
  }

  public void load_into_reg(Codegen c, DelocalizedRegister r) {
    c.generate_load_immediate(r, value);
  }

  public String toString() { return "[" + value + "]"; }
}
