Class IRInstruction
java.lang.Object
org.ek9lang.compiler.ir.IRInstruction
- All Implemented Interfaces:
INode
- Direct Known Subclasses:
BranchInstruction
,CallInstruction
,LiteralInstruction
,MemoryInstruction
,ScopeInstruction
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.
-
Constructor Summary
ConstructorsConstructorDescriptionIRInstruction
(IROpcode opcode) Create instruction with no result (e.g., STORE, BRANCH).IRInstruction
(IROpcode opcode, String result) Create instruction with result destination (e.g., LOAD, CALL).IRInstruction
(IROpcode opcode, String result, DebugInfo debugInfo) 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.int
hashCode()
boolean
Check if this instruction produces a result value.boolean
Check if this instruction is a control flow type.boolean
Check if this instruction is a memory management type.boolean
Check if this instruction is a method call type.toString()
-
Constructor Details
-
IRInstruction
Create instruction with no result (e.g., STORE, BRANCH). -
IRInstruction
-
IRInstruction
-
-
Method Details
-
addOperand
Add operand to this instruction. -
addOperands
Add multiple operands to this instruction. -
getOpcode
-
getResult
-
getOperands
-
getDebugInfo
-
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. -
accept
-
toString
-
equals
-
hashCode
-