From 892bd81a6222eb8e3e0fb7ffab4ab536f75574a2 Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Thu, 5 Jul 2018 06:22:39 +0000 Subject: [demangler] Avoid alignment warning The alignment specified by a constant for the field `BumpPointerAllocator::InitialBuffer` exceeded the alignment guaranteed by `malloc` and `new` on Windows. This change set the alignment value to that of `long double`, which is defined by the used platform. It fixes https://bugs.llvm.org/show_bug.cgi?id=37944. Differential Revision: https://reviews.llvm.org/D48889 llvm-svn: 336311 --- llvm/lib/Demangle/ItaniumDemangle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Demangle/ItaniumDemangle.cpp') diff --git a/llvm/lib/Demangle/ItaniumDemangle.cpp b/llvm/lib/Demangle/ItaniumDemangle.cpp index 8dd182fad15..a2743bd3638 100644 --- a/llvm/lib/Demangle/ItaniumDemangle.cpp +++ b/llvm/lib/Demangle/ItaniumDemangle.cpp @@ -1950,7 +1950,7 @@ class BumpPointerAllocator { static constexpr size_t AllocSize = 4096; static constexpr size_t UsableAllocSize = AllocSize - sizeof(BlockMeta); - alignas(16) char InitialBuffer[AllocSize]; + alignas(long double) char InitialBuffer[AllocSize]; BlockMeta* BlockList = nullptr; void grow() { -- cgit v1.2.3