diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-01-19 19:20:56 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-01-19 19:20:56 +0000 |
commit | e8d7514d6adc149126d5cd47df95600389f0cb70 (patch) | |
tree | 2ff18967ae1649502b436b46741a1d999d5cd8d2 /lib/CodeGen/CGDebugInfo.cpp | |
parent | e38c339ca4059b03c6a6ac97d062c9187eb30a0f (diff) |
Emit the function type of member function pointer types the same as member functions.
Adding the pseudo first parameter to a member function pointer's function type
and mark it as artificial.
Combined with a fix to GDB ( http://sourceware.org/bugzilla/show_bug.cgi?id=14998 )
this fixes gdb.cp/member-ptr.exp with Clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172911 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 1a326824fd..27ccc3b494 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -1623,8 +1623,15 @@ llvm::DIType CGDebugInfo::CreateType(const RValueReferenceType *Ty, llvm::DIType CGDebugInfo::CreateType(const MemberPointerType *Ty, llvm::DIFile U) { - return DBuilder.createMemberPointerType(CreatePointeeType(Ty->getPointeeType(), U), - getOrCreateType(QualType(Ty->getClass(), 0), U)); + llvm::DIType ClassType = getOrCreateType(QualType(Ty->getClass(), 0), U); + if (!Ty->getPointeeType()->isFunctionType()) + return DBuilder.createMemberPointerType( + CreatePointeeType(Ty->getPointeeType(), U), ClassType); + return DBuilder.createMemberPointerType(getOrCreateInstanceMethodType( + CGM.getContext().getPointerType( + QualType(Ty->getClass(), Ty->getPointeeType().getCVRQualifiers())), + Ty->getPointeeType()->getAs<FunctionProtoType>(), U), + ClassType); } llvm::DIType CGDebugInfo::CreateType(const AtomicType *Ty, |