diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-12-03 18:24:43 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-12-03 18:24:43 +0000 |
commit | 14795c86f1c37874afa332a7b9bc18e6a02bf420 (patch) | |
tree | 5a10005f10bc15ff4101d0a5ade1adedca693810 /lib/AST/ItaniumMangle.cpp | |
parent | 5e9392ba18f5925e26cc5714d1412eda0d219826 (diff) |
Fix mangling substitutions for address-space-qualified class
types. Patch from Dmitri Rubinstein!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145776 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ItaniumMangle.cpp')
-rw-r--r-- | lib/AST/ItaniumMangle.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/AST/ItaniumMangle.cpp b/lib/AST/ItaniumMangle.cpp index b2e1d20ca0..1e71a627ce 100644 --- a/lib/AST/ItaniumMangle.cpp +++ b/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; |