From 993145f9548792dc0a46dd938da4609e94f7671c Mon Sep 17 00:00:00 2001 From: JF Bastien Date: Mon, 29 Jul 2019 23:37:48 +0000 Subject: [PATCH] [NFC] avoid AlignedCharArray in LLVM As discussed in D65249, don't use AlignedCharArray or std::aligned_storage. Just use alignas(X) char Buf[Size];. This will allow me to remove AlignedCharArray entirely, and works on the current minimum version of Visual Studio. llvm-svn: 367277 --- llvm/include/llvm/Support/Endian.h | 6 ++++-- llvm/include/llvm/Support/TrailingObjects.h | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/llvm/include/llvm/Support/Endian.h b/llvm/include/llvm/Support/Endian.h index d8be944..b224947 100644 --- a/llvm/include/llvm/Support/Endian.h +++ b/llvm/include/llvm/Support/Endian.h @@ -246,8 +246,10 @@ struct packed_endian_specific_integral { } private: - AlignedCharArray::value, - sizeof(value_type)> Value; + struct { + alignas(PickAlignment::value) char buffer[sizeof(value_type)]; + } Value; public: struct ref { diff --git a/llvm/include/llvm/Support/TrailingObjects.h b/llvm/include/llvm/Support/TrailingObjects.h index 8cf4f7a..8b5daef 100644 --- a/llvm/include/llvm/Support/TrailingObjects.h +++ b/llvm/include/llvm/Support/TrailingObjects.h @@ -369,7 +369,9 @@ public: template struct FixedSizeStorage { template struct with_counts { enum { Size = totalSizeToAlloc(Counts...) }; - typedef llvm::AlignedCharArray type; + struct type { + alignas(BaseTy) char buffer[Size]; + }; }; }; -- 2.7.4