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