summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/Mangle.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/Mangle.cpp b/clang/lib/CodeGen/Mangle.cpp
index 427cc76646b..cd97b5d916c 100644
--- a/clang/lib/CodeGen/Mangle.cpp
+++ b/clang/lib/CodeGen/Mangle.cpp
@@ -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());
OpenPOWER on IntegriCloud