[Support] Add color cl category.
This commit adds a color category so tools can document this option and
enables it for dwarfdump and dsymuttil.
rdar://problem/40498996
llvm-svn: 333176
diff --git a/llvm/tools/dsymutil/dsymutil.cpp b/llvm/tools/dsymutil/dsymutil.cpp
index 2ffa7d8..7487dd9 100644
--- a/llvm/tools/dsymutil/dsymutil.cpp
+++ b/llvm/tools/dsymutil/dsymutil.cpp
@@ -393,7 +393,7 @@
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 273c535..300a00b 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 @@
llvm::InitializeAllTargetInfos();
llvm::InitializeAllTargetMCs();
- HideUnrelatedOptions({&DwarfDumpCategory, &SectionCategory});
+ HideUnrelatedOptions({&DwarfDumpCategory, &SectionCategory, &ColorCategory});
cl::ParseCommandLineOptions(
argc, argv,
"pretty-print DWARF debug information in object files"