Reset cl::Positional, cl::Sink and cl::ConsumeAfter options as well in cl::ResetCommandLineParser().
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Sorry for the delay. I'm not really familiar with the code, but this seems right (not sure if it's bulletproof, but surely not worse).
llvm/lib/Support/CommandLine.cpp | ||
---|---|---|
1332 | As I understand these will typically be in OptionsMap too, unless ArgStr happens to be empty. This all seems fine but I'd leave a comment at the top like "Reset all options at least once, it's okay if some get reset multiple times". (An alternative is to track which ones have been reset, or add a member containing this, but it doesn't seem worth it) |
As I understand these will typically be in OptionsMap too, unless ArgStr happens to be empty.
So we're possibly resetting the same options multiple times, and that's OK because it's cheap and idempotent.
This all seems fine but I'd leave a comment at the top like "Reset all options at least once, it's okay if some get reset multiple times".
(An alternative is to track which ones have been reset, or add a member containing this, but it doesn't seem worth it)