translator: add neq operator for reference type

This commit is contained in:
Alexey Stepanov
2016-08-11 19:22:54 +03:00
parent 742d7647d9
commit ddbcfe2f85
@@ -28,4 +28,7 @@ class LLVMReferenceType(val type: String, var prefix: String = "", override val
override fun operatorEq(firstOp: LLVMSingleValue, secondOp: LLVMSingleValue): LLVMExpression =
LLVMExpression(LLVMBooleanType(), "icmp eq ${firstOp.getType()} $firstOp, ${if (secondOp.type is LLVMNullType) "null" else "$secondOp"}")
override fun operatorNeq(firstOp: LLVMSingleValue, secondOp: LLVMSingleValue): LLVMExpression =
LLVMExpression(LLVMBooleanType(), "icmp neq ${firstOp.getType()} $firstOp, ${if (secondOp.type is LLVMNullType) "null" else "$secondOp"}")
}