[PATCH] D60603: Make llvm-as --help great again
serge via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 12 02:50:37 PDT 2019
serge-sans-paille updated this revision to Diff 194825.
serge-sans-paille added a comment.
Including test case
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D60603/new/
https://reviews.llvm.org/D60603
Files:
test/tools/llvm-as/help.test
test/tools/llvm-as/lit.local.cfg
tools/llvm-as/llvm-as.cpp
Index: tools/llvm-as/llvm-as.cpp
===================================================================
--- tools/llvm-as/llvm-as.cpp
+++ tools/llvm-as/llvm-as.cpp
@@ -30,38 +30,43 @@
#include <memory>
using namespace llvm;
+cl::OptionCategory AsCat("llvm-as Options");
+
static cl::opt<std::string> InputFilename(cl::Positional,
cl::desc("<input .llvm file>"),
cl::init("-"));
static cl::opt<std::string> OutputFilename("o",
cl::desc("Override output filename"),
- cl::value_desc("filename"));
+ cl::value_desc("filename"),
+ cl::cat(AsCat));
-static cl::opt<bool> Force("f", cl::desc("Enable binary output on terminals"));
+static cl::opt<bool> Force("f", cl::desc("Enable binary output on terminals"),
+ cl::cat(AsCat));
static cl::opt<bool> DisableOutput("disable-output", cl::desc("Disable output"),
- cl::init(false));
+ cl::init(false), cl::cat(AsCat));
static cl::opt<bool> EmitModuleHash("module-hash", cl::desc("Emit module hash"),
- cl::init(false));
+ cl::init(false), cl::cat(AsCat));
static cl::opt<bool> DumpAsm("d", cl::desc("Print assembly as parsed"),
- cl::Hidden);
+ cl::Hidden, cl::cat(AsCat));
static cl::opt<bool>
DisableVerify("disable-verify", cl::Hidden,
- cl::desc("Do not run verifier on input LLVM (dangerous!)"));
+ cl::desc("Do not run verifier on input LLVM (dangerous!)"),
+ cl::cat(AsCat));
static cl::opt<bool> PreserveBitcodeUseListOrder(
"preserve-bc-uselistorder",
cl::desc("Preserve use-list order when writing LLVM bitcode."),
- cl::init(true), cl::Hidden);
+ cl::init(true), cl::Hidden, cl::cat(AsCat));
static cl::opt<std::string> ClDataLayout("data-layout",
cl::desc("data layout string to use"),
cl::value_desc("layout-string"),
- cl::init(""));
+ cl::init(""), cl::cat(AsCat));
static void WriteOutputFile(const Module *M, const ModuleSummaryIndex *Index) {
// Infer the output filename if needed.
@@ -109,6 +114,7 @@
int main(int argc, char **argv) {
InitLLVM X(argc, argv);
LLVMContext Context;
+ cl::HideUnrelatedOptions(AsCat);
cl::ParseCommandLineOptions(argc, argv, "llvm .ll -> .bc assembler\n");
// Parse the file now...
Index: test/tools/llvm-as/lit.local.cfg
===================================================================
--- test/tools/llvm-as/lit.local.cfg
+++ test/tools/llvm-as/lit.local.cfg
@@ -0,0 +1,4 @@
+if not 'X86' in config.root.targets:
+ config.unsupported = True
+
+config.suffixes = ['.ll', '.s', '.test', '.yaml']
Index: test/tools/llvm-as/help.test
===================================================================
--- test/tools/llvm-as/help.test
+++ test/tools/llvm-as/help.test
@@ -0,0 +1,3 @@
+RUN: llvm-as --help 2>&1 | FileCheck --implicit-check-not="General Options:" %s
+CHECK: Generic Options:
+CHECK: llvm-as Options:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60603.194825.patch
Type: text/x-patch
Size: 3470 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190412/e59c6932/attachment.bin>
More information about the llvm-commits
mailing list