diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2020-12-02 11:43:15 -0800 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2020-12-02 15:56:12 -0800 |
commit | 65c5c9f92ec514ae41c8ea407d1c885737d699ec (patch) | |
tree | 3a458199cb16944a116d3a0880f81cf0268eaa9a /clang/lib/Frontend/CompilerInstance.cpp | |
parent | bab72dd5d5122817f41320ddde8e3246dfb5fc28 (diff) | |
download | llvm-65c5c9f92ec514ae41c8ea407d1c885737d699ec.zip llvm-65c5c9f92ec514ae41c8ea407d1c885737d699ec.tar.gz llvm-65c5c9f92ec514ae41c8ea407d1c885737d699ec.tar.bz2 |
ADT: Rely on std::aligned_union_t for math in AlignedCharArrayUnion, NFC
Instead of computing the alignment and size of the `char` buffer in
`AlignedCharArrayUnion`, rely on the math in `std::aligned_union_t`.
Because some users of this rely on the `buffer` field existing with a
type convertible to `char *`, we can't change the field type, but we can
still avoid duplicating the logic.
A potential follow up would be to delete `AlignedCharArrayUnion` after
updating its users to use `std::aligned_union_t` directly; or if we like
our template parameters better, could update users to stop peeking
inside and then replace the definition with:
```
template <class T, class... Ts>
using AlignedCharArrayUnion = std::aligned_union_t<1, T, Ts...>;
```
Differential Revision: https://reviews.llvm.org/D92500
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
0 files changed, 0 insertions, 0 deletions