[cfe-commits] r68344 - /cfe/branches/Apple/objective-rewrite/tools/clang/Driver/RewriteObjC.cpp

Steve Naroff snaroff at apple.com
Thu Apr 2 12:14:05 PDT 2009


Author: snaroff
Date: Thu Apr  2 14:14:05 2009
New Revision: 68344

URL: http://llvm.org/viewvc/llvm-project?rev=68344&view=rev
Log:
Fix <rdar://problem/6626628> clang ObjC rewriter: protocol_getMethodDescription doesn't work.

Modified:
    cfe/branches/Apple/objective-rewrite/tools/clang/Driver/RewriteObjC.cpp

Modified: cfe/branches/Apple/objective-rewrite/tools/clang/Driver/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/objective-rewrite/tools/clang/Driver/RewriteObjC.cpp?rev=68344&r1=68343&r2=68344&view=diff

==============================================================================
--- cfe/branches/Apple/objective-rewrite/tools/clang/Driver/RewriteObjC.cpp (original)
+++ cfe/branches/Apple/objective-rewrite/tools/clang/Driver/RewriteObjC.cpp Thu Apr  2 14:14:05 2009
@@ -3463,6 +3463,19 @@
   Result += "};\n\n";
 
   if (LangOpts.Microsoft) {
+    if (ProtocolExprDecls.size()) {
+      Result += "#pragma section(\".objc_protocol$B\",long,read,write)\n";
+      Result += "#pragma data_seg(push, \".objc_protocol$B\")\n";
+      for (llvm::SmallPtrSet<ObjCProtocolDecl *,8>::iterator I = ProtocolExprDecls.begin(), 
+           E = ProtocolExprDecls.end(); I != E; ++I) {
+        Result += "static struct _objc_protocol *_POINTER_OBJC_PROTOCOL_";
+        Result += (*I)->getNameAsString();
+        Result += " = &_OBJC_PROTOCOL_";
+        Result += (*I)->getNameAsString();
+        Result += ";\n";
+      }
+      Result += "#pragma data_seg(pop)\n\n";
+    }
     Result += "#pragma section(\".objc_module_info$B\",long,read,write)\n";
     Result += "#pragma data_seg(push, \".objc_module_info$B\")\n";
     Result += "static struct _objc_module *_POINTER_OBJC_MODULES = ";





More information about the cfe-commits mailing list