[compiler-rt] [compiler-rt] Replace deprecated aligned_storage with aligned byte array (PR #94171)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 2 14:16:23 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff f06f0164199d4a968d8336937cd5ef2c05946d8d 82b64d571afa1675005f45450da37a56dfceb5e0 -- compiler-rt/lib/xray/tests/unit/function_call_trie_test.cpp compiler-rt/lib/xray/tests/unit/profile_collector_test.cpp compiler-rt/lib/xray/tests/unit/segmented_array_test.cpp compiler-rt/lib/xray/tests/unit/test_helpers.cpp compiler-rt/lib/xray/xray_fdr_logging.cpp compiler-rt/lib/xray/xray_function_call_trie.h compiler-rt/lib/xray/xray_profile_collector.cpp compiler-rt/lib/xray/xray_profiling.cpp compiler-rt/lib/xray/xray_segmented_array.h compiler-rt/test/tsan/custom_mutex4.cpp compiler-rt/test/tsan/custom_mutex5.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/compiler-rt/lib/xray/tests/unit/profile_collector_test.cpp b/compiler-rt/lib/xray/tests/unit/profile_collector_test.cpp
index 6e1992d675..da50642284 100644
--- a/compiler-rt/lib/xray/tests/unit/profile_collector_test.cpp
+++ b/compiler-rt/lib/xray/tests/unit/profile_collector_test.cpp
@@ -38,8 +38,8 @@ struct ExpectedProfilingFileHeader {
void ValidateFileHeaderBlock(XRayBuffer B) {
ASSERT_NE(static_cast<const void *>(B.Data), nullptr);
ASSERT_EQ(B.Size, sizeof(ExpectedProfilingFileHeader));
- alignas(ExpectedProfilingFileHeader) std::byte
- FileHeaderStorage[sizeof(ExpectedProfilingFileHeader)];
+ alignas(ExpectedProfilingFileHeader)
+ std::byte FileHeaderStorage[sizeof(ExpectedProfilingFileHeader)];
ExpectedProfilingFileHeader ExpectedHeader;
std::memcpy(&FileHeaderStorage, B.Data, B.Size);
auto &FileHeader =
diff --git a/compiler-rt/lib/xray/tests/unit/segmented_array_test.cpp b/compiler-rt/lib/xray/tests/unit/segmented_array_test.cpp
index 072559d629..26c80ded1d 100644
--- a/compiler-rt/lib/xray/tests/unit/segmented_array_test.cpp
+++ b/compiler-rt/lib/xray/tests/unit/segmented_array_test.cpp
@@ -229,7 +229,8 @@ TEST(SegmentedArrayTest, PlacementNewOnAlignedStorage) {
alignas(AllocatorType) std::byte AllocatorStorage[sizeof(AllocatorType)];
new (&AllocatorStorage) AllocatorType(1 << 10);
auto *A = reinterpret_cast<AllocatorType *>(&AllocatorStorage);
- alignas(Array<ShadowStackEntry>) std::byte ArrayStorage[sizeof(Array<ShadowStackEntry>)];
+ alignas(Array<ShadowStackEntry>)
+ std::byte ArrayStorage[sizeof(Array<ShadowStackEntry>)];
new (&ArrayStorage) Array<ShadowStackEntry>(*A);
auto *Data = reinterpret_cast<Array<ShadowStackEntry> *>(&ArrayStorage);
``````````
</details>
https://github.com/llvm/llvm-project/pull/94171
More information about the llvm-commits
mailing list