diff options
author | James Molloy <james.molloy@arm.com> | 2012-03-05 09:59:43 +0000 |
---|---|---|
committer | James Molloy <james.molloy@arm.com> | 2012-03-05 09:59:43 +0000 |
commit | 7583ccdc1f1d78e2a4b906a8ad9b55b0a1efcc4c (patch) | |
tree | 9fc3bf495c23eadafe267ccd9b282e304c93e867 /clang/lib/AST/ItaniumMangle.cpp | |
parent | 5db541304f237bd133aad1f8b58ac35a58e42253 (diff) | |
download | bcm5719-llvm-7583ccdc1f1d78e2a4b906a8ad9b55b0a1efcc4c.tar.gz bcm5719-llvm-7583ccdc1f1d78e2a4b906a8ad9b55b0a1efcc4c.zip |
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.
llvm-svn: 152022
Diffstat (limited to 'clang/lib/AST/ItaniumMangle.cpp')
-rw-r--r-- | clang/lib/AST/ItaniumMangle.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/AST/ItaniumMangle.cpp b/clang/lib/AST/ItaniumMangle.cpp index 48e2a62c887..b7b04434d82 100644 --- a/clang/lib/AST/ItaniumMangle.cpp +++ b/clang/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; |