From: Fariborz Jahanian Date: Thu, 16 Apr 2009 18:34:20 +0000 (+0000) Subject: Category method synbols must be qualified by gategory name to X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1e9aef31545b2312ddfc5ac2593ad8e48754e2c6;p=clang 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 --- 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(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