[llvm] 810f06e - [llvm-lto2] Replace std::atomic_init with brace initiation. NFC (#143274)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 28 15:09:23 PDT 2025
Author: scuzqy
Date: 2025-08-29T00:09:20+02:00
New Revision: 810f06ec3e87e924f9cf1a60f1440663f8f70d82
URL: https://github.com/llvm/llvm-project/commit/810f06ec3e87e924f9cf1a60f1440663f8f70d82
DIFF: https://github.com/llvm/llvm-project/commit/810f06ec3e87e924f9cf1a60f1440663f8f70d82.diff
LOG: [llvm-lto2] Replace std::atomic_init with brace initiation. NFC (#143274)
In C++ 20, std::atomic_init is deprecated.
This patch replaces call to std::atomic_init with brace initiation.
Added:
Modified:
llvm/tools/llvm-lto2/llvm-lto2.cpp
Removed:
################################################################################
diff --git a/llvm/tools/llvm-lto2/llvm-lto2.cpp b/llvm/tools/llvm-lto2/llvm-lto2.cpp
index d27a2199d75d8..dd9b6ba95a439 100644
--- a/llvm/tools/llvm-lto2/llvm-lto2.cpp
+++ b/llvm/tools/llvm-lto2/llvm-lto2.cpp
@@ -394,8 +394,7 @@ static int run(int argc, char **argv) {
// behavior. Instead, we don't exit in the multi-threaded case, but we make
// sure to report the error and then at the end (after joining cleanly)
// exit(1).
- std::atomic<bool> HasErrors;
- std::atomic_init(&HasErrors, false);
+ std::atomic<bool> HasErrors{false};
Conf.DiagHandler = [&](const DiagnosticInfo &DI) {
DiagnosticPrinterRawOStream DP(errs());
DI.print(DP);
More information about the llvm-commits
mailing list