001
002/*
003 * THIS FILE IS MACHINE_GENERATED. DO NOT EDIT.
004 * See InstructionFormats.template, InstructionFormatList.dat,
005 * OperatorList.dat, etc.
006 */
007
008package org.jikesrvm.compilers.opt.ir;
009
010import org.jikesrvm.Configuration;
011import org.jikesrvm.compilers.opt.ir.operand.*;
012
013/**
014 * The Empty InstructionFormat class.
015 *
016 * The header comment for {@link Instruction} contains
017 * an explanation of the role of InstructionFormats in the
018 * opt compiler's IR.
019 */
020@SuppressWarnings("unused")  // Machine generated code is never 100% clean
021public final class Empty extends InstructionFormat {
022  /**
023   * InstructionFormat identification method for Empty.
024   * @param i an instruction
025   * @return <code>true</code> if the InstructionFormat of the argument
026   *         instruction is Empty or <code>false</code>
027   *         if it is not.
028   */
029  public static boolean conforms(Instruction i) {
030    return conforms(i.operator());
031  }
032  /**
033   * InstructionFormat identification method for Empty.
034   * @param o an instruction
035   * @return <code>true</code> if the InstructionFormat of the argument
036   *         operator is Empty or <code>false</code>
037   *         if it is not.
038   */
039  public static boolean conforms(Operator o) {
040    return o.format == Empty_format;
041  }
042
043
044  /**
045   * Create an instruction of the Empty instruction format.
046   * @param o the instruction's operator
047   * @return the newly created Empty instruction
048   */
049  public static Instruction create(Operator o
050                )
051  {
052    if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "Empty");
053    Instruction i = Instruction.create(o, 5);
054    return i;
055  }
056
057  /**
058   * Mutate the argument instruction into an instruction of the
059   * Empty instruction format having the specified
060   * operator and operands.
061   * @param i the instruction to mutate
062   * @param o the instruction's operator
063   * @return the mutated instruction
064   */
065  public static Instruction mutate(Instruction i, Operator o
066                )
067  {
068    if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "Empty");
069    i.changeOperatorTo(o);
070    return i;
071  }
072}
073