From 09c34352f8a87ed9597b4af0de564aa7d831761a Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 19 Dec 2016 00:04:51 -0500 Subject: IR: if and switch guaranteed compile time if target expr is --- src/codegen.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/codegen.cpp') diff --git a/src/codegen.cpp b/src/codegen.cpp index ef72fd76a0..ada9bebf23 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -1646,8 +1646,6 @@ static LLVMValueRef ir_render_ctz(CodeGen *g, IrExecutable *executable, IrInstru } static LLVMValueRef ir_render_switch_br(CodeGen *g, IrExecutable *executable, IrInstructionSwitchBr *instruction) { - assert(!instruction->is_inline); - LLVMValueRef target_value = ir_llvm_value(g, instruction->target_value); LLVMBasicBlockRef else_block = instruction->else_block->llvm_block; LLVMValueRef switch_instr = LLVMBuildSwitch(g->builder, target_value, else_block, instruction->case_count); @@ -2197,6 +2195,7 @@ static LLVMValueRef ir_render_instruction(CodeGen *g, IrExecutable *executable, case IrInstructionIdMemberCount: case IrInstructionIdAlignOf: case IrInstructionIdFnProto: + case IrInstructionIdTestComptime: zig_unreachable(); case IrInstructionIdReturn: return ir_render_return(g, executable, (IrInstructionReturn *)instruction); @@ -2897,7 +2896,7 @@ static void do_code_gen(CodeGen *g) { if (!type_has_bits(var->type)) { continue; } - if (var->is_inline) + if (ir_get_var_is_comptime(var)) continue; if (var->src_arg_index == SIZE_MAX) { -- cgit v1.2.3