Ignore:
Timestamp:
May 4, 2016, 11:50:51 AM (3 years ago)
Author:
cameron
Message:

Updates for LLVM 3.8; hide unrelated command line options

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/icgrep.cpp

    r5025 r5026  
    1919
    2020#include <iostream> // MEEE
    21 static cl::OptionCategory CountOnlyOptions("CountOnly Option",
    22                                        "This option controls the output.");
    23 static cl::opt<bool> CountOnly("c", cl::desc("Count and display the matching lines per file only."), cl::cat(CountOnlyOptions));
     21static cl::OptionCategory LegacyGrepOptions("A. Standard Grep Options",
     22                                       "These are standard grep options intended for compatibility with typical grep usage.");
     23static cl::OptionCategory EnhancedGrepOptions("B. Enhanced Grep Options",
     24                                       "These are additional options for icgrep functionality and performance.");
     25static cl::opt<bool> CountOnly("c", cl::desc("Count and display the matching lines per file only."), cl::cat(LegacyGrepOptions));
    2426static cl::alias CountOnlyLong("count", cl::desc("Alias for -c"), cl::aliasopt(CountOnly));
    2527
    26 static cl::OptionCategory aRegexSourceOptions("Regular Expression Options",
    27                                        "These options control the regular expression source.");
    28 
    2928static cl::list<std::string> inputFiles(cl::Positional, cl::desc("<regex> <input file ...>"), cl::OneOrMore);
    3029
    31 static cl::opt<bool> CaseInsensitive("i", cl::desc("Ignore case distinctions in the pattern and the file."), cl::cat(aRegexSourceOptions));
    32 
    33 
    34 static cl::list<std::string> regexVector("e", cl::desc("Regular expression"), cl::ZeroOrMore, cl::cat(aRegexSourceOptions));
    35 static cl::opt<std::string> RegexFilename("f", cl::desc("Take regular expressions (one per line) from a file"), cl::value_desc("regex file"), cl::init(""), cl::cat(aRegexSourceOptions));
    36 static cl::opt<std::string> IRFileName("precompiled", cl::desc("Use precompiled regular expression"), cl::value_desc("LLVM IR file"), cl::init(""), cl::cat(aRegexSourceOptions));
     30static cl::opt<bool> CaseInsensitive("i", cl::desc("Ignore case distinctions in the pattern and the file."), cl::cat(LegacyGrepOptions));
     31
     32
     33static cl::list<std::string> regexVector("e", cl::desc("Regular expression"), cl::ZeroOrMore, cl::cat(LegacyGrepOptions));
     34static cl::opt<std::string> RegexFilename("f", cl::desc("Take regular expressions (one per line) from a file"), cl::value_desc("regex file"), cl::init(""), cl::cat(LegacyGrepOptions));
     35static cl::opt<std::string> IRFileName("precompiled", cl::desc("Use precompiled regular expression"), cl::value_desc("LLVM IR file"), cl::init(""));
    3736
    3837static cl::opt<int> Threads("t", cl::desc("Total number of threads."), cl::init(1));
    3938
    4039static cl::opt<bool> GrepSupport("gs", cl::desc("Grep support. Pipe the output of icgrep into grep. \
    41          Gives you colored output + back-referencing capability."), cl::cat(aRegexSourceOptions));
     40         Gives you colored output + back-referencing capability."), cl::cat(EnhancedGrepOptions));
    4241
    4342
     
    204203
    205204int main(int argc, char *argv[]) {
    206     StringMap<cl::Option*> Map;
    207     cl::getRegisteredOptions(Map);
    208     Map["time-passes"]->setHiddenFlag(cl::Hidden);
    209     Map["disable-spill-fusing"]->setHiddenFlag(cl::Hidden);
    210     Map["enable-misched"]->setHiddenFlag(cl::Hidden);
    211     Map["enable-tbaa"]->setHiddenFlag(cl::Hidden);
    212     Map["exhaustive-register-search"]->setHiddenFlag(cl::Hidden);
    213     Map["join-liveintervals"]->setHiddenFlag(cl::Hidden);
    214     Map["limit-float-precision"]->setHiddenFlag(cl::Hidden);
    215     Map["mc-x86-disable-arith-relaxation"]->setHiddenFlag(cl::Hidden);
    216     Map["limit-float-precision"]->setHiddenFlag(cl::Hidden);
    217     Map["print-after-all"]->setHiddenFlag(cl::Hidden);
    218     Map["print-before-all"]->setHiddenFlag(cl::Hidden);
    219     Map["print-machineinstrs"]->setHiddenFlag(cl::Hidden);
    220     Map["regalloc"]->setHiddenFlag(cl::Hidden);
    221     Map["rng-seed"]->setHiddenFlag(cl::Hidden);
    222     Map["stackmap-version"]->setHiddenFlag(cl::Hidden);
    223     Map["x86-asm-syntax"]->setHiddenFlag(cl::Hidden);
    224     Map["verify-debug-info"]->setHiddenFlag(cl::Hidden);
    225     Map["verify-dom-info"]->setHiddenFlag(cl::Hidden);
    226     Map["verify-loop-info"]->setHiddenFlag(cl::Hidden);
    227     Map["verify-regalloc"]->setHiddenFlag(cl::Hidden);
    228     Map["verify-scev"]->setHiddenFlag(cl::Hidden);
    229     Map["x86-recip-refinement-steps"]->setHiddenFlag(cl::Hidden);
    230     Map["rewrite-map-file"]->setHiddenFlag(cl::Hidden);
    231 
     205    cl::HideUnrelatedOptions(ArrayRef<const cl::OptionCategory *>{&LegacyGrepOptions, &EnhancedGrepOptions});
    232206    cl::ParseCommandLineOptions(argc, argv);
    233207   
Note: See TracChangeset for help on using the changeset viewer.