PiJoules wrote:

> I'm happy with the basic idea here of making fixed-point an opt-in feature. 
> It'd be nice to preserve the special diagnostic that tells the user that they 
> need to use `-ffixed-point`, though. Do we have any existing parsing paths 
> that recognize unrecognized identifiers that are written as apparent type 
> specifiers?

None that I've found. The order of operations seems to be (1) determine what 
keywords are allowed, then (2) lex allowed keywords and set the appropriate 
properties on tokens, then (3) handle the token based on if it's an identifier 
or keyword. What I initially wanted was something where `-ffixed-point` was not 
passed, but clang would warn on instances of `_Fract/_Accum/_Sat` keywords but 
still process them as regular identifiers. This would require either (1) always 
setting them as keywords then once we lex them, re-pipe them through one of the 
right the identifier path, or (2) treat them as regular identifiers (ie. 
`_Fract/_Accum/_Sat` are not keywords and disabled) but have some checks every 
time we lex an identifier token to check for these specific keywords. The 
former seemed too non-trivial since there's a bunch of "identifier" code paths. 
The later seemed more doable but would require extra manual string checks every 
time `Lex` was called.

I'd be fine with doing either in a later patch and making a TODO issue for 
improving the diagnostics.

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

Reply via email to