summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-21 09:11:45 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-21 09:11:45 +0000
commitfdae6f7cd3c5c41e0c5631743e54876edcd4a725 (patch)
tree517aa7488199835d9524b28a4cff449ac738a459 /clang/lib/CodeGen
parent4118ec557183bc15594f8a5f4bef5a6284a1f529 (diff)
downloadbcm5719-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.cpp11
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.
OpenPOWER on IntegriCloud