From: Eli Friedman Date: Mon, 1 Jul 2013 21:29:48 +0000 (+0000) Subject: Simplify code in mangler. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=47be5bb24df2c91012ecd432546184cceee2c64c;p=clang Simplify code in mangler. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185384 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ItaniumMangle.cpp b/lib/AST/ItaniumMangle.cpp index bbdf0f93d1..394e70759a 100644 --- a/lib/AST/ItaniumMangle.cpp +++ b/lib/AST/ItaniumMangle.cpp @@ -553,7 +553,8 @@ void CXXNameMangler::mangleName(const NamedDecl *ND) { // is that of the containing namespace, or the translation unit. // FIXME: This is a hack; extern variables declared locally should have // a proper semantic declaration context! - if (isa(DC) && ND->hasLinkage() && !isLambda(ND)) + if ((isa(DC) || isa(DC)) && + ND->hasLinkage() && !isLambda(ND)) while (!DC->isNamespace() && !DC->isTranslationUnit()) DC = getEffectiveParentContext(DC); else if (GetLocalClassDecl(ND)) { @@ -1272,11 +1273,6 @@ void CXXNameMangler::mangleLocalName(const NamedDecl *ND) { // _ // := _ const DeclContext *DC = getEffectiveDeclContext(ND); - if (isa(DC) && isa(ND)) { - // Don't add objc method name mangling to locally declared function - mangleUnqualifiedName(ND); - return; - } Out << 'Z';