From b66438eb8092ea93b255f0ba11f857b1d6ccb052 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 28 May 2019 18:18:52 -0400 Subject: no "use of undeclared identifer" in dead comptime branches --- src/ir_print.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/ir_print.cpp') diff --git a/src/ir_print.cpp b/src/ir_print.cpp index dd671231c0..bf9ced89c5 100644 --- a/src/ir_print.cpp +++ b/src/ir_print.cpp @@ -1461,6 +1461,10 @@ static void ir_print_has_decl(IrPrint *irp, IrInstructionHasDecl *instruction) { fprintf(irp->f, ")"); } +static void ir_print_undeclared_ident(IrPrint *irp, IrInstructionUndeclaredIdent *instruction) { + fprintf(irp->f, "@undeclaredIdent(%s)", buf_ptr(instruction->name)); +} + static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) { ir_print_prefix(irp, instruction); switch (instruction->id) { @@ -1931,6 +1935,9 @@ static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) { case IrInstructionIdHasDecl: ir_print_has_decl(irp, (IrInstructionHasDecl *)instruction); break; + case IrInstructionIdUndeclaredIdent: + ir_print_undeclared_ident(irp, (IrInstructionUndeclaredIdent *)instruction); + break; } fprintf(irp->f, "\n"); } -- cgit v1.2.3