diff options
author | Andrew MacLeod <amacleod@cygnus.com> | 1998-06-25 14:11:54 +0000 |
---|---|---|
committer | Andrew Macleod <amacleod@gcc.gnu.org> | 1998-06-25 14:11:54 +0000 |
commit | 9c606f693ddca43b89097388cfdeeffaead030df (patch) | |
tree | bb987eafff1d4601db541283435b2bfed1629fa6 /gcc/cp/except.c | |
parent | 296b815223f2a71b7a377af93ea7a599c26f9d18 (diff) | |
download | gcc-9c606f693ddca43b89097388cfdeeffaead030df.zip gcc-9c606f693ddca43b89097388cfdeeffaead030df.tar.gz gcc-9c606f693ddca43b89097388cfdeeffaead030df.tar.bz2 |
[multiple changes]
Thu Jun 25 16:59:18 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
* except.h (CATCH_ALL_TYPE): Definition moved to eh-common.h.
(find_all_handler_type_matches): Add function prototype.
* eh-common.h (CATCH_ALL_TYPE): Definition added.
* except.c (find_all_handler_type_matches): Add function to find all
runtime type info in the exception table.
(output_exception_table_entry): Special case for CATCH_ALL_TYPE.
1998-06-25 Andrew MacLeod <amacleod@cygnus.com>
* cp-tree.h (mark_all_runtime_matches): Add function prototype.
* except.c (mark_all_runtime_matches): Set TREE_SYMBOL_REFERENCED
flag for all function decls which are in the exception table.
* exception.cc (__cplus_type_matcher): Check for CATCH_ALL_TYPE match.
* decl2.c (finish_file): Call mark_all_runtime_matches to make sure
code is emitted for any referenced rtti function.
From-SVN: r20718
Diffstat (limited to 'gcc/cp/except.c')
-rw-r--r-- | gcc/cp/except.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/gcc/cp/except.c b/gcc/cp/except.c index 438351e..4139dfd 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -472,6 +472,34 @@ build_eh_type (exp) return build_eh_type_type (TREE_TYPE (exp)); } +/* This routine is called to mark all the symbols representing runtime + type functions in the exception table as haveing been referenced. + This will make sure code is emitted for them. Called from finish_file. */ +void +mark_all_runtime_matches () +{ + int x,num; + void **ptr; + tree exp; + + num = find_all_handler_type_matches (&ptr); + if (num == 0 || ptr == NULL) + return; + + for (x=0; x <num; x++) + { + exp = (tree) ptr[x]; + if (TREE_CODE (exp) == ADDR_EXPR) + { + exp = TREE_OPERAND (exp, 0); + if (TREE_CODE (exp) == FUNCTION_DECL) + TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (exp)) = 1; + } + } + + free (ptr); +} + /* Build up a call to __cp_pop_exception, to destroy the exception object for the current catch block. HANDLER is either true or false, telling the library whether or not it is being called from an exception handler; @@ -721,7 +749,7 @@ process_start_catch_block (declspecs, declarator) if (decl) start_catch_handler (build_eh_type_type_ref (TREE_TYPE (decl))); else - start_catch_handler (NULL_TREE); + start_catch_handler (CATCH_ALL_TYPE); emit_line_note (input_filename, lineno); |