From: David Blaikie Date: Mon, 29 Dec 2014 22:53:52 +0000 (+0000) Subject: PR22051: Missing debug location on calls in dtor thunks in Windows. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1d3b4f1251fc344d9936194b0d6b2c2c3d24b235;p=clang PR22051: Missing debug location on calls in dtor thunks in Windows. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224963 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGVTables.cpp b/lib/CodeGen/CGVTables.cpp index 1aff346978..acb2a56fab 100644 --- a/lib/CodeGen/CGVTables.cpp +++ b/lib/CodeGen/CGVTables.cpp @@ -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 index 0000000000..ddf4ac7ae5 --- /dev/null +++ b/test/CodeGenCXX/debug-info-windows-dtor.cpp @@ -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 +struct AB: A, B { +}; + +template struct AB; + +// 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}