Class BranchInstr
java.lang.Object
org.ek9lang.compiler.ir.IRInstr
org.ek9lang.compiler.ir.BranchInstr
-
Method Summary
Modifier and TypeMethodDescriptionaddOperand
(String operand) Add operand to this instruction.addOperands
(String... operands) Add multiple operands to this instruction.static BranchInstr
assertValue
(String condition) Create assert instruction: ASSERT condition.static BranchInstr
assertValue
(String condition, DebugInfo debugInfo) Create assert instruction with debug info: ASSERT condition.static BranchInstr
Create unconditional branch: BRANCH target_label.static BranchInstr
Create unconditional branch with debug info: BRANCH target_label.static BranchInstr
branchFalse
(String condition, String targetLabel) Create conditional branch (false): BRANCH_FALSE condition, target_label.static BranchInstr
branchFalse
(String condition, String targetLabel, DebugInfo debugInfo) Create conditional branch (false) with debug info: BRANCH_FALSE condition, target_label.static BranchInstr
branchTrue
(String condition, String targetLabel) Create conditional branch (true): BRANCH_TRUE condition, target_label.static BranchInstr
branchTrue
(String condition, String targetLabel, DebugInfo debugInfo) Create conditional branch (true) with debug info: BRANCH_TRUE condition, target_label.Get condition for conditional branch instructions.Get return value for RETURN instructions.Get target label for branch instructions.static BranchInstr
returnValue
(String value) Create return with value: RETURN value.static BranchInstr
returnValue
(String value, DebugInfo debugInfo) Create return with value and debug info: RETURN value.static BranchInstr
Create return with no value: RETURN.static BranchInstr
returnVoid
(DebugInfo debugInfo) Create return with no value and debug info: RETURN.Methods inherited from class org.ek9lang.compiler.ir.IRInstr
accept, equals, getDebugInfo, getOpcode, getOperands, getResult, hashCode, hasResult, isControlFlow, isMemoryManagement, isMethodCall, toString
-
Method Details
-
branch
Create unconditional branch: BRANCH target_label. -
branch
Create unconditional branch with debug info: BRANCH target_label. -
branchTrue
Create conditional branch (true): BRANCH_TRUE condition, target_label. -
branchTrue
Create conditional branch (true) with debug info: BRANCH_TRUE condition, target_label. -
branchFalse
Create conditional branch (false): BRANCH_FALSE condition, target_label. -
branchFalse
Create conditional branch (false) with debug info: BRANCH_FALSE condition, target_label. -
returnVoid
Create return with no value: RETURN. -
returnVoid
Create return with no value and debug info: RETURN. -
returnValue
Create return with value: RETURN value. -
returnValue
Create return with value and debug info: RETURN value. -
assertValue
Create assert instruction: ASSERT condition. -
assertValue
Create assert instruction with debug info: ASSERT condition. -
addOperand
Description copied from class:IRInstr
Add operand to this instruction.- Overrides:
addOperand
in classIRInstr
-
addOperands
Description copied from class:IRInstr
Add multiple operands to this instruction.- Overrides:
addOperands
in classIRInstr
-
getTargetLabel
Get target label for branch instructions. -
getCondition
Get condition for conditional branch instructions. -
getReturnValue
Get return value for RETURN instructions.
-