diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-03-18 11:24:58 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-03-18 11:28:43 -0400 |
| commit | fa7c64ccd511703fef9971c4d07c447c9aeda49c (patch) | |
| tree | 6f41eb742160ec1584b6adb719ec1327f9e3c831 /src/codegen.cpp | |
| parent | af536ac343564e5120f99cbf3b7fc9efa984eb93 (diff) | |
| download | zig-fa7c64ccd511703fef9971c4d07c447c9aeda49c.tar.gz zig-fa7c64ccd511703fef9971c4d07c447c9aeda49c.zip | |
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
Diffstat (limited to 'src/codegen.cpp')
| -rw-r--r-- | src/codegen.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
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); |
