diff options
author | Daniel Sanders <daniel_l_sanders@apple.com> | 2017-03-27 13:15:13 +0000 |
---|---|---|
committer | Daniel Sanders <daniel_l_sanders@apple.com> | 2017-03-27 13:15:13 +0000 |
commit | 0848b23d5350ee5a28ffcee6bf51b440133cfa98 (patch) | |
tree | 4fb89e3fc2caf92185d047ffbdb50fff94f3e976 /llvm/utils/TableGen | |
parent | d2a97e0b7e2918532440bd6b3d32e68138a4dbf8 (diff) | |
download | bcm5719-llvm-0848b23d5350ee5a28ffcee6bf51b440133cfa98.tar.gz bcm5719-llvm-0848b23d5350ee5a28ffcee6bf51b440133cfa98.zip |
[tablegen] Use categories on options that only matter to one emitter.
Summary:
The categories are emitted in a strange order in this patch due to a bug in the
CommandLine library.
Reviewers: ab
Reviewed By: ab
Subscribers: ab, llvm-commits
Differential Revision: https://reviews.llvm.org/D30995
llvm-svn: 298843
Diffstat (limited to 'llvm/utils/TableGen')
-rw-r--r-- | llvm/utils/TableGen/AsmMatcherEmitter.cpp | 7 | ||||
-rw-r--r-- | llvm/utils/TableGen/CodeGenTarget.cpp | 13 | ||||
-rw-r--r-- | llvm/utils/TableGen/DAGISelMatcherEmitter.cpp | 10 | ||||
-rw-r--r-- | llvm/utils/TableGen/GlobalISelEmitter.cpp | 4 | ||||
-rw-r--r-- | llvm/utils/TableGen/TableGen.cpp | 3 |
5 files changed, 25 insertions, 12 deletions
diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp index 73dddc4846c..5953bdc7301 100644 --- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp +++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp @@ -123,9 +123,12 @@ using namespace llvm; #define DEBUG_TYPE "asm-matcher-emitter" +cl::OptionCategory AsmMatcherEmitterCat("Options for -gen-asm-matcher"); + static cl::opt<std::string> -MatchPrefix("match-prefix", cl::init(""), - cl::desc("Only match instructions with the given prefix")); + MatchPrefix("match-prefix", cl::init(""), + cl::desc("Only match instructions with the given prefix"), + cl::cat(AsmMatcherEmitterCat)); namespace { class AsmMatcherInfo; diff --git a/llvm/utils/TableGen/CodeGenTarget.cpp b/llvm/utils/TableGen/CodeGenTarget.cpp index 6503d5af2d4..d93511b0d87 100644 --- a/llvm/utils/TableGen/CodeGenTarget.cpp +++ b/llvm/utils/TableGen/CodeGenTarget.cpp @@ -25,13 +25,18 @@ #include <algorithm> using namespace llvm; +cl::OptionCategory AsmParserCat("Options for -gen-asm-parser"); +cl::OptionCategory AsmWriterCat("Options for -gen-asm-writer"); + static cl::opt<unsigned> -AsmParserNum("asmparsernum", cl::init(0), - cl::desc("Make -gen-asm-parser emit assembly parser #N")); + AsmParserNum("asmparsernum", cl::init(0), + cl::desc("Make -gen-asm-parser emit assembly parser #N"), + cl::cat(AsmParserCat)); static cl::opt<unsigned> -AsmWriterNum("asmwriternum", cl::init(0), - cl::desc("Make -gen-asm-writer emit assembly writer #N")); + AsmWriterNum("asmwriternum", cl::init(0), + cl::desc("Make -gen-asm-writer emit assembly writer #N"), + cl::cat(AsmWriterCat)); /// getValueType - Return the MVT::SimpleValueType that the specified TableGen /// record corresponds to. diff --git a/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp b/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp index 4b00676b51b..67e8f15b248 100644 --- a/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp +++ b/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp @@ -30,15 +30,17 @@ enum { CommentIndent = 30 }; +cl::OptionCategory DAGISelCat("Options for -gen-dag-isel"); + // To reduce generated source code size. -static cl::opt<bool> -OmitComments("omit-comments", cl::desc("Do not generate comments"), - cl::init(false)); +static cl::opt<bool> OmitComments("omit-comments", + cl::desc("Do not generate comments"), + cl::init(false), cl::cat(DAGISelCat)); static cl::opt<bool> InstrumentCoverage( "instrument-coverage", cl::desc("Generates tables to help identify patterns matched"), - cl::init(false)); + cl::init(false), cl::cat(DAGISelCat)); namespace { class MatcherTableEmitter { diff --git a/llvm/utils/TableGen/GlobalISelEmitter.cpp b/llvm/utils/TableGen/GlobalISelEmitter.cpp index 169dd32daa6..f97f5c99c5e 100644 --- a/llvm/utils/TableGen/GlobalISelEmitter.cpp +++ b/llvm/utils/TableGen/GlobalISelEmitter.cpp @@ -52,11 +52,13 @@ STATISTIC(NumPatternImported, "Number of patterns imported from SelectionDAG"); STATISTIC(NumPatternImportsSkipped, "Number of SelectionDAG imports skipped"); STATISTIC(NumPatternEmitted, "Number of patterns emitted"); +cl::OptionCategory GlobalISelEmitterCat("Options for -gen-global-isel"); + static cl::opt<bool> WarnOnSkippedPatterns( "warn-on-skipped-patterns", cl::desc("Explain why a pattern was skipped for inclusion " "in the GlobalISel selector"), - cl::init(false)); + cl::init(false), cl::cat(GlobalISelEmitterCat)); namespace { //===- Helper functions ---------------------------------------------------===// diff --git a/llvm/utils/TableGen/TableGen.cpp b/llvm/utils/TableGen/TableGen.cpp index aa1aefd5e4a..00d20f1df6c 100644 --- a/llvm/utils/TableGen/TableGen.cpp +++ b/llvm/utils/TableGen/TableGen.cpp @@ -102,9 +102,10 @@ namespace { clEnumValN(GenRegisterBank, "gen-register-bank", "Generate registers bank descriptions"))); + cl::OptionCategory PrintEnumsCat("Options for -print-enums"); cl::opt<std::string> Class("class", cl::desc("Print Enum list for this class"), - cl::value_desc("class name")); + cl::value_desc("class name"), cl::cat(PrintEnumsCat)); bool LLVMTableGenMain(raw_ostream &OS, RecordKeeper &Records) { switch (Action) { |