1 /* Language-independent diagnostic subroutines for the GNU Compiler
2 Collection that are only for use in the compilers proper and not
3 the driver or other programs.
4 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
5 2009, 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
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
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/>. */
25 #include "coretypes.h"
27 #include "diagnostic.h"
28 #include "tree-diagnostic.h"
29 #include "langhooks.h"
30 #include "langhooks-def.h"
32 /* Prints out, if necessary, the name of the current function
33 that caused an error. Called from all error and warning functions. */
35 diagnostic_report_current_function (diagnostic_context
*context
,
36 diagnostic_info
*diagnostic
)
38 diagnostic_report_current_module (context
);
39 lang_hooks
.print_error_function (context
, input_filename
, diagnostic
);
43 default_tree_diagnostic_starter (diagnostic_context
*context
,
44 diagnostic_info
*diagnostic
)
46 diagnostic_report_current_function (context
, diagnostic
);
47 pp_set_prefix (context
->printer
, diagnostic_build_prefix (context
,