aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-lto2/llvm-lto2.cpp
diff options
context:
space:
mode:
authorscuzqy <80660355+scuzqy@users.noreply.github.com>2025-08-29 06:09:20 +0800
committerGitHub <noreply@github.com>2025-08-29 00:09:20 +0200
commit810f06ec3e87e924f9cf1a60f1440663f8f70d82 (patch)
tree21b96d4f5449dce6c293ed39c001f9949425efec /llvm/tools/llvm-lto2/llvm-lto2.cpp
parent2ae4b92a1cf01b7d09f70ccc919eca2b5d02b080 (diff)
downloadllvm-810f06ec3e87e924f9cf1a60f1440663f8f70d82.zip
llvm-810f06ec3e87e924f9cf1a60f1440663f8f70d82.tar.gz
llvm-810f06ec3e87e924f9cf1a60f1440663f8f70d82.tar.bz2
[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.
Diffstat (limited to 'llvm/tools/llvm-lto2/llvm-lto2.cpp')
-rw-r--r--llvm/tools/llvm-lto2/llvm-lto2.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/tools/llvm-lto2/llvm-lto2.cpp b/llvm/tools/llvm-lto2/llvm-lto2.cpp
index d27a219..dd9b6ba 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);