summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorJF Bastien <jfbastien@apple.com>2019-07-29 23:37:48 +0000
committerJF Bastien <jfbastien@apple.com>2019-07-29 23:37:48 +0000
commit993145f9548792dc0a46dd938da4609e94f7671c (patch)
treef30071bb909d77d3aee2fe1ff969693b97ff3725 /llvm
parentd9e55fa52191d564b9ff45c14e582d94ad2a4b56 (diff)
downloadbcm5719-llvm-993145f9548792dc0a46dd938da4609e94f7671c.tar.gz
bcm5719-llvm-993145f9548792dc0a46dd938da4609e94f7671c.zip
[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
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Support/Endian.h6
-rw-r--r--llvm/include/llvm/Support/TrailingObjects.h4
2 files changed, 7 insertions, 3 deletions
diff --git a/llvm/include/llvm/Support/Endian.h b/llvm/include/llvm/Support/Endian.h
index d8be94427d7..b2249471e64 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<PickAlignment<value_type, alignment>::value,
- sizeof(value_type)> Value;
+ struct {
+ alignas(PickAlignment<value_type,
+ alignment>::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 8cf4f7aed7f..8b5daefb7aa 100644
--- a/llvm/include/llvm/Support/TrailingObjects.h
+++ b/llvm/include/llvm/Support/TrailingObjects.h
@@ -369,7 +369,9 @@ public:
template <typename... Tys> struct FixedSizeStorage {
template <size_t... Counts> struct with_counts {
enum { Size = totalSizeToAlloc<Tys...>(Counts...) };
- typedef llvm::AlignedCharArray<alignof(BaseTy), Size> type;
+ struct type {
+ alignas(BaseTy) char buffer[Size];
+ };
};
};
OpenPOWER on IntegriCloud