This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Fix __compressed_pair so it doesn't copy the argument multiple times
AbandonedPublic

Authored by EricWF on Dec 7 2016, 7:53 PM.

Details

Reviewers
mclow.lists
Summary

__compressed_pair takes and passes it's constructor arguments by value. This causes arguments to be moved 3 times instead of once. This patch addresses that issue and fixes constexpr on the constructors.

A much better alternative to this patch is D27565, which is about 80% shorter than the current implementation but may be ABI breaking.

Diff Detail

Event Timeline

EricWF updated this revision to Diff 80712.Dec 7 2016, 7:53 PM
EricWF retitled this revision from to [libcxx] Fix __compressed_pair so it doesn't copy the argument multiple times.
EricWF updated this object.
EricWF added a reviewer: mclow.lists.
EricWF added subscribers: cfe-commits, loladiro.
EricWF added a comment.Dec 7 2016, 7:58 PM

Ideally I would like to re-write __compressed_pair so that it doesn't need 4 complete specializations but I'm not sure the change would be non-ABI breaking.

EricWF updated this object.Dec 7 2016, 8:42 PM

I take it this supersedes D24372? I apologize for not getting around to commiting that yet, but if it does supersede that revision, we should probably keep the tests that we have there.

EricWF abandoned this revision.Apr 3 2017, 7:27 PM

Abandoning in favor of https://reviews.llvm.org/D27565