Skip to content

[llvm] Replace deprecated aligned_storage with aligned byte array #94169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions llvm/include/llvm/ADT/FunctionExtras.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ template <typename ReturnT, typename... ParamTs> class UniqueFunctionBase {
// provide three pointers worth of storage here.
// This is mutable as an inlined `const unique_function<void() const>` may
// still modify its own mutable members.
mutable std::aligned_storage_t<InlineStorageSize, alignof(void *)>
InlineStorage;
alignas(void *) mutable std::byte InlineStorage[InlineStorageSize];
} StorageUnion;

// A compressed pointer to either our dispatching callback or our table of
Expand Down
7 changes: 3 additions & 4 deletions llvm/lib/Support/PrettyStackTrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,9 @@ static void setCrashLogMessage(const char *msg) {

#ifdef __APPLE__
using CrashHandlerString = SmallString<2048>;
using CrashHandlerStringStorage =
std::aligned_storage<sizeof(CrashHandlerString),
alignof(CrashHandlerString)>::type;
static CrashHandlerStringStorage crashHandlerStringStorage;
using CrashHandlerStringStorage = std::byte[sizeof(CrashHandlerString)];
alignas(CrashHandlerString) static CrashHandlerStringStorage
crashHandlerStringStorage;
#endif

/// This callback is run if a fatal signal is delivered to the process, it
Expand Down
Loading