summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/MicrosoftMangle.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2012-08-25 01:12:56 +0000
committerJohn McCall <rjmccall@apple.com>2012-08-25 01:12:56 +0000
commit3351dc397ba46f24c79ae3655fa62b85dd84ec86 (patch)
treed7ba57ec04cf16054644984a0b0dfabf88164c15 /clang/lib/AST/MicrosoftMangle.cpp
parent0a0aa84da3300f4b5c8c7b5c7778940770a96323 (diff)
downloadbcm5719-llvm-3351dc397ba46f24c79ae3655fa62b85dd84ec86.tar.gz
bcm5719-llvm-3351dc397ba46f24c79ae3655fa62b85dd84ec86.zip
Fix the mangling of function pointers in the MS ABI.
Patch by Timur Iskhodzhanov! llvm-svn: 162638
Diffstat (limited to 'clang/lib/AST/MicrosoftMangle.cpp')
-rw-r--r--clang/lib/AST/MicrosoftMangle.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp
index e2cee7f52cf..7263190f466 100644
--- a/clang/lib/AST/MicrosoftMangle.cpp
+++ b/clang/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,
OpenPOWER on IntegriCloud