summaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-09-18 01:23:20 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-09-18 01:23:20 +0000
commite0e489c42466dc40574a9d7c610d31b64103cd75 (patch)
treeb9dd570a763fea2069777a6a8736ee992107849d /gcc/cp/pt.c
parent2d04109968ed378b98e32c683db814220e910fce (diff)
downloadgcc-e0e489c42466dc40574a9d7c610d31b64103cd75.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29490 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 76524229b27..35bf27f9da0 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -7475,19 +7475,25 @@ tsubst_expr (t, args, complain, in_decl)
finish_handler_sequence (stmt);
}
break;
-
+
case HANDLER:
- prep_stmt (t);
- stmt = begin_handler ();
- if (HANDLER_PARMS (t))
- expand_start_catch_block
- (tsubst (DECL_STMT_DECL (HANDLER_PARMS (t)),
- args, complain, in_decl));
- else
- expand_start_catch_block (NULL_TREE);
- finish_handler_parms (stmt);
- tsubst_expr (HANDLER_BODY (t), args, complain, in_decl);
- finish_handler (stmt);
+ {
+ tree decl;
+ tree blocks;
+
+ prep_stmt (t);
+ stmt = begin_handler ();
+ if (HANDLER_PARMS (t))
+ {
+ decl = DECL_STMT_DECL (HANDLER_PARMS (t));
+ decl = tsubst (decl, args, complain, in_decl);
+ }
+ else
+ decl = NULL_TREE;
+ blocks = finish_handler_parms (decl, stmt);
+ tsubst_expr (HANDLER_BODY (t), args, complain, in_decl);
+ finish_handler (blocks, stmt);
+ }
break;
case TAG_DEFN: