Package jminusminus

Class NHIRPhiFunction

java.lang.Object
jminusminus.NHIRInstruction
jminusminus.NHIRPhiFunction

class NHIRPhiFunction extends NHIRInstruction
HIR instruction representing phi functions.
  • Constructor Details

    • NHIRPhiFunction

      public NHIRPhiFunction(NBasicBlock block, int id, ArrayList<Integer> arguments, int local)
      Constructs an NHIRPhiFunction object.
      Parameters:
      block - enclosing block.
      id - identifier of the instruction.
      arguments - list of HIR ids of arguments for the phi function.
      local - local variable index.
  • Method Details

    • getArguments

      public ArrayList<Integer> getArguments()
      Returns a list containing the ids of arguments for this phi function.
      Returns:
      a list containing the ids of arguments for this phi function.
    • getLocal

      public int getLocal()
      Returns the local variable index for this phi function.
      Returns:
      the local variable index for this phi function.
    • inferType

      public void inferType()
      Infers type for this phi function, which is essentially the type of the arguments.
    • toLir

      public NLIRInstruction toLir()
      Converts and returns a low-level representation (LIR) of this HIR instruction. Also adds the returned LIR instruction to the list of LIR instructions for the block containing this instruction, along with any other intermediate LIR instructions needed.
      Overrides:
      toLir in class NHIRInstruction
      Returns:
      the LIR instruction corresponding to this HIR instruction.
    • toString

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