diff --git a/lldb/test/API/tools/lldb-server/vCont-threads/main.cpp b/lldb/test/API/tools/lldb-server/vCont-threads/main.cpp index 77b6aacc7d4d..ffc1489dfeb8 100644 --- a/lldb/test/API/tools/lldb-server/vCont-threads/main.cpp +++ b/lldb/test/API/tools/lldb-server/vCont-threads/main.cpp @@ -14,7 +14,7 @@ pseudo_barrier_t barrier; std::mutex print_mutex; -std::atomic can_work = ATOMIC_VAR_INIT(false); +std::atomic can_work = false; thread_local volatile sig_atomic_t can_exit_now = false; static void sigint_handler(int signo) {} diff --git a/llvm/lib/Support/PrettyStackTrace.cpp b/llvm/lib/Support/PrettyStackTrace.cpp index fa91405fee10..f9f1b8a419b8 100644 --- a/llvm/lib/Support/PrettyStackTrace.cpp +++ b/llvm/lib/Support/PrettyStackTrace.cpp @@ -64,8 +64,7 @@ static LLVM_THREAD_LOCAL PrettyStackTraceEntry *PrettyStackTraceHead = nullptr; // the current thread". If the user happens to overflow an 'unsigned' with // SIGINFO requests, it's possible that some threads will stop responding to it, // but the program won't crash. -static volatile std::atomic GlobalSigInfoGenerationCounter = - ATOMIC_VAR_INIT(1); +static volatile std::atomic GlobalSigInfoGenerationCounter = 1; static LLVM_THREAD_LOCAL unsigned ThreadLocalSigInfoGenerationCounter = 0; namespace llvm { diff --git a/llvm/lib/Support/Unix/Signals.inc b/llvm/lib/Support/Unix/Signals.inc index 05a7335216f4..ce093d5a4dc0 100644 --- a/llvm/lib/Support/Unix/Signals.inc +++ b/llvm/lib/Support/Unix/Signals.inc @@ -84,13 +84,11 @@ static void InfoSignalHandler(int Sig); // defined below. using SignalHandlerFunctionType = void (*)(); /// The function to call if ctrl-c is pressed. -static std::atomic InterruptFunction = - ATOMIC_VAR_INIT(nullptr); -static std::atomic InfoSignalFunction = - ATOMIC_VAR_INIT(nullptr); +static std::atomic InterruptFunction = nullptr; +static std::atomic InfoSignalFunction = nullptr; /// The function to call on SIGPIPE (one-time use only). static std::atomic OneShotPipeSignalFunction = - ATOMIC_VAR_INIT(nullptr); + nullptr; namespace { /// Signal-safe removal of files. @@ -98,8 +96,8 @@ namespace { /// themselves is signal-safe. Memory is freed when the head is freed, deletion /// is therefore not signal-safe either. class FileToRemoveList { - std::atomic Filename = ATOMIC_VAR_INIT(nullptr); - std::atomic Next = ATOMIC_VAR_INIT(nullptr); + std::atomic Filename = nullptr; + std::atomic Next = nullptr; FileToRemoveList() = default; // Not signal-safe. @@ -188,7 +186,7 @@ public: Head.exchange(OldHead); } }; -static std::atomic FilesToRemove = ATOMIC_VAR_INIT(nullptr); +static std::atomic FilesToRemove = nullptr; /// Clean up the list in a signal-friendly manner. /// Recall that signals can fire during llvm_shutdown. If this occurs we should @@ -248,7 +246,7 @@ static const int InfoSigs[] = {SIGUSR1 static const size_t NumSigs = std::size(IntSigs) + std::size(KillSigs) + std::size(InfoSigs) + 1 /* SIGPIPE */; -static std::atomic NumRegisteredSignals = ATOMIC_VAR_INIT(0); +static std::atomic NumRegisteredSignals = 0; static struct { struct sigaction SA; int SigNo;