This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Implement P1956 rename low-level bit functions
ClosedPublic

Authored by Mordante on Nov 1 2020, 4:14 AM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Commits
rG1a036e9cc82a: [libcxx] Implement P1956 rename low-level bit functions
Summary

Implements P1956: On the names of low-level bit manipulation functions.

Users may use older versions of libc++ or other standard libraries with the old names. In order to keep compatibility the old functions are kept, but marked as deprecated.

The patch also adds a new config macro _LIBCPP_DEPRECATED_MSG. Do you prefer a this is a separate patch?

Diff Detail

Event Timeline

Mordante created this revision.Nov 1 2020, 4:14 AM
Herald added a reviewer: Restricted Project. · View Herald TranscriptNov 1 2020, 4:14 AM
Herald added a subscriber: arichardson. · View Herald Transcript
Mordante requested review of this revision.Nov 1 2020, 4:14 AM
ldionne added a subscriber: EricWF.EditedNov 10 2020, 6:14 AM

I would be tempted to rename the functions and just remove the old ones. It's not clear to me we're making anyone a flower by keeping the old ones but marking them as deprecated. I think we might just be introducing complexity and a migration burden for a non-existent problem.

The reason why I think the problem might be non-existent is that:

  1. Those are not the most widely used functions
  2. The old names never made it into any published C++ Standard, so we'd effectively be non-conforming by providing (deprecated) functions that don't exist in the standard
  3. Many people compile with -Werror, so the difference between a deprecation warning and the name not being there is immaterial.

Can you please add a release note to libcxx/docs/ReleaseNotes.rst?

I'll launch a build at Apple to see whether removing the names causes issues. @EricWF Can you please do the same at Google?

Edit: for my own ref rdar://71236792

ldionne requested changes to this revision.Nov 10 2020, 6:28 AM

Requesting changes so it shows up properly in the queue.

This revision now requires changes to proceed.Nov 10 2020, 6:28 AM

Thanks for the review.

I kept the old names to aid people transition to the new names since I don't know how many people relay on the old names. (I don't expect too many.) If the test at Apple and Google shows no or little breakage I think it would be good to remove the old names.

I've updated the release notes and will post an updated patch after we've determined the fate of the old name.

Thanks for the review.

I kept the old names to aid people transition to the new names since I don't know how many people relay on the old names. (I don't expect too many.) If the test at Apple and Google shows no or little breakage I think it would be good to remove the old names.

Removing the old names causes no breakage internally. Let's go with that, and we can always come back and add the old names back as a temporary measure if we notice breakage -- but it's not clear to me that's going to happen.

Mordante updated this revision to Diff 305850.Nov 17 2020, 10:48 AM

Addresses the review comments:

  • Adds the change to the release notes.
  • Remove instead of deprecate the old functions.
ldionne accepted this revision.Nov 17 2020, 1:14 PM
ldionne added a subscriber: goncharov.

I don't understand why no CI is being triggered. That's weird. @goncharov do you know?

This LGTM if CI passes. Can you please hold off until we've figured out what's wrong?

This revision is now accepted and ready to land.Nov 17 2020, 1:14 PM

Thanks for the review.

@goncharov I use the Phabricator's web-interface instead of arc to create and update revisions. Can that be the issue?

Mordante updated this revision to Diff 307326.Nov 24 2020, 6:00 AM

Rebase to trigger the bildkite.

This revision was automatically updated to reflect the committed changes.