Package jminusminus
Class NHIRPhiFunction
java.lang.Object
jminusminus.NHIRInstruction
jminusminus.NHIRPhiFunction
HIR instruction representing phi functions.
-
Field Summary
Fields inherited from class jminusminus.NHIRInstruction
block, hirMnemonic, id, lir, lType, sType
-
Constructor Summary
ConstructorDescriptionNHIRPhiFunction
(NBasicBlock block, int id, ArrayList<Integer> arguments, int local) Constructs an NHIRPhiFunction object. -
Method Summary
Modifier and TypeMethodDescriptionReturns a list containing the ids of arguments for this phi function.int
getLocal()
Returns the local variable index for this phi function.void
Infers type for this phi function, which is essentially the type of the arguments.toLir()
Converts and returns a low-level representation (LIR) of this HIR instruction.toString()
Returns a string representation of this instruction.Methods inherited from class jminusminus.NHIRInstruction
equals, id
-
Constructor Details
-
NHIRPhiFunction
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
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
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 classNHIRInstruction
- Returns:
- the LIR instruction corresponding to this HIR instruction.
-
toString
Returns a string representation of this instruction.- Overrides:
toString
in classNHIRInstruction
- Returns:
- a string representation of this instruction.
-