commit | 2407a54c9b2932e1e322dcfdd9f90d0879461eda | [log] [tgz] |
---|---|---|
author | Jason Macnak <natsu@google.com> | Thu Feb 20 09:25:19 2025 -0800 |
committer | swiftshader-scoped@luci-project-accounts.iam.gserviceaccount.com <swiftshader-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Feb 20 11:09:58 2025 -0800 |
tree | 75c67c2508cb6f630060a95b4a522fae48376f1e | |
parent | 39531419df32352bc997c62f319e9ed673607fdd [diff] |
Fix LLVM's AlignOf after previous change to support c++23 https://swiftshader-review.googlesource.com/c/SwiftShader/+/74809 seems to have dropped the `T` arg from the alignof and sizeof calculations which resulted in build errors in AOSP. See the checks tab on aosp/3503612. Bug: b/397950401 Test: build in Android repo Change-Id: I555e2b59181a6d63603191a90b4d6c1bb2080efd Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/75068 Reviewed-by: Shahbaz Youssefi <syoussefi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@google.com> Tested-by: Shahbaz Youssefi <syoussefi@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com>
diff --git a/third_party/llvm-16.0/llvm/include/llvm/Support/AlignOf.h b/third_party/llvm-16.0/llvm/include/llvm/Support/AlignOf.h index a8c4578..da1d7e3 100644 --- a/third_party/llvm-16.0/llvm/include/llvm/Support/AlignOf.h +++ b/third_party/llvm-16.0/llvm/include/llvm/Support/AlignOf.h
@@ -20,7 +20,7 @@ /// A suitably aligned and sized character array member which can hold elements /// of any type. template <typename T, typename... Ts> struct AlignedCharArrayUnion { - alignas(Ts...) char buffer[std::max({sizeof(Ts)...})]; + alignas(std::max({std::size_t(1), alignof(T), alignof(Ts)...})) char buffer[std::max({std::size_t(1), sizeof(T), sizeof(Ts)...})]; }; } // end namespace llvm