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