From: Adrian Prantl Date: Tue, 23 Dec 2014 19:11:54 +0000 (+0000) Subject: Debug Info: Pass the pointer size into createMemberPointerType(). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bafa8fc3830d832a21a5b2fd8aa8cd592f22109f;p=clang Debug Info: Pass the pointer size into createMemberPointerType(). Paired commit with LLVM. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224781 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 7a5c90a1cc..8b18b296f5 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -1889,7 +1889,8 @@ llvm::DIType CGDebugInfo::CreateType(const MemberPointerType *Ty, llvm::DIType ClassType = getOrCreateType(QualType(Ty->getClass(), 0), U); if (!Ty->getPointeeType()->isFunctionType()) return DBuilder.createMemberPointerType( - getOrCreateType(Ty->getPointeeType(), U), ClassType); + getOrCreateType(Ty->getPointeeType(), U), ClassType, + CGM.PointerWidthInBits); const FunctionProtoType *FPT = Ty->getPointeeType()->getAs(); @@ -1897,7 +1898,7 @@ llvm::DIType CGDebugInfo::CreateType(const MemberPointerType *Ty, getOrCreateInstanceMethodType(CGM.getContext().getPointerType(QualType( Ty->getClass(), FPT->getTypeQuals())), FPT, U), - ClassType); + ClassType, CGM.PointerWidthInBits); } llvm::DIType CGDebugInfo::CreateType(const AtomicType *Ty, llvm::DIFile U) { diff --git a/test/CodeGenCXX/debug-info-method.cpp b/test/CodeGenCXX/debug-info-method.cpp index 690193e10b..bb69a65165 100644 --- a/test/CodeGenCXX/debug-info-method.cpp +++ b/test/CodeGenCXX/debug-info-method.cpp @@ -2,7 +2,7 @@ // CHECK: !"_ZTS1A"} ; [ DW_TAG_class_type ] [A] // CHECK: !"{{.*}}\00_ZN1A3fooEiS_3$_0\00{{.*}}", {{.*}} [protected] // CHECK: ![[THISTYPE:[0-9]+]] = {{.*}} ; [ DW_TAG_pointer_type ] {{.*}} [artificial] [from _ZTS1A] -// CHECK: DW_TAG_ptr_to_member_type +// CHECK: [ DW_TAG_ptr_to_member_type ] [line {{[0-9]+}}, size {{[1-9][0-9]+}}, align // CHECK: {{.*}}![[MEMFUNTYPE:[0-9]+]], !{{.*}}} ; [ DW_TAG_ptr_to_member_type ] {{.*}} [from ] // CHECK: ![[MEMFUNTYPE]] = {{.*}}![[MEMFUNARGS:[0-9]+]], null, null, null} ; [ DW_TAG_subroutine_type ] {{.*}} [from ] // CHECK: ![[MEMFUNARGS]] = {{.*}}, ![[THISTYPE]],