summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2013-07-01 21:29:48 +0000
committerEli Friedman <eli.friedman@gmail.com>2013-07-01 21:29:48 +0000
commitd02bbeb44eded6f1b5f5c3f727042ea37050002a (patch)
tree7a5993e5184de124822c45f8cce33156b071a49e
parent74c188f0268cc9c8fcafe13fc04eee0a592c64ae (diff)
downloadbcm5719-llvm-d02bbeb44eded6f1b5f5c3f727042ea37050002a.tar.gz
bcm5719-llvm-d02bbeb44eded6f1b5f5c3f727042ea37050002a.zip
Simplify code in mangler.
llvm-svn: 185384
-rw-r--r--clang/lib/AST/ItaniumMangle.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/clang/lib/AST/ItaniumMangle.cpp b/clang/lib/AST/ItaniumMangle.cpp
index bbdf0f93d16..394e70759a7 100644
--- a/clang/lib/AST/ItaniumMangle.cpp
+++ b/clang/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<FunctionDecl>(DC) && ND->hasLinkage() && !isLambda(ND))
+ if ((isa<FunctionDecl>(DC) || isa<ObjCMethodDecl>(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) {
// _ <entity name>
// <discriminator> := _ <non-negative number>
const DeclContext *DC = getEffectiveDeclContext(ND);
- if (isa<ObjCMethodDecl>(DC) && isa<FunctionDecl>(ND)) {
- // Don't add objc method name mangling to locally declared function
- mangleUnqualifiedName(ND);
- return;
- }
Out << 'Z';
OpenPOWER on IntegriCloud