Class IRInstr
java.lang.Object
org.ek9lang.compiler.ir.instructions.IRInstr
- All Implemented Interfaces:
INode
- Direct Known Subclasses:
BranchInstr
,CallInstr
,ControlFlowChainInstr
,GuardedAssignmentBlockInstr
,LabelInstr
,LiteralInstr
,LogicalOperationInstr
,MemoryInstr
,QuestionOperatorInstr
,ScopeInstr
Base class for all IR instructions in the EK9 intermediate representation.
Each instruction represents a single operation in the target-agnostic IR, which can be translated to JVM bytecode, LLVM IR, or other target formats.
The subclasses from this calls will actually hold the appropriate details accessible via method calls. The idea is not to have to parse or process these operands. Its just very useful to see a human-readable form when debugging and also for testing IR output.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate instruction with no result (e.g., STORE, BRANCH).Create instruction with result destination (e.g., LOAD, CALL).Create instruction with result and debug information. -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(INodeVisitor visitor) addOperand
(String operand) Add operand to this instruction.addOperands
(String... operands) Add multiple operands to this instruction.boolean
Get debug information for this instruction.Get escape analysis metadata for this instruction.boolean
Check if this instruction has escape analysis metadata.int
hashCode()
boolean
Check if this instruction produces a result value.boolean
Check if this instruction is a control flow type.boolean
isLabel()
Check if this instruction is a label marker for control flow.boolean
Check if this instruction is a memory management type.boolean
Check if this instruction is a method call type.void
setEscapeMetaData
(EscapeMetaDataDetails escapeMetaData) Set escape analysis metadata for this instruction.toString()
-
Constructor Details
-
IRInstr
Create instruction with no result (e.g., STORE, BRANCH). -
IRInstr
-
IRInstr
-
-
Method Details
-
addOperand
-
addOperands
-
getOpcode
-
getResult
-
getOperands
-
getDebugInfo
-
getEscapeMetaData
Get escape analysis metadata for this instruction. -
setEscapeMetaData
Set escape analysis metadata for this instruction. Should only be called during IR_OPTIMISATION phase. -
hasEscapeMetaData
public boolean hasEscapeMetaData()Check if this instruction has escape analysis metadata. -
hasResult
public boolean hasResult()Check if this instruction produces a result value. -
isMethodCall
public boolean isMethodCall()Check if this instruction is a method call type. -
isControlFlow
public boolean isControlFlow()Check if this instruction is a control flow type. -
isMemoryManagement
public boolean isMemoryManagement()Check if this instruction is a memory management type. -
isLabel
public boolean isLabel()Check if this instruction is a label marker for control flow. -
accept
-
toString
-
equals
-
hashCode
-