From 79d49f1955c7ae8509f1221fe533a1df5ef4bfaa Mon Sep 17 00:00:00 2001 From: lachsinc Date: Thu, 4 Oct 2018 13:43:52 +1000 Subject: Lexical block debug info. --- src/ir_print.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/ir_print.cpp') diff --git a/src/ir_print.cpp b/src/ir_print.cpp index beb465fdd..dc0a84900 100644 --- a/src/ir_print.cpp +++ b/src/ir_print.cpp @@ -1987,7 +1987,7 @@ void print_llvm_ir(irGen *ir) { di->Proc.types->id); ir_write_byte(f, ')'); // !DISubprogram( break; - case irDebugInfo_Location: { + case irDebugInfo_Location: GB_ASSERT_NOT_NULL(di->Location.scope); ir_fprintf(f, "!DILocation(" "line: %td" @@ -1996,7 +1996,20 @@ void print_llvm_ir(irGen *ir) { di->Location.pos.line, di->Location.pos.column, di->Location.scope->id); - break;} + break; + case irDebugInfo_LexicalBlock: + GB_ASSERT_NOT_NULL(di->LexicalBlock.file); + GB_ASSERT_NOT_NULL(di->LexicalBlock.scope); + ir_fprintf(f, "distinct !DILexicalBlock(" + "line: %td" + ", column: %td" + ", file: !%d" + ", scope: !%d)", + di->LexicalBlock.pos.line, + di->LexicalBlock.pos.column, + di->LexicalBlock.file->id, + di->LexicalBlock.scope->id); + break; case irDebugInfo_GlobalVariableExpression: { ir_fprintf(f, "!DIGlobalVariableExpression(" "var: !%d" -- cgit v1.2.3