[PATCH] D34764: Introduce FileEdit utility

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 28 11:32:55 PDT 2017


chandlerc added a comment.

In https://reviews.llvm.org/D34764#794070, @rnk wrote:

> The tests in llvm/test/tools/llvm-symbolizer are a good place to use this. See the ADDR: sed+grep pattern I used to extract some hex numbers from the file.


I think this is the closest to a good example honestly.

Notably, there is *no* file format or syntax here. Nothing to use. We just need to extract a prefixed set of lines from comment markers. *that* seems like a nice tool to add. `FileExtract` or something that does the exact same prefix-in-comment searching as `FileCheck` and `lit`, and extracts those lines (minus prefix) to a new file or to `stdout`.

But I would specifically advocate against using this heavily for things like assembly or C code. There, I would much rather a single file with preprocessing to split, or N files so that tools that are expected to work on those files continues to work.


https://reviews.llvm.org/D34764





More information about the llvm-commits mailing list