aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 445ec09..f74cad2 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -3962,3 +3962,52 @@ expand_tree_builtin (function, params, coerced_params)
return NULL_TREE;
}
+
+/* Tree code classes. */
+
+#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
+
+static char c_tree_code_type[] = {
+ 'x',
+#include "c-common.def"
+};
+#undef DEFTREECODE
+
+/* Table indexed by tree code giving number of expression
+ operands beyond the fixed part of the node structure.
+ Not used for types or decls. */
+
+#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
+
+static int c_tree_code_length[] = {
+ 0,
+#include "c-common.def"
+};
+#undef DEFTREECODE
+
+/* Names of tree components.
+ Used for printing out the tree and error messages. */
+#define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
+
+static const char *c_tree_code_name[] = {
+ "@@dummy",
+#include "c-common.def"
+};
+#undef DEFTREECODE
+
+/* Adds the tree codes specific to the C front end to the list of all
+ tree codes. */
+
+void
+add_c_tree_codes (void)
+{
+ memcpy (tree_code_type + (int) LAST_AND_UNUSED_TREE_CODE,
+ c_tree_code_type,
+ (int)LAST_C_TREE_CODE - (int)LAST_AND_UNUSED_TREE_CODE);
+ memcpy (tree_code_length + (int) LAST_AND_UNUSED_TREE_CODE,
+ c_tree_code_length,
+ (LAST_C_TREE_CODE - (int)LAST_AND_UNUSED_TREE_CODE) * sizeof (int));
+ memcpy (tree_code_name + (int) LAST_AND_UNUSED_TREE_CODE,
+ c_tree_code_name,
+ (LAST_C_TREE_CODE - (int)LAST_AND_UNUSED_TREE_CODE) * sizeof (char *));
+}