diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-11-21 09:11:45 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-11-21 09:11:45 +0000 |
commit | 1308af913ecd176341caa506d8dfb637e1b25486 (patch) | |
tree | 717e8e12b1bf5949acbaa7c184a70d79d3485783 /lib/CodeGen/Mangle.cpp | |
parent | 77939c995da4ec0ed6c7e5bc8afa901d8cea9001 (diff) |
Mangler: Split isStdNamespace for when the caller already has a NamespaceDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89550 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/Mangle.cpp')
-rw-r--r-- | lib/CodeGen/Mangle.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp index 377b7f421d..095fb45fd8 100644 --- a/lib/CodeGen/Mangle.cpp +++ b/lib/CodeGen/Mangle.cpp @@ -277,15 +277,16 @@ void CXXNameMangler::mangleFunctionEncoding(const FunctionDecl *FD) { mangleBareFunctionType(FT, MangleReturnType); } -static bool isStdNamespace(const DeclContext *DC) { - if (!DC->isNamespace() || !DC->getParent()->isTranslationUnit()) - return false; - - const NamespaceDecl *NS = cast<NamespaceDecl>(DC); +static bool isStdNamespace(const NamespaceDecl *NS) { const IdentifierInfo *II = NS->getOriginalNamespace()->getIdentifier(); return II && II->isStr("std"); } +static bool isStdNamespace(const DeclContext *DC) { + return DC->isNamespace() && DC->getParent()->isTranslationUnit() && + isStdNamespace(cast<NamespaceDecl>(DC)); +} + static const TemplateDecl * isTemplate(const NamedDecl *ND, const TemplateArgumentList *&TemplateArgs) { // Check if we have a function template. |