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

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 7 04:06:15 PDT 2023


jhenderson added a comment.

Couple of nits from me. I've got no objections to this change, but am a bit rusty on the code, so won't approve myself.



================
Comment at: llvm/include/llvm/Option/OptTable.h:144
+  /// Set whether "--" ends option parsing. E.g. -- -a -b gives two positional
+  /// input.
+  void setDashDashParsing(bool Value) { DashDashParsing = Value; }
----------------



================
Comment at: llvm/lib/Option/OptTable.cpp:471-472
 
+    // In DashDashParsing mode, the first "--" stops option scanning and makes
+    // all trailing arguments as positional.
+    if (DashDashParsing && Str == "--") {
----------------
Either "marks all trailing..." or "arguments positional" (but not both).


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