mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-03-02 23:50:19 +00:00
Adopt new cl::HideUnrelatedOptions API added r226729.
Summary: cl::HideUnrelatedOptions allows tools to hide all options not part of a specific OptionCategory. This is the common use case for cl::getRegisteredOptions, which should be deprecated in the future because it exposes implementation details of command line parsing. Reviewers: dexonsmith Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D7109 llvm-svn: 226741
This commit is contained in:
parent
3007ba0ab3
commit
0a9f607f7b
@ -112,15 +112,7 @@ CommonOptionsParser::CommonOptionsParser(int &argc, const char **argv,
|
||||
cl::desc("Additional argument to prepend to the compiler command line"),
|
||||
cl::cat(Category));
|
||||
|
||||
// Hide unrelated options.
|
||||
StringMap<cl::Option*> Options;
|
||||
cl::getRegisteredOptions(Options);
|
||||
for (StringMap<cl::Option *>::iterator I = Options.begin(), E = Options.end();
|
||||
I != E; ++I) {
|
||||
if (I->second->Category != &Category && I->first() != "help" &&
|
||||
I->first() != "version")
|
||||
I->second->setHiddenFlag(cl::ReallyHidden);
|
||||
}
|
||||
cl::HideUnrelatedOptions(Category);
|
||||
|
||||
Compilations.reset(FixedCompilationDatabase::loadFromCommandLine(argc,
|
||||
argv));
|
||||
|
@ -270,15 +270,7 @@ static void PrintVersion() {
|
||||
int main(int argc, const char **argv) {
|
||||
llvm::sys::PrintStackTraceOnErrorSignal();
|
||||
|
||||
// Hide unrelated options.
|
||||
StringMap<cl::Option*> Options;
|
||||
cl::getRegisteredOptions(Options);
|
||||
for (StringMap<cl::Option *>::iterator I = Options.begin(), E = Options.end();
|
||||
I != E; ++I) {
|
||||
if (I->second->Category != &ClangFormatCategory && I->first() != "help" &&
|
||||
I->first() != "version")
|
||||
I->second->setHiddenFlag(cl::ReallyHidden);
|
||||
}
|
||||
cl::HideUnrelatedOptions(ClangFormatCategory);
|
||||
|
||||
cl::SetVersionPrinter(PrintVersion);
|
||||
cl::ParseCommandLineOptions(
|
||||
|
Loading…
x
Reference in New Issue
Block a user