[PATCH] D150856: [lit] Add %{for-each-file} substitution

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


jhenderson added a comment.

So I definitely support the overall goal of this patch, but I'm not convinced by the syntax, if I'm honest. It seems somewhat unintuitive that the `%{for-each-file ...}` syntax impacts the whole line it appears on, yet its position is important.

I don't have an exact syntax in mind, but it feels to me like a new lit directive might be more appropriate to indicate that the line should be run multiple times in some manner. It would probably need to involve a new substitution too, admittedly, which indicates where to add the file name in the command. Something along the lines of `RUN-ALL-FILES-%t: cat %f`. Sorry, I don't really have the time right now to give a more thought out example that dictates how to specify the file location.



================
Comment at: llvm/docs/CommandGuide/lit.rst:559
                          Otherwise, %T but with a single leading ``/`` removed.
+ %{for-each-file <path>} Invokes RUN command for each file in ``<path>``. Accepts wildcards.
  ======================= ==============
----------------
It's completely unclear what "Accepts wildcards" means in this context. I wonder if an example might be appropriate.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150856



More information about the llvm-commits mailing list