This improves an error message, avoiding at ... at.
[gcc.git] / libcpp / ChangeLog
blobf21855c769c0416a7f0fea2feddb6b1b3250eeab
1 2024-12-24  Lewis Hyatt  <lhyatt@gmail.com>
3         * macro.cc (tokens_buff_new): Fix length argument to XNEWVEC.
5 2024-12-08  Lewis Hyatt  <lhyatt@gmail.com>
7         * include/cpplib.h (struct cpp_token): Adjust comment about the
8         struct size.
9         * include/line-map.h (location_t): Change typedef from 32-bit to 64-bit
10         integer.
11         (LINE_MAP_MAX_COLUMN_NUMBER): Increase size to be appropriate for
12         64-bit location_t.
13         (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): Likewise.
14         (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
15         (LINE_MAP_MAX_LOCATION): Likewise.
16         (MAX_LOCATION_T): Likewise.
17         (line_map_suggested_range_bits): Likewise.
18         (struct line_map): Adjust comment about the struct size.
19         (struct line_map_macro): Likewise.
20         (struct line_map_ordinary): Likewise. Rearrange fields to optimize
21         padding.
23 2024-12-06  Jakub Jelinek  <jakub@redhat.com>
25         * files.cc (finish_embed): Use CPP_EMBED even for C++.
27 2024-12-03  Joseph Myers  <josmyers@redhat.com>
29         PR c/117162
30         * include/cpplib.h (struct cpp_options): Add low_ucns.
31         * init.cc (struct lang_flags, lang_defaults): Add low_ucns.
32         (cpp_set_lang): Set low_ucns
33         * charset.cc (_cpp_valid_ucn): For C, allow UCNs below 0xa0
34         outside identifiers, with a pedwarn if pedantic before C23 or a
35         warning with -Wc11-c23-compat.  Do not allow \u0024 in identifiers
36         for C23.
38 2024-11-28  David Malcolm  <dmalcolm@redhat.com>
40         PR c/104896
41         * pch.cc (cpp_valid_state): Replace "%<%s%>" with "%qs" in message
42         wording.
44 2024-11-27  Jason Merrill  <jason@redhat.com>
46         * files.cc (_cpp_stack_file): Handle -include of header unit more
47         specially.
49 2024-11-23  Lewis Hyatt  <lhyatt@gmail.com>
51         PR preprocessor/117118
52         * lex.cc (lex_raw_string): Treat an unterminated raw string the same
53         way for a deferred pragma as is done for other directives.
55 2024-11-23  Lewis Hyatt  <lhyatt@gmail.com>
57         * lex.cc (_cpp_commit_buff): Make sure that the buffer is properly
58         aligned for the next allocation.
59         * internal.h (struct dummy): Make sure alignment is large enough for
60         a location_t, just in case.
62 2024-11-23  Lewis Hyatt  <lhyatt@gmail.com>
64         * include/line-map.h (line_map_uint_t): New typedef, the same type
65         as location_t.
66         (location_diff_t): New typedef.
67         (line_map_suggested_range_bits): New constant.
68         (struct maps_info_ordinary): Change member types from "unsigned int"
69         to "line_map_uint_t".
70         (struct maps_info_macro): Likewise.
71         (struct location_adhoc_data_map): Likewise.
72         (LINEMAPS_ALLOCATED): Change return type from "unsigned int" to
73         "line_map_uint_t".
74         (LINEMAPS_ORDINARY_ALLOCATED): Likewise.
75         (LINEMAPS_MACRO_ALLOCATED): Likewise.
76         (LINEMAPS_USED): Likewise.
77         (LINEMAPS_ORDINARY_USED): Likewise.
78         (LINEMAPS_MACRO_USED): Likewise.
79         (linemap_lookup_macro_index): Likewise.
80         (LINEMAPS_MAP_AT): Change argument type from "unsigned int" to
81         "line_map_uint_t".
82         (LINEMAPS_ORDINARY_MAP_AT): Likewise.
83         (LINEMAPS_MACRO_MAP_AT): Likewise.
84         (line_map_new_raw): Likewise.
85         (linemap_module_restore): Likewise.
86         (linemap_dump): Likewise.
87         (line_table_dump): Likewise.
88         (LINEMAPS_LAST_MAP): Add a linemap_assert() for safety.
89         (SOURCE_COLUMN): Use a cast to ensure correctness if location_t
90         becomes a 64-bit type.
91         * line-map.cc (location_adhoc_data_hash): Don't truncate to 32-bit
92         prematurely when hashing.
93         (line_maps::get_or_create_combined_loc): Adapt types to support
94         potentially 64-bit location_t. Use MAX_LOCATION_T rather than a
95         hard-coded constant.
96         (line_maps::get_range_from_loc): Adapt types and constants to
97         support potentially 64-bit location_t.
98         (line_maps::pure_location_p): Likewise.
99         (line_maps::get_pure_location): Likewise.
100         (line_map_new_raw): Likewise.
101         (LAST_SOURCE_LINE_LOCATION): Likewise.
102         (linemap_add): Likewise.
103         (linemap_module_restore): Likewise.
104         (linemap_line_start): Likewise.
105         (linemap_position_for_column): Likewise.
106         (linemap_position_for_line_and_column): Likewise.
107         (linemap_position_for_loc_and_offset): Likewise.
108         (linemap_ordinary_map_lookup): Likewise.
109         (linemap_lookup_macro_index): Likewise.
110         (linemap_dump): Likewise.
111         (linemap_dump_location): Likewise.
112         (linemap_get_file_highest_location): Likewise.
113         (line_table_dump): Likewise.
114         (linemap_compare_locations): Avoid signed int overflow in the result.
115         * macro.cc (num_expanded_macros_counter): Change type of global
116         variable from "unsigned int" to "line_map_uint_t".
117         (num_macro_tokens_counter): Likewise.
119 2024-11-18  Jason Merrill  <jason@redhat.com>
121         * internal.h (_cpp_get_file_dir): Declare.
122         * files.cc (_cpp_get_file_dir): New fn.
123         * mkdeps.cc (make_write): Use it.
125 2024-11-17  Jason Merrill  <jason@redhat.com>
127         * internal.h (search_path_head): Declare.
128         * files.cc (search_path_head): No longer static.
129         * init.cc (cpp_read_main_file): Use it.
131 2024-11-15  Jakub Jelinek  <jakub@redhat.com>
133         * expr.cc (interpret_float_suffix): Handle d64x and D64x
134         suffixes, adjust comment.
136 2024-11-13  Jakub Jelinek  <jakub@redhat.com>
138         * expr.cc (interpret_float_suffix): Handle d32 and D32 suffixes
139         for C like df, d64 and D64 like dd and d128 and D128 like
140         dl.
142 2024-11-13  Jakub Jelinek  <jakub@redhat.com>
144         PR c/117029
145         * include/cpplib.h (struct cpp_options): Add imaginary_constants
146         member.
147         * init.cc (struct lang_flags): Add imaginary_constants bitfield.
148         (lang_defaults): Add column for imaginary_constants.
149         (cpp_set_lang): Copy over imaginary_constants.
150         * expr.cc (cpp_classify_number): Diagnose CPP_N_IMAGINARY
151         non-CPP_N_FLOATING constants differently for C.
153 2024-11-01  Jakub Jelinek  <jakub@redhat.com>
155         PR c++/114461
156         * include/cpplib.h: Implement C++26 P3034R1
157         - Module Declarations Shouldn’t be Macros (or more precisely
158         its expected intent).
159         (NO_DOT_COLON): Define.
160         * internal.h (struct cpp_reader): Add diagnose_dot_colon_from_macro_p
161         member.
162         * lex.cc (cpp_maybe_module_directive): For pp-module, if
163         module keyword is followed by CPP_NAME, ensure all CPP_NAME
164         tokens possibly matching module name and module partition
165         syntax aren't expanded and aren't defined as object-like macros.
166         Verify first token after that doesn't start with open paren.
167         If the next token after module name/partition is CPP_NAME defined
168         as macro, set NO_DOT_COLON flag on it.
169         * macro.cc (cpp_get_token_1): Set
170         pfile->diagnose_dot_colon_from_macro_p if token to be expanded has
171         NO_DOT_COLON bit set in flags.  Before returning, if
172         pfile->diagnose_dot_colon_from_macro_p is true and not returning
173         CPP_PADDING or CPP_COMMENT and not during macro expansion preparation,
174         set pfile->diagnose_dot_colon_from_macro_p to false and diagnose
175         if returning CPP_DOT or CPP_COLON.
177 2024-10-25  Jakub Jelinek  <jakub@redhat.com>
179         * directives.cc: Remove trailing whitespace.
180         * mkdeps.cc: Likewise.
181         * line-map.cc: Likewise.
182         * internal.h: Likewise.
183         * files.cc: Likewise.
184         * init.cc: Likewise.
185         * makeucnid.cc: Likewise.
186         * system.h: Likewise.
187         * include/line-map.h: Likewise.
188         * include/symtab.h: Likewise.
189         * include/cpplib.h: Likewise.
190         * expr.cc: Likewise.
191         * charset.cc: Likewise.
192         * macro.cc: Likewise.
193         * errors.cc: Likewise.
194         * lex.cc: Likewise.
195         * traditional.cc: Likewise.
197 2024-10-23  Jakub Jelinek  <jakub@redhat.com>
199         * include/cpplib.h (struct cpp_options): Add
200         cpp_warn_leading_whitespace and cpp_tabstop members.
201         (enum cpp_warning_reason): Add CPP_W_LEADING_WHITESPACE.
202         * internal.h (struct _cpp_line_note): Document new
203         line note kinds.
204         * init.cc (cpp_create_reader): Set cpp_tabstop to 8.
205         * lex.cc (find_leading_whitespace_issues): New function.
206         (_cpp_clean_line): Use it.
207         (_cpp_process_line_notes): Handle 'L', 'S' and 'T' line notes.
208         (lex_raw_string): Clear type on 'L', 'S' and 'T' line notes
209         inside of raw string literals.
211 2024-10-19  Lewis Hyatt  <lhyatt@gmail.com>
213         PR preprocessor/114423
214         * internal.h (struct cpp_reader): Add DIAGNOSTIC_OVERRIDE_LOC
215         field.
216         * directives.cc (destringize_and_run): Set the new field to the
217         location of the _Pragma operator.
218         * errors.cc (cpp_diagnostic_at): Support DIAGNOSTIC_OVERRIDE_LOC to
219         temporarily issue diagnostics at a different location.
220         (cpp_diagnostic_with_line): Likewise.
222 2024-10-17  Jakub Jelinek  <jakub@redhat.com>
224         PR c/117028
225         * include/cpplib.h (struct cpp_options): Add named_uc_escape_seqs,
226         octal_constants and cpp_warn_c23_c2y_compat members.
227         (enum cpp_warning_reason): Add CPP_W_C23_C2Y_COMPAT enumerator.
228         * init.cc (struct lang_flags): Add named_uc_escape_seqs and
229         octal_constants bit-fields.
230         (lang_defaults): Add initializers for them into the table.
231         (cpp_set_lang): Initialize named_uc_escape_seqs and octal_constants.
232         (cpp_create_reader): Initialize cpp_warn_c23_c2y_compat to -1.
233         * charset.cc (_cpp_valid_ucn): Test
234         CPP_OPTION (pfile, named_uc_escape_seqs) rather than
235         CPP_OPTION (pfile, delimited_escape_seqs) in \N{} related tests.
236         Change wording of C cpp_pedwarning for \u{} and emit
237         -Wc23-c2y-compat warning for it too if needed.  Formatting fixes.
238         (convert_hex): Change wording of C cpp_pedwarning for \u{} and emit
239         -Wc23-c2y-compat warning for it too if needed.
240         (convert_oct): Likewise.
241         * expr.cc (cpp_classify_number): Handle C2Y 0o or 0O prefixed
242         octal constants.
243         (cpp_interpret_integer): Likewise.
245 2024-10-16  Jakub Jelinek  <jakub@redhat.com>
247         * expr.cc (interpret_float_suffix): ?: operator formatting fixes.
249 2024-10-16  Jakub Jelinek  <jakub@redhat.com>
251         * include/cpplib.h (TTYPE_TABLE): Add CPP_EMBED token type.
252         * files.cc (finish_embed): For limit >= 64 and C preprocessing
253         instead of emitting CPP_NUMBER CPP_COMMA separated sequence for the
254         whole embed emit it just for the first and last byte and in between
255         emit a CPP_EMBED token or tokens if too large.
257 2024-10-15  Jakub Jelinek  <jakub@redhat.com>
259         * include/cpplib.h (struct cpp_options): Add
260         cpp_warn_trailing_whitespace member.
261         (enum cpp_warning_reason): Add CPP_W_TRAILING_WHITESPACE.
262         * internal.h (struct _cpp_line_note): Document 'W' line note.
263         * lex.cc (_cpp_clean_line): Add 'W' line note for trailing whitespace
264         except for trailing whitespace after backslash.  Formatting fix.
265         (_cpp_process_line_notes): Emit -Wtrailing-whitespace diagnostics.
266         Formatting fixes.
267         (lex_raw_string): Clear type on 'W' notes.
269 2024-10-14  Jason Merrill  <jason@redhat.com>
271         * lex.cc (cpp_output_token): Omit terminal space from name.
273 2024-10-14  Lewis Hyatt  <lhyatt@gmail.com>
275         PR preprocessor/114436
276         * directives.cc (destringize_and_run): If the _Pragma changed the
277         buffer system header state (e.g. because it was "GCC
278         system_header"), propagate that change back to the actual buffer
279         too.
281 2024-10-14  Lewis Hyatt  <lhyatt@gmail.com>
283         PR preprocessor/109704
284         * include/cpplib.h (class cpp_auto_suppress_diagnostics): New class.
285         * errors.cc
286         (cpp_auto_suppress_diagnostics::cpp_auto_suppress_diagnostics): New
287         function.
288         (cpp_auto_suppress_diagnostics::~cpp_auto_suppress_diagnostics): New
289         function.
290         * charset.cc (noop_diagnostic_cb): Remove.
291         (cpp_interpret_string_ranges): Refactor diagnostic suppression logic
292         into new class cpp_auto_suppress_diagnostics.
293         (count_source_chars): Likewise.
294         * directives.cc (cpp_pop_definition): Add cpp_hashnode argument.
295         (lex_identifier_from_string): New static helper function.
296         (push_pop_macro_common): Refactor common logic from
297         do_pragma_push_macro and do_pragma_pop_macro; use
298         lex_identifier_from_string instead of _cpp_lex_identifier.
299         (do_pragma_push_macro): Reimplement using push_pop_macro_common.
300         (do_pragma_pop_macro): Likewise.
301         * internal.h (_cpp_lex_identifier): Remove.
302         * lex.cc (lex_identifier_intern): Remove.
303         (_cpp_lex_identifier): Remove.
305 2024-10-12  Jakub Jelinek  <jakub@redhat.com>
307         * include/cpplib.h (ATTRIBUTE_CPP_PPDIAG): Define.
308         (struct cpp_callbacks): Use ATTRIBUTE_CPP_PPDIAG instead of
309         ATTRIBUTE_FPTR_PRINTF on diagnostic callback.
310         (cpp_error, cpp_warning, cpp_pedwarning, cpp_warning_syshdr): Use
311         ATTRIBUTE_CPP_PPDIAG (3, 4) instead of ATTRIBUTE_PRINTF_3.
312         (cpp_warning_at, cpp_pedwarning_at): Use ATTRIBUTE_CPP_PPDIAG (4, 5)
313         instead of ATTRIBUTE_PRINTF_4.
314         (cpp_error_with_line, cpp_warning_with_line, cpp_pedwarning_with_line,
315         cpp_warning_with_line_syshdr): Use ATTRIBUTE_CPP_PPDIAG (5, 6)
316         instead of ATTRIBUTE_PRINTF_5.
317         (cpp_error_at): Use ATTRIBUTE_CPP_PPDIAG (4, 5) instead of
318         ATTRIBUTE_PRINTF_4.
319         * Makefile.in (po/$(PACKAGE).pot): Use --language=GCC-source rather
320         than --language=c.
321         * errors.cc (cpp_diagnostic_at, cpp_diagnostic,
322         cpp_diagnostic_with_line): Use ATTRIBUTE_CPP_PPDIAG instead of
323         -ATTRIBUTE_FPTR_PRINTF.
324         * charset.cc (cpp_host_to_exec_charset, _cpp_valid_ucn, convert_hex,
325         convert_oct, convert_escape): Fix up -Wformat-diag warnings.
326         (cpp_interpret_string_ranges, count_source_chars): Use
327         ATTRIBUTE_CPP_PPDIAG instead of ATTRIBUTE_FPTR_PRINTF.
328         (narrow_str_to_charconst): Fix up -Wformat-diag warnings.
329         * directives.cc (check_eol_1, directive_diagnostics, lex_macro_node,
330         do_undef, glue_header_name, parse_include, do_include_common,
331         do_include_next, _cpp_parse_embed_params, do_embed, read_flag,
332         do_line, do_linemarker, register_pragma_1, do_pragma_once,
333         do_pragma_push_macro, do_pragma_pop_macro, do_pragma_poison,
334         do_pragma_system_header, do_pragma_warning_or_error, _cpp_do__Pragma,
335         do_else, do_elif, do_endif, parse_answer, do_assert,
336         cpp_define_unused): Likewise.
337         * expr.cc (cpp_classify_number, parse_defined, eval_token,
338         _cpp_parse_expr, reduce, check_promotion): Likewise.
339         * files.cc (_cpp_find_file, finish_base64_embed,
340         _cpp_pop_file_buffer): Likewise.
341         * init.cc (sanity_checks): Likewise.
342         * lex.cc (_cpp_process_line_notes, maybe_warn_bidi_on_char,
343         _cpp_warn_invalid_utf8, _cpp_skip_block_comment,
344         warn_about_normalization, forms_identifier_p, maybe_va_opt_error,
345         identifier_diagnostics_on_lex, cpp_maybe_module_directive): Likewise.
346         * macro.cc (class vaopt_state, builtin_has_include_1,
347         builtin_has_include, builtin_has_embed, _cpp_warn_if_unused_macro,
348         _cpp_builtin_macro_text, builtin_macro, stringify_arg,
349         _cpp_arguments_ok, collect_args, enter_macro_context,
350         _cpp_save_parameter, parse_params, create_iso_definition,
351         _cpp_create_definition, check_trad_stringification): Likewise.
352         * pch.cc (cpp_valid_state): Likewise.
353         * traditional.cc (_cpp_scan_out_logical_line, recursive_macro):
354         Likewise.
356 2024-10-09  Jason Merrill  <jason@redhat.com>
358         * macro.cc (_cpp_pop_context): Fix typo.
360 2024-10-09  Ken Matsui  <kmatsui@gcc.gnu.org>
362         PR bootstrap/117039
363         * directives.cc (do_pragma_once): Use ' instead of %< and %>.
365 2024-10-09  Ken Matsui  <kmatsui@gcc.gnu.org>
367         PR preprocessor/89808
368         * include/cpplib.h (cpp_warning_reason): Define
369         CPP_W_PRAGMA_ONCE_OUTSIDE_HEADER.
370         * directives.cc (do_pragma_once): Use
371         CPP_W_PRAGMA_ONCE_OUTSIDE_HEADER.
373 2024-10-08  Jakub Jelinek  <jakub@redhat.com>
375         * makeucnid.cc (write_copyright): Update Unicode Copyright years.
376         * makeuname2c.cc (generated_ranges): Adjust Unicode version from 15.1
377         to 16.0.  Add EGYPTIAN HIEROGLYPH- generated range, adjust indexes in
378         following entries.
379         (write_copyright): Update Unicode Copyright years.
380         * generated_cpp_wcwidth.h: Regenerated.
381         * ucnid.h: Regenerated.
382         * uname2c.h: Regenerated.
384 2024-10-07  Jakub Jelinek  <jakub@redhat.com>
386         * internal.h (_cpp_trigraph_map_s): New type for C++14 or later.
387         (_cpp_trigraph_map_d): New variable for C++14 or later.
388         (_cpp_trigraph_map): Define to _cpp_trigraph_map_d.map for C++14 or
389         later.
390         * init.cc (init_trigraph_map): Define to nothing for C++14 or later.
391         (TRIGRAPH_MAP, END, s): Define differently for C++14 or later.
393 2024-10-02  Jakub Jelinek  <jakub@redhat.com>
395         PR preprocessor/96842
396         * include/cpplib.h (struct cpp_options): Add warn_header_guard member.
397         (enum cpp_warning_reason): Add CPP_W_HEADER_GUARD enumerator.
398         * internal.h (struct cpp_reader): Add mi_def_cmacro, mi_loc and
399         mi_def_loc members.
400         (_cpp_defined_macro_p): Constify type pointed by argument type.
401         Formatting fix.
402         * init.cc (cpp_create_reader): Clear
403         CPP_OPTION (pfile, warn_header_guard).
404         * directives.cc (struct if_stack): Add def_loc and mi_def_cmacro
405         members.
406         (DIRECTIVE_TABLE): Add IF_COND flag to define.
407         (do_define): Set ifs->mi_def_cmacro on a define immediately following
408         #ifndef directive for the guard.  Clear pfile->mi_valid.  Formatting
409         fix.
410         (do_endif): Copy over pfile->mi_def_cmacro and pfile->mi_def_loc
411         if ifs->mi_def_cmacro is set and pfile->mi_cmacro isn't a defined
412         macro.
413         (push_conditional): Clear mi_def_cmacro and mi_def_loc members.
414         * files.cc (_cpp_pop_file_buffer): Emit -Wheader-guard diagnostics.
416 2024-09-13  Jakub Jelinek  <jakub@redhat.com>
418         * files.cc (finish_embed): Initialize toks to tok rather
419         than NULL.
421 2024-09-12  Jakub Jelinek  <jakub@redhat.com>
423         * internal.h (struct cpp_embed_params): Add base64 member.
424         (_cpp_free_embed_params_tokens): Declare.
425         * directives.cc (DIRECTIVE_TABLE): Add IN_I flag to T_EMBED.
426         (save_token_for_embed, _cpp_free_embed_params_tokens): New functions.
427         (EMBED_PARAMS): Add gnu::base64 entry.
428         (_cpp_parse_embed_params): Parse gnu::base64 parameter.  If
429         -fpreprocessed without -fdirectives-only, require #embed to have
430         gnu::base64 parameter.  Diagnose conflict between gnu::base64 and
431         limit or gnu::offset parameters.
432         (do_embed): Use _cpp_free_embed_params_tokens.
433         * files.cc (finish_embed, base64_dec_fn): New functions.
434         (base64_dec): New array.
435         (B64D0, B64D1, B64D2, B64D3): Define.
436         (finish_base64_embed): New function.
437         (_cpp_stack_embed): Use finish_embed.  Handle params->base64
438         using finish_base64_embed.
439         * macro.cc (builtin_has_embed): Call _cpp_free_embed_params_tokens.
441 2024-09-12  Jason Merrill  <jason@redhat.com>
443         * include/cpplib.h (enum cpp_warning_reason): Add
444         CPP_W_CXX{14,17,20,23}_EXTENSIONS.
445         * charset.cc (_cpp_valid_ucn, convert_hex, convert_oct)
446         (convert_escape, narrow_str_to_charconst): Use cpp_pedwarning
447         instead of cpp_error for pedwarns.
448         * directives.cc (directive_diagnostics, _cpp_handle_directive)
449         (do_line, do_elif): Likewise.
450         * expr.cc (cpp_classify_number, eval_token): Likewise.
451         * lex.cc (skip_whitespace, maybe_va_opt_error)
452         (_cpp_lex_direct): Likewise.
453         * macro.cc (_cpp_arguments_ok): Likewise.
454         (replace_args): Use -Wvariadic-macros for pedwarn about
455         empty macro arguments.
457 2024-09-12  Jakub Jelinek  <jakub@redhat.com>
459         * internal.h (struct cpp_embed_params): Add offset member.
460         * directives.cc (EMBED_PARAMS): Add gnu::offset entry.
461         (enum embed_param_kind): Add NUM_EMBED_STD_PARAMS.
462         (_cpp_parse_embed_params): Use NUM_EMBED_STD_PARAMS rather than
463         NUM_EMBED_PARAMS when parsing standard parameters.  Parse gnu::offset
464         parameter.
465         * files.cc (struct _cpp_file): Add offset member.
466         (_cpp_stack_embed): Handle params->offset.
468 2024-09-12  Jakub Jelinek  <jakub@redhat.com>
470         PR c/105863
471         * include/cpplib.h: Implement C23 N3017 #embed - a scannable,
472         tooling-friendly binary resource inclusion mechanism paper.
473         (struct cpp_options): Add embed member.
474         (enum cpp_builtin_type): Add BT_HAS_EMBED.
475         (cpp_set_include_chains): Add another cpp_dir * argument to
476         the declaration.
477         * internal.h (enum include_type): Add IT_EMBED.
478         (struct cpp_reader): Add embed_include member.
479         (struct cpp_embed_params_tokens): New type.
480         (struct cpp_embed_params): New type.
481         (_cpp_get_token_no_padding): Declare.
482         (enum _cpp_find_file_kind): Add _cpp_FFK_EMBED and _cpp_FFK_HAS_EMBED.
483         (_cpp_stack_embed): Declare.
484         (_cpp_parse_expr): Change return type to cpp_num_part instead of
485         bool, change second argument from bool to const char * and add third
486         argument.
487         (_cpp_parse_embed_params): Declare.
488         * directives.cc (DIRECTIVE_TABLE): Add embed entry.
489         (end_directive): Don't call skip_rest_of_line for T_EMBED directive.
490         (_cpp_handle_directive): Return 2 rather than 1 for T_EMBED in
491         directives-only mode.
492         (parse_include): Don't Call check_eol for T_EMBED directive.
493         (skip_balanced_token_seq): New function.
494         (EMBED_PARAMS): Define.
495         (enum embed_param_kind): New type.
496         (embed_params): New variable.
497         (_cpp_parse_embed_params): New function.
498         (do_embed): New function.
499         (do_if): Adjust _cpp_parse_expr caller.
500         (do_elif): Likewise.
501         * expr.cc (parse_defined): Diagnose defined in #embed or __has_embed
502         parameters.
503         (_cpp_parse_expr): Change return type to cpp_num_part instead of
504         bool, change second argument from bool to const char * and add third
505         argument.  Adjust function comment.  For #embed/__has_embed parameters
506         add an artificial CPP_OPEN_PAREN.  Use the second argument DIR
507         directly instead of string literals conditional on IS_IF.
508         For #embed/__has_embed parameter, stop on reaching CPP_CLOSE_PAREN
509         matching the artificial one.  Diagnose negative or too large embed
510         parameter operands.
511         (num_binary_op): Use #embed instead of #if for diagnostics if inside
512         #embed/__has_embed parameter.
513         (num_div_op): Likewise.
514         * files.cc (struct _cpp_file): Add limit member and embed bitfield.
515         (search_cache): Add IS_EMBED argument, formatting fix.  Skip over
516         files with different file->embed from the argument.
517         (find_file_in_dir): Don't call pch_open_file if file->embed.
518         (_cpp_find_file): Handle _cpp_FFK_EMBED and _cpp_FFK_HAS_EMBED.
519         (read_file_guts): Formatting fix.
520         (has_unique_contents): Ignore file->embed files.
521         (search_path_head): Handle IT_EMBED type.
522         (_cpp_stack_embed): New function.
523         (_cpp_get_file_stat): Formatting fix.
524         (cpp_set_include_chains): Add embed argument, save it to
525         pfile->embed_include and compute lens for the chain.
526         * init.cc (struct lang_flags): Add embed member.
527         (lang_defaults): Add embed initializers.
528         (cpp_set_lang): Initialize CPP_OPTION (pfile, embed).
529         (builtin_array): Add __has_embed entry.
530         (cpp_init_builtins): Predefine __STDC_EMBED_NOT_FOUND__,
531         __STDC_EMBED_FOUND__ and __STDC_EMBED_EMPTY__.
532         * lex.cc (cpp_directive_only_process): Handle #embed.
533         * macro.cc (cpp_get_token_no_padding): Rename to ...
534         (_cpp_get_token_no_padding): ... this.  No longer static.
535         (builtin_has_include_1): New function.
536         (builtin_has_include): Use it.  Use _cpp_get_token_no_padding
537         instead of cpp_get_token_no_padding.
538         (builtin_has_embed): New function.
539         (_cpp_builtin_macro_text): Handle BT_HAS_EMBED.
541 2024-08-26  Alexander Monakov  <amonakov@ispras.ru>
543         * internal.h (CPP_BUFFER_PADDING): New macro; use it ...
544         * charset.cc (_cpp_convert_input): ...here, and ...
545         * files.cc (read_file_guts): ...here, and ...
546         * lex.cc (search_line_ssse3): here.
548 2024-08-23  Alexander Monakov  <amonakov@ispras.ru>
550         PR preprocessor/116458
551         * charset.cc (_cpp_convert_input): Bump padding to 64 if
552         HAVE_SSSE3.
554 2024-08-22  Marc Poulhiès  <poulhies@adacore.com>
556         * lex.cc(search_line_ssse3): fix static_assert to use 2 arguments.
558 2024-08-20  Jakub Jelinek  <jakub@redhat.com>
560         * init.cc (struct lang_flags): Change all members from char
561         typed fields to unsigned bit-fields.
562         (lang_defaults): Change formatting of the initializer so that it
563         fits to 68 columns rather than 147.
565 2024-08-20  Alexander Monakov  <amonakov@ispras.ru>
567         * config.in: Regenerate.
568         * configure: Regenerate.
569         * configure.ac: Check for SSSE3 instead of SSE4.2.
570         * files.cc (read_file_guts): Bump padding to 64 if HAVE_SSSE3.
571         * lex.cc (search_line_acc_char): Mark inline, not "unused".
572         (search_line_sse2): Mark inline.
573         (search_line_sse42): Replace with...
574         (search_line_ssse3): ... this new function.  Adjust the use...
575         (init_vectorized_lexer): ... here.  Simplify.
577 2024-08-06  Andi Kleen  <ak@gcc.gnu.org>
579         * lex.cc (search_line_mmx): Remove function.
580         (init_vectorized_lexer): Remove search_line_mmx.
582 2024-07-25  Jakub Jelinek  <jakub@redhat.com>
584         PR c++/110343
585         * lex.cc: C++26 P2558R2 - Add @, $, and ` to the basic character set.
586         (lex_raw_string): For C++26 allow $@` characters in prefix.
587         * charset.cc (_cpp_valid_ucn): For C++26 reject \u0024 in identifiers.
589 2024-07-24  David Malcolm  <dmalcolm@redhat.com>
591         * include/rich-location.h
592         (semi_embedded_vec::semi_embedded_vec): Add copy ctor.
593         (rich_location::rich_location): Remove "= delete" from decl of
594         copy ctor.  Add deleted decl of move ctor.
595         (rich_location::operator=): Remove "= delete" from decl of
596         copy assignment.  Add deleted decl of move assignment.
597         (fixit_hint::fixit_hint): Add copy ctor decl.  Add deleted decl of
598         move.
599         (fixit_hint::operator=): Add copy assignment decl.  Add deleted
600         decl of move assignment.
601         * line-map.cc (rich_location::rich_location): New copy ctor.
602         (fixit_hint::fixit_hint): New copy ctor.
604 2024-07-13  David Malcolm  <dmalcolm@redhat.com>
606         * include/rich-location.h (location_range::m_highlight_color): New
607         field.
608         (rich_location::rich_location): Add optional label_highlight_color
609         param.
610         (rich_location::set_highlight_color): New decl.
611         (rich_location::add_range): Add optional label_highlight_color
612         param.
613         (rich_location::set_range): Likewise.
614         * line-map.cc (rich_location::rich_location): Add
615         "label_highlight_color" param and pass it to add_range.
616         (rich_location::set_highlight_color): New.
617         (rich_location::add_range): Add "label_highlight_color" param.
618         (rich_location::set_range): Add "highlight_color" param.
620 2024-06-21  David Malcolm  <dmalcolm@redhat.com>
622         PR testsuite/109360
623         * include/rich-location.h (rich_location::get_column_override):
624         New accessor.
626 2024-06-11  Joseph Myers  <josmyers@redhat.com>
628         * include/cpplib.h (CLK_GNUC2Y, CLK_STDC2Y): New.
629         * init.cc (lang_defaults): Add GNUC2Y and STDC2Y entries.
630         (cpp_init_builtins): Define __STDC_VERSION__ to 202500L for GNUC2Y
631         and STDC2Y.
633 2024-06-07  Jason Merrill  <jason@redhat.com>
635         * files.cc (_cpp_stack_file): LC_ENTER for -include header unit.
637 2024-05-29  Jason Merrill  <jason@redhat.com>
639         * mkdeps.cc (make_write): Change .c++m to .c++-module.
641 2024-05-28  David Malcolm  <dmalcolm@redhat.com>
643         * Makefile.in (TAGS_SOURCES): Add include/label-text.h.
644         * include/label-text.h: New file.
645         * include/rich-location.h: Include "label-text.h".
646         (class label_text): Move to label-text.h.
648 2024-05-26  Peter Damianov  <peter0x44@disroot.org>
650         * lex.cc (do_peek_prev): Correct typo in argument to __builtin_expect()
652 2024-05-17  David Malcolm  <dmalcolm@redhat.com>
654         * include/rich-location.h (class label_effects): New forward decl.
655         (range_label::get_effects): New vfunc.
657 2024-04-30  Jakub Jelinek  <jakub@redhat.com>
659         * init.cc (cpp_init_builtins): Change __STDC_VERSION__
660         for C23 from 202000L to 202311L.
662 2024-04-17  Christophe Lyon  <christophe.lyon@linaro.org>
664         PR preprocessor/114748
665         * aclocal.m4: Regenerate.
666         * configure: Regenerate.
668 2024-03-14  Lewis Hyatt  <lhyatt@gmail.com>
670         PR preprocessor/110558
671         * macro.cc (builtin_has_include): Set
672         pfile->state.directive_wants_padding prior to lexing the
673         file name, in case it comes from macro expansion.
675 2024-03-14  Lewis Hyatt  <lhyatt@gmail.com>
677         PR preprocessor/80755
678         * files.cc (search_path_head): Add SUPPRESS_DIAGNOSTIC argument
679         defaulting to false.
680         (_cpp_has_header): Silently return false if the search path has been
681         exhausted, rather than issuing a diagnostic and then hitting an
682         assert.
684 2024-02-22  Jakub Jelinek  <jakub@redhat.com>
686         PR c/114007
687         * include/cpplib.h (COLON_SCOPE): Define to PURE_ZERO.
688         * lex.cc (_cpp_lex_direct): When lexing CPP_COLON with another
689         colon after it, if !CPP_OPTION (pfile, scope) set COLON_SCOPE
690         flag on the first CPP_COLON token.
692 2024-02-01  Lewis Hyatt  <lhyatt@gmail.com>
694         PR preprocessor/105608
695         * pch.cc (cpp_read_state): Set a valid location for restored
696         macros.
698 2024-01-04  Raiki Tamura  <tamaron1203@gmail.com>
700         * charset.cc (cpp_check_xid_property): New.
701         * include/cpplib.h
702         (cpp_check_xid_property): New.
703         (enum cpp_xid_property): New.
705 2023-12-13  Jakub Jelinek  <jakub@redhat.com>
707         PR preprocessor/112956
708         * lex.cc (_cpp_lex_direct): Initialize c to 0.
709         For CPP_PRAGMA_EOL tokens and if c == 0 also for CPP_EOF
710         set result->src_loc to highest locus.
712 2023-11-28  Lewis Hyatt  <lhyatt@gmail.com>
714         PR preprocessor/112701
715         * expr.cc (num_div_op): Set unsignedp appropriately when returning a
716         stub value for divide by 0.
718 2023-11-27  Alex Coplan  <alex.coplan@arm.com>
719             Iain Sandoe  <iain@sandoe.co.uk>
721         PR c++/60512
722         * include/cpplib.h (struct cpp_callbacks): Add has_feature.
723         (enum cpp_builtin_type): Add BT_HAS_{FEATURE,EXTENSION}.
724         * init.cc: Add __has_{feature,extension}.
725         * macro.cc (_cpp_builtin_macro_text): Handle
726         BT_HAS_{FEATURE,EXTENSION}.
728 2023-11-24  Alexander Monakov  <amonakov@ispras.ru>
730         * config.in: Regenerate.
731         * configure: Regenerate.
732         * configure.ac (ENABLE_VALGRIND_CHECKING): Delete.
733         (ENABLE_VALGRIND_ANNOTATIONS): Rename to
734         ENABLE_VALGRIND_WORKAROUNDS.  Delete Valgrind header checks.
735         * lex.cc (new_buff): Adjust for renaming.
736         (_cpp_free_buff): Ditto.
738 2023-11-20  Marc Poulhiès  <dkm@kataplop.net>
740         * macro.cc (parse_params): Fix typo in variadic.
741         (create_iso_definition): Likewise.
743 2023-11-19  David Malcolm  <dmalcolm@redhat.com>
745         * Makefile.in (TAGS_SOURCES): Add "include/rich-location.h".
746         * include/cpplib.h (class rich_location): New forward decl.
747         * include/line-map.h (class range_label)
748         (enum range_display_kind, struct location_range)
749         (class semi_embedded_vec, class rich_location, class label_text)
750         (class range_label, class fixit_hint): Move to...
751         * include/rich-location.h: ...this new file.
752         * internal.h: Include "rich-location.h".
754 2023-11-14  Jakub Jelinek  <jakub@redhat.com>
756         * makeucnid.cc (write_copyright): Update copyright year.
757         * makeuname2c.cc (write_copyright): Likewise.
758         (struct generated): Update latest Unicode version.
759         (generated_ranges): Add 2ebf0-2ee5d CJK UNIFIED IDEOGRAPH
760         range which was forgotten to be added to 4-8 table, but
761         clearly is expected to be there from the 15.1 additions.
762         * ucnid.h: Regenerated.
763         * uname2c.h: Regenerated.
764         * generated_cpp_wcwidth.h: Regenerated.
766 2023-11-14  Jakub Jelinek  <jakub@redhat.com>
768         PR c++/110341
769         * charset.cc: Implement C++26 P1854R4 - Making non-encodable string
770         literals ill-formed.
771         (one_count_chars, convert_count_chars, count_source_chars): New
772         functions.
773         (narrow_str_to_charconst): Change last arg type from cpp_ttype to
774         const cpp_token *.  For C++ if pedantic and i > 1 in CPP_CHAR
775         interpret token also as CPP_STRING32 and if number of characters
776         in the CPP_STRING32 is larger than number of bytes in CPP_CHAR,
777         pedwarn on it.  Make the diagnostics more detailed.
778         (wide_str_to_charconst): Change last arg type from cpp_ttype to
779         const cpp_token *.  Make the diagnostics more detailed.
780         (cpp_interpret_charconst): Adjust narrow_str_to_charconst and
781         wide_str_to_charconst callers.
783 2023-11-14  Arsen Arsenović  <arsen@aarsen.me>
785         * config.in: Regenerate.
787 2023-11-13  Arsen Arsenović  <arsen@aarsen.me>
789         * configure: Regenerate.
790         * aclocal.m4: Regenerate.
792 2023-11-09  David Malcolm  <dmalcolm@redhat.com>
794         * include/line-map.h (rich_location::get_expanded_location): Make
795         const.
796         (rich_location::get_line_table): New accessor.
797         (rich_location::m_line_table): Make the pointer be const.
798         (rich_location::m_have_expanded_location): Make mutable.
799         (rich_location::m_expanded_location): Likewise.
800         (fixit_hint::affects_line_p): Add const line_maps * param.
801         (linemap_client_expand_location_to_spelling_point): Likewise.
802         * line-map.cc (rich_location::get_expanded_location): Make const.
803         Pass m_line_table to
804         linemap_client_expand_location_to_spelling_point.
805         (rich_location::maybe_add_fixit): Likewise.
806         (fixit_hint::affects_line_p): Add set param and pass to
807         linemap_client_expand_location_to_spelling_point.
809 2023-11-07  Joseph Myers  <joseph@codesourcery.com>
811         * directives.cc: Refer to C23 instead of C2X in diagnostics and
812         comments.
813         (STDC2X): Rename to STDC23.
814         * expr.cc: Use cpp_warn_c11_c23_compat instead of
815         cpp_warn_c11_c2x_compat and CPP_W_C11_C23_COMPAT instead of
816         CPP_W_C11_C2X_COMPAT.  Refer to C23 instead of C2X in diagnostics
817         and comments.
818         * include/cpplib.h: Refer to C23 instead of C2X in diagnostics and
819         comments.
820         (CLK_GNUC2X): Rename to CLK_GNUC23.
821         (CLK_STDC2X): Rename to CLK_STDC23.
822         (CPP_W_C11_C2X_COMPAT): Rename to CPP_W_C11_C23_COMPAT.
823         * init.cc: Use GNUC23 instead of GNUC2X, STDC23 instead of STDC2X
824         and cpp_warn_c11_c23_compat instead of cpp_warn_c11_c2x_compat.
825         * lex.cc (maybe_va_opt_error): Refer to C23 instead of C2X in
826         diagnostic.
827         * macro.cc (_cpp_arguments_ok): Refer to C23 instead of C2X in
828         comment.
830 2023-11-02  Jakub Jelinek  <jakub@redhat.com>
832         PR c++/110342
833         * include/cpplib.h (TTYPE_TABLE): Add CPP_UNEVAL_STRING literal
834         entry.  Use C++11 instead of C++-0x in comments.
835         * charset.cc (convert_escape): Add UNEVAL argument, if true,
836         pedantically diagnose numeric escape sequences.
837         (cpp_interpret_string_1): Formatting fix.  Adjust convert_escape
838         caller.
839         (cpp_interpret_string): Formatting string.
840         (cpp_interpret_string_notranslate): Pass type through to
841         cpp_interpret_string if it is CPP_UNEVAL_STRING.
843 2023-10-31  David Malcolm  <dmalcolm@redhat.com>
845         * include/line-map.h
846         (line_map_macro::get_expansion_point_location): New accessor.
847         (line_map_macro::expansion): Rename field to...
848         (line_map_macro::mexpansion): Rename field to...
849         (MACRO_MAP_EXPANSION_POINT_LOCATION): Delete this function.
850         * line-map.cc (linemap_enter_macro): Update for renaming of field.
851         (linemap_macro_map_loc_to_exp_point): Update for removal of
852         MACRO_MAP_EXPANSION_POINT_LOCATION.
854 2023-10-23  Lewis Hyatt  <lhyatt@gmail.com>
856         PR preprocessor/36887
857         * directives.cc (do_pragma_poison): Store in the extra hash map the
858         location from which an identifier has been poisoned.
859         * lex.cc (identifier_diagnostics_on_lex): When issuing a diagnostic
860         for the use of a poisoned identifier, also add a note indicating the
861         location from which it was poisoned.
862         * identifiers.cc (alloc_node): Convert to template function.
863         (_cpp_init_hashtable): Handle the new extra hash map.
864         (_cpp_destroy_hashtable): Likewise.
865         * include/cpplib.h (struct cpp_hashnode_extra): New struct.
866         (cpp_create_reader): Update prototype to...
867         * init.cc (cpp_create_reader): ...accept an argument for the extra
868         hash table and pass it to _cpp_init_hashtable.
869         * include/symtab.h (ht_lookup): New overload for convenience.
870         * internal.h (struct cpp_reader): Add EXTRA_HASH_TABLE member.
871         (_cpp_init_hashtable): Adjust prototype.
873 2023-10-08  David Malcolm  <dmalcolm@redhat.com>
875         * include/line-map.h (LINEMAPS_ORDINARY_MAPS): Delete.
876         (LINEMAPS_MACRO_MAPS): Delete.
877         * line-map.cc (linemap_tracks_macro_expansion_locs_p): Update for
878         deletion of LINEMAPS_MACRO_MAPS.
879         (linemap_get_statistics): Likewise.
881 2023-10-08  David Malcolm  <dmalcolm@redhat.com>
883         * include/line-map.h (maps_info_ordinary::cache): Rename to...
884         (maps_info_ordinary::m_cache): ...this.
885         (maps_info_macro::cache): Rename to...
886         (maps_info_macro::m_cache): ...this.
887         (LINEMAPS_CACHE): Delete.
888         (LINEMAPS_ORDINARY_CACHE): Delete.
889         (LINEMAPS_MACRO_CACHE): Delete.
890         * init.cc (read_original_filename): Update for adding "m_" prefix.
891         * line-map.cc (linemap_add): Eliminate LINEMAPS_ORDINARY_CACHE in
892         favor of a simple field access.
893         (linemap_enter_macro): Likewise for LINEMAPS_MACRO_CACHE.
894         (linemap_ordinary_map_lookup): Likewise for
895         LINEMAPS_ORDINARY_CACHE, twice.
896         (linemap_lookup_macro_index): Likewise for LINEMAPS_MACRO_CACHE.
898 2023-10-08  David Malcolm  <dmalcolm@redhat.com>
900         * include/line-map.h (LINEMAPS_LAST_ALLOCATED_MAP): Delete.
901         (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Delete.
902         (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Delete.
904 2023-10-08  David Malcolm  <dmalcolm@redhat.com>
906         * include/line-map.h (line_maps::reallocator): Rename to...
907         (line_maps::m_reallocator): ...this.
908         (line_maps::round_alloc_size): Rename to...
909         (line_maps::m_round_alloc_size): ...this.
910         (line_maps::location_adhoc_data_map): Rename to...
911         (line_maps::m_location_adhoc_data_map): ...this.
912         (line_maps::num_optimized_ranges): Rename to...
913         (line_maps::m_num_optimized_ranges): ..this.
914         (line_maps::num_unoptimized_ranges): Rename to...
915         (line_maps::m_num_unoptimized_ranges): ...this.
916         (get_combined_adhoc_loc): Delete decl.
917         (COMBINE_LOCATION_DATA): Delete.
918         * lex.cc (get_location_for_byte_range_in_cur_line): Update for
919         removal of COMBINE_LOCATION_DATA.
920         (warn_about_normalization): Likewise.
921         (_cpp_lex_direct): Likewise.
922         * line-map.cc (line_maps::~line_maps): Update for "m_" prefix of
923         some fields of line_maps.
924         (rebuild_location_adhoc_htab): Likewise.
925         (can_be_stored_compactly_p): Convert to...
926         (line_maps::can_be_stored_compactly_p): ...this private member
927         function.
928         (get_combined_adhoc_loc): Convert to...
929         (line_maps::get_or_create_combined_loc): ...this public member
930         function.
931         (line_maps::make_location): Update for removal of
932         COMBINE_LOCATION_DATA.
933         (get_data_from_adhoc_loc): Update for "m_" prefix of some fields
934         of line_maps.
935         (get_discriminator_from_adhoc_loc): Likewise.
936         (get_location_from_adhoc_loc): Likewise.
937         (get_range_from_adhoc_loc): Convert to...
938         (line_maps::get_range_from_adhoc_loc): ...this private member
939         function.
940         (line_maps::get_range_from_loc): Update for conversion of
941         get_range_from_adhoc_loc to a member function.
942         (linemap_init): Update for "m_" prefix of some fields of
943         line_maps.
944         (line_map_new_raw): Likewise.
945         (linemap_enter_macro): Likewise.
946         (linemap_get_statistics): Likewise.
948 2023-10-08  David Malcolm  <dmalcolm@redhat.com>
950         * include/line-map.h (line_maps::pure_location_p): New decl.
951         (line_maps::get_pure_location): New decl.
952         (line_maps::get_range_from_loc): New decl.
953         (line_maps::get_start): New.
954         (line_maps::get_finish): New.
955         (line_maps::make_location): New decl.
956         (get_range_from_loc): Make line_maps param const.
957         (get_discriminator_from_loc): Likewise.
958         (pure_location_p): Likewise.
959         (get_pure_location): Likewise.
960         (linemap_check_files_exited): Likewise.
961         (linemap_tracks_macro_expansion_locs_p): Likewise.
962         (linemap_location_in_system_header_p): Likewise.
963         (linemap_location_from_macro_definition_p): Likewise.
964         (linemap_macro_map_loc_unwind_toward_spelling): Likewise.
965         (linemap_included_from_linemap): Likewise.
966         (first_map_in_common): Likewise.
967         (linemap_compare_locations): Likewise.
968         (linemap_location_before_p): Likewise.
969         (linemap_resolve_location): Likewise.
970         (linemap_unwind_toward_expansion): Likewise.
971         (linemap_unwind_to_first_non_reserved_loc): Likewise.
972         (linemap_expand_location): Likewise.
973         (linemap_get_file_highest_location): Likewise.
974         (linemap_get_statistics): Likewise.
975         (linemap_dump_location): Likewise.
976         (linemap_dump): Likewise.
977         (line_table_dump): Likewise.
978         * internal.h (linemap_get_expansion_line): Likewise.
979         (linemap_get_expansion_filename): Likewise.
980         * line-map.cc (can_be_stored_compactly_p): Likewise.
981         (get_data_from_adhoc_loc): Drop redundant "class".
982         (get_discriminator_from_adhoc_loc): Likewise.
983         (get_location_from_adhoc_loc): Likewise.
984         (get_range_from_adhoc_loc): Likewise.
985         (get_range_from_loc): Make const and move implementation to...
986         (line_maps::get_range_from_loc): ...this new function.
987         (get_discriminator_from_loc): Make line_maps param const.
988         (pure_location_p): Make const and move implementation to...
989         (line_maps::pure_location_p): ...this new function.
990         (get_pure_location): Make const and move implementation to...
991         (line_maps::get_pure_location): ...this new function.
992         (linemap_included_from_linemap): Make line_maps param const.
993         (linemap_check_files_exited): Likewise.
994         (linemap_tracks_macro_expansion_locs_p): Likewise.
995         (linemap_macro_map_loc_unwind_toward_spelling): Likewise.
996         (linemap_get_expansion_line): Likewise.
997         (linemap_get_expansion_filename): Likewise.
998         (linemap_location_in_system_header_p): Likewise.
999         (first_map_in_common_1): Likewise.
1000         (linemap_compare_locations): Likewise.
1001         (linemap_macro_loc_to_spelling_point): Likewise.
1002         (linemap_macro_loc_to_def_point): Likewise.
1003         (linemap_macro_loc_to_exp_point): Likewise.
1004         (linemap_resolve_location): Likewise.
1005         (linemap_location_from_macro_definition_p): Likewise.
1006         (linemap_unwind_toward_expansion): Likewise.
1007         (linemap_unwind_to_first_non_reserved_loc): Likewise.
1008         (linemap_expand_location): Likewise.
1009         (linemap_dump): Likewise.
1010         (linemap_dump_location): Likewise.
1011         (linemap_get_file_highest_location): Likewise.
1012         (linemap_get_statistics): Likewise.
1013         (line_table_dump): Likewise.
1015 2023-09-20  Lewis Hyatt  <lhyatt@gmail.com>
1017         PR preprocessor/61474
1018         * files.cc (_cpp_find_file): Set DONT_READ to TRUE for fake
1019         include files.
1020         (_cpp_fake_include): Pass a unique cpp_dir* address so
1021         the fake file will not be found when looked up for real.
1023 2023-09-19  Ben Boeckel  <ben.boeckel@kitware.com>
1025         * include/cpplib.h: Add cpp_fdeps_format enum.
1026         (cpp_options): Add fdeps_format field
1027         (cpp_finish): Add structured dependency fdeps_stream parameter.
1028         * include/mkdeps.h (deps_add_module_target): Add flag for
1029         whether a module is exported or not.
1030         (fdeps_add_target): Add function.
1031         (deps_write_p1689r5): Add function.
1032         * init.cc (cpp_finish): Add new preprocessor parameter used for C++
1033         module tracking.
1034         * mkdeps.cc (mkdeps): Implement P1689R5 output.
1036 2023-09-06  Jakub Jelinek  <jakub@redhat.com>
1038         PR c/102989
1039         * expr.cc (cpp_classify_number): Diagnose wb literal suffixes
1040         for -pedantic* before C2X or -Wc11-c2x-compat.
1042 2023-09-06  Jakub Jelinek  <jakub@redhat.com>
1044         PR c/102989
1045         * expr.cc (interpret_int_suffix): Handle wb and WB suffixes.
1046         * include/cpplib.h (CPP_N_BITINT): Define.
1048 2023-08-07  Alan Modra  <amodra@gmail.com>
1050         * configure: Regenerate.
1052 2023-07-19  Lewis Hyatt  <lhyatt@gmail.com>
1054         PR preprocessor/103902
1055         * lex.cc (identifier_diagnostics_on_lex): New function refactoring
1056         some common code.
1057         (lex_identifier_intern): Use the new function.
1058         (lex_identifier): Don't run identifier diagnostics here, rather let
1059         the call site do it when needed.
1060         (_cpp_lex_direct): Adjust the call sites of lex_identifier ()
1061         acccordingly.
1062         (struct scan_id_result): New struct.
1063         (scan_cur_identifier): New function.
1064         (create_literal2): New function.
1065         (lit_accum::create_literal2): New function.
1066         (is_macro): Folded into new function...
1067         (maybe_ignore_udl_macro_suffix): ...here.
1068         (is_macro_not_literal_suffix): Folded likewise.
1069         (lex_raw_string): Handle UTF-8 in UDL suffix via
1070         scan_cur_identifier ().
1071         (lex_string): Likewise.
1073 2023-07-06  Thomas Schwinge  <thomas@codesourcery.com>
1075         * include/symtab.h (struct ht_identifier): Document different
1076         rationale.
1078 2023-06-23  Marek Polacek  <polacek@redhat.com>
1080         * include/cpplib.h (c_lang): Add CXX26 and GNUCXX26.
1081         * init.cc (lang_defaults): Add rows for CXX26 and GNUCXX26.
1082         (cpp_init_builtins): Set __cplusplus to 202400L for C++26.
1083         Set __cplusplus to 202302L for C++23.
1085 2023-06-23  Ben Boeckel  <me@benboeckel.net>
1087         * charset.cc: Allow `UCS_LIMIT` in UTF-8 strings.
1089 2023-06-22  David Malcolm  <dmalcolm@redhat.com>
1091         * charset.cc (get_cppchar_property): New function template, based
1092         on...
1093         (cpp_wcwidth): ...this function.  Rework to use the above.
1094         Include "combining-chars.inc".
1095         (cpp_is_combining_char): New function
1096         Include "printable-chars.inc".
1097         (cpp_is_printable_char): New function
1098         * combining-chars.inc: New file, generated by
1099         contrib/unicode/gen-combining-chars.py.
1100         * include/cpplib.h (cpp_is_combining_char): New function decl.
1101         (cpp_is_printable_char): New function decl.
1102         * printable-chars.inc: New file, generated by
1103         contrib/unicode/gen-printable-chars.py.
1105 2023-06-20  Lewis Hyatt  <lhyatt@gmail.com>
1107         PR c++/66290
1108         * macro.cc (_cpp_create_definition): Add location argument.
1109         * internal.h (_cpp_create_definition): Adjust prototype.
1110         * directives.cc (do_define): Pass new location argument to
1111         _cpp_create_definition.
1112         (do_undef): Stop passing inferior location to cpp_warning_with_line;
1113         the default from cpp_warning is better.
1114         (cpp_pop_definition): Pass new location argument to
1115         _cpp_create_definition.
1116         * pch.cc (cpp_read_state): Likewise.
1118 2023-06-19  Ben Boeckel  <ben.boeckel@kitware.com>
1120         * charset.cc: Reject encodings of codepoints above 0x10FFFF.
1121         UTF-16 does not support such codepoints and therefore all
1122         Unicode rejects such values.
1124 2023-06-15  Marek Polacek  <polacek@redhat.com>
1126         * configure.ac (--enable-host-shared): Don't set PICFLAG here.
1127         (--enable-host-pie): New check.  Set PICFLAG after this check.
1128         * configure: Regenerate.
1130 2023-06-15  Jakub Jelinek  <jakub@redhat.com>
1132         PR preprocessor/80753
1133         * files.cc (struct _cpp_file): Add deferred_error bitfield.
1134         (_cpp_find_file): When finding a file in cache with deferred_error
1135         set in _cpp_FFK_NORMAL mode, call open_file_failed and clear the flag.
1136         Set deferred_error in _cpp_FFK_HAS_INCLUDE mode if open_file_failed
1137         hasn't been called.
1139 2023-04-30  Jeff Law  <jlaw@ventanamicro>
1141         Revert:
1142         2023-04-30  Longjun Luo  <luolongjuna@gmail.com>
1144         * init.cc (builtin_array): Do not always warn for a redefinition
1145         of __LINE__.
1147 2023-04-30  Longjun Luo  <luolongjuna@gmail.com>
1149         * init.cc (builtin_array): Do not always warn for a redefinition
1150         of __LINE__.
1152 2023-03-25  David Malcolm  <dmalcolm@redhat.com>
1154         PR analyzer/109098
1155         * charset.cc (cpp_valid_utf8_p): New function.
1156         * include/cpplib.h (cpp_valid_utf8_p): New prototype.
1158 2023-03-16  Jakub Jelinek  <jakub@redhat.com>
1160         * makeucnid.cc (write_copyright): Update Unicode copyright years
1161         up to 2022.
1162         * makeuname2c.cc (write_copyright): Likewise.
1163         * ucnid.h: Regenerated.
1164         * uname2c.h: Regenerated.
1166 2023-03-13  Lewis Hyatt  <lhyatt@gmail.com>
1168         PR preprocessor/67046
1169         * directives.cc (_cpp_do__Pragma): Increment pfile->keep_tokens to
1170         ensure the returned string token is valid.
1172 2023-03-13  Lewis Hyatt  <lhyatt@gmail.com>
1174         * generated_cpp_wcwidth.h: Regenerated for Unicode 15.
1176 2022-12-07  Joseph Myers  <joseph@codesourcery.com>
1178         * init.cc (lang_defaults): Enable va_opt for STDC2X.
1179         * lex.cc (maybe_va_opt_error): Adjust diagnostic message for C.
1180         * macro.cc (_cpp_arguments_ok): Update comment.
1182 2022-11-23  Marek Polacek  <polacek@redhat.com>
1184         Revert:
1185         2022-11-23  Marek Polacek  <polacek@redhat.com>
1187         * configure.ac (--enable-host-shared): Don't set PICFLAG here.
1188         (--enable-host-pie): New check.  Set PICFLAG after this check.
1189         * configure: Regenerate.
1191 2022-11-23  Marek Polacek  <polacek@redhat.com>
1193         * configure.ac (--enable-host-shared): Don't set PICFLAG here.
1194         (--enable-host-pie): New check.  Set PICFLAG after this check.
1195         * configure: Regenerate.
1197 2022-11-21  Lewis Hyatt  <lhyatt@gmail.com>
1199         * directives.cc (do_pragma): Fix memory leak in token buffer.  Fix
1200         unwanted paste between two tokens.
1202 2022-11-21  Torbjörn SVENSSON  <torbjorn.svensson@foss.st.com>
1204         * files.cc: Ensure pattern matches before use.
1206 2022-11-21  Martin Liska  <mliska@suse.cz>
1208         * config.in: Re-configure.
1210 2022-11-19  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>
1212         PR preprocessor/107691
1213         * configure.ac: Add valgrind header checks.
1214         * configure: Regenerate.
1216 2022-11-18  Richard Purdie  <richard.purdie@linuxfoundation.org>
1218         * macro.cc (_cpp_builtin_macro_text): Don't remap filenames within
1219         directives.
1221 2022-11-05  Lewis Hyatt  <lhyatt@gmail.com>
1223         PR preprocessor/55971
1224         * lex.cc (get_fresh_line_impl): New function refactoring the code
1225         from...
1226         (_cpp_get_fresh_line): ...here.
1227         (lex_raw_string): Use the new version of get_fresh_line_impl() to
1228         support raw strings containing new lines when processing a directive.
1230 2022-11-04  Jakub Jelinek  <jakub@redhat.com>
1232         * makeuname2c.cc (struct generated): Update from Unicode 15.0.0
1233         table 4-8.
1234         * ucnid.h: Regenerated for Unicode 15.0.0.
1235         * uname2c.h: Likewise.
1237 2022-10-19  Lewis Hyatt  <lhyatt@gmail.com>
1239         * include/cpplib.h (struct cpp_string): Use new "string_length" GTY.
1240         * include/symtab.h (struct ht_identifier): Likewise.
1242 2022-10-14  Joseph Myers  <joseph@codesourcery.com>
1244         * charset.cc (ucn_valid_in_identifier): Check xid_identifiers not
1245         cplusplus to determine whether to use CXX23 and NXX23 flags.
1246         * include/cpplib.h (struct cpp_options): Add xid_identifiers.
1247         * init.cc (struct lang_flags, lang_defaults): Add xid_identifiers.
1248         (cpp_set_lang): Set xid_identifiers.
1249         * lex.cc (warn_about_normalization): Add parameter identifier.
1250         Only pedwarn about non-NFC for identifiers, not pp-numbers.
1251         (_cpp_lex_direct): Update calls to warn_about_normalization.
1253 2022-10-14  Jakub Jelinek  <jakub@redhat.com>
1255         * include/cpplib.h (CPP_N_BFLOAT16): Define.
1256         * expr.cc (interpret_float_suffix): Handle bf16 and BF16 suffixes for
1257         C++.
1259 2022-09-28  Eugene Rozenfeld  <erozen@microsoft.com>
1261         * include/line-map.h: Add discriminator to location_adhoc_data.
1262         (get_combined_adhoc_loc): Add discriminator parameter.
1263         (get_discriminator_from_adhoc_loc): Add external declaration.
1264         (get_discriminator_from_loc): Add external declaration.
1265         (COMBINE_LOCATION_DATA): Add discriminator parameter.
1266         * lex.cc (get_location_for_byte_range_in_cur_line) Pass 0 discriminator
1267         in a call to COMBINE_LOCATION_DATA.
1268         (warn_about_normalization): Pass 0 discriminator in a call to
1269         COMBINE_LOCATION_DATA.
1270         (_cpp_lex_direct): Pass 0 discriminator in a call to
1271         COMBINE_LOCATION_DATA.
1272         * line-map.cc (location_adhoc_data_hash): Use discriminator compute
1273         location_adhoc_data hash.
1274         (location_adhoc_data_eq): Use discriminator when comparing
1275         location_adhoc_data.
1276         (can_be_stored_compactly_p): Check discriminator to determine
1277         compact storage.
1278         (get_combined_adhoc_loc): Add discriminator parameter.
1279         (get_discriminator_from_adhoc_loc): New function to get the discriminator
1280         from an ad-hoc location.
1281         (get_discriminator_from_loc): New function to get the discriminator
1282         from a location.
1284 2022-09-27  Jakub Jelinek  <jakub@redhat.com>
1286         PR c++/106652
1287         PR c++/85518
1288         * expr.cc (interpret_float_suffix): Allow {f,F}{16,32,64,128} and
1289         {f,F}{32,64,128}x suffixes for C++.
1291 2022-09-08  Lewis Hyatt  <lhyatt@gmail.com>
1293         * line-map.cc (location_adhoc_data_update): Remove reliance on
1294         undefined behavior.
1295         (get_combined_adhoc_loc): Likewise.
1296         (rebuild_location_adhoc_htab): Fix issue where the htab was not
1297         properly updated.
1299 2022-09-07  Joseph Myers  <joseph@codesourcery.com>
1301         * include/cpplib.h (struct cpp_options): Add true_false.
1302         * expr.cc (eval_token): Check true_false not cplusplus to
1303         determine whether to handle true and false keywords.
1304         * init.cc (struct lang_flags): Add true_false.
1305         (lang_defaults): Update.
1306         (cpp_set_lang): Set true_false.
1308 2022-09-07  Jakub Jelinek  <jakub@redhat.com>
1310         * include/cpplib.h (struct cpp_options): Add cpp_warn_unicode member.
1311         (enum cpp_warning_reason): Add CPP_W_UNICODE.
1312         * init.cc (cpp_create_reader): Initialize cpp_warn_unicode.
1313         * charset.cc (_cpp_valid_ucn): In possible identifier contexts, don't
1314         handle \u{ or \N{ specially in -std=c* modes except -std=c++2{3,b}.
1315         In possible identifier contexts, don't emit an error and punt
1316         if \N isn't followed by {, or if \N{} surrounds some lower case
1317         letters or _.  In possible identifier contexts when not C++23, don't
1318         emit an error but warning about unknown character names and treat as
1319         separate tokens.  When treating as separate tokens \u{ or \N{, emit
1320         warnings.
1322 2022-09-05  Joseph Myers  <joseph@codesourcery.com>
1324         * init.cc (lang_defaults): Disable trigraphs for C2x.
1326 2022-09-02  David Malcolm  <dmalcolm@redhat.com>
1328         PR c/90885
1329         * include/cpplib.h (BOL): Move macro to 1 << 12 since it is
1330         not used by C/C++'s unsigned char token flags.
1331         (DECIMAL_INT): New, using 1 << 6, so that it is visible as
1332         part of C/C++'s 8 bits of token flags.
1334 2022-09-01  Jakub Jelinek  <jakub@redhat.com>
1336         PR c++/106655
1337         * include/cpplib.h (struct cpp_options): Implement C++23
1338         P2295R6 - Support for UTF-8 as a portable source file encoding.
1339         Add cpp_warn_invalid_utf8 and cpp_input_charset_explicit fields.
1340         (enum cpp_warning_reason): Add CPP_W_INVALID_UTF8 enumerator.
1341         * init.cc (cpp_create_reader): Initialize cpp_warn_invalid_utf8
1342         and cpp_input_charset_explicit.
1343         * charset.cc (_cpp_valid_utf8): Adjust function comment.
1344         * lex.cc (UCS_LIMIT): Define.
1345         (utf8_continuation): New const variable.
1346         (utf8_signifier): Move earlier in the file.
1347         (_cpp_warn_invalid_utf8, _cpp_handle_multibyte_utf8): New functions.
1348         (_cpp_skip_block_comment): Handle -Winvalid-utf8 warning.
1349         (skip_line_comment): Likewise.
1350         (lex_raw_string, lex_string): Likewise.
1351         (_cpp_lex_direct): Likewise.
1353 2022-08-31  Jakub Jelinek  <jakub@redhat.com>
1355         PR preprocessor/106778
1356         * makeuname2c.cc (write_nodes): Reverse order of && operands in
1357         assert.
1359 2022-08-26  Jakub Jelinek  <jakub@redhat.com>
1361         PR c++/106647
1362         * charset.cc (wide_str_to_charconst): Implement P2362R3 - Remove
1363         non-encodable wide character literals and multicharacter.  For
1364         C++23 use CPP_DL_ERROR instead of CPP_DL_WARNING for
1365         "character constant too long for its type" diagnostics on CPP_WCHAR
1366         literals.
1368 2022-08-26  Jakub Jelinek  <jakub@redhat.com>
1370         PR c++/106648
1371         * charset.cc: Implement C++23 P2071R2 - Named universal character
1372         escapes.  Include uname2c.h.
1373         (hangul_syllables, hangul_count): New variables.
1374         (struct uname2c_data): New type.
1375         (_cpp_uname2c, _cpp_uname2c_uax44_lm2): New functions.
1376         (_cpp_valid_ucn): Use them.  Handle named universal character escapes.
1377         (convert_ucn): Adjust comment.
1378         (convert_escape): Call convert_ucn even for \N.
1379         (_cpp_interpret_identifier): Handle named universal character escapes.
1380         * lex.cc (get_bidi_ucn): Fix up function comment formatting.
1381         (get_bidi_named): New function.
1382         (forms_identifier_p, lex_string): Handle named universal character
1383         escapes.
1384         * makeuname2c.cc: New file.  Small parts copied from makeucnid.cc.
1385         * uname2c.h: New generated file.
1387 2022-08-24  Jakub Jelinek  <jakub@redhat.com>
1389         PR c++/106646
1390         * init.cc: Implement C++23 P2437R1 - Support for #warning.
1391         (lang_defaults): Set warning_directive for GNUCXX23 and CXX23.
1392         * directives.cc (directive_diagnostics): Use different wording of
1393         #warning pedwarn for C++.
1395 2022-08-20  Jakub Jelinek  <jakub@redhat.com>
1397         PR c++/106645
1398         * include/cpplib.h (struct cpp_options): Implement
1399         P2290R3 - Delimited escape sequences.  Add delimite_escape_seqs
1400         member.
1401         * init.cc (struct lang_flags): Likewise.
1402         (lang_defaults): Add delim column.
1403         (cpp_set_lang): Copy over delimite_escape_seqs.
1404         * charset.cc (extend_char_range): New function.
1405         (_cpp_valid_ucn): Use it.  Handle delimited escape sequences.
1406         (convert_hex): Likewise.
1407         (convert_oct): Likewise.
1408         (convert_ucn): Use extend_char_range.
1409         (convert_escape): Call convert_oct even for \o.
1410         (_cpp_interpret_identifier): Handle delimited escape sequences.
1411         * lex.cc (get_bidi_ucn_1): Likewise.  Add end argument, fill it in.
1412         (get_bidi_ucn): Adjust get_bidi_ucn_1 caller.  Use end argument to
1413         compute num_bytes.
1415 2022-08-18  Joseph Myers  <joseph@codesourcery.com>
1417         * include/cpplib.h (struct cpp_options): Add warning_directive.
1418         * init.cc (struct lang_flags, lang_defaults): Add
1419         warning_directive.
1420         * directives.cc (DIRECTIVE_TABLE): Mark #warning as STDC2X not
1421         EXTENSION.
1422         (directive_diagnostics): Diagnose #warning with -Wc11-c2x-compat,
1423         or with -pedantic for a standard not supporting #warning.
1425 2022-08-16  Tom Honermann  <tom@honermann.net>
1427         PR c++/106423
1428         * include/cpplib.h (cpp_warning_reason): Add CPP_W_CXX20_COMPAT.
1429         * init.cc (cpp_create_reader): Add cpp_warn_cxx20_compat.
1431 2022-08-08  Tom Honermann  <tom@honermann.net>
1433         PR preprocessor/106426
1434         * charset.cc (narrow_str_to_charconst): Set signedness of CPP_UTF8CHAR
1435         literals based on unsigned_utf8char.
1436         * include/cpplib.h (cpp_options): Add unsigned_utf8char.
1437         * init.cc (cpp_create_reader): Initialize unsigned_utf8char.
1439 2022-07-15  Jonathan Wakely  <jwakely@redhat.com>
1441         * include/line-map.h (label_text::take_or_copy): Remove.
1442         (label_text::moved_from): Rename to release.
1443         (label_text::m_buffer, label_text::m_owned): Make private.
1444         (label_text::get, label_text::is_owned): New accessors.
1446 2022-07-13  Marek Polacek  <polacek@redhat.com>
1448         PR preprocessor/106272
1449         * include/line-map.h (class label_text): Don't std::move in a return
1450         statement.
1452 2022-07-10  Lewis Hyatt  <lhyatt@gmail.com>
1454         PR preprocessor/97498
1455         * directives.cc (destringize_and_run): Override the location of
1456         the CPP_PRAGMA token from a _Pragma directive to the location of
1457         the expansion point, as is done for the tokens lexed from it.
1459 2022-07-07  David Malcolm  <dmalcolm@redhat.com>
1461         * include/line-map.h: Include <utility>.
1462         (class label_text): Delete maybe_free method in favor of a
1463         destructor.  Add move ctor and assignment operator.  Add deletion
1464         of the copy ctor and copy-assignment operator.  Rename field
1465         m_caller_owned to m_owned.  Add std::move where necessary; add
1466         moved_from member function.
1468 2022-06-28  Lewis Hyatt  <lhyatt@gmail.com>
1470         * ucnid.h: Regenerated for Unicode 14.0.
1472 2022-06-26  Lewis Hyatt  <lhyatt@gmail.com>
1474         * generated_cpp_wcwidth.h: Generated from updated Unicode data files.
1476 2022-05-29  Jakub Jelinek  <jakub@redhat.com>
1478         PR preprocessor/105732
1479         * expr.cc (_cpp_parse_expr): Handle CPP_PADDING by just another
1480         token.
1482 2022-05-20  David Malcolm  <dmalcolm@redhat.com>
1484         * lex.cc: Replace uses of "FINAL" and "OVERRIDE" with "final" and
1485         "override".
1487 2022-02-11  Joseph Myers  <joseph@codesourcery.com>
1489         * Makefile.in (po/$(PACKAGE).pot): Also handle cpp_warning_at,
1490         cpp_pedwarning_at and cpp_error_at.
1492 2022-02-01  Jakub Jelinek  <jakub@redhat.com>
1494         PR preprocessor/104147
1495         * macro.cc (funlike_invocation_p): For padding prefer a token
1496         with val.source non-NULL especially if it has PREV_WHITE set
1497         on val.source->flags.  Add gcc_assert that CPP_PADDING tokens
1498         don't have PREV_WHITE set in flags.
1500 2022-02-01  Jakub Jelinek  <jakub@redhat.com>
1502         * directives.cc (destringize_and_run): Push &pfile->avoid_paste
1503         instead of a copy of pfile->directive_result for the CPP_PADDING
1504         case.
1506 2022-01-24  Marek Polacek  <polacek@redhat.com>
1508         PR preprocessor/104030
1509         * include/cpplib.h (enum cpp_bidirectional_level): Add
1510         bidirectional_ucn.  Set values explicitly.
1511         * internal.h (cpp_reader): Adjust warn_bidi_p.
1512         * lex.cc (maybe_warn_bidi_on_close): Don't warn about UCNs
1513         unless UCN checking is on.
1514         (maybe_warn_bidi_on_char): Likewise.
1516 2022-01-18  Richard Biener  <rguenther@suse.de>
1518         * include/line-map.h (class line_maps): Re-arrange fields
1519         to minimize padding.
1520         (class rich_location): Likewise.
1521         * line-map.cc (rich_location::rich_location): Adjust.
1523 2022-01-17  Martin Liska  <mliska@suse.cz>
1525         * Makefile.in: Rename .c names to .cc.
1527 2022-01-17  Martin Liska  <mliska@suse.cz>
1529         * Makefile.in: Rename .c names to .cc.
1530         * charset.cc (convert_escape): Likewise.
1531         * directives.cc (directive_diagnostics): Likewise.
1532         (_cpp_handle_directive): Likewise.
1533         (lex_macro_node): Likewise.
1534         * include/cpplib.h (struct _cpp_file): Likewise.
1535         (PURE_ZERO): Likewise.
1536         (cpp_defined): Likewise.
1537         (cpp_error_at): Likewise.
1538         (cpp_forall_identifiers): Likewise.
1539         (cpp_compare_macros): Likewise.
1540         (cpp_get_converted_source): Likewise.
1541         (cpp_read_state): Likewise.
1542         (cpp_directive_only_process): Likewise.
1543         (struct cpp_decoded_char): Likewise.
1544         * include/line-map.h (enum lc_reason): Likewise.
1545         (enum location_aspect): Likewise.
1546         * include/mkdeps.h: Likewise.
1547         * init.cc (cpp_destroy): Likewise.
1548         (cpp_finish): Likewise.
1549         * internal.h (struct cpp_reader): Likewise.
1550         (_cpp_defined_macro_p): Likewise.
1551         (_cpp_backup_tokens_direct): Likewise.
1552         (_cpp_destroy_hashtable): Likewise.
1553         (_cpp_has_header): Likewise.
1554         (_cpp_expand_op_stack): Likewise.
1555         (_cpp_commit_buff): Likewise.
1556         (_cpp_restore_special_builtin): Likewise.
1557         (_cpp_bracket_include): Likewise.
1558         (_cpp_replacement_text_len): Likewise.
1559         (ufputs): Likewise.
1560         * line-map.cc (linemap_macro_loc_to_exp_point): Likewise.
1561         (linemap_check_files_exited): Likewise.
1562         (line_map_new_raw): Likewise.
1563         * traditional.cc (enum ls): Likewise.
1565 2022-01-17  Martin Liska  <mliska@suse.cz>
1567         * charset.c: Moved to...
1568         * charset.cc: ...here.
1569         * directives.c: Moved to...
1570         * directives.cc: ...here.
1571         * errors.c: Moved to...
1572         * errors.cc: ...here.
1573         * expr.c: Moved to...
1574         * expr.cc: ...here.
1575         * files.c: Moved to...
1576         * files.cc: ...here.
1577         * identifiers.c: Moved to...
1578         * identifiers.cc: ...here.
1579         * init.c: Moved to...
1580         * init.cc: ...here.
1581         * lex.c: Moved to...
1582         * lex.cc: ...here.
1583         * line-map.c: Moved to...
1584         * line-map.cc: ...here.
1585         * macro.c: Moved to...
1586         * macro.cc: ...here.
1587         * makeucnid.c: Moved to...
1588         * makeucnid.cc: ...here.
1589         * mkdeps.c: Moved to...
1590         * mkdeps.cc: ...here.
1591         * pch.c: Moved to...
1592         * pch.cc: ...here.
1593         * symtab.c: Moved to...
1594         * symtab.cc: ...here.
1595         * traditional.c: Moved to...
1596         * traditional.cc: ...here.
1598 2022-01-15  Martin Sebor  <msebor@redhat.com>
1600         * files.c (_cpp_find_file): Substitute a valid pointer for
1601         an invalid one to avoid -Wuse-after-free.
1603 2022-01-12  ClĂ©ment Chigot  <clement.chigot@atos.net>
1605         * configure.ac: Check sizeof ino_t and dev_t.
1606         * config.in: Regenerate.
1607         * configure: Regenerate.
1608         * include/cpplib.h (INO_T_CPP): Change for AIX.
1609         (DEV_T_CPP): New macro.
1610         (struct cpp_dir): Use it.
1612 2021-12-30  Jakub Jelinek  <jakub@redhat.com>
1614         PR preprocessor/89971
1615         * macro.c (replace_args): For ##__VA_OPT__, if __VA_OPT__ expands
1616         to no tokens at all, drop PASTE_LEFT flag from the previous token.
1618 2021-12-04  Jakub Jelinek  <jakub@redhat.com>
1620         PR preprocessor/102432
1621         * lex.c (_cpp_lex_direct): If buffer->need_line while
1622         pfile->state.in_deferred_pragma, return CPP_PRAGMA_EOL token instead
1623         of assertion failure.
1625 2021-12-03  Jakub Jelinek  <jakub@redhat.com>
1627         PR pch/71934
1628         * include/line-map.h (class line_maps): Add GTY((callback)) to
1629         reallocator and round_alloc_size members.
1631 2021-12-01  Jakub Jelinek  <jakub@redhat.com>
1633         PR c++/100977
1634         * init.c (struct lang_flags): Remove cxx23_identifiers.
1635         (lang_defaults): Remove cxx23_identifiers initializers.
1636         (cpp_set_lang): Don't copy cxx23_identifiers.
1637         * include/cpplib.h (struct cpp_options): Adjust comment about
1638         c11_identifiers.  Remove cxx23_identifiers field.
1639         * lex.c (warn_about_normalization): Use cplusplus instead of
1640         cxx23_identifiers.
1641         * charset.c (ucn_valid_in_identifier): Likewise.
1643 2021-12-01  Jakub Jelinek  <jakub@redhat.com>
1645         PR preprocessor/103415
1646         * macro.c (stringify_arg): Remove va_opt argument and va_opt handling.
1647         (paste_tokens): On successful paste or in PREV_WHITE and
1648         PREV_FALLTHROUGH flags from the *plhs token to the new token.
1649         (replace_args): Adjust stringify_arg callers.  For #__VA_OPT__,
1650         perform token pasting in a separate loop before stringify_arg call.
1652 2021-11-30  Richard Biener  <rguenther@suse.de>
1654         * charset.c (convert_escape): Remove unreachable break.
1656 2021-11-30  Jakub Jelinek  <jakub@redhat.com>
1658         PR c++/100977
1659         * init.c (lang_defaults): Enable cxx23_identifiers for
1660         -std={gnu,c}++{11,14,17,20} too.
1662 2021-11-29  Eric Gallager  <egallager@gcc.gnu.org>
1664         PR other/103021
1665         * Makefile.in: Use ETAGS variable in TAGS target.
1666         * configure: Regenerate.
1667         * configure.ac: Allow ETAGS variable to be overridden.
1669 2021-11-23  Christophe Lyon  <christophe.lyon@foss.st.com>
1671         PR preprocessor/103355
1672         * system.h (ATTR_LIKELY): Fix definition.
1674 2021-11-23  Marek Polacek  <polacek@redhat.com>
1675             Jonathan Wakely  <jwakely@redhat.com>
1677         PR preprocessor/103355
1678         * lex.c: Use ATTR_LIKELY instead of [[likely]].
1679         * system.h (ATTR_LIKELY): Define.
1681 2021-11-22  Jakub Jelinek  <jakub@redhat.com>
1682             Tobias Burnus  <tobias@codesourcery.com>
1684         PR preprocessor/103165
1685         * internal.h (struct lexer_state): Add ignore__Pragma field.
1686         * macro.c (builtin_macro): Don't interpret _Pragma if
1687         pfile->state.ignore__Pragma.
1688         (expand_arg): Temporarily set pfile->state.ignore__Pragma to 1.
1690 2021-11-17  David Malcolm  <dmalcolm@redhat.com>
1692         PR preprocessor/103026
1693         * lex.c (struct bidi::context): New.
1694         (bidi::vec): Convert to a vec of context rather than unsigned
1695         char.
1696         (bidi::ctx_at): Rename to...
1697         (bidi::pop_kind_at): ...this and reimplement for above change.
1698         (bidi::current_ctx): Update for change to vec.
1699         (bidi::current_ctx_ucn_p): Likewise.
1700         (bidi::current_ctx_loc): New.
1701         (bidi::on_char): Update for usage of context struct.  Add "loc"
1702         param and pass it when pushing contexts.
1703         (get_location_for_byte_range_in_cur_line): New.
1704         (get_bidi_utf8): Rename to...
1705         (get_bidi_utf8_1): ...this, reintroducing...
1706         (get_bidi_utf8): ...as a wrapper, setting *OUT when the result is
1707         not NONE.
1708         (get_bidi_ucn): Rename to...
1709         (get_bidi_ucn_1): ...this, reintroducing...
1710         (get_bidi_ucn): ...as a wrapper, setting *OUT when the result is
1711         not NONE.
1712         (class unpaired_bidi_rich_location): New.
1713         (maybe_warn_bidi_on_close): Use unpaired_bidi_rich_location when
1714         reporting on unpaired bidi chars.  Split into singular vs plural
1715         spellings.
1716         (maybe_warn_bidi_on_char): Pass in a location_t rather than a
1717         const uchar * and use it when emitting warnings, and when calling
1718         bidi::on_char.
1719         (_cpp_skip_block_comment): Capture location when kind is not NONE
1720         and pass it to maybe_warn_bidi_on_char.
1721         (skip_line_comment): Likewise.
1722         (forms_identifier_p): Likewise.
1723         (lex_raw_string): Likewise.
1724         (lex_string): Likewise.
1726 2021-11-17  David Malcolm  <dmalcolm@redhat.com>
1728         PR preprocessor/103026
1729         * lex.c (maybe_warn_bidi_on_close): Use a rich_location
1730         and call set_escape_on_output (true) on it.
1731         (maybe_warn_bidi_on_char): Likewise.
1733 2021-11-17  Jakub Jelinek  <jakub@redhat.com>
1735         PR preprocessor/103130
1736         * lex.c (cpp_directive_only_process): Treat even \*/ as end of block
1737         comment.
1739 2021-11-17  Marek Polacek  <polacek@redhat.com>
1741         PR preprocessor/103026
1742         * include/cpplib.h (enum cpp_bidirectional_level): New.
1743         (struct cpp_options): Add cpp_warn_bidirectional.
1744         (enum cpp_warning_reason): Add CPP_W_BIDIRECTIONAL.
1745         * internal.h (struct cpp_reader): Add warn_bidi_p member
1746         function.
1747         * init.c (cpp_create_reader): Set cpp_warn_bidirectional.
1748         * lex.c (bidi): New namespace.
1749         (get_bidi_utf8): New function.
1750         (get_bidi_ucn): Likewise.
1751         (maybe_warn_bidi_on_close): Likewise.
1752         (maybe_warn_bidi_on_char): Likewise.
1753         (_cpp_skip_block_comment): Implement warning about bidirectional
1754         control characters.
1755         (skip_line_comment): Likewise.
1756         (forms_identifier_p): Likewise.
1757         (lex_identifier): Likewise.
1758         (lex_string): Likewise.
1759         (lex_raw_string): Likewise.
1761 2021-11-01  David Malcolm  <dmalcolm@redhat.com>
1763         * charset.c (convert_escape): Use encoding_rich_location when
1764         complaining about nonprintable unknown escape sequences.
1765         (cpp_display_width_computation::::cpp_display_width_computation):
1766         Pass in policy rather than tabstop.
1767         (cpp_display_width_computation::process_next_codepoint): Add "out"
1768         param and populate *out if non-NULL.
1769         (cpp_display_width_computation::advance_display_cols): Pass NULL
1770         to process_next_codepoint.
1771         (cpp_byte_column_to_display_column): Pass in policy rather than
1772         tabstop.  Pass NULL to process_next_codepoint.
1773         (cpp_display_column_to_byte_column): Pass in policy rather than
1774         tabstop.
1775         * errors.c (cpp_diagnostic_get_current_location): New function,
1776         splitting out the logic from...
1777         (cpp_diagnostic): ...here.
1778         (cpp_warning_at): New function.
1779         (cpp_pedwarning_at): New function.
1780         * include/cpplib.h (cpp_warning_at): New decl for rich_location.
1781         (cpp_pedwarning_at): Likewise.
1782         (struct cpp_decoded_char): New.
1783         (struct cpp_char_column_policy): New.
1784         (cpp_display_width_computation::cpp_display_width_computation):
1785         Replace "tabstop" param with "policy".
1786         (cpp_display_width_computation::process_next_codepoint): Add "out"
1787         param.
1788         (cpp_display_width_computation::m_tabstop): Replace with...
1789         (cpp_display_width_computation::m_policy): ...this.
1790         (cpp_byte_column_to_display_column): Replace "tabstop" param with
1791         "policy".
1792         (cpp_display_width): Likewise.
1793         (cpp_display_column_to_byte_column): Likewise.
1794         * include/line-map.h (rich_location::escape_on_output_p): New.
1795         (rich_location::set_escape_on_output): New.
1796         (rich_location::m_escape_on_output): New.
1797         * internal.h (cpp_diagnostic_get_current_location): New decl.
1798         (class encoding_rich_location): New.
1799         * lex.c (skip_whitespace): Use encoding_rich_location when
1800         complaining about null characters.
1801         (warn_about_normalization): Generate a source range when
1802         complaining about improperly normalized tokens, rather than just a
1803         point, and use encoding_rich_location so that the source code
1804         is escaped on printing.
1805         * line-map.c (rich_location::rich_location): Initialize
1806         m_escape_on_output.
1808 2021-10-29  Tobias Burnus  <tobias@codesourcery.com>
1810         PR c++/102409
1811         * directives.c (destringize_and_run): Add PRAGMA_OP to the
1812         CPP_PRAGMA token's flags to mark is as coming from _Pragma.
1813         * include/cpplib.h (PRAGMA_OP): #define, to be used with token flags.
1814         * macro.c (collect_args): Only handle CPP_PRAGMA special if PRAGMA_OP
1815         is set.
1817 2021-10-22  Eric Gallager  <egallager@gcc.gnu.org>
1819         PR other/102663
1820         * Makefile.in: Add dummy install-dvi target.
1822 2021-10-18  Martin Liska  <mliska@suse.cz>
1824         * charset.c (convert_oct): Remove unused but set variable.
1826 2021-10-06  Jakub Jelinek  <jakub@redhat.com>
1828         * init.c (lang_defaults): Implement P2334R1, enable elifdef for
1829         -std=c++23 and -std=gnu++23.
1830         * directives.c (_cpp_handle_directive): Support elifdef/elifndef if
1831         either CPP_OPTION (pfile, elifdef) or !CPP_OPTION (pfile, std).
1832         (do_elif): For older non-std modes if pedantic pedwarn about
1833         #elifdef/#elifndef directives that change behavior.
1835 2021-09-01  Jakub Jelinek  <jakub@redhat.com>
1837         PR c++/100977
1838         * include/cpplib.h (struct cpp_options): Add cxx23_identifiers.
1839         * charset.c (CXX23, NXX23): New enumerators.
1840         (CID, NFC, NKC, CTX): Renumber.
1841         (ucn_valid_in_identifier): Implement P1949R7 - use CXX23 and
1842         NXX23 flags for cxx23_identifiers.  For start character in
1843         non-pedantic mode, allow characters that are allowed as start
1844         characters in any of the supported language modes, rather than
1845         disallowing characters allowed only as non-start characters in
1846         current mode but for characters from other language modes allowing
1847         them even if they are never allowed at start.
1848         * init.c (struct lang_flags): Add cxx23_identifiers.
1849         (lang_defaults): Add cxx23_identifiers column.
1850         (cpp_set_lang): Initialize CPP_OPTION (pfile, cxx23_identifiers).
1851         * lex.c (warn_about_normalization): If cxx23_identifiers, use
1852         cpp_pedwarning_with_line instead of cpp_warning_with_line for
1853         "is not in NFC" diagnostics.
1854         * makeucnid.c: Adjust usage comment.
1855         (CXX23, NXX23): New enumerators.
1856         (all_languages): Add CXX23.
1857         (not_NFC, not_NFKC, maybe_not_NFC): Renumber.
1858         (read_derivedcore): New function.
1859         (write_table): Print also CXX23 and NXX23 columns.
1860         (main): Require 5 arguments instead of 4, call read_derivedcore.
1861         * ucnid.h: Regenerated using Unicode 13.0.0 files.
1863 2021-09-01  Jason Merrill  <jason@redhat.com>
1865         * macro.c (replace_args): When __VA_OPT__ is on the LHS of ##,
1866         remove trailing avoid_paste tokens.
1868 2021-09-01  Jakub Jelinek  <jakub@redhat.com>
1870         PR preprocessor/101488
1871         * macro.c (replace_args): Fix up handling of CPP_PADDING tokens at the
1872         start or end of __VA_OPT__ arguments when preceeded or followed by ##.
1874 2021-08-31  Martin Sebor  <msebor@redhat.com>
1876         * include/line-map.h (class rich_location): Disable copying and
1877         assignment.
1879 2021-08-25  Lewis Hyatt  <lhyatt@gmail.com>
1881         PR other/93067
1882         * charset.c (init_iconv_desc): Adapt to permit PFILE argument to
1883         be NULL.
1884         (_cpp_convert_input): Likewise. Also move UTF-8 BOM logic to...
1885         (cpp_check_utf8_bom): ...here.  New function.
1886         (cpp_input_conversion_is_trivial): New function.
1887         * files.c (read_file_guts): Allow PFILE argument to be NULL.  Add
1888         INPUT_CHARSET argument as an alternate source of this information.
1889         (read_file): Pass the new argument to read_file_guts.
1890         (cpp_get_converted_source): New function.
1891         * include/cpplib.h (struct cpp_converted_source): Declare.
1892         (cpp_get_converted_source): Declare.
1893         (cpp_input_conversion_is_trivial): Declare.
1894         (cpp_check_utf8_bom): Declare.
1896 2021-08-17  Jakub Jelinek  <jakub@redhat.com>
1898         * macro.c (vaopt_state): Add m_stringify member.
1899         (vaopt_state::vaopt_state): Initialize it.
1900         (vaopt_state::update): Overwrite it.
1901         (vaopt_state::stringify): New method.
1902         (stringify_arg): Replace arg argument with first, count arguments
1903         and add va_opt argument.  Use first instead of arg->first and
1904         count instead of arg->count, for va_opt add paste_tokens handling.
1905         (paste_tokens): Fix up len calculation.  Don't spell rhs twice,
1906         instead use %.*s to supply lhs and rhs spelling lengths.  Don't call
1907         _cpp_backup_tokens here.
1908         (paste_all_tokens): Call it here instead.
1909         (replace_args): Adjust stringify_arg caller.  For vaopt_state::END
1910         if stringify is true handle __VA_OPT__ stringification.
1911         (create_iso_definition): Handle # __VA_OPT__ similarly to # macro_arg.
1913 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
1915         PR preprocessor/101638
1916         * macro.c (cpp_sys_macro_p): Return true instead of
1917         crashing on builtin macros.
1919 2021-08-05  Jakub Jelinek  <jakub@redhat.com>
1921         PR c++/100977
1922         * ucnid.h: Regenerated using Unicode 13.0.0 files.
1924 2021-08-05  Jakub Jelinek  <jakub@redhat.com>
1926         PR c++/100977
1927         * makeucnid.c (write_table): Fix computation of last_combine.
1928         * ucnid.h: Regenerated using Unicode 6.3.0 files.
1930 2021-06-16  Jason Merrill  <jason@redhat.com>
1932         PR c++/100796
1933         PR preprocessor/96391
1934         * line-map.c (linemap_compare_locations): Only use comparison with
1935         LINE_MAP_MAX_LOCATION_WITH_COLS to avoid abort.
1937 2021-05-20  Christophe Lyon  <christophe.lyon@linaro.org>
1938             Torbjörn Svensson  <torbjorn.svensson@st.com>
1940         PR c/42579
1941         * include/cpplib.h (cpp_builtin_type): Add BT_FILE_NAME entry.
1942         * init.c (builtin_array): Likewise.
1943         * macro.c (_cpp_builtin_macro_text): Add support for BT_FILE_NAME.
1945 2021-05-20  Jakub Jelinek  <jakub@redhat.com>
1947         PR preprocessor/100646
1948         * lex.c (cpp_directive_only_process): Treat end of file as termination
1949         for !is_block comments.
1951 2021-05-12  Jakub Jelinek  <jakub@redhat.com>
1953         PR preprocessor/100392
1954         * lex.c (cpp_directive_only_process): If buffer doesn't end with '\n',
1955         add buffer->rlimit[0] character to the printed range and
1956         CPP_INCREMENT_LINE and increment line_count.
1958 2021-05-11  Joseph Myers  <joseph@codesourcery.com>
1960         * include/cpplib.h (struct cpp_options): Add elifdef.
1961         * init.c (struct lang_flags): Add elifdef.
1962         (lang_defaults): Update to include elifdef initializers.
1963         (cpp_set_lang): Set elifdef for pfile based on language.
1964         * directives.c (STDC2X, ELIFDEF): New macros.
1965         (EXTENSION): Increase value to 3.
1966         (DIRECTIVE_TABLE): Add #elifdef and #elifndef.
1967         (_cpp_handle_directive): Do not treat ELIFDEF directives as
1968         directives for language versions without the #elifdef feature.
1969         (do_elif): Handle #elifdef and #elifndef.
1970         (do_elifdef, do_elifndef): New functions.
1972 2021-05-11  Joseph Myers  <joseph@codesourcery.com>
1974         * lex.c (cpp_avoid_paste): Do not allow pasting CPP_NUMBER with
1975         CPP_CHAR.
1977 2021-05-11  Joseph Myers  <joseph@codesourcery.com>
1979         * init.c (lang_defaults): Enable digit separators for GNUC2X and
1980         STDC2X.
1982 2021-05-07  Jakub Jelinek  <jakub@redhat.com>
1984         PR c/100450
1985         * lex.c (cpp_avoid_paste): Handle token1 CPP_PRAGMA like CPP_NAME.
1987 2021-05-06  Joseph Myers  <joseph@codesourcery.com>
1989         PR c++/83873
1990         PR preprocessor/97604
1991         * lex.c (lex_number): Reject adjacent digit separators here.  Do
1992         not allow digit separators before '.' or an exponent with sign.
1993         * expr.c (cpp_classify_number): Do not check for adjacent digit
1994         separators here.
1996 2021-05-03  H.J. Lu  <hjl.tools@gmail.com>
1998         PR bootstrap/99703
1999         * configure: Regenerated.
2001 2021-04-29  Joseph Myers  <joseph@codesourcery.com>
2003         PR preprocessor/82359
2004         * directives.c (strtolinenum): Handle digit separators.
2006 2021-04-19  Richard Biener  <rguenther@suse.de>
2008         PR preprocessor/100142
2009         * line-map.c (linemap_position_for_loc_and_offset): Revert
2010         unintended s/column_offset/column/ change.
2012 2021-04-13  Nathan Sidwell  <nathan@acm.org>
2014         PR preprocessor/99446
2015         * line-map.c (line-map.c): Do not advance to linemaps for
2016         different files.
2018 2021-04-13  Eric Botcazou  <ebotcazou@adacore.com>
2020         * include/line-map.h (IS_MACRO_LOC): Delete.
2021         * line-map.c (linemap_location_from_macro_expansion_p): Test
2022         LINEMAPS_MACRO_LOWEST_LOCATION of the linemap.
2024 2021-03-02  David Malcolm  <dmalcolm@redhat.com>
2026         PR c/99323
2027         * line-map.c (rich_location::maybe_add_fixit): Reject fix-it hints
2028         at column 0.
2030 2021-02-24  Nathan Sidwell  <nathan@acm.org>
2032         PR c++/98718
2033         * include/line-map.h
2034         * line-map.c
2036 2021-02-24  Nathan Sidwell  <nathan@acm.org>
2038         PR c++/99072
2039         * init.c (read_original_filename): Expunge all evidence of the
2040         original filename.
2042 2021-02-18  Nathan Sidwell  <nathan@acm.org>
2044         PR c++/99023
2045         * include/cpplib.h (cpp_find_header_unit): Rename to ...
2046         (cpp_probe_header_unit): ... this.
2047         * internal.h (_cp_find_header_unit): Declare.
2048         * files.c (cpp_find_header_unit): Break apart to ..
2049         (test_header_unit): ... this, and ...
2050         (_cpp_find_header_unit): ... and, or and ...
2051         (cpp_probe_header_unit): ... this.
2052         * macro.c (cpp_get_token_1): Call _cpp_find_header_unit.
2054 2021-02-16  Nathan Sidwell  <nathan@acm.org>
2056         * files.c (_cpp_stack_file): Make buffers end in unread \n.
2058 2021-02-10  David Malcolm  <dmalcolm@redhat.com>
2060         PR preprocessor/96391
2061         * line-map.c (linemap_compare_locations): Require that
2062         the location be <= LINE_MAP_MAX_LOCATION_WITH_COLS when
2063         treating locations as coming from the same macro expansion.
2065 2021-02-04  Jakub Jelinek  <jakub@redhat.com>
2067         * expr.c (cpp_classify_number): Use make_signed_t<size_t> instead of
2068         make_signed<size_t>::type in the diagnostics.
2070 2021-02-03  Jakub Jelinek  <jakub@redhat.com>
2072         PR preprocessor/98882
2073         * lex.c (cpp_directive_only_process): Don't assert that rlimit[-1]
2074         is a newline, instead assert that rlimit[0] is either newline or
2075         carriage return.  When seeing '\\' followed by '\r', check limit
2076         before accessing pos[1].
2078 2021-02-03  Ed Smith-Rowland  <3dw4rd@verizon.net>
2080         * expr.c (interpret_int_suffix): Detect 'z' integer suffix.
2081         (cpp_classify_number): Compat warning for use of 'z' suffix.
2082         * include/cpplib.h (struct cpp_options): New flag.
2083         (enum cpp_warning_reason): New flag.
2084         (CPP_N_USERDEF): Comment C++0x -> C++11.
2085         (CPP_N_SIZE_T): New flag for cpp_classify_number.
2086         * init.c (cpp_set_lang): Initialize new flag.
2088 2021-01-27  liuhongt  <hongtao.liu@intel.com>
2090         PR target/98833
2091         * lex.c (search_line_sse2): Replace builtins with == operator.
2093 2021-01-26  Paul Fee  <paul.f.fee@gmail.com>
2095         * include/cpplib.h (c_lang): Add CXX23 and GNUCXX23.
2096         * init.c (lang_defaults): Add rows for CXX23 and GNUCXX23.
2097         (cpp_init_builtins): Set __cplusplus to 202100L for C++23.
2099 2021-01-15  Nathan Sidwell  <nathan@acm.org>
2101         PR preprocessor/95253
2102         * mkdeps.c (munge): Do not escape ':'.
2104 2020-12-14  Nathan Sidwell  <nathan@acm.org>
2106         * include/cpplib.h (struct cpp_macro): Add imported_p field.
2107         (struct cpp_hashnode): Tweak deferred field documentation.
2108         * macro.c (_cpp_new_macro): Clear new field.
2109         (cpp_get_deferred_macro, get_deferred_or_lazy_macro): Assert
2110         more.
2112 2020-12-10  Jason Merrill  <jason@redhat.com>
2114         * init.c (cpp_init_builtins): Update __cplusplus for C++20.
2116 2020-12-01  JeanHeyd Meneide  <phdofthehouse@gmail.com>
2118         * charset.c (init_iconv_desc): Initialize "to" and "from" fields.
2119         * directives.c (cpp_get_narrow_charset_name): New function.
2120         (cpp_get_wide_charset_name): Likewise.
2121         * include/cpplib.h (cpp_get_narrow_charset_name): Prototype.
2122         (cpp_get_wide_charset_name): Likewise.
2123         * internal.h (cset_converter): Add "to" and "from" fields.
2125 2020-11-27  Joseph Myers  <joseph@codesourcery.com>
2127         PR preprocessor/97602
2128         * directives.c (strtolinenum): Check for overflow before it
2129         occurs.  Correct comment.
2131 2020-11-24  Nathan Sidwell  <nathan@acm.org>
2133         * include/cpplib.h (struct cpp_hashnode): Add deferred field.
2134         (cpp_set_deferred_macro): Define.
2135         (cpp_get_deferred_macro): Declare.
2136         (cpp_macro_definition): Reformat, add overload.
2137         (cpp_macro_definition_location): Deal with deferred macro.
2138         (cpp_alloc_token_string, cpp_compare_macro): Declare.
2139         * internal.h (_cpp_notify_macro_use): Return bool
2140         (_cpp_maybe_notify_macro_use): Likewise.
2141         * directives.c (do_undef): Check macro is not undef before
2142         warning.
2143         (do_ifdef, do_ifndef): Deal with deferred macro.
2144         * expr.c (parse_defined): Likewise.
2145         * lex.c (cpp_allocate_token_string): Break out of ...
2146         (create_literal): ... here.  Call it.
2147         (cpp_maybe_module_directive): Deal with deferred macro.
2148         * macro.c (cpp_get_token_1): Deal with deferred macro.
2149         (warn_of_redefinition): Deal with deferred macro.
2150         (compare_macros): Rename to ...
2151         (cpp_compare_macro): ... here.  Make extern.
2152         (cpp_get_deferred_macro): New.
2153         (_cpp_notify_macro_use): Deal with deferred macro, return bool
2154         indicating definedness.
2155         (cpp_macro_definition): Deal with deferred macro.
2157 2020-11-19  Nathan Sidwell  <nathan@acm.org>
2159         * include/cpplib.h (enum cpp_main_search): New.
2160         (struct cpp_options): Add main_search field.
2161         (cpp_main_loc): Declare.
2162         (cpp_retrofit_as_include): Declare.
2163         * internal.h (struct cpp_reader): Add main_loc field.
2164         (_cpp_in_main_source_file): Not main if main is a header.
2165         * init.c (cpp_read_main_file): Use main_search option to locate
2166         main file.  Set main_loc
2167         * files.c (cpp_retrofit_as_include): New.
2169 2020-11-19  Nathan Sidwell  <nathan@acm.org>
2171         * internal.h (cpp_in_system_header): Rename to ...
2172         (_cpp_in_system_header): ... here.
2173         (cpp_in_primary_file): Rename to ...
2174         (_cpp_in_main_source_file): ... here.  Compare main_file equality
2175         and check main_search value.
2176         * lex.c (maybe_va_opt_error, _cpp_lex_direct): Adjust for rename.
2177         * macro.c (_cpp_builtin_macro_text): Likewise.
2178         (replace_args): Likewise.
2179         * directives.c (do_include_next): Likewise.
2180         (do_pragma_once, do_pragma_system_header): Likewise.
2181         * files.c (struct _cpp_file): Delete main_file field.
2182         (pch_open): Check pfile->main_file equality.
2183         (make_cpp_file): Drop cpp_reader parm, don't set main_file.
2184         (_cpp_find_file): Adjust.
2185         (_cpp_stack_file): Check pfile->main_file equality.
2186         (struct report_missing_guard_data): Add cpp_reader field.
2187         (report_missing_guard): Check pfile->main_file equality.
2188         (_cpp_report_missing_guards): Adjust.
2190 2020-11-18  Nathan Sidwell  <nathan@acm.org>
2192         * include/cpplib.h (struct cpp_options): Add module_directives
2193         option.
2194         (NODE_MODULE): New node flag.
2195         (struct cpp_hashnode): Make rid-code a bitfield, increase bits in
2196         flags and swap with type field.
2197         * init.c (post_options): Create module-directive identifier nodes.
2198         * internal.h (struct lexer_state): Add directive_file_token &
2199         n_modules fields.  Add module node enumerator.
2200         * lex.c (cpp_maybe_module_directive): New.
2201         (_cpp_lex_token): Call it.
2202         (cpp_output_token): Add '"' around CPP_HEADER_NAME token.
2203         (do_peek_ident, do_peek_module): New.
2204         (cpp_directives_only): Detect module-directive lines.
2205         * macro.c (cpp_get_token_1): Deal with directive_file_token
2206         triggering.
2208 2020-11-18  Nathan Sidwell  <nathan@acm.org>
2210         * files.c (struct _cpp_file): Add header_unit field.
2211         (_cpp_stack_file): Add header unit support.
2212         (cpp_find_header_unit): New.
2213         * include/cpplib.h (cpp_find_header_unit): Declare.
2215 2020-11-18  Nathan Sidwell  <nathan@acm.org>
2217         * include/cpplib.h (struct cpp_options): Add modules to
2218         dep-options.
2219         * include/mkdeps.h (deps_add_module_target): Declare.
2220         (deps_add_module_dep): Declare.
2221         * mkdeps.c (class mkdeps): Add modules, module_name, cmi_name,
2222         is_header_unit fields.  Adjust cdtors.
2223         (deps_add_module_target, deps_add_module_dep): New.
2224         (make_write): Write module dependencies, if enabled.
2226 2020-11-17  Nathan Sidwell  <nathan@acm.org>
2228         * include/cpplib.h (struct cpp_callbacks): Add
2229         user_deferred_macro & translate_include.
2231 2020-11-17  Nathan Sidwell  <nathan@acm.org>
2233         * include/line-map.h (enum lc_reason): Add LC_MODULE.
2234         (MAP_MODULE_P): New.
2235         (line_map_new_raw): Declare.
2236         (linemap_enter_macro): Move declaration from internal.h
2237         (linemap_module_loc, linemap_module_reparent)
2238         (linemap_module_restore): Declare.
2239         (linemap_lookup_macro_indec): Declare.
2240         * internal.h (linemap_enter_macro): Moved to line-map.h.
2241         * line-map.c (linemap_new_raw): New, broken out of ...
2242         (new_linemap): ... here.  Call it.
2243         (LAST_SOURCE_LINE_LOCATION): New.
2244         (liemap_module_loc, linemap_module_reparent)
2245         (linemap_module_restore): New.
2246         (linemap_lookup_macro_index): New, broken out of ...
2247         (linemap_macro_map_lookup): ... here.  Call it.
2248         (linemap_dump): Add module dump.
2250 2020-11-17  Nathan Sidwell  <nathan@acm.org>
2252         PR preprocessor/97858
2253         * mkdeps.c (munge): Drop varadic args, we only ever use one.
2255 2020-11-13  Joseph Myers  <joseph@codesourcery.com>
2257         * expr.c (cpp_classify_number): Update diagnostic for binary
2258         constants for C.  Also diagnose binary constants for
2259         -Wc11-c2x-compat.
2260         * init.c (lang_defaults): Enable binary constants for GNUC2X and
2261         STDC2X.
2263 2020-11-13  Piotr H. Dabrowski  <phd@phd.re>
2265         PR c++/91318
2266         * include/cpplib.h: Added cpp_define_unused(), cpp_define_formatted_unused()
2267         * directives.c: Likewise.
2269 2020-11-12  Joseph Myers  <joseph@codesourcery.com>
2271         * include/cpplib.h (struct cpp_callbacks): Add bool argument to
2272         has_attribute.
2273         (enum cpp_builtin_type): Add BT_HAS_STD_ATTRIBUTE.
2274         * init.c (builtin_array): Add __has_c_attribute.
2275         (cpp_init_special_builtins): Handle BT_HAS_STD_ATTRIBUTE.
2276         * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_STD_ATTRIBUTE.
2277         Update call to has_attribute for BT_HAS_ATTRIBUTE.
2278         * traditional.c (fun_like_macro): Handle BT_HAS_STD_ATTRIBUTE.
2280 2020-11-12  Nicholas Guriev  <guriev-ns@ya.ru>
2282         PR pch/86674
2283         * files.c (_cpp_find_file): Use CPP_DL_NOTE not CPP_DL_ERROR in call to
2284         cpp_error.
2286 2020-11-07  Lewis Hyatt  <lhyatt@gmail.com>
2288         * generated_cpp_wcwidth.h: Regenerated from Unicode 13.0.0 data.
2290 2020-11-06  Nathan Sidwell  <nathan@acm.org>
2292         * include/cpplib.h (enum class CPP_time_kind): New.
2293         (cpp_get_date): Declare.
2294         * internal.h (struct cpp_reader): Replace source_date_epoch with
2295         time_stamp and time_stamp_kind.
2296         * init.c (cpp_create_reader): Initialize them.
2297         * macro.c (_cpp_builtin_macro_text): Use cpp_get_date.
2298         (cpp_get_date): Broken out from _cpp_builtin_macro_text and
2299         genericized.
2301 2020-11-03  Nathan Sidwell  <nathan@acm.org>
2303         * lex.c (cpp_peek_token): Do not peek past CPP_PRAGMA.
2304         (_cpp_lex_direct): Handle EOF in pragma when setting need_line,
2305         not when needing a line.
2307 2020-11-03  Nathan Sidwell  <nathan@acm.org>
2309         * lex.c (_cpp_clean_line): Fix DOS off-by-one error.
2311 2020-11-03  Nathan Sidwell  <nathan@acm.org>
2313         * init.c (cpp_read_main_file): Use cpp_get_deps result.
2315 2020-11-03  Nathan Sidwell  <nathan@acm.org>
2317         * include/mkdeps.h: Include cpplib.h
2318         (deps_write): Adjust first parm type.
2319         * mkdeps.c: Include internal.h
2320         (make_write): Adjust first parm type.  Check phony option
2321         directly.
2322         (deps_write): Adjust first parm type.
2323         * init.c (cpp_read_main_file): Use get_deps.
2324         * directives.c (cpp_get_deps): Check option before initializing.
2326 2020-11-02  Nathan Sidwell  <nathan@acm.org>
2328         * internal.h (_cpp_notify_macro_use): Add location parm.
2329         (_cpp_maybe_notify_macro_use): Likewise.
2330         * directives.c (_cpp_do_file_change): Check we've not changed file
2331         when optimizing a rewind.
2332         (do_ifdef): Pass location to _cpp_maybe_notify_macro_use.
2333         (do_ifndef): Likewise.  Delete obsolete comment about powerpc.
2334         * expr.c (parse_defined): Pass location to
2335         _cpp_maybe_notify_macro_use.
2336         * macro.c (enter_macro_context): Likewise.
2337         (warn_of_redefinition): Break out helper function.  Call it.
2338         (compare_macros): New function broken out of warn_of_redefinition.
2339         (_cpp_new_macro): Zero all fields.
2340         (_cpp_notify_macro_use): Add location parameter.
2342 2020-10-20  Nathan Sidwell  <nathan@acm.org>
2344         * lex.c (_cpp_lex_direct): Do not complete EOF processing when
2345         parsing_args.
2346         * macro.c (collect_args): Do not unwind fake EOF.
2347         (funlike_invocation_p): Do not unwind fake EOF.
2348         (cpp_context): Replace abort with gcc_assert.
2350 2020-10-19  Nathan Sidwell  <nathan@acm.org>
2352         * internal.h (struct cpp_reader): Rename 'eof' field to 'endarg'.
2353         * init.c (cpp_create_reader): Adjust.
2354         * macro.c (collect_args): Use endarg for separator.  Always rewind
2355         in the not-fn case.
2357 2020-10-08  Nathan Sidwell  <nathan@acm.org>
2359         * internal.h (enum include_type): Rename IT_MAIN_INJECT to
2360         IT_PRE_MAIN.
2361         * init.c (cpp_read_main_file): If there is no line marker, adjust
2362         the initial line marker.
2363         (read_original_filename): Return bool, peek the buffer directly
2364         before trying to tokenize.
2365         (read_original_directory): Likewise.  Directly prod the string
2366         literal.
2367         * files.c (_cpp_stack_file): Adjust for IT_PRE_MAIN change.
2369 2020-09-26  Jakub Jelinek  <jakub@redhat.com>
2371         PR bootstrap/97163
2372         * lex.c (search_line_fast): Only use _ARCH_PWR8 Altivec version
2373         for GCC >= 4.5.
2375 2020-09-17  Patrick Palka  <ppalka@redhat.com>
2377         PR c/80076
2378         * include/line-map.h (first_map_in_common): Declare.
2379         * line-map.c (first_map_in_common): Remove static.
2381 2020-09-07  Martin Storsjö  <martin@martin.st>
2383         * files.c (remap_filename): Make a strchr return value pointer
2384         to const.
2386 2020-07-30  H.J. Lu  <hjl.tools@gmail.com>
2388         PR bootstrap/96202
2389         * configure: Regenerated.
2391 2020-07-29  Tiziano MĂĽller  <tiziano.mueller@chem.uzh.ch>
2393         * init.c (builtin_array): Add xref comment.
2394         * traditional.c (fun_like_macro): Add HAS_INCLUDE codes.
2396 2020-07-28  Jakub Jelinek  <jakub@redhat.com>
2398         PR preprocessor/96323
2399         * lex.c (lex_raw_string): For c == '\n' don't continue after reporting
2400         an prefix delimiter error.
2402 2020-07-28  Nathan Sidwell  <nathan@acm.org>
2404         * init.c (cpp_read_main_file): Always use the last map for
2405         the return value.
2407 2020-07-20  Nathan Sidwell  <nathan@acm.org>
2409         * line-map.c (linemap_add): Simplify column overflow calculation.
2410         Add comment about range and column bit init.
2411         (linemap_ordinary_map_lookup): Refactor for RAII
2412         (linemap_macro_map_lookup): Likewise.
2414 2020-07-14  Lewis Hyatt  <lhyatt@gmail.com>
2416         PR preprocessor/49973
2417         PR other/86904
2418         * include/cpplib.h (struct cpp_options):  Removed support for -ftabstop,
2419         which is now handled by diagnostic_context.
2420         (class cpp_display_width_computation): New class.
2421         (cpp_byte_column_to_display_column): Add optional tabstop argument.
2422         (cpp_display_width): Likewise.
2423         (cpp_display_column_to_byte_column): Likewise.
2424         * charset.c
2425         (cpp_display_width_computation::cpp_display_width_computation): New
2426         function.
2427         (cpp_display_width_computation::advance_display_cols): Likewise.
2428         (compute_next_display_width): Removed and implemented this
2429         functionality in a new function...
2430         (cpp_display_width_computation::process_next_codepoint): ...here.
2431         (cpp_byte_column_to_display_column): Added tabstop argument.
2432         Reimplemented in terms of class cpp_display_width_computation.
2433         (cpp_display_column_to_byte_column): Likewise.
2434         * init.c (cpp_create_reader): Remove handling of -ftabstop, which is now
2435         handled by diagnostic_context.
2437 2020-07-07  Nathan Sidwell  <nathan@acm.org>
2439         * directives.c (do_linemarker): Optimize rewinding to line zero.
2440         * files.c (_cpp_stack_file): Start on line zero when about to inject
2441         headers.
2442         (cpp_push_include, cpp_push_default_include): Use highest_line as
2443         the location.
2444         * include/cpplib.h (cpp_read_main_file): Add injecting parm.
2445         * init.c (cpp_read_main_file): Likewise, inform _cpp_stack_file.
2446         * internal.h (enum include_type): Add IT_MAIN_INJECT.
2448 2020-05-29  H.J. Lu  <hjl.tools@gmail.com>
2450         PR bootstrap/95413
2451         * configure: Regenerated.
2453 2020-05-23  David Edelsohn  <dje.gcc@gmail.com>
2455         * Makefile.in (AR): Substitute @AR@.
2456         * configure.ac (CHECK_PROG AR): New.
2457         * configure: Regenerate.
2459 2020-05-20  Nathan Sidwell  <nathan@acm.org>
2461         * internal.h (typedef _cpp_file): Delete, unnecessary in C++.
2462         (enum _cpp_find_file_kind): New.
2463         (_cpp_find_file): Use it, not 3 bools.
2464         * files.c (_cpp_find_file): Use _cpp_find_file_kind enum, not
2465         bools.
2466         (cpp_make_system_header): Break overly long line.
2467         (_cpp_stack_include, _cpp_fake_include)
2468         (_cpp_do_file_change, _cpp_compare_file_date, _cpp_has_header): Adjust.
2469         * init.c (cpp_read_main): Adjust _cpp_find_file call.
2471 2020-05-18  Nathan Sidwell  <nathan@acm.org>
2473         * include/cpplib.h (cpp_get_otions, cpp_get_callbacks)
2474         (cpp_get_deps): Mark as PURE.
2475         * include/line-map.h (get_combined_adhoc_loc)
2476         (get_location_from_adhoc_loc, get_pure_location): Reformat decls.
2477         * internal.h (struct lexer_state): Clarify comment.
2478         * system.h: Remove now-unneeded bool hackery.
2479         * files.c (_cpp_find_file): Store LOC not highest_location.
2481         PR preprocessor/95149
2482         * lex.c (struct lit_accum): New.
2483         (bufring_append): Replace by lit_accum::append.
2484         (lex_raw_string): Reimplement, using fragments of the old version.
2485         (lex_string): Adjust lex_raw_string call.
2487         PR preprocessor/95182
2488         * macro.c (collect_args): Preserve EOFif we fell out of the main
2489         file.
2490         (cpp_get_token_1): Reformat a couple of short lines.
2492 2020-05-14  H.J. Lu  <hongjiu.lu@intel.com>
2494         * configure: Regenerated.
2496 2020-05-13  Jason Merrill  <jason@redhat.com>
2498         * include/cpplib.h (enum c_lang): Change CXX2A to CXX20.
2499         * init.c, lex.c: Adjust.
2501 2020-05-12  Nathan Sidwell  <nathan@acm.org>
2503         EOF location is at end of file
2504         PR preprocessor/95013
2505         * lex.c (lex_raw_string): Process line notes before incrementing.
2506         Correct incrementing condition.  Adjust for new
2507         _cpp_get_fresh_line EOF behaviour.
2508         (_cpp_get_fresh_line): Do not pop buffer at EOF, increment line
2509         instead.
2510         (_cpp_lex_direct): Adjust for new _cpp_get_fresh_line behaviour.
2511         (cpp_directive_only_process): Assert we got a fresh line.
2512         * traditional.c (_cpp_read_logical_line_trad): Adjust for new
2513         _cpp_get_fresh_line behaviour.
2515 2020-05-12  H.J. Lu  <hongjiu.lu@intel.com>
2517         * Makefile.in (CET_HOST_FLAGS): New.
2518         (COMPILER): Add $(CET_HOST_FLAGS).
2519         * configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and
2520         AC_SUBST(CET_HOST_FLAGS).  Clear CET_HOST_FLAGS if jit isn't
2521         enabled.
2522         * aclocal.m4: Regenerated.
2523         * configure: Likewise.
2525 2020-05-08  Nathan Sidwell  <nathan@acm.org>
2527         Reimplement directives only processing, support raw literals.
2528         * directives-only.c: Delete.
2529         * Makefile.in (libcpp_a_OBJS, libcpp_a_SOURCES): Remove it.
2530         * include/cpplib.h (enum CPP_DO_task): New enum.
2531         (cpp_directive_only_preprocess): Declare.
2532         * internal.h (_cpp_dir_only_callbacks): Delete.
2533         (_cpp_preprocess_dir_only): Delete.
2534         * lex.c (do_peek_backslask, do_peek_next, do_peek_prev): New.
2535         (cpp_directives_only_process): New implementation.
2537 2020-02-14  Jakub Jelinek  <jakub@redhat.com>
2539         Partially implement P1042R1: __VA_OPT__ wording clarifications
2540         PR preprocessor/92319
2541         * macro.c (expand_arg): Move declarations before vaopt_state
2542         definition.
2543         (class vaopt_state): Move enum update_type definition earlier.  Remove
2544         m_allowed member, add m_arg and m_update members.
2545         (vaopt_state::vaopt_state): Change last argument from bool any_args
2546         to macro_arg *arg, initialize m_arg and m_update instead of m_allowed.
2547         (vaopt_state::update): When bumping m_state from 1 to 2 and m_update
2548         is ERROR, determine if __VA_ARGS__ expansion has any non-CPP_PADDING
2549         tokens and set m_update to INCLUDE if it has any, DROP otherwise.
2550         Return m_update instead of m_allowed ? INCLUDE : DROP in m_state >= 2.
2551         (replace_args, create_iso_definition): Adjust last argument to
2552         vaopt_state ctor.
2554 2020-02-05  Martin Sebor  <msebor@redhat.com>
2556         * include/cpplib.h (cpp_builtin_type): Remove trailing comma to
2557         avoid pedantic warnings in C++ 98 mode.
2559 2020-02-04  Jakub Jelinek  <jakub@redhat.com>
2561         * macro.c (builtin_has_include): Diagnose __has_include* use outside
2562         of preprocessing directives.
2564         PR preprocessor/93545
2565         * macro.c (cpp_get_token_no_padding): New function.
2566         (builtin_has_include): Use it instead of cpp_get_token.  Don't check
2567         SEEN_EOL.
2569 2020-02-01  Andrew Burgess  <andrew.burgess@embecosm.com>
2571         * configure: Regenerate.
2573 2020-01-28  Nathan Sidwell  <nathan@acm.org>
2575         PR preprocessor/93452
2576         * internal.h (struct spec_nodes): Drop n__has_include{,_next}.
2577         * directives.c (lex_macro_node): Don't check __has_include redef.
2578         * expr.c (eval_token): Drop __has_include eval.
2579         (parse_has_include): Move to ...
2580         * macro.c (builtin_has_include): ... here.
2581         (_cpp_builtin_macro_text): Eval __has_include{,_next}.
2582         * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_INCLUDE{,_NEXT}.
2583         * init.c (builtin_array): Add them.
2584         (cpp_init_builtins): Drop __has_include{,_next} init here ...
2585         * pch.c (cpp_read_state): ... and here.
2586         * traditional.c (enum ls): Drop has_include states ...
2587         (_cpp_scan_out_logical_line): ... and here.
2589 2020-01-27  Andrew Burgess  <andrew.burgess@embecosm.com>
2591         * configure: Regenerate.
2593 2020-01-24  Nathan Sidwell  <nathan@acm.org>
2595         * expr.c (parse_has_include): Remove bogus controlling macro code.
2597 2020-01-20  Nathan Sidwell  <nathan@acm.org>
2599         PR preprocessor/80005
2600         * include/cpplib.h (BT_HAS_ATTRIBUTE): Fix comment.
2601         * internal.h (struct lexer_state): Delete in__has_include field.
2602         (struct spec_nodes): Rename n__has_include{,_next}__ fields.
2603         (_cpp_defined_macro_p): New.
2604         (_cpp_find_file): Add has_include parm.
2605         * directives.c (lex_macro_node): Combine defined,
2606         __has_inline{,_next} checking.
2607         (do_ifdef, do_ifndef): Use _cpp_defined_macro_p.
2608         (_cpp_init_directives): Refactor.
2609         * expr.c (parse_defined): Use _cpp_defined_macro_p.
2610         (eval_token): Adjust parse_has_include calls.
2611         (parse_has_include): Add OP parameter.  Reimplement.
2612         * files.c (_cpp_find_file): Add HAS_INCLUDE parm.  Use it to
2613         inhibit error message.
2614         (_cpp_stack_include): Adjust _cpp_find_file call.
2615         (_cpp_fake_include, _cpp_compare_file_date): Likewise.
2616         (open_file_failed): Remove in__has_include check.
2617         (_cpp_has_header): Adjust _cpp_find_file call.
2618         * identifiers.c (_cpp_init_hashtable): Don't init
2619         __has_include{,_next} here ...
2620         * init.c (cpp_init_builtins): ... init them here.  Define as
2621         macros.
2622         (cpp_read_main_file): Adjust _cpp_find_file call.
2623         * pch.c (cpp_read_state): Adjust __has_include{,_next} access.
2624         * traditional.c (_cpp_scan_out_locgical_line): Likewise.
2626         PR preprocessor/93306
2627         * expr.c (parse_has_include): Refactor.  Check skip_eval before
2628         looking.
2630 2020-01-10  David Malcolm  <dmalcolm@redhat.com>
2632         * include/line-map.h (class diagnostic_path): New forward decl.
2633         (rich_location::get_path): New accessor.
2634         (rich_location::set_path): New function.
2635         (rich_location::m_path): New field.
2636         * line-map.c (rich_location::rich_location): Initialize m_path.
2638 2020-01-01  Jakub Jelinek  <jakub@redhat.com>
2640         Update copyright years.
2642 2019-12-18  David Malcolm  <dmalcolm@redhat.com>
2644         PR preprocessor/92982
2645         * charset.c
2646         (cpp_string_location_reader::cpp_string_location_reader): Delete
2647         initialization of m_line_table.
2648         * include/cpplib.h (cpp_string_location_reader::m_line_table):
2649         Delete unused member.
2651 2019-12-14  Jakub Jelinek  <jakub@redhat.com>
2653         PR preprocessor/92919
2654         * charset.c (wide_str_to_charconst): If str contains just the
2655         NUL terminator, punt quietly.
2657 2019-12-09  David Malcolm  <dmalcolm@redhat.com>
2659         * include/line-map.h (label_text::label_text): Make private.
2660         (label_text::borrow): New.
2661         (label_text::take): New.
2662         (label_text::take_or_copy): New.
2664 2019-12-09  Lewis Hyatt  <lhyatt@gmail.com>
2666         PR preprocessor/49973
2667         * generated_cpp_wcwidth.h: New file generated by
2668         ../contrib/unicode/gen_wcwidth.py, supports new cpp_wcwidth function.
2669         * charset.c (compute_next_display_width): New function to help
2670         implement display columns.
2671         (cpp_byte_column_to_display_column): Likewise.
2672         (cpp_display_column_to_byte_column): Likewise.
2673         (cpp_wcwidth): Likewise.
2674         * include/cpplib.h (cpp_byte_column_to_display_column): Declare.
2675         (cpp_display_column_to_byte_column): Declare.
2676         (cpp_wcwidth): Declare.
2677         (cpp_display_width): New function.
2679 2019-11-14  Joseph Myers  <joseph@codesourcery.com>
2681         * charset.c (narrow_str_to_charconst): Make CPP_UTF8CHAR constants
2682         unsigned for C.
2683         * init.c (lang_defaults): Set utf8_char_literals for GNUC2X and
2684         STDC2X.
2686 2019-11-07  Jakub Jelinek  <jakub@redhat.com>
2688         PR c++/91370 - Implement P1041R4 and P1139R2 - Stronger Unicode reqs
2689         * charset.c (narrow_str_to_charconst): Add TYPE argument.  For
2690         CPP_UTF8CHAR diagnose whenever number of chars is > 1, using
2691         CPP_DL_ERROR instead of CPP_DL_WARNING.
2692         (wide_str_to_charconst): For CPP_CHAR16 or CPP_CHAR32, use
2693         CPP_DL_ERROR instead of CPP_DL_WARNING when multiple char16_t
2694         or char32_t chars are needed.
2695         (cpp_interpret_charconst): Adjust narrow_str_to_charconst caller.
2697 2019-11-05  Tim van Deurzen  <tim@kompiler.org>
2699         * cpplib.h: Add spaceship operator for C++.
2700         * lex.c: Implement conditional lexing of spaceship operator for C++20.
2702 2019-10-31  Jakub Jelinek  <jakub@redhat.com>
2704         PR preprocessor/92296
2705         * internal.h (struct def_pragma_macro): Add is_builtin bitfield.
2706         (_cpp_restore_special_builtin): Declare.
2707         * init.c (_cpp_restore_special_builtin): New function.
2708         * directives.c (do_pragma_push_macro): For NT_BUILTIN_MACRO
2709         set is_builtin and don't try to grab definition.
2710         (cpp_pop_definition): Use _cpp_restore_special_builtin to restore
2711         builtin macros.
2713 2019-10-15  Nathan Sidwell  <nathan@acm.org>
2715         * include/line-map.h (struct maps_info_ordinary): Make cache
2716         mutable.
2717         (struct maps_info_macro): Likewise.
2718         (LINEMAPS_CACHE): Remove non-ref accessor. Constify ref accessor.
2719         (LINEMAPS_ORDINARY_CACHE, LINEMAPS_MACRO_CACHE): Likewise.
2720         (LINEMAPS_ORDINARY_MAP_AT, LINEMAPS_MACRO_MAP_AT): Use
2721         LINEMAPS_USED and LINEMAPS_MAP_AT.
2722         (linemap_lookup): Constify line_map arg.
2723         linemap.c (linemap_ordinary_map_lookup, linemap_macro_map_lookup):
2724         Constify line_map arg.
2726 2019-10-11  Joseph Myers  <joseph@codesourcery.com>
2728         * include/cpplib.h (struct cpp_options): Add dfp_constants and
2729         cpp_warn_c11_c2x_compat.
2730         (enum cpp_warning_reason): Add CPP_W_C11_C2X_COMPAT.
2731         * init.c (struct lang_flags): Add dfp_constants.
2732         (lang_defaults): Set dfp_constants to 1 for GNUC2X and STDC2X and
2733         0 for other languages.
2734         (cpp_set_lang): Set dfp_constants from language.
2735         (cpp_create_reader): Set cpp_warn_c11_c2x_compat to -1.
2736         * expr.c (interpret_float_suffix): Mention DFP constants as C2X in
2737         comment.
2738         (cpp_classify_number): Do not diagnose DFP constants for languages
2739         setting dfp_constants, unless cpp_warn_c11_c2x_compat.
2741 2019-10-04  Nathan Sidwell  <nathan@acm.org>
2743         PR preprocessor/91991
2744         * line-map.c (linemap_line_start): Clear max_column_hint if we run
2745         out of locations.
2747 2019-10-02  Richard Biener  <rguenther@suse.de>
2749         * internal.h (enum include_type): Remove trailing comma.
2751 2019-10-02  Joseph Myers  <joseph@codesourcery.com>
2753         * include/cpplib.h (struct cpp_options): Add member scope.
2754         * init.c (struct lang_flags, lang_defaults): Likewise.
2755         (cpp_set_lang): Set scope member of pfile.
2756         * lex.c (_cpp_lex_direct): Test CPP_OPTION (pfile, scope) not
2757         CPP_OPTION (pfile, cplusplus) for creating CPP_SCOPE tokens.
2759 2019-09-26  Eric Botcazou  <ebotcazou@adacore.com>
2761         * charset.c (UCS_LIMIT): New macro.
2762         (ucn_valid_in_identifier): Use it instead of a hardcoded constant.
2763         (_cpp_valid_ucn): Issue a pedantic warning for UCNs larger than
2764         UCS_LIMIT outside of identifiers in C and in C++2a or later.
2766 2019-09-19  Lewis Hyatt  <lhyatt@gmail.com>
2768         PR c/67224
2769         * charset.c (_cpp_valid_utf8): New function to help lex UTF-8 tokens.
2770         * internal.h (_cpp_valid_utf8): Declare.
2771         * lex.c (forms_identifier_p): Use it to recognize UTF-8 identifiers.
2772         (_cpp_lex_direct): Handle UTF-8 in identifiers and CPP_OTHER tokens.
2773         Do all work in "default" case to avoid slowing down typical code paths.
2774         Also handle $ and UCN in the default case for consistency.
2776 2019-08-30  Nathan Sidwell  <nathan@acm.org>
2778         New # semantics for popping to "" name.
2779         libcpp/
2780         * directives.c (do_linemarker): Popping to "" name means get the
2781         name from the include stack..
2783 2019-09-05  Nathan Sidwell  <nathan@acm.org>
2785         PR preprocessor/91639
2786         * directives.c (do_include_common): Tell lexer we're a #include.
2787         * files.c (_cpp_stack_file): Lexer will have always incremented.
2788         * internal.h (struct cpp_context): Extend in_directive's
2789         semantics.
2790         * lex.c (_cpp_lex_direct): Increment line for final \n when lexing
2791         for an ISO #include.
2792         * line-map.c (linemap_line_start): Remember if we overflowed.
2794 2019-09-03  Ulrich Weigand  <uweigand@de.ibm.com>
2796         * directives.c: Remove references to spu from comments.
2797         * expr.c: Likewise.
2799 2019-08-29  Nathan Sidwell  <nathan@acm.org>
2801         * internal.h (enum include_type): Add IT_MAIN, IT_DIRECTIVE_HWM,
2802         IT_HEADER_HWM.
2803         (_cpp_stack_file): Take include_type, not a bool.
2804         * files.c (_cpp_find_file): Refactor to not hide an if inside a
2805         for conditional.
2806         (should_stack_file): Break apart to ...
2807         (is_known_idempotent_file, has_unique_contents): ... these.
2808         (_cpp_stack_file): Replace IMPORT boolean with include_type enum.
2809         Refactor to use new predicates.  Do linemap compensation here ...
2810         (_cpp_stack_include): ... not here.
2811         * init.c (cpp_read_main_file): Pass IT_MAIN to _cpp_stack_file.
2813 2019-08-28  Nathan Sidwell  <nathan@acm.org>
2815         * directives-only.c (_cpp_preprocess_dir_only): Use false, not
2816         zero for _cpp_handle_directive call.
2817         * directives.c (_cpp_handle_directive): Indented is bool.
2818         * files.c (struct _cpp_file): Make bools 1 bit bitfields.
2819         * internal.h (enum include_type): Reformat and comment.
2820         (struct cpp_buffer): Make flags 1 bit bitfields.
2821         (_cpp_handle_directive): Indented is bool.
2823 2019-07-09  Martin Sebor  <msebor@redhat.com>
2825         * include/line-map.h: Change class-key from class to struct and vice
2826         versa to match convention and avoid -Wclass-is-pod and -Wstruct-no-pod.
2827         * mkdeps.c: Same.
2829 2019-07-03  Martin Liska  <mliska@suse.cz>
2831         * line-map.c (linemap_get_expansion_filename): Remove
2832         dead assignemts.
2833         * mkdeps.c (make_write): Likewise.
2835 2019-07-02  qing zhao  <qing.zhao@oracle.com>
2837         PR preprocessor/90581
2838         * directives.c (do_include_common): Replace CPP_STACK_MAX with
2839         CPP_OPTION (pfile, max_include_depth).
2840         * include/cpplib.h (struct cpp_options): Add new field
2841         max_include_depth.
2842         * init.c (cpp_create_reader): Initiate new field max_include_depth.
2843         * internal.h: Delete CPP_STACK_MAX.
2845 2019-06-26  Nathan Sidwell  <nathan@acm.org>
2847         PR preprocessor/90927
2848         * mkdeps.c (mkdeps::vec::operator[]): Add non-const variant.
2849         (deps_add_target): Deal with out of order unquoted targets.
2851 2019-05-19  Andrew Pinski  <apinski@marvell.com>
2853         PR pch/81721
2854         * lex.c (cpp_token_val_index <case SPELL_OPERATOR>): If tok->flags
2855         has NAMED_OP set, then return CPP_TOKEN_FLD_NODE.
2857 2019-05-14  Martin Liska  <mliska@suse.cz>
2859         PR preprocessor/90382
2860         * line-map.c (first_map_in_common_1): Handle ADHOC
2861         locations.
2863 2019-05-14  Martin Liska  <mliska@suse.cz>
2865         PR preprocessor/90382
2866         * include/line-map.h (get_data_from_adhoc_loc): Add const to
2867         the first argument.
2868         (get_location_from_adhoc_loc): Likewise.
2869         * line-map.c(get_data_from_adhoc_loc):  Add const to
2870         the first argument.
2871         (get_location_from_adhoc_loc): Likewise.
2872         (get_combined_adhoc_loc): Use get_location_from_adhoc_loc
2873         (or get_data_from_adhoc_loc).
2874         (get_range_from_adhoc_loc): Likewise.
2875         (get_pure_location): Likewise.
2876         (linemap_position_for_loc_and_offset): Likewise.
2877         (linemap_lookup): Likewise.
2878         (linemap_ordinary_map_lookup): Likewise.
2879         (linemap_macro_map_lookup): Likewise.
2880         (linemap_get_expansion_line): Likewise.
2881         (linemap_get_expansion_filename): Likewise.
2882         (linemap_location_in_system_header_p): Likewise.
2883         (linemap_location_from_macro_expansion_p): Likewise.
2884         (linemap_macro_loc_to_exp_point): Likewise.
2885         (linemap_resolve_location): Likewise.
2886         (linemap_unwind_toward_expansion): Likewise.
2887         (linemap_unwind_to_first_non_reserved_loc): Likewise.
2888         (linemap_expand_location): Likewise.
2889         (linemap_dump_location): Likewise.
2891 2019-05-07  Nathan Sidwell  <nathan@acm.org>
2893         * files.c (_cpp_stack_file): Empty filenames aren't dependencies.
2894         * mkdeps.c (deps_add_dep): Assert not empty.
2896         * include/mkdeps.h (deps_write): Add PHONY arg.
2897         (deps_phony_targets): Delete.
2898         * init.c (cpp_finish): Just call deps_write.
2899         * mkdeps.c (struct mkdeps): Add local vector class.  Reimplement
2900         vector handling.
2901         (munge): Munge to static buffer.
2902         (apply_vpath): Adjust vector handling.
2903         (deps_init, deps_free): Use new, delete.
2904         (deps_add_target): Do not munge here.  Record quoting low water mark.
2905         (deps_add_dep): Do not munge here.
2906         (deps_add_vpath): Adjust vector handling.
2907         (make_write_name): New.  Munge on demand here.
2908         (make_write_vec): New.
2909         (deps_phony_targets): Delete.
2910         (make_write): New.
2911         (deps_write): Forward to deps_Write.
2912         (deps_save, deps_restore): Adjust vector handling.
2914 2019-05-06  Nathan Sidwell  <nathan@acm.org>
2916         * include/mkdeps.h: Rename struct deps to struct mkdeps.
2917         * mkdeps.c: Likewise.
2918         * include/cpplib.h (cpp_get_deps): Rename return type..
2919         * directives.c (cpp_get_deps): Likewise.
2920         * internal.h (struct cpp_reader): Rename deps field type.
2922 2019-04-03  Jonathan Wakely  <jwakely@redhat.com>
2924         * files.c (search_path_exhausted): Fix typo in comment.
2926 2019-02-26  Martin Liska  <mliska@suse.cz>
2928         * symtab.c (ht_dump_statistics): Make
2929         horizontal alignment for statistics.
2931 2019-02-20  David Malcolm  <dmalcolm@redhat.com>
2933         PR c/89410
2934         * include/line-map.h (linenum_arith_t): New typedef.
2935         (compare): Use it.
2937 2019-02-18  Martin Liska  <mliska@suse.cz>
2939         PR c++/89383
2940         * line-map.c (linemap_line_start): Use 1UL in order
2941         to not overflow.
2943 2019-02-11  Martin Liska  <mliska@suse.cz>
2945         PR lto/88147
2946         * line-map.c (linemap_line_start): Don't reuse the existing line
2947         map if the line offset is sufficiently large to cause overflow
2948         when computing location_t values.
2950 2019-01-26  Jakub Jelinek  <jakub@redhat.com>
2952         PR preprocessor/88974
2953         * directives.c (SEEN_EOL): Move macro to ...
2954         * internal.h (SEEN_EOL): ... here.
2955         * expr.c (parse_has_include): Don't cpp_get_token if SEEN_EOL ().
2957 2019-01-01  Jakub Jelinek  <jakub@redhat.com>
2959         Update copyright years.
2961 2018-11-27  Mike Gulick  <mgulick@mathworks.com>
2963         PR preprocessor/83173
2964         * location-example.txt: Update example -fdump-internal-locations
2965         output.
2967 2018-11-27  Mike Gulick  <mgulick@mathworks.com>
2969         PR preprocessor/83173
2970         * files.c (_cpp_stack_include): Check if
2971         line_table->highest_location is past current line before
2972         decrementing.
2974 2018-11-13  David Malcolm  <dmalcolm@redhat.com>
2976         * charset.c: Replace "source_location" with "location_t".
2977         * directives-only.c: Likewise.
2978         * directives.c: Likewise.
2979         * errors.c: Likewise.
2980         * expr.c: Likewise.
2981         * files.c: Likewise.
2982         * include/cpplib.h: Likewise.  Rename MAX_SOURCE_LOCATION to
2983         MAX_LOCATION_T.
2984         * include/line-map.h: Likewise.
2985         * init.c: Likewise.
2986         * internal.h: Likewise.
2987         * lex.c: Likewise.
2988         * line-map.c: Likewise.
2989         * location-example.txt: Likewise.
2990         * macro.c: Likewise.
2991         * pch.c: Likewise.
2992         * traditional.c: Likewise.
2994 2018-11-07  Hafiz Abid Qadeer  <abidh@codesourcery.com>
2996         * configure: Regenerated.
2998 2018-11-05  Martin Liska  <mliska@suse.cz>
3000         * symtab.c (ht_dump_statistics): Replace %zu with %lu format.
3002 2018-11-05  Martin Liska  <mliska@suse.cz>
3004         * symtab.c (ht_dump_statistics): Fix format and
3005         pass missing argument.
3007 2018-11-05  Martin Liska  <mliska@suse.cz>
3009         * symtab.c (ht_dump_statistics): Make dump conditional
3010         based on alloc_subobject.
3012 2018-10-31  Joseph Myers  <joseph@codesourcery.com>
3014         PR bootstrap/82856
3015         * configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
3016         * aclocal.m4, config.in, configure: Regenerate.
3018 2018-10-31  Nathan Sidwell  <nathan@acm.org>
3020         * internal.h (struct cpp_reader): Rename forced_token_location_p
3021         to forced_token_location and drop its pointerness.
3022         * include/cpplib.h (cpp_force_token_locations): Take location, not
3023         pointer to one.
3024         * init.c (cpp_create_reader): Adjust.
3025         * lex.c (cpp_read_main_file): 
3027         * directives.c (do_include_common): Commonize cleanup path.
3028         (_cpp_pop_buffer): Fix leak.
3030         * include/line-map.h (IS_ORDINARY_LOC, IS_MACRO_LOC): New
3031         predicates.
3032         (IS_ADHOC_LOC): Move earlier.
3033         (MAP_ORDINARY_P): Use IS_ORDINARY_LOC.
3034         * line-map.c (linemap_location_from_macro_expansion_p): Use
3035         IS_MACRO_LOC.
3037         * include/cpplib.h (cpp_macro_definition_location): Make inline.
3038         * macro.c (warn_of_redefinition): Fix comments, examine macro
3039         type, use C++ for.
3040         (cpp_macro_definition_location): Don't define here.
3042         * include/cpplib.h (HT_NODE): Don't cast NODE.
3043         (NODE_LEN, NODE_NAME): Use HT_NODE.
3045         * directives.c (DIRECTIVE_TABLE): Drop historical frequency
3046         comments.
3047         * files.c (_cpp_stack_file): Fix indentation.
3049 2018-10-17  Joseph Myers  <joseph@codesourcery.com>
3051         * include/cpplib.h (enum c_lang): Add CLK_GNUC2X and CLK_STDC2X.
3052         * init.c (lang_defaults): Add GNUC2X and STDC2X entries.
3053         (cpp_init_builtins): Define __STDC_VERSION__ to 202000L for C2X.
3055 2018-10-11  David Malcolm  <dmalcolm@redhat.com>
3057         * macro.c (_cpp_arguments_ok): If the argument count is wrong, add
3058         a note showing the definition of the macro.
3060 2018-10-11  Nathan Sidwell  <nathan@acm.org>
3062         * include/line-map.h (LINEMAPS_MACRO_LOWEST_LOCATION): Fix
3063         off-by-one error.
3064         * line-map.c (linemap_enter_macro): Use RAII.  Clear all of the
3065         macro_locations.
3067 2018-10-09  David Malcolm  <dmalcolm@redhat.com>
3069         * charset.c (noop_error_cb): Rename to...
3070         (noop_diagnostic_cb): ...this, converting params to enums.
3071         (cpp_interpret_string_ranges): Update for renaming and enums.
3072         * directives.c (check_eol_1): Convert reason to enum.
3073         (do_diagnostic): Convert code and reason to enum.
3074         (do_error): Use CPP_W_NONE rather than 0.
3075         (do_pragma_dependency): Likewise.
3076         * errors.c (cpp_diagnostic_at): Convert level and reason to enums.
3077         Update for renaming.
3078         (cpp_diagnostic): Convert level and reason to enums.
3079         (cpp_error): Convert level to enum.
3080         (cpp_warning): Convert reason to enums.
3081         (cpp_pedwarning): Likewise.
3082         (cpp_warning_syshdr): Likewise.
3083         (cpp_diagnostic_with_line): Convert level and reason to enums.
3084         Update for renaming.
3085         (cpp_error_with_line): Convert level to enum.
3086         (cpp_warning_with_line): Convert reason to enums.
3087         (cpp_pedwarning_with_line): Likewise.
3088         (cpp_warning_with_line_syshdr): Likewise.
3089         (cpp_error_at): Convert level to enum.
3090         (cpp_errno): Likewise.
3091         (cpp_errno_filename): Likewise.
3092         * include/cpplib.h (enum cpp_diagnostic_level): Name this enum,
3093         and move to before struct cpp_callbacks.
3094         (enum cpp_warning_reason): Likewise.
3095         (cpp_callbacks::diagnostic): Convert params from int to enums.
3096         (cpp_error): Convert int param to enum cpp_diagnostic_level.
3097         (cpp_warning): Convert int param to enum cpp_warning_reason.
3098         (cpp_pedwarning): Likewise.
3099         (cpp_warning_syshdr): Likewise.
3100         (cpp_errno): Convert int param to enum cpp_diagnostic_level.
3101         (cpp_errno_filename): Likewise.
3102         (cpp_error_with_line): Likewise.
3103         (cpp_warning_with_line): Convert int param to enum
3104         cpp_warning_reason.
3105         (cpp_pedwarning_with_line): Likewise.
3106         (cpp_warning_with_line_syshdr): Likewise.
3107         (cpp_error_at): Convert int param to enum cpp_diagnostic_level.
3108         * macro.c (create_iso_definition): Convert int to enum.
3109         (_cpp_create_definition): Likewise.
3111 2018-09-17  David Malcolm  <dmalcolm@redhat.com>
3113         * include/line-map.h (range_label::get_text): Add param
3114         "range_idx".
3116 2018-08-30  Nathan Sidwell  <nathan@acm.org>
3118         * include/line-map.h (enum lc_reason): Comment each member
3119         separately.
3120         (struct line_maps): Fix reallocator comment.
3122 2018-08-27  David Malcolm  <dmalcolm@redhat.com>
3124         PR 87091
3125         * include/line-map.h (enum range_display_kind): New enum.
3126         (struct location_range): Replace field "m_show_caret_p" with
3127         "m_range_display_kind", converting from bool to the new enum.
3128         (class rich_location): Add example of line insertion fix-it hint.
3129         (rich_location::add_range): Convert param "show_caret_p" from bool
3130         to enum range_display_kind and rename to "range_display_kind",
3131         giving it a default of SHOW_RANGE_WITHOUT_CARET.
3132         (rich_location::set_range): Likewise, albeit without a default.
3133         * line-map.c (rich_location::rich_location): Update for conversion
3134         of show_caret_p to tri-state enum.
3135         (rich_location::add_range): Likewise.
3136         (rich_location::set_range): Likewise.
3138 2018-08-24  H.J. Lu  <hongjiu.lu@intel.com>
3140         PR bootstrap/86872
3141         * line-map.c (pure_location_p): Return true if linemap_lookup
3142         returns NULL.
3143         (linemap_add): Set start_location to 0 if we run out of line map
3144         space.
3146 2018-08-20  Nathan Sidwell  <nathan@acm.org>
3148         * include/cpplib.h: Fixup some whitespace.
3149         (cpp_hashnode): Reduce type to 2 bit & flags to 8.
3151         * include/cpplib.h (NODE_BUILTIN, NODE_MACRO_ARG): Delete.
3152         Renumber others.
3153         (enum node_type): Replace NT_MACRO with NT_USER_MACRO,
3154         NT_BUILTIN_MACRO, NT_MACRO_ARG.  Delete NT_ASSERTION.
3155         (NTV_MACRO, NTV_ANSWER, NTV_BUILTIN, NTV_ARGUMENT, NTV_NONE):
3156         Delete.
3157         (CPP_HASHNODE_VALUE_IDX): Delete.
3158         (union _cpp_hashnode_value): GTY tag from enum node_type directly.
3159         (struct cpp_hashnode): Adjust GTY desc for value field.
3160         (cpp_user_macro_p, cpp_builtin_macro_p, cpp_macro_p): Adjust.
3161         * directives.c (undefine_macros): Clear value.anwers, adjust flag
3162         clearing.
3163         (_cpp_test_assertion): No need to check NT_ASSERTION.
3164         (do_assert, do_unassert): Likewise.
3165         * init.c (cpp_init_special_builtins): Set type not flags.
3166         * macro.c (struct macro_arg_saved_data): Add type field.
3167         (cpp_get_token_1): Check type not NT_VOID.
3168         (_cpp_free_definition): Adjust flag clearing.  Nullify
3169         value.answers.
3170         (_cpp_save_parameter, _cpp_unsave_parameters): Save and restore
3171         type.
3172         (lex_expansion_token): Check type not flags.
3173         (_cpp_create_definition): Set type to NT_USER_MACRO.
3174         (_cpp_notify_macro_use): Adjust type checking.
3175         * pch.c (write_macdef, count_defs, write_defs, cpp_valid_state)
3176         (save_macros): Adjust node type/flag handling.
3177         * traditional.c (_cpp_scan_out_logical_line): Check type not flags.
3179         * directives.c (do_undef): Use cpp_macro_p & cpp_builtin_macro_p.
3180         * include/cpplib.h (enum cpp_macro_kind): Remove trailing comma.
3181         (cpp_fun_like_macro_p): Make inline, define.
3182         * macro.c (cpp_define_lazily): Use UCHAR_MAX.
3183         (cpp_fun_like_macro_p): Delete.
3185         * Makefile.in (TAGS_SOURCES): Remove cpp-id-data.h.
3186         * include/cpp-id-data.h: Delete.
3187         * internal.h: Include cpplib.h not cpp-id-data.h.
3189         * include/cpp-id-data.h (struct answer): Delete.
3190         * include/cpplib.h (struct answer): Don't forward-declare.
3191         (enum cpp_macro_kind): Add cmk_assert.
3192         (struct cpp_macro): Union parms and next assert chain.
3193         (union _cpp_hashnode_value): 'answer' field is cpp_macro.
3194         * directives.c (parse_answer): Convert to use cpp_macro. Return
3195         true on success. 
3196         (parse_assertion, find_answer, _cpp_test_assertion, cpp_do_assert)
3197         (cpp_do_unassert): Convert to use cpp_macro.
3198         * macro.c (warn_of_redefinition, _cpp_new_macro)
3199         (check_trad_stringification, cpp_macro_definition): Adjust macro
3200         parm access.
3201         * traditional.c (_cpp_replacement_text_len)
3202         (_cpp_copy_replacement_text, _cpp_create_trad_definition): Likewise.
3204 2018-08-17  Nathan Sidwell  <nathan@acm.org>
3206         * include/cpplib.h (struct cpp_callbacks): Replace
3207         user_builtin_macro with user_lazy_macro.
3208         (struct cpp_macro): add lazy field.
3209         (enum cpp_builtin_type): Remove BT_FIRST_USER, BT_LAST_USER.
3210         (cpp_define_lazily): Declare.
3211         * macro.c (enter_macro_context) Use _cpp_maybe_notify_macro_use.
3212         (warn_of_redefinition): Use cpp_builtin_macro_p, directly call
3213         user_lazy_macro hook.
3214         (_cpp_new_macro): Clear lazy field.
3215         (cpp_define_lazily): Define.
3216         (_cpp_notify_macro_use): Adjust lazy definition code.
3217         (cpp_macro_definition): No need to do lazy definition here.
3218         * pch.c (write_macdef, save_macros): Likewise.
3220         * include/cpplib.h (enum cpp_macro_kind): New.
3221         (struct cpp_macro): Make body trailing array.  Add kind field,
3222         delete traditional flag.
3223         * internal.h (_cpp_new_macro): Declare.
3224         (_cpp_reserve_room): New inline.
3225         (_cpp_commit_buf): Declare.
3226         (_cpp_create_trad_definition): Return new macro.
3227         * lex.c (_cpp_commit_buff): New.
3228         * macro.c (macro_real_token_count): Count backwards.
3229         (replace_args): Pointer equality not orderedness.
3230         (_cpp_save_parameter): Use _cpp_reserve_room.
3231         (alloc_expansion_token): Delete.
3232         (lex_expansion_token): Return macro pointer.  Use _cpp_reserve_room.
3233         (create_iso_definition): Allocate macro itself.  Adjust for
3234         different allocation ordering.
3235         (_cpp_new_macro): New.
3236         (_cpp_create_definition): Adjust for API changes.
3237         * traditional.c (push_replacement_text): Don't set traditional
3238         flag.
3239         (save_replacement_text): Likewise.
3240         (_cpp_create_trad_definition): Allocate macro itself, Adjust for
3241         different allocation ordering.
3243         * cpp-id-data.h (uchar, UC): Move to internal.h
3244         (struct cpp_macro): Move to cpplib.h.
3245         * internal.h (uchar, UC): From cpp-id-data.h.
3246         * include/cpplib.h (struct cpp_macro): From cpp-id-data.h.
3248 2018-08-16  Nathan Sidwell  <nathan@acm.org>
3250         * internal.h (_cpp_save_parameter): Take parmno, not macro.
3251         (_cpp_unsave_parameters): Declare.
3252         * macro.c (_cpp_save_parameter): Take parm number, not macro.
3253         Return true on success.
3254         (_cpp_unsave_parameters): New.
3255         (parse_params): Take parm_no and variadic pointers, not macro.
3256         Reimplement parsing logic.
3257         (create_iso_definition): Adjust parse_params changes.  Call
3258         _cpp_unsave_parameters here.
3259         (_cpp_create_definition): Don't unsave params here.
3260         * traditional.c (scan_parameters): Take n_param pointer, adjust.
3261         (_cpp_create_trad_definition): Ajust scan_parameters change.  Call
3262         _cpp_unsave_parameters.
3264         * include/cpplib.h (cpp_user_macro_p, cpp_builtin_macro_p)
3265         (cpp_macro_p): New inlines.
3266         * directives.c (do_pragma_poison): Use cpp_macro_p.
3267         (do_ifdef, do_ifndef): Likewise.  Use _cpp_maybe_notify_macro_use.
3268         (cpp_pop_definition): Use cpp_macro_p.  Move _cpp_free_definition
3269         earlier.  Don't zap node directly.
3270         * expr.c (parse_defined): Use _cpp_maybe_notify_macro_use &
3271         cpp_macro_p.
3272         * files.c (should_stack_file): Use cpp_macro_p.
3273         * identifiers.c (cpp_defined): Likewise.
3274         * internal.h (_cpp_mark_macro): Use cpp_user_macro_p.
3275         (_cpp_notify_macro_use): Declare.
3276         (_cpp_maybe_notify_macro_use): New inline.
3277         * lex.c (is_macro): Use cpp_macro_p.
3278         * macro.c (_cpp_warn_if_unused_macro): Use cpp_user_macro_p.
3279         (enter_macro_context): Likewise.
3280         (_cpp_create_definition): Use cpp_builtin_macro_p,
3281         cpp_user_macro_p.  Move _cpp_free_definition earlier.
3282         (_cpp_notify_macro_use): New, broken out of multiple call sites.
3283         * traditional.c (fun_like_macro_p): Use cpp_builtin_macro_p.
3284         (maybe_start_funlike, _cpp_scan_out_logical_line)
3285         (push_replacement_text): Likewise.
3287 2018-08-15  David Malcolm  <dmalcolm@redhat.com>
3289         * include/line-map.h (struct location_range): Add "m_label" field.
3290         (class rich_location): Add description of labels to leading
3291         comment.
3292         (rich_location::rich_location): Add "label" param, defaulting to
3293         NULL.
3294         (rich_location::add_range): Likewise.
3295         (struct label_text): New struct.
3296         (class range_label): New abstract base class.
3297         * line-map.c (rich_location::rich_location): Add "label" param;
3298         use it.
3299         (rich_location::add_range): Likewise.
3301 2018-08-08  Nathan Sidwell  <nathan@acm.org>
3303         Make linemap::included_from a location
3304         libcpp/
3305         * include/line-map.h (struct line_map_ordinary): Replace
3306         included_from map index with included_at source_location.
3307         (ORDINARY_MAP_INCLUDER_FILE_INDEX): Delete.
3308         (LAST_SOURCE_LINE_LOCATION): Delete.
3309         (LAST_SOURCE_LINE, LAST_SOURCE_COLUMN): Delete.
3310         (linemap_included_from): New.
3311         (linemap_included_from_linemap): Declare.
3312         (MAIN_FILE_P): Adjust.
3313         * line-map.c (linemap_included_from_linemap): New.
3314         (lonemap_check_files_exited): Use linemap_included_at.
3315         (linemap_add): Adjust inclusion setting.
3316         (linemap_dump, linemap_dump_location): Adjust.
3317         * directives.c (do_linemarker): Use linemap_included_at.
3319 2018-08-07  Nathan Sidwell  <nathan@acm.org>
3321         * line-map.c: (linemap_init): Set default allocator here.
3322         (new_linemap): Rather than here.  Refactor allocation logic.
3324 2018-07-20  David Malcolm  <dmalcolm@redhat.com>
3326         * include/line-map.h (rich_location::set_range): Remove redundant
3327         line_maps * parameter.
3328         * line-map.c (rich_location::set_range): Likewise.
3330 2018-07-18  Bernd Edlinger  <bernd.edlinger@hotmail.de>
3332         PR 69558
3333         * macro.c (enter_macro_context): Change the location info for builtin
3334         macros and _Pragma from location of the closing parenthesis to location
3335         of the macro expansion point.
3337 2018-07-17  Jason Franklin  <j_fra@fastmail.us>
3338             Jakub Jelinek  <jakub@redhat.com>
3340         * lex.c (_cpp_lex_direct): Use CPP_DL_NOTE instead of CPP_DL_PEDWARN,
3341         CPP_DL_WARNING or CPP_DL_ERROR for note that diagnostics for C++ style
3342         comments is reported only once per file and guard those calls on the
3343         preceding cpp_error returning true.
3345 2018-07-03  Nathan Sidwell  <nathan@acm.org>
3347         Reorg line_map data structures for better packing.
3348         * include/line-map.h (enum lc_reason): Add LC_HWM.
3349         (LINE_MAP_MAX_LOCATION): Define here.
3350         (struct line_map): Move reason field to line_map_ordinary.  Adjust
3351         GTY tagging.
3352         (struct line_map_ordinary): Reorder fields for less padding.
3353         (struct line_map_macro): Likewise.
3354         (MAP_ORDINARY_P): New.
3355         (linemap_check_ordinary, linemap_check_macro): Adjust.
3356         * line-map.c (LINE_MAP_MAX_SOURCE_LOCATION): Delete.
3357         (new_linemap): Take start_location, not reason.  Adjust.
3358         (linemap_add, linemap_enter_macro): Adjust.
3359         (linemap_line_start): Likewise.
3360         (linemap_macro_expansion_map_p): Use MAP_ORDINARY_P.
3361         (linemap_macro_loc_to_spelling_point): Likewise.
3362         (linemap_macro_loc_to_def_point): Likewise.
3363         (linemap_dump): Likewise.
3365 2018-05-23  Jason Merrill  <jason@redhat.com>
3367         * system.h: #include <new> earlier.
3369 2018-05-17  Jason Merrill  <jason@redhat.com>
3371         * line-map.c (linemap_init): Use placement new.
3372         * system.h: #include <new>.
3374 2018-03-14  David Malcolm  <dmalcolm@redhat.com>
3376         * include/line-map.h (compare): New function on linenum_type.
3378 2018-02-28  Jonathan Wakely  <jwakely@redhat.com>
3380         PR preprocessor/84517
3381         * lex.c (is_macro_not_literal_suffix): New function.
3382         (lex_raw_string, lex_string): Use is_macro_not_literal_suffix to
3383         decide when to issue -Wliteral-suffix warnings.
3385 2018-02-16  Richard Biener  <rguenther@suse.de>
3387         PR bootstrap/82939
3388         * line-map.c (linemap_init): Avoid broken value-init when compiling
3389         with GCC 4.2.
3391 2018-02-15  Jason Merrill  <jason@redhat.com>
3392             Jakub Jelinek  <jakub@redhat.com>
3394         PR preprocessor/83063 - __VA_OPT__ and ##
3395         PR preprocessor/83708
3396         * macro.c (vaopt_state): Reorder m_last_was_paste before m_state.
3397         (vaopt_state::vaopt_state): Adjust.
3398         (vaopt_state::update_flags): Add BEGIN and END.
3399         (vaopt_state::update): Return them.
3400         (copy_paste_flag): Factor out of replace_args.
3401         (last_token_is): New.
3402         (replace_args): Handle BEGIN and END.  Avoid padding there.
3403         (tokens_buff_last_token_ptr): Return NULL if no tokens.
3405 2018-01-31  Jakub Jelinek  <jakub@redhat.com>
3407         PR preprocessor/69869
3408         * traditional.c (skip_macro_block_comment): Return bool, true if
3409         the macro block comment is unterminated.
3410         (copy_comment): Use return value from skip_macro_block_comment instead
3411         of always false.
3413 2018-01-27  Jakub Jelinek  <jakub@redhat.com>
3415         * include/cpplib.h (enum cpp_builtin_type): Change BT_LAST_USER from
3416         BT_FIRST_USER + 31 to BT_FIRST_USER + 63.
3418 2018-01-18  Boris Kolpackov  <boris@codesynthesis.com>
3420         PR other/70268
3421         * include/cpplib.h (cpp_callbacks::remap_filename): New callback.
3422         * macro.c (_cpp_builtin_macro_text): Call remap_filename for
3423         __FILE__ and __BASE_FILE__.
3425 2018-01-10  Kelvin Nilsen  <kelvin@gcc.gnu.org>
3427         * lex.c (search_line_fast): Remove illegal coercion of an
3428         unaligned pointer value to vector pointer type and replace with
3429         use of __builtin_vec_vsx_ld () built-in function, which operates
3430         on unaligned pointer values.
3432 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
3434         Update copyright years.
3436 2017-12-20  Michael Weiser  <michael.weiser@gmx.de>
3438         PR preprocessor/83492
3439         * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]:
3440         Fix selection of big-endian shift parameters by using
3441         __ARM_BIG_ENDIAN.
3443 2017-12-14  Bernd Edlinger  <bernd.edlinger@hotmail.de>
3445         * internal.h (maybe_print_line): Change signature.
3447 2017-12-05  Jakub Jelinek  <jakub@redhat.com>
3449         PR c++/79228
3450         * expr.c (interpret_float_suffix): Avoid memcmp.
3451         (interpret_int_suffix): Likewise.  Don't check for if.
3453 2017-12-01  Jason Merrill  <jason@redhat.com>
3455         PR c++/79228 - extensions hide C++14 complex literal operators
3456         * expr.c (interpret_float_suffix): Ignore 'i' in C++14 and up.
3457         (interpret_int_suffix): Likewise.
3459 2017-11-28  David Malcolm  <dmalcolm@redhat.com>
3461         PR c/82050
3462         * include/line-map.h (LINE_MAP_MAX_COLUMN_NUMBER): Move here.
3463         * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): ...from here.
3464         (rich_location::maybe_add_fixit): Reject fix-it hints in which
3465         the start column exceeds the next column.
3467 2017-11-20  Eric Gallager  <egall@gwmail.gwu.edu>
3469         PR preprocessor/81794
3470         * macro.c (check_trad_stringification): Have warning be controlled
3471         by -Wtraditional.
3473 2017-11-20  David Malcolm  <dmalcolm@redhat.com>
3475         PR c++/72786
3476         * include/cpplib.h (cpp_macro_definition_location): New decl.
3477         * macro.c (cpp_macro_definition): New function.
3479 2017-11-13  Tom Tromey  <tom@tromey.com>
3481         * pch.c (cpp_read_state): Set n__VA_OPT__.
3482         * macro.c (vaopt_state): New class.
3483         (_cpp_arguments_ok): Check va_opt flag.
3484         (replace_args, create_iso_definition): Use vaopt_state.
3485         * lex.c (lex_identifier_intern): Possibly issue errors for
3486         __VA_OPT__.
3487         (lex_identifier): Likewise.
3488         (maybe_va_opt_error): New function.
3489         * internal.h (struct lexer_state) <va_args_ok>: Update comment.
3490         (struct spec_nodes) <n__VA_OPT__>: New field.
3491         * init.c (struct lang_flags) <va_opt>: New field.
3492         (lang_defaults): Add entries for C++2A.  Update all entries for
3493         va_opt.
3494         (cpp_set_lang): Initialize va_opt.
3495         * include/cpplib.h (struct cpp_options) <va_opt>: New field.
3496         * identifiers.c (_cpp_init_hashtable): Initialize n__VA_OPT__.
3498 2017-11-13  David Malcolm  <dmalcolm@redhat.com>
3500         * include/line-map.h (linenum_type): Move this typedef and the
3501         comment describing column numbering to near the top of the file.
3503 2017-11-06  Mukesh Kapoor  <mukesh.kapoor@oracle.com>
3505         PR c++/80955
3506         * lex.c (lex_string): When checking for a valid macro for the
3507         warning related to -Wliteral-suffix (CPP_W_LITERAL_SUFFIX),
3508         check that the macro name does not start with an underscore
3509         before calling is_macro().
3511 2017-11-05  Tom de Vries  <tom@codesourcery.com>
3513         PR other/82784
3514         * lex.c (BUF_APPEND): Remove semicolon after
3515         "do {} while (0)".
3517 2017-10-31  David Malcolm  <dmalcolm@redhat.com>
3519         * directives.c (_cpp_handle_directive): Update for renaming of
3520         cpp_error_at_richloc to cpp_error_at.
3521         * errors.c (cpp_diagnostic_at_richloc): Rename to...
3522         (cpp_diagnostic_at): ...this, dropping the location_t-based
3523         implementation.
3524         (cpp_diagnostic): Update for removal of location_t-based
3525         cpp_diagnostic_at.
3526         (cpp_error_at): Likewise.
3527         (cpp_error_at_richloc): Rename to...
3528         (cpp_error_at): ...this, and update for renaming of
3529         cpp_diagnostic_at_richloc.
3530         * include/cpplib.h (cpp_error_at_richloc): Rename to...
3531         (cpp_error_at): ...this.
3533 2017-10-30  Joseph Myers  <joseph@codesourcery.com>
3535         * include/cpplib.h (enum c_lang): Add CLK_GNUC17 and CLK_STDC17.
3536         * init.c (lang_defaults): Add GNUC17 and STDC17 data.
3537         (cpp_init_builtins): Handle C17 value of __STDC_VERSION__.
3539 2017-10-10  Nathan Sidwell  <nathan@acm.org>
3541         PR preprocessor/82506
3542         * macro.c (cpp_quote_string): Escape raw LFs.
3544 2017-09-15  Andrew Sutton  <andrew.n.sutton@gmail.com>
3545             Jakub Jelinek  <jakub@redhat.com>
3547         Add support for -std=c++2a.
3548         * include/cpplib.h (c_lang): Add CXX2A and GNUCXX2A.
3549         * init.c (lang_defaults): Add rows for CXX2A and GNUCXX2A.
3550         (cpp_init_builtins): Set __cplusplus to 201709L for C++2a.
3552 2017-09-15  Jakub Jelinek  <jakub@redhat.com>
3554         * include/cpplib.h (enum c_lang): Rename CLK_GNUCXX1Z
3555         to CLK_GNUCXX17 and CLK_CXX1Z to CLK_CXX17.
3556         * init.c (lang_defaults, cpp_init_builtins): Likewise.
3557         * expr.c (cpp_classify_number): Use C++17 instead of C++1z
3558         in diagnostics.
3560 2017-07-07  David Malcolm  <dmalcolm@redhat.com>
3562         PR c++/79300
3563         * line-map.c (linemap_macro_loc_to_def_point): Preserve range
3564         information for macro expansions by delaying resolving ad-hoc
3565         locations until within the loop.
3567 2017-07-06  David Malcolm  <dmalcolm@redhat.com>
3569         PR c++/79300
3570         * include/line-map.h (enum location_aspect): New enum.
3571         (linemap_client_expand_location_to_spelling_point): Add
3572         enum location_aspect param.
3573         * line-map.c (rich_location::get_expanded_location): Update for
3574         new param of linemap_client_expand_location_to_spelling_point.
3575         (rich_location::maybe_add_fixit): Likewise.
3576         (fixit_hint::affects_line_p): Likewise.
3578 2017-06-21  Jakub Jelinek  <jakub@redhat.com>
3580         * line-map.c (location_adhoc_data_update): Perform addition in
3581         uintptr_t type rather than char * type.  Read *data using
3582         ptrdiff_t type instead of int64_t.
3583         (get_combined_adhoc_loc): Change offset type to ptrdiff_t from
3584         int64_t.
3586 2017-06-20  David Malcolm  <dmalcolm@redhat.com>
3588         * include/line-map.h (class rich_location): Document that attempts
3589         to delete or replace a range *affecting* multiple lines will fail.
3590         * line-map.c (rich_location::maybe_add_fixit): Implement this
3591         restriction.
3593 2017-06-09  David Malcolm  <dmalcolm@redhat.com>
3595         * include/line-map.h
3596         (rich_location::fixits_cannot_be_auto_applied): New method.
3597         (rich_location::fixits_can_be_auto_applied_p): New accessor.
3598         (rich_location::m_fixits_cannot_be_auto_applied): New field.
3599         * line-map.c (rich_location::rich_location): Initialize new field.
3601 2017-06-05  David Malcolm  <dmalcolm@redhat.com>
3603         * include/cpplib.h (struct cpp_callbacks): Add "comment"
3604         callback.
3605         * lex.c (_cpp_lex_direct): Call the comment callback if non-NULL.
3607 2017-05-02  David Malcolm  <dmalcolm@redhat.com>
3609         * include/line-map.h (class rich_location): Update description of
3610         newline handling.
3611         (class fixit_hint): Likewise.
3612         (fixit_hint::ends_with_newline_p): New decl.
3613         * line-map.c (rich_location::maybe_add_fixit): Support newlines
3614         in fix-it hints that are insertions of single lines at the start
3615         of a line.  Don't consolidate into such fix-it hints.
3616         (fixit_hint::ends_with_newline_p): New method.
3618 2017-05-01  David Malcolm  <dmalcolm@redhat.com>
3620         * include/line-map.h (source_range::intersects_line_p): Delete.
3621         (rich_location::add_fixit): Delete.
3622         (rich_location::maybe_add_fixit): New method.
3623         (class fixit_hint): Reimplement in terms of...
3624         (class fixit_replace): ...this.
3625         (class fixit_insert): Delete.
3626         * line-map.c (linemap_position_for_loc_and_offset): Drop overzealous
3627         linemap_assert_fails.
3628         (source_range::intersects_line_p): Rename to...
3629         (fixit_hint::affects_line_p): New function.
3630         (rich_location::add_fixit_insert_before): Reimplement in terms of
3631         maybe_add_fixit, moving validation there.
3632         (rich_location::add_fixit_insert_after): Likewise.
3633         (column_before_p): Delete.
3634         (rich_location::add_fixit_replace): Reimplement in terms of
3635         maybe_add_fixit, moving validation there.  Convert closed input range
3636         to half-open range.
3637         (rich_location::add_fixit): Delete.
3638         (rich_location::maybe_add_fixit): New function.
3639         (fixit_insert::fixit_insert): Delete.
3640         (fixit_insert::~fixit_insert): Delete.
3641         (fixit_insert::affects_line_p): Delete.
3642         (fixit_insert::maybe_append_replace): Delete.
3643         (fixit_replace::fixit_replace): Rename to...
3644         (fixit_hint::fixit_hint): ...this, rewriting as necessary.
3645         (fixit_replace::~fixit_replace): Delete.
3646         (fixit_replace::affects_line_p): Delete.
3647         (fixit_replace::maybe_append_replace): Rename to...
3648         (fixit_hint::maybe_append): ...this, rewriting as necessary.
3650 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
3652         * include/line-map.h (LINEMAPS_MACRO_MAPS): Fix typo in comment.
3653         * lex.c (search_line_fast): Likewise.
3654         * pch.h (cpp_valid_state): Likewise.
3656 2017-03-21  Andreas Schwab  <schwab@suse.de>
3658         * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]:
3659         Convert 64-bit value to boolean before passing to
3660         __builtin_expect.
3662 2017-03-16  Jason Merrill  <jason@redhat.com>
3664         * init.c (cpp_init_builtins): Update __cplusplus for C++17.
3666 2017-02-09  Gerald Pfeifer  <gerald@pfeifer.com>
3668         * Makefile.in (po/$(PACKAGE).pot): Adjust bug reporting URL.
3670 2017-01-10  David Malcolm  <dmalcolm@redhat.com>
3672         PR c++/77949
3673         * line-map.c (linemap_position_for_column): When calling
3674         linemap_start_line, detect if a new linemap was created with
3675         0 column bits, and bail out early if this is the case.
3676         (linemap_position_for_loc_and_offset): Replace overzealous
3677         linemap_assert_fails with a simple conditional; use correct
3678         bit count.
3680 2017-01-07  David Malcolm  <dmalcolm@redhat.com>
3682         PR c++/72803
3683         * line-map.c (linemap_line_start): When determining if the highest
3684         column given out so far will fit into a proposed change to the
3685         current map, use the effective number of column bits, rather than
3686         the total number of column + range bits.
3688 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
3690         Update copyright years.
3692 2016-12-15  David Malcolm  <dmalcolm@redhat.com>
3694         PR preprocessor/78680
3695         PR preprocessor/78811
3696         * lex.c (_cpp_lex_direct): Only determine the end-location of
3697         the token and build a range for non-reserved start locations.
3698         Do not do it for EOF tokens.
3700 2016-12-12  David Malcolm  <dmalcolm@redhat.com>
3702         PR preprocessor/78680
3703         * lex.c (_cpp_lex_direct): Ensure line notes are processed before
3704         computing the end-point of the token.
3706 2016-11-23  Paolo Bonzini  <bonzini@gnu.org>
3708         * include/cpplib.h (struct cpp_options): Add new member
3709         warn_expansion_to_defined.
3710         (CPP_W_EXPANSION_TO_DEFINED): New enum member.
3711         * expr.c (parse_defined): Warn for all uses of "defined"
3712         in macros, and tie warning to CPP_W_EXPANSION_TO_DEFINED.
3713         Make it a pedwarning instead of a warning.
3714         * system.h (HAVE_DESIGNATED_INITIALIZERS): Do not use
3715         "defined" in macros.
3717 2016-11-17  David Malcolm  <dmalcolm@redhat.com>
3719         * charset.c (cpp_interpret_string_1): Skip locations from
3720         loc_reader when advancing 'p' when handling raw strings.
3722 2016-11-16  Jakub Jelinek  <jakub@redhat.com>
3724         PR bootstrap/72823
3725         * configure.ac (ENABLE_ASSERT_CHECKING): Define if gcc configure
3726         would define that macro.
3727         * configure: Regenerated.
3728         * config.in: Regenerated.
3730 2016-11-08  Richard Earnshaw  <rearnsha@arm.com>
3732         * lex.c (search_line_fast): New implementation for AArch64.
3734 2016-10-25  David Malcolm  <dmalcolm@redhat.com>
3736         * files.c (destroy_cpp_file): Free file->path.
3738 2016-10-25  David Malcolm  <dmalcolm@redhat.com>
3740         * include/line-map.h (line_maps::~line_maps): New dtor.
3741         (location_adhoc_data_fini): Delete decl.
3742         * line-map.c (line_maps::~line_maps): New dtor.
3743         (location_adhoc_data_fini): Delete.
3745 2016-10-21  Andris Pavenis  <andris.pavenis@iki.fi>
3747         PR preprocessor/71681
3748         * files.c (remap_filename): Fix handling -remap in subdirectories.
3750 2016-10-12  Jakub Jelinek  <jakub@redhat.com>
3752         * include/cpplib.h (struct cpp_options): Add
3753         cpp_warn_implicit_fallthrough.
3754         * init.c (cpp_create_reader): Initialize it to 0.
3755         * lex.c (fallthrough_comment_p): Handle different
3756         cpp_warn_implicit_fallthrough levels.  Whitespace fixes.
3758 2016-10-08  Jakub Jelinek  <jakub@redhat.com>
3760         * lex.c (fallthrough_comment_p): Accept Else, fallthrough.
3762         * lex.c (fallthrough_comment_p): Extend to handle more common FALLTHRU
3763         comment styles.
3765         * lex.c (fallthrough_comment_p): Fix off-by-one size comparison
3766         errors, cleanup.
3767         (_cpp_lex_direct): Allow arbitrary comments in between
3768         fallthrough_comment_p comment and following token.
3770 2016-10-04  Kelvin Nilsen  <kelvin@gcc.gnu.org>
3772         PR target/77847
3773         * lex.c (search_line_fast): Add a FALLTHROUGH comment to correct
3774         compiler error in the version of this function that is
3775         conditionally compiled when GCC_VERSION >= 4005 and both
3776         __ALTIVEC__ and __BIG_ENDIAN__ symbols are defined.
3778 2016-09-26  Marek Polacek  <polacek@redhat.com>
3779             Jakub Jelinek  <jakub@redhat.com>
3781         PR c/7652
3782         * include/cpplib.h (PREV_FALLTHROUGH): Define.
3783         * internal.h (CPP_FALLTHRU): Define.
3784         * lex.c (fallthrough_comment_p): New function.
3785         (_cpp_lex_direct): Set PREV_FALLTHROUGH on tokens succeeding a falls
3786         through comment.
3788 2016-09-23  David Malcolm  <dmalcolm@redhat.com>
3790         PR preprocessor/77672
3791         * charset.c (cpp_interpret_string_1): Add a source_range for the
3792         NUL-terminator, using the location of the trailing quote of the
3793         final string.
3795 2016-09-21  Jason Merrill  <jason@redhat.com>
3797         * line-map.c (linemap_location_from_macro_definition_p): New.
3798         * line-map.h: Declare it.
3800 2016-09-15  David Malcolm  <dmalcolm@redhat.com>
3802         * include/line-map.h (class rich_location): Note that newlines
3803         aren't supported in fix-it text.
3804         * line-map.c (rich_location::add_fixit_insert_before): Reject
3805         attempts to add fix-its containing newlines.
3806         (rich_location::add_fixit_replace): Likewise.
3808 2016-09-13  David Malcolm  <dmalcolm@redhat.com>
3810         * include/line-map.h (class rich_location): Add description of
3811         fix-it hints to leading comment.
3812         (rich_location::add_fixit_insert): Rename both overloaded methods
3813         to..
3814         (rich_location::add_fixit_insert_before): ...this, updating their
3815         comments.
3816         (rich_location::add_fixit_insert_after): Two new overloaded
3817         methods.
3818         (rich_location::stop_supporting_fixits): New method.
3819         * line-map.c (rich_location::add_fixit_insert): Rename both
3820         overloaded methods to..
3821         (rich_location::add_fixit_insert_before): ...this, updating their
3822         comments.
3823         (rich_location::add_fixit_insert_after): Two new methods.
3824         (rich_location::reject_impossible_fixit): Split out
3825         failure-handling into...
3826         (rich_location::stop_supporting_fixits): New method.
3828 2016-09-02  David Malcolm  <dmalcolm@redhat.com>
3830         * include/line-map.h (rich_location::seen_impossible_fixit_p): New
3831         accessor.
3833 2016-08-31  David Malcolm  <dmalcolm@redhat.com>
3835         * include/line-map.h (class fixit_remove): Remove stray decl.
3836         (fixit_hint::affects_line_p): Make const.
3837         (fixit_insert::affects_line_p): Likewise.
3838         (fixit_replace::affects_line_p): Likewise.
3839         * line-map.c (fixit_insert::affects_line_p): Likewise.
3840         (fixit_replace::affects_line_p): Likewise.
3842 2016-08-30  David Malcolm  <dmalcolm@redhat.com>
3844         * include/line-map.h (class semi_embedded_vec): New class.
3845         (semi_embedded_vec<T, NUM_EMBEDDED>::semi_embedded_vec): New ctor.
3846         (semi_embedded_vec<T, NUM_EMBEDDED>::~semi_embedded_vec): New
3847         dtor.
3848         (semi_embedded_vec<T, NUM_EMBEDDED>::operator[]): New methods.
3849         (semi_embedded_vec<T, NUM_EMBEDDED>::push): New method.
3850         (semi_embedded_vec<T, NUM_EMBEDDED>::truncate): New method.
3851         (rich_location::get_num_locations): Reimplement in terms of
3852         m_ranges.
3853         (rich_location::get_range): Make non-inline.
3854         (rich_location::get_num_fixit_hints): Reimplement in terms of
3855         m_fixit_hints.
3856         (rich_location::add_fixit): New function.
3857         (rich_location::MAX_RANGES): Rename to...
3858         (rich_location::STATICALLY_ALLOCATED_RANGES): ...this.
3859         (rich_location::MAX_FIXIT_HINTS): Rename to...
3860         (rich_location::STATICALLY_ALLOCATED_RANGES): ...this, and make
3861         private.
3862         (rich_location::m_num_ranges): Eliminate in favor of...
3863         (rich_location::m_ranges): ...this, converting from a fixed-size
3864         array to a semi_embedded_vec.
3865         (rich_location::m_num_fixit_hints): Eliminate in favor of...
3866         (rich_location::m_fixit_hints): ...this, converting from a
3867         fixed-size array to a semi_embedded_vec.
3868         * line-map.c (rich_location::rich_location): Update for above
3869         changes.
3870         (rich_location::~rich_location): Likewise.
3871         (rich_location::get_loc): Likewise.
3872         (rich_location::get_range): New methods.
3873         (rich_location::add_range): Update for above changes.
3874         (rich_location::set_range): Likewise.
3875         (rich_location::add_fixit_insert): Likewise.
3876         (rich_location::add_fixit_replace): Likewise.
3877         (rich_location::get_last_fixit_hint): Likewise.
3878         (rich_location::reject_impossible_fixit): Likewise.
3879         (rich_location::add_fixit): New method.
3881 2016-08-30  David Malcolm  <dmalcolm@redhat.com>
3883         * include/line-map.h (rich_location::add_fixit_insert): Add
3884         comments.  Add overload omitting the source_location param.
3885         (rich_location::add_fixit_remove): Add comments.  Add overloads
3886         omitting the range, and accepting a source_location.
3887         (rich_location::add_fixit_replace): Likewise.
3888         * line-map.c (rich_location::add_fixit_insert): Add comments.  Add
3889         overload omitting the source_location param.
3890         (rich_location::add_fixit_remove): Add comments.  Add overloads
3891         omitting the range, and accepting a source_location.
3892         (rich_location::add_fixit_replace): Likewise.
3894 2016-08-26  David Malcolm  <dmalcolm@redhat.com>
3896         * include/line-map.h (get_pure_location): New decl.
3897         * line-map.c (get_pure_location): Move here, from gcc/input.c, adding
3898         a line_maps * param.
3899         (rich_location::add_fixit_insert): Call get_pure_location on "where".
3900         (rich_location::add_fixit_replace): Call get_pure_location on the
3901         end-points.
3903 2016-08-26  David Malcolm  <dmalcolm@redhat.com>
3905         * include/line-map.h (rich_location): Eliminate unimplemented
3906         constructor based on source_range.
3907         (rich_location::get_last_fixit_hint): New method.
3908         (rich_location::reject_impossible_fixit): New method.
3909         (rich_location): Add fields m_line_table and
3910         m_seen_impossible_fixit.
3911         (fixit_hint::maybe_append_replace): New pure virtual function.
3912         (fixit_insert::maybe_append_replace): New function.
3913         (fixit_replace::maybe_append_replace): New function.
3914         * line-map.c (rich_location::rich_location): Initialize
3915         m_line_table and m_seen_impossible_fixit.
3916         (rich_location::add_fixit_insert): Call
3917         reject_impossible_fixit and bail out if true.
3918         (column_before_p): New function.
3919         (rich_location::add_fixit_replace): Call reject_impossible_fixit
3920         and bail out if true.  Attempt to consolidate with neighboring
3921         fixits.
3922         (rich_location::get_last_fixit_hint): New method.
3923         (rich_location::reject_impossible_fixit): New method.
3924         (fixit_insert::maybe_append_replace): New method.
3925         (fixit_replace::maybe_append_replace): New method.
3927 2016-08-23  David Malcolm  <dmalcolm@redhat.com>
3929         * include/line-map.h (source_range::from_locations): New method.
3931 2016-08-19  David Malcolm  <dmalcolm@redhat.com>
3933         * include/line-map.h (fixit_hint::kind): Delete REPLACE.
3934         (class fixit_remove): Delete.
3935         * line-map.c (rich_location::add_fixit_remove): Reimplement
3936         by calling add_fixit_replace with an empty string.
3937         (fixit_remove::fixit_remove): Delete.
3938         (fixit_remove::affects_line_p): Delete.
3940 2016-08-19  Joseph Myers  <joseph@codesourcery.com>
3942         PR c/32187
3943         * include/cpplib.h (CPP_N_FLOATN, CPP_N_FLOATNX)
3944         (CPP_N_WIDTH_FLOATN_NX, CPP_FLOATN_SHIFT, CPP_FLOATN_MAX): New
3945         macros.
3946         * expr.c (interpret_float_suffix): Handle fN, fNx, FN and FNx
3947         suffixes.
3949 2016-08-19  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
3951         * expr.c (eval_token): Append "evaluates to 0" to Wundef diagnostic.
3953 2016-08-18  David Malcolm  <dmalcolm@redhat.com>
3955         * directives.c (directive_names): New array.
3956         (_cpp_handle_directive): Offer spelling suggestions for misspelled
3957         directives.
3958         * errors.c (cpp_diagnostic_at_richloc): New function.
3959         (cpp_error_at_richloc): New function.
3960         * include/cpplib.h (struct cpp_callbacks): Add field
3961         "get_suggestion".
3962         (cpp_error_at_richloc): New decl.
3964 2016-08-18  Marek Polacek  <polacek@redhat.com>
3966         PR c/7652
3967         * pch.c (write_macdef): Add CPP_FALLTHRU.
3969 2016-08-12  Marek Polacek  <polacek@redhat.com>
3971         PR c/7652
3972         * lex.c (search_line_fast): Add FALLTHRU.
3973         (_cpp_lex_direct): Likewise.
3974         (cpp_token_val_index): Adjust fall through comment.
3975         * macro.c (parse_params): Add FALLTHRU.
3976         * pch.c (count_defs): Adjust fall through comment.
3977         (write_defs): Likewise.
3979 2016-08-06  David Malcolm  <dmalcolm@redhat.com>
3981         PR bootstrap/72823
3982         * charset.c (_cpp_valid_ucn): Replace overzealous assert with one
3983         that allows for char_range to be non-NULL when loc_reader is NULL.
3985 2016-08-05  David Malcolm  <dmalcolm@redhat.com>
3987         * charset.c (cpp_substring_ranges::cpp_substring_ranges): New
3988         constructor.
3989         (cpp_substring_ranges::~cpp_substring_ranges): New destructor.
3990         (cpp_substring_ranges::add_range): New method.
3991         (cpp_substring_ranges::add_n_ranges): New method.
3992         (_cpp_valid_ucn): Add "char_range" and "loc_reader" params; if
3993         they are non-NULL, read position information from *loc_reader
3994         and update char_range->m_finish accordingly.
3995         (convert_ucn): Add "char_range", "loc_reader", and "ranges"
3996         params.  If loc_reader is non-NULL, read location information from
3997         it, and update *ranges accordingly, using char_range.
3998         Conditionalize the conversion into tbuf on tbuf being non-NULL.
3999         (convert_hex): Likewise, conditionalizing the call to
4000         emit_numeric_escape on tbuf.
4001         (convert_oct): Likewise.
4002         (convert_escape): Add params "loc_reader" and "ranges".  If
4003         loc_reader is non-NULL, read location information from it, and
4004         update *ranges accordingly.  Conditionalize the conversion into
4005         tbuf on tbuf being non-NULL.
4006         (cpp_interpret_string): Rename to...
4007         (cpp_interpret_string_1): ...this, adding params "loc_readers" and
4008         "out".  Use "to" to conditionalize the initialization and usage of
4009         "tbuf", such as running the converter.  If "loc_readers" is
4010         non-NULL, use the instances within it, reading location
4011         information from them, and passing them to convert_escape; likewise
4012         write to "out" if loc_readers is non-NULL.  Check for leading
4013         quote and issue an error if it is not present.  Update boundary
4014         check from "== limit" to ">= limit" to protect against erroneous
4015         location values to calls that are not parsing string literals.
4016         (cpp_interpret_string): Reimplement in terms to
4017         cpp_interpret_string_1.
4018         (noop_error_cb): New function.
4019         (cpp_interpret_string_ranges): New function.
4020         (cpp_string_location_reader::cpp_string_location_reader): New
4021         constructor.
4022         (cpp_string_location_reader::get_next): New method.
4023         * include/cpplib.h (class cpp_string_location_reader): New class.
4024         (class cpp_substring_ranges): New class.
4025         (cpp_interpret_string_ranges): New prototype.
4026         * internal.h (_cpp_valid_ucn): Add params "char_range" and
4027         "loc_reader".
4028         * lex.c (forms_identifier_p): Pass NULL for new params to
4029         _cpp_valid_ucn.
4031 2016-08-01  Andreas Schwab  <schwab@suse.de>
4033         * include/cpplib.h: Fix comment typo.
4035 2016-07-27  David Malcolm  <dmalcolm@redhat.com>
4037         * include/line-map.h (source_location): Fix line numbers in
4038         comment.
4040 2016-07-11  David Malcolm  <dmalcolm@redhat.com>
4042         * include/line-map.h (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES):
4043         Move here from line-map.c.
4044         (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
4045         * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): Move from
4046         here to line-map.h.
4047         (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
4049 2016-06-22  David Malcolm  <dmalcolm@redhat.com>
4051         * directives.c (do_include_common): Pass on "location" to
4052         _cpp_stack_include.
4053         * errors.c (cpp_diagnostic): Reimplement in terms of...
4054         (cpp_diagnostic_at): New function.
4055         (cpp_error_at): New function.
4056         (cpp_errno_filename): Add "loc" param and use it by using
4057         cpp_error_at rather than cpp_error.
4058         * files.c (find_file_in_dir): Add "loc" param and pass it to
4059         open_file_failed.
4060         (_cpp_find_file): Add "loc" param.  Use it to convert calls to
4061         cpp_error to cpp_error_at, and pass it to find_file_in_dir and
4062         open_file_failed.
4063         (read_file_guts): Add "loc" param.  Use it to convert calls to
4064         cpp_error to cpp_error_at.  Pass it to cpp_errno_filename.
4065         (read_file): Add "loc" param.  Pass it to open_file_failed and
4066         read_file_guts.
4067         (should_stack_file): Add "loc" param.  Pass it to read_file.
4068         (_cpp_stack_file): Add "loc" param.  Pass it to should_stack_file.
4069         (_cpp_stack_include): Add "loc" param.  Pass it to
4070         _cpp_find_file and _cpp_stack_file.
4071         (open_file_failed): Add "loc" param.  Pass it to
4072         cpp_errno_filename.
4073         (_cpp_fake_include): Add 0 as a source_location in call to
4074         _cpp_find_file.
4075         (_cpp_compare_file_date): Likewise.
4076         (cpp_push_include): Likewise for call to _cpp_stack_include.
4077         (cpp_push_default_include): Likewise.
4078         (_cpp_save_file_entries): Likewise for call to open_file_failed.
4079         (_cpp_has_header): Likewise for call to _cpp_find_file.
4080         * include/cpplib.h (cpp_errno_filename): Add source_location
4081         param.
4082         (cpp_error_at): New declaration.
4083         * init.c (cpp_read_main_file): Add 0 as a source_location in calls
4084         to _cpp_find_file and _cpp_stack_file.
4085         * internal.h (_cpp_find_file): Add source_location param.
4086         (_cpp_stack_file): Likewise.
4087         (_cpp_stack_include): Likewise.
4089 2016-06-22  David Malcolm  <dmalcolm@redhat.com>
4091         * include/line-map.h (fixit_hint::get_start_loc): New pure virtual
4092         function.
4093         (fixit_hint::maybe_get_end_loc): Likewise.
4094         (fixit_insert::get_start_loc): New function, implementing
4095         fixit_hint::get_start_loc.
4096         (fixit_insert::maybe_get_end_loc): New function, implementing
4097         fixit_hint::maybe_get_end_loc.
4098         (fixit_remove::get_start_loc): New function, implementing
4099         fixit_hint::get_start_loc.
4100         (fixit_remove::maybe_get_end_loc): New function, implementing
4101         fixit_hint::maybe_get_end_loc.
4102         (fixit_replace::get_start_loc): New function, implementing
4103         fixit_hint::get_start_loc.
4104         (fixit_replace::maybe_get_end_loc): New function, implementing
4105         fixit_hint::maybe_get_end_loc.
4107 2016-06-21  John David Anglin  <danglin@gcc.gnu.org>
4109         * line-map.c (location_adhoc_data_update): Use int64_t instead of
4110         long long.
4111         (get_combined_adhoc_loc): Likewise.
4113 2016-06-01  Eduard Sanou  <dhole@openmailbox.org>
4115         * include/cpplib.h (cpp_callbacks): Add get_source_date_epoch
4116         callback.
4117         * include/cpplib.h (cpp_init_source_date_epoch): Remove prototype.
4118         * init.c (cpp_init_source_date_epoch): Remove function.
4119         * init.c (cpp_create_reader): Initialize pfile->source_date_epoch.
4120         * internal.h (cpp_reader): Extend comment about source_date_epoch.
4121         * macro.c (_cpp_builtin_macro_text): Use get_source_date_epoch
4122         callback only once, read pfile->source_date_epoch on future passes.
4123         Check that get_source_date_epoch callback is not NULL.
4125 2016-05-20  Martin Liska  <mliska@suse.cz>
4127         * config.in: Regenerated.
4128         * configure: Likewise.
4129         * configure.ac: Handle --enable-valgrind-annotations.
4130         * lex.c (new_buff): Use ENABLE_VALGRIND_ANNOTATIONS instead
4131         of ENABLE_VALGRIND_CHECKING.
4132         (_cpp_free_buff): Likewise.
4134 2016-04-28  Eduard Sanou  <dhole@openmailbox.org>
4135             Matthias Klose  <doko@debian.org>
4137         * include/cpplib.h (cpp_init_source_date_epoch): Prototype.
4138         * init.c (cpp_init_source_date_epoch): New function.
4139         * internal.h: Added source_date_epoch variable to struct
4140         cpp_reader to store a reproducible date.
4141         * macro.c (_cpp_builtin_macro_text): Set pfile->date timestamp from
4142         pfile->source_date_epoch instead of localtime if source_date_epoch is
4143         set, to be used for __DATE__ and __TIME__ macros to help reproducible
4144         builds.
4146 2016-04-13  Bernd Schmidt  <bschmidt@redhat.com>
4148         Patch from Roger Orr <rogero@howzatt.demon.co.uk>
4149         PR preprocessor/69650
4150         * directives.c (do_linemarker): Reread map after calling
4151         cpp_get_token.
4153 2016-04-06  Richard Henderson  <rth@redhat.com>
4155         PR preprocessor/61817
4156         PR preprocessor/69391
4157         * internal.h (_cpp_builtin_macro_text): Update decl.
4158         * macro.c (_cpp_builtin_macro_text): Accept location for __LINE__.
4159         (builtin_macro): Accept a second location for __LINE__.
4160         (enter_macro_context): Compute both virtual and real expansion
4161         locations for the macro.
4163 2016-03-25  Bernd Schmidt  <bschmidt@redhat.com>
4165         PR lto/69650
4166         * directives.c (do_linemarker): Test for file left but not entered
4167         here.
4168         * line-map.c (linemap_add): Not here.
4170 2016-03-21  Jakub Jelinek  <jakub@redhat.com>
4172         PR target/70296
4173         * include/cpplib.h (cpp_fun_like_macro_p): New prototype.
4174         * macro.c (cpp_fun_like_macro_p): New function.
4176 2016-03-15  Richard Henderson  <rth@redhat.com>
4178         * line-map.c (new_linemap): Make alloc_size a size_t.
4180 2016-03-14  Jason Merrill  <jason@redhat.com>
4182         * expr.c (cpp_classify_number): Hex floats are new in C++1z.
4183         * init.c (lang_defaults): Likewise.
4185 2016-03-09  David Malcolm  <dmalcolm@redhat.com>
4187         PR c/68473
4188         PR c++/70105
4189         * line-map.c (linemap_macro_map_loc_unwind_toward_spelling): Move
4190         decl...
4191         * include/line-map.h
4192         (linemap_macro_map_loc_unwind_toward_spelling): ...here,
4193         converting from static to extern.
4195 2016-03-09  David Malcolm  <dmalcolm@redhat.com>
4197         PR c/68473
4198         PR c++/70105
4199         * include/line-map.h (source_range::debug): Delete.
4200         (struct location_range): Update comment.  Replace
4201         expanded_location fields "m_start", "m_finish", and "m_caret" with
4202         a source_location field: "m_loc".
4203         (class rich_location): Reword comment.
4204         (rich_location::get_loc): Reimplement in terms of a new overloaded
4205         variant which takes an unsigned int.
4206         (rich_location::get_loc_addr): Delete.
4207         (rich_location::add_range): Drop params "start" and "finish" in
4208         favor of param "loc".  Drop overloaded variants taking a
4209         source_range or location_range *.
4210         (rich_location::lazily_expand_location): Delete in favor of...
4211         (rich_location::get_expanded_location): New decl.
4212         (rich_location::m_loc): Delete field.
4213         (rich_location::m_column_override): New field.
4214         * line-map.c (rich_location::rich_location):  Drop name of
4215         line_maps * param.  Update initializations for deletion of field
4216         "m_loc" and addition of field "m_column_override".  Reimplement
4217         body as a call to add_range.  Delete overloaded variant taking a
4218         source_range.
4219         (rich_location::get_loc): New function.
4220         (rich_location::lazily_expand_location): Delete in favor of...
4221         (rich_location::get_expanded_location): New function.
4222         (rich_location::override_column): Reimplement.
4223         (rich_location::add_range): Drop params "start" and "finish" in
4224         favor of param "loc".  Eliminate location expansion in favor of
4225         simply storing loc.  Drop overloaded variants taking a
4226         source_range or location_range *.
4227         (rich_location::set_range): Eliminate location expansion.
4229 2016-02-29  David Malcolm  <dmalcolm@redhat.com>
4231         PR preprocessor/69985
4232         (linemap_position_for_loc_and_offset): Rename param from "offset"
4233         to "column_offset".  Right-shift the column_offset by m_range_bits
4234         of the pertinent ordinary map whenever offsetting a
4235         source_location.  For clarity, offset the column by the column
4236         offset, rather than the other way around.
4238 2016-02-23  David Malcolm  <dmalcolm@redhat.com>
4240         PR preprocessor/69126
4241         PR preprocessor/69543
4242         * line-map.c (linemap_compare_locations): At the function top,
4243         replace inlined bodies of get_location_from_adhoc_loc with calls
4244         to get_location_from_adhoc_loc.  Add a pair of calls to
4245         get_location_from_adhoc_loc at the bottom of the function, to
4246         avoid meaningless comparisons of ad-hoc and non-ad-hoc locations.
4248 2016-02-08  David Malcolm  <dmalcolm@redhat.com>
4250         PR preprocessor/69664
4251         * errors.c (cpp_diagnostic_with_line): Only call
4252         rich_location::override_column if the column is non-zero.
4253         * line-map.c (rich_location::override_column): Update columns
4254         within m_ranges[0].  Add assertions to verify that doing so is
4255         sane.
4257 2016-02-05  Jakub Jelinek  <jakub@redhat.com>
4259         PR c++/69628
4260         * charset.c (cpp_interpret_charconst): Clear *PCHARS_SEEN
4261         and *UNSIGNEDP if bailing out early due to errors.
4263 2016-01-28  Jakub Jelinek  <jakub@redhat.com>
4265         PR pch/68176
4266         * files.c (_cpp_find_file): Set file->implicit_preinclude even if
4267         included from file->implicit_preinclude header.
4269         * directives.c (destringize_and_run): Adjust prototype.
4271 2016-01-27  David Malcolm  <dmalcolm@redhat.com>
4273         PR preprocessor/69126
4274         * directives.c (destringize_and_run): Add expansion_loc param; use
4275         it when handling unexpanded pragmas to fixup the locations of the
4276         synthesized tokens.
4277         (_cpp_do__Pragma): Add expansion_loc param and use it when calling
4278         destringize_and_run.
4279         * internal.h (_cpp_do__Pragma): Add expansion_loc param.
4280         * macro.c (builtin_macro): Pass expansion location of _Pragma to
4281         _cpp_do__Pragma.
4283 2016-01-14  David Malcolm  <dmalcolm@redhat.com>
4285         PR preprocessor/69177
4286         * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): New
4287         constant.
4288         (LINE_MAP_MAX_LOCATION_WITH_COLS): Add note about unit tests
4289         to comment.
4290         (can_be_stored_compactly_p): Reduce threshold from
4291         LINE_MAP_MAX_LOCATION_WITH_COLS to
4292         LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES.
4293         (get_combined_adhoc_loc): Likewise.
4294         (get_range_from_loc): Likewise.
4295         (linemap_line_start): Ensure that a new ordinary map is created
4296         when transitioning from range-packing being enabled to disabled,
4297         at the LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES threshold.  Set
4298         range_bits to 0 for new ordinary maps when beyond this limit.
4299         Prevent the "increase the column bits of a freshly created map"
4300         optimization if the range bits has reduced.
4302 2016-01-08  Jakub Jelinek  <jakub@redhat.com>
4304         PR c++/69145
4305         * files.c (cpp_included_before): If IS_ADHOC_LOC (location), lookup
4306         real location from the line_table.
4308 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
4310         Update copyright years.
4312 2015-12-22  David Malcolm  <dmalcolm@redhat.com>
4314         * line-map.c (get_combined_adhoc_loc): Remove condition
4315         on locus < RESERVED_LOCATION_COUNT when considering
4316         whether a caret == start == finish location can be
4317         simply stored as the caret location.
4319 2015-12-07  David Malcolm  <dmalcolm@redhat.com>
4321         * include/line-map.h (rich_location::set_range): Add line_maps *
4322         param; convert param from source_range to source_location.  Drop
4323         "overwrite_loc_p" param.
4324         * line-map.c (rich_location::set_range): Likewise, acting as if
4325         "overwrite_loc_p" were true, and getting range from the location.
4327 2015-11-20  David Malcolm  <dmalcolm@redhat.com>
4329         PR 62314
4330         * include/line-map.h (source_range::intersects_line_p): New
4331         method.
4332         (rich_location::~rich_location): New.
4333         (rich_location::add_fixit_insert): New method.
4334         (rich_location::add_fixit_remove): New method.
4335         (rich_location::add_fixit_replace): New method.
4336         (rich_location::get_num_fixit_hints): New accessor.
4337         (rich_location::get_fixit_hint): New accessor.
4338         (rich_location::MAX_FIXIT_HINTS): New constant.
4339         (rich_location::m_num_fixit_hints): New field.
4340         (rich_location::m_fixit_hints): New field.
4341         (class fixit_hint): New class.
4342         (class fixit_insert): New class.
4343         (class fixit_remove): New class.
4344         (class fixit_replace): New class.
4345         * line-map.c (source_range::intersects_line_p): New method.
4346         (rich_location::rich_location): Add initialization of
4347         m_num_fixit_hints to both ctors.
4348         (rich_location::~rich_location): New.
4349         (rich_location::add_fixit_insert): New method.
4350         (rich_location::add_fixit_remove): New method.
4351         (rich_location::add_fixit_replace): New method.
4352         (fixit_insert::fixit_insert): New.
4353         (fixit_insert::~fixit_insert): New.
4354         (fixit_insert::affects_line_p): New.
4355         (fixit_remove::fixit_remove): New.
4356         (fixit_remove::affects_line_p): New.
4357         (fixit_replace::fixit_replace): New.
4358         (fixit_replace::~fixit_replace): New.
4359         (fixit_replace::affects_line_p): New.
4361 2015-11-19  Jakub Jelinek  <jakub@redhat.com>
4363         PR preprocessor/60736
4364         * include/cpplib.h (cpp_errno_filename): New prototype.
4365         * errors.c (cpp_errno): Don't handle msgid "" specially, use
4366         _(msgid) instead of msgid as argument to cpp_error.
4367         (cpp_errno_filename): New function.
4368         * files.c (read_file_guts): Use cpp_errno_filename instead of
4369         cpp_errno.
4370         (open_file_failed): Likewise.  Use file->name if file->path is NULL
4371         in diagnostics.
4373 2015-11-13  David Malcolm  <dmalcolm@redhat.com>
4375         * errors.c (cpp_diagnostic): Pass pfile->line_table to
4376         rich_location ctor.
4377         (cpp_diagnostic_with_line): Likewise.
4378         * include/cpplib.h (struct cpp_token): Update comment for src_loc
4379         to indicate that the range of the token is "baked into" the
4380         source_location.
4381         * include/line-map.h (source_location): Update the descriptive
4382         comment to reflect the packing scheme for short ranges, adding
4383         worked examples of location encoding.
4384         (struct line_map_ordinary): Drop field "column_bits" in favor
4385         of field "m_column_and_range_bits"; add field "m_range_bits".
4386         (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
4387         (location_adhoc_data): Add source_range field.
4388         (struct line_maps): Add fields "default_range_bits",
4389         "num_optimized_ranges" and "num_unoptimized_ranges".
4390         (get_combined_adhoc_loc): Add source_range param.
4391         (get_range_from_loc): New declaration.
4392         (pure_location_p): New prototype.
4393         (COMBINE_LOCATION_DATA):  Add source_range param.
4394         (SOURCE_LINE): Update for renaming of column_bits.
4395         (SOURCE_COLUMN): Likewise.  Shift the column right by the map's
4396         range_bits.
4397         (LAST_SOURCE_LINE_LOCATION): Update for renaming of column_bits.
4398         (linemap_position_for_line_and_column): Add line_maps * params.
4399         (rich_location::rich_location): Likewise.
4400         * lex.c (_cpp_lex_direct): Capture the range of the token, baking
4401         it into token->src_loc via a call to COMBINE_LOCATION_DATA.
4402         * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): Reduce from 1U << 17 to
4403         1U << 12.
4404         (location_adhoc_data_hash): Add the src_range into
4405         the hash value.
4406         (location_adhoc_data_eq): Require equality of the src_range
4407         values.
4408         (can_be_stored_compactly_p): New function.
4409         (get_combined_adhoc_loc): Add src_range param, and store it,
4410         via a bit-packing scheme for short ranges, otherwise within the
4411         lookaside table.  Remove the requirement that data is non-NULL.
4412         (get_range_from_adhoc_loc): New function.
4413         (get_range_from_loc): New function.
4414         (pure_location_p): New function.
4415         (linemap_add): Ensure that start_location has zero for the
4416         range_bits, unless we're past LINE_MAP_MAX_LOCATION_WITH_COLS.
4417         Initialize range_bits to zero.  Assert that the start_location
4418         is "pure".
4419         (linemap_line_start): Assert that the
4420         column_and_range_bits >= range_bits.
4421         Update determinination of whether we need to start a new map
4422         using the effective column bits, without the range bits.
4423         Use the set's default_range_bits in new maps, apart from
4424         those with column_bits == 0, which should also have 0 range_bits.
4425         Increase the column bits for new maps by the range bits.
4426         When adding lines to an existing map, use set->highest_line
4427         directly rather than offsetting highest by SOURCE_COLUMN.
4428         Add assertions to sanity-check the return value.
4429         (linemap_position_for_column): Offset to_column by range_bits.
4430         Update set->highest_location if necessary.
4431         (linemap_position_for_line_and_column): Add line_maps * param.
4432         Update the calculation to offset the column by range_bits, and
4433         conditionalize it on being <= LINE_MAP_MAX_LOCATION_WITH_COLS.
4434         Bound it by LINEMAPS_MACRO_LOWEST_LOCATION.  Update
4435         set->highest_location if necessary.
4436         (linemap_position_for_loc_and_offset): Handle ad-hoc locations;
4437         pass "set" to linemap_position_for_line_and_column.
4438         (linemap_macro_map_loc_unwind_toward_spelling): Add line_maps
4439         param.  Handle ad-hoc locations.
4440         (linemap_location_in_system_header_p): Pass on "set" to call to
4441         linemap_macro_map_loc_unwind_toward_spelling.
4442         (linemap_macro_loc_to_spelling_point): Retain ad-hoc locations.
4443         Pass on "set" to call to
4444         linemap_macro_map_loc_unwind_toward_spelling.
4445         (linemap_resolve_location): Retain ad-hoc locations.  Pass on
4446         "set" to call to linemap_macro_map_loc_unwind_toward_spelling.
4447         (linemap_unwind_toward_expansion):  Pass on "set" to call to
4448         linemap_macro_map_loc_unwind_toward_spelling.
4449         (linemap_expand_location): Extract the data pointer before
4450         extracting the location.
4451         (rich_location::rich_location): Add line_maps param; use it to
4452         extract the range from the source_location.
4453         * location-example.txt: Regenerate, showing new representation.
4455 2015-11-06  David Malcolm  <dmalcolm@redhat.com>
4457         * errors.c (cpp_diagnostic): Update for change in signature
4458         of "error" callback.
4459         (cpp_diagnostic_with_line): Likewise, calling override_column
4460         on the rich_location.
4461         * include/cpplib.h (struct cpp_callbacks): Within "error"
4462         callback, convert param from source_location to rich_location *,
4463         and drop column_override param.
4464         * include/line-map.h (struct source_range): New struct.
4465         (struct location_range): New struct.
4466         (class rich_location): New class.
4467         (linemap_client_expand_location_to_spelling_point): New declaration.
4468         * line-map.c (rich_location::rich_location): New ctors.
4469         (rich_location::lazily_expand_location): New method.
4470         (rich_location::override_column): New method.
4471         (rich_location::add_range): New methods.
4472         (rich_location::set_range): New method.
4474 2015-11-06  David Malcolm  <dmalcolm@redhat.com>
4476         * include/line-map.h (struct linemap_stats): Add fields
4477         "adhoc_table_size" and "adhoc_table_entries_used".
4478         * line-map.c (linemap_get_statistics): Populate above fields.
4480 2015-11-04  Mikhail Maltsev  <maltsevm@gmail.com>
4482         * config.in: Regenerate.
4483         * configure: Regenerate.
4484         * configure.ac: Remove ENABLE_CHECKING.
4486 2015-11-03  Uros Bizjak  <ubizjak@gmail.com>
4488         * lex.c (search_line_sse42): Correctly advance the pointer to an
4489         aligned address.
4491 2015-11-02  David Malcolm  <dmalcolm@redhat.com>
4493         * include/line-map.h (source_location): In the table in the
4494         descriptive comment, show UNKNOWN_LOCATION, BUILTINS_LOCATION,
4495         LINE_MAP_MAX_LOCATION_WITH_COLS, LINE_MAP_MAX_SOURCE_LOCATION.
4496         Add notes about ad-hoc values.
4498 2015-10-21  Mikhail Maltsev  <maltsevm@gmail.com>
4500         * include/line-map.h: Use CHECKING_P instead of ENABLE_CHECKING.
4501         * init.c: Likewise.
4502         * macro.c (struct macro_arg_token_iter, set_arg_token,
4503         macro_arg_token_iter_init, macro_arg_token_iter_forward,
4504         macro_arg_token_iter_get_token, macro_arg_token_iter_get_location,
4505         alloc_expanded_arg_mem, _cpp_backup_tokens): Likewise.
4507         * config.in: Regenerate.
4508         * configure: Regenerate.
4509         * configure.ac (CHECKING_P): Define.
4510         * system.h (fancy_abort): Declare.
4511         (abort): Define.
4512         (gcc_assert): Define. Use CHECKING_P.
4514 2015-10-13  Mikhail Maltsev  <maltsevm@gmail.com>
4516         * system.h (CHECKING_P, gcc_checking_assert): Define.
4518 2015-09-21  Manuel LĂłpez-Ibáñez  <manu@gcc.gnu.org>
4520         PR c/66415
4521         * line-map.c (linemap_position_for_loc_and_offset): Handle the
4522         case of long lines encoded in multiple maps.
4524 2015-09-07  Marek Polacek  <polacek@redhat.com>
4526         * system.h (INTTYPE_MINIMUM): Rewrite to avoid shift warning.
4528 2015-08-06  Yaakov Selkowitz  <yselkowi@redhat.com>
4530         * configure: Regenerate.
4532 2015-07-08  Thomas Schwinge  <thomas@codesourcery.com>
4534         * include/line-map.h (RESERVED_LOCATION_COUNT): Change type to
4535         source_location.
4537 2015-07-02  Paolo Carlini  <paolo.carlini@oracle.com>
4539         PR preprocessor/53690
4540         * charset.c (_cpp_valid_ucn): Add cppchar_t * parameter and change
4541         return type to bool.  Fix encoding of \u0000 and \U00000000 in C++.
4542         (convert_ucn): Adjust call.
4543         * lex.c (forms_identifier_p): Likewise.
4544         * internal.h (_cpp_valid_ucn): Adjust declaration.
4546 2015-06-30  Edward Smith-Rowland  <3dw4rd@verizon.net>
4548         Implement N4197 - Adding u8 character literals
4549         * include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens;
4550         (struct cpp_options): Add utf8_char_literals.
4551         * init.c (struct lang_flags): Add utf8_char_literals;
4552         (struct lang_flags lang_defaults): Add column for utf8_char_literals.
4553         * macro.c (stringify_arg()): Treat CPP_UTF8CHAR token;
4554         * expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()):
4555         Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens;
4556         (cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token;
4557         (eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token.
4558         * lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens.
4559         * charset.c (converter_for_type(), cpp_interpret_charconst()):
4560         Treat CPP_UTF8CHAR token.
4562 2015-06-30  Uros Bizjak  <ubizjak@gmail.com>
4564         * lex.c (search_line_sse42) [__GCC_ASM_FLAG_OUTPUTS__]: New main
4565         loop using asm flag outputs.
4567 2015-06-08  Marek Polacek  <polacek@redhat.com>
4569         PR c/66415
4570         * line-map.c (linemap_position_for_loc_and_offset): Remove
4571         linemap_assert_fails; reverse conditions.
4573 2015-05-26  Manuel LĂłpez-Ibáñez  <manu@gcc.gnu.org>
4575         * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER
4576         LINE_MAP_MAX_LOCATION_WITH_COLS,LINE_MAP_MAX_SOURCE_LOCATION):
4577         New constants.
4578         (linemap_line_start): Use them.
4579         (linemap_position_for_column): Use them.
4581 2015-05-20  David Malcolm  <dmalcolm@redhat.com>
4583         * include/line-map.h (MAP_START_LOCATION): Eliminate the non-const
4584         variant, and tweak comment for the const variant.
4585         (ORDINARY_MAP_STARTING_LINE_NUMBER): Drop the non-const variant.
4586         (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
4587         (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
4588         (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
4589         (ORDINARY_MAP_FILE_NAME): Drop the non-const variant.
4590         (MACRO_MAP_MACRO): Likewise.
4591         (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
4592         (MACRO_MAP_LOCATIONS): Likewise.
4593         (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
4594         * line-map.c (linemap_add): Replace writes through macros with
4595         direct field accesses.
4596         (linemap_enter_macro): Likewise.
4597         (linemap_line_start): Likewise.
4599 2015-05-19  David Malcolm  <dmalcolm@redhat.com>
4601         * directives.c (do_line): Strengthen local "map" from
4602         const line_map * to const line_map_ordinary *.
4603         (do_linemarker): Likewise.
4604         (_cpp_do_file_change): Assert that we're not dealing with
4605         a macro map.  Introduce local "ord_map" via a call to
4606         linemap_check_ordinary, guarded within the check for
4607         non-NULL.  Use it for typesafety.
4608         * files.c (cpp_make_system_header): Strengthen local "map" from
4609         const line_map * to const line_map_ordinary *.
4610         * include/cpplib.h (struct cpp_callbacks): Likewise for second
4611         parameter of "file_change" callback.
4612         * include/line-map.h (struct line_map): Convert from a struct
4613         containing a union to a base class.
4614         (struct line_map_ordinary): Convert to a subclass of line_map.
4615         (struct line_map_macro): Likewise.
4616         (linemap_check_ordinary): Strengthen return type from line_map *
4617         to line_map_ordinary *, and add a const-variant.
4618         (linemap_check_macro): New pair of functions.
4619         (ORDINARY_MAP_STARTING_LINE_NUMBER): Strengthen param from
4620         const line_map * to const line_map_ordinary *, eliminating call
4621         to linemap_check_ordinary.  Likewise for the non-const variant.
4622         (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
4623         (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
4624         (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Likewise.
4625         (ORDINARY_MAP_FILE_NAME): Likewise.
4626         (MACRO_MAP_MACRO): Strengthen param from const line_map * to
4627         const line_map_macro *.  Likewise for the non-const variant.
4628         (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
4629         (MACRO_MAP_LOCATIONS): Likewise.
4630         (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
4631         (struct maps_info): Replace with...
4632         (struct maps_info_ordinary):...this and...
4633         (struct maps_info_macro): ...this.
4634         (struct line_maps): Convert fields "info_ordinary" and
4635         "info_macro" to the above new structs.
4636         (LINEMAPS_MAP_INFO): Delete both functions.
4637         (LINEMAPS_MAPS): Likewise.
4638         (LINEMAPS_ALLOCATED): Rewrite both variants to avoid using
4639         LINEMAPS_MAP_INFO.
4640         (LINEMAPS_USED): Likewise.
4641         (LINEMAPS_CACHE): Likewise.
4642         (LINEMAPS_MAP_AT): Likewise.
4643         (LINEMAPS_ORDINARY_MAPS): Strengthen return type from line_map *
4644         to line_map_ordinary *.
4645         (LINEMAPS_ORDINARY_MAP_AT): Likewise.
4646         (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
4647         (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
4648         (LINEMAPS_MACRO_MAPS): Strengthen return type from line_map * to
4649         line_map_macro *.
4650         (LINEMAPS_MACRO_MAP_AT): Likewise.
4651         (LINEMAPS_LAST_MACRO_MAP): Likewise.
4652         (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
4653         (linemap_map_get_macro_name): Strengthen param from
4654         const line_map * to const line_map_macro *.
4655         (SOURCE_LINE): Strengthen first param from const line_map * to
4656         const line_map_ordinary *, removing call to
4657         linemap_check_ordinary.
4658         (SOURCE_COLUMN): Likewise.
4659         (LAST_SOURCE_LINE_LOCATION): Likewise.
4660         (LAST_SOURCE_LINE): Strengthen first param from const line_map *
4661         to const line_map_ordinary *.
4662         (LAST_SOURCE_COLUMN): Likewise.
4663         (INCLUDED_FROM): Strengthen return type from line_map * to
4664         line_map_ordinary *., and second param from const line_map *
4665         to const line_map_ordinary *, removing call to
4666         linemap_check_ordinary.
4667         (MAIN_FILE_P): Strengthen param from const line_map * to
4668         const line_map_ordinary *, removing call to
4669         linemap_check_ordinary.
4670         (linemap_position_for_line_and_column): Strengthen param from
4671         const line_map * to const line_map_ordinary *.
4672         (LINEMAP_FILE): Strengthen param from const line_map * to
4673         const line_map_ordinary *, removing call to
4674         linemap_check_ordinary.
4675         (LINEMAP_LINE): Likewise.
4676         (LINEMAP_SYSP): Likewise.
4677         (linemap_resolve_location): Strengthen final param from
4678         const line_map ** to const line_map_ordinary **.
4679         * internal.h (CPP_INCREMENT_LINE): Likewise for local "map".
4680         (linemap_enter_macro): Strengthen return type from
4681         const line_map * to const line_map_macro *.
4682         (linemap_add_macro_token): Likewise for first param.
4683         * line-map.c (linemap_check_files_exited): Strengthen local "map"
4684         from const line_map * to const line_map_ordinary *.
4685         (new_linemap): Introduce local "map_size" and use it when
4686         calculating how large the buffer should be.  Rewrite based
4687         on change of info_macro and info_ordinary into distinct types.
4688         (linemap_add): Strengthen locals "map" and "from" from line_map *
4689         to line_map_ordinary *.
4690         (linemap_enter_macro): Strengthen return type from
4691         const line_map * to const line_map_macro *, and local "map" from
4692         line_map * to line_map_macro *.
4693         (linemap_add_macro_token): Strengthen param "map" from
4694         const line_map * to const line_map_macro *.
4695         (linemap_line_start): Strengthen local "map" from line_map * to
4696         line_map_ordinary *.
4697         (linemap_position_for_column): Likewise.
4698         (linemap_position_for_line_and_column): Strengthen first param
4699         from const line_map * to const line_map_ordinary *.
4700         (linemap_position_for_loc_and_offset): Strengthen local "map" from
4701         const line_map * to const line_map_ordinary *.
4702         (linemap_ordinary_map_lookup): Likewise for return type and locals
4703         "cached" and "result".
4704         (linemap_macro_map_lookup): Strengthen return type and locals
4705         "cached" and "result" from const line_map * to
4706         const line_map_macro *.
4707         (linemap_macro_map_loc_to_exp_point): Likewise for param "map".
4708         (linemap_macro_map_loc_to_def_point): Likewise.
4709         (linemap_macro_map_loc_unwind_toward_spelling): Likewise.
4710         (linemap_get_expansion_line): Strengthen local "map" from
4711         const line_map * to const line_map_ordinary *.
4712         (linemap_get_expansion_filename): Likewise.
4713         (linemap_map_get_macro_name): Strengthen param from
4714         const line_map * to const line_map_macro *.
4715         (linemap_location_in_system_header_p): Add call to
4716         linemap_check_ordinary in region guarded by
4717         !linemap_macro_expansion_map_p.  Introduce local "macro_map" via
4718         linemap_check_macro in other region, using it in place of "map"
4719         for typesafety.
4720         (first_map_in_common_1): Add calls to linemap_check_macro.
4721         (trace_include): Strengthen param "map" from const line_map * to
4722         const line_map_ordinary *.
4723         (linemap_macro_loc_to_spelling_point): Strengthen final param from
4724         const line_map ** to const line_map_ordinary **.  Replace a
4725         C-style cast with a const_cast, and add calls to
4726         linemap_check_macro and linemap_check_ordinary.
4727         (linemap_macro_loc_to_def_point): Likewise.
4728         (linemap_macro_loc_to_exp_point): Likewise.
4729         (linemap_resolve_location): Strengthen final param from
4730         const line_map ** to const line_map_ordinary **.
4731         (linemap_unwind_toward_expansion): Introduce local "macro_map" via
4732         a checked cast and use it in place of *map.
4733         (linemap_unwind_to_first_non_reserved_loc): Strengthen local
4734         "map1" from const line_map * to const line_map_ordinary *.
4735         (linemap_expand_location): Introduce local "ord_map" via a checked
4736         cast and use it in place of map.
4737         (linemap_dump): Make local "map" const.  Strengthen local
4738         "includer_map" from line_map * to const line_map_ordinary *.
4739         Introduce locals "ord_map" and "macro_map" via checked casts and
4740         use them in place of "map" for typesafety.
4741         (linemap_dump_location): Strengthen local "map" from
4742         const line_map * to const line_map_ordinary *.
4743         (linemap_get_file_highest_location): Update for elimination of
4744         union.
4745         (linemap_get_statistics): Strengthen local "cur_map" from
4746         line_map * to const line_map_macro *.  Update uses of sizeof to
4747         use the appropriate line_map subclasses.
4748         * macro.c (_cpp_warn_if_unused_macro): Add call to
4749         linemap_check_ordinary.
4750         (builtin_macro): Strengthen local "map" from const line_map * to
4751         const line_map_macro *.
4752         (enter_macro_context): Likewise.
4753         (replace_args): Likewise.
4754         (tokens_buff_put_token_to): Likewise for param "map".
4755         (tokens_buff_add_token): Likewise.
4757 2015-05-13  David Malcolm  <dmalcolm@redhat.com>
4759         * include/line-map.h (source_location): Add a reference to
4760         location-example.txt to the descriptive comment.
4761         * location-example.txt: New file.
4763 2015-05-13  David Malcolm  <dmalcolm@redhat.com>
4765         * include/line-map.h (MAX_SOURCE_LOCATION): Convert from a macro
4766         to a const source_location.
4767         (RESERVED_LOCATION_COUNT): Likewise.
4768         (linemap_check_ordinary): Convert from a macro to a pair of inline
4769         functions, for const/non-const arguments.
4770         (MAP_START_LOCATION): Likewise.
4771         (ORDINARY_MAP_STARTING_LINE_NUMBER): Likewise.
4772         (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
4773         (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
4774         (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Convert from a macro to a
4775         pair of inline functions, for const/non-const arguments, where the
4776         latter is named...
4777         (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): New function.
4778         (ORDINARY_MAP_FILE_NAME): Convert from a macro to a pair of inline
4779         functions, for const/non-const arguments.
4780         (MACRO_MAP_MACRO): Likewise.
4781         (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
4782         (MACRO_MAP_LOCATIONS): Likewise.
4783         (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
4784         (LINEMAPS_MAP_INFO): Likewise.
4785         (LINEMAPS_MAPS): Likewise.
4786         (LINEMAPS_ALLOCATED): Likewise.
4787         (LINEMAPS_USED): Likewise.
4788         (LINEMAPS_CACHE): Likewise.
4789         (LINEMAPS_ORDINARY_CACHE): Likewise.
4790         (LINEMAPS_MACRO_CACHE): Likewise.
4791         (LINEMAPS_MAP_AT): Convert from a macro to an inline function.
4792         (LINEMAPS_LAST_MAP): Likewise.
4793         (LINEMAPS_LAST_ALLOCATED_MAP): Likewise.
4794         (LINEMAPS_ORDINARY_MAPS): Likewise.
4795         (LINEMAPS_ORDINARY_MAP_AT): Likewise.
4796         (LINEMAPS_ORDINARY_ALLOCATED): Likewise.
4797         (LINEMAPS_ORDINARY_USED): Likewise.
4798         (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
4799         (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
4800         (LINEMAPS_MACRO_MAPS): Likewise.
4801         (LINEMAPS_MACRO_MAP_AT): Likewise.
4802         (LINEMAPS_MACRO_ALLOCATED): Likewise.
4803         (LINEMAPS_MACRO_USED): Likewise.
4804         (LINEMAPS_MACRO_LOWEST_LOCATION): Likewise.
4805         (LINEMAPS_LAST_MACRO_MAP): Likewise.
4806         (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
4807         (IS_ADHOC_LOC): Likewise.
4808         (COMBINE_LOCATION_DATA): Likewise.
4809         (SOURCE_LINE): Likewise.
4810         (SOURCE_COLUMN): Likewise.
4811         (LAST_SOURCE_LINE_LOCATION): Likewise.
4812         (LAST_SOURCE_LINE): Likewise.
4813         (LAST_SOURCE_COLUMN): Likewise.
4814         (LAST_SOURCE_LINE_LOCATION)
4815         (INCLUDED_FROM): Likewise.
4816         (MAIN_FILE_P): Likewise.
4817         (LINEMAP_FILE): Likewise.
4818         (LINEMAP_LINE): Likewise.
4819         (LINEMAP_SYSP): Likewise.
4820         (linemap_location_before_p): Likewise.
4821         * line-map.c (linemap_check_files_exited): Make local "map" const.
4822         (linemap_add): Use SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS.
4823         (linemap_line_start): Likewise.
4825 2015-05-13  Michael Haubenwallner  <michael.haubenwallner@ssi-schaefer.com>
4827         * aclocal.m4: Regenerated with automake-1.11.6.
4829 2015-05-13  David Malcolm  <dmalcolm@redhat.com>
4831         * include/line-map.h (linemap_assert): Move up within the file to
4832         before all of the map accessor macros.
4833         (linemap_assert_fails): Likewise.
4834         (linemap_check_ordinary): Likewise.
4835         (linemap_macro_expansion_map_p): Likewise.
4837 2015-05-12  David Malcolm  <dmalcolm@redhat.com>
4839         * directives.c (do_line): Set seen_line_directive on line_table.
4840         (do_linemarker): Likewise.
4841         * include/line-map.h (struct line_maps): Add new field
4842         "seen_line_directive".
4844 2015-05-08  Jason Merrill  <jason@redhat.com>
4846         * include/cpplib.h: Add CPP_W_CXX11_COMPAT.
4847         (struct cpp_options): Add cpp_warn_cxx11_compat.
4848         * init.c (cpp_create_reader): Initialize it.
4849         * lex.c (lex_string): Add -Wc++11-compat warning.
4851 2015-05-05  David Malcolm  <dmalcolm@redhat.com>
4853         * pch.c (cpp_valid_state): Fix indentation so that it reflects the
4854         block structure.
4856 2015-05-05  David Malcolm  <dmalcolm@redhat.com>
4858         * include/line-map.h: Fix comment at the top of the file.
4859         (source_location): Rewrite and expand the comment for this
4860         typedef, adding an ascii-art table to clarify how source_location
4861         values are allocated.
4862         * line-map.c: Fix comment at the top of the file.
4864 2015-04-09  Richard Biener  <rguenther@suse.de>
4866         PR pch/65550
4867         * files.c (pch_open_file): Allow main and pre-included files
4868         when trying to open a PCH.
4870 2015-04-06  Jakub Jelinek  <jakub@redhat.com>
4872         PR preprocessor/61977
4873         * lex.c (cpp_peek_token): If peektok is CPP_EOF, back it up
4874         with all tokens peeked by the current function.
4876 2015-04-02  Jakub Jelinek  <jakub@redhat.com>
4878         PR preprocessor/61977
4879         * lex.c (cpp_peek_token): Temporarily clear pfile->cb.line_change.
4881 2015-03-23  Jakub Jelinek  <jakub@redhat.com>
4883         PR preprocessor/65238
4884         * internal.h (_cpp_scan_out_logical_line): Add third argument.
4885         * directives.c (prepare_directive_trad): Pass false to it.
4886         * traditional.c (_cpp_read_logical_line_trad,
4887         _cpp_create_trad_definition): Likewise.
4888         (struct fun_macro): Add paramc field.
4889         (fun_like_macro): New function.
4890         (maybe_start_funlike): Handle NODE_BUILTIN macros.  Initialize
4891         macro->paramc field.
4892         (save_argument): Use macro->paramc instead of
4893         macro->node->value.macro->paramc.
4894         (push_replacement_text): Formatting fix.
4895         (recursive_macro): Use fun_like_macro helper.
4896         (_cpp_scan_out_logical_line): Likewise.  Add BUILTIN_MACRO_ARG
4897         argument.  Initialize fmacro.paramc field.  Handle builtin
4898         function-like macros.
4900 2015-03-16  Edward Smith-Rowland  <3dw4rd@verizon.net>
4902         PR c++/64626
4903         * lex.c (lex_number): If a number ends with digit-seps (') skip back
4904         and let lex_string take them.
4906 2015-03-02  Markus Trippelsdorf  <markus@trippelsdorf.de>
4908         PR target/65261
4909         * lex.c (search_line_fast): Silence ubsan errors.
4911 2015-02-03    <dodji@redhat.com>
4913         PR preprocessor/64803
4914         * internal.h (cpp_reader::top_most_macro_node): New data member.
4915         * macro.c (enter_macro_context): Pass the location of the end of
4916         the top-most invocation of the function-like macro, or the
4917         location of the expansion point of the top-most object-like macro.
4918         (cpp_get_token_1): Store the top-most macro node in the new
4919         pfile->top_most_macro_node data member.
4920         (_cpp_pop_context): Clear the new cpp_reader::top_most_macro_node
4921         data member.
4923 2015-01-30  Szabolcs Nagy  <szabolcs.nagy@arm.com>
4925         * lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON.
4927 2015-01-23  Marek Polacek  <polacek@redhat.com>
4929         DR#412
4930         PR preprocessor/60570
4931         * directives.c (do_elif): Don't evaluate #elif conditionals
4932         when they don't need to be.
4934 2015-01-16  Jakub Jelinek  <jakub@redhat.com>
4936         * expr.c (cpp_classify_number): Add N_() around ?: string
4937         literals used in cpp_error_with_line call as format string.
4939 2015-01-05  Jakub Jelinek  <jakub@redhat.com>
4941         Update copyright years.
4943 2014-12-19  Jakub Jelinek  <jakub@redhat.com>
4945         PR preprocessor/63831
4946         * directives.c (lex_macro_node): Remove __has_attribute__ handling.
4947         * internal.h (struct spec_node): Remove n__has_attribute__ field.
4948         (struct lexer_state): Remove in__has_attribute__ field.
4949         * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_ATTRIBUTE.
4950         * identifiers.c (_cpp_init_hashtable): Remove __has_attribute__
4951         handling.
4952         * init.c (builtin_array): Add __has_attribute and __has_cpp_attribute.
4953         (cpp_init_special_builtins): Don't initialize __has_attribute
4954         or __has_cpp_attribute if CLK_ASM or pfile->cb.has_attribute is NULL.
4955         * traditional.c (enum ls): Remove ls_has_attribute,
4956         ls_has_attribute_close.
4957         (_cpp_scan_out_logical_line): Remove __has_attribute__ handling.
4958         * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_ATTRIBUTE.
4959         * pch.c (cpp_read_state): Remove __has_attribute__ handling.
4960         * expr.c (eval_token): Likewise.
4961         (parse_has_attribute): Removed.
4963 2014-12-11  Uros Bizjak  <ubizjak@gmail.com>
4965         * directives.c (cpp_define_formatted): Use xvasprintf.
4967 2014-12-05  Manuel LĂłpez-Ibáñez  <manu@gcc.gnu.org>
4969         * line-map.c (linemap_position_for_loc_and_offset): Add new
4970         linemap_assert_fails.
4972 2014-12-02  Manuel LĂłpez-Ibáñez  <manu@gcc.gnu.org>
4974         * include/line-map.h (linemap_assert_fails): Declare.
4975         * line-map.c (linemap_position_for_loc_and_offset): Use it.
4977 2014-12-02  Manuel LĂłpez-Ibáñez  <manu@gcc.gnu.org>
4979         * line-map.c (linemap_add): Fix typo.
4980         (linemap_line_start): Fix whitespace.
4982 2014-11-29  John Schmerge  <jbschmerge@gmail.com>
4984         PR preprocessor/41698
4985         * charset.c (one_utf8_to_utf16): Do not produce surrogate pairs
4986         for 0xffff.
4988 2014-11-25  Jakub Jelinek  <jakub@redhat.com>
4990         PR preprocessor/60436
4991         * line-map.c (linemap_line_start): If highest is above 0x60000000
4992         and we are still tracking columns or highest is above 0x70000000,
4993         force add_map.
4995 2014-11-20  Uros Bizjak  <ubizjak@gmail.com>
4997         PR target/63966
4998         * lex.c [__i386__ || __x86_64__]: Compile special SSE functions
4999         only for (__GNUC__ >= 5 || !defined(__PIC__)).
5001 2014-11-13  Manuel LĂłpez-Ibáñez  <manu@gcc.gnu.org>
5003         * include/line-map.h: Include EXPR, so that unused variable warnings
5004         do not occur.
5006 2014-11-11  Manuel LĂłpez-Ibáñez  <manu@gcc.gnu.org>
5008         PR fortran/44054
5009         * include/line-map.h (linemap_position_for_loc_and_offset):
5010         Declare.
5011         * line-map.c (linemap_position_for_loc_and_offset): New.
5013 2014-11-11  David Malcolm  <dmalcolm@redhat.com>
5015         * ChangeLog.jit: New.
5017 2014-11-10  Edward Smith-Rowland  <3dw4rd@verizon.net>
5019         * include/cpplib.h (cpp_callbacks): Add has_attribute.
5020         * internal.h (lexer_state): Add in__has_attribute__.
5021         * directives.c (lex_macro_node): Prevent use of __has_attribute__
5022         as a macro.
5023         * expr.c (parse_has_attribute): New function; (eval_token): Look for
5024         __has_attribute__ and route to parse_has_attribute.
5025         * identifiers.c (_cpp_init_hashtable): Initialize n__has_attribute__.
5026         * pch.c (cpp_read_state): Initialize n__has_attribute__.
5027         * traditional.c (enum ls): Add ls_has_attribute, ls_has_attribute_close;
5028         (_cpp_scan_out_logical_line): Attend to __has_attribute__.
5030 2014-11-06  Joseph Myers  <joseph@codesourcery.com>
5032         * include/cpp-id-data.h (struct cpp_macro): Update comment
5033         regarding parameters.
5034         * include/cpplib.h (struct cpp_macro_arg, struct cpp_identifier):
5035         Add spelling fields.
5036         (struct cpp_token): Update comment on macro_arg.
5037         * internal.h (_cpp_save_parameter): Add extra argument.
5038         (_cpp_spell_ident_ucns): New declaration.
5039         * lex.c (lex_identifier): Add SPELLING argument.  Set *SPELLING to
5040         original spelling of identifier.
5041         (_cpp_lex_direct): Update calls to lex_identifier.
5042         (_cpp_spell_ident_ucns): New function, factored out of
5043         cpp_spell_token.
5044         (cpp_spell_token): Adjust FORSTRING argument semantics to return
5045         original spelling of identifiers.  Use _cpp_spell_ident_ucns in
5046         !FORSTRING case.
5047         (_cpp_equiv_tokens): Check spellings of identifiers and macro
5048         arguments are identical.
5049         * macro.c (macro_arg_saved_data): New structure.
5050         (paste_tokens): Use original spellings of identifiers from
5051         cpp_spell_token.
5052         (_cpp_save_parameter): Add argument SPELLING.  Save both canonical
5053         node and its value.
5054         (parse_params): Update calls to _cpp_save_parameter.
5055         (lex_expansion_token): Save spelling of macro argument tokens.
5056         (_cpp_create_definition): Extract canonical node from saved data.
5057         (cpp_macro_definition): Use UCNs in spelling of macro name.  Use
5058         original spellings of macro argument tokens and identifiers.
5059         * traditional.c (scan_parameters): Update call to
5060         _cpp_save_parameter.
5062 2014-11-05  Joseph Myers  <joseph@codesourcery.com>
5064         PR preprocessor/9449
5065         * init.c (lang_defaults): Enable extended identifiers for C++ and
5066         C99-based standards.
5068 2014-10-22  Alan Modra  <amodra@gmail.com>
5070         * symtab.c (ht_create): Use obstack_specify_allocation in place of
5071         _obstack_begin.
5072         * files.c (_cpp_init_files): Likewise.
5073         * init.c (cpp_create_reader): Likewise.
5074         * identifiers.c (_cpp_init_hashtable): Likewise.
5076 2014-10-14  Manuel LĂłpez-Ibáñez  <manu@gcc.gnu.org>
5078         * include/line-map.h (linemap_location_from_macro_expansion_p):
5079         const struct line_maps * argument.
5080         (linemap_position_for_line_and_column): const struct line_map *
5081         argument.
5082         * line-map.c (linemap_add_macro_token): Use correct argument name
5083         in comment.
5084         (linemap_position_for_line_and_column): const struct line_map *
5085         argument.
5086         (linemap_macro_map_loc_to_def_point): Fix comment. Make static.
5087         (linemap_location_from_macro_expansion_p): const struct line_maps *
5088         argument.
5089         (linemap_resolve_location): Fix argument names in comment.
5091 2014-10-03  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
5093         * lex.c (search_line_fast): Add new version to be used for Power8
5094         and later targets when Altivec is enabled.  Restrict the existing
5095         Altivec version to big-endian systems so that lvsr is not used on
5096         little endian, where it is deprecated.  Remove LE-specific code
5097         from the now-BE-only version.
5099 2014-10-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>
5100             Jeff Law  <law@redhat.com>
5102         * charset.c (convert_no_conversion): Reallocate memory with 25%
5103         headroom.
5105 2014-10-01  Edward Smith-Rowland  <3dw4rd@verizon.net>
5107         Implement SD-6: SG10 Feature Test Recommendations
5108         * internal.h (lexer_state, spec_nodes): Add in__has_include__.
5109         * directives.c: Support __has_include__ builtin.
5110         * expr.c (parse_has_include): New function to parse __has_include__
5111         builtin; (eval_token()): Use it.
5112         * files.c (_cpp_has_header()): New funtion to look for header;
5113         (open_file_failed()): Not an error to not find a header file for
5114         __has_include__.
5115         * identifiers.c (_cpp_init_hashtable()): Add entry for __has_include__.
5116         * pch.c (cpp_read_state): Lookup __has_include__.
5117         * traditional.c (enum ls, _cpp_scan_out_logical_line()): Walk through
5118         __has_include__ statements.
5120 2014-09-30  Bernd Edlinger  <bernd.edlinger@hotmail.de>
5122         PR preprocessor/58893
5123         * errors.c (cpp_diagnostic): Fix possible out of bounds access.
5124         * files.c (_cpp_stack_include): Initialize src_loc for IT_CMDLINE.
5126 2014-09-24  Marek Polacek  <polacek@redhat.com>
5128         PR c/61405
5129         PR c/53874
5130         * include/cpplib.h (enum cpp_ttype): Define CPP_KEYWORD.
5132 2014-09-17  Jan Hubicka  <hubicka@ucw.cz>
5134         * charset.c (conversion): Rename to ...
5135         (cpp_conversion): ... this one; update.
5136         * files.c (file_hash_entry): Rename to ...
5137         (cpp_file_hash_entry): ... this one ; update.
5139 2014-09-17  Marek Polacek  <polacek@redhat.com>
5141         PR c/61854
5142         * init.c (struct lang_flags): Remove cplusplus_comments.
5143         (cpp_set_lang): Likewise.
5144         (post_options): Likewise.
5145         * lex.c (_cpp_lex_direct): Disallow C++ style comments in C90/C94.
5147 2014-09-09  Manuel LĂłpez-Ibáñez  <manu@gcc.gnu.org>
5149         * include/cpplib.h (struct cpp_options): Declare warn_normalize as
5150         int instead of enum.
5152 2014-09-04  Manuel LĂłpez-Ibáñez  <manu@gcc.gnu.org>
5154         * macro.c (replace_args): Use cpp_pedwarning, cpp_warning and
5155         CPP_W flags.
5156         * include/cpplib.h: Add CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC.
5157         * init.c (cpp_create_reader): Do not init to -1 here.
5158         * expr.c (num_binary_op): Use cpp_pedwarning.
5160 2014-08-29  Manuel LĂłpez-Ibáñez  <manu@gcc.gnu.org>
5162         * directives.c (check_eol_1): New.
5163         (check_eol_endif_labels): New.
5164         (check_eol): Call check_eol_1.
5165         (do_else,do_endif): Call check_eol_endif_labels.
5167 2014-08-29  Manuel LĂłpez-Ibáñez  <manu@gcc.gnu.org>
5169         * macro.c (warn_of_redefinition): Suppress warnings for builtins
5170         that lack the NODE_WARN flag, unless Wbuiltin-macro-redefined.
5171         (_cpp_create_definition): Use Wbuiltin-macro-redefined for
5172         builtins that lack the NODE_WARN flag.
5173         * directives.c (do_undef): Likewise.
5174         * init.c (cpp_init_special_builtins): Do not change flags
5175         depending on Wbuiltin-macro-redefined.
5177 2014-08-28  Edward Smith-Rowland  <3dw4rd@verizon.net>
5179         PR cpp/23827 - standard C++ should not have hex float preprocessor
5180         tokens
5181         * libcpp/init.c (lang_flags): Change CXX98 flag for extended numbers
5182         from 1 to 0.
5183         * libcpp/expr.c (cpp_classify_number): Weite error message for improper
5184         use of hex floating literal.
5186 2014-08-23  Edward Smith-Rowland  <3dw4rd@verizon.net>
5188         * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z;
5189         Rename CLK_GNUCXX1Y, CLK_CXX1Y to CLK_GNUCXX14, CLK_CXX14;
5190         * init.c (struct lang_flags lang_defaults): Add column for trigraphs;
5191         Add rows for CLK_GNUCXX1Z, CLK_CXX1Z; (cpp_set_lang): Set trigraphs;
5192         (cpp_init_builtins): Set __cplusplus to 201402L for C++14;
5193         Set __cplusplus to 201500L for C++17.
5194         * expr.c (cpp_classify_number): Change C++1y to C++14 in binary
5195         constants error message.
5197 2014-08-20  Marek Polacek  <polacek@redhat.com>
5199         * include/cpplib.h (cpp_options): Use signed char.
5200         * lex.c (_cpp_lex_direct): Don't warn in C++ mode.
5202 2014-08-19  Marek Polacek  <polacek@redhat.com>
5204         * lex.c (_cpp_lex_direct): Fix a typo.
5206 2014-08-19  Marek Polacek  <polacek@redhat.com>
5208         * charset.c (_cpp_valid_ucn): Warn only if -Wc90-c99-compat.
5209         * lex.c (_cpp_lex_direct): Likewise.
5210         * macro.c (replace_args): Likewise.
5211         (parse_params): Likewise.
5212         * include/cpplib.h (cpp_options): Change cpp_warn_c90_c99_compat
5213         to char.
5215 2014-08-10 Marek Polacek  <polacek@redhat.com>
5217         PR c/51849
5218         * lex.c (_cpp_lex_direct): Warn when -Wc90-c99-compat is in effect.
5219         * charset.c (_cpp_valid_ucn): Likewise.
5220         * include/cpplib.h (cpp_options): Add cpp_warn_c90_c99_compat.
5221         * macro.c (replace_args): Warn when -Wc90-c99-compat is in effect.
5222         (parse_params): Likewise.
5224 2014-07-27  Marek Polacek  <polacek@redhat.com>
5226         PR c/61861
5227         * macro.c (builtin_macro): Add location parameter.  Set
5228         location of builtin macro to the expansion point.
5229         (enter_macro_context): Pass location to builtin_macro.
5231 2014-07-16  Dodji Seketeli  <dodji@redhat.com>
5233         Support location tracking for built-in macro tokens
5234         * include/line-map.h (line_maps::builtin_location): New data
5235         member.
5236         (line_map_init): Add a new parameter to initialize the new
5237         line_maps::builtin_location data member.
5238         * line-map.c (linemap_init): Initialize the
5239         line_maps::builtin_location data member.
5240         * macro.c (builtin_macro): Create a macro map and track the token
5241         resulting from the expansion of a built-in macro.
5243 2014-07-10  Edward Smith-Rowland  <3dw4rd@verizon.net>
5244             Jonathan Wakely  <jwakely@redhat.com>
5246         PR preprocessor/61389
5247         * macro.c (_cpp_arguments_ok, parse_params, create_iso_definition):
5248         Warning messages mention C++11 in c++ mode and C99 in c mode.
5249         * lex.c (lex_identifier_intern, lex_identifier): Ditto
5251 2014-07-09  Edward Smith-Rowland  <3dw4rd@verizon.net>
5253         PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped
5254         by preprocessor
5255         * lex.c (lex_raw_string ()): Do not warn about invalid suffix
5256         if skipping. (lex_string ()): Ditto.
5258 2014-06-04  Edward Smith-Rowland  <3dw4rd@verizon.net>
5260         PR c++/61038
5261         * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
5262         Combine user-defined escape logic with the other string and char logic.
5264 2014-05-26  Richard Biener  <rguenther@suse.de>
5266         * configure.ac: Remove long long and __int64 type checks,
5267         add check for uint64_t and fail if that wasn't found.
5268         * include/cpplib.h (cpp_num_part): Use uint64_t.
5269         * config.in: Regenerate.
5270         * configure: Likewise.
5272 2014-05-21  Marek Polacek  <polacek@redhat.com>
5274         PR c/61212
5275         * files.c (find_file_in_dir): Add parens around &&.
5277 2014-05-20  Edward Smith-Rowland  <3dw4rd@verizon.net>
5279         PR c++/61038
5280         * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
5281         Check for user-defined literal strings and user-defined literal chars
5282         to escape necessary characters.
5284 2014-05-20  Richard Biener  <rguenther@suse.de>
5286         * configure.ac: Copy gcc logic of detecting a 64bit type.
5287         Remove HOST_WIDE_INT define.
5288         * include/cpplib.h: typedef cpp_num_part to a 64bit type,
5289         similar to how hwint.h does it.
5290         * config.in: Regenerate.
5291         * configure: Likewise.
5293 2014-05-09  Joey Ye  <joey.ye@arm.com>
5295         * files.c (find_file_in_dir): Always try to shorten for DOS
5296         non-system headers.
5297         * init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS.
5299 2014-05-07  Richard Biener  <rguenther@suse.de>
5301         * configure.ac: Always set need_64bit_hwint to yes.
5302         * configure: Regenerated.
5304 2014-04-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
5306         * lex.c: Remove Solaris 9 reference.
5308 2014-02-24  Walter Lee  <walt@tilera.com>
5310         * configure.ac: Change "tilepro" triplet to "tilepro*".
5311         * configure: Regenerate.
5313 2014-02-19  Jakub Jelinek  <jakub@redhat.com>
5315         PR preprocessor/58844
5316         * macro.c (enter_macro_context): Only push
5317         macro_real_token_count (macro) tokens rather than
5318         macro->count tokens, regardless of
5319         CPP_OPTION (pfile, track-macro-expansion).
5321 2014-02-07  Jakub Jelinek  <jakub@redhat.com>
5323         PR preprocessor/56824
5324         * line-map.c (get_combined_adhoc_loc, linemap_get_expansion_line,
5325         linemap_get_expansion_filename, linemap_location_in_system_header_p,
5326         linemap_location_from_macro_expansion_p,
5327         linemap_macro_loc_to_spelling_point, linemap_macro_loc_to_def_point,
5328         linemap_macro_loc_to_exp_point, linemap_expand_location): Fix
5329         formatting.
5330         (linemap_compare_locations): Look through adhoc locations for both
5331         l0 and l1.
5333 2014-01-23  Dodji Seketeli  <dodji@redhat.com>
5335         PR PR preprocessor/58580
5336         * include/line-map.h (linemap_get_file_highest_location): Declare
5337         new function.
5338         * line-map.c (linemap_get_file_highest_location): Define it.
5340 2014-01-02  Richard Sandiford  <rdsandiford@googlemail.com>
5342         Update copyright years
5344 2013-12-09  Joseph Myers  <joseph@codesourcery.com>
5346         PR preprocessor/55715
5347         * expr.c (num_binary_op): Implement subtraction directly rather
5348         than with negation and falling through into addition case.
5350 2013-11-18  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
5352         * lex.c (search_line_fast): Correct for little endian.
5354 2013-11-15  Joseph Myers  <joseph@codesourcery.com>
5356         * ucnid.tab: Add C11 and C11NOSTART data.
5357         * makeucnid.c (digit): Rename enum value to N99.
5358         (C11, N11, all_languages): New enum values.
5359         (NUM_CODE_POINTS, MAX_CODE_POINT): New macros.
5360         (flags, decomp, combining_value): Use NUM_CODE_POINTS as array
5361         size.
5362         (decomp): Use unsigned int as element type.
5363         (all_decomp): New array.
5364         (read_ucnid): Handle C11 and C11NOSTART.  Use MAX_CODE_POINT.
5365         (read_table): Use MAX_CODE_POINT.  Store all decompositions in
5366         all_decomp.
5367         (read_derived): Use MAX_CODE_POINT.
5368         (write_table): Use NUM_CODE_POINTS.  Print N99, C11 and N11
5369         flags.  Print whole array variable declaration rather than just
5370         array contents.
5371         (char_id_valid, write_context_switch): New functions.
5372         (main): Call write_context_switch.
5373         * ucnid.h: Regenerate.
5374         * include/cpplib.h (struct cpp_options): Add c11_identifiers.
5375         * init.c (struct lang_flags): Add c11_identifiers.
5376         (cpp_set_lang): Set c11_identifiers option from selected language.
5377         * internal.h (struct normalize_state): Document "previous" as
5378         previous starter character.
5379         (NORMALIZE_STATE_UPDATE_IDNUM): Take character as argument.
5380         * charset.c (DIG): Rename enum value to N99.
5381         (C11, N11): New enum values.
5382         (struct ucnrange): Give name to struct.  Use short for flags and
5383         unsigned int for end of range.  Include ucnid.h for whole variable
5384         declaration.
5385         (ucn_valid_in_identifier): Allow for characters up to 0x10FFFF.
5386         Allow for C11 in determining valid characters and valid start
5387         characters.  Use check_nfc for non-Hangul context-dependent
5388         checks.  Only store starter characters in nst->previous.
5389         (_cpp_valid_ucn): Pass new argument to
5390         NORMALIZE_STATE_UPDATE_IDNUM.
5391         * lex.c (lex_identifier): Pass new argument to
5392         NORMALIZE_STATE_UPDATE_IDNUM.  Call NORMALIZE_STATE_UPDATE_IDNUM
5393         after initial non-UCN part of identifier.
5394         (lex_number): Pass new argument to NORMALIZE_STATE_UPDATE_IDNUM.
5396 2013-11-15  Joseph Myers  <joseph@codesourcery.com>
5398         * ucnid.tab: Mark C99 digits as [C99DIG].
5399         * makeucnid.c (read_ucnid): Handle [C99DIG].
5400         (read_table): Don't check for digit characters.
5401         * ucnid.h: Regenerate.
5403 2013-11-06  Tobias Burnus  <burnus@net-b.de>
5405         * macro.c (_cpp_builtin_macro_text): Correct
5406         wording of two warnings.
5408 2013-11-05  Tobias Burnus  <burnus@net-b.de>
5410         * include/cpplib.h (CPP_W_DATE_TIME): Added.
5411         (cpp_options): Add warn_date_time.
5412         * init.c (cpp_create_reader): Init it.
5413         * macro.c (_cpp_builtin_macro_text): Warn when
5414         __DATE__/__TIME__/__TIMESTAMP__ is used.
5416 2013-10-31  Edward Smith-Rowland  <3dw4rd@verizon.net>
5418         Implement C++14 digit separators.
5419         * include/cpplib.h (cpp_options): Add digit_separators flag.
5420         * internal.h (DIGIT_SEP(c)): New macro.
5421         * expr.c (cpp_classify_number): Check improper placement of digit sep;
5422         (cpp_interpret_integer): Skip over digit separators.
5423         * init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add
5424         digit separator flags per language; (cpp_set_lang): Set
5425         digit_separators
5426         * lex.c (lex_number): Add digits separator to allowable characters for
5427         C++14.
5429 2013-10-15  David Malcolm  <dmalcolm@redhat.com>
5431         * Makefile.in (PICFLAG): New.
5432         (ALL_CFLAGS): Add PICFLAG.
5433         (ALL_CXXFLAGS): Likewise.
5434         * configure.ac: Add --enable-host-shared, setting up new
5435         PICFLAG variable.
5436         * configure: Regenerate.
5438 2013-08-07  Richard Earnshaw  <rearnsha@arm.com>
5440         * configure.ac: Set need_64bit_hwint for all arm targets.
5441         * configure: Regenerated.
5443 2013-07-20  Jakub Jelinek  <jakub@redhat.com>
5445         PR preprocessor/57620
5446         * lex.c (lex_raw_string): Undo phase1 and phase2 transformations
5447         between R" and final " rather than only in between R"del( and )del".
5449 2013-07-10  Jakub Jelinek  <jakub@redhat.com>
5451         PR preprocessor/57824
5452         * lex.c (lex_raw_string): Allow reading new-lines if
5453         in_deferred_pragma or if parsing_args and there is still
5454         data in the current buffer.
5456         * include/cpplib.h (cpp_token_val_index): Change parameter type to
5457         const cpp_token *.
5458         * lex.c (cpp_token_val_index): Likewise.
5460         PR preprocessor/57757
5461         * lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING
5462         or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that
5463         starts if a-zA-Z_.
5465 2013-06-28  Ed Smith-Rowland  <3dw4rd@verizon.net>
5467         * lex.c (lex_raw_string(), lex_string()): Constrain suffixes treated
5468         as concatenated literal and macro to just the patterns found in
5469         inttypes.h; (is_macro()): New.
5471 2013-06-24  Dehao Chen  <dehao@google.com>
5473         * files.c (_cpp_stack_include): Fix the highest_location when header
5474         file is guarded by #ifndef and is included twice.
5476 2013-04-28  Jakub Jelinek  <jakub@redhat.com>
5478         N3472 binary constants
5479         * include/cpplib.h (struct cpp_options): Fix a typo in user_literals
5480         field comment.  Add binary_constants field.
5481         * init.c (struct lang_flags): Add binary_constants field.
5482         (lang_defaults): Add bin_cst column to the table.
5483         (cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants).
5484         * expr.c (cpp_classify_number): Talk about C++11 instead of C++0x
5485         in diagnostics.  Accept binary constants if
5486         CPP_OPTION (pfile, binary_constants) even when pedantic.  Adjust
5487         pedwarn message.
5489 2013-04-24  Paolo Carlini  <paolo.carlini@oracle.com>
5491         * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y.
5492         * init.c (lang_defaults): Add defaults for the latter.
5493         (cpp_init_builtins): Define __cplusplus as 201300L for the latter.
5494         * lex.c (_cpp_lex_direct): Update.
5496 2013-04-03  Sebastian Huber  <sebastian.huber@embedded-brains.de>
5498         PR target/56771
5499         * configure.ac: Require 64-bit int for arm*-*-rtems*.
5500         * configure: Regenerate.
5502 2013-03-06  Jakub Jelinek  <jakub@redhat.com>
5504         PR middle-end/56461
5505         * internal.h (struct cpp_buffer): Add to_free field.
5506         (_cpp_pop_file_buffer): Add third argument.
5507         * files.c (_cpp_stack_file): Set buffer->to_free.
5508         (_cpp_pop_file_buffer): Add to_free argument.  Free to_free
5509         if non-NULL, and if equal to file->buffer_start, also clear
5510         file->buffer{,_start,_valid}.
5511         * directives.c (_cpp_pop_buffer): Pass buffer->to_free
5512         to _cpp_pop_file_buffer.
5514 2013-03-01  Jakub Jelinek  <jakub@redhat.com>
5516         PR middle-end/56461
5517         * files.c (_cpp_save_file_entries): Free result at the end.
5518         * pch.c (cpp_string_free): New function.
5519         (cpp_save_state): Use it in htab_create call.
5520         (cpp_write_pch_deps): Free ss->defs.  Destroy ss->definedhash.
5522 2013-02-28  Jakub Jelinek  <jakub@redhat.com>
5524         * files.c (_cpp_find_file): If returning early, before storing
5525         something to *hash_slot and *hash_slot is NULL, call htab_clear_slot
5526         on it.  Access *hash_slot using void * type rather than
5527         struct file_hash_entry * to avoid aliasing issues.
5529         * configure.ac: Don't define ENABLE_CHECKING whenever
5530         --enable-checking is seen, instead use similar --enable-checking=yes
5531         vs. --enable-checking=release default as gcc/ subdir has and
5532         define ENABLE_CHECKING if ENABLE_CHECKING is defined in gcc/.
5533         Define ENABLE_VALGRIND_CHECKING if requested.
5534         * lex.c (new_buff): If ENABLE_VALGRIND_CHECKING, put _cpp_buff
5535         struct first in the allocated buffer and result->base after it.
5536         (_cpp_free_buff): If ENABLE_VALGRIND_CHECKING, free buff itself
5537         instead of buff->base.
5538         * config.in: Regenerated.
5539         * configure: Regenerated.
5541 2013-02-13  Ed Smith-Rowland  <3dw4rd@verizon.net>
5543         PR c++/55582
5544         * lex.c (lex_raw_string): Allow string literal with suffix
5545         beginning with 's' to be parsed as a C++11 user-defined literal.
5547 2013-01-14  Richard Sandiford  <rdsandiford@googlemail.com>
5549         Update copyright years.
5551 2013-01-04  Paolo Carlini  <paolo.carlini@oracle.com>
5553         PR c++/54526 (again)
5554         * lex.c (_cpp_lex_direct): In C++11 mode, implement 2.5 p3, bullet 2.
5556 2013-01-03  Marc Glisse  <marc.glisse@inria.fr>
5558         PR bootstrap/50177
5559         * line-map.c (get_combined_adhoc_loc): Cast from extern "C" type.
5560         (new_linemap): Likewise.
5561         (linemap_enter_macro): Likewise.
5563 2012-12-03  Jakub Jelinek  <jakub@redhat.com>
5565         PR bootstrap/55380
5566         PR other/54691
5567         * files.c (read_file_guts): Allocate extra 16 bytes instead of
5568         1 byte at the end of buf.  Pass size + 16 instead of size
5569         to _cpp_convert_input.
5570         * charset.c (_cpp_convert_input): Reallocate if there aren't
5571         at least 16 bytes beyond to.len in the buffer.  Clear 16 bytes
5572         at to.text + to.len.
5574 2012-11-21  Steve Ellcey  <sellcey@mips.com>
5576         PR pch/55399
5577         * files.c (pch_open_file): Fix check for implicit_preinclude.
5579 2012-11-16  Simon Baldwin  <simonb@google.com>
5581         * include/cpplib.h (struct cpp_options): Add canonical_system_headers.
5582         * files.c (find_file_in_dir): Call maybe_shorter_path() only if
5583         canonical_system_headers is set.
5584         * init.c (cpp_create_reader): Initialize canonical_system_headers.
5585         * configure.ac: Add new --enable-canonical-system-headers.
5586         * configure: Regenerate.
5587         * config.in: Regenerate.
5589 2012-11-09  Ed Smith-Rowland  <3dw4rd@verizon.net>
5591         PR c++/54413
5592         * include/cpplib.h (cpp_interpret_float_suffix): Add cpp_reader* arg.
5593         (cpp_interpret_int_suffix): Add cpp_reader* arg.
5594         * init.c (cpp_create_reader): Iitialize new flags.
5595         * expr.c (interpret_float_suffix): Use new flags.
5596         (cpp_interpret_float_suffix): Add cpp_reader* arg.
5597         (interpret_int_suffix): Use new flags.
5598         (cpp_interpret_int_suffix): Add cpp_reader* arg.
5599         (cpp_classify_number): Adjust calls to interpret_x_suffix.
5601 2012-10-23  Ian Bolton  <ian.bolton@arm.com>
5602             Jim MacArthur  <jim.macarthur@arm.com>
5603             Marcus Shawcroft  <marcus.shawcroft@arm.com>
5604             Nigel Stephens  <nigel.stephens@arm.com>
5605             Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
5606             Richard Earnshaw  <rearnsha@arm.com>
5607             Sofiane Naci  <sofiane.naci@arm.com>
5608             Stephen Thomas  <stephen.thomas@arm.com>
5609             Tejas Belagod  <tejas.belagod@arm.com>
5610             Yufeng Zhang  <yufeng.zhang@arm.com>
5612         * configure.ac: Enable AArch64.
5613         * configure: Regenerate.
5615 2012-10-23  Joseph Myers  <joseph@codesourcery.com>
5617         * files.c (struct _cpp_file): Add implicit_preinclude.
5618         (pch_open_file): Allow a previously opened implicitly included
5619         file.
5620         (_cpp_find_file): Add implicit_preinclude argument.  Free file and
5621         do not call open_file_failed if implicit_preinclude.  Store
5622         implicit_preinclude value.
5623         (_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date):
5624         Update calls to _cpp_find_file.
5625         (_cpp_stack_include): Handle IT_DEFAULT.
5626         (cpp_push_default_include): New.
5627         * include/cpplib.h (cpp_push_default_include): Declare.
5628         * init.c (cpp_read_main_file): Update call to _cpp_find_file.
5629         * internal.h (enum include_type): Add IT_DEFAULT.
5630         (_cpp_find_file): Update prototype.
5632 2012-10-15  Tobias Burnus  <burnus@net-b.de>
5634         * files.c (read_file_guts, _cpp_save_file_entries): Free memory
5635         before returning.
5636         * lex.c (warn_about_normalization): Ditto.
5637         * mkdeps.c (deps_save): Ditto.
5638         * pch.c (cpp_valid_state): Ditto.
5640 2012-10-04  Florian Weimer  <fweimer@redhat.com>
5642         * directives.c (do_pragma_warning_or_error): New.
5643         (do_pragma_warning): New.
5644         (do_pragma_error): New.
5645         (_cpp_init_internal_pragmas): Register new pragmas.
5647 2012-09-25  Dehao Chen  <dehao@google.com>
5649         PR middle-end/54704
5650         * line-map.c (location_adhoc_data_hash): Fix the hash function.
5652 2012-09-25  Dehao Chen  <dehao@google.com>
5654         PR middle-end/54645
5655         * include/line-map.h (location_adhoc_data): Move location_adhoc_data
5656         into GC.
5657         (location_adhoc_data_map): Likewise.
5658         (line_maps): Likewise.
5659         (rebuild_location_adhoc_htab): New Function.
5660         * line-map.c (+rebuild_location_adhoc_htab): new Funcion.
5661         (get_combined_adhoc_loc): Move location_adhoc_data into GC.
5662         (location_adhoc_data_fini): Likewise.
5663         (linemap_init): Likewise.
5664         (location_adhoc_data_init): Remove Function.
5666 2012-09-19  Dehao Chen  <dehao@google.com>
5668         * include/line-map.h (MAX_SOURCE_LOCATION): New value.
5669         (location_adhoc_data_fini): New.
5670         (get_combined_adhoc_loc): New.
5671         (get_data_from_adhoc_loc): New.
5672         (get_location_from_adhoc_loc): New.
5673         (location_adhoc_data_map): New.
5674         (COMBINE_LOCATION_DATA): New.
5675         (IS_ADHOC_LOC): New.
5676         (expanded_location): New field.
5677         (line_maps): New field.
5678         * line-map.c (location_adhoc_data): New.
5679         (location_adhoc_data_hash): New.
5680         (location_adhoc_data_eq): New.
5681         (location_adhoc_data_update): New.
5682         (get_combined_adhoc_loc): New.
5683         (get_data_from_adhoc_loc): New.
5684         (get_location_from_adhoc_loc): New.
5685         (location_adhoc_data_init): New.
5686         (location_adhoc_data_fini): New.
5687         (linemap_init): Initialize location_adhoc_data.
5688         (linemap_lookup): Change to use new location.
5689         (linemap_ordinary_map_lookup): Likewise.
5690         (linemap_macro_map_lookup): Likewise.
5691         (linemap_macro_map_loc_to_def_point): Likewise.
5692         (linemap_macro_map_loc_unwind_toward_spel): Likewise.
5693         (linemap_get_expansion_line): Likewise.
5694         (linemap_get_expansion_filename): Likewise.
5695         (linemap_location_in_system_header_p): Likewise.
5696         (linemap_location_from_macro_expansion_p): Likewise.
5697         (linemap_macro_loc_to_spelling_point): Likewise.
5698         (linemap_macro_loc_to_def_point): Likewise.
5699         (linemap_macro_loc_to_exp_point): Likewise.
5700         (linemap_resolve_location): Likewise.
5701         (linemap_unwind_toward_expansion): Likewise.
5702         (linemap_unwind_to_first_non_reserved_loc): Likewise.
5703         (linemap_expand_location): Likewise.
5704         (linemap_dump_location): Likewise.
5705         (linemap_line_start): Likewise.
5707 2012-05-25  Dodji Seketeli  <dodji@redhat.com>
5709         PR preprocessor/53469
5710         * directives.c (do_pragma): Use the virtual location for the
5711         pragma token, instead of its spelling location.
5713 2012-08-14   Diego Novillo  <dnovillo@google.com>
5715         Merge from cxx-conversion branch.  Configury.
5717         * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
5718         * configure.ac: Likewise.
5719         * configure: Regenerate.
5721 2012-08-14   Lawrence Crowl  <crowl@google.com>
5723         Merge from cxx-conversion branch.  New C++ hash table.
5725         * include/symtab.h (typedef struct ht hash_table): Change the typedef
5726         name to cpp_hash_table.  Update all users of the typedef.
5728 2012-07-30  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
5730         * include/line-map.h (line_map_macro): Use the "atomic" GTY option
5731         for the macro_locations field.
5733 2011-06-19  Uros Bizjak  <ubizjak@gmail.com>
5735         * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
5736         __builtin_ia32_pcmpestri128 instead of asm.
5738 2012-06-04  Dimitrios Apostolou <jimis@gmx.net>
5740         * line-map.c (linemap_enter_macro): Don't zero max_column_hint in
5741         every macro. This improves performance by reducing the number of
5742         reallocations when track-macro-expansion is on.
5744 2012-06-04  Dodji Seketeli  <dodji@redhat.com>
5746         PR preprocessor/53463
5747         * line-map.c (linemap_location_in_system_header_p): For built-in
5748         macro tokens, check the first expansion point location that is not
5749         for a token coming from a built-in macro.
5751 2012-05-29  Joseph Myers  <joseph@codesourcery.com>
5753         * directives.c: Fix typos.
5754         * include/line-map.h: Fix typos.
5755         * line-map.c: Fix typos.
5756         * macro.c: Fix typos.
5758 2012-05-25  Dodji Seketeli  <dodji@redhat.com>
5760         PR bootstrap/53459
5761         * lex.c (search_line_fast): Avoid unused local typedefs to simulate
5762         a static assertion.
5764 2012-05-29  Dodji Seketeli  <dodji@redhat.com>
5766         PR preprocessor/53229
5767         * internal.h (cpp_reader::set_invocation_location): Remove.
5768         (cpp_reader::about_to_expand_macro_p): New member flag.
5769         * directives.c (do_pragma):  Remove Kludge as
5770         pfile->set_invocation_location is no more.
5771         * macro.c (cpp_get_token_1): Do away with the use of
5772         cpp_reader::set_invocation_location.  Just collect the macro
5773         expansion point when we are about to expand the top-most macro.
5774         Do not override cpp_reader::about_to_expand_macro_p.
5775         This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding
5776         properly handle locations of expansion points.
5777         (cpp_get_token_with_location): Adjust, as
5778         cpp_reader::set_invocation_location is no more.
5779         (paste_tokens): Take a virtual location parameter for
5780         the LHS of the pasting operator.  Use it in diagnostics.  Update
5781         comments.
5782         (paste_all_tokens): Tighten the assert.  Propagate the location of
5783         the expansion point when no virtual locations are available.
5784         Pass the virtual location to paste_tokens.
5785         (in_macro_expansion_p): New static function.
5786         (enter_macro_context): Set the cpp_reader::about_to_expand_macro_p
5787         flag until we really start expanding the macro.
5789 2012-05-16  Dodji Seketeli  <dodji@redhat.com>
5791         PR preprocessor/7263
5792         * include/cpplib.h (cpp_classify_number): Take a location
5793         parameter.
5794         * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic
5795         macros that take a location parameter.
5796         (cpp_classify_number): Take a (virtual) location parameter.  Use
5797         it for diagnostics.  Adjust comments.
5798         (eval_token): Take a location parameter.  Pass it to
5799         cpp_classify_number and to diagnostic routines.
5800         (_cpp_parse_expr): Use virtual locations of tokens when parsing
5801         expressions.  Pass a virtual location to eval_token and to
5802         diagnostic routines.
5804 2012-05-10  Tristan Gingold  <gingold@adacore.com>
5806         * expr.c (interpret_float_suffix): Add a guard.
5808 2012-05-02  Dodji Seketeli  <dodji@redhat.com>
5810         Properly initialize cpp_context in destringize_and_run
5811         * directives.c (destringize_and_run): Properly initialize the new
5812         context.
5813         * macro.c (_cpp_pop_context): Assert that we shouldn't try to pop
5814         the initial base context, which has the same life time as the
5815         current instance of cpp_file.
5817 2012-04-30  Manuel LĂłpez-Ibáñez  <manu@gcc.gnu.org>
5818             Dodji Seketeli  <dodji@seketeli.org>
5820         PR c++/52974
5821         * libcpp/files.c (maybe_shorter_path): New.
5822         (find_file_in_dir): Use it.
5824 2012-04-30  Dodji Seketeli  <dodji@redhat.com>
5826         Switch -ftrack-macro-expansion=2 on by default.
5827         * init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
5828         by default.  Add comments.
5830         Strip "<built-in>" loc from displayed expansion context
5831         * include/line-map.h (linemap_unwind_toward_expansion): Fix typo
5832         in comment.
5833         (linemap_unwind_to_first_non_reserved_loc): Declare new function.
5834         * line-map.c (linemap_unwind_to_first_non_reserved_loc): Define
5835         new function.
5837         Fix expansion point loc for macro-like tokens
5838         * macro.c (macro_of_context): New static function.
5839         (_cpp_push_token_context, push_extended_tokens_context): If the
5840         macro argument is NULL, it means we are continuing the expansion
5841         of the current macro, if any.  Update comments.
5842         (_cpp_pop_context): Re-enable expansion of the macro only when we
5843         are really out of the context of the current expansion.
5845         Fix token pasting with -ftrack-macro-expansion
5846         * macro.c (paste_all_tokens): Put the token resulting from pasting
5847         into an extended token context with -ftrack-macro-location is in
5848         effect.
5850         Fix cpp_sys_macro_p with -ftrack-macro-expansion
5851         * macro.c (cpp_sys_macro_p):  Support -ftrack-macro-expansion.
5853 2012-04-29  Dodji Seketeli  <dodji@redhat.com>
5855         * lex.c (lex_raw_string): Change C++ style comments into C style
5856         comments.
5857         (lex_string): Likewise.
5859 2012-04-27   Ollie Wild  <aaw@google.com>
5861         * include/cpplib.h (struct cpp_options): Add new field,
5862         warn_literal_suffix.
5863         (CPP_W_LITERAL_SUFFIX): New enum.
5864         * init.c (cpp_create_reader): Default initialization of
5865         warn_literal_suffix.
5866         * lex.c (lex_raw_string): Treat user-defined literals which don't
5867         begin with '_' as separate tokens and produce a warning.
5868         (lex_string): Ditto.
5870 2012-04-26  Manuel LĂłpez-Ibáñez  <manu@gcc.gnu.org>
5872         * line-map.c (linemap_resolve_location): Synchronize comments with
5873         those in line-map.h.
5874         * include/line-map.h (linemap_resolve_location): Fix spelling in
5875         comment.
5877 2012-03-22  Richard Earnshaw  <rearnsha@arm.com>
5879         * lex.c (search_line_fast): Provide Neon-optimized version for ARM.
5881 2012-03-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
5883         * lex.c: Remove Solaris 8 reference.
5885 2012-02-14  Walter Lee  <walt@tilera.com>
5887         * configure.ac: Require 64-bit hwint for tilegx and tilepro.
5888         * configure: Regenerate.
5890 2012-01-09  Richard Guenther  <rguenther@suse.de>
5892         * macro.c (_cpp_builtin_macro_text): Remove unused variable map.
5894 2012-01-09  Gary Funck  <gary@intrepid.com>
5896         PR preprocessor/33919
5897         * files.c (_cpp_get_file_name): New. Implement file name
5898         access function.
5899         * internal.h (_cpp_get_file_name): New prototype.
5900         * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
5901         to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
5903 2012-01-03  Olivier Hainque  <hainque@adacore.com>
5905         * system.h: Prior to #define, #undef fopen and freopen unconditionally.
5907 2011-12-20  Joseph Myers  <joseph@codesourcery.com>
5909         * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
5910         (CLK_STDC1X): Change to CLK_STDC11.
5911         * init.c (lang_defaults): Update comments.
5912         (cpp_init_builtins): Update language tests.  Use 201112L for C11
5913         __STDC_VERSION__.
5915 2011-12-20  Andreas Schwab  <schwab@linux-m68k.org>
5917         * configure: Regenerate.
5919 2011-12-19  Andreas Schwab  <schwab@linux-m68k.org>
5921         * configure: Regenerate.
5923 2011-12-07  Jakub Jelinek  <jakub@redhat.com>
5925         PR bootstrap/50237
5926         * internal.h (_cpp_init_lexer): New prototype.
5927         * init.c (init_library): Call it.
5928         * lex.c (init_vectorized_lexer): Remove constructor attribute,
5929         add inline keyword.
5930         (HAVE_init_vectorized_lexer): Define.
5931         (_cpp_init_lexer): New function.
5933 2011-12-03  Dodji Seketeli  <dodji@redhat.com>
5935         * macro.c (tokens_buff_remove_last_token)
5936         (tokens_buff_put_token_to): Add an 'inline' function specifier to
5937         the prototype.
5939 2011-11-22   Diego Novillo  <dnovillo@google.com>
5941         * include/line-map.h (linemap_dump): Declare.
5942         (line_table_dump): Declare.
5943         * line-map.c (linemap_dump): New.
5944         (line_table_dump): New.
5946 2011-11-21  Ed Smith-Rowland  <3dw4rd@verizon.net>
5948         PR c++/50958
5949         * expr.c (cpp_userdef_char_remove_type): Fix typo.
5951 2011-11-03  Michael Matz  <matz@suse.de>
5953         PR bootstrap/50857
5954         * configure.ac: Check for -fno-exceptions -fno-rtti.
5955         * configure: Regenerate.
5956         * Makefile.in (NOEXCEPTION_FLAGS): New flag.
5957         (ALL_CXXFLAGS): Use it.
5959 2011-11-02  Paolo Carlini  <paolo.carlini@oracle.com>
5961         * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
5963 2011-11-02  Jason Merrill  <jason@redhat.com>
5965         PR c++/50810
5966         * configure.ac: Add -Wno-narrowing to warning options.
5968 2011-10-31  Jason Merrill  <jason@redhat.com>
5970         PR libstdc++/1773
5971         * init.c (cpp_init_builtins): Set __cplusplus for C++11.
5973         PR c++/50920
5974         * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
5975         CLK_GNUCXX0X to CLK_GNUCXX11.
5977 2011-10-26  Ed Smith-Rowland  <3dw4rd@verizon.net>
5979         Implement C++11 user-defined literals.
5980         * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
5981         cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
5982         cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
5983         cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
5984         (cpp_classify_number): Classify unrecognized tokens as user-defined
5985         literals.
5986         * include/cpplib.h: Add new tokens for user-defined literals.
5987         * init.c: Add new preprocessor flag (cxx11).
5988         * lex.c: (lex_string, lex_raw_string): Handle user-defined literals
5989         including concatenation and promotion with suffixes.
5991 2011-10-24  Dodji Seketeli  <dodji@redhat.com>
5993         * line-map.c (linemap_macro_map_lookup): Fix logic.
5995 2011-10-24  Dodji Seketeli  <dodji@redhat.com>
5997         * include/line-map.h (linemap_expand_location): Take a line table
5998         parameter.  Update comment.
5999         (linemap_resolve_location): Update comment.
6000         (linemap_expand_location_full): Remove.
6001         * line-map.c (linemap_resolve_location):  Handle reserved
6002         locations; return a NULL map in those cases.
6003         (linemap_expand_location): If location is reserved, return a
6004         zeroed expanded location.  Update comment.  Take a line table to
6005         assert that the function takes non-virtual locations only.
6006         (linemap_expand_location_full): remove.
6007         (linemap_dump_location): Handle the fact that
6008         linemap_resolve_location can return NULL line maps when the
6009         location resolves to a reserved location.
6011         * line-map.c (linemap_macro_map_lookup): Fix logic.
6013 2011-10-22  Dodji Seketeli  <dodji@redhat.com>
6015         PR bootstrap/50778
6016         * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
6017         context to act upon.
6018         * lex.c (_cpp_remaining_tokens_num_in_context): Likewise.  Update
6019         comment.
6020         (cpp_token_from_context_at): Likewise.
6021         (cpp_peek_token): Use the context to peek tokens from.
6023 2011-10-20  Dodji Seketeli  <dodji@redhat.com>
6025         PR bootstrap/50801
6026         * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
6027         number of tokens.
6029 2011-10-18  Dodji Seketeli  <dodji@redhat.com>
6031         PR bootstrap/50760
6032         * include/line-map.h (struct linemap_stats): Change the type of
6033         the members from size_t to long.
6034         * macro.c (macro_arg_token_iter_init): Unconditionally initialize
6035         iter->location_ptr.
6037 2011-10-17  Dodji Seketeli  <dodji@redhat.com>
6039         * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
6040         variable without using it if ENABLE_CHECKING is not defined.  Mark
6041         the LOCATION parameter as being unused.
6043 2011-10-15  Tom Tromey  <tromey@redhat.com>
6044             Dodji Seketeli  <dodji@redhat.com>
6046         * include/line-map.h (struct line_maps::alloced_size_for_request):
6047         New member.
6048         * line-map.c (new_linemap): Use set->alloced_size_for_request to
6049         get the actual allocated size of line maps.
6051 2011-10-15  Tom Tromey  <tromey@redhat.com>
6052             Dodji Seketeli  <dodji@redhat.com>
6054         * line-map.h (struct linemap_stats): Declare new struct.
6055         (linemap_get_statistics): Declare ...
6056         * line-map.c (linemap_get_statistics):  ... new function.
6057         * macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
6058         Declare new counters.
6059         (enter_macro_context, replace_args): Update
6060         num_macro_tokens_counter.
6061         (cpp_get_token_1): Update num_expanded_macros_counter.
6063 2011-10-15  Tom Tromey  <tromey@redhat.com>
6064             Dodji Seketeli  <dodji@redhat.com>
6066         * include/cpplib.h (struct cpp_options)<debug>: New struct member.
6067         * include/line-map.h (linemap_dump_location): Declare ...
6068         * line-map.c (linemap_dump_location): ... new function.
6070 2011-10-15  Tom Tromey  <tromey@redhat.com>
6071             Dodji Seketeli  <dodji@redhat.com>
6073         * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
6074         New option.
6075         * internal.h (struct macro_context): New struct.
6076         (enum context_tokens_kind): New enum.
6077         (struct cpp_context)<tokens_kind>: New member of type enum
6078         context_tokens_kind.
6079         (struct cpp_context)<macro>: Remove this.  Replace it with an enum
6080         of macro and  macro_context.
6081         (struct cpp_context)<direct_p>: Remove.
6082         (_cpp_remaining_tokens_num_in_context): Declare new function.
6083         * directives.c (destringize_and_run): Adjust.
6084         * lex.c (_cpp_remaining_tokens_num_in_context)
6085         (_cpp_token_from_context_at): Define new functions
6086         (cpp_peek_token): Use them.
6087         * init.c (cpp_create_reader): Initialize the base context to zero.
6088         (_cpp_token_from_context_at): Define new static function.
6089         (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
6090         _cpp_token_from_context_at.
6091         * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
6092         members.
6093         (enum macro_arg_token_kind): New enum.
6094         (struct macro_arg_token_iter): New struct.
6095         (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
6096         (alloc_expanded_arg_mem, ensure_expanded_arg_room)
6097         (delete_macro_args, set_arg_token, get_arg_token_location)
6098         (arg_token_ptr_at, macro_arg_token_iter_init)
6099         (macro_arg_token_iter_get_token)
6100         (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
6101         (expanded_token_index, tokens_buff_new, tokens_buff_count)
6102         (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
6103         (tokens_buff_add_token, tokens_buff_remove_last_token)
6104         (reached_end_of_context, consume_next_token_from_context): New
6105         static functions.
6106         (cpp_get_token_1): New static function. Split and extended from
6107         cpp_get_token.  Use reached_end_of_context and
6108         consume_next_token_from_context.  Unify its return point.  Move
6109         the location tweaking from cpp_get_token_with_location in here.
6110         (cpp_get_token): Use cpp_get_token_1
6111         (stringify_arg): Use the new arg_token_at.
6112         (paste_all_tokens): Support tokens coming from extended tokens
6113         contexts.
6114         (collect_args): Return the number of collected arguments, by
6115         parameter.  Store virtual locations of tokens that constitute the
6116         collected args.
6117         (funlike_invocation_p): Return the number of collected arguments,
6118         by parameter.
6119         (enter_macro_context): Add a parameter for macro expansion point.
6120         Pass it to replace_args and to the "used" cpp callback.  Get the
6121         number of function-like macro arguments from funlike_invocation_p,
6122         pass it to the new delete_macro_args to free the memory used by
6123         macro args.  When -ftrack-macro-expansion is in effect, for macros
6124         that have no arguments, create a macro map for the macro expansion
6125         and use it to allocate proper virtual locations for tokens
6126         resulting from the expansion.  Push an extended tokens context
6127         containing the tokens resulting from macro expansion and their
6128         virtual locations.
6129         (replace_args): Rename the different variables named 'count' into
6130         variables with more meaningful names.  Create a macro map;
6131         allocate virtual locations of tokens resulting from this
6132         expansion.  Use macro_arg_token_iter to iterate over tokens of a
6133         given macro.  Handle the case of the argument of
6134         -ftrack-macro-expansion being < 2.  Don't free macro arguments
6135         memory resulting from expand_arg here, as these are freed by the
6136         caller of replace_arg using delete_macro_args now.  Push extended
6137         token context.
6138         (next_context, push_ptoken_context, _cpp_push_token_context)
6139         (_cpp_push_text_context): Properly initialize the context.
6140         (expand_arg): Use the new alloc_expanded_arg_mem,
6141         push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
6142         (_cpp_pop_context): Really free the memory held by the context.
6143         Handle freeing memory used by extended tokens contexts.
6144         (cpp_get_token_with_location): Use cpp_get_token_1.
6145         (cpp_sys_macro_p): Adjust.
6146         (_cpp_backup_tokens): Support the new kinds of token contexts.
6147         * traditional.c (recursive_macro): Adjust.
6149 2011-10-15  Tom Tromey  <tromey@redhat>
6150             Dodji Seketeli  <dodji@redhat.com>
6152         * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
6153         member.
6154         (MAX_SOURCE_LOCATION): New constant.
6155         (struct line_map_ordinary, struct line_map_macro): New structs.
6156         (struct line_map): Turn this into a union of the two above.  Add
6157         comments.
6158         (struct maps_info): New struct.
6159         (struct line_maps)<info_ordinary, info_macro>: Two new fields.
6160         These now carry the map information that was previously scattered
6161         in struct line_maps.
6162         (struct map_info::allocated): Fix comment.
6163         (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
6164         (ORDINARY_MAP_STARTING_LINE_NUMBER)
6165         (ORDINARY_MAP_INCLUDER_FILE_INDEX)
6166         (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
6167         (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
6168         (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
6169         (MACRO_MAP_EXPANSION_POINT_LOCATION)
6170         (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
6171         (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
6172         (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
6173         (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
6174         (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
6175         (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
6176         (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
6177         (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
6178         (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
6179         (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
6180         (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
6181         information.
6182         (linemap_check_ordinary, linemap_assert)
6183         (linemap_location_before_p): New macros.
6184         (linemap_position_for_line_and_column)
6185         (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
6186         (linemap_macro_expansion_map_p)
6187         (linemap_macro_map_loc_to_def_point)
6188         (linemap_macro_map_loc_unwind_once)
6189         (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
6190         (linemap_get_source_line linemap_get_source_column)
6191         (linemap_map_get_macro_name, linemap_get_file_path)
6192         (linemap_location_in_system_header_p)
6193         (linemap_location_from_macro_expansion_p): Declare new functions.
6194         (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
6195         (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
6196         accessors act on ordinary maps only.
6197         (INCLUDED_FROM): Return NULL for main files; use the new
6198         accessors.
6199         (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
6200         (struct expanded_location): Move here from gcc/input.h
6201         (linemap_resolve_location, linemap_expand_location)
6202         (linemap_expand_location_full): Declare new functions.
6203         * line-map.c: Include cpplib.h, internal.h
6204         (linemap_enter_macro, linemap_add_macro_token)
6205         (linemap_get_expansion_line, linemap_get_expansion_filename): New
6206         functions that are private to libcpp.
6207         (linemap_assert): New macro.
6208         (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
6209         (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
6210         (linemap_macro_map_loc_unwind_toward_spelling)
6211         (linemap_macro_map_loc_to_exp_point)
6212         (first_map_in_common_1, first_map_in_common): New static
6213         functions.
6214         (new_linemap): Define new static functions.  Extracted and
6215         enhanced from ...
6216         (linemap_add): ... here.  Use linemap_assert in lieu of abort
6217         previously.
6218         (linemap_tracks_macro_expansion_locs_p)
6219         (linemap_add_macro_token, linemap_macro_expansion_map_p)
6220         (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
6221         (linemap_macro_map_loc_to_def_point)
6222         (linemap_macro_map_loc_unwind_once)
6223         (linemap_step_out_once, linemap_map_get_index)
6224         (linemap_get_source_line,linemap_get_source_column)
6225         (linemap_get_file_path, linemap_map_get_macro_name)
6226         (linemap_location_in_system_header_p)
6227         (linemap_location_originated_from_system_header_p)
6228         (linemap_location_from_macro_expansion_p)
6229         (linemap_tracks_macro_expansion_locs_p)
6230         (linemap_resolve_location, linemap_expand_location)
6231         (linemap_expand_location_full)
6232         (linemap_tracks_macro_expansion_locs_p)
6233         (linemap_position_for_line_and_column, linemap_compare_locations):
6234         Define new public functions.
6235         (linemap_init): Initialize ordinary and macro maps information in
6236         the map set.
6237         (linemap_check_files_exited): Use the new accessors.
6238         (linemap_free): Remove this dead code.
6239         (linemap_line_start): Assert this uses an ordinary map.  Adjust to
6240         use the new ordinary map accessors and data structures.  Don't
6241         overflow past the lowest possible macro token's location.
6242         (linemap_position_for_column): Assert the ordinary maps of the map
6243         set are really ordinary.  Use ordinary map accessors.
6244         (linemap_lookup): Keep the same logic but generalize to allow
6245         lookup of both ordinary and macro maps.  Do not crash when called
6246         with an empty line table.
6247         * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
6248         new API of line-map.h.
6249         * directives.c (start_directive, do_line, do_linemarker)
6250         (do_linemarker): Likewise.
6251         * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
6252         (make_cpp_dir, cpp_make_system_header): Likewise.
6253         * init.c (cpp_read_main_file): Likewise.
6254         * internal.h (CPP_INCREMENT_LINE): Likewise.
6255         (linemap_enter_macro, linemap_add_macro_token)
6256         (linemap_get_expansion_line, linemap_get_expansion_filename): New
6257         functions private to libcpp.
6258         * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
6259         (skip_line_comment, skip_whitespace, lex_raw_string)
6260         (_cpp_lex_direct): Likewise.
6261         * macro.c (_cpp_builtin_macro_text): Likewise.
6262         (_cpp_aligned_alloc): Initialize the new name member of the macro.
6263         * traditional.c (copy_comment, _cpp_scan_out_logical_line):
6264         Likewise.
6265         * errors.c (cpp_diagnostic): Adjust to new linemap API.
6267 2011-08-28  Dodji Seketeli  <dodji@redhat.com>
6269         * line-map.c (linemap_add): Assert that reason must not be
6270         LC_RENAME when called for the first time on a "main input file".
6272 2011-08-22  Gabriel Charette  <gchare@google.com>
6274         * init.c (cpp_create_reader): Inititalize forced_token_location_p.
6275         * internal.h (struct cpp_reader): Add field forced_token_location_p.
6276         * lex.c (_cpp_lex_direct): Use forced_token_location_p.
6277         (cpp_force_token_locations): New.
6278         (cpp_stop_forcing_token_locations): New.
6280 2011-08-18  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
6282         PR libstdc++/1773
6283         * init.c (cpp_init_builtins): Define __cplusplus 19971L.
6285 2011-08-18  Joseph Myers  <joseph@codesourcery.com>
6287         * include/cpplib.h (struct cpp_options): Fix typo.
6289 2011-08-18  Joseph Myers  <joseph@codesourcery.com>
6291         * include/cpplib.h (struct cpp_options): Add rliterals.
6292         * init.c  (struct lang_flags, lang_defaults): Add rliterals.
6293         (cpp_set_lang): Set rliterals option.
6294         (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
6295         * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
6297 2011-08-15  Gabriel Charette  <gchare@google.com>
6299         * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
6300         Update all users to use linemap_position_for_column instead.
6302 2011-07-28  Gabriel Charette  <gchare@google.com>
6304         * include/line-map.h (struct line_maps):
6305         Remove unused field last_listed. Update all users.
6307 2011-07-28  H.J. Lu  <hongjiu.lu@intel.com>
6309         * configure.ac: Set need_64bit_hwint to yes for x86 targets.
6310         * configure: Regenerated.
6312 2011-07-25  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
6314         * system.h [__cplusplus]: Wrap C function declarations in extern "C".
6316 2011-07-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
6317             Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
6319         PR bootstrap/49794
6320         * configure.ac: Test AM_ICONV with CXX.
6321         * configure: Regenerate.
6322         * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
6324 2011-07-15  Dodji Seketeli  <dodji@redhat.com>
6326         * directives.c (struct if_stack): Use source_location as type
6327         here.
6328         * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
6329         indent, def_pragma, used_define, used_undef>: Properly use
6330         source_location as parameter type, rather than unsigned int.
6332 2011-07-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
6334         PR target/39150
6335         * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
6336         like i[34567]86-*-solaris2.1[0-9]*.
6337         * configure: Regenerate.
6339 2011-06-16  Jason Merrill  <jason@redhat.com>
6341         PR c++/45399
6342         * lex.c (lex_raw_string): Don't check for embedded NUL.
6344 2011-06-06  Dodji Seketeli  <dodji@redhat.com>
6346         PR preprocessor/48532
6347         * directives.c (do_pragma): Don't forget the invocation location
6348         when parsing the pragma name of a namespaced pragma directive.
6350 2011-05-29  John Tytgat  <John.Tytgat@aaug.net>
6352         * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
6354 2011-05-22  Uros Bizjak  <ubizjak@gmail.com>
6356         PR target/49104
6357         * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
6358         is defined.  Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
6360 2011-04-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
6362         * system.h (ENUM_BITFIELD): Remove.
6364 2011-04-24  Jakub Jelinek  <jakub@redhat.com>
6366         PR preprocessor/48740
6367         * lex.c (lex_raw_string): When raw string ends with
6368         ??) followed by raw prefix and ", ensure it is preprocessed
6369         with ??) rather than ??].
6371 2011-04-20  Jim Meyering  <meyering@redhat.com>
6373         * files.c (destroy_cpp_file): Remove useless if-before-free.
6374         * init.c (cpp_destroy): Likewise.
6375         * macro.c (replace_args): Likewise.
6376         * pch.c (cpp_valid_state): Likewise.
6378 2011-03-25  Kai Tietz  <ktietz@redhat.com>
6380         * files.c (file_hash_eq): Use filename_cmp
6381         instead of strcmp.
6382         (nonexistent_file_hash_eq): Likewise.
6383         (remap_filename): Likewise.
6384         Handle absolute DOS-path,
6385         (append_file_to_dir): Check for IS_DIR_SEPARATOR
6386         instead of slash.
6387         (read_name_map): Likewise.
6388         * linemap.c (linemap_add): Use filename_cmp
6389         instead of strcmp.
6390         * mkdeps.c (apply_vpath): Use filename_ncmp
6391         instead of strncmp.
6392         (deps_restore): Use filename_cmp instead of
6393         strcmp.
6394         * init.c (read_original_directory): Use
6395         IS_DIR_SEPARATOR instead of checking for slash.
6397 2011-03-21  Michael Meissner  <meissner@linux.vnet.ibm.com>
6399         PR preprocessor/48192
6400         * directives.c (do_ifdef): Do not consider conditional macros as
6401         being defined.
6402         (do_ifndef): Ditto.
6403         * expr.c (parse_defined): Ditto.
6405 2011-03-18  Richard Henderson  <rth@redhat.com>
6407         PR bootstrap/45381
6408         * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
6410 2011-11-04  Eric Botcazou  <ebotcazou@adacore.com>
6411             Jakub Jelinek  <jakub@redhat.com>
6413         PR preprocessor/39213
6414         * directives.c (end_directive): Call _cpp_remove_overlay for deferred
6415         pragmas as well in traditional mode.
6417 2010-11-17  Ian Lance Taylor  <iant@google.com>
6419         PR bootstrap/45538
6420         * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS.  Remove switch of
6421         AC_LANG based on ENABLE_BUILD_WITH_CXX.
6423 2010-11-16  Kai Tietz  <kai.tietz@onevision.com>
6425         PR preprocessor/17349
6426         * lex.c (save_comment): Handle in argument passing c++
6427         comments special.
6429 2010-11-02  Ian Lance Taylor  <iant@google.com>
6431         * configure.ac: Use AC_SYS_LARGEFILE.
6432         * configure: Rebuild.
6433         * config.in: Rebuild.
6435 2010-10-19  Basile Starynkevitch  <basile@starynkevitch.net>
6437         * line-map.h (source_location): Remove obsolete comment
6438         mentioning location_s.
6440 2010-09-29  Kai Tietz  <kai.tietz@onevision.com>
6442         PR preprocessor/45362
6443         * directives.c (cpp_pop_definition): Make static.
6444         (do_pragma_push_macro): Reworked to store text
6445         definition.
6446         (do_pragma_pop_macro): Add free text definition.
6447         (cpp_push_definition): Removed.
6448         * include/cpplib.h (cpp_push_definition): Removed.
6449         (cpp_pop_definition): Likewise.
6450         * internal.h (def_pragma_macro): Remove member 'value'
6451         and add new members 'definition', 'line',
6452         'syshdr', 'sued' and 'is_undef'.
6453         * pch.c (_cpp_restore_pushed_macros): Rework to work
6454         on text definition and store additional macro flags.
6455         (_cpp_save_pushed_macros): Likewise.
6457 2010-09-29  Joseph Myers  <joseph@codesourcery.com>
6459         * include/cpplib.h (cpp_options): Rename warn_deprecated,
6460         warn_traditional, warn_long_long and pedantic.
6461         * directives.c (directive_diagnostics, _cpp_handle_directive):
6462         Update names of cpp_options members.
6463         * expr.c (cpp_classify_number, eval_token): Update names of
6464         cpp_options members.
6465         * init.c (cpp_create_reader, post_options): Update names of
6466         cpp_options members.
6467         * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
6468         cpp_options members.
6469         * macro.c (parse_params): Update names of cpp_options members.
6471 2010-09-15  Ian Lance Taylor  <iant@google.com>
6473         * init.c: Fix type name in comment.
6475 2010-08-31  Jakub Jelinek  <jakub@redhat.com>
6477         PR preprocessor/45457
6478         * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
6479         needed.
6480         * directives.c (do_ifdef, do_ifndef): Likewise.
6482 2010-08-26  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
6484         * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
6486 2010-08-24  Richard Henderson  <rth@redhat.com>
6488         PR bootstrap/45376
6489         * configure.ac (HAVE_SSE4): New check.
6490         * configure, config.in: Rebuild.
6491         * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
6493 2010-08-24  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
6495         * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
6496         etc. on Solaris 2/x86.
6498 2010-08-21  Richard Henderson  <rth@redhat.com>
6499             Andi Kleen <ak@linux.intel.com>
6500             David S. Miller  <davem@davemloft.net>
6502         * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
6503         (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
6504         (ptrdiff_t): Check via AC_CHECK_TYPE.
6505         * config.in, configure: Rebuild.
6506         * system.h: Include stdint.h, if available.
6507         * lex.c (WORDS_BIGENDIAN): Provide default.
6508         (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
6509         acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
6510         search_line_sse2, search_line_sse42, init_vectorized_lexer,
6511         search_line_fast): New.
6512         (_cpp_clean_line): Use search_line_fast.  Restructure the fast
6513         loop to make it clear when we're leaving the loop.  Stay in the
6514         fast loop for non-trigraph '?'.
6516 2010-06-11  Jakub Jelinek  <jakub@redhat.com>
6518         * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
6519         callback.
6520         (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
6521         (cpp_macro_definition): Remove const qual from second argument.
6522         * macro.c (enter_macro_context): Call user_builtin_macro callback for
6523         NODE_BUILTIN !NODE_USED macros.
6524         (warn_of_redefinition): Likewise.  Remove const qual from second
6525         argument.
6526         (cpp_macro_definition): Likewise.
6527         * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
6528         for NODE_BUILTIN !NODE_USED macros.
6530 2010-06-10  Joseph Myers  <joseph@codesourcery.com>
6532         * include/cpplib.h (struct cpp_options): Remove show_column.
6533         * init.c (cpp_create_reader, post_options): Don't set show_column.
6535 2010-06-09  Joern Rennecke  <joern.rennecke@embecosm.com>
6537         PR bootstrap/44432
6538         * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
6539         check that C++ compiler works.
6540         * configure: Regenerate.
6542 2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
6544         * include/symtab.h (ht_identifier_ptr): New.
6546 2010-06-03  Joern Rennecke <joern.rennecke@embecosm.com>
6547             Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
6549         PR bootstrap/42798
6550         * configure.ac: Check for declaration of 'basename(char *)'.
6551         * configure: Regenerate.
6552         * config.in: Regenerate.
6554 2010-04-25  Joseph Myers  <joseph@codesourcery.com>
6556         * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
6557         * init.c (lang_defaults): Add entries for new language variants.
6558         (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
6559         variants.
6561 2010-04-09  Manuel LĂłpez-Ibáñez <manu@gcc.gnu.org>
6563         PR cpp/43195
6564         * files.c (report_missing_guard): Test for #pragma once.
6566 2010-04-07  Simon Baldwin  <simonb@google.com>
6568         * directives.c (do_diagnostic): Add warning reason argument,
6569         call appropriate error reporting function for code.
6570         (directive_diagnostics): Call specific warning functions with
6571         warning reason where appropriate.
6572         (do_error, do_warning, do_pragma_dependency): Add warning reason
6573         argument to do_diagnostic calls.
6574         * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
6575         _cpp_create_definition): Call specific warning functions with
6576         warning reason where appropriate.
6577         * Makefile.in: Add new diagnostic functions to gettext translations.
6578         * include/cpplib.h (struct cpp_callbacks): Add warning reason code
6579         to error callback.
6580         (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
6581         CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
6582         (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
6583         CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
6584         CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
6585         CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
6586         CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
6587         CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
6588         CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
6589         warning reason codes.
6590         (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
6591         cpp_warning_with_line, cpp_pedwarning_with_line,
6592         cpp_warning_with_line_syshdr): New specific error reporting functions.
6593         * pch.c (cpp_valid_state): Call specific warning functions with
6594         warning reason where appropriate.
6595         * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
6596         diagnostic handlers.
6597         (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
6598         cpp_warning_with_line, cpp_pedwarning_with_line,
6599         cpp_warning_with_line_syshdr): New specific error reporting functions.
6600         * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
6601         specific warning functions with warning reason where appropriate.
6602         * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
6603         warn_about_normalization, lex_identifier_intern, lex_identifier,
6604         _cpp_lex_direct): Ditto.
6605         * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
6606         narrow_str_to_charconst): Ditto.
6608 2010-04-06  Jakub Jelinek  <jakub@redhat.com>
6610         PR preprocessor/43642
6611         * lex.c (lex_raw_string): Change type of TYPE variable to
6612         unsigned char.
6614 2010-04-02  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
6616         * aclocal.m4: Regenerate.
6618 2010-03-29  Jason Merrill  <jason@redhat.com>
6620         More N3077 raw string changes
6621         * charset.c (cpp_interpret_string): Don't transform UCNs in raw
6622         strings.
6623         * lex.c (bufring_append): Split out from...
6624         (lex_raw_string): ...here.  Undo trigraph and line splicing
6625         transformations.  Do process line notes in multi-line literals.
6626         (_cpp_process_line_notes): Ignore notes that were already handled.
6628         Some raw string changes from N3077
6629         * charset.c (cpp_interpret_string): Change inner delimiters to ().
6630         * lex.c (lex_raw_string): Likewise.  Also disallow '\' in delimiter.
6632 2010-02-11  Jakub Jelinek  <jakub@redhat.com>
6634         * init.c (read_original_filename): Don't call read_original_directory
6635         if _cpp_handle_directive returns 0.
6637 2010-01-01  Joseph Myers  <joseph@codesourcery.com>
6639         PR preprocessor/41947
6640         * expr.c (cpp_classify_number): Give error for hexadecimal
6641         floating-point constant with no digits before or after point.
6643 2009-11-20  Arnaud Charlet  <charlet@adacore.com>
6645         * macro.c (enter_macro_context): Call cb.used callback if defined.
6646         * directives.c (do_idef, do_ifndef): Ditto.
6647         * include/cpplib.h (struct cpp_callbacks): Add used callback.
6649 2009-11-11  Kai Tietz  <kai.tietz@onevision.com>
6651         * directives.c (do_pragma_push_macro): New pragma handler.
6652         (do_pragma_pop_macro): Likewise.
6653         (_cpp_init_internal_pragmas): Add push_macro and
6654         pop_macro handler to internal pragmas.
6655         (lex_macro_node_from_str): Removed.
6656         (cpp_push_definition): Replace lex_macro_node_from_str
6657         by _cpp_lex_identifier.
6658         (cpp_pop_definition): Likewise.
6659         * internal.h (_cpp_lex_identifier): New prototype.
6660         (def_pragma_macro): New structure.
6661         (cpp_reader): New member pushed_macros.
6662         * lex.c (_cpp_lex_identifier): New function.
6663         (lex_identifier_intern): New function.
6664         * init.c (cpp_create_reader): Initialize pushed_macros
6665         member.
6666         (cpp_destroy): Free elements in pushed_macros member.
6667         * pch.c (_cpp_save_pushed_macros): New function.
6668         (_cpp_restore_pushed_macros): Likewise.
6669         (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
6670         (cpp_read_state): Use _cpp_restore_pushed_macros.
6672 2009-10-19  Jakub Jelinek  <jakub@redhat.com>
6674         * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
6675         (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
6676         and char32_cset_desc.
6677         (converter_for_type): Handle CPP_UTF8STRING.
6678         (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
6679         * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
6680         (parse_include): Reject raw strings.
6681         * include/cpplib.h (CPP_UTF8STRING): New token type.
6682         * internal.h (struct cpp_reader): Add utf8_cset_desc field.
6683         * lex.c (lex_raw_string): New function.
6684         (lex_string): Handle u8 string literals, call lex_raw_string
6685         for raw string literals.
6686         (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
6687         sequences.
6688         * macro.c (stringify_arg): Handle CPP_UTF8STRING.
6690 2009-10-14  Jakub Jelinek  <jakub@redhat.com>
6692         PR preprocessor/41543
6693         * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
6694         * line-map.c (linemap_init): Initialize highest_location and
6695         highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
6697 2009-10-09  Jason Merrill  <jason@redhat.com>
6699         * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
6701 2009-10-09  Neil Vachharajani <nvachhar@google.com>
6703         * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
6704         sccs.
6706 2009-09-23  Loren J. Rittle  <ljrittle@acm.org>
6708         * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
6709         * configure: Rebuilt.
6711 2009-09-22  Richard Guenther  <rguenther@suse.de>
6713         PR pch/38987
6714         * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
6716 2009-09-18  Chris Demetriou  <cgd@google.com>
6718         PR preprocessor/28435:
6719         * include/cpplib.h (struct cpp_options): Add new member
6720         deps.need_preprocessor_output.
6721         * files.c (open_file_failed): If preprocessor output is needed
6722         always report an error.
6724 2009-09-13  Kai Tietz  <kai.tietz@onevision.com>
6726         * configure.ac: Set for i?86-w64-mingw*
6727         need_64bit_hwint to yes.
6728         * configure: Regenerated.
6730 2009-09-10  Jason Merrill  <jason@redhat.com>
6732         * directives.c (cpp_define): constify.
6734 2009-09-02  Ian Lance Taylor  <iant@google.com>
6736         * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
6738 2009-08-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
6740         * configure.ac (AC_PREREQ): Bump to 2.64.
6742 2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
6744         * aclocal.m4: Regenerate.
6745         * config.in: Regenerate.
6746         * configure: Regenerate.
6748 2009-08-17  Tom Tromey  <tromey@redhat.com>
6750         PR preprocessor/41067:
6751         * charset.c (convert_escape): Add missing ":" to error text.
6753 2009-07-27  Douglas B Rupp  <rupp@gnat.com>
6755         * include/cpplib.h (INO_T_CPP): New macro.
6756         (struct cpp_dir): Use it.
6758 2009-07-20  Jerry Quinn  <jlquinn@optonline.net>
6760         PR regression/40800
6761         * configure.ac: Use = instead of == for testing
6762         ENABLE_BUILD_WITH_CXX.
6763         * configure: Rebuild.
6765 2009-07-17  Jerry Quinn  <jlquinn@optonline.net>
6767         * directives.c (do_linemarker, do_line): Use CPP_STRING for
6768         ignored enum value.
6769         * files.c (find_file_in_dir): Add cast from void* to char*.
6770         * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
6771         * Makefile.in: (WARN_CFLAGS): Use general and C-specific
6772         warnings.
6773         (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
6774         ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
6775         COMPILER_FLAGS): New.
6776         (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
6777         (COMPILE.base): Use COMPILER instead of CC.  Use COMPILER_FLAGS
6778         instead of ALL_CFLAGS.
6779         * configure.ac: Invoke AC_PROG_CXX.  Separate C-specific warnings
6780         from other warnings.  Add -Wc++-compat to C-specific warnings.
6781         Check for --enable-build-with-cxx.  Set and substitute
6782         ENABLE_BUILD_WITH_CXX.  Invoke ZW_PROG_COMPILER_DEPENDENCIES
6783         according to ENABLE_BUILD_WITH_CXX.  Invoke AC_LANG before
6784         AC_CHECK_HEADERS.
6785         * configure: Rebuild.
6786         * include/cpp-id-data.h: Remove extern "C".
6787         * include/line-map.h: Likewise.
6788         * include/mkdeps.h: Likewise.
6789         * include/symtab.h: Likewise.
6790         * internal.h: Likewise.
6792 2009-06-23  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6794         * directives.c (parse_include): Add location argument. Update all
6795         calls.
6796         (parse_answer): Likewise.
6797         (do_include_common): Error with exact location.
6798         (parse_assertion): Likewise.
6800 2009-06-18  Manuel LĂłpez-Ibáñez  <manu@gcc.gnu.org>
6802         * expr.c (num_div_op): Take explicit location.
6804 2009-06-17  Ian Lance Taylor  <iant@google.com>
6806         * include/cpplib.h (progname): Don't declare.
6808 2009-06-12  Ian Lance Taylor  <iant@google.com>
6810         * include/cpplib.h (struct cpp_options): Add
6811         warn_cxx_operator_names field.
6812         (NODE_WARN_OPERATOR): Define.
6813         (struct cpp_hashnode): Increase flags field to 10 bits, decrease
6814         type to 6 bits.
6815         * init.c (mark_named_operators): Add flags parameter.
6816         (cpp_post_options): Pick flags value to pass to
6817         mark_named_operators.
6818         * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
6819         identifier is an operator name in C++.
6821 2009-06-01  Aldy Hernandez  <aldyh@redhat.com>
6823         * include/line-map.h (LAST_SOURCE_COLUMN): New.
6825 2009-06-01  Ian Lance Taylor  <iant@google.com>
6827         * include/cpp-id-data.h: Add extern "C".
6828         * include/line-map.h: Likewise.
6829         * include/mkdeps.h: Likewise.
6830         * include/symtab.h: Likewise.
6831         * internal.h: Likewise.
6833 2009-05-15  Ian Lance Taylor  <iant@google.com>
6835         * include/cpplib.h (enum cpp_builtin_type): Rename from enum
6836         builtin_type.  Change all uses.
6838 2009-05-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6840         PR cpp/36674
6841         * directives (do_linemarker): Compensate for the increment in
6842         location that occurs when we reach the end of line.
6843         * files (_cpp_stack_include): Mention _cpp_find_file in the
6844         comment.
6846 2009-05-10  Joseph Myers  <joseph@codesourcery.com>
6848         * include/cpplib.h (enum cpp_token_fld_kind): Add
6849         CPP_TOKEN_FLD_TOKEN_NO.
6850         (struct cpp_macro_arg, struct cpp_identifier): Define.
6851         (union cpp_token_u): Use struct cpp_identifier for identifiers.
6852         Use struct cpp_macro_arg for macro arguments.  Add token_no for
6853         CPP_PASTE token numbers.
6854         * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
6855         do_pragma_poison, parse_assertion): Use val.node.node in place of
6856         val.node.
6857         * expr.c (parse_defined, eval_token): Use val.node.node in place
6858         of val.node.
6859         * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
6860         cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
6861         cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
6862         place of val.arg_no.  Use val.node.node in place of val.node.
6863         * macro.c (replace_args, cpp_get_token, parse_params,
6864         lex_expansion_token, create_iso_definition, cpp_macro_definition):
6865         Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
6866         Use val.node.node in place of val.node.
6868 2009-05-03  Joseph Myers  <joseph@codesourcery.com>
6870         * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
6871         UTF-8 sequences.
6873 2009-04-25  Joseph Myers  <joseph@codesourcery.com>
6875         PR preprocessor/39559
6876         * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
6877         constants larger than intmax_t in C99 mode.
6879 2009-04-21  Taras Glek <tglek@mozilla.com>
6881         * include/cpp-id-data.h: Update GTY annotations to new syntax.
6882         * include/cpplib.h: Likewise.
6883         * include/line-map.h: Likewise.
6884         * include/symtab.h: Likewise.
6886 2009-04-22  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6888         PR c++/14875
6889         * lex.c (cpp_type2name): Take a flags parameter. Call
6890         cpp_named_operator2name for named operators and cpp_digraph2name
6891         for digraphs.
6892         (cpp_digraph2name): New.
6893         (cpp_spell_token): Use it.
6894         (cpp_output_token): Likewise.
6895         * include/cpplib.h (cpp_type2name): Update declaration.
6896         * init.c (cpp_named_operator2name): New.
6897         * internal.h (cpp_named_operator2name): Declare.
6899 2009-04-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6901         PR c++/13358
6902         * init.c (cpp_create_reader): Wlong_long is disabled by default.
6903         * expr.c (cpp_classify_number): Give different messages for C and
6904         C++ front-ends.
6906 2009-04-19  Joseph Myers  <joseph@codesourcery.com>
6908         PR preprocessor/20078
6909         * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
6910         field.
6911         * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
6912         (struct cpp_token): Change flags to unsigned short.
6913         * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
6914         (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
6915         (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
6916         tokens.
6917         * macro.c (macro_real_token_count): New.
6918         (enter_macro_context, replace_args): Use macro_real_token_count.
6919         (create_iso_definition): Record whitespace surrounding and digraph
6920         spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
6921         Set extra_tokens and save CPP_PASTE tokens with arg_no set for
6922         multiple consecutive ## tokens.
6923         (_cpp_create_definition): Initialize extra_tokens.
6924         (cpp_macro_definition): Use macro_real_token_count.
6926 2009-04-18  Joseph Myers  <joseph@codesourcery.com>
6928         * directives.c (parse_include): Pass true to check_eol.
6930 2009-04-18  Joseph Myers  <joseph@codesourcery.com>
6932         PR preprocessor/39646
6933         * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
6934         * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
6935         * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
6936         place of LC_RENAME.
6938 2009-04-18  Joseph Myers  <joseph@codesourcery.com>
6940         PR preprocessor/39647
6941         * directives.c (check_eol): Add parameter expand.
6942         (do_undef, parse_include, do_line, do_linemarker, do_ident,
6943         do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
6944         do_else, do_endif, do_assert, do_unassert): All callers changed.
6945         Pass true from do_line, false elsewhere.
6947 2009-04-12  Joseph Myers  <joseph@codesourcery.com>
6949         PR preprocessor/31869
6950         * macro.c (stringify_arg): Handle NULL source token in padding
6951         token where previous padding token did not have source token with
6952         preceding whitespace.
6954 2009-04-09  Jakub Jelinek  <jakub@redhat.com>
6956         * Makefile.in: Change copyright header to refer to version
6957         3 of the GNU General Public License and to point readers at the
6958         COPYING3 file and the FSF's license web page.
6959         * charset.c: Likewise.
6960         * directives-only.c: Likewise.
6961         * directives.c: Likewise.
6962         * errors.c: Likewise.
6963         * expr.c: Likewise.
6964         * files.c: Likewise.
6965         * identifiers.c: Likewise.
6966         * include/cpp-id-data.h: Likewise.
6967         * include/cpplib.h: Likewise.
6968         * include/line-map.h: Likewise.
6969         * include/mkdeps.h: Likewise.
6970         * include/symtab.h: Likewise.
6971         * init.c: Likewise.
6972         * internal.h: Likewise.
6973         * lex.c: Likewise.
6974         * line-map.c: Likewise.
6975         * macro.c: Likewise.
6976         * makeucnid.c: Likewise.
6977         * mkdeps.c: Likewise.
6978         * pch.c: Likewise.
6979         * symtab.c: Likewise.
6980         * system.h: Likewise.
6981         * traditional.c: Likewise.
6982         * ucnid.tab: Likewise.
6983         * ucnid.h: Regenerate.
6985 2009-04-01  Janis Johnson  <janis187@us.ibm.com>
6987         PR c/39027
6988         * include/cpplib.h (CPP_N_DEFAULT): Define.
6989         * expr.c (interpret_float_suffix): Recognize d or D for double,
6990         return new value for default.
6991         (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
6993         PR c/33466
6994         * expr.c (interpret_float_suffix): Reject invalid suffix that uses
6995         letters from decimal float and fixed-point suffixes.
6997 2009-03-31  Joseph Myers  <joseph@codesourcery.com>
6999         PR preprocessor/15638
7000         * files.c (_cpp_find_file): Call open_file_failed after diagnosing
7001         invalid PCH.
7002         (open_file_failed): Make error for missing file fatal.
7003         * include/cpplib.h (CPP_DL_FATAL): Define.
7005 2009-03-30  Sergiy Vyshnevetskiy  <serg@vostok.net>
7007         PR preprocessor/31932:
7008         * internal.h: Don't mention HAVE_ICONV_H.
7009         * configure, config.in: Rebuild.
7010         * configure.ac: Don't check for iconv.h.
7012 2009-03-30  Tom Tromey  <tromey@redhat.com>
7014         PR preprocessor/39512:
7015         * line-map.c (linemap_init): Initialize 'reallocator' field.
7017 2009-03-30  Jakub Jelinek  <jakub@redhat.com>
7019         PR target/39558
7020         * macro.c (cpp_get_token): If macro_to_expand returns NULL
7021         and used some tokens, add CPP_PADDING before next token.
7023 2009-03-29  Joseph Myers  <joseph@codesourcery.com>
7025         PR preprocessor/34695
7026         * makedepend.c: Remove.
7027         * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
7028         (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
7029         * directives.c (cpp_errors): Remove.
7030         * errors.c (print_location, _cpp_begin_message, v_message):
7031         Remove.
7032         (cpp_error, cpp_error_with_line): Always use error callback.
7033         (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
7034         * include/cpplib.h (cpp_options): Remove pedantic_errors,
7035         inhibit_warnings, warn_system_headers, inhibit_errors,
7036         warnings_are_errors, client_diagnostic.
7037         (cpp_callbacks): Add extra arguments to error callback; make it
7038         return bool.
7039         (cpp_finish): Return void.
7040         (cpp_destroy): Remove inaccurate comment about return value.
7041         (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
7042         (CPP_DL_NOTE): Define.
7043         * include/line-map.h (linemap_print_containing_files): Remove.
7044         * init.c (cpp_finish): Do not check for or return number of
7045         errors.
7046         * internal.h (cpp_reader): Remove errors field.
7047         * line-map.c (linemap_print_containing_files): Remove.
7048         * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
7049         about previous definition.  Only emit it if previous diagnostic
7050         was emitted.
7052 2009-03-28  Joseph Myers  <joseph@codesourcery.com>
7054         * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
7055         mkinstalldirs.
7057 2009-03-18  Jakub Jelinek  <jakub@redhat.com>
7059         * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
7061 2009-02-21  Joseph Myers  <joseph@codesourcery.com>
7063         * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
7064         header name.
7065         (_cpp_lex_direct): Handle this.
7067 2009-02-15  Richard Guenther  <rguenther@suse.de>
7069         Revert last change.
7071 2009-02-13  Richard Guenther  <rguenther@suse.de>
7073         * configure.ac: Enable LFS.
7074         * configure: Re-generate.
7075         * config.in: Likewise.
7077 2009-01-05  Ben Elliston  <bje@au.ibm.com>
7079         * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
7080         (.po.pox): Likewise.
7081         (po/$(PACKAGE).pot): Likewise.
7083 2008-12-10  Alexandre Oliva  <aoliva@redhat.com>
7085         PR target/37033
7086         * pch.c (cpp_valid_state): Improve message for poisoned symbols.
7087         Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
7089 2008-11-29  Joseph Myers  <joseph@codesourcery.com>
7091         * lex.c (cpp_token_len): Use 6 as default length.
7093 2008-10-31  Manuel LĂłpez-Ibáñez  <manu@gcc.gnu.org>
7095         * expr.c (struct op): Add location.
7096         (_cpp_parse_expr): Propagate locations throught the stack
7097         of expressions.
7098         (reduce): Likewise.
7099         (check_promotion): Use explicit location in errors.
7101 2008-10-05  Matthew Gingell  <gingell@adacore.com>
7102             Arnaud Charlet  <charlet@adacore.com>
7104         * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
7105         (cpp_get_comments): New function.
7106         * internal.h (struct cpp_reader): Add comments field.
7107         * init.c (cpp_destroy): Free comments.
7108         * lex.c (store_comment, cpp_get_comments): New functions.
7109         (comments): New struct.
7110         (save_comment): Store comments in comments struct.
7112 2008-09-18  Simon Baldwin  <simonb@google.com>
7114         * include/cpplib.h (struct cpp_options): Add new boolean flag
7115         warn_builtin_macro_redefined.
7116         * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
7117         * (struct builtin_operator): Split out from previous struct builtin,
7118         enhance extra const correctness.
7119         * (struct builtin_macro): Split out from previous struct builtin, add
7120         new always_warn_if_redefined flag, enhance const correctness.
7121         * (mark_named_operators): Use struct builtin_operator.
7122         * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
7123         to builtins selectively.
7124         * macro.c (warn_of_redefinition): Return false if a builtin macro
7125         is not flagged with NODE_WARN.
7127 2008-07-31  Jakub Jelinek  <jakub@redhat.com>
7129         PR preprocessor/36649
7130         * files.c (struct report_missing_guard_data): New type.
7131         (report_missing_guard): Put paths into an array instead of printing
7132         them right away.  Return 1 rather than 0.
7133         (report_missing_guard_cmp): New function.
7134         (_cpp_report_missing_guards): Sort and print paths gathered by
7135         report_missing_guard callback.
7137 2008-07-22  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
7139         PR 28079
7140         * directives.c (strtolinenum): Handle overflow.
7141         (do_line): Give a warning if line number overflowed.
7142         (do_linemarker): Update call to strtolinenum.
7144 2008-07-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
7146         * include/line-map.h (linenum_type): New typedef.
7147         (struct line_map): Use it.
7148         (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
7149         (SOURCE_COLUMN): Likewise.
7150         * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
7151         source_location values in a variable of type linenum_type.
7152         * directives.c (struct if_stack): Use linenum_type.
7153         (strtoul_for_line): Rename as strtolinenum.
7154         (do_line): Use linenum_type.
7155         (do_linemarker): Use linenum_type and strtolinenum.
7156         (_cpp_do_file_change): Use linenum_t.
7157         * line-map.c (linemap_add): Likewise.
7158         (linemap_line_start): Likewise.
7159         * traditional.c (struct fun_macro): 'line' is a source_location.
7160         * errors.c (print_location): Use linenum_type.
7161         * directives-only.c (_cpp_preprocess_dir_only): Likewise.
7162         * internal.h (CPP_INCREMENT_LINE): Likewise.
7163         * lex.c (_cpp_skip_block_comment): Use source_location.
7165 2008-07-14  Ben Elliston  <bje@au.ibm.com>
7167         * include/cpplib.h (NODE_CONDITIONAL): New.
7168         (struct cpp_callbacks): New macro_to_expand field.
7169         (struct cpp_hashnode): Adjust size of flags and type fields.
7170         (cpp_peek_token): Prototype.
7171         * lex.c (cpp_peek_token): New function.
7172         (_cpp_temp_token): Protect pre-existing lookaheads.
7173         * macro.c (cpp_get_token): Expand any conditional macros.
7174         (_cpp_backup_tokens_direct): New.
7175         (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
7176         (warn_of_redefinition): Silently allow redefined conditional
7177         macros.
7178         (_cpp_create_definition): Remove the conditional flag when a user
7179         defines one of the conditional macros.
7180         * internal.h (_cpp_backup_tokens_direct): New prototype.
7182 2008-06-13  Andrew Haley  <aph@redhat.com>
7184         PR preprocessor/33305
7185         * macro.c (replace_args): Print a warning for empty macro
7186         arguments in C89 and C++.
7188 2008-06-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
7190         * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
7191         * configure: Regenerate.
7193 2008-06-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
7195         * Makefile.in (datarootdir): New variable.
7197 2008-06-12  H.J. Lu  <hongjiu.lu@intel.com>
7199         PR preprocessor/36479
7200         * charset.c (cpp_interpret_string_notranslate): Also set
7201         narrow_cset_desc.width.
7203 2008-06-07  Joseph Myers  <joseph@codesourcery.com>
7205         * configure.ac (parisc*64*-*-*): Remove.
7206         * configure: Regenerate.
7208 2008-05-30  Tom Tromey  <tromey@redhat.com>
7210         PR preprocessor/36320:
7211         * internal.h (_cpp_parse_expr): Update.
7212         * expr.c (_cpp_parse_expr): Add 'is_if' argument.  Update error
7213         messages.
7214         * directives.c (do_if): Update.
7215         (do_elif): Require expression if processing group.
7217 2008-05-30  Danny Smith  <dannysmith@users.sourceforge.net>
7219         * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
7221 2008-05-21  Tom Tromey  <tromey@redhat.com>
7223         PR preprocessor/27777:
7224         * lex.c (cpp_output_line_to_string): New function.
7225         * internal.h (_cpp_begin_message): Don't declare.
7226         * errors.c (_cpp_begin_message): Now static.
7227         * include/cpplib.h (cpp_output_line_to_string): Declare.
7228         * directives.c (do_diagnostic): Rewrote.  Use
7229         cpp_output_line_to_string.  Don't use _cpp_begin_message.
7231 2008-05-21  Tom Tromey  <tromey@redhat.com>
7233         * include/symtab.h (HT_ALLOCED): Remove.
7234         (ht_purge): Declare.
7235         * symtab.c (DELETED): New define.
7236         (ht_lookup): Update comment.
7237         (ht_lookup_with_hash): Handle deleted entries.  Remove HT_ALLOCED
7238         code.  Use subobject allocator for strings, if it exists.
7239         (ht_expand): Handle deleted entries.
7240         (ht_forall): Likewise.
7241         (ht_purge): New function.
7242         (ht_dump_statistics): Print deletion statistics.
7244 2008-05-13  Tom Tromey  <tromey@redhat.com>
7246         PR preprocessor/22168:
7247         * include/cpplib.h (struct cpp_options) <objc>: Update
7248         documentation.
7249         * expr.c (eval_token): Warn for use of assertions.
7250         * directives.c (directive_diagnostics): Warn about extensions.
7251         (DEPRECATED): New define.
7252         (DIRECTIVE_TABLE): Use it.
7254 2008-05-06  Tom Tromey  <tromey@redhat.com>
7256         PR preprocessor/35313, PR preprocessor/36088:
7257         * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
7258         (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
7260 2008-05-04  David S. Miller  <davem@davemloft.net>
7262         * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
7263         * configure: Regenerate.
7265 2008-04-22  Daniel Franke  <franke.daniel@gmail.com>
7267         * include/cpplib.h (cpp_define_formatted): New.
7268         * directives.c (cpp_define_formatted): New.
7270 2008-04-21  Tom Tromey  <tromey@redhat.com>
7272         PR libcpp/33415:
7273         * charset.c (_cpp_convert_input): Add buffer_start argument.
7274         Ignore UTF-8 BOM if seen.
7275         * internal.h (_cpp_convert_input): Add argument.
7276         * files.c (struct _cpp_file) <buffer_start>: New field.
7277         (destroy_cpp_file): Free buffer_start, not buffer.
7278         (_cpp_pop_file_buffer): Likewise.
7279         (read_file_guts): Update.
7281 2008-04-18  Kris Van Hees <kris.van.hees@oracle.com>
7283         * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
7284         * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
7285         (struct cpp_options): Added uliterals.
7286         (cpp_interpret_string): Update prototype.
7287         (cpp_interpret_string_notranslate): Idem.
7288         * charset.c (init_iconv_desc): New width member in cset_converter.
7289         (cpp_init_iconv): Add support for char{16,32}_cset_desc.
7290         (convert_ucn): Idem.
7291         (emit_numeric_escape): Idem.
7292         (convert_hex): Idem.
7293         (convert_oct): Idem.
7294         (convert_escape): Idem.
7295         (converter_for_type): New function.
7296         (cpp_interpret_string): Use converter_for_type, support u and U prefix.
7297         (cpp_interpret_string_notranslate): Match changed prototype.
7298         (wide_str_to_charconst): Use converter_for_type.
7299         (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
7300         * directives.c (linemarker_dir): Macro U changed to UC.
7301         (parse_include): Idem.
7302         (register_pragma_1): Idem.
7303         (restore_registered_pragmas): Idem.
7304         (get__Pragma_string): Support CPP_STRING{16,32}.
7305         * expr.c (eval_token): Support CPP_CHAR{16,32}.
7306         * init.c (struct lang_flags): Added uliterals.
7307         (lang_defaults): Idem.
7308         * internal.h (struct cset_converter) <width>: New field.
7309         (struct cpp_reader) <char16_cset_desc>: Idem.
7310         (struct cpp_reader) <char32_cset_desc>: Idem.
7311         * lex.c (digraph_spellings): Macro U changed to UC.
7312         (OP, TK): Idem.
7313         (lex_string): Add support for u'...', U'...', u"..." and U"...".
7314         (_cpp_lex_direct): Idem.
7315         * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
7316         (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
7318 2008-04-18  Paolo Bonzini  <bonzini@gnu.org>
7320         PR bootstrap/35457
7321         * aclocal.m4: Regenerate.
7322         * configure: Regenerate.
7324 2008-04-17  Tom Tromey  <tromey@redhat.com>
7326         PR libcpp/34866:
7327         * errors.c (cpp_error): Don't reference a token before the start
7328         of the current run.
7330 2008-04-16  Tom Tromey  <tromey@redhat.com>
7332         * Makefile.in (TAGS_SOURCES): New variable.
7333         (TAGS): New target.
7335 2008-04-11  Kaz Kojima  <kkojima@gcc.gnu.org>
7337         * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
7338         and shbe-*-*.
7339         * configure: Rebuilt.
7341 2008-04-02  Joseph Myers  <joseph@codesourcery.com>
7343         * include/cpplib.h (struct cpp_callbacks): Add used_define,
7344         used_undef and before_define.
7345         (NODE_USED): Define.
7346         * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
7347         do_ifndef, cpp_pop_definition): Handle new flag and use new
7348         callbacks.
7349         * expr.c (parse_defined): Handle new flag and use new callbacks.
7350         * macro.c (enter_macro_context, _cpp_free_definition): Handle new
7351         flag and use new callbacks.
7353 2008-04-01  Jakub Jelinek  <jakub@redhat.com>
7355         PR pch/13675
7356         * files.c (struct _cpp_file): Remove pch field.
7357         (pch_open_file): Don't set file->pch, just file->pchname.
7358         (should_stack_file): After pfile->cb.read_pch call
7359         free pchname and clear pchname, don't close file->fd.
7360         Test file->pchname instead of file->pch.  Don't close fd after cb.
7361         (_cpp_stack_include): Test file->pchname instead of file->pch.
7363 2008-03-28  Tom Tromey  <tromey@redhat.com>
7365         * Makefile.in (POSTCOMPILE): New variable.
7366         (.c.o): Use it.
7368 2008-03-13  Tom Tromey  <tromey@redhat.com>
7370         PR libcpp/35322:
7371         * directives.c (destringize_and_run): Set pfile->directive.
7373 2008-03-06  Markus Milleder  <markus.milleder@generali.at>
7375         PR preprocessor/35458
7376         * mkdeps.c (munge): Quote '#' with a '\'.
7378 2008-02-27  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
7380         PR preprocessor/35379
7381         * mkdeps.c (deps_write): Ensure the first target always appears
7382         in the first column, without leading backslash newline.  Avoid
7383         some more extra whitespace.
7385 2008-02-25  Thiemo Seufer <ths@mips.com>
7387         * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
7389 2008-02-19  Tom Tromey  <tromey@redhat.com>
7391         * traditional.c (lex_identifier): Use CPP_HASHNODE.
7392         * lex.c (lex_identifier): Use CPP_HASHNODE.
7393         * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
7394         do-while.
7395         * identifiers.c (alloc_node): Change return type.
7396         (_cpp_init_hashtable): Don't cast 'alloc_node'.
7397         (proxy_assertion_broken): New declaration.
7398         (cpp_forall_identifiers): Move comment.
7399         * line-map.c (linemap_add): Comment fix.
7400         (linemap_line_start): Indentation fix.
7402 2008-01-25  Jakub Jelinek  <jakub@redhat.com>
7404         PR preprocessor/34692
7405         * macro.c (collect_args): Add pragma_buff argument.  Push
7406         CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
7407         than into arguments.  Reset prevent_expansion and parsing_args
7408         state at CPP_PRAGMA_EOL/CPP_EOF.
7409         (funlike_invocation_p): Add pragma_buff argument, pass it through
7410         to collect_args.
7411         (enter_macro_context): Add result argument.  Adjust
7412         funlike_invocation_p caller.  Emit all deferred pragma tokens
7413         gathered during collect_args before the expansion, add a padding
7414         token.  Return 2 instead of 1 if any pragma tokens were prepended.
7415         (cpp_get_token): If enter_macro_context returns 2, don't return
7416         a padding token, instead cycle to grab CPP_PRAGMA token.
7417         * directives.c (_cpp_handle_directive): If was_parsing_args
7418         in deferred pragma, leave parsing_args and prevent_expansion as is.
7420 2008-01-22  Tom Tromey  <tromey@redhat.com>
7422         PR c++/34859
7423         * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
7424         __STDC_CONSTANT_MACROS.
7426 2008-01-07  Fred Fish  <fnf@specifix.com>
7428         PR preprocessor/30363
7429         * traditional.c (replace_args_and_push): Add local variable
7430         cxtquote, calculate the replacement text size assuming a
7431         worst case of every input character quoted with backslash,
7432         and properly handle output quoting of quote characters in
7433         actual arguments used in function-like macros.
7435 2008-01-03  Tom Tromey  <tromey@redhat.com>
7437         PR preprocessor/34602
7438         * directives.c (do_line): Don't try to spell EOF token.
7439         (do_linemarker): Add comment.
7441 2007-12-11  DJ Delorie  <dj@redhat.com>
7443         * charset.c (convert_using_iconv): Close out any shift states,
7444         returning to the initial state.
7446 2007-12-06  Tom Tromey  <tromey@redhat.com>
7448         PR c/29172
7449         * internal.h (struct cpp_reader) <file_hash_entries>: Changed
7450         type.
7451         <file_hash_entries_allocated, file_hash_entries_used>: Removed.
7452         * files.c (FILE_HASH_POOL_SIZE): New macro.
7453         (struct file_hash_entry_pool): New.
7454         (destroy_all_cpp_files): New function.
7455         (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
7456         (new_file_hash_entry): Update.
7457         (free_file_hash_entries): New function.
7458         (_cpp_cleanup_files): Call free_file_hash_entries and
7459         destroy_all_cpp_files.
7460         (cpp_clear_file_cache): New function.
7461         * include/cpplib.h (cpp_clear_file_cache): Declare.
7463 2007-12-03  Tom Tromey  <tromey@redhat.com>
7465         PR preprocessor/34288
7466         * configure.ac, config.in: Rebuilt.
7467         * configure.ac: Check for ssize_t.
7469 2007-11-30  Tom Tromey  <tromey@redhat.com>
7471         PR preprocessor/32868
7472         * macro.c (_cpp_create_definition): Special case
7473         __STDC_FORMAT_MACROS.
7475 2007-11-16  Michael Matz  <matz@suse.de>
7477         * files.c (search_path_head): Fix check for absolute paths.
7479 2007-11-11  Tom Tromey  <tromey@redhat.com>
7481         PR c++/17557
7482         * include/cpplib.h (cpp_included_before): Declare.
7483         * files.c (struct file_hash_entry) <location>: New field.
7484         (_cpp_find_file): Initialize new field.
7485         (make_cpp_dir): Likewise.
7486         (cpp_included_before): New function.
7488 2007-11-01  Tom Tromey  <tromey@redhat.com>
7490         PR preprocessor/30805
7491         * macro.c (paste_tokens): Handle padding token.
7492         (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
7494 2007-10-31  Tom Tromey  <tromey@redhat.com>
7496         PR preprocessor/30786
7497         * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
7498         * directives.c (_cpp_do__Pragma): Return error status.
7499         * internal.h (_cpp_do__Pragma): Update.
7500         * directives.c (get__Pragma_string): Back up if EOF seen.
7502 2007-09-06  Tom Tromey  <tromey@redhat.com>
7504         * internal.h (struct cpp_reader) <invocation_location>: New
7505         field.
7506         (struct cpp_reader) <set_invocation_location>: Likewise.
7507         * init.c (cpp_set_line_map): New function.
7508         * line-map.c (linemap_add): Use linemap's allocator.
7509         * include/line-map.h (GTY): Define.
7510         (line_map_realloc): New typedef.
7511         (struct line_map): Mark with GTY.
7512         (struct line_maps): Likewise.
7513         (struct line_maps) <maps>: Likewise.
7514         (struct line_maps) <reallocator>: New field.
7515         * include/symtab.h (GTY): Conditionally define.
7516         * include/cpplib.h (cpp_set_line_map): Declare.
7517         (cpp_get_token_with_location): Declare.
7518         * macro.c (cpp_get_token): Set invocation_location on the reader.
7519         (cpp_get_token_with_location): New function.
7521 2007-08-30  Chao-ying Fu  <fu@mips.com>
7523         * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
7524         ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
7525         (cpp_classify_number): Support decimal fixed-point constants without
7526         exponents.
7527         Warn about fixed-point constants when -pedantic.
7528         * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
7529         comments to support fixed-point values.
7530         (CPP_N_FRACT, CPP_N_ACCUM): Define.
7532 2007-08-18  Tom Tromey  <tromey@redhat.com>
7534         PR preprocessor/32974
7535         * directives.c (parse_include): Don't check for EOL when
7536         processing #pragma dependency.
7538 2007-07-30  Ollie Wild  <aaw@google.com>
7540         * directives-only.c: New file.
7541         * internal.h (struct _cpp_dir_only_callbacks): New.
7542         (_cpp_preprocess_dir_only): New function.
7543         * directives.c (_cpp_handle_directive): Check directives_only before
7544         disabling execution of indented directives.
7545         * files.c (_cpp_stack_file): Add directives_only check.
7546         * include/cpplib.h (struct cpp_options): Add directives_only.
7547         (cpp_init_special_builtins): New function.
7548         * init.c (cpp_init_special_builtins): New function.
7549         (cpp_init_builtins): Move builtin_array initialization to
7550         cpp_init_special_builtins.
7551         (post_options): Check directives_only before setting
7552         pfile->state.prevent_expansion = 1.
7553         * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
7554         is expanded inside a directive while -fdirectives-only is enabled.
7555         * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
7556         (libcpp_a_SOURCES): Add directives-only.c.
7558 2007-07-04  Uros Bizjak  <ubizjak@gmail.com>
7560         * traditional.c (_cpp_scan_out_logical_line): Initialize
7561         fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
7562         fmacro.args to prevent 'may be used uninitialized' warning.
7564 2007-07-03  Uros Bizjak  <ubizjak@gmail.com>
7566         * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
7567         Add new constants.
7568         * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
7569         suffixes.  Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
7570         for 'q' or 'Q' suffixes.
7572 2007-06-17  Danny Smith  <dannysmith@users.sourceforge.net
7574         * files.c (open_file): Correct typo.
7576 2007-06-16  Vladimir Prus  <vladimir@codesourcery.com>
7578         * files.c (open_file): Prevent the call
7579         for stat from overwriting errno.
7581 2007-06-09  Vladimir Prus  <vladimir@codesourcery.com>
7583         * files.c (open_file): Account for the
7584         fact that on windows, opening a directory gives
7585         EACCES.
7587 2007-06-05  Joerg Wunsch  <j.gnu@uriah.heep.sax.de>
7589         PR preprocessor/23479
7590         * expr.c (cpp_classify_number): Implement 0b-prefixed binary
7591         integer constants.
7592         (append_digit): Likewise.
7593         * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
7594         binary integer constants.
7596 2007-05-31  Dave Korn  <dave.korn@artimi.com>
7598         PR preprocessor/14331
7599         * lex.c (_cpp_get_fresh_line):  Don't warn if no newline at EOF.
7601 2007-05-24  Ollie Wild  <aaw@google.com>
7603         * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
7604         * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
7605         (cpp_write_pch_state): Save __COUNTER__ state.
7606         (cpp_valid_state): Check valid __COUNTER__ state.
7607         (cpp_read_state): Read new __COUNTER__ state.
7608         * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
7609         * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
7610         * internal.h (struct cpp_reader): Add counter member.
7612 2007-05-23  Simon Martin  <simartin@users.sourceforge.net>
7614         PR preprocessor/20077
7615         * macro.c (create_iso_definition): Fixed the method to determine
7616         whether the token-pasting operator appears at the beginning or the end
7617         of a macro.
7619 2007-05-21  Ian Lance Taylor  <iant@google.com>
7621         * internal.h (struct cpp_reader): Add new fields:
7622         nonexistent_file_hash and nonexistent_file_ob.
7623         * files.c: Include "obstack.h".
7624         (find_file_in_dir): Before trying to open the file, look up the
7625         path name in the hash table of nonexistent files.  After failing
7626         to open the file, add the path name to the hash table.
7627         (_cpp_find_file): Cache the results of looking up the file name
7628         starting with the quote and bracket chain heads, if we can.
7629         (nonexistent_file_hash_eq): New static function.
7630         (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
7631         pfile->nonexistent_file_ob.
7632         (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
7633         pfile->nonexistent_file_ob.
7635 2007-05-14  Janis Johnson  <janis187@us.ibm.com>
7637         * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
7639         PR c/31924
7640         * expr.c (interpret_float_suffix): Check for invalid suffix.
7642 2007-05-02  Eric Christopher  <echristo@apple.com>
7644         * expr.c (num_div_op): Don't overflow if the result is
7645         zero.
7647 2007-05-02  Tom Tromey  <tromey@redhat.com>
7649         PR preprocessor/28709
7650         * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
7652 2007-03-30  Michael Meissner  <michael.meissner@amd.com>
7654         * directives.c (lex_macro_node_from_str): Fix alloca call to be
7655         type correct.
7657 2007-03-30  Richard Henderson  <rth@redhat.com>
7659         * directives.c (lex_macro_node_from_str): New.
7660         (cpp_push_definition, cpp_pop_definition): New.
7661         * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
7663 2007-03-01  Brooks Moses  <brooks.moses@codesourcery.com>
7665         * Makefile.in: Add dummy install-pdf target.
7667 2007-01-30  Tom Tromey  <tromey@redhat.com>
7669         PR preprocessor/30468
7670         * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
7671         './'.
7673 2007-01-30  Tom Tromey  <tromey@redhat.com>
7675         PR preprocessor/29966
7676         * macro.c (lex_expansion_token): Save and restore cpp_reader's
7677         cur_token.
7678         (_cpp_create_definition): Don't restore cur_token here.
7679         * lex.c (_cpp_lex_token): Added assertion.
7681 2007-01-27  Tom Tromey  <tromey@redhat.com>
7683         * configure: Rebuilt.
7685 2007-01-12  Tom Tromey  <tromey@redhat.com>
7687         PR preprocessor/28227
7688         * directives.c (lex_macro_node): Added 'is_def_or_undef'
7689         argument.
7690         (do_define): Update.
7691         (do_undef): Update.
7692         (do_ifdef): Update.
7693         (do_ifndef): Update.
7695 2007-01-11  Paolo Bonzini  <bonzini@gnu.org>
7697         * configure: Regenerate.
7699 2007-01-11  Paolo Bonzini  <bonzini@gnu.org>
7701         * configure: Regenerate.
7703 2007-01-04  Tom Tromey  <tromey@redhat.com>
7705         PR preprocessor/28165
7706         * internal.h (cpp_in_primary_file): New function.
7707         * directives.c (do_include_next): Use cpp_in_primary_file.
7708         (do_pragma_once): Likewise.
7709         (do_pragma_system_header): Likewise.
7711 2006-12-29  Ian Lance Taylor  <iant@google.com>
7713         * lex.c (_cpp_clean_line): Add uses of __builtin_expect.  Don't
7714         look backward at the end of the line unless we saw a backslash.
7716 2006-12-29  Jakub Jelinek  <jakub@redhat.com>
7718         PR preprocessor/29612
7719         * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
7720         only when new_sysp is non-zero.
7722 2006-12-28  Tom Tromey  <tromey@redhat.com>
7724         PR preprocessor/30001
7725         * charset.c (_cpp_convert_input): Check that to.len is greater
7726         than zero.
7728 2006-11-20  Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
7730         * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
7731         * configure: Rebuilt.
7733 2006-11-01      Douglas Gregor <doug.gregor@gmail.com>
7735         * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
7736         for experimental C++0x mode.
7737         * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
7738         adopted the preprocessor changes introduced in C99.
7740 2006-10-29  Joseph Myers  <joseph@codesourcery.com>
7742         * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
7743         depending on --enable-targets=all.
7744         * configure: Regenerate.
7746 2006-10-12  Jakub Jelinek  <jakub@redhat.com>
7748         PR preprocessor/28709
7749         * macro.c (paste_tokens): Do error reporting here, use BUF with the
7750         spelled LHS token as opposed to spelling it again.
7751         (paste_all_tokens): Don't report errors here, just break on failure.
7753 2006-10-10  Brooks Moses  <bmoses@stanford.edu>
7755         * Makefile.in: Added empty "pdf" target.
7757 2006-09-22  Geoffrey Keating  <geoffk@apple.com>
7759         * configure.ac: Make need_64_bit_hwint case for x86-darwin
7760         match exactly the glob in gcc/config.gcc.
7761         * configure: Regenerate.
7763 2006-09-13  Joseph S. Myers  <joseph@codesourcery.com>
7765         PR c/28768
7766         PR preprocessor/14634
7767         * lex.c (lex_string): Pedwarn for unterminated literals.
7769 2006-09-08  Eric Christopher  <echristo@apple.com>
7771         * configure.ac: Add 64-bit HWI support for i?86-darwin.
7773 2006-08-14  Steve Ellcey  <sje@cup.hp.com>
7775         PR c++/28288
7776         PR c++/14556
7777         * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
7778         (CPP_LAST_EQ): Change.
7779         (CPP_LAST_PUNCTUATOR): Change.
7780         * expr.c (cpp_operator): Remove MIN and MAX.
7781         (reduce): Remove CPP_MIN and CPP_MAX.
7782         (num_binary_op): Ditto.
7783         * lex.c (_cpp_lex_direct): Ditto.
7784         (cpp_avoid_paste): Remove ? as legal symbol after > or <.
7786 2006-06-09  Jakub Jelinek  <jakub@redhat.com>
7788         PR preprocessor/27746
7789         * directives.c (do_pragma): Handle pragma with valid namespace
7790         and invalid name coming from macro expansion.
7791         * directives.c (destringize_and_run): Initialize next field in
7792         context.
7794         PR c/27747
7795         PR c++/27748
7796         * directives.c (destringize_and_run): Set NO_EXPAND on the
7797         tokens.
7799         * macro.c (_cpp_backup_tokens): Fix comment typo.
7801 2006-05-31  Daniel Jacobowitz  <dan@codesourcery.com>
7803         * Makefile.in (CATALOGS): Add po/ prefix.
7804         * configure: Regenerated.
7806 2006-05-23  Carlos O'Donell  <carlos@codesourcery.com>
7808         * Makefile.in: Add install-html target. Add install-html to .PHONY
7810 2006-02-17  Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
7812         * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
7813         * files.c (_cpp_get_file_stat): New function.
7814         * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
7815         * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
7816         * internal.h (_cpp_get_file_stat): Prototype.
7817         (struct cpp_buffer): Add timestamp.
7819 2006-01-23  Jakub Jelinek  <jakub@redhat.com>
7821         PR preprocessor/25717
7822         * init.c (cpp_init_builtins): If __STDC__ will not change value
7823         between system headers and other sources, define it as a normal
7824         macro rather than a builtin.
7825         * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
7826         cpp_in_system_header condition.
7828 2006-01-05  Paolo Bonzini  <bonzini@gnu.org>
7830         * Makefile.in: Use -MMD instead of -MD.
7832 2006-01-04  Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
7833             Richard Henderson  <rth@redhat.com>
7835         Merge from gomp branch:
7836         * directives.c (struct pragma_entry): Add is_deferred.  Add ident
7837         entry to value union.
7838         (end_directive): Don't eat the line if in_deferred_pragma.
7839         (run_directive): Remove pragma hacks.
7840         (insert_pragma_entry): Remove.
7841         (new_pragma_entry): New.
7842         (register_pragma_1): Split out of register_pragma.  Only handle
7843         the lookup tree and return the new entry.
7844         (cpp_register_pragma): Fill in the pragma entry here.
7845         (cpp_register_deferred_pragma): New.
7846         (register_pragma_internal): New.
7847         (_cpp_init_internal_pragmas): Use register_pragma_internal.
7848         (do_pragma): Allow pragma expansion after namespace.  For deferred
7849         pragmas, don't slurp the line into a string.
7850         (destringize_and_run): Save tokens for deferred pragmas.
7851         (cpp_handle_deferred_pragma): Remove.
7852         * macro.c (builtin_macro): Remove pragma token hack.
7853         (_cpp_push_token_context): Rename from push_token_context and export.
7854         * internal.h (struct lexer_state): Add pragma_allow_expansion.
7855         (_cpp_push_token_context): Declare.
7856         * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
7857         a token.  Update the line number correctly if so.
7858         (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
7859         (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
7860         * include/cpplib.h (PRAGMA_EOL): New.
7861         (CPP_TOKEN_FLD_PRAGMA): New.
7862         (struct cpp_token): Add val.pragma.
7863         (struct cpp_options): Remove defer_pragmas.
7864         (cpp_handle_deferred_pragma): Remove.
7865         (cpp_register_deferred_pragma): Declare.
7867 2006-01-01  Jakub Jelinek  <jakub@redhat.com>
7869         PR c++/25294
7870         * directives.c (do_pragma): If pragma line ends with multi-line
7871         block comment, end the saved deferred pragma string before that
7872         comment.  Handle embedded '\0' chars on the pragma line.
7874 2005-12-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
7876         PR c++/23333
7877         * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
7879 2005-12-07  Jon Grimm  <jgrimm2@us.ibm.com>
7880             Ben Elliston  <bje@au.ibm.com>
7882         * include/cpplib.h (CPP_N_DFLOAT): New.
7883         * expr.c (interpret_float_suffix): Identify df, dd, and dl
7884         suffixes as decimal floating point constants.
7885         (cpp_classify_number): Disallow hexadecimal DFP constants.
7887 2005-11-14  Gerald Pfeifer  <gerald@pfeifer.com>
7888             Ian Lance Taylor  <ian@airs.com>
7890         * include/cpplib.h (struct cpp_callbacks): Annotate error with
7891         ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
7893 2005-11-09  Per Bothner  <per@bothner.com>
7894             Uros Bizjak  <uros@kss-loka.si>
7896         PR c/24101
7897         * init.c (read_original_filename): Temporarily set
7898         state.in_directive before calling _cpp_lex_direct for
7899         CPP_HASH tokens.
7901 2005-11-03  James E Wilson  <wilson@specifix.com>
7903         PR preprocessor/24202
7904         * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
7906 2005-11-04  Joseph S. Myers  <joseph@codesourcery.com>
7908         * include/cpplib.h (struct cpp_callbacks): Make error take
7909         va_list* parameter.
7910         * errors.c (cpp_error): Update call to callback.
7912 2005-11-03  Andrew Pinski  <pinskia@physics.uc.edu>
7914         PR preprocessor/22042
7915         * macro.c (_cpp_builtin_macro_text): Lower the needed max
7916         buffer size.
7917         (cpp_quote_string): Don't octalify non printable
7918         charactors.
7920 2005-11-03  Joseph S. Myers  <joseph@codesourcery.com>
7922         PR c++/17964
7923         * include/cpplib.h (struct cpp_options): Add client_diagnostic.
7924         (struct cpp_callbacks): Add error.
7925         * errors.c (cpp_error): If client_diagnostic, use error callback.
7926         * charset.c (convert_escape): Don't use %03o in diagnostic.
7928 2005-10-21  James E Wilson  <wilson@specifix.com>
7930         PR preprocessor/15220
7931         * files.c (_cpp_find_file): New parameter angle_brackets.  Fix all
7932         callers.  Pass to open_file_failed.
7933         (open_file_failed): New parameter angle_brackets.  Fix all callers.
7934         Use in print_dep assignment.
7935         * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
7936         * internal.h (_cpp_find_file): Add new parm to declaration.
7938 2005-10-08  Kazu Hirata  <kazu@codesourcery.com>
7940         * configure.ac: Require 64-bit int for arm*-*-*eabi*.
7941         * configure: Regenerate.
7943 2005-10-04  Ian Lance Taylor  <ian@airs.com>
7945         PR preprocessor/13726
7946         * directives.c (check_eol_return_comments): New static function.
7947         (parse_include): Add buf parameter.  Change all callers.
7948         (do_include_common): If not discard comments, turn on
7949         save_comments.  Pass collected comments to include callback.
7950         * include/cpplib.h (struct cpp_callbacks): Add new parameter to
7951         include callback: cpp_token list.
7953 2005-09-20  Joseph S. Myers  <joseph@codesourcery.com>
7955         * include/cpplib.h (struct cpp_options): Add extended_identifiers.
7956         * init.c (struct lang_flags, lang_defaults): Add
7957         extended_identifiers.
7958         (cpp_set_lang): Use it.
7959         * lex.c (forms_identifier_p): Check extended_identifiers.
7961 2005-08-30  Jakub Jelinek  <jakub@redhat.com>
7963         PR preprocessor/20348
7964         PR preprocessor/20356
7965         * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
7966         2004-06-05 changes.
7968 2005-07-23  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7970         * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
7971         -Wmissing-format-attribute.
7973         * configure: Regenerate.
7975 2005-06-29  Kelley Cook  <kcook@gcc.gnu.org>
7977         * all files: Update FSF address in copyright headers.
7978         * makeucnid.c (write_copyright): Update outputted FSF address.
7980 2005-06-13  Zack Weinberg  <zack@codesourcery.com>
7982         * configure.ac: Invoke ZW_CREATE_DEPDIR and
7983         ZW_PROG_COMPILER_DEPENDENCIES.
7984         * aclocal.m4, configure: Regenerate.
7985         * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
7986         New variables.
7987         (distclean): Clean up $(DEPDIR) and its contents.
7988         (.c.o): Use $(COMPILE).
7989         Include $(DEPDIR)/*.Po for most object->header dependencies.
7991 2005-05-28  Gabriel Dos Reis  <gdr@integrable-solutions.net>
7993         * configure.ac: Check declarations for asprintf and vasprintf.
7994         * config.in: Regenerate.
7995         * configure: Likewise.
7997         * charset.c (conversion_loop): Use XRESIZEVEC.
7998         (convert_no_conversion): Likewise.
7999         (convert_using_iconv): Likewise.
8000         (init_iconv_desc): Cast return value of alloca.
8001         (cpp_host_to_exec_charset): Use XNEWVEC.
8002         (emit_numeric_escape): Use XRESIZEVEC.
8003         (cpp_interpret_string): Use XNEWVEC.
8004         (cpp_interpret_string): Use XRESIZEVEC.
8005         (_cpp_interpret_identifier): Cast return value of alloca.
8006         (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
8007         * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
8008         (parse_include): Use XNEWVEC.
8009         (insert_pragma_entry): Rename local variable "new" to
8010         "new_entry".
8011         (save_registered_pragmas): Cast return value of xmemdup.
8012         (destringize_and_run): Same for alloca.
8013         (parse_assertion): Likewise.
8014         (do_assert): Cast allocated storage to proper type.
8015         (cpp_define): Likewise.
8016         (_cpp_define_builtin): Likewise.
8017         (cpp_undef): Likewise.
8018         (handle_assertion): Likewise.
8019         (cpp_push_buffer): Rename local variable "new" to "new_buffer".
8020         * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
8021         (CPP_UMINUS): Likewise.
8022         (struct cpp_operator): Rename from struct operator.
8023         (_cpp_expand_op_stack): Use XRESIZEVEC.
8024         * files.c (pch_open_file): Use XNEWVEC.
8025         (pch_open_file): Use XRESIZEVEC.
8026         (read_file_guts): Use XNEWVEC and XRESIZEVEC.
8027         (dir_name_of_file): Use XNEWVEC.
8028         (make_cpp_file): Use XCNEW.
8029         (make_cpp_dir): Likewise.
8030         (allocate_file_hash_entries): USE XNEWVEC.
8031         (cpp_included): Cast return value of htab_find_with_hash.
8032         (append_file_to_dir): Use XNEWVEC.
8033         (read_filename_string): Likewise. Use XRESIZEVEC too.
8034         (read_name_map): Cast return value of alloca.  Use XRESIZEVEC.
8035         (remap_filename): Use XNEWVEC.
8036         (struct pchf_entry): Move definition out of struct pchf_data.
8037         (_cpp_save_file_entries): Use XCNEWVAR.
8038         (_cpp_read_file_entries): Use XNEWVAR.
8039         * identifiers.c (alloc_node): Use XOBNEW.
8040         * init.c (cpp_create_reader): Use XCNEW.
8041         (cpp_init_builtins): Cast of b->value to enum builtin_type.
8042         (read_original_directory): Cast return value of alloca.
8043         * lex.c (add_line_note): Use XRESIZEVEC.
8044         (warn_about_normalization): Use XNEWVEC.
8045         (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
8046         (new_buff): Use XNEWVEC.
8047         * line-map.c (linemap_add): Use XRESIZEVEC.
8048         * macro.c (builtin_macro): Cast return value of alloca.
8049         (paste_tokens): Likewise.
8050         (expand_arg): Use XNEWVEC and XRESIZEVEC.
8051         (_cpp_save_parameter): Use XRESIZEVEC.
8052         (create_iso_definition): Cast allocated storage to proper type.
8053         (_cpp_create_definition): Likewise.
8054         (cpp_macro_definition): Use XRESIZEVEC.
8055         * makedepend.c (add_clm): Use XNEW.
8056         (add_dir): Likewise.
8057         * mkdeps.c (munge): Use XNEWVEC.
8058         (deps_init): Use XCNEW.
8059         (deps_add_target): Use XRESIZEVEC.
8060         (deps_add_default_target): Cast return value of alloca.
8061         (deps_add_dep): Use XRESIZEVEC.
8062         (deps_add_vpath): Likewise.  Use XNEWVEC too.
8063         (deps_restore): Likewise.
8064         * pch.c (save_idents): Use XNEW and XNEWVEC.
8065         (cpp_save_state): Use XNEW.
8066         (count_defs): Cast return value of htab_find.
8067         (write_defs): Likewise.
8068         (cpp_write_pch_deps): Use XNEWVEC.
8069         (collect_ht_nodes): Use XRESIZEVEC.
8070         (cpp_valid_state): Use XNEWVEC.
8071         (save_macros): Use XRESIZEVEC.  Cast return value of xmemdup.
8072         * symtab.c (ht_create): Use XCNEW.
8073         (ht_lookup_with_hash): Cast return value of obstack_copy0.
8074         (ht_expand): Use XCNEWVEC.
8075         * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
8076         (bool): Do not define if __cplusplus.
8078 2005-05-12  Zack Weinberg  <zack@codesourcery.com>
8080         * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
8081         (do_sccs): Delete function definition, #define to do_ident.
8082         (do_ident): Don't hardwire directive name.
8084 2005-05-12  Ryota Kunisawa  <kunisawa@access.co.jp>
8086         PR bootstrap/21230
8087         * configure: Regenerate.
8089 2005-04-27  Andris Pavenis  <pavenis@latnet.lv>
8091         * files.c: Include io.h for DJGPP to get prototype of setmode.
8093 2005-04-19  Per Bothner  <per@bothner.com>
8095         PR preprocessor/20907
8096         * line-map.c (linemap_line_start): Fix bug when we need to increse
8097         column_bits but can re-use the current line_map.
8099 2005-04-19  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
8101         * system.h (fopen, fdopen, freopen): Define these to the unlocked
8102         libiberty functions.
8104 2005-04-11  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
8106         * configure.ac (libcpp_UNLOCKED_FUNCS): New.
8107         (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
8108         * system.h (putchar, getc, getchar, clearerr, feof, fileno,
8109         fflush, fgetc, fgets, ferror, fread): Redefine to the associated
8110         _unlocked function.
8111         (fwrite_unlocked): Fix prototype.
8113         * configure, config.in: Regenerate.
8115 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
8117         PR preprocessor/19475
8118         * macro.c (create_iso_definition): For < ISO C99, don't
8119         pedwarn if there is no whitespace between macro name and its
8120         replacement, but the replacement starts with a basic character
8121         set character.
8123 2005-03-28  Andreas Jaeger  <aj@suse.de>
8125         * lex.c (warn_about_normalization): Cast field width to int to
8126         avoid warning.
8128 2005-03-19  Joseph S. Myers  <joseph@codesourcery.com>
8130         * configure.ac: Consistently use solaris2.1[0-9]* instead of
8131         solaris2.1[0-9].
8132         * configure: Regenerate.
8134 2005-03-15  Geoffrey Keating  <geoffk@apple.com>
8136         * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
8137         UCN rather than printing an error.
8139 2005-03-14  Geoffrey Keating  <geoffk@apple.com>
8141         * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
8143 2005-03-14  Geoffrey Keating  <geoffk@apple.com>
8145         * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
8146         * charset.c: Update for new format of ucnid.h.
8147         (ucn_valid_in_identifier): Update for new format of ucnid.h.
8148         Add NST parameter, and update it; update callers.
8149         (cpp_valid_ucn): Add NST parameter, update callers.  Replace abort
8150         with cpp_error.
8151         (convert_ucn): Pass normalize_state to cpp_valid_ucn.
8152         * internal.h (struct normalize_state): New.
8153         (INITIAL_NORMALIZE_STATE): New.
8154         (NORMALIZE_STATE_RESULT): New.
8155         (NORMALIZE_STATE_UPDATE_IDNUM): New.
8156         (_cpp_valid_ucn): New.
8157         * lex.c (warn_about_normalization): New.
8158         (forms_identifier_p): Add normalize_state parameter, update callers.
8159         (lex_identifier): Add normalize_state parameter, update callers.  Keep
8160         the state current.
8161         (lex_number): Likewise.
8162         (_cpp_lex_direct): Pass normalize_state to subroutines.  Check
8163         it with warn_about_normalization.
8164         * makeucnid.c: New.
8165         * ucnid.h: Replace.
8166         * ucnid.pl: Remove.
8167         * ucnid.tab: Make appropriate for input to makeucnid.c.  Remove
8168         comments about obsolete version of C++.
8169         * include/cpplib.h (enum cpp_normalize_level): New.
8170         (struct cpp_options): Add warn_normalize field.
8172 2005-03-11  Geoffrey Keating  <geoffk@apple.com>
8174         * directives.c (glue_header_name): Update call to cpp_spell_token.
8175         * internal.h (_cpp_interpret_identifier): New.
8176         * charset.c (_cpp_interpret_identifier): New.
8177         (_cpp_valid_ucn): Allow UCN version of '$'.
8178         * lex.c (lex_identifier): Add extra parameter to indicate if initial
8179         character was '$' or '\'.  Support identifiers with UCNs.
8180         (forms_identifier_p): Allow UCNs.
8181         (_cpp_lex_direct): Pass extra parameter to lex_identifier.
8182         (utf8_to_ucn): New.
8183         (cpp_spell_token): Add FORSTRING parameter.  Use it.
8184         (cpp_token_as_text): Update call to cpp_spell_token.
8185         (cpp_output_token): Write UCNs back out.
8186         (stringify_arg): Update call to cpp_spell_token.
8187         (paste_tokens): Likewise.
8188         (cpp_macro_definition): Likewise.
8189         * macro.c (stringify_arg): Likewise.
8190         (paste_tokens): Likewise.
8191         (cpp_macro_definition): Likewise.
8192         * include/cpplib.h: Add parameter to cpp_spell_token.
8194 2005-03-04  Jakub Jelinek  <jakub@redhat.com>
8196         PR bootstrap/20282
8197         PR bootstrap/20305
8198         * macro.c (replace_args, cpp_get_token): Copy whole
8199         cpp_token_u instead of just cpp_string field from it.
8201 2005-02-28  Devang Patel  <dpatel@apple.com>
8203         * directives.c (do_line): Save sysp early before line table is
8204         realloc'ed.
8206 2005-02-20  Zack Weinberg  <zack@codesourcery.com>
8208         PR 18785
8209         * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
8210         (cpp_host_to_exec_charset): New function.
8211         * include/cpplib.h: Declare cpp_host_to_exec_charset.
8213 2005-02-19  Devang Patel  <dpatel@apple.com>
8215         * charset.c (_cpp_convert_input): Check '\r' before inserting
8216         '\n' at the end.
8218 2005-02-15  Eric Christopher  <echristo@redhat.com>
8220         PR preprocessor/19077
8221         * macro.c (cpp_macro_definition): Move handling of whitespace
8222         to PREV_WHITE conditional. Remove overloading of len
8223         variable.
8225 2005-02-14  Kazu Hirata  <kazu@cs.umass.edu>
8227         * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
8228         traditional.c: Update copyright.
8230 2005-02-14  Paolo Bonzini  <bonzini@gnu.org>
8232         PR bootstrap/19818
8233         * configure.ac: Check for declaration of basename and getopt.
8234         * config.in: Regenerate.
8235         * configure: Regenerate.
8236         * internal.h (ustrcspn): New.
8237         * macro.c (create_iso_definition): Fix allocation of memory.
8238         (padding_token): Add cast to remove const-ness.
8239         * pch.c (cpp_read_state): Use ustrcspn.
8241 2005-02-08  Mike Stump  <mrs@apple.com>
8243         * files.c (pchf_adder): Remove.
8244         (struct pchf_adder_info): Likewise.
8245         (_cpp_save_file_entries): Write out all files so that #import works.
8247 2005-01-23  Joseph S. Myers  <joseph@codesourcery.com>
8249         * configure: Regenerate.
8251 2005-01-11  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
8253         * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
8255         * include/cpplib.h: Also update copyright years.
8257 2005-01-03  Geoffrey Keating  <geoffk@apple.com>
8259         * files.c (_cpp_find_file): Add files found by search_path_exhausted
8260         to the list of all files.
8262 2005-01-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
8264         * internal.h: Update references to Cpp lib filenames.
8265         * directives.c: Likewise.
8266         * init.c: Likewise.
8267         * macro.c: Likewise.
8268         * traditional.c: Likewise.
8270 2004-12-15  Eric Botcazou  <ebotcazou@libertysurf.fr>
8272         PR preprocessor/15167
8273         * files.c (destroy_cpp_file): New function.
8274         (should_stack_file): Make a new file if the
8275         compared file is still stacked.
8277 2004-11-28  Nathanael Nerode  <neroden@gcc.gnu.org>
8279         PR preprocessor/17610
8280         * directives.c (do_include_common): Error out if an empty filename
8281         is given for #include (or #include_next or #import).
8283 2004-11-27  Roger Sayle  <roger@eyesopen.com>
8284             Zack Weinberg  <zack@codesourcery.com>
8286         * internal.h: Replace all uses of uchar with unsigned char.
8287         * include/cpp-id-data.h: Likewise.  Guard typedef of uchar
8288         with !IN_GCC, so uchar is only defined whilst building libcpp.
8290 2004-11-24  Kelley Cook  <kcook@gcc.gnu.org>
8292         * aclocal.m4: Regenerate.
8294 2004-11-24  Roger Sayle  <roger@eyesopen.com>
8296         PR preprocessor/15824
8297         * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
8298         directly, instead of the non-existant "system.h" and "ansidecl.h".
8299         * configure: Regenerate.
8301 2004-11-23  Daniel Jacobowitz  <dan@codesourcery.com>
8302             Joseph Myers  <joseph@codesourcery.com>
8304         * internal.h (struct lexer_state): Add in_deferred_pragma.
8305         * directives.c (struct pragma_entry): Add allow_expansion.
8306         (insert_pragma_entry): Take allow_expansion flag.
8307         (register_pragma): Likewise.
8308         (cpp_register_pragma): Likewise.
8309         (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
8310         (do_pragma): Honor allow_expansion.
8311         (cpp_handle_deferred_pragma): Set in_deferred_pragma.
8312         * include/cpplib.h (cpp_register_pragma): Update prototype.
8314 2004-11-18  Daniel Jacobowitz  <dan@codesourcery.com>
8315             Mark Mitchell  <mark@codesourcery.com>
8317         * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
8318         need_64bit_hwint=yes.
8319         * configure: Regenerate.
8321 2004-11-09  Joseph S. Myers  <joseph@codesourcery.com>
8323         * Makefile.in ($(PACKAGE).pot): New rule.  Depend on
8324         po/$(PACKAGE).pot.
8325         (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
8326         arguments.  Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
8327         Remove local srcdir path from generated file.
8329 2004-11-04  Zack Weinberg  <zack@codesourcery.com>
8330             Gerald Pfeifer  <gerald@pfeifer.com>
8332         * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
8333         as well.
8335 2004-10-27  Zack Weinberg  <zack@codesourcery.com>
8337         PR 18075
8338         * directives.c (do_pragma): Do not defer pragmas which are unknown.
8339         (cpp_handle_deferred_pragma): Add cast to silence warning.
8341 2004-10-14  Joseph S. Myers  <jsm@polyomino.org.uk>
8343         * errors.c (_cpp_begin_message): Print "error: " for errors.
8345 2004-10-10  Andreas Jaeger  <aj@suse.de>
8347         * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
8348         * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
8350 2004-10-08  Andrew Pinski  <pinskia@physics.uc.edu>
8352         * pch.c (cpp_write_pch_state): Remove variable z as it is not
8353         used.
8354         (cpp_read_state): Remove unused variables, m, d and mac_count.
8356 2004-09-29  Per Bothner  <per@bothner.com>
8358         * directives.c (cpp_handle_deferred_pragma):  Save, clear and restore
8359         cb.line_change.  Otherwise do_pragma will call the line_change
8360         call-back with a meaningless line number.
8362 2004-09-24  Zack Weinberg  <zack@codesourcery.com>
8364         * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
8365         programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
8366         ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
8367         * aclocal.m4, configure: Regenerate.
8368         * init.c: Include localedir.h.
8369         * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
8370         (DEFS): Delete.
8371         (.c.o): Use $(ALL_CFLAGS).
8372         (localedir.h, localedir.hs): New rules.
8373         (clean): Use rm -rf to remove directories.
8374         (distclean): Also delete localedir.h and localedir.hs.
8375         (init.o): Update dependencies.
8377 2004-09-22  Kelley Cook  <kcook@gcc.gnu.org>
8379         * Makefile.in (aclocal.m4): Update dependencies.
8380         * configure.ac (AC_CONFIG_MACRO_DIR): New.
8381         * aclocal.m4, configure: Regenerate.
8383 2004-09-17  Zack Weinberg  <zack@codesourcery.com>
8385         * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
8386         (_cpp_convert_input, _cpp_default_encoding): Add comments.
8387         Some other comments in this file also tweaked.
8389         * directives.c (do_pragma): Save current buffer position
8390         before lexing the pragma keywords; don't call
8391         _cpp_backup_tokens in the defer_pragmas case.
8393 2004-09-15  Per Bothner  <per@bothner.com>
8395         * include/line-map.h (line_map_start):  Add parameter names so
8396         preceding comment makes sense.
8397         (linemap_add):  Remove from comment mention of non-existing parameter.
8399 2004-09-09  Matt Austern  <austern@apple.com>
8400             Zack Weinberg  <zack@codesourcery.com>
8402         * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
8403         prefixes throughout.  Add entry for PRAGMA.  Remove
8404         unnecessary "= 0" from EQ.
8405         (enum cpp_ttype): Adjust OP and TK definitions to restore
8406         prefixes, via token-paste.
8407         (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
8408         Change from #defines to additional cpp_ttype enumerators.
8409         (struct cpp_options): Add defer_pragmas.
8410         (cpp_handle_deferred_pragma): Prototype new interface.
8412         * internal.h (struct cpp_reader): Add directive_result.
8413         * directives.c (struct pragma_entry): Add is_internal field;
8414         give boolean fields type bool.
8415         (start_directive): Initialize pfile->directive_result.type.
8416         (_cpp_do__Pragma): Likewise.
8417         (run_directive): Do not crash if pfile->buffer->prev is NULL.
8418         (insert_pragma_entry): Add 'internal' argument; set new->is_internal
8419         from it.
8420         (register_pragma): New static function, bulk of former
8421         cpp_register_pragma here; add 'internal' argument, pass along
8422         to insert_pragma_entry.
8423         (cpp_register_pragma): Now a wrapper around register_pragma which
8424         always passes false for 'internal' argument.
8425         (_cpp_init_internal_pragmas): Call register_pragma directly, passing
8426         true for 'internal'.
8427         (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
8428         an internal pragma, save text till the end of the line as a CPP_PRAGMA
8429         token instead of executing the pragma.
8430         (cpp_handle_deferred_pragma): New interface.
8431         * lex.c (token_spellings): Adjust OP and TK definitions to
8432         match changes to cpplib.h.
8433         (_cpp_lex_token): Check for a directive-result token and
8434         return it if present.
8435         (cpp_token_val_index): Handle CPP_PRAGMA.
8436         * macro.c (cpp_builtin_macro_text): Correct comment.
8437         (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
8439 2004-09-06  Serge Belyshev  <belyshev@lubercy.com>
8441         PR preprocessor/14699
8442         * symtab.c (ht_dump_statistics): Change type of sum_of_squares
8443         from size_t to double.
8445 2004-08-28  Andreas Schwab  <schwab@suse.de>
8446             Andreas Jaeger <aj@suse.de>
8448         * configure.ac: Set PACKAGE correctly.
8449         * configure: Regenerated.
8451 2004-08-25  Paolo Bonzini  <bonzini@gnu.org>
8453         * Makefile.in: Add back top_builddir.
8455 2004-08-25  Paolo Bonzini  <bonzini@gnu.org>
8457         * configure.ac: Replace Automake macro invocations
8458         with manual Autoconf checks and substitutions.
8459         * configure: Regenerate.
8460         * aclocal.m4: Regenerate.
8461         * config.in: Regenerate.
8462         * Makefile.am: Removed.
8463         * Makefile.in: Heavy simplification and reorganization.
8465 2004-08-09  Mark Mitchell  <mark@codesourcery.com>
8467         * configure.ac (arm*-*-eabi*): New target.
8468         (arm*-*-symbianelf*): Likewise.
8469         * configure: Regenerated.
8471 2004-07-24  Bernardo Innocenti  <bernie@develer.com>
8473         * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
8474         * directives.c: Use XNEW-family macros from libiberty.
8475         * lex.c: Likewise.
8476         * macro.c: Likewise.
8477         * cpplib.h (cpp_deps_style): Export enum with name.
8479 2004-07-23  Matthias Klose  <doko@debian.org>
8481         * init.c (init_library): Use PACKAGE for the text domain.
8483 2004-07-16  Andris Pavenis  <pavenis@latnet.lv>
8485         PR preprocessor/16366
8486         * internal.h (struct cpp_reader): New field dir_hash.
8487         * files.c (make_cpp_dir): Use dir_hash, not file_hash.
8488         (_cpp_init_files, _cpp_cleanup_files): Update for new field.
8490 2004-07-04  Neil Booth  <neil@duron.akihabara.co.uk>
8492         PR preprocessor/16192
8493         PR preprocessor/15913
8494         PR preprocessor/15572
8495         * expr.c (_cpp_parse_expr): Handle remaining cases where an
8496         expression is missing.
8497         * init.c (post_options): Traditional cpp doesn't do // comments.
8499 2004-06-30  Per Bothner  <per@bothner.com>
8501         * include/line-map.h (fileline):  Remove old typedef.
8502         * internal.h (struct cpp_reader):  Use source_location typedef instead.
8504 2004-06-26  Zack Weinberg  <zack@codesourcery.com>
8506         Partially revert patch of 2004-06-05.
8507         * files.c (search_cache): Remove pfile argument.  Don't check
8508         for file that would be found by "" or <> search here...
8509         (_cpp_find_file): ...do it here, before calling find_file_in_dir.
8510         Do not apply directory-of-current-file correction to files
8511         found by this check.  Rearrange code slightly.
8513 2004-06-21  Geoffrey Keating  <geoffk@apple.com>
8515         * files.c (should_stack_file): Correct swapped parameters to call
8516         to cb.read_pch.
8517         * pch.c (cpp_valid_state): Handle -fpreprocessed.
8519 2004-06-15  Paolo Bonzini  <bonzini@gnu.org>
8521         * Makefile.in: Regenerate with automake 1.8.5.
8522         * aclocal.m4: Likewise.
8523         * configure: Regenerate.
8525 2004-06-11  Zack Weinberg  <zack@codesourcery.com>
8527         * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
8528         * configure, config.in: Regenerate.
8529         * system.h: Unconditionally define bool as unsigned char,
8530         BOOL_BITFIELD as unsigned int.
8531         * .cvsignore: New file.
8533 2004-06-09  Geoffrey Keating  <geoffk@apple.com>
8535         * traditional.c (push_replacement_text): Set macro->traditional.
8536         (save_replacement_text): Likewise.
8537         * pch.c (cpp_write_pch_state): Don't write list of defined macros.
8538         (struct save_macro_item): Delete.
8539         (struct save_macro_data): Use a character array not the previous
8540         structured format.
8541         (save_macros): Save macro as text not as internal structures.
8542         (cpp_prepare_state): Update for changes to save_macro_data.
8543         (cpp_read_state): Don't read macros defined in PCH.  Restore
8544         -D macros as text.
8545         * macro.c (create_iso_definition): Honour alloc_subobject.
8546         Clear traditional flag.
8547         (_cpp_create_definition): Honour alloc_subobject.
8548         * lex.c (cpp_token_val_index): New.
8549         * internal.h: Include cpp-id-data.h.
8550         (uchar): Move definition to cpp-id-data.h.
8551         (U): Likewise.
8552         (cpp_macro): Likewise.
8553         * directives.c (struct answer): Move to cpp-id-data.h.
8554         (do_assert): Honour alloc_subobject.
8556         * include/symtab.h (struct ht): Add field 'alloc_subobject'.
8557         * include/cpplib.h (struct cpp_string): Add GTY marker.
8558         (enum cpp_token_fld_kind): New.
8559         (struct cpp_token): Add GTY markers.
8560         (cpp_token_val_index): Prototype.
8561         (CPP_HASHNODE_VALUE_IDX): New.
8562         (struct cpp_hashnode): Don't skip fields of 'value' when marking.
8563         * include/cpp-id-data.h: New file.
8565 2004-06-09  Paolo Bonzini  <bonzini@gnu.org>
8567         * Makefile.am (all-local): New.
8568         * Makefile.in: Regenerate.
8570 2004-06-06  Roger Sayle  <roger@eyesopen.com>
8572         * Makefile.am (LIBICONV): Declare.
8573         (makedepend_LDADD): Use LIBICONV.
8574         * Makefile.in: Regenerate.
8576 2004-06-05  Andrew Pinski  <pinskia@physics.uc.edu>
8578         * Makefile.am (LIBINTL): Declare
8579         (makedepend_LDADD): Use LIBINTL.
8580         * Makefile.in: Regenerate.
8582 2004-06-05  Zack Weinberg  <zack@codesourcery.com>
8584         * Makefile.am: Add makedepend.
8585         * Makefile.in, aclocal.m4: Regenerate.
8586         * charset.c: Insert a space to avoid a warning.
8587         * directives.c: Include mkdeps.h.
8588         (_cpp_handle_directive): Reenable macro expander if appropriate.
8589         (undefine_macros): Inline body of _cpp_free_definition for speed.
8590         Do not call undef callback or _cpp_warn_if_unused_macro.
8591         (cpp_get_deps): New interface.
8592         * files.c (search_cache): Add pfile argument.  Check for file
8593         that would be found by "" or <> search here...
8594         (_cpp_find_file): ...not here.  Correct recorded start_dir of
8595         files found by directory-of-current-file search that would be
8596         found by "" or <> search.
8597         * init.c (cpp_add_dependency_target): Delete.
8598         * internal.h (struct lexer_state): Add discarding_output flag.
8599         * lex.c (lex_identifier): Compute hash function while scanning.
8600         * macro.c (cpp_scan_nooutput): Disable macro expansion outside
8601         directives.
8602         * makedepend.c: New file.
8603         * mkdeps.c (struct deps): Add vpath vector.
8604         (apply_vpath, deps_add_vpath): New function.
8605         (deps_free): Free vpath vector.
8606         (deps_add_dep, deps_add_target): Use apply_vpath.
8607         * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
8608         (ht_lookup_with_hash): New function.
8609         * cpplib.h, mkdeps.h: Update prototypes.
8610         * symtab.h: Update prototypes.
8611         (HT_HASHSTEP, HT_FINISH): New macros.
8613 2004-05-29  Geoffrey Keating  <geoffk@apple.com>
8615         * symtab.c (ht_create): Set entries_owned.
8616         (ht_destroy): Honour entries_owned.
8617         (ht_expand): Likewise.
8618         (ht_load): New.
8619         * include/symtab.h (struct ht): New field 'entries_owned'
8620         (ht_load): New prototype.
8622 2004-05-26  Paolo Bonzini  <bonzini@gnu.org>
8624         PR bootstrap/15651
8625         * configure.ac: Fix m4 quoting when picking
8626         the size of HOST_WIDE_INT.
8627         * configure: Regenerate.
8629 2004-05-25  Paolo Bonzini  <bonzini@gnu.org>
8631         * Makefile.am: the correct directory for
8632         gettext include files is given by @INCINTL@.
8633         * Makefile.in: Regenerate.
8635 2004-05-24  Paolo Bonzini  <bonzini@gnu.org>
8637         * system.h [!ENABLE_NLS]: dgettext takes two
8638         parameters.
8640 2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
8642         Moved libcpp from the gcc subdirectory to the toplevel.
8643         * Makefile.am: New file.
8644         * Makefile.in: Regenerate.
8645         * configure.ac: New file.
8646         * configure: Regenerate.
8647         * config.in: Regenerate.
8648         * charset.c: Moved from gcc/cppcharset.c.  Add note about
8649         brokenness of input charset detection.  Adjust for change
8650         in name of cppucnid.h.
8651         * errors.c: Moved from gcc/cpperror.c.  Do not include intl.h.
8652         * expr.c: Moved from gcc/cppexp.c.
8653         * files.c: Moved from gcc/cppfiles.c.  Do not include intl.h.
8654         Remove #define of O_BINARY, it is in system.h.
8655         * identifiers.c: Moved from gcc/cpphash.c.
8656         * internal.h: Moved from gcc/cpphash.h.  Change header
8657         guard name.  All other files adjusted to match name change.
8658         * init.c: Moved from gcc/cppinit.c.
8659         (init_library) [ENABLE_NLS]: Call bindtextdomain.
8660         * lex.c: Moved from gcc/cpplex.c.
8661         * directives.c: Moved from gcc/cpplib.c.
8662         * macro.c: Moved from gcc/cppmacro.c.
8663         * pch.c: Moved from gcc/cpppch.c.  Do not include intl.h.
8664         * traditional.c: Moved from gcc/cpptrad.c.
8665         * ucnid.h: Moved from gcc/cppucnid.h.  Change header
8666         guard name.
8667         * ucnid.pl: Moved from gcc/cppucnid.pl.
8668         * ucnid.tab: Moved from gcc/cppucnid.tab.  Change header
8669         guard name.
8670         * symtab.c: Moved from gcc/hashtable.c.
8671         * line-map.c: Moved from gcc.  Do not include intl.h.
8672         * mkdeps.c: Moved from gcc.
8673         * system.h: New file.
8674         * include/cpplib.h: Moved from gcc.  Change header guard name.
8675         * include/line-map.h: Moved from gcc.  Change header guard name.
8676         * include/mkdeps.h: Moved from gcc.  Change header guard name.
8677         * include/symtab.h: Moved from gcc/hashtable.h.  Change header
8678         guard name.
8680 Copyright (C) 2004-2025 Free Software Foundation, Inc.
8682 Copying and distribution of this file, with or without modification,
8683 are permitted in any medium without royalty provided the copyright
8684 notice and this notice are preserved.