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