aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-04-16 18:34:20 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-04-16 18:34:20 +0000
commit1e9aef31545b2312ddfc5ac2593ad8e48754e2c6 (patch)
tree2f9d79dcd6f152ae0cf305757f19fddcb64cc417
parent3201f6beec688ab9fe8750527e28f52d5420e22d (diff)
Category method synbols must be qualified by gategory name to
match gcc's. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69305 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGObjCMac.cpp6
-rw-r--r--test/CodeGenObjC/metadata_symbols.m6
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index 629ea80945..9d45ff6404 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -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 += ' ';
diff --git a/test/CodeGenObjC/metadata_symbols.m b/test/CodeGenObjC/metadata_symbols.m
index 55dc5a38f5..1a1d1e1d98 100644
--- a/test/CodeGenObjC/metadata_symbols.m
+++ b/test/CodeGenObjC/metadata_symbols.m
@@ -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