diff options
author | amacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-05-14 13:39:15 +0000 |
---|---|---|
committer | amacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-05-14 13:39:15 +0000 |
commit | 011a7f231d497d484ae4d4c4e5407da4f1a5a00d (patch) | |
tree | 210e41e74a68a515399d6c03258a484e02563706 /gcc/integrate.c | |
parent | 6f1bf8a1217bcb9d5b8b63d63c962b326b5d0319 (diff) | |
download | gcc-011a7f231d497d484ae4d4c4e5407da4f1a5a00d.tar.gz |
First cut of changes to utilize the new exception handling model
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19746 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/integrate.c')
-rw-r--r-- | gcc/integrate.c | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/gcc/integrate.c b/gcc/integrate.c index 2f8dde132dd..7a588884e86 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -95,7 +95,12 @@ get_label_from_map (map, i) rtx x = map->label_map[i]; if (x == NULL_RTX) - x = map->label_map[i] = gen_label_rtx(); + { + push_obstacks_nochange (); + end_temporary_allocation (); + x = map->label_map[i] = gen_label_rtx(); + pop_obstacks (); + } return x; } @@ -658,10 +663,28 @@ save_for_inline_copying (fndecl) if (NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_BEG || NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_END) { + int new_region = CODE_LABEL_NUMBER + (label_map[NOTE_BLOCK_NUMBER (copy)]); + + /* we have to duplicate the handlers for the original */ + if (NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_BEG) + { + handler_info *ptr, *temp; + int nr; + nr = new_eh_region_entry (new_region); + ptr = get_first_handler (NOTE_BLOCK_NUMBER (copy)); + for ( ; ptr; ptr = ptr->next) + { + temp = get_new_handler ( + label_map[CODE_LABEL_NUMBER (ptr->handler_label)], + ptr->type_info); + add_new_handler (nr, temp); + } + } + /* We have to forward these both to match the new exception region. */ - NOTE_BLOCK_NUMBER (copy) - = CODE_LABEL_NUMBER (label_map[NOTE_BLOCK_NUMBER (copy)]); + NOTE_BLOCK_NUMBER (copy) = new_region; } RTX_INTEGRATED_P (copy) = RTX_INTEGRATED_P (insn); @@ -2038,6 +2061,22 @@ expand_inline_function (fndecl, parms, target, ignore, type, rtx label = get_label_from_map (map, NOTE_BLOCK_NUMBER (copy)); + /* we have to duplicate the handlers for the original */ + if (NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_BEG) + { + handler_info *ptr, *temp; + int nr; + nr = new_eh_region_entry (CODE_LABEL_NUMBER (label)); + ptr = get_first_handler (NOTE_BLOCK_NUMBER (copy)); + for ( ; ptr; ptr = ptr->next) + { + temp = get_new_handler ( get_label_from_map (map, + CODE_LABEL_NUMBER (ptr->handler_label)), + ptr->type_info); + add_new_handler (nr, temp); + } + } + /* We have to forward these both to match the new exception region. */ NOTE_BLOCK_NUMBER (copy) = CODE_LABEL_NUMBER (label); |