AaronBallman wrote:

> > But the token kind we have is `identifier` and not one of the keywords, so 
> > we can't do the more trivial integer comparisons.
> 
> Can we precompute a list/map/whatever of all identifiers that are keywords in 
> C++ but not in C and then do pointer comparisons on the `IdentifierInfo*` 
> maybe? At least then we wouldn’t have to do actual string comparisons; that 
> said, I’m not sure that’s going to be that much better...

That's a pretty good idea, let me try that. I'll back out the changes that 
disable checking when the diagnostic isn't enabled so we get a better 
comparison.

https://github.com/llvm/llvm-project/pull/137234
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to