[all-commits] [llvm/llvm-project] 1ed832: Reland [NFC-I] Remove hack for fp-classification b...

Erich Keane via All-commits all-commits at lists.llvm.org
Tue Dec 17 06:58:40 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 1ed832e42446ef8c4afe08f980db2e54ac316bf3
      https://github.com/llvm/llvm-project/commit/1ed832e42446ef8c4afe08f980db2e54ac316bf3
  Author: Erich Keane <erich.keane at intel.com>
  Date:   2019-12-17 (Tue, 17 Dec 2019)

  Changed paths:
    M clang/include/clang/Basic/Builtins.def
    M clang/lib/Sema/SemaChecking.cpp
    M clang/test/CodeGen/builtin_float.c
    A clang/test/Sema/builtin-fpclassification.c
    M clang/test/Sema/crash-invalid-builtin.c

  Log Message:
  -----------
  Reland [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.

Note: The initial patch for this missed that certain systems need to
still convert half to float, since they dont' support that type.




More information about the All-commits mailing list