[llvm-dev] NUL in TableGen files

via llvm-dev llvm-dev at lists.llvm.org
Wed May 5 07:09:00 PDT 2021


> >There are various bits of code scattered throughout the TableGen lexer
> >to deal with NUL characters that are not at the end of the source
> >string. I'd like to clean that up by simply disallowing NULs in .td
> >files. Can anyone think of a legitimate reason to use a NUL in a
> >TableGen file?
> 
> Cleaning up NUL handling in TableGen lexer sounds good.

Agreed; if there are no existing NUL characters in .td files, I think
it's okay to have the lexer assume there aren't any.  They are text
files, and legitimate uses for NUL in a text file are scarce.

You could "git blame" the places that have this code, and see if the
commit history tells you anything instructive; or it might just be an
over-abundance of caution on the part of the original programmer(s).
--paulr



More information about the llvm-dev mailing list