]> granicus.if.org Git - clang/commitdiff
PR22051: Missing debug location on calls in dtor thunks in Windows.
authorDavid Blaikie <dblaikie@gmail.com>
Mon, 29 Dec 2014 22:53:52 +0000 (22:53 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Mon, 29 Dec 2014 22:53:52 +0000 (22:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224963 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGVTables.cpp
test/CodeGenCXX/debug-info-windows-dtor.cpp [new file with mode: 0644]

index 1aff346978216591e728498a7d576085c7fc15b7..acb2a56fab309a141c85e4fd91299a6884e1fd17 100644 (file)
@@ -214,7 +214,7 @@ void CodeGenFunction::StartThunk(llvm::Function *Fn, GlobalDecl GD,
 
   // Start defining the function.
   StartFunction(GlobalDecl(), ResultType, Fn, FnInfo, FunctionArgs,
-                MD->getLocation(), SourceLocation());
+                MD->getLocation(), MD->getLocation());
 
   // Since we didn't pass a GlobalDecl to StartFunction, do this ourselves.
   CGM.getCXXABI().EmitInstanceFunctionProlog(*this);
diff --git a/test/CodeGenCXX/debug-info-windows-dtor.cpp b/test/CodeGenCXX/debug-info-windows-dtor.cpp
new file mode 100644 (file)
index 0000000..ddf4ac7
--- /dev/null
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -triple i386-unknown-windows-msvc -std=c++11 -emit-llvm -gline-tables-only %s -o - | FileCheck %s
+
+struct A {
+  virtual ~A() {}
+};
+
+struct B {
+  virtual ~B() {}
+};
+
+template<typename T>
+struct AB: A, B {
+};
+
+template struct AB<int>;
+
+// CHECK-LABEL: define {{.*}}@"\01??_E?$AB@H@@W3AEPAXI@Z"
+// CHECK: call {{.*}}@"\01??_G?$AB@H@@UAEPAXI@Z"({{.*}}) #{{[0-9]*}}, !dbg [[THUNK_LOC:![0-9]*]]
+// CHECK-LABEL: define
+
+// CHECK: [[THUNK_VEC_DEL_DTOR:![0-9]*]] = {{.*}} @"\01??_E?$AB@H@@W3AEPAXI@Z", {{.*}}; [ DW_TAG_subprogram ]
+// CHECK: [[THUNK_LOC]] = !{i32 15, i32 0, [[THUNK_VEC_DEL_DTOR]], null}