[cfe-commits] r89550 - /cfe/trunk/lib/CodeGen/Mangle.cpp

Daniel Dunbar daniel at zuster.org
Sat Nov 21 01:11:45 PST 2009


Author: ddunbar
Date: Sat Nov 21 03:11:45 2009
New Revision: 89550

URL: http://llvm.org/viewvc/llvm-project?rev=89550&view=rev
Log:
Mangler: Split isStdNamespace for when the caller already has a NamespaceDecl.

Modified:
    cfe/trunk/lib/CodeGen/Mangle.cpp

Modified: cfe/trunk/lib/CodeGen/Mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/Mangle.cpp?rev=89550&r1=89549&r2=89550&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/Mangle.cpp (original)
+++ cfe/trunk/lib/CodeGen/Mangle.cpp Sat Nov 21 03:11:45 2009
@@ -277,15 +277,16 @@
   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.





More information about the cfe-commits mailing list