]> granicus.if.org Git - clang/commitdiff
Category method synbols must be qualified by gategory name to
authorFariborz Jahanian <fjahanian@apple.com>
Thu, 16 Apr 2009 18:34:20 +0000 (18:34 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Thu, 16 Apr 2009 18:34:20 +0000 (18:34 +0000)
match gcc's.

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

lib/CodeGen/CGObjCMac.cpp
test/CodeGenObjC/metadata_symbols.m

index 629ea809459eb08b7c592fd964c1f8a4400c22ce..9d45ff640444c592b35500a9fb35053ad5b976b1 100644 (file)
@@ -3043,6 +3043,12 @@ void CGObjCCommonMac::GetNameForMethod(const ObjCMethodDecl *D,
   NameOut += '[';
   assert (CD && "Missing container decl in GetNameForMethod");
   NameOut += CD->getNameAsString();
+  if (const ObjCCategoryImplDecl *CID = 
+      dyn_cast<ObjCCategoryImplDecl>(D->getDeclContext())) {
+    NameOut += '(';
+    NameOut += CID->getNameAsString();
+    NameOut+= ')';
+  }
   // FIXME. For a method in a category, (CAT_NAME) is inserted here.
   // Right now! there is not enough info. to do this.
   NameOut += ' ';
index 55dc5a38f594fc6bf93e3145c3a2eaea690e9b04..1a1d1e1d981071ccc554c8203eaea37d1d9a3c29 100644 (file)
@@ -8,8 +8,7 @@
 // RUN: grep '@"OBJC_EHTYPE_$_EH3"' %t | count 3 &&
 // RUN: grep '@"\\01L_OBJC_CLASS_NAME_" =.*section "__TEXT,__cstring,cstring_literals", align 1' %t | count 1 &&
 // RUN: grep -F 'define internal void @"\01-[A im0]"' %t &&
-// FIXME: Should include category name.
-// RUN: grep -F 'define internal void @"\01-[A im1]"' %t &&
+// RUN: grep -F 'define internal void @"\01-[A(Cat) im1]"' %t &&
 
 // RUN: clang-cc -fvisibility=hidden -triple x86_64-apple-darwin9 -emit-llvm -o %t %s &&
 
@@ -19,8 +18,7 @@
 // RUN: grep '@"OBJC_EHTYPE_$_EH2" = external global' %t &&
 // RUN: grep '@"OBJC_EHTYPE_$_EH3" = hidden global .*section "__DATA,__objc_const", align 8' %t &&
 // RUN: grep -F 'define internal void @"\01-[A im0]"' %t &&
-// FIXME: Should include category name.
-// RUN: grep -F 'define internal void @"\01-[A im1]"' %t &&
+// RUN: grep -F 'define internal void @"\01-[A(Cat) im1]"' %t &&
 
 // RUN: true