aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/Mangle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/Mangle.cpp')
-rw-r--r--lib/CodeGen/Mangle.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp
index 88e2e9425b..e6c3f1b42f 100644
--- a/lib/CodeGen/Mangle.cpp
+++ b/lib/CodeGen/Mangle.cpp
@@ -488,11 +488,13 @@ void CXXNameMangler::manglePrefix(const DeclContext *DC) {
// ::= <substitution>
// FIXME: We only handle mangling of namespaces and classes at the moment.
+ if (DC->isTranslationUnit())
+ return;
+
if (mangleSubstitution(cast<NamedDecl>(DC)))
return;
- if (!DC->getParent()->isTranslationUnit())
- manglePrefix(DC->getParent());
+ manglePrefix(DC->getParent());
if (const NamespaceDecl *Namespace = dyn_cast<NamespaceDecl>(DC))
mangleSourceName(Namespace->getIdentifier());