[PATCH] D152286: [Option] Support special argument "--"

serge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 6 11:47:41 PDT 2023


serge-sans-paille accepted this revision.
serge-sans-paille added a comment.
This revision is now accepted and ready to land.

Big fan of this change. I added a few potential minor suggestions.
We may want to also modify the generated help to suggest the special meaning of `--`?



================
Comment at: llvm/lib/Option/OptTable.cpp:475
+      while (++Index < End) {
+        Args.append(new Arg(getOption(InputOptionID), Str, Index,
+                            Args.getArgString(Index)));
----------------
Probably pedantic, but the other part of the code use ``std::make_unique<Arg>(...)` instead which at least convey the ownership very clearly.


================
Comment at: llvm/unittests/Option/OptionParsingTest.cpp:418
+}
+
 TYPED_TEST(OptTableTest, UnknownOptions) {
----------------
Would be great to have a test without any trailing argument after the `--` too.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152286



More information about the llvm-commits mailing list