[PATCH] D71228: [Commandline] Move Debug options from Debug.cpp to Commandline.cpp
Don Hinton via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 11 15:33:32 PST 2019
hintonda marked an inline comment as done.
hintonda added inline comments.
================
Comment at: llvm/lib/Support/Debug.cpp:82
-// -debug - Command line option to enable the DEBUG statements in the passes.
-// This flag may only be enabled in debug builds.
-static cl::opt<bool, true>
-Debug("debug", cl::desc("Enable debug output"), cl::Hidden,
- cl::location(DebugFlag));
-
-// -debug-buffer-size - Buffer the last N characters of debug output
-//until program termination.
-static cl::opt<unsigned>
-DebugBufferSize("debug-buffer-size",
- cl::desc("Buffer the last N characters of debug output "
- "until program termination. "
- "[default 0 -- immediate print-out]"),
- cl::Hidden,
- cl::init(0));
-
-static cl::list<std::string, ManagedStatic<std::vector<std::string>>>
- DebugOnly("debug-only",
- cl::desc("Enable a specific type of debug output (comma "
- "separated list of types)"),
- cl::Hidden, cl::ZeroOrMore, cl::value_desc("debug string"),
- cl::location(CurrentDebugType), cl::CommaSeparated,
- cl::callback([](const std::string &) { DebugFlag = true; }));
+unsigned DebugBufferSize = 0;
----------------
serge-sans-paille wrote:
> Why did you keep that definition here?
Originally, the option was named `DebugBufferSize` and only used in `llvm::dbgs()` below.
I renamed it to `DebugBufferSizeOpt` when I moved to CommandLine.cpp, and added a `cl::location` attribute referencing the new DebugBufferSize variable. Might make sense to put it in the `llvm` namespace though.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71228/new/
https://reviews.llvm.org/D71228
More information about the llvm-commits
mailing list