[NFC-I] Remove hack for fp-classification builtins
authorErich Keane <erich.keane@intel.com>
Mon, 16 Dec 2019 19:15:48 +0000 (11:15 -0800)
committerErich Keane <erich.keane@intel.com>
Mon, 16 Dec 2019 20:22:55 +0000 (12:22 -0800)
commitb1e542f302c1ed796ad9f703d4d36e010afcb914
treedbe59cbea22d6df13502831c2277686a51541ae9
parentff07fc66d9eef577f3b44716f72e581a18cd9ac9
[NFC-I] Remove hack for fp-classification builtins

The FP-classification builtins (__builtin_isfinite, etc) use variadic
packs in the definition file to mean an overload set.  Because of that,
floats were converted to doubles, which is incorrect. There WAS a patch
to remove the cast after the fact.

THis patch switches these builtins to just be custom type checking,
calls the implicit conversions for the integer members, and makes sure
the correct L->R casts are put into place, then does type checking like
normal.

A future direction (that wouldn't be NFC) would consider making
conversions for the floating point parameter legal.
clang/include/clang/Basic/Builtins.def
clang/lib/Sema/SemaChecking.cpp
clang/test/Sema/builtin-fpclassification.c [new file with mode: 0644]
clang/test/Sema/crash-invalid-builtin.c