This is an archive of the discontinued LLVM Phabricator instance.

[CommandLine] Don't allow duplicate categories.
ClosedPublic

Authored by hintonda on May 15 2019, 6:36 PM.

Details

Summary

This is a fix to D61574, r360179, that allowed duplicate
OptionCategory's. This change adds a check to make sure a category can
only be added once even if the user passes it twice.

Diff Detail

Repository
rL LLVM

Event Timeline

hintonda created this revision.May 15 2019, 6:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 15 2019, 6:36 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
hintonda edited the summary of this revision. (Show Details)May 15 2019, 6:38 PM
MaskRay added inline comments.May 15 2019, 7:57 PM
llvm/lib/Support/CommandLine.cpp
453 ↗(On Diff #199711)

Doesn't plain find work?

hintonda marked an inline comment as done.May 15 2019, 8:19 PM
hintonda added inline comments.
llvm/lib/Support/CommandLine.cpp
453 ↗(On Diff #199711)

Ah, thanks for catching that. It's cruft from a previous iteration where I was excluding index 0, but realized I didn't need to. I'll fix, thanks...

hintonda updated this revision to Diff 199730.May 15 2019, 8:23 PM
  • Used find instead of find_if.
hintonda updated this revision to Diff 199735.May 15 2019, 8:39 PM
  • Remove file erroneously included in last upload.
MaskRay accepted this revision.May 16 2019, 12:49 AM
This revision is now accepted and ready to land.May 16 2019, 12:49 AM
This revision was automatically updated to reflect the committed changes.