diff options
| author | lachsinc <lachlansinclair@gmail.com> | 2018-10-05 16:49:48 +1000 |
|---|---|---|
| committer | lachsinc <lachlansinclair@gmail.com> | 2018-10-05 16:49:48 +1000 |
| commit | 992502f03b347b10db3bf45e31e93a02ba2f9b82 (patch) | |
| tree | ef9037791d6727f8e4d6d9bbd0d76b8e007faa40 /src/ir_print.cpp | |
| parent | edc3a9392a35b7a3c90f6503617ccc2a1fb5a372 (diff) | |
Add debug info for proc ptrs.
Diffstat (limited to 'src/ir_print.cpp')
| -rw-r--r-- | src/ir_print.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp index e880f8c9c..ef7e701da 100644 --- a/src/ir_print.cpp +++ b/src/ir_print.cpp @@ -1964,6 +1964,7 @@ void print_llvm_ir(irGen *ir) { break; case irDebugInfo_Proc: // TODO(lachsinc): We need to store scope info inside di, not just file info, for procs. + // Should all subprograms have distinct ?? ir_fprintf(f, "distinct !DISubprogram(" "name: \"%.*s\"" ", linkageName: \"%.*s\"" @@ -1976,7 +1977,7 @@ void print_llvm_ir(irGen *ir) { ", flags: DIFlagPrototyped" ", isOptimized: false" ", unit: !%d" - ", type: !DISubroutineType(types: !%d)", + ", type: !%d", LIT(di->Proc.entity->token.string), LIT(di->Proc.name), di->Proc.file->id, // TODO(lachsinc): HACK For now lets pretend all procs scope's == file. @@ -1984,9 +1985,13 @@ void print_llvm_ir(irGen *ir) { di->Proc.pos.line, di->Proc.pos.line, // NOTE(lachsinc): Assume scopeLine always same as line. m->debug_compile_unit->id, - di->Proc.types->id); + di->Proc.type->id); ir_write_byte(f, ')'); // !DISubprogram( break; + case irDebugInfo_ProcType: + ir_fprintf(f, "!DISubroutineType(types: !%d)", + di->ProcType.types->id); + break; case irDebugInfo_Location: GB_ASSERT_NOT_NULL(di->Location.scope); ir_fprintf(f, "!DILocation(" |