Class LogicalOperationInstr
java.lang.Object
org.ek9lang.compiler.ir.IRInstr
org.ek9lang.compiler.ir.LogicalOperationInstr
- All Implemented Interfaces:
INode
IR instruction for logical operations (AND/OR) with short-circuit capability.
This high-level instruction provides a declarative approach to Boolean operations, allowing backends to choose between short-circuit and full evaluation strategies: - LLVM: Lower to conditional branches with PHI nodes - JVM: Lower to bytecode jumps or full method calls - Other backends: Optimize based on target-specific capabilities
Contains complete evaluation paths for both operands and the logical result. Backends can use the primitive boolean condition to make short-circuit decisions.
Format: LOGICAL_AND_BLOCK/OR_BLOCK result = left_operand, condition, right_evaluation, logical_result
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The type of logical operation. -
Method Summary
Modifier and TypeMethodDescriptionstatic IRInstr
andOperation
(LogicalDetails logicalDetails) Create logical AND operation.Get the primitive boolean condition variable name.Get the conditional evaluation record.Get the left operand evaluation record.Get the left operand evaluation instructions.Get the left operand variable name.Get the variable name that holds the logical operation result.Get the operation type (AND or OR).Get the logical operation context record.Get the result computation instructions.Get the result evaluation record.Get the right operand evaluation record.Get the right operand evaluation instructions.Get the variable name that holds the right operand EK9 Boolean.Get the scope ID for memory management.static IRInstr
orOperation
(LogicalDetails logicalDetails) Create logical OR operation.toString()
Methods inherited from class org.ek9lang.compiler.ir.IRInstr
accept, addOperand, addOperands, equals, getDebugInfo, getOpcode, getOperands, getResult, hashCode, hasResult, isControlFlow, isLabel, isMemoryManagement, isMethodCall
-
Method Details
-
andOperation
Create logical AND operation. -
orOperation
Create logical OR operation. -
getOperation
Get the operation type (AND or OR). -
getLeftEvaluationInstructions
-
getLeftOperand
Get the left operand variable name. -
getCondition
Get the primitive boolean condition variable name. -
getRightEvaluationInstructions
-
getRightOperand
Get the variable name that holds the right operand EK9 Boolean. -
getResultComputationInstructions
-
getLogicalResult
Get the variable name that holds the logical operation result. -
getScopeId
Get the scope ID for memory management. -
getLeftEvaluation
Get the left operand evaluation record. -
getConditionalEvaluation
Get the conditional evaluation record. -
getRightEvaluation
Get the right operand evaluation record. -
getResultEvaluation
Get the result evaluation record. -
getOperationContext
Get the logical operation context record. -
toString
-