aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2015-11-07 10:17:05 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2015-11-07 10:17:05 +0000
commit46e343b8d225732ae2e81509ca1accf47444f64b (patch)
treebf2eb1c3768397191320000d6b39a9b2b2e6ea7d
parentdf838ef0f1a11355a217ab11ed8546dd97873870 (diff)
downloadgcc-46e343b8d225732ae2e81509ca1accf47444f64b.zip
gcc-46e343b8d225732ae2e81509ca1accf47444f64b.tar.gz
gcc-46e343b8d225732ae2e81509ca1accf47444f64b.tar.bz2
Move #undef DEF_INTERNAL_FN to internal-fn.def
In practice the definition of DEF_INTERNAL_FN is never reused after including internal-fn.def, so we might as well #undef it there. This becomes more obvious with a later patch that adds other DEF_INTERNAL_* directives, such as DEF_INTERNAL_OPTAB_FN. If the includer doesn't care about the information carried in these new directives, it can simply leave the macro undefined and internals.def will provide a definition that forwards to DEF_INTERNAL_FN. It doesn't make much sense for includers to have to #undef macros that are defined by internals.def and it seems overly complicated to get internals.def to undef macros only in the cases where it provided a definition. Instead I went with the approach of #undeffing all the DEF_INTERNAL_* macros unconditionally. Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi. gcc/ * internal-fn.def: #undef DEF_INTERNAL_FN at the end. * internal-fn.c: Don't undef it here. * tree-core.h: Likewise. From-SVN: r229923
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/internal-fn.c4
-rw-r--r--gcc/internal-fn.def2
-rw-r--r--gcc/tree-core.h1
4 files changed, 8 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 443066d..753d992 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2015-11-07 Richard Sandiford <richard.sandiford@arm.com>
+ * internal-fn.def: #undef DEF_INTERNAL_FN at the end.
+ * internal-fn.c: Don't undef it here.
+ * tree-core.h: Likewise.
+
+2015-11-07 Richard Sandiford <richard.sandiford@arm.com>
+
* builtins.c (fold_builtin_nan): Delete.
(fold_builtin_memcmp): Remove case where both arguments are constant.
(fold_builtin_strcmp, fold_builtin_strncmp): Likewise.
diff --git a/gcc/internal-fn.c b/gcc/internal-fn.c
index 6fac752..afbfae8 100644
--- a/gcc/internal-fn.c
+++ b/gcc/internal-fn.c
@@ -43,7 +43,6 @@ along with GCC; see the file COPYING3. If not see
const char *const internal_fn_name_array[] = {
#define DEF_INTERNAL_FN(CODE, FLAGS, FNSPEC) #CODE,
#include "internal-fn.def"
-#undef DEF_INTERNAL_FN
"<invalid-fn>"
};
@@ -51,7 +50,6 @@ const char *const internal_fn_name_array[] = {
const int internal_fn_flags_array[] = {
#define DEF_INTERNAL_FN(CODE, FLAGS, FNSPEC) FLAGS,
#include "internal-fn.def"
-#undef DEF_INTERNAL_FN
0
};
@@ -65,7 +63,6 @@ init_internal_fns ()
if (FNSPEC) internal_fn_fnspec_array[IFN_##CODE] = \
build_string ((int) sizeof (FNSPEC), FNSPEC ? FNSPEC : "");
#include "internal-fn.def"
-#undef DEF_INTERNAL_FN
internal_fn_fnspec_array[IFN_LAST] = 0;
}
@@ -2062,7 +2059,6 @@ expand_GOACC_REDUCTION (gcall *stmt ATTRIBUTE_UNUSED)
static void (*const internal_fn_expanders[]) (gcall *) = {
#define DEF_INTERNAL_FN(CODE, FLAGS, FNSPEC) expand_##CODE,
#include "internal-fn.def"
-#undef DEF_INTERNAL_FN
0
};
diff --git a/gcc/internal-fn.def b/gcc/internal-fn.def
index ca06b10..d0eb704 100644
--- a/gcc/internal-fn.def
+++ b/gcc/internal-fn.def
@@ -86,3 +86,5 @@ DEF_INTERNAL_FN (GOACC_LOOP, ECF_PURE | ECF_NOTHROW, NULL)
/* OpenACC reduction abstraction. See internal-fn.h for usage. */
DEF_INTERNAL_FN (GOACC_REDUCTION, ECF_NOTHROW | ECF_LEAF, NULL)
+
+#undef DEF_INTERNAL_FN
diff --git a/gcc/tree-core.h b/gcc/tree-core.h
index a976915..3c50e57 100644
--- a/gcc/tree-core.h
+++ b/gcc/tree-core.h
@@ -774,7 +774,6 @@ enum annot_expr_kind {
enum internal_fn {
#define DEF_INTERNAL_FN(CODE, FLAGS, FNSPEC) IFN_##CODE,
#include "internal-fn.def"
-#undef DEF_INTERNAL_FN
IFN_LAST
};