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 | fdae6f7cd3c5c41e0c5631743e54876edcd4a725 (patch) | |
tree | 517aa7488199835d9524b28a4cff449ac738a459 /clang/lib/CodeGen | |
parent | 4118ec557183bc15594f8a5f4bef5a6284a1f529 (diff) | |
download | bcm5719-llvm-fdae6f7cd3c5c41e0c5631743e54876edcd4a725.tar.gz bcm5719-llvm-fdae6f7cd3c5c41e0c5631743e54876edcd4a725.zip |
Mangler: Split isStdNamespace for when the caller already has a NamespaceDecl.
llvm-svn: 89550
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/Mangle.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/Mangle.cpp b/clang/lib/CodeGen/Mangle.cpp index 377b7f421d7..095fb45fd8b 100644 --- a/clang/lib/CodeGen/Mangle.cpp +++ b/clang/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. |