[PATCH] D34764: Introduce FileEdit utility

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 28 10:28:04 PDT 2017


chandlerc added a comment.

First point, I feel like these are two very different pieces of functionality. My thought sare pretty specific to the particular tool.

Regarding replacing the 'sed' like functionality: many tests that use 'sed' really shouldn't. FileCheck variables and other techniques tend to be much better IMO. But if we need a portable replacement, sure. I don't have strong opinions about the exact way we replace it.

Regarding the separate file creation thing... I'm much less enthusiastic about this. I *do* want access to tools like clang-format while editing bits of C++ code. I don't think embedding them into the .test file is a good idea.

For almost all cases, I think we either *should* keep things in separate files and then we should just have actual separate files that are easy to edit, or we should use existing ways to put things into a single file. The use case you brought up: compile the same source file N different tims with a different macro to create the N object files. Use the existing preprocessor syntax to partition the file contents.

We used to have the problem of needing lots of separate files for C++ modules tests and are fixing that by allowing us to build a multi-file module from a single source input.

Technically, we can even do this with a single IR file, running llvm-extract to separate it, and then processing the separate files.

Anyways, I understand that we'll always need *some* support for separate files, but i think the Inputs directory and actual separate files is a reasonable mechanism.


https://reviews.llvm.org/D34764





More information about the llvm-commits mailing list