[cfe-commits] r43600 - in /cfe/trunk: Driver/RewriteTest.cpp clang.xcodeproj/project.pbxproj

Steve Naroff snaroff at apple.com
Wed Oct 31 20:35:41 PDT 2007


Author: snaroff
Date: Wed Oct 31 22:35:41 2007
New Revision: 43600

URL: http://llvm.org/viewvc/llvm-project?rev=43600&view=rev
Log:

Tweak RewriteInterfaceDecl() to generate a typedef (if one hasn't already been generated).


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=43600&r1=43599&r2=43600&view=diff

==============================================================================
--- cfe/trunk/Driver/RewriteTest.cpp (original)
+++ cfe/trunk/Driver/RewriteTest.cpp Wed Oct 31 22:35:41 2007
@@ -329,6 +329,17 @@
   endBuf += Lexer::MeasureTokenLength(LocEnd, *SM);
 
   std::string ResultStr;
+  if (!ObjcForwardDecls.count(ClassDecl)) {
+    // we haven't seen a forward decl - generate a typedef.
+    ResultStr += "typedef struct ";
+    ResultStr += ClassDecl->getName();
+    ResultStr += " ";
+    ResultStr += ClassDecl->getName();
+    ResultStr += ";";
+    
+    // Mark this typedef as having been generated.
+    ObjcForwardDecls.insert(ClassDecl);
+  }
   SynthesizeObjcInternalStruct(ClassDecl, ResultStr);
     
   Rewrite.ReplaceText(LocStart, endBuf-startBuf, 

Modified: cfe/trunk/clang.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/clang.xcodeproj/project.pbxproj?rev=43600&r1=43599&r2=43600&view=diff

==============================================================================
--- cfe/trunk/clang.xcodeproj/project.pbxproj (original)
+++ cfe/trunk/clang.xcodeproj/project.pbxproj Wed Oct 31 22:35:41 2007
@@ -756,7 +756,6 @@
 		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