Commit caf93cb0 by Eric Christopher

builtins.c (expand_builtin_setjmp_receiver): Fix comment for code removal.

2004-07-21  Eric Christopher  <echristo@redhat.com>

	* builtins.c (expand_builtin_setjmp_receiver): Fix comment for code
	removal.
	* c-decl.c (pop_scope): Ditto.
	* calls.c (expand_call): Remove call to current_nesting_level,
	update comment accordingly. Remove calls to expand_start_target_temps
	and expand_end_target_temps.
	* cfgexpand.c (construct_init_block): Remove call to
	expand_start_bindings_and_block.
	(construct_exit_block): Remove call to expand_end_bindings.
	* expr.c (safe_from_p): Remove BIND_EXPR handling.
	(expand_expr_real_1): Ditto. Fix formatting.
	(expand_vars): Delete.
	* stmt.c (POPSTACK): Remove block_stack.
	(stmt_status): Remove x_block_stack.
	(block_stack): Delete.
	(expand_start_bindings_and_block): Ditto.
	(expand_start_target_temps): Ditto.
	(expand_end_target_temps): Ditto.
	(current_nesting_level): Ditto.
	(warn_about_unused_variables): Ditto.
	(expand_end_bindings): Ditto.
	* tree.h: Remove declarations for above.

2004-07-21  Eric Christopher  <echristo@redhat.com>

	* decl.c (poplevel): Inline unused variable checking.
	Change formatting.

From-SVN: r85019
parent d942072c
2004-07-21 Eric Christopher <echristo@redhat.com>
* builtins.c (expand_builtin_setjmp_receiver): Fix comment for code
removal.
* c-decl.c (pop_scope): Ditto.
* calls.c (expand_call): Remove call to current_nesting_level,
update comment accordingly. Remove calls to expand_start_target_temps
and expand_end_target_temps.
* cfgexpand.c (construct_init_block): Remove call to
expand_start_bindings_and_block.
(construct_exit_block): Remove call to expand_end_bindings.
* expr.c (safe_from_p): Remove BIND_EXPR handling.
(expand_expr_real_1): Ditto. Fix formatting.
(expand_vars): Delete.
* stmt.c (POPSTACK): Remove block_stack.
(stmt_status): Remove x_block_stack.
(block_stack): Delete.
(expand_start_bindings_and_block): Ditto.
(expand_start_target_temps): Ditto.
(expand_end_target_temps): Ditto.
(current_nesting_level): Ditto.
(warn_about_unused_variables): Ditto.
(expand_end_bindings): Ditto.
* tree.h: Remove declarations for above.
2004-07-21 Steven Bosscher <stevenb@suse.de> 2004-07-21 Steven Bosscher <stevenb@suse.de>
* rtl.h (insn_note): Remove NOTE_INSN_PREDICTION. * rtl.h (insn_note): Remove NOTE_INSN_PREDICTION.
...@@ -125,7 +150,6 @@ ...@@ -125,7 +150,6 @@
for EXTRA_SECTION_FUNCTIONS. for EXTRA_SECTION_FUNCTIONS.
* doc/install.texi: Update binutils requirements. * doc/install.texi: Update binutils requirements.
>>>>>>> 2.4622
2004-07-20 Nathan Sidwell <nathan@codesourcery.com> 2004-07-20 Nathan Sidwell <nathan@codesourcery.com>
* vec.h (VEC_T_length, VEC_T_index, VEC_T_iterate, VEC_T_truncate, * vec.h (VEC_T_length, VEC_T_index, VEC_T_iterate, VEC_T_truncate,
......
...@@ -571,8 +571,7 @@ expand_builtin_setjmp_receiver (rtx receiver_label ATTRIBUTE_UNUSED) ...@@ -571,8 +571,7 @@ expand_builtin_setjmp_receiver (rtx receiver_label ATTRIBUTE_UNUSED)
emit_insn (gen_rtx_CLOBBER (VOIDmode, static_chain_rtx)); emit_insn (gen_rtx_CLOBBER (VOIDmode, static_chain_rtx));
/* Now put in the code to restore the frame pointer, and argument /* Now put in the code to restore the frame pointer, and argument
pointer, if needed. The code below is from expand_end_bindings pointer, if needed. */
in stmt.c; see detailed documentation there. */
#ifdef HAVE_nonlocal_goto #ifdef HAVE_nonlocal_goto
if (! HAVE_nonlocal_goto) if (! HAVE_nonlocal_goto)
#endif #endif
...@@ -814,7 +813,7 @@ expand_builtin_nonlocal_goto (tree arglist) ...@@ -814,7 +813,7 @@ expand_builtin_nonlocal_goto (tree arglist)
emit_insn (gen_rtx_CLOBBER (VOIDmode, emit_insn (gen_rtx_CLOBBER (VOIDmode,
gen_rtx_MEM (BLKmode, gen_rtx_MEM (BLKmode,
hard_frame_pointer_rtx))); hard_frame_pointer_rtx)));
/* Restore frame pointer for containing function. /* Restore frame pointer for containing function.
This sets the actual hard register used for the frame pointer This sets the actual hard register used for the frame pointer
to the location of the function's incoming static chain info. to the location of the function's incoming static chain info.
...@@ -822,14 +821,14 @@ expand_builtin_nonlocal_goto (tree arglist) ...@@ -822,14 +821,14 @@ expand_builtin_nonlocal_goto (tree arglist)
proper value and reload the argument pointer, if needed. */ proper value and reload the argument pointer, if needed. */
emit_move_insn (hard_frame_pointer_rtx, r_fp); emit_move_insn (hard_frame_pointer_rtx, r_fp);
emit_stack_restore (SAVE_NONLOCAL, r_sp, NULL_RTX); emit_stack_restore (SAVE_NONLOCAL, r_sp, NULL_RTX);
/* USE of hard_frame_pointer_rtx added for consistency; /* USE of hard_frame_pointer_rtx added for consistency;
not clear if really needed. */ not clear if really needed. */
emit_insn (gen_rtx_USE (VOIDmode, hard_frame_pointer_rtx)); emit_insn (gen_rtx_USE (VOIDmode, hard_frame_pointer_rtx));
emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx)); emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx));
emit_indirect_jump (r_label); emit_indirect_jump (r_label);
} }
/* Search backwards to the jump insn and mark it as a /* Search backwards to the jump insn and mark it as a
non-local goto. */ non-local goto. */
for (insn = get_last_insn (); insn; insn = PREV_INSN (insn)) for (insn = get_last_insn (); insn; insn = PREV_INSN (insn))
...@@ -2038,7 +2037,7 @@ expand_builtin_mathfn_3 (tree exp, rtx target, rtx subtarget) ...@@ -2038,7 +2037,7 @@ expand_builtin_mathfn_3 (tree exp, rtx target, rtx subtarget)
case BUILT_IN_SIN: case BUILT_IN_SIN:
case BUILT_IN_SINF: case BUILT_IN_SINF:
case BUILT_IN_SINL: case BUILT_IN_SINL:
if (!expand_twoval_unop (builtin_optab, op0, 0, target, 0)) if (!expand_twoval_unop (builtin_optab, op0, 0, target, 0))
abort(); abort();
break; break;
case BUILT_IN_COS: case BUILT_IN_COS:
...@@ -7576,13 +7575,13 @@ fold_builtin_isascii (tree arglist) ...@@ -7576,13 +7575,13 @@ fold_builtin_isascii (tree arglist)
{ {
/* Transform isascii(c) -> ((c & ~0x7f) == 0). */ /* Transform isascii(c) -> ((c & ~0x7f) == 0). */
tree arg = TREE_VALUE (arglist); tree arg = TREE_VALUE (arglist);
arg = fold (build2 (EQ_EXPR, integer_type_node, arg = fold (build2 (EQ_EXPR, integer_type_node,
build2 (BIT_AND_EXPR, integer_type_node, arg, build2 (BIT_AND_EXPR, integer_type_node, arg,
build_int_2 (~ (unsigned HOST_WIDE_INT) 0x7f, build_int_2 (~ (unsigned HOST_WIDE_INT) 0x7f,
~ (HOST_WIDE_INT) 0)), ~ (HOST_WIDE_INT) 0)),
integer_zero_node)); integer_zero_node));
if (in_gimple_form && !TREE_CONSTANT (arg)) if (in_gimple_form && !TREE_CONSTANT (arg))
return NULL_TREE; return NULL_TREE;
else else
...@@ -7601,7 +7600,7 @@ fold_builtin_toascii (tree arglist) ...@@ -7601,7 +7600,7 @@ fold_builtin_toascii (tree arglist)
{ {
/* Transform toascii(c) -> (c & 0x7f). */ /* Transform toascii(c) -> (c & 0x7f). */
tree arg = TREE_VALUE (arglist); tree arg = TREE_VALUE (arglist);
return fold (build2 (BIT_AND_EXPR, integer_type_node, arg, return fold (build2 (BIT_AND_EXPR, integer_type_node, arg,
build_int_2 (0x7f, 0))); build_int_2 (0x7f, 0)));
} }
...@@ -7950,7 +7949,7 @@ fold_builtin_1 (tree exp, bool ignore) ...@@ -7950,7 +7949,7 @@ fold_builtin_1 (tree exp, bool ignore)
if (flag_unsafe_math_optimizations && BUILTIN_ROOT_P (fcode)) if (flag_unsafe_math_optimizations && BUILTIN_ROOT_P (fcode))
{ {
tree powfn = mathfn_built_in (type, BUILT_IN_POW); tree powfn = mathfn_built_in (type, BUILT_IN_POW);
if (powfn) if (powfn)
{ {
tree arg0 = TREE_VALUE (TREE_OPERAND (arg, 1)); tree arg0 = TREE_VALUE (TREE_OPERAND (arg, 1));
...@@ -7958,7 +7957,7 @@ fold_builtin_1 (tree exp, bool ignore) ...@@ -7958,7 +7957,7 @@ fold_builtin_1 (tree exp, bool ignore)
/* The inner root was either sqrt or cbrt. */ /* The inner root was either sqrt or cbrt. */
REAL_VALUE_TYPE dconstroot = REAL_VALUE_TYPE dconstroot =
BUILTIN_SQRT_P (fcode) ? dconsthalf : dconstthird; BUILTIN_SQRT_P (fcode) ? dconsthalf : dconstthird;
/* Adjust for the outer root. */ /* Adjust for the outer root. */
SET_REAL_EXP (&dconstroot, REAL_EXP (&dconstroot) - 1); SET_REAL_EXP (&dconstroot, REAL_EXP (&dconstroot) - 1);
dconstroot = real_value_truncate (TYPE_MODE (type), dconstroot); dconstroot = real_value_truncate (TYPE_MODE (type), dconstroot);
...@@ -8032,7 +8031,7 @@ fold_builtin_1 (tree exp, bool ignore) ...@@ -8032,7 +8031,7 @@ fold_builtin_1 (tree exp, bool ignore)
build_tree_list (NULL_TREE, tree_root)); build_tree_list (NULL_TREE, tree_root));
return build_function_call_expr (powfn, arglist); return build_function_call_expr (powfn, arglist);
} }
} }
} }
break; break;
...@@ -8431,7 +8430,7 @@ fold_builtin_1 (tree exp, bool ignore) ...@@ -8431,7 +8430,7 @@ fold_builtin_1 (tree exp, bool ignore)
} }
/* A wrapper function for builtin folding that prevents warnings for /* A wrapper function for builtin folding that prevents warnings for
"statement without effect" and the like, caused by removing the "statement without effect" and the like, caused by removing the
call node earlier than the warning is generated. */ call node earlier than the warning is generated. */
tree tree
...@@ -8540,7 +8539,7 @@ readonly_data_expr (tree exp) ...@@ -8540,7 +8539,7 @@ readonly_data_expr (tree exp)
/* Make sure we call decl_readonly_section only for trees it /* Make sure we call decl_readonly_section only for trees it
can handle (since it returns true for everything it doesn't can handle (since it returns true for everything it doesn't
understand). */ understand). */
if (TREE_CODE (exp) == STRING_CST if (TREE_CODE (exp) == STRING_CST
|| TREE_CODE (exp) == CONSTRUCTOR || TREE_CODE (exp) == CONSTRUCTOR
|| (TREE_CODE (exp) == VAR_DECL && TREE_STATIC (exp))) || (TREE_CODE (exp) == VAR_DECL && TREE_STATIC (exp)))
return decl_readonly_section (exp, 0); return decl_readonly_section (exp, 0);
......
...@@ -746,9 +746,7 @@ pop_scope (void) ...@@ -746,9 +746,7 @@ pop_scope (void)
goto common_symbol; goto common_symbol;
case VAR_DECL: case VAR_DECL:
/* Warnings for unused variables. Keep this in sync with /* Warnings for unused variables. */
stmt.c:warn_about_unused_variables, which we cannot use
since it expects a different data structure. */
if (warn_unused_variable if (warn_unused_variable
&& !TREE_USED (p) && !TREE_USED (p)
&& !DECL_IN_SYSTEM_HEADER (p) && !DECL_IN_SYSTEM_HEADER (p)
...@@ -1951,7 +1949,7 @@ pushdecl (tree x) ...@@ -1951,7 +1949,7 @@ pushdecl (tree x)
bind (name, x, file_scope, /*invisible=*/true, /*nested=*/false); bind (name, x, file_scope, /*invisible=*/true, /*nested=*/false);
nested = true; nested = true;
} }
} }
warn_if_shadowing (x); warn_if_shadowing (x);
...@@ -4516,7 +4514,7 @@ grokdeclarator (tree declarator, tree declspecs, ...@@ -4516,7 +4514,7 @@ grokdeclarator (tree declarator, tree declspecs,
DECL_EXTERNAL (decl) = 0; DECL_EXTERNAL (decl) = 0;
else else
DECL_EXTERNAL (decl) = 1; DECL_EXTERNAL (decl) = 1;
/* Record absence of global scope for `static' or `auto'. */ /* Record absence of global scope for `static' or `auto'. */
TREE_PUBLIC (decl) TREE_PUBLIC (decl)
= !(specbits & ((1 << (int) RID_STATIC) | (1 << (int) RID_AUTO))); = !(specbits & ((1 << (int) RID_STATIC) | (1 << (int) RID_AUTO)));
......
...@@ -2232,15 +2232,11 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -2232,15 +2232,11 @@ expand_call (tree exp, rtx target, int ignore)
finished with regular parsing. Which means that some of the finished with regular parsing. Which means that some of the
machinery we use to generate tail-calls is no longer in place. machinery we use to generate tail-calls is no longer in place.
This is most often true of sjlj-exceptions, which we couldn't This is most often true of sjlj-exceptions, which we couldn't
tail-call to anyway. tail-call to anyway. */
If current_nesting_level () == 0, we're being called after
the function body has been expanded. This can happen when
setting up trampolines in expand_function_end. */
if (currently_expanding_call++ != 0 if (currently_expanding_call++ != 0
|| !flag_optimize_sibling_calls || !flag_optimize_sibling_calls
|| !rtx_equal_function_value_matters || !rtx_equal_function_value_matters
|| current_nesting_level () == 0
|| args_size.var || args_size.var
|| lookup_stmt_eh_region (exp) >= 0) || lookup_stmt_eh_region (exp) >= 0)
try_tail_call = 0; try_tail_call = 0;
...@@ -2372,15 +2368,6 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -2372,15 +2368,6 @@ expand_call (tree exp, rtx target, int ignore)
sibcall_failure instead of continuing the loop. */ sibcall_failure instead of continuing the loop. */
start_sequence (); start_sequence ();
if (pass == 0)
{
/* We know at this point that there are not currently any
pending cleanups. If, however, in the process of evaluating
the arguments we were to create some, we'll need to be
able to get rid of them. */
expand_start_target_temps ();
}
/* Don't let pending stack adjusts add up to too much. /* Don't let pending stack adjusts add up to too much.
Also, do all pending adjustments now if there is any chance Also, do all pending adjustments now if there is any chance
this might be a call to alloca or if we are expanding a sibling this might be a call to alloca or if we are expanding a sibling
...@@ -3093,14 +3080,6 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -3093,14 +3080,6 @@ expand_call (tree exp, rtx target, int ignore)
if (args[i].aligned_regs) if (args[i].aligned_regs)
free (args[i].aligned_regs); free (args[i].aligned_regs);
if (pass == 0)
{
/* Undo the fake expand_start_target_temps we did earlier. If
there had been any cleanups created, we've already set
sibcall_failure. */
expand_end_target_temps ();
}
/* If this function is returning into a memory location marked as /* If this function is returning into a memory location marked as
readonly, it means it is initializing that location. We normally treat readonly, it means it is initializing that location. We normally treat
functions as not clobbering such locations, so we need to specify that functions as not clobbering such locations, so we need to specify that
......
...@@ -210,7 +210,7 @@ expand_gimple_basic_block (basic_block bb, FILE * dump_file) ...@@ -210,7 +210,7 @@ expand_gimple_basic_block (basic_block bb, FILE * dump_file)
expand_expr_stmt (stmt); expand_expr_stmt (stmt);
/* Java emits line number notes in the top of labels. /* Java emits line number notes in the top of labels.
??? Make this go away once line number notes are obsoleted. */ ??? Make this go away once line number notes are obsoleted. */
BB_HEAD (bb) = NEXT_INSN (last); BB_HEAD (bb) = NEXT_INSN (last);
if (NOTE_P (BB_HEAD (bb))) if (NOTE_P (BB_HEAD (bb)))
...@@ -275,7 +275,7 @@ expand_gimple_basic_block (basic_block bb, FILE * dump_file) ...@@ -275,7 +275,7 @@ expand_gimple_basic_block (basic_block bb, FILE * dump_file)
if (JUMP_TABLE_DATA_P (last)) if (JUMP_TABLE_DATA_P (last))
last = PREV_INSN (PREV_INSN (last)); last = PREV_INSN (PREV_INSN (last));
BB_END (bb) = last; BB_END (bb) = last;
if (dump_file) if (dump_file)
dump_bb (bb, dump_file, 0); dump_bb (bb, dump_file, 0);
update_bb_for_insn (bb); update_bb_for_insn (bb);
...@@ -292,8 +292,6 @@ construct_init_block (void) ...@@ -292,8 +292,6 @@ construct_init_block (void)
basic_block init_block, first_block; basic_block init_block, first_block;
edge e; edge e;
expand_start_bindings_and_block (0, NULL_TREE);
for (e = ENTRY_BLOCK_PTR->succ; e; e = e->succ_next) for (e = ENTRY_BLOCK_PTR->succ; e; e = e->succ_next)
if (e->dest == ENTRY_BLOCK_PTR->next_bb) if (e->dest == ENTRY_BLOCK_PTR->next_bb)
break; break;
...@@ -329,7 +327,7 @@ construct_exit_block (void) ...@@ -329,7 +327,7 @@ construct_exit_block (void)
basic_block exit_block; basic_block exit_block;
edge e, e2, next; edge e, e2, next;
/* Make sure the locus is set to the end of the function, so that /* Make sure the locus is set to the end of the function, so that
epilogue line numbers and warnings are set properly. */ epilogue line numbers and warnings are set properly. */
#ifdef USE_MAPPED_LOCATION #ifdef USE_MAPPED_LOCATION
if (cfun->function_end_locus != UNKNOWN_LOCATION) if (cfun->function_end_locus != UNKNOWN_LOCATION)
...@@ -341,8 +339,6 @@ construct_exit_block (void) ...@@ -341,8 +339,6 @@ construct_exit_block (void)
/* The following insns belong to the top scope. */ /* The following insns belong to the top scope. */
record_block_change (DECL_INITIAL (current_function_decl)); record_block_change (DECL_INITIAL (current_function_decl));
expand_end_bindings (NULL_TREE, 1, 0);
/* Generate rtl for function exit. */ /* Generate rtl for function exit. */
expand_function_end (); expand_function_end ();
......
2004-07-21 Eric Christopher <echristo@redhat.com>
* decl.c (poplevel): Inline unused variable checking.
Change formatting.
2004-07-21 Paolo Bonzini <bonzini@gnu.org> 2004-07-21 Paolo Bonzini <bonzini@gnu.org>
* typeck.c (build_binary_op): Do not use RDIV_EXPR for * typeck.c (build_binary_op): Do not use RDIV_EXPR for
...@@ -114,7 +119,7 @@ ...@@ -114,7 +119,7 @@
2004-07-19 Mark Mitchell <mark@codesourcery.com> 2004-07-19 Mark Mitchell <mark@codesourcery.com>
Revert patch for PR c++/16623. Revert patch for PR c++/16623.
2004-07-19 Kelley Cook <kcook@gcc.gnu.org> 2004-07-19 Kelley Cook <kcook@gcc.gnu.org>
* except.c: Remove two spurious carriage returns. * except.c: Remove two spurious carriage returns.
...@@ -315,8 +320,8 @@ ...@@ -315,8 +320,8 @@
(copy_binfo): Declare. (copy_binfo): Declare.
2004-07-15 Mark Mitchell <mark@codesourcery.com> 2004-07-15 Mark Mitchell <mark@codesourcery.com>
* name-lookup.c (set_inherited_value_binding_p): Add class_type * name-lookup.c (set_inherited_value_binding_p): Add class_type
parameter. parameter.
(get_class_binding): Adjust. (get_class_binding): Adjust.
(push_class_level_binding): Don't use set_inherited_value_binding_p. (push_class_level_binding): Don't use set_inherited_value_binding_p.
...@@ -378,7 +383,7 @@ ...@@ -378,7 +383,7 @@
(dfs_push_type_decls): Remove. (dfs_push_type_decls): Remove.
(dfs_push_decls): Remove. (dfs_push_decls): Remove.
(push_class_decls): Remove. (push_class_decls): Remove.
2004-07-13 Mark Mitchell <mark@codesourcery.com> 2004-07-13 Mark Mitchell <mark@codesourcery.com>
PR c++/16518 PR c++/16518
......
...@@ -64,7 +64,7 @@ static tree grok_reference_init (tree, tree, tree, tree *); ...@@ -64,7 +64,7 @@ static tree grok_reference_init (tree, tree, tree, tree *);
static tree grokfndecl (tree, tree, tree, tree, tree, int, static tree grokfndecl (tree, tree, tree, tree, tree, int,
enum overload_flags, cp_cv_quals, enum overload_flags, cp_cv_quals,
tree, int, int, int, int, int, int, tree); tree, int, int, int, int, int, int, tree);
static tree grokvardecl (tree, tree, const cp_decl_specifier_seq *, static tree grokvardecl (tree, tree, const cp_decl_specifier_seq *,
int, int, tree); int, int, tree);
static void record_unknown_type (tree, const char *); static void record_unknown_type (tree, const char *);
static tree builtin_function_1 (const char *, tree, tree, int, static tree builtin_function_1 (const char *, tree, tree, int,
...@@ -110,7 +110,7 @@ static tree start_cleanup_fn (void); ...@@ -110,7 +110,7 @@ static tree start_cleanup_fn (void);
static void end_cleanup_fn (void); static void end_cleanup_fn (void);
static tree cp_make_fname_decl (tree, int); static tree cp_make_fname_decl (tree, int);
static void initialize_predefined_identifiers (void); static void initialize_predefined_identifiers (void);
static tree check_special_function_return_type static tree check_special_function_return_type
(special_function_kind, tree, tree); (special_function_kind, tree, tree);
static tree push_cp_library_fn (enum tree_code, tree); static tree push_cp_library_fn (enum tree_code, tree);
static tree build_cp_library_fn (tree, enum tree_code, tree); static tree build_cp_library_fn (tree, enum tree_code, tree);
...@@ -234,7 +234,7 @@ int function_depth; ...@@ -234,7 +234,7 @@ int function_depth;
with __attribute__((deprecated)). An object declared as with __attribute__((deprecated)). An object declared as
__attribute__((deprecated)) suppresses warnings of uses of other __attribute__((deprecated)) suppresses warnings of uses of other
deprecated items. */ deprecated items. */
enum deprecated_states { enum deprecated_states {
DEPRECATED_NORMAL, DEPRECATED_NORMAL,
DEPRECATED_SUPPRESS DEPRECATED_SUPPRESS
...@@ -266,8 +266,8 @@ current_tmpl_spec_kind (int n_class_scopes) ...@@ -266,8 +266,8 @@ current_tmpl_spec_kind (int n_class_scopes)
struct cp_binding_level *b; struct cp_binding_level *b;
/* Scan through the template parameter scopes. */ /* Scan through the template parameter scopes. */
for (b = current_binding_level; for (b = current_binding_level;
b->kind == sk_template_parms; b->kind == sk_template_parms;
b = b->level_chain) b = b->level_chain)
{ {
/* If we see a specialization scope inside a parameter scope, /* If we see a specialization scope inside a parameter scope,
...@@ -444,7 +444,7 @@ poplevel (int keep, int reverse, int functionbody) ...@@ -444,7 +444,7 @@ poplevel (int keep, int reverse, int functionbody)
? ((functionbody = 0), tmp) : functionbody); ? ((functionbody = 0), tmp) : functionbody);
subblocks = functionbody >= 0 ? current_binding_level->blocks : 0; subblocks = functionbody >= 0 ? current_binding_level->blocks : 0;
my_friendly_assert (VEC_length(cp_class_binding, my_friendly_assert (VEC_length(cp_class_binding,
current_binding_level->class_shadowed) == 0, current_binding_level->class_shadowed) == 0,
19990414); 19990414);
...@@ -502,14 +502,6 @@ poplevel (int keep, int reverse, int functionbody) ...@@ -502,14 +502,6 @@ poplevel (int keep, int reverse, int functionbody)
else else
decls = current_binding_level->names; decls = current_binding_level->names;
/* When not in function-at-a-time mode, expand_end_bindings will
warn about unused variables. But, in function-at-a-time mode
expand_end_bindings is not passed the list of variables in the
current scope, and therefore no warning is emitted. So, we
explicitly warn here. */
if (!processing_template_decl)
warn_about_unused_variables (getdecls ());
/* If there were any declarations or structure tags in that level, /* If there were any declarations or structure tags in that level,
or if this level is a function body, or if this level is a function body,
create a BLOCK to record them for the life of this function. */ create a BLOCK to record them for the life of this function. */
...@@ -534,6 +526,16 @@ poplevel (int keep, int reverse, int functionbody) ...@@ -534,6 +526,16 @@ poplevel (int keep, int reverse, int functionbody)
leaving_for_scope leaving_for_scope
= current_binding_level->kind == sk_for && flag_new_for_scope == 1; = current_binding_level->kind == sk_for && flag_new_for_scope == 1;
/* Before we remove the declarations first check for unused variables. */
if (warn_unused_variable
&& !processing_template_decl)
for (decl = getdecls (); decl; decl = TREE_CHAIN (decl))
if (TREE_CODE (decl) == VAR_DECL
&& ! TREE_USED (decl)
&& ! DECL_IN_SYSTEM_HEADER (decl)
&& DECL_NAME (decl) && ! DECL_ARTIFICIAL (decl))
warning ("%Junused variable '%D'", decl, decl);
/* Remove declarations for all the DECLs in this level. */ /* Remove declarations for all the DECLs in this level. */
for (link = decls; link; link = TREE_CHAIN (link)) for (link = decls; link; link = TREE_CHAIN (link))
{ {
...@@ -595,7 +597,7 @@ poplevel (int keep, int reverse, int functionbody) ...@@ -595,7 +597,7 @@ poplevel (int keep, int reverse, int functionbody)
/* Although we don't pop the cxx_binding, we do clear /* Although we don't pop the cxx_binding, we do clear
its SCOPE since the scope is going away now. */ its SCOPE since the scope is going away now. */
IDENTIFIER_BINDING (name)->scope IDENTIFIER_BINDING (name)->scope
= current_binding_level->level_chain; = current_binding_level->level_chain;
} }
} }
...@@ -603,8 +605,10 @@ poplevel (int keep, int reverse, int functionbody) ...@@ -603,8 +605,10 @@ poplevel (int keep, int reverse, int functionbody)
{ {
/* Remove the binding. */ /* Remove the binding. */
decl = link; decl = link;
if (TREE_CODE (decl) == TREE_LIST) if (TREE_CODE (decl) == TREE_LIST)
decl = TREE_VALUE (decl); decl = TREE_VALUE (decl);
if (DECL_P (decl)) if (DECL_P (decl))
pop_binding (DECL_NAME (decl), decl); pop_binding (DECL_NAME (decl), decl);
else if (TREE_CODE (decl) == OVERLOAD) else if (TREE_CODE (decl) == OVERLOAD)
...@@ -787,9 +791,9 @@ walk_vtables_r (tree namespace, void* data) ...@@ -787,9 +791,9 @@ walk_vtables_r (tree namespace, void* data)
returns a nonzero value, return a nonzero value. */ returns a nonzero value, return a nonzero value. */
bool bool
walk_vtables (walk_globals_pred p, walk_globals_fn f, void *data) walk_vtables (walk_globals_pred p, walk_globals_fn f, void *data)
{ {
struct walk_globals_data wgd; struct walk_globals_data wgd;
wgd.p = p; wgd.p = p;
wgd.f = f; wgd.f = f;
wgd.data = data; wgd.data = data;
...@@ -803,7 +807,7 @@ static int ...@@ -803,7 +807,7 @@ static int
walk_namespaces_r (tree namespace, walk_namespaces_fn f, void* data) walk_namespaces_r (tree namespace, walk_namespaces_fn f, void* data)
{ {
int result = 0; int result = 0;
tree current = NAMESPACE_LEVEL (namespace)->namespaces; tree current = NAMESPACE_LEVEL (namespace)->namespaces;
result |= (*f) (namespace, data); result |= (*f) (namespace, data);
...@@ -1410,7 +1414,7 @@ duplicate_decls (tree newdecl, tree olddecl) ...@@ -1410,7 +1414,7 @@ duplicate_decls (tree newdecl, tree olddecl)
In a declarative region, a namespace-alias-definition can be In a declarative region, a namespace-alias-definition can be
used to redefine a namespace-alias declared in that declarative used to redefine a namespace-alias declared in that declarative
region to refer only to the namespace to which it already region to refer only to the namespace to which it already
refers. refers.
Therefore, if we encounter a second alias directive for the same Therefore, if we encounter a second alias directive for the same
alias, we can just ignore the second directive. */ alias, we can just ignore the second directive. */
...@@ -1486,7 +1490,7 @@ duplicate_decls (tree newdecl, tree olddecl) ...@@ -1486,7 +1490,7 @@ duplicate_decls (tree newdecl, tree olddecl)
} }
} }
if (DECL_DECLARED_INLINE_P (newdecl) if (DECL_DECLARED_INLINE_P (newdecl)
&& ! DECL_DECLARED_INLINE_P (olddecl) && ! DECL_DECLARED_INLINE_P (olddecl)
&& TREE_ADDRESSABLE (olddecl) && warn_inline) && TREE_ADDRESSABLE (olddecl) && warn_inline)
{ {
...@@ -1580,7 +1584,7 @@ duplicate_decls (tree newdecl, tree olddecl) ...@@ -1580,7 +1584,7 @@ duplicate_decls (tree newdecl, tree olddecl)
if (DECL_INITIAL (DECL_TEMPLATE_RESULT (olddecl)) == NULL_TREE if (DECL_INITIAL (DECL_TEMPLATE_RESULT (olddecl)) == NULL_TREE
&& DECL_INITIAL (DECL_TEMPLATE_RESULT (newdecl)) != NULL_TREE) && DECL_INITIAL (DECL_TEMPLATE_RESULT (newdecl)) != NULL_TREE)
{ {
DECL_SOURCE_LOCATION (olddecl) DECL_SOURCE_LOCATION (olddecl)
= DECL_SOURCE_LOCATION (DECL_TEMPLATE_RESULT (olddecl)) = DECL_SOURCE_LOCATION (DECL_TEMPLATE_RESULT (olddecl))
= DECL_SOURCE_LOCATION (newdecl); = DECL_SOURCE_LOCATION (newdecl);
if (DECL_FUNCTION_TEMPLATE_P (newdecl)) if (DECL_FUNCTION_TEMPLATE_P (newdecl))
...@@ -1590,7 +1594,7 @@ duplicate_decls (tree newdecl, tree olddecl) ...@@ -1590,7 +1594,7 @@ duplicate_decls (tree newdecl, tree olddecl)
if (DECL_FUNCTION_TEMPLATE_P (newdecl)) if (DECL_FUNCTION_TEMPLATE_P (newdecl))
{ {
DECL_INLINE (DECL_TEMPLATE_RESULT (olddecl)) DECL_INLINE (DECL_TEMPLATE_RESULT (olddecl))
|= DECL_INLINE (DECL_TEMPLATE_RESULT (newdecl)); |= DECL_INLINE (DECL_TEMPLATE_RESULT (newdecl));
DECL_DECLARED_INLINE_P (DECL_TEMPLATE_RESULT (olddecl)) DECL_DECLARED_INLINE_P (DECL_TEMPLATE_RESULT (olddecl))
|= DECL_DECLARED_INLINE_P (DECL_TEMPLATE_RESULT (newdecl)); |= DECL_DECLARED_INLINE_P (DECL_TEMPLATE_RESULT (newdecl));
...@@ -1700,7 +1704,7 @@ duplicate_decls (tree newdecl, tree olddecl) ...@@ -1700,7 +1704,7 @@ duplicate_decls (tree newdecl, tree olddecl)
/* Keep the old RTL. */ /* Keep the old RTL. */
COPY_DECL_RTL (olddecl, newdecl); COPY_DECL_RTL (olddecl, newdecl);
} }
else if (TREE_CODE (newdecl) == VAR_DECL else if (TREE_CODE (newdecl) == VAR_DECL
&& (DECL_SIZE (olddecl) || !DECL_SIZE (newdecl))) && (DECL_SIZE (olddecl) || !DECL_SIZE (newdecl)))
{ {
/* Keep the old RTL. We cannot keep the old RTL if the old /* Keep the old RTL. We cannot keep the old RTL if the old
...@@ -1745,7 +1749,7 @@ duplicate_decls (tree newdecl, tree olddecl) ...@@ -1745,7 +1749,7 @@ duplicate_decls (tree newdecl, tree olddecl)
/* Don't really know how much of the language-specific /* Don't really know how much of the language-specific
values we should copy from old to new. */ values we should copy from old to new. */
DECL_IN_AGGR_P (newdecl) = DECL_IN_AGGR_P (olddecl); DECL_IN_AGGR_P (newdecl) = DECL_IN_AGGR_P (olddecl);
DECL_LANG_SPECIFIC (newdecl)->decl_flags.u2 = DECL_LANG_SPECIFIC (newdecl)->decl_flags.u2 =
DECL_LANG_SPECIFIC (olddecl)->decl_flags.u2; DECL_LANG_SPECIFIC (olddecl)->decl_flags.u2;
DECL_NONCONVERTING_P (newdecl) = DECL_NONCONVERTING_P (olddecl); DECL_NONCONVERTING_P (newdecl) = DECL_NONCONVERTING_P (olddecl);
DECL_TEMPLATE_INFO (newdecl) = DECL_TEMPLATE_INFO (olddecl); DECL_TEMPLATE_INFO (newdecl) = DECL_TEMPLATE_INFO (olddecl);
...@@ -1802,7 +1806,7 @@ duplicate_decls (tree newdecl, tree olddecl) ...@@ -1802,7 +1806,7 @@ duplicate_decls (tree newdecl, tree olddecl)
DECL_DECLARED_INLINE_P (newdecl) |= DECL_DECLARED_INLINE_P (olddecl); DECL_DECLARED_INLINE_P (newdecl) |= DECL_DECLARED_INLINE_P (olddecl);
/* If either decl says `inline', this fn is inline, unless /* If either decl says `inline', this fn is inline, unless
its definition was passed already. */ its definition was passed already. */
if (DECL_INLINE (newdecl) && DECL_INITIAL (olddecl) == NULL_TREE) if (DECL_INLINE (newdecl) && DECL_INITIAL (olddecl) == NULL_TREE)
DECL_INLINE (olddecl) = 1; DECL_INLINE (olddecl) = 1;
...@@ -1906,8 +1910,8 @@ duplicate_decls (tree newdecl, tree olddecl) ...@@ -1906,8 +1910,8 @@ duplicate_decls (tree newdecl, tree olddecl)
olddecl, and not newdecl, is on the list of olddecl, and not newdecl, is on the list of
instantiations so that if we try to do the instantiation instantiations so that if we try to do the instantiation
again we won't get the clobbered declaration. */ again we won't get the clobbered declaration. */
reregister_specialization (newdecl, reregister_specialization (newdecl,
DECL_TI_TEMPLATE (newdecl), DECL_TI_TEMPLATE (newdecl),
olddecl); olddecl);
} }
else else
...@@ -1929,7 +1933,7 @@ duplicate_decls (tree newdecl, tree olddecl) ...@@ -1929,7 +1933,7 @@ duplicate_decls (tree newdecl, tree olddecl)
/* If OLDDECL had its DECL_RTL instantiated, re-invoke make_decl_rtl /* If OLDDECL had its DECL_RTL instantiated, re-invoke make_decl_rtl
so that encode_section_info has a chance to look at the new decl so that encode_section_info has a chance to look at the new decl
flags and attributes. */ flags and attributes. */
if (DECL_RTL_SET_P (olddecl) if (DECL_RTL_SET_P (olddecl)
&& (TREE_CODE (olddecl) == FUNCTION_DECL && (TREE_CODE (olddecl) == FUNCTION_DECL
|| (TREE_CODE (olddecl) == VAR_DECL || (TREE_CODE (olddecl) == VAR_DECL
&& TREE_STATIC (olddecl)))) && TREE_STATIC (olddecl))))
...@@ -1998,7 +2002,7 @@ redeclaration_error_message (tree newdecl, tree olddecl) ...@@ -1998,7 +2002,7 @@ redeclaration_error_message (tree newdecl, tree olddecl)
} }
if (TREE_CODE (DECL_TEMPLATE_RESULT (newdecl)) != FUNCTION_DECL if (TREE_CODE (DECL_TEMPLATE_RESULT (newdecl)) != FUNCTION_DECL
|| (DECL_TEMPLATE_RESULT (newdecl) || (DECL_TEMPLATE_RESULT (newdecl)
== DECL_TEMPLATE_RESULT (olddecl))) == DECL_TEMPLATE_RESULT (olddecl)))
return NULL; return NULL;
...@@ -2343,8 +2347,8 @@ define_label (location_t location, tree name) ...@@ -2343,8 +2347,8 @@ define_label (location_t location, tree name)
/* After labels, make any new cleanups in the function go into their /* After labels, make any new cleanups in the function go into their
own new (temporary) binding contour. */ own new (temporary) binding contour. */
for (p = current_binding_level; for (p = current_binding_level;
p->kind != sk_function_parms; p->kind != sk_function_parms;
p = p->level_chain) p = p->level_chain)
p->more_cleanups_ok = 0; p->more_cleanups_ok = 0;
...@@ -2451,8 +2455,8 @@ finish_case_label (tree low_value, tree high_value) ...@@ -2451,8 +2455,8 @@ finish_case_label (tree low_value, tree high_value)
/* After labels, make any new cleanups in the function go into their /* After labels, make any new cleanups in the function go into their
own new (temporary) binding contour. */ own new (temporary) binding contour. */
for (p = current_binding_level; for (p = current_binding_level;
p->kind != sk_function_parms; p->kind != sk_function_parms;
p = p->level_chain) p = p->level_chain)
p->more_cleanups_ok = 0; p->more_cleanups_ok = 0;
...@@ -2515,7 +2519,7 @@ build_typename_type (tree context, tree name, tree fullname) ...@@ -2515,7 +2519,7 @@ build_typename_type (tree context, tree name, tree fullname)
if (typename_htab == NULL) if (typename_htab == NULL)
{ {
typename_htab = htab_create_ggc (61, &typename_hash, typename_htab = htab_create_ggc (61, &typename_hash,
&typename_compare, NULL); &typename_compare, NULL);
} }
...@@ -2587,7 +2591,7 @@ make_typename_type (tree context, tree name, tsubst_flags_t complain) ...@@ -2587,7 +2591,7 @@ make_typename_type (tree context, tree name, tsubst_flags_t complain)
return error_mark_node; return error_mark_node;
} }
my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 20030802); my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 20030802);
if (TREE_CODE (context) == NAMESPACE_DECL) if (TREE_CODE (context) == NAMESPACE_DECL)
{ {
/* We can get here from typename_sub0 in the explicit_template_type /* We can get here from typename_sub0 in the explicit_template_type
...@@ -2649,7 +2653,7 @@ make_typename_type (tree context, tree name, tsubst_flags_t complain) ...@@ -2649,7 +2653,7 @@ make_typename_type (tree context, tree name, tsubst_flags_t complain)
if (DECL_ARTIFICIAL (t) || !(complain & tf_keep_type_decl)) if (DECL_ARTIFICIAL (t) || !(complain & tf_keep_type_decl))
t = TREE_TYPE (t); t = TREE_TYPE (t);
return t; return t;
} }
} }
...@@ -2700,7 +2704,7 @@ make_unbound_class_template (tree context, tree name, tsubst_flags_t complain) ...@@ -2700,7 +2704,7 @@ make_unbound_class_template (tree context, tree name, tsubst_flags_t complain)
error ("no class template named `%#T' in `%#T'", name, context); error ("no class template named `%#T' in `%#T'", name, context);
return error_mark_node; return error_mark_node;
} }
if (complain & tf_error) if (complain & tf_error)
perform_or_defer_access_check (TYPE_BINFO (context), tmpl); perform_or_defer_access_check (TYPE_BINFO (context), tmpl);
...@@ -2730,8 +2734,8 @@ make_unbound_class_template (tree context, tree name, tsubst_flags_t complain) ...@@ -2730,8 +2734,8 @@ make_unbound_class_template (tree context, tree name, tsubst_flags_t complain)
type. TYPE is the _TYPE node for the builtin type. */ type. TYPE is the _TYPE node for the builtin type. */
void void
record_builtin_type (enum rid rid_index, record_builtin_type (enum rid rid_index,
const char* name, const char* name,
tree type) tree type)
{ {
tree rname = NULL_TREE, tname = NULL_TREE; tree rname = NULL_TREE, tname = NULL_TREE;
...@@ -2965,7 +2969,7 @@ cxx_init_decl_processing (void) ...@@ -2965,7 +2969,7 @@ cxx_init_decl_processing (void)
void_ftype = build_function_type (void_type_node, void_list_node); void_ftype = build_function_type (void_type_node, void_list_node);
void_ftype_ptr = build_function_type (void_type_node, void_ftype_ptr = build_function_type (void_type_node,
tree_cons (NULL_TREE, tree_cons (NULL_TREE,
ptr_type_node, ptr_type_node,
void_list_node)); void_list_node));
void_ftype_ptr void_ftype_ptr
= build_exception_variant (void_ftype_ptr, empty_except_spec); = build_exception_variant (void_ftype_ptr, empty_except_spec);
...@@ -3025,13 +3029,13 @@ cxx_init_decl_processing (void) ...@@ -3025,13 +3029,13 @@ cxx_init_decl_processing (void)
bad_alloc_id = get_identifier ("bad_alloc"); bad_alloc_id = get_identifier ("bad_alloc");
bad_alloc_type_node = make_aggr_type (RECORD_TYPE); bad_alloc_type_node = make_aggr_type (RECORD_TYPE);
TYPE_CONTEXT (bad_alloc_type_node) = current_namespace; TYPE_CONTEXT (bad_alloc_type_node) = current_namespace;
bad_alloc_decl bad_alloc_decl
= create_implicit_typedef (bad_alloc_id, bad_alloc_type_node); = create_implicit_typedef (bad_alloc_id, bad_alloc_type_node);
DECL_CONTEXT (bad_alloc_decl) = current_namespace; DECL_CONTEXT (bad_alloc_decl) = current_namespace;
TYPE_STUB_DECL (bad_alloc_type_node) = bad_alloc_decl; TYPE_STUB_DECL (bad_alloc_type_node) = bad_alloc_decl;
pop_namespace (); pop_namespace ();
ptr_ftype_sizetype ptr_ftype_sizetype
= build_function_type (ptr_type_node, = build_function_type (ptr_type_node,
tree_cons (NULL_TREE, tree_cons (NULL_TREE,
size_type_node, size_type_node,
...@@ -3085,17 +3089,17 @@ cp_fname_init (const char* name, tree *type_p) ...@@ -3085,17 +3089,17 @@ cp_fname_init (const char* name, tree *type_p)
domain = build_index_type (size_int (length)); domain = build_index_type (size_int (length));
init = build_string (length + 1, name); init = build_string (length + 1, name);
} }
type = build_qualified_type (char_type_node, TYPE_QUAL_CONST); type = build_qualified_type (char_type_node, TYPE_QUAL_CONST);
type = build_cplus_array_type (type, domain); type = build_cplus_array_type (type, domain);
*type_p = type; *type_p = type;
if (init) if (init)
TREE_TYPE (init) = type; TREE_TYPE (init) = type;
else else
init = error_mark_node; init = error_mark_node;
return init; return init;
} }
...@@ -3120,12 +3124,12 @@ cp_make_fname_decl (tree id, int type_dep) ...@@ -3120,12 +3124,12 @@ cp_make_fname_decl (tree id, int type_dep)
/* As we're using pushdecl_with_scope, we must set the context. */ /* As we're using pushdecl_with_scope, we must set the context. */
DECL_CONTEXT (decl) = current_function_decl; DECL_CONTEXT (decl) = current_function_decl;
DECL_PRETTY_FUNCTION_P (decl) = type_dep; DECL_PRETTY_FUNCTION_P (decl) = type_dep;
TREE_STATIC (decl) = 1; TREE_STATIC (decl) = 1;
TREE_READONLY (decl) = 1; TREE_READONLY (decl) = 1;
DECL_ARTIFICIAL (decl) = 1; DECL_ARTIFICIAL (decl) = 1;
DECL_INITIAL (decl) = init; DECL_INITIAL (decl) = init;
TREE_USED (decl) = 1; TREE_USED (decl) = 1;
if (current_function_decl) if (current_function_decl)
...@@ -3138,7 +3142,7 @@ cp_make_fname_decl (tree id, int type_dep) ...@@ -3138,7 +3142,7 @@ cp_make_fname_decl (tree id, int type_dep)
} }
else else
pushdecl_top_level_and_finish (decl, init); pushdecl_top_level_and_finish (decl, init);
return decl; return decl;
} }
...@@ -3424,7 +3428,7 @@ check_tag_decl (cp_decl_specifier_seq *declspecs) ...@@ -3424,7 +3428,7 @@ check_tag_decl (cp_decl_specifier_seq *declspecs)
} }
if (TYPE_P (declspecs->type) if (TYPE_P (declspecs->type)
&& ((TREE_CODE (declspecs->type) != TYPENAME_TYPE && ((TREE_CODE (declspecs->type) != TYPENAME_TYPE
&& IS_AGGR_TYPE (declspecs->type)) && IS_AGGR_TYPE (declspecs->type))
|| TREE_CODE (declspecs->type) == ENUMERAL_TYPE)) || TREE_CODE (declspecs->type) == ENUMERAL_TYPE))
declared_type = declspecs->type; declared_type = declspecs->type;
...@@ -3460,7 +3464,7 @@ check_tag_decl (cp_decl_specifier_seq *declspecs) ...@@ -3460,7 +3464,7 @@ check_tag_decl (cp_decl_specifier_seq *declspecs)
/* Anonymous unions are objects, so they can have specifiers. */; /* Anonymous unions are objects, so they can have specifiers. */;
SET_ANON_AGGR_TYPE_P (declared_type); SET_ANON_AGGR_TYPE_P (declared_type);
if (TREE_CODE (declared_type) != UNION_TYPE && pedantic if (TREE_CODE (declared_type) != UNION_TYPE && pedantic
&& !in_system_header) && !in_system_header)
pedwarn ("ISO C++ prohibits anonymous structs"); pedwarn ("ISO C++ prohibits anonymous structs");
} }
...@@ -3469,11 +3473,11 @@ check_tag_decl (cp_decl_specifier_seq *declspecs) ...@@ -3469,11 +3473,11 @@ check_tag_decl (cp_decl_specifier_seq *declspecs)
{ {
if (declspecs->specs[(int)ds_inline] if (declspecs->specs[(int)ds_inline]
|| declspecs->specs[(int)ds_virtual]) || declspecs->specs[(int)ds_virtual])
error ("`%s' can only be specified for functions", error ("`%s' can only be specified for functions",
declspecs->specs[(int)ds_inline] declspecs->specs[(int)ds_inline]
? "inline" : "virtual"); ? "inline" : "virtual");
else if (saw_friend else if (saw_friend
&& (!current_class_type && (!current_class_type
|| current_scope () != current_class_type)) || current_scope () != current_class_type))
error ("`friend' can only be specified inside a class"); error ("`friend' can only be specified inside a class");
else if (declspecs->specs[(int)ds_explicit]) else if (declspecs->specs[(int)ds_explicit])
...@@ -3501,7 +3505,7 @@ check_tag_decl (cp_decl_specifier_seq *declspecs) ...@@ -3501,7 +3505,7 @@ check_tag_decl (cp_decl_specifier_seq *declspecs)
Otherwise, it is an error. Otherwise, it is an error.
C++: may have to grok the declspecs to learn about static, C++: may have to grok the declspecs to learn about static,
complain for anonymous unions. complain for anonymous unions.
Returns the TYPE declared -- or NULL_TREE if none. */ Returns the TYPE declared -- or NULL_TREE if none. */
...@@ -3526,7 +3530,7 @@ shadow_tag (cp_decl_specifier_seq *declspecs) ...@@ -3526,7 +3530,7 @@ shadow_tag (cp_decl_specifier_seq *declspecs)
if (TYPE_FIELDS (t)) if (TYPE_FIELDS (t))
{ {
tree decl = grokdeclarator (/*declarator=*/NULL, tree decl = grokdeclarator (/*declarator=*/NULL,
declspecs, NORMAL, 0, NULL); declspecs, NORMAL, 0, NULL);
finish_anon_union (decl); finish_anon_union (decl);
} }
...@@ -3538,7 +3542,7 @@ shadow_tag (cp_decl_specifier_seq *declspecs) ...@@ -3538,7 +3542,7 @@ shadow_tag (cp_decl_specifier_seq *declspecs)
/* Decode a "typename", such as "int **", returning a ..._TYPE node. */ /* Decode a "typename", such as "int **", returning a ..._TYPE node. */
tree tree
groktypename (cp_decl_specifier_seq *type_specifiers, groktypename (cp_decl_specifier_seq *type_specifiers,
const cp_declarator *declarator) const cp_declarator *declarator)
{ {
tree attrs; tree attrs;
...@@ -3567,10 +3571,10 @@ groktypename (cp_decl_specifier_seq *type_specifiers, ...@@ -3567,10 +3571,10 @@ groktypename (cp_decl_specifier_seq *type_specifiers,
grokfield and not through here. */ grokfield and not through here. */
tree tree
start_decl (const cp_declarator *declarator, start_decl (const cp_declarator *declarator,
cp_decl_specifier_seq *declspecs, cp_decl_specifier_seq *declspecs,
int initialized, int initialized,
tree attributes, tree attributes,
tree prefix_attributes) tree prefix_attributes)
{ {
tree decl; tree decl;
...@@ -3955,10 +3959,10 @@ layout_var_decl (tree decl) ...@@ -3955,10 +3959,10 @@ layout_var_decl (tree decl)
`extern X x' for some incomplete type `X'.) */ `extern X x' for some incomplete type `X'.) */
if (!DECL_EXTERNAL (decl)) if (!DECL_EXTERNAL (decl))
complete_type (type); complete_type (type);
if (!DECL_SIZE (decl) if (!DECL_SIZE (decl)
&& TREE_TYPE (decl) != error_mark_node && TREE_TYPE (decl) != error_mark_node
&& (COMPLETE_TYPE_P (type) && (COMPLETE_TYPE_P (type)
|| (TREE_CODE (type) == ARRAY_TYPE || (TREE_CODE (type) == ARRAY_TYPE
&& !TYPE_DOMAIN (type) && !TYPE_DOMAIN (type)
&& COMPLETE_TYPE_P (TREE_TYPE (type))))) && COMPLETE_TYPE_P (TREE_TYPE (type)))))
layout_decl (decl, 0); layout_decl (decl, 0);
...@@ -4015,7 +4019,7 @@ maybe_commonize_var (tree decl) ...@@ -4015,7 +4019,7 @@ maybe_commonize_var (tree decl)
&& DECL_FUNCTION_SCOPE_P (decl) && DECL_FUNCTION_SCOPE_P (decl)
/* Unfortunately, import_export_decl has not always been called /* Unfortunately, import_export_decl has not always been called
before the function is processed, so we cannot simply check before the function is processed, so we cannot simply check
DECL_COMDAT. */ DECL_COMDAT. */
&& (DECL_COMDAT (DECL_CONTEXT (decl)) && (DECL_COMDAT (DECL_CONTEXT (decl))
|| ((DECL_DECLARED_INLINE_P (DECL_CONTEXT (decl)) || ((DECL_DECLARED_INLINE_P (DECL_CONTEXT (decl))
|| DECL_TEMPLATE_INSTANTIATION (DECL_CONTEXT (decl))) || DECL_TEMPLATE_INSTANTIATION (DECL_CONTEXT (decl)))
...@@ -4098,7 +4102,7 @@ next_initializable_field (tree field) ...@@ -4098,7 +4102,7 @@ next_initializable_field (tree field)
*INITP is one of a list of initializers describing a brace-enclosed *INITP is one of a list of initializers describing a brace-enclosed
initializer for an entity of the indicated aggregate TYPE. It may initializer for an entity of the indicated aggregate TYPE. It may
not presently match the shape of the TYPE; for example: not presently match the shape of the TYPE; for example:
struct S { int a; int b; }; struct S { int a; int b; };
struct S a[] = { 1, 2, 3, 4 }; struct S a[] = { 1, 2, 3, 4 };
...@@ -4157,7 +4161,7 @@ reshape_init (tree type, tree *initp) ...@@ -4157,7 +4161,7 @@ reshape_init (tree type, tree *initp)
else else
old_init = error_mark_node; old_init = error_mark_node;
} }
return old_init; return old_init;
} }
...@@ -4195,7 +4199,7 @@ reshape_init (tree type, tree *initp) ...@@ -4195,7 +4199,7 @@ reshape_init (tree type, tree *initp)
} }
else else
{ {
/* Build a CONSTRUCTOR to hold the contents of the aggregate. */ /* Build a CONSTRUCTOR to hold the contents of the aggregate. */
new_init = build_constructor (NULL_TREE, NULL_TREE); new_init = build_constructor (NULL_TREE, NULL_TREE);
if (CLASS_TYPE_P (type)) if (CLASS_TYPE_P (type))
...@@ -4207,7 +4211,7 @@ reshape_init (tree type, tree *initp) ...@@ -4207,7 +4211,7 @@ reshape_init (tree type, tree *initp)
if (!field) if (!field)
{ {
/* [dcl.init.aggr] /* [dcl.init.aggr]
An initializer for an aggregate member that is an An initializer for an aggregate member that is an
empty class shall have the form of an empty empty class shall have the form of an empty
initializer-list {}. */ initializer-list {}. */
...@@ -4245,7 +4249,7 @@ reshape_init (tree type, tree *initp) ...@@ -4245,7 +4249,7 @@ reshape_init (tree type, tree *initp)
return error_mark_node; return error_mark_node;
TREE_CHAIN (field_init) = CONSTRUCTOR_ELTS (new_init); TREE_CHAIN (field_init) = CONSTRUCTOR_ELTS (new_init);
CONSTRUCTOR_ELTS (new_init) = field_init; CONSTRUCTOR_ELTS (new_init) = field_init;
/* [dcl.init.aggr] /* [dcl.init.aggr]
When a union is initialized with a brace-enclosed When a union is initialized with a brace-enclosed
initializer, the braces shall only contain an initializer, the braces shall only contain an
...@@ -4355,7 +4359,7 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup) ...@@ -4355,7 +4359,7 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup)
if (type == error_mark_node) if (type == error_mark_node)
/* We will have already complained. */ /* We will have already complained. */
init = NULL_TREE; init = NULL_TREE;
else if (init && COMPLETE_TYPE_P (type) else if (init && COMPLETE_TYPE_P (type)
&& !TREE_CONSTANT (TYPE_SIZE (type))) && !TREE_CONSTANT (TYPE_SIZE (type)))
{ {
error ("variable-sized object `%D' may not be initialized", decl); error ("variable-sized object `%D' may not be initialized", decl);
...@@ -4387,7 +4391,7 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup) ...@@ -4387,7 +4391,7 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup)
init = grok_reference_init (decl, type, init, cleanup); init = grok_reference_init (decl, type, init, cleanup);
else if (init) else if (init)
{ {
if (TREE_CODE (init) == CONSTRUCTOR if (TREE_CODE (init) == CONSTRUCTOR
&& BRACE_ENCLOSED_INITIALIZER_P (init)) && BRACE_ENCLOSED_INITIALIZER_P (init))
{ {
/* [dcl.init] paragraph 13, /* [dcl.init] paragraph 13,
...@@ -4395,7 +4399,7 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup) ...@@ -4395,7 +4399,7 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup)
T x = { a }; T x = { a };
is equivalent to is equivalent to
T x = a; T x = a;
reshape_init will complain about the extra braces, reshape_init will complain about the extra braces,
and doesn't do anything useful in the case where TYPE is and doesn't do anything useful in the case where TYPE is
scalar, so just don't call it. */ scalar, so just don't call it. */
...@@ -4573,7 +4577,7 @@ initialize_local_var (tree decl, tree init) ...@@ -4573,7 +4577,7 @@ initialize_local_var (tree decl, tree init)
tree cleanup; tree cleanup;
my_friendly_assert (TREE_CODE (decl) == VAR_DECL my_friendly_assert (TREE_CODE (decl) == VAR_DECL
|| TREE_CODE (decl) == RESULT_DECL, || TREE_CODE (decl) == RESULT_DECL,
20021010); 20021010);
my_friendly_assert (!TREE_STATIC (decl), 20021010); my_friendly_assert (!TREE_STATIC (decl), 20021010);
...@@ -4662,7 +4666,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags) ...@@ -4662,7 +4666,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
/* If a name was specified, get the string. */ /* If a name was specified, get the string. */
if (global_scope_p (current_binding_level)) if (global_scope_p (current_binding_level))
asmspec_tree = maybe_apply_renaming_pragma (decl, asmspec_tree); asmspec_tree = maybe_apply_renaming_pragma (decl, asmspec_tree);
if (asmspec_tree) if (asmspec_tree)
asmspec = TREE_STRING_POINTER (asmspec_tree); asmspec = TREE_STRING_POINTER (asmspec_tree);
if (init && TREE_CODE (init) == NAMESPACE_DECL) if (init && TREE_CODE (init) == NAMESPACE_DECL)
...@@ -4740,7 +4744,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags) ...@@ -4740,7 +4744,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
if (TREE_CODE (decl) != FUNCTION_DECL) if (TREE_CODE (decl) != FUNCTION_DECL)
ttype = target_type (type); ttype = target_type (type);
/* Currently, GNU C++ puts constants in text space, making them /* Currently, GNU C++ puts constants in text space, making them
impossible to initialize. In the future, one would hope for impossible to initialize. In the future, one would hope for
an operating system which understood the difference between an operating system which understood the difference between
...@@ -4748,7 +4752,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags) ...@@ -4748,7 +4752,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
if (! DECL_EXTERNAL (decl) && TREE_READONLY (decl)) if (! DECL_EXTERNAL (decl) && TREE_READONLY (decl))
{ {
was_readonly = 1; was_readonly = 1;
if (TYPE_NEEDS_CONSTRUCTING (type) if (TYPE_NEEDS_CONSTRUCTING (type)
|| TREE_CODE (type) == REFERENCE_TYPE) || TREE_CODE (type) == REFERENCE_TYPE)
TREE_READONLY (decl) = 0; TREE_READONLY (decl) = 0;
} }
...@@ -4778,13 +4782,13 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags) ...@@ -4778,13 +4782,13 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
init = NULL_TREE; init = NULL_TREE;
} }
/* Handle: /* Handle:
[dcl.init] [dcl.init]
The memory occupied by any object of static storage The memory occupied by any object of static storage
duration is zero-initialized at program startup before duration is zero-initialized at program startup before
any other initialization takes place. any other initialization takes place.
We cannot create an appropriate initializer until after We cannot create an appropriate initializer until after
the type of DECL is finalized. If DECL_INITIAL is set, the type of DECL is finalized. If DECL_INITIAL is set,
then the DECL is statically initialized, and any then the DECL is statically initialized, and any
...@@ -4833,7 +4837,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags) ...@@ -4833,7 +4837,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
else else
abstract_virtuals_error (decl, type); abstract_virtuals_error (decl, type);
if (TREE_CODE (decl) == FUNCTION_DECL if (TREE_CODE (decl) == FUNCTION_DECL
|| TREE_TYPE (decl) == error_mark_node) || TREE_TYPE (decl) == error_mark_node)
/* No initialization required. */ /* No initialization required. */
; ;
...@@ -5117,7 +5121,7 @@ register_dtor_fn (tree decl) ...@@ -5117,7 +5121,7 @@ register_dtor_fn (tree decl)
to the original function, rather than the anonymous one. That to the original function, rather than the anonymous one. That
will make the back-end think that nested functions are in use, will make the back-end think that nested functions are in use,
which causes confusion. */ which causes confusion. */
push_deferring_access_checks (dk_no_check); push_deferring_access_checks (dk_no_check);
fcall = build_cleanup (decl); fcall = build_cleanup (decl);
pop_deferring_access_checks (); pop_deferring_access_checks ();
...@@ -5134,7 +5138,7 @@ register_dtor_fn (tree decl) ...@@ -5134,7 +5138,7 @@ register_dtor_fn (tree decl)
cleanup = build_unary_op (ADDR_EXPR, cleanup, 0); cleanup = build_unary_op (ADDR_EXPR, cleanup, 0);
if (flag_use_cxa_atexit) if (flag_use_cxa_atexit)
{ {
args = tree_cons (NULL_TREE, args = tree_cons (NULL_TREE,
build_unary_op (ADDR_EXPR, get_dso_handle_node (), 0), build_unary_op (ADDR_EXPR, get_dso_handle_node (), 0),
NULL_TREE); NULL_TREE);
args = tree_cons (NULL_TREE, null_pointer_node, args); args = tree_cons (NULL_TREE, null_pointer_node, args);
...@@ -5156,7 +5160,7 @@ expand_static_init (tree decl, tree init) ...@@ -5156,7 +5160,7 @@ expand_static_init (tree decl, tree init)
my_friendly_assert (TREE_STATIC (decl), 20021010); my_friendly_assert (TREE_STATIC (decl), 20021010);
/* Some variables require no initialization. */ /* Some variables require no initialization. */
if (!init if (!init
&& !TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl)) && !TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl))
&& TYPE_HAS_TRIVIAL_DESTRUCTOR (TREE_TYPE (decl))) && TYPE_HAS_TRIVIAL_DESTRUCTOR (TREE_TYPE (decl)))
return; return;
...@@ -5326,7 +5330,7 @@ complete_array_type (tree type, tree initial_value, int do_default) ...@@ -5326,7 +5330,7 @@ complete_array_type (tree type, tree initial_value, int do_default)
TYPE_NEEDS_CONSTRUCTING (type) TYPE_NEEDS_CONSTRUCTING (type)
= TYPE_NEEDS_CONSTRUCTING (TYPE_MAIN_VARIANT (elt_type)); = TYPE_NEEDS_CONSTRUCTING (TYPE_MAIN_VARIANT (elt_type));
TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type) TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)
= TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TYPE_MAIN_VARIANT (elt_type)); = TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TYPE_MAIN_VARIANT (elt_type));
} }
/* Lay out the type now that we can get the real answer. */ /* Lay out the type now that we can get the real answer. */
...@@ -5404,7 +5408,7 @@ bad_specifiers (tree object, ...@@ -5404,7 +5408,7 @@ bad_specifiers (tree object,
applicable error messages. */ applicable error messages. */
static tree static tree
grokfndecl (tree ctype, grokfndecl (tree ctype,
tree type, tree type,
tree declarator, tree declarator,
tree parms, tree parms,
...@@ -5413,11 +5417,11 @@ grokfndecl (tree ctype, ...@@ -5413,11 +5417,11 @@ grokfndecl (tree ctype,
enum overload_flags flags, enum overload_flags flags,
cp_cv_quals quals, cp_cv_quals quals,
tree raises, tree raises,
int check, int check,
int friendp, int friendp,
int publicp, int publicp,
int inlinep, int inlinep,
int funcdef_flag, int funcdef_flag,
int template_count, int template_count,
tree in_namespace) tree in_namespace)
{ {
...@@ -5701,7 +5705,7 @@ grokfndecl (tree ctype, ...@@ -5701,7 +5705,7 @@ grokfndecl (tree ctype,
return decl; return decl;
} }
/* Create a VAR_DECL named NAME with the indicated TYPE. /* Create a VAR_DECL named NAME with the indicated TYPE.
If SCOPE is non-NULL, it is the class type or namespace containing If SCOPE is non-NULL, it is the class type or namespace containing
the variable. If SCOPE is NULL, the variable should is created in the variable. If SCOPE is NULL, the variable should is created in
...@@ -5717,7 +5721,7 @@ grokvardecl (tree type, ...@@ -5717,7 +5721,7 @@ grokvardecl (tree type,
{ {
tree decl; tree decl;
my_friendly_assert (!name || TREE_CODE (name) == IDENTIFIER_NODE, my_friendly_assert (!name || TREE_CODE (name) == IDENTIFIER_NODE,
20020808); 20020808);
/* Compute the scope in which to place the variable. */ /* Compute the scope in which to place the variable. */
...@@ -5741,7 +5745,7 @@ grokvardecl (tree type, ...@@ -5741,7 +5745,7 @@ grokvardecl (tree type,
(TREE_CODE (scope) == NAMESPACE_DECL && processing_template_decl) (TREE_CODE (scope) == NAMESPACE_DECL && processing_template_decl)
/* Similarly for namespace-scope variables with language linkage /* Similarly for namespace-scope variables with language linkage
other than C++. */ other than C++. */
|| (TREE_CODE (scope) == NAMESPACE_DECL || (TREE_CODE (scope) == NAMESPACE_DECL
&& current_lang_name != lang_name_cplusplus) && current_lang_name != lang_name_cplusplus)
/* Similarly for static data members. */ /* Similarly for static data members. */
|| TYPE_P (scope))) || TYPE_P (scope)))
...@@ -5854,7 +5858,7 @@ build_ptrmemfunc_type (tree type) ...@@ -5854,7 +5858,7 @@ build_ptrmemfunc_type (tree type)
t = make_aggr_type (RECORD_TYPE); t = make_aggr_type (RECORD_TYPE);
xref_basetypes (t, NULL_TREE); xref_basetypes (t, NULL_TREE);
/* Let the front-end know this is a pointer to member function... */ /* Let the front-end know this is a pointer to member function... */
TYPE_PTRMEMFUNC_FLAG (t) = 1; TYPE_PTRMEMFUNC_FLAG (t) = 1;
/* ... and not really an aggregate. */ /* ... and not really an aggregate. */
...@@ -5862,11 +5866,11 @@ build_ptrmemfunc_type (tree type) ...@@ -5862,11 +5866,11 @@ build_ptrmemfunc_type (tree type)
field = build_decl (FIELD_DECL, pfn_identifier, type); field = build_decl (FIELD_DECL, pfn_identifier, type);
fields = field; fields = field;
field = build_decl (FIELD_DECL, delta_identifier, delta_type_node); field = build_decl (FIELD_DECL, delta_identifier, delta_type_node);
TREE_CHAIN (field) = fields; TREE_CHAIN (field) = fields;
fields = field; fields = field;
finish_builtin_struct (t, "__ptrmemfunc_type", fields, ptr_type_node); finish_builtin_struct (t, "__ptrmemfunc_type", fields, ptr_type_node);
/* Zap out the name so that the back-end will give us the debugging /* Zap out the name so that the back-end will give us the debugging
...@@ -5902,11 +5906,11 @@ build_ptrmem_type (tree class_type, tree member_type) ...@@ -5902,11 +5906,11 @@ build_ptrmem_type (tree class_type, tree member_type)
tree arg_types; tree arg_types;
arg_types = TYPE_ARG_TYPES (member_type); arg_types = TYPE_ARG_TYPES (member_type);
class_type = (cp_build_qualified_type class_type = (cp_build_qualified_type
(class_type, (class_type,
cp_type_quals (TREE_TYPE (TREE_VALUE (arg_types))))); cp_type_quals (TREE_TYPE (TREE_VALUE (arg_types)))));
member_type member_type
= build_method_type_directly (class_type, = build_method_type_directly (class_type,
TREE_TYPE (member_type), TREE_TYPE (member_type),
TREE_CHAIN (arg_types)); TREE_CHAIN (arg_types));
return build_ptrmemfunc_type (build_pointer_type (member_type)); return build_ptrmemfunc_type (build_pointer_type (member_type));
...@@ -6261,7 +6265,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -6261,7 +6265,7 @@ grokdeclarator (const cp_declarator *declarator,
int explicit_char = 0; int explicit_char = 0;
int defaulted_int = 0; int defaulted_int = 0;
tree dependant_name = NULL_TREE; tree dependant_name = NULL_TREE;
tree typedef_decl = NULL_TREE; tree typedef_decl = NULL_TREE;
const char *name = NULL; const char *name = NULL;
tree typedef_type = NULL_TREE; tree typedef_type = NULL_TREE;
...@@ -6298,7 +6302,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -6298,7 +6302,7 @@ grokdeclarator (const cp_declarator *declarator,
/* The NAMESPACE_DECL for the namespace in which this entity is /* The NAMESPACE_DECL for the namespace in which this entity is
located. If an unqualified name is used to declare the entity, located. If an unqualified name is used to declare the entity,
this value will be NULL_TREE, even if the entity is located at this value will be NULL_TREE, even if the entity is located at
namespace scope. */ namespace scope. */
tree in_namespace = NULL_TREE; tree in_namespace = NULL_TREE;
cp_decl_spec ds; cp_decl_spec ds;
cp_storage_class storage_class; cp_storage_class storage_class;
...@@ -6319,8 +6323,8 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -6319,8 +6323,8 @@ grokdeclarator (const cp_declarator *declarator,
/* Look inside a declarator for the name being declared /* Look inside a declarator for the name being declared
and get it as a string, for an error message. */ and get it as a string, for an error message. */
for (id_declarator = declarator; for (id_declarator = declarator;
id_declarator; id_declarator;
id_declarator = id_declarator->declarator) id_declarator = id_declarator->declarator)
{ {
if (id_declarator->kind != cdk_id) if (id_declarator->kind != cdk_id)
...@@ -6359,17 +6363,17 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -6359,17 +6363,17 @@ grokdeclarator (const cp_declarator *declarator,
Therefore, we do as well. */ Therefore, we do as well. */
if (qualifying_scope && TYPE_P (qualifying_scope)) if (qualifying_scope && TYPE_P (qualifying_scope))
{ {
ctype = TYPE_MAIN_VARIANT (qualifying_scope); ctype = TYPE_MAIN_VARIANT (qualifying_scope);
if (innermost_code != cdk_function if (innermost_code != cdk_function
&& current_class_type && current_class_type
&& !UNIQUELY_DERIVED_FROM_P (ctype, && !UNIQUELY_DERIVED_FROM_P (ctype,
current_class_type)) current_class_type))
{ {
error ("type `%T' is not derived from type `%T'", error ("type `%T' is not derived from type `%T'",
ctype, current_class_type); ctype, current_class_type);
ctype = NULL_TREE; ctype = NULL_TREE;
} }
TREE_OPERAND (decl, 0) = ctype; TREE_OPERAND (decl, 0) = ctype;
} }
else if (TREE_CODE (qualifying_scope) == NAMESPACE_DECL) else if (TREE_CODE (qualifying_scope) == NAMESPACE_DECL)
in_namespace = qualifying_scope; in_namespace = qualifying_scope;
...@@ -6528,12 +6532,12 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -6528,12 +6532,12 @@ grokdeclarator (const cp_declarator *declarator,
explicit_char = declspecs->explicit_char_p; explicit_char = declspecs->explicit_char_p;
/* Check for repeated decl-specifiers. */ /* Check for repeated decl-specifiers. */
for (ds = ds_first; ds != ds_last; ++ds) for (ds = ds_first; ds != ds_last; ++ds)
{ {
unsigned count = declspecs->specs[(int)ds]; unsigned count = declspecs->specs[(int)ds];
if (count < 2) if (count < 2)
continue; continue;
/* The "long" specifier is a special case because of /* The "long" specifier is a special case because of
"long long". */ "long long". */
if (ds == ds_long) if (ds == ds_long)
{ {
...@@ -6543,7 +6547,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -6543,7 +6547,7 @@ grokdeclarator (const cp_declarator *declarator,
pedwarn ("ISO C++ does not support `long long'"); pedwarn ("ISO C++ does not support `long long'");
else else
longlong = 1; longlong = 1;
} }
else if (declspecs->specs[(int)ds] > 1) else if (declspecs->specs[(int)ds] > 1)
{ {
static const char *const decl_spec_names[] = { static const char *const decl_spec_names[] = {
...@@ -6603,7 +6607,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -6603,7 +6607,7 @@ grokdeclarator (const cp_declarator *declarator,
type = integer_type_node; type = integer_type_node;
} }
ctype = NULL_TREE; ctype = NULL_TREE;
/* Now process the modifiers that were specified /* Now process the modifiers that were specified
...@@ -6743,7 +6747,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -6743,7 +6747,7 @@ grokdeclarator (const cp_declarator *declarator,
? tf_ignore_bad_quals : 0) | tf_error | tf_warning)); ? tf_ignore_bad_quals : 0) | tf_error | tf_warning));
/* We might have ignored or rejected some of the qualifiers. */ /* We might have ignored or rejected some of the qualifiers. */
type_quals = cp_type_quals (type); type_quals = cp_type_quals (type);
staticp = 0; staticp = 0;
inlinep = !! declspecs->specs[(int)ds_inline]; inlinep = !! declspecs->specs[(int)ds_inline];
virtualp = !! declspecs->specs[(int)ds_virtual]; virtualp = !! declspecs->specs[(int)ds_virtual];
...@@ -6797,7 +6801,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -6797,7 +6801,7 @@ grokdeclarator (const cp_declarator *declarator,
if (declspecs->multiple_storage_classes_p) if (declspecs->multiple_storage_classes_p)
error ("multiple storage classes in declaration of `%s'", name); error ("multiple storage classes in declaration of `%s'", name);
else if (thread_p else if (thread_p
&& ((storage_class && ((storage_class
&& storage_class != sc_extern && storage_class != sc_extern
&& storage_class != sc_static) && storage_class != sc_static)
|| declspecs->specs[(int)ds_typedef])) || declspecs->specs[(int)ds_typedef]))
...@@ -6805,7 +6809,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -6805,7 +6809,7 @@ grokdeclarator (const cp_declarator *declarator,
error ("multiple storage classes in declaration of `%s'", name); error ("multiple storage classes in declaration of `%s'", name);
thread_p = false; thread_p = false;
} }
else if (decl_context != NORMAL else if (decl_context != NORMAL
&& ((storage_class != sc_none && ((storage_class != sc_none
&& storage_class != sc_mutable) && storage_class != sc_mutable)
|| thread_p)) || thread_p))
...@@ -6863,7 +6867,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -6863,7 +6867,7 @@ grokdeclarator (const cp_declarator *declarator,
storage_class = sc_none; storage_class = sc_none;
} }
} }
else if (storage_class == sc_extern && initialized else if (storage_class == sc_extern && initialized
&& !funcdef_flag) && !funcdef_flag)
{ {
if (toplevel_bindings_p ()) if (toplevel_bindings_p ())
...@@ -6908,19 +6912,19 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -6908,19 +6912,19 @@ grokdeclarator (const cp_declarator *declarator,
switch (TREE_CODE (unqualified_id)) switch (TREE_CODE (unqualified_id))
{ {
case BIT_NOT_EXPR: case BIT_NOT_EXPR:
unqualified_id unqualified_id
= constructor_name (TREE_OPERAND (unqualified_id, 0)); = constructor_name (TREE_OPERAND (unqualified_id, 0));
break; break;
case TYPE_DECL: case TYPE_DECL:
unqualified_id unqualified_id
= constructor_name (TREE_TYPE (unqualified_id)); = constructor_name (TREE_TYPE (unqualified_id));
break; break;
case IDENTIFIER_NODE: case IDENTIFIER_NODE:
case TEMPLATE_ID_EXPR: case TEMPLATE_ID_EXPR:
break; break;
default: default:
abort (); abort ();
} }
...@@ -6928,7 +6932,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -6928,7 +6932,7 @@ grokdeclarator (const cp_declarator *declarator,
/* Determine the type of the entity declared by recurring on the /* Determine the type of the entity declared by recurring on the
declarator. */ declarator. */
for (; for (;
declarator && declarator->kind != cdk_id; declarator && declarator->kind != cdk_id;
declarator = declarator->declarator) declarator = declarator->declarator)
{ {
...@@ -6944,7 +6948,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -6944,7 +6948,7 @@ grokdeclarator (const cp_declarator *declarator,
if (attrs) if (attrs)
{ {
int attr_flags; int attr_flags;
attr_flags = 0; attr_flags = 0;
if (declarator == NULL || declarator->kind == cdk_id) if (declarator == NULL || declarator->kind == cdk_id)
attr_flags |= (int) ATTR_FLAG_DECL_NEXT; attr_flags |= (int) ATTR_FLAG_DECL_NEXT;
...@@ -6960,7 +6964,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -6960,7 +6964,7 @@ grokdeclarator (const cp_declarator *declarator,
switch (declarator->kind) switch (declarator->kind)
{ {
case cdk_array: case cdk_array:
type = create_array_type_for_decl (dname, type, type = create_array_type_for_decl (dname, type,
declarator->u.array.bounds); declarator->u.array.bounds);
if (inner_declarator if (inner_declarator
&& (inner_declarator->kind == cdk_pointer && (inner_declarator->kind == cdk_pointer
...@@ -7093,7 +7097,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -7093,7 +7097,7 @@ grokdeclarator (const cp_declarator *declarator,
name); name);
} }
arg_types = grokparms (declarator->u.function.parameters, arg_types = grokparms (declarator->u.function.parameters,
&parms); &parms);
if (inner_declarator if (inner_declarator
...@@ -7105,7 +7109,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -7105,7 +7109,7 @@ grokdeclarator (const cp_declarator *declarator,
arg_types = void_list_node; arg_types = void_list_node;
parms = NULL_TREE; parms = NULL_TREE;
} }
type = build_function_type (type, arg_types); type = build_function_type (type, arg_types);
} }
break; break;
...@@ -7140,7 +7144,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -7140,7 +7144,7 @@ grokdeclarator (const cp_declarator *declarator,
|| (quals && TREE_CODE (type) == METHOD_TYPE))) || (quals && TREE_CODE (type) == METHOD_TYPE)))
{ {
tree dummy = build_decl (TYPE_DECL, NULL_TREE, type); tree dummy = build_decl (TYPE_DECL, NULL_TREE, type);
grok_method_quals (declarator->u.pointer.class_type, grok_method_quals (declarator->u.pointer.class_type,
dummy, quals); dummy, quals);
type = TREE_TYPE (dummy); type = TREE_TYPE (dummy);
quals = TYPE_UNQUALIFIED; quals = TYPE_UNQUALIFIED;
...@@ -7154,7 +7158,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -7154,7 +7158,7 @@ grokdeclarator (const cp_declarator *declarator,
else if (TREE_CODE (type) == METHOD_TYPE) else if (TREE_CODE (type) == METHOD_TYPE)
type = build_ptrmemfunc_type (build_pointer_type (type)); type = build_ptrmemfunc_type (build_pointer_type (type));
else if (declarator->kind == cdk_ptrmem) else if (declarator->kind == cdk_ptrmem)
type = build_ptrmem_type (declarator->u.pointer.class_type, type = build_ptrmem_type (declarator->u.pointer.class_type,
type); type);
else else
type = build_pointer_type (type); type = build_pointer_type (type);
...@@ -7164,8 +7168,8 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -7164,8 +7168,8 @@ grokdeclarator (const cp_declarator *declarator,
if (declarator->u.pointer.qualifiers) if (declarator->u.pointer.qualifiers)
{ {
type type
= cp_build_qualified_type (type, = cp_build_qualified_type (type,
declarator->u.pointer.qualifiers); declarator->u.pointer.qualifiers);
type_quals = cp_type_quals (type); type_quals = cp_type_quals (type);
} }
...@@ -7179,19 +7183,19 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -7179,19 +7183,19 @@ grokdeclarator (const cp_declarator *declarator,
abort (); abort ();
} }
} }
if (unqualified_id && TREE_CODE (unqualified_id) == TEMPLATE_ID_EXPR if (unqualified_id && TREE_CODE (unqualified_id) == TEMPLATE_ID_EXPR
&& TREE_CODE (type) != FUNCTION_TYPE && TREE_CODE (type) != FUNCTION_TYPE
&& TREE_CODE (type) != METHOD_TYPE) && TREE_CODE (type) != METHOD_TYPE)
{ {
error ("template-id `%D' used as a declarator", error ("template-id `%D' used as a declarator",
unqualified_id); unqualified_id);
unqualified_id = dname; unqualified_id = dname;
} }
/* If DECLARATOR is non-NULL, we know it is a cdk_id declarator; /* If DECLARATOR is non-NULL, we know it is a cdk_id declarator;
otherwise, we would not have exited the loop above. */ otherwise, we would not have exited the loop above. */
if (declarator if (declarator
&& TREE_CODE (declarator->u.id.name) == SCOPE_REF && TREE_CODE (declarator->u.id.name) == SCOPE_REF
/* If the qualifying scope was invalid, it will have been set to /* If the qualifying scope was invalid, it will have been set to
NULL_TREE above. */ NULL_TREE above. */
...@@ -7248,8 +7252,8 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -7248,8 +7252,8 @@ grokdeclarator (const cp_declarator *declarator,
are always static functions. */ are always static functions. */
; ;
else if (current_class_type == NULL_TREE || friendp) else if (current_class_type == NULL_TREE || friendp)
type type
= build_method_type_directly (ctype, = build_method_type_directly (ctype,
TREE_TYPE (type), TREE_TYPE (type),
TYPE_ARG_TYPES (type)); TYPE_ARG_TYPES (type));
else else
...@@ -7304,7 +7308,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -7304,7 +7308,7 @@ grokdeclarator (const cp_declarator *declarator,
} }
if ((decl_context == FIELD || decl_context == PARM) if ((decl_context == FIELD || decl_context == PARM)
&& !processing_template_decl && !processing_template_decl
&& variably_modified_type_p (type, NULL_TREE)) && variably_modified_type_p (type, NULL_TREE))
{ {
if (decl_context == FIELD) if (decl_context == FIELD)
...@@ -7377,7 +7381,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -7377,7 +7381,7 @@ grokdeclarator (const cp_declarator *declarator,
if (!current_function_decl) if (!current_function_decl)
DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace); DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace);
} }
/* If the user declares "typedef struct {...} foo" then the /* If the user declares "typedef struct {...} foo" then the
struct will have an anonymous name. Fill that name in now. struct will have an anonymous name. Fill that name in now.
Nothing can refer to it, so nothing needs know about the name Nothing can refer to it, so nothing needs know about the name
...@@ -7432,7 +7436,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -7432,7 +7436,7 @@ grokdeclarator (const cp_declarator *declarator,
|| (typedef_decl && C_TYPEDEF_EXPLICITLY_SIGNED (typedef_decl))) || (typedef_decl && C_TYPEDEF_EXPLICITLY_SIGNED (typedef_decl)))
C_TYPEDEF_EXPLICITLY_SIGNED (decl) = 1; C_TYPEDEF_EXPLICITLY_SIGNED (decl) = 1;
bad_specifiers (decl, "type", virtualp, quals != TYPE_UNQUALIFIED, bad_specifiers (decl, "type", virtualp, quals != TYPE_UNQUALIFIED,
inlinep, friendp, raises != NULL_TREE); inlinep, friendp, raises != NULL_TREE);
return decl; return decl;
...@@ -7450,7 +7454,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -7450,7 +7454,7 @@ grokdeclarator (const cp_declarator *declarator,
/* Detect where we're using a typedef of function type to declare a /* Detect where we're using a typedef of function type to declare a
function. PARMS will not be set, so we must create it now. */ function. PARMS will not be set, so we must create it now. */
if (type == typedef_type && TREE_CODE (type) == FUNCTION_TYPE) if (type == typedef_type && TREE_CODE (type) == FUNCTION_TYPE)
{ {
tree decls = NULL_TREE; tree decls = NULL_TREE;
...@@ -7463,7 +7467,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -7463,7 +7467,7 @@ grokdeclarator (const cp_declarator *declarator,
TREE_CHAIN (decl) = decls; TREE_CHAIN (decl) = decls;
decls = decl; decls = decl;
} }
parms = nreverse (decls); parms = nreverse (decls);
} }
...@@ -7668,7 +7672,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -7668,7 +7672,7 @@ grokdeclarator (const cp_declarator *declarator,
} }
} }
else if (staticp < 2) else if (staticp < 2)
type = build_method_type_directly (ctype, type = build_method_type_directly (ctype,
TREE_TYPE (type), TREE_TYPE (type),
TYPE_ARG_TYPES (type)); TYPE_ARG_TYPES (type));
} }
...@@ -7784,7 +7788,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -7784,7 +7788,7 @@ grokdeclarator (const cp_declarator *declarator,
if (decl == error_mark_node) if (decl == error_mark_node)
return error_mark_node; return error_mark_node;
} }
decl = do_friend (ctype, unqualified_id, decl, decl = do_friend (ctype, unqualified_id, decl,
*attrlist, flags, quals, funcdef_flag); *attrlist, flags, quals, funcdef_flag);
return decl; return decl;
...@@ -7901,7 +7905,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -7901,7 +7905,7 @@ grokdeclarator (const cp_declarator *declarator,
} }
else if (TREE_CODE (type) == FUNCTION_TYPE && staticp < 2 else if (TREE_CODE (type) == FUNCTION_TYPE && staticp < 2
&& !NEW_DELETE_OPNAME_P (original_name)) && !NEW_DELETE_OPNAME_P (original_name))
type = build_method_type_directly (ctype, type = build_method_type_directly (ctype,
TREE_TYPE (type), TREE_TYPE (type),
TYPE_ARG_TYPES (type)); TYPE_ARG_TYPES (type));
...@@ -7948,7 +7952,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -7948,7 +7952,7 @@ grokdeclarator (const cp_declarator *declarator,
/* It's a variable. */ /* It's a variable. */
/* An uninitialized decl with `extern' is a reference. */ /* An uninitialized decl with `extern' is a reference. */
decl = grokvardecl (type, unqualified_id, decl = grokvardecl (type, unqualified_id,
declspecs, declspecs,
initialized, initialized,
(type_quals & TYPE_QUAL_CONST) != 0, (type_quals & TYPE_QUAL_CONST) != 0,
...@@ -8273,7 +8277,7 @@ copy_fn_p (tree d) ...@@ -8273,7 +8277,7 @@ copy_fn_p (tree d)
tree args; tree args;
tree arg_type; tree arg_type;
int result = 1; int result = 1;
my_friendly_assert (DECL_FUNCTION_MEMBER_P (d), 20011208); my_friendly_assert (DECL_FUNCTION_MEMBER_P (d), 20011208);
if (DECL_TEMPLATE_INFO (d) && is_member_template (DECL_TI_TEMPLATE (d))) if (DECL_TEMPLATE_INFO (d) && is_member_template (DECL_TI_TEMPLATE (d)))
...@@ -8282,7 +8286,7 @@ copy_fn_p (tree d) ...@@ -8282,7 +8286,7 @@ copy_fn_p (tree d)
represented as template functions internally, and we must represented as template functions internally, and we must
accept those as copy functions. */ accept those as copy functions. */
return 0; return 0;
args = FUNCTION_FIRST_USER_PARMTYPE (d); args = FUNCTION_FIRST_USER_PARMTYPE (d);
if (!args) if (!args)
return 0; return 0;
...@@ -8302,7 +8306,7 @@ copy_fn_p (tree d) ...@@ -8302,7 +8306,7 @@ copy_fn_p (tree d)
} }
else else
return 0; return 0;
args = TREE_CHAIN (args); args = TREE_CHAIN (args);
if (args && args != void_list_node && !TREE_PURPOSE (args)) if (args && args != void_list_node && !TREE_PURPOSE (args))
...@@ -8321,11 +8325,11 @@ void grok_special_member_properties (tree decl) ...@@ -8321,11 +8325,11 @@ void grok_special_member_properties (tree decl)
else if (DECL_CONSTRUCTOR_P (decl)) else if (DECL_CONSTRUCTOR_P (decl))
{ {
int ctor = copy_fn_p (decl); int ctor = copy_fn_p (decl);
if (ctor > 0) if (ctor > 0)
{ {
/* [class.copy] /* [class.copy]
A non-template constructor for class X is a copy A non-template constructor for class X is a copy
constructor if its first parameter is of type X&, const constructor if its first parameter is of type X&, const
X&, volatile X& or const volatile X&, and either there X&, volatile X& or const volatile X&, and either there
...@@ -8341,13 +8345,13 @@ void grok_special_member_properties (tree decl) ...@@ -8341,13 +8345,13 @@ void grok_special_member_properties (tree decl)
else if (DECL_OVERLOADED_OPERATOR_P (decl) == NOP_EXPR) else if (DECL_OVERLOADED_OPERATOR_P (decl) == NOP_EXPR)
{ {
/* [class.copy] /* [class.copy]
A non-template assignment operator for class X is a copy A non-template assignment operator for class X is a copy
assignment operator if its parameter is of type X, X&, const assignment operator if its parameter is of type X, X&, const
X&, volatile X& or const volatile X&. */ X&, volatile X& or const volatile X&. */
int assop = copy_fn_p (decl); int assop = copy_fn_p (decl);
if (assop) if (assop)
{ {
TYPE_HAS_ASSIGN_REF (DECL_CONTEXT (decl)) = 1; TYPE_HAS_ASSIGN_REF (DECL_CONTEXT (decl)) = 1;
...@@ -8368,12 +8372,12 @@ grok_ctor_properties (tree ctype, tree decl) ...@@ -8368,12 +8372,12 @@ grok_ctor_properties (tree ctype, tree decl)
if (ctor_parm < 0) if (ctor_parm < 0)
{ {
/* [class.copy] /* [class.copy]
A declaration of a constructor for a class X is ill-formed if A declaration of a constructor for a class X is ill-formed if
its first parameter is of type (optionally cv-qualified) X its first parameter is of type (optionally cv-qualified) X
and either there are no other parameters or else all other and either there are no other parameters or else all other
parameters have default arguments. parameters have default arguments.
We *don't* complain about member template instantiations that We *don't* complain about member template instantiations that
have this form, though; they can occur as we try to decide have this form, though; they can occur as we try to decide
what constructor to use during overload resolution. Since what constructor to use during overload resolution. Since
...@@ -8386,7 +8390,7 @@ grok_ctor_properties (tree ctype, tree decl) ...@@ -8386,7 +8390,7 @@ grok_ctor_properties (tree ctype, tree decl)
ctype, ctype); ctype, ctype);
return 0; return 0;
} }
return 1; return 1;
} }
...@@ -8791,7 +8795,7 @@ check_elaborated_type_specifier (enum tag_types tag_code, ...@@ -8791,7 +8795,7 @@ check_elaborated_type_specifier (enum tag_types tag_code,
type = TREE_TYPE (decl); type = TREE_TYPE (decl);
/* [dcl.type.elab] /* [dcl.type.elab]
If the identifier resolves to a typedef-name or a template If the identifier resolves to a typedef-name or a template
type-parameter, the elaborated-type-specifier is ill-formed. type-parameter, the elaborated-type-specifier is ill-formed.
...@@ -8804,7 +8808,7 @@ check_elaborated_type_specifier (enum tag_types tag_code, ...@@ -8804,7 +8808,7 @@ check_elaborated_type_specifier (enum tag_types tag_code,
error ("using typedef-name `%D' after `%s'", decl, tag_name (tag_code)); error ("using typedef-name `%D' after `%s'", decl, tag_name (tag_code));
return IS_AGGR_TYPE (type) ? type : error_mark_node; return IS_AGGR_TYPE (type) ? type : error_mark_node;
} }
if (TREE_CODE (type) == TEMPLATE_TYPE_PARM) if (TREE_CODE (type) == TEMPLATE_TYPE_PARM)
{ {
error ("using template type parameter `%T' after `%s'", error ("using template type parameter `%T' after `%s'",
...@@ -8995,7 +8999,7 @@ xref_tag (enum tag_types tag_code, tree name, ...@@ -8995,7 +8999,7 @@ xref_tag (enum tag_types tag_code, tree name,
{ {
if (!globalize && processing_template_decl && IS_AGGR_TYPE (t)) if (!globalize && processing_template_decl && IS_AGGR_TYPE (t))
redeclare_class_template (t, current_template_parms); redeclare_class_template (t, current_template_parms);
else if (!processing_template_decl else if (!processing_template_decl
&& CLASS_TYPE_P (t) && CLASS_TYPE_P (t)
&& CLASSTYPE_IS_TEMPLATE (t)) && CLASSTYPE_IS_TEMPLATE (t))
{ {
...@@ -9052,11 +9056,11 @@ xref_basetypes (tree ref, tree base_list) ...@@ -9052,11 +9056,11 @@ xref_basetypes (tree ref, tree base_list)
instantiated. This ensures that if we call ourselves recursively instantiated. This ensures that if we call ourselves recursively
we do not get confused about which classes are marked and which we do not get confused about which classes are marked and which
are not. */ are not. */
basep = &base_list; basep = &base_list;
while (*basep) while (*basep)
{ {
tree basetype = TREE_VALUE (*basep); tree basetype = TREE_VALUE (*basep);
if (!(processing_template_decl && uses_template_parms (basetype)) if (!(processing_template_decl && uses_template_parms (basetype))
&& !complete_type_or_else (basetype, NULL)) && !complete_type_or_else (basetype, NULL))
/* An incomplete type. Remove it from the list. */ /* An incomplete type. Remove it from the list. */
...@@ -9078,33 +9082,34 @@ xref_basetypes (tree ref, tree base_list) ...@@ -9078,33 +9082,34 @@ xref_basetypes (tree ref, tree base_list)
redefinition. */ redefinition. */
my_friendly_assert (!TYPE_BINFO (ref) || TYPE_SIZE (ref), 20040706); my_friendly_assert (!TYPE_BINFO (ref) || TYPE_SIZE (ref), 20040706);
my_friendly_assert (TYPE_MAIN_VARIANT (ref) == ref, 20040712); my_friendly_assert (TYPE_MAIN_VARIANT (ref) == ref, 20040712);
binfo = make_tree_binfo (max_bases); binfo = make_tree_binfo (max_bases);
TYPE_BINFO (ref) = binfo; TYPE_BINFO (ref) = binfo;
BINFO_OFFSET (binfo) = size_zero_node; BINFO_OFFSET (binfo) = size_zero_node;
BINFO_TYPE (binfo) = ref; BINFO_TYPE (binfo) = ref;
if (max_bases) if (max_bases)
{ {
BINFO_BASE_ACCESSES (binfo) = make_tree_vec (max_bases); BINFO_BASE_ACCESSES (binfo) = make_tree_vec (max_bases);
/* An aggregate cannot have baseclasses. */ /* An aggregate cannot have baseclasses. */
CLASSTYPE_NON_AGGREGATE (ref) = 1; CLASSTYPE_NON_AGGREGATE (ref) = 1;
if (TREE_CODE (ref) == UNION_TYPE) if (TREE_CODE (ref) == UNION_TYPE)
error ("derived union `%T' invalid", ref); error ("derived union `%T' invalid", ref);
} }
if (max_bases > 1) if (max_bases > 1)
{ {
TYPE_USES_MULTIPLE_INHERITANCE (ref) = 1; TYPE_USES_MULTIPLE_INHERITANCE (ref) = 1;
/* If there is more than one non-empty they cannot be at the /* If there is more than one non-empty they cannot be at the
same address. */ same address. */
TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P (ref) = 1; TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P (ref) = 1;
if (TYPE_FOR_JAVA (ref)) if (TYPE_FOR_JAVA (ref))
error ("Java class '%T' cannot have multiple bases", ref); error ("Java class '%T' cannot have multiple bases", ref);
} }
if (max_vbases) if (max_vbases)
{ {
CLASSTYPE_VBASECLASSES (ref) = VEC_alloc (tree, max_vbases); CLASSTYPE_VBASECLASSES (ref) = VEC_alloc (tree, max_vbases);
...@@ -9112,7 +9117,7 @@ xref_basetypes (tree ref, tree base_list) ...@@ -9112,7 +9117,7 @@ xref_basetypes (tree ref, tree base_list)
/* Converting to a virtual base class requires looking up the /* Converting to a virtual base class requires looking up the
offset of the virtual base. */ offset of the virtual base. */
TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P (ref) = 1; TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P (ref) = 1;
if (TYPE_FOR_JAVA (ref)) if (TYPE_FOR_JAVA (ref))
error ("Java class '%T' cannot have virtual bases", ref); error ("Java class '%T' cannot have virtual bases", ref);
} }
...@@ -9122,10 +9127,10 @@ xref_basetypes (tree ref, tree base_list) ...@@ -9122,10 +9127,10 @@ xref_basetypes (tree ref, tree base_list)
tree access = TREE_PURPOSE (base_list); tree access = TREE_PURPOSE (base_list);
int via_virtual = TREE_TYPE (base_list) != NULL_TREE; int via_virtual = TREE_TYPE (base_list) != NULL_TREE;
tree basetype = TREE_VALUE (base_list); tree basetype = TREE_VALUE (base_list);
if (access == access_default_node) if (access == access_default_node)
access = default_access; access = default_access;
if (TREE_CODE (basetype) == TYPE_DECL) if (TREE_CODE (basetype) == TYPE_DECL)
basetype = TREE_TYPE (basetype); basetype = TREE_TYPE (basetype);
if (TREE_CODE (basetype) != RECORD_TYPE if (TREE_CODE (basetype) != RECORD_TYPE
...@@ -9137,7 +9142,7 @@ xref_basetypes (tree ref, tree base_list) ...@@ -9137,7 +9142,7 @@ xref_basetypes (tree ref, tree base_list)
basetype); basetype);
continue; continue;
} }
if (CLASSTYPE_MARKED (basetype)) if (CLASSTYPE_MARKED (basetype))
{ {
if (basetype == ref) if (basetype == ref)
...@@ -9147,7 +9152,7 @@ xref_basetypes (tree ref, tree base_list) ...@@ -9147,7 +9152,7 @@ xref_basetypes (tree ref, tree base_list)
continue; continue;
} }
SET_CLASSTYPE_MARKED (basetype); SET_CLASSTYPE_MARKED (basetype);
if (TYPE_FOR_JAVA (basetype) && (current_lang_depth () == 0)) if (TYPE_FOR_JAVA (basetype) && (current_lang_depth () == 0))
TYPE_FOR_JAVA (ref) = 1; TYPE_FOR_JAVA (ref) = 1;
...@@ -9157,7 +9162,7 @@ xref_basetypes (tree ref, tree base_list) ...@@ -9157,7 +9162,7 @@ xref_basetypes (tree ref, tree base_list)
base_binfo = TYPE_BINFO (basetype); base_binfo = TYPE_BINFO (basetype);
/* The orignal basetype could have been a typedef'd type. */ /* The orignal basetype could have been a typedef'd type. */
basetype = BINFO_TYPE (base_binfo); basetype = BINFO_TYPE (base_binfo);
/* Inherit flags from the base. */ /* Inherit flags from the base. */
TYPE_HAS_NEW_OPERATOR (ref) TYPE_HAS_NEW_OPERATOR (ref)
|= TYPE_HAS_NEW_OPERATOR (basetype); |= TYPE_HAS_NEW_OPERATOR (basetype);
...@@ -9170,7 +9175,7 @@ xref_basetypes (tree ref, tree base_list) ...@@ -9170,7 +9175,7 @@ xref_basetypes (tree ref, tree base_list)
|= TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P (basetype); |= TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P (basetype);
TYPE_HAS_CONVERSION (ref) |= TYPE_HAS_CONVERSION (basetype); TYPE_HAS_CONVERSION (ref) |= TYPE_HAS_CONVERSION (basetype);
} }
base_binfo = copy_binfo (base_binfo, basetype, ref, base_binfo = copy_binfo (base_binfo, basetype, ref,
&igo_prev, via_virtual); &igo_prev, via_virtual);
if (!BINFO_INHERITANCE_CHAIN (base_binfo)) if (!BINFO_INHERITANCE_CHAIN (base_binfo))
...@@ -9186,7 +9191,7 @@ xref_basetypes (tree ref, tree base_list) ...@@ -9186,7 +9191,7 @@ xref_basetypes (tree ref, tree base_list)
slots. */ slots. */
TREE_VEC_LENGTH (BINFO_BASE_ACCESSES (binfo)) TREE_VEC_LENGTH (BINFO_BASE_ACCESSES (binfo))
= BINFO_N_BASE_BINFOS (binfo); = BINFO_N_BASE_BINFOS (binfo);
/* Unmark all the types. */ /* Unmark all the types. */
for (i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); i++) for (i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); i++)
CLEAR_CLASSTYPE_MARKED (BINFO_TYPE (base_binfo)); CLEAR_CLASSTYPE_MARKED (BINFO_TYPE (base_binfo));
...@@ -9244,7 +9249,7 @@ finish_enum (tree enumtype) ...@@ -9244,7 +9249,7 @@ finish_enum (tree enumtype)
tree t; tree t;
bool unsignedp; bool unsignedp;
int lowprec; int lowprec;
int highprec; int highprec;
int precision; int precision;
integer_type_kind itk; integer_type_kind itk;
tree underlying_type = NULL_TREE; tree underlying_type = NULL_TREE;
...@@ -9258,8 +9263,8 @@ finish_enum (tree enumtype) ...@@ -9258,8 +9263,8 @@ finish_enum (tree enumtype)
works. */ works. */
if (processing_template_decl) if (processing_template_decl)
{ {
for (values = TYPE_VALUES (enumtype); for (values = TYPE_VALUES (enumtype);
values; values;
values = TREE_CHAIN (values)) values = TREE_CHAIN (values))
TREE_TYPE (TREE_VALUE (values)) = enumtype; TREE_TYPE (TREE_VALUE (values)) = enumtype;
if (at_function_scope_p ()) if (at_function_scope_p ())
...@@ -9272,8 +9277,8 @@ finish_enum (tree enumtype) ...@@ -9272,8 +9277,8 @@ finish_enum (tree enumtype)
{ {
minnode = maxnode = NULL_TREE; minnode = maxnode = NULL_TREE;
for (values = TYPE_VALUES (enumtype); for (values = TYPE_VALUES (enumtype);
values; values;
values = TREE_CHAIN (values)) values = TREE_CHAIN (values))
{ {
decl = TREE_VALUE (values); decl = TREE_VALUE (values);
...@@ -9331,13 +9336,13 @@ finish_enum (tree enumtype) ...@@ -9331,13 +9336,13 @@ finish_enum (tree enumtype)
enumeration. It is implementation-defined which integral type is enumeration. It is implementation-defined which integral type is
used as the underlying type for an enumeration except that the used as the underlying type for an enumeration except that the
underlying type shall not be larger than int unless the value of underlying type shall not be larger than int unless the value of
an enumerator cannot fit in an int or unsigned int. an enumerator cannot fit in an int or unsigned int.
We use "int" or an "unsigned int" as the underlying type, even if We use "int" or an "unsigned int" as the underlying type, even if
a smaller integral type would work, unless the user has a smaller integral type would work, unless the user has
explicitly requested that we use the smallest possible type. */ explicitly requested that we use the smallest possible type. */
for (itk = (flag_short_enums ? itk_char : itk_int); for (itk = (flag_short_enums ? itk_char : itk_int);
itk != itk_none; itk != itk_none;
itk++) itk++)
{ {
underlying_type = integer_types[itk]; underlying_type = integer_types[itk];
...@@ -9357,7 +9362,7 @@ finish_enum (tree enumtype) ...@@ -9357,7 +9362,7 @@ finish_enum (tree enumtype)
underlying_type = integer_types[itk_unsigned_long_long]; underlying_type = integer_types[itk_unsigned_long_long];
} }
/* Compute the minium and maximum values for the type. /* Compute the minium and maximum values for the type.
[dcl.enum] [dcl.enum]
...@@ -9370,7 +9375,7 @@ finish_enum (tree enumtype) ...@@ -9370,7 +9375,7 @@ finish_enum (tree enumtype)
set_min_and_max_values_for_integral_type (enumtype, precision, unsignedp); set_min_and_max_values_for_integral_type (enumtype, precision, unsignedp);
/* [dcl.enum] /* [dcl.enum]
The value of sizeof() applied to an enumeration type, an object The value of sizeof() applied to an enumeration type, an object
of an enumeration type, or an enumerator, is the value of sizeof() of an enumeration type, or an enumerator, is the value of sizeof()
applied to the underlying type. */ applied to the underlying type. */
...@@ -9591,13 +9596,13 @@ start_preparsed_function (tree decl1, tree attrs, int flags) ...@@ -9591,13 +9596,13 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
fntype = TREE_TYPE (decl1); fntype = TREE_TYPE (decl1);
if (TREE_CODE (fntype) == METHOD_TYPE) if (TREE_CODE (fntype) == METHOD_TYPE)
ctype = TYPE_METHOD_BASETYPE (fntype); ctype = TYPE_METHOD_BASETYPE (fntype);
/* ISO C++ 11.4/5. A friend function defined in a class is in /* ISO C++ 11.4/5. A friend function defined in a class is in
the (lexical) scope of the class in which it is defined. */ the (lexical) scope of the class in which it is defined. */
if (!ctype && DECL_FRIEND_P (decl1)) if (!ctype && DECL_FRIEND_P (decl1))
{ {
ctype = DECL_FRIEND_CONTEXT (decl1); ctype = DECL_FRIEND_CONTEXT (decl1);
/* CTYPE could be null here if we're dealing with a template; /* CTYPE could be null here if we're dealing with a template;
for example, `inline friend float foo()' inside a template for example, `inline friend float foo()' inside a template
will have no CTYPE set. */ will have no CTYPE set. */
...@@ -9718,7 +9723,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags) ...@@ -9718,7 +9723,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
{ {
/* A specialization is not used to guide overload resolution. */ /* A specialization is not used to guide overload resolution. */
if (!DECL_FUNCTION_MEMBER_P (decl1) if (!DECL_FUNCTION_MEMBER_P (decl1)
&& !(DECL_USE_TEMPLATE (decl1) && && !(DECL_USE_TEMPLATE (decl1) &&
PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (decl1)))) PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (decl1))))
{ {
tree olddecl = pushdecl (decl1); tree olddecl = pushdecl (decl1);
...@@ -9805,13 +9810,13 @@ start_preparsed_function (tree decl1, tree attrs, int flags) ...@@ -9805,13 +9810,13 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
else if (interface_unknown == 0 else if (interface_unknown == 0
&& ! DECL_TEMPLATE_INSTANTIATION (decl1)) && ! DECL_TEMPLATE_INSTANTIATION (decl1))
{ {
if (DECL_DECLARED_INLINE_P (decl1) if (DECL_DECLARED_INLINE_P (decl1)
|| DECL_TEMPLATE_INSTANTIATION (decl1) || DECL_TEMPLATE_INSTANTIATION (decl1)
|| processing_template_decl) || processing_template_decl)
{ {
DECL_EXTERNAL (decl1) DECL_EXTERNAL (decl1)
= (interface_only = (interface_only
|| (DECL_DECLARED_INLINE_P (decl1) || (DECL_DECLARED_INLINE_P (decl1)
&& ! flag_implement_inlines && ! flag_implement_inlines
&& !DECL_VINDEX (decl1))); && !DECL_VINDEX (decl1)));
...@@ -9842,7 +9847,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags) ...@@ -9842,7 +9847,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
So clear DECL_EXTERNAL. */ So clear DECL_EXTERNAL. */
DECL_EXTERNAL (decl1) = 0; DECL_EXTERNAL (decl1) = 0;
if ((DECL_DECLARED_INLINE_P (decl1) if ((DECL_DECLARED_INLINE_P (decl1)
|| DECL_TEMPLATE_INSTANTIATION (decl1)) || DECL_TEMPLATE_INSTANTIATION (decl1))
&& ! DECL_INTERFACE_KNOWN (decl1) && ! DECL_INTERFACE_KNOWN (decl1)
/* Don't try to defer nested functions for now. */ /* Don't try to defer nested functions for now. */
...@@ -9863,7 +9868,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags) ...@@ -9863,7 +9868,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
} }
start_fname_decls (); start_fname_decls ();
store_parm_decls (current_function_parms); store_parm_decls (current_function_parms);
} }
...@@ -9876,7 +9881,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags) ...@@ -9876,7 +9881,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
yyparse to report a parse error. */ yyparse to report a parse error. */
int int
start_function (cp_decl_specifier_seq *declspecs, start_function (cp_decl_specifier_seq *declspecs,
const cp_declarator *declarator, const cp_declarator *declarator,
tree attrs) tree attrs)
{ {
...@@ -9888,19 +9893,19 @@ start_function (cp_decl_specifier_seq *declspecs, ...@@ -9888,19 +9893,19 @@ start_function (cp_decl_specifier_seq *declspecs,
/* This should only be done once on the outermost decl. */ /* This should only be done once on the outermost decl. */
have_extern_spec = false; have_extern_spec = false;
} }
decl1 = grokdeclarator (declarator, declspecs, FUNCDEF, 1, &attrs); decl1 = grokdeclarator (declarator, declspecs, FUNCDEF, 1, &attrs);
/* If the declarator is not suitable for a function definition, /* If the declarator is not suitable for a function definition,
cause a syntax error. */ cause a syntax error. */
if (decl1 == NULL_TREE || TREE_CODE (decl1) != FUNCTION_DECL) if (decl1 == NULL_TREE || TREE_CODE (decl1) != FUNCTION_DECL)
return 0; return 0;
cplus_decl_attributes (&decl1, attrs, 0); cplus_decl_attributes (&decl1, attrs, 0);
/* If #pragma weak was used, mark the decl weak now. */ /* If #pragma weak was used, mark the decl weak now. */
if (global_scope_p (current_binding_level)) if (global_scope_p (current_binding_level))
maybe_apply_pragma_weak (decl1); maybe_apply_pragma_weak (decl1);
if (DECL_MAIN_P (decl1)) if (DECL_MAIN_P (decl1))
{ {
/* If this doesn't return integer_type, or a typedef to /* If this doesn't return integer_type, or a typedef to
...@@ -10070,7 +10075,7 @@ begin_destructor_body (void) ...@@ -10070,7 +10075,7 @@ begin_destructor_body (void)
if_stmt = begin_if_stmt (); if_stmt = begin_if_stmt ();
/* If it is not safe to avoid setting up the vtables, then /* If it is not safe to avoid setting up the vtables, then
someone will change the condition to be boolean_true_node. someone will change the condition to be boolean_true_node.
(Actually, for now, we do not have code to set the condition (Actually, for now, we do not have code to set the condition
appropriately, so we just assume that we always need to appropriately, so we just assume that we always need to
initialize the vtables.) */ initialize the vtables.) */
...@@ -10117,7 +10122,7 @@ finish_destructor_body (void) ...@@ -10117,7 +10122,7 @@ finish_destructor_body (void)
be looked up in the scope of the destructor's class and if be looked up in the scope of the destructor's class and if
found shall be accessible and unambiguous. */ found shall be accessible and unambiguous. */
exprstmt = build_op_delete_call exprstmt = build_op_delete_call
(DELETE_EXPR, current_class_ptr, virtual_size, (DELETE_EXPR, current_class_ptr, virtual_size,
/*global_p=*/false, NULL_TREE); /*global_p=*/false, NULL_TREE);
if_stmt = begin_if_stmt (); if_stmt = begin_if_stmt ();
...@@ -10183,7 +10188,7 @@ finish_function_body (tree compstmt) ...@@ -10183,7 +10188,7 @@ finish_function_body (tree compstmt)
finish_constructor_body (); finish_constructor_body ();
else if (DECL_DESTRUCTOR_P (current_function_decl)) else if (DECL_DESTRUCTOR_P (current_function_decl))
finish_destructor_body (); finish_destructor_body ();
} }
/* Finish up a function declaration and compile that function /* Finish up a function declaration and compile that function
all the way to assembler language output. The free the storage all the way to assembler language output. The free the storage
...@@ -10225,7 +10230,7 @@ finish_function (int flags) ...@@ -10225,7 +10230,7 @@ finish_function (int flags)
which then got a warning when stored in a ptr-to-function variable. */ which then got a warning when stored in a ptr-to-function variable. */
my_friendly_assert (building_stmt_tree (), 20000911); my_friendly_assert (building_stmt_tree (), 20000911);
/* For a cloned function, we've already got all the code we need; /* For a cloned function, we've already got all the code we need;
there's no need to add any extra bits. */ there's no need to add any extra bits. */
if (!DECL_CLONED_FUNCTION_P (fndecl)) if (!DECL_CLONED_FUNCTION_P (fndecl))
...@@ -10263,7 +10268,7 @@ finish_function (int flags) ...@@ -10263,7 +10268,7 @@ finish_function (int flags)
/* This must come after expand_function_end because cleanups might /* This must come after expand_function_end because cleanups might
have declarations (from inline functions) that need to go into have declarations (from inline functions) that need to go into
this function's blocks. */ this function's blocks. */
/* If the current binding level isn't the outermost binding level /* If the current binding level isn't the outermost binding level
for this function, either there is a bug, or we have experienced for this function, either there is a bug, or we have experienced
syntax errors and the statement tree is malformed. */ syntax errors and the statement tree is malformed. */
...@@ -10406,7 +10411,7 @@ finish_function (int flags) ...@@ -10406,7 +10411,7 @@ finish_function (int flags)
CHANGES TO CODE IN `grokfield'. */ CHANGES TO CODE IN `grokfield'. */
tree tree
start_method (cp_decl_specifier_seq *declspecs, start_method (cp_decl_specifier_seq *declspecs,
const cp_declarator *declarator, tree attrlist) const cp_declarator *declarator, tree attrlist)
{ {
tree fndecl = grokdeclarator (declarator, declspecs, MEMFUNCDEF, 0, tree fndecl = grokdeclarator (declarator, declspecs, MEMFUNCDEF, 0,
...@@ -10540,15 +10545,15 @@ maybe_register_incomplete_var (tree var) ...@@ -10540,15 +10545,15 @@ maybe_register_incomplete_var (tree var)
my_friendly_assert (TREE_CODE (var) == VAR_DECL, 20020406); my_friendly_assert (TREE_CODE (var) == VAR_DECL, 20020406);
/* Keep track of variables with incomplete types. */ /* Keep track of variables with incomplete types. */
if (!processing_template_decl && TREE_TYPE (var) != error_mark_node if (!processing_template_decl && TREE_TYPE (var) != error_mark_node
&& DECL_EXTERNAL (var)) && DECL_EXTERNAL (var))
{ {
tree inner_type = TREE_TYPE (var); tree inner_type = TREE_TYPE (var);
while (TREE_CODE (inner_type) == ARRAY_TYPE) while (TREE_CODE (inner_type) == ARRAY_TYPE)
inner_type = TREE_TYPE (inner_type); inner_type = TREE_TYPE (inner_type);
inner_type = TYPE_MAIN_VARIANT (inner_type); inner_type = TYPE_MAIN_VARIANT (inner_type);
if ((!COMPLETE_TYPE_P (inner_type) && CLASS_TYPE_P (inner_type)) if ((!COMPLETE_TYPE_P (inner_type) && CLASS_TYPE_P (inner_type))
/* RTTI TD entries are created while defining the type_info. */ /* RTTI TD entries are created while defining the type_info. */
|| (TYPE_LANG_SPECIFIC (inner_type) || (TYPE_LANG_SPECIFIC (inner_type)
...@@ -10567,7 +10572,7 @@ complete_vars (tree type) ...@@ -10567,7 +10572,7 @@ complete_vars (tree type)
tree *list = &incomplete_vars; tree *list = &incomplete_vars;
my_friendly_assert (CLASS_TYPE_P (type), 20020406); my_friendly_assert (CLASS_TYPE_P (type), 20020406);
while (*list) while (*list)
{ {
if (same_type_p (type, TREE_PURPOSE (*list))) if (same_type_p (type, TREE_PURPOSE (*list)))
{ {
...@@ -10682,7 +10687,7 @@ cxx_push_function_context (struct function * f) ...@@ -10682,7 +10687,7 @@ cxx_push_function_context (struct function * f)
*cp_function_chain = *DECL_SAVED_FUNCTION_DATA (fn); *cp_function_chain = *DECL_SAVED_FUNCTION_DATA (fn);
/* We don't need the saved data anymore. Unless this is an inline /* We don't need the saved data anymore. Unless this is an inline
function; we need the named return value info for function; we need the named return value info for
declare_return_variable. */ declare_return_variable. */
if (! DECL_INLINE (fn)) if (! DECL_INLINE (fn))
DECL_SAVED_FUNCTION_DATA (fn) = NULL; DECL_SAVED_FUNCTION_DATA (fn) = NULL;
......
...@@ -3948,7 +3948,7 @@ store_expr (tree exp, rtx target, int want_value) ...@@ -3948,7 +3948,7 @@ store_expr (tree exp, rtx target, int want_value)
else else
{ {
temp = expand_expr_real (exp, target, GET_MODE (target), temp = expand_expr_real (exp, target, GET_MODE (target),
(want_value & 2 (want_value & 2
? EXPAND_STACK_PARM : EXPAND_NORMAL), ? EXPAND_STACK_PARM : EXPAND_NORMAL),
&alt_rtl); &alt_rtl);
/* Return TARGET if it's a specified hardware register. /* Return TARGET if it's a specified hardware register.
...@@ -4142,7 +4142,7 @@ categorize_ctor_elements_1 (tree ctor, HOST_WIDE_INT *p_nz_elts, ...@@ -4142,7 +4142,7 @@ categorize_ctor_elements_1 (tree ctor, HOST_WIDE_INT *p_nz_elts,
nz_elts = 0; nz_elts = 0;
nc_elts = 0; nc_elts = 0;
for (list = CONSTRUCTOR_ELTS (ctor); list; list = TREE_CHAIN (list)) for (list = CONSTRUCTOR_ELTS (ctor); list; list = TREE_CHAIN (list))
{ {
tree value = TREE_VALUE (list); tree value = TREE_VALUE (list);
...@@ -4297,7 +4297,7 @@ int ...@@ -4297,7 +4297,7 @@ int
mostly_zeros_p (tree exp) mostly_zeros_p (tree exp)
{ {
if (TREE_CODE (exp) == CONSTRUCTOR) if (TREE_CODE (exp) == CONSTRUCTOR)
{ {
HOST_WIDE_INT nz_elts, nc_elts, elts; HOST_WIDE_INT nz_elts, nc_elts, elts;
...@@ -4831,12 +4831,12 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) ...@@ -4831,12 +4831,12 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
if (REG_P (target) && VECTOR_MODE_P (GET_MODE (target))) if (REG_P (target) && VECTOR_MODE_P (GET_MODE (target)))
{ {
enum machine_mode mode = GET_MODE (target); enum machine_mode mode = GET_MODE (target);
icode = (int) vec_init_optab->handlers[mode].insn_code; icode = (int) vec_init_optab->handlers[mode].insn_code;
if (icode != CODE_FOR_nothing) if (icode != CODE_FOR_nothing)
{ {
unsigned int i; unsigned int i;
vector = alloca (n_elts); vector = alloca (n_elts);
for (i = 0; i < n_elts; i++) for (i = 0; i < n_elts; i++)
vector [i] = CONST0_RTX (GET_MODE_INNER (mode)); vector [i] = CONST0_RTX (GET_MODE_INNER (mode));
...@@ -5479,7 +5479,7 @@ array_ref_element_size (tree exp) ...@@ -5479,7 +5479,7 @@ array_ref_element_size (tree exp)
return size_binop (MULT_EXPR, aligned_size, return size_binop (MULT_EXPR, aligned_size,
size_int (TYPE_ALIGN (elmt_type) / BITS_PER_UNIT)); size_int (TYPE_ALIGN (elmt_type) / BITS_PER_UNIT));
/* Otherwise, take the size from that of the element type. Substitute /* Otherwise, take the size from that of the element type. Substitute
any PLACEHOLDER_EXPR that we have. */ any PLACEHOLDER_EXPR that we have. */
else else
return SUBSTITUTE_PLACEHOLDER_IN_EXPR (TYPE_SIZE_UNIT (elmt_type), exp); return SUBSTITUTE_PLACEHOLDER_IN_EXPR (TYPE_SIZE_UNIT (elmt_type), exp);
...@@ -5539,7 +5539,7 @@ component_ref_field_offset (tree exp) ...@@ -5539,7 +5539,7 @@ component_ref_field_offset (tree exp)
return size_binop (MULT_EXPR, aligned_offset, return size_binop (MULT_EXPR, aligned_offset,
size_int (DECL_OFFSET_ALIGN (field) / BITS_PER_UNIT)); size_int (DECL_OFFSET_ALIGN (field) / BITS_PER_UNIT));
/* Otherwise, take the offset from that of the field. Substitute /* Otherwise, take the offset from that of the field. Substitute
any PLACEHOLDER_EXPR that we have. */ any PLACEHOLDER_EXPR that we have. */
else else
return SUBSTITUTE_PLACEHOLDER_IN_EXPR (DECL_FIELD_OFFSET (field), exp); return SUBSTITUTE_PLACEHOLDER_IN_EXPR (DECL_FIELD_OFFSET (field), exp);
...@@ -5861,11 +5861,6 @@ safe_from_p (rtx x, tree exp, int top_p) ...@@ -5861,11 +5861,6 @@ safe_from_p (rtx x, tree exp, int top_p)
case SAVE_EXPR: case SAVE_EXPR:
return safe_from_p (x, TREE_OPERAND (exp, 0), 0); return safe_from_p (x, TREE_OPERAND (exp, 0), 0);
case BIND_EXPR:
/* The only operand we look at is operand 1. The rest aren't
part of the expression. */
return safe_from_p (x, TREE_OPERAND (exp, 1), 0);
default: default:
break; break;
} }
...@@ -6037,7 +6032,7 @@ expand_var (tree var) ...@@ -6037,7 +6032,7 @@ expand_var (tree var)
{ {
/* Prepare a mem & address for the decl. */ /* Prepare a mem & address for the decl. */
rtx x; rtx x;
if (TREE_STATIC (var)) if (TREE_STATIC (var))
abort (); abort ();
...@@ -6063,23 +6058,6 @@ expand_var (tree var) ...@@ -6063,23 +6058,6 @@ expand_var (tree var)
} }
} }
/* Expands declarations of variables in list VARS. */
static void
expand_vars (tree vars)
{
for (; vars; vars = TREE_CHAIN (vars))
{
tree var = vars;
if (DECL_EXTERNAL (var))
continue;
expand_var (var);
expand_decl_init (var);
}
}
/* Subroutine of expand_expr. Expand the two operands of a binary /* Subroutine of expand_expr. Expand the two operands of a binary
expression EXP0 and EXP1 placing the results in OP0 and OP1. expression EXP0 and EXP1 placing the results in OP0 and OP1.
The value may be stored in TARGET if TARGET is nonzero. The The value may be stored in TARGET if TARGET is nonzero. The
...@@ -6148,7 +6126,7 @@ expand_operands (tree exp0, tree exp1, rtx target, rtx *op0, rtx *op1, ...@@ -6148,7 +6126,7 @@ expand_operands (tree exp0, tree exp1, rtx target, rtx *op0, rtx *op1,
marked TARGET so that it's safe from being trashed by libcalls. We marked TARGET so that it's safe from being trashed by libcalls. We
don't want to use TARGET for anything but the final result; don't want to use TARGET for anything but the final result;
Intermediate values must go elsewhere. Additionally, calls to Intermediate values must go elsewhere. Additionally, calls to
emit_block_move will be flagged with BLOCK_OP_CALL_PARM. emit_block_move will be flagged with BLOCK_OP_CALL_PARM.
If EXP is a VAR_DECL whose DECL_RTL was a MEM with an invalid If EXP is a VAR_DECL whose DECL_RTL was a MEM with an invalid
address, and ALT_RTL is non-NULL, then *ALT_RTL is set to the address, and ALT_RTL is non-NULL, then *ALT_RTL is set to the
...@@ -6183,11 +6161,11 @@ expand_expr_real (tree exp, rtx target, enum machine_mode tmode, ...@@ -6183,11 +6161,11 @@ expand_expr_real (tree exp, rtx target, enum machine_mode tmode,
} }
/* If this is an expression of some kind and it has an associated line /* If this is an expression of some kind and it has an associated line
number, then emit the line number before expanding the expression. number, then emit the line number before expanding the expression.
We need to save and restore the file and line information so that We need to save and restore the file and line information so that
errors discovered during expansion are emitted with the right errors discovered during expansion are emitted with the right
information. It would be better of the diagnostic routines information. It would be better of the diagnostic routines
used the file/line information embedded in the tree nodes rather used the file/line information embedded in the tree nodes rather
than globals. */ than globals. */
if (cfun && EXPR_HAS_LOCATION (exp)) if (cfun && EXPR_HAS_LOCATION (exp))
...@@ -6195,7 +6173,7 @@ expand_expr_real (tree exp, rtx target, enum machine_mode tmode, ...@@ -6195,7 +6173,7 @@ expand_expr_real (tree exp, rtx target, enum machine_mode tmode,
location_t saved_location = input_location; location_t saved_location = input_location;
input_location = EXPR_LOCATION (exp); input_location = EXPR_LOCATION (exp);
emit_line_note (input_location); emit_line_note (input_location);
/* Record where the insns produced belong. */ /* Record where the insns produced belong. */
record_block_change (TREE_BLOCK (exp)); record_block_change (TREE_BLOCK (exp));
...@@ -6212,9 +6190,9 @@ expand_expr_real (tree exp, rtx target, enum machine_mode tmode, ...@@ -6212,9 +6190,9 @@ expand_expr_real (tree exp, rtx target, enum machine_mode tmode,
expand_call() will mark CALL_INSNs before we get to this code, expand_call() will mark CALL_INSNs before we get to this code,
but it doesn't handle libcalls, and these may trap. */ but it doesn't handle libcalls, and these may trap. */
if (rn >= 0) if (rn >= 0)
{ {
rtx insn; rtx insn;
for (insn = next_real_insn (last); insn; for (insn = next_real_insn (last); insn;
insn = next_real_insn (insn)) insn = next_real_insn (insn))
{ {
if (! find_reg_note (insn, REG_EH_REGION, NULL_RTX) if (! find_reg_note (insn, REG_EH_REGION, NULL_RTX)
...@@ -6501,7 +6479,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -6501,7 +6479,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
if (GET_MODE_CLASS (TYPE_MODE (TREE_TYPE (exp))) == MODE_VECTOR_INT if (GET_MODE_CLASS (TYPE_MODE (TREE_TYPE (exp))) == MODE_VECTOR_INT
|| GET_MODE_CLASS (TYPE_MODE (TREE_TYPE (exp))) == MODE_VECTOR_FLOAT) || GET_MODE_CLASS (TYPE_MODE (TREE_TYPE (exp))) == MODE_VECTOR_FLOAT)
return const_vector_from_tree (exp); return const_vector_from_tree (exp);
else else
return expand_expr (build1 (CONSTRUCTOR, TREE_TYPE (exp), return expand_expr (build1 (CONSTRUCTOR, TREE_TYPE (exp),
TREE_VECTOR_CST_ELTS (exp)), TREE_VECTOR_CST_ELTS (exp)),
ignore ? const0_rtx : target, tmode, modifier); ignore ? const0_rtx : target, tmode, modifier);
...@@ -6624,31 +6602,6 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -6624,31 +6602,6 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
expand_goto (LABELED_BLOCK_LABEL (EXIT_BLOCK_LABELED_BLOCK (exp))); expand_goto (LABELED_BLOCK_LABEL (EXIT_BLOCK_LABELED_BLOCK (exp)));
return const0_rtx; return const0_rtx;
case BIND_EXPR:
{
tree block = BIND_EXPR_BLOCK (exp);
int mark_ends;
/* If we're in functions-as-trees mode, this BIND_EXPR represents
the block, so we need to emit NOTE_INSN_BLOCK_* notes. */
mark_ends = (block != NULL_TREE);
expand_start_bindings_and_block (mark_ends ? 0 : 2, block);
/* If VARS have not yet been expanded, expand them now. */
expand_vars (BIND_EXPR_VARS (exp));
/* TARGET was clobbered early in this function. The correct
indicator or whether or not we need the value of this
expression is the IGNORE variable. */
temp = expand_expr (BIND_EXPR_BODY (exp),
ignore ? const0_rtx : target,
tmode, modifier);
expand_end_bindings (BIND_EXPR_VARS (exp), mark_ends, 0);
return temp;
}
case CONSTRUCTOR: case CONSTRUCTOR:
/* If we don't need the result, just ensure we evaluate any /* If we don't need the result, just ensure we evaluate any
subexpressions. */ subexpressions. */
...@@ -8617,6 +8570,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8617,6 +8570,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case TARGET_EXPR: case TARGET_EXPR:
case CASE_LABEL_EXPR: case CASE_LABEL_EXPR:
case VA_ARG_EXPR: case VA_ARG_EXPR:
case BIND_EXPR:
/* Lowered by gimplify.c. */ /* Lowered by gimplify.c. */
abort (); abort ();
...@@ -8740,7 +8694,7 @@ is_aligning_offset (tree offset, tree exp) ...@@ -8740,7 +8694,7 @@ is_aligning_offset (tree offset, tree exp)
power of 2 and which is larger than BIGGEST_ALIGNMENT. */ power of 2 and which is larger than BIGGEST_ALIGNMENT. */
if (TREE_CODE (offset) != BIT_AND_EXPR if (TREE_CODE (offset) != BIT_AND_EXPR
|| !host_integerp (TREE_OPERAND (offset, 1), 1) || !host_integerp (TREE_OPERAND (offset, 1), 1)
|| compare_tree_int (TREE_OPERAND (offset, 1), || compare_tree_int (TREE_OPERAND (offset, 1),
BIGGEST_ALIGNMENT / BITS_PER_UNIT) <= 0 BIGGEST_ALIGNMENT / BITS_PER_UNIT) <= 0
|| !exact_log2 (tree_low_cst (TREE_OPERAND (offset, 1), 1) + 1) < 0) || !exact_log2 (tree_low_cst (TREE_OPERAND (offset, 1), 1) + 1) < 0)
return 0; return 0;
......
...@@ -212,8 +212,6 @@ do { struct nesting *target = STACK; \ ...@@ -212,8 +212,6 @@ do { struct nesting *target = STACK; \
do { this = nesting_stack; \ do { this = nesting_stack; \
if (cond_stack == this) \ if (cond_stack == this) \
cond_stack = cond_stack->next; \ cond_stack = cond_stack->next; \
if (block_stack == this) \
block_stack = block_stack->next; \
if (case_stack == this) \ if (case_stack == this) \
case_stack = case_stack->next; \ case_stack = case_stack->next; \
nesting_depth = nesting_stack->depth - 1; \ nesting_depth = nesting_stack->depth - 1; \
...@@ -223,9 +221,6 @@ do { struct nesting *target = STACK; \ ...@@ -223,9 +221,6 @@ do { struct nesting *target = STACK; \
struct stmt_status GTY(()) struct stmt_status GTY(())
{ {
/* Chain of all pending binding contours. */
struct nesting * x_block_stack;
/* If any new stacks are added here, add them to POPSTACKS too. */ /* If any new stacks are added here, add them to POPSTACKS too. */
/* Chain of all pending conditional statements. */ /* Chain of all pending conditional statements. */
...@@ -249,7 +244,6 @@ struct stmt_status GTY(()) ...@@ -249,7 +244,6 @@ struct stmt_status GTY(())
location_t x_emit_locus; location_t x_emit_locus;
}; };
#define block_stack (cfun->stmt->x_block_stack)
#define cond_stack (cfun->stmt->x_cond_stack) #define cond_stack (cfun->stmt->x_cond_stack)
#define case_stack (cfun->stmt->x_case_stack) #define case_stack (cfun->stmt->x_case_stack)
#define nesting_stack (cfun->stmt->x_nesting_stack) #define nesting_stack (cfun->stmt->x_nesting_stack)
...@@ -410,7 +404,7 @@ expand_label (tree label) ...@@ -410,7 +404,7 @@ expand_label (tree label)
if (FORCED_LABEL (label)) if (FORCED_LABEL (label))
forced_labels = gen_rtx_EXPR_LIST (VOIDmode, label_r, forced_labels); forced_labels = gen_rtx_EXPR_LIST (VOIDmode, label_r, forced_labels);
if (DECL_NONLOCAL (label) || FORCED_LABEL (label)) if (DECL_NONLOCAL (label) || FORCED_LABEL (label))
maybe_set_first_label_num (label_r); maybe_set_first_label_num (label_r);
} }
...@@ -1436,7 +1430,7 @@ resolve_asm_operand_names (tree string, tree outputs, tree inputs) ...@@ -1436,7 +1430,7 @@ resolve_asm_operand_names (tree string, tree outputs, tree inputs)
than 999 operands. */ than 999 operands. */
buffer = xstrdup (TREE_STRING_POINTER (string)); buffer = xstrdup (TREE_STRING_POINTER (string));
p = buffer + (c - TREE_STRING_POINTER (string)); p = buffer + (c - TREE_STRING_POINTER (string));
while ((p = strchr (p, '%')) != NULL) while ((p = strchr (p, '%')) != NULL)
{ {
if (p[1] == '[') if (p[1] == '[')
...@@ -1561,7 +1555,7 @@ expand_expr_stmt (tree exp) ...@@ -1561,7 +1555,7 @@ expand_expr_stmt (tree exp)
} }
/* Warn if EXP contains any computations whose results are not used. /* Warn if EXP contains any computations whose results are not used.
Return 1 if a warning is printed; 0 otherwise. LOCUS is the Return 1 if a warning is printed; 0 otherwise. LOCUS is the
(potential) location of the expression. */ (potential) location of the expression. */
int int
...@@ -2061,98 +2055,6 @@ expand_return (tree retval) ...@@ -2061,98 +2055,6 @@ expand_return (tree retval)
} }
} }
/* Generate the RTL code for entering a binding contour.
The variables are declared one by one, by calls to `expand_decl'.
FLAGS is a bitwise or of the following flags:
1 - Nonzero if this construct should be visible to
`exit_something'.
2 - Nonzero if this contour does not require a
NOTE_INSN_BLOCK_BEG note. Virtually all calls from
language-independent code should set this flag because they
will not create corresponding BLOCK nodes. (There should be
a one-to-one correspondence between NOTE_INSN_BLOCK_BEG notes
and BLOCKs.) If this flag is set, MARK_ENDS should be zero
when expand_end_bindings is called.
If we are creating a NOTE_INSN_BLOCK_BEG note, a BLOCK may
optionally be supplied. If so, it becomes the NOTE_BLOCK for the
note. */
void
expand_start_bindings_and_block (int flags, tree block)
{
struct nesting *thisblock = ALLOC_NESTING ();
rtx note;
int exit_flag = ((flags & 1) != 0);
int block_flag = ((flags & 2) == 0);
/* If a BLOCK is supplied, then the caller should be requesting a
NOTE_INSN_BLOCK_BEG note. */
if (!block_flag && block)
abort ();
/* Create a note to mark the beginning of the block. */
note = emit_note (NOTE_INSN_DELETED);
/* Make an entry on block_stack for the block we are entering. */
thisblock->desc = BLOCK_NESTING;
thisblock->next = block_stack;
thisblock->all = nesting_stack;
thisblock->depth = ++nesting_depth;
thisblock->data.block.block_target_temp_slot_level = target_temp_slot_level;
/* When we insert instructions after the last unconditional cleanup,
we don't adjust last_insn. That means that a later add_insn will
clobber the instructions we've just added. The easiest way to
fix this is to just insert another instruction here, so that the
instructions inserted after the last unconditional cleanup are
never the last instruction. */
emit_note (NOTE_INSN_DELETED);
thisblock->data.block.first_insn = note;
thisblock->data.block.block_start_count = ++current_block_start_count;
thisblock->exit_label = exit_flag ? gen_label_rtx () : 0;
block_stack = thisblock;
nesting_stack = thisblock;
/* Make a new level for allocating stack slots. */
push_temp_slots ();
}
/* Specify the scope of temporaries created by TARGET_EXPRs. Similar
to CLEANUP_POINT_EXPR, but handles cases when a series of calls to
expand_expr are made. After we end the region, we know that all
space for all temporaries that were created by TARGET_EXPRs will be
destroyed and their space freed for reuse. */
void
expand_start_target_temps (void)
{
/* This is so that even if the result is preserved, the space
allocated will be freed, as we know that it is no longer in use. */
push_temp_slots ();
/* Start a new binding layer that will keep track of all cleanup
actions to be performed. */
expand_start_bindings (2);
target_temp_slot_level = temp_slot_level;
}
void
expand_end_target_temps (void)
{
expand_end_bindings (NULL_TREE, 0, 0);
/* This is so that even if the result is preserved, the space
allocated will be freed, as we know that it is no longer in use. */
pop_temp_slots ();
}
/* Given a pointer to a BLOCK node return nonzero if (and only if) the node /* Given a pointer to a BLOCK node return nonzero if (and only if) the node
in question represents the outermost pair of curly braces (i.e. the "body in question represents the outermost pair of curly braces (i.e. the "body
block") of a function or method. block") of a function or method.
...@@ -2185,15 +2087,6 @@ is_body_block (tree stmt) ...@@ -2185,15 +2087,6 @@ is_body_block (tree stmt)
return 0; return 0;
} }
/* Return an opaque pointer to the current nesting level, so frontend code
can check its own sanity. */
struct nesting *
current_nesting_level (void)
{
return cfun ? block_stack : 0;
}
/* Emit code to restore vital registers at the beginning of a nonlocal goto /* Emit code to restore vital registers at the beginning of a nonlocal goto
handler. */ handler. */
static void static void
...@@ -2263,70 +2156,6 @@ expand_nl_goto_receiver (void) ...@@ -2263,70 +2156,6 @@ expand_nl_goto_receiver (void)
insn. */ insn. */
emit_insn (gen_rtx_ASM_INPUT (VOIDmode, "")); emit_insn (gen_rtx_ASM_INPUT (VOIDmode, ""));
} }
/* Warn about any unused VARS (which may contain nodes other than
VAR_DECLs, but such nodes are ignored). The nodes are connected
via the TREE_CHAIN field. */
void
warn_about_unused_variables (tree vars)
{
tree decl;
if (warn_unused_variable)
for (decl = vars; decl; decl = TREE_CHAIN (decl))
if (TREE_CODE (decl) == VAR_DECL
&& ! TREE_USED (decl)
&& ! DECL_IN_SYSTEM_HEADER (decl)
&& DECL_NAME (decl) && ! DECL_ARTIFICIAL (decl))
warning ("%Junused variable '%D'", decl, decl);
}
/* Generate RTL code to terminate a binding contour.
VARS is the chain of VAR_DECL nodes for the variables bound in this
contour. There may actually be other nodes in this chain, but any
nodes other than VAR_DECLS are ignored.
MARK_ENDS is nonzero if we should put a note at the beginning
and end of this binding contour.
DONT_JUMP_IN is positive if it is not valid to jump into this contour,
zero if we can jump into this contour only if it does not have a saved
stack level, and negative if we are not to check for invalid use of
labels (because the front end does that). */
void
expand_end_bindings (tree vars, int mark_ends ATTRIBUTE_UNUSED,
int dont_jump_in ATTRIBUTE_UNUSED)
{
struct nesting *thisblock = block_stack;
/* If any of the variables in this scope were not used, warn the
user. */
warn_about_unused_variables (vars);
if (thisblock->exit_label)
{
do_pending_stack_adjust ();
emit_label (thisblock->exit_label);
}
/* Mark the beginning and end of the scope if requested. */
/* Get rid of the beginning-mark if we don't make an end-mark. */
NOTE_LINE_NUMBER (thisblock->data.block.first_insn) = NOTE_INSN_DELETED;
/* Restore the temporary level of TARGET_EXPRs. */
target_temp_slot_level = thisblock->data.block.block_target_temp_slot_level;
/* Restore block_stack level for containing block. */
POPSTACK (block_stack);
/* Pop the stack slot nesting and free any slots at this level. */
pop_temp_slots ();
}
/* Generate RTL for the automatic variable declaration DECL. /* Generate RTL for the automatic variable declaration DECL.
(Other kinds of declarations are simply ignored if seen here.) */ (Other kinds of declarations are simply ignored if seen here.) */
......
...@@ -248,7 +248,7 @@ struct tree_common GTY(()) ...@@ -248,7 +248,7 @@ struct tree_common GTY(())
BLOCK BLOCK
..._DECL ..._DECL
CALL_FROM_THUNK_P in CALL_FROM_THUNK_P in
CALL_EXPR CALL_EXPR
side_effects_flag: side_effects_flag:
...@@ -569,7 +569,7 @@ extern void tree_operand_check_failed (int, enum tree_code, ...@@ -569,7 +569,7 @@ extern void tree_operand_check_failed (int, enum tree_code,
TREE_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE) TREE_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE)
#define NOT_RECORD_OR_UNION_CHECK(T) \ #define NOT_RECORD_OR_UNION_CHECK(T) \
TREE_NOT_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE) TREE_NOT_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE)
#define NUMERICAL_TYPE_CHECK(T) \ #define NUMERICAL_TYPE_CHECK(T) \
TREE_CHECK5 (T, INTEGER_TYPE, ENUMERAL_TYPE, BOOLEAN_TYPE, \ TREE_CHECK5 (T, INTEGER_TYPE, ENUMERAL_TYPE, BOOLEAN_TYPE, \
CHAR_TYPE, REAL_TYPE) CHAR_TYPE, REAL_TYPE)
...@@ -764,7 +764,7 @@ extern void tree_operand_check_failed (int, enum tree_code, ...@@ -764,7 +764,7 @@ extern void tree_operand_check_failed (int, enum tree_code,
/* In an INTEGER_CST, REAL_CST, COMPLEX_CST, or VECTOR_CST, this means /* In an INTEGER_CST, REAL_CST, COMPLEX_CST, or VECTOR_CST, this means
there was an overflow in folding, and no warning has been issued there was an overflow in folding, and no warning has been issued
for this subexpression. TREE_OVERFLOW implies TREE_CONSTANT_OVERFLOW, for this subexpression. TREE_OVERFLOW implies TREE_CONSTANT_OVERFLOW,
but not vice versa. but not vice versa.
??? Apparently, lots of code assumes this is defined in all ??? Apparently, lots of code assumes this is defined in all
expressions. */ expressions. */
...@@ -806,7 +806,7 @@ extern void tree_operand_check_failed (int, enum tree_code, ...@@ -806,7 +806,7 @@ extern void tree_operand_check_failed (int, enum tree_code,
accessing the memory pointed to won't generate a trap. However, accessing the memory pointed to won't generate a trap. However,
this only applies to an object when used appropriately: it doesn't this only applies to an object when used appropriately: it doesn't
mean that writing a READONLY mem won't trap. mean that writing a READONLY mem won't trap.
In ARRAY_REF and ARRAY_RANGE_REF means that we know that the index In ARRAY_REF and ARRAY_RANGE_REF means that we know that the index
(or slice of the array) always belongs to the range of the array. (or slice of the array) always belongs to the range of the array.
I.e. that the access will not trap, provided that the access to I.e. that the access will not trap, provided that the access to
...@@ -843,7 +843,7 @@ extern void tree_operand_check_failed (int, enum tree_code, ...@@ -843,7 +843,7 @@ extern void tree_operand_check_failed (int, enum tree_code,
to be compiled separately. to be compiled separately.
Nonzero in a RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE or ENUMERAL_TYPE Nonzero in a RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE or ENUMERAL_TYPE
if the sdb debugging info for the type has been written. if the sdb debugging info for the type has been written.
In a BLOCK node, nonzero if reorder_blocks has already seen this block. In a BLOCK node, nonzero if reorder_blocks has already seen this block.
In an SSA_NAME node, nonzero if the SSA_NAME occurs in an abnormal In an SSA_NAME node, nonzero if the SSA_NAME occurs in an abnormal
PHI node. */ PHI node. */
#define TREE_ASM_WRITTEN(NODE) ((NODE)->common.asm_written_flag) #define TREE_ASM_WRITTEN(NODE) ((NODE)->common.asm_written_flag)
...@@ -1163,7 +1163,7 @@ struct tree_vec GTY(()) ...@@ -1163,7 +1163,7 @@ struct tree_vec GTY(())
/* VDEF_EXPR accessors are specified in tree-flow.h, along with the other /* VDEF_EXPR accessors are specified in tree-flow.h, along with the other
accessors for SSA operands. */ accessors for SSA operands. */
/* CATCH_EXPR accessors. */ /* CATCH_EXPR accessors. */
#define CATCH_TYPES(NODE) TREE_OPERAND (CATCH_EXPR_CHECK (NODE), 0) #define CATCH_TYPES(NODE) TREE_OPERAND (CATCH_EXPR_CHECK (NODE), 0)
#define CATCH_BODY(NODE) TREE_OPERAND (CATCH_EXPR_CHECK (NODE), 1) #define CATCH_BODY(NODE) TREE_OPERAND (CATCH_EXPR_CHECK (NODE), 1)
...@@ -1227,7 +1227,7 @@ struct tree_exp GTY(()) ...@@ -1227,7 +1227,7 @@ struct tree_exp GTY(())
/* Auxiliary pass-specific data. */ /* Auxiliary pass-specific data. */
#define SSA_NAME_AUX(N) \ #define SSA_NAME_AUX(N) \
SSA_NAME_CHECK (N)->ssa_name.aux SSA_NAME_CHECK (N)->ssa_name.aux
#ifndef _TREE_FLOW_H #ifndef _TREE_FLOW_H
struct ptr_info_def; struct ptr_info_def;
#endif #endif
...@@ -1245,7 +1245,7 @@ struct tree_ssa_name GTY(()) ...@@ -1245,7 +1245,7 @@ struct tree_ssa_name GTY(())
/* Pointer attributes used for alias analysis. */ /* Pointer attributes used for alias analysis. */
struct ptr_info_def *ptr_info; struct ptr_info_def *ptr_info;
/* Value for SSA name used by GVN. */ /* Value for SSA name used by GVN. */
tree GTY((skip)) value_handle; tree GTY((skip)) value_handle;
/* Auxiliary information stored with the ssa name. */ /* Auxiliary information stored with the ssa name. */
...@@ -3360,11 +3360,6 @@ extern void expand_stack_alloc (tree, tree); ...@@ -3360,11 +3360,6 @@ extern void expand_stack_alloc (tree, tree);
extern rtx expand_stack_save (void); extern rtx expand_stack_save (void);
extern void expand_stack_restore (tree); extern void expand_stack_restore (tree);
extern void expand_return (tree); extern void expand_return (tree);
extern void expand_start_bindings_and_block (int, tree);
#define expand_start_bindings(flags) \
expand_start_bindings_and_block(flags, NULL_TREE)
extern void expand_end_bindings (tree, int, int);
extern void warn_about_unused_variables (tree);
extern int is_body_block (tree); extern int is_body_block (tree);
extern struct nesting * current_nesting_level (void); extern struct nesting * current_nesting_level (void);
...@@ -3632,8 +3627,6 @@ extern void expand_asm_expr (tree); ...@@ -3632,8 +3627,6 @@ extern void expand_asm_expr (tree);
extern bool asm_op_is_mem_input (tree, tree); extern bool asm_op_is_mem_input (tree, tree);
extern tree resolve_asm_operand_names (tree, tree, tree); extern tree resolve_asm_operand_names (tree, tree, tree);
extern void init_stmt_for_function (void); extern void init_stmt_for_function (void);
extern void expand_start_target_temps (void);
extern void expand_end_target_temps (void);
extern void expand_elseif (tree); extern void expand_elseif (tree);
extern void expand_decl (tree); extern void expand_decl (tree);
extern void expand_anon_union_decl (tree, tree, tree); extern void expand_anon_union_decl (tree, tree, tree);
...@@ -3702,7 +3695,7 @@ enum tree_dump_index ...@@ -3702,7 +3695,7 @@ enum tree_dump_index
TDI_nested, /* dump each function after unnesting it */ TDI_nested, /* dump each function after unnesting it */
TDI_inlined, /* dump each function after inlining TDI_inlined, /* dump each function after inlining
within it. */ within it. */
TDI_vcg, /* create a VCG graph file for each TDI_vcg, /* create a VCG graph file for each
function's flowgraph. */ function's flowgraph. */
TDI_xml, /* dump function call graph. */ TDI_xml, /* dump function call graph. */
TDI_all, /* enable all the dumps. */ TDI_all, /* enable all the dumps. */
...@@ -3749,7 +3742,7 @@ extern void fancy_abort (const char *, int, const char *) ...@@ -3749,7 +3742,7 @@ extern void fancy_abort (const char *, int, const char *)
ATTRIBUTE_NORETURN; ATTRIBUTE_NORETURN;
#define abort() fancy_abort (__FILE__, __LINE__, __FUNCTION__) #define abort() fancy_abort (__FILE__, __LINE__, __FUNCTION__)
/* Enum and arrays used for tree allocation stats. /* Enum and arrays used for tree allocation stats.
Keep in sync with tree.c:tree_node_kind_names. */ Keep in sync with tree.c:tree_node_kind_names. */
typedef enum typedef enum
{ {
...@@ -3780,7 +3773,7 @@ extern int tree_node_sizes[]; ...@@ -3780,7 +3773,7 @@ extern int tree_node_sizes[];
be restricted. False if we are not in gimple form and folding is not be restricted. False if we are not in gimple form and folding is not
restricted to creating gimple expressions. */ restricted to creating gimple expressions. */
extern bool in_gimple_form; extern bool in_gimple_form;
/* In tree-ssa-loop-niter.c. */ /* In tree-ssa-loop-niter.c. */
tree lower_bound_in_type (tree, tree); tree lower_bound_in_type (tree, tree);
......
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