diff options
| author | Reid Kleckner <rnk@google.com> | 2019-04-04 18:45:05 +0000 |
|---|---|---|
| committer | Reid Kleckner <rnk@google.com> | 2019-04-04 18:45:05 +0000 |
| commit | 4312fee0a9fb5b2bfe4a52766a4abdd35f23c018 (patch) | |
| tree | dca1a48ea7711c3fb08d54869706177f11832320 | |
| parent | 09137be7f8f604b28fc122e14631b133f3ec4ef0 (diff) | |
| download | bcm5719-llvm-4312fee0a9fb5b2bfe4a52766a4abdd35f23c018.tar.gz bcm5719-llvm-4312fee0a9fb5b2bfe4a52766a4abdd35f23c018.zip | |
Appease STLs where std::atomic<void*> lacks a constexpr default ctor
MSVC 2019 casts the pointer to a pointer-sized integer, which is a
reinterpret_cast, which is invalid in a constexpr context, so I have to
remove the LLVM_REQUIRES_CONSTANT_INITIALIZATION annotation for now.
llvm-svn: 357716
| -rw-r--r-- | llvm/include/llvm/Support/ManagedStatic.h | 2 | ||||
| -rw-r--r-- | llvm/lib/Support/CommandLine.cpp | 6 |
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); |

