[cfe-commits] r64470 - in /cfe/trunk: lib/CodeGen/CGObjCMac.cpp test/CodeGenObjC/no-category-class.m
Fariborz Jahanian
fjahanian at apple.com
Fri Feb 13 09:52:23 PST 2009
Author: fjahanian
Date: Fri Feb 13 11:52:22 2009
New Revision: 64470
URL: http://llvm.org/viewvc/llvm-project?rev=64470&view=rev
Log:
Fixed a 64bit code gen bug of a cateogory
implementation with no category declaration!
Added:
cfe/trunk/test/CodeGenObjC/no-category-class.m
Modified:
cfe/trunk/lib/CodeGen/CGObjCMac.cpp
Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=64470&r1=64469&r2=64470&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Fri Feb 13 11:52:22 2009
@@ -3849,17 +3849,23 @@
Methods);
const ObjCCategoryDecl *Category =
Interface->FindCategoryDeclaration(OCD->getIdentifier());
- Values[4] = EmitProtocolList("\01l_OBJC_CATEGORY_PROTOCOLS_$_"
- + Interface->getNameAsString() + "_$_"
- + Category->getNameAsString(),
- Category->protocol_begin(),
- Category->protocol_end());
-
- std::string ExtName(Interface->getNameAsString() + "_$_" +
- OCD->getNameAsString());
- Values[5] =
- EmitPropertyList(std::string("\01l_OBJC_$_PROP_LIST_") + ExtName,
- OCD, Category, ObjCTypes);
+ if (Category) {
+ std::string ExtName(Interface->getNameAsString() + "_$_" +
+ OCD->getNameAsString());
+ Values[4] = EmitProtocolList("\01l_OBJC_CATEGORY_PROTOCOLS_$_"
+ + Interface->getNameAsString() + "_$_"
+ + Category->getNameAsString(),
+ Category->protocol_begin(),
+ Category->protocol_end());
+ Values[5] =
+ EmitPropertyList(std::string("\01l_OBJC_$_PROP_LIST_") + ExtName,
+ OCD, Category, ObjCTypes);
+ }
+ else {
+ Values[4] = llvm::Constant::getNullValue(ObjCTypes.ProtocolListnfABIPtrTy);
+ Values[5] = llvm::Constant::getNullValue(ObjCTypes.PropertyListPtrTy);
+ }
+
llvm::Constant *Init =
llvm::ConstantStruct::get(ObjCTypes.CategorynfABITy,
Values);
Added: cfe/trunk/test/CodeGenObjC/no-category-class.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/no-category-class.m?rev=64470&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjC/no-category-class.m (added)
+++ cfe/trunk/test/CodeGenObjC/no-category-class.m Fri Feb 13 11:52:22 2009
@@ -0,0 +1,8 @@
+// RUN: clang -triple x86_64-unknown-unknown -emit-llvm -o %t %s
+
+ at interface NSObject
+ at end
+
+ at implementation NSObject(IBXLIFFIntegration)
+ at end
+
More information about the cfe-commits
mailing list