Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / gcc / java / java-except.h
bloba45e650ffb8ab27404f36d59a473615df1c846cf
1 /* Definitions for exception handling for use by the GNU compiler
2 for the Java(TM) language compiler.
3 Copyright (C) 1997, 1998, 1999, 2000, 2003, 2004, 2005
4 Free Software Foundation, Inc.
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
13 GCC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA.
23 Java and all Java-based marks are trademarks or registered trademarks
24 of Sun Microsystems, Inc. in the United States and other countries.
25 The Free Software Foundation is independent of Sun Microsystems, Inc. */
27 struct eh_range
29 /* The (byte-code PC) range of the handled block. */
30 int start_pc;
31 int end_pc;
33 /* A list of handlers. For each element in the list,
34 the TREE_PURPOSE is the handled class (NULL_EXPR for a finally block),
35 and the TREE_VALUE is the LABEL_DECL of the handler. */
36 tree handlers;
38 /* Surrounding handler, if any. */
39 struct eh_range *outer;
41 /* The first child range. It is is nested inside this range
42 (i.e. this.start_pc <= first_child.end_pc
43 && this.end_pc >= first_child.end_pc).
44 The children are linked together using next_sibling, and are sorted
45 by increasing start_pc and end_pc (we do not support non-nested
46 overlapping ranges). */
47 struct eh_range *first_child;
49 /* The next child of outer, in address order. */
50 struct eh_range *next_sibling;
52 /* True if this range has already been expanded. */
53 int expanded;
55 /* The TRY_CATCH_EXPR for this EH range. */
56 tree stmt;
58 tree handler;
61 /* A dummy range that represents the entire method. */
62 extern struct eh_range whole_range;
64 #define NULL_EH_RANGE (&whole_range)
66 extern struct eh_range * find_handler (int);
67 extern void method_init_exceptions (void);
68 extern void maybe_start_try (int, int);
69 extern void add_handler (int, int, tree, tree);
70 extern void handle_nested_ranges (void);
71 extern void expand_end_java_handler (struct eh_range *);