[PATCH] D70284: Constant strings emitted when `-fno-constant-cfstrings` is passed should allow dead stripping

2020-10-06 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith requested changes to this revision.
dexonsmith added a comment.
This revision now requires changes to proceed.

Ah, I think it's because you filled in the "project" field which I think we 
usually leave blank. Maybe now I can "request changes".




Comment at: clang/lib/CodeGen/CGObjCMac.cpp:1981
 
+// This is only used when `-fno-constant-cfstrings` is given
 ConstantAddress

Please drop this comment.



Comment at: clang/test/CodeGenObjC/ns-constant-strings.m:47
+// CHECK-NONFRAGILE: attributes #0 = { "objc_arc_inert" }
\ No newline at end of file


Please fix this missing newline.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70284/new/

https://reviews.llvm.org/D70284

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D70284: Constant strings emitted when `-fno-constant-cfstrings` is passed should allow dead stripping

2020-10-06 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment.



> Hmm ok should I redo this completely then? Not sure what is up but it shows 
> you as a reviewer hmm...

This revision is old at this point, and I can't remember if you created a new 
revision with a separate D-number? I still can't "request changes". If you've 
already committed you should be able to "abandon" this one.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70284/new/

https://reviews.llvm.org/D70284

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D70284: Constant strings emitted when `-fno-constant-cfstrings` is passed should allow dead stripping

2020-04-13 Thread Ben D. Jones via Phabricator via cfe-commits
bendjones added a comment.

In D70284#1978948 , @dexonsmith wrote:

> In D70284#1752893 , @bendjones wrote:
>
> > In D70284#1752811 , @dexonsmith 
> > wrote:
> >
> > > For some reason this revision is locked down and I'm not allowed to 
> > > "edit" it, which includes adding inline review comments.  Can you add me 
> > > as a reviewer?
> >
> >
> > Thought I did.
>
>
> I'm still not able to edit this, so I cannot "accept revision".  I'm not sure 
> what's going wrong but this revision object seems corrupted.


Hmm ok should I redo this completely then? Not sure what is up but it shows you 
as a reviewer hmm...

>>> The two comments:
>>> 
>>> - Please add a period at the end of the sentence in the comment.
>> 
>> Will do.
> 
> The comment actually looks liable to bitrot, since IIUC it's talking about 
> callers which can change over time.
> 
> LGTM if you remove it.

Ok will do...

> 
> 
>>> - Can you give more context about what `objc_arc_inert` is doing, and why 
>>> it's necessary now that `no_dead_strip` is gone?
>> 
>> The objc_arc_inert was added to other similar things so in the spirt of 
>> making things match I added it here. I can keep it simple though.
> 
> Okay, SGTM.  There are no ARC operations, and this will allow certain 
> optimizations.  I suggest documenting why it's safe in the commit message.

So just stating that I'm keeping things in sync with other areas?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70284/new/

https://reviews.llvm.org/D70284



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D70284: Constant strings emitted when `-fno-constant-cfstrings` is passed should allow dead stripping

2020-04-13 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment.

In D70284#1752893 , @bendjones wrote:

> In D70284#1752811 , @dexonsmith 
> wrote:
>
> > For some reason this revision is locked down and I'm not allowed to "edit" 
> > it, which includes adding inline review comments.  Can you add me as a 
> > reviewer?
>
>
> Thought I did.


I'm still not able to edit this, so I cannot "accept revision".  I'm not sure 
what's going wrong but this revision object seems corrupted.

>> The two comments:
>> 
>> - Please add a period at the end of the sentence in the comment.
> 
> Will do.

The comment actually looks liable to bitrot, since IIUC it's talking about 
callers which can change over time.

LGTM if you remove it.

>> - Can you give more context about what `objc_arc_inert` is doing, and why 
>> it's necessary now that `no_dead_strip` is gone?
> 
> The objc_arc_inert was added to other similar things so in the spirt of 
> making things match I added it here. I can keep it simple though.

Okay, SGTM.  There are no ARC operations, and this will allow certain 
optimizations.  I suggest documenting why it's safe in the commit message.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70284/new/

https://reviews.llvm.org/D70284



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D70284: Constant strings emitted when `-fno-constant-cfstrings` is passed should allow dead stripping

2020-01-08 Thread Ben D. Jones via cfe-commits
Sure. Will do. Thanks!

> On Jan 7, 2020, at 5:17 PM, Akira Hatanaka  wrote:
> 
> 
>> 
>>> On Jan 7, 2020, at 2:45 PM, Ben D. Jones via Phabricator via cfe-commits 
>>>  wrote:
>>> 
>>> bendjones added a comment.
>>> 
>>> In D70284#1752806 , @bendjones 
>>> wrote:
>>> 
>>> Any additional thoughts @dexonsmith @erik.pilkington @ahatanak?
>> 
>> 
>> @dexonsmith @erik.pilkington @ahatanak does this look good to go?
>> 
> 
> Can you commit the changes that add `objc_arc_inert` separately and rebase 
> the patch after that? Stripping `no_dead_strip` isn’t a prerequisite for 
> adding `objc_arc_inert`.
> 
> Also, can you check the alignment and `#` at the end of the 
> `_unnamed_nsstring` global variables to make sure `no_dead_strip` is no 
> longer emitted?
> 
>> 
>> Repository:
>> rG LLVM Github Monorepo
>> 
>> CHANGES SINCE LAST ACTION
>> https://reviews.llvm.org/D70284/new/
>> 
>> https://reviews.llvm.org/D70284
>> 
>> 
>> 
>> ___
>> cfe-commits mailing list
>> cfe-commits@lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
> 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D70284: Constant strings emitted when `-fno-constant-cfstrings` is passed should allow dead stripping

2020-01-07 Thread Akira Hatanaka via cfe-commits
> On Jan 7, 2020, at 2:45 PM, Ben D. Jones via Phabricator via cfe-commits 
>  wrote:
> 
> bendjones added a comment.
> 
> In D70284#1752806 , @bendjones wrote:
> 
>> Any additional thoughts @dexonsmith @erik.pilkington @ahatanak?
> 
> 
> @dexonsmith @erik.pilkington @ahatanak does this look good to go?
> 

Can you commit the changes that add `objc_arc_inert` separately and rebase the 
patch after that? Stripping `no_dead_strip` isn’t a prerequisite for adding 
`objc_arc_inert`.

Also, can you check the alignment and `#` at the end of the `_unnamed_nsstring` 
global variables to make sure `no_dead_strip` is no longer emitted?

> 
> Repository:
>  rG LLVM Github Monorepo
> 
> CHANGES SINCE LAST ACTION
>  https://reviews.llvm.org/D70284/new/
> 
> https://reviews.llvm.org/D70284
> 
> 
> 
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D70284: Constant strings emitted when `-fno-constant-cfstrings` is passed should allow dead stripping

2020-01-07 Thread Ben D. Jones via Phabricator via cfe-commits
bendjones added a comment.

In D70284#1752806 , @bendjones wrote:

> Any additional thoughts @dexonsmith @erik.pilkington @ahatanak?


@dexonsmith @erik.pilkington @ahatanak does this look good to go?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70284/new/

https://reviews.llvm.org/D70284



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D70284: Constant strings emitted when `-fno-constant-cfstrings` is passed should allow dead stripping

2019-11-20 Thread Ben D. Jones via cfe-commits
Yup will do. 

Sent from my iPhone

- Ben D. Jones

> On Nov 19, 2019, at 6:32 PM, Akira Hatanaka  wrote:
> 
> Can you check the `#0` at the end of the globals and other strings that 
> precede that? If you do so, we can also check that `no_dead_strip` isn’t 
> added.
> 
>> On Nov 19, 2019, at 6:05 PM, Duncan P. N. Exon Smith via Phabricator via 
>> cfe-commits  wrote:
>> 
>> dexonsmith added a comment.
>> 
>> For some reason this revision is locked down and I'm not allowed to "edit" 
>> it, which includes adding inline review comments.  Can you add me as a 
>> reviewer?
>> 
>> The two comments:
>> 
>> - Please add a period at the end of the sentence in the comment.
>> - Can you give more context about what `objc_arc_inert` is doing, and why 
>> it's necessary now that `no_dead_strip` is gone?
>> 
>> 
>> Repository:
>> rG LLVM Github Monorepo
>> 
>> CHANGES SINCE LAST ACTION
>> https://reviews.llvm.org/D70284/new/
>> 
>> https://reviews.llvm.org/D70284
>> 
>> 
>> 
>> ___
>> cfe-commits mailing list
>> cfe-commits@lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
> 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D70284: Constant strings emitted when `-fno-constant-cfstrings` is passed should allow dead stripping

2019-11-19 Thread Ben D. Jones via Phabricator via cfe-commits
bendjones added a comment.

In D70284#1752811 , @dexonsmith wrote:

> For some reason this revision is locked down and I'm not allowed to "edit" 
> it, which includes adding inline review comments.  Can you add me as a 
> reviewer?


Thought I did.

> The two comments:
> 
> - Please add a period at the end of the sentence in the comment.

Will do.

> - Can you give more context about what `objc_arc_inert` is doing, and why 
> it's necessary now that `no_dead_strip` is gone?

The objc_arc_inert was added to other similar things so in the spirt of making 
things match I added it here. I can keep it simple though.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70284/new/

https://reviews.llvm.org/D70284



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D70284: Constant strings emitted when `-fno-constant-cfstrings` is passed should allow dead stripping

2019-11-19 Thread Akira Hatanaka via cfe-commits
Can you check the `#0` at the end of the globals and other strings that precede 
that? If you do so, we can also check that `no_dead_strip` isn’t added.

> On Nov 19, 2019, at 6:05 PM, Duncan P. N. Exon Smith via Phabricator via 
> cfe-commits  wrote:
> 
> dexonsmith added a comment.
> 
> For some reason this revision is locked down and I'm not allowed to "edit" 
> it, which includes adding inline review comments.  Can you add me as a 
> reviewer?
> 
> The two comments:
> 
> - Please add a period at the end of the sentence in the comment.
> - Can you give more context about what `objc_arc_inert` is doing, and why 
> it's necessary now that `no_dead_strip` is gone?
> 
> 
> Repository:
>  rG LLVM Github Monorepo
> 
> CHANGES SINCE LAST ACTION
>  https://reviews.llvm.org/D70284/new/
> 
> https://reviews.llvm.org/D70284
> 
> 
> 
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D70284: Constant strings emitted when `-fno-constant-cfstrings` is passed should allow dead stripping

2019-11-19 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment.

For some reason this revision is locked down and I'm not allowed to "edit" it, 
which includes adding inline review comments.  Can you add me as a reviewer?

The two comments:

- Please add a period at the end of the sentence in the comment.
- Can you give more context about what `objc_arc_inert` is doing, and why it's 
necessary now that `no_dead_strip` is gone?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70284/new/

https://reviews.llvm.org/D70284



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D70284: Constant strings emitted when `-fno-constant-cfstrings` is passed should allow dead stripping

2019-11-19 Thread Ben D. Jones via Phabricator via cfe-commits
bendjones added a comment.

Any additional thoughts @dexonsmith @erik.pilkington @ahatanak?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70284/new/

https://reviews.llvm.org/D70284



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D70284: Constant strings emitted when `-fno-constant-cfstrings` is passed should allow dead stripping

2019-11-14 Thread Ben D. Jones via Phabricator via cfe-commits
bendjones updated this revision to Diff 229441.
bendjones added a comment.

Added `"objc_arc_inert"` and updated 
`clang/test/CodeGenObjC/ns-constant-strings.m` tests to make sure the section 
is emitted as we want.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70284/new/

https://reviews.llvm.org/D70284

Files:
  clang/lib/CodeGen/CGObjCMac.cpp
  clang/test/CodeGenObjC/ns-constant-strings.m


Index: clang/test/CodeGenObjC/ns-constant-strings.m
===
--- clang/test/CodeGenObjC/ns-constant-strings.m
+++ clang/test/CodeGenObjC/ns-constant-strings.m
@@ -33,7 +33,14 @@
 // CHECK-NONFRAGILE: @"OBJC_CLASS_$_NSConstantString" = external global
 
 // CHECK-FRAGILE: @.str = private unnamed_addr constant [6 x i8] c"MyApp\00"
+// CHECK-FRAGILE: @_unnamed_nsstring_ = private constant 
%struct.__builtin_NSString { i32* getelementptr inbounds ([0 x i32], [0 x i32]* 
@_NSConstantStringClassReference, i32 0, i32 0), i8* getelementptr inbounds ([6 
x i8], [6 x i8]* @.str, i32 0, i32 0), i32 5 }, section 
"__OBJC,__cstring_object,regular"
 // CHECK-FRAGILE: @.str.1 = private unnamed_addr constant [7 x i8] c"MyApp1\00"
+// CHECK-FRAGILE: @_unnamed_nsstring_.2 = private constant 
%struct.__builtin_NSString { i32* getelementptr inbounds ([0 x i32], [0 x i32]* 
@_NSConstantStringClassReference, i32 0, i32 0), i8* getelementptr inbounds ([7 
x i8], [7 x i8]* @.str.1, i32 0, i32 0), i32 6 }, section 
"__OBJC,__cstring_object,regular"
 
 // CHECK-NONFRAGILE: @.str = private unnamed_addr constant [6 x i8] c"MyApp\00"
+// CHECK-NONFRAGILE: @_unnamed_nsstring_ = private constant 
%struct.__builtin_NSString { i32* bitcast (%struct._class_t* 
@"OBJC_CLASS_$_NSConstantString" to i32*), i8* getelementptr inbounds ([6 x 
i8], [6 x i8]* @.str, i32 0, i32 0), i32 5 }, section 
"__DATA,__objc_stringobj,regular"
 // CHECK-NONFRAGILE: @.str.1 = private unnamed_addr constant [7 x i8] 
c"MyApp1\00"
+// CHECK-NONFRAGILE: @_unnamed_nsstring_.2 = private constant 
%struct.__builtin_NSString { i32* bitcast (%struct._class_t* 
@"OBJC_CLASS_$_NSConstantString" to i32*), i8* getelementptr inbounds ([7 x 
i8], [7 x i8]* @.str.1, i32 0, i32 0), i32 6 }, section 
"__DATA,__objc_stringobj,regular"
+
+// CHECK-FRAGILE: attributes #0 = { "objc_arc_inert" }
+// CHECK-NONFRAGILE: attributes #0 = { "objc_arc_inert" }
\ No newline at end of file
Index: clang/lib/CodeGen/CGObjCMac.cpp
===
--- clang/lib/CodeGen/CGObjCMac.cpp
+++ clang/lib/CodeGen/CGObjCMac.cpp
@@ -1978,6 +1978,7 @@
   return V;
 }
 
+// This is only used when `-fno-constant-cfstrings` is given
 ConstantAddress
 CGObjCCommonMac::GenerateConstantNSString(const StringLiteral *Literal) {
   unsigned StringLength = 0;
@@ -2029,13 +2030,12 @@
   GV = Fields.finishAndCreateGlobal("_unnamed_nsstring_", Alignment,
 /*constant*/ true,
 llvm::GlobalVariable::PrivateLinkage);
-  const char *NSStringSection = 
"__OBJC,__cstring_object,regular,no_dead_strip";
-  const char *NSStringNonFragileABISection =
-  "__DATA,__objc_stringobj,regular,no_dead_strip";
-  // FIXME. Fix section.
+  const char *NSStringSection = "__OBJC,__cstring_object,regular";
+  const char *NSStringNonFragileABISection = "__DATA,__objc_stringobj,regular";
   GV->setSection(CGM.getLangOpts().ObjCRuntime.isNonFragile()
  ? NSStringNonFragileABISection
  : NSStringSection);
+  GV->addAttribute("objc_arc_inert");
   Entry.second = GV;
 
   return ConstantAddress(GV, Alignment);


Index: clang/test/CodeGenObjC/ns-constant-strings.m
===
--- clang/test/CodeGenObjC/ns-constant-strings.m
+++ clang/test/CodeGenObjC/ns-constant-strings.m
@@ -33,7 +33,14 @@
 // CHECK-NONFRAGILE: @"OBJC_CLASS_$_NSConstantString" = external global
 
 // CHECK-FRAGILE: @.str = private unnamed_addr constant [6 x i8] c"MyApp\00"
+// CHECK-FRAGILE: @_unnamed_nsstring_ = private constant %struct.__builtin_NSString { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @_NSConstantStringClassReference, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i32 5 }, section "__OBJC,__cstring_object,regular"
 // CHECK-FRAGILE: @.str.1 = private unnamed_addr constant [7 x i8] c"MyApp1\00"
+// CHECK-FRAGILE: @_unnamed_nsstring_.2 = private constant %struct.__builtin_NSString { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @_NSConstantStringClassReference, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0), i32 6 }, section "__OBJC,__cstring_object,regular"
 
 // CHECK-NONFRAGILE: @.str = private unnamed_addr constant [6 x i8] c"MyApp\00"
+// CHECK-NONFRAGILE: @_unnamed_nsstring_ = private constant %struct.__builtin_NSString { i32* bitcast (%struct._class_t* @"OBJC_

[PATCH] D70284: Constant strings emitted when `-fno-constant-cfstrings` is passed should allow dead stripping

2019-11-14 Thread Ben D. Jones via Phabricator via cfe-commits
bendjones added a comment.

In D70284#1746853 , @dexonsmith wrote:

> The code looks right, but can you add a test for this in CodeGenObjC?  Also, 
> when you re-upload the patch with the tests, please use `-U999` to 
> provide full context in the diff.


Will do


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70284/new/

https://reviews.llvm.org/D70284



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D70284: Constant strings emitted when `-fno-constant-cfstrings` is passed should allow dead stripping

2019-11-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment.

The code looks right, but can you add a test for this in CodeGenObjC?  Also, 
when you re-upload the patch with the tests, please use `-U999` to provide 
full context in the diff.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70284/new/

https://reviews.llvm.org/D70284



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D70284: Constant strings emitted when `-fno-constant-cfstrings` is passed should allow dead stripping

2019-11-14 Thread Ben D. Jones via Phabricator via cfe-commits
bendjones created this revision.
bendjones added reviewers: erik.pilkington, ahatanak.
bendjones created this object with edit policy "Administrators".
bendjones added a project: clang.
Herald added subscribers: cfe-commits, dexonsmith.

Part of rdar://56643852 that makes all possible constant string code paths emit 
without `no_dead_strip` so that dead stripping is allowed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70284

Files:
  clang/lib/CodeGen/CGObjCMac.cpp


Index: clang/lib/CodeGen/CGObjCMac.cpp
===
--- clang/lib/CodeGen/CGObjCMac.cpp
+++ clang/lib/CodeGen/CGObjCMac.cpp
@@ -1978,6 +1978,7 @@
   return V;
 }
 
+// This is only used when `-fno-constant-cfstrings` is given
 ConstantAddress
 CGObjCCommonMac::GenerateConstantNSString(const StringLiteral *Literal) {
   unsigned StringLength = 0;
@@ -2029,10 +2030,8 @@
   GV = Fields.finishAndCreateGlobal("_unnamed_nsstring_", Alignment,
 /*constant*/ true,
 llvm::GlobalVariable::PrivateLinkage);
-  const char *NSStringSection = 
"__OBJC,__cstring_object,regular,no_dead_strip";
-  const char *NSStringNonFragileABISection =
-  "__DATA,__objc_stringobj,regular,no_dead_strip";
-  // FIXME. Fix section.
+  const char *NSStringSection = "__OBJC,__cstring_object,regular";
+  const char *NSStringNonFragileABISection = "__DATA,__objc_stringobj,regular";
   GV->setSection(CGM.getLangOpts().ObjCRuntime.isNonFragile()
  ? NSStringNonFragileABISection
  : NSStringSection);


Index: clang/lib/CodeGen/CGObjCMac.cpp
===
--- clang/lib/CodeGen/CGObjCMac.cpp
+++ clang/lib/CodeGen/CGObjCMac.cpp
@@ -1978,6 +1978,7 @@
   return V;
 }
 
+// This is only used when `-fno-constant-cfstrings` is given
 ConstantAddress
 CGObjCCommonMac::GenerateConstantNSString(const StringLiteral *Literal) {
   unsigned StringLength = 0;
@@ -2029,10 +2030,8 @@
   GV = Fields.finishAndCreateGlobal("_unnamed_nsstring_", Alignment,
 /*constant*/ true,
 llvm::GlobalVariable::PrivateLinkage);
-  const char *NSStringSection = "__OBJC,__cstring_object,regular,no_dead_strip";
-  const char *NSStringNonFragileABISection =
-  "__DATA,__objc_stringobj,regular,no_dead_strip";
-  // FIXME. Fix section.
+  const char *NSStringSection = "__OBJC,__cstring_object,regular";
+  const char *NSStringNonFragileABISection = "__DATA,__objc_stringobj,regular";
   GV->setSection(CGM.getLangOpts().ObjCRuntime.isNonFragile()
  ? NSStringNonFragileABISection
  : NSStringSection);
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits