[PATCH] D92512: ADT: Change AlignedCharArrayUnion to an alias of std::aligned_union_t, NFC

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 2 14:48:32 PST 2020


dexonsmith created this revision.
dexonsmith added a reviewer: rnk.
Herald added subscribers: ributzka, martong, hiraditya.
Herald added a reviewer: shafik.
Herald added projects: clang, LLVM.
dexonsmith requested review of this revision.

Update all the users of `AlignedCharArrayUnion` to stop peeking inside
(to look at `buffer`), and then finish gutting it. It's now an alias of
`std::aligned_union_t`, with a minor difference in template parameters
(`std::aligned_union_t` takes a minimum size and 0+ types, whereas this
just takes 1+ types... maybe a bit simpler to use correctly?).

A potential follow up would be to remove `AlignedCharArrayUnion`
entirely, inlining this alias into its users, but it's not clear to me
if that's better.

If https://reviews.llvm.org/D92500 lands without any issue, I think this should be safe as well.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92512

Files:
  clang/include/clang/AST/APValue.h
  clang/include/clang/AST/ASTTypeTraits.h
  clang/include/clang/AST/ParentMapContext.h
  clang/lib/AST/APValue.cpp
  clang/lib/AST/ASTImporter.cpp
  clang/lib/Frontend/PrecompiledPreamble.cpp
  llvm/include/llvm/ADT/DenseMap.h
  llvm/include/llvm/ADT/IntervalMap.h
  llvm/include/llvm/CodeGen/DIE.h
  llvm/include/llvm/Support/AlignOf.h
  llvm/include/llvm/Support/Error.h
  llvm/include/llvm/Support/ErrorOr.h
  llvm/include/llvm/Support/JSON.h
  llvm/lib/Support/JSON.cpp
  llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92512.309065.patch
Type: text/x-patch
Size: 33167 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201202/436f4ada/attachment.bin>


More information about the llvm-commits mailing list