aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp')
-rw-r--r--llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp29
1 files changed, 21 insertions, 8 deletions
diff --git a/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp b/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
index 639a6d1ec02c..f4851bfb2a9c 100644
--- a/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
+++ b/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
@@ -32,37 +32,48 @@
#include "llvm/Support/Error.h"
#include "llvm/Support/InitLLVM.h"
#include "llvm/Support/MemoryBuffer.h"
+#include "llvm/Support/WithColor.h"
#include "llvm/Support/raw_ostream.h"
#include <memory>
using namespace llvm;
-static cl::opt<std::string>
- InputFilename(cl::Positional, cl::desc("<input bitcode>"), cl::init("-"));
+static cl::OptionCategory BCAnalyzerCategory("BC Analyzer Options");
+
+static cl::opt<std::string> InputFilename(cl::Positional,
+ cl::desc("<input bitcode>"),
+ cl::init("-"),
+ cl::cat(BCAnalyzerCategory));
-static cl::opt<bool> Dump("dump", cl::desc("Dump low level bitcode trace"));
+static cl::opt<bool> Dump("dump", cl::desc("Dump low level bitcode trace"),
+ cl::cat(BCAnalyzerCategory));
//===----------------------------------------------------------------------===//
// Bitcode specific analysis.
//===----------------------------------------------------------------------===//
static cl::opt<bool> NoHistogram("disable-histogram",
- cl::desc("Do not print per-code histogram"));
+ cl::desc("Do not print per-code histogram"),
+ cl::cat(BCAnalyzerCategory));
static cl::opt<bool> NonSymbolic("non-symbolic",
cl::desc("Emit numeric info in dump even if"
- " symbolic info is available"));
+ " symbolic info is available"),
+ cl::cat(BCAnalyzerCategory));
static cl::opt<std::string>
BlockInfoFilename("block-info",
- cl::desc("Use the BLOCK_INFO from the given file"));
+ cl::desc("Use the BLOCK_INFO from the given file"),
+ cl::cat(BCAnalyzerCategory));
static cl::opt<bool>
ShowBinaryBlobs("show-binary-blobs",
- cl::desc("Print binary blobs using hex escapes"));
+ cl::desc("Print binary blobs using hex escapes"),
+ cl::cat(BCAnalyzerCategory));
static cl::opt<std::string> CheckHash(
"check-hash",
- cl::desc("Check module hash using the argument as a string table"));
+ cl::desc("Check module hash using the argument as a string table"),
+ cl::cat(BCAnalyzerCategory));
static Error reportError(StringRef Message) {
return createStringError(std::errc::illegal_byte_sequence, Message.data());
@@ -85,6 +96,8 @@ static Expected<std::unique_ptr<MemoryBuffer>> openBitcodeFile(StringRef Path) {
int main(int argc, char **argv) {
InitLLVM X(argc, argv);
+
+ cl::HideUnrelatedOptions({&BCAnalyzerCategory, &getColorCategory()});
cl::ParseCommandLineOptions(argc, argv, "llvm-bcanalyzer file analyzer\n");
ExitOnError ExitOnErr("llvm-bcanalyzer: ");