summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/Support/WithColor.h2
-rw-r--r--llvm/lib/Support/WithColor.cpp6
-rw-r--r--llvm/test/tools/dsymutil/cmdline.test2
-rw-r--r--llvm/test/tools/llvm-dwarfdump/cmdline.test2
-rw-r--r--llvm/tools/dsymutil/dsymutil.cpp2
-rw-r--r--llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp3
6 files changed, 13 insertions, 4 deletions
diff --git a/llvm/include/llvm/Support/WithColor.h b/llvm/include/llvm/Support/WithColor.h
index ee1e05cda32..e3559b4002a 100644
--- a/llvm/include/llvm/Support/WithColor.h
+++ b/llvm/include/llvm/Support/WithColor.h
@@ -14,6 +14,8 @@
namespace llvm {
+extern cl::OptionCategory ColorCategory;
+
class raw_ostream;
// Symbolic names for various syntax elements.
diff --git a/llvm/lib/Support/WithColor.cpp b/llvm/lib/Support/WithColor.cpp
index a663c69ac3e..d71aed9126b 100644
--- a/llvm/lib/Support/WithColor.cpp
+++ b/llvm/lib/Support/WithColor.cpp
@@ -13,9 +13,11 @@
using namespace llvm;
+cl::OptionCategory llvm::ColorCategory("Color Options");
+
static cl::opt<cl::boolOrDefault>
- UseColor("color",
- cl::desc("use colored syntax highlighting (default=autodetect)"),
+ UseColor("color", cl::cat(ColorCategory),
+ cl::desc("Use colors in output (default=autodetect)"),
cl::init(cl::BOU_UNSET));
bool WithColor::colorsEnabled(raw_ostream &OS) {
diff --git a/llvm/test/tools/dsymutil/cmdline.test b/llvm/test/tools/dsymutil/cmdline.test
index c9b5b2c0efa..e010169b20e 100644
--- a/llvm/test/tools/dsymutil/cmdline.test
+++ b/llvm/test/tools/dsymutil/cmdline.test
@@ -2,6 +2,8 @@ RUN: dsymutil -help 2>&1 | FileCheck --check-prefix=HELP %s
HELP: OVERVIEW: manipulate archived DWARF debug symbol files.
HELP: USAGE: dsymutil{{[^ ]*}} [options] <input files>
HELP-NOT: -reverse-iterate
+HELP: Color Options
+HELP: -color
HELP: Specific Options:
HELP: -arch=<arch>
HELP: -dump-debug-map
diff --git a/llvm/test/tools/llvm-dwarfdump/cmdline.test b/llvm/test/tools/llvm-dwarfdump/cmdline.test
index 7fb9e8389d0..1314990a7b9 100644
--- a/llvm/test/tools/llvm-dwarfdump/cmdline.test
+++ b/llvm/test/tools/llvm-dwarfdump/cmdline.test
@@ -2,6 +2,8 @@ RUN: llvm-dwarfdump -h 2>&1 | FileCheck --check-prefix=HELP %s
RUN: llvm-dwarfdump --help 2>&1 | FileCheck --check-prefix=HELP %s
HELP: USAGE: llvm-dwarfdump{{[^ ]*}} [options] <input object files or .dSYM bundles>
HELP-NOT: -reverse-iterate
+HELP: Color Options
+HELP: -color
HELP: Section-specific Dump Options
HELP: -debug-info - Dump the .debug_info section
HELP: -eh-frame
diff --git a/llvm/tools/dsymutil/dsymutil.cpp b/llvm/tools/dsymutil/dsymutil.cpp
index 2ffa7d85792..7487dd9694e 100644
--- a/llvm/tools/dsymutil/dsymutil.cpp
+++ b/llvm/tools/dsymutil/dsymutil.cpp
@@ -393,7 +393,7 @@ int main(int argc, char **argv) {
std::string SDKPath = llvm::sys::fs::getMainExecutable(argv[0], P);
SDKPath = llvm::sys::path::parent_path(SDKPath);
- HideUnrelatedOptions(DsymCategory);
+ HideUnrelatedOptions({&DsymCategory, &ColorCategory});
llvm::cl::ParseCommandLineOptions(
argc, argv,
"manipulate archived DWARF debug symbol files.\n\n"
diff --git a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
index 273c535925c..300a00b01be 100644
--- a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
+++ b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
@@ -28,6 +28,7 @@
#include "llvm/Support/Regex.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/ToolOutputFile.h"
+#include "llvm/Support/WithColor.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
@@ -513,7 +514,7 @@ int main(int argc, char **argv) {
llvm::InitializeAllTargetInfos();
llvm::InitializeAllTargetMCs();
- HideUnrelatedOptions({&DwarfDumpCategory, &SectionCategory});
+ HideUnrelatedOptions({&DwarfDumpCategory, &SectionCategory, &ColorCategory});
cl::ParseCommandLineOptions(
argc, argv,
"pretty-print DWARF debug information in object files"
OpenPOWER on IntegriCloud