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

Steve Naroff snaroff at apple.com
Fri Apr 4 15:58:22 PDT 2008


Author: snaroff
Date: Fri Apr  4 17:58:22 2008
New Revision: 49241

URL: http://llvm.org/viewvc/llvm-project?rev=49241&view=rev
Log:
Avoid implicitly including any header files (requested by ckane).

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=49241&r1=49240&r2=49241&view=diff

==============================================================================
--- cfe/trunk/Driver/RewriteTest.cpp (original)
+++ cfe/trunk/Driver/RewriteTest.cpp Fri Apr  4 17:58:22 2008
@@ -327,11 +327,10 @@
   Preamble += "extern Protocol *objc_getProtocol(const char *);\n";
   if (LangOpts.Microsoft) 
     Preamble += "} // end extern \"C\"\n";
-  Preamble += "#include <objc/objc.h>\n";
   Preamble += "#ifndef __FASTENUMERATIONSTATE\n";
   Preamble += "struct __objcFastEnumerationState {\n\t";
   Preamble += "unsigned long state;\n\t";
-  Preamble += "id *itemsPtr;\n\t";
+  Preamble += "void **itemsPtr;\n\t";
   Preamble += "unsigned long *mutationsPtr;\n\t";
   Preamble += "unsigned long extra[5];\n};\n";
   Preamble += "#define __FASTENUMERATIONSTATE\n";
@@ -2912,8 +2911,7 @@
     RewriteImplementationDecl(CategoryImplementation[i]);
   
   // This is needed for use of offsetof
-  Result += "#include <stddef.h>\n";
-    
+  Result += "#define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER)\n";   
   // For each implemented class, write out all its meta data.
   for (int i = 0; i < ClsDefCount; i++)
     RewriteObjCClassMetaData(ClassImplementation[i], Result);





More information about the cfe-commits mailing list