mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Adding a new cl::HideUnrelatedOptions API to allow clang to migrate off cl::getRegisteredOptions.
Summary: cl::getRegisteredOptions really exposes some of the innards of how command line parsing is implemented. Exposing new APIs that allow us to disentangle client code from implementation details will allow us to make more extensive changes to command line parsing. Reviewers: chandlerc, dexonsmith, beanz Reviewed By: dexonsmith Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7100 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226729 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1826,12 +1826,22 @@ void cl::AddExtraVersionPrinter(void (*func)()) {
|
||||
void cl::getRegisteredOptions(StringMap<Option *> &Map) {
|
||||
// Get all the options.
|
||||
SmallVector<Option *, 4> PositionalOpts; // NOT USED
|
||||
SmallVector<Option *, 4> SinkOpts; // NOT USED
|
||||
SmallVector<Option *, 4> SinkOpts; // NOT USED
|
||||
assert(Map.size() == 0 && "StringMap must be empty");
|
||||
GetOptionInfo(PositionalOpts, SinkOpts, Map);
|
||||
return;
|
||||
}
|
||||
|
||||
void cl::HideUnrelatedOptions(cl::OptionCategory &Category) {
|
||||
StringMap<cl::Option *> Options;
|
||||
cl::getRegisteredOptions(Options);
|
||||
for (auto &I : Options) {
|
||||
if (I.second->Category != &Category && I.first() != "help" &&
|
||||
I.first() != "version")
|
||||
I.second->setHiddenFlag(cl::ReallyHidden);
|
||||
}
|
||||
}
|
||||
|
||||
void LLVMParseCommandLineOptions(int argc, const char *const *argv,
|
||||
const char *Overview) {
|
||||
llvm::cl::ParseCommandLineOptions(argc, argv, Overview);
|
||||
|
Reference in New Issue
Block a user