From 9263e91e2e91aaf0eb72488f2a52648c086bef35 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Fri, 18 Sep 2009 18:39:58 +0000 Subject: [PATCH] Change manglePrefix to return early if the DC is the translation unit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82246 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/Mangle.cpp | 6 ++++-- 1 file 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) { // ::= // FIXME: We only handle mangling of namespaces and classes at the moment. + if (DC->isTranslationUnit()) + return; + if (mangleSubstitution(cast(DC))) return; - if (!DC->getParent()->isTranslationUnit()) - manglePrefix(DC->getParent()); + manglePrefix(DC->getParent()); if (const NamespaceDecl *Namespace = dyn_cast(DC)) mangleSourceName(Namespace->getIdentifier()); -- 2.50.1