gcc/gcc/cp/semantics.c

2660 lines
70 KiB
C
Raw Normal View History

/* Perform the semantic phase of parsing, i.e., the process of
building tree structure, checking semantic consistency, and
building RTL. These routines are used both during actual parsing
and during the instantiation of template functions.
Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Written by Mark Mitchell (mmitchell@usa.net) based on code found
formerly in parse.y and pt.c.
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#include "config.h"
#include "system.h"
#include "tree.h"
#include "cp-tree.h"
Make-lang.in (cp/decl.o, cp/tree.o): Depend on tree-inline.h. * Make-lang.in (cp/decl.o, cp/tree.o): Depend on tree-inline.h. (cp/pt.o, cp/semantics.o, cp/optimize.o): Likewise. * cp-tree.h (lang_decl): Moved inlined_fns to tree_decl. (TREE_READONLY_DECL_P, DECL_INLINED_FNS): Moved to ../tree.h. (flag_inline_trees): Moved declaration to ../tree-inline.h. (walk_tree): Moved declaration to ../tree-inline.h. (walk_tree_without_duplicates, copy_tree_r): Likewise. (remap_save_expr): Likewise. * decl.c: Include tree-inline.h. (lang_mark_tree): Don't mark inlined_fns. * decl2.c (flag_inline_trees): Moved defn to ../tree-inline.c. * optimize.c: Include tree-inline.h. (optimize_inline_calls): Move declaration to ../tree.h, as non-static. (remap_decl): Use language-independent constructs and hooks. (remap_block, copy_body_r, declare_return_variable): Likewise. (inlinable_function_p): Likewise. Don't test for DECL_LANG_SPECIFIC before DECL_INLINED_FNS as inlined_fns is no longer language-specific. (optimize_inline_calls): Likewise. Make it non-static. Moved call of dump_function to... (optimize_function): Here... (clone_body): New function, extracted from... (maybe_clone_body): ... here. Build decl_map locally and pass it on to clone_body. * pt.c, semantics.c: Include tree-inline.h. * tree.c: Likewise. (cp_walk_subtrees): New language-specific hook for tree inlining. (cp_cannot_inline_tree_fn, cp_add_pending_fn_decls, cp_is_overload_p, cp_auto_var_in_fn_p, cp_copy_res_decl_for_inlining): Likewise. (walk_tree): Move language-specific constructs into... (cp_walk_subtrees): this new function. (copy_tree_r): Use language-independent constructs and hooks. (init_tree): Initialize tree inlining hooks. (remap_save_expr): Adjust prototype so that the declaration does not require the definition of splay_tree. From-SVN: r46020
2001-10-05 04:48:47 +02:00
#include "tree-inline.h"
#include "except.h"
#include "lex.h"
#include "toplev.h"
#include "flags.h"
#include "ggc.h"
#include "rtl.h"
#include "expr.h"
#include "output.h"
#include "timevar.h"
Makefile.in (toplev.o, [...]): Don't depend on dwarfout.h. * Makefile.in (toplev.o, dwarfout.o, final.o): Don't depend on dwarfout.h. * dbxout.c (dbxout_function): Rename dbxout_funciton_decl, move to conditionally compiled block. (dbx_debug_hooks, xcoff_debug_hooks): Update. * dbxout.h (dbxout_function): Remove. * debug.c (do_nothing_debug_hooks): Update. * debug.h (struct gcc_debug_hooks): New hooks function_decl, global_decl, deferred_inline_function. * dwarf2out.c (dwarf2_debug_hooks): Update. (dwarf2out_global_decl): New. * dwarfout.c: Don't include dwarfout.h. (dwarfout_global_decl, dwarfout_function_decl, dwarfout_deferred_inline_function): New. (dwarf_debug_hooks): Update. * dwarfout.h: Remove. * final.c: Don't include dwarfout.h. * sdbout.c (sdbout_global_decl): New. (sdbout_debug_hooks): Update. * toplev.c: Don't include dwarfout.h. (check_global_declarations, rest_of_compilation): Use new debug hooks. (note_deferral_of_defined_inline_function): Remove. * toplev.h (note_deferral_of_defined_inline_function): Remove. * ch/Makefile.in (lex.o): No dependence on dwarfout.h. * ch/lex.c: Don't include dwarfout.h. * cp/Make-lang.in (decl2.o): No dependence on dwarfout.h, dwarf2out.h. (semantics.o, optimize.o): Depend on debug.h not dwarfout.h. * cp/decl2.c: Don't include dwarfout.h and dwarf2out.h. * cp/optimize.c: Include debug.h. (maybe_clone_body): Use debug hook. * cp/semantics.c: Include debug.h. (expand_body): Use debug hook. * po/POTFILES.in: Remove dwarfout.h. From-SVN: r44145
2001-07-19 08:22:04 +02:00
#include "debug.h"
/* There routines provide a modular interface to perform many parsing
operations. They may therefore be used during actual parsing, or
during template instantiation, which may be regarded as a
degenerate form of parsing. Since the current g++ parser is
lacking in several respects, and will be reimplemented, we are
attempting to move most code that is not directly related to
parsing into this file; that will make implementing the new parser
much easier since it will be able to make use of these routines. */
static tree maybe_convert_cond PARAMS ((tree));
static tree simplify_aggr_init_exprs_r PARAMS ((tree *, int *, void *));
static void deferred_type_access_control PARAMS ((void));
cp-tree.h (BV_USE_VCALL_INDEX_P): New macro. * cp-tree.h (BV_USE_VCALL_INDEX_P): New macro. (BV_GENERATE_THUNK_WITH_VTABLE_P): Likewise. (lang_decl_flags): Add generate_with_vtable_p. Make vcall_offset a tree, not an int. (THUNK_GENERATE_WITH_VTABLE_P): New macro. (make_thunk): Change prototype. (emit_thunk): Rename to use_thunk. (mangle_thunk): Change prototype. * class.c (get_derived_offset): Simplify. (copy_virtuals): Clear BV_USE_VCALL_INDEX_P and BV_GENERATE_THUNK_WITH_VTABLE_P. (build_primary_vtable): Simplify. (add_virtual_function): Use BV_FN, rather than TREE_VALUE. (dfs_find_base): Remove. (update_vtable_entry_for_fn): Correct bug in finding the base where a virtual function was first declared. Figure out whether or not to emit a vcall-thunk with the vtables in which it appears. Correct logic for deciding whether to use an ordinary thunk, or a vcall thunk. (finish_struct_1): Remove unnecssary code. (build_vtbl_initializer): Use ssize_int for the running counter of negative indices. (build_vtbl_initializer): Only use vcall thunks where necessary. Mark thunks as needing to be emitted with their vtables, or not. (build_vbase_offset_vtbl_entries): Adjust for use of ssize_int in indices. Use size_binop. (dfs_build_vcall_offset_vtbl_entries): Don't rely on BINFO_PRIMARY_MARKED_P here. Use BV_FN consistently. Use size_binop. (build_rtti_vtbl_entries): Adjust call to build_vtable_entry. (build_vtable_entry): Mark thunks as needing to be emitted with their vtables, or not. * decl.c (lang_mark_tree): Mark the vcall_offset in a thunk. * decl2.c (mark_vtable_entries): Use use_thunk instead of emit_thunk. * dump.c (dequeue_and_dump): Remove dead code. Dump new thunk information. * error.c (dump_expr): Use BV_FN. * mangle.c (mangle_thunk): Adjust now that vcall_offset is a tree, not an int. * method.c (make_thunk): Likewise. (emit_thunk): Rename to use_thunk. Allow callers to decide whether or not to actually emit the thunk. Adjust for changes in representation of vcall offsets. * search.c (dfs_get_pure_virtuals): Use BV_FN. * semantics.c (emit_associated_thunks): New function. (expand_body): Use it. * ir.texi: Adjust decriptions of thunks. From-SVN: r34656
2000-06-23 03:14:40 +02:00
static void emit_associated_thunks PARAMS ((tree));
static void genrtl_try_block PARAMS ((tree));
static void genrtl_eh_spec_block PARAMS ((tree));
static void genrtl_handler PARAMS ((tree));
static void genrtl_named_return_value PARAMS ((void));
static void cp_expand_stmt PARAMS ((tree));
c-common.h (genrtl_clear_out_block): Remove. * c-common.h (genrtl_clear_out_block): Remove. * c-semantics.c (genrtl_clear_out_block): Remove. (genrtl_while_stmt): Don't call it. (genrtl_for_stmt): Likewise. * cp-tree.h (struct saved_scope): Remove x_function_parms. (current_function_parms): Don't define. (struct cp_language_function): Remove parms_stored. (current_function_just_assigned_this): Don't define. (current_function_parms_stored): Likewise. (static_ctors): Declare. (static_dtors): Likewise. (SF_EXPAND): Don't define. (expand_start_early_try_stmts): Remove declaration. (store_parm_decls): Likewise. * decl.c (static_ctors): Don't declare. (static_dtors): Likewise. (struct binding_level): Remove this_block. (poplevel): Remove dead code. (set_block): Likewise. (mark_binding_level): Don't mark this_block. (mark_saved_scope): Don't mark x_function_parms. (init_decl_processing): Don't add current_function_parms as a GC root. (check_function_type): Change prototype. (start_function): Remove RTL-generation code. (expand_start_early_try_stmts): Remove. (store_parm_decls): Give it internal linkage. Remove RTL-generation code. (finish_function): Remove RTL-generation code. * decl2.c (static_ctors): Fix formatting. (static_dtors): Likewise. * method.c (use_thunk): Don't call store_parm_decls. (synthesize_method): Likewise. * optimize.c (maybe_clone_body): Likewise. * parse.y (fn.def2): Likewise. (.set_base_init): Likewise. (nodecls): Likewise. * pt.c (instantiate_decl): Likewise. * rtti.c (synthesize_tinfo_fn): Likewise. * semantics.c (genrtl_try_block): Simplify. (expand_body): Use genrtl_start_function and genrtl_finish_function. (genrtl_start_function): New function. (genrtl_finish_function): Likewise. From-SVN: r36350
2000-09-12 08:46:00 +02:00
static void genrtl_start_function PARAMS ((tree));
static void genrtl_finish_function PARAMS ((tree));
static tree clear_decl_rtl PARAMS ((tree *, int *, void *));
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
/* Finish processing the COND, the SUBSTMT condition for STMT. */
#define FINISH_COND(COND, STMT, SUBSTMT) \
do { \
if (last_tree != (STMT)) \
{ \
RECHAIN_STMTS (STMT, SUBSTMT); \
if (!processing_template_decl) \
{ \
(COND) = build_tree_list (SUBSTMT, COND); \
(SUBSTMT) = (COND); \
} \
} \
else \
(SUBSTMT) = (COND); \
} while (0)
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
/* Returns nonzero if the current statement is a full expression,
Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. 2000-07-01 Benjamin Chelf <chelf@codesourcery.com> * Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. (c-semantics.o): New target. * c-common.h (TREE_LANG_FLAG_?): Added documentation. (genrtl_do_pushlevel): Moved from cp/cp-tree.h. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (gerntl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (expand_cond): Likewise. (expand_stmt): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. (do_case): Likewise. (COMPOUND_STMT_NO_SCOPE): Likewise. (c_expand_asm_operands): Likewise. (NEW_FOR_SCOPE_P): New macro. (expand_expr_stmt_fn): New type. (set_current_function_name_declared): Likewise. (current_function_name_declared): Likewise. (lang_expand_stmt): Likewise. (stmts_are_full_exprs_p): Likewise. (anon_aggr_type_p): Likewise. (lang_expand_expr_stmt): Likewise. (build_case_label): Likewise. * c-decl.c (lang_expand_expr_stmt): Initialize. (stmts_are_full_exprs_p): Define. (current_function_name_declared): Likewise. (do_case): Likewise. (lang_expand_stmt): Likewise. (set_current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (build_case_label): Likewise. * c-semantics.c: New file. (expand_cond): Moved from cp/semantics.c. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (make_rtl_for_local_static): Moved from cp/decl.c. (emit_local_var): Likewise. (expand_stmt): Define. * c-tree.h: (c_expand_asm_operands): Moved to c-common.h. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/Make-lang.in (cc1plus$(exeext)): Added c-semantics.o. * cp/Makefile.in (OBJS): Added ../c-semantics.o. (OBJDEPS): Likewise. * cp/cp-tree.h (TREE_LANG_FLAG_?): Moved common documentation to ../c-common.h. (struct stmt_tree): Added comment. (current_function_name_declared): Removed. (stmts_are_full_exprs_p): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (COMPOUND_STMT_NO_SCOPE): Moved to ../c-common.h. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (do_case): Likewise. (expand_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (c_expand_asm_operands): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/decl.c (make_rtl_for_local_static): Moved to c-semantics.c. (emit_local_var): Likewise. (initialize_local_var): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (push_cp_function_context): Likewise. * cp/expect.c (expand_throw): Change reference to stmts_are_full_exprs_p. * cp/init.c (build_aggr_init): Change reference to stmts_are_full_exprs_p. (build_vec_init): Likewise. * cp/optimize.c (maybe_clone_body): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/pt.c (instantiate_decl): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/semantics.c (expand_cond): Moved declaration to c-common.h. (genrtl_do_pushlevel): Moved to c-semantics.c. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (gerntl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (expand_cond): Likewise. (expand_stmt): Renamed to ... (lang_expand_stmt): ... this. (lang_expand_expr_stmt): Initialize. (set_current_function_name_declared): Likewise. (stmts_are_full_exprs_p): Likewise. (current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (do_poplevel): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (add_tree): Likewise. (finish_expr_stmt): Likewise. (prep_stmt): Likewise. (lang_expand_stmt): Likewise. (begin_compound_stmt): Change reference to current_function_name_declared to cp_function_chain->name_declared and call to current_function_name_declared(). (setup_vtbl_ptr): Likewise. (genrtl_do_poplevel): Removed. From-SVN: r34827
2000-07-02 07:23:01 +02:00
i.e. temporaries created during that statement should be destroyed
at the end of the statement. */
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. 2000-07-01 Benjamin Chelf <chelf@codesourcery.com> * Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. (c-semantics.o): New target. * c-common.h (TREE_LANG_FLAG_?): Added documentation. (genrtl_do_pushlevel): Moved from cp/cp-tree.h. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (gerntl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (expand_cond): Likewise. (expand_stmt): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. (do_case): Likewise. (COMPOUND_STMT_NO_SCOPE): Likewise. (c_expand_asm_operands): Likewise. (NEW_FOR_SCOPE_P): New macro. (expand_expr_stmt_fn): New type. (set_current_function_name_declared): Likewise. (current_function_name_declared): Likewise. (lang_expand_stmt): Likewise. (stmts_are_full_exprs_p): Likewise. (anon_aggr_type_p): Likewise. (lang_expand_expr_stmt): Likewise. (build_case_label): Likewise. * c-decl.c (lang_expand_expr_stmt): Initialize. (stmts_are_full_exprs_p): Define. (current_function_name_declared): Likewise. (do_case): Likewise. (lang_expand_stmt): Likewise. (set_current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (build_case_label): Likewise. * c-semantics.c: New file. (expand_cond): Moved from cp/semantics.c. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (make_rtl_for_local_static): Moved from cp/decl.c. (emit_local_var): Likewise. (expand_stmt): Define. * c-tree.h: (c_expand_asm_operands): Moved to c-common.h. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/Make-lang.in (cc1plus$(exeext)): Added c-semantics.o. * cp/Makefile.in (OBJS): Added ../c-semantics.o. (OBJDEPS): Likewise. * cp/cp-tree.h (TREE_LANG_FLAG_?): Moved common documentation to ../c-common.h. (struct stmt_tree): Added comment. (current_function_name_declared): Removed. (stmts_are_full_exprs_p): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (COMPOUND_STMT_NO_SCOPE): Moved to ../c-common.h. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (do_case): Likewise. (expand_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (c_expand_asm_operands): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/decl.c (make_rtl_for_local_static): Moved to c-semantics.c. (emit_local_var): Likewise. (initialize_local_var): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (push_cp_function_context): Likewise. * cp/expect.c (expand_throw): Change reference to stmts_are_full_exprs_p. * cp/init.c (build_aggr_init): Change reference to stmts_are_full_exprs_p. (build_vec_init): Likewise. * cp/optimize.c (maybe_clone_body): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/pt.c (instantiate_decl): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/semantics.c (expand_cond): Moved declaration to c-common.h. (genrtl_do_pushlevel): Moved to c-semantics.c. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (gerntl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (expand_cond): Likewise. (expand_stmt): Renamed to ... (lang_expand_stmt): ... this. (lang_expand_expr_stmt): Initialize. (set_current_function_name_declared): Likewise. (stmts_are_full_exprs_p): Likewise. (current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (do_poplevel): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (add_tree): Likewise. (finish_expr_stmt): Likewise. (prep_stmt): Likewise. (lang_expand_stmt): Likewise. (begin_compound_stmt): Change reference to current_function_name_declared to cp_function_chain->name_declared and call to current_function_name_declared(). (setup_vtbl_ptr): Likewise. (genrtl_do_poplevel): Removed. From-SVN: r34827
2000-07-02 07:23:01 +02:00
int
stmts_are_full_exprs_p ()
{
Move statement-tree facilities from C++ to C front-end. * c-common.h (c_tree_index): Add CTI_VOID_ZERO. (void_zero_node): New macro. (struct stmt_tree_s): New type. (stmt_tree): New typedef. (struct language_function): New type. (last_tree): New macro. (last_expr_type): Likewise. (walk_tree_fn): New typedef. (current_stmt_tree): New function. (begin_stmt_tree): Likewise. (add_stmt): Likewise. (finish_stmt_tree): Likewise. (statement_code_p): Likewise. (lang_statement_code_p): New variable. (walk_stmt_tree): New function. (STMT_IS_FULL_EXPR_P): New macro. * c-common.c (lang_statement_code_p): New variable. (c_common_nodes_and_builtins): Initialize void_zero_node. (statement_code_p): New function. (walk_stmt_tree): Likewise. * c-decl.c (language_function): Rename to ... (c_language_function): ... this. Include language_function. (push_c_function_context): Adjust accordingly. (pop_c_function_context): Likewise. (mark_c_function_context): Likewise. (current_stmt_tree): Define. * c-semantics.c (begin_stmt_tree): New function. (add_stmt): Likewise. (prune_unused_decls): Likewise. (finish_stmt_tree): Likewise. Move statement-tree facilities from C++ to C front-end. * cp-tree.h (cp_tree_index): Remove CPTI_VOID_ZERO. (void_zero_node): Remove. (stmt_tree): Likewise. (scope_chain): Adjust. (language_function): Rename to cp_language_function. (cp_function_chain): Adjust. (current_stmt_tree): Remove. (last_tree): Likewise. (last_expr_type): Likewise. (struct lang_decl): Adjust. (STMT_IS_FULL_EXPR_P): Remove. (add_tree): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (walk_tree_fn): Likewise. (walk_stmt_tree): Likewise. * class.c (finish_struct): Replace use of add_tree with add_stmt. * decl.c (mark_stmt_tree): Adjust type. (init_decl_processing): Don't build void_zero_node. (initialize_local_var): Adjust usage of current_stmt_tree. (finish_enum): Use add_stmt, not add_tree. (save_function_data): Adjust use of language_function. (finish_constructor_body): Use add_stmt, not add_tree. (finish_destructor_body): Likewise. (push_cp_function_context): Adjust use of language_function. (pop_cp_function_context): Likewise. (mark_lang_function): Likewise. (mark_cp_function_context): Likewise. * init.c (build_aggr_init): Adjust use of current_stmt_tree. (build_vec_init): Likewise. * semantics.c (SET_LAST_STMT): Remove. (RECHAIN_STMTS): Don't use it. (stmts_are_full_exprs_p): Adjust use of current_stmt_tree. (current_stmt_tree): Define. (add_tree): Remove. (finish_goto_stmt): Use add_stmt, not add_tree. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_then_clause): Likewise. (begin_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (begin_handler): Likewise. (begin_catch_block): Likewise. (begin_compound_stmt): Likewise. (begin_asm_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (add_decl_stmt): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (setup_vtbl_ptr): Likewise. (add_scope_stmt): Likewise. (finish_stmt_expr): Likewise. (prune_unused_decls): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (prep_stmt): Adjust use of current_stmt_tree. (lang_expand_stmt): Likewise. * tree.c (statement_code_p): Remove. (cp_statement_code_p): New function. (walk_stmt_tree): Remove. (init_tree): Set lang_statement_code_p. From-SVN: r36221
2000-09-07 03:36:11 +02:00
return current_stmt_tree ()->stmts_are_full_exprs_p;
}
/* Returns the stmt_tree (if any) to which statements are currently
being added. If there is no active statement-tree, NULL is
returned. */
stmt_tree
current_stmt_tree ()
{
return (cfun
? &cfun->language->base.x_stmt_tree
Move statement-tree facilities from C++ to C front-end. * c-common.h (c_tree_index): Add CTI_VOID_ZERO. (void_zero_node): New macro. (struct stmt_tree_s): New type. (stmt_tree): New typedef. (struct language_function): New type. (last_tree): New macro. (last_expr_type): Likewise. (walk_tree_fn): New typedef. (current_stmt_tree): New function. (begin_stmt_tree): Likewise. (add_stmt): Likewise. (finish_stmt_tree): Likewise. (statement_code_p): Likewise. (lang_statement_code_p): New variable. (walk_stmt_tree): New function. (STMT_IS_FULL_EXPR_P): New macro. * c-common.c (lang_statement_code_p): New variable. (c_common_nodes_and_builtins): Initialize void_zero_node. (statement_code_p): New function. (walk_stmt_tree): Likewise. * c-decl.c (language_function): Rename to ... (c_language_function): ... this. Include language_function. (push_c_function_context): Adjust accordingly. (pop_c_function_context): Likewise. (mark_c_function_context): Likewise. (current_stmt_tree): Define. * c-semantics.c (begin_stmt_tree): New function. (add_stmt): Likewise. (prune_unused_decls): Likewise. (finish_stmt_tree): Likewise. Move statement-tree facilities from C++ to C front-end. * cp-tree.h (cp_tree_index): Remove CPTI_VOID_ZERO. (void_zero_node): Remove. (stmt_tree): Likewise. (scope_chain): Adjust. (language_function): Rename to cp_language_function. (cp_function_chain): Adjust. (current_stmt_tree): Remove. (last_tree): Likewise. (last_expr_type): Likewise. (struct lang_decl): Adjust. (STMT_IS_FULL_EXPR_P): Remove. (add_tree): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (walk_tree_fn): Likewise. (walk_stmt_tree): Likewise. * class.c (finish_struct): Replace use of add_tree with add_stmt. * decl.c (mark_stmt_tree): Adjust type. (init_decl_processing): Don't build void_zero_node. (initialize_local_var): Adjust usage of current_stmt_tree. (finish_enum): Use add_stmt, not add_tree. (save_function_data): Adjust use of language_function. (finish_constructor_body): Use add_stmt, not add_tree. (finish_destructor_body): Likewise. (push_cp_function_context): Adjust use of language_function. (pop_cp_function_context): Likewise. (mark_lang_function): Likewise. (mark_cp_function_context): Likewise. * init.c (build_aggr_init): Adjust use of current_stmt_tree. (build_vec_init): Likewise. * semantics.c (SET_LAST_STMT): Remove. (RECHAIN_STMTS): Don't use it. (stmts_are_full_exprs_p): Adjust use of current_stmt_tree. (current_stmt_tree): Define. (add_tree): Remove. (finish_goto_stmt): Use add_stmt, not add_tree. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_then_clause): Likewise. (begin_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (begin_handler): Likewise. (begin_catch_block): Likewise. (begin_compound_stmt): Likewise. (begin_asm_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (add_decl_stmt): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (setup_vtbl_ptr): Likewise. (add_scope_stmt): Likewise. (finish_stmt_expr): Likewise. (prune_unused_decls): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (prep_stmt): Adjust use of current_stmt_tree. (lang_expand_stmt): Likewise. * tree.c (statement_code_p): Remove. (cp_statement_code_p): New function. (walk_stmt_tree): Remove. (init_tree): Set lang_statement_code_p. From-SVN: r36221
2000-09-07 03:36:11 +02:00
: &scope_chain->x_stmt_tree);
Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. 2000-07-01 Benjamin Chelf <chelf@codesourcery.com> * Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. (c-semantics.o): New target. * c-common.h (TREE_LANG_FLAG_?): Added documentation. (genrtl_do_pushlevel): Moved from cp/cp-tree.h. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (gerntl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (expand_cond): Likewise. (expand_stmt): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. (do_case): Likewise. (COMPOUND_STMT_NO_SCOPE): Likewise. (c_expand_asm_operands): Likewise. (NEW_FOR_SCOPE_P): New macro. (expand_expr_stmt_fn): New type. (set_current_function_name_declared): Likewise. (current_function_name_declared): Likewise. (lang_expand_stmt): Likewise. (stmts_are_full_exprs_p): Likewise. (anon_aggr_type_p): Likewise. (lang_expand_expr_stmt): Likewise. (build_case_label): Likewise. * c-decl.c (lang_expand_expr_stmt): Initialize. (stmts_are_full_exprs_p): Define. (current_function_name_declared): Likewise. (do_case): Likewise. (lang_expand_stmt): Likewise. (set_current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (build_case_label): Likewise. * c-semantics.c: New file. (expand_cond): Moved from cp/semantics.c. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (make_rtl_for_local_static): Moved from cp/decl.c. (emit_local_var): Likewise. (expand_stmt): Define. * c-tree.h: (c_expand_asm_operands): Moved to c-common.h. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/Make-lang.in (cc1plus$(exeext)): Added c-semantics.o. * cp/Makefile.in (OBJS): Added ../c-semantics.o. (OBJDEPS): Likewise. * cp/cp-tree.h (TREE_LANG_FLAG_?): Moved common documentation to ../c-common.h. (struct stmt_tree): Added comment. (current_function_name_declared): Removed. (stmts_are_full_exprs_p): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (COMPOUND_STMT_NO_SCOPE): Moved to ../c-common.h. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (do_case): Likewise. (expand_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (c_expand_asm_operands): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/decl.c (make_rtl_for_local_static): Moved to c-semantics.c. (emit_local_var): Likewise. (initialize_local_var): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (push_cp_function_context): Likewise. * cp/expect.c (expand_throw): Change reference to stmts_are_full_exprs_p. * cp/init.c (build_aggr_init): Change reference to stmts_are_full_exprs_p. (build_vec_init): Likewise. * cp/optimize.c (maybe_clone_body): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/pt.c (instantiate_decl): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/semantics.c (expand_cond): Moved declaration to c-common.h. (genrtl_do_pushlevel): Moved to c-semantics.c. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (gerntl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (expand_cond): Likewise. (expand_stmt): Renamed to ... (lang_expand_stmt): ... this. (lang_expand_expr_stmt): Initialize. (set_current_function_name_declared): Likewise. (stmts_are_full_exprs_p): Likewise. (current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (do_poplevel): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (add_tree): Likewise. (finish_expr_stmt): Likewise. (prep_stmt): Likewise. (lang_expand_stmt): Likewise. (begin_compound_stmt): Change reference to current_function_name_declared to cp_function_chain->name_declared and call to current_function_name_declared(). (setup_vtbl_ptr): Likewise. (genrtl_do_poplevel): Removed. From-SVN: r34827
2000-07-02 07:23:01 +02:00
}
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. 2000-07-01 Benjamin Chelf <chelf@codesourcery.com> * Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. (c-semantics.o): New target. * c-common.h (TREE_LANG_FLAG_?): Added documentation. (genrtl_do_pushlevel): Moved from cp/cp-tree.h. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (gerntl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (expand_cond): Likewise. (expand_stmt): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. (do_case): Likewise. (COMPOUND_STMT_NO_SCOPE): Likewise. (c_expand_asm_operands): Likewise. (NEW_FOR_SCOPE_P): New macro. (expand_expr_stmt_fn): New type. (set_current_function_name_declared): Likewise. (current_function_name_declared): Likewise. (lang_expand_stmt): Likewise. (stmts_are_full_exprs_p): Likewise. (anon_aggr_type_p): Likewise. (lang_expand_expr_stmt): Likewise. (build_case_label): Likewise. * c-decl.c (lang_expand_expr_stmt): Initialize. (stmts_are_full_exprs_p): Define. (current_function_name_declared): Likewise. (do_case): Likewise. (lang_expand_stmt): Likewise. (set_current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (build_case_label): Likewise. * c-semantics.c: New file. (expand_cond): Moved from cp/semantics.c. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (make_rtl_for_local_static): Moved from cp/decl.c. (emit_local_var): Likewise. (expand_stmt): Define. * c-tree.h: (c_expand_asm_operands): Moved to c-common.h. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/Make-lang.in (cc1plus$(exeext)): Added c-semantics.o. * cp/Makefile.in (OBJS): Added ../c-semantics.o. (OBJDEPS): Likewise. * cp/cp-tree.h (TREE_LANG_FLAG_?): Moved common documentation to ../c-common.h. (struct stmt_tree): Added comment. (current_function_name_declared): Removed. (stmts_are_full_exprs_p): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (COMPOUND_STMT_NO_SCOPE): Moved to ../c-common.h. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (do_case): Likewise. (expand_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (c_expand_asm_operands): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/decl.c (make_rtl_for_local_static): Moved to c-semantics.c. (emit_local_var): Likewise. (initialize_local_var): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (push_cp_function_context): Likewise. * cp/expect.c (expand_throw): Change reference to stmts_are_full_exprs_p. * cp/init.c (build_aggr_init): Change reference to stmts_are_full_exprs_p. (build_vec_init): Likewise. * cp/optimize.c (maybe_clone_body): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/pt.c (instantiate_decl): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/semantics.c (expand_cond): Moved declaration to c-common.h. (genrtl_do_pushlevel): Moved to c-semantics.c. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (gerntl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (expand_cond): Likewise. (expand_stmt): Renamed to ... (lang_expand_stmt): ... this. (lang_expand_expr_stmt): Initialize. (set_current_function_name_declared): Likewise. (stmts_are_full_exprs_p): Likewise. (current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (do_poplevel): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (add_tree): Likewise. (finish_expr_stmt): Likewise. (prep_stmt): Likewise. (lang_expand_stmt): Likewise. (begin_compound_stmt): Change reference to current_function_name_declared to cp_function_chain->name_declared and call to current_function_name_declared(). (setup_vtbl_ptr): Likewise. (genrtl_do_poplevel): Removed. From-SVN: r34827
2000-07-02 07:23:01 +02:00
/* Nonzero if TYPE is an anonymous union or struct type. We have to use a
flag for this because "A union for which objects or pointers are
declared is not an anonymous union" [class.union]. */
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. 2000-07-01 Benjamin Chelf <chelf@codesourcery.com> * Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. (c-semantics.o): New target. * c-common.h (TREE_LANG_FLAG_?): Added documentation. (genrtl_do_pushlevel): Moved from cp/cp-tree.h. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (gerntl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (expand_cond): Likewise. (expand_stmt): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. (do_case): Likewise. (COMPOUND_STMT_NO_SCOPE): Likewise. (c_expand_asm_operands): Likewise. (NEW_FOR_SCOPE_P): New macro. (expand_expr_stmt_fn): New type. (set_current_function_name_declared): Likewise. (current_function_name_declared): Likewise. (lang_expand_stmt): Likewise. (stmts_are_full_exprs_p): Likewise. (anon_aggr_type_p): Likewise. (lang_expand_expr_stmt): Likewise. (build_case_label): Likewise. * c-decl.c (lang_expand_expr_stmt): Initialize. (stmts_are_full_exprs_p): Define. (current_function_name_declared): Likewise. (do_case): Likewise. (lang_expand_stmt): Likewise. (set_current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (build_case_label): Likewise. * c-semantics.c: New file. (expand_cond): Moved from cp/semantics.c. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (make_rtl_for_local_static): Moved from cp/decl.c. (emit_local_var): Likewise. (expand_stmt): Define. * c-tree.h: (c_expand_asm_operands): Moved to c-common.h. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/Make-lang.in (cc1plus$(exeext)): Added c-semantics.o. * cp/Makefile.in (OBJS): Added ../c-semantics.o. (OBJDEPS): Likewise. * cp/cp-tree.h (TREE_LANG_FLAG_?): Moved common documentation to ../c-common.h. (struct stmt_tree): Added comment. (current_function_name_declared): Removed. (stmts_are_full_exprs_p): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (COMPOUND_STMT_NO_SCOPE): Moved to ../c-common.h. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (do_case): Likewise. (expand_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (c_expand_asm_operands): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/decl.c (make_rtl_for_local_static): Moved to c-semantics.c. (emit_local_var): Likewise. (initialize_local_var): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (push_cp_function_context): Likewise. * cp/expect.c (expand_throw): Change reference to stmts_are_full_exprs_p. * cp/init.c (build_aggr_init): Change reference to stmts_are_full_exprs_p. (build_vec_init): Likewise. * cp/optimize.c (maybe_clone_body): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/pt.c (instantiate_decl): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/semantics.c (expand_cond): Moved declaration to c-common.h. (genrtl_do_pushlevel): Moved to c-semantics.c. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (gerntl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (expand_cond): Likewise. (expand_stmt): Renamed to ... (lang_expand_stmt): ... this. (lang_expand_expr_stmt): Initialize. (set_current_function_name_declared): Likewise. (stmts_are_full_exprs_p): Likewise. (current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (do_poplevel): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (add_tree): Likewise. (finish_expr_stmt): Likewise. (prep_stmt): Likewise. (lang_expand_stmt): Likewise. (begin_compound_stmt): Change reference to current_function_name_declared to cp_function_chain->name_declared and call to current_function_name_declared(). (setup_vtbl_ptr): Likewise. (genrtl_do_poplevel): Removed. From-SVN: r34827
2000-07-02 07:23:01 +02:00
int
anon_aggr_type_p (node)
tree node;
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
{
return ANON_AGGR_TYPE_P (node);
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
}
Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. 2000-07-01 Benjamin Chelf <chelf@codesourcery.com> * Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. (c-semantics.o): New target. * c-common.h (TREE_LANG_FLAG_?): Added documentation. (genrtl_do_pushlevel): Moved from cp/cp-tree.h. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (gerntl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (expand_cond): Likewise. (expand_stmt): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. (do_case): Likewise. (COMPOUND_STMT_NO_SCOPE): Likewise. (c_expand_asm_operands): Likewise. (NEW_FOR_SCOPE_P): New macro. (expand_expr_stmt_fn): New type. (set_current_function_name_declared): Likewise. (current_function_name_declared): Likewise. (lang_expand_stmt): Likewise. (stmts_are_full_exprs_p): Likewise. (anon_aggr_type_p): Likewise. (lang_expand_expr_stmt): Likewise. (build_case_label): Likewise. * c-decl.c (lang_expand_expr_stmt): Initialize. (stmts_are_full_exprs_p): Define. (current_function_name_declared): Likewise. (do_case): Likewise. (lang_expand_stmt): Likewise. (set_current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (build_case_label): Likewise. * c-semantics.c: New file. (expand_cond): Moved from cp/semantics.c. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (make_rtl_for_local_static): Moved from cp/decl.c. (emit_local_var): Likewise. (expand_stmt): Define. * c-tree.h: (c_expand_asm_operands): Moved to c-common.h. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/Make-lang.in (cc1plus$(exeext)): Added c-semantics.o. * cp/Makefile.in (OBJS): Added ../c-semantics.o. (OBJDEPS): Likewise. * cp/cp-tree.h (TREE_LANG_FLAG_?): Moved common documentation to ../c-common.h. (struct stmt_tree): Added comment. (current_function_name_declared): Removed. (stmts_are_full_exprs_p): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (COMPOUND_STMT_NO_SCOPE): Moved to ../c-common.h. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (do_case): Likewise. (expand_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (c_expand_asm_operands): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/decl.c (make_rtl_for_local_static): Moved to c-semantics.c. (emit_local_var): Likewise. (initialize_local_var): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (push_cp_function_context): Likewise. * cp/expect.c (expand_throw): Change reference to stmts_are_full_exprs_p. * cp/init.c (build_aggr_init): Change reference to stmts_are_full_exprs_p. (build_vec_init): Likewise. * cp/optimize.c (maybe_clone_body): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/pt.c (instantiate_decl): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/semantics.c (expand_cond): Moved declaration to c-common.h. (genrtl_do_pushlevel): Moved to c-semantics.c. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (gerntl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (expand_cond): Likewise. (expand_stmt): Renamed to ... (lang_expand_stmt): ... this. (lang_expand_expr_stmt): Initialize. (set_current_function_name_declared): Likewise. (stmts_are_full_exprs_p): Likewise. (current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (do_poplevel): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (add_tree): Likewise. (finish_expr_stmt): Likewise. (prep_stmt): Likewise. (lang_expand_stmt): Likewise. (begin_compound_stmt): Change reference to current_function_name_declared to cp_function_chain->name_declared and call to current_function_name_declared(). (setup_vtbl_ptr): Likewise. (genrtl_do_poplevel): Removed. From-SVN: r34827
2000-07-02 07:23:01 +02:00
/* Finish a scope. */
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
tree
Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. 2000-07-01 Benjamin Chelf <chelf@codesourcery.com> * Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. (c-semantics.o): New target. * c-common.h (TREE_LANG_FLAG_?): Added documentation. (genrtl_do_pushlevel): Moved from cp/cp-tree.h. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (gerntl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (expand_cond): Likewise. (expand_stmt): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. (do_case): Likewise. (COMPOUND_STMT_NO_SCOPE): Likewise. (c_expand_asm_operands): Likewise. (NEW_FOR_SCOPE_P): New macro. (expand_expr_stmt_fn): New type. (set_current_function_name_declared): Likewise. (current_function_name_declared): Likewise. (lang_expand_stmt): Likewise. (stmts_are_full_exprs_p): Likewise. (anon_aggr_type_p): Likewise. (lang_expand_expr_stmt): Likewise. (build_case_label): Likewise. * c-decl.c (lang_expand_expr_stmt): Initialize. (stmts_are_full_exprs_p): Define. (current_function_name_declared): Likewise. (do_case): Likewise. (lang_expand_stmt): Likewise. (set_current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (build_case_label): Likewise. * c-semantics.c: New file. (expand_cond): Moved from cp/semantics.c. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (make_rtl_for_local_static): Moved from cp/decl.c. (emit_local_var): Likewise. (expand_stmt): Define. * c-tree.h: (c_expand_asm_operands): Moved to c-common.h. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/Make-lang.in (cc1plus$(exeext)): Added c-semantics.o. * cp/Makefile.in (OBJS): Added ../c-semantics.o. (OBJDEPS): Likewise. * cp/cp-tree.h (TREE_LANG_FLAG_?): Moved common documentation to ../c-common.h. (struct stmt_tree): Added comment. (current_function_name_declared): Removed. (stmts_are_full_exprs_p): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (COMPOUND_STMT_NO_SCOPE): Moved to ../c-common.h. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (do_case): Likewise. (expand_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (c_expand_asm_operands): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/decl.c (make_rtl_for_local_static): Moved to c-semantics.c. (emit_local_var): Likewise. (initialize_local_var): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (push_cp_function_context): Likewise. * cp/expect.c (expand_throw): Change reference to stmts_are_full_exprs_p. * cp/init.c (build_aggr_init): Change reference to stmts_are_full_exprs_p. (build_vec_init): Likewise. * cp/optimize.c (maybe_clone_body): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/pt.c (instantiate_decl): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/semantics.c (expand_cond): Moved declaration to c-common.h. (genrtl_do_pushlevel): Moved to c-semantics.c. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (gerntl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (expand_cond): Likewise. (expand_stmt): Renamed to ... (lang_expand_stmt): ... this. (lang_expand_expr_stmt): Initialize. (set_current_function_name_declared): Likewise. (stmts_are_full_exprs_p): Likewise. (current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (do_poplevel): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (add_tree): Likewise. (finish_expr_stmt): Likewise. (prep_stmt): Likewise. (lang_expand_stmt): Likewise. (begin_compound_stmt): Change reference to current_function_name_declared to cp_function_chain->name_declared and call to current_function_name_declared(). (setup_vtbl_ptr): Likewise. (genrtl_do_poplevel): Removed. From-SVN: r34827
2000-07-02 07:23:01 +02:00
do_poplevel ()
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
{
tree block = NULL_TREE;
Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. 2000-07-01 Benjamin Chelf <chelf@codesourcery.com> * Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. (c-semantics.o): New target. * c-common.h (TREE_LANG_FLAG_?): Added documentation. (genrtl_do_pushlevel): Moved from cp/cp-tree.h. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (gerntl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (expand_cond): Likewise. (expand_stmt): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. (do_case): Likewise. (COMPOUND_STMT_NO_SCOPE): Likewise. (c_expand_asm_operands): Likewise. (NEW_FOR_SCOPE_P): New macro. (expand_expr_stmt_fn): New type. (set_current_function_name_declared): Likewise. (current_function_name_declared): Likewise. (lang_expand_stmt): Likewise. (stmts_are_full_exprs_p): Likewise. (anon_aggr_type_p): Likewise. (lang_expand_expr_stmt): Likewise. (build_case_label): Likewise. * c-decl.c (lang_expand_expr_stmt): Initialize. (stmts_are_full_exprs_p): Define. (current_function_name_declared): Likewise. (do_case): Likewise. (lang_expand_stmt): Likewise. (set_current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (build_case_label): Likewise. * c-semantics.c: New file. (expand_cond): Moved from cp/semantics.c. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (make_rtl_for_local_static): Moved from cp/decl.c. (emit_local_var): Likewise. (expand_stmt): Define. * c-tree.h: (c_expand_asm_operands): Moved to c-common.h. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/Make-lang.in (cc1plus$(exeext)): Added c-semantics.o. * cp/Makefile.in (OBJS): Added ../c-semantics.o. (OBJDEPS): Likewise. * cp/cp-tree.h (TREE_LANG_FLAG_?): Moved common documentation to ../c-common.h. (struct stmt_tree): Added comment. (current_function_name_declared): Removed. (stmts_are_full_exprs_p): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (COMPOUND_STMT_NO_SCOPE): Moved to ../c-common.h. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (do_case): Likewise. (expand_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (c_expand_asm_operands): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/decl.c (make_rtl_for_local_static): Moved to c-semantics.c. (emit_local_var): Likewise. (initialize_local_var): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (push_cp_function_context): Likewise. * cp/expect.c (expand_throw): Change reference to stmts_are_full_exprs_p. * cp/init.c (build_aggr_init): Change reference to stmts_are_full_exprs_p. (build_vec_init): Likewise. * cp/optimize.c (maybe_clone_body): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/pt.c (instantiate_decl): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/semantics.c (expand_cond): Moved declaration to c-common.h. (genrtl_do_pushlevel): Moved to c-semantics.c. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (gerntl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (expand_cond): Likewise. (expand_stmt): Renamed to ... (lang_expand_stmt): ... this. (lang_expand_expr_stmt): Initialize. (set_current_function_name_declared): Likewise. (stmts_are_full_exprs_p): Likewise. (current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (do_poplevel): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (add_tree): Likewise. (finish_expr_stmt): Likewise. (prep_stmt): Likewise. (lang_expand_stmt): Likewise. (begin_compound_stmt): Change reference to current_function_name_declared to cp_function_chain->name_declared and call to current_function_name_declared(). (setup_vtbl_ptr): Likewise. (genrtl_do_poplevel): Removed. From-SVN: r34827
2000-07-02 07:23:01 +02:00
if (stmts_are_full_exprs_p ())
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
{
tree scope_stmts = NULL_TREE;
Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. 2000-07-01 Benjamin Chelf <chelf@codesourcery.com> * Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. (c-semantics.o): New target. * c-common.h (TREE_LANG_FLAG_?): Added documentation. (genrtl_do_pushlevel): Moved from cp/cp-tree.h. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (gerntl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (expand_cond): Likewise. (expand_stmt): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. (do_case): Likewise. (COMPOUND_STMT_NO_SCOPE): Likewise. (c_expand_asm_operands): Likewise. (NEW_FOR_SCOPE_P): New macro. (expand_expr_stmt_fn): New type. (set_current_function_name_declared): Likewise. (current_function_name_declared): Likewise. (lang_expand_stmt): Likewise. (stmts_are_full_exprs_p): Likewise. (anon_aggr_type_p): Likewise. (lang_expand_expr_stmt): Likewise. (build_case_label): Likewise. * c-decl.c (lang_expand_expr_stmt): Initialize. (stmts_are_full_exprs_p): Define. (current_function_name_declared): Likewise. (do_case): Likewise. (lang_expand_stmt): Likewise. (set_current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (build_case_label): Likewise. * c-semantics.c: New file. (expand_cond): Moved from cp/semantics.c. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (make_rtl_for_local_static): Moved from cp/decl.c. (emit_local_var): Likewise. (expand_stmt): Define. * c-tree.h: (c_expand_asm_operands): Moved to c-common.h. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/Make-lang.in (cc1plus$(exeext)): Added c-semantics.o. * cp/Makefile.in (OBJS): Added ../c-semantics.o. (OBJDEPS): Likewise. * cp/cp-tree.h (TREE_LANG_FLAG_?): Moved common documentation to ../c-common.h. (struct stmt_tree): Added comment. (current_function_name_declared): Removed. (stmts_are_full_exprs_p): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (COMPOUND_STMT_NO_SCOPE): Moved to ../c-common.h. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (do_case): Likewise. (expand_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (c_expand_asm_operands): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/decl.c (make_rtl_for_local_static): Moved to c-semantics.c. (emit_local_var): Likewise. (initialize_local_var): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (push_cp_function_context): Likewise. * cp/expect.c (expand_throw): Change reference to stmts_are_full_exprs_p. * cp/init.c (build_aggr_init): Change reference to stmts_are_full_exprs_p. (build_vec_init): Likewise. * cp/optimize.c (maybe_clone_body): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/pt.c (instantiate_decl): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/semantics.c (expand_cond): Moved declaration to c-common.h. (genrtl_do_pushlevel): Moved to c-semantics.c. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (gerntl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (expand_cond): Likewise. (expand_stmt): Renamed to ... (lang_expand_stmt): ... this. (lang_expand_expr_stmt): Initialize. (set_current_function_name_declared): Likewise. (stmts_are_full_exprs_p): Likewise. (current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (do_poplevel): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (add_tree): Likewise. (finish_expr_stmt): Likewise. (prep_stmt): Likewise. (lang_expand_stmt): Likewise. (begin_compound_stmt): Change reference to current_function_name_declared to cp_function_chain->name_declared and call to current_function_name_declared(). (setup_vtbl_ptr): Likewise. (genrtl_do_poplevel): Removed. From-SVN: r34827
2000-07-02 07:23:01 +02:00
if (!processing_template_decl)
scope_stmts = add_scope_stmt (/*begin_p=*/0, /*partial_p=*/0);
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
block = poplevel (kept_level_p (), 1, 0);
if (block && !processing_template_decl)
{
SCOPE_STMT_BLOCK (TREE_PURPOSE (scope_stmts)) = block;
SCOPE_STMT_BLOCK (TREE_VALUE (scope_stmts)) = block;
}
}
return block;
}
Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. 2000-07-01 Benjamin Chelf <chelf@codesourcery.com> * Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. (c-semantics.o): New target. * c-common.h (TREE_LANG_FLAG_?): Added documentation. (genrtl_do_pushlevel): Moved from cp/cp-tree.h. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (gerntl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (expand_cond): Likewise. (expand_stmt): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. (do_case): Likewise. (COMPOUND_STMT_NO_SCOPE): Likewise. (c_expand_asm_operands): Likewise. (NEW_FOR_SCOPE_P): New macro. (expand_expr_stmt_fn): New type. (set_current_function_name_declared): Likewise. (current_function_name_declared): Likewise. (lang_expand_stmt): Likewise. (stmts_are_full_exprs_p): Likewise. (anon_aggr_type_p): Likewise. (lang_expand_expr_stmt): Likewise. (build_case_label): Likewise. * c-decl.c (lang_expand_expr_stmt): Initialize. (stmts_are_full_exprs_p): Define. (current_function_name_declared): Likewise. (do_case): Likewise. (lang_expand_stmt): Likewise. (set_current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (build_case_label): Likewise. * c-semantics.c: New file. (expand_cond): Moved from cp/semantics.c. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (make_rtl_for_local_static): Moved from cp/decl.c. (emit_local_var): Likewise. (expand_stmt): Define. * c-tree.h: (c_expand_asm_operands): Moved to c-common.h. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/Make-lang.in (cc1plus$(exeext)): Added c-semantics.o. * cp/Makefile.in (OBJS): Added ../c-semantics.o. (OBJDEPS): Likewise. * cp/cp-tree.h (TREE_LANG_FLAG_?): Moved common documentation to ../c-common.h. (struct stmt_tree): Added comment. (current_function_name_declared): Removed. (stmts_are_full_exprs_p): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (COMPOUND_STMT_NO_SCOPE): Moved to ../c-common.h. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (do_case): Likewise. (expand_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (c_expand_asm_operands): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/decl.c (make_rtl_for_local_static): Moved to c-semantics.c. (emit_local_var): Likewise. (initialize_local_var): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (push_cp_function_context): Likewise. * cp/expect.c (expand_throw): Change reference to stmts_are_full_exprs_p. * cp/init.c (build_aggr_init): Change reference to stmts_are_full_exprs_p. (build_vec_init): Likewise. * cp/optimize.c (maybe_clone_body): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/pt.c (instantiate_decl): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/semantics.c (expand_cond): Moved declaration to c-common.h. (genrtl_do_pushlevel): Moved to c-semantics.c. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (gerntl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (expand_cond): Likewise. (expand_stmt): Renamed to ... (lang_expand_stmt): ... this. (lang_expand_expr_stmt): Initialize. (set_current_function_name_declared): Likewise. (stmts_are_full_exprs_p): Likewise. (current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (do_poplevel): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (add_tree): Likewise. (finish_expr_stmt): Likewise. (prep_stmt): Likewise. (lang_expand_stmt): Likewise. (begin_compound_stmt): Change reference to current_function_name_declared to cp_function_chain->name_declared and call to current_function_name_declared(). (setup_vtbl_ptr): Likewise. (genrtl_do_poplevel): Removed. From-SVN: r34827
2000-07-02 07:23:01 +02:00
/* Begin a new scope. */
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
void
Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. 2000-07-01 Benjamin Chelf <chelf@codesourcery.com> * Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. (c-semantics.o): New target. * c-common.h (TREE_LANG_FLAG_?): Added documentation. (genrtl_do_pushlevel): Moved from cp/cp-tree.h. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (gerntl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (expand_cond): Likewise. (expand_stmt): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. (do_case): Likewise. (COMPOUND_STMT_NO_SCOPE): Likewise. (c_expand_asm_operands): Likewise. (NEW_FOR_SCOPE_P): New macro. (expand_expr_stmt_fn): New type. (set_current_function_name_declared): Likewise. (current_function_name_declared): Likewise. (lang_expand_stmt): Likewise. (stmts_are_full_exprs_p): Likewise. (anon_aggr_type_p): Likewise. (lang_expand_expr_stmt): Likewise. (build_case_label): Likewise. * c-decl.c (lang_expand_expr_stmt): Initialize. (stmts_are_full_exprs_p): Define. (current_function_name_declared): Likewise. (do_case): Likewise. (lang_expand_stmt): Likewise. (set_current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (build_case_label): Likewise. * c-semantics.c: New file. (expand_cond): Moved from cp/semantics.c. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (make_rtl_for_local_static): Moved from cp/decl.c. (emit_local_var): Likewise. (expand_stmt): Define. * c-tree.h: (c_expand_asm_operands): Moved to c-common.h. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/Make-lang.in (cc1plus$(exeext)): Added c-semantics.o. * cp/Makefile.in (OBJS): Added ../c-semantics.o. (OBJDEPS): Likewise. * cp/cp-tree.h (TREE_LANG_FLAG_?): Moved common documentation to ../c-common.h. (struct stmt_tree): Added comment. (current_function_name_declared): Removed. (stmts_are_full_exprs_p): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (COMPOUND_STMT_NO_SCOPE): Moved to ../c-common.h. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (do_case): Likewise. (expand_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (c_expand_asm_operands): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/decl.c (make_rtl_for_local_static): Moved to c-semantics.c. (emit_local_var): Likewise. (initialize_local_var): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (push_cp_function_context): Likewise. * cp/expect.c (expand_throw): Change reference to stmts_are_full_exprs_p. * cp/init.c (build_aggr_init): Change reference to stmts_are_full_exprs_p. (build_vec_init): Likewise. * cp/optimize.c (maybe_clone_body): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/pt.c (instantiate_decl): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/semantics.c (expand_cond): Moved declaration to c-common.h. (genrtl_do_pushlevel): Moved to c-semantics.c. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (gerntl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (expand_cond): Likewise. (expand_stmt): Renamed to ... (lang_expand_stmt): ... this. (lang_expand_expr_stmt): Initialize. (set_current_function_name_declared): Likewise. (stmts_are_full_exprs_p): Likewise. (current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (do_poplevel): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (add_tree): Likewise. (finish_expr_stmt): Likewise. (prep_stmt): Likewise. (lang_expand_stmt): Likewise. (begin_compound_stmt): Change reference to current_function_name_declared to cp_function_chain->name_declared and call to current_function_name_declared(). (setup_vtbl_ptr): Likewise. (genrtl_do_poplevel): Removed. From-SVN: r34827
2000-07-02 07:23:01 +02:00
do_pushlevel ()
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
{
Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. 2000-07-01 Benjamin Chelf <chelf@codesourcery.com> * Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. (c-semantics.o): New target. * c-common.h (TREE_LANG_FLAG_?): Added documentation. (genrtl_do_pushlevel): Moved from cp/cp-tree.h. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (gerntl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (expand_cond): Likewise. (expand_stmt): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. (do_case): Likewise. (COMPOUND_STMT_NO_SCOPE): Likewise. (c_expand_asm_operands): Likewise. (NEW_FOR_SCOPE_P): New macro. (expand_expr_stmt_fn): New type. (set_current_function_name_declared): Likewise. (current_function_name_declared): Likewise. (lang_expand_stmt): Likewise. (stmts_are_full_exprs_p): Likewise. (anon_aggr_type_p): Likewise. (lang_expand_expr_stmt): Likewise. (build_case_label): Likewise. * c-decl.c (lang_expand_expr_stmt): Initialize. (stmts_are_full_exprs_p): Define. (current_function_name_declared): Likewise. (do_case): Likewise. (lang_expand_stmt): Likewise. (set_current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (build_case_label): Likewise. * c-semantics.c: New file. (expand_cond): Moved from cp/semantics.c. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (make_rtl_for_local_static): Moved from cp/decl.c. (emit_local_var): Likewise. (expand_stmt): Define. * c-tree.h: (c_expand_asm_operands): Moved to c-common.h. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/Make-lang.in (cc1plus$(exeext)): Added c-semantics.o. * cp/Makefile.in (OBJS): Added ../c-semantics.o. (OBJDEPS): Likewise. * cp/cp-tree.h (TREE_LANG_FLAG_?): Moved common documentation to ../c-common.h. (struct stmt_tree): Added comment. (current_function_name_declared): Removed. (stmts_are_full_exprs_p): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (COMPOUND_STMT_NO_SCOPE): Moved to ../c-common.h. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (do_case): Likewise. (expand_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (c_expand_asm_operands): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/decl.c (make_rtl_for_local_static): Moved to c-semantics.c. (emit_local_var): Likewise. (initialize_local_var): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (push_cp_function_context): Likewise. * cp/expect.c (expand_throw): Change reference to stmts_are_full_exprs_p. * cp/init.c (build_aggr_init): Change reference to stmts_are_full_exprs_p. (build_vec_init): Likewise. * cp/optimize.c (maybe_clone_body): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/pt.c (instantiate_decl): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/semantics.c (expand_cond): Moved declaration to c-common.h. (genrtl_do_pushlevel): Moved to c-semantics.c. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (gerntl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (expand_cond): Likewise. (expand_stmt): Renamed to ... (lang_expand_stmt): ... this. (lang_expand_expr_stmt): Initialize. (set_current_function_name_declared): Likewise. (stmts_are_full_exprs_p): Likewise. (current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (do_poplevel): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (add_tree): Likewise. (finish_expr_stmt): Likewise. (prep_stmt): Likewise. (lang_expand_stmt): Likewise. (begin_compound_stmt): Change reference to current_function_name_declared to cp_function_chain->name_declared and call to current_function_name_declared(). (setup_vtbl_ptr): Likewise. (genrtl_do_poplevel): Removed. From-SVN: r34827
2000-07-02 07:23:01 +02:00
if (stmts_are_full_exprs_p ())
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
{
Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. 2000-07-01 Benjamin Chelf <chelf@codesourcery.com> * Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. (c-semantics.o): New target. * c-common.h (TREE_LANG_FLAG_?): Added documentation. (genrtl_do_pushlevel): Moved from cp/cp-tree.h. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (gerntl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (expand_cond): Likewise. (expand_stmt): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. (do_case): Likewise. (COMPOUND_STMT_NO_SCOPE): Likewise. (c_expand_asm_operands): Likewise. (NEW_FOR_SCOPE_P): New macro. (expand_expr_stmt_fn): New type. (set_current_function_name_declared): Likewise. (current_function_name_declared): Likewise. (lang_expand_stmt): Likewise. (stmts_are_full_exprs_p): Likewise. (anon_aggr_type_p): Likewise. (lang_expand_expr_stmt): Likewise. (build_case_label): Likewise. * c-decl.c (lang_expand_expr_stmt): Initialize. (stmts_are_full_exprs_p): Define. (current_function_name_declared): Likewise. (do_case): Likewise. (lang_expand_stmt): Likewise. (set_current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (build_case_label): Likewise. * c-semantics.c: New file. (expand_cond): Moved from cp/semantics.c. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (make_rtl_for_local_static): Moved from cp/decl.c. (emit_local_var): Likewise. (expand_stmt): Define. * c-tree.h: (c_expand_asm_operands): Moved to c-common.h. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/Make-lang.in (cc1plus$(exeext)): Added c-semantics.o. * cp/Makefile.in (OBJS): Added ../c-semantics.o. (OBJDEPS): Likewise. * cp/cp-tree.h (TREE_LANG_FLAG_?): Moved common documentation to ../c-common.h. (struct stmt_tree): Added comment. (current_function_name_declared): Removed. (stmts_are_full_exprs_p): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (COMPOUND_STMT_NO_SCOPE): Moved to ../c-common.h. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (do_case): Likewise. (expand_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (c_expand_asm_operands): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/decl.c (make_rtl_for_local_static): Moved to c-semantics.c. (emit_local_var): Likewise. (initialize_local_var): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (push_cp_function_context): Likewise. * cp/expect.c (expand_throw): Change reference to stmts_are_full_exprs_p. * cp/init.c (build_aggr_init): Change reference to stmts_are_full_exprs_p. (build_vec_init): Likewise. * cp/optimize.c (maybe_clone_body): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/pt.c (instantiate_decl): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/semantics.c (expand_cond): Moved declaration to c-common.h. (genrtl_do_pushlevel): Moved to c-semantics.c. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (gerntl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (expand_cond): Likewise. (expand_stmt): Renamed to ... (lang_expand_stmt): ... this. (lang_expand_expr_stmt): Initialize. (set_current_function_name_declared): Likewise. (stmts_are_full_exprs_p): Likewise. (current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (do_poplevel): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (add_tree): Likewise. (finish_expr_stmt): Likewise. (prep_stmt): Likewise. (lang_expand_stmt): Likewise. (begin_compound_stmt): Change reference to current_function_name_declared to cp_function_chain->name_declared and call to current_function_name_declared(). (setup_vtbl_ptr): Likewise. (genrtl_do_poplevel): Removed. From-SVN: r34827
2000-07-02 07:23:01 +02:00
pushlevel (0);
if (!processing_template_decl)
add_scope_stmt (/*begin_p=*/1, /*partial_p=*/0);
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
}
}
/* Finish a goto-statement. */
tree
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
finish_goto_stmt (destination)
tree destination;
{
if (TREE_CODE (destination) == IDENTIFIER_NODE)
destination = lookup_label (destination);
/* We warn about unused labels with -Wunused. That means we have to
mark the used labels as used. */
if (TREE_CODE (destination) == LABEL_DECL)
TREE_USED (destination) = 1;
if (TREE_CODE (destination) != LABEL_DECL)
/* We don't inline calls to functions with computed gotos.
Those functions are typically up to some funny business,
and may be depending on the labels being at particular
addresses, or some such. */
DECL_UNINLINABLE (current_function_decl) = 1;
check_goto (destination);
return add_stmt (build_stmt (GOTO_STMT, destination));
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
}
/* COND is the condition-expression for an if, while, etc.,
statement. Convert it to a boolean value, if appropriate. */
Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. 2000-07-01 Benjamin Chelf <chelf@codesourcery.com> * Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. (c-semantics.o): New target. * c-common.h (TREE_LANG_FLAG_?): Added documentation. (genrtl_do_pushlevel): Moved from cp/cp-tree.h. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (gerntl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (expand_cond): Likewise. (expand_stmt): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. (do_case): Likewise. (COMPOUND_STMT_NO_SCOPE): Likewise. (c_expand_asm_operands): Likewise. (NEW_FOR_SCOPE_P): New macro. (expand_expr_stmt_fn): New type. (set_current_function_name_declared): Likewise. (current_function_name_declared): Likewise. (lang_expand_stmt): Likewise. (stmts_are_full_exprs_p): Likewise. (anon_aggr_type_p): Likewise. (lang_expand_expr_stmt): Likewise. (build_case_label): Likewise. * c-decl.c (lang_expand_expr_stmt): Initialize. (stmts_are_full_exprs_p): Define. (current_function_name_declared): Likewise. (do_case): Likewise. (lang_expand_stmt): Likewise. (set_current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (build_case_label): Likewise. * c-semantics.c: New file. (expand_cond): Moved from cp/semantics.c. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (make_rtl_for_local_static): Moved from cp/decl.c. (emit_local_var): Likewise. (expand_stmt): Define. * c-tree.h: (c_expand_asm_operands): Moved to c-common.h. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/Make-lang.in (cc1plus$(exeext)): Added c-semantics.o. * cp/Makefile.in (OBJS): Added ../c-semantics.o. (OBJDEPS): Likewise. * cp/cp-tree.h (TREE_LANG_FLAG_?): Moved common documentation to ../c-common.h. (struct stmt_tree): Added comment. (current_function_name_declared): Removed. (stmts_are_full_exprs_p): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (COMPOUND_STMT_NO_SCOPE): Moved to ../c-common.h. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (do_case): Likewise. (expand_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (c_expand_asm_operands): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/decl.c (make_rtl_for_local_static): Moved to c-semantics.c. (emit_local_var): Likewise. (initialize_local_var): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (push_cp_function_context): Likewise. * cp/expect.c (expand_throw): Change reference to stmts_are_full_exprs_p. * cp/init.c (build_aggr_init): Change reference to stmts_are_full_exprs_p. (build_vec_init): Likewise. * cp/optimize.c (maybe_clone_body): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/pt.c (instantiate_decl): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/semantics.c (expand_cond): Moved declaration to c-common.h. (genrtl_do_pushlevel): Moved to c-semantics.c. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (gerntl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (expand_cond): Likewise. (expand_stmt): Renamed to ... (lang_expand_stmt): ... this. (lang_expand_expr_stmt): Initialize. (set_current_function_name_declared): Likewise. (stmts_are_full_exprs_p): Likewise. (current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (do_poplevel): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (add_tree): Likewise. (finish_expr_stmt): Likewise. (prep_stmt): Likewise. (lang_expand_stmt): Likewise. (begin_compound_stmt): Change reference to current_function_name_declared to cp_function_chain->name_declared and call to current_function_name_declared(). (setup_vtbl_ptr): Likewise. (genrtl_do_poplevel): Removed. From-SVN: r34827
2000-07-02 07:23:01 +02:00
tree
maybe_convert_cond (cond)
tree cond;
{
/* Empty conditions remain empty. */
if (!cond)
return NULL_TREE;
/* Wait until we instantiate templates before doing conversion. */
if (processing_template_decl)
return cond;
/* Do the conversion. */
cond = convert_from_reference (cond);
return condition_conversion (cond);
}
Remove support for assigning to `this'. * NEWS: Note that fact. * class.c (build_vbase_path): Don't check flag_this_is_variable. * cp-tree.h (EXPR_STMT_ASSIGNS_THIS): Remove. (language_function): Remove assigns_this, just_assigned_this, and x_base_init_expr. Add x_vcalls_possible_p. Add vtbls_set_up_p. (base_init_expr): Remove. (current_vcalls_possible_p): New macro. (vtbls_set_up_p): Likewise. (emit_base_init): Change prototype. * decl.c (finish_destructor_body): New function, split out from finish_function. (current_function_assigns_this): Remove. (current_function_just_assigned_this): Likewise. (start_function): Don't set them. (finish_function): Don't check them. Don't emit base-initialization code here. Generate code for destructors when doing semantic analysis. (finish_stmt): Don't check current_function_just_assigned_this. * decl2.c (lang_f_options): Remove this-is-variable. (lang_decode_option): Likewise. (grokclassfn): Don't check flag_this_is_variable. * init.c (emit_base_init): Return the expression generated. (construct_virtual_bases): Don't push/pop obstacks. Fix typo. (build_new_1): Don't check flag_this_is_variable. (get_temp_regvar): Don't set DECL_REGISTER. (build_vec_init): Don't call use_variable. * lang-options.h: Remove "-fthis-is-variable" and "-fno-this-is-variable". * pt.c (tsubst_expr): Don't check EXPR_STMT_ASSIGNS_THIS. * search.c (expand_upcast_fixups): Use finish_expr_stmt, not expand_expr_stmt. * semantics.c (finish_expr_stmt_real): Rename to ... (finish_expr_stmt): This. Remove assigned_this parameter. (begin_if_stmt): Call do_pushlevel before starting the statement. (begin_compound_stmt): Don't declare __FUNCTION__ in scope-less blocks. (setup_vtbl_ptr): Emit initialization code for bases and members at semantic-analysis time. Emit code to initialize vtables in destructors here. (expand_stmt): Use finish_expr_stmt, not finish_expr_stmt_real. Don't handle CTOR_INITIALIZER any more. * typeck.c (build_modify_expr): Don't check for assignments to this. (c_expand_return): Don't suggest assigning to `this'. * Makefile.in (decl.o): Depend on RTL_H. (decl2.o): Likewise. (class.o): Likewise. (call.o): Likewise. (method.o): Likewise. (search.o): Likewise. (tree.o): Likewise. (pt.o): Likewise. * decl.c (duplicate_decls): When a builtin function is redeclared as static, make sure it is mangled correctly. * ir.texi (CTOR_INITIALIZER): Remove mention. Fix typo. Add detail about the statement-tree. From-SVN: r29531
1999-09-20 22:19:04 +02:00
/* Finish an expression-statement, whose EXPRESSION is as indicated. */
tree
Remove support for assigning to `this'. * NEWS: Note that fact. * class.c (build_vbase_path): Don't check flag_this_is_variable. * cp-tree.h (EXPR_STMT_ASSIGNS_THIS): Remove. (language_function): Remove assigns_this, just_assigned_this, and x_base_init_expr. Add x_vcalls_possible_p. Add vtbls_set_up_p. (base_init_expr): Remove. (current_vcalls_possible_p): New macro. (vtbls_set_up_p): Likewise. (emit_base_init): Change prototype. * decl.c (finish_destructor_body): New function, split out from finish_function. (current_function_assigns_this): Remove. (current_function_just_assigned_this): Likewise. (start_function): Don't set them. (finish_function): Don't check them. Don't emit base-initialization code here. Generate code for destructors when doing semantic analysis. (finish_stmt): Don't check current_function_just_assigned_this. * decl2.c (lang_f_options): Remove this-is-variable. (lang_decode_option): Likewise. (grokclassfn): Don't check flag_this_is_variable. * init.c (emit_base_init): Return the expression generated. (construct_virtual_bases): Don't push/pop obstacks. Fix typo. (build_new_1): Don't check flag_this_is_variable. (get_temp_regvar): Don't set DECL_REGISTER. (build_vec_init): Don't call use_variable. * lang-options.h: Remove "-fthis-is-variable" and "-fno-this-is-variable". * pt.c (tsubst_expr): Don't check EXPR_STMT_ASSIGNS_THIS. * search.c (expand_upcast_fixups): Use finish_expr_stmt, not expand_expr_stmt. * semantics.c (finish_expr_stmt_real): Rename to ... (finish_expr_stmt): This. Remove assigned_this parameter. (begin_if_stmt): Call do_pushlevel before starting the statement. (begin_compound_stmt): Don't declare __FUNCTION__ in scope-less blocks. (setup_vtbl_ptr): Emit initialization code for bases and members at semantic-analysis time. Emit code to initialize vtables in destructors here. (expand_stmt): Use finish_expr_stmt, not finish_expr_stmt_real. Don't handle CTOR_INITIALIZER any more. * typeck.c (build_modify_expr): Don't check for assignments to this. (c_expand_return): Don't suggest assigning to `this'. * Makefile.in (decl.o): Depend on RTL_H. (decl2.o): Likewise. (class.o): Likewise. (call.o): Likewise. (method.o): Likewise. (search.o): Likewise. (tree.o): Likewise. (pt.o): Likewise. * decl.c (duplicate_decls): When a builtin function is redeclared as static, make sure it is mangled correctly. * ir.texi (CTOR_INITIALIZER): Remove mention. Fix typo. Add detail about the statement-tree. From-SVN: r29531
1999-09-20 22:19:04 +02:00
finish_expr_stmt (expr)
tree expr;
{
tree r = NULL_TREE;
tree expr_type = NULL_TREE;;
if (expr != NULL_TREE)
{
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
if (!processing_template_decl
Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. 2000-07-01 Benjamin Chelf <chelf@codesourcery.com> * Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. (c-semantics.o): New target. * c-common.h (TREE_LANG_FLAG_?): Added documentation. (genrtl_do_pushlevel): Moved from cp/cp-tree.h. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (gerntl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (expand_cond): Likewise. (expand_stmt): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. (do_case): Likewise. (COMPOUND_STMT_NO_SCOPE): Likewise. (c_expand_asm_operands): Likewise. (NEW_FOR_SCOPE_P): New macro. (expand_expr_stmt_fn): New type. (set_current_function_name_declared): Likewise. (current_function_name_declared): Likewise. (lang_expand_stmt): Likewise. (stmts_are_full_exprs_p): Likewise. (anon_aggr_type_p): Likewise. (lang_expand_expr_stmt): Likewise. (build_case_label): Likewise. * c-decl.c (lang_expand_expr_stmt): Initialize. (stmts_are_full_exprs_p): Define. (current_function_name_declared): Likewise. (do_case): Likewise. (lang_expand_stmt): Likewise. (set_current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (build_case_label): Likewise. * c-semantics.c: New file. (expand_cond): Moved from cp/semantics.c. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (make_rtl_for_local_static): Moved from cp/decl.c. (emit_local_var): Likewise. (expand_stmt): Define. * c-tree.h: (c_expand_asm_operands): Moved to c-common.h. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/Make-lang.in (cc1plus$(exeext)): Added c-semantics.o. * cp/Makefile.in (OBJS): Added ../c-semantics.o. (OBJDEPS): Likewise. * cp/cp-tree.h (TREE_LANG_FLAG_?): Moved common documentation to ../c-common.h. (struct stmt_tree): Added comment. (current_function_name_declared): Removed. (stmts_are_full_exprs_p): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (COMPOUND_STMT_NO_SCOPE): Moved to ../c-common.h. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (do_case): Likewise. (expand_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (c_expand_asm_operands): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/decl.c (make_rtl_for_local_static): Moved to c-semantics.c. (emit_local_var): Likewise. (initialize_local_var): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (push_cp_function_context): Likewise. * cp/expect.c (expand_throw): Change reference to stmts_are_full_exprs_p. * cp/init.c (build_aggr_init): Change reference to stmts_are_full_exprs_p. (build_vec_init): Likewise. * cp/optimize.c (maybe_clone_body): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/pt.c (instantiate_decl): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/semantics.c (expand_cond): Moved declaration to c-common.h. (genrtl_do_pushlevel): Moved to c-semantics.c. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (gerntl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (expand_cond): Likewise. (expand_stmt): Renamed to ... (lang_expand_stmt): ... this. (lang_expand_expr_stmt): Initialize. (set_current_function_name_declared): Likewise. (stmts_are_full_exprs_p): Likewise. (current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (do_poplevel): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (add_tree): Likewise. (finish_expr_stmt): Likewise. (prep_stmt): Likewise. (lang_expand_stmt): Likewise. (begin_compound_stmt): Change reference to current_function_name_declared to cp_function_chain->name_declared and call to current_function_name_declared(). (setup_vtbl_ptr): Likewise. (genrtl_do_poplevel): Removed. From-SVN: r34827
2000-07-02 07:23:01 +02:00
&& !(stmts_are_full_exprs_p ())
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
&& ((TREE_CODE (TREE_TYPE (expr)) == ARRAY_TYPE
&& lvalue_p (expr))
|| TREE_CODE (TREE_TYPE (expr)) == FUNCTION_TYPE))
expr = default_conversion (expr);
/* Remember the type of the expression. */
expr_type = TREE_TYPE (expr);
Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. 2000-07-01 Benjamin Chelf <chelf@codesourcery.com> * Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. (c-semantics.o): New target. * c-common.h (TREE_LANG_FLAG_?): Added documentation. (genrtl_do_pushlevel): Moved from cp/cp-tree.h. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (gerntl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (expand_cond): Likewise. (expand_stmt): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. (do_case): Likewise. (COMPOUND_STMT_NO_SCOPE): Likewise. (c_expand_asm_operands): Likewise. (NEW_FOR_SCOPE_P): New macro. (expand_expr_stmt_fn): New type. (set_current_function_name_declared): Likewise. (current_function_name_declared): Likewise. (lang_expand_stmt): Likewise. (stmts_are_full_exprs_p): Likewise. (anon_aggr_type_p): Likewise. (lang_expand_expr_stmt): Likewise. (build_case_label): Likewise. * c-decl.c (lang_expand_expr_stmt): Initialize. (stmts_are_full_exprs_p): Define. (current_function_name_declared): Likewise. (do_case): Likewise. (lang_expand_stmt): Likewise. (set_current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (build_case_label): Likewise. * c-semantics.c: New file. (expand_cond): Moved from cp/semantics.c. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (make_rtl_for_local_static): Moved from cp/decl.c. (emit_local_var): Likewise. (expand_stmt): Define. * c-tree.h: (c_expand_asm_operands): Moved to c-common.h. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/Make-lang.in (cc1plus$(exeext)): Added c-semantics.o. * cp/Makefile.in (OBJS): Added ../c-semantics.o. (OBJDEPS): Likewise. * cp/cp-tree.h (TREE_LANG_FLAG_?): Moved common documentation to ../c-common.h. (struct stmt_tree): Added comment. (current_function_name_declared): Removed. (stmts_are_full_exprs_p): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (COMPOUND_STMT_NO_SCOPE): Moved to ../c-common.h. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (do_case): Likewise. (expand_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (c_expand_asm_operands): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/decl.c (make_rtl_for_local_static): Moved to c-semantics.c. (emit_local_var): Likewise. (initialize_local_var): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (push_cp_function_context): Likewise. * cp/expect.c (expand_throw): Change reference to stmts_are_full_exprs_p. * cp/init.c (build_aggr_init): Change reference to stmts_are_full_exprs_p. (build_vec_init): Likewise. * cp/optimize.c (maybe_clone_body): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/pt.c (instantiate_decl): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/semantics.c (expand_cond): Moved declaration to c-common.h. (genrtl_do_pushlevel): Moved to c-semantics.c. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (gerntl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (expand_cond): Likewise. (expand_stmt): Renamed to ... (lang_expand_stmt): ... this. (lang_expand_expr_stmt): Initialize. (set_current_function_name_declared): Likewise. (stmts_are_full_exprs_p): Likewise. (current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (do_poplevel): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (add_tree): Likewise. (finish_expr_stmt): Likewise. (prep_stmt): Likewise. (lang_expand_stmt): Likewise. (begin_compound_stmt): Change reference to current_function_name_declared to cp_function_chain->name_declared and call to current_function_name_declared(). (setup_vtbl_ptr): Likewise. (genrtl_do_poplevel): Removed. From-SVN: r34827
2000-07-02 07:23:01 +02:00
if (stmts_are_full_exprs_p ())
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
expr = convert_to_void (expr, "statement");
r = add_stmt (build_stmt (EXPR_STMT, expr));
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
}
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
finish_stmt ();
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
/* This was an expression-statement, so we save the type of the
expression. */
last_expr_type = expr_type;
return r;
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
}
/* Begin an if-statement. Returns a newly created IF_STMT if
appropriate. */
tree
begin_if_stmt ()
{
tree r;
Remove support for assigning to `this'. * NEWS: Note that fact. * class.c (build_vbase_path): Don't check flag_this_is_variable. * cp-tree.h (EXPR_STMT_ASSIGNS_THIS): Remove. (language_function): Remove assigns_this, just_assigned_this, and x_base_init_expr. Add x_vcalls_possible_p. Add vtbls_set_up_p. (base_init_expr): Remove. (current_vcalls_possible_p): New macro. (vtbls_set_up_p): Likewise. (emit_base_init): Change prototype. * decl.c (finish_destructor_body): New function, split out from finish_function. (current_function_assigns_this): Remove. (current_function_just_assigned_this): Likewise. (start_function): Don't set them. (finish_function): Don't check them. Don't emit base-initialization code here. Generate code for destructors when doing semantic analysis. (finish_stmt): Don't check current_function_just_assigned_this. * decl2.c (lang_f_options): Remove this-is-variable. (lang_decode_option): Likewise. (grokclassfn): Don't check flag_this_is_variable. * init.c (emit_base_init): Return the expression generated. (construct_virtual_bases): Don't push/pop obstacks. Fix typo. (build_new_1): Don't check flag_this_is_variable. (get_temp_regvar): Don't set DECL_REGISTER. (build_vec_init): Don't call use_variable. * lang-options.h: Remove "-fthis-is-variable" and "-fno-this-is-variable". * pt.c (tsubst_expr): Don't check EXPR_STMT_ASSIGNS_THIS. * search.c (expand_upcast_fixups): Use finish_expr_stmt, not expand_expr_stmt. * semantics.c (finish_expr_stmt_real): Rename to ... (finish_expr_stmt): This. Remove assigned_this parameter. (begin_if_stmt): Call do_pushlevel before starting the statement. (begin_compound_stmt): Don't declare __FUNCTION__ in scope-less blocks. (setup_vtbl_ptr): Emit initialization code for bases and members at semantic-analysis time. Emit code to initialize vtables in destructors here. (expand_stmt): Use finish_expr_stmt, not finish_expr_stmt_real. Don't handle CTOR_INITIALIZER any more. * typeck.c (build_modify_expr): Don't check for assignments to this. (c_expand_return): Don't suggest assigning to `this'. * Makefile.in (decl.o): Depend on RTL_H. (decl2.o): Likewise. (class.o): Likewise. (call.o): Likewise. (method.o): Likewise. (search.o): Likewise. (tree.o): Likewise. (pt.o): Likewise. * decl.c (duplicate_decls): When a builtin function is redeclared as static, make sure it is mangled correctly. * ir.texi (CTOR_INITIALIZER): Remove mention. Fix typo. Add detail about the statement-tree. From-SVN: r29531
1999-09-20 22:19:04 +02:00
do_pushlevel ();
c-common.h (build_stmt): Declare. 2000-07-10 Benjamin Chelf <chelf@codesourcery.com> * c-common.h (build_stmt): Declare. (build_continue_stmt): Likewise. (build_break_stmt): Likewise. (build_return_stmt): Likewise. * c-decl.c (do_case): Rewrite to do what previously done in c-parse.in. * c-semantics.c (build_stmt): Define. (build_return_stmt): Likewise. (build_break_stmt): Likewise. (build_continue_stmt): Likewise. (build_case_label): Likewise. * c-parse.in (BREAK): Change to build tree, then generate RTL. (CONTINUE): Likewise. (RETURN): Likewise. (CASE): Likewise. (DEFAULT): Likewise. * c-parse.y: Regenerate. * c-pasre.c: Likewise. * cp/semantics.c (finish_for_stmt): Remove call to emit_line_note. (finish_continue_stmt): Likewise. (begin_for_stmt): Remove call to note_level_for_for. (finish_goto_stmt): Change call from build_min_nt to build_stmt. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_case_label): Likewise. (genrtl_try_block): Likewise. (begin_try_block): Likewise. (begin_handler): Likewise. (begin_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (add_decl_stmt): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (setup_vtbl_ptr): Likewise. (add_scope_stmt): Likewise. * cp/decl.c (finish_constructor_body): Likewise. (finish_destructor_body): Likewise. * cp/optimize.c (copy_body_r): Likewise. (initialize_inlined_parameters): Likewise. (declare_return_variable): Likewise. (expand_call_inline): Likewise. From-SVN: r34943
2000-07-10 12:56:23 +02:00
r = build_stmt (IF_STMT, NULL_TREE, NULL_TREE, NULL_TREE);
Move statement-tree facilities from C++ to C front-end. * c-common.h (c_tree_index): Add CTI_VOID_ZERO. (void_zero_node): New macro. (struct stmt_tree_s): New type. (stmt_tree): New typedef. (struct language_function): New type. (last_tree): New macro. (last_expr_type): Likewise. (walk_tree_fn): New typedef. (current_stmt_tree): New function. (begin_stmt_tree): Likewise. (add_stmt): Likewise. (finish_stmt_tree): Likewise. (statement_code_p): Likewise. (lang_statement_code_p): New variable. (walk_stmt_tree): New function. (STMT_IS_FULL_EXPR_P): New macro. * c-common.c (lang_statement_code_p): New variable. (c_common_nodes_and_builtins): Initialize void_zero_node. (statement_code_p): New function. (walk_stmt_tree): Likewise. * c-decl.c (language_function): Rename to ... (c_language_function): ... this. Include language_function. (push_c_function_context): Adjust accordingly. (pop_c_function_context): Likewise. (mark_c_function_context): Likewise. (current_stmt_tree): Define. * c-semantics.c (begin_stmt_tree): New function. (add_stmt): Likewise. (prune_unused_decls): Likewise. (finish_stmt_tree): Likewise. Move statement-tree facilities from C++ to C front-end. * cp-tree.h (cp_tree_index): Remove CPTI_VOID_ZERO. (void_zero_node): Remove. (stmt_tree): Likewise. (scope_chain): Adjust. (language_function): Rename to cp_language_function. (cp_function_chain): Adjust. (current_stmt_tree): Remove. (last_tree): Likewise. (last_expr_type): Likewise. (struct lang_decl): Adjust. (STMT_IS_FULL_EXPR_P): Remove. (add_tree): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (walk_tree_fn): Likewise. (walk_stmt_tree): Likewise. * class.c (finish_struct): Replace use of add_tree with add_stmt. * decl.c (mark_stmt_tree): Adjust type. (init_decl_processing): Don't build void_zero_node. (initialize_local_var): Adjust usage of current_stmt_tree. (finish_enum): Use add_stmt, not add_tree. (save_function_data): Adjust use of language_function. (finish_constructor_body): Use add_stmt, not add_tree. (finish_destructor_body): Likewise. (push_cp_function_context): Adjust use of language_function. (pop_cp_function_context): Likewise. (mark_lang_function): Likewise. (mark_cp_function_context): Likewise. * init.c (build_aggr_init): Adjust use of current_stmt_tree. (build_vec_init): Likewise. * semantics.c (SET_LAST_STMT): Remove. (RECHAIN_STMTS): Don't use it. (stmts_are_full_exprs_p): Adjust use of current_stmt_tree. (current_stmt_tree): Define. (add_tree): Remove. (finish_goto_stmt): Use add_stmt, not add_tree. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_then_clause): Likewise. (begin_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (begin_handler): Likewise. (begin_catch_block): Likewise. (begin_compound_stmt): Likewise. (begin_asm_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (add_decl_stmt): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (setup_vtbl_ptr): Likewise. (add_scope_stmt): Likewise. (finish_stmt_expr): Likewise. (prune_unused_decls): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (prep_stmt): Adjust use of current_stmt_tree. (lang_expand_stmt): Likewise. * tree.c (statement_code_p): Remove. (cp_statement_code_p): New function. (walk_stmt_tree): Remove. (init_tree): Set lang_statement_code_p. From-SVN: r36221
2000-09-07 03:36:11 +02:00
add_stmt (r);
return r;
}
/* Process the COND of an if-statement, which may be given by
IF_STMT. */
void
finish_if_stmt_cond (cond, if_stmt)
tree cond;
tree if_stmt;
{
cond = maybe_convert_cond (cond);
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
FINISH_COND (cond, if_stmt, IF_COND (if_stmt));
}
/* Finish the then-clause of an if-statement, which may be given by
IF_STMT. */
tree
finish_then_clause (if_stmt)
tree if_stmt;
{
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
RECHAIN_STMTS (if_stmt, THEN_CLAUSE (if_stmt));
return if_stmt;
}
/* Begin the else-clause of an if-statement. */
void
begin_else_clause ()
{
}
/* Finish the else-clause of an if-statement, which may be given by
IF_STMT. */
void
finish_else_clause (if_stmt)
tree if_stmt;
{
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
RECHAIN_STMTS (if_stmt, ELSE_CLAUSE (if_stmt));
}
/* Finish an if-statement. */
void
finish_if_stmt ()
{
finish_stmt ();
do_poplevel ();
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
}
/* Begin a while-statement. Returns a newly created WHILE_STMT if
appropriate. */
tree
begin_while_stmt ()
{
tree r;
c-common.h (build_stmt): Declare. 2000-07-10 Benjamin Chelf <chelf@codesourcery.com> * c-common.h (build_stmt): Declare. (build_continue_stmt): Likewise. (build_break_stmt): Likewise. (build_return_stmt): Likewise. * c-decl.c (do_case): Rewrite to do what previously done in c-parse.in. * c-semantics.c (build_stmt): Define. (build_return_stmt): Likewise. (build_break_stmt): Likewise. (build_continue_stmt): Likewise. (build_case_label): Likewise. * c-parse.in (BREAK): Change to build tree, then generate RTL. (CONTINUE): Likewise. (RETURN): Likewise. (CASE): Likewise. (DEFAULT): Likewise. * c-parse.y: Regenerate. * c-pasre.c: Likewise. * cp/semantics.c (finish_for_stmt): Remove call to emit_line_note. (finish_continue_stmt): Likewise. (begin_for_stmt): Remove call to note_level_for_for. (finish_goto_stmt): Change call from build_min_nt to build_stmt. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_case_label): Likewise. (genrtl_try_block): Likewise. (begin_try_block): Likewise. (begin_handler): Likewise. (begin_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (add_decl_stmt): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (setup_vtbl_ptr): Likewise. (add_scope_stmt): Likewise. * cp/decl.c (finish_constructor_body): Likewise. (finish_destructor_body): Likewise. * cp/optimize.c (copy_body_r): Likewise. (initialize_inlined_parameters): Likewise. (declare_return_variable): Likewise. (expand_call_inline): Likewise. From-SVN: r34943
2000-07-10 12:56:23 +02:00
r = build_stmt (WHILE_STMT, NULL_TREE, NULL_TREE);
Move statement-tree facilities from C++ to C front-end. * c-common.h (c_tree_index): Add CTI_VOID_ZERO. (void_zero_node): New macro. (struct stmt_tree_s): New type. (stmt_tree): New typedef. (struct language_function): New type. (last_tree): New macro. (last_expr_type): Likewise. (walk_tree_fn): New typedef. (current_stmt_tree): New function. (begin_stmt_tree): Likewise. (add_stmt): Likewise. (finish_stmt_tree): Likewise. (statement_code_p): Likewise. (lang_statement_code_p): New variable. (walk_stmt_tree): New function. (STMT_IS_FULL_EXPR_P): New macro. * c-common.c (lang_statement_code_p): New variable. (c_common_nodes_and_builtins): Initialize void_zero_node. (statement_code_p): New function. (walk_stmt_tree): Likewise. * c-decl.c (language_function): Rename to ... (c_language_function): ... this. Include language_function. (push_c_function_context): Adjust accordingly. (pop_c_function_context): Likewise. (mark_c_function_context): Likewise. (current_stmt_tree): Define. * c-semantics.c (begin_stmt_tree): New function. (add_stmt): Likewise. (prune_unused_decls): Likewise. (finish_stmt_tree): Likewise. Move statement-tree facilities from C++ to C front-end. * cp-tree.h (cp_tree_index): Remove CPTI_VOID_ZERO. (void_zero_node): Remove. (stmt_tree): Likewise. (scope_chain): Adjust. (language_function): Rename to cp_language_function. (cp_function_chain): Adjust. (current_stmt_tree): Remove. (last_tree): Likewise. (last_expr_type): Likewise. (struct lang_decl): Adjust. (STMT_IS_FULL_EXPR_P): Remove. (add_tree): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (walk_tree_fn): Likewise. (walk_stmt_tree): Likewise. * class.c (finish_struct): Replace use of add_tree with add_stmt. * decl.c (mark_stmt_tree): Adjust type. (init_decl_processing): Don't build void_zero_node. (initialize_local_var): Adjust usage of current_stmt_tree. (finish_enum): Use add_stmt, not add_tree. (save_function_data): Adjust use of language_function. (finish_constructor_body): Use add_stmt, not add_tree. (finish_destructor_body): Likewise. (push_cp_function_context): Adjust use of language_function. (pop_cp_function_context): Likewise. (mark_lang_function): Likewise. (mark_cp_function_context): Likewise. * init.c (build_aggr_init): Adjust use of current_stmt_tree. (build_vec_init): Likewise. * semantics.c (SET_LAST_STMT): Remove. (RECHAIN_STMTS): Don't use it. (stmts_are_full_exprs_p): Adjust use of current_stmt_tree. (current_stmt_tree): Define. (add_tree): Remove. (finish_goto_stmt): Use add_stmt, not add_tree. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_then_clause): Likewise. (begin_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (begin_handler): Likewise. (begin_catch_block): Likewise. (begin_compound_stmt): Likewise. (begin_asm_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (add_decl_stmt): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (setup_vtbl_ptr): Likewise. (add_scope_stmt): Likewise. (finish_stmt_expr): Likewise. (prune_unused_decls): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (prep_stmt): Adjust use of current_stmt_tree. (lang_expand_stmt): Likewise. * tree.c (statement_code_p): Remove. (cp_statement_code_p): New function. (walk_stmt_tree): Remove. (init_tree): Set lang_statement_code_p. From-SVN: r36221
2000-09-07 03:36:11 +02:00
add_stmt (r);
do_pushlevel ();
return r;
}
/* Process the COND of a while-statement, which may be given by
WHILE_STMT. */
void
finish_while_stmt_cond (cond, while_stmt)
tree cond;
tree while_stmt;
{
cond = maybe_convert_cond (cond);
if (processing_template_decl)
/* Don't mess with condition decls in a template. */
FINISH_COND (cond, while_stmt, WHILE_COND (while_stmt));
else if (getdecls () == NULL_TREE)
/* It was a simple condition; install it. */
WHILE_COND (while_stmt) = cond;
else
{
/* If there was a declaration in the condition, we can't leave it
there; transform
while (A x = 42) { }
to
while (true) { A x = 42; if (!x) break; } */
tree if_stmt;
WHILE_COND (while_stmt) = boolean_true_node;
if_stmt = begin_if_stmt ();
cond = build_unary_op (TRUTH_NOT_EXPR, cond, 0);
finish_if_stmt_cond (cond, if_stmt);
finish_break_stmt ();
finish_then_clause (if_stmt);
finish_if_stmt ();
}
}
/* Finish a while-statement, which may be given by WHILE_STMT. */
void
finish_while_stmt (while_stmt)
tree while_stmt;
{
do_poplevel ();
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
RECHAIN_STMTS (while_stmt, WHILE_BODY (while_stmt));
finish_stmt ();
}
/* Begin a do-statement. Returns a newly created DO_STMT if
appropriate. */
tree
begin_do_stmt ()
{
c-common.h (build_stmt): Declare. 2000-07-10 Benjamin Chelf <chelf@codesourcery.com> * c-common.h (build_stmt): Declare. (build_continue_stmt): Likewise. (build_break_stmt): Likewise. (build_return_stmt): Likewise. * c-decl.c (do_case): Rewrite to do what previously done in c-parse.in. * c-semantics.c (build_stmt): Define. (build_return_stmt): Likewise. (build_break_stmt): Likewise. (build_continue_stmt): Likewise. (build_case_label): Likewise. * c-parse.in (BREAK): Change to build tree, then generate RTL. (CONTINUE): Likewise. (RETURN): Likewise. (CASE): Likewise. (DEFAULT): Likewise. * c-parse.y: Regenerate. * c-pasre.c: Likewise. * cp/semantics.c (finish_for_stmt): Remove call to emit_line_note. (finish_continue_stmt): Likewise. (begin_for_stmt): Remove call to note_level_for_for. (finish_goto_stmt): Change call from build_min_nt to build_stmt. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_case_label): Likewise. (genrtl_try_block): Likewise. (begin_try_block): Likewise. (begin_handler): Likewise. (begin_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (add_decl_stmt): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (setup_vtbl_ptr): Likewise. (add_scope_stmt): Likewise. * cp/decl.c (finish_constructor_body): Likewise. (finish_destructor_body): Likewise. * cp/optimize.c (copy_body_r): Likewise. (initialize_inlined_parameters): Likewise. (declare_return_variable): Likewise. (expand_call_inline): Likewise. From-SVN: r34943
2000-07-10 12:56:23 +02:00
tree r = build_stmt (DO_STMT, NULL_TREE, NULL_TREE);
Move statement-tree facilities from C++ to C front-end. * c-common.h (c_tree_index): Add CTI_VOID_ZERO. (void_zero_node): New macro. (struct stmt_tree_s): New type. (stmt_tree): New typedef. (struct language_function): New type. (last_tree): New macro. (last_expr_type): Likewise. (walk_tree_fn): New typedef. (current_stmt_tree): New function. (begin_stmt_tree): Likewise. (add_stmt): Likewise. (finish_stmt_tree): Likewise. (statement_code_p): Likewise. (lang_statement_code_p): New variable. (walk_stmt_tree): New function. (STMT_IS_FULL_EXPR_P): New macro. * c-common.c (lang_statement_code_p): New variable. (c_common_nodes_and_builtins): Initialize void_zero_node. (statement_code_p): New function. (walk_stmt_tree): Likewise. * c-decl.c (language_function): Rename to ... (c_language_function): ... this. Include language_function. (push_c_function_context): Adjust accordingly. (pop_c_function_context): Likewise. (mark_c_function_context): Likewise. (current_stmt_tree): Define. * c-semantics.c (begin_stmt_tree): New function. (add_stmt): Likewise. (prune_unused_decls): Likewise. (finish_stmt_tree): Likewise. Move statement-tree facilities from C++ to C front-end. * cp-tree.h (cp_tree_index): Remove CPTI_VOID_ZERO. (void_zero_node): Remove. (stmt_tree): Likewise. (scope_chain): Adjust. (language_function): Rename to cp_language_function. (cp_function_chain): Adjust. (current_stmt_tree): Remove. (last_tree): Likewise. (last_expr_type): Likewise. (struct lang_decl): Adjust. (STMT_IS_FULL_EXPR_P): Remove. (add_tree): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (walk_tree_fn): Likewise. (walk_stmt_tree): Likewise. * class.c (finish_struct): Replace use of add_tree with add_stmt. * decl.c (mark_stmt_tree): Adjust type. (init_decl_processing): Don't build void_zero_node. (initialize_local_var): Adjust usage of current_stmt_tree. (finish_enum): Use add_stmt, not add_tree. (save_function_data): Adjust use of language_function. (finish_constructor_body): Use add_stmt, not add_tree. (finish_destructor_body): Likewise. (push_cp_function_context): Adjust use of language_function. (pop_cp_function_context): Likewise. (mark_lang_function): Likewise. (mark_cp_function_context): Likewise. * init.c (build_aggr_init): Adjust use of current_stmt_tree. (build_vec_init): Likewise. * semantics.c (SET_LAST_STMT): Remove. (RECHAIN_STMTS): Don't use it. (stmts_are_full_exprs_p): Adjust use of current_stmt_tree. (current_stmt_tree): Define. (add_tree): Remove. (finish_goto_stmt): Use add_stmt, not add_tree. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_then_clause): Likewise. (begin_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (begin_handler): Likewise. (begin_catch_block): Likewise. (begin_compound_stmt): Likewise. (begin_asm_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (add_decl_stmt): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (setup_vtbl_ptr): Likewise. (add_scope_stmt): Likewise. (finish_stmt_expr): Likewise. (prune_unused_decls): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (prep_stmt): Adjust use of current_stmt_tree. (lang_expand_stmt): Likewise. * tree.c (statement_code_p): Remove. (cp_statement_code_p): New function. (walk_stmt_tree): Remove. (init_tree): Set lang_statement_code_p. From-SVN: r36221
2000-09-07 03:36:11 +02:00
add_stmt (r);
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
return r;
}
/* Finish the body of a do-statement, which may be given by DO_STMT. */
void
finish_do_body (do_stmt)
tree do_stmt;
{
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
RECHAIN_STMTS (do_stmt, DO_BODY (do_stmt));
}
/* Finish a do-statement, which may be given by DO_STMT, and whose
COND is as indicated. */
void
finish_do_stmt (cond, do_stmt)
tree cond;
tree do_stmt;
{
cond = maybe_convert_cond (cond);
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
DO_COND (do_stmt) = cond;
finish_stmt ();
}
/* Finish a return-statement. The EXPRESSION returned, if any, is as
indicated. */
tree
finish_return_stmt (expr)
tree expr;
{
tree r;
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
if (!processing_template_decl)
expr = check_return_expr (expr);
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
if (!processing_template_decl)
{
if (DECL_DESTRUCTOR_P (current_function_decl))
{
/* Similarly, all destructors must run destructors for
base-classes before returning. So, all returns in a
destructor get sent to the DTOR_LABEL; finish_function emits
code to return a value there. */
return finish_goto_stmt (dtor_label);
}
}
r = add_stmt (build_stmt (RETURN_STMT, expr));
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
finish_stmt ();
return r;
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
}
/* Begin a for-statement. Returns a new FOR_STMT if appropriate. */
tree
begin_for_stmt ()
{
tree r;
c-common.h (build_stmt): Declare. 2000-07-10 Benjamin Chelf <chelf@codesourcery.com> * c-common.h (build_stmt): Declare. (build_continue_stmt): Likewise. (build_break_stmt): Likewise. (build_return_stmt): Likewise. * c-decl.c (do_case): Rewrite to do what previously done in c-parse.in. * c-semantics.c (build_stmt): Define. (build_return_stmt): Likewise. (build_break_stmt): Likewise. (build_continue_stmt): Likewise. (build_case_label): Likewise. * c-parse.in (BREAK): Change to build tree, then generate RTL. (CONTINUE): Likewise. (RETURN): Likewise. (CASE): Likewise. (DEFAULT): Likewise. * c-parse.y: Regenerate. * c-pasre.c: Likewise. * cp/semantics.c (finish_for_stmt): Remove call to emit_line_note. (finish_continue_stmt): Likewise. (begin_for_stmt): Remove call to note_level_for_for. (finish_goto_stmt): Change call from build_min_nt to build_stmt. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_case_label): Likewise. (genrtl_try_block): Likewise. (begin_try_block): Likewise. (begin_handler): Likewise. (begin_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (add_decl_stmt): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (setup_vtbl_ptr): Likewise. (add_scope_stmt): Likewise. * cp/decl.c (finish_constructor_body): Likewise. (finish_destructor_body): Likewise. * cp/optimize.c (copy_body_r): Likewise. (initialize_inlined_parameters): Likewise. (declare_return_variable): Likewise. (expand_call_inline): Likewise. From-SVN: r34943
2000-07-10 12:56:23 +02:00
r = build_stmt (FOR_STMT, NULL_TREE, NULL_TREE,
NULL_TREE, NULL_TREE);
Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. 2000-07-01 Benjamin Chelf <chelf@codesourcery.com> * Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. (c-semantics.o): New target. * c-common.h (TREE_LANG_FLAG_?): Added documentation. (genrtl_do_pushlevel): Moved from cp/cp-tree.h. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (gerntl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (expand_cond): Likewise. (expand_stmt): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. (do_case): Likewise. (COMPOUND_STMT_NO_SCOPE): Likewise. (c_expand_asm_operands): Likewise. (NEW_FOR_SCOPE_P): New macro. (expand_expr_stmt_fn): New type. (set_current_function_name_declared): Likewise. (current_function_name_declared): Likewise. (lang_expand_stmt): Likewise. (stmts_are_full_exprs_p): Likewise. (anon_aggr_type_p): Likewise. (lang_expand_expr_stmt): Likewise. (build_case_label): Likewise. * c-decl.c (lang_expand_expr_stmt): Initialize. (stmts_are_full_exprs_p): Define. (current_function_name_declared): Likewise. (do_case): Likewise. (lang_expand_stmt): Likewise. (set_current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (build_case_label): Likewise. * c-semantics.c: New file. (expand_cond): Moved from cp/semantics.c. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (make_rtl_for_local_static): Moved from cp/decl.c. (emit_local_var): Likewise. (expand_stmt): Define. * c-tree.h: (c_expand_asm_operands): Moved to c-common.h. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/Make-lang.in (cc1plus$(exeext)): Added c-semantics.o. * cp/Makefile.in (OBJS): Added ../c-semantics.o. (OBJDEPS): Likewise. * cp/cp-tree.h (TREE_LANG_FLAG_?): Moved common documentation to ../c-common.h. (struct stmt_tree): Added comment. (current_function_name_declared): Removed. (stmts_are_full_exprs_p): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (COMPOUND_STMT_NO_SCOPE): Moved to ../c-common.h. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (do_case): Likewise. (expand_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (c_expand_asm_operands): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/decl.c (make_rtl_for_local_static): Moved to c-semantics.c. (emit_local_var): Likewise. (initialize_local_var): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (push_cp_function_context): Likewise. * cp/expect.c (expand_throw): Change reference to stmts_are_full_exprs_p. * cp/init.c (build_aggr_init): Change reference to stmts_are_full_exprs_p. (build_vec_init): Likewise. * cp/optimize.c (maybe_clone_body): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/pt.c (instantiate_decl): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/semantics.c (expand_cond): Moved declaration to c-common.h. (genrtl_do_pushlevel): Moved to c-semantics.c. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (gerntl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (expand_cond): Likewise. (expand_stmt): Renamed to ... (lang_expand_stmt): ... this. (lang_expand_expr_stmt): Initialize. (set_current_function_name_declared): Likewise. (stmts_are_full_exprs_p): Likewise. (current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (do_poplevel): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (add_tree): Likewise. (finish_expr_stmt): Likewise. (prep_stmt): Likewise. (lang_expand_stmt): Likewise. (begin_compound_stmt): Change reference to current_function_name_declared to cp_function_chain->name_declared and call to current_function_name_declared(). (setup_vtbl_ptr): Likewise. (genrtl_do_poplevel): Removed. From-SVN: r34827
2000-07-02 07:23:01 +02:00
NEW_FOR_SCOPE_P (r) = flag_new_for_scope > 0;
if (NEW_FOR_SCOPE_P (r))
{
do_pushlevel ();
note_level_for_for ();
}
add_stmt (r);
return r;
}
/* Finish the for-init-statement of a for-statement, which may be
given by FOR_STMT. */
void
finish_for_init_stmt (for_stmt)
tree for_stmt;
{
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
if (last_tree != for_stmt)
RECHAIN_STMTS (for_stmt, FOR_INIT_STMT (for_stmt));
do_pushlevel ();
}
/* Finish the COND of a for-statement, which may be given by
FOR_STMT. */
void
finish_for_cond (cond, for_stmt)
tree cond;
tree for_stmt;
{
cond = maybe_convert_cond (cond);
if (processing_template_decl)
/* Don't mess with condition decls in a template. */
FINISH_COND (cond, for_stmt, FOR_COND (for_stmt));
else if (getdecls () == NULL_TREE)
/* It was a simple condition; install it. */
FOR_COND (for_stmt) = cond;
else
{
/* If there was a declaration in the condition, we can't leave it
there; transform
for (; A x = 42;) { }
to
for (;;) { A x = 42; if (!x) break; } */
tree if_stmt;
FOR_COND (for_stmt) = NULL_TREE;
if_stmt = begin_if_stmt ();
cond = build_unary_op (TRUTH_NOT_EXPR, cond, 0);
finish_if_stmt_cond (cond, if_stmt);
finish_break_stmt ();
finish_then_clause (if_stmt);
finish_if_stmt ();
}
}
/* Finish the increment-EXPRESSION in a for-statement, which may be
given by FOR_STMT. */
void
finish_for_expr (expr, for_stmt)
tree expr;
tree for_stmt;
{
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
FOR_EXPR (for_stmt) = expr;
}
/* Finish the body of a for-statement, which may be given by
FOR_STMT. The increment-EXPR for the loop must be
provided. */
void
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
finish_for_stmt (for_stmt)
tree for_stmt;
{
/* Pop the scope for the body of the loop. */
do_poplevel ();
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
RECHAIN_STMTS (for_stmt, FOR_BODY (for_stmt));
Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. 2000-07-01 Benjamin Chelf <chelf@codesourcery.com> * Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. (c-semantics.o): New target. * c-common.h (TREE_LANG_FLAG_?): Added documentation. (genrtl_do_pushlevel): Moved from cp/cp-tree.h. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (gerntl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (expand_cond): Likewise. (expand_stmt): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. (do_case): Likewise. (COMPOUND_STMT_NO_SCOPE): Likewise. (c_expand_asm_operands): Likewise. (NEW_FOR_SCOPE_P): New macro. (expand_expr_stmt_fn): New type. (set_current_function_name_declared): Likewise. (current_function_name_declared): Likewise. (lang_expand_stmt): Likewise. (stmts_are_full_exprs_p): Likewise. (anon_aggr_type_p): Likewise. (lang_expand_expr_stmt): Likewise. (build_case_label): Likewise. * c-decl.c (lang_expand_expr_stmt): Initialize. (stmts_are_full_exprs_p): Define. (current_function_name_declared): Likewise. (do_case): Likewise. (lang_expand_stmt): Likewise. (set_current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (build_case_label): Likewise. * c-semantics.c: New file. (expand_cond): Moved from cp/semantics.c. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (make_rtl_for_local_static): Moved from cp/decl.c. (emit_local_var): Likewise. (expand_stmt): Define. * c-tree.h: (c_expand_asm_operands): Moved to c-common.h. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/Make-lang.in (cc1plus$(exeext)): Added c-semantics.o. * cp/Makefile.in (OBJS): Added ../c-semantics.o. (OBJDEPS): Likewise. * cp/cp-tree.h (TREE_LANG_FLAG_?): Moved common documentation to ../c-common.h. (struct stmt_tree): Added comment. (current_function_name_declared): Removed. (stmts_are_full_exprs_p): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (COMPOUND_STMT_NO_SCOPE): Moved to ../c-common.h. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (do_case): Likewise. (expand_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (c_expand_asm_operands): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/decl.c (make_rtl_for_local_static): Moved to c-semantics.c. (emit_local_var): Likewise. (initialize_local_var): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (push_cp_function_context): Likewise. * cp/expect.c (expand_throw): Change reference to stmts_are_full_exprs_p. * cp/init.c (build_aggr_init): Change reference to stmts_are_full_exprs_p. (build_vec_init): Likewise. * cp/optimize.c (maybe_clone_body): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/pt.c (instantiate_decl): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/semantics.c (expand_cond): Moved declaration to c-common.h. (genrtl_do_pushlevel): Moved to c-semantics.c. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (gerntl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (expand_cond): Likewise. (expand_stmt): Renamed to ... (lang_expand_stmt): ... this. (lang_expand_expr_stmt): Initialize. (set_current_function_name_declared): Likewise. (stmts_are_full_exprs_p): Likewise. (current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (do_poplevel): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (add_tree): Likewise. (finish_expr_stmt): Likewise. (prep_stmt): Likewise. (lang_expand_stmt): Likewise. (begin_compound_stmt): Change reference to current_function_name_declared to cp_function_chain->name_declared and call to current_function_name_declared(). (setup_vtbl_ptr): Likewise. (genrtl_do_poplevel): Removed. From-SVN: r34827
2000-07-02 07:23:01 +02:00
if (NEW_FOR_SCOPE_P (for_stmt))
do_poplevel ();
finish_stmt ();
}
/* Finish a break-statement. */
tree
finish_break_stmt ()
{
return add_stmt (build_break_stmt ());
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
}
/* Finish a continue-statement. */
tree
finish_continue_stmt ()
{
return add_stmt (build_continue_stmt ());
}
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
/* Begin a switch-statement. Returns a new SWITCH_STMT if
appropriate. */
tree
begin_switch_stmt ()
{
tree r;
do_pushlevel ();
r = build_stmt (SWITCH_STMT, NULL_TREE, NULL_TREE, NULL_TREE);
Move statement-tree facilities from C++ to C front-end. * c-common.h (c_tree_index): Add CTI_VOID_ZERO. (void_zero_node): New macro. (struct stmt_tree_s): New type. (stmt_tree): New typedef. (struct language_function): New type. (last_tree): New macro. (last_expr_type): Likewise. (walk_tree_fn): New typedef. (current_stmt_tree): New function. (begin_stmt_tree): Likewise. (add_stmt): Likewise. (finish_stmt_tree): Likewise. (statement_code_p): Likewise. (lang_statement_code_p): New variable. (walk_stmt_tree): New function. (STMT_IS_FULL_EXPR_P): New macro. * c-common.c (lang_statement_code_p): New variable. (c_common_nodes_and_builtins): Initialize void_zero_node. (statement_code_p): New function. (walk_stmt_tree): Likewise. * c-decl.c (language_function): Rename to ... (c_language_function): ... this. Include language_function. (push_c_function_context): Adjust accordingly. (pop_c_function_context): Likewise. (mark_c_function_context): Likewise. (current_stmt_tree): Define. * c-semantics.c (begin_stmt_tree): New function. (add_stmt): Likewise. (prune_unused_decls): Likewise. (finish_stmt_tree): Likewise. Move statement-tree facilities from C++ to C front-end. * cp-tree.h (cp_tree_index): Remove CPTI_VOID_ZERO. (void_zero_node): Remove. (stmt_tree): Likewise. (scope_chain): Adjust. (language_function): Rename to cp_language_function. (cp_function_chain): Adjust. (current_stmt_tree): Remove. (last_tree): Likewise. (last_expr_type): Likewise. (struct lang_decl): Adjust. (STMT_IS_FULL_EXPR_P): Remove. (add_tree): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (walk_tree_fn): Likewise. (walk_stmt_tree): Likewise. * class.c (finish_struct): Replace use of add_tree with add_stmt. * decl.c (mark_stmt_tree): Adjust type. (init_decl_processing): Don't build void_zero_node. (initialize_local_var): Adjust usage of current_stmt_tree. (finish_enum): Use add_stmt, not add_tree. (save_function_data): Adjust use of language_function. (finish_constructor_body): Use add_stmt, not add_tree. (finish_destructor_body): Likewise. (push_cp_function_context): Adjust use of language_function. (pop_cp_function_context): Likewise. (mark_lang_function): Likewise. (mark_cp_function_context): Likewise. * init.c (build_aggr_init): Adjust use of current_stmt_tree. (build_vec_init): Likewise. * semantics.c (SET_LAST_STMT): Remove. (RECHAIN_STMTS): Don't use it. (stmts_are_full_exprs_p): Adjust use of current_stmt_tree. (current_stmt_tree): Define. (add_tree): Remove. (finish_goto_stmt): Use add_stmt, not add_tree. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_then_clause): Likewise. (begin_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (begin_handler): Likewise. (begin_catch_block): Likewise. (begin_compound_stmt): Likewise. (begin_asm_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (add_decl_stmt): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (setup_vtbl_ptr): Likewise. (add_scope_stmt): Likewise. (finish_stmt_expr): Likewise. (prune_unused_decls): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (prep_stmt): Adjust use of current_stmt_tree. (lang_expand_stmt): Likewise. * tree.c (statement_code_p): Remove. (cp_statement_code_p): New function. (walk_stmt_tree): Remove. (init_tree): Set lang_statement_code_p. From-SVN: r36221
2000-09-07 03:36:11 +02:00
add_stmt (r);
return r;
}
/* Finish the cond of a switch-statement. */
void
finish_switch_cond (cond, switch_stmt)
tree cond;
tree switch_stmt;
{
tree orig_type = NULL;
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
if (!processing_template_decl)
{
c-common.h (add_stmt): Change prototype. * c-common.h (add_stmt): Change prototype. (RECHAIN_STMTS): New macro. (CASE_LABEL_DECL): Likewise. (genrtl_case_label): Change prototype. (c_expand_start_case): Remove prototype. (build_case_label): Change prototype. (decl_constant_value): Declare. * c-common.c (check_case_value): Handle C++'s extensions to C semantics. * c-commnon.def (CASE_LABEL): Add room for the CASE_LABEL_DECL field. * c-parse.in (stmt): Adjust handling of return statements and case laels. * c-semantics.c (add_stmt): Return the new statement. (genrtl_return_stmt): Take the RETURN_STMT as input, not the returned expression. Directly generate RTL, rather than calling c_expand_return. (genrtl_switch_stmt): Don't call c_expand_start_case. (build_case_label): Take the LABEL_DECL as input, too. (genrtl_case_label): Just call add_case_node. (expand_stmt): Adjust calls to genrtl_return_stmt and genrtl_case_label. * c-tree.h (c_expand_start_case): Declare. * c-typeck.c (decl_constant_value): Give it external linkage. (c_expand_return): Don't call expand_return or expand_null_return; use genrtl_return_stmt instead. * stmt.c (struct nesting): Remove num_ranges field. (add_case_node): Give it external linkage. (expand_start_case): Don't set num_ranges. (expand_start_case_dummy): Don't clear it. (pushcase): Rely on add_case_node to handle `default' labels. (add_case_node): Handle `default' labels. * tree.c (tree_int_cst_compare): New function. * tree.h (tree_int_cst_compare): Declare. (add_case_node): Likewise. * cp-tree.h (push_switch): Change prototype. (check_cp_case_value): Remove declaration. (decl_constant_value): Likewise. * decl.c (struct cp_switch): Add switch_stmt and cases. (case_compare): New function. (push_switch): Set switch_stmt. Initialize cases. (pop_switch): Clean up cases. (define_case_label): Rename to ... (finish_case_label): ... this. Do semantic analysis for case labels here. (start_function): Correct comment. * decl2.c (check_cp_case_value): Remove. * expr.c (do_case): Remove. * pt.c (tsubst_expr): Adjust call to finish_case_label. * semantics.c (genrtl_do_poplevel): Remove declaration. (RECHAIN_STMTS): Remove. (finish_break_stmt): Use build_break_stmt. (finish_continue_stmt): Use build_continue_stmt. (finish_switch_cond): Adjust condition here, rater than in c_expand_start_case. (finish_case_label): Remove. * typeck.c (c_expand_return): Remove. (c_expand_start_case): Likewise. From-SVN: r36305
2000-09-10 23:34:41 +02:00
tree index;
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
/* Convert the condition to an integer or enumeration type. */
cond = build_expr_type_conversion (WANT_INT | WANT_ENUM, cond, 1);
if (cond == NULL_TREE)
{
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
error ("switch quantity not an integer");
cond = error_mark_node;
}
orig_type = TREE_TYPE (cond);
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
if (cond != error_mark_node)
{
cond = default_conversion (cond);
cond = fold (build1 (CLEANUP_POINT_EXPR, TREE_TYPE (cond), cond));
}
c-common.h (add_stmt): Change prototype. * c-common.h (add_stmt): Change prototype. (RECHAIN_STMTS): New macro. (CASE_LABEL_DECL): Likewise. (genrtl_case_label): Change prototype. (c_expand_start_case): Remove prototype. (build_case_label): Change prototype. (decl_constant_value): Declare. * c-common.c (check_case_value): Handle C++'s extensions to C semantics. * c-commnon.def (CASE_LABEL): Add room for the CASE_LABEL_DECL field. * c-parse.in (stmt): Adjust handling of return statements and case laels. * c-semantics.c (add_stmt): Return the new statement. (genrtl_return_stmt): Take the RETURN_STMT as input, not the returned expression. Directly generate RTL, rather than calling c_expand_return. (genrtl_switch_stmt): Don't call c_expand_start_case. (build_case_label): Take the LABEL_DECL as input, too. (genrtl_case_label): Just call add_case_node. (expand_stmt): Adjust calls to genrtl_return_stmt and genrtl_case_label. * c-tree.h (c_expand_start_case): Declare. * c-typeck.c (decl_constant_value): Give it external linkage. (c_expand_return): Don't call expand_return or expand_null_return; use genrtl_return_stmt instead. * stmt.c (struct nesting): Remove num_ranges field. (add_case_node): Give it external linkage. (expand_start_case): Don't set num_ranges. (expand_start_case_dummy): Don't clear it. (pushcase): Rely on add_case_node to handle `default' labels. (add_case_node): Handle `default' labels. * tree.c (tree_int_cst_compare): New function. * tree.h (tree_int_cst_compare): Declare. (add_case_node): Likewise. * cp-tree.h (push_switch): Change prototype. (check_cp_case_value): Remove declaration. (decl_constant_value): Likewise. * decl.c (struct cp_switch): Add switch_stmt and cases. (case_compare): New function. (push_switch): Set switch_stmt. Initialize cases. (pop_switch): Clean up cases. (define_case_label): Rename to ... (finish_case_label): ... this. Do semantic analysis for case labels here. (start_function): Correct comment. * decl2.c (check_cp_case_value): Remove. * expr.c (do_case): Remove. * pt.c (tsubst_expr): Adjust call to finish_case_label. * semantics.c (genrtl_do_poplevel): Remove declaration. (RECHAIN_STMTS): Remove. (finish_break_stmt): Use build_break_stmt. (finish_continue_stmt): Use build_continue_stmt. (finish_switch_cond): Adjust condition here, rater than in c_expand_start_case. (finish_case_label): Remove. * typeck.c (c_expand_return): Remove. (c_expand_start_case): Likewise. From-SVN: r36305
2000-09-10 23:34:41 +02:00
if (cond != error_mark_node)
{
index = get_unwidened (cond, NULL_TREE);
/* We can't strip a conversion from a signed type to an unsigned,
because if we did, int_fits_type_p would do the wrong thing
when checking case values for being in range,
and it's too hard to do the right thing. */
if (TREE_UNSIGNED (TREE_TYPE (cond))
== TREE_UNSIGNED (TREE_TYPE (index)))
cond = index;
}
}
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
FINISH_COND (cond, switch_stmt, SWITCH_COND (switch_stmt));
SWITCH_TYPE (switch_stmt) = orig_type;
c-common.h (add_stmt): Change prototype. * c-common.h (add_stmt): Change prototype. (RECHAIN_STMTS): New macro. (CASE_LABEL_DECL): Likewise. (genrtl_case_label): Change prototype. (c_expand_start_case): Remove prototype. (build_case_label): Change prototype. (decl_constant_value): Declare. * c-common.c (check_case_value): Handle C++'s extensions to C semantics. * c-commnon.def (CASE_LABEL): Add room for the CASE_LABEL_DECL field. * c-parse.in (stmt): Adjust handling of return statements and case laels. * c-semantics.c (add_stmt): Return the new statement. (genrtl_return_stmt): Take the RETURN_STMT as input, not the returned expression. Directly generate RTL, rather than calling c_expand_return. (genrtl_switch_stmt): Don't call c_expand_start_case. (build_case_label): Take the LABEL_DECL as input, too. (genrtl_case_label): Just call add_case_node. (expand_stmt): Adjust calls to genrtl_return_stmt and genrtl_case_label. * c-tree.h (c_expand_start_case): Declare. * c-typeck.c (decl_constant_value): Give it external linkage. (c_expand_return): Don't call expand_return or expand_null_return; use genrtl_return_stmt instead. * stmt.c (struct nesting): Remove num_ranges field. (add_case_node): Give it external linkage. (expand_start_case): Don't set num_ranges. (expand_start_case_dummy): Don't clear it. (pushcase): Rely on add_case_node to handle `default' labels. (add_case_node): Handle `default' labels. * tree.c (tree_int_cst_compare): New function. * tree.h (tree_int_cst_compare): Declare. (add_case_node): Likewise. * cp-tree.h (push_switch): Change prototype. (check_cp_case_value): Remove declaration. (decl_constant_value): Likewise. * decl.c (struct cp_switch): Add switch_stmt and cases. (case_compare): New function. (push_switch): Set switch_stmt. Initialize cases. (pop_switch): Clean up cases. (define_case_label): Rename to ... (finish_case_label): ... this. Do semantic analysis for case labels here. (start_function): Correct comment. * decl2.c (check_cp_case_value): Remove. * expr.c (do_case): Remove. * pt.c (tsubst_expr): Adjust call to finish_case_label. * semantics.c (genrtl_do_poplevel): Remove declaration. (RECHAIN_STMTS): Remove. (finish_break_stmt): Use build_break_stmt. (finish_continue_stmt): Use build_continue_stmt. (finish_switch_cond): Adjust condition here, rater than in c_expand_start_case. (finish_case_label): Remove. * typeck.c (c_expand_return): Remove. (c_expand_start_case): Likewise. From-SVN: r36305
2000-09-10 23:34:41 +02:00
push_switch (switch_stmt);
}
/* Finish the body of a switch-statement, which may be given by
SWITCH_STMT. The COND to switch on is indicated. */
void
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
finish_switch_stmt (switch_stmt)
tree switch_stmt;
{
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
RECHAIN_STMTS (switch_stmt, SWITCH_BODY (switch_stmt));
pop_switch ();
finish_stmt ();
do_poplevel ();
}
/* Generate the RTL for T, which is a TRY_BLOCK. */
static void
genrtl_try_block (t)
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
tree t;
{
if (CLEANUP_P (t))
{
expand_eh_region_start ();
expand_stmt (TRY_STMTS (t));
expand_eh_region_end_cleanup (TRY_HANDLERS (t));
Make-lang.in (CXX_SRCS): Add optimize.c. 1999-11-25 Mark Mitchell <mark@codesourcery.com> * Make-lang.in (CXX_SRCS): Add optimize.c. * Makefile.in (CXX_OBJS): Add optimize.o. (CXX_TREE_H): Add splay-tree.h, system.h, and $(CONFIG_H). (spew.o, lex.o, decl.o, decl2.o, typeck2.o, typeck.o): Adjust. (class.o, call.o, friend.o, init.o, method.o, cvt.o): Likewise. (search.o, tree.o, ptree.o, rtti.o, except.o, expr.o): Likewise. (xref.o, pt.o, error.o, errfn.o, repo.o, semantics.o): Likewise. (dump.o): Likewise. (optimize.o): New target. * class.c: Don't include splay-tree.h. * cp-tree.def (CTOR_COMPLETE): Rename to CTOR_STMT. * cp-tree.h: Include splay-tree.h. (DECL_UNINLINABLE): New macro. (CTOR_BEGIN_P, CTOR_END_P): New macros. (flag_inline_trees): New variable. (local_variable_p): New function. (nonstatic_local_decl_p): Likewise. (optimize_function): Likewise. (cplus_unsave_expr_now): Remove. (copy_tree_r): Declare. (remap_save_expr): Likewise. * decl.c (local_variable_p): Don't make it static. (local_variable_p_walkfn): New function. (make_rtl_for_local_static): Remove code to try to avoid writing out static constants. (emit_local_var): Fix indentation. (nonstatic_local_decl_p): New function. (check_default_argument): Use local_variable_p_walkfn, not local_variable_p, when walking the tree. (start_function): Set the DECL_CONTEXT for automatically generated labels. (finish_constructor_body): Use CTOR_STMT to mark the end of a constructor. * decl2.c: Don't include splay-tree.h. (flag_inline_trees): Define. * dump.c: Don't include splay-tree.h. * except.c (expand_end_catch_block): Fix comment formatting. (expand_end_eh_spec): Set DECL_CONTEXT on temporary variables. (expand_throw): Tidy comment. * init.c (build_vec_delete_1): Use create_temporary_var. * lex.c (cplus_tree_code_type): Make it static. (cplus_tree_code_length): Likewise. (cplus_tree_code_name): Likewise. * optimize.c: New file. * semantics.c (finish_goto_stmt): Set DECL_UNLINABLE for functions with computed gotos. (setup_vtbl_ptr): Mark the beginnings of constructors with CTOR_STMT. (expand_stmt): Handle CTOR_STMT, not CTOR_COMPLETE. (expand_body): Call optimize_function. Save bodies if we're doing inlining on trees. * tree.c: Don't include splay-tree.h. Include insn-config.h and integrate.h. (copy_tree_r): Make it public. (statement_code_p): New function. (mark_local_for_remap_r): Likewise. (cp_usave_r): Likewise. (cp_unsave): Likewise. (build_cplus_new): Set DECL_CONTEXT for temporary variables. (walk_tree): Walk into `s' class nodes. Walk statement chains. (copy_tree_r): Handle 's' class nodes. Restore chains for statements. Nullify scopes. Don't copy types. (init_tree): Set lang_unsave to cp_unsave. (remap_save_expr): Define. * ir.texi: Document CTOR_STMT. From-SVN: r30669
1999-11-25 21:32:04 +01:00
}
else
{
c-common.h (genrtl_clear_out_block): Remove. * c-common.h (genrtl_clear_out_block): Remove. * c-semantics.c (genrtl_clear_out_block): Remove. (genrtl_while_stmt): Don't call it. (genrtl_for_stmt): Likewise. * cp-tree.h (struct saved_scope): Remove x_function_parms. (current_function_parms): Don't define. (struct cp_language_function): Remove parms_stored. (current_function_just_assigned_this): Don't define. (current_function_parms_stored): Likewise. (static_ctors): Declare. (static_dtors): Likewise. (SF_EXPAND): Don't define. (expand_start_early_try_stmts): Remove declaration. (store_parm_decls): Likewise. * decl.c (static_ctors): Don't declare. (static_dtors): Likewise. (struct binding_level): Remove this_block. (poplevel): Remove dead code. (set_block): Likewise. (mark_binding_level): Don't mark this_block. (mark_saved_scope): Don't mark x_function_parms. (init_decl_processing): Don't add current_function_parms as a GC root. (check_function_type): Change prototype. (start_function): Remove RTL-generation code. (expand_start_early_try_stmts): Remove. (store_parm_decls): Give it internal linkage. Remove RTL-generation code. (finish_function): Remove RTL-generation code. * decl2.c (static_ctors): Fix formatting. (static_dtors): Likewise. * method.c (use_thunk): Don't call store_parm_decls. (synthesize_method): Likewise. * optimize.c (maybe_clone_body): Likewise. * parse.y (fn.def2): Likewise. (.set_base_init): Likewise. (nodecls): Likewise. * pt.c (instantiate_decl): Likewise. * rtti.c (synthesize_tinfo_fn): Likewise. * semantics.c (genrtl_try_block): Simplify. (expand_body): Use genrtl_start_function and genrtl_finish_function. (genrtl_start_function): New function. (genrtl_finish_function): Likewise. From-SVN: r36350
2000-09-12 08:46:00 +02:00
if (!FN_TRY_BLOCK_P (t))
emit_line_note (input_filename, lineno);
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
expand_eh_region_start ();
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
expand_stmt (TRY_STMTS (t));
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
if (FN_TRY_BLOCK_P (t))
{
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
expand_start_all_catch ();
in_function_try_handler = 1;
expand_stmt (TRY_HANDLERS (t));
in_function_try_handler = 0;
expand_end_all_catch ();
}
else
{
expand_start_all_catch ();
expand_stmt (TRY_HANDLERS (t));
expand_end_all_catch ();
}
}
}
/* Generate the RTL for T, which is an EH_SPEC_BLOCK. */
static void
genrtl_eh_spec_block (t)
tree t;
{
expand_eh_region_start ();
expand_stmt (EH_SPEC_STMTS (t));
expand_eh_region_end_allowed (EH_SPEC_RAISES (t),
build_call (call_unexpected_node,
tree_cons (NULL_TREE,
build_exc_ptr (),
NULL_TREE)));
}
/* Begin a try-block. Returns a newly-created TRY_BLOCK if
appropriate. */
tree
begin_try_block ()
{
c-common.h (build_stmt): Declare. 2000-07-10 Benjamin Chelf <chelf@codesourcery.com> * c-common.h (build_stmt): Declare. (build_continue_stmt): Likewise. (build_break_stmt): Likewise. (build_return_stmt): Likewise. * c-decl.c (do_case): Rewrite to do what previously done in c-parse.in. * c-semantics.c (build_stmt): Define. (build_return_stmt): Likewise. (build_break_stmt): Likewise. (build_continue_stmt): Likewise. (build_case_label): Likewise. * c-parse.in (BREAK): Change to build tree, then generate RTL. (CONTINUE): Likewise. (RETURN): Likewise. (CASE): Likewise. (DEFAULT): Likewise. * c-parse.y: Regenerate. * c-pasre.c: Likewise. * cp/semantics.c (finish_for_stmt): Remove call to emit_line_note. (finish_continue_stmt): Likewise. (begin_for_stmt): Remove call to note_level_for_for. (finish_goto_stmt): Change call from build_min_nt to build_stmt. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_case_label): Likewise. (genrtl_try_block): Likewise. (begin_try_block): Likewise. (begin_handler): Likewise. (begin_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (add_decl_stmt): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (setup_vtbl_ptr): Likewise. (add_scope_stmt): Likewise. * cp/decl.c (finish_constructor_body): Likewise. (finish_destructor_body): Likewise. * cp/optimize.c (copy_body_r): Likewise. (initialize_inlined_parameters): Likewise. (declare_return_variable): Likewise. (expand_call_inline): Likewise. From-SVN: r34943
2000-07-10 12:56:23 +02:00
tree r = build_stmt (TRY_BLOCK, NULL_TREE, NULL_TREE);
Move statement-tree facilities from C++ to C front-end. * c-common.h (c_tree_index): Add CTI_VOID_ZERO. (void_zero_node): New macro. (struct stmt_tree_s): New type. (stmt_tree): New typedef. (struct language_function): New type. (last_tree): New macro. (last_expr_type): Likewise. (walk_tree_fn): New typedef. (current_stmt_tree): New function. (begin_stmt_tree): Likewise. (add_stmt): Likewise. (finish_stmt_tree): Likewise. (statement_code_p): Likewise. (lang_statement_code_p): New variable. (walk_stmt_tree): New function. (STMT_IS_FULL_EXPR_P): New macro. * c-common.c (lang_statement_code_p): New variable. (c_common_nodes_and_builtins): Initialize void_zero_node. (statement_code_p): New function. (walk_stmt_tree): Likewise. * c-decl.c (language_function): Rename to ... (c_language_function): ... this. Include language_function. (push_c_function_context): Adjust accordingly. (pop_c_function_context): Likewise. (mark_c_function_context): Likewise. (current_stmt_tree): Define. * c-semantics.c (begin_stmt_tree): New function. (add_stmt): Likewise. (prune_unused_decls): Likewise. (finish_stmt_tree): Likewise. Move statement-tree facilities from C++ to C front-end. * cp-tree.h (cp_tree_index): Remove CPTI_VOID_ZERO. (void_zero_node): Remove. (stmt_tree): Likewise. (scope_chain): Adjust. (language_function): Rename to cp_language_function. (cp_function_chain): Adjust. (current_stmt_tree): Remove. (last_tree): Likewise. (last_expr_type): Likewise. (struct lang_decl): Adjust. (STMT_IS_FULL_EXPR_P): Remove. (add_tree): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (walk_tree_fn): Likewise. (walk_stmt_tree): Likewise. * class.c (finish_struct): Replace use of add_tree with add_stmt. * decl.c (mark_stmt_tree): Adjust type. (init_decl_processing): Don't build void_zero_node. (initialize_local_var): Adjust usage of current_stmt_tree. (finish_enum): Use add_stmt, not add_tree. (save_function_data): Adjust use of language_function. (finish_constructor_body): Use add_stmt, not add_tree. (finish_destructor_body): Likewise. (push_cp_function_context): Adjust use of language_function. (pop_cp_function_context): Likewise. (mark_lang_function): Likewise. (mark_cp_function_context): Likewise. * init.c (build_aggr_init): Adjust use of current_stmt_tree. (build_vec_init): Likewise. * semantics.c (SET_LAST_STMT): Remove. (RECHAIN_STMTS): Don't use it. (stmts_are_full_exprs_p): Adjust use of current_stmt_tree. (current_stmt_tree): Define. (add_tree): Remove. (finish_goto_stmt): Use add_stmt, not add_tree. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_then_clause): Likewise. (begin_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (begin_handler): Likewise. (begin_catch_block): Likewise. (begin_compound_stmt): Likewise. (begin_asm_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (add_decl_stmt): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (setup_vtbl_ptr): Likewise. (add_scope_stmt): Likewise. (finish_stmt_expr): Likewise. (prune_unused_decls): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (prep_stmt): Adjust use of current_stmt_tree. (lang_expand_stmt): Likewise. * tree.c (statement_code_p): Remove. (cp_statement_code_p): New function. (walk_stmt_tree): Remove. (init_tree): Set lang_statement_code_p. From-SVN: r36221
2000-09-07 03:36:11 +02:00
add_stmt (r);
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
return r;
}
/* Likewise, for a function-try-block. */
tree
begin_function_try_block ()
{
c-common.h (build_stmt): Declare. 2000-07-10 Benjamin Chelf <chelf@codesourcery.com> * c-common.h (build_stmt): Declare. (build_continue_stmt): Likewise. (build_break_stmt): Likewise. (build_return_stmt): Likewise. * c-decl.c (do_case): Rewrite to do what previously done in c-parse.in. * c-semantics.c (build_stmt): Define. (build_return_stmt): Likewise. (build_break_stmt): Likewise. (build_continue_stmt): Likewise. (build_case_label): Likewise. * c-parse.in (BREAK): Change to build tree, then generate RTL. (CONTINUE): Likewise. (RETURN): Likewise. (CASE): Likewise. (DEFAULT): Likewise. * c-parse.y: Regenerate. * c-pasre.c: Likewise. * cp/semantics.c (finish_for_stmt): Remove call to emit_line_note. (finish_continue_stmt): Likewise. (begin_for_stmt): Remove call to note_level_for_for. (finish_goto_stmt): Change call from build_min_nt to build_stmt. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_case_label): Likewise. (genrtl_try_block): Likewise. (begin_try_block): Likewise. (begin_handler): Likewise. (begin_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (add_decl_stmt): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (setup_vtbl_ptr): Likewise. (add_scope_stmt): Likewise. * cp/decl.c (finish_constructor_body): Likewise. (finish_destructor_body): Likewise. * cp/optimize.c (copy_body_r): Likewise. (initialize_inlined_parameters): Likewise. (declare_return_variable): Likewise. (expand_call_inline): Likewise. From-SVN: r34943
2000-07-10 12:56:23 +02:00
tree r = build_stmt (TRY_BLOCK, NULL_TREE, NULL_TREE);
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
FN_TRY_BLOCK_P (r) = 1;
Move statement-tree facilities from C++ to C front-end. * c-common.h (c_tree_index): Add CTI_VOID_ZERO. (void_zero_node): New macro. (struct stmt_tree_s): New type. (stmt_tree): New typedef. (struct language_function): New type. (last_tree): New macro. (last_expr_type): Likewise. (walk_tree_fn): New typedef. (current_stmt_tree): New function. (begin_stmt_tree): Likewise. (add_stmt): Likewise. (finish_stmt_tree): Likewise. (statement_code_p): Likewise. (lang_statement_code_p): New variable. (walk_stmt_tree): New function. (STMT_IS_FULL_EXPR_P): New macro. * c-common.c (lang_statement_code_p): New variable. (c_common_nodes_and_builtins): Initialize void_zero_node. (statement_code_p): New function. (walk_stmt_tree): Likewise. * c-decl.c (language_function): Rename to ... (c_language_function): ... this. Include language_function. (push_c_function_context): Adjust accordingly. (pop_c_function_context): Likewise. (mark_c_function_context): Likewise. (current_stmt_tree): Define. * c-semantics.c (begin_stmt_tree): New function. (add_stmt): Likewise. (prune_unused_decls): Likewise. (finish_stmt_tree): Likewise. Move statement-tree facilities from C++ to C front-end. * cp-tree.h (cp_tree_index): Remove CPTI_VOID_ZERO. (void_zero_node): Remove. (stmt_tree): Likewise. (scope_chain): Adjust. (language_function): Rename to cp_language_function. (cp_function_chain): Adjust. (current_stmt_tree): Remove. (last_tree): Likewise. (last_expr_type): Likewise. (struct lang_decl): Adjust. (STMT_IS_FULL_EXPR_P): Remove. (add_tree): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (walk_tree_fn): Likewise. (walk_stmt_tree): Likewise. * class.c (finish_struct): Replace use of add_tree with add_stmt. * decl.c (mark_stmt_tree): Adjust type. (init_decl_processing): Don't build void_zero_node. (initialize_local_var): Adjust usage of current_stmt_tree. (finish_enum): Use add_stmt, not add_tree. (save_function_data): Adjust use of language_function. (finish_constructor_body): Use add_stmt, not add_tree. (finish_destructor_body): Likewise. (push_cp_function_context): Adjust use of language_function. (pop_cp_function_context): Likewise. (mark_lang_function): Likewise. (mark_cp_function_context): Likewise. * init.c (build_aggr_init): Adjust use of current_stmt_tree. (build_vec_init): Likewise. * semantics.c (SET_LAST_STMT): Remove. (RECHAIN_STMTS): Don't use it. (stmts_are_full_exprs_p): Adjust use of current_stmt_tree. (current_stmt_tree): Define. (add_tree): Remove. (finish_goto_stmt): Use add_stmt, not add_tree. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_then_clause): Likewise. (begin_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (begin_handler): Likewise. (begin_catch_block): Likewise. (begin_compound_stmt): Likewise. (begin_asm_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (add_decl_stmt): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (setup_vtbl_ptr): Likewise. (add_scope_stmt): Likewise. (finish_stmt_expr): Likewise. (prune_unused_decls): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (prep_stmt): Adjust use of current_stmt_tree. (lang_expand_stmt): Likewise. * tree.c (statement_code_p): Remove. (cp_statement_code_p): New function. (walk_stmt_tree): Remove. (init_tree): Set lang_statement_code_p. From-SVN: r36221
2000-09-07 03:36:11 +02:00
add_stmt (r);
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
return r;
}
/* Finish a try-block, which may be given by TRY_BLOCK. */
void
finish_try_block (try_block)
tree try_block;
{
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
RECHAIN_STMTS (try_block, TRY_STMTS (try_block));
}
/* Finish the body of a cleanup try-block, which may be given by
TRY_BLOCK. */
void
finish_cleanup_try_block (try_block)
tree try_block;
{
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
RECHAIN_STMTS (try_block, TRY_STMTS (try_block));
}
cp-tree.def (SUBOBJECT): New tree node. * cp-tree.def (SUBOBJECT): New tree node. * cp-tree.h (CLEANUP_P): New macro. (SUBOBJECT_CLEANUP): Likewise. (keep_next_level): Add parameter. (get_temp_regvar): Don't declare. (emit_base_init): Remove parameter. (expand_aggr_init): Rename to build_aggr_init. (expand_vec_init): Rename to build_vec_init. (do_pushlevel): Remove. (do_poplevel): Likewise. (finish_cleanup): New function. (finish_subobject): Likewise. (stmts_are_full_exprs_p): New variable. * decl.c (keep_next_level): Add parameter. (cp_finish_decl): Use build_aggr_init, not expand_aggr_init. Use finish_expr_stmt to expand the code. (expand_static_init): Use tree-generating, not RTL-generating, functions to handle the initialization. (start_function): Remove dead code. Always have a momentary obstack inside the function, even before hitting the first curly brace. (cplus_expand_expr_stmt): Move calls to expand_{start,end}_target_temps into semantics.c. (cp_function): Add stmts_are_full_exprs_p. (push_cp_function_context): Save it. (pop_cp_function_context): Restore it. * decl2.c (get_temp_regvar): Move to init.c. (do_static_initialization): Use build_{aggr,vec}_init. (do_static_destruction): Fix typo in comment. * dump.c (dequeue_and_dump): Handle INIT_EXPR. * except.c (expand_throw): Use create_temporary_var. * expr.c (cplus_expand_expr): Use build_{aggr,vec}_init. * init.c (expand_vec_init_try_block): Remove. (expand_vec_init_catch_clause): Likewise. (get_temp_regvar): New function. (begin_init_stmts): Likewise. (finish_init_stmts): Likewise. (perform_member_init): Use build_{aggr,vec}_init. Build up tree structure here. (emit_base_init): Likewise. Remove unused parameter. (expand_virtual_init): Likewise. (expand_cleanup_for_base): Use finish_subobject. (expand_aggr_vbase_init_1): Simplify. (construct_virtual_bases): Use tree-generating functions to build up initialization. (expand_aggr_init): Likewise. Rename to build_aggr_init. (expand_default_init): Likewise. (expand_aggr_init_1): Likewise. (expand_vec_init): Rename to build_vec_init. * method.c (do_build_copy_constructor): Use tree-generating functions. Don't call clear_last_expr. (do_build_assign_ref): Likewise. (synthesize_method): Call clear_last_expr here. * parse.y (base_init): Don't call clear_last_expr here. (nodecls): Likewise. * pt.c (tsubst_expr): Handle a TRY_BLOCK with CLEANUP_P set. * semantics.c (do_pushlevel): Move to here. (do_poplevel): Likewise. (stmts_are_full_exprs_p): New variable. (finish_expr_stmt): Handle logic for temoprary cleanup here. (finish_for_stmt): Use finish_expr_stmt. (finish_cleanup): New function. (finish_function_try_block): Fix indentation. (finish_subobject): New function. (setup_vtbl_ptr): Call keep_next_level here. (finish_stmt_expr): Handle a block with no scope inside the statement-expression. (expand_stmt): Handle a TRY_BLOCK with CLEANUP_P set. Handle SUBOBJECT. * tree.c (search_tree): Handle INIT_EXPR. (mapcar): Likewise. * typeck.c (build_modify_expr): Don't build an RTL_EXPR. * typeck2.c (store_init_value): Change expand_aggr_init to build_aggr_init in comment. From-SVN: r28878
1999-08-26 00:07:18 +02:00
/* Finish an implicitly generated try-block, with a cleanup is given
by CLEANUP. */
void
finish_cleanup (cleanup, try_block)
tree cleanup;
tree try_block;
{
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
TRY_HANDLERS (try_block) = cleanup;
CLEANUP_P (try_block) = 1;
cp-tree.def (SUBOBJECT): New tree node. * cp-tree.def (SUBOBJECT): New tree node. * cp-tree.h (CLEANUP_P): New macro. (SUBOBJECT_CLEANUP): Likewise. (keep_next_level): Add parameter. (get_temp_regvar): Don't declare. (emit_base_init): Remove parameter. (expand_aggr_init): Rename to build_aggr_init. (expand_vec_init): Rename to build_vec_init. (do_pushlevel): Remove. (do_poplevel): Likewise. (finish_cleanup): New function. (finish_subobject): Likewise. (stmts_are_full_exprs_p): New variable. * decl.c (keep_next_level): Add parameter. (cp_finish_decl): Use build_aggr_init, not expand_aggr_init. Use finish_expr_stmt to expand the code. (expand_static_init): Use tree-generating, not RTL-generating, functions to handle the initialization. (start_function): Remove dead code. Always have a momentary obstack inside the function, even before hitting the first curly brace. (cplus_expand_expr_stmt): Move calls to expand_{start,end}_target_temps into semantics.c. (cp_function): Add stmts_are_full_exprs_p. (push_cp_function_context): Save it. (pop_cp_function_context): Restore it. * decl2.c (get_temp_regvar): Move to init.c. (do_static_initialization): Use build_{aggr,vec}_init. (do_static_destruction): Fix typo in comment. * dump.c (dequeue_and_dump): Handle INIT_EXPR. * except.c (expand_throw): Use create_temporary_var. * expr.c (cplus_expand_expr): Use build_{aggr,vec}_init. * init.c (expand_vec_init_try_block): Remove. (expand_vec_init_catch_clause): Likewise. (get_temp_regvar): New function. (begin_init_stmts): Likewise. (finish_init_stmts): Likewise. (perform_member_init): Use build_{aggr,vec}_init. Build up tree structure here. (emit_base_init): Likewise. Remove unused parameter. (expand_virtual_init): Likewise. (expand_cleanup_for_base): Use finish_subobject. (expand_aggr_vbase_init_1): Simplify. (construct_virtual_bases): Use tree-generating functions to build up initialization. (expand_aggr_init): Likewise. Rename to build_aggr_init. (expand_default_init): Likewise. (expand_aggr_init_1): Likewise. (expand_vec_init): Rename to build_vec_init. * method.c (do_build_copy_constructor): Use tree-generating functions. Don't call clear_last_expr. (do_build_assign_ref): Likewise. (synthesize_method): Call clear_last_expr here. * parse.y (base_init): Don't call clear_last_expr here. (nodecls): Likewise. * pt.c (tsubst_expr): Handle a TRY_BLOCK with CLEANUP_P set. * semantics.c (do_pushlevel): Move to here. (do_poplevel): Likewise. (stmts_are_full_exprs_p): New variable. (finish_expr_stmt): Handle logic for temoprary cleanup here. (finish_for_stmt): Use finish_expr_stmt. (finish_cleanup): New function. (finish_function_try_block): Fix indentation. (finish_subobject): New function. (setup_vtbl_ptr): Call keep_next_level here. (finish_stmt_expr): Handle a block with no scope inside the statement-expression. (expand_stmt): Handle a TRY_BLOCK with CLEANUP_P set. Handle SUBOBJECT. * tree.c (search_tree): Handle INIT_EXPR. (mapcar): Likewise. * typeck.c (build_modify_expr): Don't build an RTL_EXPR. * typeck2.c (store_init_value): Change expand_aggr_init to build_aggr_init in comment. From-SVN: r28878
1999-08-26 00:07:18 +02:00
}
/* Likewise, for a function-try-block. */
void
finish_function_try_block (try_block)
tree try_block;
{
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
if (TREE_CHAIN (try_block)
&& TREE_CODE (TREE_CHAIN (try_block)) == CTOR_INITIALIZER)
{
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
/* Chain the compound statement after the CTOR_INITIALIZER. */
TREE_CHAIN (TREE_CHAIN (try_block)) = last_tree;
/* And make the CTOR_INITIALIZER the body of the try-block. */
RECHAIN_STMTS (try_block, TRY_STMTS (try_block));
}
else
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
RECHAIN_STMTS (try_block, TRY_STMTS (try_block));
Turn on function-at-a-time processing. * cp-tree.h (doing_semantic_analysis_p): New macro. (SF_DEFAULT): Define to zero, not SF_EXPAND. (start_handler_parms): Change prototype. (expand_start_catch_block): Likewise. (expand_end_catch_block): Likewise. (expand_start_eh_spec): Likewise. (expand_end_eh_spec): Declare. (finish_handler_parms): Change prototype. (begin_catch_block): Declare. (finish_handler): Change prototype. (do_pushlevel): Declare. (do_poplevel): Likewise. * decl.c (pushlevel): Don't create binding levels when not doing semantic analysis. (poplevel): Don't pop them. (pushdecl): Assert that we are never called when not doing semantic analysis. (pushdecl_top_level): Use push_to_top_level. (make_label_decl): Don't fiddle with obstacks. Make RTL For the label when expanding. (cp_finish_decl): Only inject for-scope variables when doing semantic analysis. Add comments. (start_handler_parms): Return the handler parm. (start_function): Reorganize. Don't clear DECL_INITIAL if it is already set. Reinitialize from saved function data if available. Don't pushlevel when not doing semantic analysis. (store_parm_decls): Only generate RTL when expanding. Only pushdecl when doing semantic analysis. Set current_eh_spec_try_block if appropriate. (finish_function): Simplify. Use do_pushlevel and do_poplevel. Combine common code. Don't poplevel when not doing semantic analysis. (push_cp_function_context): Don't expand functions without an explicit call to expand_body. (mark_lang_function): Make eh_spec_try_block and x_scope_stmt_stack. * except.c (expand_end_eh_spec): Don't declare. (process_start_catch_block): Likewise. (push_eh_cleanup): Use finish_decl_cleanup. (initialize_handler_parm): New function. (expand_start_catch_block): Use it. (expand_end_catch_block): Use tree-generation functions, not RTL-generation functions. (expand_start_eh_spec): Likewise. (expand_end_eh_spec): Likewise. (expand_exception_blocks): Simplify. (start_anon_func): Use do_pushlevel. (end_anon_func): Use do_poplvel. Call expand_body for the function. * expr.c (do_case): Don't call define_case_label. * init.c (create_temporary_var): Set DECL_CONTEXT for local variables. * method.c (emit_thunk): Call expand_body for the thunk. (sythesize_method): Likewise. * parse.y (handler_args): Give it ttype. (eat_saved_input): Call expand_body. (base_init): Use do_pushlevel. (pending_inline): Call expand_body. (handler): Adjust calls to finish_handler_parms and finish_handler. (handler_args): Don't call expand_start_catch_block. Return the catch parameter. * pt.c (tsubst_expr): Adjust HANDLER handling. * parse.c: Regenerated. * rtti.c (synthesize_tinfo_fn): Call finish_function. * semantics.c (do_pushlevel): Give it external linkage. Build SCOPE_STMTs. (do_poplevel): Likewise. (finish_case_label): Call define_case_label when doing semantic analysis. (finish_goto_stmt): Create RTL for labels. (finish_function_try_block): Set in_function_try_handler unconditionally. (finish_function_handler_sequence): Unset it. (finish_handler_parms): Use expand_start_catch_block even when building a statement-tree. (begin_catch_block): New function. (finish_handler): Move a little RTL-generation logic here. (finish_decl_cleanup): Allow cleanups for empty declarations. (finish_named_return_value): Don't pushdecl when not doing semantic analysis. (expand_stmt): Don't do semantic analysis for variable declarations. Handle START_CATCH_STMT. Call expand_label directly for a LABEL_STMT. Tweak handling of GOTO_STMT. Adjust HANDLERs. Handle SCOPE_STMT, CTOR_INITIALIZER, and RETURN_INIT. (expand_body): Let expand_stmt handle CTOR_INITIALIZER, RETURN_INIT and function try blocks. From-SVN: r29490
1999-09-18 03:23:20 +02:00
in_function_try_handler = 1;
}
/* Finish a handler-sequence for a try-block, which may be given by
TRY_BLOCK. */
void
finish_handler_sequence (try_block)
tree try_block;
{
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
RECHAIN_STMTS (try_block, TRY_HANDLERS (try_block));
check_handlers (TRY_HANDLERS (try_block));
}
/* Likewise, for a function-try-block. */
void
finish_function_handler_sequence (try_block)
tree try_block;
{
Turn on function-at-a-time processing. * cp-tree.h (doing_semantic_analysis_p): New macro. (SF_DEFAULT): Define to zero, not SF_EXPAND. (start_handler_parms): Change prototype. (expand_start_catch_block): Likewise. (expand_end_catch_block): Likewise. (expand_start_eh_spec): Likewise. (expand_end_eh_spec): Declare. (finish_handler_parms): Change prototype. (begin_catch_block): Declare. (finish_handler): Change prototype. (do_pushlevel): Declare. (do_poplevel): Likewise. * decl.c (pushlevel): Don't create binding levels when not doing semantic analysis. (poplevel): Don't pop them. (pushdecl): Assert that we are never called when not doing semantic analysis. (pushdecl_top_level): Use push_to_top_level. (make_label_decl): Don't fiddle with obstacks. Make RTL For the label when expanding. (cp_finish_decl): Only inject for-scope variables when doing semantic analysis. Add comments. (start_handler_parms): Return the handler parm. (start_function): Reorganize. Don't clear DECL_INITIAL if it is already set. Reinitialize from saved function data if available. Don't pushlevel when not doing semantic analysis. (store_parm_decls): Only generate RTL when expanding. Only pushdecl when doing semantic analysis. Set current_eh_spec_try_block if appropriate. (finish_function): Simplify. Use do_pushlevel and do_poplevel. Combine common code. Don't poplevel when not doing semantic analysis. (push_cp_function_context): Don't expand functions without an explicit call to expand_body. (mark_lang_function): Make eh_spec_try_block and x_scope_stmt_stack. * except.c (expand_end_eh_spec): Don't declare. (process_start_catch_block): Likewise. (push_eh_cleanup): Use finish_decl_cleanup. (initialize_handler_parm): New function. (expand_start_catch_block): Use it. (expand_end_catch_block): Use tree-generation functions, not RTL-generation functions. (expand_start_eh_spec): Likewise. (expand_end_eh_spec): Likewise. (expand_exception_blocks): Simplify. (start_anon_func): Use do_pushlevel. (end_anon_func): Use do_poplvel. Call expand_body for the function. * expr.c (do_case): Don't call define_case_label. * init.c (create_temporary_var): Set DECL_CONTEXT for local variables. * method.c (emit_thunk): Call expand_body for the thunk. (sythesize_method): Likewise. * parse.y (handler_args): Give it ttype. (eat_saved_input): Call expand_body. (base_init): Use do_pushlevel. (pending_inline): Call expand_body. (handler): Adjust calls to finish_handler_parms and finish_handler. (handler_args): Don't call expand_start_catch_block. Return the catch parameter. * pt.c (tsubst_expr): Adjust HANDLER handling. * parse.c: Regenerated. * rtti.c (synthesize_tinfo_fn): Call finish_function. * semantics.c (do_pushlevel): Give it external linkage. Build SCOPE_STMTs. (do_poplevel): Likewise. (finish_case_label): Call define_case_label when doing semantic analysis. (finish_goto_stmt): Create RTL for labels. (finish_function_try_block): Set in_function_try_handler unconditionally. (finish_function_handler_sequence): Unset it. (finish_handler_parms): Use expand_start_catch_block even when building a statement-tree. (begin_catch_block): New function. (finish_handler): Move a little RTL-generation logic here. (finish_decl_cleanup): Allow cleanups for empty declarations. (finish_named_return_value): Don't pushdecl when not doing semantic analysis. (expand_stmt): Don't do semantic analysis for variable declarations. Handle START_CATCH_STMT. Call expand_label directly for a LABEL_STMT. Tweak handling of GOTO_STMT. Adjust HANDLERs. Handle SCOPE_STMT, CTOR_INITIALIZER, and RETURN_INIT. (expand_body): Let expand_stmt handle CTOR_INITIALIZER, RETURN_INIT and function try blocks. From-SVN: r29490
1999-09-18 03:23:20 +02:00
in_function_try_handler = 0;
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
RECHAIN_STMTS (try_block, TRY_HANDLERS (try_block));
check_handlers (TRY_HANDLERS (try_block));
}
/* Generate the RTL for T, which is a HANDLER. */
Turn on function-at-a-time processing. * cp-tree.h (doing_semantic_analysis_p): New macro. (SF_DEFAULT): Define to zero, not SF_EXPAND. (start_handler_parms): Change prototype. (expand_start_catch_block): Likewise. (expand_end_catch_block): Likewise. (expand_start_eh_spec): Likewise. (expand_end_eh_spec): Declare. (finish_handler_parms): Change prototype. (begin_catch_block): Declare. (finish_handler): Change prototype. (do_pushlevel): Declare. (do_poplevel): Likewise. * decl.c (pushlevel): Don't create binding levels when not doing semantic analysis. (poplevel): Don't pop them. (pushdecl): Assert that we are never called when not doing semantic analysis. (pushdecl_top_level): Use push_to_top_level. (make_label_decl): Don't fiddle with obstacks. Make RTL For the label when expanding. (cp_finish_decl): Only inject for-scope variables when doing semantic analysis. Add comments. (start_handler_parms): Return the handler parm. (start_function): Reorganize. Don't clear DECL_INITIAL if it is already set. Reinitialize from saved function data if available. Don't pushlevel when not doing semantic analysis. (store_parm_decls): Only generate RTL when expanding. Only pushdecl when doing semantic analysis. Set current_eh_spec_try_block if appropriate. (finish_function): Simplify. Use do_pushlevel and do_poplevel. Combine common code. Don't poplevel when not doing semantic analysis. (push_cp_function_context): Don't expand functions without an explicit call to expand_body. (mark_lang_function): Make eh_spec_try_block and x_scope_stmt_stack. * except.c (expand_end_eh_spec): Don't declare. (process_start_catch_block): Likewise. (push_eh_cleanup): Use finish_decl_cleanup. (initialize_handler_parm): New function. (expand_start_catch_block): Use it. (expand_end_catch_block): Use tree-generation functions, not RTL-generation functions. (expand_start_eh_spec): Likewise. (expand_end_eh_spec): Likewise. (expand_exception_blocks): Simplify. (start_anon_func): Use do_pushlevel. (end_anon_func): Use do_poplvel. Call expand_body for the function. * expr.c (do_case): Don't call define_case_label. * init.c (create_temporary_var): Set DECL_CONTEXT for local variables. * method.c (emit_thunk): Call expand_body for the thunk. (sythesize_method): Likewise. * parse.y (handler_args): Give it ttype. (eat_saved_input): Call expand_body. (base_init): Use do_pushlevel. (pending_inline): Call expand_body. (handler): Adjust calls to finish_handler_parms and finish_handler. (handler_args): Don't call expand_start_catch_block. Return the catch parameter. * pt.c (tsubst_expr): Adjust HANDLER handling. * parse.c: Regenerated. * rtti.c (synthesize_tinfo_fn): Call finish_function. * semantics.c (do_pushlevel): Give it external linkage. Build SCOPE_STMTs. (do_poplevel): Likewise. (finish_case_label): Call define_case_label when doing semantic analysis. (finish_goto_stmt): Create RTL for labels. (finish_function_try_block): Set in_function_try_handler unconditionally. (finish_function_handler_sequence): Unset it. (finish_handler_parms): Use expand_start_catch_block even when building a statement-tree. (begin_catch_block): New function. (finish_handler): Move a little RTL-generation logic here. (finish_decl_cleanup): Allow cleanups for empty declarations. (finish_named_return_value): Don't pushdecl when not doing semantic analysis. (expand_stmt): Don't do semantic analysis for variable declarations. Handle START_CATCH_STMT. Call expand_label directly for a LABEL_STMT. Tweak handling of GOTO_STMT. Adjust HANDLERs. Handle SCOPE_STMT, CTOR_INITIALIZER, and RETURN_INIT. (expand_body): Let expand_stmt handle CTOR_INITIALIZER, RETURN_INIT and function try blocks. From-SVN: r29490
1999-09-18 03:23:20 +02:00
static void
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
genrtl_handler (t)
tree t;
{
genrtl_do_pushlevel ();
if (!processing_template_decl)
expand_start_catch (HANDLER_TYPE (t));
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
expand_stmt (HANDLER_BODY (t));
if (!processing_template_decl)
expand_end_catch ();
}
/* Begin a handler. Returns a HANDLER if appropriate. */
tree
begin_handler ()
{
tree r;
c-common.h (build_stmt): Declare. 2000-07-10 Benjamin Chelf <chelf@codesourcery.com> * c-common.h (build_stmt): Declare. (build_continue_stmt): Likewise. (build_break_stmt): Likewise. (build_return_stmt): Likewise. * c-decl.c (do_case): Rewrite to do what previously done in c-parse.in. * c-semantics.c (build_stmt): Define. (build_return_stmt): Likewise. (build_break_stmt): Likewise. (build_continue_stmt): Likewise. (build_case_label): Likewise. * c-parse.in (BREAK): Change to build tree, then generate RTL. (CONTINUE): Likewise. (RETURN): Likewise. (CASE): Likewise. (DEFAULT): Likewise. * c-parse.y: Regenerate. * c-pasre.c: Likewise. * cp/semantics.c (finish_for_stmt): Remove call to emit_line_note. (finish_continue_stmt): Likewise. (begin_for_stmt): Remove call to note_level_for_for. (finish_goto_stmt): Change call from build_min_nt to build_stmt. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_case_label): Likewise. (genrtl_try_block): Likewise. (begin_try_block): Likewise. (begin_handler): Likewise. (begin_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (add_decl_stmt): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (setup_vtbl_ptr): Likewise. (add_scope_stmt): Likewise. * cp/decl.c (finish_constructor_body): Likewise. (finish_destructor_body): Likewise. * cp/optimize.c (copy_body_r): Likewise. (initialize_inlined_parameters): Likewise. (declare_return_variable): Likewise. (expand_call_inline): Likewise. From-SVN: r34943
2000-07-10 12:56:23 +02:00
r = build_stmt (HANDLER, NULL_TREE, NULL_TREE);
Move statement-tree facilities from C++ to C front-end. * c-common.h (c_tree_index): Add CTI_VOID_ZERO. (void_zero_node): New macro. (struct stmt_tree_s): New type. (stmt_tree): New typedef. (struct language_function): New type. (last_tree): New macro. (last_expr_type): Likewise. (walk_tree_fn): New typedef. (current_stmt_tree): New function. (begin_stmt_tree): Likewise. (add_stmt): Likewise. (finish_stmt_tree): Likewise. (statement_code_p): Likewise. (lang_statement_code_p): New variable. (walk_stmt_tree): New function. (STMT_IS_FULL_EXPR_P): New macro. * c-common.c (lang_statement_code_p): New variable. (c_common_nodes_and_builtins): Initialize void_zero_node. (statement_code_p): New function. (walk_stmt_tree): Likewise. * c-decl.c (language_function): Rename to ... (c_language_function): ... this. Include language_function. (push_c_function_context): Adjust accordingly. (pop_c_function_context): Likewise. (mark_c_function_context): Likewise. (current_stmt_tree): Define. * c-semantics.c (begin_stmt_tree): New function. (add_stmt): Likewise. (prune_unused_decls): Likewise. (finish_stmt_tree): Likewise. Move statement-tree facilities from C++ to C front-end. * cp-tree.h (cp_tree_index): Remove CPTI_VOID_ZERO. (void_zero_node): Remove. (stmt_tree): Likewise. (scope_chain): Adjust. (language_function): Rename to cp_language_function. (cp_function_chain): Adjust. (current_stmt_tree): Remove. (last_tree): Likewise. (last_expr_type): Likewise. (struct lang_decl): Adjust. (STMT_IS_FULL_EXPR_P): Remove. (add_tree): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (walk_tree_fn): Likewise. (walk_stmt_tree): Likewise. * class.c (finish_struct): Replace use of add_tree with add_stmt. * decl.c (mark_stmt_tree): Adjust type. (init_decl_processing): Don't build void_zero_node. (initialize_local_var): Adjust usage of current_stmt_tree. (finish_enum): Use add_stmt, not add_tree. (save_function_data): Adjust use of language_function. (finish_constructor_body): Use add_stmt, not add_tree. (finish_destructor_body): Likewise. (push_cp_function_context): Adjust use of language_function. (pop_cp_function_context): Likewise. (mark_lang_function): Likewise. (mark_cp_function_context): Likewise. * init.c (build_aggr_init): Adjust use of current_stmt_tree. (build_vec_init): Likewise. * semantics.c (SET_LAST_STMT): Remove. (RECHAIN_STMTS): Don't use it. (stmts_are_full_exprs_p): Adjust use of current_stmt_tree. (current_stmt_tree): Define. (add_tree): Remove. (finish_goto_stmt): Use add_stmt, not add_tree. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_then_clause): Likewise. (begin_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (begin_handler): Likewise. (begin_catch_block): Likewise. (begin_compound_stmt): Likewise. (begin_asm_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (add_decl_stmt): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (setup_vtbl_ptr): Likewise. (add_scope_stmt): Likewise. (finish_stmt_expr): Likewise. (prune_unused_decls): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (prep_stmt): Adjust use of current_stmt_tree. (lang_expand_stmt): Likewise. * tree.c (statement_code_p): Remove. (cp_statement_code_p): New function. (walk_stmt_tree): Remove. (init_tree): Set lang_statement_code_p. From-SVN: r36221
2000-09-07 03:36:11 +02:00
add_stmt (r);
/* Create a binding level for the eh_info and the exception object
cleanup. */
do_pushlevel ();
note_level_for_catch ();
return r;
}
/* Finish the handler-parameters for a handler, which may be given by
Turn on function-at-a-time processing. * cp-tree.h (doing_semantic_analysis_p): New macro. (SF_DEFAULT): Define to zero, not SF_EXPAND. (start_handler_parms): Change prototype. (expand_start_catch_block): Likewise. (expand_end_catch_block): Likewise. (expand_start_eh_spec): Likewise. (expand_end_eh_spec): Declare. (finish_handler_parms): Change prototype. (begin_catch_block): Declare. (finish_handler): Change prototype. (do_pushlevel): Declare. (do_poplevel): Likewise. * decl.c (pushlevel): Don't create binding levels when not doing semantic analysis. (poplevel): Don't pop them. (pushdecl): Assert that we are never called when not doing semantic analysis. (pushdecl_top_level): Use push_to_top_level. (make_label_decl): Don't fiddle with obstacks. Make RTL For the label when expanding. (cp_finish_decl): Only inject for-scope variables when doing semantic analysis. Add comments. (start_handler_parms): Return the handler parm. (start_function): Reorganize. Don't clear DECL_INITIAL if it is already set. Reinitialize from saved function data if available. Don't pushlevel when not doing semantic analysis. (store_parm_decls): Only generate RTL when expanding. Only pushdecl when doing semantic analysis. Set current_eh_spec_try_block if appropriate. (finish_function): Simplify. Use do_pushlevel and do_poplevel. Combine common code. Don't poplevel when not doing semantic analysis. (push_cp_function_context): Don't expand functions without an explicit call to expand_body. (mark_lang_function): Make eh_spec_try_block and x_scope_stmt_stack. * except.c (expand_end_eh_spec): Don't declare. (process_start_catch_block): Likewise. (push_eh_cleanup): Use finish_decl_cleanup. (initialize_handler_parm): New function. (expand_start_catch_block): Use it. (expand_end_catch_block): Use tree-generation functions, not RTL-generation functions. (expand_start_eh_spec): Likewise. (expand_end_eh_spec): Likewise. (expand_exception_blocks): Simplify. (start_anon_func): Use do_pushlevel. (end_anon_func): Use do_poplvel. Call expand_body for the function. * expr.c (do_case): Don't call define_case_label. * init.c (create_temporary_var): Set DECL_CONTEXT for local variables. * method.c (emit_thunk): Call expand_body for the thunk. (sythesize_method): Likewise. * parse.y (handler_args): Give it ttype. (eat_saved_input): Call expand_body. (base_init): Use do_pushlevel. (pending_inline): Call expand_body. (handler): Adjust calls to finish_handler_parms and finish_handler. (handler_args): Don't call expand_start_catch_block. Return the catch parameter. * pt.c (tsubst_expr): Adjust HANDLER handling. * parse.c: Regenerated. * rtti.c (synthesize_tinfo_fn): Call finish_function. * semantics.c (do_pushlevel): Give it external linkage. Build SCOPE_STMTs. (do_poplevel): Likewise. (finish_case_label): Call define_case_label when doing semantic analysis. (finish_goto_stmt): Create RTL for labels. (finish_function_try_block): Set in_function_try_handler unconditionally. (finish_function_handler_sequence): Unset it. (finish_handler_parms): Use expand_start_catch_block even when building a statement-tree. (begin_catch_block): New function. (finish_handler): Move a little RTL-generation logic here. (finish_decl_cleanup): Allow cleanups for empty declarations. (finish_named_return_value): Don't pushdecl when not doing semantic analysis. (expand_stmt): Don't do semantic analysis for variable declarations. Handle START_CATCH_STMT. Call expand_label directly for a LABEL_STMT. Tweak handling of GOTO_STMT. Adjust HANDLERs. Handle SCOPE_STMT, CTOR_INITIALIZER, and RETURN_INIT. (expand_body): Let expand_stmt handle CTOR_INITIALIZER, RETURN_INIT and function try blocks. From-SVN: r29490
1999-09-18 03:23:20 +02:00
HANDLER. DECL is the declaration for the catch parameter, or NULL
if this is a `catch (...)' clause. */
void
Turn on function-at-a-time processing. * cp-tree.h (doing_semantic_analysis_p): New macro. (SF_DEFAULT): Define to zero, not SF_EXPAND. (start_handler_parms): Change prototype. (expand_start_catch_block): Likewise. (expand_end_catch_block): Likewise. (expand_start_eh_spec): Likewise. (expand_end_eh_spec): Declare. (finish_handler_parms): Change prototype. (begin_catch_block): Declare. (finish_handler): Change prototype. (do_pushlevel): Declare. (do_poplevel): Likewise. * decl.c (pushlevel): Don't create binding levels when not doing semantic analysis. (poplevel): Don't pop them. (pushdecl): Assert that we are never called when not doing semantic analysis. (pushdecl_top_level): Use push_to_top_level. (make_label_decl): Don't fiddle with obstacks. Make RTL For the label when expanding. (cp_finish_decl): Only inject for-scope variables when doing semantic analysis. Add comments. (start_handler_parms): Return the handler parm. (start_function): Reorganize. Don't clear DECL_INITIAL if it is already set. Reinitialize from saved function data if available. Don't pushlevel when not doing semantic analysis. (store_parm_decls): Only generate RTL when expanding. Only pushdecl when doing semantic analysis. Set current_eh_spec_try_block if appropriate. (finish_function): Simplify. Use do_pushlevel and do_poplevel. Combine common code. Don't poplevel when not doing semantic analysis. (push_cp_function_context): Don't expand functions without an explicit call to expand_body. (mark_lang_function): Make eh_spec_try_block and x_scope_stmt_stack. * except.c (expand_end_eh_spec): Don't declare. (process_start_catch_block): Likewise. (push_eh_cleanup): Use finish_decl_cleanup. (initialize_handler_parm): New function. (expand_start_catch_block): Use it. (expand_end_catch_block): Use tree-generation functions, not RTL-generation functions. (expand_start_eh_spec): Likewise. (expand_end_eh_spec): Likewise. (expand_exception_blocks): Simplify. (start_anon_func): Use do_pushlevel. (end_anon_func): Use do_poplvel. Call expand_body for the function. * expr.c (do_case): Don't call define_case_label. * init.c (create_temporary_var): Set DECL_CONTEXT for local variables. * method.c (emit_thunk): Call expand_body for the thunk. (sythesize_method): Likewise. * parse.y (handler_args): Give it ttype. (eat_saved_input): Call expand_body. (base_init): Use do_pushlevel. (pending_inline): Call expand_body. (handler): Adjust calls to finish_handler_parms and finish_handler. (handler_args): Don't call expand_start_catch_block. Return the catch parameter. * pt.c (tsubst_expr): Adjust HANDLER handling. * parse.c: Regenerated. * rtti.c (synthesize_tinfo_fn): Call finish_function. * semantics.c (do_pushlevel): Give it external linkage. Build SCOPE_STMTs. (do_poplevel): Likewise. (finish_case_label): Call define_case_label when doing semantic analysis. (finish_goto_stmt): Create RTL for labels. (finish_function_try_block): Set in_function_try_handler unconditionally. (finish_function_handler_sequence): Unset it. (finish_handler_parms): Use expand_start_catch_block even when building a statement-tree. (begin_catch_block): New function. (finish_handler): Move a little RTL-generation logic here. (finish_decl_cleanup): Allow cleanups for empty declarations. (finish_named_return_value): Don't pushdecl when not doing semantic analysis. (expand_stmt): Don't do semantic analysis for variable declarations. Handle START_CATCH_STMT. Call expand_label directly for a LABEL_STMT. Tweak handling of GOTO_STMT. Adjust HANDLERs. Handle SCOPE_STMT, CTOR_INITIALIZER, and RETURN_INIT. (expand_body): Let expand_stmt handle CTOR_INITIALIZER, RETURN_INIT and function try blocks. From-SVN: r29490
1999-09-18 03:23:20 +02:00
finish_handler_parms (decl, handler)
tree decl;
tree handler;
Turn on function-at-a-time processing. * cp-tree.h (doing_semantic_analysis_p): New macro. (SF_DEFAULT): Define to zero, not SF_EXPAND. (start_handler_parms): Change prototype. (expand_start_catch_block): Likewise. (expand_end_catch_block): Likewise. (expand_start_eh_spec): Likewise. (expand_end_eh_spec): Declare. (finish_handler_parms): Change prototype. (begin_catch_block): Declare. (finish_handler): Change prototype. (do_pushlevel): Declare. (do_poplevel): Likewise. * decl.c (pushlevel): Don't create binding levels when not doing semantic analysis. (poplevel): Don't pop them. (pushdecl): Assert that we are never called when not doing semantic analysis. (pushdecl_top_level): Use push_to_top_level. (make_label_decl): Don't fiddle with obstacks. Make RTL For the label when expanding. (cp_finish_decl): Only inject for-scope variables when doing semantic analysis. Add comments. (start_handler_parms): Return the handler parm. (start_function): Reorganize. Don't clear DECL_INITIAL if it is already set. Reinitialize from saved function data if available. Don't pushlevel when not doing semantic analysis. (store_parm_decls): Only generate RTL when expanding. Only pushdecl when doing semantic analysis. Set current_eh_spec_try_block if appropriate. (finish_function): Simplify. Use do_pushlevel and do_poplevel. Combine common code. Don't poplevel when not doing semantic analysis. (push_cp_function_context): Don't expand functions without an explicit call to expand_body. (mark_lang_function): Make eh_spec_try_block and x_scope_stmt_stack. * except.c (expand_end_eh_spec): Don't declare. (process_start_catch_block): Likewise. (push_eh_cleanup): Use finish_decl_cleanup. (initialize_handler_parm): New function. (expand_start_catch_block): Use it. (expand_end_catch_block): Use tree-generation functions, not RTL-generation functions. (expand_start_eh_spec): Likewise. (expand_end_eh_spec): Likewise. (expand_exception_blocks): Simplify. (start_anon_func): Use do_pushlevel. (end_anon_func): Use do_poplvel. Call expand_body for the function. * expr.c (do_case): Don't call define_case_label. * init.c (create_temporary_var): Set DECL_CONTEXT for local variables. * method.c (emit_thunk): Call expand_body for the thunk. (sythesize_method): Likewise. * parse.y (handler_args): Give it ttype. (eat_saved_input): Call expand_body. (base_init): Use do_pushlevel. (pending_inline): Call expand_body. (handler): Adjust calls to finish_handler_parms and finish_handler. (handler_args): Don't call expand_start_catch_block. Return the catch parameter. * pt.c (tsubst_expr): Adjust HANDLER handling. * parse.c: Regenerated. * rtti.c (synthesize_tinfo_fn): Call finish_function. * semantics.c (do_pushlevel): Give it external linkage. Build SCOPE_STMTs. (do_poplevel): Likewise. (finish_case_label): Call define_case_label when doing semantic analysis. (finish_goto_stmt): Create RTL for labels. (finish_function_try_block): Set in_function_try_handler unconditionally. (finish_function_handler_sequence): Unset it. (finish_handler_parms): Use expand_start_catch_block even when building a statement-tree. (begin_catch_block): New function. (finish_handler): Move a little RTL-generation logic here. (finish_decl_cleanup): Allow cleanups for empty declarations. (finish_named_return_value): Don't pushdecl when not doing semantic analysis. (expand_stmt): Don't do semantic analysis for variable declarations. Handle START_CATCH_STMT. Call expand_label directly for a LABEL_STMT. Tweak handling of GOTO_STMT. Adjust HANDLERs. Handle SCOPE_STMT, CTOR_INITIALIZER, and RETURN_INIT. (expand_body): Let expand_stmt handle CTOR_INITIALIZER, RETURN_INIT and function try blocks. From-SVN: r29490
1999-09-18 03:23:20 +02:00
{
tree type = NULL_TREE;
Turn on function-at-a-time processing. * cp-tree.h (doing_semantic_analysis_p): New macro. (SF_DEFAULT): Define to zero, not SF_EXPAND. (start_handler_parms): Change prototype. (expand_start_catch_block): Likewise. (expand_end_catch_block): Likewise. (expand_start_eh_spec): Likewise. (expand_end_eh_spec): Declare. (finish_handler_parms): Change prototype. (begin_catch_block): Declare. (finish_handler): Change prototype. (do_pushlevel): Declare. (do_poplevel): Likewise. * decl.c (pushlevel): Don't create binding levels when not doing semantic analysis. (poplevel): Don't pop them. (pushdecl): Assert that we are never called when not doing semantic analysis. (pushdecl_top_level): Use push_to_top_level. (make_label_decl): Don't fiddle with obstacks. Make RTL For the label when expanding. (cp_finish_decl): Only inject for-scope variables when doing semantic analysis. Add comments. (start_handler_parms): Return the handler parm. (start_function): Reorganize. Don't clear DECL_INITIAL if it is already set. Reinitialize from saved function data if available. Don't pushlevel when not doing semantic analysis. (store_parm_decls): Only generate RTL when expanding. Only pushdecl when doing semantic analysis. Set current_eh_spec_try_block if appropriate. (finish_function): Simplify. Use do_pushlevel and do_poplevel. Combine common code. Don't poplevel when not doing semantic analysis. (push_cp_function_context): Don't expand functions without an explicit call to expand_body. (mark_lang_function): Make eh_spec_try_block and x_scope_stmt_stack. * except.c (expand_end_eh_spec): Don't declare. (process_start_catch_block): Likewise. (push_eh_cleanup): Use finish_decl_cleanup. (initialize_handler_parm): New function. (expand_start_catch_block): Use it. (expand_end_catch_block): Use tree-generation functions, not RTL-generation functions. (expand_start_eh_spec): Likewise. (expand_end_eh_spec): Likewise. (expand_exception_blocks): Simplify. (start_anon_func): Use do_pushlevel. (end_anon_func): Use do_poplvel. Call expand_body for the function. * expr.c (do_case): Don't call define_case_label. * init.c (create_temporary_var): Set DECL_CONTEXT for local variables. * method.c (emit_thunk): Call expand_body for the thunk. (sythesize_method): Likewise. * parse.y (handler_args): Give it ttype. (eat_saved_input): Call expand_body. (base_init): Use do_pushlevel. (pending_inline): Call expand_body. (handler): Adjust calls to finish_handler_parms and finish_handler. (handler_args): Don't call expand_start_catch_block. Return the catch parameter. * pt.c (tsubst_expr): Adjust HANDLER handling. * parse.c: Regenerated. * rtti.c (synthesize_tinfo_fn): Call finish_function. * semantics.c (do_pushlevel): Give it external linkage. Build SCOPE_STMTs. (do_poplevel): Likewise. (finish_case_label): Call define_case_label when doing semantic analysis. (finish_goto_stmt): Create RTL for labels. (finish_function_try_block): Set in_function_try_handler unconditionally. (finish_function_handler_sequence): Unset it. (finish_handler_parms): Use expand_start_catch_block even when building a statement-tree. (begin_catch_block): New function. (finish_handler): Move a little RTL-generation logic here. (finish_decl_cleanup): Allow cleanups for empty declarations. (finish_named_return_value): Don't pushdecl when not doing semantic analysis. (expand_stmt): Don't do semantic analysis for variable declarations. Handle START_CATCH_STMT. Call expand_label directly for a LABEL_STMT. Tweak handling of GOTO_STMT. Adjust HANDLERs. Handle SCOPE_STMT, CTOR_INITIALIZER, and RETURN_INIT. (expand_body): Let expand_stmt handle CTOR_INITIALIZER, RETURN_INIT and function try blocks. From-SVN: r29490
1999-09-18 03:23:20 +02:00
if (processing_template_decl)
{
if (decl)
{
decl = pushdecl (decl);
decl = push_template_decl (decl);
add_decl_stmt (decl);
RECHAIN_STMTS (handler, HANDLER_PARMS (handler));
type = TREE_TYPE (decl);
Turn on function-at-a-time processing. * cp-tree.h (doing_semantic_analysis_p): New macro. (SF_DEFAULT): Define to zero, not SF_EXPAND. (start_handler_parms): Change prototype. (expand_start_catch_block): Likewise. (expand_end_catch_block): Likewise. (expand_start_eh_spec): Likewise. (expand_end_eh_spec): Declare. (finish_handler_parms): Change prototype. (begin_catch_block): Declare. (finish_handler): Change prototype. (do_pushlevel): Declare. (do_poplevel): Likewise. * decl.c (pushlevel): Don't create binding levels when not doing semantic analysis. (poplevel): Don't pop them. (pushdecl): Assert that we are never called when not doing semantic analysis. (pushdecl_top_level): Use push_to_top_level. (make_label_decl): Don't fiddle with obstacks. Make RTL For the label when expanding. (cp_finish_decl): Only inject for-scope variables when doing semantic analysis. Add comments. (start_handler_parms): Return the handler parm. (start_function): Reorganize. Don't clear DECL_INITIAL if it is already set. Reinitialize from saved function data if available. Don't pushlevel when not doing semantic analysis. (store_parm_decls): Only generate RTL when expanding. Only pushdecl when doing semantic analysis. Set current_eh_spec_try_block if appropriate. (finish_function): Simplify. Use do_pushlevel and do_poplevel. Combine common code. Don't poplevel when not doing semantic analysis. (push_cp_function_context): Don't expand functions without an explicit call to expand_body. (mark_lang_function): Make eh_spec_try_block and x_scope_stmt_stack. * except.c (expand_end_eh_spec): Don't declare. (process_start_catch_block): Likewise. (push_eh_cleanup): Use finish_decl_cleanup. (initialize_handler_parm): New function. (expand_start_catch_block): Use it. (expand_end_catch_block): Use tree-generation functions, not RTL-generation functions. (expand_start_eh_spec): Likewise. (expand_end_eh_spec): Likewise. (expand_exception_blocks): Simplify. (start_anon_func): Use do_pushlevel. (end_anon_func): Use do_poplvel. Call expand_body for the function. * expr.c (do_case): Don't call define_case_label. * init.c (create_temporary_var): Set DECL_CONTEXT for local variables. * method.c (emit_thunk): Call expand_body for the thunk. (sythesize_method): Likewise. * parse.y (handler_args): Give it ttype. (eat_saved_input): Call expand_body. (base_init): Use do_pushlevel. (pending_inline): Call expand_body. (handler): Adjust calls to finish_handler_parms and finish_handler. (handler_args): Don't call expand_start_catch_block. Return the catch parameter. * pt.c (tsubst_expr): Adjust HANDLER handling. * parse.c: Regenerated. * rtti.c (synthesize_tinfo_fn): Call finish_function. * semantics.c (do_pushlevel): Give it external linkage. Build SCOPE_STMTs. (do_poplevel): Likewise. (finish_case_label): Call define_case_label when doing semantic analysis. (finish_goto_stmt): Create RTL for labels. (finish_function_try_block): Set in_function_try_handler unconditionally. (finish_function_handler_sequence): Unset it. (finish_handler_parms): Use expand_start_catch_block even when building a statement-tree. (begin_catch_block): New function. (finish_handler): Move a little RTL-generation logic here. (finish_decl_cleanup): Allow cleanups for empty declarations. (finish_named_return_value): Don't pushdecl when not doing semantic analysis. (expand_stmt): Don't do semantic analysis for variable declarations. Handle START_CATCH_STMT. Call expand_label directly for a LABEL_STMT. Tweak handling of GOTO_STMT. Adjust HANDLERs. Handle SCOPE_STMT, CTOR_INITIALIZER, and RETURN_INIT. (expand_body): Let expand_stmt handle CTOR_INITIALIZER, RETURN_INIT and function try blocks. From-SVN: r29490
1999-09-18 03:23:20 +02:00
}
}
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
else
type = expand_start_catch_block (decl);
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
HANDLER_TYPE (handler) = type;
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
}
/* Finish a handler, which may be given by HANDLER. The BLOCKs are
the return value from the matching call to finish_handler_parms. */
void
finish_handler (handler)
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
tree handler;
{
if (!processing_template_decl)
expand_end_catch_block ();
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
do_poplevel ();
RECHAIN_STMTS (handler, HANDLER_BODY (handler));
}
/* Begin a compound-statement. If HAS_NO_SCOPE is nonzero, the
compound-statement does not define a scope. Returns a new
COMPOUND_STMT if appropriate. */
tree
begin_compound_stmt (has_no_scope)
int has_no_scope;
{
tree r;
int is_try = 0;
c-common.h (build_stmt): Declare. 2000-07-10 Benjamin Chelf <chelf@codesourcery.com> * c-common.h (build_stmt): Declare. (build_continue_stmt): Likewise. (build_break_stmt): Likewise. (build_return_stmt): Likewise. * c-decl.c (do_case): Rewrite to do what previously done in c-parse.in. * c-semantics.c (build_stmt): Define. (build_return_stmt): Likewise. (build_break_stmt): Likewise. (build_continue_stmt): Likewise. (build_case_label): Likewise. * c-parse.in (BREAK): Change to build tree, then generate RTL. (CONTINUE): Likewise. (RETURN): Likewise. (CASE): Likewise. (DEFAULT): Likewise. * c-parse.y: Regenerate. * c-pasre.c: Likewise. * cp/semantics.c (finish_for_stmt): Remove call to emit_line_note. (finish_continue_stmt): Likewise. (begin_for_stmt): Remove call to note_level_for_for. (finish_goto_stmt): Change call from build_min_nt to build_stmt. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_case_label): Likewise. (genrtl_try_block): Likewise. (begin_try_block): Likewise. (begin_handler): Likewise. (begin_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (add_decl_stmt): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (setup_vtbl_ptr): Likewise. (add_scope_stmt): Likewise. * cp/decl.c (finish_constructor_body): Likewise. (finish_destructor_body): Likewise. * cp/optimize.c (copy_body_r): Likewise. (initialize_inlined_parameters): Likewise. (declare_return_variable): Likewise. (expand_call_inline): Likewise. From-SVN: r34943
2000-07-10 12:56:23 +02:00
r = build_stmt (COMPOUND_STMT, NULL_TREE);
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
if (last_tree && TREE_CODE (last_tree) == TRY_BLOCK)
is_try = 1;
Move statement-tree facilities from C++ to C front-end. * c-common.h (c_tree_index): Add CTI_VOID_ZERO. (void_zero_node): New macro. (struct stmt_tree_s): New type. (stmt_tree): New typedef. (struct language_function): New type. (last_tree): New macro. (last_expr_type): Likewise. (walk_tree_fn): New typedef. (current_stmt_tree): New function. (begin_stmt_tree): Likewise. (add_stmt): Likewise. (finish_stmt_tree): Likewise. (statement_code_p): Likewise. (lang_statement_code_p): New variable. (walk_stmt_tree): New function. (STMT_IS_FULL_EXPR_P): New macro. * c-common.c (lang_statement_code_p): New variable. (c_common_nodes_and_builtins): Initialize void_zero_node. (statement_code_p): New function. (walk_stmt_tree): Likewise. * c-decl.c (language_function): Rename to ... (c_language_function): ... this. Include language_function. (push_c_function_context): Adjust accordingly. (pop_c_function_context): Likewise. (mark_c_function_context): Likewise. (current_stmt_tree): Define. * c-semantics.c (begin_stmt_tree): New function. (add_stmt): Likewise. (prune_unused_decls): Likewise. (finish_stmt_tree): Likewise. Move statement-tree facilities from C++ to C front-end. * cp-tree.h (cp_tree_index): Remove CPTI_VOID_ZERO. (void_zero_node): Remove. (stmt_tree): Likewise. (scope_chain): Adjust. (language_function): Rename to cp_language_function. (cp_function_chain): Adjust. (current_stmt_tree): Remove. (last_tree): Likewise. (last_expr_type): Likewise. (struct lang_decl): Adjust. (STMT_IS_FULL_EXPR_P): Remove. (add_tree): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (walk_tree_fn): Likewise. (walk_stmt_tree): Likewise. * class.c (finish_struct): Replace use of add_tree with add_stmt. * decl.c (mark_stmt_tree): Adjust type. (init_decl_processing): Don't build void_zero_node. (initialize_local_var): Adjust usage of current_stmt_tree. (finish_enum): Use add_stmt, not add_tree. (save_function_data): Adjust use of language_function. (finish_constructor_body): Use add_stmt, not add_tree. (finish_destructor_body): Likewise. (push_cp_function_context): Adjust use of language_function. (pop_cp_function_context): Likewise. (mark_lang_function): Likewise. (mark_cp_function_context): Likewise. * init.c (build_aggr_init): Adjust use of current_stmt_tree. (build_vec_init): Likewise. * semantics.c (SET_LAST_STMT): Remove. (RECHAIN_STMTS): Don't use it. (stmts_are_full_exprs_p): Adjust use of current_stmt_tree. (current_stmt_tree): Define. (add_tree): Remove. (finish_goto_stmt): Use add_stmt, not add_tree. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_then_clause): Likewise. (begin_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (begin_handler): Likewise. (begin_catch_block): Likewise. (begin_compound_stmt): Likewise. (begin_asm_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (add_decl_stmt): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (setup_vtbl_ptr): Likewise. (add_scope_stmt): Likewise. (finish_stmt_expr): Likewise. (prune_unused_decls): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (prep_stmt): Adjust use of current_stmt_tree. (lang_expand_stmt): Likewise. * tree.c (statement_code_p): Remove. (cp_statement_code_p): New function. (walk_stmt_tree): Remove. (init_tree): Set lang_statement_code_p. From-SVN: r36221
2000-09-07 03:36:11 +02:00
add_stmt (r);
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
if (has_no_scope)
COMPOUND_STMT_NO_SCOPE (r) = 1;
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
last_expr_type = NULL_TREE;
if (!has_no_scope)
{
do_pushlevel ();
if (is_try)
note_level_for_try ();
}
cp-tree.def (SUBOBJECT): New tree node. * cp-tree.def (SUBOBJECT): New tree node. * cp-tree.h (CLEANUP_P): New macro. (SUBOBJECT_CLEANUP): Likewise. (keep_next_level): Add parameter. (get_temp_regvar): Don't declare. (emit_base_init): Remove parameter. (expand_aggr_init): Rename to build_aggr_init. (expand_vec_init): Rename to build_vec_init. (do_pushlevel): Remove. (do_poplevel): Likewise. (finish_cleanup): New function. (finish_subobject): Likewise. (stmts_are_full_exprs_p): New variable. * decl.c (keep_next_level): Add parameter. (cp_finish_decl): Use build_aggr_init, not expand_aggr_init. Use finish_expr_stmt to expand the code. (expand_static_init): Use tree-generating, not RTL-generating, functions to handle the initialization. (start_function): Remove dead code. Always have a momentary obstack inside the function, even before hitting the first curly brace. (cplus_expand_expr_stmt): Move calls to expand_{start,end}_target_temps into semantics.c. (cp_function): Add stmts_are_full_exprs_p. (push_cp_function_context): Save it. (pop_cp_function_context): Restore it. * decl2.c (get_temp_regvar): Move to init.c. (do_static_initialization): Use build_{aggr,vec}_init. (do_static_destruction): Fix typo in comment. * dump.c (dequeue_and_dump): Handle INIT_EXPR. * except.c (expand_throw): Use create_temporary_var. * expr.c (cplus_expand_expr): Use build_{aggr,vec}_init. * init.c (expand_vec_init_try_block): Remove. (expand_vec_init_catch_clause): Likewise. (get_temp_regvar): New function. (begin_init_stmts): Likewise. (finish_init_stmts): Likewise. (perform_member_init): Use build_{aggr,vec}_init. Build up tree structure here. (emit_base_init): Likewise. Remove unused parameter. (expand_virtual_init): Likewise. (expand_cleanup_for_base): Use finish_subobject. (expand_aggr_vbase_init_1): Simplify. (construct_virtual_bases): Use tree-generating functions to build up initialization. (expand_aggr_init): Likewise. Rename to build_aggr_init. (expand_default_init): Likewise. (expand_aggr_init_1): Likewise. (expand_vec_init): Rename to build_vec_init. * method.c (do_build_copy_constructor): Use tree-generating functions. Don't call clear_last_expr. (do_build_assign_ref): Likewise. (synthesize_method): Call clear_last_expr here. * parse.y (base_init): Don't call clear_last_expr here. (nodecls): Likewise. * pt.c (tsubst_expr): Handle a TRY_BLOCK with CLEANUP_P set. * semantics.c (do_pushlevel): Move to here. (do_poplevel): Likewise. (stmts_are_full_exprs_p): New variable. (finish_expr_stmt): Handle logic for temoprary cleanup here. (finish_for_stmt): Use finish_expr_stmt. (finish_cleanup): New function. (finish_function_try_block): Fix indentation. (finish_subobject): New function. (setup_vtbl_ptr): Call keep_next_level here. (finish_stmt_expr): Handle a block with no scope inside the statement-expression. (expand_stmt): Handle a TRY_BLOCK with CLEANUP_P set. Handle SUBOBJECT. * tree.c (search_tree): Handle INIT_EXPR. (mapcar): Likewise. * typeck.c (build_modify_expr): Don't build an RTL_EXPR. * typeck2.c (store_init_value): Change expand_aggr_init to build_aggr_init in comment. From-SVN: r28878
1999-08-26 00:07:18 +02:00
else
/* Normally, we try hard to keep the BLOCK for a
statement-expression. But, if it's a statement-expression with
a scopeless block, there's nothing to keep, and we don't want
to accidentally keep a block *inside* the scopeless block. */
keep_next_level (0);
return r;
}
/* Finish a compound-statement, which may be given by COMPOUND_STMT.
If HAS_NO_SCOPE is nonzero, the compound statement does not define
a scope. */
tree
finish_compound_stmt (has_no_scope, compound_stmt)
int has_no_scope;
tree compound_stmt;
{
tree r;
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
tree t;
if (!has_no_scope)
r = do_poplevel ();
else
r = NULL_TREE;
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
RECHAIN_STMTS (compound_stmt, COMPOUND_BODY (compound_stmt));
/* When we call finish_stmt we will lose LAST_EXPR_TYPE. But, since
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
the precise purpose of that variable is store the type of the
last expression statement within the last compound statement, we
preserve the value. */
t = last_expr_type;
finish_stmt ();
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
last_expr_type = t;
return r;
}
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
/* Finish an asm-statement, whose components are a CV_QUALIFIER, a
STRING, some OUTPUT_OPERANDS, some INPUT_OPERANDS, and some
CLOBBERS. */
tree
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
finish_asm_stmt (cv_qualifier, string, output_operands,
input_operands, clobbers)
tree cv_qualifier;
tree string;
tree output_operands;
tree input_operands;
tree clobbers;
{
tree r;
tree t;
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
if (cv_qualifier != NULL_TREE
&& cv_qualifier != ridpointers[(int) RID_VOLATILE])
{
warning ("%s qualifier ignored on asm",
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
IDENTIFIER_POINTER (cv_qualifier));
cv_qualifier = NULL_TREE;
}
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
if (!processing_template_decl)
{
int i;
int ninputs;
int noutputs;
for (t = input_operands; t; t = TREE_CHAIN (t))
{
tree converted_operand
= decay_conversion (TREE_VALUE (t));
/* If the type of the operand hasn't been determined (e.g.,
because it involves an overloaded function), then issue
an error message. There's no context available to
resolve the overloading. */
if (TREE_TYPE (converted_operand) == unknown_type_node)
{
error ("type of asm operand `%E' could not be determined",
TREE_VALUE (t));
converted_operand = error_mark_node;
}
TREE_VALUE (t) = converted_operand;
}
ninputs = list_length (input_operands);
noutputs = list_length (output_operands);
for (i = 0, t = output_operands; t; t = TREE_CHAIN (t), ++i)
{
bool allows_mem;
bool allows_reg;
bool is_inout;
const char *constraint;
tree operand;
constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (t)));
operand = TREE_VALUE (t);
if (!parse_output_constraint (&constraint,
i, ninputs, noutputs,
&allows_mem,
&allows_reg,
&is_inout))
{
/* By marking the type as erroneous, we will not try to
process this operand again in expand_asm_operands. */
TREE_TYPE (operand) = error_mark_node;
continue;
}
/* If the operand is a DECL that is going to end up in
memory, assume it is addressable. This is a bit more
conservative than it would ideally be; the exact test is
buried deep in expand_asm_operands and depends on the
DECL_RTL for the OPERAND -- which we don't have at this
point. */
if (!allows_reg && DECL_P (operand))
c-decl.c (grokdeclarator): Update. * c-decl.c (grokdeclarator): Update. * c-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine. * c-tree.h (c_mark_addressable): New. * c-typeck.c (default_function_array_conversion, build_unary_op, build_array_ref, convert_for_assignment): Update. (mark_addressable): Rename. * calls.c (try_to_integrate, expand_call): Use langhook. * expr.c (expand_expr): Use langhook. * langhooks-def.h (LANG_HOOKS_INITIALIZER): Update. * langhooks.h (struct lang_hooks): New hook. * stmt.c (expand_asm_operands): Use langhook. * tree.h (mark_addressable): Remove. ada: * decl.c (gnat_to_gnu_entity): Update. * gigi.h (mark_addressable): Rename. * misc.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine. * trans.c (tree_transform): Update. * utils.c (create_var_decl): Update. * util2.c (build_binary_op, build_unary_op, fill_vms_descriptor): Update. (mark_addressable): Rename, update. cp: * call.c (build_addr_func): Update. * class.c (resolve_address_of_overloaded_function): Update. * cp-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine. * cp-tree.h (cxx_mark_addressable): New. * decl.c (register_dtor_fn, cxx_maybe_build_cleanup): Update. * decl2.c (build_cleanup): Update. * except.c (build_throw): Update. * init.c (resolve_offset_ref): Update. * pt.c (convert_nontype_argument): Update. * semantics.c (finish_asm_stmt, simplify_affr_init_exprs_r): Update. * typeck.c (decay_conversion, build_array_ref, build_unary_op, unary_complex_lvalue): Update. (mark_addressable): Rename. f: * com.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine. (mark_addressable): Rename. (ffecom_arrayref_, ffecom_1): Update. java: * java-tree.h (java_mark_addressable): New. * lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine. * typeck.c (mark_addressable): Rename, update. objc: * objc-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine. From-SVN: r51705
2002-04-01 22:26:18 +02:00
cxx_mark_addressable (operand);
}
}
c-common.h (build_stmt): Declare. 2000-07-10 Benjamin Chelf <chelf@codesourcery.com> * c-common.h (build_stmt): Declare. (build_continue_stmt): Likewise. (build_break_stmt): Likewise. (build_return_stmt): Likewise. * c-decl.c (do_case): Rewrite to do what previously done in c-parse.in. * c-semantics.c (build_stmt): Define. (build_return_stmt): Likewise. (build_break_stmt): Likewise. (build_continue_stmt): Likewise. (build_case_label): Likewise. * c-parse.in (BREAK): Change to build tree, then generate RTL. (CONTINUE): Likewise. (RETURN): Likewise. (CASE): Likewise. (DEFAULT): Likewise. * c-parse.y: Regenerate. * c-pasre.c: Likewise. * cp/semantics.c (finish_for_stmt): Remove call to emit_line_note. (finish_continue_stmt): Likewise. (begin_for_stmt): Remove call to note_level_for_for. (finish_goto_stmt): Change call from build_min_nt to build_stmt. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_case_label): Likewise. (genrtl_try_block): Likewise. (begin_try_block): Likewise. (begin_handler): Likewise. (begin_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (add_decl_stmt): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (setup_vtbl_ptr): Likewise. (add_scope_stmt): Likewise. * cp/decl.c (finish_constructor_body): Likewise. (finish_destructor_body): Likewise. * cp/optimize.c (copy_body_r): Likewise. (initialize_inlined_parameters): Likewise. (declare_return_variable): Likewise. (expand_call_inline): Likewise. From-SVN: r34943
2000-07-10 12:56:23 +02:00
r = build_stmt (ASM_STMT, cv_qualifier, string,
output_operands, input_operands,
clobbers);
return add_stmt (r);
}
/* Finish a label with the indicated NAME. */
void
finish_label_stmt (name)
tree name;
{
tree decl = define_label (input_filename, lineno, name);
Move statement-tree facilities from C++ to C front-end. * c-common.h (c_tree_index): Add CTI_VOID_ZERO. (void_zero_node): New macro. (struct stmt_tree_s): New type. (stmt_tree): New typedef. (struct language_function): New type. (last_tree): New macro. (last_expr_type): Likewise. (walk_tree_fn): New typedef. (current_stmt_tree): New function. (begin_stmt_tree): Likewise. (add_stmt): Likewise. (finish_stmt_tree): Likewise. (statement_code_p): Likewise. (lang_statement_code_p): New variable. (walk_stmt_tree): New function. (STMT_IS_FULL_EXPR_P): New macro. * c-common.c (lang_statement_code_p): New variable. (c_common_nodes_and_builtins): Initialize void_zero_node. (statement_code_p): New function. (walk_stmt_tree): Likewise. * c-decl.c (language_function): Rename to ... (c_language_function): ... this. Include language_function. (push_c_function_context): Adjust accordingly. (pop_c_function_context): Likewise. (mark_c_function_context): Likewise. (current_stmt_tree): Define. * c-semantics.c (begin_stmt_tree): New function. (add_stmt): Likewise. (prune_unused_decls): Likewise. (finish_stmt_tree): Likewise. Move statement-tree facilities from C++ to C front-end. * cp-tree.h (cp_tree_index): Remove CPTI_VOID_ZERO. (void_zero_node): Remove. (stmt_tree): Likewise. (scope_chain): Adjust. (language_function): Rename to cp_language_function. (cp_function_chain): Adjust. (current_stmt_tree): Remove. (last_tree): Likewise. (last_expr_type): Likewise. (struct lang_decl): Adjust. (STMT_IS_FULL_EXPR_P): Remove. (add_tree): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (walk_tree_fn): Likewise. (walk_stmt_tree): Likewise. * class.c (finish_struct): Replace use of add_tree with add_stmt. * decl.c (mark_stmt_tree): Adjust type. (init_decl_processing): Don't build void_zero_node. (initialize_local_var): Adjust usage of current_stmt_tree. (finish_enum): Use add_stmt, not add_tree. (save_function_data): Adjust use of language_function. (finish_constructor_body): Use add_stmt, not add_tree. (finish_destructor_body): Likewise. (push_cp_function_context): Adjust use of language_function. (pop_cp_function_context): Likewise. (mark_lang_function): Likewise. (mark_cp_function_context): Likewise. * init.c (build_aggr_init): Adjust use of current_stmt_tree. (build_vec_init): Likewise. * semantics.c (SET_LAST_STMT): Remove. (RECHAIN_STMTS): Don't use it. (stmts_are_full_exprs_p): Adjust use of current_stmt_tree. (current_stmt_tree): Define. (add_tree): Remove. (finish_goto_stmt): Use add_stmt, not add_tree. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_then_clause): Likewise. (begin_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (begin_handler): Likewise. (begin_catch_block): Likewise. (begin_compound_stmt): Likewise. (begin_asm_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (add_decl_stmt): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (setup_vtbl_ptr): Likewise. (add_scope_stmt): Likewise. (finish_stmt_expr): Likewise. (prune_unused_decls): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (prep_stmt): Adjust use of current_stmt_tree. (lang_expand_stmt): Likewise. * tree.c (statement_code_p): Remove. (cp_statement_code_p): New function. (walk_stmt_tree): Remove. (init_tree): Set lang_statement_code_p. From-SVN: r36221
2000-09-07 03:36:11 +02:00
add_stmt (build_stmt (LABEL_STMT, decl));
}
/* Finish a series of declarations for local labels. G++ allows users
to declare "local" labels, i.e., labels with scope. This extension
is useful when writing code involving statement-expressions. */
void
finish_label_decl (name)
tree name;
{
tree decl = declare_local_label (name);
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
add_decl_stmt (decl);
}
/* When DECL goes out of scope, make sure that CLEANUP is executed. */
cp-tree.def (SUBOBJECT): New tree node. * cp-tree.def (SUBOBJECT): New tree node. * cp-tree.h (CLEANUP_P): New macro. (SUBOBJECT_CLEANUP): Likewise. (keep_next_level): Add parameter. (get_temp_regvar): Don't declare. (emit_base_init): Remove parameter. (expand_aggr_init): Rename to build_aggr_init. (expand_vec_init): Rename to build_vec_init. (do_pushlevel): Remove. (do_poplevel): Likewise. (finish_cleanup): New function. (finish_subobject): Likewise. (stmts_are_full_exprs_p): New variable. * decl.c (keep_next_level): Add parameter. (cp_finish_decl): Use build_aggr_init, not expand_aggr_init. Use finish_expr_stmt to expand the code. (expand_static_init): Use tree-generating, not RTL-generating, functions to handle the initialization. (start_function): Remove dead code. Always have a momentary obstack inside the function, even before hitting the first curly brace. (cplus_expand_expr_stmt): Move calls to expand_{start,end}_target_temps into semantics.c. (cp_function): Add stmts_are_full_exprs_p. (push_cp_function_context): Save it. (pop_cp_function_context): Restore it. * decl2.c (get_temp_regvar): Move to init.c. (do_static_initialization): Use build_{aggr,vec}_init. (do_static_destruction): Fix typo in comment. * dump.c (dequeue_and_dump): Handle INIT_EXPR. * except.c (expand_throw): Use create_temporary_var. * expr.c (cplus_expand_expr): Use build_{aggr,vec}_init. * init.c (expand_vec_init_try_block): Remove. (expand_vec_init_catch_clause): Likewise. (get_temp_regvar): New function. (begin_init_stmts): Likewise. (finish_init_stmts): Likewise. (perform_member_init): Use build_{aggr,vec}_init. Build up tree structure here. (emit_base_init): Likewise. Remove unused parameter. (expand_virtual_init): Likewise. (expand_cleanup_for_base): Use finish_subobject. (expand_aggr_vbase_init_1): Simplify. (construct_virtual_bases): Use tree-generating functions to build up initialization. (expand_aggr_init): Likewise. Rename to build_aggr_init. (expand_default_init): Likewise. (expand_aggr_init_1): Likewise. (expand_vec_init): Rename to build_vec_init. * method.c (do_build_copy_constructor): Use tree-generating functions. Don't call clear_last_expr. (do_build_assign_ref): Likewise. (synthesize_method): Call clear_last_expr here. * parse.y (base_init): Don't call clear_last_expr here. (nodecls): Likewise. * pt.c (tsubst_expr): Handle a TRY_BLOCK with CLEANUP_P set. * semantics.c (do_pushlevel): Move to here. (do_poplevel): Likewise. (stmts_are_full_exprs_p): New variable. (finish_expr_stmt): Handle logic for temoprary cleanup here. (finish_for_stmt): Use finish_expr_stmt. (finish_cleanup): New function. (finish_function_try_block): Fix indentation. (finish_subobject): New function. (setup_vtbl_ptr): Call keep_next_level here. (finish_stmt_expr): Handle a block with no scope inside the statement-expression. (expand_stmt): Handle a TRY_BLOCK with CLEANUP_P set. Handle SUBOBJECT. * tree.c (search_tree): Handle INIT_EXPR. (mapcar): Likewise. * typeck.c (build_modify_expr): Don't build an RTL_EXPR. * typeck2.c (store_init_value): Change expand_aggr_init to build_aggr_init in comment. From-SVN: r28878
1999-08-26 00:07:18 +02:00
void
finish_decl_cleanup (decl, cleanup)
tree decl;
cp-tree.def (SUBOBJECT): New tree node. * cp-tree.def (SUBOBJECT): New tree node. * cp-tree.h (CLEANUP_P): New macro. (SUBOBJECT_CLEANUP): Likewise. (keep_next_level): Add parameter. (get_temp_regvar): Don't declare. (emit_base_init): Remove parameter. (expand_aggr_init): Rename to build_aggr_init. (expand_vec_init): Rename to build_vec_init. (do_pushlevel): Remove. (do_poplevel): Likewise. (finish_cleanup): New function. (finish_subobject): Likewise. (stmts_are_full_exprs_p): New variable. * decl.c (keep_next_level): Add parameter. (cp_finish_decl): Use build_aggr_init, not expand_aggr_init. Use finish_expr_stmt to expand the code. (expand_static_init): Use tree-generating, not RTL-generating, functions to handle the initialization. (start_function): Remove dead code. Always have a momentary obstack inside the function, even before hitting the first curly brace. (cplus_expand_expr_stmt): Move calls to expand_{start,end}_target_temps into semantics.c. (cp_function): Add stmts_are_full_exprs_p. (push_cp_function_context): Save it. (pop_cp_function_context): Restore it. * decl2.c (get_temp_regvar): Move to init.c. (do_static_initialization): Use build_{aggr,vec}_init. (do_static_destruction): Fix typo in comment. * dump.c (dequeue_and_dump): Handle INIT_EXPR. * except.c (expand_throw): Use create_temporary_var. * expr.c (cplus_expand_expr): Use build_{aggr,vec}_init. * init.c (expand_vec_init_try_block): Remove. (expand_vec_init_catch_clause): Likewise. (get_temp_regvar): New function. (begin_init_stmts): Likewise. (finish_init_stmts): Likewise. (perform_member_init): Use build_{aggr,vec}_init. Build up tree structure here. (emit_base_init): Likewise. Remove unused parameter. (expand_virtual_init): Likewise. (expand_cleanup_for_base): Use finish_subobject. (expand_aggr_vbase_init_1): Simplify. (construct_virtual_bases): Use tree-generating functions to build up initialization. (expand_aggr_init): Likewise. Rename to build_aggr_init. (expand_default_init): Likewise. (expand_aggr_init_1): Likewise. (expand_vec_init): Rename to build_vec_init. * method.c (do_build_copy_constructor): Use tree-generating functions. Don't call clear_last_expr. (do_build_assign_ref): Likewise. (synthesize_method): Call clear_last_expr here. * parse.y (base_init): Don't call clear_last_expr here. (nodecls): Likewise. * pt.c (tsubst_expr): Handle a TRY_BLOCK with CLEANUP_P set. * semantics.c (do_pushlevel): Move to here. (do_poplevel): Likewise. (stmts_are_full_exprs_p): New variable. (finish_expr_stmt): Handle logic for temoprary cleanup here. (finish_for_stmt): Use finish_expr_stmt. (finish_cleanup): New function. (finish_function_try_block): Fix indentation. (finish_subobject): New function. (setup_vtbl_ptr): Call keep_next_level here. (finish_stmt_expr): Handle a block with no scope inside the statement-expression. (expand_stmt): Handle a TRY_BLOCK with CLEANUP_P set. Handle SUBOBJECT. * tree.c (search_tree): Handle INIT_EXPR. (mapcar): Likewise. * typeck.c (build_modify_expr): Don't build an RTL_EXPR. * typeck2.c (store_init_value): Change expand_aggr_init to build_aggr_init in comment. From-SVN: r28878
1999-08-26 00:07:18 +02:00
tree cleanup;
{
add_stmt (build_stmt (CLEANUP_STMT, decl, cleanup));
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
}
/* If the current scope exits with an exception, run CLEANUP. */
void
finish_eh_cleanup (cleanup)
tree cleanup;
{
tree r = build_stmt (CLEANUP_STMT, NULL_TREE, cleanup);
CLEANUP_EH_ONLY (r) = 1;
add_stmt (r);
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
}
/* Generate the RTL for a RETURN_INIT. */
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
static void
genrtl_named_return_value ()
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
{
tree decl = DECL_RESULT (current_function_decl);
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
/* If this named return value comes in a register, put it in a
pseudo-register. */
if (DECL_REGISTER (decl))
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
{
/* Note that the mode of the old DECL_RTL may be wider than the
mode of DECL_RESULT, depending on the calling conventions for
the processor. For example, on the Alpha, a 32-bit integer
is returned in a DImode register -- the DECL_RESULT has
SImode but the DECL_RTL for the DECL_RESULT has DImode. So,
here, we use the mode the back-end has already assigned for
the return value. */
varasm.c (assemble_alias): Use DECL_ASSEMBLER_NAME... * varasm.c (assemble_alias): Use DECL_ASSEMBLER_NAME, not the contents of the RTL, to determine the name of the object. * tree.h (DECL_RTL): Allocate RTL lazily. (SET_DECL_RTL): New macro. (DECL_RTL_SET_P): Likewise. (COPY_DECL_RTL): Likewise. (DECL_RTL_IF_SET): Likewise. * varasm.c (make_decl_rtl): Add assertions about the kind of declaration we are processing. * c-decl.c (duplicate_decls): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc. (start_decl): Likewise. (finish_decl): Likewise. * c-semantics.c (emit_local_var): Likewise. * calls.c (expand_call): Likewise. * dbxout.c (dbxout_symbol): Likewise. * emit-rtl.c (unshare_all_rtl): Likewise. (unshare_all_decls): Likewise. (reset_used_decls): Likewise. * expr.c (store_constructor): Likewise. (safe_from_p): Likewise. (expand_expr): Likewise. * function.c (put_var_into_stack): Likewise. (instantiate_decls_1): Likewise. (assign_parms): Likewise. (expand_function_start): Likewise. (expand_function_end): Likewise. * ggc-common.c (gcc_mark_trees): Likewise. * integrate.c (function_cannot_inline_p): Likewise. (copy_decl_for_inlining): Likewise. (expand_inline_function): Likewise. (integrate_parm_decls): Likewise. (integrate_decl_tree): Likewise. * print-tree.c (print_node): Likewise. * reg-stack.c (stack_result): Likewise. * stmt.c (label_rtx): Likewise. (expand_return): Likewise. (expand_decl): Likewise. (expand_decl_cleanup): Likewise. (expand_anon_union_decl): Likewise. * toplev.c (check_global_declarations): Likewise. (rest_of_decl_compilation): Likewise. * tree.c (simple_cst_equal): Likewise. * objc/objc-act.c (generate_static_references): Likewise. * class.c (build_clone): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc. * cp-tree.h (DECL_IN_MEMORY_P): Likewise. * decl.c (duplicate_decls): Likewise. (builtin_function): Likewise. (build_library_fn): Likewise. (build_cp_library_fn): Likewise. (check_initializer): Likewise. (cp_finish_decl): Likewise. * decl2.c (grokfield): Likewise. (grok_function_init): Remove #if 0'd code. (finish_anon_union): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc. * friend.c (do_friend): Likewise. * init.c (get_temp_regvar): Likewise. * method.c (make_thunk): Likewise. * pt.c (tsubst_friend_function): Likewise. (tsubst_decl): Likewise. (regenerate_decl_from_template): Likewise. * semantics.c (genrtl_named_return_value): Likewise. (expand_body): Likewise. (genrtl_finish_function): Likewise. * tree.c (cp_tree_equal): Likewise. * com.c (ffecom_member_phase_2): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc. (duplicate_decls): Likewise. (start_decl): Likewise. * class.c (build_static_field_ref): Likewise. (make_method_value): Likewise. (get_dispatch_table): Likewise. * decl.c (push_jvm_slot): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc. From-SVN: r40482
2001-03-15 03:51:03 +01:00
SET_DECL_RTL (decl, gen_reg_rtx (GET_MODE (DECL_RTL (decl))));
if (TREE_ADDRESSABLE (decl))
put_var_into_stack (decl);
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
}
emit_local_var (decl);
}
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
/* Bind a name and initialization to the return value of
the current function. */
void
finish_named_return_value (return_id, init)
tree return_id, init;
{
tree decl = DECL_RESULT (current_function_decl);
/* Give this error as many times as there are occurrences, so that
users can use Emacs compilation buffers to find and fix all such
places. */
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
if (pedantic)
pedwarn ("ISO C++ does not permit named return values");
cp_deprecated ("the named return value extension");
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
if (return_id != NULL_TREE)
{
if (DECL_NAME (decl) == NULL_TREE)
Compute DECL_ASSEMBLER_NAME lazily. * tree.h (DECL_ASSEMBLER_NAME): Compute it lazily. (DECL_ASSEMBLER_NAME_SET_P): New macro. (SET_DECL_ASSEMBLER_NAME): Likewise. (COPY_DECL_ASSEMBLER_NAME): Likewise. (set_decl_assembler_name): Declare. (lang_set_decl_assembler_name): Likewise. * tree.c (lang_set_decl_assembler_name): New variab.e (set_decl_assembler_name): New function. (init_obstacks): Set lang_set_decl_assembler_name. (build_decl): Don't set DECL_ASSEMBLER_NAME. * c-decl.c (duplicate_decls): Use SET_DECL_ASSEMBLER_NAME, COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME where it's not necessary. (builtin_function): Likewise. (finish_decl): Likewise. * dbxout.c (dbxout_type_methods): Likewise. * ggc-common.c (ggc_mark_trees): Likewise. * profile.c (output_func_start_profiler): Likewise. * varasm.c (make_decl_rtl): Likewise. * class.c (get_vtable_decl): Use SET_DECL_ASSEMBLER_NAME, COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME where it's not necessary. (add_method): Remove optimization involving comparison of DECL_ASSEMBLER_NAME. (build_vtbl_or_vbase_field): Use SET_DECL_ASSEMBLER_NAME, COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME where it's not necessary. (check_methods): Likewise. (build_clone): Likewise. (built_vtt): Likewise. * cp-tree.h (DECL_NEEDED_P): Likewise. * decl.c (pushtag): Likewise. (duplicate_decls): Likewise. (pushdecl): Likewise. (builtin_function): Likewise. (build_library_fn_1): Set DECL_LANGUAGE for library functions. (build_cp_library_fn): Likewise. (maybe_commonize_var): Use SET_DECL_ASSEMBLER_NAME, COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME where it's not necessary. (make_rtl_for_nonlocal_decl): Likewise. (cp_finish_decl): Likewise. (grokfndecl): Likewise. (grokvardecl): Likewise. (grokdeclarator): Likewise. (start_function): Likewise. (cp_missing_return_ok_p): Likewise. * decl2.c (grokclassfn): Likewise. (check_classfn): Likewise. (finish_static_data_member_decl): Likewise. (grokfield): Likewise. * error.c (GLOBAL_IORD_P): Remove. (dump_global_iord): Improve output. (dump_decl): Avoid using DECL_ASSEMBLER_NAME. * except.c (nothrow_libfn_p): Summarily reject any function not in namespace-scope. * init.c (build_java_class_ref): Don't explicitly set DECL_ASSEMBLER_NAME after calling mangle_decl. * mangle.c (mangle_decl_string): Handle extern "C" functions. (mangle_decl): Set the DECL_ASSEMBLER_NAME for the decl. * method.c (set_mangled_name_for_decl): Don't explicitly set DECL_ASSEMBLER_NAME after calling mangle_decl. (make_thunk): Explicitly set the DECL_ASSEMBLER_NAME and IDENTIFIER_GLOBAL_VALUE for the thunk. * pt.c (set_mangled_name_for_template_decl): Remove. (check_explicit_specialization): Don't use it. (looup_template_class): Don't set DECL_ASSEMBLER_NAME. (tsubst_friend_function): Likewise. (tsubst_decl): Likewise. (regenerate_decl_from_template): Use COPY_DECL_ASSEMBLER_NAME. * rtti.c (get_tinfo_decl): Use SET_DECL_ASSEMBLER_NAME, COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME where it's not necessary. (tinfo_base_init): Likewise. (create_real_tinfo_var): Likewise. * search.c (looup_field_1): Likewise. * semantics.c (finish_named_return_value): Likewise. * tree.c (init_tree): Set lang_set_decl_assembler_name. * com.c (builtin_function): Use SET_DECL_ASSEMBLER_NAME. * class.c (build_class_ref): Use SET_DECL_ASSEMBLER_NAME. (layout_class): Likewise. (layout_class_method): Likewise. (emit_register_classes): Likewise. * decl.c (builtin_function): Likewise. (give_name_to_locals): Likewise. From-SVN: r40642
2001-03-20 00:50:04 +01:00
DECL_NAME (decl) = return_id;
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
else
{
error ("return identifier `%D' already in place", return_id);
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
return;
}
}
/* Can't let this happen for constructors. */
if (DECL_CONSTRUCTOR_P (current_function_decl))
{
error ("can't redefine default return value for constructors");
return;
}
/* If we have a named return value, put that in our scope as well. */
if (DECL_NAME (decl) != NULL_TREE)
{
/* Let `cp_finish_decl' know that this initializer is ok. */
DECL_INITIAL (decl) = init;
Turn on function-at-a-time processing. * cp-tree.h (doing_semantic_analysis_p): New macro. (SF_DEFAULT): Define to zero, not SF_EXPAND. (start_handler_parms): Change prototype. (expand_start_catch_block): Likewise. (expand_end_catch_block): Likewise. (expand_start_eh_spec): Likewise. (expand_end_eh_spec): Declare. (finish_handler_parms): Change prototype. (begin_catch_block): Declare. (finish_handler): Change prototype. (do_pushlevel): Declare. (do_poplevel): Likewise. * decl.c (pushlevel): Don't create binding levels when not doing semantic analysis. (poplevel): Don't pop them. (pushdecl): Assert that we are never called when not doing semantic analysis. (pushdecl_top_level): Use push_to_top_level. (make_label_decl): Don't fiddle with obstacks. Make RTL For the label when expanding. (cp_finish_decl): Only inject for-scope variables when doing semantic analysis. Add comments. (start_handler_parms): Return the handler parm. (start_function): Reorganize. Don't clear DECL_INITIAL if it is already set. Reinitialize from saved function data if available. Don't pushlevel when not doing semantic analysis. (store_parm_decls): Only generate RTL when expanding. Only pushdecl when doing semantic analysis. Set current_eh_spec_try_block if appropriate. (finish_function): Simplify. Use do_pushlevel and do_poplevel. Combine common code. Don't poplevel when not doing semantic analysis. (push_cp_function_context): Don't expand functions without an explicit call to expand_body. (mark_lang_function): Make eh_spec_try_block and x_scope_stmt_stack. * except.c (expand_end_eh_spec): Don't declare. (process_start_catch_block): Likewise. (push_eh_cleanup): Use finish_decl_cleanup. (initialize_handler_parm): New function. (expand_start_catch_block): Use it. (expand_end_catch_block): Use tree-generation functions, not RTL-generation functions. (expand_start_eh_spec): Likewise. (expand_end_eh_spec): Likewise. (expand_exception_blocks): Simplify. (start_anon_func): Use do_pushlevel. (end_anon_func): Use do_poplvel. Call expand_body for the function. * expr.c (do_case): Don't call define_case_label. * init.c (create_temporary_var): Set DECL_CONTEXT for local variables. * method.c (emit_thunk): Call expand_body for the thunk. (sythesize_method): Likewise. * parse.y (handler_args): Give it ttype. (eat_saved_input): Call expand_body. (base_init): Use do_pushlevel. (pending_inline): Call expand_body. (handler): Adjust calls to finish_handler_parms and finish_handler. (handler_args): Don't call expand_start_catch_block. Return the catch parameter. * pt.c (tsubst_expr): Adjust HANDLER handling. * parse.c: Regenerated. * rtti.c (synthesize_tinfo_fn): Call finish_function. * semantics.c (do_pushlevel): Give it external linkage. Build SCOPE_STMTs. (do_poplevel): Likewise. (finish_case_label): Call define_case_label when doing semantic analysis. (finish_goto_stmt): Create RTL for labels. (finish_function_try_block): Set in_function_try_handler unconditionally. (finish_function_handler_sequence): Unset it. (finish_handler_parms): Use expand_start_catch_block even when building a statement-tree. (begin_catch_block): New function. (finish_handler): Move a little RTL-generation logic here. (finish_decl_cleanup): Allow cleanups for empty declarations. (finish_named_return_value): Don't pushdecl when not doing semantic analysis. (expand_stmt): Don't do semantic analysis for variable declarations. Handle START_CATCH_STMT. Call expand_label directly for a LABEL_STMT. Tweak handling of GOTO_STMT. Adjust HANDLERs. Handle SCOPE_STMT, CTOR_INITIALIZER, and RETURN_INIT. (expand_body): Let expand_stmt handle CTOR_INITIALIZER, RETURN_INIT and function try blocks. From-SVN: r29490
1999-09-18 03:23:20 +02:00
if (doing_semantic_analysis_p ())
pushdecl (decl);
if (!processing_template_decl)
{
cp_finish_decl (decl, init, NULL_TREE, 0);
Move statement-tree facilities from C++ to C front-end. * c-common.h (c_tree_index): Add CTI_VOID_ZERO. (void_zero_node): New macro. (struct stmt_tree_s): New type. (stmt_tree): New typedef. (struct language_function): New type. (last_tree): New macro. (last_expr_type): Likewise. (walk_tree_fn): New typedef. (current_stmt_tree): New function. (begin_stmt_tree): Likewise. (add_stmt): Likewise. (finish_stmt_tree): Likewise. (statement_code_p): Likewise. (lang_statement_code_p): New variable. (walk_stmt_tree): New function. (STMT_IS_FULL_EXPR_P): New macro. * c-common.c (lang_statement_code_p): New variable. (c_common_nodes_and_builtins): Initialize void_zero_node. (statement_code_p): New function. (walk_stmt_tree): Likewise. * c-decl.c (language_function): Rename to ... (c_language_function): ... this. Include language_function. (push_c_function_context): Adjust accordingly. (pop_c_function_context): Likewise. (mark_c_function_context): Likewise. (current_stmt_tree): Define. * c-semantics.c (begin_stmt_tree): New function. (add_stmt): Likewise. (prune_unused_decls): Likewise. (finish_stmt_tree): Likewise. Move statement-tree facilities from C++ to C front-end. * cp-tree.h (cp_tree_index): Remove CPTI_VOID_ZERO. (void_zero_node): Remove. (stmt_tree): Likewise. (scope_chain): Adjust. (language_function): Rename to cp_language_function. (cp_function_chain): Adjust. (current_stmt_tree): Remove. (last_tree): Likewise. (last_expr_type): Likewise. (struct lang_decl): Adjust. (STMT_IS_FULL_EXPR_P): Remove. (add_tree): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (walk_tree_fn): Likewise. (walk_stmt_tree): Likewise. * class.c (finish_struct): Replace use of add_tree with add_stmt. * decl.c (mark_stmt_tree): Adjust type. (init_decl_processing): Don't build void_zero_node. (initialize_local_var): Adjust usage of current_stmt_tree. (finish_enum): Use add_stmt, not add_tree. (save_function_data): Adjust use of language_function. (finish_constructor_body): Use add_stmt, not add_tree. (finish_destructor_body): Likewise. (push_cp_function_context): Adjust use of language_function. (pop_cp_function_context): Likewise. (mark_lang_function): Likewise. (mark_cp_function_context): Likewise. * init.c (build_aggr_init): Adjust use of current_stmt_tree. (build_vec_init): Likewise. * semantics.c (SET_LAST_STMT): Remove. (RECHAIN_STMTS): Don't use it. (stmts_are_full_exprs_p): Adjust use of current_stmt_tree. (current_stmt_tree): Define. (add_tree): Remove. (finish_goto_stmt): Use add_stmt, not add_tree. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_then_clause): Likewise. (begin_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (begin_handler): Likewise. (begin_catch_block): Likewise. (begin_compound_stmt): Likewise. (begin_asm_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (add_decl_stmt): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (setup_vtbl_ptr): Likewise. (add_scope_stmt): Likewise. (finish_stmt_expr): Likewise. (prune_unused_decls): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (prep_stmt): Adjust use of current_stmt_tree. (lang_expand_stmt): Likewise. * tree.c (statement_code_p): Remove. (cp_statement_code_p): New function. (walk_stmt_tree): Remove. (init_tree): Set lang_statement_code_p. From-SVN: r36221
2000-09-07 03:36:11 +02:00
add_stmt (build_stmt (RETURN_INIT, NULL_TREE, NULL_TREE));
}
else
Move statement-tree facilities from C++ to C front-end. * c-common.h (c_tree_index): Add CTI_VOID_ZERO. (void_zero_node): New macro. (struct stmt_tree_s): New type. (stmt_tree): New typedef. (struct language_function): New type. (last_tree): New macro. (last_expr_type): Likewise. (walk_tree_fn): New typedef. (current_stmt_tree): New function. (begin_stmt_tree): Likewise. (add_stmt): Likewise. (finish_stmt_tree): Likewise. (statement_code_p): Likewise. (lang_statement_code_p): New variable. (walk_stmt_tree): New function. (STMT_IS_FULL_EXPR_P): New macro. * c-common.c (lang_statement_code_p): New variable. (c_common_nodes_and_builtins): Initialize void_zero_node. (statement_code_p): New function. (walk_stmt_tree): Likewise. * c-decl.c (language_function): Rename to ... (c_language_function): ... this. Include language_function. (push_c_function_context): Adjust accordingly. (pop_c_function_context): Likewise. (mark_c_function_context): Likewise. (current_stmt_tree): Define. * c-semantics.c (begin_stmt_tree): New function. (add_stmt): Likewise. (prune_unused_decls): Likewise. (finish_stmt_tree): Likewise. Move statement-tree facilities from C++ to C front-end. * cp-tree.h (cp_tree_index): Remove CPTI_VOID_ZERO. (void_zero_node): Remove. (stmt_tree): Likewise. (scope_chain): Adjust. (language_function): Rename to cp_language_function. (cp_function_chain): Adjust. (current_stmt_tree): Remove. (last_tree): Likewise. (last_expr_type): Likewise. (struct lang_decl): Adjust. (STMT_IS_FULL_EXPR_P): Remove. (add_tree): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (walk_tree_fn): Likewise. (walk_stmt_tree): Likewise. * class.c (finish_struct): Replace use of add_tree with add_stmt. * decl.c (mark_stmt_tree): Adjust type. (init_decl_processing): Don't build void_zero_node. (initialize_local_var): Adjust usage of current_stmt_tree. (finish_enum): Use add_stmt, not add_tree. (save_function_data): Adjust use of language_function. (finish_constructor_body): Use add_stmt, not add_tree. (finish_destructor_body): Likewise. (push_cp_function_context): Adjust use of language_function. (pop_cp_function_context): Likewise. (mark_lang_function): Likewise. (mark_cp_function_context): Likewise. * init.c (build_aggr_init): Adjust use of current_stmt_tree. (build_vec_init): Likewise. * semantics.c (SET_LAST_STMT): Remove. (RECHAIN_STMTS): Don't use it. (stmts_are_full_exprs_p): Adjust use of current_stmt_tree. (current_stmt_tree): Define. (add_tree): Remove. (finish_goto_stmt): Use add_stmt, not add_tree. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_then_clause): Likewise. (begin_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (begin_handler): Likewise. (begin_catch_block): Likewise. (begin_compound_stmt): Likewise. (begin_asm_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (add_decl_stmt): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (setup_vtbl_ptr): Likewise. (add_scope_stmt): Likewise. (finish_stmt_expr): Likewise. (prune_unused_decls): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (prep_stmt): Adjust use of current_stmt_tree. (lang_expand_stmt): Likewise. * tree.c (statement_code_p): Remove. (cp_statement_code_p): New function. (walk_stmt_tree): Remove. (init_tree): Set lang_statement_code_p. From-SVN: r36221
2000-09-07 03:36:11 +02:00
add_stmt (build_stmt (RETURN_INIT, return_id, init));
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
}
/* Don't use tree-inlining for functions with named return values.
That doesn't work properly because we don't do any translation of
the RETURN_INITs when they are copied. */
DECL_UNINLINABLE (current_function_decl) = 1;
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
}
/* Begin processing a mem-initializer-list. */
void
begin_mem_initializers ()
{
if (! DECL_CONSTRUCTOR_P (current_function_decl))
error ("only constructors take base initializers");
}
/* The MEM_INITS is a list of mem-initializers, in reverse of the
order they were written by the user. Each node is as for
emit_mem_initializers. */
void
finish_mem_initializers (tree mem_inits)
{
/* Reorder the MEM_INITS so that they are in the order they appeared
in the source program. */
mem_inits = nreverse (mem_inits);
if (processing_template_decl)
add_stmt (build_min_nt (CTOR_INITIALIZER, mem_inits));
else
emit_mem_initializers (mem_inits);
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
}
splay-tree.c (splay_tree_predecessor): Fix typo in comment. * splay-tree.c (splay_tree_predecessor): Fix typo in comment. Convert the C front-end to use function-at-a-time mode. * c-common.h: Include splay-tree.h. (C_DECLARED_LABEL_FLAG): New macro. (struct language_function): Add x_scope_stmt_stack and x_function_name_declared_p. (RECHAIN_STMTS): Move definition. (lang_statment_code_p): Likewise. (lang_expand_stmt): Likewise. (lang_expand_decl_stmt): New variable. (lang_expand_function_end): Likewise. (current_scope_stmt_stack): New function. (add_decl_stmt): Likewise. (add_scope_stmt): Likewise. (mark_stmt_tree): Likewise. (struct c_lang_decl): New structure. (DECL_SAVED_TREE): Define. (c_mark_lang_decl): New function. (c_expand_start_cond): Change prototype. (c_finish_then): New function. (c_finish_else): Likewise. (current_function_name_declared): Remove. (set_current_function_name_declared): Likewise. (mark_c_language_function): Declare. (case_compare): Likewise. (c_add_case_label): Likewise. (c_expand_expr): Likewise. (c_safe_from_p): Likewise. * c-common.c (lang_expand_function_end): New variable. (struct if_elt): Add if_stmt. (c_expand_start_cond): Add the if-statement to the statement-tree, rather than generating RTL. (c_finish_then): New function. (c_expand_start_else): Don't generate RTL. (c_finish_else): New function. (c_expand_expr_stmt): Don't generate RTL. (statement_code_p): Add SCOPE_STMT. (case_compare): New function. (c_add_case_label): Likewise. (mark_stmt_tree): Likewise. (c_mark_lang_decl): Likewise. (mark_c_language_function): Likewise. (c_expand_expr): Likewise. (c_safe_from_p): Likewise. * c-decl.c (c_stmt_tree): New variable (c_scope_stmt_stack): Likewise. (c_function_name_declared_p): Likewise. (lang_expand_expr_stmt): Remove. (poplevel): Don't call output_inline_function for nested functions. (pushdecl): Don't set DECL_CONTEXT for a local declaration of an `extern' function. (redeclaration_error_message): Change means of computing whether or not a function is nested. (lookup_label): Don't call label_rtx. (init_decl_processing): Add more GC roots. (start_decl): Add DECL_STMTs to the statement-tree, rather than calling rest_of_decl_compilation. (finish_decl): Don't call expand_decl. (store_parm_decls): Begin the statement-tree, but don't generate RTL. (finish_function): Tie off the statement-tree. Call c_expand_body if appropriate. (c_expand_body): New function. (push_c_function_context): Save more information. (pop_c_function_contxt): Likewise. (copy_lang_decl): Now that we use DECL_LANG_SPECIFIC, copy it. (lang_mark_tree): Mark it. (current_stmt_tree): Adjust. (current_scope_stmt_stack): New function. (do_case): Remove. (set_current_name_declared): Likewise. (c_begin_compound_stmt): Define. (c_expand_decl_stmt): Likewise. * c-lang.c: Include rtl.h and expr.h. (lang_init): Set more language-specific hooks. * c-lex.c: Include expr.h. * c-parse.in: Changes throughout to add statements to the statement-tree, rather than generating RTL after every statement. * c-semantics.c (lang_expand_decl_stmt): Define. (add_decl_stmt): New function. (add_scope_stmt): Likewise. (finish_stmt_tree): Tweak. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Handle local labels, and call lang_expand_decl_stmt if required. (genrtl_for_stmt): Fix line-number handling. (genrtl_case_label): Handle cleanups. (genrtl_asm_stmt): Don't call combine_strings. (genrtl_compound_stmt): Simplify. (expand_stmt): Handle SCOPE_STMTs. * c-tree.h (struct lang_decl): New structure. (C_DECLARED_LABEL_FLAG): Remove. (c_begin_compound_stmt): Declare. (c_expand_decl_stmt): Likewise. (c_expand_start_case): Rename to c_start_case. (c_finish_case): New function. * c-typeck.c (start_init): Tweak setting of constructor_incremental. (c_expand_asm_operands): Tweak error-handling. Add to the statement-tree. (c_expand_return): Add to the statement-tree. (c_expand_start_case): Rename to ... (c_start_case): ... this. (struct c_switch): New type. (switch_stack): New variable. (do_case): Simplify. (c_finish_case): New function. * dependence.c: Include expr.h. (enum dependence_type): Change spelling of enumerals. (check_node_dependence): Adjust. * expr.h (lang_safe_from_p): Declare. (safe_from_p): Likewise. * expr.c (lang_safe_from_p): New variable. (safe_from_p): Give it external linkage. Use lang_safe_from_p. * stmt.c (expand_expr_stmt): Avoid clobberring of last_expr_type. * toplev.c (rest_of_decl_compilation): Robustify. * tree.c (contains_placeholder_p): Likewise. * Makefile.in: Update dependencies. * objc/objc-act.h: Adjust calculation of value for dummy_tree_code. * objc/objc-act.c: Include rtl.h, expr.h, and c-common.h. (objc_expand_function_end): New function. (finish_method_def): Use it. (init_objc): Initialize more language-specific hooks. * objc/Make-lang.in: Update dependencies. * cp-tree.h (struct cp_language_function): Remove x_scope_stmt_stack and name_declared. (current_scope_stmt_stack): Remove. (function_name_declared_p): New macro. (struct lang_decl_flags): Use c_lang_decl as a base class. (context): Remove. (struct lang_decl): Replace saved_tree with context. (DECL_FRIEND_CONTEXT): Adjust accordingly. (SET_DECL_FRIEND_CONTEXT): Likewise. (DECL_VIRTUAL_CONTEXT): Likewise. (DECL_SAVED_TREE): Remove. (C_DECLARED_LABEL_FLAG): Likewise. (cplus_expand_expr_stmt): Don't declare. (add_decl_stmt): Likewise. (add_scope_stmt): Likewise. * decl.c (mark_stmt_tree): Remove. (case_compare): Likewise. (finish_case_label): Use c_add_case_label. (init_decl_processing): Set more language-specific hooks. (build_enumerator): Fix typo in comment. (cplus_expand_expr_stmt): Remove. (mark_lang_function): Use mark_c_language_function. (lang_mark_tree): Use c_mark_lang_decl. * decl2.c: Change order of inclusion. * except.c: Likewise. * expr.c (cplus_expand_expr): Remove handling of STMT_EXPR. Fall back on c_expand_expr. * friend.c: Include expr.h. * init.c: Change order of inclusion. * Makefile.in: Update dependencies. * lex.h (free_lang_decl_chain): Remove. * optimize.c (maybe_clone_body): Use function_name_declared_p. * pt.c (build_template_decl): Don't copy DECL_VIRTUAL_CONTEXT if it doesn't exist. (instantiate_decl): Use function_name_declared_p. * semantics.c (lang_expand_expr_stmt): Remove. (set_current_function_name_declared): Likewise. (current_function_name_declared): Likewise. (begin_compound_stmt): Use function_name_declared_p. (add_decl_stmt): Remove. (setup_vtbl_ptr): Use function_name_declared_p. (add_scope_stmt): Remove. (current_scope_stmt_stack): New function. (cp_expand_stmt): Don't handle SCOPE_STMTs. (expand_body): Use function_name_declared_p. * tree.c (cp_statement_code_p): Don't include SCOPE_STMT. * typeck.c: Change order of includes. (convert_sequence): Remove. From-SVN: r36464
2000-09-17 09:38:23 +02:00
/* Returns the stack of SCOPE_STMTs for the current function. */
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
splay-tree.c (splay_tree_predecessor): Fix typo in comment. * splay-tree.c (splay_tree_predecessor): Fix typo in comment. Convert the C front-end to use function-at-a-time mode. * c-common.h: Include splay-tree.h. (C_DECLARED_LABEL_FLAG): New macro. (struct language_function): Add x_scope_stmt_stack and x_function_name_declared_p. (RECHAIN_STMTS): Move definition. (lang_statment_code_p): Likewise. (lang_expand_stmt): Likewise. (lang_expand_decl_stmt): New variable. (lang_expand_function_end): Likewise. (current_scope_stmt_stack): New function. (add_decl_stmt): Likewise. (add_scope_stmt): Likewise. (mark_stmt_tree): Likewise. (struct c_lang_decl): New structure. (DECL_SAVED_TREE): Define. (c_mark_lang_decl): New function. (c_expand_start_cond): Change prototype. (c_finish_then): New function. (c_finish_else): Likewise. (current_function_name_declared): Remove. (set_current_function_name_declared): Likewise. (mark_c_language_function): Declare. (case_compare): Likewise. (c_add_case_label): Likewise. (c_expand_expr): Likewise. (c_safe_from_p): Likewise. * c-common.c (lang_expand_function_end): New variable. (struct if_elt): Add if_stmt. (c_expand_start_cond): Add the if-statement to the statement-tree, rather than generating RTL. (c_finish_then): New function. (c_expand_start_else): Don't generate RTL. (c_finish_else): New function. (c_expand_expr_stmt): Don't generate RTL. (statement_code_p): Add SCOPE_STMT. (case_compare): New function. (c_add_case_label): Likewise. (mark_stmt_tree): Likewise. (c_mark_lang_decl): Likewise. (mark_c_language_function): Likewise. (c_expand_expr): Likewise. (c_safe_from_p): Likewise. * c-decl.c (c_stmt_tree): New variable (c_scope_stmt_stack): Likewise. (c_function_name_declared_p): Likewise. (lang_expand_expr_stmt): Remove. (poplevel): Don't call output_inline_function for nested functions. (pushdecl): Don't set DECL_CONTEXT for a local declaration of an `extern' function. (redeclaration_error_message): Change means of computing whether or not a function is nested. (lookup_label): Don't call label_rtx. (init_decl_processing): Add more GC roots. (start_decl): Add DECL_STMTs to the statement-tree, rather than calling rest_of_decl_compilation. (finish_decl): Don't call expand_decl. (store_parm_decls): Begin the statement-tree, but don't generate RTL. (finish_function): Tie off the statement-tree. Call c_expand_body if appropriate. (c_expand_body): New function. (push_c_function_context): Save more information. (pop_c_function_contxt): Likewise. (copy_lang_decl): Now that we use DECL_LANG_SPECIFIC, copy it. (lang_mark_tree): Mark it. (current_stmt_tree): Adjust. (current_scope_stmt_stack): New function. (do_case): Remove. (set_current_name_declared): Likewise. (c_begin_compound_stmt): Define. (c_expand_decl_stmt): Likewise. * c-lang.c: Include rtl.h and expr.h. (lang_init): Set more language-specific hooks. * c-lex.c: Include expr.h. * c-parse.in: Changes throughout to add statements to the statement-tree, rather than generating RTL after every statement. * c-semantics.c (lang_expand_decl_stmt): Define. (add_decl_stmt): New function. (add_scope_stmt): Likewise. (finish_stmt_tree): Tweak. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Handle local labels, and call lang_expand_decl_stmt if required. (genrtl_for_stmt): Fix line-number handling. (genrtl_case_label): Handle cleanups. (genrtl_asm_stmt): Don't call combine_strings. (genrtl_compound_stmt): Simplify. (expand_stmt): Handle SCOPE_STMTs. * c-tree.h (struct lang_decl): New structure. (C_DECLARED_LABEL_FLAG): Remove. (c_begin_compound_stmt): Declare. (c_expand_decl_stmt): Likewise. (c_expand_start_case): Rename to c_start_case. (c_finish_case): New function. * c-typeck.c (start_init): Tweak setting of constructor_incremental. (c_expand_asm_operands): Tweak error-handling. Add to the statement-tree. (c_expand_return): Add to the statement-tree. (c_expand_start_case): Rename to ... (c_start_case): ... this. (struct c_switch): New type. (switch_stack): New variable. (do_case): Simplify. (c_finish_case): New function. * dependence.c: Include expr.h. (enum dependence_type): Change spelling of enumerals. (check_node_dependence): Adjust. * expr.h (lang_safe_from_p): Declare. (safe_from_p): Likewise. * expr.c (lang_safe_from_p): New variable. (safe_from_p): Give it external linkage. Use lang_safe_from_p. * stmt.c (expand_expr_stmt): Avoid clobberring of last_expr_type. * toplev.c (rest_of_decl_compilation): Robustify. * tree.c (contains_placeholder_p): Likewise. * Makefile.in: Update dependencies. * objc/objc-act.h: Adjust calculation of value for dummy_tree_code. * objc/objc-act.c: Include rtl.h, expr.h, and c-common.h. (objc_expand_function_end): New function. (finish_method_def): Use it. (init_objc): Initialize more language-specific hooks. * objc/Make-lang.in: Update dependencies. * cp-tree.h (struct cp_language_function): Remove x_scope_stmt_stack and name_declared. (current_scope_stmt_stack): Remove. (function_name_declared_p): New macro. (struct lang_decl_flags): Use c_lang_decl as a base class. (context): Remove. (struct lang_decl): Replace saved_tree with context. (DECL_FRIEND_CONTEXT): Adjust accordingly. (SET_DECL_FRIEND_CONTEXT): Likewise. (DECL_VIRTUAL_CONTEXT): Likewise. (DECL_SAVED_TREE): Remove. (C_DECLARED_LABEL_FLAG): Likewise. (cplus_expand_expr_stmt): Don't declare. (add_decl_stmt): Likewise. (add_scope_stmt): Likewise. * decl.c (mark_stmt_tree): Remove. (case_compare): Likewise. (finish_case_label): Use c_add_case_label. (init_decl_processing): Set more language-specific hooks. (build_enumerator): Fix typo in comment. (cplus_expand_expr_stmt): Remove. (mark_lang_function): Use mark_c_language_function. (lang_mark_tree): Use c_mark_lang_decl. * decl2.c: Change order of inclusion. * except.c: Likewise. * expr.c (cplus_expand_expr): Remove handling of STMT_EXPR. Fall back on c_expand_expr. * friend.c: Include expr.h. * init.c: Change order of inclusion. * Makefile.in: Update dependencies. * lex.h (free_lang_decl_chain): Remove. * optimize.c (maybe_clone_body): Use function_name_declared_p. * pt.c (build_template_decl): Don't copy DECL_VIRTUAL_CONTEXT if it doesn't exist. (instantiate_decl): Use function_name_declared_p. * semantics.c (lang_expand_expr_stmt): Remove. (set_current_function_name_declared): Likewise. (current_function_name_declared): Likewise. (begin_compound_stmt): Use function_name_declared_p. (add_decl_stmt): Remove. (setup_vtbl_ptr): Use function_name_declared_p. (add_scope_stmt): Remove. (current_scope_stmt_stack): New function. (cp_expand_stmt): Don't handle SCOPE_STMTs. (expand_body): Use function_name_declared_p. * tree.c (cp_statement_code_p): Don't include SCOPE_STMT. * typeck.c: Change order of includes. (convert_sequence): Remove. From-SVN: r36464
2000-09-17 09:38:23 +02:00
tree *
current_scope_stmt_stack ()
{
return &cfun->language->base.x_scope_stmt_stack;
}
/* Finish a parenthesized expression EXPR. */
tree
finish_parenthesized_expr (expr)
tree expr;
{
if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (expr))))
c-common.c (truthvalue_conversion): Rename, update. * c-common.c (truthvalue_conversion): Rename, update. * c-common.h (c_common_truthvalue_conversion): New. * c-convert.c (convert): Update. * c-lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Redefine. * c-parse.in (expr_no_commas, if_prefix, select_or_iter_stmt): Update. * c-typeck.c (build_binary_op, build_unary_op, build_conditional_expr): Update. * fold-const.c (constant_boolean_node, fold): Use langhook. * langhooks-def.h (LANGHOOK_INITIALIZER): Update. * langhooks.h (struct lang_hooks): New hook. * stmt.c (expand_decl_cleanup): Use langhook. * tree.h (truthvalue_conversion): Remove. ada: * gigi.h (truthvalue_conversion): Rename. * misc.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Redefine. * trans.c (tree_transform): Update. * utils2.c (truthvalue_conversion): Rename, update. (build_binary_op, build_unary_op): Update. cp: * cp-lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Redefine. * cvt.c: Update comment. * init.c (expand_cleanup_for_base): Update. * semantics.c (finish_parenthesized_expr): Update. * typeck.c (cp_truthvalue_conversion): Update. f: * com.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Redefine. (truthvalue_conversion): Rename. Update. Make static. (ffecom_truth_value): Update. java: * expr.c (truthvalue_conversion): Rename. Update. (expand_compare): Update. * java-tree.h (java_truthvalue_conversion): New. * lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Redefine. objc: * objc-lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Redefine. From-SVN: r51880
2002-04-05 00:19:58 +02:00
/* This inhibits warnings in c_common_truthvalue_conversion. */
C_SET_EXP_ORIGINAL_CODE (expr, ERROR_MARK);
if (TREE_CODE (expr) == OFFSET_REF)
/* [expr.unary.op]/3 The qualified id of a pointer-to-member must not be
enclosed in parentheses. */
PTRMEM_OK_P (expr) = 0;
return expr;
}
/* Begin a statement-expression. The value returned must be passed to
finish_stmt_expr. */
tree
begin_stmt_expr ()
{
cp-tree.def (VEC_INIT_EXPR): Remove. * cp-tree.def (VEC_INIT_EXPR): Remove. * cp-tree.h (struct stmt_tree): New type. (struct saved_scope): Remove firstobj. Add x_saved_tree, x_stmt_tree. (class_cache_firstobj): Remove. (struct language_function): Remove stmts_are_full_exprs_p, x_last_tree, and x_last_expr_type. Add x_stmt_tree. (current_stmt_tree): New macro. (last_tree): Adjust. (last_expr_type): Likewise. (doing_semantic_analysis_p): Simplify. (stmts_are_full_exprs_p): Adjust. (begin_tree): Remove prototype. (end_tree): Likewise. (begin_stmt_tree): Change prototype. (finish_stmt_tree): Likewise. (building_stmt_tree): Simplify. * decl.c (mark_stmt_tree): New function. (mark_saved_scope): Use it. (start_function): Rearrange slightly to call begin_stmt_tree earlier. (save_function_data): Tweak. (finish_function): Adjust call to finish_stmt_tree. (mark_lang_function): Use mark_stmt_tree. * expr.c (cplus_expand_expr): Don't handle VEC_INIT_EXPR. * init.c (build_new_1): Remove creation of VEC_INIT_EXPR. (build_vec_init): Remove creation of stand-in intializer. * pt.c (begin_tree): Remove. (end_tree): Likewise. * semantics.c (SET_LAST_STMT): New macro. Use it throughout. (begin_compound_stmt): Handle a compound-statement outside of a function. (begin_stmt_expr): Handle a statement-expression outsidef of a function. (finish_stmt_expr): Likewise. (begin_class_definition): Don't call begin_tree. (finish_inline_definitions): Don't call end_tree. (begin_stmt_tree): Take a pointer to tree, not a function as input. (finish_stmt_tree): Likewise. * tree.c (search_tree): Don't handle VEC_INIT_EXPR. (mapcar): Likewise. * parse.y (simple_stmt): Don't call finish_stmt unnecessarily. * parse.c: Regenerated. * dump.c (dqueue_and_dump): Dump bitfieldness. From-SVN: r29786
1999-10-03 20:57:37 +02:00
/* If we're outside a function, we won't have a statement-tree to
work with. But, if we see a statement-expression we need to
create one. */
if (! cfun && !last_tree)
cp-tree.def (VEC_INIT_EXPR): Remove. * cp-tree.def (VEC_INIT_EXPR): Remove. * cp-tree.h (struct stmt_tree): New type. (struct saved_scope): Remove firstobj. Add x_saved_tree, x_stmt_tree. (class_cache_firstobj): Remove. (struct language_function): Remove stmts_are_full_exprs_p, x_last_tree, and x_last_expr_type. Add x_stmt_tree. (current_stmt_tree): New macro. (last_tree): Adjust. (last_expr_type): Likewise. (doing_semantic_analysis_p): Simplify. (stmts_are_full_exprs_p): Adjust. (begin_tree): Remove prototype. (end_tree): Likewise. (begin_stmt_tree): Change prototype. (finish_stmt_tree): Likewise. (building_stmt_tree): Simplify. * decl.c (mark_stmt_tree): New function. (mark_saved_scope): Use it. (start_function): Rearrange slightly to call begin_stmt_tree earlier. (save_function_data): Tweak. (finish_function): Adjust call to finish_stmt_tree. (mark_lang_function): Use mark_stmt_tree. * expr.c (cplus_expand_expr): Don't handle VEC_INIT_EXPR. * init.c (build_new_1): Remove creation of VEC_INIT_EXPR. (build_vec_init): Remove creation of stand-in intializer. * pt.c (begin_tree): Remove. (end_tree): Likewise. * semantics.c (SET_LAST_STMT): New macro. Use it throughout. (begin_compound_stmt): Handle a compound-statement outside of a function. (begin_stmt_expr): Handle a statement-expression outsidef of a function. (finish_stmt_expr): Likewise. (begin_class_definition): Don't call begin_tree. (finish_inline_definitions): Don't call end_tree. (begin_stmt_tree): Take a pointer to tree, not a function as input. (finish_stmt_tree): Likewise. * tree.c (search_tree): Don't handle VEC_INIT_EXPR. (mapcar): Likewise. * parse.y (simple_stmt): Don't call finish_stmt unnecessarily. * parse.c: Regenerated. * dump.c (dqueue_and_dump): Dump bitfieldness. From-SVN: r29786
1999-10-03 20:57:37 +02:00
begin_stmt_tree (&scope_chain->x_saved_tree);
cp-tree.def (SUBOBJECT): New tree node. * cp-tree.def (SUBOBJECT): New tree node. * cp-tree.h (CLEANUP_P): New macro. (SUBOBJECT_CLEANUP): Likewise. (keep_next_level): Add parameter. (get_temp_regvar): Don't declare. (emit_base_init): Remove parameter. (expand_aggr_init): Rename to build_aggr_init. (expand_vec_init): Rename to build_vec_init. (do_pushlevel): Remove. (do_poplevel): Likewise. (finish_cleanup): New function. (finish_subobject): Likewise. (stmts_are_full_exprs_p): New variable. * decl.c (keep_next_level): Add parameter. (cp_finish_decl): Use build_aggr_init, not expand_aggr_init. Use finish_expr_stmt to expand the code. (expand_static_init): Use tree-generating, not RTL-generating, functions to handle the initialization. (start_function): Remove dead code. Always have a momentary obstack inside the function, even before hitting the first curly brace. (cplus_expand_expr_stmt): Move calls to expand_{start,end}_target_temps into semantics.c. (cp_function): Add stmts_are_full_exprs_p. (push_cp_function_context): Save it. (pop_cp_function_context): Restore it. * decl2.c (get_temp_regvar): Move to init.c. (do_static_initialization): Use build_{aggr,vec}_init. (do_static_destruction): Fix typo in comment. * dump.c (dequeue_and_dump): Handle INIT_EXPR. * except.c (expand_throw): Use create_temporary_var. * expr.c (cplus_expand_expr): Use build_{aggr,vec}_init. * init.c (expand_vec_init_try_block): Remove. (expand_vec_init_catch_clause): Likewise. (get_temp_regvar): New function. (begin_init_stmts): Likewise. (finish_init_stmts): Likewise. (perform_member_init): Use build_{aggr,vec}_init. Build up tree structure here. (emit_base_init): Likewise. Remove unused parameter. (expand_virtual_init): Likewise. (expand_cleanup_for_base): Use finish_subobject. (expand_aggr_vbase_init_1): Simplify. (construct_virtual_bases): Use tree-generating functions to build up initialization. (expand_aggr_init): Likewise. Rename to build_aggr_init. (expand_default_init): Likewise. (expand_aggr_init_1): Likewise. (expand_vec_init): Rename to build_vec_init. * method.c (do_build_copy_constructor): Use tree-generating functions. Don't call clear_last_expr. (do_build_assign_ref): Likewise. (synthesize_method): Call clear_last_expr here. * parse.y (base_init): Don't call clear_last_expr here. (nodecls): Likewise. * pt.c (tsubst_expr): Handle a TRY_BLOCK with CLEANUP_P set. * semantics.c (do_pushlevel): Move to here. (do_poplevel): Likewise. (stmts_are_full_exprs_p): New variable. (finish_expr_stmt): Handle logic for temoprary cleanup here. (finish_for_stmt): Use finish_expr_stmt. (finish_cleanup): New function. (finish_function_try_block): Fix indentation. (finish_subobject): New function. (setup_vtbl_ptr): Call keep_next_level here. (finish_stmt_expr): Handle a block with no scope inside the statement-expression. (expand_stmt): Handle a TRY_BLOCK with CLEANUP_P set. Handle SUBOBJECT. * tree.c (search_tree): Handle INIT_EXPR. (mapcar): Likewise. * typeck.c (build_modify_expr): Don't build an RTL_EXPR. * typeck2.c (store_init_value): Change expand_aggr_init to build_aggr_init in comment. From-SVN: r28878
1999-08-26 00:07:18 +02:00
keep_next_level (1);
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
/* If we're building a statement tree, then the upcoming compound
statement will be chained onto the tree structure, starting at
last_tree. We return last_tree so that we can later unhook the
compound statement. */
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
return last_tree;
}
/* Used when beginning a statement-expression outside function scope.
For example, when handling a file-scope initializer, we use this
function. */
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
tree
begin_global_stmt_expr ()
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
{
if (! cfun && !last_tree)
begin_stmt_tree (&scope_chain->x_saved_tree);
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
keep_next_level (1);
return last_tree ? last_tree : expand_start_stmt_expr(/*has_scope=*/1);
}
/* Finish the STMT_EXPR last begun with begin_global_stmt_expr. */
tree
finish_global_stmt_expr (stmt_expr)
tree stmt_expr;
{
stmt_expr = expand_end_stmt_expr (stmt_expr);
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
if (! cfun
&& TREE_CHAIN (scope_chain->x_saved_tree) == NULL_TREE)
finish_stmt_tree (&scope_chain->x_saved_tree);
return stmt_expr;
}
/* Finish a statement-expression. RTL_EXPR should be the value
returned by the previous begin_stmt_expr; EXPR is the
statement-expression. Returns an expression representing the
statement-expression. */
tree
finish_stmt_expr (rtl_expr)
tree rtl_expr;
{
tree result;
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
/* If the last thing in the statement-expression was not an
expression-statement, then it has type `void'. */
if (!last_expr_type)
last_expr_type = void_type_node;
result = build_min (STMT_EXPR, last_expr_type, last_tree);
TREE_SIDE_EFFECTS (result) = 1;
/* Remove the compound statement from the tree structure; it is
now saved in the STMT_EXPR. */
Move statement-tree facilities from C++ to C front-end. * c-common.h (c_tree_index): Add CTI_VOID_ZERO. (void_zero_node): New macro. (struct stmt_tree_s): New type. (stmt_tree): New typedef. (struct language_function): New type. (last_tree): New macro. (last_expr_type): Likewise. (walk_tree_fn): New typedef. (current_stmt_tree): New function. (begin_stmt_tree): Likewise. (add_stmt): Likewise. (finish_stmt_tree): Likewise. (statement_code_p): Likewise. (lang_statement_code_p): New variable. (walk_stmt_tree): New function. (STMT_IS_FULL_EXPR_P): New macro. * c-common.c (lang_statement_code_p): New variable. (c_common_nodes_and_builtins): Initialize void_zero_node. (statement_code_p): New function. (walk_stmt_tree): Likewise. * c-decl.c (language_function): Rename to ... (c_language_function): ... this. Include language_function. (push_c_function_context): Adjust accordingly. (pop_c_function_context): Likewise. (mark_c_function_context): Likewise. (current_stmt_tree): Define. * c-semantics.c (begin_stmt_tree): New function. (add_stmt): Likewise. (prune_unused_decls): Likewise. (finish_stmt_tree): Likewise. Move statement-tree facilities from C++ to C front-end. * cp-tree.h (cp_tree_index): Remove CPTI_VOID_ZERO. (void_zero_node): Remove. (stmt_tree): Likewise. (scope_chain): Adjust. (language_function): Rename to cp_language_function. (cp_function_chain): Adjust. (current_stmt_tree): Remove. (last_tree): Likewise. (last_expr_type): Likewise. (struct lang_decl): Adjust. (STMT_IS_FULL_EXPR_P): Remove. (add_tree): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (walk_tree_fn): Likewise. (walk_stmt_tree): Likewise. * class.c (finish_struct): Replace use of add_tree with add_stmt. * decl.c (mark_stmt_tree): Adjust type. (init_decl_processing): Don't build void_zero_node. (initialize_local_var): Adjust usage of current_stmt_tree. (finish_enum): Use add_stmt, not add_tree. (save_function_data): Adjust use of language_function. (finish_constructor_body): Use add_stmt, not add_tree. (finish_destructor_body): Likewise. (push_cp_function_context): Adjust use of language_function. (pop_cp_function_context): Likewise. (mark_lang_function): Likewise. (mark_cp_function_context): Likewise. * init.c (build_aggr_init): Adjust use of current_stmt_tree. (build_vec_init): Likewise. * semantics.c (SET_LAST_STMT): Remove. (RECHAIN_STMTS): Don't use it. (stmts_are_full_exprs_p): Adjust use of current_stmt_tree. (current_stmt_tree): Define. (add_tree): Remove. (finish_goto_stmt): Use add_stmt, not add_tree. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_then_clause): Likewise. (begin_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (begin_handler): Likewise. (begin_catch_block): Likewise. (begin_compound_stmt): Likewise. (begin_asm_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (add_decl_stmt): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (setup_vtbl_ptr): Likewise. (add_scope_stmt): Likewise. (finish_stmt_expr): Likewise. (prune_unused_decls): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (prep_stmt): Adjust use of current_stmt_tree. (lang_expand_stmt): Likewise. * tree.c (statement_code_p): Remove. (cp_statement_code_p): New function. (walk_stmt_tree): Remove. (init_tree): Set lang_statement_code_p. From-SVN: r36221
2000-09-07 03:36:11 +02:00
last_tree = rtl_expr;
c-common.h (IF_COND): Added documentation. * c-common.h (IF_COND): Added documentation. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/cp-tree.h (genrtl_try_block): Declare function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument. (finish_switch_stmt): Likewise. * cp/semantics.c (genrtl_try_block): Define function. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_decl_cleanup): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_named_return_value): Likewise. (genrtl_begin_stmt_expr): Likewise. (genrtl_finish_stmt_expr): Likewise. (finish_for_stmt): Removed first argument and generate rtl specific code. (finish_switch_stmt): Likewise. (do_poplevel): Removed generate rtl specific code. (do_pushlevel): Likewise. (add_tree): Likewise. (finish_goto_stmt): Likewise. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (finish_if_stmt): Likewise. (clear_out_block): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_switch_cond): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_cleanup_try_block): Likewise. (finish_cleanup): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (begin_catch_block): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_label_decl): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (begin_stmt_expr): Likewise. (finish_stmt_expr): Likewise. * cp/decl.c (initialize_local_var): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. * cp/init.c (begin_init_stmts): Changed calls to begin_stmt_expr and begin_compound_expr to call genrtl_begin_stmt_expr and genrtl_begin_compound_expr when appropriate. (finish_init_stmts): Changed calls to finish_compound_expr and finish_stmt_expr to call genrtl_finish_compound_expr and genrtl_finish_stmt_expr when appropriate. (expand_default_init): Changed call to finish_expr_stmt to call genrtl_expr_stmt when appropriate. (build_vec_init): Likewise. * cp/parse.y (simple_stmt): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. * cp/parse.c: Regenerated. * cp/pt.c (tsubst_expr): Removed first argument from call to finish_for_stmt. Removed first argument from call to finish_switch_stmt. From-SVN: r34597
2000-06-19 20:40:24 +02:00
TREE_CHAIN (last_tree) = NULL_TREE;
cp-tree.def (SUBOBJECT): New tree node. * cp-tree.def (SUBOBJECT): New tree node. * cp-tree.h (CLEANUP_P): New macro. (SUBOBJECT_CLEANUP): Likewise. (keep_next_level): Add parameter. (get_temp_regvar): Don't declare. (emit_base_init): Remove parameter. (expand_aggr_init): Rename to build_aggr_init. (expand_vec_init): Rename to build_vec_init. (do_pushlevel): Remove. (do_poplevel): Likewise. (finish_cleanup): New function. (finish_subobject): Likewise. (stmts_are_full_exprs_p): New variable. * decl.c (keep_next_level): Add parameter. (cp_finish_decl): Use build_aggr_init, not expand_aggr_init. Use finish_expr_stmt to expand the code. (expand_static_init): Use tree-generating, not RTL-generating, functions to handle the initialization. (start_function): Remove dead code. Always have a momentary obstack inside the function, even before hitting the first curly brace. (cplus_expand_expr_stmt): Move calls to expand_{start,end}_target_temps into semantics.c. (cp_function): Add stmts_are_full_exprs_p. (push_cp_function_context): Save it. (pop_cp_function_context): Restore it. * decl2.c (get_temp_regvar): Move to init.c. (do_static_initialization): Use build_{aggr,vec}_init. (do_static_destruction): Fix typo in comment. * dump.c (dequeue_and_dump): Handle INIT_EXPR. * except.c (expand_throw): Use create_temporary_var. * expr.c (cplus_expand_expr): Use build_{aggr,vec}_init. * init.c (expand_vec_init_try_block): Remove. (expand_vec_init_catch_clause): Likewise. (get_temp_regvar): New function. (begin_init_stmts): Likewise. (finish_init_stmts): Likewise. (perform_member_init): Use build_{aggr,vec}_init. Build up tree structure here. (emit_base_init): Likewise. Remove unused parameter. (expand_virtual_init): Likewise. (expand_cleanup_for_base): Use finish_subobject. (expand_aggr_vbase_init_1): Simplify. (construct_virtual_bases): Use tree-generating functions to build up initialization. (expand_aggr_init): Likewise. Rename to build_aggr_init. (expand_default_init): Likewise. (expand_aggr_init_1): Likewise. (expand_vec_init): Rename to build_vec_init. * method.c (do_build_copy_constructor): Use tree-generating functions. Don't call clear_last_expr. (do_build_assign_ref): Likewise. (synthesize_method): Call clear_last_expr here. * parse.y (base_init): Don't call clear_last_expr here. (nodecls): Likewise. * pt.c (tsubst_expr): Handle a TRY_BLOCK with CLEANUP_P set. * semantics.c (do_pushlevel): Move to here. (do_poplevel): Likewise. (stmts_are_full_exprs_p): New variable. (finish_expr_stmt): Handle logic for temoprary cleanup here. (finish_for_stmt): Use finish_expr_stmt. (finish_cleanup): New function. (finish_function_try_block): Fix indentation. (finish_subobject): New function. (setup_vtbl_ptr): Call keep_next_level here. (finish_stmt_expr): Handle a block with no scope inside the statement-expression. (expand_stmt): Handle a TRY_BLOCK with CLEANUP_P set. Handle SUBOBJECT. * tree.c (search_tree): Handle INIT_EXPR. (mapcar): Likewise. * typeck.c (build_modify_expr): Don't build an RTL_EXPR. * typeck2.c (store_init_value): Change expand_aggr_init to build_aggr_init in comment. From-SVN: r28878
1999-08-26 00:07:18 +02:00
cp-tree.def (VEC_INIT_EXPR): Remove. * cp-tree.def (VEC_INIT_EXPR): Remove. * cp-tree.h (struct stmt_tree): New type. (struct saved_scope): Remove firstobj. Add x_saved_tree, x_stmt_tree. (class_cache_firstobj): Remove. (struct language_function): Remove stmts_are_full_exprs_p, x_last_tree, and x_last_expr_type. Add x_stmt_tree. (current_stmt_tree): New macro. (last_tree): Adjust. (last_expr_type): Likewise. (doing_semantic_analysis_p): Simplify. (stmts_are_full_exprs_p): Adjust. (begin_tree): Remove prototype. (end_tree): Likewise. (begin_stmt_tree): Change prototype. (finish_stmt_tree): Likewise. (building_stmt_tree): Simplify. * decl.c (mark_stmt_tree): New function. (mark_saved_scope): Use it. (start_function): Rearrange slightly to call begin_stmt_tree earlier. (save_function_data): Tweak. (finish_function): Adjust call to finish_stmt_tree. (mark_lang_function): Use mark_stmt_tree. * expr.c (cplus_expand_expr): Don't handle VEC_INIT_EXPR. * init.c (build_new_1): Remove creation of VEC_INIT_EXPR. (build_vec_init): Remove creation of stand-in intializer. * pt.c (begin_tree): Remove. (end_tree): Likewise. * semantics.c (SET_LAST_STMT): New macro. Use it throughout. (begin_compound_stmt): Handle a compound-statement outside of a function. (begin_stmt_expr): Handle a statement-expression outsidef of a function. (finish_stmt_expr): Likewise. (begin_class_definition): Don't call begin_tree. (finish_inline_definitions): Don't call end_tree. (begin_stmt_tree): Take a pointer to tree, not a function as input. (finish_stmt_tree): Likewise. * tree.c (search_tree): Don't handle VEC_INIT_EXPR. (mapcar): Likewise. * parse.y (simple_stmt): Don't call finish_stmt unnecessarily. * parse.c: Regenerated. * dump.c (dqueue_and_dump): Dump bitfieldness. From-SVN: r29786
1999-10-03 20:57:37 +02:00
/* If we created a statement-tree for this statement-expression,
remove it now. */
if (! cfun
cp-tree.def (VEC_INIT_EXPR): Remove. * cp-tree.def (VEC_INIT_EXPR): Remove. * cp-tree.h (struct stmt_tree): New type. (struct saved_scope): Remove firstobj. Add x_saved_tree, x_stmt_tree. (class_cache_firstobj): Remove. (struct language_function): Remove stmts_are_full_exprs_p, x_last_tree, and x_last_expr_type. Add x_stmt_tree. (current_stmt_tree): New macro. (last_tree): Adjust. (last_expr_type): Likewise. (doing_semantic_analysis_p): Simplify. (stmts_are_full_exprs_p): Adjust. (begin_tree): Remove prototype. (end_tree): Likewise. (begin_stmt_tree): Change prototype. (finish_stmt_tree): Likewise. (building_stmt_tree): Simplify. * decl.c (mark_stmt_tree): New function. (mark_saved_scope): Use it. (start_function): Rearrange slightly to call begin_stmt_tree earlier. (save_function_data): Tweak. (finish_function): Adjust call to finish_stmt_tree. (mark_lang_function): Use mark_stmt_tree. * expr.c (cplus_expand_expr): Don't handle VEC_INIT_EXPR. * init.c (build_new_1): Remove creation of VEC_INIT_EXPR. (build_vec_init): Remove creation of stand-in intializer. * pt.c (begin_tree): Remove. (end_tree): Likewise. * semantics.c (SET_LAST_STMT): New macro. Use it throughout. (begin_compound_stmt): Handle a compound-statement outside of a function. (begin_stmt_expr): Handle a statement-expression outsidef of a function. (finish_stmt_expr): Likewise. (begin_class_definition): Don't call begin_tree. (finish_inline_definitions): Don't call end_tree. (begin_stmt_tree): Take a pointer to tree, not a function as input. (finish_stmt_tree): Likewise. * tree.c (search_tree): Don't handle VEC_INIT_EXPR. (mapcar): Likewise. * parse.y (simple_stmt): Don't call finish_stmt unnecessarily. * parse.c: Regenerated. * dump.c (dqueue_and_dump): Dump bitfieldness. From-SVN: r29786
1999-10-03 20:57:37 +02:00
&& TREE_CHAIN (scope_chain->x_saved_tree) == NULL_TREE)
finish_stmt_tree (&scope_chain->x_saved_tree);
return result;
}
call.c (build_field_call): Do not look up the field by name. * call.c (build_field_call): Do not look up the field by name. (build_method_call): Simplify. (struct z_candidate): Add access_path and conversion_path. Remove basetype_path. (convert_class_to_reference): Adjust use of add_function_candidate. (add_candidate): Add conversion_path argument. (add_function_candidate): Use it. (add_conv_dndidate): Likewise. (build_builtin_candidate): Likewise. (add_template_candidate_real): Add conversion_path argument. (add_template_conv_candidate): Likewise. (add_template_candidate): Likewise. (build_user_type_conversion_1): Use it. (build_new_function_call): Remove name lookup code. Adjust use of add_template_candidate and add_function_candidate. (build_new_op): Likewise. (convert_like_real): Use build_special_member_call. (build_over_call): Use cand->conversion_path. (build_special_member_call): New method. (build_new_method_call): Remove name lookup code. * cp-tree.def (OFFSET_REF): Update documentation. (TEMPLATE_ID_EXPR): Likewise. * cp-tree.h (BASELINK_ACCESS_BINFO): New macro. (BASELINK_OPTYPE): Likewise. (build_new_method_call): Adjust prototype. (build_special_member_call): New method. (build_baselink): New method. (build_offset_ref_call_from_tree): Likewise. (build_call_from_tree): Likewise. (finish_qualified_call_expr): Remove. (finish_call_expr): Adjust prototype. (build_x_function_call): Remove. * cvt.c (ocp_convert): Use build_special_member_call. * decl2.c (reparse_absdcl_as_expr): Use finish_call_expr. (build_expr_from_tree): Adjust handling for TEMPLATE_ID_EXPR and CALL_EXPR. (build_offset_ref_call_from_tree): New function. (build_call_from_tree): Likewise. * init.c (expand_cleanup): Use build_special_member_call. (expand_default_init): Likewise. (build_member_call): Use finish_call_expr. (build_new_1): Use build_special_member_call. (push_base_cleanups): Likewise. * method.c (do_build_assign_ref): Likewise. * parse.y (template_id): Do not pass a COMPONENT_REF to lookup_template_function. (primary): Use parse_finish_call_epxr, not finish_call_expr. (parse_finish_call_expr): New function. * pt.c (lookup_template_function): Add assertions. * search.c (lookup_base): Allow T to be a binfo. (build_baselink): New function. (lookup_member): Use it. * semantics.c (finish_call_expr): Do not do name lookup. (finish_object_call_expr): Remove #if 0'd code. (finish_qualified_call_expr): Remove. * typeck.c (build_x_function_call): Remove. (build_static_case): Use build_special_member_call. * typeck2.c (build_functional_cast): Likewise. * g++.dg/inherit/operator1.C: New test. * g++.dg/lookup/disamb1.C: Fix typo in comment. * g++.dg/other/error1.C: Change expected error message. * g++.dg/template/conv4.C: Likewise. From-SVN: r55920
2002-08-01 06:46:23 +02:00
/* Generate an expression for `FN (ARGS)'.
If DISALLOW_VIRTUAL is true, the call to FN will be not generated
as a virtual call, even if FN is virtual. (This flag is set when
encountering an expression where the function name is explicitly
qualified. For example a call to `X::f' never generates a virtual
call.)
Returns code for the call. */
tree
call.c (build_field_call): Do not look up the field by name. * call.c (build_field_call): Do not look up the field by name. (build_method_call): Simplify. (struct z_candidate): Add access_path and conversion_path. Remove basetype_path. (convert_class_to_reference): Adjust use of add_function_candidate. (add_candidate): Add conversion_path argument. (add_function_candidate): Use it. (add_conv_dndidate): Likewise. (build_builtin_candidate): Likewise. (add_template_candidate_real): Add conversion_path argument. (add_template_conv_candidate): Likewise. (add_template_candidate): Likewise. (build_user_type_conversion_1): Use it. (build_new_function_call): Remove name lookup code. Adjust use of add_template_candidate and add_function_candidate. (build_new_op): Likewise. (convert_like_real): Use build_special_member_call. (build_over_call): Use cand->conversion_path. (build_special_member_call): New method. (build_new_method_call): Remove name lookup code. * cp-tree.def (OFFSET_REF): Update documentation. (TEMPLATE_ID_EXPR): Likewise. * cp-tree.h (BASELINK_ACCESS_BINFO): New macro. (BASELINK_OPTYPE): Likewise. (build_new_method_call): Adjust prototype. (build_special_member_call): New method. (build_baselink): New method. (build_offset_ref_call_from_tree): Likewise. (build_call_from_tree): Likewise. (finish_qualified_call_expr): Remove. (finish_call_expr): Adjust prototype. (build_x_function_call): Remove. * cvt.c (ocp_convert): Use build_special_member_call. * decl2.c (reparse_absdcl_as_expr): Use finish_call_expr. (build_expr_from_tree): Adjust handling for TEMPLATE_ID_EXPR and CALL_EXPR. (build_offset_ref_call_from_tree): New function. (build_call_from_tree): Likewise. * init.c (expand_cleanup): Use build_special_member_call. (expand_default_init): Likewise. (build_member_call): Use finish_call_expr. (build_new_1): Use build_special_member_call. (push_base_cleanups): Likewise. * method.c (do_build_assign_ref): Likewise. * parse.y (template_id): Do not pass a COMPONENT_REF to lookup_template_function. (primary): Use parse_finish_call_epxr, not finish_call_expr. (parse_finish_call_expr): New function. * pt.c (lookup_template_function): Add assertions. * search.c (lookup_base): Allow T to be a binfo. (build_baselink): New function. (lookup_member): Use it. * semantics.c (finish_call_expr): Do not do name lookup. (finish_object_call_expr): Remove #if 0'd code. (finish_qualified_call_expr): Remove. * typeck.c (build_x_function_call): Remove. (build_static_case): Use build_special_member_call. * typeck2.c (build_functional_cast): Likewise. * g++.dg/inherit/operator1.C: New test. * g++.dg/lookup/disamb1.C: Fix typo in comment. * g++.dg/other/error1.C: Change expected error message. * g++.dg/template/conv4.C: Likewise. From-SVN: r55920
2002-08-01 06:46:23 +02:00
finish_call_expr (tree fn, tree args, bool disallow_virtual)
{
call.c (build_field_call): Do not look up the field by name. * call.c (build_field_call): Do not look up the field by name. (build_method_call): Simplify. (struct z_candidate): Add access_path and conversion_path. Remove basetype_path. (convert_class_to_reference): Adjust use of add_function_candidate. (add_candidate): Add conversion_path argument. (add_function_candidate): Use it. (add_conv_dndidate): Likewise. (build_builtin_candidate): Likewise. (add_template_candidate_real): Add conversion_path argument. (add_template_conv_candidate): Likewise. (add_template_candidate): Likewise. (build_user_type_conversion_1): Use it. (build_new_function_call): Remove name lookup code. Adjust use of add_template_candidate and add_function_candidate. (build_new_op): Likewise. (convert_like_real): Use build_special_member_call. (build_over_call): Use cand->conversion_path. (build_special_member_call): New method. (build_new_method_call): Remove name lookup code. * cp-tree.def (OFFSET_REF): Update documentation. (TEMPLATE_ID_EXPR): Likewise. * cp-tree.h (BASELINK_ACCESS_BINFO): New macro. (BASELINK_OPTYPE): Likewise. (build_new_method_call): Adjust prototype. (build_special_member_call): New method. (build_baselink): New method. (build_offset_ref_call_from_tree): Likewise. (build_call_from_tree): Likewise. (finish_qualified_call_expr): Remove. (finish_call_expr): Adjust prototype. (build_x_function_call): Remove. * cvt.c (ocp_convert): Use build_special_member_call. * decl2.c (reparse_absdcl_as_expr): Use finish_call_expr. (build_expr_from_tree): Adjust handling for TEMPLATE_ID_EXPR and CALL_EXPR. (build_offset_ref_call_from_tree): New function. (build_call_from_tree): Likewise. * init.c (expand_cleanup): Use build_special_member_call. (expand_default_init): Likewise. (build_member_call): Use finish_call_expr. (build_new_1): Use build_special_member_call. (push_base_cleanups): Likewise. * method.c (do_build_assign_ref): Likewise. * parse.y (template_id): Do not pass a COMPONENT_REF to lookup_template_function. (primary): Use parse_finish_call_epxr, not finish_call_expr. (parse_finish_call_expr): New function. * pt.c (lookup_template_function): Add assertions. * search.c (lookup_base): Allow T to be a binfo. (build_baselink): New function. (lookup_member): Use it. * semantics.c (finish_call_expr): Do not do name lookup. (finish_object_call_expr): Remove #if 0'd code. (finish_qualified_call_expr): Remove. * typeck.c (build_x_function_call): Remove. (build_static_case): Use build_special_member_call. * typeck2.c (build_functional_cast): Likewise. * g++.dg/inherit/operator1.C: New test. * g++.dg/lookup/disamb1.C: Fix typo in comment. * g++.dg/other/error1.C: Change expected error message. * g++.dg/template/conv4.C: Likewise. From-SVN: r55920
2002-08-01 06:46:23 +02:00
if (fn == error_mark_node || args == error_mark_node)
return error_mark_node;
if (processing_template_decl)
return build_nt (CALL_EXPR, fn, args, NULL_TREE);
/* ARGS should be a list of arguments. */
my_friendly_assert (!args || TREE_CODE (args) == TREE_LIST,
20020712);
call.c (build_field_call): Do not look up the field by name. * call.c (build_field_call): Do not look up the field by name. (build_method_call): Simplify. (struct z_candidate): Add access_path and conversion_path. Remove basetype_path. (convert_class_to_reference): Adjust use of add_function_candidate. (add_candidate): Add conversion_path argument. (add_function_candidate): Use it. (add_conv_dndidate): Likewise. (build_builtin_candidate): Likewise. (add_template_candidate_real): Add conversion_path argument. (add_template_conv_candidate): Likewise. (add_template_candidate): Likewise. (build_user_type_conversion_1): Use it. (build_new_function_call): Remove name lookup code. Adjust use of add_template_candidate and add_function_candidate. (build_new_op): Likewise. (convert_like_real): Use build_special_member_call. (build_over_call): Use cand->conversion_path. (build_special_member_call): New method. (build_new_method_call): Remove name lookup code. * cp-tree.def (OFFSET_REF): Update documentation. (TEMPLATE_ID_EXPR): Likewise. * cp-tree.h (BASELINK_ACCESS_BINFO): New macro. (BASELINK_OPTYPE): Likewise. (build_new_method_call): Adjust prototype. (build_special_member_call): New method. (build_baselink): New method. (build_offset_ref_call_from_tree): Likewise. (build_call_from_tree): Likewise. (finish_qualified_call_expr): Remove. (finish_call_expr): Adjust prototype. (build_x_function_call): Remove. * cvt.c (ocp_convert): Use build_special_member_call. * decl2.c (reparse_absdcl_as_expr): Use finish_call_expr. (build_expr_from_tree): Adjust handling for TEMPLATE_ID_EXPR and CALL_EXPR. (build_offset_ref_call_from_tree): New function. (build_call_from_tree): Likewise. * init.c (expand_cleanup): Use build_special_member_call. (expand_default_init): Likewise. (build_member_call): Use finish_call_expr. (build_new_1): Use build_special_member_call. (push_base_cleanups): Likewise. * method.c (do_build_assign_ref): Likewise. * parse.y (template_id): Do not pass a COMPONENT_REF to lookup_template_function. (primary): Use parse_finish_call_epxr, not finish_call_expr. (parse_finish_call_expr): New function. * pt.c (lookup_template_function): Add assertions. * search.c (lookup_base): Allow T to be a binfo. (build_baselink): New function. (lookup_member): Use it. * semantics.c (finish_call_expr): Do not do name lookup. (finish_object_call_expr): Remove #if 0'd code. (finish_qualified_call_expr): Remove. * typeck.c (build_x_function_call): Remove. (build_static_case): Use build_special_member_call. * typeck2.c (build_functional_cast): Likewise. * g++.dg/inherit/operator1.C: New test. * g++.dg/lookup/disamb1.C: Fix typo in comment. * g++.dg/other/error1.C: Change expected error message. * g++.dg/template/conv4.C: Likewise. From-SVN: r55920
2002-08-01 06:46:23 +02:00
if (BASELINK_P (fn))
{
call.c (build_field_call): Do not look up the field by name. * call.c (build_field_call): Do not look up the field by name. (build_method_call): Simplify. (struct z_candidate): Add access_path and conversion_path. Remove basetype_path. (convert_class_to_reference): Adjust use of add_function_candidate. (add_candidate): Add conversion_path argument. (add_function_candidate): Use it. (add_conv_dndidate): Likewise. (build_builtin_candidate): Likewise. (add_template_candidate_real): Add conversion_path argument. (add_template_conv_candidate): Likewise. (add_template_candidate): Likewise. (build_user_type_conversion_1): Use it. (build_new_function_call): Remove name lookup code. Adjust use of add_template_candidate and add_function_candidate. (build_new_op): Likewise. (convert_like_real): Use build_special_member_call. (build_over_call): Use cand->conversion_path. (build_special_member_call): New method. (build_new_method_call): Remove name lookup code. * cp-tree.def (OFFSET_REF): Update documentation. (TEMPLATE_ID_EXPR): Likewise. * cp-tree.h (BASELINK_ACCESS_BINFO): New macro. (BASELINK_OPTYPE): Likewise. (build_new_method_call): Adjust prototype. (build_special_member_call): New method. (build_baselink): New method. (build_offset_ref_call_from_tree): Likewise. (build_call_from_tree): Likewise. (finish_qualified_call_expr): Remove. (finish_call_expr): Adjust prototype. (build_x_function_call): Remove. * cvt.c (ocp_convert): Use build_special_member_call. * decl2.c (reparse_absdcl_as_expr): Use finish_call_expr. (build_expr_from_tree): Adjust handling for TEMPLATE_ID_EXPR and CALL_EXPR. (build_offset_ref_call_from_tree): New function. (build_call_from_tree): Likewise. * init.c (expand_cleanup): Use build_special_member_call. (expand_default_init): Likewise. (build_member_call): Use finish_call_expr. (build_new_1): Use build_special_member_call. (push_base_cleanups): Likewise. * method.c (do_build_assign_ref): Likewise. * parse.y (template_id): Do not pass a COMPONENT_REF to lookup_template_function. (primary): Use parse_finish_call_epxr, not finish_call_expr. (parse_finish_call_expr): New function. * pt.c (lookup_template_function): Add assertions. * search.c (lookup_base): Allow T to be a binfo. (build_baselink): New function. (lookup_member): Use it. * semantics.c (finish_call_expr): Do not do name lookup. (finish_object_call_expr): Remove #if 0'd code. (finish_qualified_call_expr): Remove. * typeck.c (build_x_function_call): Remove. (build_static_case): Use build_special_member_call. * typeck2.c (build_functional_cast): Likewise. * g++.dg/inherit/operator1.C: New test. * g++.dg/lookup/disamb1.C: Fix typo in comment. * g++.dg/other/error1.C: Change expected error message. * g++.dg/template/conv4.C: Likewise. From-SVN: r55920
2002-08-01 06:46:23 +02:00
tree object;
/* A call to a member function. From [over.call.func]:
If the keyword this is in scope and refers to the class of
that member function, or a derived class thereof, then the
function call is transformed into a qualified function call
using (*this) as the postfix-expression to the left of the
. operator.... [Otherwise] a contrived object of type T
becomes the implied object argument.
This paragraph is unclear about this situation:
struct A { void f(); };
struct B : public A {};
struct C : public A { void g() { B::f(); }};
In particular, for `B::f', this paragraph does not make clear
whether "the class of that member function" refers to `A' or
to `B'. We believe it refers to `B'. */
if (current_class_type
&& DERIVED_FROM_P (BINFO_TYPE (BASELINK_ACCESS_BINFO (fn)),
current_class_type)
&& current_class_ref)
object = current_class_ref;
else
{
tree representative_fn;
call.c (build_field_call): Do not look up the field by name. * call.c (build_field_call): Do not look up the field by name. (build_method_call): Simplify. (struct z_candidate): Add access_path and conversion_path. Remove basetype_path. (convert_class_to_reference): Adjust use of add_function_candidate. (add_candidate): Add conversion_path argument. (add_function_candidate): Use it. (add_conv_dndidate): Likewise. (build_builtin_candidate): Likewise. (add_template_candidate_real): Add conversion_path argument. (add_template_conv_candidate): Likewise. (add_template_candidate): Likewise. (build_user_type_conversion_1): Use it. (build_new_function_call): Remove name lookup code. Adjust use of add_template_candidate and add_function_candidate. (build_new_op): Likewise. (convert_like_real): Use build_special_member_call. (build_over_call): Use cand->conversion_path. (build_special_member_call): New method. (build_new_method_call): Remove name lookup code. * cp-tree.def (OFFSET_REF): Update documentation. (TEMPLATE_ID_EXPR): Likewise. * cp-tree.h (BASELINK_ACCESS_BINFO): New macro. (BASELINK_OPTYPE): Likewise. (build_new_method_call): Adjust prototype. (build_special_member_call): New method. (build_baselink): New method. (build_offset_ref_call_from_tree): Likewise. (build_call_from_tree): Likewise. (finish_qualified_call_expr): Remove. (finish_call_expr): Adjust prototype. (build_x_function_call): Remove. * cvt.c (ocp_convert): Use build_special_member_call. * decl2.c (reparse_absdcl_as_expr): Use finish_call_expr. (build_expr_from_tree): Adjust handling for TEMPLATE_ID_EXPR and CALL_EXPR. (build_offset_ref_call_from_tree): New function. (build_call_from_tree): Likewise. * init.c (expand_cleanup): Use build_special_member_call. (expand_default_init): Likewise. (build_member_call): Use finish_call_expr. (build_new_1): Use build_special_member_call. (push_base_cleanups): Likewise. * method.c (do_build_assign_ref): Likewise. * parse.y (template_id): Do not pass a COMPONENT_REF to lookup_template_function. (primary): Use parse_finish_call_epxr, not finish_call_expr. (parse_finish_call_expr): New function. * pt.c (lookup_template_function): Add assertions. * search.c (lookup_base): Allow T to be a binfo. (build_baselink): New function. (lookup_member): Use it. * semantics.c (finish_call_expr): Do not do name lookup. (finish_object_call_expr): Remove #if 0'd code. (finish_qualified_call_expr): Remove. * typeck.c (build_x_function_call): Remove. (build_static_case): Use build_special_member_call. * typeck2.c (build_functional_cast): Likewise. * g++.dg/inherit/operator1.C: New test. * g++.dg/lookup/disamb1.C: Fix typo in comment. * g++.dg/other/error1.C: Change expected error message. * g++.dg/template/conv4.C: Likewise. From-SVN: r55920
2002-08-01 06:46:23 +02:00
representative_fn = BASELINK_FUNCTIONS (fn);
if (TREE_CODE (representative_fn) == TEMPLATE_ID_EXPR)
representative_fn = TREE_OPERAND (representative_fn, 0);
representative_fn = get_first_fn (representative_fn);
object = build_dummy_object (DECL_CONTEXT (representative_fn));
}
call.c (build_field_call): Do not look up the field by name. * call.c (build_field_call): Do not look up the field by name. (build_method_call): Simplify. (struct z_candidate): Add access_path and conversion_path. Remove basetype_path. (convert_class_to_reference): Adjust use of add_function_candidate. (add_candidate): Add conversion_path argument. (add_function_candidate): Use it. (add_conv_dndidate): Likewise. (build_builtin_candidate): Likewise. (add_template_candidate_real): Add conversion_path argument. (add_template_conv_candidate): Likewise. (add_template_candidate): Likewise. (build_user_type_conversion_1): Use it. (build_new_function_call): Remove name lookup code. Adjust use of add_template_candidate and add_function_candidate. (build_new_op): Likewise. (convert_like_real): Use build_special_member_call. (build_over_call): Use cand->conversion_path. (build_special_member_call): New method. (build_new_method_call): Remove name lookup code. * cp-tree.def (OFFSET_REF): Update documentation. (TEMPLATE_ID_EXPR): Likewise. * cp-tree.h (BASELINK_ACCESS_BINFO): New macro. (BASELINK_OPTYPE): Likewise. (build_new_method_call): Adjust prototype. (build_special_member_call): New method. (build_baselink): New method. (build_offset_ref_call_from_tree): Likewise. (build_call_from_tree): Likewise. (finish_qualified_call_expr): Remove. (finish_call_expr): Adjust prototype. (build_x_function_call): Remove. * cvt.c (ocp_convert): Use build_special_member_call. * decl2.c (reparse_absdcl_as_expr): Use finish_call_expr. (build_expr_from_tree): Adjust handling for TEMPLATE_ID_EXPR and CALL_EXPR. (build_offset_ref_call_from_tree): New function. (build_call_from_tree): Likewise. * init.c (expand_cleanup): Use build_special_member_call. (expand_default_init): Likewise. (build_member_call): Use finish_call_expr. (build_new_1): Use build_special_member_call. (push_base_cleanups): Likewise. * method.c (do_build_assign_ref): Likewise. * parse.y (template_id): Do not pass a COMPONENT_REF to lookup_template_function. (primary): Use parse_finish_call_epxr, not finish_call_expr. (parse_finish_call_expr): New function. * pt.c (lookup_template_function): Add assertions. * search.c (lookup_base): Allow T to be a binfo. (build_baselink): New function. (lookup_member): Use it. * semantics.c (finish_call_expr): Do not do name lookup. (finish_object_call_expr): Remove #if 0'd code. (finish_qualified_call_expr): Remove. * typeck.c (build_x_function_call): Remove. (build_static_case): Use build_special_member_call. * typeck2.c (build_functional_cast): Likewise. * g++.dg/inherit/operator1.C: New test. * g++.dg/lookup/disamb1.C: Fix typo in comment. * g++.dg/other/error1.C: Change expected error message. * g++.dg/template/conv4.C: Likewise. From-SVN: r55920
2002-08-01 06:46:23 +02:00
return build_new_method_call (object, fn, args, NULL_TREE,
(disallow_virtual
? LOOKUP_NONVIRTUAL : 0));
}
else if (is_overloaded_fn (fn))
/* A call to a namespace-scope function. */
return build_new_function_call (fn, args);
else if (CLASS_TYPE_P (TREE_TYPE (fn)))
{
/* If the "function" is really an object of class type, it might
have an overloaded `operator ()'. */
tree result;
result = build_opfncall (CALL_EXPR, LOOKUP_NORMAL, fn, args, NULL_TREE);
if (result)
return result;
}
/* A call where the function is unknown. */
return build_function_call (fn, args);
}
/* Finish a call to a postfix increment or decrement or EXPR. (Which
is indicated by CODE, which should be POSTINCREMENT_EXPR or
POSTDECREMENT_EXPR.) */
tree
finish_increment_expr (expr, code)
tree expr;
enum tree_code code;
{
/* If we get an OFFSET_REF, turn it into what it really means (e.g.,
a COMPONENT_REF). This way if we've got, say, a reference to a
static member that's being operated on, we don't end up trying to
find a member operator for the class it's in. */
if (TREE_CODE (expr) == OFFSET_REF)
expr = resolve_offset_ref (expr);
return build_x_unary_op (code, expr);
}
/* Finish a use of `this'. Returns an expression for `this'. */
tree
finish_this_expr ()
{
tree result;
if (current_class_ptr)
{
result = current_class_ptr;
}
else if (current_function_decl
&& DECL_STATIC_FUNCTION_P (current_function_decl))
{
error ("`this' is unavailable for static member functions");
result = error_mark_node;
}
else
{
if (current_function_decl)
error ("invalid use of `this' in non-member function");
else
error ("invalid use of `this' at top level");
result = error_mark_node;
}
return result;
}
/* Finish a member function call using OBJECT and ARGS as arguments to
FN. Returns an expression for the call. */
tree
finish_object_call_expr (fn, object, args)
tree fn;
tree object;
tree args;
{
if (DECL_DECLARES_TYPE_P (fn))
{
if (processing_template_decl)
/* This can happen on code like:
class X;
template <class T> void f(T t) {
t.X();
}
We just grab the underlying IDENTIFIER. */
fn = DECL_NAME (fn);
else
{
error ("calling type `%T' like a method", fn);
return error_mark_node;
}
}
call.c (build_field_call): Do not look up the field by name. * call.c (build_field_call): Do not look up the field by name. (build_method_call): Simplify. (struct z_candidate): Add access_path and conversion_path. Remove basetype_path. (convert_class_to_reference): Adjust use of add_function_candidate. (add_candidate): Add conversion_path argument. (add_function_candidate): Use it. (add_conv_dndidate): Likewise. (build_builtin_candidate): Likewise. (add_template_candidate_real): Add conversion_path argument. (add_template_conv_candidate): Likewise. (add_template_candidate): Likewise. (build_user_type_conversion_1): Use it. (build_new_function_call): Remove name lookup code. Adjust use of add_template_candidate and add_function_candidate. (build_new_op): Likewise. (convert_like_real): Use build_special_member_call. (build_over_call): Use cand->conversion_path. (build_special_member_call): New method. (build_new_method_call): Remove name lookup code. * cp-tree.def (OFFSET_REF): Update documentation. (TEMPLATE_ID_EXPR): Likewise. * cp-tree.h (BASELINK_ACCESS_BINFO): New macro. (BASELINK_OPTYPE): Likewise. (build_new_method_call): Adjust prototype. (build_special_member_call): New method. (build_baselink): New method. (build_offset_ref_call_from_tree): Likewise. (build_call_from_tree): Likewise. (finish_qualified_call_expr): Remove. (finish_call_expr): Adjust prototype. (build_x_function_call): Remove. * cvt.c (ocp_convert): Use build_special_member_call. * decl2.c (reparse_absdcl_as_expr): Use finish_call_expr. (build_expr_from_tree): Adjust handling for TEMPLATE_ID_EXPR and CALL_EXPR. (build_offset_ref_call_from_tree): New function. (build_call_from_tree): Likewise. * init.c (expand_cleanup): Use build_special_member_call. (expand_default_init): Likewise. (build_member_call): Use finish_call_expr. (build_new_1): Use build_special_member_call. (push_base_cleanups): Likewise. * method.c (do_build_assign_ref): Likewise. * parse.y (template_id): Do not pass a COMPONENT_REF to lookup_template_function. (primary): Use parse_finish_call_epxr, not finish_call_expr. (parse_finish_call_expr): New function. * pt.c (lookup_template_function): Add assertions. * search.c (lookup_base): Allow T to be a binfo. (build_baselink): New function. (lookup_member): Use it. * semantics.c (finish_call_expr): Do not do name lookup. (finish_object_call_expr): Remove #if 0'd code. (finish_qualified_call_expr): Remove. * typeck.c (build_x_function_call): Remove. (build_static_case): Use build_special_member_call. * typeck2.c (build_functional_cast): Likewise. * g++.dg/inherit/operator1.C: New test. * g++.dg/lookup/disamb1.C: Fix typo in comment. * g++.dg/other/error1.C: Change expected error message. * g++.dg/template/conv4.C: Likewise. From-SVN: r55920
2002-08-01 06:46:23 +02:00
Rework build_component_ref. * call.c (build_vfield_ref): Do not go through build_component_ref. (build_field_call): Use build_class_member_access_expr. (build_user_type_conversion_1): Use BASELINK_FUNCTIONS. (build_object_call): Likewise. * class.c (convert_to_base): New function. (type_requires_array_cookie): Use BASELINK_FUNCTIONS. (instantiate_type): Handle BASELINKs. * cp-tree.def (BASELINK): New tree code. * cp-tree.h (BASELINK_P): Reimplement. (SET_BASELINK_P): Remove. (BASELINK_BINFO): Reimplement. (BASELINK_FUNCTIONS): Likewise. (BASELINK_ACCESS_BINFO): Likewise. (BASELINK_OPTYPE): Likewise. (convert_to_base): New function. (name_p): Likewise. (build_object_ref): Remove. (build_component_ref_1): Likewise. (build_component_ref): Likewise. (build_x_component_ref): Likewise. (build_class_member_access_expr): New function. (finish_class_member_access_expr): Likewise. (build_ptrmemfunc_access_expr): Likewise. * decl.c (grokdeclarator): Handle BASELINKs. * decl2. (build_expr_from_tree): Handle COMPONENT_REFs by using finish_class_member_access_expr. (arg_assoc): Handle BASELINKs. (do_class_using_decl): Likewise. * error.c (dump_decl): Likewise. (dump_expr): Use build_ptrmemfunc_access_expr. * except.c (dtor_nothrow): Use CLASSTYPE_DESTRUCTORS to find destructors. (build_throw): Use BASELINK_FUNCTIONS. * init.c (perform_member_init): Use build_class_member_access_expr. (build_offset_ref): Handle BASELINKs. Use build_class_member_access_expr. * method.c (hack_identifier): Likewise. * parse.y (do_id): Use BASELINK, not TREE_LIST. (primary): Remove uses of build_object_ref. * pt.c (lookup_template_function): Handle BASELINKs. (resolve_overloaded_unification): Likewise. * search.c (build_baselink): Build a BASELINK, not a TREE_LIST. (lookup_field): Use BASELINK, not TREE_LIST. (lookup_fnfiels): Likewise. (setup_class_bindings): Likewise. * semantics.c (finish_object_call_expr): Do not use build_method_call when we already know what function is being called. * spew.c (identifier_type): Use BASELINK, not TREE_LIST. * tree.c (really_overloaded_fn): Use OVL_CHAIN for OVERLOADs, not TREE_CHAIN. (name_p): New function. * typeck.c (build_object_ref): Remove. (build_component_ref_1): Likewise. (build_x_component_ref): Likewise. (build_class_member_access_expr): New function. (finish_class_member_access_expr): Likewise. (build_ptrmemfunc_access_expr): Likewise. (get_member_function_from_ptrfunc): Use build_ptrmemfunc_access_expr. (build_binary_op): Likewise. (build_unary_op): Likewise. (build_ptrmemfunc): Likewise. (pfn_from_ptrmemfunc): Likewise. * typeck2.c (build_m_component_ref): Adjust comment. * g++.dg/abi/offsetof.C: Tweak error messages. * g++.old-deja/g++.mike/p10769a.C: Likewise. From-SVN: r56117
2002-08-08 07:48:39 +02:00
if (name_p (fn))
return build_method_call (object, fn, args, NULL_TREE, LOOKUP_NORMAL);
else
return build_new_method_call (object, fn, args, NULL_TREE, LOOKUP_NORMAL);
}
/* Finish a qualified member function call using OBJECT and ARGS as
arguments to FN. Returns an expression for the call. */
tree
finish_qualified_object_call_expr (fn, object, args)
tree fn;
tree object;
tree args;
{
extend.texi (C++ Signatures): Remove node. * extend.texi (C++ Signatures): Remove node. * invoke.texi: Remove discussion of -fhandle-signatures, signature, sigof, __signature__, and __sigof__. * Make-lang.in (CXX_SRCS): Remove sig.c. * Makefile.in (CXX_OBJS): Remove sig.o. (sig.o): Remove. * cp-tree.h (CPTI_OPAQUE_TYPE): Remove. (CPTI_SIGNATURE_TYPE): Likewise. (CPTI_SIGTABLE_ENTRY_TYPE): Likewise. (opaque_type_node): Likewise. (signature_type_node): Likewise. (sigtable_entry_type): Likewise. (flag_handle_signatures): Likewise. (lang_type): Remove is_signature, is_signature_pointer, is_signature_reference, has_opaque_typedecls, sigtables_has_been_generated. Adjust dummy. Remove signature, signature_pointer_to, signature_reference_to. (IS_SIGNATURE): Remove. (SET_SIGNATURE): Remove. (CLEAR_SIGNATURE): Remove. (IS_SIGNATURE_POINTER): Remove. (IS_SIGNATURE_REFERENCE): Remove. (SIGNATURE_HAS_OPAQUE_TYPEDECLS): Remove. (SIGTABLE_HAS_BEEN_GENERATED): Remove. (CLASSTYPE_SIGNATURE): Remove. (SIGNATURE_TYPE): Remove. (SIGNATURE_METHOD_VEC): Remove. (SIGNATURE_POINTER_TO): Remove. (SIGNATURE_REFERENCE_TO): Remove. (lang_decl_flags): Remove is_default_implementation. Rename memfunc_pointer_to to saved_tree. (IS_DEFAULT_IMPLEMENTATION): Remove. (DECL_MEMFUNC_POINTER_TO): Remove. (DECL_MEMFUNC_POINTING_TO): Remove. (DECL_SAVED_TREE): Adjust definition. (tag_types): Remove signature_type_node. (SIGNATURE_FIELD_NAME): Remove. (SIGNATURE_FIELD_NAME_FORMAT): Likewise. (SIGNATURE_OPTR_NAME): Likewise. (SIGNATURE_SPTR_NAME): Likewise. (SIGNATURE_POINTER_NAME): Likewise. (SIGNATURE_POINTER_NAME_FORMAT): Likewise. (SIGNATURE_REFERENCE_NAME): Likewise. (SIGNATURE_REFERNECE_NAME_FORMAT): Likewise. (SIGTABLE_PTR_TYPE): Likewise. (SIGTABLE_NAME_FORMAT): Likewise. (SIGTABLE_NAME_FORMAT_LONG): Likewise. (SIGTABLE_TAG_NAME): Likewise. (SIGTABLE_VB_OFF_NAME): Likewise. (SIGTABLE_VT_OFF_NAME): Likewise. (finish_base_specifiers): Change prototype. (build_signature_pointer_type): Remove. (build_signature_reference_type): Remove. (build_signature_pointer_constructor): Remove. (build_signature_method_call): Remove. (build_optr_ref): Likewise. (append_signature_fields): Likewise. (signature_error): Likewise. * call.c (build_this): Remove signature support. (build_over_call): Likewise. (build_new_method_call): Likewise. * class.c (add_implicitly_declared_members): Likewise. (finish_struct_1): Likewise. (finish_struct): Likewise. * cvt.c (cp_convert_to_pointer): Likewise. (convert_to_pointer_force): Likewise. (ocp_convert): Likewise. * decl.c (sigtable_decl_p): Remove. (init_decl_processing): Remove support for signatures. (cp_finish_decl): Likewise. (grokdeclarator): Likewise. (grokparms): Likewise. (xref_tag): Likewise. (start_function): Likewise. (start_method): Likewise. * decl2.c (finish_sigtable_vardecl): Remove. (flag_handle_signatures): Remove. (lang_f_options): Remove handle-signatures. (grokfield): Remove support for signatures. (grokbitfield): Likewise. (finish_file): Likewise. (reparse_absdcl_as_casts): Likewise. * error.c (dump_type_real): Likewise. (dump_function_decl): Likewise. * friend.c (make_friend_class): Likewise. * gxx.gperf: Remove __signature__, signature, __sigof__, sigof. * hash.h: Regenerated. * init.c (build_new_1): Remove support for signatures. * lang-options.h: Remove -fhandle-signatures, -fno-handle-signatures. * lex.c (init_parse): Remove support for signatures. (yyprint): Likewise. * lex.h (rid): Remove RID_SIGNATURE. * method.c (build_decl_overload_real): Remove support for signatures. (hack_identifier): Likewise. * parse.y (base_class): Likewise. (base_class.1): Likewise. (access_specifier): Likewise. * search.c (lookup_member): Likewise. * semantics.c (finish_qualified_object_call_expr): Likewise. (finish_template_type_parm): Likewise. (begin_class_definition): Likewise. (finish_base_specifier): Likewise. * sig.c: Remove. * tree.c (build_cplus_method_type): Remove support for signatures. * typeck.c (require_complete_type): Likewise. (c_sizeof): Likewise. (c_alignof): Likewise. (build_object_ref): Likewise. (build_component_ref): Likewise. (build_indirect_ref): Likewise. (build_c_cast): Likewise. (build_modify_expr): Likewise. (convert_for_initialization): Likewise. * typeck2.c (signature_error): Remove. (store_init_value): Remove support for signatures. (digest_init): Likewise. (build_x_arrow): Likewise. (build_functional_cast): Likewise. * xref.c (GNU_xref_decl): Likewise. From-SVN: r28677
1999-08-11 22:22:41 +02:00
return build_scoped_method_call (object, TREE_OPERAND (fn, 0),
TREE_OPERAND (fn, 1), args);
}
/* Finish a pseudo-destructor call expression of OBJECT, with SCOPE
being the scope, if any, of DESTRUCTOR. Returns an expression for
the call. */
tree
finish_pseudo_destructor_call_expr (object, scope, destructor)
tree object;
tree scope;
tree destructor;
{
if (processing_template_decl)
return build_min_nt (PSEUDO_DTOR_EXPR, object, scope, destructor);
if (scope && scope != destructor)
error ("destructor specifier `%T::~%T()' must have matching names",
scope, destructor);
if ((scope == NULL_TREE || IDENTIFIER_GLOBAL_VALUE (destructor))
&& (TREE_CODE (TREE_TYPE (object)) !=
TREE_CODE (TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (destructor)))))
error ("`%E' is not of type `%T'", object, destructor);
return cp_convert (void_type_node, object);
}
/* Finish an expression of the form CODE EXPR. */
tree
finish_unary_op_expr (code, expr)
enum tree_code code;
tree expr;
{
tree result = build_x_unary_op (code, expr);
/* Inside a template, build_x_unary_op does not fold the
expression. So check whether the result is folded before
setting TREE_NEGATED_INT. */
if (code == NEGATE_EXPR && TREE_CODE (expr) == INTEGER_CST
&& TREE_CODE (result) == INTEGER_CST
&& !TREE_UNSIGNED (TREE_TYPE (result))
&& INT_CST_LT (result, integer_zero_node))
TREE_NEGATED_INT (result) = 1;
overflow_warning (result);
return result;
}
/* Finish an id-expression. */
tree
finish_id_expr (expr)
tree expr;
{
if (TREE_CODE (expr) == IDENTIFIER_NODE)
expr = do_identifier (expr, 1, NULL_TREE);
if (TREE_TYPE (expr) == error_mark_node)
expr = error_mark_node;
return expr;
}
/* Return the declaration for the function-name variable indicated by
ID. */
tree
finish_fname (tree id)
{
tree decl;
decl = fname_decl (C_RID_CODE (id), id);
if (processing_template_decl)
decl = build_min_nt (LOOKUP_EXPR, DECL_NAME (decl));
return decl;
}
cp-tree.h (struct saved_scope): Add incomplete field. * cp-tree.h (struct saved_scope): Add incomplete field. (namespace_scope_incomplete): New macro. * decl.c (pushdecl): Use it. (hack_incomplete_structures): Use it. See through artificial binding levels. (mark_saved_scope): Mark it. Implement access control for nested types. * search.c (type_access_control): New fn. (accessible_p): Now we do perform access control for types. * semantics.c (deferred_type_access_control): New fn. (initial_deferred_type_access_control): New fn. (begin_function_definition): Call it. Add lookups parm. * decl.c (struct binding_level): Add this_class field. (pushlevel_class): Set it. (mark_binding_level): Mark it. (lookup_name_real): Use it. Call type_access_control. (mark_saved_scope): Mark lookups field. * cp-tree.h (flagged_type_tree): Add lookups field. (struct saved_scope): Add lookups field. (type_lookups): New macro. * parse.y (declmods): Now <ftype>. (parse_decl): Add lookups parm. Call initial_deferred_type_access_control. (lang_extdef): Clear type_lookups. (typed_declspecs, declmods, typespec): Set lookups field. (initdcl): Call deferred_type_access_control. (fn.def1, fn.def2, typed_declspecs1, initdcl0_innards, nomods_initdcl0, component_decl_1, named_parm): Adjust. * friend.c (is_friend): Nested classes are friends of their enclosing classes. * class.c (currently_open_derived_class): New fn. * method.c (hack_identifier): Use it. * lex.c (do_identifier): Remove obsolete code. * parse.y (typed_typespecs): Propagate new_type_flag properly. From-SVN: r31837
2000-02-07 21:36:36 +01:00
static tree current_type_lookups;
/* Perform deferred access control for types used in the type of a
declaration. */
static void
cp-tree.h (struct saved_scope): Add incomplete field. * cp-tree.h (struct saved_scope): Add incomplete field. (namespace_scope_incomplete): New macro. * decl.c (pushdecl): Use it. (hack_incomplete_structures): Use it. See through artificial binding levels. (mark_saved_scope): Mark it. Implement access control for nested types. * search.c (type_access_control): New fn. (accessible_p): Now we do perform access control for types. * semantics.c (deferred_type_access_control): New fn. (initial_deferred_type_access_control): New fn. (begin_function_definition): Call it. Add lookups parm. * decl.c (struct binding_level): Add this_class field. (pushlevel_class): Set it. (mark_binding_level): Mark it. (lookup_name_real): Use it. Call type_access_control. (mark_saved_scope): Mark lookups field. * cp-tree.h (flagged_type_tree): Add lookups field. (struct saved_scope): Add lookups field. (type_lookups): New macro. * parse.y (declmods): Now <ftype>. (parse_decl): Add lookups parm. Call initial_deferred_type_access_control. (lang_extdef): Clear type_lookups. (typed_declspecs, declmods, typespec): Set lookups field. (initdcl): Call deferred_type_access_control. (fn.def1, fn.def2, typed_declspecs1, initdcl0_innards, nomods_initdcl0, component_decl_1, named_parm): Adjust. * friend.c (is_friend): Nested classes are friends of their enclosing classes. * class.c (currently_open_derived_class): New fn. * method.c (hack_identifier): Use it. * lex.c (do_identifier): Remove obsolete code. * parse.y (typed_typespecs): Propagate new_type_flag properly. From-SVN: r31837
2000-02-07 21:36:36 +01:00
deferred_type_access_control ()
{
tree lookup = type_lookups;
cp-tree.h (struct saved_scope): Add incomplete field. * cp-tree.h (struct saved_scope): Add incomplete field. (namespace_scope_incomplete): New macro. * decl.c (pushdecl): Use it. (hack_incomplete_structures): Use it. See through artificial binding levels. (mark_saved_scope): Mark it. Implement access control for nested types. * search.c (type_access_control): New fn. (accessible_p): Now we do perform access control for types. * semantics.c (deferred_type_access_control): New fn. (initial_deferred_type_access_control): New fn. (begin_function_definition): Call it. Add lookups parm. * decl.c (struct binding_level): Add this_class field. (pushlevel_class): Set it. (mark_binding_level): Mark it. (lookup_name_real): Use it. Call type_access_control. (mark_saved_scope): Mark lookups field. * cp-tree.h (flagged_type_tree): Add lookups field. (struct saved_scope): Add lookups field. (type_lookups): New macro. * parse.y (declmods): Now <ftype>. (parse_decl): Add lookups parm. Call initial_deferred_type_access_control. (lang_extdef): Clear type_lookups. (typed_declspecs, declmods, typespec): Set lookups field. (initdcl): Call deferred_type_access_control. (fn.def1, fn.def2, typed_declspecs1, initdcl0_innards, nomods_initdcl0, component_decl_1, named_parm): Adjust. * friend.c (is_friend): Nested classes are friends of their enclosing classes. * class.c (currently_open_derived_class): New fn. * method.c (hack_identifier): Use it. * lex.c (do_identifier): Remove obsolete code. * parse.y (typed_typespecs): Propagate new_type_flag properly. From-SVN: r31837
2000-02-07 21:36:36 +01:00
if (lookup == error_mark_node)
return;
for (; lookup; lookup = TREE_CHAIN (lookup))
enforce_access (TREE_PURPOSE (lookup), TREE_VALUE (lookup));
}
void
decl_type_access_control (decl)
tree decl;
cp-tree.h (struct saved_scope): Add incomplete field. * cp-tree.h (struct saved_scope): Add incomplete field. (namespace_scope_incomplete): New macro. * decl.c (pushdecl): Use it. (hack_incomplete_structures): Use it. See through artificial binding levels. (mark_saved_scope): Mark it. Implement access control for nested types. * search.c (type_access_control): New fn. (accessible_p): Now we do perform access control for types. * semantics.c (deferred_type_access_control): New fn. (initial_deferred_type_access_control): New fn. (begin_function_definition): Call it. Add lookups parm. * decl.c (struct binding_level): Add this_class field. (pushlevel_class): Set it. (mark_binding_level): Mark it. (lookup_name_real): Use it. Call type_access_control. (mark_saved_scope): Mark lookups field. * cp-tree.h (flagged_type_tree): Add lookups field. (struct saved_scope): Add lookups field. (type_lookups): New macro. * parse.y (declmods): Now <ftype>. (parse_decl): Add lookups parm. Call initial_deferred_type_access_control. (lang_extdef): Clear type_lookups. (typed_declspecs, declmods, typespec): Set lookups field. (initdcl): Call deferred_type_access_control. (fn.def1, fn.def2, typed_declspecs1, initdcl0_innards, nomods_initdcl0, component_decl_1, named_parm): Adjust. * friend.c (is_friend): Nested classes are friends of their enclosing classes. * class.c (currently_open_derived_class): New fn. * method.c (hack_identifier): Use it. * lex.c (do_identifier): Remove obsolete code. * parse.y (typed_typespecs): Propagate new_type_flag properly. From-SVN: r31837
2000-02-07 21:36:36 +01:00
{
tree save_fn;
cp-tree.h (struct saved_scope): Add incomplete field. * cp-tree.h (struct saved_scope): Add incomplete field. (namespace_scope_incomplete): New macro. * decl.c (pushdecl): Use it. (hack_incomplete_structures): Use it. See through artificial binding levels. (mark_saved_scope): Mark it. Implement access control for nested types. * search.c (type_access_control): New fn. (accessible_p): Now we do perform access control for types. * semantics.c (deferred_type_access_control): New fn. (initial_deferred_type_access_control): New fn. (begin_function_definition): Call it. Add lookups parm. * decl.c (struct binding_level): Add this_class field. (pushlevel_class): Set it. (mark_binding_level): Mark it. (lookup_name_real): Use it. Call type_access_control. (mark_saved_scope): Mark lookups field. * cp-tree.h (flagged_type_tree): Add lookups field. (struct saved_scope): Add lookups field. (type_lookups): New macro. * parse.y (declmods): Now <ftype>. (parse_decl): Add lookups parm. Call initial_deferred_type_access_control. (lang_extdef): Clear type_lookups. (typed_declspecs, declmods, typespec): Set lookups field. (initdcl): Call deferred_type_access_control. (fn.def1, fn.def2, typed_declspecs1, initdcl0_innards, nomods_initdcl0, component_decl_1, named_parm): Adjust. * friend.c (is_friend): Nested classes are friends of their enclosing classes. * class.c (currently_open_derived_class): New fn. * method.c (hack_identifier): Use it. * lex.c (do_identifier): Remove obsolete code. * parse.y (typed_typespecs): Propagate new_type_flag properly. From-SVN: r31837
2000-02-07 21:36:36 +01:00
if (type_lookups == error_mark_node)
return;
save_fn = current_function_decl;
if (decl && TREE_CODE (decl) == FUNCTION_DECL)
current_function_decl = decl;
cp-tree.h (struct saved_scope): Add incomplete field. * cp-tree.h (struct saved_scope): Add incomplete field. (namespace_scope_incomplete): New macro. * decl.c (pushdecl): Use it. (hack_incomplete_structures): Use it. See through artificial binding levels. (mark_saved_scope): Mark it. Implement access control for nested types. * search.c (type_access_control): New fn. (accessible_p): Now we do perform access control for types. * semantics.c (deferred_type_access_control): New fn. (initial_deferred_type_access_control): New fn. (begin_function_definition): Call it. Add lookups parm. * decl.c (struct binding_level): Add this_class field. (pushlevel_class): Set it. (mark_binding_level): Mark it. (lookup_name_real): Use it. Call type_access_control. (mark_saved_scope): Mark lookups field. * cp-tree.h (flagged_type_tree): Add lookups field. (struct saved_scope): Add lookups field. (type_lookups): New macro. * parse.y (declmods): Now <ftype>. (parse_decl): Add lookups parm. Call initial_deferred_type_access_control. (lang_extdef): Clear type_lookups. (typed_declspecs, declmods, typespec): Set lookups field. (initdcl): Call deferred_type_access_control. (fn.def1, fn.def2, typed_declspecs1, initdcl0_innards, nomods_initdcl0, component_decl_1, named_parm): Adjust. * friend.c (is_friend): Nested classes are friends of their enclosing classes. * class.c (currently_open_derived_class): New fn. * method.c (hack_identifier): Use it. * lex.c (do_identifier): Remove obsolete code. * parse.y (typed_typespecs): Propagate new_type_flag properly. From-SVN: r31837
2000-02-07 21:36:36 +01:00
deferred_type_access_control ();
current_function_decl = save_fn;
/* Now strip away the checks for the current declarator; they were
added to type_lookups after typed_declspecs saved the copy that
ended up in current_type_lookups. */
type_lookups = current_type_lookups;
}
void
save_type_access_control (lookups)
tree lookups;
{
current_type_lookups = lookups;
}
/* Reset the deferred access control. */
void
reset_type_access_control ()
{
type_lookups = NULL_TREE;
current_type_lookups = NULL_TREE;
}
cp-tree.h (struct saved_scope): Add incomplete field. * cp-tree.h (struct saved_scope): Add incomplete field. (namespace_scope_incomplete): New macro. * decl.c (pushdecl): Use it. (hack_incomplete_structures): Use it. See through artificial binding levels. (mark_saved_scope): Mark it. Implement access control for nested types. * search.c (type_access_control): New fn. (accessible_p): Now we do perform access control for types. * semantics.c (deferred_type_access_control): New fn. (initial_deferred_type_access_control): New fn. (begin_function_definition): Call it. Add lookups parm. * decl.c (struct binding_level): Add this_class field. (pushlevel_class): Set it. (mark_binding_level): Mark it. (lookup_name_real): Use it. Call type_access_control. (mark_saved_scope): Mark lookups field. * cp-tree.h (flagged_type_tree): Add lookups field. (struct saved_scope): Add lookups field. (type_lookups): New macro. * parse.y (declmods): Now <ftype>. (parse_decl): Add lookups parm. Call initial_deferred_type_access_control. (lang_extdef): Clear type_lookups. (typed_declspecs, declmods, typespec): Set lookups field. (initdcl): Call deferred_type_access_control. (fn.def1, fn.def2, typed_declspecs1, initdcl0_innards, nomods_initdcl0, component_decl_1, named_parm): Adjust. * friend.c (is_friend): Nested classes are friends of their enclosing classes. * class.c (currently_open_derived_class): New fn. * method.c (hack_identifier): Use it. * lex.c (do_identifier): Remove obsolete code. * parse.y (typed_typespecs): Propagate new_type_flag properly. From-SVN: r31837
2000-02-07 21:36:36 +01:00
/* Begin a function definition declared with DECL_SPECS, ATTRIBUTES,
and DECLARATOR. Returns nonzero if the function-declaration is
valid. */
int
begin_function_definition (decl_specs, attributes, declarator)
tree decl_specs;
tree attributes;
tree declarator;
{
if (!start_function (decl_specs, declarator, attributes, SF_DEFAULT))
return 0;
deferred_type_access_control ();
type_lookups = error_mark_node;
/* The things we're about to see are not directly qualified by any
template headers we've seen thus far. */
reset_specialization ();
return 1;
}
/* Begin a constructor declarator of the form `SCOPE::NAME'. Returns
a SCOPE_REF. */
tree
begin_constructor_declarator (scope, name)
tree scope;
tree name;
{
tree result = build_nt (SCOPE_REF, scope, name);
enter_scope_of (result);
return result;
}
/* Finish an init-declarator. Returns a DECL. */
tree
finish_declarator (declarator, declspecs, attributes,
prefix_attributes, initialized)
tree declarator;
tree declspecs;
tree attributes;
tree prefix_attributes;
int initialized;
{
return start_decl (declarator, declspecs, initialized, attributes,
prefix_attributes);
}
/* Finish a translation unit. */
void
finish_translation_unit ()
{
/* In case there were missing closebraces,
get us back to the global binding level. */
pop_everything ();
while (current_namespace != global_namespace)
pop_namespace ();
Lazy __FUNCTION__ generation. gcc: Lazy __FUNCTION__ generation. * c-common.h (RID_FUNCTION_NAME, RID_PRETTY_FUNCTION_NAME, RID_C99_FUNCTION_NAME): New _RIDs. (CTI_FUNCTION_ID, CTI_PRETTY_FUNCTION_ID, CTI_FUNC_ID): Remove. (CTI_FUNCTION_NAME_DECL, CTI_PRETTY_FUNCTION_NAME_DECL, CTI_C99_FUNCTION_NAME_DECL, CTI_SAVED_FUNCTION_NAME_DECLS): New global tree slots. (function_id_node, pretty_function_id_node, func_id_node): Remove. (c99_function_name_decl_node, function_name_decl_node, pretty_function_name_decl_node, saved_function_name_decls): Declare. (struct language_function): Remove x_function_name_declared_p. (make_fname_decl): Remove a parameter. (declare_function_names): Remove prototype. (start_fname_decls, finish_fname_decls): Prototype. (fname_as_string): Likewise. (fname_string, fname_decl): Likewise. * c-common.c (make_fname_decl): Adjust. (struct fname_var_t): New struct. (fname_vars): New static array. (declare_function_name): Remove. (start_fname_decls, finish_fname_decls): New functions. (fname_as_string): New function from remnants of declare_function_name. (fname_string, fname_decl): New functions. * c-decl.c (c_function_name_declared_p): Remove. (init_decl_processing): Don't generate __FUNCTION__ et al ids, don't call declare_function_name. Call start_fname_decls. (c_make_fname_decl): Adjust parameters. Generate the name. Don't clobber the line number. Call finish_decl. (start_function): Call start_fname_decls. (finish_function): Call finish_fname_decls. Remove c_function_name_declared_p. (push_c_function_context): Don't push c_function_name_declared_p. (pop_c_function_context): Don't pop c_function_name_declared_p. (c_begin_compound_stmt): Don't check c_function_name_declared_p. * c-parse.in (STRING_FUNC_NAME, VAR_FUNC_NAME): New tokens. (program): Call finish_fname_decls for C. (primary): Add VAR_FUNC_NAME. (reswords): Add slots for __FUNCTION__ et al. (rid_to_yy): Add mappings for __FUNCTION__ et al. (yylexname): If it's a STRING_FUNC_NAME generate the function name now. Don't look for VAR_DECLs containing __FUNCTION__ et al. * c-semantics.c (prune_unused_decls): Remove. (finish_stmt_tree): Don't call prune_unused_decls. (genrtl_decl_stmt): Don't prune unused decls here. cp: Lazy __FUNCTION__ generation. * cp-tree.def (FUNCTION_NAME): Remove. * cp-tree.h (function_name_declared_p): Remove. (cp_fname_init): Prototype. * decl.c (init_decl_processing): Don't generate __FUNCTION__ et al ids, don't call declare_function_name. Call start_fname_decls. (cp_make_fname_decl): Adjust parameters. Generate the name. Don't clobber the line number. (cp_fname_init): New function. (start_function): Call start_fname_decls. (finish_function): Call finish_fname_decls. * lex.c (reswords): Add slots for __FUNCTION__ et al. (rid_to_yy): Add mappings for __FUNCTION__ et al. * optimize.c (maybe_clone_body): Remove function_name_declared_p. * parse.y (VAR_FUNC_NAME): New token. (primary): Add VAR_FUNC_NAME. * pt.c (tsubst_decl): Adjust a DECL_PRETTY_FUNCTION_P's generation. (tsubst, FUNCTION_NAME case): Remove. (tsubst_copy, FUNCTION_NAME case): Remove. (tsubst_expr, DECL_STMT case): Be careful with a DECL_PRETTY_FUNCTION_P. (instantiate_decl): Remove function_name_declared_p. * semantics.c (begin_compound_statement): Don't call declare_function_name here. (setup_vtbl_ptr). Don't save & restore function_name_declared_p. (finish_translation_unit): Call finish_fname_decls. (expand_body): Remove function_name_declared_p. * typeck2.c (digest_init): Allow any ERROR_MARK. testsuite: * gcc.dg/c99-func-2.c: Remove xfail. * gcc.dg/c99-func-3.c: Remove xfail. * gcc.dg/c99-func-4.c: Remove xfail. From-SVN: r41520
2001-04-24 10:22:06 +02:00
/* Do file scope __FUNCTION__ et al. */
Lazy __FUNCTION__ generation. gcc: Lazy __FUNCTION__ generation. * c-common.h (RID_FUNCTION_NAME, RID_PRETTY_FUNCTION_NAME, RID_C99_FUNCTION_NAME): New _RIDs. (CTI_FUNCTION_ID, CTI_PRETTY_FUNCTION_ID, CTI_FUNC_ID): Remove. (CTI_FUNCTION_NAME_DECL, CTI_PRETTY_FUNCTION_NAME_DECL, CTI_C99_FUNCTION_NAME_DECL, CTI_SAVED_FUNCTION_NAME_DECLS): New global tree slots. (function_id_node, pretty_function_id_node, func_id_node): Remove. (c99_function_name_decl_node, function_name_decl_node, pretty_function_name_decl_node, saved_function_name_decls): Declare. (struct language_function): Remove x_function_name_declared_p. (make_fname_decl): Remove a parameter. (declare_function_names): Remove prototype. (start_fname_decls, finish_fname_decls): Prototype. (fname_as_string): Likewise. (fname_string, fname_decl): Likewise. * c-common.c (make_fname_decl): Adjust. (struct fname_var_t): New struct. (fname_vars): New static array. (declare_function_name): Remove. (start_fname_decls, finish_fname_decls): New functions. (fname_as_string): New function from remnants of declare_function_name. (fname_string, fname_decl): New functions. * c-decl.c (c_function_name_declared_p): Remove. (init_decl_processing): Don't generate __FUNCTION__ et al ids, don't call declare_function_name. Call start_fname_decls. (c_make_fname_decl): Adjust parameters. Generate the name. Don't clobber the line number. Call finish_decl. (start_function): Call start_fname_decls. (finish_function): Call finish_fname_decls. Remove c_function_name_declared_p. (push_c_function_context): Don't push c_function_name_declared_p. (pop_c_function_context): Don't pop c_function_name_declared_p. (c_begin_compound_stmt): Don't check c_function_name_declared_p. * c-parse.in (STRING_FUNC_NAME, VAR_FUNC_NAME): New tokens. (program): Call finish_fname_decls for C. (primary): Add VAR_FUNC_NAME. (reswords): Add slots for __FUNCTION__ et al. (rid_to_yy): Add mappings for __FUNCTION__ et al. (yylexname): If it's a STRING_FUNC_NAME generate the function name now. Don't look for VAR_DECLs containing __FUNCTION__ et al. * c-semantics.c (prune_unused_decls): Remove. (finish_stmt_tree): Don't call prune_unused_decls. (genrtl_decl_stmt): Don't prune unused decls here. cp: Lazy __FUNCTION__ generation. * cp-tree.def (FUNCTION_NAME): Remove. * cp-tree.h (function_name_declared_p): Remove. (cp_fname_init): Prototype. * decl.c (init_decl_processing): Don't generate __FUNCTION__ et al ids, don't call declare_function_name. Call start_fname_decls. (cp_make_fname_decl): Adjust parameters. Generate the name. Don't clobber the line number. (cp_fname_init): New function. (start_function): Call start_fname_decls. (finish_function): Call finish_fname_decls. * lex.c (reswords): Add slots for __FUNCTION__ et al. (rid_to_yy): Add mappings for __FUNCTION__ et al. * optimize.c (maybe_clone_body): Remove function_name_declared_p. * parse.y (VAR_FUNC_NAME): New token. (primary): Add VAR_FUNC_NAME. * pt.c (tsubst_decl): Adjust a DECL_PRETTY_FUNCTION_P's generation. (tsubst, FUNCTION_NAME case): Remove. (tsubst_copy, FUNCTION_NAME case): Remove. (tsubst_expr, DECL_STMT case): Be careful with a DECL_PRETTY_FUNCTION_P. (instantiate_decl): Remove function_name_declared_p. * semantics.c (begin_compound_statement): Don't call declare_function_name here. (setup_vtbl_ptr). Don't save & restore function_name_declared_p. (finish_translation_unit): Call finish_fname_decls. (expand_body): Remove function_name_declared_p. * typeck2.c (digest_init): Allow any ERROR_MARK. testsuite: * gcc.dg/c99-func-2.c: Remove xfail. * gcc.dg/c99-func-3.c: Remove xfail. * gcc.dg/c99-func-4.c: Remove xfail. From-SVN: r41520
2001-04-24 10:22:06 +02:00
finish_fname_decls ();
finish_file ();
}
/* Finish a template type parameter, specified as AGGR IDENTIFIER.
Returns the parameter. */
tree
finish_template_type_parm (aggr, identifier)
tree aggr;
tree identifier;
{
extend.texi (C++ Signatures): Remove node. * extend.texi (C++ Signatures): Remove node. * invoke.texi: Remove discussion of -fhandle-signatures, signature, sigof, __signature__, and __sigof__. * Make-lang.in (CXX_SRCS): Remove sig.c. * Makefile.in (CXX_OBJS): Remove sig.o. (sig.o): Remove. * cp-tree.h (CPTI_OPAQUE_TYPE): Remove. (CPTI_SIGNATURE_TYPE): Likewise. (CPTI_SIGTABLE_ENTRY_TYPE): Likewise. (opaque_type_node): Likewise. (signature_type_node): Likewise. (sigtable_entry_type): Likewise. (flag_handle_signatures): Likewise. (lang_type): Remove is_signature, is_signature_pointer, is_signature_reference, has_opaque_typedecls, sigtables_has_been_generated. Adjust dummy. Remove signature, signature_pointer_to, signature_reference_to. (IS_SIGNATURE): Remove. (SET_SIGNATURE): Remove. (CLEAR_SIGNATURE): Remove. (IS_SIGNATURE_POINTER): Remove. (IS_SIGNATURE_REFERENCE): Remove. (SIGNATURE_HAS_OPAQUE_TYPEDECLS): Remove. (SIGTABLE_HAS_BEEN_GENERATED): Remove. (CLASSTYPE_SIGNATURE): Remove. (SIGNATURE_TYPE): Remove. (SIGNATURE_METHOD_VEC): Remove. (SIGNATURE_POINTER_TO): Remove. (SIGNATURE_REFERENCE_TO): Remove. (lang_decl_flags): Remove is_default_implementation. Rename memfunc_pointer_to to saved_tree. (IS_DEFAULT_IMPLEMENTATION): Remove. (DECL_MEMFUNC_POINTER_TO): Remove. (DECL_MEMFUNC_POINTING_TO): Remove. (DECL_SAVED_TREE): Adjust definition. (tag_types): Remove signature_type_node. (SIGNATURE_FIELD_NAME): Remove. (SIGNATURE_FIELD_NAME_FORMAT): Likewise. (SIGNATURE_OPTR_NAME): Likewise. (SIGNATURE_SPTR_NAME): Likewise. (SIGNATURE_POINTER_NAME): Likewise. (SIGNATURE_POINTER_NAME_FORMAT): Likewise. (SIGNATURE_REFERENCE_NAME): Likewise. (SIGNATURE_REFERNECE_NAME_FORMAT): Likewise. (SIGTABLE_PTR_TYPE): Likewise. (SIGTABLE_NAME_FORMAT): Likewise. (SIGTABLE_NAME_FORMAT_LONG): Likewise. (SIGTABLE_TAG_NAME): Likewise. (SIGTABLE_VB_OFF_NAME): Likewise. (SIGTABLE_VT_OFF_NAME): Likewise. (finish_base_specifiers): Change prototype. (build_signature_pointer_type): Remove. (build_signature_reference_type): Remove. (build_signature_pointer_constructor): Remove. (build_signature_method_call): Remove. (build_optr_ref): Likewise. (append_signature_fields): Likewise. (signature_error): Likewise. * call.c (build_this): Remove signature support. (build_over_call): Likewise. (build_new_method_call): Likewise. * class.c (add_implicitly_declared_members): Likewise. (finish_struct_1): Likewise. (finish_struct): Likewise. * cvt.c (cp_convert_to_pointer): Likewise. (convert_to_pointer_force): Likewise. (ocp_convert): Likewise. * decl.c (sigtable_decl_p): Remove. (init_decl_processing): Remove support for signatures. (cp_finish_decl): Likewise. (grokdeclarator): Likewise. (grokparms): Likewise. (xref_tag): Likewise. (start_function): Likewise. (start_method): Likewise. * decl2.c (finish_sigtable_vardecl): Remove. (flag_handle_signatures): Remove. (lang_f_options): Remove handle-signatures. (grokfield): Remove support for signatures. (grokbitfield): Likewise. (finish_file): Likewise. (reparse_absdcl_as_casts): Likewise. * error.c (dump_type_real): Likewise. (dump_function_decl): Likewise. * friend.c (make_friend_class): Likewise. * gxx.gperf: Remove __signature__, signature, __sigof__, sigof. * hash.h: Regenerated. * init.c (build_new_1): Remove support for signatures. * lang-options.h: Remove -fhandle-signatures, -fno-handle-signatures. * lex.c (init_parse): Remove support for signatures. (yyprint): Likewise. * lex.h (rid): Remove RID_SIGNATURE. * method.c (build_decl_overload_real): Remove support for signatures. (hack_identifier): Likewise. * parse.y (base_class): Likewise. (base_class.1): Likewise. (access_specifier): Likewise. * search.c (lookup_member): Likewise. * semantics.c (finish_qualified_object_call_expr): Likewise. (finish_template_type_parm): Likewise. (begin_class_definition): Likewise. (finish_base_specifier): Likewise. * sig.c: Remove. * tree.c (build_cplus_method_type): Remove support for signatures. * typeck.c (require_complete_type): Likewise. (c_sizeof): Likewise. (c_alignof): Likewise. (build_object_ref): Likewise. (build_component_ref): Likewise. (build_indirect_ref): Likewise. (build_c_cast): Likewise. (build_modify_expr): Likewise. (convert_for_initialization): Likewise. * typeck2.c (signature_error): Remove. (store_init_value): Remove support for signatures. (digest_init): Likewise. (build_x_arrow): Likewise. (build_functional_cast): Likewise. * xref.c (GNU_xref_decl): Likewise. From-SVN: r28677
1999-08-11 22:22:41 +02:00
if (aggr != class_type_node)
{
pedwarn ("template type parameters must use the keyword `class' or `typename'");
aggr = class_type_node;
}
return build_tree_list (aggr, identifier);
}
/* Finish a template template parameter, specified as AGGR IDENTIFIER.
Returns the parameter. */
tree
finish_template_template_parm (aggr, identifier)
tree aggr;
tree identifier;
{
tree decl = build_decl (TYPE_DECL, identifier, NULL_TREE);
tree tmpl = build_lang_decl (TEMPLATE_DECL, identifier, NULL_TREE);
DECL_TEMPLATE_PARMS (tmpl) = current_template_parms;
DECL_TEMPLATE_RESULT (tmpl) = decl;
DECL_ARTIFICIAL (decl) = 1;
end_template_decl ();
my_friendly_assert (DECL_TEMPLATE_PARMS (tmpl), 20010110);
return finish_template_type_parm (aggr, tmpl);
}
/* ARGUMENT is the default-argument value for a template template
parameter. If ARGUMENT is invalid, issue error messages and return
the ERROR_MARK_NODE. Otherwise, ARGUMENT itself is returned. */
tree
check_template_template_default_arg (tree argument)
{
if (TREE_CODE (argument) != TEMPLATE_DECL
&& TREE_CODE (argument) != TEMPLATE_TEMPLATE_PARM
&& TREE_CODE (argument) != TYPE_DECL
&& TREE_CODE (argument) != UNBOUND_CLASS_TEMPLATE)
{
error ("invalid default template argument");
return error_mark_node;
}
return argument;
}
/* Finish a parameter list, indicated by PARMS. If ELLIPSIS is
nonzero, the parameter list was terminated by a `...'. */
tree
finish_parmlist (parms, ellipsis)
tree parms;
int ellipsis;
{
if (parms)
{
/* We mark the PARMS as a parmlist so that declarator processing can
disambiguate certain constructs. */
TREE_PARMLIST (parms) = 1;
/* We do not append void_list_node here, but leave it to grokparms
to do that. */
PARMLIST_ELLIPSIS_P (parms) = ellipsis;
}
return parms;
}
/* Begin a class definition, as indicated by T. */
tree
begin_class_definition (t)
tree t;
{
if (t == error_mark_node)
return error_mark_node;
/* Check the bases are accessible. */
decl_type_access_control (TYPE_NAME (t));
reset_type_access_control ();
if (processing_template_parmlist)
{
error ("definition of `%#T' inside template parameter list", t);
return error_mark_node;
}
/* In a definition of a member class template, we will get here with
an implicit typename. */
if (IMPLICIT_TYPENAME_P (t))
t = TREE_TYPE (t);
/* A non-implicit typename comes from code like:
template <typename T> struct A {
template <typename U> struct A<T>::B ...
This is erroneous. */
else if (TREE_CODE (t) == TYPENAME_TYPE)
{
error ("invalid definition of qualified type `%T'", t);
t = error_mark_node;
}
if (t == error_mark_node || ! IS_AGGR_TYPE (t))
{
t = make_aggr_type (RECORD_TYPE);
pushtag (make_anon_name (), t, 0);
}
/* If we generated a partial instantiation of this type, but now
we're seeing a real definition, we're actually looking at a
partial specialization. Consider:
template <class T, class U>
struct Y {};
template <class T>
struct X {};
template <class T, class U>
void f()
{
typename X<Y<T, U> >::A a;
}
template <class T, class U>
struct X<Y<T, U> >
{
};
We have to undo the effects of the previous partial
instantiation. */
if (PARTIAL_INSTANTIATION_P (t))
{
if (!pedantic)
{
/* Unfortunately, when we're not in pedantic mode, we
attempt to actually fill in some of the fields of the
partial instantiation, in order to support the implicit
typename extension. Clear those fields now, in
preparation for the definition here. The fields cleared
here must match those set in instantiate_class_template.
Look for a comment mentioning begin_class_definition
there. */
TYPE_BINFO_BASETYPES (t) = NULL_TREE;
TYPE_FIELDS (t) = NULL_TREE;
TYPE_METHODS (t) = NULL_TREE;
CLASSTYPE_DECL_LIST (t) = NULL_TREE;
CLASSTYPE_TAGS (t) = NULL_TREE;
CLASSTYPE_VBASECLASSES (t) = NULL_TREE;
TYPE_SIZE (t) = NULL_TREE;
}
/* This isn't a partial instantiation any more. */
PARTIAL_INSTANTIATION_P (t) = 0;
}
/* If this type was already complete, and we see another definition,
that's an error. */
tree.h (COMPLETE_TYPE_P): New macro. gcc * tree.h (COMPLETE_TYPE_P): New macro. (COMPLETE_OR_VOID_TYPE_P): New macro. (COMPLETE_OR_UNBOUND_ARRAY_TYPE_P): New macro. * stor-layout.c (layout_type, case VOID_TYPE): Don't set TYPE_SIZE. * c-aux-info.c (gen_type): Use them. * c-common.c (c_expand_expr_stmt): Likewise. * c-decl.c (poplevel, pushdecl, start_decl, finish_decl, grokdeclarator, grokparms, finish_struct, start_function, store_parm_decls, combine_parm_decls): Likewise. * c-parse.y (cast_expr): Likewise. * c-typeck.c (require_complete_type, c_sizeof, c_sizeof_nowarn, c_size_in_bytes, c_alignof, build_component_ref, build_indirect_ref, build_array_ref, convert_arguments, build_binary_op, pointer_diff, build_unary_op, digest_init: Likewise. * calls.c (initialize_argument_information): Likewise. * convert.c (convert_to_integer): Likewise. * dbxout.c (dbxout_typedefs, dbxout_type, dbxout_symbol): Likewise. * dwarfout.c (location_or_const_value_attribute, output_enumeration_type_die, output_structure_type_die, output_union_type_die, output_type): Likewise. * expr.c (safe_from_p, expand_expr): Likewise. * function.c (assign_parms): Likewise. * sdbout.c (sdbout_symbol, sdbout_one_type): Likewise. * tree.c (build_array_type, build_function_type, build_method_type, build_offset_type, build_complex_type): Likewise. * c-parse.c, c-parse.h: Regenerated. gcc/cp * typeck.c (require_complete_type, complete_type, complete_type_or_else, c_sizeof, c_sizeof_nowarn, build_array_ref, convert_arguments, pointer_diff, build_x_unary_op, build_unary_op, build_c_cast, build_modify_expr): Use COMPLETE_TYPE_P etc. * call.c (is_complete, convert_like_real, build_new_method_call): Likewise. * class.c (build_vbase_pointer_fields, check_bases, build_base_field, finish_struct_1, pushclass): Likewise. * cvt.c (cp_convert_to_pointer, convert_to_void): Likewise. * decl.c (maybe_process_template_type_declaration, pushtag, pushdecl, redeclaration_error_message, start_decl, start_decl_1, layout_var_decl, check_initializer, cp_finish_decl, grokdeclarator, require_complete_types_for_parms, grok_op_properties, xref_tag, xref_basetypes, check_function_type): Likewise. * decl2.c (check_classfn, reparse_absdcl_as_casts): Likewise. * friend.c (do_friend): Likewise. * init.c (build_offset_ref): Likewise. * parse.y (structsp): Likewise. * pt.c (maybe_process_partial_specialization, tsubst_friend_function, instantiate_class_template, tsubst, do_type_instantiation, instantiate_pending_templates): Likewise. * repo.c (repo_get_id): Likewise. * rtti.c (build_typeid, get_typeid, build_dynamic_cast_1, synthesize_tinfo_var, emit_support_tinfos): Likewise. * search.c (lookup_fnfields_1, lookup_conversions): Likewise. * semantics.c (begin_class_definition): Likewise. * tree.c (build_cplus_method_type): Likewise. * typeck2.c (digest_init, build_functional_cast, add_exception_specifier): Likewise. * parse.h, parse.c: Regenerated. From-SVN: r32671
2000-03-21 19:10:48 +01:00
else if (COMPLETE_TYPE_P (t))
duplicate_tag_error (t);
/* Update the location of the decl. */
DECL_SOURCE_FILE (TYPE_NAME (t)) = input_filename;
DECL_SOURCE_LINE (TYPE_NAME (t)) = lineno;
if (TYPE_BEING_DEFINED (t))
{
t = make_aggr_type (TREE_CODE (t));
pushtag (TYPE_IDENTIFIER (t), t, 0);
}
maybe_process_partial_specialization (t);
tinfo.h (__class_type_info): Fix illegal declaration. 1999-04-02 Mark Mitchell <mark@codesourcery.com> * tinfo.h (__class_type_info): Fix illegal declaration. * cp-tree.def (TEMPLATE_ID_EXPR): Update comment. * cp-tree.h (INHERITED_VALUE_BINDING_P): New macro. (IDENTIFIER_CLASS_VALUE): Improve documentation. (is_properly_derived_from): Declare. (invalidate_class_lookup_cache): Likewise. (maybe_maybe_note_name_used_in_class): Likewise. (note_name_declared_in_class): Likewise. (push_using_decl): Remove duplicate declaration. (id_in_current_class): Remove declaration. (push_class_binding): Change prototype. (clear_identitifer_class_values): Declare. * call.c (is_properly_derived_from): Make it global. (build_new_function_call): Be careful about updating candidates. (build_new_method_call): Handle COMPONENT_REFs. Don't crash when asked to make illegal calls. * class.c: Include splay-tree.h. (class_stack_node): Add names_used slot. (check_member_decl_is_same_in_complete_scope): Remove. (add_method): Fix comment. Push the declaration into class scope. (finish_struct_1): When popping the class, pop the bindings too. Remove check for data member/function member conflict. (finish_struct): Remove calls to check_member_decl_is_same_in_complete_scope. Change calls to popclass. (pushclass): Clear names_used in the class stack entry. Use invalidate_class_lookup_cache to remove cached entries, rather than magic values with popclass. Clear IDENTIFIER_CLASS_VALUE before entering a new class. Remove dead code. Don't mess with current_function_decl when pushing declarations. (invalidate_class_lookup_cache): New function, split out from ... (popclass): Here. Clean up names_used on our way out. (instantiate_type): Adjust. (build_self_reference): Don't push the declaration here. (maybe_note_name_used_in_class): New function. (note_name_declared_in_class): Likewise. * decl.c (add_binding): Change prototype. (find_class_binding_level): New function. (innermost_nonclass_level): Likewise. (current_binding_level): Update documentation. (inner_binding_level): Remove. Replace with current_binding_level throughout. (push_binding_level): Remove special handling of class_binding_level. (pop_binding_level): Likewise. Use find_class_binding_level. (suspend_binding_level): Likewise. (global_bindings_p): Use innermost_nonclass_level. (toplevel_bindings_p): Likewise. (namespace_bindings_p): Likewise. (pseudo_global_level_p): Likewise. (push_binding): Clear INHERITED_VALUE_BINDING_P. (add_binding): Check for illegal multiple declarations. Return a value indicating whether or not the new binding was legal. (push_local_binding): Skip over class binding levels. Check return value from add_binding. (push_class_binding): Set INHERITED_VALUE_BINDING_P. Call note_name_declared_in_class. (pushlevel_class): Remove "fake out the rest of the compiler" code. (poplevel_class): Reset IDENTIFIER_CLASS_VALUEs. (clear_identifier_class_values): New function. (pop_from_top_level): Use it. (pop_everything): Tweak. (maybe_process_template_type_declaration): Don't push the declaration for the template here. (pushtag): Don't push tag declarations into class scope here. (pushdecl): Apply DeMorgan's law for readability. (pushdecl_class_level): Remove special-case code for TYPE_BEING_DEFINED. Handle OVERLOADs and anonymous unions. (push_class_level_bindng): Deal with inherited bindings. (lookup_name_real): Remove special-case code for TYPE_BEING_DEFINED, and some implicit typename magic. (grokdeclarator): Handle COMPONENT_REF for a template function. (build_enumerator): Don't call pushdecl_class_level here. (id_in_current_class): Remove. * decl2.c (grokfield): Don't call pushdecl_class_level or check_template_shadow. * errfn.c (cp_file_of): Don't declare. (cp_line_of): Likewise. * error.c (dump_decl): Handle an OVERLOAD. (cp_file_of): Likewise. (cp_line_of): Likewise. * init.c (build_member_call): Handle a COMPONENT_REF. * lex.c (do_identifier): Call maybe_note_name_used_in_class, not pushdecl_class_level. * method.c (hack_identifier): Build COMPONENT_REFs for references to member templates as well as member functions. Remove dead code. * parse.y (left_curly): Remove. (nonnested_type): Call maybe_note_name_used_in_class, not pushdecl_class_level. * parse.c: Regenerated. (nested_name_specifier_1): Likewise. * pt.c (check_explicit_specialization): Adjust, for robustness. (check_template_shadow): Handle OVERLOADs. (build_template_decl): Set DECL_CONSTRUCTOR_P on the TEMPLATE_DECL, if appropriate. * search.c (envelope_add_decl): Remove. (dfs_pushdecls): Likewise. (dfs_compress_decls): Likewise. (dfs_push_decls): New function. (dfs_push_type_decls): Likewise. (setup_class_bindings): Likewise. (template_self_reference_p): Likewise. (lookup_field_r): Use it. (looup_member): Remove old comment. Deal with ambiguity. (push_class_decls): Use dfs_push_decls and dfs_push_type_decls, and remove envelope processing. * semantics.c (begin_class_definition): Let pushclass push declarations for base classes. (finish_member_declaration): Push declarations into class scope. * typeck.c (build_component_ref): Just put an OVERLOAD into the COMPONENT_REF, not a TREE_LIST of an OVERLOAD. (build_x_function_call): Deal with OVERLOAD. Handle template-ids. * Makefile.in (class.o): Depend on splay-tree.h. From-SVN: r26133
1999-04-02 17:36:57 +02:00
pushclass (t, 1);
TYPE_BEING_DEFINED (t) = 1;
TYPE_PACKED (t) = flag_pack_struct;
/* Reset the interface data, at the earliest possible
moment, as it might have been set via a class foo;
before. */
if (! TYPE_ANONYMOUS_P (t))
{
CLASSTYPE_INTERFACE_ONLY (t) = interface_only;
SET_CLASSTYPE_INTERFACE_UNKNOWN_X
(t, interface_unknown);
}
reset_specialization();
/* Make a declaration for this class in its own scope. */
build_self_reference ();
return t;
}
cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.h (ptrmem_cst): New type. (lang_type): Remove local_typedecls. (dummy): Increase to 12 bits from 11. (CLASSTYPE_LOCAL_TYPEDECLS): Remove. (PTRMEM_CST_CLASS): New macro. (PTRMEM_CST_MEMBER): Likewise. (current_access_specifier): New variable. (current_class_type): Remove duplicate declaration. (finish_struct): Change prototype. (unreverse_member_declarations): New function. (pushdecl_class_level): Change prototype. (grok_enum_decls): Remove. (fixup_anonymous_union): New function. (grok_x_components): Change prototype. (tsubst_chain): Remove. (finish_member_template_decl): Likewise. (check_explicit_specialization): Fix indentation. (finish_class_definition): Change prototype. (finish_member_class_template): Likewise. (finish_member_declaration): New function. (check_multiple_declarators): Likewise. * class.c (class_stack_node_t): New type. (current_class_base): Remove. (current_class_stack): Change type. (current_access_specifier): New variable. (grow_method): Remove. (check_member_decl_is_same_in_complete_scope): Break out from finish_struct. (make_method_vec): New function. (free_method_vec): Likewise. (add_implicitly_declared_members): Break out from finish_struct_1. (free_method_vecs): New variable. (add_method): Rework for direct use from parser. (handle_using_decl): Watch for NULL_TREE while iterating through CLASSTYPE_METHOD_VEC. (finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here; just do some error-checking. (warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC. (finish_struct_1): Simplify. Use add_implicitly_declared_members. (finish_struct): Change prototype. Simplify; fields and methods are already set up at this point. (init_class_processing): Set up current_class_stack. (pushclass): Save current_access_specifier. (popclass): Restore it. (currently_open_class): Simplify. (build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS. * decl.c (saved_scope): Add access_specifier. (maybe_push_to_top_level): Save it. (pop_from_top_level): Restore it. (maybe_process_template_type_declaration): Use finish_member_declaration. (pushtag): Likewise. (pushdecl_class_level): Don't return a value. (fixup_anonymous_union): Break out from grok_x_components. (shadow_tag): Use it. (xref_tag): Complain about using an elaborated type specifier to reference a template type parameter or typedef name. (xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (current_local_enum): Remove. (build_enumerator): Call finish_member_declaration. (grok_enum_decls): Remove. * decl2.c (grok_x_components): Simplify. (check_classfn): Change iteration through CLASSTYPE_METHOD_VEC. (grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (merge_functions): Add to comment. (arg_assoc_type): Prototype. (arg_assoc): Pass as many arguments as there are parameters. * error.c (dump_expr): Handle PTRMEM_CST. Improve handling of OFFSET_REF. * expr.c (cpls_expand_expr): Remove dead code. Handle PTRMEM_CST. * friend.c (do_friend): Lookup friends when in nested classes. Change comments. * init.c (build_offset_ref): Do lookup even for classes that are only partially defined. (decl_constant_value): Remove dead code. * method.c (build_overload_value): Remove hack where by TYPE was not a TYPE. Handle PTRMEM_CST. (build_template_parm_names): Don't pass a PARM_DECL where a TYPE should go. * parse.y (components, notype_components, component_decl, component_decl_1, component_declarator, component_declarator0): Now all are itype rather than ttype. Rework to add members to classes on the fly. (typesqpecqual_reserved): Use check_multiple_declarators. (structsp): Update class to finish_class_definition. (do_xref_defn): Unsplit into named_class_head. (access_specifier): Set current_access_specifier. * pt.c (set_current_access_from_decl): New function. (finish_member_template_decl): Don't take the parameters. (comp_template_args): Make more robust. (lookup_template_class): Don't use current_local_enum. (for_each_template_parm): Handle PTRMEM_CST. (instantiate_class_template): Use set_current_access_from_decl, finish_member_declaration and unreverse_member_declarations. Set lineno/input_filename before generating implicit member functions. (type_unification_real): Don't assume back-unification happens only for the last argument. (regenerate_decl_from_template): Call pushclass a bit earlier. (tsubst_chain): Remove. (tsubst_enum): Use set_current_access_from_decl. (set_mangled_name_for_template_decl): Fix indentation. * search.c (lookup_fnfields_1): Change iteration through CLASSTYPE_METHOD_VEC. (dfs_pushdecls): Likewise. (dfs_compress_decls): Likewise. (add_conversions): Likewise. * semantics.c (finish_class_definition): Don't take components. Change call to finish_struct. (finish_member_declaration): New function. (finish_member_class_template): Don't take template parameters. Change call to grok_x_components. Call finish_member_template_decl. (check_multiple_declarators): New function. * sig.c (append_signature_fields): Work from the TYPE_METHODS, not a passed in fieldlist. * tree.c (search_tree): Handle PTRMEM_CST. (mapcar): Likewise. * typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not INTEGER_CSTs, for pointer-to-data members. From-SVN: r22869
1998-10-06 16:20:30 +02:00
/* Finish the member declaration given by DECL. */
void
finish_member_declaration (decl)
tree decl;
{
if (decl == error_mark_node || decl == NULL_TREE)
return;
if (decl == void_type_node)
/* The COMPONENT was a friend, not a member, and so there's
nothing for us to do. */
return;
/* We should see only one DECL at a time. */
my_friendly_assert (TREE_CHAIN (decl) == NULL_TREE, 0);
/* Set up access control for DECL. */
TREE_PRIVATE (decl)
= (current_access_specifier == access_private_node);
TREE_PROTECTED (decl)
= (current_access_specifier == access_protected_node);
if (TREE_CODE (decl) == TEMPLATE_DECL)
{
c-convert.c (convert): Return if output or input type is ERROR_MARK. * c-convert.c (convert): Return if output or input type is ERROR_MARK. * c-decl.c (duplicate_decls): Only look at DECL_BUILT_IN_NONANSI and DECL_INLINE if FUNCTION_DECL. (pushdecl, redeclaration_error_message): Likewise, for DECL_INLINE. (store_parm_decls): Check for type of PARM_DECL being ERROR_MARK. Use DECL_WEAK, not DECL_RESULT, to flag for already seen. (combine_parm_decls): Likewise. * ggc-common.c (gcc_mark_tree_children, case 'd'): Use DECL_RESULT_FLD. * print-tree.c (print_node): Likewise. Only test DECL_PACKED, DECL_INLINE, DECL_BIT_FIELD, and DECL_TRANSPARENT_UNION on proper decl types. Properly handly DECL_INCOMING_RTL and DECL_SAVED_INSNS. * stor-layout.c (layout_decl): Only check DECL_PACKED and DECL_BIT_FIELD of FIELD_DECL. * tree.h (DECL_RESULT_FLD): New macro. * cp/class.c (check_field_decl): Fix typo. (build_vtbl_or_vbase_field): Don't clear DECL_SAVED_INSNS. (check_methods): Likewise. (check_field_decls): Likewise. Use DECL_CONTEXT, not DECL_FIELD_CONTEXT. * cp-tree.h (DECL_SHADOWED_FOR_VAR, DECL_TEMPLATE_RESULT): Use DECL_RESULT_FLD, not DECL_RESULT. * cp/decl.c (xref_tag): Use DECL_TEMPLATE_RESULT. * cp/lex.c (identifier_type): Likewise. * cp/pt.c (determine_specialization, lookup_template_class): Likewise. (tsubst_friend_function, tsubst_decl, instantiate_template): Likewise. (resolve_overloaded_unification, more_specialized): Likewise. * cp/semantics.c (finish_member_declaration): Likewise. * cp/typeck.c (build_x_function_call): Likewise. From-SVN: r32759
2000-03-27 03:26:18 +02:00
TREE_PRIVATE (DECL_TEMPLATE_RESULT (decl)) = TREE_PRIVATE (decl);
TREE_PROTECTED (DECL_TEMPLATE_RESULT (decl)) = TREE_PROTECTED (decl);
cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.h (ptrmem_cst): New type. (lang_type): Remove local_typedecls. (dummy): Increase to 12 bits from 11. (CLASSTYPE_LOCAL_TYPEDECLS): Remove. (PTRMEM_CST_CLASS): New macro. (PTRMEM_CST_MEMBER): Likewise. (current_access_specifier): New variable. (current_class_type): Remove duplicate declaration. (finish_struct): Change prototype. (unreverse_member_declarations): New function. (pushdecl_class_level): Change prototype. (grok_enum_decls): Remove. (fixup_anonymous_union): New function. (grok_x_components): Change prototype. (tsubst_chain): Remove. (finish_member_template_decl): Likewise. (check_explicit_specialization): Fix indentation. (finish_class_definition): Change prototype. (finish_member_class_template): Likewise. (finish_member_declaration): New function. (check_multiple_declarators): Likewise. * class.c (class_stack_node_t): New type. (current_class_base): Remove. (current_class_stack): Change type. (current_access_specifier): New variable. (grow_method): Remove. (check_member_decl_is_same_in_complete_scope): Break out from finish_struct. (make_method_vec): New function. (free_method_vec): Likewise. (add_implicitly_declared_members): Break out from finish_struct_1. (free_method_vecs): New variable. (add_method): Rework for direct use from parser. (handle_using_decl): Watch for NULL_TREE while iterating through CLASSTYPE_METHOD_VEC. (finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here; just do some error-checking. (warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC. (finish_struct_1): Simplify. Use add_implicitly_declared_members. (finish_struct): Change prototype. Simplify; fields and methods are already set up at this point. (init_class_processing): Set up current_class_stack. (pushclass): Save current_access_specifier. (popclass): Restore it. (currently_open_class): Simplify. (build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS. * decl.c (saved_scope): Add access_specifier. (maybe_push_to_top_level): Save it. (pop_from_top_level): Restore it. (maybe_process_template_type_declaration): Use finish_member_declaration. (pushtag): Likewise. (pushdecl_class_level): Don't return a value. (fixup_anonymous_union): Break out from grok_x_components. (shadow_tag): Use it. (xref_tag): Complain about using an elaborated type specifier to reference a template type parameter or typedef name. (xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (current_local_enum): Remove. (build_enumerator): Call finish_member_declaration. (grok_enum_decls): Remove. * decl2.c (grok_x_components): Simplify. (check_classfn): Change iteration through CLASSTYPE_METHOD_VEC. (grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (merge_functions): Add to comment. (arg_assoc_type): Prototype. (arg_assoc): Pass as many arguments as there are parameters. * error.c (dump_expr): Handle PTRMEM_CST. Improve handling of OFFSET_REF. * expr.c (cpls_expand_expr): Remove dead code. Handle PTRMEM_CST. * friend.c (do_friend): Lookup friends when in nested classes. Change comments. * init.c (build_offset_ref): Do lookup even for classes that are only partially defined. (decl_constant_value): Remove dead code. * method.c (build_overload_value): Remove hack where by TYPE was not a TYPE. Handle PTRMEM_CST. (build_template_parm_names): Don't pass a PARM_DECL where a TYPE should go. * parse.y (components, notype_components, component_decl, component_decl_1, component_declarator, component_declarator0): Now all are itype rather than ttype. Rework to add members to classes on the fly. (typesqpecqual_reserved): Use check_multiple_declarators. (structsp): Update class to finish_class_definition. (do_xref_defn): Unsplit into named_class_head. (access_specifier): Set current_access_specifier. * pt.c (set_current_access_from_decl): New function. (finish_member_template_decl): Don't take the parameters. (comp_template_args): Make more robust. (lookup_template_class): Don't use current_local_enum. (for_each_template_parm): Handle PTRMEM_CST. (instantiate_class_template): Use set_current_access_from_decl, finish_member_declaration and unreverse_member_declarations. Set lineno/input_filename before generating implicit member functions. (type_unification_real): Don't assume back-unification happens only for the last argument. (regenerate_decl_from_template): Call pushclass a bit earlier. (tsubst_chain): Remove. (tsubst_enum): Use set_current_access_from_decl. (set_mangled_name_for_template_decl): Fix indentation. * search.c (lookup_fnfields_1): Change iteration through CLASSTYPE_METHOD_VEC. (dfs_pushdecls): Likewise. (dfs_compress_decls): Likewise. (add_conversions): Likewise. * semantics.c (finish_class_definition): Don't take components. Change call to finish_struct. (finish_member_declaration): New function. (finish_member_class_template): Don't take template parameters. Change call to grok_x_components. Call finish_member_template_decl. (check_multiple_declarators): New function. * sig.c (append_signature_fields): Work from the TYPE_METHODS, not a passed in fieldlist. * tree.c (search_tree): Handle PTRMEM_CST. (mapcar): Likewise. * typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not INTEGER_CSTs, for pointer-to-data members. From-SVN: r22869
1998-10-06 16:20:30 +02:00
}
/* Mark the DECL as a member of the current class. */
Make DECL_CONTEXT mean the class in which a member function was declared, even for a virtual function. Make DECL_CONTEXT mean the class in which a member function was declared, even for a virtual function. * cp-tree.h (DECL_CLASS_CONTEXT): Adjust. (DECL_FRIEND_CONTEXT): New macro. (DECL_REAL_CONTEXT): Remove. (SET_DECL_FRIEND_CONTEXT): Likewise. (DECL_VIRTUAL_CONTEXT): Adjust. (DECL_CLASS_SCOPE_P): Use TYPE_P. (add_friends): Remove. (hack_decl_function_context): Likewise. * call.c (build_new_function_call): Replace DECL_REAL_CONTEXT with CP_DECL_CONTEXT. (build_over_call): Fix indentation. Use DECL_CONTEXT instead of DECL_CLASS_CONTEXT. * class.c (dfs_build_vcall_offset_vtbl_entries): Likewise. (add_method): Set DECL_VIRTUAL_CONTEXT, not DECL_CLASS_CONTEXT. (strictly_overrides): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. (build_vtbl_or_vbase_field): Don't set DECL_CLASS_CONTEXT. (build_base_field): Likewise. (finish_struct_1): Likewise. (build_self_reference): Likewise. * decl.c (push_class_binding): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT. (pushtag): Use decl_function_context, not hack_decl_function_context. (decls_match): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT. (duplicate_decls): Use DECL_VIRTUAL_CONTEXT. (pushdecl): Remove bogus code. (start_decl): Use DECL_CONTEXT rather than DECL_CLASS_CONTEXT. (cp_finish_decl): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT. (grokfndecl): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. Use decl_function_context, nothack_decl_function_context. (grokvardecl): Don't set DECL_CLASS_CONTEXT. (grokdeclarator): Likewise. Use decl_function_context, not hack_decl_function_context. (copy_args_p): Document. Don't use DECL_CLASS_CONTEXT. (start_function): Use DECL_FRIEND_CONTEXT, not DECL_CLASS_CONTEXT. Use decl_function_context, not hack_decl_function_context. (finish_function): Use decl_function_context, not hack_decl_function_context. (maybe_retrofit_in_chrg): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. (grokclassfn): Set DECL_VIRTUAL_CONTEXT, not DECL_CONTEXT. (finish_static_data_member_decl): Don't set DECL_CLASS_CONTEXT. (grokfield): Likewise. (finish_builtin_type): Likewise. (finish_vtable_vardec): Use decl_function_context, not hack_decl_function_context. (import_export_decl): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. (start_static_initialization_or_destruction): Likewise. (finish_static_initialization_or_destruction): Likewise. (mark_used): Adjust logic for deciding when to synthesize methods. * dump.c (dequeue_and_dump): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT. * error.c (dump_function_decl): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. * friend.c (is_friend): Likewise. (add_friends): Remove. (do_friend): Use SET_DECL_FRIEND_CONTEXT. * lex.c (begin_definition_of_inclass_inline): Use decl_function_context, not hack_decl_function_context. (process_next_inline): Likewise. (do_identifier): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT. * method.c (set_mangled_name_for_decl): Use DECL_CONTEXT, not DECL_CLASSS_CONTEXT. (hack_identifier): Likewise. (synthesize_method): Use decl_function_context, not hack_decl_function_context. * pt.c (template_class_depth_real): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT. (is_member_template): Use decl_function_context, not hack_decl_function_context. Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. (build_template_decl): Set DECL_VIRTUAL_CONTEXT, not DECL_CLASS_CONTEXT. (check_default_tmpl_args): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT. (push_template_decl_real): Likewise. (instantiate_class_template): Don't call add_friends. (tsubst_default_argument): Use DECL_CONTEXT, not DECL_REAL_CONTEXT. (tsubst_decl): Set DECL_VIRTUAL_CONTEXT, not DECL_CLASS_CONTEXT. Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. (set_meangled_name_for_template_decl): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. * repo.c (repo_inline_used): Likewise. * search.c (current_scope): Adjust for new _CONTEXT macros. (context_for_name_lookup): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT. (friend_accessible_p): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. (lookup_fnfields_here):Likewise. (check_final_overrider): Likewise. (init_vbase_pointers): Likewise. (virtual_context): Likewise. * semantics.c (finish_member_declaration): Just set DECL_CONTEXT. (expand_body): Use decl_function_context, not hack_decl_function_context. * tree.c (hack_decl_function_context): Remove. * typeck.c (build_x_function_call): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. * typeck2.c (error_not_base_type): Likewise. From-SVN: r32018
2000-02-17 00:54:23 +01:00
DECL_CONTEXT (decl) = current_class_type;
cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.h (ptrmem_cst): New type. (lang_type): Remove local_typedecls. (dummy): Increase to 12 bits from 11. (CLASSTYPE_LOCAL_TYPEDECLS): Remove. (PTRMEM_CST_CLASS): New macro. (PTRMEM_CST_MEMBER): Likewise. (current_access_specifier): New variable. (current_class_type): Remove duplicate declaration. (finish_struct): Change prototype. (unreverse_member_declarations): New function. (pushdecl_class_level): Change prototype. (grok_enum_decls): Remove. (fixup_anonymous_union): New function. (grok_x_components): Change prototype. (tsubst_chain): Remove. (finish_member_template_decl): Likewise. (check_explicit_specialization): Fix indentation. (finish_class_definition): Change prototype. (finish_member_class_template): Likewise. (finish_member_declaration): New function. (check_multiple_declarators): Likewise. * class.c (class_stack_node_t): New type. (current_class_base): Remove. (current_class_stack): Change type. (current_access_specifier): New variable. (grow_method): Remove. (check_member_decl_is_same_in_complete_scope): Break out from finish_struct. (make_method_vec): New function. (free_method_vec): Likewise. (add_implicitly_declared_members): Break out from finish_struct_1. (free_method_vecs): New variable. (add_method): Rework for direct use from parser. (handle_using_decl): Watch for NULL_TREE while iterating through CLASSTYPE_METHOD_VEC. (finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here; just do some error-checking. (warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC. (finish_struct_1): Simplify. Use add_implicitly_declared_members. (finish_struct): Change prototype. Simplify; fields and methods are already set up at this point. (init_class_processing): Set up current_class_stack. (pushclass): Save current_access_specifier. (popclass): Restore it. (currently_open_class): Simplify. (build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS. * decl.c (saved_scope): Add access_specifier. (maybe_push_to_top_level): Save it. (pop_from_top_level): Restore it. (maybe_process_template_type_declaration): Use finish_member_declaration. (pushtag): Likewise. (pushdecl_class_level): Don't return a value. (fixup_anonymous_union): Break out from grok_x_components. (shadow_tag): Use it. (xref_tag): Complain about using an elaborated type specifier to reference a template type parameter or typedef name. (xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (current_local_enum): Remove. (build_enumerator): Call finish_member_declaration. (grok_enum_decls): Remove. * decl2.c (grok_x_components): Simplify. (check_classfn): Change iteration through CLASSTYPE_METHOD_VEC. (grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (merge_functions): Add to comment. (arg_assoc_type): Prototype. (arg_assoc): Pass as many arguments as there are parameters. * error.c (dump_expr): Handle PTRMEM_CST. Improve handling of OFFSET_REF. * expr.c (cpls_expand_expr): Remove dead code. Handle PTRMEM_CST. * friend.c (do_friend): Lookup friends when in nested classes. Change comments. * init.c (build_offset_ref): Do lookup even for classes that are only partially defined. (decl_constant_value): Remove dead code. * method.c (build_overload_value): Remove hack where by TYPE was not a TYPE. Handle PTRMEM_CST. (build_template_parm_names): Don't pass a PARM_DECL where a TYPE should go. * parse.y (components, notype_components, component_decl, component_decl_1, component_declarator, component_declarator0): Now all are itype rather than ttype. Rework to add members to classes on the fly. (typesqpecqual_reserved): Use check_multiple_declarators. (structsp): Update class to finish_class_definition. (do_xref_defn): Unsplit into named_class_head. (access_specifier): Set current_access_specifier. * pt.c (set_current_access_from_decl): New function. (finish_member_template_decl): Don't take the parameters. (comp_template_args): Make more robust. (lookup_template_class): Don't use current_local_enum. (for_each_template_parm): Handle PTRMEM_CST. (instantiate_class_template): Use set_current_access_from_decl, finish_member_declaration and unreverse_member_declarations. Set lineno/input_filename before generating implicit member functions. (type_unification_real): Don't assume back-unification happens only for the last argument. (regenerate_decl_from_template): Call pushclass a bit earlier. (tsubst_chain): Remove. (tsubst_enum): Use set_current_access_from_decl. (set_mangled_name_for_template_decl): Fix indentation. * search.c (lookup_fnfields_1): Change iteration through CLASSTYPE_METHOD_VEC. (dfs_pushdecls): Likewise. (dfs_compress_decls): Likewise. (add_conversions): Likewise. * semantics.c (finish_class_definition): Don't take components. Change call to finish_struct. (finish_member_declaration): New function. (finish_member_class_template): Don't take template parameters. Change call to grok_x_components. Call finish_member_template_decl. (check_multiple_declarators): New function. * sig.c (append_signature_fields): Work from the TYPE_METHODS, not a passed in fieldlist. * tree.c (search_tree): Handle PTRMEM_CST. (mapcar): Likewise. * typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not INTEGER_CSTs, for pointer-to-data members. From-SVN: r22869
1998-10-06 16:20:30 +02:00
/* [dcl.link]
A C language linkage is ignored for the names of class members
and the member function type of class member functions. */
if (DECL_LANG_SPECIFIC (decl) && DECL_LANGUAGE (decl) == lang_c)
SET_DECL_LANGUAGE (decl, lang_cplusplus);
maybe_add_class_template_decl_list (current_class_type, decl, /*friend_p=*/0);
cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.h (ptrmem_cst): New type. (lang_type): Remove local_typedecls. (dummy): Increase to 12 bits from 11. (CLASSTYPE_LOCAL_TYPEDECLS): Remove. (PTRMEM_CST_CLASS): New macro. (PTRMEM_CST_MEMBER): Likewise. (current_access_specifier): New variable. (current_class_type): Remove duplicate declaration. (finish_struct): Change prototype. (unreverse_member_declarations): New function. (pushdecl_class_level): Change prototype. (grok_enum_decls): Remove. (fixup_anonymous_union): New function. (grok_x_components): Change prototype. (tsubst_chain): Remove. (finish_member_template_decl): Likewise. (check_explicit_specialization): Fix indentation. (finish_class_definition): Change prototype. (finish_member_class_template): Likewise. (finish_member_declaration): New function. (check_multiple_declarators): Likewise. * class.c (class_stack_node_t): New type. (current_class_base): Remove. (current_class_stack): Change type. (current_access_specifier): New variable. (grow_method): Remove. (check_member_decl_is_same_in_complete_scope): Break out from finish_struct. (make_method_vec): New function. (free_method_vec): Likewise. (add_implicitly_declared_members): Break out from finish_struct_1. (free_method_vecs): New variable. (add_method): Rework for direct use from parser. (handle_using_decl): Watch for NULL_TREE while iterating through CLASSTYPE_METHOD_VEC. (finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here; just do some error-checking. (warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC. (finish_struct_1): Simplify. Use add_implicitly_declared_members. (finish_struct): Change prototype. Simplify; fields and methods are already set up at this point. (init_class_processing): Set up current_class_stack. (pushclass): Save current_access_specifier. (popclass): Restore it. (currently_open_class): Simplify. (build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS. * decl.c (saved_scope): Add access_specifier. (maybe_push_to_top_level): Save it. (pop_from_top_level): Restore it. (maybe_process_template_type_declaration): Use finish_member_declaration. (pushtag): Likewise. (pushdecl_class_level): Don't return a value. (fixup_anonymous_union): Break out from grok_x_components. (shadow_tag): Use it. (xref_tag): Complain about using an elaborated type specifier to reference a template type parameter or typedef name. (xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (current_local_enum): Remove. (build_enumerator): Call finish_member_declaration. (grok_enum_decls): Remove. * decl2.c (grok_x_components): Simplify. (check_classfn): Change iteration through CLASSTYPE_METHOD_VEC. (grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (merge_functions): Add to comment. (arg_assoc_type): Prototype. (arg_assoc): Pass as many arguments as there are parameters. * error.c (dump_expr): Handle PTRMEM_CST. Improve handling of OFFSET_REF. * expr.c (cpls_expand_expr): Remove dead code. Handle PTRMEM_CST. * friend.c (do_friend): Lookup friends when in nested classes. Change comments. * init.c (build_offset_ref): Do lookup even for classes that are only partially defined. (decl_constant_value): Remove dead code. * method.c (build_overload_value): Remove hack where by TYPE was not a TYPE. Handle PTRMEM_CST. (build_template_parm_names): Don't pass a PARM_DECL where a TYPE should go. * parse.y (components, notype_components, component_decl, component_decl_1, component_declarator, component_declarator0): Now all are itype rather than ttype. Rework to add members to classes on the fly. (typesqpecqual_reserved): Use check_multiple_declarators. (structsp): Update class to finish_class_definition. (do_xref_defn): Unsplit into named_class_head. (access_specifier): Set current_access_specifier. * pt.c (set_current_access_from_decl): New function. (finish_member_template_decl): Don't take the parameters. (comp_template_args): Make more robust. (lookup_template_class): Don't use current_local_enum. (for_each_template_parm): Handle PTRMEM_CST. (instantiate_class_template): Use set_current_access_from_decl, finish_member_declaration and unreverse_member_declarations. Set lineno/input_filename before generating implicit member functions. (type_unification_real): Don't assume back-unification happens only for the last argument. (regenerate_decl_from_template): Call pushclass a bit earlier. (tsubst_chain): Remove. (tsubst_enum): Use set_current_access_from_decl. (set_mangled_name_for_template_decl): Fix indentation. * search.c (lookup_fnfields_1): Change iteration through CLASSTYPE_METHOD_VEC. (dfs_pushdecls): Likewise. (dfs_compress_decls): Likewise. (add_conversions): Likewise. * semantics.c (finish_class_definition): Don't take components. Change call to finish_struct. (finish_member_declaration): New function. (finish_member_class_template): Don't take template parameters. Change call to grok_x_components. Call finish_member_template_decl. (check_multiple_declarators): New function. * sig.c (append_signature_fields): Work from the TYPE_METHODS, not a passed in fieldlist. * tree.c (search_tree): Handle PTRMEM_CST. (mapcar): Likewise. * typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not INTEGER_CSTs, for pointer-to-data members. From-SVN: r22869
1998-10-06 16:20:30 +02:00
/* Put functions on the TYPE_METHODS list and everything else on the
TYPE_FIELDS list. Note that these are built up in reverse order.
We reverse them (to obtain declaration order) in finish_struct. */
if (TREE_CODE (decl) == FUNCTION_DECL
|| DECL_FUNCTION_TEMPLATE_P (decl))
{
/* We also need to add this function to the
CLASSTYPE_METHOD_VEC. */
add_method (current_class_type, decl, /*error_p=*/0);
cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.h (ptrmem_cst): New type. (lang_type): Remove local_typedecls. (dummy): Increase to 12 bits from 11. (CLASSTYPE_LOCAL_TYPEDECLS): Remove. (PTRMEM_CST_CLASS): New macro. (PTRMEM_CST_MEMBER): Likewise. (current_access_specifier): New variable. (current_class_type): Remove duplicate declaration. (finish_struct): Change prototype. (unreverse_member_declarations): New function. (pushdecl_class_level): Change prototype. (grok_enum_decls): Remove. (fixup_anonymous_union): New function. (grok_x_components): Change prototype. (tsubst_chain): Remove. (finish_member_template_decl): Likewise. (check_explicit_specialization): Fix indentation. (finish_class_definition): Change prototype. (finish_member_class_template): Likewise. (finish_member_declaration): New function. (check_multiple_declarators): Likewise. * class.c (class_stack_node_t): New type. (current_class_base): Remove. (current_class_stack): Change type. (current_access_specifier): New variable. (grow_method): Remove. (check_member_decl_is_same_in_complete_scope): Break out from finish_struct. (make_method_vec): New function. (free_method_vec): Likewise. (add_implicitly_declared_members): Break out from finish_struct_1. (free_method_vecs): New variable. (add_method): Rework for direct use from parser. (handle_using_decl): Watch for NULL_TREE while iterating through CLASSTYPE_METHOD_VEC. (finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here; just do some error-checking. (warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC. (finish_struct_1): Simplify. Use add_implicitly_declared_members. (finish_struct): Change prototype. Simplify; fields and methods are already set up at this point. (init_class_processing): Set up current_class_stack. (pushclass): Save current_access_specifier. (popclass): Restore it. (currently_open_class): Simplify. (build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS. * decl.c (saved_scope): Add access_specifier. (maybe_push_to_top_level): Save it. (pop_from_top_level): Restore it. (maybe_process_template_type_declaration): Use finish_member_declaration. (pushtag): Likewise. (pushdecl_class_level): Don't return a value. (fixup_anonymous_union): Break out from grok_x_components. (shadow_tag): Use it. (xref_tag): Complain about using an elaborated type specifier to reference a template type parameter or typedef name. (xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (current_local_enum): Remove. (build_enumerator): Call finish_member_declaration. (grok_enum_decls): Remove. * decl2.c (grok_x_components): Simplify. (check_classfn): Change iteration through CLASSTYPE_METHOD_VEC. (grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (merge_functions): Add to comment. (arg_assoc_type): Prototype. (arg_assoc): Pass as many arguments as there are parameters. * error.c (dump_expr): Handle PTRMEM_CST. Improve handling of OFFSET_REF. * expr.c (cpls_expand_expr): Remove dead code. Handle PTRMEM_CST. * friend.c (do_friend): Lookup friends when in nested classes. Change comments. * init.c (build_offset_ref): Do lookup even for classes that are only partially defined. (decl_constant_value): Remove dead code. * method.c (build_overload_value): Remove hack where by TYPE was not a TYPE. Handle PTRMEM_CST. (build_template_parm_names): Don't pass a PARM_DECL where a TYPE should go. * parse.y (components, notype_components, component_decl, component_decl_1, component_declarator, component_declarator0): Now all are itype rather than ttype. Rework to add members to classes on the fly. (typesqpecqual_reserved): Use check_multiple_declarators. (structsp): Update class to finish_class_definition. (do_xref_defn): Unsplit into named_class_head. (access_specifier): Set current_access_specifier. * pt.c (set_current_access_from_decl): New function. (finish_member_template_decl): Don't take the parameters. (comp_template_args): Make more robust. (lookup_template_class): Don't use current_local_enum. (for_each_template_parm): Handle PTRMEM_CST. (instantiate_class_template): Use set_current_access_from_decl, finish_member_declaration and unreverse_member_declarations. Set lineno/input_filename before generating implicit member functions. (type_unification_real): Don't assume back-unification happens only for the last argument. (regenerate_decl_from_template): Call pushclass a bit earlier. (tsubst_chain): Remove. (tsubst_enum): Use set_current_access_from_decl. (set_mangled_name_for_template_decl): Fix indentation. * search.c (lookup_fnfields_1): Change iteration through CLASSTYPE_METHOD_VEC. (dfs_pushdecls): Likewise. (dfs_compress_decls): Likewise. (add_conversions): Likewise. * semantics.c (finish_class_definition): Don't take components. Change call to finish_struct. (finish_member_declaration): New function. (finish_member_class_template): Don't take template parameters. Change call to grok_x_components. Call finish_member_template_decl. (check_multiple_declarators): New function. * sig.c (append_signature_fields): Work from the TYPE_METHODS, not a passed in fieldlist. * tree.c (search_tree): Handle PTRMEM_CST. (mapcar): Likewise. * typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not INTEGER_CSTs, for pointer-to-data members. From-SVN: r22869
1998-10-06 16:20:30 +02:00
TREE_CHAIN (decl) = TYPE_METHODS (current_class_type);
TYPE_METHODS (current_class_type) = decl;
}
else
{
/* All TYPE_DECLs go at the end of TYPE_FIELDS. Ordinary fields
go at the beginning. The reason is that lookup_field_1
searches the list in order, and we want a field name to
override a type name so that the "struct stat hack" will
work. In particular:
struct S { enum E { }; int E } s;
s.E = 3;
is valid. In addition, the FIELD_DECLs must be maintained in
cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.h (ptrmem_cst): New type. (lang_type): Remove local_typedecls. (dummy): Increase to 12 bits from 11. (CLASSTYPE_LOCAL_TYPEDECLS): Remove. (PTRMEM_CST_CLASS): New macro. (PTRMEM_CST_MEMBER): Likewise. (current_access_specifier): New variable. (current_class_type): Remove duplicate declaration. (finish_struct): Change prototype. (unreverse_member_declarations): New function. (pushdecl_class_level): Change prototype. (grok_enum_decls): Remove. (fixup_anonymous_union): New function. (grok_x_components): Change prototype. (tsubst_chain): Remove. (finish_member_template_decl): Likewise. (check_explicit_specialization): Fix indentation. (finish_class_definition): Change prototype. (finish_member_class_template): Likewise. (finish_member_declaration): New function. (check_multiple_declarators): Likewise. * class.c (class_stack_node_t): New type. (current_class_base): Remove. (current_class_stack): Change type. (current_access_specifier): New variable. (grow_method): Remove. (check_member_decl_is_same_in_complete_scope): Break out from finish_struct. (make_method_vec): New function. (free_method_vec): Likewise. (add_implicitly_declared_members): Break out from finish_struct_1. (free_method_vecs): New variable. (add_method): Rework for direct use from parser. (handle_using_decl): Watch for NULL_TREE while iterating through CLASSTYPE_METHOD_VEC. (finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here; just do some error-checking. (warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC. (finish_struct_1): Simplify. Use add_implicitly_declared_members. (finish_struct): Change prototype. Simplify; fields and methods are already set up at this point. (init_class_processing): Set up current_class_stack. (pushclass): Save current_access_specifier. (popclass): Restore it. (currently_open_class): Simplify. (build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS. * decl.c (saved_scope): Add access_specifier. (maybe_push_to_top_level): Save it. (pop_from_top_level): Restore it. (maybe_process_template_type_declaration): Use finish_member_declaration. (pushtag): Likewise. (pushdecl_class_level): Don't return a value. (fixup_anonymous_union): Break out from grok_x_components. (shadow_tag): Use it. (xref_tag): Complain about using an elaborated type specifier to reference a template type parameter or typedef name. (xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (current_local_enum): Remove. (build_enumerator): Call finish_member_declaration. (grok_enum_decls): Remove. * decl2.c (grok_x_components): Simplify. (check_classfn): Change iteration through CLASSTYPE_METHOD_VEC. (grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (merge_functions): Add to comment. (arg_assoc_type): Prototype. (arg_assoc): Pass as many arguments as there are parameters. * error.c (dump_expr): Handle PTRMEM_CST. Improve handling of OFFSET_REF. * expr.c (cpls_expand_expr): Remove dead code. Handle PTRMEM_CST. * friend.c (do_friend): Lookup friends when in nested classes. Change comments. * init.c (build_offset_ref): Do lookup even for classes that are only partially defined. (decl_constant_value): Remove dead code. * method.c (build_overload_value): Remove hack where by TYPE was not a TYPE. Handle PTRMEM_CST. (build_template_parm_names): Don't pass a PARM_DECL where a TYPE should go. * parse.y (components, notype_components, component_decl, component_decl_1, component_declarator, component_declarator0): Now all are itype rather than ttype. Rework to add members to classes on the fly. (typesqpecqual_reserved): Use check_multiple_declarators. (structsp): Update class to finish_class_definition. (do_xref_defn): Unsplit into named_class_head. (access_specifier): Set current_access_specifier. * pt.c (set_current_access_from_decl): New function. (finish_member_template_decl): Don't take the parameters. (comp_template_args): Make more robust. (lookup_template_class): Don't use current_local_enum. (for_each_template_parm): Handle PTRMEM_CST. (instantiate_class_template): Use set_current_access_from_decl, finish_member_declaration and unreverse_member_declarations. Set lineno/input_filename before generating implicit member functions. (type_unification_real): Don't assume back-unification happens only for the last argument. (regenerate_decl_from_template): Call pushclass a bit earlier. (tsubst_chain): Remove. (tsubst_enum): Use set_current_access_from_decl. (set_mangled_name_for_template_decl): Fix indentation. * search.c (lookup_fnfields_1): Change iteration through CLASSTYPE_METHOD_VEC. (dfs_pushdecls): Likewise. (dfs_compress_decls): Likewise. (add_conversions): Likewise. * semantics.c (finish_class_definition): Don't take components. Change call to finish_struct. (finish_member_declaration): New function. (finish_member_class_template): Don't take template parameters. Change call to grok_x_components. Call finish_member_template_decl. (check_multiple_declarators): New function. * sig.c (append_signature_fields): Work from the TYPE_METHODS, not a passed in fieldlist. * tree.c (search_tree): Handle PTRMEM_CST. (mapcar): Likewise. * typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not INTEGER_CSTs, for pointer-to-data members. From-SVN: r22869
1998-10-06 16:20:30 +02:00
declaration order so that class layout works as expected.
However, we don't need that order until class layout, so we
save a little time by putting FIELD_DECLs on in reverse order
here, and then reversing them in finish_struct_1. (We could
also keep a pointer to the correct insertion points in the
list.) */
if (TREE_CODE (decl) == TYPE_DECL)
TYPE_FIELDS (current_class_type)
= chainon (TYPE_FIELDS (current_class_type), decl);
else
{
TREE_CHAIN (decl) = TYPE_FIELDS (current_class_type);
TYPE_FIELDS (current_class_type) = decl;
}
tinfo.h (__class_type_info): Fix illegal declaration. 1999-04-02 Mark Mitchell <mark@codesourcery.com> * tinfo.h (__class_type_info): Fix illegal declaration. * cp-tree.def (TEMPLATE_ID_EXPR): Update comment. * cp-tree.h (INHERITED_VALUE_BINDING_P): New macro. (IDENTIFIER_CLASS_VALUE): Improve documentation. (is_properly_derived_from): Declare. (invalidate_class_lookup_cache): Likewise. (maybe_maybe_note_name_used_in_class): Likewise. (note_name_declared_in_class): Likewise. (push_using_decl): Remove duplicate declaration. (id_in_current_class): Remove declaration. (push_class_binding): Change prototype. (clear_identitifer_class_values): Declare. * call.c (is_properly_derived_from): Make it global. (build_new_function_call): Be careful about updating candidates. (build_new_method_call): Handle COMPONENT_REFs. Don't crash when asked to make illegal calls. * class.c: Include splay-tree.h. (class_stack_node): Add names_used slot. (check_member_decl_is_same_in_complete_scope): Remove. (add_method): Fix comment. Push the declaration into class scope. (finish_struct_1): When popping the class, pop the bindings too. Remove check for data member/function member conflict. (finish_struct): Remove calls to check_member_decl_is_same_in_complete_scope. Change calls to popclass. (pushclass): Clear names_used in the class stack entry. Use invalidate_class_lookup_cache to remove cached entries, rather than magic values with popclass. Clear IDENTIFIER_CLASS_VALUE before entering a new class. Remove dead code. Don't mess with current_function_decl when pushing declarations. (invalidate_class_lookup_cache): New function, split out from ... (popclass): Here. Clean up names_used on our way out. (instantiate_type): Adjust. (build_self_reference): Don't push the declaration here. (maybe_note_name_used_in_class): New function. (note_name_declared_in_class): Likewise. * decl.c (add_binding): Change prototype. (find_class_binding_level): New function. (innermost_nonclass_level): Likewise. (current_binding_level): Update documentation. (inner_binding_level): Remove. Replace with current_binding_level throughout. (push_binding_level): Remove special handling of class_binding_level. (pop_binding_level): Likewise. Use find_class_binding_level. (suspend_binding_level): Likewise. (global_bindings_p): Use innermost_nonclass_level. (toplevel_bindings_p): Likewise. (namespace_bindings_p): Likewise. (pseudo_global_level_p): Likewise. (push_binding): Clear INHERITED_VALUE_BINDING_P. (add_binding): Check for illegal multiple declarations. Return a value indicating whether or not the new binding was legal. (push_local_binding): Skip over class binding levels. Check return value from add_binding. (push_class_binding): Set INHERITED_VALUE_BINDING_P. Call note_name_declared_in_class. (pushlevel_class): Remove "fake out the rest of the compiler" code. (poplevel_class): Reset IDENTIFIER_CLASS_VALUEs. (clear_identifier_class_values): New function. (pop_from_top_level): Use it. (pop_everything): Tweak. (maybe_process_template_type_declaration): Don't push the declaration for the template here. (pushtag): Don't push tag declarations into class scope here. (pushdecl): Apply DeMorgan's law for readability. (pushdecl_class_level): Remove special-case code for TYPE_BEING_DEFINED. Handle OVERLOADs and anonymous unions. (push_class_level_bindng): Deal with inherited bindings. (lookup_name_real): Remove special-case code for TYPE_BEING_DEFINED, and some implicit typename magic. (grokdeclarator): Handle COMPONENT_REF for a template function. (build_enumerator): Don't call pushdecl_class_level here. (id_in_current_class): Remove. * decl2.c (grokfield): Don't call pushdecl_class_level or check_template_shadow. * errfn.c (cp_file_of): Don't declare. (cp_line_of): Likewise. * error.c (dump_decl): Handle an OVERLOAD. (cp_file_of): Likewise. (cp_line_of): Likewise. * init.c (build_member_call): Handle a COMPONENT_REF. * lex.c (do_identifier): Call maybe_note_name_used_in_class, not pushdecl_class_level. * method.c (hack_identifier): Build COMPONENT_REFs for references to member templates as well as member functions. Remove dead code. * parse.y (left_curly): Remove. (nonnested_type): Call maybe_note_name_used_in_class, not pushdecl_class_level. * parse.c: Regenerated. (nested_name_specifier_1): Likewise. * pt.c (check_explicit_specialization): Adjust, for robustness. (check_template_shadow): Handle OVERLOADs. (build_template_decl): Set DECL_CONSTRUCTOR_P on the TEMPLATE_DECL, if appropriate. * search.c (envelope_add_decl): Remove. (dfs_pushdecls): Likewise. (dfs_compress_decls): Likewise. (dfs_push_decls): New function. (dfs_push_type_decls): Likewise. (setup_class_bindings): Likewise. (template_self_reference_p): Likewise. (lookup_field_r): Use it. (looup_member): Remove old comment. Deal with ambiguity. (push_class_decls): Use dfs_push_decls and dfs_push_type_decls, and remove envelope processing. * semantics.c (begin_class_definition): Let pushclass push declarations for base classes. (finish_member_declaration): Push declarations into class scope. * typeck.c (build_component_ref): Just put an OVERLOAD into the COMPONENT_REF, not a TREE_LIST of an OVERLOAD. (build_x_function_call): Deal with OVERLOAD. Handle template-ids. * Makefile.in (class.o): Depend on splay-tree.h. From-SVN: r26133
1999-04-02 17:36:57 +02:00
/* Enter the DECL into the scope of the class. */
if (TREE_CODE (decl) != USING_DECL)
pushdecl_class_level (decl);
cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.h (ptrmem_cst): New type. (lang_type): Remove local_typedecls. (dummy): Increase to 12 bits from 11. (CLASSTYPE_LOCAL_TYPEDECLS): Remove. (PTRMEM_CST_CLASS): New macro. (PTRMEM_CST_MEMBER): Likewise. (current_access_specifier): New variable. (current_class_type): Remove duplicate declaration. (finish_struct): Change prototype. (unreverse_member_declarations): New function. (pushdecl_class_level): Change prototype. (grok_enum_decls): Remove. (fixup_anonymous_union): New function. (grok_x_components): Change prototype. (tsubst_chain): Remove. (finish_member_template_decl): Likewise. (check_explicit_specialization): Fix indentation. (finish_class_definition): Change prototype. (finish_member_class_template): Likewise. (finish_member_declaration): New function. (check_multiple_declarators): Likewise. * class.c (class_stack_node_t): New type. (current_class_base): Remove. (current_class_stack): Change type. (current_access_specifier): New variable. (grow_method): Remove. (check_member_decl_is_same_in_complete_scope): Break out from finish_struct. (make_method_vec): New function. (free_method_vec): Likewise. (add_implicitly_declared_members): Break out from finish_struct_1. (free_method_vecs): New variable. (add_method): Rework for direct use from parser. (handle_using_decl): Watch for NULL_TREE while iterating through CLASSTYPE_METHOD_VEC. (finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here; just do some error-checking. (warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC. (finish_struct_1): Simplify. Use add_implicitly_declared_members. (finish_struct): Change prototype. Simplify; fields and methods are already set up at this point. (init_class_processing): Set up current_class_stack. (pushclass): Save current_access_specifier. (popclass): Restore it. (currently_open_class): Simplify. (build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS. * decl.c (saved_scope): Add access_specifier. (maybe_push_to_top_level): Save it. (pop_from_top_level): Restore it. (maybe_process_template_type_declaration): Use finish_member_declaration. (pushtag): Likewise. (pushdecl_class_level): Don't return a value. (fixup_anonymous_union): Break out from grok_x_components. (shadow_tag): Use it. (xref_tag): Complain about using an elaborated type specifier to reference a template type parameter or typedef name. (xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (current_local_enum): Remove. (build_enumerator): Call finish_member_declaration. (grok_enum_decls): Remove. * decl2.c (grok_x_components): Simplify. (check_classfn): Change iteration through CLASSTYPE_METHOD_VEC. (grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (merge_functions): Add to comment. (arg_assoc_type): Prototype. (arg_assoc): Pass as many arguments as there are parameters. * error.c (dump_expr): Handle PTRMEM_CST. Improve handling of OFFSET_REF. * expr.c (cpls_expand_expr): Remove dead code. Handle PTRMEM_CST. * friend.c (do_friend): Lookup friends when in nested classes. Change comments. * init.c (build_offset_ref): Do lookup even for classes that are only partially defined. (decl_constant_value): Remove dead code. * method.c (build_overload_value): Remove hack where by TYPE was not a TYPE. Handle PTRMEM_CST. (build_template_parm_names): Don't pass a PARM_DECL where a TYPE should go. * parse.y (components, notype_components, component_decl, component_decl_1, component_declarator, component_declarator0): Now all are itype rather than ttype. Rework to add members to classes on the fly. (typesqpecqual_reserved): Use check_multiple_declarators. (structsp): Update class to finish_class_definition. (do_xref_defn): Unsplit into named_class_head. (access_specifier): Set current_access_specifier. * pt.c (set_current_access_from_decl): New function. (finish_member_template_decl): Don't take the parameters. (comp_template_args): Make more robust. (lookup_template_class): Don't use current_local_enum. (for_each_template_parm): Handle PTRMEM_CST. (instantiate_class_template): Use set_current_access_from_decl, finish_member_declaration and unreverse_member_declarations. Set lineno/input_filename before generating implicit member functions. (type_unification_real): Don't assume back-unification happens only for the last argument. (regenerate_decl_from_template): Call pushclass a bit earlier. (tsubst_chain): Remove. (tsubst_enum): Use set_current_access_from_decl. (set_mangled_name_for_template_decl): Fix indentation. * search.c (lookup_fnfields_1): Change iteration through CLASSTYPE_METHOD_VEC. (dfs_pushdecls): Likewise. (dfs_compress_decls): Likewise. (add_conversions): Likewise. * semantics.c (finish_class_definition): Don't take components. Change call to finish_struct. (finish_member_declaration): New function. (finish_member_class_template): Don't take template parameters. Change call to grok_x_components. Call finish_member_template_decl. (check_multiple_declarators): New function. * sig.c (append_signature_fields): Work from the TYPE_METHODS, not a passed in fieldlist. * tree.c (search_tree): Handle PTRMEM_CST. (mapcar): Likewise. * typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not INTEGER_CSTs, for pointer-to-data members. From-SVN: r22869
1998-10-06 16:20:30 +02:00
}
}
/* Finish a class definition T with the indicate ATTRIBUTES. If SEMI,
the definition is immediately followed by a semicolon. Returns the
type. */
tree
finish_class_definition (t, attributes, semi, pop_scope_p)
tree t;
tree attributes;
int semi;
int pop_scope_p;
{
if (t == error_mark_node)
return error_mark_node;
/* finish_struct nukes this anyway; if finish_exception does too,
then it can go. */
if (semi)
note_got_semicolon (t);
/* If we got any attributes in class_head, xref_tag will stick them in
TREE_TYPE of the type. Grab them now. */
attributes = chainon (TYPE_ATTRIBUTES (t), attributes);
TYPE_ATTRIBUTES (t) = NULL_TREE;
if (TREE_CODE (t) == ENUMERAL_TYPE)
;
else
{
t = finish_struct (t, attributes);
if (semi)
note_got_semicolon (t);
}
if (! semi)
check_for_missing_semicolon (t);
if (pop_scope_p)
pop_scope (CP_DECL_CONTEXT (TYPE_MAIN_DECL (t)));
if (current_scope () == current_function_decl)
do_pending_defargs ();
return t;
}
/* Finish processing the default argument expressions cached during
the processing of a class definition. */
void
begin_inline_definitions ()
{
Integrated preprocessor. top level: * Makefile.in: Remove all references to c-parse.gperf, c-gperf.h, and c-parse.h. Remove -d from yacc command line generating c-parse.c. Update dependencies. * c-parse.gperf, c-gperf.h: Delete. * c-common.c: Don't define parse_options, cpp_token, yy_cur, yy_lim, or yy_get_token. Don't define get_directive_line if USE_CPPLIB. * c-common.h: Add multiple include guard. Define RID values for every keyword in C, C++, and Objective C. Put all the modifiers first. (struct c_fileinfo, get_fileinfo, dump_time_statistics): New. * c-decl.c (c_decode_option): Handle -lang-objc here. (print_lang_identifier): Handle C_IS_RESERVED_WORD case. (grokdeclarator): Adjust for new RID scheme. (extract_interface_info): New stub. * c-lang.c: Don't declare yy_cur or parse_options. (lang_init_options): Call cpp_init. Don't call cpp_options_init. (lang_init): Don't call check_newline if USE_CPPLIB. * c-lex.c: Don't include c-parse.h. Do include timevar.h. Elide lots of unnecessary code if USE_CPPLIB. Delete code rendered unnecessary by new architecture. Move routines not shared with C++ to c-parse.in. Maintain a local idea of the line number. Handle C++ as well as C. [USE_CPPLIB]: Declare and register callbacks for #ident and for entering/leaving files. (init_c_lex, c_lex): Are now the entry points to this file. (check_newline): Break out directive handling to process_directive. (read_ucs, is_extended_char, utf8_extend_token): Moved here from C++ front end. (readescape, parse_float): Overhaul. (lex_number, lex_string, lex_charconst): Break out of c_lex (n'ee yylex). (get_fileinfo, update_header_times, dump_one_header, dump_time_statistics): New and/or moved here from C++. Support per-file data needed by C++ and per-header timing statistics (C++ only, at the moment). * c-lex.h: Update prototypes. Add multiple include guard. * c-tree.h (struct lang_identifier): Add rid_code field. (C_IS_RESERVED_WORD, C_RID_CODE): New. * c-parse.in: Include c-pragma.h. Remove unnecesary calls to reinit_parse_for_function and/or position_after_white_space. (save_filename, save_lineno): Look ahead before saving. (label -> identifier ':'): Save file and line before shifting ':'. (reservedwords): No need to call get_identifier. (init_parse, finish_parse, yyerror, yylex, yyprint, make_pointer_declarator): Are now here for C/ObjC. (rid_to_yy): Conversion table from RID constants to Yacc codes. * c-pragma.c: Rewrite parsing logic to fit with cpplib's #pragma registry. Provide dummy implementation of that interface if !USE_CPPLIB. * c-pragma.h: Update to match. * flags.h: Add multiple include guard. (flag_detailed_statistics): Moved here from C++. * toplev.c: Define flag_detailed_statistics. * gcc.c (C specs): Use %(trad_capable_cpp) for -E|-M|-MM case #if USE_CPPLIB. * timevar.def (TV_CPP, TV_LEX): New. * timevar.h: Add multiple include guard. * objc/lang-specs.h: Use %(trad_capable_cpp) for -E|-M|-MM case #if USE_CPPLIB. * objc/objc-act.c: Don't mention yy_cur or parse_options. Initialize cpplib properly. Force lineno to 0 after first call to check_newline. Don't handle -lang-objc here. Move forget_protocol_qualifiers and remember_protocol_qualifiers here. cp: * Make-lang.in, Makefile.in: Remove all references to input.c, gxx.gperf, and hash.h. Add ../c-lex.o to C_OBJS. * gxx.gperf, hash.h, input.c: Delete. * lang-specs.h: Pass -lang-c++ to cc1plus so cpplib is initialized properly. * class.c (fixup_pending_inline): Take a tree, not a struct pending_inline *. All callers changed. (init_class_processing): Set RID_PUBLIC, RID_PRIVATE, RID_PROTECTED entries in ridpointers[] array here. * decl.c (duplicate_decls): Do not refer to struct pending_inline. (record_builtin_type, init_decl_processing): Use RID_MAX not CP_RID_MAX. (grokdeclarator): Use C_IS_RESERVED_WORD. * decl2.c (lang_decode_option): Ignore -lang-c++ for sake of cpplib. (grok_x_components): Do not inspect pending_inlines chain. * cp-tree.h (struct lang_identifier): Add rid_code entry. (C_IS_RESERVED_WORD, C_RID_CODE, C_RID_YYCODE): New. (flag_no_gnu_keywords, flag_operator_names, rid_to_yy): Declare. (DEFARG_LENGTH, struct pending_inline, TIME_IDENTIFIER_TIME, TIME_IDENTIFIER_FILEINFO): Kill. Update prototypes. * lex.h: Expunge cp_rid. Rewrite RIDBIT macros to use just a single 32-bit word. * parse.y: Call do_pending_inlines unconditionally. reinit_parse_for_method is now snarf_method. fn.defpen is no longer necessary. Remove unnecessary <itype> annotation on SCOPE. Do not refer to end_of_file or struct pending_inline. * semantics.c (begin_inline_definitions): Call do_pending_inlines unconditionally. * lex.c: Remove all code now shared with C front end. Initialize cpplib properly if USE_CPPLIB. Put reserved words into the get_identifier table. Rewrite pragma handling to work with the registry. Move code to save tokens for later processing to spew.c. * spew.c: Rewrite everything in terms of token streams instead of text. Move routines here from lex.c / input.c as appropriate. GC-mark trees hanging off the pending inlines chain. testsuite: * g++.old-deja/g++.benjamin/13478.C: Put meaningful tags on ERROR markers. * g++.old-deja/g++.brendan/crash8.C: Move ERROR marker up one line. * gcc.dg/c99-array-nonobj-1.c: Don't expect func[] cases to fail. * gcc.dg/wtr-label-1.c: Don't use unconstrained .* in error regexps. * gcc.dg/wtr-suffix-1.c: Correct error regexps. * gcc.dg/cpp/unc1.c, gcc.dg/cpp/unc2.c, gcc.dg/cpp/unc3.c: Preprocess only. * gcc.dg/cpp/unc4.c: Adjust line number in dg-error line. * gcc.dg/noncompile/const-ll-1.c: Generalize error regexp. From-SVN: r36216
2000-09-07 02:37:14 +02:00
if (current_scope () == current_function_decl)
do_pending_inlines ();
}
/* Finish processing the declaration of a member class template
TYPES whose template parameters are given by PARMS. */
tree
cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.h (ptrmem_cst): New type. (lang_type): Remove local_typedecls. (dummy): Increase to 12 bits from 11. (CLASSTYPE_LOCAL_TYPEDECLS): Remove. (PTRMEM_CST_CLASS): New macro. (PTRMEM_CST_MEMBER): Likewise. (current_access_specifier): New variable. (current_class_type): Remove duplicate declaration. (finish_struct): Change prototype. (unreverse_member_declarations): New function. (pushdecl_class_level): Change prototype. (grok_enum_decls): Remove. (fixup_anonymous_union): New function. (grok_x_components): Change prototype. (tsubst_chain): Remove. (finish_member_template_decl): Likewise. (check_explicit_specialization): Fix indentation. (finish_class_definition): Change prototype. (finish_member_class_template): Likewise. (finish_member_declaration): New function. (check_multiple_declarators): Likewise. * class.c (class_stack_node_t): New type. (current_class_base): Remove. (current_class_stack): Change type. (current_access_specifier): New variable. (grow_method): Remove. (check_member_decl_is_same_in_complete_scope): Break out from finish_struct. (make_method_vec): New function. (free_method_vec): Likewise. (add_implicitly_declared_members): Break out from finish_struct_1. (free_method_vecs): New variable. (add_method): Rework for direct use from parser. (handle_using_decl): Watch for NULL_TREE while iterating through CLASSTYPE_METHOD_VEC. (finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here; just do some error-checking. (warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC. (finish_struct_1): Simplify. Use add_implicitly_declared_members. (finish_struct): Change prototype. Simplify; fields and methods are already set up at this point. (init_class_processing): Set up current_class_stack. (pushclass): Save current_access_specifier. (popclass): Restore it. (currently_open_class): Simplify. (build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS. * decl.c (saved_scope): Add access_specifier. (maybe_push_to_top_level): Save it. (pop_from_top_level): Restore it. (maybe_process_template_type_declaration): Use finish_member_declaration. (pushtag): Likewise. (pushdecl_class_level): Don't return a value. (fixup_anonymous_union): Break out from grok_x_components. (shadow_tag): Use it. (xref_tag): Complain about using an elaborated type specifier to reference a template type parameter or typedef name. (xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (current_local_enum): Remove. (build_enumerator): Call finish_member_declaration. (grok_enum_decls): Remove. * decl2.c (grok_x_components): Simplify. (check_classfn): Change iteration through CLASSTYPE_METHOD_VEC. (grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (merge_functions): Add to comment. (arg_assoc_type): Prototype. (arg_assoc): Pass as many arguments as there are parameters. * error.c (dump_expr): Handle PTRMEM_CST. Improve handling of OFFSET_REF. * expr.c (cpls_expand_expr): Remove dead code. Handle PTRMEM_CST. * friend.c (do_friend): Lookup friends when in nested classes. Change comments. * init.c (build_offset_ref): Do lookup even for classes that are only partially defined. (decl_constant_value): Remove dead code. * method.c (build_overload_value): Remove hack where by TYPE was not a TYPE. Handle PTRMEM_CST. (build_template_parm_names): Don't pass a PARM_DECL where a TYPE should go. * parse.y (components, notype_components, component_decl, component_decl_1, component_declarator, component_declarator0): Now all are itype rather than ttype. Rework to add members to classes on the fly. (typesqpecqual_reserved): Use check_multiple_declarators. (structsp): Update class to finish_class_definition. (do_xref_defn): Unsplit into named_class_head. (access_specifier): Set current_access_specifier. * pt.c (set_current_access_from_decl): New function. (finish_member_template_decl): Don't take the parameters. (comp_template_args): Make more robust. (lookup_template_class): Don't use current_local_enum. (for_each_template_parm): Handle PTRMEM_CST. (instantiate_class_template): Use set_current_access_from_decl, finish_member_declaration and unreverse_member_declarations. Set lineno/input_filename before generating implicit member functions. (type_unification_real): Don't assume back-unification happens only for the last argument. (regenerate_decl_from_template): Call pushclass a bit earlier. (tsubst_chain): Remove. (tsubst_enum): Use set_current_access_from_decl. (set_mangled_name_for_template_decl): Fix indentation. * search.c (lookup_fnfields_1): Change iteration through CLASSTYPE_METHOD_VEC. (dfs_pushdecls): Likewise. (dfs_compress_decls): Likewise. (add_conversions): Likewise. * semantics.c (finish_class_definition): Don't take components. Change call to finish_struct. (finish_member_declaration): New function. (finish_member_class_template): Don't take template parameters. Change call to grok_x_components. Call finish_member_template_decl. (check_multiple_declarators): New function. * sig.c (append_signature_fields): Work from the TYPE_METHODS, not a passed in fieldlist. * tree.c (search_tree): Handle PTRMEM_CST. (mapcar): Likewise. * typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not INTEGER_CSTs, for pointer-to-data members. From-SVN: r22869
1998-10-06 16:20:30 +02:00
finish_member_class_template (types)
tree types;
{
cp-tree.h (TI_USES_TEMPLATE_PARMS): Remove. * cp-tree.h (TI_USES_TEMPLATE_PARMS): Remove. (build_template_decl_overload): Remove. (set_mangled_name_for_decl): New function. (innermost_args): Remove is_spec parameter. (most_specialized, most_specialized_class): Remove declarations. (lookup_template_class): Add entering_scope parameter. (maybe_process_partial_specialization): New function. (finish_template_decl): Likewise. (finish_template_type): Likewise. * class.c (finish_struct): Clean up processing of member template specializations. * decl.c (pushtag): Fix formatting. (lookup_tag): Improve handling of pseudo-global levels. (make_typename_type): Adjust call to lookup_template_class. (shadow_tag): Use maybe_process_partial_specialization. (xref_tag): Improve handling of member friends. (start_function): Call push_nested_class before push_template_decl. Don't call push_template_decl for specializations. * decl2.c (grok_x_components): Don't call xref_tag for template instantiations. Handle UNION_TYPEs like RECORD_TYPEs. (grokclassfn): Use set_mangled_name_for_decl. (arg_assoc_class): Adjust call to innermost_args. (mark_used): Don't call instantiate_decl for a TEMPLATE_DECL. * error.c (dump_function_name): Improve printing of template function names. * friend.c (is_friend): Don't compare types of decls to determine friendship, unless flag_guiding_decls. (make_friend_class): Partial specializations cannot be friends. (do_friend): Use set_mangled_name_for_decl. Call push_template_decl_real instead of push_template_decl. * method.c (build_decl_overload_real): Remove prototype. Give it external linkage. (build_overload_identififer): Adjust call to innermost_args. (build_template_decl_overload): Remove. (set_mangled_name_for_decl): New function. * parse.y (.finish_template_type): New non-terminal. (template_def): Use finish_template_decl. Use template_extdef instead of extdef. (template_extdef, template_datadef): New non-terminals, containing only those rules for things which can be templates. (datadef): Tidy. (template_type, self_template_type): Use .finish_template_type. (named_class_head): Use maybe_process_partial_specialization. * pt.c (mangle_class_name_for_template): Remove context parameter. (get_class_bindings): Remove outer_args parameter. (complete_template_args): Remove. (add_outermost_template_args): New function. (register_specialization): Return the specialization. (unregister_specialization): New function. (tsubst_template_parms): Likewise. (most_specialized, most_specialized_class): Prototype here as static. (original_template): Rename to most_general_template. (tsubst_template_parms): New function. (set_mangled_name_for_template_decl): Likewise. (TMPL_ARGS_DEPTH): New macro. (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Adjust. (TMPL_ARGS_LEVEL): New macro. (SET_TMPL_ARGS_LEVEL): Likewise. (TMPL_ARG): Likewise. (SET_TMPL_ARG): Likewise. (TMPL_ARGS_DEPTH): Likewise. (finish_member_template_decl): Use finish_template_decl. (maybe_process_partial_specialization): New function, split out from tsubst. (inline_needs_template_parms): Use TMPL_PARMS_DEPTH. (maybe_begin_member_template_processing): Use new macros. (is_member_template): Likewise. (is_member_template_class): Likewise. (add_to_template_args): Likewise. Deal with multiple levels of args. (maybe_process_partial_specialization): New function. (retrieve_specialization): Add consistency check. (determine_specialization): Return full argument list. (check_explicit_specialization): Tweak friend handling. Use full argument lists. Simplify. (current_template_args): Use new macros. (push_template_decl_real): Change ill-named mainargs to specargs. Check that a partial specialization actually specializes at least one parameter. Improve friend handling. Modify for full template arguments. (classtype_mangled_name): Don't mangle the names of specializations. (lookup_template_class): Add entering_scope parameter. Use it to avoid finding a template type when an instantiation is required. Simplify. Use full template arguments. (tsubst_friend_function): Use unregister_specialization. Use new macros. Use full template arguments. (tsubst_friend_class): Substitute, using tsubst_template_parms, into the template parameters before passing them to redeclare_class_template. (instantiate_class_template): Simplify. Use full template arguments. Adjust calls to get_class_bindings. Use SET_IDENTIFIER_TYPE_VALUE where needed. Improve friend handling. (innermost_args): Use new macros. (tsubst_aggr_type): New function, split out from tsubst. (tsubst): Use tsubst_aggr_type, tsubst_template_parms, new calling conventions for lookup_tmeplate_class. Refine handling of partial instantiations. Remove calls to complete_template_args. Simplify. Add consistency checks. Use set_mangled_name_for_decl and set_mangled_name_for_template_decl. (tsubst_copy): Use tsubst_aggr_type. (instantiate_template): Use full template arguments. (more_specialized): Improve formatting. (more_specialized_class): Adjust calls to get_class_bindings. (get_bindings_real): Don't call complete_template_args. (most_specialized): Don't overwrite input; create a new list. (most_specialized_class): Use most_general_template. (regenerate_decl_from_template): Use unregister_specialization. Use full template arguments. (instantiate_decl): Use full template arguments. (set_mangled_name_for_template_decl): New function. * semantics.c (begin_class_definition): Use maybe_process_partial_specialization. (finish_member_class_template): New function. (finish_template_decl): Likewise. (finish_template_type): Likewise. (typeck.c): Don't crash after issuing a compiler_error. * Makefile.in (CONFLICTS): Adjust; we removed a s/r conflict. From-SVN: r21433
1998-07-28 03:03:16 +02:00
tree t;
/* If there are declared, but undefined, partial specializations
mixed in with the typespecs they will not yet have passed through
maybe_process_partial_specialization, so we do that here. */
for (t = types; t != NULL_TREE; t = TREE_CHAIN (t))
if (IS_AGGR_TYPE_CODE (TREE_CODE (TREE_VALUE (t))))
maybe_process_partial_specialization (TREE_VALUE (t));
note_list_got_semicolon (types);
cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.h (ptrmem_cst): New type. (lang_type): Remove local_typedecls. (dummy): Increase to 12 bits from 11. (CLASSTYPE_LOCAL_TYPEDECLS): Remove. (PTRMEM_CST_CLASS): New macro. (PTRMEM_CST_MEMBER): Likewise. (current_access_specifier): New variable. (current_class_type): Remove duplicate declaration. (finish_struct): Change prototype. (unreverse_member_declarations): New function. (pushdecl_class_level): Change prototype. (grok_enum_decls): Remove. (fixup_anonymous_union): New function. (grok_x_components): Change prototype. (tsubst_chain): Remove. (finish_member_template_decl): Likewise. (check_explicit_specialization): Fix indentation. (finish_class_definition): Change prototype. (finish_member_class_template): Likewise. (finish_member_declaration): New function. (check_multiple_declarators): Likewise. * class.c (class_stack_node_t): New type. (current_class_base): Remove. (current_class_stack): Change type. (current_access_specifier): New variable. (grow_method): Remove. (check_member_decl_is_same_in_complete_scope): Break out from finish_struct. (make_method_vec): New function. (free_method_vec): Likewise. (add_implicitly_declared_members): Break out from finish_struct_1. (free_method_vecs): New variable. (add_method): Rework for direct use from parser. (handle_using_decl): Watch for NULL_TREE while iterating through CLASSTYPE_METHOD_VEC. (finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here; just do some error-checking. (warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC. (finish_struct_1): Simplify. Use add_implicitly_declared_members. (finish_struct): Change prototype. Simplify; fields and methods are already set up at this point. (init_class_processing): Set up current_class_stack. (pushclass): Save current_access_specifier. (popclass): Restore it. (currently_open_class): Simplify. (build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS. * decl.c (saved_scope): Add access_specifier. (maybe_push_to_top_level): Save it. (pop_from_top_level): Restore it. (maybe_process_template_type_declaration): Use finish_member_declaration. (pushtag): Likewise. (pushdecl_class_level): Don't return a value. (fixup_anonymous_union): Break out from grok_x_components. (shadow_tag): Use it. (xref_tag): Complain about using an elaborated type specifier to reference a template type parameter or typedef name. (xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (current_local_enum): Remove. (build_enumerator): Call finish_member_declaration. (grok_enum_decls): Remove. * decl2.c (grok_x_components): Simplify. (check_classfn): Change iteration through CLASSTYPE_METHOD_VEC. (grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (merge_functions): Add to comment. (arg_assoc_type): Prototype. (arg_assoc): Pass as many arguments as there are parameters. * error.c (dump_expr): Handle PTRMEM_CST. Improve handling of OFFSET_REF. * expr.c (cpls_expand_expr): Remove dead code. Handle PTRMEM_CST. * friend.c (do_friend): Lookup friends when in nested classes. Change comments. * init.c (build_offset_ref): Do lookup even for classes that are only partially defined. (decl_constant_value): Remove dead code. * method.c (build_overload_value): Remove hack where by TYPE was not a TYPE. Handle PTRMEM_CST. (build_template_parm_names): Don't pass a PARM_DECL where a TYPE should go. * parse.y (components, notype_components, component_decl, component_decl_1, component_declarator, component_declarator0): Now all are itype rather than ttype. Rework to add members to classes on the fly. (typesqpecqual_reserved): Use check_multiple_declarators. (structsp): Update class to finish_class_definition. (do_xref_defn): Unsplit into named_class_head. (access_specifier): Set current_access_specifier. * pt.c (set_current_access_from_decl): New function. (finish_member_template_decl): Don't take the parameters. (comp_template_args): Make more robust. (lookup_template_class): Don't use current_local_enum. (for_each_template_parm): Handle PTRMEM_CST. (instantiate_class_template): Use set_current_access_from_decl, finish_member_declaration and unreverse_member_declarations. Set lineno/input_filename before generating implicit member functions. (type_unification_real): Don't assume back-unification happens only for the last argument. (regenerate_decl_from_template): Call pushclass a bit earlier. (tsubst_chain): Remove. (tsubst_enum): Use set_current_access_from_decl. (set_mangled_name_for_template_decl): Fix indentation. * search.c (lookup_fnfields_1): Change iteration through CLASSTYPE_METHOD_VEC. (dfs_pushdecls): Likewise. (dfs_compress_decls): Likewise. (add_conversions): Likewise. * semantics.c (finish_class_definition): Don't take components. Change call to finish_struct. (finish_member_declaration): New function. (finish_member_class_template): Don't take template parameters. Change call to grok_x_components. Call finish_member_template_decl. (check_multiple_declarators): New function. * sig.c (append_signature_fields): Work from the TYPE_METHODS, not a passed in fieldlist. * tree.c (search_tree): Handle PTRMEM_CST. (mapcar): Likewise. * typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not INTEGER_CSTs, for pointer-to-data members. From-SVN: r22869
1998-10-06 16:20:30 +02:00
grok_x_components (types);
if (TYPE_CONTEXT (TREE_VALUE (types)) != current_class_type)
/* The component was in fact a friend declaration. We avoid
finish_member_template_decl performing certain checks by
unsetting TYPES. */
types = NULL_TREE;
cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.h (ptrmem_cst): New type. (lang_type): Remove local_typedecls. (dummy): Increase to 12 bits from 11. (CLASSTYPE_LOCAL_TYPEDECLS): Remove. (PTRMEM_CST_CLASS): New macro. (PTRMEM_CST_MEMBER): Likewise. (current_access_specifier): New variable. (current_class_type): Remove duplicate declaration. (finish_struct): Change prototype. (unreverse_member_declarations): New function. (pushdecl_class_level): Change prototype. (grok_enum_decls): Remove. (fixup_anonymous_union): New function. (grok_x_components): Change prototype. (tsubst_chain): Remove. (finish_member_template_decl): Likewise. (check_explicit_specialization): Fix indentation. (finish_class_definition): Change prototype. (finish_member_class_template): Likewise. (finish_member_declaration): New function. (check_multiple_declarators): Likewise. * class.c (class_stack_node_t): New type. (current_class_base): Remove. (current_class_stack): Change type. (current_access_specifier): New variable. (grow_method): Remove. (check_member_decl_is_same_in_complete_scope): Break out from finish_struct. (make_method_vec): New function. (free_method_vec): Likewise. (add_implicitly_declared_members): Break out from finish_struct_1. (free_method_vecs): New variable. (add_method): Rework for direct use from parser. (handle_using_decl): Watch for NULL_TREE while iterating through CLASSTYPE_METHOD_VEC. (finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here; just do some error-checking. (warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC. (finish_struct_1): Simplify. Use add_implicitly_declared_members. (finish_struct): Change prototype. Simplify; fields and methods are already set up at this point. (init_class_processing): Set up current_class_stack. (pushclass): Save current_access_specifier. (popclass): Restore it. (currently_open_class): Simplify. (build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS. * decl.c (saved_scope): Add access_specifier. (maybe_push_to_top_level): Save it. (pop_from_top_level): Restore it. (maybe_process_template_type_declaration): Use finish_member_declaration. (pushtag): Likewise. (pushdecl_class_level): Don't return a value. (fixup_anonymous_union): Break out from grok_x_components. (shadow_tag): Use it. (xref_tag): Complain about using an elaborated type specifier to reference a template type parameter or typedef name. (xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (current_local_enum): Remove. (build_enumerator): Call finish_member_declaration. (grok_enum_decls): Remove. * decl2.c (grok_x_components): Simplify. (check_classfn): Change iteration through CLASSTYPE_METHOD_VEC. (grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (merge_functions): Add to comment. (arg_assoc_type): Prototype. (arg_assoc): Pass as many arguments as there are parameters. * error.c (dump_expr): Handle PTRMEM_CST. Improve handling of OFFSET_REF. * expr.c (cpls_expand_expr): Remove dead code. Handle PTRMEM_CST. * friend.c (do_friend): Lookup friends when in nested classes. Change comments. * init.c (build_offset_ref): Do lookup even for classes that are only partially defined. (decl_constant_value): Remove dead code. * method.c (build_overload_value): Remove hack where by TYPE was not a TYPE. Handle PTRMEM_CST. (build_template_parm_names): Don't pass a PARM_DECL where a TYPE should go. * parse.y (components, notype_components, component_decl, component_decl_1, component_declarator, component_declarator0): Now all are itype rather than ttype. Rework to add members to classes on the fly. (typesqpecqual_reserved): Use check_multiple_declarators. (structsp): Update class to finish_class_definition. (do_xref_defn): Unsplit into named_class_head. (access_specifier): Set current_access_specifier. * pt.c (set_current_access_from_decl): New function. (finish_member_template_decl): Don't take the parameters. (comp_template_args): Make more robust. (lookup_template_class): Don't use current_local_enum. (for_each_template_parm): Handle PTRMEM_CST. (instantiate_class_template): Use set_current_access_from_decl, finish_member_declaration and unreverse_member_declarations. Set lineno/input_filename before generating implicit member functions. (type_unification_real): Don't assume back-unification happens only for the last argument. (regenerate_decl_from_template): Call pushclass a bit earlier. (tsubst_chain): Remove. (tsubst_enum): Use set_current_access_from_decl. (set_mangled_name_for_template_decl): Fix indentation. * search.c (lookup_fnfields_1): Change iteration through CLASSTYPE_METHOD_VEC. (dfs_pushdecls): Likewise. (dfs_compress_decls): Likewise. (add_conversions): Likewise. * semantics.c (finish_class_definition): Don't take components. Change call to finish_struct. (finish_member_declaration): New function. (finish_member_class_template): Don't take template parameters. Change call to grok_x_components. Call finish_member_template_decl. (check_multiple_declarators): New function. * sig.c (append_signature_fields): Work from the TYPE_METHODS, not a passed in fieldlist. * tree.c (search_tree): Handle PTRMEM_CST. (mapcar): Likewise. * typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not INTEGER_CSTs, for pointer-to-data members. From-SVN: r22869
1998-10-06 16:20:30 +02:00
finish_member_template_decl (types);
/* As with other component type declarations, we do
not store the new DECL on the list of
component_decls. */
return NULL_TREE;
}
cp-tree.h (TI_USES_TEMPLATE_PARMS): Remove. * cp-tree.h (TI_USES_TEMPLATE_PARMS): Remove. (build_template_decl_overload): Remove. (set_mangled_name_for_decl): New function. (innermost_args): Remove is_spec parameter. (most_specialized, most_specialized_class): Remove declarations. (lookup_template_class): Add entering_scope parameter. (maybe_process_partial_specialization): New function. (finish_template_decl): Likewise. (finish_template_type): Likewise. * class.c (finish_struct): Clean up processing of member template specializations. * decl.c (pushtag): Fix formatting. (lookup_tag): Improve handling of pseudo-global levels. (make_typename_type): Adjust call to lookup_template_class. (shadow_tag): Use maybe_process_partial_specialization. (xref_tag): Improve handling of member friends. (start_function): Call push_nested_class before push_template_decl. Don't call push_template_decl for specializations. * decl2.c (grok_x_components): Don't call xref_tag for template instantiations. Handle UNION_TYPEs like RECORD_TYPEs. (grokclassfn): Use set_mangled_name_for_decl. (arg_assoc_class): Adjust call to innermost_args. (mark_used): Don't call instantiate_decl for a TEMPLATE_DECL. * error.c (dump_function_name): Improve printing of template function names. * friend.c (is_friend): Don't compare types of decls to determine friendship, unless flag_guiding_decls. (make_friend_class): Partial specializations cannot be friends. (do_friend): Use set_mangled_name_for_decl. Call push_template_decl_real instead of push_template_decl. * method.c (build_decl_overload_real): Remove prototype. Give it external linkage. (build_overload_identififer): Adjust call to innermost_args. (build_template_decl_overload): Remove. (set_mangled_name_for_decl): New function. * parse.y (.finish_template_type): New non-terminal. (template_def): Use finish_template_decl. Use template_extdef instead of extdef. (template_extdef, template_datadef): New non-terminals, containing only those rules for things which can be templates. (datadef): Tidy. (template_type, self_template_type): Use .finish_template_type. (named_class_head): Use maybe_process_partial_specialization. * pt.c (mangle_class_name_for_template): Remove context parameter. (get_class_bindings): Remove outer_args parameter. (complete_template_args): Remove. (add_outermost_template_args): New function. (register_specialization): Return the specialization. (unregister_specialization): New function. (tsubst_template_parms): Likewise. (most_specialized, most_specialized_class): Prototype here as static. (original_template): Rename to most_general_template. (tsubst_template_parms): New function. (set_mangled_name_for_template_decl): Likewise. (TMPL_ARGS_DEPTH): New macro. (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Adjust. (TMPL_ARGS_LEVEL): New macro. (SET_TMPL_ARGS_LEVEL): Likewise. (TMPL_ARG): Likewise. (SET_TMPL_ARG): Likewise. (TMPL_ARGS_DEPTH): Likewise. (finish_member_template_decl): Use finish_template_decl. (maybe_process_partial_specialization): New function, split out from tsubst. (inline_needs_template_parms): Use TMPL_PARMS_DEPTH. (maybe_begin_member_template_processing): Use new macros. (is_member_template): Likewise. (is_member_template_class): Likewise. (add_to_template_args): Likewise. Deal with multiple levels of args. (maybe_process_partial_specialization): New function. (retrieve_specialization): Add consistency check. (determine_specialization): Return full argument list. (check_explicit_specialization): Tweak friend handling. Use full argument lists. Simplify. (current_template_args): Use new macros. (push_template_decl_real): Change ill-named mainargs to specargs. Check that a partial specialization actually specializes at least one parameter. Improve friend handling. Modify for full template arguments. (classtype_mangled_name): Don't mangle the names of specializations. (lookup_template_class): Add entering_scope parameter. Use it to avoid finding a template type when an instantiation is required. Simplify. Use full template arguments. (tsubst_friend_function): Use unregister_specialization. Use new macros. Use full template arguments. (tsubst_friend_class): Substitute, using tsubst_template_parms, into the template parameters before passing them to redeclare_class_template. (instantiate_class_template): Simplify. Use full template arguments. Adjust calls to get_class_bindings. Use SET_IDENTIFIER_TYPE_VALUE where needed. Improve friend handling. (innermost_args): Use new macros. (tsubst_aggr_type): New function, split out from tsubst. (tsubst): Use tsubst_aggr_type, tsubst_template_parms, new calling conventions for lookup_tmeplate_class. Refine handling of partial instantiations. Remove calls to complete_template_args. Simplify. Add consistency checks. Use set_mangled_name_for_decl and set_mangled_name_for_template_decl. (tsubst_copy): Use tsubst_aggr_type. (instantiate_template): Use full template arguments. (more_specialized): Improve formatting. (more_specialized_class): Adjust calls to get_class_bindings. (get_bindings_real): Don't call complete_template_args. (most_specialized): Don't overwrite input; create a new list. (most_specialized_class): Use most_general_template. (regenerate_decl_from_template): Use unregister_specialization. Use full template arguments. (instantiate_decl): Use full template arguments. (set_mangled_name_for_template_decl): New function. * semantics.c (begin_class_definition): Use maybe_process_partial_specialization. (finish_member_class_template): New function. (finish_template_decl): Likewise. (finish_template_type): Likewise. (typeck.c): Don't crash after issuing a compiler_error. * Makefile.in (CONFLICTS): Adjust; we removed a s/r conflict. From-SVN: r21433
1998-07-28 03:03:16 +02:00
/* Finish processing a complete template declaration. The PARMS are
cp-tree.h (TI_USES_TEMPLATE_PARMS): Remove. * cp-tree.h (TI_USES_TEMPLATE_PARMS): Remove. (build_template_decl_overload): Remove. (set_mangled_name_for_decl): New function. (innermost_args): Remove is_spec parameter. (most_specialized, most_specialized_class): Remove declarations. (lookup_template_class): Add entering_scope parameter. (maybe_process_partial_specialization): New function. (finish_template_decl): Likewise. (finish_template_type): Likewise. * class.c (finish_struct): Clean up processing of member template specializations. * decl.c (pushtag): Fix formatting. (lookup_tag): Improve handling of pseudo-global levels. (make_typename_type): Adjust call to lookup_template_class. (shadow_tag): Use maybe_process_partial_specialization. (xref_tag): Improve handling of member friends. (start_function): Call push_nested_class before push_template_decl. Don't call push_template_decl for specializations. * decl2.c (grok_x_components): Don't call xref_tag for template instantiations. Handle UNION_TYPEs like RECORD_TYPEs. (grokclassfn): Use set_mangled_name_for_decl. (arg_assoc_class): Adjust call to innermost_args. (mark_used): Don't call instantiate_decl for a TEMPLATE_DECL. * error.c (dump_function_name): Improve printing of template function names. * friend.c (is_friend): Don't compare types of decls to determine friendship, unless flag_guiding_decls. (make_friend_class): Partial specializations cannot be friends. (do_friend): Use set_mangled_name_for_decl. Call push_template_decl_real instead of push_template_decl. * method.c (build_decl_overload_real): Remove prototype. Give it external linkage. (build_overload_identififer): Adjust call to innermost_args. (build_template_decl_overload): Remove. (set_mangled_name_for_decl): New function. * parse.y (.finish_template_type): New non-terminal. (template_def): Use finish_template_decl. Use template_extdef instead of extdef. (template_extdef, template_datadef): New non-terminals, containing only those rules for things which can be templates. (datadef): Tidy. (template_type, self_template_type): Use .finish_template_type. (named_class_head): Use maybe_process_partial_specialization. * pt.c (mangle_class_name_for_template): Remove context parameter. (get_class_bindings): Remove outer_args parameter. (complete_template_args): Remove. (add_outermost_template_args): New function. (register_specialization): Return the specialization. (unregister_specialization): New function. (tsubst_template_parms): Likewise. (most_specialized, most_specialized_class): Prototype here as static. (original_template): Rename to most_general_template. (tsubst_template_parms): New function. (set_mangled_name_for_template_decl): Likewise. (TMPL_ARGS_DEPTH): New macro. (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Adjust. (TMPL_ARGS_LEVEL): New macro. (SET_TMPL_ARGS_LEVEL): Likewise. (TMPL_ARG): Likewise. (SET_TMPL_ARG): Likewise. (TMPL_ARGS_DEPTH): Likewise. (finish_member_template_decl): Use finish_template_decl. (maybe_process_partial_specialization): New function, split out from tsubst. (inline_needs_template_parms): Use TMPL_PARMS_DEPTH. (maybe_begin_member_template_processing): Use new macros. (is_member_template): Likewise. (is_member_template_class): Likewise. (add_to_template_args): Likewise. Deal with multiple levels of args. (maybe_process_partial_specialization): New function. (retrieve_specialization): Add consistency check. (determine_specialization): Return full argument list. (check_explicit_specialization): Tweak friend handling. Use full argument lists. Simplify. (current_template_args): Use new macros. (push_template_decl_real): Change ill-named mainargs to specargs. Check that a partial specialization actually specializes at least one parameter. Improve friend handling. Modify for full template arguments. (classtype_mangled_name): Don't mangle the names of specializations. (lookup_template_class): Add entering_scope parameter. Use it to avoid finding a template type when an instantiation is required. Simplify. Use full template arguments. (tsubst_friend_function): Use unregister_specialization. Use new macros. Use full template arguments. (tsubst_friend_class): Substitute, using tsubst_template_parms, into the template parameters before passing them to redeclare_class_template. (instantiate_class_template): Simplify. Use full template arguments. Adjust calls to get_class_bindings. Use SET_IDENTIFIER_TYPE_VALUE where needed. Improve friend handling. (innermost_args): Use new macros. (tsubst_aggr_type): New function, split out from tsubst. (tsubst): Use tsubst_aggr_type, tsubst_template_parms, new calling conventions for lookup_tmeplate_class. Refine handling of partial instantiations. Remove calls to complete_template_args. Simplify. Add consistency checks. Use set_mangled_name_for_decl and set_mangled_name_for_template_decl. (tsubst_copy): Use tsubst_aggr_type. (instantiate_template): Use full template arguments. (more_specialized): Improve formatting. (more_specialized_class): Adjust calls to get_class_bindings. (get_bindings_real): Don't call complete_template_args. (most_specialized): Don't overwrite input; create a new list. (most_specialized_class): Use most_general_template. (regenerate_decl_from_template): Use unregister_specialization. Use full template arguments. (instantiate_decl): Use full template arguments. (set_mangled_name_for_template_decl): New function. * semantics.c (begin_class_definition): Use maybe_process_partial_specialization. (finish_member_class_template): New function. (finish_template_decl): Likewise. (finish_template_type): Likewise. (typeck.c): Don't crash after issuing a compiler_error. * Makefile.in (CONFLICTS): Adjust; we removed a s/r conflict. From-SVN: r21433
1998-07-28 03:03:16 +02:00
the template parameters. */
void
finish_template_decl (parms)
tree parms;
{
if (parms)
end_template_decl ();
else
end_specialization ();
}
/* Finish processing a template-id (which names a type) of the form
cp-tree.h (TI_USES_TEMPLATE_PARMS): Remove. * cp-tree.h (TI_USES_TEMPLATE_PARMS): Remove. (build_template_decl_overload): Remove. (set_mangled_name_for_decl): New function. (innermost_args): Remove is_spec parameter. (most_specialized, most_specialized_class): Remove declarations. (lookup_template_class): Add entering_scope parameter. (maybe_process_partial_specialization): New function. (finish_template_decl): Likewise. (finish_template_type): Likewise. * class.c (finish_struct): Clean up processing of member template specializations. * decl.c (pushtag): Fix formatting. (lookup_tag): Improve handling of pseudo-global levels. (make_typename_type): Adjust call to lookup_template_class. (shadow_tag): Use maybe_process_partial_specialization. (xref_tag): Improve handling of member friends. (start_function): Call push_nested_class before push_template_decl. Don't call push_template_decl for specializations. * decl2.c (grok_x_components): Don't call xref_tag for template instantiations. Handle UNION_TYPEs like RECORD_TYPEs. (grokclassfn): Use set_mangled_name_for_decl. (arg_assoc_class): Adjust call to innermost_args. (mark_used): Don't call instantiate_decl for a TEMPLATE_DECL. * error.c (dump_function_name): Improve printing of template function names. * friend.c (is_friend): Don't compare types of decls to determine friendship, unless flag_guiding_decls. (make_friend_class): Partial specializations cannot be friends. (do_friend): Use set_mangled_name_for_decl. Call push_template_decl_real instead of push_template_decl. * method.c (build_decl_overload_real): Remove prototype. Give it external linkage. (build_overload_identififer): Adjust call to innermost_args. (build_template_decl_overload): Remove. (set_mangled_name_for_decl): New function. * parse.y (.finish_template_type): New non-terminal. (template_def): Use finish_template_decl. Use template_extdef instead of extdef. (template_extdef, template_datadef): New non-terminals, containing only those rules for things which can be templates. (datadef): Tidy. (template_type, self_template_type): Use .finish_template_type. (named_class_head): Use maybe_process_partial_specialization. * pt.c (mangle_class_name_for_template): Remove context parameter. (get_class_bindings): Remove outer_args parameter. (complete_template_args): Remove. (add_outermost_template_args): New function. (register_specialization): Return the specialization. (unregister_specialization): New function. (tsubst_template_parms): Likewise. (most_specialized, most_specialized_class): Prototype here as static. (original_template): Rename to most_general_template. (tsubst_template_parms): New function. (set_mangled_name_for_template_decl): Likewise. (TMPL_ARGS_DEPTH): New macro. (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Adjust. (TMPL_ARGS_LEVEL): New macro. (SET_TMPL_ARGS_LEVEL): Likewise. (TMPL_ARG): Likewise. (SET_TMPL_ARG): Likewise. (TMPL_ARGS_DEPTH): Likewise. (finish_member_template_decl): Use finish_template_decl. (maybe_process_partial_specialization): New function, split out from tsubst. (inline_needs_template_parms): Use TMPL_PARMS_DEPTH. (maybe_begin_member_template_processing): Use new macros. (is_member_template): Likewise. (is_member_template_class): Likewise. (add_to_template_args): Likewise. Deal with multiple levels of args. (maybe_process_partial_specialization): New function. (retrieve_specialization): Add consistency check. (determine_specialization): Return full argument list. (check_explicit_specialization): Tweak friend handling. Use full argument lists. Simplify. (current_template_args): Use new macros. (push_template_decl_real): Change ill-named mainargs to specargs. Check that a partial specialization actually specializes at least one parameter. Improve friend handling. Modify for full template arguments. (classtype_mangled_name): Don't mangle the names of specializations. (lookup_template_class): Add entering_scope parameter. Use it to avoid finding a template type when an instantiation is required. Simplify. Use full template arguments. (tsubst_friend_function): Use unregister_specialization. Use new macros. Use full template arguments. (tsubst_friend_class): Substitute, using tsubst_template_parms, into the template parameters before passing them to redeclare_class_template. (instantiate_class_template): Simplify. Use full template arguments. Adjust calls to get_class_bindings. Use SET_IDENTIFIER_TYPE_VALUE where needed. Improve friend handling. (innermost_args): Use new macros. (tsubst_aggr_type): New function, split out from tsubst. (tsubst): Use tsubst_aggr_type, tsubst_template_parms, new calling conventions for lookup_tmeplate_class. Refine handling of partial instantiations. Remove calls to complete_template_args. Simplify. Add consistency checks. Use set_mangled_name_for_decl and set_mangled_name_for_template_decl. (tsubst_copy): Use tsubst_aggr_type. (instantiate_template): Use full template arguments. (more_specialized): Improve formatting. (more_specialized_class): Adjust calls to get_class_bindings. (get_bindings_real): Don't call complete_template_args. (most_specialized): Don't overwrite input; create a new list. (most_specialized_class): Use most_general_template. (regenerate_decl_from_template): Use unregister_specialization. Use full template arguments. (instantiate_decl): Use full template arguments. (set_mangled_name_for_template_decl): New function. * semantics.c (begin_class_definition): Use maybe_process_partial_specialization. (finish_member_class_template): New function. (finish_template_decl): Likewise. (finish_template_type): Likewise. (typeck.c): Don't crash after issuing a compiler_error. * Makefile.in (CONFLICTS): Adjust; we removed a s/r conflict. From-SVN: r21433
1998-07-28 03:03:16 +02:00
NAME < ARGS >. Return the TYPE_DECL for the type named by the
template-id. If ENTERING_SCOPE is nonzero we are about to enter
cp-tree.h (TI_USES_TEMPLATE_PARMS): Remove. * cp-tree.h (TI_USES_TEMPLATE_PARMS): Remove. (build_template_decl_overload): Remove. (set_mangled_name_for_decl): New function. (innermost_args): Remove is_spec parameter. (most_specialized, most_specialized_class): Remove declarations. (lookup_template_class): Add entering_scope parameter. (maybe_process_partial_specialization): New function. (finish_template_decl): Likewise. (finish_template_type): Likewise. * class.c (finish_struct): Clean up processing of member template specializations. * decl.c (pushtag): Fix formatting. (lookup_tag): Improve handling of pseudo-global levels. (make_typename_type): Adjust call to lookup_template_class. (shadow_tag): Use maybe_process_partial_specialization. (xref_tag): Improve handling of member friends. (start_function): Call push_nested_class before push_template_decl. Don't call push_template_decl for specializations. * decl2.c (grok_x_components): Don't call xref_tag for template instantiations. Handle UNION_TYPEs like RECORD_TYPEs. (grokclassfn): Use set_mangled_name_for_decl. (arg_assoc_class): Adjust call to innermost_args. (mark_used): Don't call instantiate_decl for a TEMPLATE_DECL. * error.c (dump_function_name): Improve printing of template function names. * friend.c (is_friend): Don't compare types of decls to determine friendship, unless flag_guiding_decls. (make_friend_class): Partial specializations cannot be friends. (do_friend): Use set_mangled_name_for_decl. Call push_template_decl_real instead of push_template_decl. * method.c (build_decl_overload_real): Remove prototype. Give it external linkage. (build_overload_identififer): Adjust call to innermost_args. (build_template_decl_overload): Remove. (set_mangled_name_for_decl): New function. * parse.y (.finish_template_type): New non-terminal. (template_def): Use finish_template_decl. Use template_extdef instead of extdef. (template_extdef, template_datadef): New non-terminals, containing only those rules for things which can be templates. (datadef): Tidy. (template_type, self_template_type): Use .finish_template_type. (named_class_head): Use maybe_process_partial_specialization. * pt.c (mangle_class_name_for_template): Remove context parameter. (get_class_bindings): Remove outer_args parameter. (complete_template_args): Remove. (add_outermost_template_args): New function. (register_specialization): Return the specialization. (unregister_specialization): New function. (tsubst_template_parms): Likewise. (most_specialized, most_specialized_class): Prototype here as static. (original_template): Rename to most_general_template. (tsubst_template_parms): New function. (set_mangled_name_for_template_decl): Likewise. (TMPL_ARGS_DEPTH): New macro. (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Adjust. (TMPL_ARGS_LEVEL): New macro. (SET_TMPL_ARGS_LEVEL): Likewise. (TMPL_ARG): Likewise. (SET_TMPL_ARG): Likewise. (TMPL_ARGS_DEPTH): Likewise. (finish_member_template_decl): Use finish_template_decl. (maybe_process_partial_specialization): New function, split out from tsubst. (inline_needs_template_parms): Use TMPL_PARMS_DEPTH. (maybe_begin_member_template_processing): Use new macros. (is_member_template): Likewise. (is_member_template_class): Likewise. (add_to_template_args): Likewise. Deal with multiple levels of args. (maybe_process_partial_specialization): New function. (retrieve_specialization): Add consistency check. (determine_specialization): Return full argument list. (check_explicit_specialization): Tweak friend handling. Use full argument lists. Simplify. (current_template_args): Use new macros. (push_template_decl_real): Change ill-named mainargs to specargs. Check that a partial specialization actually specializes at least one parameter. Improve friend handling. Modify for full template arguments. (classtype_mangled_name): Don't mangle the names of specializations. (lookup_template_class): Add entering_scope parameter. Use it to avoid finding a template type when an instantiation is required. Simplify. Use full template arguments. (tsubst_friend_function): Use unregister_specialization. Use new macros. Use full template arguments. (tsubst_friend_class): Substitute, using tsubst_template_parms, into the template parameters before passing them to redeclare_class_template. (instantiate_class_template): Simplify. Use full template arguments. Adjust calls to get_class_bindings. Use SET_IDENTIFIER_TYPE_VALUE where needed. Improve friend handling. (innermost_args): Use new macros. (tsubst_aggr_type): New function, split out from tsubst. (tsubst): Use tsubst_aggr_type, tsubst_template_parms, new calling conventions for lookup_tmeplate_class. Refine handling of partial instantiations. Remove calls to complete_template_args. Simplify. Add consistency checks. Use set_mangled_name_for_decl and set_mangled_name_for_template_decl. (tsubst_copy): Use tsubst_aggr_type. (instantiate_template): Use full template arguments. (more_specialized): Improve formatting. (more_specialized_class): Adjust calls to get_class_bindings. (get_bindings_real): Don't call complete_template_args. (most_specialized): Don't overwrite input; create a new list. (most_specialized_class): Use most_general_template. (regenerate_decl_from_template): Use unregister_specialization. Use full template arguments. (instantiate_decl): Use full template arguments. (set_mangled_name_for_template_decl): New function. * semantics.c (begin_class_definition): Use maybe_process_partial_specialization. (finish_member_class_template): New function. (finish_template_decl): Likewise. (finish_template_type): Likewise. (typeck.c): Don't crash after issuing a compiler_error. * Makefile.in (CONFLICTS): Adjust; we removed a s/r conflict. From-SVN: r21433
1998-07-28 03:03:16 +02:00
the scope of template-id indicated. */
tree
finish_template_type (name, args, entering_scope)
tree name;
tree args;
int entering_scope;
{
tree decl;
decl = lookup_template_class (name, args,
NULL_TREE, NULL_TREE,
entering_scope, /*complain=*/1);
cp-tree.h (TI_USES_TEMPLATE_PARMS): Remove. * cp-tree.h (TI_USES_TEMPLATE_PARMS): Remove. (build_template_decl_overload): Remove. (set_mangled_name_for_decl): New function. (innermost_args): Remove is_spec parameter. (most_specialized, most_specialized_class): Remove declarations. (lookup_template_class): Add entering_scope parameter. (maybe_process_partial_specialization): New function. (finish_template_decl): Likewise. (finish_template_type): Likewise. * class.c (finish_struct): Clean up processing of member template specializations. * decl.c (pushtag): Fix formatting. (lookup_tag): Improve handling of pseudo-global levels. (make_typename_type): Adjust call to lookup_template_class. (shadow_tag): Use maybe_process_partial_specialization. (xref_tag): Improve handling of member friends. (start_function): Call push_nested_class before push_template_decl. Don't call push_template_decl for specializations. * decl2.c (grok_x_components): Don't call xref_tag for template instantiations. Handle UNION_TYPEs like RECORD_TYPEs. (grokclassfn): Use set_mangled_name_for_decl. (arg_assoc_class): Adjust call to innermost_args. (mark_used): Don't call instantiate_decl for a TEMPLATE_DECL. * error.c (dump_function_name): Improve printing of template function names. * friend.c (is_friend): Don't compare types of decls to determine friendship, unless flag_guiding_decls. (make_friend_class): Partial specializations cannot be friends. (do_friend): Use set_mangled_name_for_decl. Call push_template_decl_real instead of push_template_decl. * method.c (build_decl_overload_real): Remove prototype. Give it external linkage. (build_overload_identififer): Adjust call to innermost_args. (build_template_decl_overload): Remove. (set_mangled_name_for_decl): New function. * parse.y (.finish_template_type): New non-terminal. (template_def): Use finish_template_decl. Use template_extdef instead of extdef. (template_extdef, template_datadef): New non-terminals, containing only those rules for things which can be templates. (datadef): Tidy. (template_type, self_template_type): Use .finish_template_type. (named_class_head): Use maybe_process_partial_specialization. * pt.c (mangle_class_name_for_template): Remove context parameter. (get_class_bindings): Remove outer_args parameter. (complete_template_args): Remove. (add_outermost_template_args): New function. (register_specialization): Return the specialization. (unregister_specialization): New function. (tsubst_template_parms): Likewise. (most_specialized, most_specialized_class): Prototype here as static. (original_template): Rename to most_general_template. (tsubst_template_parms): New function. (set_mangled_name_for_template_decl): Likewise. (TMPL_ARGS_DEPTH): New macro. (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Adjust. (TMPL_ARGS_LEVEL): New macro. (SET_TMPL_ARGS_LEVEL): Likewise. (TMPL_ARG): Likewise. (SET_TMPL_ARG): Likewise. (TMPL_ARGS_DEPTH): Likewise. (finish_member_template_decl): Use finish_template_decl. (maybe_process_partial_specialization): New function, split out from tsubst. (inline_needs_template_parms): Use TMPL_PARMS_DEPTH. (maybe_begin_member_template_processing): Use new macros. (is_member_template): Likewise. (is_member_template_class): Likewise. (add_to_template_args): Likewise. Deal with multiple levels of args. (maybe_process_partial_specialization): New function. (retrieve_specialization): Add consistency check. (determine_specialization): Return full argument list. (check_explicit_specialization): Tweak friend handling. Use full argument lists. Simplify. (current_template_args): Use new macros. (push_template_decl_real): Change ill-named mainargs to specargs. Check that a partial specialization actually specializes at least one parameter. Improve friend handling. Modify for full template arguments. (classtype_mangled_name): Don't mangle the names of specializations. (lookup_template_class): Add entering_scope parameter. Use it to avoid finding a template type when an instantiation is required. Simplify. Use full template arguments. (tsubst_friend_function): Use unregister_specialization. Use new macros. Use full template arguments. (tsubst_friend_class): Substitute, using tsubst_template_parms, into the template parameters before passing them to redeclare_class_template. (instantiate_class_template): Simplify. Use full template arguments. Adjust calls to get_class_bindings. Use SET_IDENTIFIER_TYPE_VALUE where needed. Improve friend handling. (innermost_args): Use new macros. (tsubst_aggr_type): New function, split out from tsubst. (tsubst): Use tsubst_aggr_type, tsubst_template_parms, new calling conventions for lookup_tmeplate_class. Refine handling of partial instantiations. Remove calls to complete_template_args. Simplify. Add consistency checks. Use set_mangled_name_for_decl and set_mangled_name_for_template_decl. (tsubst_copy): Use tsubst_aggr_type. (instantiate_template): Use full template arguments. (more_specialized): Improve formatting. (more_specialized_class): Adjust calls to get_class_bindings. (get_bindings_real): Don't call complete_template_args. (most_specialized): Don't overwrite input; create a new list. (most_specialized_class): Use most_general_template. (regenerate_decl_from_template): Use unregister_specialization. Use full template arguments. (instantiate_decl): Use full template arguments. (set_mangled_name_for_template_decl): New function. * semantics.c (begin_class_definition): Use maybe_process_partial_specialization. (finish_member_class_template): New function. (finish_template_decl): Likewise. (finish_template_type): Likewise. (typeck.c): Don't crash after issuing a compiler_error. * Makefile.in (CONFLICTS): Adjust; we removed a s/r conflict. From-SVN: r21433
1998-07-28 03:03:16 +02:00
if (decl != error_mark_node)
decl = TYPE_STUB_DECL (decl);
return decl;
}
/* SR is a SCOPE_REF node. Enter the scope of SR, whether it is a
namespace scope or a class scope. */
void
enter_scope_of (sr)
tree sr;
{
tree scope = TREE_OPERAND (sr, 0);
if (TREE_CODE (scope) == NAMESPACE_DECL)
{
push_decl_namespace (scope);
TREE_COMPLEXITY (sr) = -1;
}
else if (scope != current_class_type)
{
if (TREE_CODE (scope) == TYPENAME_TYPE)
{
/* In a declarator for a template class member, the scope will
get here as an implicit typename, a TYPENAME_TYPE with a type. */
scope = TREE_TYPE (scope);
TREE_OPERAND (sr, 0) = scope;
}
push_nested_class (scope, 3);
TREE_COMPLEXITY (sr) = current_class_depth;
}
}
/* Finish processing a BASE_CLASS with the indicated ACCESS_SPECIFIER.
Return a TREE_LIST containing the ACCESS_SPECIFIER and the
BASE_CLASS, or NULL_TREE if an error occurred. The
ACCESS_SPECIFIER is one of
access_{default,public,protected_private}[_virtual]_node.*/
tree
extend.texi (C++ Signatures): Remove node. * extend.texi (C++ Signatures): Remove node. * invoke.texi: Remove discussion of -fhandle-signatures, signature, sigof, __signature__, and __sigof__. * Make-lang.in (CXX_SRCS): Remove sig.c. * Makefile.in (CXX_OBJS): Remove sig.o. (sig.o): Remove. * cp-tree.h (CPTI_OPAQUE_TYPE): Remove. (CPTI_SIGNATURE_TYPE): Likewise. (CPTI_SIGTABLE_ENTRY_TYPE): Likewise. (opaque_type_node): Likewise. (signature_type_node): Likewise. (sigtable_entry_type): Likewise. (flag_handle_signatures): Likewise. (lang_type): Remove is_signature, is_signature_pointer, is_signature_reference, has_opaque_typedecls, sigtables_has_been_generated. Adjust dummy. Remove signature, signature_pointer_to, signature_reference_to. (IS_SIGNATURE): Remove. (SET_SIGNATURE): Remove. (CLEAR_SIGNATURE): Remove. (IS_SIGNATURE_POINTER): Remove. (IS_SIGNATURE_REFERENCE): Remove. (SIGNATURE_HAS_OPAQUE_TYPEDECLS): Remove. (SIGTABLE_HAS_BEEN_GENERATED): Remove. (CLASSTYPE_SIGNATURE): Remove. (SIGNATURE_TYPE): Remove. (SIGNATURE_METHOD_VEC): Remove. (SIGNATURE_POINTER_TO): Remove. (SIGNATURE_REFERENCE_TO): Remove. (lang_decl_flags): Remove is_default_implementation. Rename memfunc_pointer_to to saved_tree. (IS_DEFAULT_IMPLEMENTATION): Remove. (DECL_MEMFUNC_POINTER_TO): Remove. (DECL_MEMFUNC_POINTING_TO): Remove. (DECL_SAVED_TREE): Adjust definition. (tag_types): Remove signature_type_node. (SIGNATURE_FIELD_NAME): Remove. (SIGNATURE_FIELD_NAME_FORMAT): Likewise. (SIGNATURE_OPTR_NAME): Likewise. (SIGNATURE_SPTR_NAME): Likewise. (SIGNATURE_POINTER_NAME): Likewise. (SIGNATURE_POINTER_NAME_FORMAT): Likewise. (SIGNATURE_REFERENCE_NAME): Likewise. (SIGNATURE_REFERNECE_NAME_FORMAT): Likewise. (SIGTABLE_PTR_TYPE): Likewise. (SIGTABLE_NAME_FORMAT): Likewise. (SIGTABLE_NAME_FORMAT_LONG): Likewise. (SIGTABLE_TAG_NAME): Likewise. (SIGTABLE_VB_OFF_NAME): Likewise. (SIGTABLE_VT_OFF_NAME): Likewise. (finish_base_specifiers): Change prototype. (build_signature_pointer_type): Remove. (build_signature_reference_type): Remove. (build_signature_pointer_constructor): Remove. (build_signature_method_call): Remove. (build_optr_ref): Likewise. (append_signature_fields): Likewise. (signature_error): Likewise. * call.c (build_this): Remove signature support. (build_over_call): Likewise. (build_new_method_call): Likewise. * class.c (add_implicitly_declared_members): Likewise. (finish_struct_1): Likewise. (finish_struct): Likewise. * cvt.c (cp_convert_to_pointer): Likewise. (convert_to_pointer_force): Likewise. (ocp_convert): Likewise. * decl.c (sigtable_decl_p): Remove. (init_decl_processing): Remove support for signatures. (cp_finish_decl): Likewise. (grokdeclarator): Likewise. (grokparms): Likewise. (xref_tag): Likewise. (start_function): Likewise. (start_method): Likewise. * decl2.c (finish_sigtable_vardecl): Remove. (flag_handle_signatures): Remove. (lang_f_options): Remove handle-signatures. (grokfield): Remove support for signatures. (grokbitfield): Likewise. (finish_file): Likewise. (reparse_absdcl_as_casts): Likewise. * error.c (dump_type_real): Likewise. (dump_function_decl): Likewise. * friend.c (make_friend_class): Likewise. * gxx.gperf: Remove __signature__, signature, __sigof__, sigof. * hash.h: Regenerated. * init.c (build_new_1): Remove support for signatures. * lang-options.h: Remove -fhandle-signatures, -fno-handle-signatures. * lex.c (init_parse): Remove support for signatures. (yyprint): Likewise. * lex.h (rid): Remove RID_SIGNATURE. * method.c (build_decl_overload_real): Remove support for signatures. (hack_identifier): Likewise. * parse.y (base_class): Likewise. (base_class.1): Likewise. (access_specifier): Likewise. * search.c (lookup_member): Likewise. * semantics.c (finish_qualified_object_call_expr): Likewise. (finish_template_type_parm): Likewise. (begin_class_definition): Likewise. (finish_base_specifier): Likewise. * sig.c: Remove. * tree.c (build_cplus_method_type): Remove support for signatures. * typeck.c (require_complete_type): Likewise. (c_sizeof): Likewise. (c_alignof): Likewise. (build_object_ref): Likewise. (build_component_ref): Likewise. (build_indirect_ref): Likewise. (build_c_cast): Likewise. (build_modify_expr): Likewise. (convert_for_initialization): Likewise. * typeck2.c (signature_error): Remove. (store_init_value): Remove support for signatures. (digest_init): Likewise. (build_x_arrow): Likewise. (build_functional_cast): Likewise. * xref.c (GNU_xref_decl): Likewise. From-SVN: r28677
1999-08-11 22:22:41 +02:00
finish_base_specifier (access_specifier, base_class)
tree access_specifier;
tree base_class;
{
tree result;
if (base_class == error_mark_node)
{
error ("invalid base-class specification");
result = NULL_TREE;
}
else if (! is_aggr_type (base_class, 1))
result = NULL_TREE;
else
{
2001-11-22 03:33:02 +01:00
if (cp_type_quals (base_class) != 0)
{
error ("base class `%T' has cv qualifiers", base_class);
base_class = TYPE_MAIN_VARIANT (base_class);
}
result = build_tree_list (access_specifier, base_class);
}
return result;
}
cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.h (ptrmem_cst): New type. (lang_type): Remove local_typedecls. (dummy): Increase to 12 bits from 11. (CLASSTYPE_LOCAL_TYPEDECLS): Remove. (PTRMEM_CST_CLASS): New macro. (PTRMEM_CST_MEMBER): Likewise. (current_access_specifier): New variable. (current_class_type): Remove duplicate declaration. (finish_struct): Change prototype. (unreverse_member_declarations): New function. (pushdecl_class_level): Change prototype. (grok_enum_decls): Remove. (fixup_anonymous_union): New function. (grok_x_components): Change prototype. (tsubst_chain): Remove. (finish_member_template_decl): Likewise. (check_explicit_specialization): Fix indentation. (finish_class_definition): Change prototype. (finish_member_class_template): Likewise. (finish_member_declaration): New function. (check_multiple_declarators): Likewise. * class.c (class_stack_node_t): New type. (current_class_base): Remove. (current_class_stack): Change type. (current_access_specifier): New variable. (grow_method): Remove. (check_member_decl_is_same_in_complete_scope): Break out from finish_struct. (make_method_vec): New function. (free_method_vec): Likewise. (add_implicitly_declared_members): Break out from finish_struct_1. (free_method_vecs): New variable. (add_method): Rework for direct use from parser. (handle_using_decl): Watch for NULL_TREE while iterating through CLASSTYPE_METHOD_VEC. (finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here; just do some error-checking. (warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC. (finish_struct_1): Simplify. Use add_implicitly_declared_members. (finish_struct): Change prototype. Simplify; fields and methods are already set up at this point. (init_class_processing): Set up current_class_stack. (pushclass): Save current_access_specifier. (popclass): Restore it. (currently_open_class): Simplify. (build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS. * decl.c (saved_scope): Add access_specifier. (maybe_push_to_top_level): Save it. (pop_from_top_level): Restore it. (maybe_process_template_type_declaration): Use finish_member_declaration. (pushtag): Likewise. (pushdecl_class_level): Don't return a value. (fixup_anonymous_union): Break out from grok_x_components. (shadow_tag): Use it. (xref_tag): Complain about using an elaborated type specifier to reference a template type parameter or typedef name. (xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (current_local_enum): Remove. (build_enumerator): Call finish_member_declaration. (grok_enum_decls): Remove. * decl2.c (grok_x_components): Simplify. (check_classfn): Change iteration through CLASSTYPE_METHOD_VEC. (grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (merge_functions): Add to comment. (arg_assoc_type): Prototype. (arg_assoc): Pass as many arguments as there are parameters. * error.c (dump_expr): Handle PTRMEM_CST. Improve handling of OFFSET_REF. * expr.c (cpls_expand_expr): Remove dead code. Handle PTRMEM_CST. * friend.c (do_friend): Lookup friends when in nested classes. Change comments. * init.c (build_offset_ref): Do lookup even for classes that are only partially defined. (decl_constant_value): Remove dead code. * method.c (build_overload_value): Remove hack where by TYPE was not a TYPE. Handle PTRMEM_CST. (build_template_parm_names): Don't pass a PARM_DECL where a TYPE should go. * parse.y (components, notype_components, component_decl, component_decl_1, component_declarator, component_declarator0): Now all are itype rather than ttype. Rework to add members to classes on the fly. (typesqpecqual_reserved): Use check_multiple_declarators. (structsp): Update class to finish_class_definition. (do_xref_defn): Unsplit into named_class_head. (access_specifier): Set current_access_specifier. * pt.c (set_current_access_from_decl): New function. (finish_member_template_decl): Don't take the parameters. (comp_template_args): Make more robust. (lookup_template_class): Don't use current_local_enum. (for_each_template_parm): Handle PTRMEM_CST. (instantiate_class_template): Use set_current_access_from_decl, finish_member_declaration and unreverse_member_declarations. Set lineno/input_filename before generating implicit member functions. (type_unification_real): Don't assume back-unification happens only for the last argument. (regenerate_decl_from_template): Call pushclass a bit earlier. (tsubst_chain): Remove. (tsubst_enum): Use set_current_access_from_decl. (set_mangled_name_for_template_decl): Fix indentation. * search.c (lookup_fnfields_1): Change iteration through CLASSTYPE_METHOD_VEC. (dfs_pushdecls): Likewise. (dfs_compress_decls): Likewise. (add_conversions): Likewise. * semantics.c (finish_class_definition): Don't take components. Change call to finish_struct. (finish_member_declaration): New function. (finish_member_class_template): Don't take template parameters. Change call to grok_x_components. Call finish_member_template_decl. (check_multiple_declarators): New function. * sig.c (append_signature_fields): Work from the TYPE_METHODS, not a passed in fieldlist. * tree.c (search_tree): Handle PTRMEM_CST. (mapcar): Likewise. * typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not INTEGER_CSTs, for pointer-to-data members. From-SVN: r22869
1998-10-06 16:20:30 +02:00
/* Called when multiple declarators are processed. If that is not
premitted in this context, an error is issued. */
void
check_multiple_declarators ()
{
/* [temp]
In a template-declaration, explicit specialization, or explicit
instantiation the init-declarator-list in the declaration shall
contain at most one declarator.
We don't just use PROCESSING_TEMPLATE_DECL for the first
condition since that would disallow the perfectly valid code,
cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.h (ptrmem_cst): New type. (lang_type): Remove local_typedecls. (dummy): Increase to 12 bits from 11. (CLASSTYPE_LOCAL_TYPEDECLS): Remove. (PTRMEM_CST_CLASS): New macro. (PTRMEM_CST_MEMBER): Likewise. (current_access_specifier): New variable. (current_class_type): Remove duplicate declaration. (finish_struct): Change prototype. (unreverse_member_declarations): New function. (pushdecl_class_level): Change prototype. (grok_enum_decls): Remove. (fixup_anonymous_union): New function. (grok_x_components): Change prototype. (tsubst_chain): Remove. (finish_member_template_decl): Likewise. (check_explicit_specialization): Fix indentation. (finish_class_definition): Change prototype. (finish_member_class_template): Likewise. (finish_member_declaration): New function. (check_multiple_declarators): Likewise. * class.c (class_stack_node_t): New type. (current_class_base): Remove. (current_class_stack): Change type. (current_access_specifier): New variable. (grow_method): Remove. (check_member_decl_is_same_in_complete_scope): Break out from finish_struct. (make_method_vec): New function. (free_method_vec): Likewise. (add_implicitly_declared_members): Break out from finish_struct_1. (free_method_vecs): New variable. (add_method): Rework for direct use from parser. (handle_using_decl): Watch for NULL_TREE while iterating through CLASSTYPE_METHOD_VEC. (finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here; just do some error-checking. (warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC. (finish_struct_1): Simplify. Use add_implicitly_declared_members. (finish_struct): Change prototype. Simplify; fields and methods are already set up at this point. (init_class_processing): Set up current_class_stack. (pushclass): Save current_access_specifier. (popclass): Restore it. (currently_open_class): Simplify. (build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS. * decl.c (saved_scope): Add access_specifier. (maybe_push_to_top_level): Save it. (pop_from_top_level): Restore it. (maybe_process_template_type_declaration): Use finish_member_declaration. (pushtag): Likewise. (pushdecl_class_level): Don't return a value. (fixup_anonymous_union): Break out from grok_x_components. (shadow_tag): Use it. (xref_tag): Complain about using an elaborated type specifier to reference a template type parameter or typedef name. (xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (current_local_enum): Remove. (build_enumerator): Call finish_member_declaration. (grok_enum_decls): Remove. * decl2.c (grok_x_components): Simplify. (check_classfn): Change iteration through CLASSTYPE_METHOD_VEC. (grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (merge_functions): Add to comment. (arg_assoc_type): Prototype. (arg_assoc): Pass as many arguments as there are parameters. * error.c (dump_expr): Handle PTRMEM_CST. Improve handling of OFFSET_REF. * expr.c (cpls_expand_expr): Remove dead code. Handle PTRMEM_CST. * friend.c (do_friend): Lookup friends when in nested classes. Change comments. * init.c (build_offset_ref): Do lookup even for classes that are only partially defined. (decl_constant_value): Remove dead code. * method.c (build_overload_value): Remove hack where by TYPE was not a TYPE. Handle PTRMEM_CST. (build_template_parm_names): Don't pass a PARM_DECL where a TYPE should go. * parse.y (components, notype_components, component_decl, component_decl_1, component_declarator, component_declarator0): Now all are itype rather than ttype. Rework to add members to classes on the fly. (typesqpecqual_reserved): Use check_multiple_declarators. (structsp): Update class to finish_class_definition. (do_xref_defn): Unsplit into named_class_head. (access_specifier): Set current_access_specifier. * pt.c (set_current_access_from_decl): New function. (finish_member_template_decl): Don't take the parameters. (comp_template_args): Make more robust. (lookup_template_class): Don't use current_local_enum. (for_each_template_parm): Handle PTRMEM_CST. (instantiate_class_template): Use set_current_access_from_decl, finish_member_declaration and unreverse_member_declarations. Set lineno/input_filename before generating implicit member functions. (type_unification_real): Don't assume back-unification happens only for the last argument. (regenerate_decl_from_template): Call pushclass a bit earlier. (tsubst_chain): Remove. (tsubst_enum): Use set_current_access_from_decl. (set_mangled_name_for_template_decl): Fix indentation. * search.c (lookup_fnfields_1): Change iteration through CLASSTYPE_METHOD_VEC. (dfs_pushdecls): Likewise. (dfs_compress_decls): Likewise. (add_conversions): Likewise. * semantics.c (finish_class_definition): Don't take components. Change call to finish_struct. (finish_member_declaration): New function. (finish_member_class_template): Don't take template parameters. Change call to grok_x_components. Call finish_member_template_decl. (check_multiple_declarators): New function. * sig.c (append_signature_fields): Work from the TYPE_METHODS, not a passed in fieldlist. * tree.c (search_tree): Handle PTRMEM_CST. (mapcar): Likewise. * typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not INTEGER_CSTs, for pointer-to-data members. From-SVN: r22869
1998-10-06 16:20:30 +02:00
like `template <class T> struct S { int i, j; };'. */
if (at_function_scope_p ())
cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.h (ptrmem_cst): New type. (lang_type): Remove local_typedecls. (dummy): Increase to 12 bits from 11. (CLASSTYPE_LOCAL_TYPEDECLS): Remove. (PTRMEM_CST_CLASS): New macro. (PTRMEM_CST_MEMBER): Likewise. (current_access_specifier): New variable. (current_class_type): Remove duplicate declaration. (finish_struct): Change prototype. (unreverse_member_declarations): New function. (pushdecl_class_level): Change prototype. (grok_enum_decls): Remove. (fixup_anonymous_union): New function. (grok_x_components): Change prototype. (tsubst_chain): Remove. (finish_member_template_decl): Likewise. (check_explicit_specialization): Fix indentation. (finish_class_definition): Change prototype. (finish_member_class_template): Likewise. (finish_member_declaration): New function. (check_multiple_declarators): Likewise. * class.c (class_stack_node_t): New type. (current_class_base): Remove. (current_class_stack): Change type. (current_access_specifier): New variable. (grow_method): Remove. (check_member_decl_is_same_in_complete_scope): Break out from finish_struct. (make_method_vec): New function. (free_method_vec): Likewise. (add_implicitly_declared_members): Break out from finish_struct_1. (free_method_vecs): New variable. (add_method): Rework for direct use from parser. (handle_using_decl): Watch for NULL_TREE while iterating through CLASSTYPE_METHOD_VEC. (finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here; just do some error-checking. (warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC. (finish_struct_1): Simplify. Use add_implicitly_declared_members. (finish_struct): Change prototype. Simplify; fields and methods are already set up at this point. (init_class_processing): Set up current_class_stack. (pushclass): Save current_access_specifier. (popclass): Restore it. (currently_open_class): Simplify. (build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS. * decl.c (saved_scope): Add access_specifier. (maybe_push_to_top_level): Save it. (pop_from_top_level): Restore it. (maybe_process_template_type_declaration): Use finish_member_declaration. (pushtag): Likewise. (pushdecl_class_level): Don't return a value. (fixup_anonymous_union): Break out from grok_x_components. (shadow_tag): Use it. (xref_tag): Complain about using an elaborated type specifier to reference a template type parameter or typedef name. (xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (current_local_enum): Remove. (build_enumerator): Call finish_member_declaration. (grok_enum_decls): Remove. * decl2.c (grok_x_components): Simplify. (check_classfn): Change iteration through CLASSTYPE_METHOD_VEC. (grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (merge_functions): Add to comment. (arg_assoc_type): Prototype. (arg_assoc): Pass as many arguments as there are parameters. * error.c (dump_expr): Handle PTRMEM_CST. Improve handling of OFFSET_REF. * expr.c (cpls_expand_expr): Remove dead code. Handle PTRMEM_CST. * friend.c (do_friend): Lookup friends when in nested classes. Change comments. * init.c (build_offset_ref): Do lookup even for classes that are only partially defined. (decl_constant_value): Remove dead code. * method.c (build_overload_value): Remove hack where by TYPE was not a TYPE. Handle PTRMEM_CST. (build_template_parm_names): Don't pass a PARM_DECL where a TYPE should go. * parse.y (components, notype_components, component_decl, component_decl_1, component_declarator, component_declarator0): Now all are itype rather than ttype. Rework to add members to classes on the fly. (typesqpecqual_reserved): Use check_multiple_declarators. (structsp): Update class to finish_class_definition. (do_xref_defn): Unsplit into named_class_head. (access_specifier): Set current_access_specifier. * pt.c (set_current_access_from_decl): New function. (finish_member_template_decl): Don't take the parameters. (comp_template_args): Make more robust. (lookup_template_class): Don't use current_local_enum. (for_each_template_parm): Handle PTRMEM_CST. (instantiate_class_template): Use set_current_access_from_decl, finish_member_declaration and unreverse_member_declarations. Set lineno/input_filename before generating implicit member functions. (type_unification_real): Don't assume back-unification happens only for the last argument. (regenerate_decl_from_template): Call pushclass a bit earlier. (tsubst_chain): Remove. (tsubst_enum): Use set_current_access_from_decl. (set_mangled_name_for_template_decl): Fix indentation. * search.c (lookup_fnfields_1): Change iteration through CLASSTYPE_METHOD_VEC. (dfs_pushdecls): Likewise. (dfs_compress_decls): Likewise. (add_conversions): Likewise. * semantics.c (finish_class_definition): Don't take components. Change call to finish_struct. (finish_member_declaration): New function. (finish_member_class_template): Don't take template parameters. Change call to grok_x_components. Call finish_member_template_decl. (check_multiple_declarators): New function. * sig.c (append_signature_fields): Work from the TYPE_METHODS, not a passed in fieldlist. * tree.c (search_tree): Handle PTRMEM_CST. (mapcar): Likewise. * typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not INTEGER_CSTs, for pointer-to-data members. From-SVN: r22869
1998-10-06 16:20:30 +02:00
/* It's OK to write `template <class T> void f() { int i, j;}'. */
return;
if (PROCESSING_REAL_TEMPLATE_DECL_P ()
|| processing_explicit_instantiation
|| processing_specialization)
error ("multiple declarators in template declaration");
cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.def (PTRMEM_CST): New tree node. * cp-tree.h (ptrmem_cst): New type. (lang_type): Remove local_typedecls. (dummy): Increase to 12 bits from 11. (CLASSTYPE_LOCAL_TYPEDECLS): Remove. (PTRMEM_CST_CLASS): New macro. (PTRMEM_CST_MEMBER): Likewise. (current_access_specifier): New variable. (current_class_type): Remove duplicate declaration. (finish_struct): Change prototype. (unreverse_member_declarations): New function. (pushdecl_class_level): Change prototype. (grok_enum_decls): Remove. (fixup_anonymous_union): New function. (grok_x_components): Change prototype. (tsubst_chain): Remove. (finish_member_template_decl): Likewise. (check_explicit_specialization): Fix indentation. (finish_class_definition): Change prototype. (finish_member_class_template): Likewise. (finish_member_declaration): New function. (check_multiple_declarators): Likewise. * class.c (class_stack_node_t): New type. (current_class_base): Remove. (current_class_stack): Change type. (current_access_specifier): New variable. (grow_method): Remove. (check_member_decl_is_same_in_complete_scope): Break out from finish_struct. (make_method_vec): New function. (free_method_vec): Likewise. (add_implicitly_declared_members): Break out from finish_struct_1. (free_method_vecs): New variable. (add_method): Rework for direct use from parser. (handle_using_decl): Watch for NULL_TREE while iterating through CLASSTYPE_METHOD_VEC. (finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here; just do some error-checking. (warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC. (finish_struct_1): Simplify. Use add_implicitly_declared_members. (finish_struct): Change prototype. Simplify; fields and methods are already set up at this point. (init_class_processing): Set up current_class_stack. (pushclass): Save current_access_specifier. (popclass): Restore it. (currently_open_class): Simplify. (build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS. * decl.c (saved_scope): Add access_specifier. (maybe_push_to_top_level): Save it. (pop_from_top_level): Restore it. (maybe_process_template_type_declaration): Use finish_member_declaration. (pushtag): Likewise. (pushdecl_class_level): Don't return a value. (fixup_anonymous_union): Break out from grok_x_components. (shadow_tag): Use it. (xref_tag): Complain about using an elaborated type specifier to reference a template type parameter or typedef name. (xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (current_local_enum): Remove. (build_enumerator): Call finish_member_declaration. (grok_enum_decls): Remove. * decl2.c (grok_x_components): Simplify. (check_classfn): Change iteration through CLASSTYPE_METHOD_VEC. (grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS. (merge_functions): Add to comment. (arg_assoc_type): Prototype. (arg_assoc): Pass as many arguments as there are parameters. * error.c (dump_expr): Handle PTRMEM_CST. Improve handling of OFFSET_REF. * expr.c (cpls_expand_expr): Remove dead code. Handle PTRMEM_CST. * friend.c (do_friend): Lookup friends when in nested classes. Change comments. * init.c (build_offset_ref): Do lookup even for classes that are only partially defined. (decl_constant_value): Remove dead code. * method.c (build_overload_value): Remove hack where by TYPE was not a TYPE. Handle PTRMEM_CST. (build_template_parm_names): Don't pass a PARM_DECL where a TYPE should go. * parse.y (components, notype_components, component_decl, component_decl_1, component_declarator, component_declarator0): Now all are itype rather than ttype. Rework to add members to classes on the fly. (typesqpecqual_reserved): Use check_multiple_declarators. (structsp): Update class to finish_class_definition. (do_xref_defn): Unsplit into named_class_head. (access_specifier): Set current_access_specifier. * pt.c (set_current_access_from_decl): New function. (finish_member_template_decl): Don't take the parameters. (comp_template_args): Make more robust. (lookup_template_class): Don't use current_local_enum. (for_each_template_parm): Handle PTRMEM_CST. (instantiate_class_template): Use set_current_access_from_decl, finish_member_declaration and unreverse_member_declarations. Set lineno/input_filename before generating implicit member functions. (type_unification_real): Don't assume back-unification happens only for the last argument. (regenerate_decl_from_template): Call pushclass a bit earlier. (tsubst_chain): Remove. (tsubst_enum): Use set_current_access_from_decl. (set_mangled_name_for_template_decl): Fix indentation. * search.c (lookup_fnfields_1): Change iteration through CLASSTYPE_METHOD_VEC. (dfs_pushdecls): Likewise. (dfs_compress_decls): Likewise. (add_conversions): Likewise. * semantics.c (finish_class_definition): Don't take components. Change call to finish_struct. (finish_member_declaration): New function. (finish_member_class_template): Don't take template parameters. Change call to grok_x_components. Call finish_member_template_decl. (check_multiple_declarators): New function. * sig.c (append_signature_fields): Work from the TYPE_METHODS, not a passed in fieldlist. * tree.c (search_tree): Handle PTRMEM_CST. (mapcar): Likewise. * typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not INTEGER_CSTs, for pointer-to-data members. From-SVN: r22869
1998-10-06 16:20:30 +02:00
}
/* Implement the __typeof keyword: Return the type of EXPR, suitable for
use as a type-specifier. */
tree
finish_typeof (expr)
tree expr;
{
if (processing_template_decl)
{
tree t;
t = make_aggr_type (TYPEOF_TYPE);
TYPE_FIELDS (t) = expr;
return t;
}
if (TREE_CODE (expr) == OFFSET_REF)
expr = resolve_offset_ref (expr);
return TREE_TYPE (expr);
}
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
/* Compute the value of the `sizeof' operator. */
tree
finish_sizeof (t)
tree t;
{
if (processing_template_decl)
return build_min_nt (SIZEOF_EXPR, t);
return TYPE_P (t) ? cxx_sizeof (t) : expr_sizeof (t);
}
/* Implement the __alignof keyword: Return the minimum required
alignment of T, measured in bytes. */
tree
finish_alignof (t)
tree t;
{
if (processing_template_decl)
return build_min_nt (ALIGNOF_EXPR, t);
return TYPE_P (t) ? cxx_alignof (t) : c_alignof_expr (t);
}
/* Generate RTL for the statement T, and its substatements, and any
other statements at its nesting level. */
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
static void
cp_expand_stmt (t)
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
tree t;
{
switch (TREE_CODE (t))
{
case TRY_BLOCK:
genrtl_try_block (t);
break;
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
case EH_SPEC_BLOCK:
genrtl_eh_spec_block (t);
break;
case HANDLER:
genrtl_handler (t);
break;
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
case RETURN_INIT:
genrtl_named_return_value ();
break;
case USING_STMT:
break;
default:
abort ();
break;
}
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
}
/* Called from expand_body via walk_tree. Replace all AGGR_INIT_EXPRs
will equivalent CALL_EXPRs. */
static tree
simplify_aggr_init_exprs_r (tp, walk_subtrees, data)
tree *tp;
int *walk_subtrees ATTRIBUTE_UNUSED;
void *data ATTRIBUTE_UNUSED;
{
tree aggr_init_expr;
tree call_expr;
tree fn;
tree args;
tree slot;
tree type;
int copy_from_buffer_p;
aggr_init_expr = *tp;
/* We don't need to walk into types; there's nothing in a type that
needs simplification. (And, furthermore, there are places we
actively don't want to go. For example, we don't want to wander
into the default arguments for a FUNCTION_DECL that appears in a
CALL_EXPR.) */
if (TYPE_P (aggr_init_expr))
{
*walk_subtrees = 0;
return NULL_TREE;
}
/* Only AGGR_INIT_EXPRs are interesting. */
else if (TREE_CODE (aggr_init_expr) != AGGR_INIT_EXPR)
return NULL_TREE;
/* Form an appropriate CALL_EXPR. */
fn = TREE_OPERAND (aggr_init_expr, 0);
args = TREE_OPERAND (aggr_init_expr, 1);
slot = TREE_OPERAND (aggr_init_expr, 2);
type = TREE_TYPE (aggr_init_expr);
if (AGGR_INIT_VIA_CTOR_P (aggr_init_expr))
{
/* Replace the first argument with the address of the third
argument to the AGGR_INIT_EXPR. */
c-decl.c (grokdeclarator): Update. * c-decl.c (grokdeclarator): Update. * c-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine. * c-tree.h (c_mark_addressable): New. * c-typeck.c (default_function_array_conversion, build_unary_op, build_array_ref, convert_for_assignment): Update. (mark_addressable): Rename. * calls.c (try_to_integrate, expand_call): Use langhook. * expr.c (expand_expr): Use langhook. * langhooks-def.h (LANG_HOOKS_INITIALIZER): Update. * langhooks.h (struct lang_hooks): New hook. * stmt.c (expand_asm_operands): Use langhook. * tree.h (mark_addressable): Remove. ada: * decl.c (gnat_to_gnu_entity): Update. * gigi.h (mark_addressable): Rename. * misc.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine. * trans.c (tree_transform): Update. * utils.c (create_var_decl): Update. * util2.c (build_binary_op, build_unary_op, fill_vms_descriptor): Update. (mark_addressable): Rename, update. cp: * call.c (build_addr_func): Update. * class.c (resolve_address_of_overloaded_function): Update. * cp-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine. * cp-tree.h (cxx_mark_addressable): New. * decl.c (register_dtor_fn, cxx_maybe_build_cleanup): Update. * decl2.c (build_cleanup): Update. * except.c (build_throw): Update. * init.c (resolve_offset_ref): Update. * pt.c (convert_nontype_argument): Update. * semantics.c (finish_asm_stmt, simplify_affr_init_exprs_r): Update. * typeck.c (decay_conversion, build_array_ref, build_unary_op, unary_complex_lvalue): Update. (mark_addressable): Rename. f: * com.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine. (mark_addressable): Rename. (ffecom_arrayref_, ffecom_1): Update. java: * java-tree.h (java_mark_addressable): New. * lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine. * typeck.c (mark_addressable): Rename, update. objc: * objc-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine. From-SVN: r51705
2002-04-01 22:26:18 +02:00
cxx_mark_addressable (slot);
args = tree_cons (NULL_TREE,
build1 (ADDR_EXPR,
build_pointer_type (TREE_TYPE (slot)),
slot),
TREE_CHAIN (args));
}
call_expr = build (CALL_EXPR,
TREE_TYPE (TREE_TYPE (TREE_TYPE (fn))),
fn, args, NULL_TREE);
TREE_SIDE_EFFECTS (call_expr) = 1;
/* If we're using the non-reentrant PCC calling convention, then we
need to copy the returned value out of the static buffer into the
SLOT. */
copy_from_buffer_p = 0;
#ifdef PCC_STATIC_STRUCT_RETURN
if (!AGGR_INIT_VIA_CTOR_P (aggr_init_expr) && aggregate_value_p (type))
{
int old_ac = flag_access_control;
flag_access_control = 0;
call_expr = build_aggr_init (slot, call_expr,
DIRECT_BIND | LOOKUP_ONLYCONVERTING);
flag_access_control = old_ac;
copy_from_buffer_p = 1;
}
#endif
/* If this AGGR_INIT_EXPR indicates the value returned by a
function, then we want to use the value of the initialized
location as the result. */
if (AGGR_INIT_VIA_CTOR_P (aggr_init_expr) || copy_from_buffer_p)
{
call_expr = build (COMPOUND_EXPR, type,
call_expr, slot);
TREE_SIDE_EFFECTS (call_expr) = 1;
}
/* Replace the AGGR_INIT_EXPR with the CALL_EXPR. */
TREE_CHAIN (call_expr) = TREE_CHAIN (aggr_init_expr);
*tp = call_expr;
/* Keep iterating. */
return NULL_TREE;
}
cp-tree.h (BV_USE_VCALL_INDEX_P): New macro. * cp-tree.h (BV_USE_VCALL_INDEX_P): New macro. (BV_GENERATE_THUNK_WITH_VTABLE_P): Likewise. (lang_decl_flags): Add generate_with_vtable_p. Make vcall_offset a tree, not an int. (THUNK_GENERATE_WITH_VTABLE_P): New macro. (make_thunk): Change prototype. (emit_thunk): Rename to use_thunk. (mangle_thunk): Change prototype. * class.c (get_derived_offset): Simplify. (copy_virtuals): Clear BV_USE_VCALL_INDEX_P and BV_GENERATE_THUNK_WITH_VTABLE_P. (build_primary_vtable): Simplify. (add_virtual_function): Use BV_FN, rather than TREE_VALUE. (dfs_find_base): Remove. (update_vtable_entry_for_fn): Correct bug in finding the base where a virtual function was first declared. Figure out whether or not to emit a vcall-thunk with the vtables in which it appears. Correct logic for deciding whether to use an ordinary thunk, or a vcall thunk. (finish_struct_1): Remove unnecssary code. (build_vtbl_initializer): Use ssize_int for the running counter of negative indices. (build_vtbl_initializer): Only use vcall thunks where necessary. Mark thunks as needing to be emitted with their vtables, or not. (build_vbase_offset_vtbl_entries): Adjust for use of ssize_int in indices. Use size_binop. (dfs_build_vcall_offset_vtbl_entries): Don't rely on BINFO_PRIMARY_MARKED_P here. Use BV_FN consistently. Use size_binop. (build_rtti_vtbl_entries): Adjust call to build_vtable_entry. (build_vtable_entry): Mark thunks as needing to be emitted with their vtables, or not. * decl.c (lang_mark_tree): Mark the vcall_offset in a thunk. * decl2.c (mark_vtable_entries): Use use_thunk instead of emit_thunk. * dump.c (dequeue_and_dump): Remove dead code. Dump new thunk information. * error.c (dump_expr): Use BV_FN. * mangle.c (mangle_thunk): Adjust now that vcall_offset is a tree, not an int. * method.c (make_thunk): Likewise. (emit_thunk): Rename to use_thunk. Allow callers to decide whether or not to actually emit the thunk. Adjust for changes in representation of vcall offsets. * search.c (dfs_get_pure_virtuals): Use BV_FN. * semantics.c (emit_associated_thunks): New function. (expand_body): Use it. * ir.texi: Adjust decriptions of thunks. From-SVN: r34656
2000-06-23 03:14:40 +02:00
/* Emit all thunks to FN that should be emitted when FN is emitted. */
static void
emit_associated_thunks (fn)
tree fn;
{
/* When we use vcall offsets, we emit thunks with the virtual
functions to which they thunk. The whole point of vcall offsets
is so that you can know statically the entire set of thunks that
will ever be needed for a given virtual function, thereby
enabling you to output all the thunks with the function itself. */
if (DECL_VIRTUAL_P (fn))
cp-tree.h (BV_USE_VCALL_INDEX_P): New macro. * cp-tree.h (BV_USE_VCALL_INDEX_P): New macro. (BV_GENERATE_THUNK_WITH_VTABLE_P): Likewise. (lang_decl_flags): Add generate_with_vtable_p. Make vcall_offset a tree, not an int. (THUNK_GENERATE_WITH_VTABLE_P): New macro. (make_thunk): Change prototype. (emit_thunk): Rename to use_thunk. (mangle_thunk): Change prototype. * class.c (get_derived_offset): Simplify. (copy_virtuals): Clear BV_USE_VCALL_INDEX_P and BV_GENERATE_THUNK_WITH_VTABLE_P. (build_primary_vtable): Simplify. (add_virtual_function): Use BV_FN, rather than TREE_VALUE. (dfs_find_base): Remove. (update_vtable_entry_for_fn): Correct bug in finding the base where a virtual function was first declared. Figure out whether or not to emit a vcall-thunk with the vtables in which it appears. Correct logic for deciding whether to use an ordinary thunk, or a vcall thunk. (finish_struct_1): Remove unnecssary code. (build_vtbl_initializer): Use ssize_int for the running counter of negative indices. (build_vtbl_initializer): Only use vcall thunks where necessary. Mark thunks as needing to be emitted with their vtables, or not. (build_vbase_offset_vtbl_entries): Adjust for use of ssize_int in indices. Use size_binop. (dfs_build_vcall_offset_vtbl_entries): Don't rely on BINFO_PRIMARY_MARKED_P here. Use BV_FN consistently. Use size_binop. (build_rtti_vtbl_entries): Adjust call to build_vtable_entry. (build_vtable_entry): Mark thunks as needing to be emitted with their vtables, or not. * decl.c (lang_mark_tree): Mark the vcall_offset in a thunk. * decl2.c (mark_vtable_entries): Use use_thunk instead of emit_thunk. * dump.c (dequeue_and_dump): Remove dead code. Dump new thunk information. * error.c (dump_expr): Use BV_FN. * mangle.c (mangle_thunk): Adjust now that vcall_offset is a tree, not an int. * method.c (make_thunk): Likewise. (emit_thunk): Rename to use_thunk. Allow callers to decide whether or not to actually emit the thunk. Adjust for changes in representation of vcall offsets. * search.c (dfs_get_pure_virtuals): Use BV_FN. * semantics.c (emit_associated_thunks): New function. (expand_body): Use it. * ir.texi: Adjust decriptions of thunks. From-SVN: r34656
2000-06-23 03:14:40 +02:00
{
tree thunk;
for (thunk = DECL_THUNKS (fn); thunk; thunk = TREE_CHAIN (thunk))
use_thunk (thunk, /*emit_p=*/1);
cp-tree.h (BV_USE_VCALL_INDEX_P): New macro. * cp-tree.h (BV_USE_VCALL_INDEX_P): New macro. (BV_GENERATE_THUNK_WITH_VTABLE_P): Likewise. (lang_decl_flags): Add generate_with_vtable_p. Make vcall_offset a tree, not an int. (THUNK_GENERATE_WITH_VTABLE_P): New macro. (make_thunk): Change prototype. (emit_thunk): Rename to use_thunk. (mangle_thunk): Change prototype. * class.c (get_derived_offset): Simplify. (copy_virtuals): Clear BV_USE_VCALL_INDEX_P and BV_GENERATE_THUNK_WITH_VTABLE_P. (build_primary_vtable): Simplify. (add_virtual_function): Use BV_FN, rather than TREE_VALUE. (dfs_find_base): Remove. (update_vtable_entry_for_fn): Correct bug in finding the base where a virtual function was first declared. Figure out whether or not to emit a vcall-thunk with the vtables in which it appears. Correct logic for deciding whether to use an ordinary thunk, or a vcall thunk. (finish_struct_1): Remove unnecssary code. (build_vtbl_initializer): Use ssize_int for the running counter of negative indices. (build_vtbl_initializer): Only use vcall thunks where necessary. Mark thunks as needing to be emitted with their vtables, or not. (build_vbase_offset_vtbl_entries): Adjust for use of ssize_int in indices. Use size_binop. (dfs_build_vcall_offset_vtbl_entries): Don't rely on BINFO_PRIMARY_MARKED_P here. Use BV_FN consistently. Use size_binop. (build_rtti_vtbl_entries): Adjust call to build_vtable_entry. (build_vtable_entry): Mark thunks as needing to be emitted with their vtables, or not. * decl.c (lang_mark_tree): Mark the vcall_offset in a thunk. * decl2.c (mark_vtable_entries): Use use_thunk instead of emit_thunk. * dump.c (dequeue_and_dump): Remove dead code. Dump new thunk information. * error.c (dump_expr): Use BV_FN. * mangle.c (mangle_thunk): Adjust now that vcall_offset is a tree, not an int. * method.c (make_thunk): Likewise. (emit_thunk): Rename to use_thunk. Allow callers to decide whether or not to actually emit the thunk. Adjust for changes in representation of vcall offsets. * search.c (dfs_get_pure_virtuals): Use BV_FN. * semantics.c (emit_associated_thunks): New function. (expand_body): Use it. * ir.texi: Adjust decriptions of thunks. From-SVN: r34656
2000-06-23 03:14:40 +02:00
}
}
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
/* Generate RTL for FN. */
void
expand_body (fn)
tree fn;
{
int saved_lineno;
top level: * Makefile.in (WARN_CFLAGS): Add -Wwrite-strings. (tree.o): Depend on output.h. * c-decl.c (pending_invalid_xref_file, current_function_prototype_file): Constify. (pushdecl): Constify a local char *. (define_label): Constify filename parameter. * c-lex.c (init_parse): Constify parameter and return value. * c-typeck.c (c_expand_asm_operands): Constify filename parameter. * c-tree.h: Update prototypes. * c-parse.in: Constify filename member of %union, and if_stmt_file. * c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y, objc/objc-parse.c: Regenerate. * dwarfout.c (dwarfout_init): Constify main_input_filename parameter. * dwarfout.h: Update prototypes. * expr.c (expand_expr): Constify a local char *. * flags.h: Constify main_input_filename. * function.c (expand_function_end): Constify filename parameter. * genrecog.c (make_insn_sequence): Use a character array for c_test_pos. (main): Remove unused variables. * input.h: Constify input_filename, main_input_filename, and file_stack.name. Update prototypes. * output.h: Declare first_global_object_name and weak_global_object_name here, as const char *. * stmt.c (expand_asm_operands): Constify filename parameter. * toplev.c (compile_file, push_srcloc, debug_start_source_file): Constify filename parameter. (input_filename, main_input_filename): Constify. * toplev.h: Update prototypes. * tree.c: Include output.h. Don't declare first_global_object_name or weak_global_object_name. Clean up string bashing in get_file_function_name_long. * tree.h (struct tree_decl): Constify filename member. (input_filename): Constify. Update prototypes. * varasm.c (first_global_object_name, weak_global_object_name): Constify. (assemble_start_function, assemble_variable): Clean up string bashing. * gcc.c: Constify all spec-related strings initialized, transitively, from string constants. Constify all strings and string variables related to multilibs. (set_spec, read_specs): Cast argument to free to PTR. (used_arg): Do not modify multilib_matches. Use strncmp plus length comparison to compare multilib switches. * genmultilib: Constify everything declared in multilib.h. ch: * ch-tree.h: Update prototypes. Remove prototypes for functions declared elsewhere. * decl.c (define_label): Constify filename parameter. * grant.c (globalize_decl, set_default_grant_file): Constify local char * variables. Don't declare first_global_object_name or asm_out_file. * lang.c (chill_real_input_filename): Constify. * lex.c (init_parse): Constify parameter and return value. * parse.c: Don't declare input_filename. (ch_expand_asm_operands): Constify filename parameter. (parse_multi_dimension_case_action): Constify local char *. * satisfy.c (safe_satisfy_decl): Constify local char *. cp: * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, and pending_inline.filename. Update prototypes. * decl.c (define_label): Constify filename parameter. * decl2.c (warn_if_unknown_interface): Constify local char *. * input.c Constify input_source.filename. Don't declare input_filename or lineno. Constify filename parameter to feed_input. * lex.c (init_parse): Constify parameter and return value. (cp_pragma_interface, cp_pragma_implementation): Constify filename argument. (reinit_parse_for_method, reinit_parse_for_block, reinit_parse_for_expr, feed_defarg, handle_cp_pragma): Constify local char *. * pt.c: Don't declare lineno or input_filename. (print_template_context, tsubst_friend_function, tsubst_decl, tsubst, instantiate_decl): Constify local char *. * semantics.c (expand_body): Constify local char *. * tree.c (build_srcloc): Constify filename parameter. * typeck.c (c_expand_asm_operands): Constify filename parameter. f: * com.c (ffecom_subscript_check_): Constify array_name parameter. Clean up string bashing. (ffecom_arrayref_, ffecom_char_args_x_): Constify array_name parameter. (ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify local char *. (init_parse): Constify parameter and return value. * lex.c: Include dwarfout.h instead of prototyping dwarfout_* functions here. (ffelex_file_pop_, ffelex_file_push_): Constify filename parameter. (ffelex_hash_, ffelex_include_): Constify local char *. * std.c (ffestd_exec_end): Constify local char *. * where.c (ffewhere_file_new): Constify filename parameter. * where.h: Update prototypes. java: * check_init.c (check_init): Constify local char *. * class.c (push_class): Constify local char *. * java_tree.h: Update prototypes. * jcf-io.c (open_class): Constify filename parameter and return value. (find_class): Remove redundant string copy. Cast return from open_class. * jcf-parse.c (read_class, parse_class_file, yyparse): Constify local char *. * jcf-write.c (generate_bytecode_insns, generate_classfile): Constify local char *. * jcf.h (JCF): Constify filename and classname. (JCF_FINISH): Cast args to FREE to char * when appropriate. * lang.c (init_parse): Constify parameter and return value. * lex.c (java_get_line_col): Constify filename parameter. * parse.h: Constify parser_ctxt.filename. Update prototypes. * parse.y (java_parser_context_suspend, issue_warning_error_from_context, safe_layout_class): Constify local char *. * parse.c: Regenerate. From-SVN: r33804
2000-05-09 21:56:01 +02:00
const char *saved_input_filename;
tree saved_function;
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
/* When the parser calls us after finishing the body of a template
function, we don't really want to expand the body. When we're
processing an in-class definition of an inline function,
PROCESSING_TEMPLATE_DECL will no longer be set here, so we have
to look at the function itself. */
if (processing_template_decl
|| (DECL_LANG_SPECIFIC (fn)
&& DECL_TEMPLATE_INFO (fn)
&& uses_template_parms (DECL_TI_ARGS (fn))))
{
/* Normally, collection only occurs in rest_of_compilation. So,
if we don't collect here, we never collect junk generated
during the processing of templates until we hit a
non-template function. */
ggc_collect ();
return;
}
/* Replace AGGR_INIT_EXPRs with appropriate CALL_EXPRs. */
walk_tree_without_duplicates (&DECL_SAVED_TREE (fn),
simplify_aggr_init_exprs_r,
NULL);
/* If this is a constructor or destructor body, we have to clone
it. */
cp-tree.h (cp_tree_index): Add CPTI_DTOR_IDENTIFIER. * cp-tree.h (cp_tree_index): Add CPTI_DTOR_IDENTIFIER. (complete_dtor_identifier): New macro. (CLASSTYPE_FIRST_CONVERSION): Remove. (CLASSTYPE_CONSTRUCTOR_SLOT): New macro. (CLASSTYPE_DESTRUCTOR_SLOT): Likewise. (CLASSTYPE_FIRST_CONVERSION_SLOT): Likewise. (CLASSTYPE_CONSTRUCTORS): Likewise. (CLASSTYPE_DESTRUCTORS): Likewise. (lang_decl): Add cloned_function. (DECL_COMPLETE_CONSTRUCTOR_P): New macro. (DECL_BASE_CONSTRUCTOR_P): Likewise. (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P): Likewise. (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P): Likewise. (DECL_CLONED_FUNCTION_P): Likewise. (DECL_CLONED_FUNCTION): Likewise. (clone_function_decl): Declare. (maybe_clone_body): Likewise. * call.c (build_user_type_conversion_1): Call complete object constructors in the new ABI. (build_new_method_call): Don't add in-charge parameters under the new ABI. * class.c (add_method): Use DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P, CLASSTYPE_CONSTRUCTOR_SLOT, and CLASSTYPE_DESTRUCTOR_SLOT. (build_clone): New function. (clone_function_decl): Likewise. (clone_constructors_and_destructors): Likewise. (check_bases_and_members): Use it. * decl.c (iniitialize_predefined_identifiers): Initialize complete_dtor_identifier. (finish_function): Don't add extra code to a clone. (lang_mark_tree): Mark cloned_function. * decl2.c (mark_used): Don't bother trying to instantiate things we synthesized. * dump.c (dequeue_and_dump): Don't dump CP_DECL_CONTEXT twice. * method.c (set_mangled_name_for_decl): Don't treat clones as constructors. (synthesize_method): Sythesize cloned functions, not the clones. * optimize.c (inline_data): Update comment on ret_label. (remap_block): Don't assume DECL_INITIAL exists. (copy_body_r): Allow ret_label to be NULL. (maybe_clone_body): Define. * pt.c (tsubst_decl): Handle clones. (instantiate_clone): New function. (instantiate_template): Use it. (set_mangled_name_for_template_decl): Don't treat clones as constructors. * search.c (lookup_fnfields_1): Use CLASSTYPE_CONSTRUCTOR_SLOT, CLASSTYPE_DESTRUCTOR_SLOT, and CLASSTYPE_FIRST_CONVERSION_SLOT. * semantics.c (expand_body): Clone function bodies as necessary. From-SVN: r33084
2000-04-11 22:16:36 +02:00
if (maybe_clone_body (fn))
{
/* We don't want to process FN again, so pretend we've written
it out, even though we haven't. */
TREE_ASM_WRITTEN (fn) = 1;
return;
}
/* There's no reason to do any of the work here if we're only doing
semantic analysis; this code just generates RTL. */
if (flag_syntax_only)
return;
/* If possible, avoid generating RTL for this function. Instead,
just record it as an inline function, and wait until end-of-file
to decide whether to write it out or not. */
if (/* We have to generate RTL if it's not an inline function. */
(DECL_INLINE (fn) || DECL_COMDAT (fn))
/* Or if we have to emit code for inline functions anyhow. */
&& !flag_keep_inline_functions
/* Or if we actually have a reference to the function. */
&& !DECL_NEEDED_P (fn))
{
/* Set DECL_EXTERNAL so that assemble_external will be called as
necessary. We'll clear it again in finish_file. */
if (!DECL_EXTERNAL (fn))
{
DECL_NOT_REALLY_EXTERN (fn) = 1;
DECL_EXTERNAL (fn) = 1;
}
/* Remember this function. In finish_file we'll decide if
we actually need to write this function out. */
defer_fn (fn);
/* Let the back-end know that this function exists. */
Makefile.in (toplev.o, [...]): Don't depend on dwarfout.h. * Makefile.in (toplev.o, dwarfout.o, final.o): Don't depend on dwarfout.h. * dbxout.c (dbxout_function): Rename dbxout_funciton_decl, move to conditionally compiled block. (dbx_debug_hooks, xcoff_debug_hooks): Update. * dbxout.h (dbxout_function): Remove. * debug.c (do_nothing_debug_hooks): Update. * debug.h (struct gcc_debug_hooks): New hooks function_decl, global_decl, deferred_inline_function. * dwarf2out.c (dwarf2_debug_hooks): Update. (dwarf2out_global_decl): New. * dwarfout.c: Don't include dwarfout.h. (dwarfout_global_decl, dwarfout_function_decl, dwarfout_deferred_inline_function): New. (dwarf_debug_hooks): Update. * dwarfout.h: Remove. * final.c: Don't include dwarfout.h. * sdbout.c (sdbout_global_decl): New. (sdbout_debug_hooks): Update. * toplev.c: Don't include dwarfout.h. (check_global_declarations, rest_of_compilation): Use new debug hooks. (note_deferral_of_defined_inline_function): Remove. * toplev.h (note_deferral_of_defined_inline_function): Remove. * ch/Makefile.in (lex.o): No dependence on dwarfout.h. * ch/lex.c: Don't include dwarfout.h. * cp/Make-lang.in (decl2.o): No dependence on dwarfout.h, dwarf2out.h. (semantics.o, optimize.o): Depend on debug.h not dwarfout.h. * cp/decl2.c: Don't include dwarfout.h and dwarf2out.h. * cp/optimize.c: Include debug.h. (maybe_clone_body): Use debug hook. * cp/semantics.c: Include debug.h. (expand_body): Use debug hook. * po/POTFILES.in: Remove dwarfout.h. From-SVN: r44145
2001-07-19 08:22:04 +02:00
(*debug_hooks->deferred_inline_function) (fn);
return;
}
/* Compute the appropriate object-file linkage for inline
functions. */
if (DECL_DECLARED_INLINE_P (fn))
import_export_decl (fn);
/* If FN is external, then there's no point in generating RTL for
it. This situation can arise with an inline function under
2001-11-23 20:00:14 +01:00
`-fexternal-templates'; we instantiate the function, even though
we're not planning on emitting it, in case we get a chance to
inline it. */
if (DECL_EXTERNAL (fn))
return;
/* Save the current file name and line number. When we expand the
body of the function, we'll set LINENO and INPUT_FILENAME so that
error-mesages come out in the right places. */
saved_lineno = lineno;
saved_input_filename = input_filename;
saved_function = current_function_decl;
lineno = DECL_SOURCE_LINE (fn);
input_filename = DECL_SOURCE_FILE (fn);
current_function_decl = fn;
timevar_push (TV_INTEGRATION);
/* Optimize the body of the function before expanding it. */
optimize_function (fn);
timevar_pop (TV_INTEGRATION);
timevar_push (TV_EXPAND);
c-common.h (genrtl_clear_out_block): Remove. * c-common.h (genrtl_clear_out_block): Remove. * c-semantics.c (genrtl_clear_out_block): Remove. (genrtl_while_stmt): Don't call it. (genrtl_for_stmt): Likewise. * cp-tree.h (struct saved_scope): Remove x_function_parms. (current_function_parms): Don't define. (struct cp_language_function): Remove parms_stored. (current_function_just_assigned_this): Don't define. (current_function_parms_stored): Likewise. (static_ctors): Declare. (static_dtors): Likewise. (SF_EXPAND): Don't define. (expand_start_early_try_stmts): Remove declaration. (store_parm_decls): Likewise. * decl.c (static_ctors): Don't declare. (static_dtors): Likewise. (struct binding_level): Remove this_block. (poplevel): Remove dead code. (set_block): Likewise. (mark_binding_level): Don't mark this_block. (mark_saved_scope): Don't mark x_function_parms. (init_decl_processing): Don't add current_function_parms as a GC root. (check_function_type): Change prototype. (start_function): Remove RTL-generation code. (expand_start_early_try_stmts): Remove. (store_parm_decls): Give it internal linkage. Remove RTL-generation code. (finish_function): Remove RTL-generation code. * decl2.c (static_ctors): Fix formatting. (static_dtors): Likewise. * method.c (use_thunk): Don't call store_parm_decls. (synthesize_method): Likewise. * optimize.c (maybe_clone_body): Likewise. * parse.y (fn.def2): Likewise. (.set_base_init): Likewise. (nodecls): Likewise. * pt.c (instantiate_decl): Likewise. * rtti.c (synthesize_tinfo_fn): Likewise. * semantics.c (genrtl_try_block): Simplify. (expand_body): Use genrtl_start_function and genrtl_finish_function. (genrtl_start_function): New function. (genrtl_finish_function): Likewise. From-SVN: r36350
2000-09-12 08:46:00 +02:00
genrtl_start_function (fn);
current_function_is_thunk = DECL_THUNK_P (fn);
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
/* Expand the body. */
Turn on function-at-a-time processing. * cp-tree.h (doing_semantic_analysis_p): New macro. (SF_DEFAULT): Define to zero, not SF_EXPAND. (start_handler_parms): Change prototype. (expand_start_catch_block): Likewise. (expand_end_catch_block): Likewise. (expand_start_eh_spec): Likewise. (expand_end_eh_spec): Declare. (finish_handler_parms): Change prototype. (begin_catch_block): Declare. (finish_handler): Change prototype. (do_pushlevel): Declare. (do_poplevel): Likewise. * decl.c (pushlevel): Don't create binding levels when not doing semantic analysis. (poplevel): Don't pop them. (pushdecl): Assert that we are never called when not doing semantic analysis. (pushdecl_top_level): Use push_to_top_level. (make_label_decl): Don't fiddle with obstacks. Make RTL For the label when expanding. (cp_finish_decl): Only inject for-scope variables when doing semantic analysis. Add comments. (start_handler_parms): Return the handler parm. (start_function): Reorganize. Don't clear DECL_INITIAL if it is already set. Reinitialize from saved function data if available. Don't pushlevel when not doing semantic analysis. (store_parm_decls): Only generate RTL when expanding. Only pushdecl when doing semantic analysis. Set current_eh_spec_try_block if appropriate. (finish_function): Simplify. Use do_pushlevel and do_poplevel. Combine common code. Don't poplevel when not doing semantic analysis. (push_cp_function_context): Don't expand functions without an explicit call to expand_body. (mark_lang_function): Make eh_spec_try_block and x_scope_stmt_stack. * except.c (expand_end_eh_spec): Don't declare. (process_start_catch_block): Likewise. (push_eh_cleanup): Use finish_decl_cleanup. (initialize_handler_parm): New function. (expand_start_catch_block): Use it. (expand_end_catch_block): Use tree-generation functions, not RTL-generation functions. (expand_start_eh_spec): Likewise. (expand_end_eh_spec): Likewise. (expand_exception_blocks): Simplify. (start_anon_func): Use do_pushlevel. (end_anon_func): Use do_poplvel. Call expand_body for the function. * expr.c (do_case): Don't call define_case_label. * init.c (create_temporary_var): Set DECL_CONTEXT for local variables. * method.c (emit_thunk): Call expand_body for the thunk. (sythesize_method): Likewise. * parse.y (handler_args): Give it ttype. (eat_saved_input): Call expand_body. (base_init): Use do_pushlevel. (pending_inline): Call expand_body. (handler): Adjust calls to finish_handler_parms and finish_handler. (handler_args): Don't call expand_start_catch_block. Return the catch parameter. * pt.c (tsubst_expr): Adjust HANDLER handling. * parse.c: Regenerated. * rtti.c (synthesize_tinfo_fn): Call finish_function. * semantics.c (do_pushlevel): Give it external linkage. Build SCOPE_STMTs. (do_poplevel): Likewise. (finish_case_label): Call define_case_label when doing semantic analysis. (finish_goto_stmt): Create RTL for labels. (finish_function_try_block): Set in_function_try_handler unconditionally. (finish_function_handler_sequence): Unset it. (finish_handler_parms): Use expand_start_catch_block even when building a statement-tree. (begin_catch_block): New function. (finish_handler): Move a little RTL-generation logic here. (finish_decl_cleanup): Allow cleanups for empty declarations. (finish_named_return_value): Don't pushdecl when not doing semantic analysis. (expand_stmt): Don't do semantic analysis for variable declarations. Handle START_CATCH_STMT. Call expand_label directly for a LABEL_STMT. Tweak handling of GOTO_STMT. Adjust HANDLERs. Handle SCOPE_STMT, CTOR_INITIALIZER, and RETURN_INIT. (expand_body): Let expand_stmt handle CTOR_INITIALIZER, RETURN_INIT and function try blocks. From-SVN: r29490
1999-09-18 03:23:20 +02:00
expand_stmt (DECL_SAVED_TREE (fn));
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
/* Statements should always be full-expressions at the outermost set
of curly braces for a function. */
Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. 2000-07-01 Benjamin Chelf <chelf@codesourcery.com> * Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. (c-semantics.o): New target. * c-common.h (TREE_LANG_FLAG_?): Added documentation. (genrtl_do_pushlevel): Moved from cp/cp-tree.h. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (gerntl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (expand_cond): Likewise. (expand_stmt): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. (do_case): Likewise. (COMPOUND_STMT_NO_SCOPE): Likewise. (c_expand_asm_operands): Likewise. (NEW_FOR_SCOPE_P): New macro. (expand_expr_stmt_fn): New type. (set_current_function_name_declared): Likewise. (current_function_name_declared): Likewise. (lang_expand_stmt): Likewise. (stmts_are_full_exprs_p): Likewise. (anon_aggr_type_p): Likewise. (lang_expand_expr_stmt): Likewise. (build_case_label): Likewise. * c-decl.c (lang_expand_expr_stmt): Initialize. (stmts_are_full_exprs_p): Define. (current_function_name_declared): Likewise. (do_case): Likewise. (lang_expand_stmt): Likewise. (set_current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (build_case_label): Likewise. * c-semantics.c: New file. (expand_cond): Moved from cp/semantics.c. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (genrtl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (make_rtl_for_local_static): Moved from cp/decl.c. (emit_local_var): Likewise. (expand_stmt): Define. * c-tree.h: (c_expand_asm_operands): Moved to c-common.h. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/Make-lang.in (cc1plus$(exeext)): Added c-semantics.o. * cp/Makefile.in (OBJS): Added ../c-semantics.o. (OBJDEPS): Likewise. * cp/cp-tree.h (TREE_LANG_FLAG_?): Moved common documentation to ../c-common.h. (struct stmt_tree): Added comment. (current_function_name_declared): Removed. (stmts_are_full_exprs_p): Likewise. (genrtl_do_pushlevel): Likewise. (genrtl_clear_out_block): Likewise. (COMPOUND_STMT_NO_SCOPE): Moved to ../c-common.h. (DECL_ANON_UNION_ELEMS): Likewise. (emit_local_var): Likewise. (make_rtl_for_local_static): Likewise. (do_case): Likewise. (expand_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (c_expand_asm_operands): Likewise. (c_expand_return): Likewise. (c_expand_start_case): Likewise. * cp/decl.c (make_rtl_for_local_static): Moved to c-semantics.c. (emit_local_var): Likewise. (initialize_local_var): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (push_cp_function_context): Likewise. * cp/expect.c (expand_throw): Change reference to stmts_are_full_exprs_p. * cp/init.c (build_aggr_init): Change reference to stmts_are_full_exprs_p. (build_vec_init): Likewise. * cp/optimize.c (maybe_clone_body): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/pt.c (instantiate_decl): Change reference to current_function_name_declared to cp_function_chain->name_declared. * cp/semantics.c (expand_cond): Moved declaration to c-common.h. (genrtl_do_pushlevel): Moved to c-semantics.c. (genrtl_clear_out_block): Likewise. (genrtl_goto_stmt): Likewise. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Likewise. (gerntl_if_stmt): Likewise. (genrtl_while_stmt): Likewise. (genrtl_do_stmt): Likewise. (genrtl_return_stmt): Likewise. (genrtl_for_stmt): Likewise. (genrtl_break_stmt): Likewise. (genrtl_continue_stmt): Likewise. (genrtl_scope_stmt): Likewise. (genrtl_switch_stmt): Likewise. (genrtl_case_label): Likewise. (genrtl_begin_compound_stmt): Likewise. (genrtl_finish_compound_stmt): Likewise. (genrtl_compound_stmt): Likewise. (genrtl_asm_stmt): Likewise. (genrtl_decl_cleanup): Likewise. (expand_cond): Likewise. (expand_stmt): Renamed to ... (lang_expand_stmt): ... this. (lang_expand_expr_stmt): Initialize. (set_current_function_name_declared): Likewise. (stmts_are_full_exprs_p): Likewise. (current_function_name_declared): Likewise. (anon_aggr_type_p): Likewise. (do_poplevel): Change reference to stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). Change reference to stmts_are_full_exprs_p to current_stmt_tree->stmts_are_full_exprs_p. (add_tree): Likewise. (finish_expr_stmt): Likewise. (prep_stmt): Likewise. (lang_expand_stmt): Likewise. (begin_compound_stmt): Change reference to current_function_name_declared to cp_function_chain->name_declared and call to current_function_name_declared(). (setup_vtbl_ptr): Likewise. (genrtl_do_poplevel): Removed. From-SVN: r34827
2000-07-02 07:23:01 +02:00
my_friendly_assert (stmts_are_full_exprs_p (), 19990831);
/* The outermost statement for a function contains the line number
recorded when we finished processing the function. */
lineno = STMT_LINENO (DECL_SAVED_TREE (fn));
/* Generate code for the function. */
c-common.h (genrtl_clear_out_block): Remove. * c-common.h (genrtl_clear_out_block): Remove. * c-semantics.c (genrtl_clear_out_block): Remove. (genrtl_while_stmt): Don't call it. (genrtl_for_stmt): Likewise. * cp-tree.h (struct saved_scope): Remove x_function_parms. (current_function_parms): Don't define. (struct cp_language_function): Remove parms_stored. (current_function_just_assigned_this): Don't define. (current_function_parms_stored): Likewise. (static_ctors): Declare. (static_dtors): Likewise. (SF_EXPAND): Don't define. (expand_start_early_try_stmts): Remove declaration. (store_parm_decls): Likewise. * decl.c (static_ctors): Don't declare. (static_dtors): Likewise. (struct binding_level): Remove this_block. (poplevel): Remove dead code. (set_block): Likewise. (mark_binding_level): Don't mark this_block. (mark_saved_scope): Don't mark x_function_parms. (init_decl_processing): Don't add current_function_parms as a GC root. (check_function_type): Change prototype. (start_function): Remove RTL-generation code. (expand_start_early_try_stmts): Remove. (store_parm_decls): Give it internal linkage. Remove RTL-generation code. (finish_function): Remove RTL-generation code. * decl2.c (static_ctors): Fix formatting. (static_dtors): Likewise. * method.c (use_thunk): Don't call store_parm_decls. (synthesize_method): Likewise. * optimize.c (maybe_clone_body): Likewise. * parse.y (fn.def2): Likewise. (.set_base_init): Likewise. (nodecls): Likewise. * pt.c (instantiate_decl): Likewise. * rtti.c (synthesize_tinfo_fn): Likewise. * semantics.c (genrtl_try_block): Simplify. (expand_body): Use genrtl_start_function and genrtl_finish_function. (genrtl_start_function): New function. (genrtl_finish_function): Likewise. From-SVN: r36350
2000-09-12 08:46:00 +02:00
genrtl_finish_function (fn);
Make-lang.in (CXX_SRCS): Add optimize.c. 1999-11-25 Mark Mitchell <mark@codesourcery.com> * Make-lang.in (CXX_SRCS): Add optimize.c. * Makefile.in (CXX_OBJS): Add optimize.o. (CXX_TREE_H): Add splay-tree.h, system.h, and $(CONFIG_H). (spew.o, lex.o, decl.o, decl2.o, typeck2.o, typeck.o): Adjust. (class.o, call.o, friend.o, init.o, method.o, cvt.o): Likewise. (search.o, tree.o, ptree.o, rtti.o, except.o, expr.o): Likewise. (xref.o, pt.o, error.o, errfn.o, repo.o, semantics.o): Likewise. (dump.o): Likewise. (optimize.o): New target. * class.c: Don't include splay-tree.h. * cp-tree.def (CTOR_COMPLETE): Rename to CTOR_STMT. * cp-tree.h: Include splay-tree.h. (DECL_UNINLINABLE): New macro. (CTOR_BEGIN_P, CTOR_END_P): New macros. (flag_inline_trees): New variable. (local_variable_p): New function. (nonstatic_local_decl_p): Likewise. (optimize_function): Likewise. (cplus_unsave_expr_now): Remove. (copy_tree_r): Declare. (remap_save_expr): Likewise. * decl.c (local_variable_p): Don't make it static. (local_variable_p_walkfn): New function. (make_rtl_for_local_static): Remove code to try to avoid writing out static constants. (emit_local_var): Fix indentation. (nonstatic_local_decl_p): New function. (check_default_argument): Use local_variable_p_walkfn, not local_variable_p, when walking the tree. (start_function): Set the DECL_CONTEXT for automatically generated labels. (finish_constructor_body): Use CTOR_STMT to mark the end of a constructor. * decl2.c: Don't include splay-tree.h. (flag_inline_trees): Define. * dump.c: Don't include splay-tree.h. * except.c (expand_end_catch_block): Fix comment formatting. (expand_end_eh_spec): Set DECL_CONTEXT on temporary variables. (expand_throw): Tidy comment. * init.c (build_vec_delete_1): Use create_temporary_var. * lex.c (cplus_tree_code_type): Make it static. (cplus_tree_code_length): Likewise. (cplus_tree_code_name): Likewise. * optimize.c: New file. * semantics.c (finish_goto_stmt): Set DECL_UNLINABLE for functions with computed gotos. (setup_vtbl_ptr): Mark the beginnings of constructors with CTOR_STMT. (expand_stmt): Handle CTOR_STMT, not CTOR_COMPLETE. (expand_body): Call optimize_function. Save bodies if we're doing inlining on trees. * tree.c: Don't include splay-tree.h. Include insn-config.h and integrate.h. (copy_tree_r): Make it public. (statement_code_p): New function. (mark_local_for_remap_r): Likewise. (cp_usave_r): Likewise. (cp_unsave): Likewise. (build_cplus_new): Set DECL_CONTEXT for temporary variables. (walk_tree): Walk into `s' class nodes. Walk statement chains. (copy_tree_r): Handle 's' class nodes. Restore chains for statements. Nullify scopes. Don't copy types. (init_tree): Set lang_unsave to cp_unsave. (remap_save_expr): Define. * ir.texi: Document CTOR_STMT. From-SVN: r30669
1999-11-25 21:32:04 +01:00
/* If possible, obliterate the body of the function so that it can
be garbage collected. */
c-common.h (flag_dump_translation_unit): Remove. * c-common.h (flag_dump_translation_unit): Remove. (enum tree_dump_index): Define. (TDF_ADDRESS, TDF_SLIM): New #defines. (dump_node_to_file): Remove. (dump_node): Make extern. Add flags. (dump_flag, dump_enabled_p, dump_begin, dump_end, dump_switch_p): Prototype. * c-common.c (flag_dump_translation_unit): Remove. * c-decl.c (c_decode_option): Remove -fdump-translation-unit logic. Use dump_switch_p. * c-dump.h (struct dump_info): Add node and user fields. (dump_pointer): Declare. * c-dump.c (dump_node): Make extern. Add flags. (SOL_COLUMN, EOL_COLUMN, COLUMN_ALIGNMENT): New #defines. (dump_new_line, dump_maybe_newline): Use them. (dump_pointer): New function. (dequeue_and_dump): Check TDF_SLIM before dumping a _DECL's chain or function's body. Dump address, if TDF_ADDRESS set. (dump_flag): Define. (dump_node_to_file): Remove. (struct dump_file_info): New struct. (dump_files): New array. (dump_begin, dump_end, dump_enabled_p, dump_switch_p): Define. * c-lang.c (finish_file): Adjust dumping. * toplev.h (dump_base_name): Make extern. * invoke.texi: Document new flags. cp: * class.c (maybe_indent_hierarchy): New function. (dump_class_hierarchy_r): Add flags. Dump extra binfo information, if enabled. Use maybe_indent_hierarchy. Adjust output format. (dump_class_hierarchy): Adjust prototype. Adjust output format. (dump_array, dump_vtable, dump_vtt): New functions. (finish_struct_1): Adjust hierarchy dumping. (initialize_vtable): Call dump_vtable. (build_vtt): Call dump_vtt. (build_ctor_vtbl_group): Call dump_vtable. * decl2.c (flag_dump_class_layout): Remove. (cxx_decode_option): Remove dump translation unit and dump class hierarchy check. Call dump_switch_p. (finish_file): Adjust dumping. (dump.c): Only dump base classes if not TDF_SLIM. Only dump namespace members if not TDF_SLIM. * optimize.c (dump_function): New function. (optimize_function): Call dump_function. * semantics.c (expand_body): Use dump_enabled_p. From-SVN: r42896
2001-06-05 10:03:45 +02:00
if (dump_enabled_p (TDI_all))
Make-lang.in (CXX_SRCS): Add optimize.c. 1999-11-25 Mark Mitchell <mark@codesourcery.com> * Make-lang.in (CXX_SRCS): Add optimize.c. * Makefile.in (CXX_OBJS): Add optimize.o. (CXX_TREE_H): Add splay-tree.h, system.h, and $(CONFIG_H). (spew.o, lex.o, decl.o, decl2.o, typeck2.o, typeck.o): Adjust. (class.o, call.o, friend.o, init.o, method.o, cvt.o): Likewise. (search.o, tree.o, ptree.o, rtti.o, except.o, expr.o): Likewise. (xref.o, pt.o, error.o, errfn.o, repo.o, semantics.o): Likewise. (dump.o): Likewise. (optimize.o): New target. * class.c: Don't include splay-tree.h. * cp-tree.def (CTOR_COMPLETE): Rename to CTOR_STMT. * cp-tree.h: Include splay-tree.h. (DECL_UNINLINABLE): New macro. (CTOR_BEGIN_P, CTOR_END_P): New macros. (flag_inline_trees): New variable. (local_variable_p): New function. (nonstatic_local_decl_p): Likewise. (optimize_function): Likewise. (cplus_unsave_expr_now): Remove. (copy_tree_r): Declare. (remap_save_expr): Likewise. * decl.c (local_variable_p): Don't make it static. (local_variable_p_walkfn): New function. (make_rtl_for_local_static): Remove code to try to avoid writing out static constants. (emit_local_var): Fix indentation. (nonstatic_local_decl_p): New function. (check_default_argument): Use local_variable_p_walkfn, not local_variable_p, when walking the tree. (start_function): Set the DECL_CONTEXT for automatically generated labels. (finish_constructor_body): Use CTOR_STMT to mark the end of a constructor. * decl2.c: Don't include splay-tree.h. (flag_inline_trees): Define. * dump.c: Don't include splay-tree.h. * except.c (expand_end_catch_block): Fix comment formatting. (expand_end_eh_spec): Set DECL_CONTEXT on temporary variables. (expand_throw): Tidy comment. * init.c (build_vec_delete_1): Use create_temporary_var. * lex.c (cplus_tree_code_type): Make it static. (cplus_tree_code_length): Likewise. (cplus_tree_code_name): Likewise. * optimize.c: New file. * semantics.c (finish_goto_stmt): Set DECL_UNLINABLE for functions with computed gotos. (setup_vtbl_ptr): Mark the beginnings of constructors with CTOR_STMT. (expand_stmt): Handle CTOR_STMT, not CTOR_COMPLETE. (expand_body): Call optimize_function. Save bodies if we're doing inlining on trees. * tree.c: Don't include splay-tree.h. Include insn-config.h and integrate.h. (copy_tree_r): Make it public. (statement_code_p): New function. (mark_local_for_remap_r): Likewise. (cp_usave_r): Likewise. (cp_unsave): Likewise. (build_cplus_new): Set DECL_CONTEXT for temporary variables. (walk_tree): Walk into `s' class nodes. Walk statement chains. (copy_tree_r): Handle 's' class nodes. Restore chains for statements. Nullify scopes. Don't copy types. (init_tree): Set lang_unsave to cp_unsave. (remap_save_expr): Define. * ir.texi: Document CTOR_STMT. From-SVN: r30669
1999-11-25 21:32:04 +01:00
/* Keep the body; we're going to dump it. */
;
else if (DECL_INLINE (fn) && flag_inline_trees)
/* We might need the body of this function so that we can expand
it inline somewhere else. */
;
else
/* We don't need the body; blow it away. */
DECL_SAVED_TREE (fn) = NULL_TREE;
/* And restore the current source position. */
current_function_decl = saved_function;
lineno = saved_lineno;
input_filename = saved_input_filename;
extract_interface_info ();
timevar_pop (TV_EXPAND);
/* Emit any thunks that should be emitted at the same time as FN. */
emit_associated_thunks (fn);
cp-tree.def (STMT_EXPR): New tree node. * cp-tree.def (STMT_EXPR): New tree node. * cp-tree.h (STMT_EXPR_STMT): New macro. (store_return_init): Change prototype. (finish_named_return_value): New function. (expand_stmt): Likewise. (expand_body): Likewise. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (expanding_p): New variable. (last_expr_type): Likewise. (building_stmt_tree): New macro. * decl.c (start_function): Use building_stmt_tree, not processing_template_decl, where appropriate. (store_parm_decls): Likewise. (store_return_init): Move most of the body to semantics.c. (finish_function): Use building_stmt_tree. (finish_stmt): Clear last_expr_type here. (cp_function): Add expanding_p, last_tree, last_expr_type. (push_cp_function_context): Save them. (pop_cp_function_context): Restore them. * decl2.c (setup_vtbl_ptr): Move to semantics.c. * error.c (dump_expr): Handle STMT_EXPR. * except.c (expand_start_catch_block): Use building_stmt_tree. Use add_decl_stmt. * expr.c (cplus_expand_expr): Handle STMT_EXPR. (do_case): Move add_tree call to semantics.c. * parse.y (return_init): Use finish_named_return_value. (for.init.statement): Use finish_expr_stmt. * parse.c: Regenerated. * pt.c (do_pushlevel): Move to semantics.c. (do_poplevel): Likewise. (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. (tsubst_expr): Don't expand all the way to RTL here. Handle RETURN_INIT and CTOR_INITIALIZER. (instantiate_decl): Call expand_body after tsubst'ing into DECL_SAVED_TREE. * semantics.c (expand_stmts): New function. (expanding_p): New variable. (last_expr_type): Likewise. (finish_expr_stmt): Use building_stmt_tree. (begin_if_stmt): Likewise. (finish_if_stmt_cond): Likewise. (finish_then_clause): Likewise. (begin_else_clause): Likewise. (finish_else_clause): Likewise. (begin_while_stmt): Likewise. (finish_while_stmt_cond): Likewise. (finish_while_stmt): Likewise. (finish_do_body): Likewise. (finish_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (fnish_for_init_stmt): Likewise. (finish_for_cond): Likewise. (finish_for_expr): Likewise. (finish_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (finish_switch_cond): Likewise. (finish_switch_stmt): Likewise. (finish_case_label): Call add_tree here if necessary. (finish_goto_statement): Use building_stmt_tree. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (finish_try_block): Likewise. (finish_function_try_block): Likewise. (finish_handler_sequence): Likewise. (finish_function_handler_sequence): Likewise. (begin_handler): Likewise. (finish_handler_parms): Likewise. (finish_handler): Likewise. (begin_compound_stmt): Likewise. (finish_compound_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (finish_named_return_value): New function. (setup_vtbl_ptr): Moved here from decl2.c. (do_pushlevel): Moved here from pt.c. (do_poplevel): Likewise. (begin_stmt_expr): Use building_stmt_tree. (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, when building_stmt_tree. (begin_stmt_tree): New function. (finish_stmt_tree): Likewise. (expand_stmt): Likewise. (expand_body): Likewise. * tree.c (build_cplus_method_type): Make sure the argument types end up on the same obstack as the METHOD_TYPE. (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR. (mapcar): Break out common cases. Handle COMPOUND_EXPR, MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than sorry, if an unsupported node is encountered. * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. (c_expand_return): Don't call add_tree here. From-SVN: r28729
1999-08-16 21:01:36 +02:00
}
/* Helper function for walk_tree, used by finish_function to override all
the RETURN_STMTs and pertinent CLEANUP_STMTs for the named return
value optimization. */
tree
nullify_returns_r (tp, walk_subtrees, data)
tree *tp;
int *walk_subtrees;
void *data;
{
tree nrv = (tree) data;
/* No need to walk into types. There wouldn't be any need to walk into
non-statements, except that we have to consider STMT_EXPRs. */
if (TYPE_P (*tp))
*walk_subtrees = 0;
else if (TREE_CODE (*tp) == RETURN_STMT)
RETURN_STMT_EXPR (*tp) = NULL_TREE;
else if (TREE_CODE (*tp) == CLEANUP_STMT
&& CLEANUP_DECL (*tp) == nrv)
CLEANUP_EH_ONLY (*tp) = 1;
/* Keep iterating. */
return NULL_TREE;
}
c-common.h (genrtl_clear_out_block): Remove. * c-common.h (genrtl_clear_out_block): Remove. * c-semantics.c (genrtl_clear_out_block): Remove. (genrtl_while_stmt): Don't call it. (genrtl_for_stmt): Likewise. * cp-tree.h (struct saved_scope): Remove x_function_parms. (current_function_parms): Don't define. (struct cp_language_function): Remove parms_stored. (current_function_just_assigned_this): Don't define. (current_function_parms_stored): Likewise. (static_ctors): Declare. (static_dtors): Likewise. (SF_EXPAND): Don't define. (expand_start_early_try_stmts): Remove declaration. (store_parm_decls): Likewise. * decl.c (static_ctors): Don't declare. (static_dtors): Likewise. (struct binding_level): Remove this_block. (poplevel): Remove dead code. (set_block): Likewise. (mark_binding_level): Don't mark this_block. (mark_saved_scope): Don't mark x_function_parms. (init_decl_processing): Don't add current_function_parms as a GC root. (check_function_type): Change prototype. (start_function): Remove RTL-generation code. (expand_start_early_try_stmts): Remove. (store_parm_decls): Give it internal linkage. Remove RTL-generation code. (finish_function): Remove RTL-generation code. * decl2.c (static_ctors): Fix formatting. (static_dtors): Likewise. * method.c (use_thunk): Don't call store_parm_decls. (synthesize_method): Likewise. * optimize.c (maybe_clone_body): Likewise. * parse.y (fn.def2): Likewise. (.set_base_init): Likewise. (nodecls): Likewise. * pt.c (instantiate_decl): Likewise. * rtti.c (synthesize_tinfo_fn): Likewise. * semantics.c (genrtl_try_block): Simplify. (expand_body): Use genrtl_start_function and genrtl_finish_function. (genrtl_start_function): New function. (genrtl_finish_function): Likewise. From-SVN: r36350
2000-09-12 08:46:00 +02:00
/* Start generating the RTL for FN. */
static void
genrtl_start_function (fn)
tree fn;
{
/* Tell everybody what function we're processing. */
current_function_decl = fn;
/* Get the RTL machinery going for this function. */
init_function_start (fn, DECL_SOURCE_FILE (fn), DECL_SOURCE_LINE (fn));
/* Let everybody know that we're expanding this function, not doing
semantic analysis. */
expanding_p = 1;
/* Even though we're inside a function body, we still don't want to
call expand_expr to calculate the size of a variable-sized array.
We haven't necessarily assigned RTL to all variables yet, so it's
not safe to try to expand expressions involving them. */
immediate_size_expand = 0;
cfun->x_dont_save_pending_sizes_p = 1;
/* Let the user know we're compiling this function. */
announce_function (fn);
/* Initialize the per-function data. */
my_friendly_assert (!DECL_PENDING_INLINE_P (fn), 20000911);
if (DECL_SAVED_FUNCTION_DATA (fn))
{
/* If we already parsed this function, and we're just expanding it
now, restore saved state. */
*cp_function_chain = *DECL_SAVED_FUNCTION_DATA (fn);
/* This function is being processed in whole-function mode; we
already did semantic analysis. */
cfun->x_whole_function_mode_p = 1;
/* If we decided that we didn't want to inline this function,
make sure the back-end knows that. */
if (!current_function_cannot_inline)
current_function_cannot_inline = cp_function_chain->cannot_inline;
/* We don't need the saved data anymore. Unless this is an inline
function; we need the named return value info for
cp_copy_res_decl_for_inlining. */
if (! DECL_INLINE (fn))
DECL_SAVED_FUNCTION_DATA (fn) = NULL;
c-common.h (genrtl_clear_out_block): Remove. * c-common.h (genrtl_clear_out_block): Remove. * c-semantics.c (genrtl_clear_out_block): Remove. (genrtl_while_stmt): Don't call it. (genrtl_for_stmt): Likewise. * cp-tree.h (struct saved_scope): Remove x_function_parms. (current_function_parms): Don't define. (struct cp_language_function): Remove parms_stored. (current_function_just_assigned_this): Don't define. (current_function_parms_stored): Likewise. (static_ctors): Declare. (static_dtors): Likewise. (SF_EXPAND): Don't define. (expand_start_early_try_stmts): Remove declaration. (store_parm_decls): Likewise. * decl.c (static_ctors): Don't declare. (static_dtors): Likewise. (struct binding_level): Remove this_block. (poplevel): Remove dead code. (set_block): Likewise. (mark_binding_level): Don't mark this_block. (mark_saved_scope): Don't mark x_function_parms. (init_decl_processing): Don't add current_function_parms as a GC root. (check_function_type): Change prototype. (start_function): Remove RTL-generation code. (expand_start_early_try_stmts): Remove. (store_parm_decls): Give it internal linkage. Remove RTL-generation code. (finish_function): Remove RTL-generation code. * decl2.c (static_ctors): Fix formatting. (static_dtors): Likewise. * method.c (use_thunk): Don't call store_parm_decls. (synthesize_method): Likewise. * optimize.c (maybe_clone_body): Likewise. * parse.y (fn.def2): Likewise. (.set_base_init): Likewise. (nodecls): Likewise. * pt.c (instantiate_decl): Likewise. * rtti.c (synthesize_tinfo_fn): Likewise. * semantics.c (genrtl_try_block): Simplify. (expand_body): Use genrtl_start_function and genrtl_finish_function. (genrtl_start_function): New function. (genrtl_finish_function): Likewise. From-SVN: r36350
2000-09-12 08:46:00 +02:00
}
/* Keep track of how many functions we're presently expanding. */
++function_depth;
/* Create a binding level for the parameters. */
expand_function_start (fn, /*parms_have_cleanups=*/0);
c-common.h (genrtl_clear_out_block): Remove. * c-common.h (genrtl_clear_out_block): Remove. * c-semantics.c (genrtl_clear_out_block): Remove. (genrtl_while_stmt): Don't call it. (genrtl_for_stmt): Likewise. * cp-tree.h (struct saved_scope): Remove x_function_parms. (current_function_parms): Don't define. (struct cp_language_function): Remove parms_stored. (current_function_just_assigned_this): Don't define. (current_function_parms_stored): Likewise. (static_ctors): Declare. (static_dtors): Likewise. (SF_EXPAND): Don't define. (expand_start_early_try_stmts): Remove declaration. (store_parm_decls): Likewise. * decl.c (static_ctors): Don't declare. (static_dtors): Likewise. (struct binding_level): Remove this_block. (poplevel): Remove dead code. (set_block): Likewise. (mark_binding_level): Don't mark this_block. (mark_saved_scope): Don't mark x_function_parms. (init_decl_processing): Don't add current_function_parms as a GC root. (check_function_type): Change prototype. (start_function): Remove RTL-generation code. (expand_start_early_try_stmts): Remove. (store_parm_decls): Give it internal linkage. Remove RTL-generation code. (finish_function): Remove RTL-generation code. * decl2.c (static_ctors): Fix formatting. (static_dtors): Likewise. * method.c (use_thunk): Don't call store_parm_decls. (synthesize_method): Likewise. * optimize.c (maybe_clone_body): Likewise. * parse.y (fn.def2): Likewise. (.set_base_init): Likewise. (nodecls): Likewise. * pt.c (instantiate_decl): Likewise. * rtti.c (synthesize_tinfo_fn): Likewise. * semantics.c (genrtl_try_block): Simplify. (expand_body): Use genrtl_start_function and genrtl_finish_function. (genrtl_start_function): New function. (genrtl_finish_function): Likewise. From-SVN: r36350
2000-09-12 08:46:00 +02:00
/* If this function is `main'. */
if (DECL_MAIN_P (fn))
expand_main_function ();
/* Give our named return value the same RTL as our RESULT_DECL. */
if (current_function_return_value)
COPY_DECL_RTL (DECL_RESULT (fn), current_function_return_value);
c-common.h (genrtl_clear_out_block): Remove. * c-common.h (genrtl_clear_out_block): Remove. * c-semantics.c (genrtl_clear_out_block): Remove. (genrtl_while_stmt): Don't call it. (genrtl_for_stmt): Likewise. * cp-tree.h (struct saved_scope): Remove x_function_parms. (current_function_parms): Don't define. (struct cp_language_function): Remove parms_stored. (current_function_just_assigned_this): Don't define. (current_function_parms_stored): Likewise. (static_ctors): Declare. (static_dtors): Likewise. (SF_EXPAND): Don't define. (expand_start_early_try_stmts): Remove declaration. (store_parm_decls): Likewise. * decl.c (static_ctors): Don't declare. (static_dtors): Likewise. (struct binding_level): Remove this_block. (poplevel): Remove dead code. (set_block): Likewise. (mark_binding_level): Don't mark this_block. (mark_saved_scope): Don't mark x_function_parms. (init_decl_processing): Don't add current_function_parms as a GC root. (check_function_type): Change prototype. (start_function): Remove RTL-generation code. (expand_start_early_try_stmts): Remove. (store_parm_decls): Give it internal linkage. Remove RTL-generation code. (finish_function): Remove RTL-generation code. * decl2.c (static_ctors): Fix formatting. (static_dtors): Likewise. * method.c (use_thunk): Don't call store_parm_decls. (synthesize_method): Likewise. * optimize.c (maybe_clone_body): Likewise. * parse.y (fn.def2): Likewise. (.set_base_init): Likewise. (nodecls): Likewise. * pt.c (instantiate_decl): Likewise. * rtti.c (synthesize_tinfo_fn): Likewise. * semantics.c (genrtl_try_block): Simplify. (expand_body): Use genrtl_start_function and genrtl_finish_function. (genrtl_start_function): New function. (genrtl_finish_function): Likewise. From-SVN: r36350
2000-09-12 08:46:00 +02:00
}
/* Finish generating the RTL for FN. */
static void
genrtl_finish_function (fn)
tree fn;
{
tree t;
c-common.h (genrtl_clear_out_block): Remove. * c-common.h (genrtl_clear_out_block): Remove. * c-semantics.c (genrtl_clear_out_block): Remove. (genrtl_while_stmt): Don't call it. (genrtl_for_stmt): Likewise. * cp-tree.h (struct saved_scope): Remove x_function_parms. (current_function_parms): Don't define. (struct cp_language_function): Remove parms_stored. (current_function_just_assigned_this): Don't define. (current_function_parms_stored): Likewise. (static_ctors): Declare. (static_dtors): Likewise. (SF_EXPAND): Don't define. (expand_start_early_try_stmts): Remove declaration. (store_parm_decls): Likewise. * decl.c (static_ctors): Don't declare. (static_dtors): Likewise. (struct binding_level): Remove this_block. (poplevel): Remove dead code. (set_block): Likewise. (mark_binding_level): Don't mark this_block. (mark_saved_scope): Don't mark x_function_parms. (init_decl_processing): Don't add current_function_parms as a GC root. (check_function_type): Change prototype. (start_function): Remove RTL-generation code. (expand_start_early_try_stmts): Remove. (store_parm_decls): Give it internal linkage. Remove RTL-generation code. (finish_function): Remove RTL-generation code. * decl2.c (static_ctors): Fix formatting. (static_dtors): Likewise. * method.c (use_thunk): Don't call store_parm_decls. (synthesize_method): Likewise. * optimize.c (maybe_clone_body): Likewise. * parse.y (fn.def2): Likewise. (.set_base_init): Likewise. (nodecls): Likewise. * pt.c (instantiate_decl): Likewise. * rtti.c (synthesize_tinfo_fn): Likewise. * semantics.c (genrtl_try_block): Simplify. (expand_body): Use genrtl_start_function and genrtl_finish_function. (genrtl_start_function): New function. (genrtl_finish_function): Likewise. From-SVN: r36350
2000-09-12 08:46:00 +02:00
#if 0
if (write_symbols != NO_DEBUG)
{
/* Keep this code around in case we later want to control debug info
based on whether a type is "used". (jason 1999-11-11) */
tree ttype = target_type (fntype);
tree parmdecl;
if (IS_AGGR_TYPE (ttype))
/* Let debugger know it should output info for this type. */
note_debug_info_needed (ttype);
for (parmdecl = DECL_ARGUMENTS (fndecl); parmdecl; parmdecl = TREE_CHAIN (parmdecl))
{
ttype = target_type (TREE_TYPE (parmdecl));
if (IS_AGGR_TYPE (ttype))
/* Let debugger know it should output info for this type. */
note_debug_info_needed (ttype);
}
}
#endif
/* Clean house because we will need to reorder insns here. */
do_pending_stack_adjust ();
/* If we have a named return value, we need to force a return so that
the return register is USEd. */
if (DECL_NAME (DECL_RESULT (fn)))
emit_jump (return_label);
c-common.h (genrtl_clear_out_block): Remove. * c-common.h (genrtl_clear_out_block): Remove. * c-semantics.c (genrtl_clear_out_block): Remove. (genrtl_while_stmt): Don't call it. (genrtl_for_stmt): Likewise. * cp-tree.h (struct saved_scope): Remove x_function_parms. (current_function_parms): Don't define. (struct cp_language_function): Remove parms_stored. (current_function_just_assigned_this): Don't define. (current_function_parms_stored): Likewise. (static_ctors): Declare. (static_dtors): Likewise. (SF_EXPAND): Don't define. (expand_start_early_try_stmts): Remove declaration. (store_parm_decls): Likewise. * decl.c (static_ctors): Don't declare. (static_dtors): Likewise. (struct binding_level): Remove this_block. (poplevel): Remove dead code. (set_block): Likewise. (mark_binding_level): Don't mark this_block. (mark_saved_scope): Don't mark x_function_parms. (init_decl_processing): Don't add current_function_parms as a GC root. (check_function_type): Change prototype. (start_function): Remove RTL-generation code. (expand_start_early_try_stmts): Remove. (store_parm_decls): Give it internal linkage. Remove RTL-generation code. (finish_function): Remove RTL-generation code. * decl2.c (static_ctors): Fix formatting. (static_dtors): Likewise. * method.c (use_thunk): Don't call store_parm_decls. (synthesize_method): Likewise. * optimize.c (maybe_clone_body): Likewise. * parse.y (fn.def2): Likewise. (.set_base_init): Likewise. (nodecls): Likewise. * pt.c (instantiate_decl): Likewise. * rtti.c (synthesize_tinfo_fn): Likewise. * semantics.c (genrtl_try_block): Simplify. (expand_body): Use genrtl_start_function and genrtl_finish_function. (genrtl_start_function): New function. (genrtl_finish_function): Likewise. From-SVN: r36350
2000-09-12 08:46:00 +02:00
/* We hard-wired immediate_size_expand to zero in start_function.
Expand_function_end will decrement this variable. So, we set the
variable to one here, so that after the decrement it will remain
zero. */
immediate_size_expand = 1;
/* Generate rtl for function exit. */
expand_function_end (input_filename, lineno, 0);
c-common.h (genrtl_clear_out_block): Remove. * c-common.h (genrtl_clear_out_block): Remove. * c-semantics.c (genrtl_clear_out_block): Remove. (genrtl_while_stmt): Don't call it. (genrtl_for_stmt): Likewise. * cp-tree.h (struct saved_scope): Remove x_function_parms. (current_function_parms): Don't define. (struct cp_language_function): Remove parms_stored. (current_function_just_assigned_this): Don't define. (current_function_parms_stored): Likewise. (static_ctors): Declare. (static_dtors): Likewise. (SF_EXPAND): Don't define. (expand_start_early_try_stmts): Remove declaration. (store_parm_decls): Likewise. * decl.c (static_ctors): Don't declare. (static_dtors): Likewise. (struct binding_level): Remove this_block. (poplevel): Remove dead code. (set_block): Likewise. (mark_binding_level): Don't mark this_block. (mark_saved_scope): Don't mark x_function_parms. (init_decl_processing): Don't add current_function_parms as a GC root. (check_function_type): Change prototype. (start_function): Remove RTL-generation code. (expand_start_early_try_stmts): Remove. (store_parm_decls): Give it internal linkage. Remove RTL-generation code. (finish_function): Remove RTL-generation code. * decl2.c (static_ctors): Fix formatting. (static_dtors): Likewise. * method.c (use_thunk): Don't call store_parm_decls. (synthesize_method): Likewise. * optimize.c (maybe_clone_body): Likewise. * parse.y (fn.def2): Likewise. (.set_base_init): Likewise. (nodecls): Likewise. * pt.c (instantiate_decl): Likewise. * rtti.c (synthesize_tinfo_fn): Likewise. * semantics.c (genrtl_try_block): Simplify. (expand_body): Use genrtl_start_function and genrtl_finish_function. (genrtl_start_function): New function. (genrtl_finish_function): Likewise. From-SVN: r36350
2000-09-12 08:46:00 +02:00
/* If this is a nested function (like a template instantiation that
we're compiling in the midst of compiling something else), push a
new GC context. That will keep local variables on the stack from
being collected while we're doing the compilation of this
function. */
if (function_depth > 1)
ggc_push_context ();
/* There's no need to defer outputting this function any more; we
know we want to output it. */
DECL_DEFER_OUTPUT (fn) = 0;
c-common.h (genrtl_clear_out_block): Remove. * c-common.h (genrtl_clear_out_block): Remove. * c-semantics.c (genrtl_clear_out_block): Remove. (genrtl_while_stmt): Don't call it. (genrtl_for_stmt): Likewise. * cp-tree.h (struct saved_scope): Remove x_function_parms. (current_function_parms): Don't define. (struct cp_language_function): Remove parms_stored. (current_function_just_assigned_this): Don't define. (current_function_parms_stored): Likewise. (static_ctors): Declare. (static_dtors): Likewise. (SF_EXPAND): Don't define. (expand_start_early_try_stmts): Remove declaration. (store_parm_decls): Likewise. * decl.c (static_ctors): Don't declare. (static_dtors): Likewise. (struct binding_level): Remove this_block. (poplevel): Remove dead code. (set_block): Likewise. (mark_binding_level): Don't mark this_block. (mark_saved_scope): Don't mark x_function_parms. (init_decl_processing): Don't add current_function_parms as a GC root. (check_function_type): Change prototype. (start_function): Remove RTL-generation code. (expand_start_early_try_stmts): Remove. (store_parm_decls): Give it internal linkage. Remove RTL-generation code. (finish_function): Remove RTL-generation code. * decl2.c (static_ctors): Fix formatting. (static_dtors): Likewise. * method.c (use_thunk): Don't call store_parm_decls. (synthesize_method): Likewise. * optimize.c (maybe_clone_body): Likewise. * parse.y (fn.def2): Likewise. (.set_base_init): Likewise. (nodecls): Likewise. * pt.c (instantiate_decl): Likewise. * rtti.c (synthesize_tinfo_fn): Likewise. * semantics.c (genrtl_try_block): Simplify. (expand_body): Use genrtl_start_function and genrtl_finish_function. (genrtl_start_function): New function. (genrtl_finish_function): Likewise. From-SVN: r36350
2000-09-12 08:46:00 +02:00
/* Run the optimizers and output the assembler code for this
function. */
rest_of_compilation (fn);
/* Undo the call to ggc_push_context above. */
if (function_depth > 1)
ggc_pop_context ();
#if 0
/* Keep this code around in case we later want to control debug info
based on whether a type is "used". (jason 1999-11-11) */
if (ctype && TREE_ASM_WRITTEN (fn))
note_debug_info_needed (ctype);
#endif
/* If this function is marked with the constructor attribute, add it
to the list of functions to be called along with constructors
from static duration objects. */
if (DECL_STATIC_CONSTRUCTOR (fn))
static_ctors = tree_cons (NULL_TREE, fn, static_ctors);
/* If this function is marked with the destructor attribute, add it
to the list of functions to be called along with destructors from
static duration objects. */
if (DECL_STATIC_DESTRUCTOR (fn))
static_dtors = tree_cons (NULL_TREE, fn, static_dtors);
--function_depth;
/* In C++, we should never be saving RTL for the function. */
my_friendly_assert (!DECL_SAVED_INSNS (fn), 20010903);
/* Since we don't need the RTL for this function anymore, stop
pointing to it. That's especially important for LABEL_DECLs,
since you can reach all the instructions in the function from the
CODE_LABEL stored in the DECL_RTL for the LABEL_DECL. Walk the
BLOCK-tree, clearing DECL_RTL for LABEL_DECLs and non-static
local variables. */
walk_tree_without_duplicates (&DECL_SAVED_TREE (fn),
clear_decl_rtl,
NULL);
c-common.h (genrtl_clear_out_block): Remove. * c-common.h (genrtl_clear_out_block): Remove. * c-semantics.c (genrtl_clear_out_block): Remove. (genrtl_while_stmt): Don't call it. (genrtl_for_stmt): Likewise. * cp-tree.h (struct saved_scope): Remove x_function_parms. (current_function_parms): Don't define. (struct cp_language_function): Remove parms_stored. (current_function_just_assigned_this): Don't define. (current_function_parms_stored): Likewise. (static_ctors): Declare. (static_dtors): Likewise. (SF_EXPAND): Don't define. (expand_start_early_try_stmts): Remove declaration. (store_parm_decls): Likewise. * decl.c (static_ctors): Don't declare. (static_dtors): Likewise. (struct binding_level): Remove this_block. (poplevel): Remove dead code. (set_block): Likewise. (mark_binding_level): Don't mark this_block. (mark_saved_scope): Don't mark x_function_parms. (init_decl_processing): Don't add current_function_parms as a GC root. (check_function_type): Change prototype. (start_function): Remove RTL-generation code. (expand_start_early_try_stmts): Remove. (store_parm_decls): Give it internal linkage. Remove RTL-generation code. (finish_function): Remove RTL-generation code. * decl2.c (static_ctors): Fix formatting. (static_dtors): Likewise. * method.c (use_thunk): Don't call store_parm_decls. (synthesize_method): Likewise. * optimize.c (maybe_clone_body): Likewise. * parse.y (fn.def2): Likewise. (.set_base_init): Likewise. (nodecls): Likewise. * pt.c (instantiate_decl): Likewise. * rtti.c (synthesize_tinfo_fn): Likewise. * semantics.c (genrtl_try_block): Simplify. (expand_body): Use genrtl_start_function and genrtl_finish_function. (genrtl_start_function): New function. (genrtl_finish_function): Likewise. From-SVN: r36350
2000-09-12 08:46:00 +02:00
/* Clear out the RTL for the arguments. */
for (t = DECL_ARGUMENTS (fn); t; t = TREE_CHAIN (t))
{
SET_DECL_RTL (t, NULL_RTX);
DECL_INCOMING_RTL (t) = NULL_RTX;
}
if (!(flag_inline_trees && DECL_INLINE (fn)))
/* DECL_INITIAL must remain nonzero so we know this was an
actual function definition. */
DECL_INITIAL (fn) = error_mark_node;
c-common.h (genrtl_clear_out_block): Remove. * c-common.h (genrtl_clear_out_block): Remove. * c-semantics.c (genrtl_clear_out_block): Remove. (genrtl_while_stmt): Don't call it. (genrtl_for_stmt): Likewise. * cp-tree.h (struct saved_scope): Remove x_function_parms. (current_function_parms): Don't define. (struct cp_language_function): Remove parms_stored. (current_function_just_assigned_this): Don't define. (current_function_parms_stored): Likewise. (static_ctors): Declare. (static_dtors): Likewise. (SF_EXPAND): Don't define. (expand_start_early_try_stmts): Remove declaration. (store_parm_decls): Likewise. * decl.c (static_ctors): Don't declare. (static_dtors): Likewise. (struct binding_level): Remove this_block. (poplevel): Remove dead code. (set_block): Likewise. (mark_binding_level): Don't mark this_block. (mark_saved_scope): Don't mark x_function_parms. (init_decl_processing): Don't add current_function_parms as a GC root. (check_function_type): Change prototype. (start_function): Remove RTL-generation code. (expand_start_early_try_stmts): Remove. (store_parm_decls): Give it internal linkage. Remove RTL-generation code. (finish_function): Remove RTL-generation code. * decl2.c (static_ctors): Fix formatting. (static_dtors): Likewise. * method.c (use_thunk): Don't call store_parm_decls. (synthesize_method): Likewise. * optimize.c (maybe_clone_body): Likewise. * parse.y (fn.def2): Likewise. (.set_base_init): Likewise. (nodecls): Likewise. * pt.c (instantiate_decl): Likewise. * rtti.c (synthesize_tinfo_fn): Likewise. * semantics.c (genrtl_try_block): Simplify. (expand_body): Use genrtl_start_function and genrtl_finish_function. (genrtl_start_function): New function. (genrtl_finish_function): Likewise. From-SVN: r36350
2000-09-12 08:46:00 +02:00
/* Let the error reporting routines know that we're outside a
function. For a nested function, this value is used in
pop_cp_function_context and then reset via pop_function_context. */
current_function_decl = NULL_TREE;
}
/* Clear out the DECL_RTL for the non-static variables in BLOCK and
its sub-blocks. */
static tree
clear_decl_rtl (tp, walk_subtrees, data)
tree *tp;
int *walk_subtrees ATTRIBUTE_UNUSED;
void *data ATTRIBUTE_UNUSED;
{
if (nonstatic_local_decl_p (*tp))
SET_DECL_RTL (*tp, NULL_RTX);
return NULL_TREE;
}
/* Perform initialization related to this module. */
void
init_cp_semantics ()
{
lang_expand_stmt = cp_expand_stmt;
}