From fa7c64ccd511703fef9971c4d07c447c9aeda49c Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 18 Mar 2017 11:24:58 -0400 Subject: lazy analysis of top level declarations previously, we had lazy analysis of top level declarations, but if a declaration was referenced within a compile-time if or switch statement, that would still add the top level declaration to the resolution queue. now we have a declref ir instruction, which is only resolved if we analyze the instruction. this takes into account comptime branching. closes #270 --- src/codegen.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/codegen.cpp') diff --git a/src/codegen.cpp b/src/codegen.cpp index 5456fbce3d..a1dac1cca1 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -2519,6 +2519,7 @@ static LLVMValueRef ir_render_instruction(CodeGen *g, IrExecutable *executable, case IrInstructionIdCanImplicitCast: case IrInstructionIdSetGlobalAlign: case IrInstructionIdSetGlobalSection: + case IrInstructionIdDeclRef: zig_unreachable(); case IrInstructionIdReturn: return ir_render_return(g, executable, (IrInstructionReturn *)instruction); -- cgit v1.2.3