This is an archive of the discontinued LLVM Phabricator instance.

Allow instantiation of deque and deque::iterator with incomplete value type.
AbandonedPublic

Authored by eugenis on Apr 17 2015, 3:04 PM.

Details

Reviewers
mclow.lists

Diff Detail

Repository
rL LLVM

Event Timeline

eugenis updated this revision to Diff 23970.Apr 17 2015, 3:04 PM
eugenis retitled this revision from to Allow instantiation of deque and deque::iterator with incomplete value type..
eugenis updated this object.
eugenis edited the test plan for this revision. (Show Details)
eugenis set the repository for this revision to rL LLVM.
eugenis added a subscriber: Unknown Object (MLST).

Friendly ping.
The diff is big, but all the changes are mechanical: all I did was move __block_size calculation inside method bodies to avoid evaluating it during class instantiation.

On a second thought, does this change break ABI stability?
I really don't understand what could break though, seeing that the change is header-only and does not affect libc++.so at all.

On a third thought, it does break ABI stability. We've got
sizeof(element) baked into deque::iterator mangled name! Does it mean
we are doomed and there is no way to achieve this?

EricWF added a subscriber: EricWF.May 14 2015, 7:56 AM

Ooohh... Your right. It does seem to change the mangled name of std::deque::iterator. libc++ needs to quickly figure out how we want to manage ABI changes. I'll bring this up with @mclow.lists at the end of next week.

mclow.lists edited edge metadata.Jun 23 2015, 8:22 AM

I don't want to close this, but we're not going to apply it anytime soon, either.
[ Due to the ABI breakage ]

It looks like the right solution for this problem is starting a __2 namespace and duplicating the whole deque header there (because the changes are so pervasive). How does that sound? I'd like to work on that. Any advice would be much appreciated.

rsmith added a subscriber: rsmith.Jun 23 2015, 5:39 PM

I put together a different possible approach at http://reviews.llvm.org/D10677. The idea is to keep the old and new ABI versions as similar as possible, by filling in the last template argument of the iterator type with 0 in the new ABI. That template parameter becomes (essentially) meaningless, and both the old and new ABI use a different mechanism to get the block size when they need it.

eugenis abandoned this revision.Jun 25 2015, 1:26 PM

Abandoned in favor of http://reviews.llvm.org/D10677.