translator: add && and || operators
This commit is contained in:
@@ -713,8 +713,10 @@ abstract class BlockCodegen(val state: TranslationState, val variableManager: Va
|
|||||||
fun addPrimitiveReferenceOperationByName(operator: String, firstOp: LLVMSingleValue, secondNativeOp: LLVMSingleValue): LLVMExpression {
|
fun addPrimitiveReferenceOperationByName(operator: String, firstOp: LLVMSingleValue, secondNativeOp: LLVMSingleValue): LLVMExpression {
|
||||||
val firstNativeOp = codeBuilder.receiveNativeValue(firstOp)
|
val firstNativeOp = codeBuilder.receiveNativeValue(firstOp)
|
||||||
return when (operator) {
|
return when (operator) {
|
||||||
|
"||",
|
||||||
"or" -> firstNativeOp.type!!.operatorOr(firstNativeOp, secondNativeOp)
|
"or" -> firstNativeOp.type!!.operatorOr(firstNativeOp, secondNativeOp)
|
||||||
"xor" -> firstNativeOp.type!!.operatorXor(firstNativeOp, secondNativeOp)
|
"xor" -> firstNativeOp.type!!.operatorXor(firstNativeOp, secondNativeOp)
|
||||||
|
"&&",
|
||||||
"and" -> firstNativeOp.type!!.operatorAnd(firstNativeOp, secondNativeOp)
|
"and" -> firstNativeOp.type!!.operatorAnd(firstNativeOp, secondNativeOp)
|
||||||
"%" -> firstNativeOp.type!!.operatorMod(firstNativeOp, secondNativeOp)
|
"%" -> firstNativeOp.type!!.operatorMod(firstNativeOp, secondNativeOp)
|
||||||
"shl" -> {
|
"shl" -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user