From b2dd096b0c7e5c48380b99b3d2b1ff4763b7f525 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Tue, 22 Apr 2003 05:44:12 +0000 Subject: Makefile.in (calls.o): Depend on except.h. * Makefile.in (calls.o): Depend on except.h. * calls.c: Include except.h. (emit_call_1): Call note_eh_region_may_contain_throw if appropriate. * except.c (eh_region): Add may_contain_throw. (expand_eh_region_end_cleanup): Do not include handler code when it cannot be reached. (note_eh_region_may_contain_throw): New function. * except.h (note_eh_region_may_contain_throw): New function. * call.c (build_over_call): Use build_cxx_call. (build_cxx_call): New method, split out of build_over_call. * cp-tree.h (language_function): Add can_throw. (build_cxx_call): Declare it. * decl.c (finish_function): If a function does not contain any calls to functions that can throw an exception, indicate that fact. * decl2.c (mark_used): Do not defer the instantiation of functions, if the current function does not throw. * optimize.c (maybe_clone_body): Copy TREE_NOTHROW to the clones. * pt.c (instantiate_decl): Make sure import_export_decl is called before emitting things. * rtti.c (throw_bad_cast): Use build_cxx_call. (build_dynamic_cast_1): Likewise. * typeck.c (build_function_call): Likewise. * g++.dg/template/recurse.C: Adjust location of error messages. From-SVN: r65929 --- gcc/cp/optimize.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/cp/optimize.c') diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c index d461b0d..2c1c15d 100644 --- a/gcc/cp/optimize.c +++ b/gcc/cp/optimize.c @@ -259,6 +259,9 @@ maybe_clone_body (tree fn) /* Clean up. */ splay_tree_delete (decl_map); + /* The clone can throw iff the original function can throw. */ + cp_function_chain->can_throw = !TREE_NOTHROW (fn); + /* Now, expand this function into RTL, if appropriate. */ finish_function (0); BLOCK_ABSTRACT_ORIGIN (DECL_INITIAL (clone)) = DECL_INITIAL (fn); -- cgit v1.1