[PATCH] D126931: [llvm-ml] Remove all file extension restrictions

Alan Zhao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 2 17:05:29 PDT 2022


ayzhao created this revision.
Herald added a project: All.
ayzhao requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

After D126425 <https://reviews.llvm.org/D126425> was submitted, hans@ observed that MSVC's ml.exe doesn't
care about the file's extension at all. Now, we check if the file exists
to determine whether an input filename is a valid assembly file.

ml.exe treats unmatched leading forward slashes as invalid flags.
However, this is a problem on *nix systems as a leading forward slash
there is a valid file path. To partially mitigate this, we now consider
such inputs invalid arguments if they begin with a forward slash and do
*not* contain any more further forward slash characters. Everything else
is treated as a filename and we emit an appropriate error.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126931

Files:
  llvm/test/tools/llvm-ml/basic.test
  llvm/test/tools/llvm-ml/invalid_file_extension.blah
  llvm/test/tools/llvm-ml/lit.local.cfg
  llvm/test/tools/llvm-ml/random_file_extension.blah
  llvm/test/tools/llvm-ml/valid_file_extension.S
  llvm/tools/llvm-ml/Opts.td
  llvm/tools/llvm-ml/llvm-ml.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126931.433919.patch
Type: text/x-patch
Size: 5218 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220603/b1d017f1/attachment.bin>


More information about the llvm-commits mailing list