Package iota

Class NLirInstruction

java.lang.Object
iota.NLirInstruction
Direct Known Subclasses:
NLirArithmetic, NLirCall, NLirCopy, NLirIConst, NLirInc, NLirJump, NLirLoad, NLirPhiFunction, NLirRead, NLirStore, NLirWrite

abstract class NLirInstruction extends Object
An abstract low-level intermediate representation (LIR) of an HIR instruction.
  • Field Details

    • lir2Marvin

      protected static HashMap<String,String> lir2Marvin
      Maps LIR mnemonic to the corresponding Marvin mnemonic. For example, maps "push" to "pushr".
    • block

      public NBasicBlock block
      Enclosing basic block.
    • id

      public int id
      Instruction id.
    • mnemonic

      public String mnemonic
      Instruction mnemonic.
    • reads

      public ArrayList<NRegister> reads
      Input registers (if any).
    • write

      public NRegister write
      Output register (if any).
  • Constructor Details

    • NLirInstruction

      protected NLirInstruction(NBasicBlock block, int id, String mnemonic)
      Constructs an NLirInstruction object.
      Parameters:
      block - enclosing block.
      id - instruction id.
      mnemonic - instruction mnemonic.
  • Method Details

    • id

      public String id()
      Returns the id of this instruction as a string.
      Returns:
      Returns the id of this instruction as a string.
    • toMarvin

      public void toMarvin()
      Converts this instruction to the corresponding Marvin instruction.
    • toString

      public String toString()
      Returns a string representation of this instruction.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this instruction.