translator: add && and || operators

This commit is contained in:
Alexey Stepanov
2016-08-18 19:09:22 +03:00
parent 8c3f100d24
commit f884bef128
@@ -713,8 +713,10 @@ abstract class BlockCodegen(val state: TranslationState, val variableManager: Va
fun addPrimitiveReferenceOperationByName(operator: String, firstOp: LLVMSingleValue, secondNativeOp: LLVMSingleValue): LLVMExpression {
val firstNativeOp = codeBuilder.receiveNativeValue(firstOp)
return when (operator) {
"||",
"or" -> firstNativeOp.type!!.operatorOr(firstNativeOp, secondNativeOp)
"xor" -> firstNativeOp.type!!.operatorXor(firstNativeOp, secondNativeOp)
"&&",
"and" -> firstNativeOp.type!!.operatorAnd(firstNativeOp, secondNativeOp)
"%" -> firstNativeOp.type!!.operatorMod(firstNativeOp, secondNativeOp)
"shl" -> {