]> granicus.if.org Git - clang/commitdiff
Fix a bug (that I thought I had fixed already) where mangling a prefix could get...
authorAnders Carlsson <andersca@mac.com>
Wed, 1 Apr 2009 00:42:16 +0000 (00:42 +0000)
committerAnders Carlsson <andersca@mac.com>
Wed, 1 Apr 2009 00:42:16 +0000 (00:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68168 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/Mangle.cpp

index 427cc76646b4b6cc8a641eb9912f1948e322c5b0..cd97b5d916c6bc5f6c5042799cc0ac850ff6d5af 100644 (file)
@@ -219,8 +219,8 @@ void CXXNameMangler::manglePrefix(const DeclContext *DC) {
   //           ::= # empty
   //           ::= <substitution>
   // FIXME: We only handle mangling of namespaces and classes at the moment.
-  if (DC->getParent() != DC)
-    manglePrefix(DC);
+  if (!DC->getParent()->isTranslationUnit())
+    manglePrefix(DC->getParent());
 
   if (const NamespaceDecl *Namespace = dyn_cast<NamespaceDecl>(DC))
     mangleSourceName(Namespace->getIdentifier());