comparison gcc/diagnostic.h @ 63:b7f97abdc517 gcc-4.6-20100522

update gcc from gcc-4.5.0 to gcc-4.6
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Mon, 24 May 2010 12:47:05 +0900
parents 77e2b8dfacca
children f6334be47118
comparison
equal deleted inserted replaced
56:3c8a44c06a95 63:b7f97abdc517
1 /* Various declarations for language-independent diagnostics subroutines. 1 /* Various declarations for language-independent diagnostics subroutines.
2 Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 2 Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
3 Free Software Foundation, Inc. 3 2010, Free Software Foundation, Inc.
4 Contributed by Gabriel Dos Reis <gdr@codesourcery.com> 4 Contributed by Gabriel Dos Reis <gdr@codesourcery.com>
5 5
6 This file is part of GCC. 6 This file is part of GCC.
7 7
8 GCC is free software; you can redistribute it and/or modify it under 8 GCC is free software; you can redistribute it and/or modify it under
40 typedef struct diagnostic_info 40 typedef struct diagnostic_info
41 { 41 {
42 text_info message; 42 text_info message;
43 location_t location; 43 location_t location;
44 unsigned int override_column; 44 unsigned int override_column;
45 /* TREE_BLOCK if the diagnostic is to be reported in some inline 45 /* Auxiliary data for client. */
46 function inlined into other function, otherwise NULL. */ 46 void *x_data;
47 tree abstract_origin;
48 /* The kind of diagnostic it is about. */ 47 /* The kind of diagnostic it is about. */
49 diagnostic_t kind; 48 diagnostic_t kind;
50 /* Which OPT_* directly controls this diagnostic. */ 49 /* Which OPT_* directly controls this diagnostic. */
51 int option_index; 50 int option_index;
52 } diagnostic_info; 51 } diagnostic_info;
67 /* The number of times we have issued diagnostics. */ 66 /* The number of times we have issued diagnostics. */
68 int diagnostic_count[DK_LAST_DIAGNOSTIC_KIND]; 67 int diagnostic_count[DK_LAST_DIAGNOSTIC_KIND];
69 68
70 /* True if we should display the "warnings are being tread as error" 69 /* True if we should display the "warnings are being tread as error"
71 message, usually displayed once per compiler run. */ 70 message, usually displayed once per compiler run. */
72 bool issue_warnings_are_errors_message; 71 bool some_warnings_are_errors;
73 72
74 /* True if it has been requested that warnings be treated as errors. */ 73 /* True if it has been requested that warnings be treated as errors. */
75 bool warning_as_error_requested; 74 bool warning_as_error_requested;
76 75
77 /* For each option index that can be passed to warning() et all 76 /* For each option index that can be passed to warning() et all
101 diagnostic_finalizer_fn end_diagnostic; 100 diagnostic_finalizer_fn end_diagnostic;
102 101
103 /* Client hook to report an internal error. */ 102 /* Client hook to report an internal error. */
104 void (*internal_error) (const char *, va_list *); 103 void (*internal_error) (const char *, va_list *);
105 104
106 /* Function of last diagnostic message; more generally, function such that 105 /* Auxiliary data for client. */
107 if next diagnostic message is in it then we don't have to mention the 106 void *x_data;
108 function name. */
109 tree last_function;
110 107
111 /* Used to detect when the input file stack has changed since last 108 /* Used to detect when the input file stack has changed since last
112 described. */ 109 described. */
113 const struct line_map *last_module; 110 const struct line_map *last_module;
114 111
115 int lock; 112 int lock;
113
114 bool inhibit_notes_p;
116 }; 115 };
116
117 static inline void
118 diagnostic_inhibit_notes (diagnostic_context * context)
119 {
120 context->inhibit_notes_p = true;
121 }
122
117 123
118 /* Client supplied function to announce a diagnostic. */ 124 /* Client supplied function to announce a diagnostic. */
119 #define diagnostic_starter(DC) (DC)->begin_diagnostic 125 #define diagnostic_starter(DC) (DC)->begin_diagnostic
120 126
121 /* Client supplied function called after a diagnostic message is 127 /* Client supplied function called after a diagnostic message is
122 displayed. */ 128 displayed. */
123 #define diagnostic_finalizer(DC) (DC)->end_diagnostic 129 #define diagnostic_finalizer(DC) (DC)->end_diagnostic
124 130
125 /* Extension hook for client. */ 131 /* Extension hooks for client. */
126 #define diagnostic_auxiliary_data(DC) (DC)->x_data 132 #define diagnostic_context_auxiliary_data(DC) (DC)->x_data
133 #define diagnostic_info_auxiliary_data(DI) (DI)->x_data
127 134
128 /* Same as pp_format_decoder. Works on 'diagnostic_context *'. */ 135 /* Same as pp_format_decoder. Works on 'diagnostic_context *'. */
129 #define diagnostic_format_decoder(DC) ((DC)->printer->format_decoder) 136 #define diagnostic_format_decoder(DC) ((DC)->printer->format_decoder)
130 137
131 /* Same as output_prefixing_rule. Works on 'diagnostic_context *'. */ 138 /* Same as output_prefixing_rule. Works on 'diagnostic_context *'. */
134 /* Maximum characters per line in automatic line wrapping mode. 141 /* Maximum characters per line in automatic line wrapping mode.
135 Zero means don't wrap lines. */ 142 Zero means don't wrap lines. */
136 #define diagnostic_line_cutoff(DC) ((DC)->printer->wrapping.line_cutoff) 143 #define diagnostic_line_cutoff(DC) ((DC)->printer->wrapping.line_cutoff)
137 144
138 #define diagnostic_flush_buffer(DC) pp_base_flush ((DC)->printer) 145 #define diagnostic_flush_buffer(DC) pp_base_flush ((DC)->printer)
139
140 /* True if the last function in which a diagnostic was reported is
141 different from the current one. */
142 #define diagnostic_last_function_changed(DC, DI) \
143 ((DC)->last_function != ((DI)->abstract_origin \
144 ? (DI)->abstract_origin : current_function_decl))
145
146 /* Remember the current function as being the last one in which we report
147 a diagnostic. */
148 #define diagnostic_set_last_function(DC, DI) \
149 (DC)->last_function = (((DI) && (DI)->abstract_origin) \
150 ? (DI)->abstract_origin : current_function_decl)
151 146
152 /* True if the last module or file in which a diagnostic was reported is 147 /* True if the last module or file in which a diagnostic was reported is
153 different from the current one. */ 148 different from the current one. */
154 #define diagnostic_last_module_changed(DC, MAP) \ 149 #define diagnostic_last_module_changed(DC, MAP) \
155 ((DC)->last_module != MAP) 150 ((DC)->last_module != MAP)
188 183
189 /* Override the column number to be used for reporting a 184 /* Override the column number to be used for reporting a
190 diagnostic. */ 185 diagnostic. */
191 #define diagnostic_override_column(DI, COL) (DI)->override_column = (COL) 186 #define diagnostic_override_column(DI, COL) (DI)->override_column = (COL)
192 187
188 /* Override the option index to be used for reporting a
189 diagnostic. */
190 #define diagnostic_override_option_index(DI, OPTIDX) \
191 ((DI)->option_index = (OPTIDX))
192
193 /* Diagnostic related functions. */ 193 /* Diagnostic related functions. */
194 extern void diagnostic_initialize (diagnostic_context *); 194 extern void diagnostic_initialize (diagnostic_context *);
195 extern void diagnostic_finish (diagnostic_context *);
195 extern void diagnostic_report_current_module (diagnostic_context *); 196 extern void diagnostic_report_current_module (diagnostic_context *);
196 extern void diagnostic_report_current_function (diagnostic_context *,
197 diagnostic_info *);
198 197
199 /* Force diagnostics controlled by OPTIDX to be kind KIND. */ 198 /* Force diagnostics controlled by OPTIDX to be kind KIND. */
200 extern diagnostic_t diagnostic_classify_diagnostic (diagnostic_context *, 199 extern diagnostic_t diagnostic_classify_diagnostic (diagnostic_context *,
201 int /* optidx */, 200 int /* optidx */,
202 diagnostic_t /* kind */); 201 diagnostic_t /* kind */);
217 void default_diagnostic_finalizer (diagnostic_context *, diagnostic_info *); 216 void default_diagnostic_finalizer (diagnostic_context *, diagnostic_info *);
218 217
219 /* Pure text formatting support functions. */ 218 /* Pure text formatting support functions. */
220 extern char *file_name_as_prefix (const char *); 219 extern char *file_name_as_prefix (const char *);
221 220
222 /* In tree-pretty-print.c */
223 extern void print_declaration (pretty_printer *, tree, int, int);
224 extern int dump_generic_node (pretty_printer *, tree, int, int, bool);
225 extern void print_generic_stmt (FILE *, tree, int);
226 extern void print_generic_stmt_indented (FILE *, tree, int, int);
227 extern void print_generic_expr (FILE *, tree, int);
228 extern void print_generic_decl (FILE *, tree, int);
229 extern void debug_c_tree (tree);
230 extern void dump_omp_clauses (pretty_printer *, tree, int, int);
231 extern void print_call_name (pretty_printer *, tree, int);
232
233 /* In gimple-pretty-print.c */
234 extern void debug_generic_expr (tree);
235 extern void debug_generic_stmt (tree);
236 extern void debug_tree_chain (tree);
237 extern void debug_gimple_stmt (gimple);
238 extern void debug_gimple_seq (gimple_seq);
239 extern void print_gimple_seq (FILE *, gimple_seq, int, int);
240 extern void print_gimple_stmt (FILE *, gimple, int, int);
241 extern void print_gimple_expr (FILE *, gimple, int, int);
242 extern void dump_gimple_stmt (pretty_printer *, gimple, int, int);
243
244 /* In toplev.c */
245 extern bool default_tree_printer (pretty_printer *, text_info *, const char *,
246 int, bool, bool, bool);
247
248 #endif /* ! GCC_DIAGNOSTIC_H */ 221 #endif /* ! GCC_DIAGNOSTIC_H */