tree-diagnostic.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* Various declarations for language-independent diagnostics
  2. subroutines that are only for use in the compilers proper and not
  3. the driver or other programs.
  4. Copyright (C) 2000-2019 Free Software Foundation, Inc.
  5. This file is part of GCC.
  6. GCC is free software; you can redistribute it and/or modify it under
  7. the terms of the GNU General Public License as published by the Free
  8. Software Foundation; either version 3, or (at your option) any later
  9. version.
  10. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  13. for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with GCC; see the file COPYING3. If not see
  16. <http://www.gnu.org/licenses/>. */
  17. #ifndef GCC_TREE_DIAGNOSTIC_H
  18. #define GCC_TREE_DIAGNOSTIC_H
  19. /* TREE_BLOCK if the diagnostic is to be reported in some inline
  20. function inlined into other function, otherwise NULL. */
  21. #define diagnostic_abstract_origin(DI) \
  22. ((tree) diagnostic_info_auxiliary_data (DI))
  23. /* Function of last diagnostic message; more generally, function such
  24. that if next diagnostic message is in it then we don't have to
  25. mention the function name. */
  26. #define diagnostic_last_function(DC) \
  27. ((tree) diagnostic_context_auxiliary_data (DC))
  28. /* True if the last function in which a diagnostic was reported is
  29. different from the current one. */
  30. #define diagnostic_last_function_changed(DC, DI) \
  31. (diagnostic_last_function (DC) != (diagnostic_abstract_origin (DI) \
  32. ? diagnostic_abstract_origin (DI) \
  33. : current_function_decl))
  34. /* Remember the current function as being the last one in which we report
  35. a diagnostic. */
  36. #define diagnostic_set_last_function(DC, DI) \
  37. diagnostic_context_auxiliary_data (DC) \
  38. = (((DI) && diagnostic_abstract_origin (DI)) \
  39. ? diagnostic_abstract_origin (DI) \
  40. : current_function_decl)
  41. void diagnostic_report_current_function (diagnostic_context *,
  42. diagnostic_info *);
  43. void virt_loc_aware_diagnostic_finalizer (diagnostic_context *,
  44. diagnostic_info *);
  45. void tree_diagnostics_defaults (diagnostic_context *context);
  46. bool default_tree_printer (pretty_printer *, text_info *, const char *,
  47. int, bool, bool, bool, bool *, const char **);
  48. #endif /* ! GCC_TREE_DIAGNOSTIC_H */