/* Implements exception handling.
- Copyright (C) 1989, 92-96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1989, 92-97, 1998 Free Software Foundation, Inc.
Contributed by Mike Stump <mrs@cygnus.com>.
This file is part of GNU CC.
throw. On machines that have unwind info support, __throw is generated
by code in libgcc2.c, otherwise __throw is generated on a
per-object-file basis for each source file compiled with
- -fexceptions by the the C++ frontend. Before __throw is invoked,
+ -fexceptions by the C++ frontend. Before __throw is invoked,
the current context of the throw needs to be placed in the global
variable __eh_pc.
#include "config.h"
#include "defaults.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "tree.h"
#include "flags.h"
#include "insn-config.h"
#include "recog.h"
#include "output.h"
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
+#include "toplev.h"
/* One to use setjmp/longjmp method of generating code for exception
handling. */
struct label_node *false_label_stack = NULL;
-rtx expand_builtin_return_addr PROTO((enum built_in_function, int, rtx));
+static void push_eh_entry PROTO((struct eh_stack *));
+static struct eh_entry * pop_eh_entry PROTO((struct eh_stack *));
+static void enqueue_eh_entry PROTO((struct eh_queue *, struct eh_entry *));
+static struct eh_entry * dequeue_eh_entry PROTO((struct eh_queue *));
+static rtx call_get_eh_context PROTO((void));
+static void start_dynamic_cleanup PROTO((tree, tree));
+static void start_dynamic_handler PROTO((void));
static void expand_rethrow PROTO((rtx));
+static void output_exception_table_entry PROTO((FILE *, int));
+static int can_throw PROTO((rtx));
+static rtx scan_region PROTO((rtx, int, int *));
+static void eh_regs PROTO((rtx *, rtx *, int));
+static void set_insn_eh_region PROTO((rtx *, int));
+rtx expand_builtin_return_addr PROTO((enum built_in_function, int, rtx));
\f
/* Various support routines to manipulate the various data structures
used by the exception handling code. */
return tempentry;
}
\f
-/* Routine to see if exception exception handling is turned on.
+/* Routine to see if exception handling is turned on.
DO_WARN is non-zero if we want to inform the user that exception
handling is turned off.
This routine notices one particular common case in C++ code
generation, and optimizes it so as to not need the exception
region. It works by creating a dynamic cleanup action, instead of
- of a using an exception region. */
+ a using an exception region. */
int
expand_eh_region_start_tree (decl, cleanup)
return 0;
}
-/* Output the entry of the exception table corresponding to to the
+/* Output the entry of the exception table corresponding to the
exception region numbered N to file FILE.
N is the code label number corresponding to the handler of the
static int *insn_eh_region = (int *)0;
static int maximum_uid;
-static void set_insn_eh_region (first, region_num)
+static void
+set_insn_eh_region (first, region_num)
rtx *first;
int region_num;
{