From d26ace395551cb88bba5f70a08cce6ac0c0de253 Mon Sep 17 00:00:00 2001 From: Erik Pilkington Date: Tue, 3 Jul 2018 00:23:18 +0000 Subject: [PATCH] [demangler] Fix a MSVC alignment warning. This should fix llvm.org/PR37944 llvm-svn: 336157 --- libcxxabi/src/cxa_demangle.cpp | 3 ++- llvm/lib/Demangle/ItaniumDemangle.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libcxxabi/src/cxa_demangle.cpp b/libcxxabi/src/cxa_demangle.cpp index d70ffdf10651..1cdc29b811c3 100644 --- a/libcxxabi/src/cxa_demangle.cpp +++ b/libcxxabi/src/cxa_demangle.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -1890,7 +1891,7 @@ class BumpPointerAllocator { static constexpr size_t AllocSize = 4096; static constexpr size_t UsableAllocSize = AllocSize - sizeof(BlockMeta); - alignas(16) char InitialBuffer[AllocSize]; + alignas(std::max_align_t) char InitialBuffer[AllocSize]; BlockMeta* BlockList = nullptr; void grow() { diff --git a/llvm/lib/Demangle/ItaniumDemangle.cpp b/llvm/lib/Demangle/ItaniumDemangle.cpp index 8dd182fad150..c7bba85f5d88 100644 --- a/llvm/lib/Demangle/ItaniumDemangle.cpp +++ b/llvm/lib/Demangle/ItaniumDemangle.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -1950,7 +1951,7 @@ class BumpPointerAllocator { static constexpr size_t AllocSize = 4096; static constexpr size_t UsableAllocSize = AllocSize - sizeof(BlockMeta); - alignas(16) char InitialBuffer[AllocSize]; + alignas(std::max_align_t) char InitialBuffer[AllocSize]; BlockMeta* BlockList = nullptr; void grow() {