[llvm] [llvm][Tablegen][llvm-tblgen] Added keyword #undef to llvm-tblgen (PR #69135)

Jessica Clarke via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 18 20:57:10 PDT 2023


jrtc27 wrote:

> > I have some concerns right now because this would technically allow to include the same TableGen file multiple times
> 
> That's already true if you don't have an include guard?
> 
> > which is something we've been recently discussing of taking advantage of forbidding, and making the #include basically #include_once.
> 
> I would have concerns about that; including a file multiple times can be useful, and diverging from C's preprocessor sounds like a bad idea and will lead to confusion.
> 
> But regardless, I do not see why that is relevant here. #undef is only relevant in the sense that #ifdef _can_ be used to write an include guard, but not always.

(if you want _that_ semantics, call it include[_-]once or import, not include, which normally means the does-exactly-what-you say "paste contents of file here")

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


More information about the llvm-commits mailing list