[cfe-commits] r43311 - /cfe/trunk/Driver/RewriteTest.cpp

Fariborz Jahanian fjahanian at apple.com
Wed Oct 24 13:54:24 PDT 2007


Author: fjahanian
Date: Wed Oct 24 15:54:23 2007
New Revision: 43311

URL: http://llvm.org/viewvc/llvm-project?rev=43311&view=rev
Log:
Couple of minor changes. 1) Metaclass metadata also has a reference to
protocol meta-data (unlike what documentation says). 2) Include objc.h so,
we can compile the generated metadata with both gcc and clang.

Modified:
    cfe/trunk/Driver/RewriteTest.cpp

Modified: cfe/trunk/Driver/RewriteTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/RewriteTest.cpp?rev=43311&r1=43310&r2=43311&view=diff

==============================================================================
--- cfe/trunk/Driver/RewriteTest.cpp (original)
+++ cfe/trunk/Driver/RewriteTest.cpp Wed Oct 24 15:54:23 2007
@@ -686,7 +686,11 @@
            CDecl->getName());
   else
     printf(", 0\n");
-  printf("\t,0,0,0,0\n");
+  if (CDecl->getNumIntfRefProtocols() > 0)
+    printf("\t,0,(struct _objc_protocol_list*)&_OBJC_CLASS_PROTOCOLS_%s,0,0\n", 
+           CDecl->getName());
+  else
+    printf("\t,0,0,0,0\n");
   printf("};\n");
   
   // class metadata generation.
@@ -724,6 +728,10 @@
   if (ClsDefCount == 0 && CatDefCount == 0)
     return;
   
+  // TODO: This is temporary until we decide how to access objc types in a
+  // c program
+  printf("\n#include <Objc/objc.h>\n");
+  
   // For each implemented class, write out all its meta data.
   for (int i = 0; i < ClsDefCount; i++)
     RewriteObjcClassMetaData(ClassImplementation[i]);





More information about the cfe-commits mailing list