aboutsummaryrefslogtreecommitdiff
path: root/lib/Rewrite/RewriteModernObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-04-14 17:13:08 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-04-14 17:13:08 +0000
commit8590d86ea35d0dd04711edd6b8dc57fa9a528305 (patch)
tree3af79a0ec7d716bc4c9b1b17c189b42fbdbe55f3 /lib/Rewrite/RewriteModernObjC.cpp
parentf4dd85835bc79aaa0ebdc08244ee0fc7f687285c (diff)
objective-c modern translator: Make metadata
definition for protocols static. // rdar://11248048 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154753 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Rewrite/RewriteModernObjC.cpp')
-rw-r--r--lib/Rewrite/RewriteModernObjC.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/Rewrite/RewriteModernObjC.cpp b/lib/Rewrite/RewriteModernObjC.cpp
index b783c92dc7..b3d85a4ad3 100644
--- a/lib/Rewrite/RewriteModernObjC.cpp
+++ b/lib/Rewrite/RewriteModernObjC.cpp
@@ -5616,13 +5616,11 @@ void RewriteModernObjC::Initialize(ASTContext &context) {
// These are currently generated.
Preamble += "\n#pragma section(\".objc_classlist$B\", long, read, write)\n";
Preamble += "#pragma section(\".objc_catlist$B\", long, read, write)\n";
- Preamble += "#pragma section(\".objc_protolist$B\", long, read, write)\n";
Preamble += "#pragma section(\".objc_imageinfo$B\", long, read, write)\n";
Preamble += "#pragma section(\".objc_nlclslist$B\", long, read, write)\n";
Preamble += "#pragma section(\".objc_nlcatlist$B\", long, read, write)\n";
Preamble += "#pragma section(\".objc_protorefs$B\", long, read, write)\n";
// These are generated but not necessary for functionality.
- Preamble += "#pragma section(\".datacoal_nt$B\", long, read, write)\n";
Preamble += "#pragma section(\".cat_cls_meth$B\", long, read, write)\n";
Preamble += "#pragma section(\".inst_meth$B\", long, read, write)\n";
Preamble += "#pragma section(\".cls_meth$B\", long, read, write)\n";
@@ -6593,7 +6591,7 @@ void RewriteModernObjC::RewriteObjCProtocolMetaData(ObjCProtocolDecl *PDecl,
// Writer out root metadata for current protocol: struct _protocol_t
Result += "\n";
if (LangOpts.MicrosoftExt)
- Result += "__declspec(allocate(\".datacoal_nt$B\")) ";
+ Result += "static ";
Result += "struct _protocol_t _OBJC_PROTOCOL_";
Result += PDecl->getNameAsString();
Result += " __attribute__ ((used, section (\"__DATA,__datacoal_nt,coalesced\"))) = {\n";
@@ -6651,11 +6649,8 @@ void RewriteModernObjC::RewriteObjCProtocolMetaData(ObjCProtocolDecl *PDecl,
else
Result += "\t0\n};\n";
- // Use this protocol meta-data to build protocol list table in section
- // .objc_protolist$B
- // Unspecified visibility means 'private extern'.
if (LangOpts.MicrosoftExt)
- Result += "__declspec(allocate(\".objc_protolist$B\")) ";
+ Result += "static ";
Result += "struct _protocol_t *";
Result += "_OBJC_LABEL_PROTOCOL_$_"; Result += PDecl->getNameAsString();
Result += " = &_OBJC_PROTOCOL_"; Result += PDecl->getNameAsString();