[CodeGen] fix const-ness of cbrt and fma
authorSanjay Patel <spatel@rotateright.com>
Mon, 13 Nov 2017 22:11:49 +0000 (22:11 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 13 Nov 2017 22:11:49 +0000 (22:11 +0000)
commit33f83995a8cb8071255b7b923c94c243e4bd2ebb
tree609046c8f803b0fbd5eb0a782a2c36c5b2d7057c
parentfabddf18a0d195802168aeec21ec35cc6989e584
[CodeGen] fix const-ness of cbrt and fma

cbrt() is always constant because it can't overflow or underflow. Therefore, it can't set errno.

fma() is not always constant because it can overflow or underflow. Therefore, it can set errno.
But we know that it never sets errno on GNU / MSVC, so make it constant in those environments.

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

llvm-svn: 318093
clang/include/clang/Basic/Builtins.def
clang/lib/CodeGen/CGBuiltin.cpp
clang/lib/Sema/SemaDecl.cpp
clang/test/CodeGen/libcalls.c
clang/test/CodeGen/math-builtins.c
clang/test/CodeGen/math-libcalls.c