[cfe-commits] r66175 - /cfe/trunk/lib/CodeGen/CGObjCMac.cpp
Fariborz Jahanian
fjahanian at apple.com
Thu Mar 5 11:17:32 PST 2009
Author: fjahanian
Date: Thu Mar 5 13:17:31 2009
New Revision: 66175
URL: http://llvm.org/viewvc/llvm-project?rev=66175&view=rev
Log:
Adds a template for a function for objc2's gc's ivar layout
bitmap.
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=66175&r1=66174&r2=66175&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Thu Mar 5 13:17:31 2009
@@ -395,6 +395,11 @@
/// name. The return value has type char *.
llvm::Constant *GetClassName(IdentifierInfo *Ident);
+ /// GetIvarLayoutName - Returns a unique constant for the given
+ /// ivar layout bitmap.
+ llvm::Constant *GetIvarLayoutName(IdentifierInfo *Ident,
+ const ObjCCommonTypesHelper &ObjCTypes);
+
const RecordDecl *GetFirstIvarInRecord(const ObjCInterfaceDecl *OID,
RecordDecl::field_iterator &FIV,
RecordDecl::field_iterator &PIV);
@@ -1467,7 +1472,7 @@
Values[ 8] = llvm::Constant::getNullValue(ObjCTypes.CachePtrTy);
Values[ 9] = Protocols;
// FIXME: Set ivar_layout
- Values[10] = llvm::Constant::getNullValue(ObjCTypes.Int8PtrTy);
+ Values[10] = GetIvarLayoutName(0, ObjCTypes);
Values[11] = EmitClassExtension(ID);
llvm::Constant *Init = llvm::ConstantStruct::get(ObjCTypes.ClassTy,
Values);
@@ -1598,7 +1603,7 @@
std::vector<llvm::Constant*> Values(3);
Values[0] = llvm::ConstantInt::get(ObjCTypes.IntTy, Size);
// FIXME: Output weak_ivar_layout string.
- Values[1] = llvm::Constant::getNullValue(ObjCTypes.Int8PtrTy);
+ Values[1] = GetIvarLayoutName(0, ObjCTypes);
Values[2] = EmitPropertyList("\01L_OBJC_$_PROP_LIST_" + ID->getNameAsString(),
ID, ID->getClassInterface(), ObjCTypes);
@@ -2437,6 +2442,13 @@
return getConstantGEP(Entry, 0, 0);
}
+/// GetIvarLayoutName - Returns a unique constant for the given
+/// ivar layout bitmap.
+llvm::Constant *CGObjCCommonMac::GetIvarLayoutName(IdentifierInfo *Ident,
+ const ObjCCommonTypesHelper &ObjCTypes) {
+ return llvm::Constant::getNullValue(ObjCTypes.Int8PtrTy);
+}
+
llvm::Constant *CGObjCCommonMac::GetMethodVarName(Selector Sel) {
llvm::GlobalVariable *&Entry = MethodVarNames[Sel];
@@ -3568,7 +3580,7 @@
Values[ 2] = llvm::ConstantInt::get(ObjCTypes.IntTy, InstanceSize);
// FIXME. For 64bit targets add 0 here.
// FIXME. ivarLayout is currently null!
- Values[ 3] = llvm::Constant::getNullValue(ObjCTypes.Int8PtrTy);
+ Values[ 3] = GetIvarLayoutName(0, ObjCTypes);
Values[ 4] = GetClassName(ID->getIdentifier());
// const struct _method_list_t * const baseMethods;
std::vector<llvm::Constant*> Methods;
@@ -3618,7 +3630,7 @@
else
Values[ 7] = EmitIvarList(ID);
// FIXME. weakIvarLayout is currently null.
- Values[ 8] = llvm::Constant::getNullValue(ObjCTypes.Int8PtrTy);
+ Values[ 8] = GetIvarLayoutName(0, ObjCTypes);
if (flags & CLS_META)
Values[ 9] = llvm::Constant::getNullValue(ObjCTypes.PropertyListPtrTy);
else
More information about the cfe-commits
mailing list