summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorTimur Iskhodzhanov <timurrrr@google.com>2012-07-26 10:41:15 +0000
committerTimur Iskhodzhanov <timurrrr@google.com>2012-07-26 10:41:15 +0000
commit25fabdbace8b2384fac2a473fd115f005f55a2d3 (patch)
treef50b89753cd1095e74f429d503e3970eee08ecb9 /clang/lib/AST
parent5651452076cb5d88562f9ac49487d4ed8dc76515 (diff)
downloadbcm5719-llvm-25fabdbace8b2384fac2a473fd115f005f55a2d3.tar.gz
bcm5719-llvm-25fabdbace8b2384fac2a473fd115f005f55a2d3.zip
Fix PR13389 (Wrong mangling of return type qualifiers with -cxx-abi microsoft)
llvm-svn: 160780
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/MicrosoftMangle.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp
index 467a45ef00c..f6a1f7d9d92 100644
--- a/clang/lib/AST/MicrosoftMangle.cpp
+++ b/clang/lib/AST/MicrosoftMangle.cpp
@@ -1090,8 +1090,15 @@ void MicrosoftCXXNameMangler::mangleType(const FunctionType *T,
else {
QualType Result = Proto->getResultType();
const Type* RT = Result.getTypePtr();
- if(isa<TagType>(RT) && !RT->isAnyPointerType() && !RT->isReferenceType())
- Out << "?A";
+ if (!RT->isAnyPointerType() && !RT->isReferenceType()) {
+ if (Result.hasQualifiers() || !RT->isBuiltinType())
+ Out << '?';
+ if (!RT->isBuiltinType() && !Result.hasQualifiers()) {
+ // Lack of qualifiers for user types is mangled as 'A'.
+ Out << 'A';
+ }
+ }
+
// FIXME: Get the source range for the result type. Or, better yet,
// implement the unimplemented stuff so we don't need accurate source
// location info anymore :).
OpenPOWER on IntegriCloud