Class IRInstr
java.lang.Object
org.ek9lang.compiler.ir.IRInstr
- All Implemented Interfaces:
INode
- Direct Known Subclasses:
BranchInstr
,CallInstr
,LiteralInstr
,MemoryInstr
,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.
-
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.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
-
IRInstr
Create instruction with no result (e.g., STORE, BRANCH). -
IRInstr
-
IRInstr
-
-
Method Details
-
addOperand
-
addOperands
-
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
-