[PATCH] D83834: Add test utility 'extract'

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 24 08:54:55 PDT 2020


MaskRay added a comment.

In D83834#2172415 <https://reviews.llvm.org/D83834#2172415>, @lattner wrote:

> Ok fair enough.  I'd recommend a name like `llvm-split-file` or something like that given that we already have an `llvm-extract` tool that is very different.


How about a short name, e.g. `split-file`? We have many lit utilities not named `llvm-*`: `not`, `count`, `FileCheck`. The utility is more of their league.

In D83834#2172423 <https://reviews.llvm.org/D83834#2172423>, @lattner wrote:

> Also, it is worth pointing out that we already have an (arguably much better) way to handle the problem you're trying to solve here:
>
> Name your test something like "foo.ll", then have the auxilary files be named "foo.ll.xyz". You can then refer to them directly in the test with "%s.xyz".  This is better because 1) it doesn't introduce another micro tool, 2) it is general to non text files,  3) it is easy to work with on the command line when a test breaks, and 4) this makes it easier for multiple tests to share the same file.
>
> The only downside I see to this is the creation of more small files, but I think it is a good tradeoff to not introduce a new way of doing things here that is less general.


Separate files are considered. Actually that motivated the standalone utility https://reviews.llvm.org/D83725#2149490

"I end up doing one of three things in this situation: 1) adding a separate file in the "Inputs" directory - this is not great because the test input is far away from the actual test (i.e. not in the same file), making it harder to follow; 2) echoing the second and later inputs to separate files at runtime - this is not great because it has a runtime cost; ..."


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83834





More information about the llvm-commits mailing list