aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Signals.cpp
diff options
context:
space:
mode:
authorMehdi Amini <joker.eph@gmail.com>2021-07-16 03:46:22 +0000
committerMehdi Amini <joker.eph@gmail.com>2021-07-16 03:46:53 +0000
commit16b5e9d6a269913e8da0fa037e8af32eaf304c8f (patch)
tree2029314f1156239954ae10c5eb6748a303fdfc14 /llvm/lib/Support/Signals.cpp
parent42f588f39c5ce6f521e3709b8871d1fdd076292f (diff)
downloadllvm-16b5e9d6a269913e8da0fa037e8af32eaf304c8f.zip
llvm-16b5e9d6a269913e8da0fa037e8af32eaf304c8f.tar.gz
llvm-16b5e9d6a269913e8da0fa037e8af32eaf304c8f.tar.bz2
Revert "Use ManagedStatic and lazy initialization of cl::opt in libSupport to make it free of global initializer"
This reverts commit 42f588f39c5ce6f521e3709b8871d1fdd076292f. Broke some buildbots
Diffstat (limited to 'llvm/lib/Support/Signals.cpp')
-rw-r--r--llvm/lib/Support/Signals.cpp39
1 files changed, 9 insertions, 30 deletions
diff --git a/llvm/lib/Support/Signals.cpp b/llvm/lib/Support/Signals.cpp
index dd4dded..4e70eed 100644
--- a/llvm/lib/Support/Signals.cpp
+++ b/llvm/lib/Support/Signals.cpp
@@ -12,9 +12,6 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/Signals.h"
-
-#include "DebugOptions.h"
-
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Config/llvm-config.h"
@@ -42,33 +39,15 @@ using namespace llvm;
// Use explicit storage to avoid accessing cl::opt in a signal handler.
static bool DisableSymbolicationFlag = false;
-static ManagedStatic<std::string> CrashDiagnosticsDirectory;
-namespace {
-struct CreateDisableSymbolication {
- static void *call() {
- return new cl::opt<bool, true>(
- "disable-symbolication",
- cl::desc("Disable symbolizing crash backtraces."),
- cl::location(DisableSymbolicationFlag), cl::Hidden);
- }
-};
-struct CreateCrashDiagnosticsDir {
- static void *call() {
- return new cl::opt<std::string, true>(
- "crash-diagnostics-dir", cl::value_desc("directory"),
- cl::desc("Directory for crash diagnostic files."),
- cl::location(*CrashDiagnosticsDirectory), cl::Hidden);
- }
-};
-} // namespace
-void llvm::initSignalsOptions() {
- static ManagedStatic<cl::opt<bool, true>, CreateDisableSymbolication>
- DisableSymbolication;
- static ManagedStatic<cl::opt<std::string, true>, CreateCrashDiagnosticsDir>
- CrashDiagnosticsDir;
- *DisableSymbolication;
- *CrashDiagnosticsDir;
-}
+static cl::opt<bool, true>
+ DisableSymbolication("disable-symbolication",
+ cl::desc("Disable symbolizing crash backtraces."),
+ cl::location(DisableSymbolicationFlag), cl::Hidden);
+static std::string CrashDiagnosticsDirectory;
+static cl::opt<std::string, true>
+ CrashDiagnosticsDir("crash-diagnostics-dir", cl::value_desc("directory"),
+ cl::desc("Directory for crash diagnostic files."),
+ cl::location(CrashDiagnosticsDirectory), cl::Hidden);
constexpr char DisableSymbolizationEnv[] = "LLVM_DISABLE_SYMBOLIZATION";
constexpr char LLVMSymbolizerPathEnv[] = "LLVM_SYMBOLIZER_PATH";