[PATCH] D108770: [OptTable] Improve error message output for grouped short options

Owen Reynolds via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 26 09:05:54 PDT 2021


gbreynoo added inline comments.


================
Comment at: llvm/lib/Option/OptTable.cpp:379
     if (Arg *A = Opt.accept(Args, Str.substr(0, 2), true, Index)) {
-      if (Str.size() == 2)
-        ++Index;
-      else
-        Args.replaceArgString(Index, Twine('-') + Str.substr(2));
+      // Check that the last option isn't a flag wrongly given an argument
+      if (Str[2] == '=')
----------------
I could not find a case in which we would enter `if (Str.size() == 2)` so I have removed it. I think either the option would have already been accepted or we want to create the an Arg as unknown option. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108770



More information about the llvm-commits mailing list