Fix a bug (that I thought I had fixed already) where mangling a prefix could get us into an infinite loop

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68168 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp
index 427cc76..cd97b5d 100644
--- a/lib/CodeGen/Mangle.cpp
+++ b/lib/CodeGen/Mangle.cpp
@@ -219,8 +219,8 @@
   //           ::= # 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());