summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-12-03 18:24:43 +0000
committerDouglas Gregor <dgregor@apple.com>2011-12-03 18:24:43 +0000
commitfb9968d6f11f7d8e85362f092445b95f94a55724 (patch)
tree93ecbf3d1065002edfc4f860d1b6e5032becf9ed /clang/lib/AST
parentdca70af22f74c8a298def2b262f6f5fc277a34f0 (diff)
downloadbcm5719-llvm-fb9968d6f11f7d8e85362f092445b95f94a55724.tar.gz
bcm5719-llvm-fb9968d6f11f7d8e85362f092445b95f94a55724.zip
Fix mangling substitutions for address-space-qualified class
types. Patch from Dmitri Rubinstein! llvm-svn: 145776
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/ItaniumMangle.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/clang/lib/AST/ItaniumMangle.cpp b/clang/lib/AST/ItaniumMangle.cpp
index b2e1d20ca01..1e71a627ce9 100644
--- a/clang/lib/AST/ItaniumMangle.cpp
+++ b/clang/lib/AST/ItaniumMangle.cpp
@@ -2984,8 +2984,15 @@ bool CXXNameMangler::mangleSubstitution(const NamedDecl *ND) {
return mangleSubstitution(reinterpret_cast<uintptr_t>(ND));
}
+/// \brief Determine whether the given type has any qualifiers that are
+/// relevant for substitutions.
+static bool hasMangledSubstitutionQualifiers(QualType T) {
+ Qualifiers Qs = T.getQualifiers();
+ return Qs.getCVRQualifiers() || Qs.hasAddressSpace();
+}
+
bool CXXNameMangler::mangleSubstitution(QualType T) {
- if (!T.getCVRQualifiers()) {
+ if (!hasMangledSubstitutionQualifiers(T)) {
if (const RecordType *RT = T->getAs<RecordType>())
return mangleSubstitution(RT->getDecl());
}
@@ -3171,7 +3178,7 @@ bool CXXNameMangler::mangleStandardSubstitution(const NamedDecl *ND) {
}
void CXXNameMangler::addSubstitution(QualType T) {
- if (!T.getCVRQualifiers()) {
+ if (!hasMangledSubstitutionQualifiers(T)) {
if (const RecordType *RT = T->getAs<RecordType>()) {
addSubstitution(RT->getDecl());
return;
OpenPOWER on IntegriCloud