diff options
author | John McCall <rjmccall@apple.com> | 2012-08-25 01:12:56 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2012-08-25 01:12:56 +0000 |
commit | 2612e9f1d0a356a303097bea9faf53fdb213c50c (patch) | |
tree | a683a72e786b6a698a12558b5c6fa886b58c3307 /lib/AST/MicrosoftMangle.cpp | |
parent | 3682f1ea9c7fddc7dcbc590891158ba40f7fca16 (diff) |
Fix the mangling of function pointers in the MS ABI.
Patch by Timur Iskhodzhanov!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162638 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/MicrosoftMangle.cpp')
-rw-r--r-- | lib/AST/MicrosoftMangle.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/AST/MicrosoftMangle.cpp b/lib/AST/MicrosoftMangle.cpp index e2cee7f52c..7263190f46 100644 --- a/lib/AST/MicrosoftMangle.cpp +++ b/lib/AST/MicrosoftMangle.cpp @@ -1059,6 +1059,8 @@ void MicrosoftCXXNameMangler::mangleType(const FunctionProtoType *T, SourceRange) { // Structors only appear in decls, so at this point we know it's not a // structor type. + // FIXME: This may not be lambda-friendly. + Out << "$$A6"; mangleType(T, NULL, false, false); } void MicrosoftCXXNameMangler::mangleType(const FunctionNoProtoType *T, @@ -1214,7 +1216,7 @@ void MicrosoftCXXNameMangler::mangleCallingConvention(const FunctionType *T, if (CC == CC_Default) { if (IsInstMethod) { const FunctionProtoType *FPT = - T->getCanonicalTypeUnqualified().getAs<FunctionProtoType>(); + T->getCanonicalTypeUnqualified().castAs<FunctionProtoType>(); bool isVariadic = FPT->isVariadic(); CC = getASTContext().getDefaultCXXMethodCallConv(isVariadic); } else { @@ -1497,7 +1499,9 @@ void MicrosoftCXXNameMangler::mangleType(const ObjCObjectType *T, void MicrosoftCXXNameMangler::mangleType(const BlockPointerType *T, SourceRange Range) { Out << "_E"; - mangleType(T->getPointeeType(), Range); + + QualType pointee = T->getPointeeType(); + mangleType(pointee->castAs<FunctionProtoType>(), NULL, false, false); } void MicrosoftCXXNameMangler::mangleType(const InjectedClassNameType *T, |