summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/MicrosoftMangle.cpp
diff options
context:
space:
mode:
authorAndrey Bokhanko <andreybokhanko@gmail.com>2016-04-15 08:03:51 +0000
committerAndrey Bokhanko <andreybokhanko@gmail.com>2016-04-15 08:03:51 +0000
commitf7fa634887cf327ebca2a71327631ee00f0057a8 (patch)
tree6115bdd74d32215b36ca02a348f2eb780a95b716 /clang/lib/AST/MicrosoftMangle.cpp
parent18e69f4f635434eefadb35caffef71d2b429933c (diff)
downloadbcm5719-llvm-f7fa634887cf327ebca2a71327631ee00f0057a8.tar.gz
bcm5719-llvm-f7fa634887cf327ebca2a71327631ee00f0057a8.zip
[MSVC Compat] Implementation of __unaligned (MS extension) as a type qualifier
This patch implements __unaligned as a type qualifier; before that, it was modeled as an attribute. Proper mangling of __unaligned is implemented as well. Some OpenCL code/tests are tangenially affected, as they relied on existing number and sizes of type qualifiers. Differential Revision: http://reviews.llvm.org/D18596 llvm-svn: 266415
Diffstat (limited to 'clang/lib/AST/MicrosoftMangle.cpp')
-rw-r--r--clang/lib/AST/MicrosoftMangle.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp
index c9caddbb6fc..617e22d3b30 100644
--- a/clang/lib/AST/MicrosoftMangle.cpp
+++ b/clang/lib/AST/MicrosoftMangle.cpp
@@ -1444,6 +1444,9 @@ void MicrosoftCXXNameMangler::manglePointerExtQualifiers(Qualifiers Quals,
(PointeeType.isNull() || !PointeeType->isFunctionType()))
Out << 'E';
+ if (!PointeeType.isNull() && PointeeType.getLocalQualifiers().hasUnaligned())
+ Out << 'F';
+
if (HasRestrict)
Out << 'I';
}
@@ -1577,6 +1580,8 @@ void MicrosoftCXXNameMangler::mangleType(QualType T, SourceRange Range,
}
break;
case QMM_Result:
+ // Presence of __unaligned qualifier shouldn't affect mangling here.
+ Quals.removeUnaligned();
if ((!IsPointer && Quals) || isa<TagType>(T)) {
Out << '?';
mangleQualifiers(Quals, false);
OpenPOWER on IntegriCloud