This is an archive of the discontinued LLVM Phabricator instance.

Constant strings emitted when `-fno-constant-cfstrings` is passed should allow dead stripping
Needs RevisionPublic

Authored by bendjones on Nov 14 2019, 5:44 PM.

Details

Summary

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

Diff Detail

Event Timeline

bendjones created this revision.Nov 14 2019, 5:44 PM
bendjones created this object with edit policy "Administrators".

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 -U9999999 to provide full context in the diff.

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 -U9999999 to provide full context in the diff.

Will do

bendjones updated this revision to Diff 229441.Nov 14 2019, 8:45 PM

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

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?

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.

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.

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?

bendjones added 1 blocking reviewer(s): dexonsmith.Apr 13 2020, 2:20 PM
bendjones changed the edit policy from "Administrators" to "Restricted Project (Project)".

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.

dexonsmith requested changes to this revision.EditedOct 6 2020, 2:37 PM

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".

EDIT: confirmed; this went through after I added myself to the "clang" project.

clang/lib/CodeGen/CGObjCMac.cpp
1981

Please drop this comment.

clang/test/CodeGenObjC/ns-constant-strings.m
47

Please fix this missing newline.

This revision now requires changes to proceed.Oct 6 2020, 2:37 PM