summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/Support/ManagedStatic.h2
-rw-r--r--llvm/lib/Support/CommandLine.cpp6
2 files changed, 3 insertions, 5 deletions
diff --git a/llvm/include/llvm/Support/ManagedStatic.h b/llvm/include/llvm/Support/ManagedStatic.h
index 0290510e030..30c3daa5ba5 100644
--- a/llvm/include/llvm/Support/ManagedStatic.h
+++ b/llvm/include/llvm/Support/ManagedStatic.h
@@ -45,7 +45,7 @@ template <typename T, size_t N> struct object_deleter<T[N]> {
class ManagedStaticBase {
protected:
#ifndef LLVM_AVOID_CONSTEXPR_CTOR
- mutable std::atomic<void *> Ptr;
+ mutable std::atomic<void *> Ptr{nullptr};
mutable void (*DeleterFn)(void *) = nullptr;
mutable const ManagedStaticBase *Next = nullptr;
#else
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index d2cfef9f42a..1858fe941ae 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -377,12 +377,10 @@ void OptionCategory::registerCategory() {
// that this ManagedStatic uses constant initailization and not dynamic
// initialization because it is referenced from cl::opt constructors, which run
// dynamically in an arbitrary order.
-LLVM_REQUIRE_CONSTANT_INITIALIZATION ManagedStatic<SubCommand>
- llvm::cl::TopLevelSubCommand;
+ManagedStatic<SubCommand> llvm::cl::TopLevelSubCommand;
// A special subcommand that can be used to put an option into all subcommands.
-LLVM_REQUIRE_CONSTANT_INITIALIZATION ManagedStatic<SubCommand>
- llvm::cl::AllSubCommands;
+ManagedStatic<SubCommand> llvm::cl::AllSubCommands;
void SubCommand::registerSubCommand() {
GlobalParser->registerSubCommand(this);
OpenPOWER on IntegriCloud