[llvm] [TableGen] Implement a preprocessor (PR #120113)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 14 03:56:00 PDT 2025


jayfoad wrote:

> > Is the intent mostly to find easily where different class or other defs are coming from (in other files)?
> 
> The use cases I had in mind are to do with debugging tablegen itself:
> 
> * If you want to reduce a test case (either manually or automatically) it's easier if you can start with a single file.
> * If someone reports a tablegen bug that reproduces on an out-of-tree backend it's easier if they can give you a repro consisting of a single file.
> 
> But it seems like a generally useful thing that might find more use cases than I can imagine.

Another use case I've found is that it provides a nice way to benchmark the performance of lexing independently from parsing.

https://github.com/llvm/llvm-project/pull/120113


More information about the llvm-commits mailing list