llvm-project/libcxx
Duncan P. N. Exon Smith 42f8eee150 cmath: Skip Libc for integral types in isinf, etc.
For std::isinf, the standard requires effectively calling isinf as
double from Libc for integral types. But integral types are never
infinite; we don't need to call Libc to return false.

Also short-circuit other functions where Libc won't have interesting
answers: signbit, fpclassify, isfinite, isnan, and isnormal.

I added correctness tests for integral types since we're no longer
deferring to Libc.

In review it was pointed out that in future revisions of the C++
standard we may add more types to std::is_arithmetic (e.g.,
std::is_fixed_point).  I'll leave it to a future commit to hack this to
allow using math functions on those.  We'll need to change things like
__libcpp_fpclassify anyway, so I'm not sure anything here would really
be future-proof.

https://reviews.llvm.org/D31561
rdar://problem/31361223

llvm-svn: 301060
2017-04-21 23:14:55 +00:00
..
benchmarks Emit benchmark tests into the benchmarks build directory, not lib/ 2017-04-18 07:40:22 +00:00
cmake [CMake][libcxx] Fix the --target and --gcc-toolchain flag handling 2017-04-16 02:25:55 +00:00
docs [libc++] Add _LIBCPP_DISABLE_EXTERN_TEMPLATE config option 2017-04-13 20:13:32 +00:00
include cmath: Skip Libc for integral types in isinf, etc. 2017-04-21 23:14:55 +00:00
lib Rename the static version of libc++ on Windows. 2017-04-20 04:19:02 +00:00
src [libc++] Use _LIBCPP_ABI_MICROSOFT instead of _MSC_VER 2017-04-19 20:11:04 +00:00
test cmath: Skip Libc for integral types in isinf, etc. 2017-04-21 23:14:55 +00:00
utils XFAIL Windows test failures under test/libcxx 2017-04-21 01:48:02 +00:00
www Mark LWG#2788 as complete - we already do this 2017-04-18 17:22:49 +00:00
.arcconfig Upgrade arcconfig to use https 2016-07-18 02:02:49 +00:00
.clang-format Make clang-format use C++03 syntax 2017-04-15 02:45:43 +00:00
.gitignore Implement N4606 optional 2016-10-12 07:46:20 +00:00
CMakeLists.txt [libc++] Default to vcruntime when targeting MSVC 2017-04-20 23:33:49 +00:00
CREDITS.TXT Updated email address in `CREDITS.txt`. 2017-03-06 20:46:55 +00:00
LICENSE.TXT Update year to 2017 2017-01-03 11:20:43 +00:00
NOTES.TXT Update doc and various cleanup 2016-12-23 20:00:13 +00:00
TODO.TXT Add list of filesystem NB comments to TODO.TXT so they can be tracked separately 2017-03-06 21:23:36 +00:00
appveyor.yml change what branches Appveyor builds 2017-04-19 23:27:48 +00:00