Commit Graph

1 Commits

Author SHA1 Message Date
Louis Dionne
55b6136b3a DO NOT MERGE: [libc++] Add __truncating_cast for safely casting float types to integers
This is needed anytime we need to clamp an arbitrary floating point
value to an integer type.

Thanks to Eric Fiselier for the patch.

Differential Revision: https://reviews.llvm.org/D66836

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@370891 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit c9ac8d533010d8915bcfdecab891fb451f71ce74)
(cherry picked from commit 4561f55204960c0b3bc4594089ddcf56e5655cad)
(cherry picked from commit f4471784fdb5799b9862febc385a26becfbe53b3)

Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=994957
Bug: http://b/139690488
Change-Id: I3d402ed0237a2f5f934a5d368ca91304bfcd9ed0
2019-09-13 14:46:25 -07:00