Commit 92e948a8 by Nathan Froyd Committed by Nathan Froyd

make TS_BLOCK a substructure of TS_BASE

make TS_BLOCK a substructure of TS_BASE
gcc/
	* tree.c (initialize_tree_contains_struct): Mark TS_BLOCK as
	TS_BASE instead of TS_COMMON.
	(find_decls_types_r): Check for TS_TYPED structure before looking at
	TREE_TYPE.
	* tree.h (struct tree_block): Inherit from tree_base, not tree_common.
	Add chain field.
	(BLOCK_CHAIN): Use new chain field.

gcc/c-family/
	* c-common.c (warning_candidate_p): Check for BLOCKs.

gcc/java/
	* decl.c (poplevel): Don't access TREE_TYPE of BLOCKs.
	* expr.c (build_jni_stub): Likewise.

From-SVN: r174300
parent d74be317
2011-05-26 Nathan Froyd <froydnj@codesourcery.com>
* tree.c (initialize_tree_contains_struct): Mark TS_BLOCK as
TS_BASE instead of TS_COMMON.
(find_decls_types_r): Check for TS_TYPED structure before looking at
TREE_TYPE.
* tree.h (struct tree_block): Inherit from tree_base, not tree_common.
Add chain field.
(BLOCK_CHAIN): Use new chain field.
2011-05-26 Pat Haugen <pthaugen@us.ibm.com> 2011-05-26 Pat Haugen <pthaugen@us.ibm.com>
* config/rs6000/rs6000.c (rs6000_register_move_cost): Make LR/CTR * config/rs6000/rs6000.c (rs6000_register_move_cost): Make LR/CTR
......
2011-05-26 Nathan Froyd <froydnj@codesourcery.com> 2011-05-26 Nathan Froyd <froydnj@codesourcery.com>
* c-common.c (warning_candidate_p): Check for BLOCKs.
2011-05-26 Nathan Froyd <froydnj@codesourcery.com>
* c-common.h (struct c_common_identifier): Inherit from tree_typed, * c-common.h (struct c_common_identifier): Inherit from tree_typed,
not tree_common. not tree_common.
......
...@@ -2367,6 +2367,9 @@ warning_candidate_p (tree x) ...@@ -2367,6 +2367,9 @@ warning_candidate_p (tree x)
if (DECL_P (x) && DECL_ARTIFICIAL (x)) if (DECL_P (x) && DECL_ARTIFICIAL (x))
return 0; return 0;
if (TREE_CODE (x) == BLOCK)
return 0;
/* VOID_TYPE_P (TREE_TYPE (x)) is workaround for cp/tree.c /* VOID_TYPE_P (TREE_TYPE (x)) is workaround for cp/tree.c
(lvalue_p) crash on TRY/CATCH. */ (lvalue_p) crash on TRY/CATCH. */
if (TREE_TYPE (x) == NULL_TREE || VOID_TYPE_P (TREE_TYPE (x))) if (TREE_TYPE (x) == NULL_TREE || VOID_TYPE_P (TREE_TYPE (x)))
......
2011-05-26 Nathan Froyd <froydnj@codesourcery.com>
* decl.c (poplevel): Don't access TREE_TYPE of BLOCKs.
* expr.c (build_jni_stub): Likewise.
2011-05-24 Joseph Myers <joseph@codesourcery.com> 2011-05-24 Joseph Myers <joseph@codesourcery.com>
* Make-lang.in ($(XGCJ)$(exeext)): Use libcommon-target.a instead * Make-lang.in ($(XGCJ)$(exeext)): Use libcommon-target.a instead
......
...@@ -1425,10 +1425,7 @@ poplevel (int keep, int reverse, int functionbody) ...@@ -1425,10 +1425,7 @@ poplevel (int keep, int reverse, int functionbody)
block = 0; block = 0;
if (keep || functionbody) if (keep || functionbody)
{ block = make_node (BLOCK);
block = make_node (BLOCK);
TREE_TYPE (block) = void_type_node;
}
if (current_binding_level->exception_range) if (current_binding_level->exception_range)
expand_end_java_handler (current_binding_level->exception_range); expand_end_java_handler (current_binding_level->exception_range);
...@@ -1456,7 +1453,7 @@ poplevel (int keep, int reverse, int functionbody) ...@@ -1456,7 +1453,7 @@ poplevel (int keep, int reverse, int functionbody)
} }
*var = NULL; *var = NULL;
bind = build3 (BIND_EXPR, TREE_TYPE (block), BLOCK_VARS (block), bind = build3 (BIND_EXPR, void_type_node, BLOCK_VARS (block),
BLOCK_EXPR_BODY (block), block); BLOCK_EXPR_BODY (block), block);
BIND_EXPR_BODY (bind) = current_binding_level->stmts; BIND_EXPR_BODY (bind) = current_binding_level->stmts;
......
...@@ -2649,7 +2649,6 @@ build_jni_stub (tree method) ...@@ -2649,7 +2649,6 @@ build_jni_stub (tree method)
method_args = DECL_ARGUMENTS (method); method_args = DECL_ARGUMENTS (method);
block = build_block (env_var, NULL_TREE, method_args, NULL_TREE); block = build_block (env_var, NULL_TREE, method_args, NULL_TREE);
TREE_SIDE_EFFECTS (block) = 1; TREE_SIDE_EFFECTS (block) = 1;
TREE_TYPE (block) = TREE_TYPE (TREE_TYPE (method));
/* Compute the local `env' by calling _Jv_GetJNIEnvNewFrame. */ /* Compute the local `env' by calling _Jv_GetJNIEnvNewFrame. */
body = build2 (MODIFY_EXPR, ptr_type_node, env_var, body = build2 (MODIFY_EXPR, ptr_type_node, env_var,
......
...@@ -368,6 +368,7 @@ initialize_tree_contains_struct (void) ...@@ -368,6 +368,7 @@ initialize_tree_contains_struct (void)
switch (ts_code) switch (ts_code)
{ {
case TS_TYPED: case TS_TYPED:
case TS_BLOCK:
MARK_TS_BASE (code); MARK_TS_BASE (code);
break; break;
...@@ -389,7 +390,6 @@ initialize_tree_contains_struct (void) ...@@ -389,7 +390,6 @@ initialize_tree_contains_struct (void)
case TS_TYPE_COMMON: case TS_TYPE_COMMON:
case TS_LIST: case TS_LIST:
case TS_VEC: case TS_VEC:
case TS_BLOCK:
case TS_BINFO: case TS_BINFO:
case TS_STATEMENT_LIST: case TS_STATEMENT_LIST:
case TS_OMP_CLAUSE: case TS_OMP_CLAUSE:
...@@ -4892,7 +4892,8 @@ find_decls_types_r (tree *tp, int *ws, void *data) ...@@ -4892,7 +4892,8 @@ find_decls_types_r (tree *tp, int *ws, void *data)
fld_worklist_push (BLOCK_ABSTRACT_ORIGIN (t), fld); fld_worklist_push (BLOCK_ABSTRACT_ORIGIN (t), fld);
} }
if (TREE_CODE (t) != IDENTIFIER_NODE) if (TREE_CODE (t) != IDENTIFIER_NODE
&& CODE_CONTAINS_STRUCT (TREE_CODE (t), TS_TYPED))
fld_worklist_push (TREE_TYPE (t), fld); fld_worklist_push (TREE_TYPE (t), fld);
return NULL_TREE; return NULL_TREE;
......
...@@ -2051,9 +2051,7 @@ struct GTY(()) tree_omp_clause { ...@@ -2051,9 +2051,7 @@ struct GTY(()) tree_omp_clause {
VEC_index (tree, BLOCK_NONLOCALIZED_VARS (NODE), N) VEC_index (tree, BLOCK_NONLOCALIZED_VARS (NODE), N)
#define BLOCK_SUBBLOCKS(NODE) (BLOCK_CHECK (NODE)->block.subblocks) #define BLOCK_SUBBLOCKS(NODE) (BLOCK_CHECK (NODE)->block.subblocks)
#define BLOCK_SUPERCONTEXT(NODE) (BLOCK_CHECK (NODE)->block.supercontext) #define BLOCK_SUPERCONTEXT(NODE) (BLOCK_CHECK (NODE)->block.supercontext)
/* Note: when changing this, make sure to find the places #define BLOCK_CHAIN(NODE) (BLOCK_CHECK (NODE)->block.chain)
that use chainon or nreverse. */
#define BLOCK_CHAIN(NODE) TREE_CHAIN (BLOCK_CHECK (NODE))
#define BLOCK_ABSTRACT_ORIGIN(NODE) (BLOCK_CHECK (NODE)->block.abstract_origin) #define BLOCK_ABSTRACT_ORIGIN(NODE) (BLOCK_CHECK (NODE)->block.abstract_origin)
#define BLOCK_ABSTRACT(NODE) (BLOCK_CHECK (NODE)->block.abstract_flag) #define BLOCK_ABSTRACT(NODE) (BLOCK_CHECK (NODE)->block.abstract_flag)
...@@ -2094,7 +2092,8 @@ struct GTY(()) tree_omp_clause { ...@@ -2094,7 +2092,8 @@ struct GTY(()) tree_omp_clause {
#define BLOCK_SOURCE_LOCATION(NODE) (BLOCK_CHECK (NODE)->block.locus) #define BLOCK_SOURCE_LOCATION(NODE) (BLOCK_CHECK (NODE)->block.locus)
struct GTY(()) tree_block { struct GTY(()) tree_block {
struct tree_common common; struct tree_base base;
tree chain;
unsigned abstract_flag : 1; unsigned abstract_flag : 1;
unsigned block_num : 31; unsigned block_num : 31;
......
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