From: Anders Carlsson Date: Fri, 18 Sep 2009 18:39:58 +0000 (+0000) Subject: Change manglePrefix to return early if the DC is the translation unit. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9263e91e2e91aaf0eb72488f2a52648c086bef35;p=clang 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 --- 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());