aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/DebugCounter.cpp
diff options
context:
space:
mode:
authorMehdi Amini <joker.eph@gmail.com>2021-07-16 07:34:41 +0000
committerMehdi Amini <joker.eph@gmail.com>2021-07-16 07:35:13 +0000
commit8d051d854619956de633047409149cdab1e3319a (patch)
treee51ddd9e2fdb3237526b74ab09484bec6b4ca44a /llvm/lib/Support/DebugCounter.cpp
parent3d3dc9523f9b2ec9d83d37bd8a757726f37b6ee5 (diff)
downloadllvm-8d051d854619956de633047409149cdab1e3319a.zip
llvm-8d051d854619956de633047409149cdab1e3319a.tar.gz
llvm-8d051d854619956de633047409149cdab1e3319a.tar.bz2
Revert "Use ManagedStatic and lazy initialization of cl::opt in libSupport to make it free of global initializer"
This reverts commit af9321739b20becf170e6bb5060b8d780e1dc8dd. Still some specific config broken in some way that requires more investigation.
Diffstat (limited to 'llvm/lib/Support/DebugCounter.cpp')
-rw-r--r--llvm/lib/Support/DebugCounter.cpp31
1 files changed, 8 insertions, 23 deletions
diff --git a/llvm/lib/Support/DebugCounter.cpp b/llvm/lib/Support/DebugCounter.cpp
index f553463..7bb231c 100644
--- a/llvm/lib/Support/DebugCounter.cpp
+++ b/llvm/lib/Support/DebugCounter.cpp
@@ -1,7 +1,4 @@
#include "llvm/Support/DebugCounter.h"
-
-#include "DebugOptions.h"
-
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/ManagedStatic.h"
@@ -43,29 +40,17 @@ private:
}
}
};
-
-struct CreateDebugCounterOption {
- static void *call() {
- return new DebugCounterList(
- "debug-counter", cl::Hidden,
- cl::desc("Comma separated list of debug counter skip and count"),
- cl::CommaSeparated, cl::ZeroOrMore,
- cl::location(DebugCounter::instance()));
- }
-};
} // namespace
-static ManagedStatic<DebugCounterList, CreateDebugCounterOption>
- DebugCounterOption;
-static bool PrintDebugCounter;
+// Create our command line option.
+static DebugCounterList DebugCounterOption(
+ "debug-counter", cl::Hidden,
+ cl::desc("Comma separated list of debug counter skip and count"),
+ cl::CommaSeparated, cl::ZeroOrMore, cl::location(DebugCounter::instance()));
-void llvm::initDebugCounterOptions() {
- *DebugCounterOption;
- static cl::opt<bool, true> RegisterPrintDebugCounter(
- "print-debug-counter", cl::Hidden, cl::location(PrintDebugCounter),
- cl::init(false), cl::Optional,
- cl::desc("Print out debug counter info after all counters accumulated"));
-}
+static cl::opt<bool> PrintDebugCounter(
+ "print-debug-counter", cl::Hidden, cl::init(false), cl::Optional,
+ cl::desc("Print out debug counter info after all counters accumulated"));
static ManagedStatic<DebugCounter> DC;