diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2015-11-07 10:10:44 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2015-11-07 10:10:44 +0000 |
commit | df838ef0f1a11355a217ab11ed8546dd97873870 (patch) | |
tree | 0a6fba6186ee90f2710a360da3bcb509e1e7f047 /libobjc/objc-foreach.c | |
parent | db9bd5d5752356a71b1ce6986f30c164c39cf51d (diff) | |
download | gcc-df838ef0f1a11355a217ab11ed8546dd97873870.zip gcc-df838ef0f1a11355a217ab11ed8546dd97873870.tar.gz gcc-df838ef0f1a11355a217ab11ed8546dd97873870.tar.bz2 |
Move const char * -> int/fp folds to fold-const-call.c
This patch moves folds that deal with constant string arguments and
return a constant integer or floating-point value. For example, it
handles strcmp ("foo", "bar") but not strstr ("foobar", "bar"),
which wouldn't currently be accepted by the gimple folders.
The builtins.c folding for strlen (via c_strlen) is a bit more general
than what the fold-const-call.c code does (and more general than we need
for the gimple folders). I've therefore left it as-is, even though it
partially duplicates the new code.
Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.
gcc/
* builtins.c (fold_builtin_nan): Delete.
(fold_builtin_memcmp): Remove case where both arguments are constant.
(fold_builtin_strcmp, fold_builtin_strncmp): Likewise.
(fold_builtin_strspn, fold_builtin_strcspn): Likewise.
(fold_builtin_1): Remove BUILT_IN_NAN* handling.
* fold-const-call.c: Include fold-const.h.
(host_size_t_cst_p): New function.
(build_cmp_result, fold_const_builtin_nan): Likewise.
(fold_const_call_1): New function, split out from...
(fold_const_call): ...here (for all three interfaces). Handle
constant nan, nans, strlen, strcmp, strncmp, strspn and strcspn.
From-SVN: r229922
Diffstat (limited to 'libobjc/objc-foreach.c')
0 files changed, 0 insertions, 0 deletions