java-except.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* Definitions for exception handling for use by the GNU compiler
  2. for the Java(TM) language compiler.
  3. Copyright (C) 1997-2015 Free Software Foundation, Inc.
  4. This file is part of GCC.
  5. GCC is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3, or (at your option)
  8. any later version.
  9. GCC is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with GCC; see the file COPYING3. If not see
  15. <http://www.gnu.org/licenses/>.
  16. Java and all Java-based marks are trademarks or registered trademarks
  17. of Sun Microsystems, Inc. in the United States and other countries.
  18. The Free Software Foundation is independent of Sun Microsystems, Inc. */
  19. struct eh_range
  20. {
  21. /* The (byte-code PC) range of the handled block. */
  22. int start_pc;
  23. int end_pc;
  24. /* A list of handlers. For each element in the list,
  25. the TREE_PURPOSE is the handled class (NULL_EXPR for a finally block),
  26. and the TREE_VALUE is the LABEL_DECL of the handler. */
  27. tree handlers;
  28. /* Surrounding handler, if any. */
  29. struct eh_range *outer;
  30. /* The first child range. It is is nested inside this range
  31. (i.e. this.start_pc <= first_child.end_pc
  32. && this.end_pc >= first_child.end_pc).
  33. The children are linked together using next_sibling, and are sorted
  34. by increasing start_pc and end_pc (we do not support non-nested
  35. overlapping ranges). */
  36. struct eh_range *first_child;
  37. /* The next child of outer, in address order. */
  38. struct eh_range *next_sibling;
  39. /* True if this range has already been expanded. */
  40. int expanded;
  41. /* The TRY_CATCH_EXPR for this EH range. */
  42. tree stmt;
  43. };
  44. /* A dummy range that represents the entire method. */
  45. extern struct eh_range whole_range;
  46. #define NULL_EH_RANGE (&whole_range)
  47. extern struct eh_range * find_handler (int);
  48. extern void method_init_exceptions (void);
  49. extern void maybe_start_try (int, int);
  50. extern void add_handler (int, int, tree, tree);
  51. extern void expand_end_java_handler (struct eh_range *);
  52. extern bool sanity_check_exception_range (struct eh_range *);