[PATCH] D66328: [DebugInfo] Add debug location to dynamic atexit destructor

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 19 13:17:20 PDT 2019


rnk added a comment.

I'd be happy to take this patch, address the comments, and land it, if you don't want to deal with all the nits.



================
Comment at: test/CodeGen/debug-info-no-location.cpp:1
+// RUN: %clang -cc1 -emit-llvm %s -gcodeview -debug-info-kind=limited -o - | FileCheck %s
+// CHECK: call void @"??1?$c at UB@@@@QEAA at XZ"(%struct.c* @"?f@?1??d@@YAPEAU?$c at UB@@@@XZ at 4U2@A"), !dbg !51
----------------
I think the `%clang_cc1` substitution is preferred, it sets the resource directory.


================
Comment at: test/CodeGen/debug-info-no-location.cpp:4
+// CHECK-NEXT: ret void, !dbg !51
+// CHECK: !48 = distinct !DISubprogram(name: "`dynamic atexit destructor for 'f'", scope: !3, file: !3, line: 16, type: !49, scopeLine: 16, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !27, retainedNodes: !29)
+// CHECK: !51 = !DILocation(line: 16, scope: !48)
----------------
aprantl wrote:
> Please don't hardcode metadata numbers in the tests, this is bound to break almost immediately.
> 
> It seems like this function is compiler-generated and thus should be marked as artificial?
I think using an artificial location (line 0) is consistent with other calls to StartFunction in CGDeclCXX.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66328/new/

https://reviews.llvm.org/D66328





More information about the cfe-commits mailing list