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