diff options
author | Patrick Palka <ppalka@redhat.com> | 2020-09-28 12:05:32 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2020-09-28 12:05:32 -0400 |
commit | 361e32eeaa8e80c2c3b4879518756cf131e8f938 (patch) | |
tree | cb8e49f29fe2d9db63d085bc704400e3a3925866 /libgo/go | |
parent | ea51fba504d05e94f7ac97e7f278652d684418b2 (diff) | |
download | gcc-361e32eeaa8e80c2c3b4879518756cf131e8f938.zip gcc-361e32eeaa8e80c2c3b4879518756cf131e8f938.tar.gz gcc-361e32eeaa8e80c2c3b4879518756cf131e8f938.tar.bz2 |
libstdc++: Rearrange some range adaptors' data members
Since the standard range adaptors are specified to derive from the empty
class view_base, having their first data member store the underlying
view is suboptimal, for if the underlying view also derives from
view_base then the two view_base subobjects will be adjacent; this
prevents the compiler from applying the empty base optimization to elide
away the storage for these two empty bases.
This patch improves the situation by declaring the _M_base data member
last instead of first in each range adaptor that has more than one data
member, so that the empty base optimization can apply in more cases.
libstdc++-v3/ChangeLog:
* include/std/ranges (filter_view): Declare the data member
_M_base last instead of first, and adjust constructors' member
initializer lists accordingly.
(transform_view): Likewise.
(take_view): Likewise.
(take_while_view): Likewise.
(drop_view): Likewise.
(drop_while_view): Likewise.
(join_view): Likewise.
(split_view): Likewise (and tweak nearby formatting).
(reverse_view): Likewise.
* testsuite/std/ranges/adaptors/sizeof.cc: Update expected
sizes.
Diffstat (limited to 'libgo/go')
0 files changed, 0 insertions, 0 deletions