summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-01-19 19:20:56 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-01-19 19:20:56 +0000
commit2c705ca98dee05e4dd9a3360eb2ccca5ff8a8102 (patch)
tree32f3cd98411a8ebc73ff7dac9e8b543cdd302f7b /clang/lib/CodeGen/CGDebugInfo.cpp
parentf23bf14ee482d12b62f9b24008e5b8c501124d1b (diff)
downloadbcm5719-llvm-2c705ca98dee05e4dd9a3360eb2ccca5ff8a8102.tar.gz
bcm5719-llvm-2c705ca98dee05e4dd9a3360eb2ccca5ff8a8102.zip
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. llvm-svn: 172911
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 1a326824fd3..27ccc3b494f 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/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,
OpenPOWER on IntegriCloud