aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ItaniumMangle.cpp
diff options
context:
space:
mode:
authorJames Molloy <james.molloy@arm.com>2012-03-05 09:59:43 +0000
committerJames Molloy <james.molloy@arm.com>2012-03-05 09:59:43 +0000
commitb3c312ce4d94a037a83ba6df6650b0317b15edd1 (patch)
tree9a7851a79cdb72b0a15346ef3badadb5883d1c72 /lib/AST/ItaniumMangle.cpp
parent2a2781805a6b55573d369e34c5dcfba307ce83e9 (diff)
Fix a bug in the mangler where in 'namespace std { extern "C" {X;} }', X would not be seen to be in ::std::.
Migrate two other places where the same logic is used to use the helper function that already exists. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152022 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ItaniumMangle.cpp')
-rw-r--r--lib/AST/ItaniumMangle.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/AST/ItaniumMangle.cpp b/lib/AST/ItaniumMangle.cpp
index 48e2a62c88..b7b04434d8 100644
--- a/lib/AST/ItaniumMangle.cpp
+++ b/lib/AST/ItaniumMangle.cpp
@@ -553,8 +553,7 @@ void CXXNameMangler::mangleName(const NamedDecl *ND) {
return;
}
- while (isa<LinkageSpecDecl>(DC))
- DC = getEffectiveParentContext(DC);
+ DC = IgnoreLinkageSpecDecls(DC);
if (DC->isTranslationUnit() || isStdNamespace(DC)) {
// Check if we have a template.
@@ -594,7 +593,8 @@ void CXXNameMangler::mangleName(const TemplateDecl *TD,
void CXXNameMangler::mangleUnscopedName(const NamedDecl *ND) {
// <unscoped-name> ::= <unqualified-name>
// ::= St <unqualified-name> # ::std::
- if (isStdNamespace(getEffectiveDeclContext(ND)))
+
+ if (isStdNamespace(IgnoreLinkageSpecDecls(getEffectiveDeclContext(ND))))
Out << "St";
mangleUnqualifiedName(ND);
@@ -1393,8 +1393,7 @@ void CXXNameMangler::manglePrefix(const DeclContext *DC, bool NoFunction) {
// ::= # empty
// ::= <substitution>
- while (isa<LinkageSpecDecl>(DC))
- DC = getEffectiveParentContext(DC);
+ DC = IgnoreLinkageSpecDecls(DC);
if (DC->isTranslationUnit())
return;