[cfe-commits] r43409 - in /cfe/trunk: Driver/RewriteTest.cpp clang.xcodeproj/project.pbxproj
Fariborz Jahanian
fjahanian at apple.com
Fri Oct 26 16:09:28 PDT 2007
Author: fjahanian
Date: Fri Oct 26 18:09:28 2007
New Revision: 43409
URL: http://llvm.org/viewvc/llvm-project?rev=43409&view=rev
Log:
Path to synthesize 'instance' size field of _objc_class metadata.
Modified:
cfe/trunk/Driver/RewriteTest.cpp
cfe/trunk/clang.xcodeproj/project.pbxproj
Modified: cfe/trunk/Driver/RewriteTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/RewriteTest.cpp?rev=43409&r1=43408&r2=43409&view=diff
==============================================================================
--- cfe/trunk/Driver/RewriteTest.cpp (original)
+++ cfe/trunk/Driver/RewriteTest.cpp Fri Oct 26 18:09:28 2007
@@ -88,8 +88,6 @@
std::string &Result);
void SynthesizeObjcInternalStruct(ObjcInterfaceDecl *CDecl,
std::string &Result);
- void RewriteObjcInternalStructs(ObjcImplementationDecl *IDecl,
- std::string &Result);
void SynthesizeIvarOffsetComputation(ObjcImplementationDecl *IDecl,
ObjcIvarDecl *ivar,
std::string &Result);
@@ -795,9 +793,9 @@
? IDecl->getImplDeclNumIvars()
: (CDecl ? CDecl->getIntfDeclNumIvars() : 0);
+ SynthesizeObjcInternalStruct(CDecl, Result);
+
if (NumIvars > 0) {
- SynthesizeObjcInternalStruct(CDecl, Result);
-
static bool objc_ivar = false;
if (!objc_ivar) {
/* struct _objc_ivar {
@@ -971,8 +969,15 @@
Result += "\"";
}
// 'info' field is initialized to CLS_CLASS(1) for class
- // TODO: instance_size is curently set to 0.
- Result += ", 0,1,0";
+ Result += ", 0,1";
+ if (!ObjcSynthesizedStructs.count(CDecl))
+ Result += ",0";
+ else {
+ // class has size. Must synthesize its size.
+ Result += ",sizeof(struct _interface_";
+ Result += CDecl->getName();
+ Result += ")";
+ }
if (NumIvars > 0) {
Result += ", &_OBJC_INSTANCE_VARIABLES_";
Result += CDecl->getName();
Modified: cfe/trunk/clang.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/clang.xcodeproj/project.pbxproj?rev=43409&r1=43408&r2=43409&view=diff
==============================================================================
--- cfe/trunk/clang.xcodeproj/project.pbxproj (original)
+++ cfe/trunk/clang.xcodeproj/project.pbxproj Fri Oct 26 18:09:28 2007
@@ -756,6 +756,7 @@
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */;
+ compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
mainGroup = 08FB7794FE84155DC02AAC07 /* clang */;
projectDirPath = "";
More information about the cfe-commits
mailing list