Add support for converting member pointer types to LLVM types. Also mangle pointer to member functions correctly and add tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71981 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp
index c27ef4f..c09a13a 100644
--- a/lib/CodeGen/Mangle.cpp
+++ b/lib/CodeGen/Mangle.cpp
@@ -608,7 +608,12 @@
// <pointer-to-member-type> ::= M <class type> <member type>
Out << 'M';
mangleType(QualType(T->getClass(), 0));
- mangleType(T->getPointeeType());
+ QualType PointeeType = T->getPointeeType();
+ if (const FunctionProtoType *FPT = dyn_cast<FunctionProtoType>(PointeeType)) {
+ mangleCVQualifiers(FPT->getTypeQuals());
+ mangleType(FPT);
+ } else
+ mangleType(PointeeType);
}
void CXXNameMangler::mangleType(const TemplateTypeParmType *T) {