[PATCH] D62105: [CommandLine] Remove OptionCategory and SubCommand caches from the Option class.

Don Hinton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 2 13:38:52 PDT 2019


hintonda updated this revision to Diff 202622.
hintonda added a comment.

Since a SubCommand's OptionsMap key is a string, and multiple
SubCommands can have unrelated options of the same name,
getSubCommands needs to also make sure the found Option matches the
this pointer.

Also, hid the addArgument() method in Alias to prevent users from
trying to add it twice, once when specifying a SubCommand, and again
in the done() method.

Added tests to cover these two cases -- first discovered in llvm-xray,
which declares duplicate Options and Aliases in multiple SubCommands.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62105/new/

https://reviews.llvm.org/D62105

Files:
  llvm/include/llvm/Support/CommandLine.h
  llvm/lib/Support/CommandLine.cpp
  llvm/unittests/Support/CommandLineTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62105.202622.patch
Type: text/x-patch
Size: 16042 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190602/94c78885/attachment.bin>


More information about the llvm-commits mailing list