aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorLouis Dionne <ldionne.2@gmail.com>2020-12-11 12:22:16 -0500
committerLouis Dionne <ldionne.2@gmail.com>2021-01-08 13:04:03 -0500
commit955dd7b7f3f6df79f573508ffb567f3923e892f7 (patch)
tree016fbfea72292496403ebc878fe86d493341add9 /clang/lib/Frontend/CompilerInvocation.cpp
parent95729f95d803c8e8f4ca3e6767404ec2c0492d53 (diff)
downloadllvm-955dd7b7f3f6df79f573508ffb567f3923e892f7.zip
llvm-955dd7b7f3f6df79f573508ffb567f3923e892f7.tar.gz
llvm-955dd7b7f3f6df79f573508ffb567f3923e892f7.tar.bz2
[libc++] LWG2070: Use Allocator construction for objects created with allocate_shared
This patch updates `allocate_shared` to call `allocator_traits::construct` when creating the object held inside the shared_pointer, and `allocator_traits::destroy` when destroying it. This resolves the part of P0674R1 that was originally filed as LWG2070. This change is landed separately from the rest of P0674R1 because it is incredibly tricky from an ABI perspective. This is the reason why this change is so tricky is that we previously used EBO in a compressed pair to store both the allocator and the object type stored in the `shared_ptr`. However, starting in C++20, P0674 requires us to use Allocator construction for initializing the object type. That requirement rules out the use of the EBO for the object type, since using the EBO implies that the base will be initialized when the control block is initialized (and hence we can't do it through Allocator construction). Hence, supporting P0674 requires changing how we store the object type inside the control block, which we do while being ABI compatible by using some trickery with a properly aligned char buffer. Fixes https://llvm.org/PR41900 Supersedes https://llvm.org/D62760 Differential Revision: https://reviews.llvm.org/D91201
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions