[PATCH] D146148: Float_t and double_t types shouldn't be modified by #pragma clang fp eval_method

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 28 10:59:24 PDT 2023


rjmccall added a comment.

Yeah, that was the sort of thing I was worried about.  The identifier thing is also a reasonable approach, and it'll be nice infrastructure for other, similar things.

The ranges of special identifier we already call out on IdentifierInfo* are for builtin functions (where we need to synthesize a declaration) and ObjC context-sensitive tokens (which are directly important to the parser).  I think it makes sense for these to be a third category, but please don't make it as narrow as `BuiltinTypedefKind` or something like that; call it something generic like `InterestingIdentifierKind`, and make sure the code in `ActOnTypedefNameDecl` checks for the `float_t` and `double_t` kinds specifically before adding the attribute, so that people using this mechanism for other purposes don't inadvertently trigger your code.  We have a number of other places in the compiler that would probably benefit from using this over doing `IdentifierInfo*` comparisons.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146148/new/

https://reviews.llvm.org/D146148



More information about the cfe-commits mailing list