summaryrefslogtreecommitdiff
path: root/gcc/except.c
diff options
context:
space:
mode:
authoramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>1998-05-28 07:32:33 +0000
committeramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>1998-05-28 07:32:33 +0000
commit444be12c32939cb52150531e086e29753ec4c514 (patch)
tree1ae90a1f7e7acf9282967693b1700bd18248222e /gcc/except.c
parentbd3b10888bb2aaa30742b85acb9fdd5ccdb3ead2 (diff)
downloadgcc-444be12c32939cb52150531e086e29753ec4c514.tar.gz
Flow now removes exception regions when their handlers are all removed.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@20115 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/except.c')
-rw-r--r--gcc/except.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/except.c b/gcc/except.c
index a2cee20dc89..5881e223d64 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -754,6 +754,34 @@ add_new_handler (region, newhandler)
}
}
+/* Remove a handler label. The handler label is being deleted, so all
+ regions which reference this handler should have it removed from their
+ list of possible handlers. Any region which has the final handler
+ removed can be deleted. */
+
+void remove_handler (removing_label)
+ rtx removing_label;
+{
+ struct handler_info *handler, *last;
+ int x;
+ for (x = 0 ; x < current_func_eh_entry; ++x)
+ {
+ last = NULL;
+ handler = function_eh_regions[x].handlers;
+ for ( ; handler; last = handler, handler = handler->next)
+ if (handler->handler_label == removing_label)
+ {
+ if (last)
+ {
+ last->next = handler->next;
+ handler = last;
+ }
+ else
+ function_eh_regions[x].handlers = handler->next;
+ }
+ }
+}
+
/* Create a new handler structure initialized with the handler label and
typeinfo fields passed in. */