[cfe-commits] r132791 - in /cfe/trunk: lib/AST/ItaniumMangle.cpp test/CodeGenObjCXX/mangle.mm

Fariborz Jahanian fjahanian at apple.com
Thu Jun 9 12:25:01 PDT 2011


Author: fjahanian
Date: Thu Jun  9 14:25:01 2011
New Revision: 132791

URL: http://llvm.org/viewvc/llvm-project?rev=132791&view=rev
Log:
Don't add objc method name mangling to locally declared function.
// rdar://9566314

Modified:
    cfe/trunk/lib/AST/ItaniumMangle.cpp
    cfe/trunk/test/CodeGenObjCXX/mangle.mm

Modified: cfe/trunk/lib/AST/ItaniumMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ItaniumMangle.cpp?rev=132791&r1=132790&r2=132791&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ItaniumMangle.cpp (original)
+++ cfe/trunk/lib/AST/ItaniumMangle.cpp Thu Jun  9 14:25:01 2011
@@ -1122,6 +1122,12 @@
   //              := Z <function encoding> E s [<discriminator>]
   // <discriminator> := _ <non-negative number>
   const DeclContext *DC = ND->getDeclContext();
+  if (isa<ObjCMethodDecl>(DC) && isa<FunctionDecl>(ND)) {
+    // Don't add objc method name mangling to locally declared function
+    mangleUnqualifiedName(ND);
+    return;
+  }
+
   Out << 'Z';
 
   if (const ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(DC)) {

Modified: cfe/trunk/test/CodeGenObjCXX/mangle.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/mangle.mm?rev=132791&r1=132790&r2=132791&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/mangle.mm (original)
+++ cfe/trunk/test/CodeGenObjCXX/mangle.mm Thu Jun  9 14:25:01 2011
@@ -42,3 +42,15 @@
 }
 @end
 
+// rdar://9566314
+ at interface NX
+- (void)Meth;
+ at end
+
+ at implementation NX
+- (void)Meth {
+  void uiIsVisible();
+// CHECK: call void @_Z11uiIsVisiblev
+  uiIsVisible();
+}
+ at end





More information about the cfe-commits mailing list