diff options
author | Mehdi Amini <joker.eph@gmail.com> | 2021-07-16 03:46:22 +0000 |
---|---|---|
committer | Mehdi Amini <joker.eph@gmail.com> | 2021-07-16 03:46:53 +0000 |
commit | 16b5e9d6a269913e8da0fa037e8af32eaf304c8f (patch) | |
tree | 2029314f1156239954ae10c5eb6748a303fdfc14 /llvm/lib/Support/DebugCounter.cpp | |
parent | 42f588f39c5ce6f521e3709b8871d1fdd076292f (diff) | |
download | llvm-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/DebugCounter.cpp')
-rw-r--r-- | llvm/lib/Support/DebugCounter.cpp | 31 |
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; |