[PATCH] D53840: Preprocessing support in tablegen
Vyacheslav Zakharin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 31 14:14:18 PDT 2018
vzakhari added a comment.
In https://reviews.llvm.org/D53840#1282024, @nhaehnle wrote:
> I have to say I'm feeling a bit ambivalent about this. I'd say it would be nicer to have a mechanism that integrates with the rest of the TableGen language, but that's admittedly non-trivial. So I guess this approach is okay.
Thank you for the prompt reply, Nikolai! Yes, I decided to keep the preprocessing aside to minimize changes in the actual lexing.
> The handling of end-of-files is a bit wonky. Have you considered just returning EOF from getNextChar at end of file, even if there's a parent file, and changing the EOF case in LexToken to just loop (or tail-recurse, I suppose) if it was the EOF of an included file?
This is possible, though, EOF handling will be required in SkipCComment() and LexBracket(). If you agree with me changing these routines, I can do this. Returning EOF from getNextChar() allows handling cross-file C-style comments and bracket contructs - I can disallow these use-cases or keep supporting them. What do you think I should do?
Repository:
rL LLVM
https://reviews.llvm.org/D53840
More information about the llvm-commits
mailing list