summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-07 10:18:38 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-07 10:18:38 +0000
commitac677063b7406b896e049b0d7d2ca275a8428157 (patch)
treeccf3e9b48b09616d6c7845a4b402ae67fa434d63
parenta1a69d21291d07eb9942f3dbfdd31dbbdd4bcad5 (diff)
downloadgcc-ac677063b7406b896e049b0d7d2ca275a8428157.tar.gz
Move #undef DEF_BUILTIN* to builtins.def
I was confused at first why tree-core.h was undefining DEF_BUILTIN_CHKP before defining it, then undefining it again after including builtins.def. This is because builtins.def provides a default definition of DEF_BUILTIN_CHKP, but leaves it up to the caller to undefine it where necessary. Similarly to the previous internal-fn.def patch, it seems more obvious for builtins.def to #undef things unconditionally. One argument might have been that keeping preprocessor stuff out of the .def files makes it easier for non-cpp parsers. In practice though we already have #ifs and multiline #defines, so single-line #undefs should be easy in comparison. Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi. gcc/ada/ * gcc-interface/utils.c: Don't undef DEF_BUILTIN. gcc/c-family/ * c-common.c: Don't undef DEF_BUILTIN. gcc/jit/ * jit-builtins.c: Don't undef DEF_BUILTIN. gcc/lto/ * lto-lang.c: Don't undef DEF_BUILTIN. gcc/ * builtins.def: #undef DEF_BUILTIN and DEF_BUILTIN_CHKP * builtins.c, genmatch.c, tree-core.h: Don't undef them here. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229924 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/ada/ChangeLog4
-rw-r--r--gcc/ada/gcc-interface/utils.c1
-rw-r--r--gcc/builtins.c1
-rw-r--r--gcc/builtins.def3
-rw-r--r--gcc/c-family/ChangeLog4
-rw-r--r--gcc/c-family/c-common.c1
-rw-r--r--gcc/genmatch.c2
-rw-r--r--gcc/jit/ChangeLog4
-rw-r--r--gcc/jit/jit-builtins.c1
-rw-r--r--gcc/lto/ChangeLog4
-rw-r--r--gcc/lto/lto-lang.c1
-rw-r--r--gcc/tree-core.h4
13 files changed, 24 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 753d992d846..6ffc9aa6a89 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2015-11-07 Richard Sandiford <richard.sandiford@arm.com>
+ * builtins.def: #undef DEF_BUILTIN and DEF_BUILTIN_CHKP
+ * builtins.c, genmatch.c, tree-core.h: Don't undef them here.
+
+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.
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 22afbdc1b10..22ec245956d 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,7 @@
+2015-11-07 Richard Sandiford <richard.sandiford@arm.com>
+
+ * gcc-interface/utils.c: Don't undef DEF_BUILTIN.
+
2015-10-29 Andrew MacLeod <amacleod@redhat.com>
* gcc-interface/decl.c: Reorder #include's and remove duplicates.
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 8617a876ae6..3b893b85fa7 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -6040,7 +6040,6 @@ install_builtin_functions (void)
BOTH_P, FALLBACK_P, NONANSI_P, \
built_in_attributes[(int) ATTRS], IMPLICIT);
#include "builtins.def"
-#undef DEF_BUILTIN
}
/* ----------------------------------------------------------------------- *
diff --git a/gcc/builtins.c b/gcc/builtins.c
index add9fc8484f..ad661c199aa 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -78,7 +78,6 @@ const char * built_in_names[(int) END_BUILTINS] =
{
#include "builtins.def"
};
-#undef DEF_BUILTIN
/* Setup an array of builtin_info_type, make sure each element decl is
initialized to NULL_TREE. */
diff --git a/gcc/builtins.def b/gcc/builtins.def
index 076da406e1f..ed850df2d01 100644
--- a/gcc/builtins.def
+++ b/gcc/builtins.def
@@ -945,3 +945,6 @@ DEF_GCC_BUILTIN (BUILT_IN_LINE, "LINE", BT_FN_INT, ATTR_NOTHROW_LEAF_LIST)
/* Pointer Bounds Checker builtins. */
#include "chkp-builtins.def"
+
+#undef DEF_BUILTIN_CHKP
+#undef DEF_BUILTIN
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index e6d632d8b97..7a2781d3c7e 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,7 @@
+2015-11-07 Richard Sandiford <richard.sandiford@arm.com>
+
+ * c-common.c: Don't undef DEF_BUILTIN.
+
2015-11-06 David Malcolm <dmalcolm@redhat.com>
* c-common.c (c_cpp_error): Convert parameter from location_t to
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index b7ae7541d43..bdcb5b25401 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -5735,7 +5735,6 @@ c_define_builtins (tree va_list_ref_type_node, tree va_list_arg_type_node)
BOTH_P, FALLBACK_P, NONANSI_P, \
built_in_attributes[(int) ATTRS], IMPLICIT);
#include "builtins.def"
-#undef DEF_BUILTIN
targetm.init_builtins ();
diff --git a/gcc/genmatch.c b/gcc/genmatch.c
index ad502f97262..1eb8c24da7d 100644
--- a/gcc/genmatch.c
+++ b/gcc/genmatch.c
@@ -229,7 +229,6 @@ enum built_in_function {
#include "builtins.def"
END_BUILTINS
};
-#undef DEF_BUILTIN
/* Return true if CODE represents a commutative tree code. Otherwise
return false. */
@@ -4619,7 +4618,6 @@ add_operator (VIEW_CONVERT2, "VIEW_CONVERT2", "tcc_unary", 1);
#define DEF_BUILTIN(ENUM, N, C, T, LT, B, F, NA, AT, IM, COND) \
add_builtin (ENUM, # ENUM);
#include "builtins.def"
-#undef DEF_BUILTIN
/* Parse ahead! */
parser p (r);
diff --git a/gcc/jit/ChangeLog b/gcc/jit/ChangeLog
index 301179bbdc0..5da80441c5c 100644
--- a/gcc/jit/ChangeLog
+++ b/gcc/jit/ChangeLog
@@ -1,3 +1,7 @@
+2015-11-07 Richard Sandiford <richard.sandiford@arm.com>
+
+ * jit-builtins.c: Don't undef DEF_BUILTIN.
+
2015-10-29 Andrew MacLeod <amacleod@redhat.com>
* dummy-frontend.c: Reorder #include's and remove duplicates.
diff --git a/gcc/jit/jit-builtins.c b/gcc/jit/jit-builtins.c
index b28a5de21f7..63ff5affb55 100644
--- a/gcc/jit/jit-builtins.c
+++ b/gcc/jit/jit-builtins.c
@@ -62,7 +62,6 @@ static const struct builtin_data builtin_data[] =
{
#include "builtins.def"
};
-#undef DEF_BUILTIN
/* Helper function for find_builtin_by_name. */
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 332251cd62f..056cab6ffe5 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,7 @@
+2015-11-07 Richard Sandiford <richard.sandiford@arm.com>
+
+ * lto-lang.c: Don't undef DEF_BUILTIN.
+
2015-10-29 Andrew MacLeod <amacleod@redhat.com>
* lto-lang.c: Reorder #include's and remove duplicates.
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
index be317a42fbe..4805c2a69b1 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -731,7 +731,6 @@ lto_define_builtins (tree va_list_ref_type_node ATTRIBUTE_UNUSED,
builtin_types[(int) LIBTYPE], BOTH_P, FALLBACK_P, \
NONANSI_P, built_in_attributes[(int) ATTRS], IMPLICIT);
#include "builtins.def"
-#undef DEF_BUILTIN
}
static GTY(()) tree registered_builtin_types;
diff --git a/gcc/tree-core.h b/gcc/tree-core.h
index 3c50e578afd..954368f70ff 100644
--- a/gcc/tree-core.h
+++ b/gcc/tree-core.h
@@ -159,13 +159,10 @@ enum built_in_function {
BEGIN_CHKP_BUILTINS,
-#undef DEF_BUILTIN
#define DEF_BUILTIN(ENUM, N, C, T, LT, B, F, NA, AT, IM, COND)
-#undef DEF_BUILTIN_CHKP
#define DEF_BUILTIN_CHKP(ENUM, N, C, T, LT, B, F, NA, AT, IM, COND) \
ENUM##_CHKP = ENUM + BEGIN_CHKP_BUILTINS + 1,
#include "builtins.def"
-#undef DEF_BUILTIN_CHKP
END_CHKP_BUILTINS = BEGIN_CHKP_BUILTINS * 2 + 1,
@@ -186,7 +183,6 @@ enum built_in_function {
/* Upper bound on non-language-specific builtins. */
END_BUILTINS
};
-#undef DEF_BUILTIN
/* Tree code classes. Each tree_code has an associated code class
represented by a TREE_CODE_CLASS. */