aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2020-12-02 11:43:15 -0800
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2020-12-02 15:56:12 -0800
commit65c5c9f92ec514ae41c8ea407d1c885737d699ec (patch)
tree3a458199cb16944a116d3a0880f81cf0268eaa9a /clang/lib/Frontend/CompilerInstance.cpp
parentbab72dd5d5122817f41320ddde8e3246dfb5fc28 (diff)
downloadllvm-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