aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 0642fbd7ec..06f9b295b9 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -1230,11 +1230,6 @@ static LLVMValueRef ir_render_un_op(CodeGen *g, IrExecutable *executable, IrInst
zig_unreachable();
}
}
- case IrUnOpBoolNot:
- {
- LLVMValueRef zero = LLVMConstNull(LLVMTypeOf(expr));
- return LLVMBuildICmp(g->builder, LLVMIntEQ, expr, zero, "");
- }
case IrUnOpBinNot:
return LLVMBuildNot(g->builder, expr, "");
case IrUnOpAddressOf:
@@ -1339,6 +1334,12 @@ static LLVMValueRef ir_render_un_op(CodeGen *g, IrExecutable *executable, IrInst
zig_unreachable();
}
+static LLVMValueRef ir_render_bool_not(CodeGen *g, IrExecutable *executable, IrInstructionBoolNot *instruction) {
+ LLVMValueRef value = ir_llvm_value(g, instruction->value);
+ LLVMValueRef zero = LLVMConstNull(LLVMTypeOf(value));
+ return LLVMBuildICmp(g->builder, LLVMIntEQ, value, zero, "");
+}
+
static LLVMValueRef ir_render_decl_var(CodeGen *g, IrExecutable *executable,
IrInstructionDeclVar *decl_var_instruction)
{
@@ -1927,6 +1928,7 @@ static LLVMValueRef ir_render_instruction(CodeGen *g, IrExecutable *executable,
case IrInstructionIdCDefine:
case IrInstructionIdCUndef:
case IrInstructionIdEmbedFile:
+ case IrInstructionIdIntType:
zig_unreachable();
case IrInstructionIdReturn:
return ir_render_return(g, executable, (IrInstructionReturn *)instruction);
@@ -1984,6 +1986,8 @@ static LLVMValueRef ir_render_instruction(CodeGen *g, IrExecutable *executable,
return ir_render_div_exact(g, executable, (IrInstructionDivExact *)instruction);
case IrInstructionIdTruncate:
return ir_render_truncate(g, executable, (IrInstructionTruncate *)instruction);
+ case IrInstructionIdBoolNot:
+ return ir_render_bool_not(g, executable, (IrInstructionBoolNot *)instruction);
case IrInstructionIdSwitchVar:
case IrInstructionIdContainerInitList:
case IrInstructionIdStructInit: