Commit 03646189 by Richard Stallman

(typedef tree_node_kind): Added new kind, i.e. `b_kind'.

(tree_node_kind_names):  Added name for `b_kind'.
(make_node, copy_node, stabilize_reference_1):
Handle case 'b' (for BLOCK nodes).
(make_node):  Don't try to deal with BLOCKs when doing a type 'e' node.

From-SVN: r1603
parent 61131fa2
...@@ -195,16 +195,45 @@ char **tree_code_name; ...@@ -195,16 +195,45 @@ char **tree_code_name;
/* Statistics-gathering stuff. */ /* Statistics-gathering stuff. */
typedef enum typedef enum
{ {
d_kind, t_kind, s_kind, r_kind, e_kind, c_kind, d_kind,
id_kind, op_id_kind, perm_list_kind, temp_list_kind, t_kind,
vec_kind, x_kind, lang_decl, lang_type, all_kinds b_kind,
s_kind,
r_kind,
e_kind,
c_kind,
id_kind,
op_id_kind,
perm_list_kind,
temp_list_kind,
vec_kind,
x_kind,
lang_decl,
lang_type,
all_kinds
} tree_node_kind; } tree_node_kind;
int tree_node_counts[(int)all_kinds]; int tree_node_counts[(int)all_kinds];
int tree_node_sizes[(int)all_kinds]; int tree_node_sizes[(int)all_kinds];
int id_string_size = 0; int id_string_size = 0;
char *tree_node_kind_names[] = { "decls", "types", "stmts", "refs", "exprs", "constants",
"identifiers", "op_identifiers", "perm_tree_lists", "temp_tree_lists", char *tree_node_kind_names[] = {
"vecs", "random kinds", "lang_decl kinds", "lang_type kinds" }; "decls",
"types",
"blocks",
"stmts",
"refs",
"exprs",
"constants",
"identifiers",
"op_identifiers",
"perm_tree_lists",
"temp_tree_lists",
"vecs",
"random kinds",
"lang_decl kinds",
"lang_type kinds"
};
/* Hash table for uniquizing IDENTIFIER_NODEs by name. */ /* Hash table for uniquizing IDENTIFIER_NODEs by name. */
...@@ -774,6 +803,16 @@ make_node (code) ...@@ -774,6 +803,16 @@ make_node (code)
obstack = all_types_permanent ? &permanent_obstack : saveable_obstack; obstack = all_types_permanent ? &permanent_obstack : saveable_obstack;
break; break;
case 'b': /* a lexical block */
#ifdef GATHER_STATISTICS
kind = b_kind;
#endif
length = sizeof (struct tree_block);
/* All BLOCK nodes are put where we can preserve them if nec. */
if (obstack != &permanent_obstack)
obstack = saveable_obstack;
break;
case 's': /* an expression with side effects */ case 's': /* an expression with side effects */
#ifdef GATHER_STATISTICS #ifdef GATHER_STATISTICS
kind = s_kind; kind = s_kind;
...@@ -793,10 +832,8 @@ make_node (code) ...@@ -793,10 +832,8 @@ make_node (code)
usual_kind: usual_kind:
#endif #endif
obstack = expression_obstack; obstack = expression_obstack;
/* All BLOCK nodes are put where we can preserve them if nec. /* All BIND_EXPR nodes are put where we can preserve them if nec. */
Also their potential controllers. */ if (code == BIND_EXPR && obstack != &permanent_obstack)
if ((code == BLOCK || code == BIND_EXPR)
&& obstack != &permanent_obstack)
obstack = saveable_obstack; obstack = saveable_obstack;
length = sizeof (struct tree_exp) length = sizeof (struct tree_exp)
+ (tree_code_length[(int) code] - 1) * sizeof (char *); + (tree_code_length[(int) code] - 1) * sizeof (char *);
...@@ -907,6 +944,10 @@ copy_node (node) ...@@ -907,6 +944,10 @@ copy_node (node)
length = sizeof (struct tree_type); length = sizeof (struct tree_type);
break; break;
case 'b': /* a lexical block node */
length = sizeof (struct tree_block);
break;
case 'r': /* a reference */ case 'r': /* a reference */
case 'e': /* a expression */ case 'e': /* a expression */
case 's': /* an expression with side effects */ case 's': /* an expression with side effects */
...@@ -1861,6 +1902,7 @@ stabilize_reference_1 (e) ...@@ -1861,6 +1902,7 @@ stabilize_reference_1 (e)
case 'x': case 'x':
case 't': case 't':
case 'd': case 'd':
case 'b':
case '<': case '<':
case 's': case 's':
case 'e': case 'e':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment