]> granicus.if.org Git - clang/commitdiff
Use isFunctionOrMethod for vars declared locallly
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 30 Jun 2010 18:57:21 +0000 (18:57 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 30 Jun 2010 18:57:21 +0000 (18:57 +0000)
in method/blocks to decide not to mangle them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107309 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/Mangle.cpp

index 4d755ce957547ec325e0dcbc667ba5c9183af654..2ae1919a65f9a8bfbcf6088b01c91b8797d0328b 100644 (file)
@@ -294,7 +294,7 @@ bool MangleContext::shouldMangleDeclName(const NamedDecl *D) {
   if (!FD) {
     const DeclContext *DC = D->getDeclContext();
     // Check for extern variable declared locally.
-    if ((isa<FunctionDecl>(DC) || isa<ObjCMethodDecl>(DC) ) && D->hasLinkage())
+    if (DC->isFunctionOrMethod() && D->hasLinkage())
       while (!DC->isNamespace() && !DC->isTranslationUnit())
         DC = DC->getParent();
     if (DC->isTranslationUnit() && D->getLinkage() != InternalLinkage)