]> granicus.if.org Git - clang/commitdiff
modern objective-c translator: couple of minor
authorFariborz Jahanian <fjahanian@apple.com>
Tue, 20 Mar 2012 17:34:50 +0000 (17:34 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Tue, 20 Mar 2012 17:34:50 +0000 (17:34 +0000)
changes to how meta-data is declared.
// rdar://11076938

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153098 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Rewrite/RewriteModernObjC.cpp
test/Rewriter/objc-modern-ivar-receiver-1.mm

index aee89f11b2b62307bf4bda11af95f2cf7c5571b5..cbae6906776dcdf78e4a794c017ea522a8793321 100644 (file)
@@ -5269,7 +5269,7 @@ void RewriteModernObjC::RewriteIvarOffsetComputation(ObjCIvarDecl *ivar,
 
 /// struct _class_t {
 ///   struct _class_t *isa;
-///   struct _class_t * const superclass;
+///   struct _class_t *superclass;
 ///   void *cache;
 ///   IMP *vtable;
 ///   struct _class_ro_t *ro;
@@ -5354,7 +5354,7 @@ static void WriteModernMetadataDeclarations(ASTContext *Context, std::string &Re
   
   Result += "\nstruct _class_t {\n";
   Result += "\tstruct _class_t *isa;\n";
-  Result += "\tstruct _class_t *const superclass;\n";
+  Result += "\tstruct _class_t *superclass;\n";
   Result += "\tvoid *cache;\n";
   Result += "\tvoid *vtable;\n";
   Result += "\tstruct _class_ro_t *ro;\n";
@@ -5369,7 +5369,7 @@ static void WriteModernMetadataDeclarations(ASTContext *Context, std::string &Re
   Result += "\tconst struct _prop_list_t *const properties;\n";
   Result += "};\n";
   
-  Result += "extern void *_objc_empty_cache;\n";
+  Result += "__declspec(dllimport) extern struct objc_cache _objc_empty_cache;\n";
   Result += "extern void *_objc_empty_vtable;\n";
   
   meta_data_declared = true;
index 5ffcdd49698e3179edb35b018125b115098fd327..b5078c7cc818ea0bf16b5342039e77318dc707f0 100644 (file)
@@ -26,3 +26,6 @@ void *sel_registerName(const char *);
 @end
 
 // CHECK: id obj = (*(id *)((char *)newInv + OBJC_IVAR_$_NSInvocation$_container));
+// rdar://11076938
+// CHECK: struct _class_t *superclass;
+// CHECK: __declspec(dllimport) extern struct objc_cache _objc_empty_cache;