================

----------------
vsapsai wrote:

I'd like to get @AaronBallman opinion on the change in `Parser::Initialize` 
API. Separating initialization from `ConsumeToken` is driven by the need to 
initialize the parser before `ExternalASTSource::StartTranslationUnit` which 
can start deserializing decls [and using Sema]. Calling `ConsumeToken` 
explicitly is somewhat clunky but doesn't seem like a terribly complicated API.

In general, I believe it is reasonable for `StartTranslationUnit` to assume 
that all other components have been initialized when it is called. And I think 
it is debatable to start actual work during initialization. I believe moving 
`ConsumeToken` out of `Parser::Initialize` makes the code easier to compose and 
not to rely on a specific order of calls so much.

https://github.com/llvm/llvm-project/pull/208348
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to