Class BasicBlockInstr
java.lang.Object
org.ek9lang.compiler.ir.BasicBlockInstr
- All Implemented Interfaces:
INode
Represents a basic block in the EK9 IR - a sequence of instructions with single entry and exit.
Basic blocks are fundamental units of control flow analysis and optimization. Each block contains a linear sequence of instructions ending with a control flow instruction.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(INodeVisitor visitor) void
addInstruction
(IRInstr instruction) Add instruction to this basic block.void
addInstructions
(List<IRInstr> instructions) Add multiple instructions from a list.addInstructions
(IRInstr... instructions) Add multiple instructions to this basic block.addSuccessor
(BasicBlockInstr successor) Add successor basic block (control flow edge).boolean
Check if this block ends with a control flow instruction.boolean
getLabel()
Get the last instruction in this block (usually control flow).Get all memory management instructions in this block.Get all method call instructions in this block.int
hashCode()
boolean
isEmpty()
Check if this block is empty (no instructions).boolean
Check if this block is a terminator (ends with RETURN).toString()
-
Constructor Details
-
BasicBlockInstr
Create basic block with given label.
-
-
Method Details
-
addInstruction
Add instruction to this basic block. -
addInstructions
Add multiple instructions to this basic block. -
addInstructions
-
addSuccessor
Add successor basic block (control flow edge). -
getLabel
-
getInstructions
-
getPredecessors
-
getSuccessors
-
isEmpty
public boolean isEmpty()Check if this block is empty (no instructions). -
getLastInstruction
Get the last instruction in this block (usually control flow). -
endsWithControlFlow
public boolean endsWithControlFlow()Check if this block ends with a control flow instruction. -
isTerminator
public boolean isTerminator()Check if this block is a terminator (ends with RETURN). -
getMethodCalls
-
getMemoryManagementInstructions
-
accept
-
toString
-
equals
-
hashCode
-