]> granicus.if.org Git - clang/commitdiff
Tweak RewriteInterfaceDecl() to generate a typedef (if one hasn't already been genera...
authorSteve Naroff <snaroff@apple.com>
Thu, 1 Nov 2007 03:35:41 +0000 (03:35 +0000)
committerSteve Naroff <snaroff@apple.com>
Thu, 1 Nov 2007 03:35:41 +0000 (03:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43600 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/RewriteTest.cpp
clang.xcodeproj/project.pbxproj

index 999b0796a97b713491043e24a9b2f9208d2424be..026c5d62c4e748a6075f451af761efa74fb24b57 100644 (file)
@@ -329,6 +329,17 @@ void RewriteTest::RewriteInterfaceDecl(ObjcInterfaceDecl *ClassDecl) {
   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, 
index fe4cf8d85be8296188b8454e3723b21a50eb5906..de41b4628d0c47ae944965792f26798c623eb63f 100644 (file)
                08FB7793FE84155DC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */;
-                       compatibilityVersion = "Xcode 2.4";
                        hasScannedForEncodings = 1;
                        mainGroup = 08FB7794FE84155DC02AAC07 /* clang */;
                        projectDirPath = "";