1 2025-06-17 Jason Merrill <jason@redhat.com>
3 * line-map.cc (linemap_location_from_module_p): Add.
4 * include/line-map.h: Declare it.
6 2025-06-11 David Malcolm <dmalcolm@redhat.com>
9 * include/line-map.h (typedef expanded_location): Convert to...
10 (struct expanded_location): ...this.
11 (operator==): New decl, for expanded_location.
12 (operator!=): Likewise.
13 * line-map.cc (operator==): New decl, for expanded_location.
15 2025-05-07 Jakub Jelinek <jakub@redhat.com>
17 PR preprocessor/108900
18 PR preprocessor/116047
19 PR preprocessor/120061
20 * files.cc (_cpp_stack_file): Revert 2025-03-28 change.
21 * line-map.cc (linemap_add): Use
22 SOURCE_LINE (from, linemap_included_from (map - 1)) + 1; instead of
23 SOURCE_LINE (from, from[1].start_location); to compute to_line
24 for LC_LEAVE. For LC_ENTER included_from computation, look at
25 map[-2] or even lower if map[-1] has the same start_location as
28 2025-04-28 Lewis Hyatt <lhyatt@gmail.com>
31 * errors.cc (cpp_get_diagnostic_override_loc): New function.
32 * include/cpplib.h (cpp_get_diagnostic_override_loc): Declare.
34 2025-04-24 Jakub Jelinek <jakub@redhat.com>
37 * lex.cc (lex_raw_string): For C allow $@` in raw string delimiters
38 if CPP_OPTION (pfile, low_ucns) i.e. for C23 and later.
40 2025-04-09 Jakub Jelinek <jakub@redhat.com>
42 PR preprocessor/118674
43 * macro.cc (parse_params) <case CPP_ELLIPSIS>: If _cpp_save_parameter
44 failed for __VA_ARGS__, goto out.
46 2025-04-04 Jakub Jelinek <jakub@redhat.com>
48 PR preprocessor/119391
49 * expr.cc (num_lshift): Add pfile argument. Don't set num.overflow
50 for !num.unsignedp in C++20 or later unless n >= precision. For
51 C++11 to C++17 set it if orig >> (precision - 1 - n) as logical
52 shift results in value > 1.
53 (num_binary_op): Pass pfile to num_lshift.
54 (num_div_op): Likewise.
56 2025-03-28 Jeremy Bettis <jbettis@google.com>
58 PR preprocessor/108900
59 * files.cc (_cpp_stack_file): Do not decrement highest_location
62 2025-03-27 Roland McGrath <mcgrathr@google.com>
64 * configure.ac: Check for setlocale.
65 * configure, config.in: Regenerated.
67 2025-03-12 Jakub Jelinek <jakub@redhat.com>
69 PR preprocessor/119202
70 * charset.cc (convert_oct): Fix up typo in diagnostics about \o
73 2025-02-28 Jakub Jelinek <jakub@redhat.com>
75 * include/cpplib.h (enum cpp_warning_reason): Add
76 CPP_W_CXX26_EXTENSIONS enumerator.
77 * init.cc (lang_defaults): Set embed for GNUCXX26 and CXX26.
78 * directives.cc (do_embed): Adjust pedwarn wording for embed in C++,
79 use cpp_pedwarning instead of cpp_error and add CPP_W_C11_C23_COMPAT
80 warning of cpp_pedwarning hasn't diagnosed anything.
82 2024-12-24 Lewis Hyatt <lhyatt@gmail.com>
84 * macro.cc (tokens_buff_new): Fix length argument to XNEWVEC.
86 2024-12-08 Lewis Hyatt <lhyatt@gmail.com>
88 * include/cpplib.h (struct cpp_token): Adjust comment about the
90 * include/line-map.h (location_t): Change typedef from 32-bit to 64-bit
92 (LINE_MAP_MAX_COLUMN_NUMBER): Increase size to be appropriate for
94 (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): Likewise.
95 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
96 (LINE_MAP_MAX_LOCATION): Likewise.
97 (MAX_LOCATION_T): Likewise.
98 (line_map_suggested_range_bits): Likewise.
99 (struct line_map): Adjust comment about the struct size.
100 (struct line_map_macro): Likewise.
101 (struct line_map_ordinary): Likewise. Rearrange fields to optimize
104 2024-12-06 Jakub Jelinek <jakub@redhat.com>
106 * files.cc (finish_embed): Use CPP_EMBED even for C++.
108 2024-12-03 Joseph Myers <josmyers@redhat.com>
111 * include/cpplib.h (struct cpp_options): Add low_ucns.
112 * init.cc (struct lang_flags, lang_defaults): Add low_ucns.
113 (cpp_set_lang): Set low_ucns
114 * charset.cc (_cpp_valid_ucn): For C, allow UCNs below 0xa0
115 outside identifiers, with a pedwarn if pedantic before C23 or a
116 warning with -Wc11-c23-compat. Do not allow \u0024 in identifiers
119 2024-11-28 David Malcolm <dmalcolm@redhat.com>
122 * pch.cc (cpp_valid_state): Replace "%<%s%>" with "%qs" in message
125 2024-11-27 Jason Merrill <jason@redhat.com>
127 * files.cc (_cpp_stack_file): Handle -include of header unit more
130 2024-11-23 Lewis Hyatt <lhyatt@gmail.com>
132 PR preprocessor/117118
133 * lex.cc (lex_raw_string): Treat an unterminated raw string the same
134 way for a deferred pragma as is done for other directives.
136 2024-11-23 Lewis Hyatt <lhyatt@gmail.com>
138 * lex.cc (_cpp_commit_buff): Make sure that the buffer is properly
139 aligned for the next allocation.
140 * internal.h (struct dummy): Make sure alignment is large enough for
141 a location_t, just in case.
143 2024-11-23 Lewis Hyatt <lhyatt@gmail.com>
145 * include/line-map.h (line_map_uint_t): New typedef, the same type
147 (location_diff_t): New typedef.
148 (line_map_suggested_range_bits): New constant.
149 (struct maps_info_ordinary): Change member types from "unsigned int"
150 to "line_map_uint_t".
151 (struct maps_info_macro): Likewise.
152 (struct location_adhoc_data_map): Likewise.
153 (LINEMAPS_ALLOCATED): Change return type from "unsigned int" to
155 (LINEMAPS_ORDINARY_ALLOCATED): Likewise.
156 (LINEMAPS_MACRO_ALLOCATED): Likewise.
157 (LINEMAPS_USED): Likewise.
158 (LINEMAPS_ORDINARY_USED): Likewise.
159 (LINEMAPS_MACRO_USED): Likewise.
160 (linemap_lookup_macro_index): Likewise.
161 (LINEMAPS_MAP_AT): Change argument type from "unsigned int" to
163 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
164 (LINEMAPS_MACRO_MAP_AT): Likewise.
165 (line_map_new_raw): Likewise.
166 (linemap_module_restore): Likewise.
167 (linemap_dump): Likewise.
168 (line_table_dump): Likewise.
169 (LINEMAPS_LAST_MAP): Add a linemap_assert() for safety.
170 (SOURCE_COLUMN): Use a cast to ensure correctness if location_t
171 becomes a 64-bit type.
172 * line-map.cc (location_adhoc_data_hash): Don't truncate to 32-bit
173 prematurely when hashing.
174 (line_maps::get_or_create_combined_loc): Adapt types to support
175 potentially 64-bit location_t. Use MAX_LOCATION_T rather than a
177 (line_maps::get_range_from_loc): Adapt types and constants to
178 support potentially 64-bit location_t.
179 (line_maps::pure_location_p): Likewise.
180 (line_maps::get_pure_location): Likewise.
181 (line_map_new_raw): Likewise.
182 (LAST_SOURCE_LINE_LOCATION): Likewise.
183 (linemap_add): Likewise.
184 (linemap_module_restore): Likewise.
185 (linemap_line_start): Likewise.
186 (linemap_position_for_column): Likewise.
187 (linemap_position_for_line_and_column): Likewise.
188 (linemap_position_for_loc_and_offset): Likewise.
189 (linemap_ordinary_map_lookup): Likewise.
190 (linemap_lookup_macro_index): Likewise.
191 (linemap_dump): Likewise.
192 (linemap_dump_location): Likewise.
193 (linemap_get_file_highest_location): Likewise.
194 (line_table_dump): Likewise.
195 (linemap_compare_locations): Avoid signed int overflow in the result.
196 * macro.cc (num_expanded_macros_counter): Change type of global
197 variable from "unsigned int" to "line_map_uint_t".
198 (num_macro_tokens_counter): Likewise.
200 2024-11-18 Jason Merrill <jason@redhat.com>
202 * internal.h (_cpp_get_file_dir): Declare.
203 * files.cc (_cpp_get_file_dir): New fn.
204 * mkdeps.cc (make_write): Use it.
206 2024-11-17 Jason Merrill <jason@redhat.com>
208 * internal.h (search_path_head): Declare.
209 * files.cc (search_path_head): No longer static.
210 * init.cc (cpp_read_main_file): Use it.
212 2024-11-15 Jakub Jelinek <jakub@redhat.com>
214 * expr.cc (interpret_float_suffix): Handle d64x and D64x
215 suffixes, adjust comment.
217 2024-11-13 Jakub Jelinek <jakub@redhat.com>
219 * expr.cc (interpret_float_suffix): Handle d32 and D32 suffixes
220 for C like df, d64 and D64 like dd and d128 and D128 like
223 2024-11-13 Jakub Jelinek <jakub@redhat.com>
226 * include/cpplib.h (struct cpp_options): Add imaginary_constants
228 * init.cc (struct lang_flags): Add imaginary_constants bitfield.
229 (lang_defaults): Add column for imaginary_constants.
230 (cpp_set_lang): Copy over imaginary_constants.
231 * expr.cc (cpp_classify_number): Diagnose CPP_N_IMAGINARY
232 non-CPP_N_FLOATING constants differently for C.
234 2024-11-01 Jakub Jelinek <jakub@redhat.com>
237 * include/cpplib.h: Implement C++26 P3034R1
238 - Module Declarations Shouldn’t be Macros (or more precisely
239 its expected intent).
240 (NO_DOT_COLON): Define.
241 * internal.h (struct cpp_reader): Add diagnose_dot_colon_from_macro_p
243 * lex.cc (cpp_maybe_module_directive): For pp-module, if
244 module keyword is followed by CPP_NAME, ensure all CPP_NAME
245 tokens possibly matching module name and module partition
246 syntax aren't expanded and aren't defined as object-like macros.
247 Verify first token after that doesn't start with open paren.
248 If the next token after module name/partition is CPP_NAME defined
249 as macro, set NO_DOT_COLON flag on it.
250 * macro.cc (cpp_get_token_1): Set
251 pfile->diagnose_dot_colon_from_macro_p if token to be expanded has
252 NO_DOT_COLON bit set in flags. Before returning, if
253 pfile->diagnose_dot_colon_from_macro_p is true and not returning
254 CPP_PADDING or CPP_COMMENT and not during macro expansion preparation,
255 set pfile->diagnose_dot_colon_from_macro_p to false and diagnose
256 if returning CPP_DOT or CPP_COLON.
258 2024-10-25 Jakub Jelinek <jakub@redhat.com>
260 * directives.cc: Remove trailing whitespace.
261 * mkdeps.cc: Likewise.
262 * line-map.cc: Likewise.
263 * internal.h: Likewise.
264 * files.cc: Likewise.
266 * makeucnid.cc: Likewise.
267 * system.h: Likewise.
268 * include/line-map.h: Likewise.
269 * include/symtab.h: Likewise.
270 * include/cpplib.h: Likewise.
272 * charset.cc: Likewise.
273 * macro.cc: Likewise.
274 * errors.cc: Likewise.
276 * traditional.cc: Likewise.
278 2024-10-23 Jakub Jelinek <jakub@redhat.com>
280 * include/cpplib.h (struct cpp_options): Add
281 cpp_warn_leading_whitespace and cpp_tabstop members.
282 (enum cpp_warning_reason): Add CPP_W_LEADING_WHITESPACE.
283 * internal.h (struct _cpp_line_note): Document new
285 * init.cc (cpp_create_reader): Set cpp_tabstop to 8.
286 * lex.cc (find_leading_whitespace_issues): New function.
287 (_cpp_clean_line): Use it.
288 (_cpp_process_line_notes): Handle 'L', 'S' and 'T' line notes.
289 (lex_raw_string): Clear type on 'L', 'S' and 'T' line notes
290 inside of raw string literals.
292 2024-10-19 Lewis Hyatt <lhyatt@gmail.com>
294 PR preprocessor/114423
295 * internal.h (struct cpp_reader): Add DIAGNOSTIC_OVERRIDE_LOC
297 * directives.cc (destringize_and_run): Set the new field to the
298 location of the _Pragma operator.
299 * errors.cc (cpp_diagnostic_at): Support DIAGNOSTIC_OVERRIDE_LOC to
300 temporarily issue diagnostics at a different location.
301 (cpp_diagnostic_with_line): Likewise.
303 2024-10-17 Jakub Jelinek <jakub@redhat.com>
306 * include/cpplib.h (struct cpp_options): Add named_uc_escape_seqs,
307 octal_constants and cpp_warn_c23_c2y_compat members.
308 (enum cpp_warning_reason): Add CPP_W_C23_C2Y_COMPAT enumerator.
309 * init.cc (struct lang_flags): Add named_uc_escape_seqs and
310 octal_constants bit-fields.
311 (lang_defaults): Add initializers for them into the table.
312 (cpp_set_lang): Initialize named_uc_escape_seqs and octal_constants.
313 (cpp_create_reader): Initialize cpp_warn_c23_c2y_compat to -1.
314 * charset.cc (_cpp_valid_ucn): Test
315 CPP_OPTION (pfile, named_uc_escape_seqs) rather than
316 CPP_OPTION (pfile, delimited_escape_seqs) in \N{} related tests.
317 Change wording of C cpp_pedwarning for \u{} and emit
318 -Wc23-c2y-compat warning for it too if needed. Formatting fixes.
319 (convert_hex): Change wording of C cpp_pedwarning for \u{} and emit
320 -Wc23-c2y-compat warning for it too if needed.
321 (convert_oct): Likewise.
322 * expr.cc (cpp_classify_number): Handle C2Y 0o or 0O prefixed
324 (cpp_interpret_integer): Likewise.
326 2024-10-16 Jakub Jelinek <jakub@redhat.com>
328 * expr.cc (interpret_float_suffix): ?: operator formatting fixes.
330 2024-10-16 Jakub Jelinek <jakub@redhat.com>
332 * include/cpplib.h (TTYPE_TABLE): Add CPP_EMBED token type.
333 * files.cc (finish_embed): For limit >= 64 and C preprocessing
334 instead of emitting CPP_NUMBER CPP_COMMA separated sequence for the
335 whole embed emit it just for the first and last byte and in between
336 emit a CPP_EMBED token or tokens if too large.
338 2024-10-15 Jakub Jelinek <jakub@redhat.com>
340 * include/cpplib.h (struct cpp_options): Add
341 cpp_warn_trailing_whitespace member.
342 (enum cpp_warning_reason): Add CPP_W_TRAILING_WHITESPACE.
343 * internal.h (struct _cpp_line_note): Document 'W' line note.
344 * lex.cc (_cpp_clean_line): Add 'W' line note for trailing whitespace
345 except for trailing whitespace after backslash. Formatting fix.
346 (_cpp_process_line_notes): Emit -Wtrailing-whitespace diagnostics.
348 (lex_raw_string): Clear type on 'W' notes.
350 2024-10-14 Jason Merrill <jason@redhat.com>
352 * lex.cc (cpp_output_token): Omit terminal space from name.
354 2024-10-14 Lewis Hyatt <lhyatt@gmail.com>
356 PR preprocessor/114436
357 * directives.cc (destringize_and_run): If the _Pragma changed the
358 buffer system header state (e.g. because it was "GCC
359 system_header"), propagate that change back to the actual buffer
362 2024-10-14 Lewis Hyatt <lhyatt@gmail.com>
364 PR preprocessor/109704
365 * include/cpplib.h (class cpp_auto_suppress_diagnostics): New class.
367 (cpp_auto_suppress_diagnostics::cpp_auto_suppress_diagnostics): New
369 (cpp_auto_suppress_diagnostics::~cpp_auto_suppress_diagnostics): New
371 * charset.cc (noop_diagnostic_cb): Remove.
372 (cpp_interpret_string_ranges): Refactor diagnostic suppression logic
373 into new class cpp_auto_suppress_diagnostics.
374 (count_source_chars): Likewise.
375 * directives.cc (cpp_pop_definition): Add cpp_hashnode argument.
376 (lex_identifier_from_string): New static helper function.
377 (push_pop_macro_common): Refactor common logic from
378 do_pragma_push_macro and do_pragma_pop_macro; use
379 lex_identifier_from_string instead of _cpp_lex_identifier.
380 (do_pragma_push_macro): Reimplement using push_pop_macro_common.
381 (do_pragma_pop_macro): Likewise.
382 * internal.h (_cpp_lex_identifier): Remove.
383 * lex.cc (lex_identifier_intern): Remove.
384 (_cpp_lex_identifier): Remove.
386 2024-10-12 Jakub Jelinek <jakub@redhat.com>
388 * include/cpplib.h (ATTRIBUTE_CPP_PPDIAG): Define.
389 (struct cpp_callbacks): Use ATTRIBUTE_CPP_PPDIAG instead of
390 ATTRIBUTE_FPTR_PRINTF on diagnostic callback.
391 (cpp_error, cpp_warning, cpp_pedwarning, cpp_warning_syshdr): Use
392 ATTRIBUTE_CPP_PPDIAG (3, 4) instead of ATTRIBUTE_PRINTF_3.
393 (cpp_warning_at, cpp_pedwarning_at): Use ATTRIBUTE_CPP_PPDIAG (4, 5)
394 instead of ATTRIBUTE_PRINTF_4.
395 (cpp_error_with_line, cpp_warning_with_line, cpp_pedwarning_with_line,
396 cpp_warning_with_line_syshdr): Use ATTRIBUTE_CPP_PPDIAG (5, 6)
397 instead of ATTRIBUTE_PRINTF_5.
398 (cpp_error_at): Use ATTRIBUTE_CPP_PPDIAG (4, 5) instead of
400 * Makefile.in (po/$(PACKAGE).pot): Use --language=GCC-source rather
402 * errors.cc (cpp_diagnostic_at, cpp_diagnostic,
403 cpp_diagnostic_with_line): Use ATTRIBUTE_CPP_PPDIAG instead of
404 -ATTRIBUTE_FPTR_PRINTF.
405 * charset.cc (cpp_host_to_exec_charset, _cpp_valid_ucn, convert_hex,
406 convert_oct, convert_escape): Fix up -Wformat-diag warnings.
407 (cpp_interpret_string_ranges, count_source_chars): Use
408 ATTRIBUTE_CPP_PPDIAG instead of ATTRIBUTE_FPTR_PRINTF.
409 (narrow_str_to_charconst): Fix up -Wformat-diag warnings.
410 * directives.cc (check_eol_1, directive_diagnostics, lex_macro_node,
411 do_undef, glue_header_name, parse_include, do_include_common,
412 do_include_next, _cpp_parse_embed_params, do_embed, read_flag,
413 do_line, do_linemarker, register_pragma_1, do_pragma_once,
414 do_pragma_push_macro, do_pragma_pop_macro, do_pragma_poison,
415 do_pragma_system_header, do_pragma_warning_or_error, _cpp_do__Pragma,
416 do_else, do_elif, do_endif, parse_answer, do_assert,
417 cpp_define_unused): Likewise.
418 * expr.cc (cpp_classify_number, parse_defined, eval_token,
419 _cpp_parse_expr, reduce, check_promotion): Likewise.
420 * files.cc (_cpp_find_file, finish_base64_embed,
421 _cpp_pop_file_buffer): Likewise.
422 * init.cc (sanity_checks): Likewise.
423 * lex.cc (_cpp_process_line_notes, maybe_warn_bidi_on_char,
424 _cpp_warn_invalid_utf8, _cpp_skip_block_comment,
425 warn_about_normalization, forms_identifier_p, maybe_va_opt_error,
426 identifier_diagnostics_on_lex, cpp_maybe_module_directive): Likewise.
427 * macro.cc (class vaopt_state, builtin_has_include_1,
428 builtin_has_include, builtin_has_embed, _cpp_warn_if_unused_macro,
429 _cpp_builtin_macro_text, builtin_macro, stringify_arg,
430 _cpp_arguments_ok, collect_args, enter_macro_context,
431 _cpp_save_parameter, parse_params, create_iso_definition,
432 _cpp_create_definition, check_trad_stringification): Likewise.
433 * pch.cc (cpp_valid_state): Likewise.
434 * traditional.cc (_cpp_scan_out_logical_line, recursive_macro):
437 2024-10-09 Jason Merrill <jason@redhat.com>
439 * macro.cc (_cpp_pop_context): Fix typo.
441 2024-10-09 Ken Matsui <kmatsui@gcc.gnu.org>
444 * directives.cc (do_pragma_once): Use ' instead of %< and %>.
446 2024-10-09 Ken Matsui <kmatsui@gcc.gnu.org>
448 PR preprocessor/89808
449 * include/cpplib.h (cpp_warning_reason): Define
450 CPP_W_PRAGMA_ONCE_OUTSIDE_HEADER.
451 * directives.cc (do_pragma_once): Use
452 CPP_W_PRAGMA_ONCE_OUTSIDE_HEADER.
454 2024-10-08 Jakub Jelinek <jakub@redhat.com>
456 * makeucnid.cc (write_copyright): Update Unicode Copyright years.
457 * makeuname2c.cc (generated_ranges): Adjust Unicode version from 15.1
458 to 16.0. Add EGYPTIAN HIEROGLYPH- generated range, adjust indexes in
460 (write_copyright): Update Unicode Copyright years.
461 * generated_cpp_wcwidth.h: Regenerated.
462 * ucnid.h: Regenerated.
463 * uname2c.h: Regenerated.
465 2024-10-07 Jakub Jelinek <jakub@redhat.com>
467 * internal.h (_cpp_trigraph_map_s): New type for C++14 or later.
468 (_cpp_trigraph_map_d): New variable for C++14 or later.
469 (_cpp_trigraph_map): Define to _cpp_trigraph_map_d.map for C++14 or
471 * init.cc (init_trigraph_map): Define to nothing for C++14 or later.
472 (TRIGRAPH_MAP, END, s): Define differently for C++14 or later.
474 2024-10-02 Jakub Jelinek <jakub@redhat.com>
476 PR preprocessor/96842
477 * include/cpplib.h (struct cpp_options): Add warn_header_guard member.
478 (enum cpp_warning_reason): Add CPP_W_HEADER_GUARD enumerator.
479 * internal.h (struct cpp_reader): Add mi_def_cmacro, mi_loc and
481 (_cpp_defined_macro_p): Constify type pointed by argument type.
483 * init.cc (cpp_create_reader): Clear
484 CPP_OPTION (pfile, warn_header_guard).
485 * directives.cc (struct if_stack): Add def_loc and mi_def_cmacro
487 (DIRECTIVE_TABLE): Add IF_COND flag to define.
488 (do_define): Set ifs->mi_def_cmacro on a define immediately following
489 #ifndef directive for the guard. Clear pfile->mi_valid. Formatting
491 (do_endif): Copy over pfile->mi_def_cmacro and pfile->mi_def_loc
492 if ifs->mi_def_cmacro is set and pfile->mi_cmacro isn't a defined
494 (push_conditional): Clear mi_def_cmacro and mi_def_loc members.
495 * files.cc (_cpp_pop_file_buffer): Emit -Wheader-guard diagnostics.
497 2024-09-13 Jakub Jelinek <jakub@redhat.com>
499 * files.cc (finish_embed): Initialize toks to tok rather
502 2024-09-12 Jakub Jelinek <jakub@redhat.com>
504 * internal.h (struct cpp_embed_params): Add base64 member.
505 (_cpp_free_embed_params_tokens): Declare.
506 * directives.cc (DIRECTIVE_TABLE): Add IN_I flag to T_EMBED.
507 (save_token_for_embed, _cpp_free_embed_params_tokens): New functions.
508 (EMBED_PARAMS): Add gnu::base64 entry.
509 (_cpp_parse_embed_params): Parse gnu::base64 parameter. If
510 -fpreprocessed without -fdirectives-only, require #embed to have
511 gnu::base64 parameter. Diagnose conflict between gnu::base64 and
512 limit or gnu::offset parameters.
513 (do_embed): Use _cpp_free_embed_params_tokens.
514 * files.cc (finish_embed, base64_dec_fn): New functions.
515 (base64_dec): New array.
516 (B64D0, B64D1, B64D2, B64D3): Define.
517 (finish_base64_embed): New function.
518 (_cpp_stack_embed): Use finish_embed. Handle params->base64
519 using finish_base64_embed.
520 * macro.cc (builtin_has_embed): Call _cpp_free_embed_params_tokens.
522 2024-09-12 Jason Merrill <jason@redhat.com>
524 * include/cpplib.h (enum cpp_warning_reason): Add
525 CPP_W_CXX{14,17,20,23}_EXTENSIONS.
526 * charset.cc (_cpp_valid_ucn, convert_hex, convert_oct)
527 (convert_escape, narrow_str_to_charconst): Use cpp_pedwarning
528 instead of cpp_error for pedwarns.
529 * directives.cc (directive_diagnostics, _cpp_handle_directive)
530 (do_line, do_elif): Likewise.
531 * expr.cc (cpp_classify_number, eval_token): Likewise.
532 * lex.cc (skip_whitespace, maybe_va_opt_error)
533 (_cpp_lex_direct): Likewise.
534 * macro.cc (_cpp_arguments_ok): Likewise.
535 (replace_args): Use -Wvariadic-macros for pedwarn about
536 empty macro arguments.
538 2024-09-12 Jakub Jelinek <jakub@redhat.com>
540 * internal.h (struct cpp_embed_params): Add offset member.
541 * directives.cc (EMBED_PARAMS): Add gnu::offset entry.
542 (enum embed_param_kind): Add NUM_EMBED_STD_PARAMS.
543 (_cpp_parse_embed_params): Use NUM_EMBED_STD_PARAMS rather than
544 NUM_EMBED_PARAMS when parsing standard parameters. Parse gnu::offset
546 * files.cc (struct _cpp_file): Add offset member.
547 (_cpp_stack_embed): Handle params->offset.
549 2024-09-12 Jakub Jelinek <jakub@redhat.com>
552 * include/cpplib.h: Implement C23 N3017 #embed - a scannable,
553 tooling-friendly binary resource inclusion mechanism paper.
554 (struct cpp_options): Add embed member.
555 (enum cpp_builtin_type): Add BT_HAS_EMBED.
556 (cpp_set_include_chains): Add another cpp_dir * argument to
558 * internal.h (enum include_type): Add IT_EMBED.
559 (struct cpp_reader): Add embed_include member.
560 (struct cpp_embed_params_tokens): New type.
561 (struct cpp_embed_params): New type.
562 (_cpp_get_token_no_padding): Declare.
563 (enum _cpp_find_file_kind): Add _cpp_FFK_EMBED and _cpp_FFK_HAS_EMBED.
564 (_cpp_stack_embed): Declare.
565 (_cpp_parse_expr): Change return type to cpp_num_part instead of
566 bool, change second argument from bool to const char * and add third
568 (_cpp_parse_embed_params): Declare.
569 * directives.cc (DIRECTIVE_TABLE): Add embed entry.
570 (end_directive): Don't call skip_rest_of_line for T_EMBED directive.
571 (_cpp_handle_directive): Return 2 rather than 1 for T_EMBED in
572 directives-only mode.
573 (parse_include): Don't Call check_eol for T_EMBED directive.
574 (skip_balanced_token_seq): New function.
575 (EMBED_PARAMS): Define.
576 (enum embed_param_kind): New type.
577 (embed_params): New variable.
578 (_cpp_parse_embed_params): New function.
579 (do_embed): New function.
580 (do_if): Adjust _cpp_parse_expr caller.
582 * expr.cc (parse_defined): Diagnose defined in #embed or __has_embed
584 (_cpp_parse_expr): Change return type to cpp_num_part instead of
585 bool, change second argument from bool to const char * and add third
586 argument. Adjust function comment. For #embed/__has_embed parameters
587 add an artificial CPP_OPEN_PAREN. Use the second argument DIR
588 directly instead of string literals conditional on IS_IF.
589 For #embed/__has_embed parameter, stop on reaching CPP_CLOSE_PAREN
590 matching the artificial one. Diagnose negative or too large embed
592 (num_binary_op): Use #embed instead of #if for diagnostics if inside
593 #embed/__has_embed parameter.
594 (num_div_op): Likewise.
595 * files.cc (struct _cpp_file): Add limit member and embed bitfield.
596 (search_cache): Add IS_EMBED argument, formatting fix. Skip over
597 files with different file->embed from the argument.
598 (find_file_in_dir): Don't call pch_open_file if file->embed.
599 (_cpp_find_file): Handle _cpp_FFK_EMBED and _cpp_FFK_HAS_EMBED.
600 (read_file_guts): Formatting fix.
601 (has_unique_contents): Ignore file->embed files.
602 (search_path_head): Handle IT_EMBED type.
603 (_cpp_stack_embed): New function.
604 (_cpp_get_file_stat): Formatting fix.
605 (cpp_set_include_chains): Add embed argument, save it to
606 pfile->embed_include and compute lens for the chain.
607 * init.cc (struct lang_flags): Add embed member.
608 (lang_defaults): Add embed initializers.
609 (cpp_set_lang): Initialize CPP_OPTION (pfile, embed).
610 (builtin_array): Add __has_embed entry.
611 (cpp_init_builtins): Predefine __STDC_EMBED_NOT_FOUND__,
612 __STDC_EMBED_FOUND__ and __STDC_EMBED_EMPTY__.
613 * lex.cc (cpp_directive_only_process): Handle #embed.
614 * macro.cc (cpp_get_token_no_padding): Rename to ...
615 (_cpp_get_token_no_padding): ... this. No longer static.
616 (builtin_has_include_1): New function.
617 (builtin_has_include): Use it. Use _cpp_get_token_no_padding
618 instead of cpp_get_token_no_padding.
619 (builtin_has_embed): New function.
620 (_cpp_builtin_macro_text): Handle BT_HAS_EMBED.
622 2024-08-26 Alexander Monakov <amonakov@ispras.ru>
624 * internal.h (CPP_BUFFER_PADDING): New macro; use it ...
625 * charset.cc (_cpp_convert_input): ...here, and ...
626 * files.cc (read_file_guts): ...here, and ...
627 * lex.cc (search_line_ssse3): here.
629 2024-08-23 Alexander Monakov <amonakov@ispras.ru>
631 PR preprocessor/116458
632 * charset.cc (_cpp_convert_input): Bump padding to 64 if
635 2024-08-22 Marc Poulhiès <poulhies@adacore.com>
637 * lex.cc(search_line_ssse3): fix static_assert to use 2 arguments.
639 2024-08-20 Jakub Jelinek <jakub@redhat.com>
641 * init.cc (struct lang_flags): Change all members from char
642 typed fields to unsigned bit-fields.
643 (lang_defaults): Change formatting of the initializer so that it
644 fits to 68 columns rather than 147.
646 2024-08-20 Alexander Monakov <amonakov@ispras.ru>
648 * config.in: Regenerate.
649 * configure: Regenerate.
650 * configure.ac: Check for SSSE3 instead of SSE4.2.
651 * files.cc (read_file_guts): Bump padding to 64 if HAVE_SSSE3.
652 * lex.cc (search_line_acc_char): Mark inline, not "unused".
653 (search_line_sse2): Mark inline.
654 (search_line_sse42): Replace with...
655 (search_line_ssse3): ... this new function. Adjust the use...
656 (init_vectorized_lexer): ... here. Simplify.
658 2024-08-06 Andi Kleen <ak@gcc.gnu.org>
660 * lex.cc (search_line_mmx): Remove function.
661 (init_vectorized_lexer): Remove search_line_mmx.
663 2024-07-25 Jakub Jelinek <jakub@redhat.com>
666 * lex.cc: C++26 P2558R2 - Add @, $, and ` to the basic character set.
667 (lex_raw_string): For C++26 allow $@` characters in prefix.
668 * charset.cc (_cpp_valid_ucn): For C++26 reject \u0024 in identifiers.
670 2024-07-24 David Malcolm <dmalcolm@redhat.com>
672 * include/rich-location.h
673 (semi_embedded_vec::semi_embedded_vec): Add copy ctor.
674 (rich_location::rich_location): Remove "= delete" from decl of
675 copy ctor. Add deleted decl of move ctor.
676 (rich_location::operator=): Remove "= delete" from decl of
677 copy assignment. Add deleted decl of move assignment.
678 (fixit_hint::fixit_hint): Add copy ctor decl. Add deleted decl of
680 (fixit_hint::operator=): Add copy assignment decl. Add deleted
681 decl of move assignment.
682 * line-map.cc (rich_location::rich_location): New copy ctor.
683 (fixit_hint::fixit_hint): New copy ctor.
685 2024-07-13 David Malcolm <dmalcolm@redhat.com>
687 * include/rich-location.h (location_range::m_highlight_color): New
689 (rich_location::rich_location): Add optional label_highlight_color
691 (rich_location::set_highlight_color): New decl.
692 (rich_location::add_range): Add optional label_highlight_color
694 (rich_location::set_range): Likewise.
695 * line-map.cc (rich_location::rich_location): Add
696 "label_highlight_color" param and pass it to add_range.
697 (rich_location::set_highlight_color): New.
698 (rich_location::add_range): Add "label_highlight_color" param.
699 (rich_location::set_range): Add "highlight_color" param.
701 2024-06-21 David Malcolm <dmalcolm@redhat.com>
704 * include/rich-location.h (rich_location::get_column_override):
707 2024-06-11 Joseph Myers <josmyers@redhat.com>
709 * include/cpplib.h (CLK_GNUC2Y, CLK_STDC2Y): New.
710 * init.cc (lang_defaults): Add GNUC2Y and STDC2Y entries.
711 (cpp_init_builtins): Define __STDC_VERSION__ to 202500L for GNUC2Y
714 2024-06-07 Jason Merrill <jason@redhat.com>
716 * files.cc (_cpp_stack_file): LC_ENTER for -include header unit.
718 2024-05-29 Jason Merrill <jason@redhat.com>
720 * mkdeps.cc (make_write): Change .c++m to .c++-module.
722 2024-05-28 David Malcolm <dmalcolm@redhat.com>
724 * Makefile.in (TAGS_SOURCES): Add include/label-text.h.
725 * include/label-text.h: New file.
726 * include/rich-location.h: Include "label-text.h".
727 (class label_text): Move to label-text.h.
729 2024-05-26 Peter Damianov <peter0x44@disroot.org>
731 * lex.cc (do_peek_prev): Correct typo in argument to __builtin_expect()
733 2024-05-17 David Malcolm <dmalcolm@redhat.com>
735 * include/rich-location.h (class label_effects): New forward decl.
736 (range_label::get_effects): New vfunc.
738 2024-04-30 Jakub Jelinek <jakub@redhat.com>
740 * init.cc (cpp_init_builtins): Change __STDC_VERSION__
741 for C23 from 202000L to 202311L.
743 2024-04-17 Christophe Lyon <christophe.lyon@linaro.org>
745 PR preprocessor/114748
746 * aclocal.m4: Regenerate.
747 * configure: Regenerate.
749 2024-03-14 Lewis Hyatt <lhyatt@gmail.com>
751 PR preprocessor/110558
752 * macro.cc (builtin_has_include): Set
753 pfile->state.directive_wants_padding prior to lexing the
754 file name, in case it comes from macro expansion.
756 2024-03-14 Lewis Hyatt <lhyatt@gmail.com>
758 PR preprocessor/80755
759 * files.cc (search_path_head): Add SUPPRESS_DIAGNOSTIC argument
761 (_cpp_has_header): Silently return false if the search path has been
762 exhausted, rather than issuing a diagnostic and then hitting an
765 2024-02-22 Jakub Jelinek <jakub@redhat.com>
768 * include/cpplib.h (COLON_SCOPE): Define to PURE_ZERO.
769 * lex.cc (_cpp_lex_direct): When lexing CPP_COLON with another
770 colon after it, if !CPP_OPTION (pfile, scope) set COLON_SCOPE
771 flag on the first CPP_COLON token.
773 2024-02-01 Lewis Hyatt <lhyatt@gmail.com>
775 PR preprocessor/105608
776 * pch.cc (cpp_read_state): Set a valid location for restored
779 2024-01-04 Raiki Tamura <tamaron1203@gmail.com>
781 * charset.cc (cpp_check_xid_property): New.
783 (cpp_check_xid_property): New.
784 (enum cpp_xid_property): New.
786 2023-12-13 Jakub Jelinek <jakub@redhat.com>
788 PR preprocessor/112956
789 * lex.cc (_cpp_lex_direct): Initialize c to 0.
790 For CPP_PRAGMA_EOL tokens and if c == 0 also for CPP_EOF
791 set result->src_loc to highest locus.
793 2023-11-28 Lewis Hyatt <lhyatt@gmail.com>
795 PR preprocessor/112701
796 * expr.cc (num_div_op): Set unsignedp appropriately when returning a
797 stub value for divide by 0.
799 2023-11-27 Alex Coplan <alex.coplan@arm.com>
800 Iain Sandoe <iain@sandoe.co.uk>
803 * include/cpplib.h (struct cpp_callbacks): Add has_feature.
804 (enum cpp_builtin_type): Add BT_HAS_{FEATURE,EXTENSION}.
805 * init.cc: Add __has_{feature,extension}.
806 * macro.cc (_cpp_builtin_macro_text): Handle
807 BT_HAS_{FEATURE,EXTENSION}.
809 2023-11-24 Alexander Monakov <amonakov@ispras.ru>
811 * config.in: Regenerate.
812 * configure: Regenerate.
813 * configure.ac (ENABLE_VALGRIND_CHECKING): Delete.
814 (ENABLE_VALGRIND_ANNOTATIONS): Rename to
815 ENABLE_VALGRIND_WORKAROUNDS. Delete Valgrind header checks.
816 * lex.cc (new_buff): Adjust for renaming.
817 (_cpp_free_buff): Ditto.
819 2023-11-20 Marc Poulhiès <dkm@kataplop.net>
821 * macro.cc (parse_params): Fix typo in variadic.
822 (create_iso_definition): Likewise.
824 2023-11-19 David Malcolm <dmalcolm@redhat.com>
826 * Makefile.in (TAGS_SOURCES): Add "include/rich-location.h".
827 * include/cpplib.h (class rich_location): New forward decl.
828 * include/line-map.h (class range_label)
829 (enum range_display_kind, struct location_range)
830 (class semi_embedded_vec, class rich_location, class label_text)
831 (class range_label, class fixit_hint): Move to...
832 * include/rich-location.h: ...this new file.
833 * internal.h: Include "rich-location.h".
835 2023-11-14 Jakub Jelinek <jakub@redhat.com>
837 * makeucnid.cc (write_copyright): Update copyright year.
838 * makeuname2c.cc (write_copyright): Likewise.
839 (struct generated): Update latest Unicode version.
840 (generated_ranges): Add 2ebf0-2ee5d CJK UNIFIED IDEOGRAPH
841 range which was forgotten to be added to 4-8 table, but
842 clearly is expected to be there from the 15.1 additions.
843 * ucnid.h: Regenerated.
844 * uname2c.h: Regenerated.
845 * generated_cpp_wcwidth.h: Regenerated.
847 2023-11-14 Jakub Jelinek <jakub@redhat.com>
850 * charset.cc: Implement C++26 P1854R4 - Making non-encodable string
852 (one_count_chars, convert_count_chars, count_source_chars): New
854 (narrow_str_to_charconst): Change last arg type from cpp_ttype to
855 const cpp_token *. For C++ if pedantic and i > 1 in CPP_CHAR
856 interpret token also as CPP_STRING32 and if number of characters
857 in the CPP_STRING32 is larger than number of bytes in CPP_CHAR,
858 pedwarn on it. Make the diagnostics more detailed.
859 (wide_str_to_charconst): Change last arg type from cpp_ttype to
860 const cpp_token *. Make the diagnostics more detailed.
861 (cpp_interpret_charconst): Adjust narrow_str_to_charconst and
862 wide_str_to_charconst callers.
864 2023-11-14 Arsen Arsenović <arsen@aarsen.me>
866 * config.in: Regenerate.
868 2023-11-13 Arsen Arsenović <arsen@aarsen.me>
870 * configure: Regenerate.
871 * aclocal.m4: Regenerate.
873 2023-11-09 David Malcolm <dmalcolm@redhat.com>
875 * include/line-map.h (rich_location::get_expanded_location): Make
877 (rich_location::get_line_table): New accessor.
878 (rich_location::m_line_table): Make the pointer be const.
879 (rich_location::m_have_expanded_location): Make mutable.
880 (rich_location::m_expanded_location): Likewise.
881 (fixit_hint::affects_line_p): Add const line_maps * param.
882 (linemap_client_expand_location_to_spelling_point): Likewise.
883 * line-map.cc (rich_location::get_expanded_location): Make const.
885 linemap_client_expand_location_to_spelling_point.
886 (rich_location::maybe_add_fixit): Likewise.
887 (fixit_hint::affects_line_p): Add set param and pass to
888 linemap_client_expand_location_to_spelling_point.
890 2023-11-07 Joseph Myers <joseph@codesourcery.com>
892 * directives.cc: Refer to C23 instead of C2X in diagnostics and
894 (STDC2X): Rename to STDC23.
895 * expr.cc: Use cpp_warn_c11_c23_compat instead of
896 cpp_warn_c11_c2x_compat and CPP_W_C11_C23_COMPAT instead of
897 CPP_W_C11_C2X_COMPAT. Refer to C23 instead of C2X in diagnostics
899 * include/cpplib.h: Refer to C23 instead of C2X in diagnostics and
901 (CLK_GNUC2X): Rename to CLK_GNUC23.
902 (CLK_STDC2X): Rename to CLK_STDC23.
903 (CPP_W_C11_C2X_COMPAT): Rename to CPP_W_C11_C23_COMPAT.
904 * init.cc: Use GNUC23 instead of GNUC2X, STDC23 instead of STDC2X
905 and cpp_warn_c11_c23_compat instead of cpp_warn_c11_c2x_compat.
906 * lex.cc (maybe_va_opt_error): Refer to C23 instead of C2X in
908 * macro.cc (_cpp_arguments_ok): Refer to C23 instead of C2X in
911 2023-11-02 Jakub Jelinek <jakub@redhat.com>
914 * include/cpplib.h (TTYPE_TABLE): Add CPP_UNEVAL_STRING literal
915 entry. Use C++11 instead of C++-0x in comments.
916 * charset.cc (convert_escape): Add UNEVAL argument, if true,
917 pedantically diagnose numeric escape sequences.
918 (cpp_interpret_string_1): Formatting fix. Adjust convert_escape
920 (cpp_interpret_string): Formatting string.
921 (cpp_interpret_string_notranslate): Pass type through to
922 cpp_interpret_string if it is CPP_UNEVAL_STRING.
924 2023-10-31 David Malcolm <dmalcolm@redhat.com>
927 (line_map_macro::get_expansion_point_location): New accessor.
928 (line_map_macro::expansion): Rename field to...
929 (line_map_macro::mexpansion): Rename field to...
930 (MACRO_MAP_EXPANSION_POINT_LOCATION): Delete this function.
931 * line-map.cc (linemap_enter_macro): Update for renaming of field.
932 (linemap_macro_map_loc_to_exp_point): Update for removal of
933 MACRO_MAP_EXPANSION_POINT_LOCATION.
935 2023-10-23 Lewis Hyatt <lhyatt@gmail.com>
937 PR preprocessor/36887
938 * directives.cc (do_pragma_poison): Store in the extra hash map the
939 location from which an identifier has been poisoned.
940 * lex.cc (identifier_diagnostics_on_lex): When issuing a diagnostic
941 for the use of a poisoned identifier, also add a note indicating the
942 location from which it was poisoned.
943 * identifiers.cc (alloc_node): Convert to template function.
944 (_cpp_init_hashtable): Handle the new extra hash map.
945 (_cpp_destroy_hashtable): Likewise.
946 * include/cpplib.h (struct cpp_hashnode_extra): New struct.
947 (cpp_create_reader): Update prototype to...
948 * init.cc (cpp_create_reader): ...accept an argument for the extra
949 hash table and pass it to _cpp_init_hashtable.
950 * include/symtab.h (ht_lookup): New overload for convenience.
951 * internal.h (struct cpp_reader): Add EXTRA_HASH_TABLE member.
952 (_cpp_init_hashtable): Adjust prototype.
954 2023-10-08 David Malcolm <dmalcolm@redhat.com>
956 * include/line-map.h (LINEMAPS_ORDINARY_MAPS): Delete.
957 (LINEMAPS_MACRO_MAPS): Delete.
958 * line-map.cc (linemap_tracks_macro_expansion_locs_p): Update for
959 deletion of LINEMAPS_MACRO_MAPS.
960 (linemap_get_statistics): Likewise.
962 2023-10-08 David Malcolm <dmalcolm@redhat.com>
964 * include/line-map.h (maps_info_ordinary::cache): Rename to...
965 (maps_info_ordinary::m_cache): ...this.
966 (maps_info_macro::cache): Rename to...
967 (maps_info_macro::m_cache): ...this.
968 (LINEMAPS_CACHE): Delete.
969 (LINEMAPS_ORDINARY_CACHE): Delete.
970 (LINEMAPS_MACRO_CACHE): Delete.
971 * init.cc (read_original_filename): Update for adding "m_" prefix.
972 * line-map.cc (linemap_add): Eliminate LINEMAPS_ORDINARY_CACHE in
973 favor of a simple field access.
974 (linemap_enter_macro): Likewise for LINEMAPS_MACRO_CACHE.
975 (linemap_ordinary_map_lookup): Likewise for
976 LINEMAPS_ORDINARY_CACHE, twice.
977 (linemap_lookup_macro_index): Likewise for LINEMAPS_MACRO_CACHE.
979 2023-10-08 David Malcolm <dmalcolm@redhat.com>
981 * include/line-map.h (LINEMAPS_LAST_ALLOCATED_MAP): Delete.
982 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Delete.
983 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Delete.
985 2023-10-08 David Malcolm <dmalcolm@redhat.com>
987 * include/line-map.h (line_maps::reallocator): Rename to...
988 (line_maps::m_reallocator): ...this.
989 (line_maps::round_alloc_size): Rename to...
990 (line_maps::m_round_alloc_size): ...this.
991 (line_maps::location_adhoc_data_map): Rename to...
992 (line_maps::m_location_adhoc_data_map): ...this.
993 (line_maps::num_optimized_ranges): Rename to...
994 (line_maps::m_num_optimized_ranges): ..this.
995 (line_maps::num_unoptimized_ranges): Rename to...
996 (line_maps::m_num_unoptimized_ranges): ...this.
997 (get_combined_adhoc_loc): Delete decl.
998 (COMBINE_LOCATION_DATA): Delete.
999 * lex.cc (get_location_for_byte_range_in_cur_line): Update for
1000 removal of COMBINE_LOCATION_DATA.
1001 (warn_about_normalization): Likewise.
1002 (_cpp_lex_direct): Likewise.
1003 * line-map.cc (line_maps::~line_maps): Update for "m_" prefix of
1004 some fields of line_maps.
1005 (rebuild_location_adhoc_htab): Likewise.
1006 (can_be_stored_compactly_p): Convert to...
1007 (line_maps::can_be_stored_compactly_p): ...this private member
1009 (get_combined_adhoc_loc): Convert to...
1010 (line_maps::get_or_create_combined_loc): ...this public member
1012 (line_maps::make_location): Update for removal of
1013 COMBINE_LOCATION_DATA.
1014 (get_data_from_adhoc_loc): Update for "m_" prefix of some fields
1016 (get_discriminator_from_adhoc_loc): Likewise.
1017 (get_location_from_adhoc_loc): Likewise.
1018 (get_range_from_adhoc_loc): Convert to...
1019 (line_maps::get_range_from_adhoc_loc): ...this private member
1021 (line_maps::get_range_from_loc): Update for conversion of
1022 get_range_from_adhoc_loc to a member function.
1023 (linemap_init): Update for "m_" prefix of some fields of
1025 (line_map_new_raw): Likewise.
1026 (linemap_enter_macro): Likewise.
1027 (linemap_get_statistics): Likewise.
1029 2023-10-08 David Malcolm <dmalcolm@redhat.com>
1031 * include/line-map.h (line_maps::pure_location_p): New decl.
1032 (line_maps::get_pure_location): New decl.
1033 (line_maps::get_range_from_loc): New decl.
1034 (line_maps::get_start): New.
1035 (line_maps::get_finish): New.
1036 (line_maps::make_location): New decl.
1037 (get_range_from_loc): Make line_maps param const.
1038 (get_discriminator_from_loc): Likewise.
1039 (pure_location_p): Likewise.
1040 (get_pure_location): Likewise.
1041 (linemap_check_files_exited): Likewise.
1042 (linemap_tracks_macro_expansion_locs_p): Likewise.
1043 (linemap_location_in_system_header_p): Likewise.
1044 (linemap_location_from_macro_definition_p): Likewise.
1045 (linemap_macro_map_loc_unwind_toward_spelling): Likewise.
1046 (linemap_included_from_linemap): Likewise.
1047 (first_map_in_common): Likewise.
1048 (linemap_compare_locations): Likewise.
1049 (linemap_location_before_p): Likewise.
1050 (linemap_resolve_location): Likewise.
1051 (linemap_unwind_toward_expansion): Likewise.
1052 (linemap_unwind_to_first_non_reserved_loc): Likewise.
1053 (linemap_expand_location): Likewise.
1054 (linemap_get_file_highest_location): Likewise.
1055 (linemap_get_statistics): Likewise.
1056 (linemap_dump_location): Likewise.
1057 (linemap_dump): Likewise.
1058 (line_table_dump): Likewise.
1059 * internal.h (linemap_get_expansion_line): Likewise.
1060 (linemap_get_expansion_filename): Likewise.
1061 * line-map.cc (can_be_stored_compactly_p): Likewise.
1062 (get_data_from_adhoc_loc): Drop redundant "class".
1063 (get_discriminator_from_adhoc_loc): Likewise.
1064 (get_location_from_adhoc_loc): Likewise.
1065 (get_range_from_adhoc_loc): Likewise.
1066 (get_range_from_loc): Make const and move implementation to...
1067 (line_maps::get_range_from_loc): ...this new function.
1068 (get_discriminator_from_loc): Make line_maps param const.
1069 (pure_location_p): Make const and move implementation to...
1070 (line_maps::pure_location_p): ...this new function.
1071 (get_pure_location): Make const and move implementation to...
1072 (line_maps::get_pure_location): ...this new function.
1073 (linemap_included_from_linemap): Make line_maps param const.
1074 (linemap_check_files_exited): Likewise.
1075 (linemap_tracks_macro_expansion_locs_p): Likewise.
1076 (linemap_macro_map_loc_unwind_toward_spelling): Likewise.
1077 (linemap_get_expansion_line): Likewise.
1078 (linemap_get_expansion_filename): Likewise.
1079 (linemap_location_in_system_header_p): Likewise.
1080 (first_map_in_common_1): Likewise.
1081 (linemap_compare_locations): Likewise.
1082 (linemap_macro_loc_to_spelling_point): Likewise.
1083 (linemap_macro_loc_to_def_point): Likewise.
1084 (linemap_macro_loc_to_exp_point): Likewise.
1085 (linemap_resolve_location): Likewise.
1086 (linemap_location_from_macro_definition_p): Likewise.
1087 (linemap_unwind_toward_expansion): Likewise.
1088 (linemap_unwind_to_first_non_reserved_loc): Likewise.
1089 (linemap_expand_location): Likewise.
1090 (linemap_dump): Likewise.
1091 (linemap_dump_location): Likewise.
1092 (linemap_get_file_highest_location): Likewise.
1093 (linemap_get_statistics): Likewise.
1094 (line_table_dump): Likewise.
1096 2023-09-20 Lewis Hyatt <lhyatt@gmail.com>
1098 PR preprocessor/61474
1099 * files.cc (_cpp_find_file): Set DONT_READ to TRUE for fake
1101 (_cpp_fake_include): Pass a unique cpp_dir* address so
1102 the fake file will not be found when looked up for real.
1104 2023-09-19 Ben Boeckel <ben.boeckel@kitware.com>
1106 * include/cpplib.h: Add cpp_fdeps_format enum.
1107 (cpp_options): Add fdeps_format field
1108 (cpp_finish): Add structured dependency fdeps_stream parameter.
1109 * include/mkdeps.h (deps_add_module_target): Add flag for
1110 whether a module is exported or not.
1111 (fdeps_add_target): Add function.
1112 (deps_write_p1689r5): Add function.
1113 * init.cc (cpp_finish): Add new preprocessor parameter used for C++
1115 * mkdeps.cc (mkdeps): Implement P1689R5 output.
1117 2023-09-06 Jakub Jelinek <jakub@redhat.com>
1120 * expr.cc (cpp_classify_number): Diagnose wb literal suffixes
1121 for -pedantic* before C2X or -Wc11-c2x-compat.
1123 2023-09-06 Jakub Jelinek <jakub@redhat.com>
1126 * expr.cc (interpret_int_suffix): Handle wb and WB suffixes.
1127 * include/cpplib.h (CPP_N_BITINT): Define.
1129 2023-08-07 Alan Modra <amodra@gmail.com>
1131 * configure: Regenerate.
1133 2023-07-19 Lewis Hyatt <lhyatt@gmail.com>
1135 PR preprocessor/103902
1136 * lex.cc (identifier_diagnostics_on_lex): New function refactoring
1138 (lex_identifier_intern): Use the new function.
1139 (lex_identifier): Don't run identifier diagnostics here, rather let
1140 the call site do it when needed.
1141 (_cpp_lex_direct): Adjust the call sites of lex_identifier ()
1143 (struct scan_id_result): New struct.
1144 (scan_cur_identifier): New function.
1145 (create_literal2): New function.
1146 (lit_accum::create_literal2): New function.
1147 (is_macro): Folded into new function...
1148 (maybe_ignore_udl_macro_suffix): ...here.
1149 (is_macro_not_literal_suffix): Folded likewise.
1150 (lex_raw_string): Handle UTF-8 in UDL suffix via
1151 scan_cur_identifier ().
1152 (lex_string): Likewise.
1154 2023-07-06 Thomas Schwinge <thomas@codesourcery.com>
1156 * include/symtab.h (struct ht_identifier): Document different
1159 2023-06-23 Marek Polacek <polacek@redhat.com>
1161 * include/cpplib.h (c_lang): Add CXX26 and GNUCXX26.
1162 * init.cc (lang_defaults): Add rows for CXX26 and GNUCXX26.
1163 (cpp_init_builtins): Set __cplusplus to 202400L for C++26.
1164 Set __cplusplus to 202302L for C++23.
1166 2023-06-23 Ben Boeckel <me@benboeckel.net>
1168 * charset.cc: Allow `UCS_LIMIT` in UTF-8 strings.
1170 2023-06-22 David Malcolm <dmalcolm@redhat.com>
1172 * charset.cc (get_cppchar_property): New function template, based
1174 (cpp_wcwidth): ...this function. Rework to use the above.
1175 Include "combining-chars.inc".
1176 (cpp_is_combining_char): New function
1177 Include "printable-chars.inc".
1178 (cpp_is_printable_char): New function
1179 * combining-chars.inc: New file, generated by
1180 contrib/unicode/gen-combining-chars.py.
1181 * include/cpplib.h (cpp_is_combining_char): New function decl.
1182 (cpp_is_printable_char): New function decl.
1183 * printable-chars.inc: New file, generated by
1184 contrib/unicode/gen-printable-chars.py.
1186 2023-06-20 Lewis Hyatt <lhyatt@gmail.com>
1189 * macro.cc (_cpp_create_definition): Add location argument.
1190 * internal.h (_cpp_create_definition): Adjust prototype.
1191 * directives.cc (do_define): Pass new location argument to
1192 _cpp_create_definition.
1193 (do_undef): Stop passing inferior location to cpp_warning_with_line;
1194 the default from cpp_warning is better.
1195 (cpp_pop_definition): Pass new location argument to
1196 _cpp_create_definition.
1197 * pch.cc (cpp_read_state): Likewise.
1199 2023-06-19 Ben Boeckel <ben.boeckel@kitware.com>
1201 * charset.cc: Reject encodings of codepoints above 0x10FFFF.
1202 UTF-16 does not support such codepoints and therefore all
1203 Unicode rejects such values.
1205 2023-06-15 Marek Polacek <polacek@redhat.com>
1207 * configure.ac (--enable-host-shared): Don't set PICFLAG here.
1208 (--enable-host-pie): New check. Set PICFLAG after this check.
1209 * configure: Regenerate.
1211 2023-06-15 Jakub Jelinek <jakub@redhat.com>
1213 PR preprocessor/80753
1214 * files.cc (struct _cpp_file): Add deferred_error bitfield.
1215 (_cpp_find_file): When finding a file in cache with deferred_error
1216 set in _cpp_FFK_NORMAL mode, call open_file_failed and clear the flag.
1217 Set deferred_error in _cpp_FFK_HAS_INCLUDE mode if open_file_failed
1220 2023-04-30 Jeff Law <jlaw@ventanamicro>
1223 2023-04-30 Longjun Luo <luolongjuna@gmail.com>
1225 * init.cc (builtin_array): Do not always warn for a redefinition
1228 2023-04-30 Longjun Luo <luolongjuna@gmail.com>
1230 * init.cc (builtin_array): Do not always warn for a redefinition
1233 2023-03-25 David Malcolm <dmalcolm@redhat.com>
1236 * charset.cc (cpp_valid_utf8_p): New function.
1237 * include/cpplib.h (cpp_valid_utf8_p): New prototype.
1239 2023-03-16 Jakub Jelinek <jakub@redhat.com>
1241 * makeucnid.cc (write_copyright): Update Unicode copyright years
1243 * makeuname2c.cc (write_copyright): Likewise.
1244 * ucnid.h: Regenerated.
1245 * uname2c.h: Regenerated.
1247 2023-03-13 Lewis Hyatt <lhyatt@gmail.com>
1249 PR preprocessor/67046
1250 * directives.cc (_cpp_do__Pragma): Increment pfile->keep_tokens to
1251 ensure the returned string token is valid.
1253 2023-03-13 Lewis Hyatt <lhyatt@gmail.com>
1255 * generated_cpp_wcwidth.h: Regenerated for Unicode 15.
1257 2022-12-07 Joseph Myers <joseph@codesourcery.com>
1259 * init.cc (lang_defaults): Enable va_opt for STDC2X.
1260 * lex.cc (maybe_va_opt_error): Adjust diagnostic message for C.
1261 * macro.cc (_cpp_arguments_ok): Update comment.
1263 2022-11-23 Marek Polacek <polacek@redhat.com>
1266 2022-11-23 Marek Polacek <polacek@redhat.com>
1268 * configure.ac (--enable-host-shared): Don't set PICFLAG here.
1269 (--enable-host-pie): New check. Set PICFLAG after this check.
1270 * configure: Regenerate.
1272 2022-11-23 Marek Polacek <polacek@redhat.com>
1274 * configure.ac (--enable-host-shared): Don't set PICFLAG here.
1275 (--enable-host-pie): New check. Set PICFLAG after this check.
1276 * configure: Regenerate.
1278 2022-11-21 Lewis Hyatt <lhyatt@gmail.com>
1280 * directives.cc (do_pragma): Fix memory leak in token buffer. Fix
1281 unwanted paste between two tokens.
1283 2022-11-21 Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
1285 * files.cc: Ensure pattern matches before use.
1287 2022-11-21 Martin Liska <mliska@suse.cz>
1289 * config.in: Re-configure.
1291 2022-11-19 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
1293 PR preprocessor/107691
1294 * configure.ac: Add valgrind header checks.
1295 * configure: Regenerate.
1297 2022-11-18 Richard Purdie <richard.purdie@linuxfoundation.org>
1299 * macro.cc (_cpp_builtin_macro_text): Don't remap filenames within
1302 2022-11-05 Lewis Hyatt <lhyatt@gmail.com>
1304 PR preprocessor/55971
1305 * lex.cc (get_fresh_line_impl): New function refactoring the code
1307 (_cpp_get_fresh_line): ...here.
1308 (lex_raw_string): Use the new version of get_fresh_line_impl() to
1309 support raw strings containing new lines when processing a directive.
1311 2022-11-04 Jakub Jelinek <jakub@redhat.com>
1313 * makeuname2c.cc (struct generated): Update from Unicode 15.0.0
1315 * ucnid.h: Regenerated for Unicode 15.0.0.
1316 * uname2c.h: Likewise.
1318 2022-10-19 Lewis Hyatt <lhyatt@gmail.com>
1320 * include/cpplib.h (struct cpp_string): Use new "string_length" GTY.
1321 * include/symtab.h (struct ht_identifier): Likewise.
1323 2022-10-14 Joseph Myers <joseph@codesourcery.com>
1325 * charset.cc (ucn_valid_in_identifier): Check xid_identifiers not
1326 cplusplus to determine whether to use CXX23 and NXX23 flags.
1327 * include/cpplib.h (struct cpp_options): Add xid_identifiers.
1328 * init.cc (struct lang_flags, lang_defaults): Add xid_identifiers.
1329 (cpp_set_lang): Set xid_identifiers.
1330 * lex.cc (warn_about_normalization): Add parameter identifier.
1331 Only pedwarn about non-NFC for identifiers, not pp-numbers.
1332 (_cpp_lex_direct): Update calls to warn_about_normalization.
1334 2022-10-14 Jakub Jelinek <jakub@redhat.com>
1336 * include/cpplib.h (CPP_N_BFLOAT16): Define.
1337 * expr.cc (interpret_float_suffix): Handle bf16 and BF16 suffixes for
1340 2022-09-28 Eugene Rozenfeld <erozen@microsoft.com>
1342 * include/line-map.h: Add discriminator to location_adhoc_data.
1343 (get_combined_adhoc_loc): Add discriminator parameter.
1344 (get_discriminator_from_adhoc_loc): Add external declaration.
1345 (get_discriminator_from_loc): Add external declaration.
1346 (COMBINE_LOCATION_DATA): Add discriminator parameter.
1347 * lex.cc (get_location_for_byte_range_in_cur_line) Pass 0 discriminator
1348 in a call to COMBINE_LOCATION_DATA.
1349 (warn_about_normalization): Pass 0 discriminator in a call to
1350 COMBINE_LOCATION_DATA.
1351 (_cpp_lex_direct): Pass 0 discriminator in a call to
1352 COMBINE_LOCATION_DATA.
1353 * line-map.cc (location_adhoc_data_hash): Use discriminator compute
1354 location_adhoc_data hash.
1355 (location_adhoc_data_eq): Use discriminator when comparing
1356 location_adhoc_data.
1357 (can_be_stored_compactly_p): Check discriminator to determine
1359 (get_combined_adhoc_loc): Add discriminator parameter.
1360 (get_discriminator_from_adhoc_loc): New function to get the discriminator
1361 from an ad-hoc location.
1362 (get_discriminator_from_loc): New function to get the discriminator
1365 2022-09-27 Jakub Jelinek <jakub@redhat.com>
1369 * expr.cc (interpret_float_suffix): Allow {f,F}{16,32,64,128} and
1370 {f,F}{32,64,128}x suffixes for C++.
1372 2022-09-08 Lewis Hyatt <lhyatt@gmail.com>
1374 * line-map.cc (location_adhoc_data_update): Remove reliance on
1376 (get_combined_adhoc_loc): Likewise.
1377 (rebuild_location_adhoc_htab): Fix issue where the htab was not
1380 2022-09-07 Joseph Myers <joseph@codesourcery.com>
1382 * include/cpplib.h (struct cpp_options): Add true_false.
1383 * expr.cc (eval_token): Check true_false not cplusplus to
1384 determine whether to handle true and false keywords.
1385 * init.cc (struct lang_flags): Add true_false.
1386 (lang_defaults): Update.
1387 (cpp_set_lang): Set true_false.
1389 2022-09-07 Jakub Jelinek <jakub@redhat.com>
1391 * include/cpplib.h (struct cpp_options): Add cpp_warn_unicode member.
1392 (enum cpp_warning_reason): Add CPP_W_UNICODE.
1393 * init.cc (cpp_create_reader): Initialize cpp_warn_unicode.
1394 * charset.cc (_cpp_valid_ucn): In possible identifier contexts, don't
1395 handle \u{ or \N{ specially in -std=c* modes except -std=c++2{3,b}.
1396 In possible identifier contexts, don't emit an error and punt
1397 if \N isn't followed by {, or if \N{} surrounds some lower case
1398 letters or _. In possible identifier contexts when not C++23, don't
1399 emit an error but warning about unknown character names and treat as
1400 separate tokens. When treating as separate tokens \u{ or \N{, emit
1403 2022-09-05 Joseph Myers <joseph@codesourcery.com>
1405 * init.cc (lang_defaults): Disable trigraphs for C2x.
1407 2022-09-02 David Malcolm <dmalcolm@redhat.com>
1410 * include/cpplib.h (BOL): Move macro to 1 << 12 since it is
1411 not used by C/C++'s unsigned char token flags.
1412 (DECIMAL_INT): New, using 1 << 6, so that it is visible as
1413 part of C/C++'s 8 bits of token flags.
1415 2022-09-01 Jakub Jelinek <jakub@redhat.com>
1418 * include/cpplib.h (struct cpp_options): Implement C++23
1419 P2295R6 - Support for UTF-8 as a portable source file encoding.
1420 Add cpp_warn_invalid_utf8 and cpp_input_charset_explicit fields.
1421 (enum cpp_warning_reason): Add CPP_W_INVALID_UTF8 enumerator.
1422 * init.cc (cpp_create_reader): Initialize cpp_warn_invalid_utf8
1423 and cpp_input_charset_explicit.
1424 * charset.cc (_cpp_valid_utf8): Adjust function comment.
1425 * lex.cc (UCS_LIMIT): Define.
1426 (utf8_continuation): New const variable.
1427 (utf8_signifier): Move earlier in the file.
1428 (_cpp_warn_invalid_utf8, _cpp_handle_multibyte_utf8): New functions.
1429 (_cpp_skip_block_comment): Handle -Winvalid-utf8 warning.
1430 (skip_line_comment): Likewise.
1431 (lex_raw_string, lex_string): Likewise.
1432 (_cpp_lex_direct): Likewise.
1434 2022-08-31 Jakub Jelinek <jakub@redhat.com>
1436 PR preprocessor/106778
1437 * makeuname2c.cc (write_nodes): Reverse order of && operands in
1440 2022-08-26 Jakub Jelinek <jakub@redhat.com>
1443 * charset.cc (wide_str_to_charconst): Implement P2362R3 - Remove
1444 non-encodable wide character literals and multicharacter. For
1445 C++23 use CPP_DL_ERROR instead of CPP_DL_WARNING for
1446 "character constant too long for its type" diagnostics on CPP_WCHAR
1449 2022-08-26 Jakub Jelinek <jakub@redhat.com>
1452 * charset.cc: Implement C++23 P2071R2 - Named universal character
1453 escapes. Include uname2c.h.
1454 (hangul_syllables, hangul_count): New variables.
1455 (struct uname2c_data): New type.
1456 (_cpp_uname2c, _cpp_uname2c_uax44_lm2): New functions.
1457 (_cpp_valid_ucn): Use them. Handle named universal character escapes.
1458 (convert_ucn): Adjust comment.
1459 (convert_escape): Call convert_ucn even for \N.
1460 (_cpp_interpret_identifier): Handle named universal character escapes.
1461 * lex.cc (get_bidi_ucn): Fix up function comment formatting.
1462 (get_bidi_named): New function.
1463 (forms_identifier_p, lex_string): Handle named universal character
1465 * makeuname2c.cc: New file. Small parts copied from makeucnid.cc.
1466 * uname2c.h: New generated file.
1468 2022-08-24 Jakub Jelinek <jakub@redhat.com>
1471 * init.cc: Implement C++23 P2437R1 - Support for #warning.
1472 (lang_defaults): Set warning_directive for GNUCXX23 and CXX23.
1473 * directives.cc (directive_diagnostics): Use different wording of
1474 #warning pedwarn for C++.
1476 2022-08-20 Jakub Jelinek <jakub@redhat.com>
1479 * include/cpplib.h (struct cpp_options): Implement
1480 P2290R3 - Delimited escape sequences. Add delimite_escape_seqs
1482 * init.cc (struct lang_flags): Likewise.
1483 (lang_defaults): Add delim column.
1484 (cpp_set_lang): Copy over delimite_escape_seqs.
1485 * charset.cc (extend_char_range): New function.
1486 (_cpp_valid_ucn): Use it. Handle delimited escape sequences.
1487 (convert_hex): Likewise.
1488 (convert_oct): Likewise.
1489 (convert_ucn): Use extend_char_range.
1490 (convert_escape): Call convert_oct even for \o.
1491 (_cpp_interpret_identifier): Handle delimited escape sequences.
1492 * lex.cc (get_bidi_ucn_1): Likewise. Add end argument, fill it in.
1493 (get_bidi_ucn): Adjust get_bidi_ucn_1 caller. Use end argument to
1496 2022-08-18 Joseph Myers <joseph@codesourcery.com>
1498 * include/cpplib.h (struct cpp_options): Add warning_directive.
1499 * init.cc (struct lang_flags, lang_defaults): Add
1501 * directives.cc (DIRECTIVE_TABLE): Mark #warning as STDC2X not
1503 (directive_diagnostics): Diagnose #warning with -Wc11-c2x-compat,
1504 or with -pedantic for a standard not supporting #warning.
1506 2022-08-16 Tom Honermann <tom@honermann.net>
1509 * include/cpplib.h (cpp_warning_reason): Add CPP_W_CXX20_COMPAT.
1510 * init.cc (cpp_create_reader): Add cpp_warn_cxx20_compat.
1512 2022-08-08 Tom Honermann <tom@honermann.net>
1514 PR preprocessor/106426
1515 * charset.cc (narrow_str_to_charconst): Set signedness of CPP_UTF8CHAR
1516 literals based on unsigned_utf8char.
1517 * include/cpplib.h (cpp_options): Add unsigned_utf8char.
1518 * init.cc (cpp_create_reader): Initialize unsigned_utf8char.
1520 2022-07-15 Jonathan Wakely <jwakely@redhat.com>
1522 * include/line-map.h (label_text::take_or_copy): Remove.
1523 (label_text::moved_from): Rename to release.
1524 (label_text::m_buffer, label_text::m_owned): Make private.
1525 (label_text::get, label_text::is_owned): New accessors.
1527 2022-07-13 Marek Polacek <polacek@redhat.com>
1529 PR preprocessor/106272
1530 * include/line-map.h (class label_text): Don't std::move in a return
1533 2022-07-10 Lewis Hyatt <lhyatt@gmail.com>
1535 PR preprocessor/97498
1536 * directives.cc (destringize_and_run): Override the location of
1537 the CPP_PRAGMA token from a _Pragma directive to the location of
1538 the expansion point, as is done for the tokens lexed from it.
1540 2022-07-07 David Malcolm <dmalcolm@redhat.com>
1542 * include/line-map.h: Include <utility>.
1543 (class label_text): Delete maybe_free method in favor of a
1544 destructor. Add move ctor and assignment operator. Add deletion
1545 of the copy ctor and copy-assignment operator. Rename field
1546 m_caller_owned to m_owned. Add std::move where necessary; add
1547 moved_from member function.
1549 2022-06-28 Lewis Hyatt <lhyatt@gmail.com>
1551 * ucnid.h: Regenerated for Unicode 14.0.
1553 2022-06-26 Lewis Hyatt <lhyatt@gmail.com>
1555 * generated_cpp_wcwidth.h: Generated from updated Unicode data files.
1557 2022-05-29 Jakub Jelinek <jakub@redhat.com>
1559 PR preprocessor/105732
1560 * expr.cc (_cpp_parse_expr): Handle CPP_PADDING by just another
1563 2022-05-20 David Malcolm <dmalcolm@redhat.com>
1565 * lex.cc: Replace uses of "FINAL" and "OVERRIDE" with "final" and
1568 2022-02-11 Joseph Myers <joseph@codesourcery.com>
1570 * Makefile.in (po/$(PACKAGE).pot): Also handle cpp_warning_at,
1571 cpp_pedwarning_at and cpp_error_at.
1573 2022-02-01 Jakub Jelinek <jakub@redhat.com>
1575 PR preprocessor/104147
1576 * macro.cc (funlike_invocation_p): For padding prefer a token
1577 with val.source non-NULL especially if it has PREV_WHITE set
1578 on val.source->flags. Add gcc_assert that CPP_PADDING tokens
1579 don't have PREV_WHITE set in flags.
1581 2022-02-01 Jakub Jelinek <jakub@redhat.com>
1583 * directives.cc (destringize_and_run): Push &pfile->avoid_paste
1584 instead of a copy of pfile->directive_result for the CPP_PADDING
1587 2022-01-24 Marek Polacek <polacek@redhat.com>
1589 PR preprocessor/104030
1590 * include/cpplib.h (enum cpp_bidirectional_level): Add
1591 bidirectional_ucn. Set values explicitly.
1592 * internal.h (cpp_reader): Adjust warn_bidi_p.
1593 * lex.cc (maybe_warn_bidi_on_close): Don't warn about UCNs
1594 unless UCN checking is on.
1595 (maybe_warn_bidi_on_char): Likewise.
1597 2022-01-18 Richard Biener <rguenther@suse.de>
1599 * include/line-map.h (class line_maps): Re-arrange fields
1600 to minimize padding.
1601 (class rich_location): Likewise.
1602 * line-map.cc (rich_location::rich_location): Adjust.
1604 2022-01-17 Martin Liska <mliska@suse.cz>
1606 * Makefile.in: Rename .c names to .cc.
1608 2022-01-17 Martin Liska <mliska@suse.cz>
1610 * Makefile.in: Rename .c names to .cc.
1611 * charset.cc (convert_escape): Likewise.
1612 * directives.cc (directive_diagnostics): Likewise.
1613 (_cpp_handle_directive): Likewise.
1614 (lex_macro_node): Likewise.
1615 * include/cpplib.h (struct _cpp_file): Likewise.
1616 (PURE_ZERO): Likewise.
1617 (cpp_defined): Likewise.
1618 (cpp_error_at): Likewise.
1619 (cpp_forall_identifiers): Likewise.
1620 (cpp_compare_macros): Likewise.
1621 (cpp_get_converted_source): Likewise.
1622 (cpp_read_state): Likewise.
1623 (cpp_directive_only_process): Likewise.
1624 (struct cpp_decoded_char): Likewise.
1625 * include/line-map.h (enum lc_reason): Likewise.
1626 (enum location_aspect): Likewise.
1627 * include/mkdeps.h: Likewise.
1628 * init.cc (cpp_destroy): Likewise.
1629 (cpp_finish): Likewise.
1630 * internal.h (struct cpp_reader): Likewise.
1631 (_cpp_defined_macro_p): Likewise.
1632 (_cpp_backup_tokens_direct): Likewise.
1633 (_cpp_destroy_hashtable): Likewise.
1634 (_cpp_has_header): Likewise.
1635 (_cpp_expand_op_stack): Likewise.
1636 (_cpp_commit_buff): Likewise.
1637 (_cpp_restore_special_builtin): Likewise.
1638 (_cpp_bracket_include): Likewise.
1639 (_cpp_replacement_text_len): Likewise.
1641 * line-map.cc (linemap_macro_loc_to_exp_point): Likewise.
1642 (linemap_check_files_exited): Likewise.
1643 (line_map_new_raw): Likewise.
1644 * traditional.cc (enum ls): Likewise.
1646 2022-01-17 Martin Liska <mliska@suse.cz>
1648 * charset.c: Moved to...
1649 * charset.cc: ...here.
1650 * directives.c: Moved to...
1651 * directives.cc: ...here.
1652 * errors.c: Moved to...
1653 * errors.cc: ...here.
1654 * expr.c: Moved to...
1656 * files.c: Moved to...
1657 * files.cc: ...here.
1658 * identifiers.c: Moved to...
1659 * identifiers.cc: ...here.
1660 * init.c: Moved to...
1662 * lex.c: Moved to...
1664 * line-map.c: Moved to...
1665 * line-map.cc: ...here.
1666 * macro.c: Moved to...
1667 * macro.cc: ...here.
1668 * makeucnid.c: Moved to...
1669 * makeucnid.cc: ...here.
1670 * mkdeps.c: Moved to...
1671 * mkdeps.cc: ...here.
1672 * pch.c: Moved to...
1674 * symtab.c: Moved to...
1675 * symtab.cc: ...here.
1676 * traditional.c: Moved to...
1677 * traditional.cc: ...here.
1679 2022-01-15 Martin Sebor <msebor@redhat.com>
1681 * files.c (_cpp_find_file): Substitute a valid pointer for
1682 an invalid one to avoid -Wuse-after-free.
1684 2022-01-12 Clément Chigot <clement.chigot@atos.net>
1686 * configure.ac: Check sizeof ino_t and dev_t.
1687 * config.in: Regenerate.
1688 * configure: Regenerate.
1689 * include/cpplib.h (INO_T_CPP): Change for AIX.
1690 (DEV_T_CPP): New macro.
1691 (struct cpp_dir): Use it.
1693 2021-12-30 Jakub Jelinek <jakub@redhat.com>
1695 PR preprocessor/89971
1696 * macro.c (replace_args): For ##__VA_OPT__, if __VA_OPT__ expands
1697 to no tokens at all, drop PASTE_LEFT flag from the previous token.
1699 2021-12-04 Jakub Jelinek <jakub@redhat.com>
1701 PR preprocessor/102432
1702 * lex.c (_cpp_lex_direct): If buffer->need_line while
1703 pfile->state.in_deferred_pragma, return CPP_PRAGMA_EOL token instead
1704 of assertion failure.
1706 2021-12-03 Jakub Jelinek <jakub@redhat.com>
1709 * include/line-map.h (class line_maps): Add GTY((callback)) to
1710 reallocator and round_alloc_size members.
1712 2021-12-01 Jakub Jelinek <jakub@redhat.com>
1715 * init.c (struct lang_flags): Remove cxx23_identifiers.
1716 (lang_defaults): Remove cxx23_identifiers initializers.
1717 (cpp_set_lang): Don't copy cxx23_identifiers.
1718 * include/cpplib.h (struct cpp_options): Adjust comment about
1719 c11_identifiers. Remove cxx23_identifiers field.
1720 * lex.c (warn_about_normalization): Use cplusplus instead of
1722 * charset.c (ucn_valid_in_identifier): Likewise.
1724 2021-12-01 Jakub Jelinek <jakub@redhat.com>
1726 PR preprocessor/103415
1727 * macro.c (stringify_arg): Remove va_opt argument and va_opt handling.
1728 (paste_tokens): On successful paste or in PREV_WHITE and
1729 PREV_FALLTHROUGH flags from the *plhs token to the new token.
1730 (replace_args): Adjust stringify_arg callers. For #__VA_OPT__,
1731 perform token pasting in a separate loop before stringify_arg call.
1733 2021-11-30 Richard Biener <rguenther@suse.de>
1735 * charset.c (convert_escape): Remove unreachable break.
1737 2021-11-30 Jakub Jelinek <jakub@redhat.com>
1740 * init.c (lang_defaults): Enable cxx23_identifiers for
1741 -std={gnu,c}++{11,14,17,20} too.
1743 2021-11-29 Eric Gallager <egallager@gcc.gnu.org>
1746 * Makefile.in: Use ETAGS variable in TAGS target.
1747 * configure: Regenerate.
1748 * configure.ac: Allow ETAGS variable to be overridden.
1750 2021-11-23 Christophe Lyon <christophe.lyon@foss.st.com>
1752 PR preprocessor/103355
1753 * system.h (ATTR_LIKELY): Fix definition.
1755 2021-11-23 Marek Polacek <polacek@redhat.com>
1756 Jonathan Wakely <jwakely@redhat.com>
1758 PR preprocessor/103355
1759 * lex.c: Use ATTR_LIKELY instead of [[likely]].
1760 * system.h (ATTR_LIKELY): Define.
1762 2021-11-22 Jakub Jelinek <jakub@redhat.com>
1763 Tobias Burnus <tobias@codesourcery.com>
1765 PR preprocessor/103165
1766 * internal.h (struct lexer_state): Add ignore__Pragma field.
1767 * macro.c (builtin_macro): Don't interpret _Pragma if
1768 pfile->state.ignore__Pragma.
1769 (expand_arg): Temporarily set pfile->state.ignore__Pragma to 1.
1771 2021-11-17 David Malcolm <dmalcolm@redhat.com>
1773 PR preprocessor/103026
1774 * lex.c (struct bidi::context): New.
1775 (bidi::vec): Convert to a vec of context rather than unsigned
1777 (bidi::ctx_at): Rename to...
1778 (bidi::pop_kind_at): ...this and reimplement for above change.
1779 (bidi::current_ctx): Update for change to vec.
1780 (bidi::current_ctx_ucn_p): Likewise.
1781 (bidi::current_ctx_loc): New.
1782 (bidi::on_char): Update for usage of context struct. Add "loc"
1783 param and pass it when pushing contexts.
1784 (get_location_for_byte_range_in_cur_line): New.
1785 (get_bidi_utf8): Rename to...
1786 (get_bidi_utf8_1): ...this, reintroducing...
1787 (get_bidi_utf8): ...as a wrapper, setting *OUT when the result is
1789 (get_bidi_ucn): Rename to...
1790 (get_bidi_ucn_1): ...this, reintroducing...
1791 (get_bidi_ucn): ...as a wrapper, setting *OUT when the result is
1793 (class unpaired_bidi_rich_location): New.
1794 (maybe_warn_bidi_on_close): Use unpaired_bidi_rich_location when
1795 reporting on unpaired bidi chars. Split into singular vs plural
1797 (maybe_warn_bidi_on_char): Pass in a location_t rather than a
1798 const uchar * and use it when emitting warnings, and when calling
1800 (_cpp_skip_block_comment): Capture location when kind is not NONE
1801 and pass it to maybe_warn_bidi_on_char.
1802 (skip_line_comment): Likewise.
1803 (forms_identifier_p): Likewise.
1804 (lex_raw_string): Likewise.
1805 (lex_string): Likewise.
1807 2021-11-17 David Malcolm <dmalcolm@redhat.com>
1809 PR preprocessor/103026
1810 * lex.c (maybe_warn_bidi_on_close): Use a rich_location
1811 and call set_escape_on_output (true) on it.
1812 (maybe_warn_bidi_on_char): Likewise.
1814 2021-11-17 Jakub Jelinek <jakub@redhat.com>
1816 PR preprocessor/103130
1817 * lex.c (cpp_directive_only_process): Treat even \*/ as end of block
1820 2021-11-17 Marek Polacek <polacek@redhat.com>
1822 PR preprocessor/103026
1823 * include/cpplib.h (enum cpp_bidirectional_level): New.
1824 (struct cpp_options): Add cpp_warn_bidirectional.
1825 (enum cpp_warning_reason): Add CPP_W_BIDIRECTIONAL.
1826 * internal.h (struct cpp_reader): Add warn_bidi_p member
1828 * init.c (cpp_create_reader): Set cpp_warn_bidirectional.
1829 * lex.c (bidi): New namespace.
1830 (get_bidi_utf8): New function.
1831 (get_bidi_ucn): Likewise.
1832 (maybe_warn_bidi_on_close): Likewise.
1833 (maybe_warn_bidi_on_char): Likewise.
1834 (_cpp_skip_block_comment): Implement warning about bidirectional
1836 (skip_line_comment): Likewise.
1837 (forms_identifier_p): Likewise.
1838 (lex_identifier): Likewise.
1839 (lex_string): Likewise.
1840 (lex_raw_string): Likewise.
1842 2021-11-01 David Malcolm <dmalcolm@redhat.com>
1844 * charset.c (convert_escape): Use encoding_rich_location when
1845 complaining about nonprintable unknown escape sequences.
1846 (cpp_display_width_computation::::cpp_display_width_computation):
1847 Pass in policy rather than tabstop.
1848 (cpp_display_width_computation::process_next_codepoint): Add "out"
1849 param and populate *out if non-NULL.
1850 (cpp_display_width_computation::advance_display_cols): Pass NULL
1851 to process_next_codepoint.
1852 (cpp_byte_column_to_display_column): Pass in policy rather than
1853 tabstop. Pass NULL to process_next_codepoint.
1854 (cpp_display_column_to_byte_column): Pass in policy rather than
1856 * errors.c (cpp_diagnostic_get_current_location): New function,
1857 splitting out the logic from...
1858 (cpp_diagnostic): ...here.
1859 (cpp_warning_at): New function.
1860 (cpp_pedwarning_at): New function.
1861 * include/cpplib.h (cpp_warning_at): New decl for rich_location.
1862 (cpp_pedwarning_at): Likewise.
1863 (struct cpp_decoded_char): New.
1864 (struct cpp_char_column_policy): New.
1865 (cpp_display_width_computation::cpp_display_width_computation):
1866 Replace "tabstop" param with "policy".
1867 (cpp_display_width_computation::process_next_codepoint): Add "out"
1869 (cpp_display_width_computation::m_tabstop): Replace with...
1870 (cpp_display_width_computation::m_policy): ...this.
1871 (cpp_byte_column_to_display_column): Replace "tabstop" param with
1873 (cpp_display_width): Likewise.
1874 (cpp_display_column_to_byte_column): Likewise.
1875 * include/line-map.h (rich_location::escape_on_output_p): New.
1876 (rich_location::set_escape_on_output): New.
1877 (rich_location::m_escape_on_output): New.
1878 * internal.h (cpp_diagnostic_get_current_location): New decl.
1879 (class encoding_rich_location): New.
1880 * lex.c (skip_whitespace): Use encoding_rich_location when
1881 complaining about null characters.
1882 (warn_about_normalization): Generate a source range when
1883 complaining about improperly normalized tokens, rather than just a
1884 point, and use encoding_rich_location so that the source code
1885 is escaped on printing.
1886 * line-map.c (rich_location::rich_location): Initialize
1889 2021-10-29 Tobias Burnus <tobias@codesourcery.com>
1892 * directives.c (destringize_and_run): Add PRAGMA_OP to the
1893 CPP_PRAGMA token's flags to mark is as coming from _Pragma.
1894 * include/cpplib.h (PRAGMA_OP): #define, to be used with token flags.
1895 * macro.c (collect_args): Only handle CPP_PRAGMA special if PRAGMA_OP
1898 2021-10-22 Eric Gallager <egallager@gcc.gnu.org>
1901 * Makefile.in: Add dummy install-dvi target.
1903 2021-10-18 Martin Liska <mliska@suse.cz>
1905 * charset.c (convert_oct): Remove unused but set variable.
1907 2021-10-06 Jakub Jelinek <jakub@redhat.com>
1909 * init.c (lang_defaults): Implement P2334R1, enable elifdef for
1910 -std=c++23 and -std=gnu++23.
1911 * directives.c (_cpp_handle_directive): Support elifdef/elifndef if
1912 either CPP_OPTION (pfile, elifdef) or !CPP_OPTION (pfile, std).
1913 (do_elif): For older non-std modes if pedantic pedwarn about
1914 #elifdef/#elifndef directives that change behavior.
1916 2021-09-01 Jakub Jelinek <jakub@redhat.com>
1919 * include/cpplib.h (struct cpp_options): Add cxx23_identifiers.
1920 * charset.c (CXX23, NXX23): New enumerators.
1921 (CID, NFC, NKC, CTX): Renumber.
1922 (ucn_valid_in_identifier): Implement P1949R7 - use CXX23 and
1923 NXX23 flags for cxx23_identifiers. For start character in
1924 non-pedantic mode, allow characters that are allowed as start
1925 characters in any of the supported language modes, rather than
1926 disallowing characters allowed only as non-start characters in
1927 current mode but for characters from other language modes allowing
1928 them even if they are never allowed at start.
1929 * init.c (struct lang_flags): Add cxx23_identifiers.
1930 (lang_defaults): Add cxx23_identifiers column.
1931 (cpp_set_lang): Initialize CPP_OPTION (pfile, cxx23_identifiers).
1932 * lex.c (warn_about_normalization): If cxx23_identifiers, use
1933 cpp_pedwarning_with_line instead of cpp_warning_with_line for
1934 "is not in NFC" diagnostics.
1935 * makeucnid.c: Adjust usage comment.
1936 (CXX23, NXX23): New enumerators.
1937 (all_languages): Add CXX23.
1938 (not_NFC, not_NFKC, maybe_not_NFC): Renumber.
1939 (read_derivedcore): New function.
1940 (write_table): Print also CXX23 and NXX23 columns.
1941 (main): Require 5 arguments instead of 4, call read_derivedcore.
1942 * ucnid.h: Regenerated using Unicode 13.0.0 files.
1944 2021-09-01 Jason Merrill <jason@redhat.com>
1946 * macro.c (replace_args): When __VA_OPT__ is on the LHS of ##,
1947 remove trailing avoid_paste tokens.
1949 2021-09-01 Jakub Jelinek <jakub@redhat.com>
1951 PR preprocessor/101488
1952 * macro.c (replace_args): Fix up handling of CPP_PADDING tokens at the
1953 start or end of __VA_OPT__ arguments when preceeded or followed by ##.
1955 2021-08-31 Martin Sebor <msebor@redhat.com>
1957 * include/line-map.h (class rich_location): Disable copying and
1960 2021-08-25 Lewis Hyatt <lhyatt@gmail.com>
1963 * charset.c (init_iconv_desc): Adapt to permit PFILE argument to
1965 (_cpp_convert_input): Likewise. Also move UTF-8 BOM logic to...
1966 (cpp_check_utf8_bom): ...here. New function.
1967 (cpp_input_conversion_is_trivial): New function.
1968 * files.c (read_file_guts): Allow PFILE argument to be NULL. Add
1969 INPUT_CHARSET argument as an alternate source of this information.
1970 (read_file): Pass the new argument to read_file_guts.
1971 (cpp_get_converted_source): New function.
1972 * include/cpplib.h (struct cpp_converted_source): Declare.
1973 (cpp_get_converted_source): Declare.
1974 (cpp_input_conversion_is_trivial): Declare.
1975 (cpp_check_utf8_bom): Declare.
1977 2021-08-17 Jakub Jelinek <jakub@redhat.com>
1979 * macro.c (vaopt_state): Add m_stringify member.
1980 (vaopt_state::vaopt_state): Initialize it.
1981 (vaopt_state::update): Overwrite it.
1982 (vaopt_state::stringify): New method.
1983 (stringify_arg): Replace arg argument with first, count arguments
1984 and add va_opt argument. Use first instead of arg->first and
1985 count instead of arg->count, for va_opt add paste_tokens handling.
1986 (paste_tokens): Fix up len calculation. Don't spell rhs twice,
1987 instead use %.*s to supply lhs and rhs spelling lengths. Don't call
1988 _cpp_backup_tokens here.
1989 (paste_all_tokens): Call it here instead.
1990 (replace_args): Adjust stringify_arg caller. For vaopt_state::END
1991 if stringify is true handle __VA_OPT__ stringification.
1992 (create_iso_definition): Handle # __VA_OPT__ similarly to # macro_arg.
1994 2021-08-12 Jakub Jelinek <jakub@redhat.com>
1996 PR preprocessor/101638
1997 * macro.c (cpp_sys_macro_p): Return true instead of
1998 crashing on builtin macros.
2000 2021-08-05 Jakub Jelinek <jakub@redhat.com>
2003 * ucnid.h: Regenerated using Unicode 13.0.0 files.
2005 2021-08-05 Jakub Jelinek <jakub@redhat.com>
2008 * makeucnid.c (write_table): Fix computation of last_combine.
2009 * ucnid.h: Regenerated using Unicode 6.3.0 files.
2011 2021-06-16 Jason Merrill <jason@redhat.com>
2014 PR preprocessor/96391
2015 * line-map.c (linemap_compare_locations): Only use comparison with
2016 LINE_MAP_MAX_LOCATION_WITH_COLS to avoid abort.
2018 2021-05-20 Christophe Lyon <christophe.lyon@linaro.org>
2019 Torbjörn Svensson <torbjorn.svensson@st.com>
2022 * include/cpplib.h (cpp_builtin_type): Add BT_FILE_NAME entry.
2023 * init.c (builtin_array): Likewise.
2024 * macro.c (_cpp_builtin_macro_text): Add support for BT_FILE_NAME.
2026 2021-05-20 Jakub Jelinek <jakub@redhat.com>
2028 PR preprocessor/100646
2029 * lex.c (cpp_directive_only_process): Treat end of file as termination
2030 for !is_block comments.
2032 2021-05-12 Jakub Jelinek <jakub@redhat.com>
2034 PR preprocessor/100392
2035 * lex.c (cpp_directive_only_process): If buffer doesn't end with '\n',
2036 add buffer->rlimit[0] character to the printed range and
2037 CPP_INCREMENT_LINE and increment line_count.
2039 2021-05-11 Joseph Myers <joseph@codesourcery.com>
2041 * include/cpplib.h (struct cpp_options): Add elifdef.
2042 * init.c (struct lang_flags): Add elifdef.
2043 (lang_defaults): Update to include elifdef initializers.
2044 (cpp_set_lang): Set elifdef for pfile based on language.
2045 * directives.c (STDC2X, ELIFDEF): New macros.
2046 (EXTENSION): Increase value to 3.
2047 (DIRECTIVE_TABLE): Add #elifdef and #elifndef.
2048 (_cpp_handle_directive): Do not treat ELIFDEF directives as
2049 directives for language versions without the #elifdef feature.
2050 (do_elif): Handle #elifdef and #elifndef.
2051 (do_elifdef, do_elifndef): New functions.
2053 2021-05-11 Joseph Myers <joseph@codesourcery.com>
2055 * lex.c (cpp_avoid_paste): Do not allow pasting CPP_NUMBER with
2058 2021-05-11 Joseph Myers <joseph@codesourcery.com>
2060 * init.c (lang_defaults): Enable digit separators for GNUC2X and
2063 2021-05-07 Jakub Jelinek <jakub@redhat.com>
2066 * lex.c (cpp_avoid_paste): Handle token1 CPP_PRAGMA like CPP_NAME.
2068 2021-05-06 Joseph Myers <joseph@codesourcery.com>
2071 PR preprocessor/97604
2072 * lex.c (lex_number): Reject adjacent digit separators here. Do
2073 not allow digit separators before '.' or an exponent with sign.
2074 * expr.c (cpp_classify_number): Do not check for adjacent digit
2077 2021-05-03 H.J. Lu <hjl.tools@gmail.com>
2080 * configure: Regenerated.
2082 2021-04-29 Joseph Myers <joseph@codesourcery.com>
2084 PR preprocessor/82359
2085 * directives.c (strtolinenum): Handle digit separators.
2087 2021-04-19 Richard Biener <rguenther@suse.de>
2089 PR preprocessor/100142
2090 * line-map.c (linemap_position_for_loc_and_offset): Revert
2091 unintended s/column_offset/column/ change.
2093 2021-04-13 Nathan Sidwell <nathan@acm.org>
2095 PR preprocessor/99446
2096 * line-map.c (line-map.c): Do not advance to linemaps for
2099 2021-04-13 Eric Botcazou <ebotcazou@adacore.com>
2101 * include/line-map.h (IS_MACRO_LOC): Delete.
2102 * line-map.c (linemap_location_from_macro_expansion_p): Test
2103 LINEMAPS_MACRO_LOWEST_LOCATION of the linemap.
2105 2021-03-02 David Malcolm <dmalcolm@redhat.com>
2108 * line-map.c (rich_location::maybe_add_fixit): Reject fix-it hints
2111 2021-02-24 Nathan Sidwell <nathan@acm.org>
2114 * include/line-map.h
2117 2021-02-24 Nathan Sidwell <nathan@acm.org>
2120 * init.c (read_original_filename): Expunge all evidence of the
2123 2021-02-18 Nathan Sidwell <nathan@acm.org>
2126 * include/cpplib.h (cpp_find_header_unit): Rename to ...
2127 (cpp_probe_header_unit): ... this.
2128 * internal.h (_cp_find_header_unit): Declare.
2129 * files.c (cpp_find_header_unit): Break apart to ..
2130 (test_header_unit): ... this, and ...
2131 (_cpp_find_header_unit): ... and, or and ...
2132 (cpp_probe_header_unit): ... this.
2133 * macro.c (cpp_get_token_1): Call _cpp_find_header_unit.
2135 2021-02-16 Nathan Sidwell <nathan@acm.org>
2137 * files.c (_cpp_stack_file): Make buffers end in unread \n.
2139 2021-02-10 David Malcolm <dmalcolm@redhat.com>
2141 PR preprocessor/96391
2142 * line-map.c (linemap_compare_locations): Require that
2143 the location be <= LINE_MAP_MAX_LOCATION_WITH_COLS when
2144 treating locations as coming from the same macro expansion.
2146 2021-02-04 Jakub Jelinek <jakub@redhat.com>
2148 * expr.c (cpp_classify_number): Use make_signed_t<size_t> instead of
2149 make_signed<size_t>::type in the diagnostics.
2151 2021-02-03 Jakub Jelinek <jakub@redhat.com>
2153 PR preprocessor/98882
2154 * lex.c (cpp_directive_only_process): Don't assert that rlimit[-1]
2155 is a newline, instead assert that rlimit[0] is either newline or
2156 carriage return. When seeing '\\' followed by '\r', check limit
2157 before accessing pos[1].
2159 2021-02-03 Ed Smith-Rowland <3dw4rd@verizon.net>
2161 * expr.c (interpret_int_suffix): Detect 'z' integer suffix.
2162 (cpp_classify_number): Compat warning for use of 'z' suffix.
2163 * include/cpplib.h (struct cpp_options): New flag.
2164 (enum cpp_warning_reason): New flag.
2165 (CPP_N_USERDEF): Comment C++0x -> C++11.
2166 (CPP_N_SIZE_T): New flag for cpp_classify_number.
2167 * init.c (cpp_set_lang): Initialize new flag.
2169 2021-01-27 liuhongt <hongtao.liu@intel.com>
2172 * lex.c (search_line_sse2): Replace builtins with == operator.
2174 2021-01-26 Paul Fee <paul.f.fee@gmail.com>
2176 * include/cpplib.h (c_lang): Add CXX23 and GNUCXX23.
2177 * init.c (lang_defaults): Add rows for CXX23 and GNUCXX23.
2178 (cpp_init_builtins): Set __cplusplus to 202100L for C++23.
2180 2021-01-15 Nathan Sidwell <nathan@acm.org>
2182 PR preprocessor/95253
2183 * mkdeps.c (munge): Do not escape ':'.
2185 2020-12-14 Nathan Sidwell <nathan@acm.org>
2187 * include/cpplib.h (struct cpp_macro): Add imported_p field.
2188 (struct cpp_hashnode): Tweak deferred field documentation.
2189 * macro.c (_cpp_new_macro): Clear new field.
2190 (cpp_get_deferred_macro, get_deferred_or_lazy_macro): Assert
2193 2020-12-10 Jason Merrill <jason@redhat.com>
2195 * init.c (cpp_init_builtins): Update __cplusplus for C++20.
2197 2020-12-01 JeanHeyd Meneide <phdofthehouse@gmail.com>
2199 * charset.c (init_iconv_desc): Initialize "to" and "from" fields.
2200 * directives.c (cpp_get_narrow_charset_name): New function.
2201 (cpp_get_wide_charset_name): Likewise.
2202 * include/cpplib.h (cpp_get_narrow_charset_name): Prototype.
2203 (cpp_get_wide_charset_name): Likewise.
2204 * internal.h (cset_converter): Add "to" and "from" fields.
2206 2020-11-27 Joseph Myers <joseph@codesourcery.com>
2208 PR preprocessor/97602
2209 * directives.c (strtolinenum): Check for overflow before it
2210 occurs. Correct comment.
2212 2020-11-24 Nathan Sidwell <nathan@acm.org>
2214 * include/cpplib.h (struct cpp_hashnode): Add deferred field.
2215 (cpp_set_deferred_macro): Define.
2216 (cpp_get_deferred_macro): Declare.
2217 (cpp_macro_definition): Reformat, add overload.
2218 (cpp_macro_definition_location): Deal with deferred macro.
2219 (cpp_alloc_token_string, cpp_compare_macro): Declare.
2220 * internal.h (_cpp_notify_macro_use): Return bool
2221 (_cpp_maybe_notify_macro_use): Likewise.
2222 * directives.c (do_undef): Check macro is not undef before
2224 (do_ifdef, do_ifndef): Deal with deferred macro.
2225 * expr.c (parse_defined): Likewise.
2226 * lex.c (cpp_allocate_token_string): Break out of ...
2227 (create_literal): ... here. Call it.
2228 (cpp_maybe_module_directive): Deal with deferred macro.
2229 * macro.c (cpp_get_token_1): Deal with deferred macro.
2230 (warn_of_redefinition): Deal with deferred macro.
2231 (compare_macros): Rename to ...
2232 (cpp_compare_macro): ... here. Make extern.
2233 (cpp_get_deferred_macro): New.
2234 (_cpp_notify_macro_use): Deal with deferred macro, return bool
2235 indicating definedness.
2236 (cpp_macro_definition): Deal with deferred macro.
2238 2020-11-19 Nathan Sidwell <nathan@acm.org>
2240 * include/cpplib.h (enum cpp_main_search): New.
2241 (struct cpp_options): Add main_search field.
2242 (cpp_main_loc): Declare.
2243 (cpp_retrofit_as_include): Declare.
2244 * internal.h (struct cpp_reader): Add main_loc field.
2245 (_cpp_in_main_source_file): Not main if main is a header.
2246 * init.c (cpp_read_main_file): Use main_search option to locate
2247 main file. Set main_loc
2248 * files.c (cpp_retrofit_as_include): New.
2250 2020-11-19 Nathan Sidwell <nathan@acm.org>
2252 * internal.h (cpp_in_system_header): Rename to ...
2253 (_cpp_in_system_header): ... here.
2254 (cpp_in_primary_file): Rename to ...
2255 (_cpp_in_main_source_file): ... here. Compare main_file equality
2256 and check main_search value.
2257 * lex.c (maybe_va_opt_error, _cpp_lex_direct): Adjust for rename.
2258 * macro.c (_cpp_builtin_macro_text): Likewise.
2259 (replace_args): Likewise.
2260 * directives.c (do_include_next): Likewise.
2261 (do_pragma_once, do_pragma_system_header): Likewise.
2262 * files.c (struct _cpp_file): Delete main_file field.
2263 (pch_open): Check pfile->main_file equality.
2264 (make_cpp_file): Drop cpp_reader parm, don't set main_file.
2265 (_cpp_find_file): Adjust.
2266 (_cpp_stack_file): Check pfile->main_file equality.
2267 (struct report_missing_guard_data): Add cpp_reader field.
2268 (report_missing_guard): Check pfile->main_file equality.
2269 (_cpp_report_missing_guards): Adjust.
2271 2020-11-18 Nathan Sidwell <nathan@acm.org>
2273 * include/cpplib.h (struct cpp_options): Add module_directives
2275 (NODE_MODULE): New node flag.
2276 (struct cpp_hashnode): Make rid-code a bitfield, increase bits in
2277 flags and swap with type field.
2278 * init.c (post_options): Create module-directive identifier nodes.
2279 * internal.h (struct lexer_state): Add directive_file_token &
2280 n_modules fields. Add module node enumerator.
2281 * lex.c (cpp_maybe_module_directive): New.
2282 (_cpp_lex_token): Call it.
2283 (cpp_output_token): Add '"' around CPP_HEADER_NAME token.
2284 (do_peek_ident, do_peek_module): New.
2285 (cpp_directives_only): Detect module-directive lines.
2286 * macro.c (cpp_get_token_1): Deal with directive_file_token
2289 2020-11-18 Nathan Sidwell <nathan@acm.org>
2291 * files.c (struct _cpp_file): Add header_unit field.
2292 (_cpp_stack_file): Add header unit support.
2293 (cpp_find_header_unit): New.
2294 * include/cpplib.h (cpp_find_header_unit): Declare.
2296 2020-11-18 Nathan Sidwell <nathan@acm.org>
2298 * include/cpplib.h (struct cpp_options): Add modules to
2300 * include/mkdeps.h (deps_add_module_target): Declare.
2301 (deps_add_module_dep): Declare.
2302 * mkdeps.c (class mkdeps): Add modules, module_name, cmi_name,
2303 is_header_unit fields. Adjust cdtors.
2304 (deps_add_module_target, deps_add_module_dep): New.
2305 (make_write): Write module dependencies, if enabled.
2307 2020-11-17 Nathan Sidwell <nathan@acm.org>
2309 * include/cpplib.h (struct cpp_callbacks): Add
2310 user_deferred_macro & translate_include.
2312 2020-11-17 Nathan Sidwell <nathan@acm.org>
2314 * include/line-map.h (enum lc_reason): Add LC_MODULE.
2315 (MAP_MODULE_P): New.
2316 (line_map_new_raw): Declare.
2317 (linemap_enter_macro): Move declaration from internal.h
2318 (linemap_module_loc, linemap_module_reparent)
2319 (linemap_module_restore): Declare.
2320 (linemap_lookup_macro_indec): Declare.
2321 * internal.h (linemap_enter_macro): Moved to line-map.h.
2322 * line-map.c (linemap_new_raw): New, broken out of ...
2323 (new_linemap): ... here. Call it.
2324 (LAST_SOURCE_LINE_LOCATION): New.
2325 (liemap_module_loc, linemap_module_reparent)
2326 (linemap_module_restore): New.
2327 (linemap_lookup_macro_index): New, broken out of ...
2328 (linemap_macro_map_lookup): ... here. Call it.
2329 (linemap_dump): Add module dump.
2331 2020-11-17 Nathan Sidwell <nathan@acm.org>
2333 PR preprocessor/97858
2334 * mkdeps.c (munge): Drop varadic args, we only ever use one.
2336 2020-11-13 Joseph Myers <joseph@codesourcery.com>
2338 * expr.c (cpp_classify_number): Update diagnostic for binary
2339 constants for C. Also diagnose binary constants for
2341 * init.c (lang_defaults): Enable binary constants for GNUC2X and
2344 2020-11-13 Piotr H. Dabrowski <phd@phd.re>
2347 * include/cpplib.h: Added cpp_define_unused(), cpp_define_formatted_unused()
2348 * directives.c: Likewise.
2350 2020-11-12 Joseph Myers <joseph@codesourcery.com>
2352 * include/cpplib.h (struct cpp_callbacks): Add bool argument to
2354 (enum cpp_builtin_type): Add BT_HAS_STD_ATTRIBUTE.
2355 * init.c (builtin_array): Add __has_c_attribute.
2356 (cpp_init_special_builtins): Handle BT_HAS_STD_ATTRIBUTE.
2357 * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_STD_ATTRIBUTE.
2358 Update call to has_attribute for BT_HAS_ATTRIBUTE.
2359 * traditional.c (fun_like_macro): Handle BT_HAS_STD_ATTRIBUTE.
2361 2020-11-12 Nicholas Guriev <guriev-ns@ya.ru>
2364 * files.c (_cpp_find_file): Use CPP_DL_NOTE not CPP_DL_ERROR in call to
2367 2020-11-07 Lewis Hyatt <lhyatt@gmail.com>
2369 * generated_cpp_wcwidth.h: Regenerated from Unicode 13.0.0 data.
2371 2020-11-06 Nathan Sidwell <nathan@acm.org>
2373 * include/cpplib.h (enum class CPP_time_kind): New.
2374 (cpp_get_date): Declare.
2375 * internal.h (struct cpp_reader): Replace source_date_epoch with
2376 time_stamp and time_stamp_kind.
2377 * init.c (cpp_create_reader): Initialize them.
2378 * macro.c (_cpp_builtin_macro_text): Use cpp_get_date.
2379 (cpp_get_date): Broken out from _cpp_builtin_macro_text and
2382 2020-11-03 Nathan Sidwell <nathan@acm.org>
2384 * lex.c (cpp_peek_token): Do not peek past CPP_PRAGMA.
2385 (_cpp_lex_direct): Handle EOF in pragma when setting need_line,
2386 not when needing a line.
2388 2020-11-03 Nathan Sidwell <nathan@acm.org>
2390 * lex.c (_cpp_clean_line): Fix DOS off-by-one error.
2392 2020-11-03 Nathan Sidwell <nathan@acm.org>
2394 * init.c (cpp_read_main_file): Use cpp_get_deps result.
2396 2020-11-03 Nathan Sidwell <nathan@acm.org>
2398 * include/mkdeps.h: Include cpplib.h
2399 (deps_write): Adjust first parm type.
2400 * mkdeps.c: Include internal.h
2401 (make_write): Adjust first parm type. Check phony option
2403 (deps_write): Adjust first parm type.
2404 * init.c (cpp_read_main_file): Use get_deps.
2405 * directives.c (cpp_get_deps): Check option before initializing.
2407 2020-11-02 Nathan Sidwell <nathan@acm.org>
2409 * internal.h (_cpp_notify_macro_use): Add location parm.
2410 (_cpp_maybe_notify_macro_use): Likewise.
2411 * directives.c (_cpp_do_file_change): Check we've not changed file
2412 when optimizing a rewind.
2413 (do_ifdef): Pass location to _cpp_maybe_notify_macro_use.
2414 (do_ifndef): Likewise. Delete obsolete comment about powerpc.
2415 * expr.c (parse_defined): Pass location to
2416 _cpp_maybe_notify_macro_use.
2417 * macro.c (enter_macro_context): Likewise.
2418 (warn_of_redefinition): Break out helper function. Call it.
2419 (compare_macros): New function broken out of warn_of_redefinition.
2420 (_cpp_new_macro): Zero all fields.
2421 (_cpp_notify_macro_use): Add location parameter.
2423 2020-10-20 Nathan Sidwell <nathan@acm.org>
2425 * lex.c (_cpp_lex_direct): Do not complete EOF processing when
2427 * macro.c (collect_args): Do not unwind fake EOF.
2428 (funlike_invocation_p): Do not unwind fake EOF.
2429 (cpp_context): Replace abort with gcc_assert.
2431 2020-10-19 Nathan Sidwell <nathan@acm.org>
2433 * internal.h (struct cpp_reader): Rename 'eof' field to 'endarg'.
2434 * init.c (cpp_create_reader): Adjust.
2435 * macro.c (collect_args): Use endarg for separator. Always rewind
2438 2020-10-08 Nathan Sidwell <nathan@acm.org>
2440 * internal.h (enum include_type): Rename IT_MAIN_INJECT to
2442 * init.c (cpp_read_main_file): If there is no line marker, adjust
2443 the initial line marker.
2444 (read_original_filename): Return bool, peek the buffer directly
2445 before trying to tokenize.
2446 (read_original_directory): Likewise. Directly prod the string
2448 * files.c (_cpp_stack_file): Adjust for IT_PRE_MAIN change.
2450 2020-09-26 Jakub Jelinek <jakub@redhat.com>
2453 * lex.c (search_line_fast): Only use _ARCH_PWR8 Altivec version
2456 2020-09-17 Patrick Palka <ppalka@redhat.com>
2459 * include/line-map.h (first_map_in_common): Declare.
2460 * line-map.c (first_map_in_common): Remove static.
2462 2020-09-07 Martin Storsjö <martin@martin.st>
2464 * files.c (remap_filename): Make a strchr return value pointer
2467 2020-07-30 H.J. Lu <hjl.tools@gmail.com>
2470 * configure: Regenerated.
2472 2020-07-29 Tiziano MĂĽller <tiziano.mueller@chem.uzh.ch>
2474 * init.c (builtin_array): Add xref comment.
2475 * traditional.c (fun_like_macro): Add HAS_INCLUDE codes.
2477 2020-07-28 Jakub Jelinek <jakub@redhat.com>
2479 PR preprocessor/96323
2480 * lex.c (lex_raw_string): For c == '\n' don't continue after reporting
2481 an prefix delimiter error.
2483 2020-07-28 Nathan Sidwell <nathan@acm.org>
2485 * init.c (cpp_read_main_file): Always use the last map for
2488 2020-07-20 Nathan Sidwell <nathan@acm.org>
2490 * line-map.c (linemap_add): Simplify column overflow calculation.
2491 Add comment about range and column bit init.
2492 (linemap_ordinary_map_lookup): Refactor for RAII
2493 (linemap_macro_map_lookup): Likewise.
2495 2020-07-14 Lewis Hyatt <lhyatt@gmail.com>
2497 PR preprocessor/49973
2499 * include/cpplib.h (struct cpp_options): Removed support for -ftabstop,
2500 which is now handled by diagnostic_context.
2501 (class cpp_display_width_computation): New class.
2502 (cpp_byte_column_to_display_column): Add optional tabstop argument.
2503 (cpp_display_width): Likewise.
2504 (cpp_display_column_to_byte_column): Likewise.
2506 (cpp_display_width_computation::cpp_display_width_computation): New
2508 (cpp_display_width_computation::advance_display_cols): Likewise.
2509 (compute_next_display_width): Removed and implemented this
2510 functionality in a new function...
2511 (cpp_display_width_computation::process_next_codepoint): ...here.
2512 (cpp_byte_column_to_display_column): Added tabstop argument.
2513 Reimplemented in terms of class cpp_display_width_computation.
2514 (cpp_display_column_to_byte_column): Likewise.
2515 * init.c (cpp_create_reader): Remove handling of -ftabstop, which is now
2516 handled by diagnostic_context.
2518 2020-07-07 Nathan Sidwell <nathan@acm.org>
2520 * directives.c (do_linemarker): Optimize rewinding to line zero.
2521 * files.c (_cpp_stack_file): Start on line zero when about to inject
2523 (cpp_push_include, cpp_push_default_include): Use highest_line as
2525 * include/cpplib.h (cpp_read_main_file): Add injecting parm.
2526 * init.c (cpp_read_main_file): Likewise, inform _cpp_stack_file.
2527 * internal.h (enum include_type): Add IT_MAIN_INJECT.
2529 2020-05-29 H.J. Lu <hjl.tools@gmail.com>
2532 * configure: Regenerated.
2534 2020-05-23 David Edelsohn <dje.gcc@gmail.com>
2536 * Makefile.in (AR): Substitute @AR@.
2537 * configure.ac (CHECK_PROG AR): New.
2538 * configure: Regenerate.
2540 2020-05-20 Nathan Sidwell <nathan@acm.org>
2542 * internal.h (typedef _cpp_file): Delete, unnecessary in C++.
2543 (enum _cpp_find_file_kind): New.
2544 (_cpp_find_file): Use it, not 3 bools.
2545 * files.c (_cpp_find_file): Use _cpp_find_file_kind enum, not
2547 (cpp_make_system_header): Break overly long line.
2548 (_cpp_stack_include, _cpp_fake_include)
2549 (_cpp_do_file_change, _cpp_compare_file_date, _cpp_has_header): Adjust.
2550 * init.c (cpp_read_main): Adjust _cpp_find_file call.
2552 2020-05-18 Nathan Sidwell <nathan@acm.org>
2554 * include/cpplib.h (cpp_get_otions, cpp_get_callbacks)
2555 (cpp_get_deps): Mark as PURE.
2556 * include/line-map.h (get_combined_adhoc_loc)
2557 (get_location_from_adhoc_loc, get_pure_location): Reformat decls.
2558 * internal.h (struct lexer_state): Clarify comment.
2559 * system.h: Remove now-unneeded bool hackery.
2560 * files.c (_cpp_find_file): Store LOC not highest_location.
2562 PR preprocessor/95149
2563 * lex.c (struct lit_accum): New.
2564 (bufring_append): Replace by lit_accum::append.
2565 (lex_raw_string): Reimplement, using fragments of the old version.
2566 (lex_string): Adjust lex_raw_string call.
2568 PR preprocessor/95182
2569 * macro.c (collect_args): Preserve EOFif we fell out of the main
2571 (cpp_get_token_1): Reformat a couple of short lines.
2573 2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
2575 * configure: Regenerated.
2577 2020-05-13 Jason Merrill <jason@redhat.com>
2579 * include/cpplib.h (enum c_lang): Change CXX2A to CXX20.
2580 * init.c, lex.c: Adjust.
2582 2020-05-12 Nathan Sidwell <nathan@acm.org>
2584 EOF location is at end of file
2585 PR preprocessor/95013
2586 * lex.c (lex_raw_string): Process line notes before incrementing.
2587 Correct incrementing condition. Adjust for new
2588 _cpp_get_fresh_line EOF behaviour.
2589 (_cpp_get_fresh_line): Do not pop buffer at EOF, increment line
2591 (_cpp_lex_direct): Adjust for new _cpp_get_fresh_line behaviour.
2592 (cpp_directive_only_process): Assert we got a fresh line.
2593 * traditional.c (_cpp_read_logical_line_trad): Adjust for new
2594 _cpp_get_fresh_line behaviour.
2596 2020-05-12 H.J. Lu <hongjiu.lu@intel.com>
2598 * Makefile.in (CET_HOST_FLAGS): New.
2599 (COMPILER): Add $(CET_HOST_FLAGS).
2600 * configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and
2601 AC_SUBST(CET_HOST_FLAGS). Clear CET_HOST_FLAGS if jit isn't
2603 * aclocal.m4: Regenerated.
2604 * configure: Likewise.
2606 2020-05-08 Nathan Sidwell <nathan@acm.org>
2608 Reimplement directives only processing, support raw literals.
2609 * directives-only.c: Delete.
2610 * Makefile.in (libcpp_a_OBJS, libcpp_a_SOURCES): Remove it.
2611 * include/cpplib.h (enum CPP_DO_task): New enum.
2612 (cpp_directive_only_preprocess): Declare.
2613 * internal.h (_cpp_dir_only_callbacks): Delete.
2614 (_cpp_preprocess_dir_only): Delete.
2615 * lex.c (do_peek_backslask, do_peek_next, do_peek_prev): New.
2616 (cpp_directives_only_process): New implementation.
2618 2020-02-14 Jakub Jelinek <jakub@redhat.com>
2620 Partially implement P1042R1: __VA_OPT__ wording clarifications
2621 PR preprocessor/92319
2622 * macro.c (expand_arg): Move declarations before vaopt_state
2624 (class vaopt_state): Move enum update_type definition earlier. Remove
2625 m_allowed member, add m_arg and m_update members.
2626 (vaopt_state::vaopt_state): Change last argument from bool any_args
2627 to macro_arg *arg, initialize m_arg and m_update instead of m_allowed.
2628 (vaopt_state::update): When bumping m_state from 1 to 2 and m_update
2629 is ERROR, determine if __VA_ARGS__ expansion has any non-CPP_PADDING
2630 tokens and set m_update to INCLUDE if it has any, DROP otherwise.
2631 Return m_update instead of m_allowed ? INCLUDE : DROP in m_state >= 2.
2632 (replace_args, create_iso_definition): Adjust last argument to
2635 2020-02-05 Martin Sebor <msebor@redhat.com>
2637 * include/cpplib.h (cpp_builtin_type): Remove trailing comma to
2638 avoid pedantic warnings in C++ 98 mode.
2640 2020-02-04 Jakub Jelinek <jakub@redhat.com>
2642 * macro.c (builtin_has_include): Diagnose __has_include* use outside
2643 of preprocessing directives.
2645 PR preprocessor/93545
2646 * macro.c (cpp_get_token_no_padding): New function.
2647 (builtin_has_include): Use it instead of cpp_get_token. Don't check
2650 2020-02-01 Andrew Burgess <andrew.burgess@embecosm.com>
2652 * configure: Regenerate.
2654 2020-01-28 Nathan Sidwell <nathan@acm.org>
2656 PR preprocessor/93452
2657 * internal.h (struct spec_nodes): Drop n__has_include{,_next}.
2658 * directives.c (lex_macro_node): Don't check __has_include redef.
2659 * expr.c (eval_token): Drop __has_include eval.
2660 (parse_has_include): Move to ...
2661 * macro.c (builtin_has_include): ... here.
2662 (_cpp_builtin_macro_text): Eval __has_include{,_next}.
2663 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_INCLUDE{,_NEXT}.
2664 * init.c (builtin_array): Add them.
2665 (cpp_init_builtins): Drop __has_include{,_next} init here ...
2666 * pch.c (cpp_read_state): ... and here.
2667 * traditional.c (enum ls): Drop has_include states ...
2668 (_cpp_scan_out_logical_line): ... and here.
2670 2020-01-27 Andrew Burgess <andrew.burgess@embecosm.com>
2672 * configure: Regenerate.
2674 2020-01-24 Nathan Sidwell <nathan@acm.org>
2676 * expr.c (parse_has_include): Remove bogus controlling macro code.
2678 2020-01-20 Nathan Sidwell <nathan@acm.org>
2680 PR preprocessor/80005
2681 * include/cpplib.h (BT_HAS_ATTRIBUTE): Fix comment.
2682 * internal.h (struct lexer_state): Delete in__has_include field.
2683 (struct spec_nodes): Rename n__has_include{,_next}__ fields.
2684 (_cpp_defined_macro_p): New.
2685 (_cpp_find_file): Add has_include parm.
2686 * directives.c (lex_macro_node): Combine defined,
2687 __has_inline{,_next} checking.
2688 (do_ifdef, do_ifndef): Use _cpp_defined_macro_p.
2689 (_cpp_init_directives): Refactor.
2690 * expr.c (parse_defined): Use _cpp_defined_macro_p.
2691 (eval_token): Adjust parse_has_include calls.
2692 (parse_has_include): Add OP parameter. Reimplement.
2693 * files.c (_cpp_find_file): Add HAS_INCLUDE parm. Use it to
2694 inhibit error message.
2695 (_cpp_stack_include): Adjust _cpp_find_file call.
2696 (_cpp_fake_include, _cpp_compare_file_date): Likewise.
2697 (open_file_failed): Remove in__has_include check.
2698 (_cpp_has_header): Adjust _cpp_find_file call.
2699 * identifiers.c (_cpp_init_hashtable): Don't init
2700 __has_include{,_next} here ...
2701 * init.c (cpp_init_builtins): ... init them here. Define as
2703 (cpp_read_main_file): Adjust _cpp_find_file call.
2704 * pch.c (cpp_read_state): Adjust __has_include{,_next} access.
2705 * traditional.c (_cpp_scan_out_locgical_line): Likewise.
2707 PR preprocessor/93306
2708 * expr.c (parse_has_include): Refactor. Check skip_eval before
2711 2020-01-10 David Malcolm <dmalcolm@redhat.com>
2713 * include/line-map.h (class diagnostic_path): New forward decl.
2714 (rich_location::get_path): New accessor.
2715 (rich_location::set_path): New function.
2716 (rich_location::m_path): New field.
2717 * line-map.c (rich_location::rich_location): Initialize m_path.
2719 2020-01-01 Jakub Jelinek <jakub@redhat.com>
2721 Update copyright years.
2723 2019-12-18 David Malcolm <dmalcolm@redhat.com>
2725 PR preprocessor/92982
2727 (cpp_string_location_reader::cpp_string_location_reader): Delete
2728 initialization of m_line_table.
2729 * include/cpplib.h (cpp_string_location_reader::m_line_table):
2730 Delete unused member.
2732 2019-12-14 Jakub Jelinek <jakub@redhat.com>
2734 PR preprocessor/92919
2735 * charset.c (wide_str_to_charconst): If str contains just the
2736 NUL terminator, punt quietly.
2738 2019-12-09 David Malcolm <dmalcolm@redhat.com>
2740 * include/line-map.h (label_text::label_text): Make private.
2741 (label_text::borrow): New.
2742 (label_text::take): New.
2743 (label_text::take_or_copy): New.
2745 2019-12-09 Lewis Hyatt <lhyatt@gmail.com>
2747 PR preprocessor/49973
2748 * generated_cpp_wcwidth.h: New file generated by
2749 ../contrib/unicode/gen_wcwidth.py, supports new cpp_wcwidth function.
2750 * charset.c (compute_next_display_width): New function to help
2751 implement display columns.
2752 (cpp_byte_column_to_display_column): Likewise.
2753 (cpp_display_column_to_byte_column): Likewise.
2754 (cpp_wcwidth): Likewise.
2755 * include/cpplib.h (cpp_byte_column_to_display_column): Declare.
2756 (cpp_display_column_to_byte_column): Declare.
2757 (cpp_wcwidth): Declare.
2758 (cpp_display_width): New function.
2760 2019-11-14 Joseph Myers <joseph@codesourcery.com>
2762 * charset.c (narrow_str_to_charconst): Make CPP_UTF8CHAR constants
2764 * init.c (lang_defaults): Set utf8_char_literals for GNUC2X and
2767 2019-11-07 Jakub Jelinek <jakub@redhat.com>
2769 PR c++/91370 - Implement P1041R4 and P1139R2 - Stronger Unicode reqs
2770 * charset.c (narrow_str_to_charconst): Add TYPE argument. For
2771 CPP_UTF8CHAR diagnose whenever number of chars is > 1, using
2772 CPP_DL_ERROR instead of CPP_DL_WARNING.
2773 (wide_str_to_charconst): For CPP_CHAR16 or CPP_CHAR32, use
2774 CPP_DL_ERROR instead of CPP_DL_WARNING when multiple char16_t
2775 or char32_t chars are needed.
2776 (cpp_interpret_charconst): Adjust narrow_str_to_charconst caller.
2778 2019-11-05 Tim van Deurzen <tim@kompiler.org>
2780 * cpplib.h: Add spaceship operator for C++.
2781 * lex.c: Implement conditional lexing of spaceship operator for C++20.
2783 2019-10-31 Jakub Jelinek <jakub@redhat.com>
2785 PR preprocessor/92296
2786 * internal.h (struct def_pragma_macro): Add is_builtin bitfield.
2787 (_cpp_restore_special_builtin): Declare.
2788 * init.c (_cpp_restore_special_builtin): New function.
2789 * directives.c (do_pragma_push_macro): For NT_BUILTIN_MACRO
2790 set is_builtin and don't try to grab definition.
2791 (cpp_pop_definition): Use _cpp_restore_special_builtin to restore
2794 2019-10-15 Nathan Sidwell <nathan@acm.org>
2796 * include/line-map.h (struct maps_info_ordinary): Make cache
2798 (struct maps_info_macro): Likewise.
2799 (LINEMAPS_CACHE): Remove non-ref accessor. Constify ref accessor.
2800 (LINEMAPS_ORDINARY_CACHE, LINEMAPS_MACRO_CACHE): Likewise.
2801 (LINEMAPS_ORDINARY_MAP_AT, LINEMAPS_MACRO_MAP_AT): Use
2802 LINEMAPS_USED and LINEMAPS_MAP_AT.
2803 (linemap_lookup): Constify line_map arg.
2804 linemap.c (linemap_ordinary_map_lookup, linemap_macro_map_lookup):
2805 Constify line_map arg.
2807 2019-10-11 Joseph Myers <joseph@codesourcery.com>
2809 * include/cpplib.h (struct cpp_options): Add dfp_constants and
2810 cpp_warn_c11_c2x_compat.
2811 (enum cpp_warning_reason): Add CPP_W_C11_C2X_COMPAT.
2812 * init.c (struct lang_flags): Add dfp_constants.
2813 (lang_defaults): Set dfp_constants to 1 for GNUC2X and STDC2X and
2814 0 for other languages.
2815 (cpp_set_lang): Set dfp_constants from language.
2816 (cpp_create_reader): Set cpp_warn_c11_c2x_compat to -1.
2817 * expr.c (interpret_float_suffix): Mention DFP constants as C2X in
2819 (cpp_classify_number): Do not diagnose DFP constants for languages
2820 setting dfp_constants, unless cpp_warn_c11_c2x_compat.
2822 2019-10-04 Nathan Sidwell <nathan@acm.org>
2824 PR preprocessor/91991
2825 * line-map.c (linemap_line_start): Clear max_column_hint if we run
2828 2019-10-02 Richard Biener <rguenther@suse.de>
2830 * internal.h (enum include_type): Remove trailing comma.
2832 2019-10-02 Joseph Myers <joseph@codesourcery.com>
2834 * include/cpplib.h (struct cpp_options): Add member scope.
2835 * init.c (struct lang_flags, lang_defaults): Likewise.
2836 (cpp_set_lang): Set scope member of pfile.
2837 * lex.c (_cpp_lex_direct): Test CPP_OPTION (pfile, scope) not
2838 CPP_OPTION (pfile, cplusplus) for creating CPP_SCOPE tokens.
2840 2019-09-26 Eric Botcazou <ebotcazou@adacore.com>
2842 * charset.c (UCS_LIMIT): New macro.
2843 (ucn_valid_in_identifier): Use it instead of a hardcoded constant.
2844 (_cpp_valid_ucn): Issue a pedantic warning for UCNs larger than
2845 UCS_LIMIT outside of identifiers in C and in C++2a or later.
2847 2019-09-19 Lewis Hyatt <lhyatt@gmail.com>
2850 * charset.c (_cpp_valid_utf8): New function to help lex UTF-8 tokens.
2851 * internal.h (_cpp_valid_utf8): Declare.
2852 * lex.c (forms_identifier_p): Use it to recognize UTF-8 identifiers.
2853 (_cpp_lex_direct): Handle UTF-8 in identifiers and CPP_OTHER tokens.
2854 Do all work in "default" case to avoid slowing down typical code paths.
2855 Also handle $ and UCN in the default case for consistency.
2857 2019-08-30 Nathan Sidwell <nathan@acm.org>
2859 New # semantics for popping to "" name.
2861 * directives.c (do_linemarker): Popping to "" name means get the
2862 name from the include stack..
2864 2019-09-05 Nathan Sidwell <nathan@acm.org>
2866 PR preprocessor/91639
2867 * directives.c (do_include_common): Tell lexer we're a #include.
2868 * files.c (_cpp_stack_file): Lexer will have always incremented.
2869 * internal.h (struct cpp_context): Extend in_directive's
2871 * lex.c (_cpp_lex_direct): Increment line for final \n when lexing
2872 for an ISO #include.
2873 * line-map.c (linemap_line_start): Remember if we overflowed.
2875 2019-09-03 Ulrich Weigand <uweigand@de.ibm.com>
2877 * directives.c: Remove references to spu from comments.
2880 2019-08-29 Nathan Sidwell <nathan@acm.org>
2882 * internal.h (enum include_type): Add IT_MAIN, IT_DIRECTIVE_HWM,
2884 (_cpp_stack_file): Take include_type, not a bool.
2885 * files.c (_cpp_find_file): Refactor to not hide an if inside a
2887 (should_stack_file): Break apart to ...
2888 (is_known_idempotent_file, has_unique_contents): ... these.
2889 (_cpp_stack_file): Replace IMPORT boolean with include_type enum.
2890 Refactor to use new predicates. Do linemap compensation here ...
2891 (_cpp_stack_include): ... not here.
2892 * init.c (cpp_read_main_file): Pass IT_MAIN to _cpp_stack_file.
2894 2019-08-28 Nathan Sidwell <nathan@acm.org>
2896 * directives-only.c (_cpp_preprocess_dir_only): Use false, not
2897 zero for _cpp_handle_directive call.
2898 * directives.c (_cpp_handle_directive): Indented is bool.
2899 * files.c (struct _cpp_file): Make bools 1 bit bitfields.
2900 * internal.h (enum include_type): Reformat and comment.
2901 (struct cpp_buffer): Make flags 1 bit bitfields.
2902 (_cpp_handle_directive): Indented is bool.
2904 2019-07-09 Martin Sebor <msebor@redhat.com>
2906 * include/line-map.h: Change class-key from class to struct and vice
2907 versa to match convention and avoid -Wclass-is-pod and -Wstruct-no-pod.
2910 2019-07-03 Martin Liska <mliska@suse.cz>
2912 * line-map.c (linemap_get_expansion_filename): Remove
2914 * mkdeps.c (make_write): Likewise.
2916 2019-07-02 qing zhao <qing.zhao@oracle.com>
2918 PR preprocessor/90581
2919 * directives.c (do_include_common): Replace CPP_STACK_MAX with
2920 CPP_OPTION (pfile, max_include_depth).
2921 * include/cpplib.h (struct cpp_options): Add new field
2923 * init.c (cpp_create_reader): Initiate new field max_include_depth.
2924 * internal.h: Delete CPP_STACK_MAX.
2926 2019-06-26 Nathan Sidwell <nathan@acm.org>
2928 PR preprocessor/90927
2929 * mkdeps.c (mkdeps::vec::operator[]): Add non-const variant.
2930 (deps_add_target): Deal with out of order unquoted targets.
2932 2019-05-19 Andrew Pinski <apinski@marvell.com>
2935 * lex.c (cpp_token_val_index <case SPELL_OPERATOR>): If tok->flags
2936 has NAMED_OP set, then return CPP_TOKEN_FLD_NODE.
2938 2019-05-14 Martin Liska <mliska@suse.cz>
2940 PR preprocessor/90382
2941 * line-map.c (first_map_in_common_1): Handle ADHOC
2944 2019-05-14 Martin Liska <mliska@suse.cz>
2946 PR preprocessor/90382
2947 * include/line-map.h (get_data_from_adhoc_loc): Add const to
2949 (get_location_from_adhoc_loc): Likewise.
2950 * line-map.c(get_data_from_adhoc_loc): Add const to
2952 (get_location_from_adhoc_loc): Likewise.
2953 (get_combined_adhoc_loc): Use get_location_from_adhoc_loc
2954 (or get_data_from_adhoc_loc).
2955 (get_range_from_adhoc_loc): Likewise.
2956 (get_pure_location): Likewise.
2957 (linemap_position_for_loc_and_offset): Likewise.
2958 (linemap_lookup): Likewise.
2959 (linemap_ordinary_map_lookup): Likewise.
2960 (linemap_macro_map_lookup): Likewise.
2961 (linemap_get_expansion_line): Likewise.
2962 (linemap_get_expansion_filename): Likewise.
2963 (linemap_location_in_system_header_p): Likewise.
2964 (linemap_location_from_macro_expansion_p): Likewise.
2965 (linemap_macro_loc_to_exp_point): Likewise.
2966 (linemap_resolve_location): Likewise.
2967 (linemap_unwind_toward_expansion): Likewise.
2968 (linemap_unwind_to_first_non_reserved_loc): Likewise.
2969 (linemap_expand_location): Likewise.
2970 (linemap_dump_location): Likewise.
2972 2019-05-07 Nathan Sidwell <nathan@acm.org>
2974 * files.c (_cpp_stack_file): Empty filenames aren't dependencies.
2975 * mkdeps.c (deps_add_dep): Assert not empty.
2977 * include/mkdeps.h (deps_write): Add PHONY arg.
2978 (deps_phony_targets): Delete.
2979 * init.c (cpp_finish): Just call deps_write.
2980 * mkdeps.c (struct mkdeps): Add local vector class. Reimplement
2982 (munge): Munge to static buffer.
2983 (apply_vpath): Adjust vector handling.
2984 (deps_init, deps_free): Use new, delete.
2985 (deps_add_target): Do not munge here. Record quoting low water mark.
2986 (deps_add_dep): Do not munge here.
2987 (deps_add_vpath): Adjust vector handling.
2988 (make_write_name): New. Munge on demand here.
2989 (make_write_vec): New.
2990 (deps_phony_targets): Delete.
2992 (deps_write): Forward to deps_Write.
2993 (deps_save, deps_restore): Adjust vector handling.
2995 2019-05-06 Nathan Sidwell <nathan@acm.org>
2997 * include/mkdeps.h: Rename struct deps to struct mkdeps.
2998 * mkdeps.c: Likewise.
2999 * include/cpplib.h (cpp_get_deps): Rename return type..
3000 * directives.c (cpp_get_deps): Likewise.
3001 * internal.h (struct cpp_reader): Rename deps field type.
3003 2019-04-03 Jonathan Wakely <jwakely@redhat.com>
3005 * files.c (search_path_exhausted): Fix typo in comment.
3007 2019-02-26 Martin Liska <mliska@suse.cz>
3009 * symtab.c (ht_dump_statistics): Make
3010 horizontal alignment for statistics.
3012 2019-02-20 David Malcolm <dmalcolm@redhat.com>
3015 * include/line-map.h (linenum_arith_t): New typedef.
3018 2019-02-18 Martin Liska <mliska@suse.cz>
3021 * line-map.c (linemap_line_start): Use 1UL in order
3024 2019-02-11 Martin Liska <mliska@suse.cz>
3027 * line-map.c (linemap_line_start): Don't reuse the existing line
3028 map if the line offset is sufficiently large to cause overflow
3029 when computing location_t values.
3031 2019-01-26 Jakub Jelinek <jakub@redhat.com>
3033 PR preprocessor/88974
3034 * directives.c (SEEN_EOL): Move macro to ...
3035 * internal.h (SEEN_EOL): ... here.
3036 * expr.c (parse_has_include): Don't cpp_get_token if SEEN_EOL ().
3038 2019-01-01 Jakub Jelinek <jakub@redhat.com>
3040 Update copyright years.
3042 2018-11-27 Mike Gulick <mgulick@mathworks.com>
3044 PR preprocessor/83173
3045 * location-example.txt: Update example -fdump-internal-locations
3048 2018-11-27 Mike Gulick <mgulick@mathworks.com>
3050 PR preprocessor/83173
3051 * files.c (_cpp_stack_include): Check if
3052 line_table->highest_location is past current line before
3055 2018-11-13 David Malcolm <dmalcolm@redhat.com>
3057 * charset.c: Replace "source_location" with "location_t".
3058 * directives-only.c: Likewise.
3059 * directives.c: Likewise.
3060 * errors.c: Likewise.
3062 * files.c: Likewise.
3063 * include/cpplib.h: Likewise. Rename MAX_SOURCE_LOCATION to
3065 * include/line-map.h: Likewise.
3067 * internal.h: Likewise.
3069 * line-map.c: Likewise.
3070 * location-example.txt: Likewise.
3071 * macro.c: Likewise.
3073 * traditional.c: Likewise.
3075 2018-11-07 Hafiz Abid Qadeer <abidh@codesourcery.com>
3077 * configure: Regenerated.
3079 2018-11-05 Martin Liska <mliska@suse.cz>
3081 * symtab.c (ht_dump_statistics): Replace %zu with %lu format.
3083 2018-11-05 Martin Liska <mliska@suse.cz>
3085 * symtab.c (ht_dump_statistics): Fix format and
3086 pass missing argument.
3088 2018-11-05 Martin Liska <mliska@suse.cz>
3090 * symtab.c (ht_dump_statistics): Make dump conditional
3091 based on alloc_subobject.
3093 2018-10-31 Joseph Myers <joseph@codesourcery.com>
3096 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
3097 * aclocal.m4, config.in, configure: Regenerate.
3099 2018-10-31 Nathan Sidwell <nathan@acm.org>
3101 * internal.h (struct cpp_reader): Rename forced_token_location_p
3102 to forced_token_location and drop its pointerness.
3103 * include/cpplib.h (cpp_force_token_locations): Take location, not
3105 * init.c (cpp_create_reader): Adjust.
3106 * lex.c (cpp_read_main_file):
3108 * directives.c (do_include_common): Commonize cleanup path.
3109 (_cpp_pop_buffer): Fix leak.
3111 * include/line-map.h (IS_ORDINARY_LOC, IS_MACRO_LOC): New
3113 (IS_ADHOC_LOC): Move earlier.
3114 (MAP_ORDINARY_P): Use IS_ORDINARY_LOC.
3115 * line-map.c (linemap_location_from_macro_expansion_p): Use
3118 * include/cpplib.h (cpp_macro_definition_location): Make inline.
3119 * macro.c (warn_of_redefinition): Fix comments, examine macro
3121 (cpp_macro_definition_location): Don't define here.
3123 * include/cpplib.h (HT_NODE): Don't cast NODE.
3124 (NODE_LEN, NODE_NAME): Use HT_NODE.
3126 * directives.c (DIRECTIVE_TABLE): Drop historical frequency
3128 * files.c (_cpp_stack_file): Fix indentation.
3130 2018-10-17 Joseph Myers <joseph@codesourcery.com>
3132 * include/cpplib.h (enum c_lang): Add CLK_GNUC2X and CLK_STDC2X.
3133 * init.c (lang_defaults): Add GNUC2X and STDC2X entries.
3134 (cpp_init_builtins): Define __STDC_VERSION__ to 202000L for C2X.
3136 2018-10-11 David Malcolm <dmalcolm@redhat.com>
3138 * macro.c (_cpp_arguments_ok): If the argument count is wrong, add
3139 a note showing the definition of the macro.
3141 2018-10-11 Nathan Sidwell <nathan@acm.org>
3143 * include/line-map.h (LINEMAPS_MACRO_LOWEST_LOCATION): Fix
3145 * line-map.c (linemap_enter_macro): Use RAII. Clear all of the
3148 2018-10-09 David Malcolm <dmalcolm@redhat.com>
3150 * charset.c (noop_error_cb): Rename to...
3151 (noop_diagnostic_cb): ...this, converting params to enums.
3152 (cpp_interpret_string_ranges): Update for renaming and enums.
3153 * directives.c (check_eol_1): Convert reason to enum.
3154 (do_diagnostic): Convert code and reason to enum.
3155 (do_error): Use CPP_W_NONE rather than 0.
3156 (do_pragma_dependency): Likewise.
3157 * errors.c (cpp_diagnostic_at): Convert level and reason to enums.
3158 Update for renaming.
3159 (cpp_diagnostic): Convert level and reason to enums.
3160 (cpp_error): Convert level to enum.
3161 (cpp_warning): Convert reason to enums.
3162 (cpp_pedwarning): Likewise.
3163 (cpp_warning_syshdr): Likewise.
3164 (cpp_diagnostic_with_line): Convert level and reason to enums.
3165 Update for renaming.
3166 (cpp_error_with_line): Convert level to enum.
3167 (cpp_warning_with_line): Convert reason to enums.
3168 (cpp_pedwarning_with_line): Likewise.
3169 (cpp_warning_with_line_syshdr): Likewise.
3170 (cpp_error_at): Convert level to enum.
3171 (cpp_errno): Likewise.
3172 (cpp_errno_filename): Likewise.
3173 * include/cpplib.h (enum cpp_diagnostic_level): Name this enum,
3174 and move to before struct cpp_callbacks.
3175 (enum cpp_warning_reason): Likewise.
3176 (cpp_callbacks::diagnostic): Convert params from int to enums.
3177 (cpp_error): Convert int param to enum cpp_diagnostic_level.
3178 (cpp_warning): Convert int param to enum cpp_warning_reason.
3179 (cpp_pedwarning): Likewise.
3180 (cpp_warning_syshdr): Likewise.
3181 (cpp_errno): Convert int param to enum cpp_diagnostic_level.
3182 (cpp_errno_filename): Likewise.
3183 (cpp_error_with_line): Likewise.
3184 (cpp_warning_with_line): Convert int param to enum
3186 (cpp_pedwarning_with_line): Likewise.
3187 (cpp_warning_with_line_syshdr): Likewise.
3188 (cpp_error_at): Convert int param to enum cpp_diagnostic_level.
3189 * macro.c (create_iso_definition): Convert int to enum.
3190 (_cpp_create_definition): Likewise.
3192 2018-09-17 David Malcolm <dmalcolm@redhat.com>
3194 * include/line-map.h (range_label::get_text): Add param
3197 2018-08-30 Nathan Sidwell <nathan@acm.org>
3199 * include/line-map.h (enum lc_reason): Comment each member
3201 (struct line_maps): Fix reallocator comment.
3203 2018-08-27 David Malcolm <dmalcolm@redhat.com>
3206 * include/line-map.h (enum range_display_kind): New enum.
3207 (struct location_range): Replace field "m_show_caret_p" with
3208 "m_range_display_kind", converting from bool to the new enum.
3209 (class rich_location): Add example of line insertion fix-it hint.
3210 (rich_location::add_range): Convert param "show_caret_p" from bool
3211 to enum range_display_kind and rename to "range_display_kind",
3212 giving it a default of SHOW_RANGE_WITHOUT_CARET.
3213 (rich_location::set_range): Likewise, albeit without a default.
3214 * line-map.c (rich_location::rich_location): Update for conversion
3215 of show_caret_p to tri-state enum.
3216 (rich_location::add_range): Likewise.
3217 (rich_location::set_range): Likewise.
3219 2018-08-24 H.J. Lu <hongjiu.lu@intel.com>
3222 * line-map.c (pure_location_p): Return true if linemap_lookup
3224 (linemap_add): Set start_location to 0 if we run out of line map
3227 2018-08-20 Nathan Sidwell <nathan@acm.org>
3229 * include/cpplib.h: Fixup some whitespace.
3230 (cpp_hashnode): Reduce type to 2 bit & flags to 8.
3232 * include/cpplib.h (NODE_BUILTIN, NODE_MACRO_ARG): Delete.
3234 (enum node_type): Replace NT_MACRO with NT_USER_MACRO,
3235 NT_BUILTIN_MACRO, NT_MACRO_ARG. Delete NT_ASSERTION.
3236 (NTV_MACRO, NTV_ANSWER, NTV_BUILTIN, NTV_ARGUMENT, NTV_NONE):
3238 (CPP_HASHNODE_VALUE_IDX): Delete.
3239 (union _cpp_hashnode_value): GTY tag from enum node_type directly.
3240 (struct cpp_hashnode): Adjust GTY desc for value field.
3241 (cpp_user_macro_p, cpp_builtin_macro_p, cpp_macro_p): Adjust.
3242 * directives.c (undefine_macros): Clear value.anwers, adjust flag
3244 (_cpp_test_assertion): No need to check NT_ASSERTION.
3245 (do_assert, do_unassert): Likewise.
3246 * init.c (cpp_init_special_builtins): Set type not flags.
3247 * macro.c (struct macro_arg_saved_data): Add type field.
3248 (cpp_get_token_1): Check type not NT_VOID.
3249 (_cpp_free_definition): Adjust flag clearing. Nullify
3251 (_cpp_save_parameter, _cpp_unsave_parameters): Save and restore
3253 (lex_expansion_token): Check type not flags.
3254 (_cpp_create_definition): Set type to NT_USER_MACRO.
3255 (_cpp_notify_macro_use): Adjust type checking.
3256 * pch.c (write_macdef, count_defs, write_defs, cpp_valid_state)
3257 (save_macros): Adjust node type/flag handling.
3258 * traditional.c (_cpp_scan_out_logical_line): Check type not flags.
3260 * directives.c (do_undef): Use cpp_macro_p & cpp_builtin_macro_p.
3261 * include/cpplib.h (enum cpp_macro_kind): Remove trailing comma.
3262 (cpp_fun_like_macro_p): Make inline, define.
3263 * macro.c (cpp_define_lazily): Use UCHAR_MAX.
3264 (cpp_fun_like_macro_p): Delete.
3266 * Makefile.in (TAGS_SOURCES): Remove cpp-id-data.h.
3267 * include/cpp-id-data.h: Delete.
3268 * internal.h: Include cpplib.h not cpp-id-data.h.
3270 * include/cpp-id-data.h (struct answer): Delete.
3271 * include/cpplib.h (struct answer): Don't forward-declare.
3272 (enum cpp_macro_kind): Add cmk_assert.
3273 (struct cpp_macro): Union parms and next assert chain.
3274 (union _cpp_hashnode_value): 'answer' field is cpp_macro.
3275 * directives.c (parse_answer): Convert to use cpp_macro. Return
3277 (parse_assertion, find_answer, _cpp_test_assertion, cpp_do_assert)
3278 (cpp_do_unassert): Convert to use cpp_macro.
3279 * macro.c (warn_of_redefinition, _cpp_new_macro)
3280 (check_trad_stringification, cpp_macro_definition): Adjust macro
3282 * traditional.c (_cpp_replacement_text_len)
3283 (_cpp_copy_replacement_text, _cpp_create_trad_definition): Likewise.
3285 2018-08-17 Nathan Sidwell <nathan@acm.org>
3287 * include/cpplib.h (struct cpp_callbacks): Replace
3288 user_builtin_macro with user_lazy_macro.
3289 (struct cpp_macro): add lazy field.
3290 (enum cpp_builtin_type): Remove BT_FIRST_USER, BT_LAST_USER.
3291 (cpp_define_lazily): Declare.
3292 * macro.c (enter_macro_context) Use _cpp_maybe_notify_macro_use.
3293 (warn_of_redefinition): Use cpp_builtin_macro_p, directly call
3294 user_lazy_macro hook.
3295 (_cpp_new_macro): Clear lazy field.
3296 (cpp_define_lazily): Define.
3297 (_cpp_notify_macro_use): Adjust lazy definition code.
3298 (cpp_macro_definition): No need to do lazy definition here.
3299 * pch.c (write_macdef, save_macros): Likewise.
3301 * include/cpplib.h (enum cpp_macro_kind): New.
3302 (struct cpp_macro): Make body trailing array. Add kind field,
3303 delete traditional flag.
3304 * internal.h (_cpp_new_macro): Declare.
3305 (_cpp_reserve_room): New inline.
3306 (_cpp_commit_buf): Declare.
3307 (_cpp_create_trad_definition): Return new macro.
3308 * lex.c (_cpp_commit_buff): New.
3309 * macro.c (macro_real_token_count): Count backwards.
3310 (replace_args): Pointer equality not orderedness.
3311 (_cpp_save_parameter): Use _cpp_reserve_room.
3312 (alloc_expansion_token): Delete.
3313 (lex_expansion_token): Return macro pointer. Use _cpp_reserve_room.
3314 (create_iso_definition): Allocate macro itself. Adjust for
3315 different allocation ordering.
3316 (_cpp_new_macro): New.
3317 (_cpp_create_definition): Adjust for API changes.
3318 * traditional.c (push_replacement_text): Don't set traditional
3320 (save_replacement_text): Likewise.
3321 (_cpp_create_trad_definition): Allocate macro itself, Adjust for
3322 different allocation ordering.
3324 * cpp-id-data.h (uchar, UC): Move to internal.h
3325 (struct cpp_macro): Move to cpplib.h.
3326 * internal.h (uchar, UC): From cpp-id-data.h.
3327 * include/cpplib.h (struct cpp_macro): From cpp-id-data.h.
3329 2018-08-16 Nathan Sidwell <nathan@acm.org>
3331 * internal.h (_cpp_save_parameter): Take parmno, not macro.
3332 (_cpp_unsave_parameters): Declare.
3333 * macro.c (_cpp_save_parameter): Take parm number, not macro.
3334 Return true on success.
3335 (_cpp_unsave_parameters): New.
3336 (parse_params): Take parm_no and variadic pointers, not macro.
3337 Reimplement parsing logic.
3338 (create_iso_definition): Adjust parse_params changes. Call
3339 _cpp_unsave_parameters here.
3340 (_cpp_create_definition): Don't unsave params here.
3341 * traditional.c (scan_parameters): Take n_param pointer, adjust.
3342 (_cpp_create_trad_definition): Ajust scan_parameters change. Call
3343 _cpp_unsave_parameters.
3345 * include/cpplib.h (cpp_user_macro_p, cpp_builtin_macro_p)
3346 (cpp_macro_p): New inlines.
3347 * directives.c (do_pragma_poison): Use cpp_macro_p.
3348 (do_ifdef, do_ifndef): Likewise. Use _cpp_maybe_notify_macro_use.
3349 (cpp_pop_definition): Use cpp_macro_p. Move _cpp_free_definition
3350 earlier. Don't zap node directly.
3351 * expr.c (parse_defined): Use _cpp_maybe_notify_macro_use &
3353 * files.c (should_stack_file): Use cpp_macro_p.
3354 * identifiers.c (cpp_defined): Likewise.
3355 * internal.h (_cpp_mark_macro): Use cpp_user_macro_p.
3356 (_cpp_notify_macro_use): Declare.
3357 (_cpp_maybe_notify_macro_use): New inline.
3358 * lex.c (is_macro): Use cpp_macro_p.
3359 * macro.c (_cpp_warn_if_unused_macro): Use cpp_user_macro_p.
3360 (enter_macro_context): Likewise.
3361 (_cpp_create_definition): Use cpp_builtin_macro_p,
3362 cpp_user_macro_p. Move _cpp_free_definition earlier.
3363 (_cpp_notify_macro_use): New, broken out of multiple call sites.
3364 * traditional.c (fun_like_macro_p): Use cpp_builtin_macro_p.
3365 (maybe_start_funlike, _cpp_scan_out_logical_line)
3366 (push_replacement_text): Likewise.
3368 2018-08-15 David Malcolm <dmalcolm@redhat.com>
3370 * include/line-map.h (struct location_range): Add "m_label" field.
3371 (class rich_location): Add description of labels to leading
3373 (rich_location::rich_location): Add "label" param, defaulting to
3375 (rich_location::add_range): Likewise.
3376 (struct label_text): New struct.
3377 (class range_label): New abstract base class.
3378 * line-map.c (rich_location::rich_location): Add "label" param;
3380 (rich_location::add_range): Likewise.
3382 2018-08-08 Nathan Sidwell <nathan@acm.org>
3384 Make linemap::included_from a location
3386 * include/line-map.h (struct line_map_ordinary): Replace
3387 included_from map index with included_at source_location.
3388 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Delete.
3389 (LAST_SOURCE_LINE_LOCATION): Delete.
3390 (LAST_SOURCE_LINE, LAST_SOURCE_COLUMN): Delete.
3391 (linemap_included_from): New.
3392 (linemap_included_from_linemap): Declare.
3393 (MAIN_FILE_P): Adjust.
3394 * line-map.c (linemap_included_from_linemap): New.
3395 (lonemap_check_files_exited): Use linemap_included_at.
3396 (linemap_add): Adjust inclusion setting.
3397 (linemap_dump, linemap_dump_location): Adjust.
3398 * directives.c (do_linemarker): Use linemap_included_at.
3400 2018-08-07 Nathan Sidwell <nathan@acm.org>
3402 * line-map.c: (linemap_init): Set default allocator here.
3403 (new_linemap): Rather than here. Refactor allocation logic.
3405 2018-07-20 David Malcolm <dmalcolm@redhat.com>
3407 * include/line-map.h (rich_location::set_range): Remove redundant
3408 line_maps * parameter.
3409 * line-map.c (rich_location::set_range): Likewise.
3411 2018-07-18 Bernd Edlinger <bernd.edlinger@hotmail.de>
3414 * macro.c (enter_macro_context): Change the location info for builtin
3415 macros and _Pragma from location of the closing parenthesis to location
3416 of the macro expansion point.
3418 2018-07-17 Jason Franklin <j_fra@fastmail.us>
3419 Jakub Jelinek <jakub@redhat.com>
3421 * lex.c (_cpp_lex_direct): Use CPP_DL_NOTE instead of CPP_DL_PEDWARN,
3422 CPP_DL_WARNING or CPP_DL_ERROR for note that diagnostics for C++ style
3423 comments is reported only once per file and guard those calls on the
3424 preceding cpp_error returning true.
3426 2018-07-03 Nathan Sidwell <nathan@acm.org>
3428 Reorg line_map data structures for better packing.
3429 * include/line-map.h (enum lc_reason): Add LC_HWM.
3430 (LINE_MAP_MAX_LOCATION): Define here.
3431 (struct line_map): Move reason field to line_map_ordinary. Adjust
3433 (struct line_map_ordinary): Reorder fields for less padding.
3434 (struct line_map_macro): Likewise.
3435 (MAP_ORDINARY_P): New.
3436 (linemap_check_ordinary, linemap_check_macro): Adjust.
3437 * line-map.c (LINE_MAP_MAX_SOURCE_LOCATION): Delete.
3438 (new_linemap): Take start_location, not reason. Adjust.
3439 (linemap_add, linemap_enter_macro): Adjust.
3440 (linemap_line_start): Likewise.
3441 (linemap_macro_expansion_map_p): Use MAP_ORDINARY_P.
3442 (linemap_macro_loc_to_spelling_point): Likewise.
3443 (linemap_macro_loc_to_def_point): Likewise.
3444 (linemap_dump): Likewise.
3446 2018-05-23 Jason Merrill <jason@redhat.com>
3448 * system.h: #include <new> earlier.
3450 2018-05-17 Jason Merrill <jason@redhat.com>
3452 * line-map.c (linemap_init): Use placement new.
3453 * system.h: #include <new>.
3455 2018-03-14 David Malcolm <dmalcolm@redhat.com>
3457 * include/line-map.h (compare): New function on linenum_type.
3459 2018-02-28 Jonathan Wakely <jwakely@redhat.com>
3461 PR preprocessor/84517
3462 * lex.c (is_macro_not_literal_suffix): New function.
3463 (lex_raw_string, lex_string): Use is_macro_not_literal_suffix to
3464 decide when to issue -Wliteral-suffix warnings.
3466 2018-02-16 Richard Biener <rguenther@suse.de>
3469 * line-map.c (linemap_init): Avoid broken value-init when compiling
3472 2018-02-15 Jason Merrill <jason@redhat.com>
3473 Jakub Jelinek <jakub@redhat.com>
3475 PR preprocessor/83063 - __VA_OPT__ and ##
3476 PR preprocessor/83708
3477 * macro.c (vaopt_state): Reorder m_last_was_paste before m_state.
3478 (vaopt_state::vaopt_state): Adjust.
3479 (vaopt_state::update_flags): Add BEGIN and END.
3480 (vaopt_state::update): Return them.
3481 (copy_paste_flag): Factor out of replace_args.
3482 (last_token_is): New.
3483 (replace_args): Handle BEGIN and END. Avoid padding there.
3484 (tokens_buff_last_token_ptr): Return NULL if no tokens.
3486 2018-01-31 Jakub Jelinek <jakub@redhat.com>
3488 PR preprocessor/69869
3489 * traditional.c (skip_macro_block_comment): Return bool, true if
3490 the macro block comment is unterminated.
3491 (copy_comment): Use return value from skip_macro_block_comment instead
3494 2018-01-27 Jakub Jelinek <jakub@redhat.com>
3496 * include/cpplib.h (enum cpp_builtin_type): Change BT_LAST_USER from
3497 BT_FIRST_USER + 31 to BT_FIRST_USER + 63.
3499 2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
3502 * include/cpplib.h (cpp_callbacks::remap_filename): New callback.
3503 * macro.c (_cpp_builtin_macro_text): Call remap_filename for
3504 __FILE__ and __BASE_FILE__.
3506 2018-01-10 Kelvin Nilsen <kelvin@gcc.gnu.org>
3508 * lex.c (search_line_fast): Remove illegal coercion of an
3509 unaligned pointer value to vector pointer type and replace with
3510 use of __builtin_vec_vsx_ld () built-in function, which operates
3511 on unaligned pointer values.
3513 2018-01-03 Jakub Jelinek <jakub@redhat.com>
3515 Update copyright years.
3517 2017-12-20 Michael Weiser <michael.weiser@gmx.de>
3519 PR preprocessor/83492
3520 * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]:
3521 Fix selection of big-endian shift parameters by using
3524 2017-12-14 Bernd Edlinger <bernd.edlinger@hotmail.de>
3526 * internal.h (maybe_print_line): Change signature.
3528 2017-12-05 Jakub Jelinek <jakub@redhat.com>
3531 * expr.c (interpret_float_suffix): Avoid memcmp.
3532 (interpret_int_suffix): Likewise. Don't check for if.
3534 2017-12-01 Jason Merrill <jason@redhat.com>
3536 PR c++/79228 - extensions hide C++14 complex literal operators
3537 * expr.c (interpret_float_suffix): Ignore 'i' in C++14 and up.
3538 (interpret_int_suffix): Likewise.
3540 2017-11-28 David Malcolm <dmalcolm@redhat.com>
3543 * include/line-map.h (LINE_MAP_MAX_COLUMN_NUMBER): Move here.
3544 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): ...from here.
3545 (rich_location::maybe_add_fixit): Reject fix-it hints in which
3546 the start column exceeds the next column.
3548 2017-11-20 Eric Gallager <egall@gwmail.gwu.edu>
3550 PR preprocessor/81794
3551 * macro.c (check_trad_stringification): Have warning be controlled
3554 2017-11-20 David Malcolm <dmalcolm@redhat.com>
3557 * include/cpplib.h (cpp_macro_definition_location): New decl.
3558 * macro.c (cpp_macro_definition): New function.
3560 2017-11-13 Tom Tromey <tom@tromey.com>
3562 * pch.c (cpp_read_state): Set n__VA_OPT__.
3563 * macro.c (vaopt_state): New class.
3564 (_cpp_arguments_ok): Check va_opt flag.
3565 (replace_args, create_iso_definition): Use vaopt_state.
3566 * lex.c (lex_identifier_intern): Possibly issue errors for
3568 (lex_identifier): Likewise.
3569 (maybe_va_opt_error): New function.
3570 * internal.h (struct lexer_state) <va_args_ok>: Update comment.
3571 (struct spec_nodes) <n__VA_OPT__>: New field.
3572 * init.c (struct lang_flags) <va_opt>: New field.
3573 (lang_defaults): Add entries for C++2A. Update all entries for
3575 (cpp_set_lang): Initialize va_opt.
3576 * include/cpplib.h (struct cpp_options) <va_opt>: New field.
3577 * identifiers.c (_cpp_init_hashtable): Initialize n__VA_OPT__.
3579 2017-11-13 David Malcolm <dmalcolm@redhat.com>
3581 * include/line-map.h (linenum_type): Move this typedef and the
3582 comment describing column numbering to near the top of the file.
3584 2017-11-06 Mukesh Kapoor <mukesh.kapoor@oracle.com>
3587 * lex.c (lex_string): When checking for a valid macro for the
3588 warning related to -Wliteral-suffix (CPP_W_LITERAL_SUFFIX),
3589 check that the macro name does not start with an underscore
3590 before calling is_macro().
3592 2017-11-05 Tom de Vries <tom@codesourcery.com>
3595 * lex.c (BUF_APPEND): Remove semicolon after
3598 2017-10-31 David Malcolm <dmalcolm@redhat.com>
3600 * directives.c (_cpp_handle_directive): Update for renaming of
3601 cpp_error_at_richloc to cpp_error_at.
3602 * errors.c (cpp_diagnostic_at_richloc): Rename to...
3603 (cpp_diagnostic_at): ...this, dropping the location_t-based
3605 (cpp_diagnostic): Update for removal of location_t-based
3607 (cpp_error_at): Likewise.
3608 (cpp_error_at_richloc): Rename to...
3609 (cpp_error_at): ...this, and update for renaming of
3610 cpp_diagnostic_at_richloc.
3611 * include/cpplib.h (cpp_error_at_richloc): Rename to...
3612 (cpp_error_at): ...this.
3614 2017-10-30 Joseph Myers <joseph@codesourcery.com>
3616 * include/cpplib.h (enum c_lang): Add CLK_GNUC17 and CLK_STDC17.
3617 * init.c (lang_defaults): Add GNUC17 and STDC17 data.
3618 (cpp_init_builtins): Handle C17 value of __STDC_VERSION__.
3620 2017-10-10 Nathan Sidwell <nathan@acm.org>
3622 PR preprocessor/82506
3623 * macro.c (cpp_quote_string): Escape raw LFs.
3625 2017-09-15 Andrew Sutton <andrew.n.sutton@gmail.com>
3626 Jakub Jelinek <jakub@redhat.com>
3628 Add support for -std=c++2a.
3629 * include/cpplib.h (c_lang): Add CXX2A and GNUCXX2A.
3630 * init.c (lang_defaults): Add rows for CXX2A and GNUCXX2A.
3631 (cpp_init_builtins): Set __cplusplus to 201709L for C++2a.
3633 2017-09-15 Jakub Jelinek <jakub@redhat.com>
3635 * include/cpplib.h (enum c_lang): Rename CLK_GNUCXX1Z
3636 to CLK_GNUCXX17 and CLK_CXX1Z to CLK_CXX17.
3637 * init.c (lang_defaults, cpp_init_builtins): Likewise.
3638 * expr.c (cpp_classify_number): Use C++17 instead of C++1z
3641 2017-07-07 David Malcolm <dmalcolm@redhat.com>
3644 * line-map.c (linemap_macro_loc_to_def_point): Preserve range
3645 information for macro expansions by delaying resolving ad-hoc
3646 locations until within the loop.
3648 2017-07-06 David Malcolm <dmalcolm@redhat.com>
3651 * include/line-map.h (enum location_aspect): New enum.
3652 (linemap_client_expand_location_to_spelling_point): Add
3653 enum location_aspect param.
3654 * line-map.c (rich_location::get_expanded_location): Update for
3655 new param of linemap_client_expand_location_to_spelling_point.
3656 (rich_location::maybe_add_fixit): Likewise.
3657 (fixit_hint::affects_line_p): Likewise.
3659 2017-06-21 Jakub Jelinek <jakub@redhat.com>
3661 * line-map.c (location_adhoc_data_update): Perform addition in
3662 uintptr_t type rather than char * type. Read *data using
3663 ptrdiff_t type instead of int64_t.
3664 (get_combined_adhoc_loc): Change offset type to ptrdiff_t from
3667 2017-06-20 David Malcolm <dmalcolm@redhat.com>
3669 * include/line-map.h (class rich_location): Document that attempts
3670 to delete or replace a range *affecting* multiple lines will fail.
3671 * line-map.c (rich_location::maybe_add_fixit): Implement this
3674 2017-06-09 David Malcolm <dmalcolm@redhat.com>
3676 * include/line-map.h
3677 (rich_location::fixits_cannot_be_auto_applied): New method.
3678 (rich_location::fixits_can_be_auto_applied_p): New accessor.
3679 (rich_location::m_fixits_cannot_be_auto_applied): New field.
3680 * line-map.c (rich_location::rich_location): Initialize new field.
3682 2017-06-05 David Malcolm <dmalcolm@redhat.com>
3684 * include/cpplib.h (struct cpp_callbacks): Add "comment"
3686 * lex.c (_cpp_lex_direct): Call the comment callback if non-NULL.
3688 2017-05-02 David Malcolm <dmalcolm@redhat.com>
3690 * include/line-map.h (class rich_location): Update description of
3692 (class fixit_hint): Likewise.
3693 (fixit_hint::ends_with_newline_p): New decl.
3694 * line-map.c (rich_location::maybe_add_fixit): Support newlines
3695 in fix-it hints that are insertions of single lines at the start
3696 of a line. Don't consolidate into such fix-it hints.
3697 (fixit_hint::ends_with_newline_p): New method.
3699 2017-05-01 David Malcolm <dmalcolm@redhat.com>
3701 * include/line-map.h (source_range::intersects_line_p): Delete.
3702 (rich_location::add_fixit): Delete.
3703 (rich_location::maybe_add_fixit): New method.
3704 (class fixit_hint): Reimplement in terms of...
3705 (class fixit_replace): ...this.
3706 (class fixit_insert): Delete.
3707 * line-map.c (linemap_position_for_loc_and_offset): Drop overzealous
3708 linemap_assert_fails.
3709 (source_range::intersects_line_p): Rename to...
3710 (fixit_hint::affects_line_p): New function.
3711 (rich_location::add_fixit_insert_before): Reimplement in terms of
3712 maybe_add_fixit, moving validation there.
3713 (rich_location::add_fixit_insert_after): Likewise.
3714 (column_before_p): Delete.
3715 (rich_location::add_fixit_replace): Reimplement in terms of
3716 maybe_add_fixit, moving validation there. Convert closed input range
3718 (rich_location::add_fixit): Delete.
3719 (rich_location::maybe_add_fixit): New function.
3720 (fixit_insert::fixit_insert): Delete.
3721 (fixit_insert::~fixit_insert): Delete.
3722 (fixit_insert::affects_line_p): Delete.
3723 (fixit_insert::maybe_append_replace): Delete.
3724 (fixit_replace::fixit_replace): Rename to...
3725 (fixit_hint::fixit_hint): ...this, rewriting as necessary.
3726 (fixit_replace::~fixit_replace): Delete.
3727 (fixit_replace::affects_line_p): Delete.
3728 (fixit_replace::maybe_append_replace): Rename to...
3729 (fixit_hint::maybe_append): ...this, rewriting as necessary.
3731 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
3733 * include/line-map.h (LINEMAPS_MACRO_MAPS): Fix typo in comment.
3734 * lex.c (search_line_fast): Likewise.
3735 * pch.h (cpp_valid_state): Likewise.
3737 2017-03-21 Andreas Schwab <schwab@suse.de>
3739 * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]:
3740 Convert 64-bit value to boolean before passing to
3743 2017-03-16 Jason Merrill <jason@redhat.com>
3745 * init.c (cpp_init_builtins): Update __cplusplus for C++17.
3747 2017-02-09 Gerald Pfeifer <gerald@pfeifer.com>
3749 * Makefile.in (po/$(PACKAGE).pot): Adjust bug reporting URL.
3751 2017-01-10 David Malcolm <dmalcolm@redhat.com>
3754 * line-map.c (linemap_position_for_column): When calling
3755 linemap_start_line, detect if a new linemap was created with
3756 0 column bits, and bail out early if this is the case.
3757 (linemap_position_for_loc_and_offset): Replace overzealous
3758 linemap_assert_fails with a simple conditional; use correct
3761 2017-01-07 David Malcolm <dmalcolm@redhat.com>
3764 * line-map.c (linemap_line_start): When determining if the highest
3765 column given out so far will fit into a proposed change to the
3766 current map, use the effective number of column bits, rather than
3767 the total number of column + range bits.
3769 2017-01-01 Jakub Jelinek <jakub@redhat.com>
3771 Update copyright years.
3773 2016-12-15 David Malcolm <dmalcolm@redhat.com>
3775 PR preprocessor/78680
3776 PR preprocessor/78811
3777 * lex.c (_cpp_lex_direct): Only determine the end-location of
3778 the token and build a range for non-reserved start locations.
3779 Do not do it for EOF tokens.
3781 2016-12-12 David Malcolm <dmalcolm@redhat.com>
3783 PR preprocessor/78680
3784 * lex.c (_cpp_lex_direct): Ensure line notes are processed before
3785 computing the end-point of the token.
3787 2016-11-23 Paolo Bonzini <bonzini@gnu.org>
3789 * include/cpplib.h (struct cpp_options): Add new member
3790 warn_expansion_to_defined.
3791 (CPP_W_EXPANSION_TO_DEFINED): New enum member.
3792 * expr.c (parse_defined): Warn for all uses of "defined"
3793 in macros, and tie warning to CPP_W_EXPANSION_TO_DEFINED.
3794 Make it a pedwarning instead of a warning.
3795 * system.h (HAVE_DESIGNATED_INITIALIZERS): Do not use
3796 "defined" in macros.
3798 2016-11-17 David Malcolm <dmalcolm@redhat.com>
3800 * charset.c (cpp_interpret_string_1): Skip locations from
3801 loc_reader when advancing 'p' when handling raw strings.
3803 2016-11-16 Jakub Jelinek <jakub@redhat.com>
3806 * configure.ac (ENABLE_ASSERT_CHECKING): Define if gcc configure
3807 would define that macro.
3808 * configure: Regenerated.
3809 * config.in: Regenerated.
3811 2016-11-08 Richard Earnshaw <rearnsha@arm.com>
3813 * lex.c (search_line_fast): New implementation for AArch64.
3815 2016-10-25 David Malcolm <dmalcolm@redhat.com>
3817 * files.c (destroy_cpp_file): Free file->path.
3819 2016-10-25 David Malcolm <dmalcolm@redhat.com>
3821 * include/line-map.h (line_maps::~line_maps): New dtor.
3822 (location_adhoc_data_fini): Delete decl.
3823 * line-map.c (line_maps::~line_maps): New dtor.
3824 (location_adhoc_data_fini): Delete.
3826 2016-10-21 Andris Pavenis <andris.pavenis@iki.fi>
3828 PR preprocessor/71681
3829 * files.c (remap_filename): Fix handling -remap in subdirectories.
3831 2016-10-12 Jakub Jelinek <jakub@redhat.com>
3833 * include/cpplib.h (struct cpp_options): Add
3834 cpp_warn_implicit_fallthrough.
3835 * init.c (cpp_create_reader): Initialize it to 0.
3836 * lex.c (fallthrough_comment_p): Handle different
3837 cpp_warn_implicit_fallthrough levels. Whitespace fixes.
3839 2016-10-08 Jakub Jelinek <jakub@redhat.com>
3841 * lex.c (fallthrough_comment_p): Accept Else, fallthrough.
3843 * lex.c (fallthrough_comment_p): Extend to handle more common FALLTHRU
3846 * lex.c (fallthrough_comment_p): Fix off-by-one size comparison
3848 (_cpp_lex_direct): Allow arbitrary comments in between
3849 fallthrough_comment_p comment and following token.
3851 2016-10-04 Kelvin Nilsen <kelvin@gcc.gnu.org>
3854 * lex.c (search_line_fast): Add a FALLTHROUGH comment to correct
3855 compiler error in the version of this function that is
3856 conditionally compiled when GCC_VERSION >= 4005 and both
3857 __ALTIVEC__ and __BIG_ENDIAN__ symbols are defined.
3859 2016-09-26 Marek Polacek <polacek@redhat.com>
3860 Jakub Jelinek <jakub@redhat.com>
3863 * include/cpplib.h (PREV_FALLTHROUGH): Define.
3864 * internal.h (CPP_FALLTHRU): Define.
3865 * lex.c (fallthrough_comment_p): New function.
3866 (_cpp_lex_direct): Set PREV_FALLTHROUGH on tokens succeeding a falls
3869 2016-09-23 David Malcolm <dmalcolm@redhat.com>
3871 PR preprocessor/77672
3872 * charset.c (cpp_interpret_string_1): Add a source_range for the
3873 NUL-terminator, using the location of the trailing quote of the
3876 2016-09-21 Jason Merrill <jason@redhat.com>
3878 * line-map.c (linemap_location_from_macro_definition_p): New.
3879 * line-map.h: Declare it.
3881 2016-09-15 David Malcolm <dmalcolm@redhat.com>
3883 * include/line-map.h (class rich_location): Note that newlines
3884 aren't supported in fix-it text.
3885 * line-map.c (rich_location::add_fixit_insert_before): Reject
3886 attempts to add fix-its containing newlines.
3887 (rich_location::add_fixit_replace): Likewise.
3889 2016-09-13 David Malcolm <dmalcolm@redhat.com>
3891 * include/line-map.h (class rich_location): Add description of
3892 fix-it hints to leading comment.
3893 (rich_location::add_fixit_insert): Rename both overloaded methods
3895 (rich_location::add_fixit_insert_before): ...this, updating their
3897 (rich_location::add_fixit_insert_after): Two new overloaded
3899 (rich_location::stop_supporting_fixits): New method.
3900 * line-map.c (rich_location::add_fixit_insert): Rename both
3901 overloaded methods to..
3902 (rich_location::add_fixit_insert_before): ...this, updating their
3904 (rich_location::add_fixit_insert_after): Two new methods.
3905 (rich_location::reject_impossible_fixit): Split out
3906 failure-handling into...
3907 (rich_location::stop_supporting_fixits): New method.
3909 2016-09-02 David Malcolm <dmalcolm@redhat.com>
3911 * include/line-map.h (rich_location::seen_impossible_fixit_p): New
3914 2016-08-31 David Malcolm <dmalcolm@redhat.com>
3916 * include/line-map.h (class fixit_remove): Remove stray decl.
3917 (fixit_hint::affects_line_p): Make const.
3918 (fixit_insert::affects_line_p): Likewise.
3919 (fixit_replace::affects_line_p): Likewise.
3920 * line-map.c (fixit_insert::affects_line_p): Likewise.
3921 (fixit_replace::affects_line_p): Likewise.
3923 2016-08-30 David Malcolm <dmalcolm@redhat.com>
3925 * include/line-map.h (class semi_embedded_vec): New class.
3926 (semi_embedded_vec<T, NUM_EMBEDDED>::semi_embedded_vec): New ctor.
3927 (semi_embedded_vec<T, NUM_EMBEDDED>::~semi_embedded_vec): New
3929 (semi_embedded_vec<T, NUM_EMBEDDED>::operator[]): New methods.
3930 (semi_embedded_vec<T, NUM_EMBEDDED>::push): New method.
3931 (semi_embedded_vec<T, NUM_EMBEDDED>::truncate): New method.
3932 (rich_location::get_num_locations): Reimplement in terms of
3934 (rich_location::get_range): Make non-inline.
3935 (rich_location::get_num_fixit_hints): Reimplement in terms of
3937 (rich_location::add_fixit): New function.
3938 (rich_location::MAX_RANGES): Rename to...
3939 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this.
3940 (rich_location::MAX_FIXIT_HINTS): Rename to...
3941 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this, and make
3943 (rich_location::m_num_ranges): Eliminate in favor of...
3944 (rich_location::m_ranges): ...this, converting from a fixed-size
3945 array to a semi_embedded_vec.
3946 (rich_location::m_num_fixit_hints): Eliminate in favor of...
3947 (rich_location::m_fixit_hints): ...this, converting from a
3948 fixed-size array to a semi_embedded_vec.
3949 * line-map.c (rich_location::rich_location): Update for above
3951 (rich_location::~rich_location): Likewise.
3952 (rich_location::get_loc): Likewise.
3953 (rich_location::get_range): New methods.
3954 (rich_location::add_range): Update for above changes.
3955 (rich_location::set_range): Likewise.
3956 (rich_location::add_fixit_insert): Likewise.
3957 (rich_location::add_fixit_replace): Likewise.
3958 (rich_location::get_last_fixit_hint): Likewise.
3959 (rich_location::reject_impossible_fixit): Likewise.
3960 (rich_location::add_fixit): New method.
3962 2016-08-30 David Malcolm <dmalcolm@redhat.com>
3964 * include/line-map.h (rich_location::add_fixit_insert): Add
3965 comments. Add overload omitting the source_location param.
3966 (rich_location::add_fixit_remove): Add comments. Add overloads
3967 omitting the range, and accepting a source_location.
3968 (rich_location::add_fixit_replace): Likewise.
3969 * line-map.c (rich_location::add_fixit_insert): Add comments. Add
3970 overload omitting the source_location param.
3971 (rich_location::add_fixit_remove): Add comments. Add overloads
3972 omitting the range, and accepting a source_location.
3973 (rich_location::add_fixit_replace): Likewise.
3975 2016-08-26 David Malcolm <dmalcolm@redhat.com>
3977 * include/line-map.h (get_pure_location): New decl.
3978 * line-map.c (get_pure_location): Move here, from gcc/input.c, adding
3979 a line_maps * param.
3980 (rich_location::add_fixit_insert): Call get_pure_location on "where".
3981 (rich_location::add_fixit_replace): Call get_pure_location on the
3984 2016-08-26 David Malcolm <dmalcolm@redhat.com>
3986 * include/line-map.h (rich_location): Eliminate unimplemented
3987 constructor based on source_range.
3988 (rich_location::get_last_fixit_hint): New method.
3989 (rich_location::reject_impossible_fixit): New method.
3990 (rich_location): Add fields m_line_table and
3991 m_seen_impossible_fixit.
3992 (fixit_hint::maybe_append_replace): New pure virtual function.
3993 (fixit_insert::maybe_append_replace): New function.
3994 (fixit_replace::maybe_append_replace): New function.
3995 * line-map.c (rich_location::rich_location): Initialize
3996 m_line_table and m_seen_impossible_fixit.
3997 (rich_location::add_fixit_insert): Call
3998 reject_impossible_fixit and bail out if true.
3999 (column_before_p): New function.
4000 (rich_location::add_fixit_replace): Call reject_impossible_fixit
4001 and bail out if true. Attempt to consolidate with neighboring
4003 (rich_location::get_last_fixit_hint): New method.
4004 (rich_location::reject_impossible_fixit): New method.
4005 (fixit_insert::maybe_append_replace): New method.
4006 (fixit_replace::maybe_append_replace): New method.
4008 2016-08-23 David Malcolm <dmalcolm@redhat.com>
4010 * include/line-map.h (source_range::from_locations): New method.
4012 2016-08-19 David Malcolm <dmalcolm@redhat.com>
4014 * include/line-map.h (fixit_hint::kind): Delete REPLACE.
4015 (class fixit_remove): Delete.
4016 * line-map.c (rich_location::add_fixit_remove): Reimplement
4017 by calling add_fixit_replace with an empty string.
4018 (fixit_remove::fixit_remove): Delete.
4019 (fixit_remove::affects_line_p): Delete.
4021 2016-08-19 Joseph Myers <joseph@codesourcery.com>
4024 * include/cpplib.h (CPP_N_FLOATN, CPP_N_FLOATNX)
4025 (CPP_N_WIDTH_FLOATN_NX, CPP_FLOATN_SHIFT, CPP_FLOATN_MAX): New
4027 * expr.c (interpret_float_suffix): Handle fN, fNx, FN and FNx
4030 2016-08-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
4032 * expr.c (eval_token): Append "evaluates to 0" to Wundef diagnostic.
4034 2016-08-18 David Malcolm <dmalcolm@redhat.com>
4036 * directives.c (directive_names): New array.
4037 (_cpp_handle_directive): Offer spelling suggestions for misspelled
4039 * errors.c (cpp_diagnostic_at_richloc): New function.
4040 (cpp_error_at_richloc): New function.
4041 * include/cpplib.h (struct cpp_callbacks): Add field
4043 (cpp_error_at_richloc): New decl.
4045 2016-08-18 Marek Polacek <polacek@redhat.com>
4048 * pch.c (write_macdef): Add CPP_FALLTHRU.
4050 2016-08-12 Marek Polacek <polacek@redhat.com>
4053 * lex.c (search_line_fast): Add FALLTHRU.
4054 (_cpp_lex_direct): Likewise.
4055 (cpp_token_val_index): Adjust fall through comment.
4056 * macro.c (parse_params): Add FALLTHRU.
4057 * pch.c (count_defs): Adjust fall through comment.
4058 (write_defs): Likewise.
4060 2016-08-06 David Malcolm <dmalcolm@redhat.com>
4063 * charset.c (_cpp_valid_ucn): Replace overzealous assert with one
4064 that allows for char_range to be non-NULL when loc_reader is NULL.
4066 2016-08-05 David Malcolm <dmalcolm@redhat.com>
4068 * charset.c (cpp_substring_ranges::cpp_substring_ranges): New
4070 (cpp_substring_ranges::~cpp_substring_ranges): New destructor.
4071 (cpp_substring_ranges::add_range): New method.
4072 (cpp_substring_ranges::add_n_ranges): New method.
4073 (_cpp_valid_ucn): Add "char_range" and "loc_reader" params; if
4074 they are non-NULL, read position information from *loc_reader
4075 and update char_range->m_finish accordingly.
4076 (convert_ucn): Add "char_range", "loc_reader", and "ranges"
4077 params. If loc_reader is non-NULL, read location information from
4078 it, and update *ranges accordingly, using char_range.
4079 Conditionalize the conversion into tbuf on tbuf being non-NULL.
4080 (convert_hex): Likewise, conditionalizing the call to
4081 emit_numeric_escape on tbuf.
4082 (convert_oct): Likewise.
4083 (convert_escape): Add params "loc_reader" and "ranges". If
4084 loc_reader is non-NULL, read location information from it, and
4085 update *ranges accordingly. Conditionalize the conversion into
4086 tbuf on tbuf being non-NULL.
4087 (cpp_interpret_string): Rename to...
4088 (cpp_interpret_string_1): ...this, adding params "loc_readers" and
4089 "out". Use "to" to conditionalize the initialization and usage of
4090 "tbuf", such as running the converter. If "loc_readers" is
4091 non-NULL, use the instances within it, reading location
4092 information from them, and passing them to convert_escape; likewise
4093 write to "out" if loc_readers is non-NULL. Check for leading
4094 quote and issue an error if it is not present. Update boundary
4095 check from "== limit" to ">= limit" to protect against erroneous
4096 location values to calls that are not parsing string literals.
4097 (cpp_interpret_string): Reimplement in terms to
4098 cpp_interpret_string_1.
4099 (noop_error_cb): New function.
4100 (cpp_interpret_string_ranges): New function.
4101 (cpp_string_location_reader::cpp_string_location_reader): New
4103 (cpp_string_location_reader::get_next): New method.
4104 * include/cpplib.h (class cpp_string_location_reader): New class.
4105 (class cpp_substring_ranges): New class.
4106 (cpp_interpret_string_ranges): New prototype.
4107 * internal.h (_cpp_valid_ucn): Add params "char_range" and
4109 * lex.c (forms_identifier_p): Pass NULL for new params to
4112 2016-08-01 Andreas Schwab <schwab@suse.de>
4114 * include/cpplib.h: Fix comment typo.
4116 2016-07-27 David Malcolm <dmalcolm@redhat.com>
4118 * include/line-map.h (source_location): Fix line numbers in
4121 2016-07-11 David Malcolm <dmalcolm@redhat.com>
4123 * include/line-map.h (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES):
4124 Move here from line-map.c.
4125 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
4126 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): Move from
4128 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
4130 2016-06-22 David Malcolm <dmalcolm@redhat.com>
4132 * directives.c (do_include_common): Pass on "location" to
4134 * errors.c (cpp_diagnostic): Reimplement in terms of...
4135 (cpp_diagnostic_at): New function.
4136 (cpp_error_at): New function.
4137 (cpp_errno_filename): Add "loc" param and use it by using
4138 cpp_error_at rather than cpp_error.
4139 * files.c (find_file_in_dir): Add "loc" param and pass it to
4141 (_cpp_find_file): Add "loc" param. Use it to convert calls to
4142 cpp_error to cpp_error_at, and pass it to find_file_in_dir and
4144 (read_file_guts): Add "loc" param. Use it to convert calls to
4145 cpp_error to cpp_error_at. Pass it to cpp_errno_filename.
4146 (read_file): Add "loc" param. Pass it to open_file_failed and
4148 (should_stack_file): Add "loc" param. Pass it to read_file.
4149 (_cpp_stack_file): Add "loc" param. Pass it to should_stack_file.
4150 (_cpp_stack_include): Add "loc" param. Pass it to
4151 _cpp_find_file and _cpp_stack_file.
4152 (open_file_failed): Add "loc" param. Pass it to
4154 (_cpp_fake_include): Add 0 as a source_location in call to
4156 (_cpp_compare_file_date): Likewise.
4157 (cpp_push_include): Likewise for call to _cpp_stack_include.
4158 (cpp_push_default_include): Likewise.
4159 (_cpp_save_file_entries): Likewise for call to open_file_failed.
4160 (_cpp_has_header): Likewise for call to _cpp_find_file.
4161 * include/cpplib.h (cpp_errno_filename): Add source_location
4163 (cpp_error_at): New declaration.
4164 * init.c (cpp_read_main_file): Add 0 as a source_location in calls
4165 to _cpp_find_file and _cpp_stack_file.
4166 * internal.h (_cpp_find_file): Add source_location param.
4167 (_cpp_stack_file): Likewise.
4168 (_cpp_stack_include): Likewise.
4170 2016-06-22 David Malcolm <dmalcolm@redhat.com>
4172 * include/line-map.h (fixit_hint::get_start_loc): New pure virtual
4174 (fixit_hint::maybe_get_end_loc): Likewise.
4175 (fixit_insert::get_start_loc): New function, implementing
4176 fixit_hint::get_start_loc.
4177 (fixit_insert::maybe_get_end_loc): New function, implementing
4178 fixit_hint::maybe_get_end_loc.
4179 (fixit_remove::get_start_loc): New function, implementing
4180 fixit_hint::get_start_loc.
4181 (fixit_remove::maybe_get_end_loc): New function, implementing
4182 fixit_hint::maybe_get_end_loc.
4183 (fixit_replace::get_start_loc): New function, implementing
4184 fixit_hint::get_start_loc.
4185 (fixit_replace::maybe_get_end_loc): New function, implementing
4186 fixit_hint::maybe_get_end_loc.
4188 2016-06-21 John David Anglin <danglin@gcc.gnu.org>
4190 * line-map.c (location_adhoc_data_update): Use int64_t instead of
4192 (get_combined_adhoc_loc): Likewise.
4194 2016-06-01 Eduard Sanou <dhole@openmailbox.org>
4196 * include/cpplib.h (cpp_callbacks): Add get_source_date_epoch
4198 * include/cpplib.h (cpp_init_source_date_epoch): Remove prototype.
4199 * init.c (cpp_init_source_date_epoch): Remove function.
4200 * init.c (cpp_create_reader): Initialize pfile->source_date_epoch.
4201 * internal.h (cpp_reader): Extend comment about source_date_epoch.
4202 * macro.c (_cpp_builtin_macro_text): Use get_source_date_epoch
4203 callback only once, read pfile->source_date_epoch on future passes.
4204 Check that get_source_date_epoch callback is not NULL.
4206 2016-05-20 Martin Liska <mliska@suse.cz>
4208 * config.in: Regenerated.
4209 * configure: Likewise.
4210 * configure.ac: Handle --enable-valgrind-annotations.
4211 * lex.c (new_buff): Use ENABLE_VALGRIND_ANNOTATIONS instead
4212 of ENABLE_VALGRIND_CHECKING.
4213 (_cpp_free_buff): Likewise.
4215 2016-04-28 Eduard Sanou <dhole@openmailbox.org>
4216 Matthias Klose <doko@debian.org>
4218 * include/cpplib.h (cpp_init_source_date_epoch): Prototype.
4219 * init.c (cpp_init_source_date_epoch): New function.
4220 * internal.h: Added source_date_epoch variable to struct
4221 cpp_reader to store a reproducible date.
4222 * macro.c (_cpp_builtin_macro_text): Set pfile->date timestamp from
4223 pfile->source_date_epoch instead of localtime if source_date_epoch is
4224 set, to be used for __DATE__ and __TIME__ macros to help reproducible
4227 2016-04-13 Bernd Schmidt <bschmidt@redhat.com>
4229 Patch from Roger Orr <rogero@howzatt.demon.co.uk>
4230 PR preprocessor/69650
4231 * directives.c (do_linemarker): Reread map after calling
4234 2016-04-06 Richard Henderson <rth@redhat.com>
4236 PR preprocessor/61817
4237 PR preprocessor/69391
4238 * internal.h (_cpp_builtin_macro_text): Update decl.
4239 * macro.c (_cpp_builtin_macro_text): Accept location for __LINE__.
4240 (builtin_macro): Accept a second location for __LINE__.
4241 (enter_macro_context): Compute both virtual and real expansion
4242 locations for the macro.
4244 2016-03-25 Bernd Schmidt <bschmidt@redhat.com>
4247 * directives.c (do_linemarker): Test for file left but not entered
4249 * line-map.c (linemap_add): Not here.
4251 2016-03-21 Jakub Jelinek <jakub@redhat.com>
4254 * include/cpplib.h (cpp_fun_like_macro_p): New prototype.
4255 * macro.c (cpp_fun_like_macro_p): New function.
4257 2016-03-15 Richard Henderson <rth@redhat.com>
4259 * line-map.c (new_linemap): Make alloc_size a size_t.
4261 2016-03-14 Jason Merrill <jason@redhat.com>
4263 * expr.c (cpp_classify_number): Hex floats are new in C++1z.
4264 * init.c (lang_defaults): Likewise.
4266 2016-03-09 David Malcolm <dmalcolm@redhat.com>
4270 * line-map.c (linemap_macro_map_loc_unwind_toward_spelling): Move
4272 * include/line-map.h
4273 (linemap_macro_map_loc_unwind_toward_spelling): ...here,
4274 converting from static to extern.
4276 2016-03-09 David Malcolm <dmalcolm@redhat.com>
4280 * include/line-map.h (source_range::debug): Delete.
4281 (struct location_range): Update comment. Replace
4282 expanded_location fields "m_start", "m_finish", and "m_caret" with
4283 a source_location field: "m_loc".
4284 (class rich_location): Reword comment.
4285 (rich_location::get_loc): Reimplement in terms of a new overloaded
4286 variant which takes an unsigned int.
4287 (rich_location::get_loc_addr): Delete.
4288 (rich_location::add_range): Drop params "start" and "finish" in
4289 favor of param "loc". Drop overloaded variants taking a
4290 source_range or location_range *.
4291 (rich_location::lazily_expand_location): Delete in favor of...
4292 (rich_location::get_expanded_location): New decl.
4293 (rich_location::m_loc): Delete field.
4294 (rich_location::m_column_override): New field.
4295 * line-map.c (rich_location::rich_location): Drop name of
4296 line_maps * param. Update initializations for deletion of field
4297 "m_loc" and addition of field "m_column_override". Reimplement
4298 body as a call to add_range. Delete overloaded variant taking a
4300 (rich_location::get_loc): New function.
4301 (rich_location::lazily_expand_location): Delete in favor of...
4302 (rich_location::get_expanded_location): New function.
4303 (rich_location::override_column): Reimplement.
4304 (rich_location::add_range): Drop params "start" and "finish" in
4305 favor of param "loc". Eliminate location expansion in favor of
4306 simply storing loc. Drop overloaded variants taking a
4307 source_range or location_range *.
4308 (rich_location::set_range): Eliminate location expansion.
4310 2016-02-29 David Malcolm <dmalcolm@redhat.com>
4312 PR preprocessor/69985
4313 (linemap_position_for_loc_and_offset): Rename param from "offset"
4314 to "column_offset". Right-shift the column_offset by m_range_bits
4315 of the pertinent ordinary map whenever offsetting a
4316 source_location. For clarity, offset the column by the column
4317 offset, rather than the other way around.
4319 2016-02-23 David Malcolm <dmalcolm@redhat.com>
4321 PR preprocessor/69126
4322 PR preprocessor/69543
4323 * line-map.c (linemap_compare_locations): At the function top,
4324 replace inlined bodies of get_location_from_adhoc_loc with calls
4325 to get_location_from_adhoc_loc. Add a pair of calls to
4326 get_location_from_adhoc_loc at the bottom of the function, to
4327 avoid meaningless comparisons of ad-hoc and non-ad-hoc locations.
4329 2016-02-08 David Malcolm <dmalcolm@redhat.com>
4331 PR preprocessor/69664
4332 * errors.c (cpp_diagnostic_with_line): Only call
4333 rich_location::override_column if the column is non-zero.
4334 * line-map.c (rich_location::override_column): Update columns
4335 within m_ranges[0]. Add assertions to verify that doing so is
4338 2016-02-05 Jakub Jelinek <jakub@redhat.com>
4341 * charset.c (cpp_interpret_charconst): Clear *PCHARS_SEEN
4342 and *UNSIGNEDP if bailing out early due to errors.
4344 2016-01-28 Jakub Jelinek <jakub@redhat.com>
4347 * files.c (_cpp_find_file): Set file->implicit_preinclude even if
4348 included from file->implicit_preinclude header.
4350 * directives.c (destringize_and_run): Adjust prototype.
4352 2016-01-27 David Malcolm <dmalcolm@redhat.com>
4354 PR preprocessor/69126
4355 * directives.c (destringize_and_run): Add expansion_loc param; use
4356 it when handling unexpanded pragmas to fixup the locations of the
4358 (_cpp_do__Pragma): Add expansion_loc param and use it when calling
4359 destringize_and_run.
4360 * internal.h (_cpp_do__Pragma): Add expansion_loc param.
4361 * macro.c (builtin_macro): Pass expansion location of _Pragma to
4364 2016-01-14 David Malcolm <dmalcolm@redhat.com>
4366 PR preprocessor/69177
4367 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): New
4369 (LINE_MAP_MAX_LOCATION_WITH_COLS): Add note about unit tests
4371 (can_be_stored_compactly_p): Reduce threshold from
4372 LINE_MAP_MAX_LOCATION_WITH_COLS to
4373 LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES.
4374 (get_combined_adhoc_loc): Likewise.
4375 (get_range_from_loc): Likewise.
4376 (linemap_line_start): Ensure that a new ordinary map is created
4377 when transitioning from range-packing being enabled to disabled,
4378 at the LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES threshold. Set
4379 range_bits to 0 for new ordinary maps when beyond this limit.
4380 Prevent the "increase the column bits of a freshly created map"
4381 optimization if the range bits has reduced.
4383 2016-01-08 Jakub Jelinek <jakub@redhat.com>
4386 * files.c (cpp_included_before): If IS_ADHOC_LOC (location), lookup
4387 real location from the line_table.
4389 2016-01-04 Jakub Jelinek <jakub@redhat.com>
4391 Update copyright years.
4393 2015-12-22 David Malcolm <dmalcolm@redhat.com>
4395 * line-map.c (get_combined_adhoc_loc): Remove condition
4396 on locus < RESERVED_LOCATION_COUNT when considering
4397 whether a caret == start == finish location can be
4398 simply stored as the caret location.
4400 2015-12-07 David Malcolm <dmalcolm@redhat.com>
4402 * include/line-map.h (rich_location::set_range): Add line_maps *
4403 param; convert param from source_range to source_location. Drop
4404 "overwrite_loc_p" param.
4405 * line-map.c (rich_location::set_range): Likewise, acting as if
4406 "overwrite_loc_p" were true, and getting range from the location.
4408 2015-11-20 David Malcolm <dmalcolm@redhat.com>
4411 * include/line-map.h (source_range::intersects_line_p): New
4413 (rich_location::~rich_location): New.
4414 (rich_location::add_fixit_insert): New method.
4415 (rich_location::add_fixit_remove): New method.
4416 (rich_location::add_fixit_replace): New method.
4417 (rich_location::get_num_fixit_hints): New accessor.
4418 (rich_location::get_fixit_hint): New accessor.
4419 (rich_location::MAX_FIXIT_HINTS): New constant.
4420 (rich_location::m_num_fixit_hints): New field.
4421 (rich_location::m_fixit_hints): New field.
4422 (class fixit_hint): New class.
4423 (class fixit_insert): New class.
4424 (class fixit_remove): New class.
4425 (class fixit_replace): New class.
4426 * line-map.c (source_range::intersects_line_p): New method.
4427 (rich_location::rich_location): Add initialization of
4428 m_num_fixit_hints to both ctors.
4429 (rich_location::~rich_location): New.
4430 (rich_location::add_fixit_insert): New method.
4431 (rich_location::add_fixit_remove): New method.
4432 (rich_location::add_fixit_replace): New method.
4433 (fixit_insert::fixit_insert): New.
4434 (fixit_insert::~fixit_insert): New.
4435 (fixit_insert::affects_line_p): New.
4436 (fixit_remove::fixit_remove): New.
4437 (fixit_remove::affects_line_p): New.
4438 (fixit_replace::fixit_replace): New.
4439 (fixit_replace::~fixit_replace): New.
4440 (fixit_replace::affects_line_p): New.
4442 2015-11-19 Jakub Jelinek <jakub@redhat.com>
4444 PR preprocessor/60736
4445 * include/cpplib.h (cpp_errno_filename): New prototype.
4446 * errors.c (cpp_errno): Don't handle msgid "" specially, use
4447 _(msgid) instead of msgid as argument to cpp_error.
4448 (cpp_errno_filename): New function.
4449 * files.c (read_file_guts): Use cpp_errno_filename instead of
4451 (open_file_failed): Likewise. Use file->name if file->path is NULL
4454 2015-11-13 David Malcolm <dmalcolm@redhat.com>
4456 * errors.c (cpp_diagnostic): Pass pfile->line_table to
4458 (cpp_diagnostic_with_line): Likewise.
4459 * include/cpplib.h (struct cpp_token): Update comment for src_loc
4460 to indicate that the range of the token is "baked into" the
4462 * include/line-map.h (source_location): Update the descriptive
4463 comment to reflect the packing scheme for short ranges, adding
4464 worked examples of location encoding.
4465 (struct line_map_ordinary): Drop field "column_bits" in favor
4466 of field "m_column_and_range_bits"; add field "m_range_bits".
4467 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
4468 (location_adhoc_data): Add source_range field.
4469 (struct line_maps): Add fields "default_range_bits",
4470 "num_optimized_ranges" and "num_unoptimized_ranges".
4471 (get_combined_adhoc_loc): Add source_range param.
4472 (get_range_from_loc): New declaration.
4473 (pure_location_p): New prototype.
4474 (COMBINE_LOCATION_DATA): Add source_range param.
4475 (SOURCE_LINE): Update for renaming of column_bits.
4476 (SOURCE_COLUMN): Likewise. Shift the column right by the map's
4478 (LAST_SOURCE_LINE_LOCATION): Update for renaming of column_bits.
4479 (linemap_position_for_line_and_column): Add line_maps * params.
4480 (rich_location::rich_location): Likewise.
4481 * lex.c (_cpp_lex_direct): Capture the range of the token, baking
4482 it into token->src_loc via a call to COMBINE_LOCATION_DATA.
4483 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): Reduce from 1U << 17 to
4485 (location_adhoc_data_hash): Add the src_range into
4487 (location_adhoc_data_eq): Require equality of the src_range
4489 (can_be_stored_compactly_p): New function.
4490 (get_combined_adhoc_loc): Add src_range param, and store it,
4491 via a bit-packing scheme for short ranges, otherwise within the
4492 lookaside table. Remove the requirement that data is non-NULL.
4493 (get_range_from_adhoc_loc): New function.
4494 (get_range_from_loc): New function.
4495 (pure_location_p): New function.
4496 (linemap_add): Ensure that start_location has zero for the
4497 range_bits, unless we're past LINE_MAP_MAX_LOCATION_WITH_COLS.
4498 Initialize range_bits to zero. Assert that the start_location
4500 (linemap_line_start): Assert that the
4501 column_and_range_bits >= range_bits.
4502 Update determinination of whether we need to start a new map
4503 using the effective column bits, without the range bits.
4504 Use the set's default_range_bits in new maps, apart from
4505 those with column_bits == 0, which should also have 0 range_bits.
4506 Increase the column bits for new maps by the range bits.
4507 When adding lines to an existing map, use set->highest_line
4508 directly rather than offsetting highest by SOURCE_COLUMN.
4509 Add assertions to sanity-check the return value.
4510 (linemap_position_for_column): Offset to_column by range_bits.
4511 Update set->highest_location if necessary.
4512 (linemap_position_for_line_and_column): Add line_maps * param.
4513 Update the calculation to offset the column by range_bits, and
4514 conditionalize it on being <= LINE_MAP_MAX_LOCATION_WITH_COLS.
4515 Bound it by LINEMAPS_MACRO_LOWEST_LOCATION. Update
4516 set->highest_location if necessary.
4517 (linemap_position_for_loc_and_offset): Handle ad-hoc locations;
4518 pass "set" to linemap_position_for_line_and_column.
4519 (linemap_macro_map_loc_unwind_toward_spelling): Add line_maps
4520 param. Handle ad-hoc locations.
4521 (linemap_location_in_system_header_p): Pass on "set" to call to
4522 linemap_macro_map_loc_unwind_toward_spelling.
4523 (linemap_macro_loc_to_spelling_point): Retain ad-hoc locations.
4524 Pass on "set" to call to
4525 linemap_macro_map_loc_unwind_toward_spelling.
4526 (linemap_resolve_location): Retain ad-hoc locations. Pass on
4527 "set" to call to linemap_macro_map_loc_unwind_toward_spelling.
4528 (linemap_unwind_toward_expansion): Pass on "set" to call to
4529 linemap_macro_map_loc_unwind_toward_spelling.
4530 (linemap_expand_location): Extract the data pointer before
4531 extracting the location.
4532 (rich_location::rich_location): Add line_maps param; use it to
4533 extract the range from the source_location.
4534 * location-example.txt: Regenerate, showing new representation.
4536 2015-11-06 David Malcolm <dmalcolm@redhat.com>
4538 * errors.c (cpp_diagnostic): Update for change in signature
4539 of "error" callback.
4540 (cpp_diagnostic_with_line): Likewise, calling override_column
4541 on the rich_location.
4542 * include/cpplib.h (struct cpp_callbacks): Within "error"
4543 callback, convert param from source_location to rich_location *,
4544 and drop column_override param.
4545 * include/line-map.h (struct source_range): New struct.
4546 (struct location_range): New struct.
4547 (class rich_location): New class.
4548 (linemap_client_expand_location_to_spelling_point): New declaration.
4549 * line-map.c (rich_location::rich_location): New ctors.
4550 (rich_location::lazily_expand_location): New method.
4551 (rich_location::override_column): New method.
4552 (rich_location::add_range): New methods.
4553 (rich_location::set_range): New method.
4555 2015-11-06 David Malcolm <dmalcolm@redhat.com>
4557 * include/line-map.h (struct linemap_stats): Add fields
4558 "adhoc_table_size" and "adhoc_table_entries_used".
4559 * line-map.c (linemap_get_statistics): Populate above fields.
4561 2015-11-04 Mikhail Maltsev <maltsevm@gmail.com>
4563 * config.in: Regenerate.
4564 * configure: Regenerate.
4565 * configure.ac: Remove ENABLE_CHECKING.
4567 2015-11-03 Uros Bizjak <ubizjak@gmail.com>
4569 * lex.c (search_line_sse42): Correctly advance the pointer to an
4572 2015-11-02 David Malcolm <dmalcolm@redhat.com>
4574 * include/line-map.h (source_location): In the table in the
4575 descriptive comment, show UNKNOWN_LOCATION, BUILTINS_LOCATION,
4576 LINE_MAP_MAX_LOCATION_WITH_COLS, LINE_MAP_MAX_SOURCE_LOCATION.
4577 Add notes about ad-hoc values.
4579 2015-10-21 Mikhail Maltsev <maltsevm@gmail.com>
4581 * include/line-map.h: Use CHECKING_P instead of ENABLE_CHECKING.
4583 * macro.c (struct macro_arg_token_iter, set_arg_token,
4584 macro_arg_token_iter_init, macro_arg_token_iter_forward,
4585 macro_arg_token_iter_get_token, macro_arg_token_iter_get_location,
4586 alloc_expanded_arg_mem, _cpp_backup_tokens): Likewise.
4588 * config.in: Regenerate.
4589 * configure: Regenerate.
4590 * configure.ac (CHECKING_P): Define.
4591 * system.h (fancy_abort): Declare.
4593 (gcc_assert): Define. Use CHECKING_P.
4595 2015-10-13 Mikhail Maltsev <maltsevm@gmail.com>
4597 * system.h (CHECKING_P, gcc_checking_assert): Define.
4599 2015-09-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
4602 * line-map.c (linemap_position_for_loc_and_offset): Handle the
4603 case of long lines encoded in multiple maps.
4605 2015-09-07 Marek Polacek <polacek@redhat.com>
4607 * system.h (INTTYPE_MINIMUM): Rewrite to avoid shift warning.
4609 2015-08-06 Yaakov Selkowitz <yselkowi@redhat.com>
4611 * configure: Regenerate.
4613 2015-07-08 Thomas Schwinge <thomas@codesourcery.com>
4615 * include/line-map.h (RESERVED_LOCATION_COUNT): Change type to
4618 2015-07-02 Paolo Carlini <paolo.carlini@oracle.com>
4620 PR preprocessor/53690
4621 * charset.c (_cpp_valid_ucn): Add cppchar_t * parameter and change
4622 return type to bool. Fix encoding of \u0000 and \U00000000 in C++.
4623 (convert_ucn): Adjust call.
4624 * lex.c (forms_identifier_p): Likewise.
4625 * internal.h (_cpp_valid_ucn): Adjust declaration.
4627 2015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
4629 Implement N4197 - Adding u8 character literals
4630 * include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens;
4631 (struct cpp_options): Add utf8_char_literals.
4632 * init.c (struct lang_flags): Add utf8_char_literals;
4633 (struct lang_flags lang_defaults): Add column for utf8_char_literals.
4634 * macro.c (stringify_arg()): Treat CPP_UTF8CHAR token;
4635 * expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()):
4636 Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens;
4637 (cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token;
4638 (eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token.
4639 * lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens.
4640 * charset.c (converter_for_type(), cpp_interpret_charconst()):
4641 Treat CPP_UTF8CHAR token.
4643 2015-06-30 Uros Bizjak <ubizjak@gmail.com>
4645 * lex.c (search_line_sse42) [__GCC_ASM_FLAG_OUTPUTS__]: New main
4646 loop using asm flag outputs.
4648 2015-06-08 Marek Polacek <polacek@redhat.com>
4651 * line-map.c (linemap_position_for_loc_and_offset): Remove
4652 linemap_assert_fails; reverse conditions.
4654 2015-05-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
4656 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER
4657 LINE_MAP_MAX_LOCATION_WITH_COLS,LINE_MAP_MAX_SOURCE_LOCATION):
4659 (linemap_line_start): Use them.
4660 (linemap_position_for_column): Use them.
4662 2015-05-20 David Malcolm <dmalcolm@redhat.com>
4664 * include/line-map.h (MAP_START_LOCATION): Eliminate the non-const
4665 variant, and tweak comment for the const variant.
4666 (ORDINARY_MAP_STARTING_LINE_NUMBER): Drop the non-const variant.
4667 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
4668 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
4669 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
4670 (ORDINARY_MAP_FILE_NAME): Drop the non-const variant.
4671 (MACRO_MAP_MACRO): Likewise.
4672 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
4673 (MACRO_MAP_LOCATIONS): Likewise.
4674 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
4675 * line-map.c (linemap_add): Replace writes through macros with
4676 direct field accesses.
4677 (linemap_enter_macro): Likewise.
4678 (linemap_line_start): Likewise.
4680 2015-05-19 David Malcolm <dmalcolm@redhat.com>
4682 * directives.c (do_line): Strengthen local "map" from
4683 const line_map * to const line_map_ordinary *.
4684 (do_linemarker): Likewise.
4685 (_cpp_do_file_change): Assert that we're not dealing with
4686 a macro map. Introduce local "ord_map" via a call to
4687 linemap_check_ordinary, guarded within the check for
4688 non-NULL. Use it for typesafety.
4689 * files.c (cpp_make_system_header): Strengthen local "map" from
4690 const line_map * to const line_map_ordinary *.
4691 * include/cpplib.h (struct cpp_callbacks): Likewise for second
4692 parameter of "file_change" callback.
4693 * include/line-map.h (struct line_map): Convert from a struct
4694 containing a union to a base class.
4695 (struct line_map_ordinary): Convert to a subclass of line_map.
4696 (struct line_map_macro): Likewise.
4697 (linemap_check_ordinary): Strengthen return type from line_map *
4698 to line_map_ordinary *, and add a const-variant.
4699 (linemap_check_macro): New pair of functions.
4700 (ORDINARY_MAP_STARTING_LINE_NUMBER): Strengthen param from
4701 const line_map * to const line_map_ordinary *, eliminating call
4702 to linemap_check_ordinary. Likewise for the non-const variant.
4703 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
4704 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
4705 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Likewise.
4706 (ORDINARY_MAP_FILE_NAME): Likewise.
4707 (MACRO_MAP_MACRO): Strengthen param from const line_map * to
4708 const line_map_macro *. Likewise for the non-const variant.
4709 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
4710 (MACRO_MAP_LOCATIONS): Likewise.
4711 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
4712 (struct maps_info): Replace with...
4713 (struct maps_info_ordinary):...this and...
4714 (struct maps_info_macro): ...this.
4715 (struct line_maps): Convert fields "info_ordinary" and
4716 "info_macro" to the above new structs.
4717 (LINEMAPS_MAP_INFO): Delete both functions.
4718 (LINEMAPS_MAPS): Likewise.
4719 (LINEMAPS_ALLOCATED): Rewrite both variants to avoid using
4721 (LINEMAPS_USED): Likewise.
4722 (LINEMAPS_CACHE): Likewise.
4723 (LINEMAPS_MAP_AT): Likewise.
4724 (LINEMAPS_ORDINARY_MAPS): Strengthen return type from line_map *
4725 to line_map_ordinary *.
4726 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
4727 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
4728 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
4729 (LINEMAPS_MACRO_MAPS): Strengthen return type from line_map * to
4731 (LINEMAPS_MACRO_MAP_AT): Likewise.
4732 (LINEMAPS_LAST_MACRO_MAP): Likewise.
4733 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
4734 (linemap_map_get_macro_name): Strengthen param from
4735 const line_map * to const line_map_macro *.
4736 (SOURCE_LINE): Strengthen first param from const line_map * to
4737 const line_map_ordinary *, removing call to
4738 linemap_check_ordinary.
4739 (SOURCE_COLUMN): Likewise.
4740 (LAST_SOURCE_LINE_LOCATION): Likewise.
4741 (LAST_SOURCE_LINE): Strengthen first param from const line_map *
4742 to const line_map_ordinary *.
4743 (LAST_SOURCE_COLUMN): Likewise.
4744 (INCLUDED_FROM): Strengthen return type from line_map * to
4745 line_map_ordinary *., and second param from const line_map *
4746 to const line_map_ordinary *, removing call to
4747 linemap_check_ordinary.
4748 (MAIN_FILE_P): Strengthen param from const line_map * to
4749 const line_map_ordinary *, removing call to
4750 linemap_check_ordinary.
4751 (linemap_position_for_line_and_column): Strengthen param from
4752 const line_map * to const line_map_ordinary *.
4753 (LINEMAP_FILE): Strengthen param from const line_map * to
4754 const line_map_ordinary *, removing call to
4755 linemap_check_ordinary.
4756 (LINEMAP_LINE): Likewise.
4757 (LINEMAP_SYSP): Likewise.
4758 (linemap_resolve_location): Strengthen final param from
4759 const line_map ** to const line_map_ordinary **.
4760 * internal.h (CPP_INCREMENT_LINE): Likewise for local "map".
4761 (linemap_enter_macro): Strengthen return type from
4762 const line_map * to const line_map_macro *.
4763 (linemap_add_macro_token): Likewise for first param.
4764 * line-map.c (linemap_check_files_exited): Strengthen local "map"
4765 from const line_map * to const line_map_ordinary *.
4766 (new_linemap): Introduce local "map_size" and use it when
4767 calculating how large the buffer should be. Rewrite based
4768 on change of info_macro and info_ordinary into distinct types.
4769 (linemap_add): Strengthen locals "map" and "from" from line_map *
4770 to line_map_ordinary *.
4771 (linemap_enter_macro): Strengthen return type from
4772 const line_map * to const line_map_macro *, and local "map" from
4773 line_map * to line_map_macro *.
4774 (linemap_add_macro_token): Strengthen param "map" from
4775 const line_map * to const line_map_macro *.
4776 (linemap_line_start): Strengthen local "map" from line_map * to
4777 line_map_ordinary *.
4778 (linemap_position_for_column): Likewise.
4779 (linemap_position_for_line_and_column): Strengthen first param
4780 from const line_map * to const line_map_ordinary *.
4781 (linemap_position_for_loc_and_offset): Strengthen local "map" from
4782 const line_map * to const line_map_ordinary *.
4783 (linemap_ordinary_map_lookup): Likewise for return type and locals
4784 "cached" and "result".
4785 (linemap_macro_map_lookup): Strengthen return type and locals
4786 "cached" and "result" from const line_map * to
4787 const line_map_macro *.
4788 (linemap_macro_map_loc_to_exp_point): Likewise for param "map".
4789 (linemap_macro_map_loc_to_def_point): Likewise.
4790 (linemap_macro_map_loc_unwind_toward_spelling): Likewise.
4791 (linemap_get_expansion_line): Strengthen local "map" from
4792 const line_map * to const line_map_ordinary *.
4793 (linemap_get_expansion_filename): Likewise.
4794 (linemap_map_get_macro_name): Strengthen param from
4795 const line_map * to const line_map_macro *.
4796 (linemap_location_in_system_header_p): Add call to
4797 linemap_check_ordinary in region guarded by
4798 !linemap_macro_expansion_map_p. Introduce local "macro_map" via
4799 linemap_check_macro in other region, using it in place of "map"
4801 (first_map_in_common_1): Add calls to linemap_check_macro.
4802 (trace_include): Strengthen param "map" from const line_map * to
4803 const line_map_ordinary *.
4804 (linemap_macro_loc_to_spelling_point): Strengthen final param from
4805 const line_map ** to const line_map_ordinary **. Replace a
4806 C-style cast with a const_cast, and add calls to
4807 linemap_check_macro and linemap_check_ordinary.
4808 (linemap_macro_loc_to_def_point): Likewise.
4809 (linemap_macro_loc_to_exp_point): Likewise.
4810 (linemap_resolve_location): Strengthen final param from
4811 const line_map ** to const line_map_ordinary **.
4812 (linemap_unwind_toward_expansion): Introduce local "macro_map" via
4813 a checked cast and use it in place of *map.
4814 (linemap_unwind_to_first_non_reserved_loc): Strengthen local
4815 "map1" from const line_map * to const line_map_ordinary *.
4816 (linemap_expand_location): Introduce local "ord_map" via a checked
4817 cast and use it in place of map.
4818 (linemap_dump): Make local "map" const. Strengthen local
4819 "includer_map" from line_map * to const line_map_ordinary *.
4820 Introduce locals "ord_map" and "macro_map" via checked casts and
4821 use them in place of "map" for typesafety.
4822 (linemap_dump_location): Strengthen local "map" from
4823 const line_map * to const line_map_ordinary *.
4824 (linemap_get_file_highest_location): Update for elimination of
4826 (linemap_get_statistics): Strengthen local "cur_map" from
4827 line_map * to const line_map_macro *. Update uses of sizeof to
4828 use the appropriate line_map subclasses.
4829 * macro.c (_cpp_warn_if_unused_macro): Add call to
4830 linemap_check_ordinary.
4831 (builtin_macro): Strengthen local "map" from const line_map * to
4832 const line_map_macro *.
4833 (enter_macro_context): Likewise.
4834 (replace_args): Likewise.
4835 (tokens_buff_put_token_to): Likewise for param "map".
4836 (tokens_buff_add_token): Likewise.
4838 2015-05-13 David Malcolm <dmalcolm@redhat.com>
4840 * include/line-map.h (source_location): Add a reference to
4841 location-example.txt to the descriptive comment.
4842 * location-example.txt: New file.
4844 2015-05-13 David Malcolm <dmalcolm@redhat.com>
4846 * include/line-map.h (MAX_SOURCE_LOCATION): Convert from a macro
4847 to a const source_location.
4848 (RESERVED_LOCATION_COUNT): Likewise.
4849 (linemap_check_ordinary): Convert from a macro to a pair of inline
4850 functions, for const/non-const arguments.
4851 (MAP_START_LOCATION): Likewise.
4852 (ORDINARY_MAP_STARTING_LINE_NUMBER): Likewise.
4853 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
4854 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
4855 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Convert from a macro to a
4856 pair of inline functions, for const/non-const arguments, where the
4858 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): New function.
4859 (ORDINARY_MAP_FILE_NAME): Convert from a macro to a pair of inline
4860 functions, for const/non-const arguments.
4861 (MACRO_MAP_MACRO): Likewise.
4862 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
4863 (MACRO_MAP_LOCATIONS): Likewise.
4864 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
4865 (LINEMAPS_MAP_INFO): Likewise.
4866 (LINEMAPS_MAPS): Likewise.
4867 (LINEMAPS_ALLOCATED): Likewise.
4868 (LINEMAPS_USED): Likewise.
4869 (LINEMAPS_CACHE): Likewise.
4870 (LINEMAPS_ORDINARY_CACHE): Likewise.
4871 (LINEMAPS_MACRO_CACHE): Likewise.
4872 (LINEMAPS_MAP_AT): Convert from a macro to an inline function.
4873 (LINEMAPS_LAST_MAP): Likewise.
4874 (LINEMAPS_LAST_ALLOCATED_MAP): Likewise.
4875 (LINEMAPS_ORDINARY_MAPS): Likewise.
4876 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
4877 (LINEMAPS_ORDINARY_ALLOCATED): Likewise.
4878 (LINEMAPS_ORDINARY_USED): Likewise.
4879 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
4880 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
4881 (LINEMAPS_MACRO_MAPS): Likewise.
4882 (LINEMAPS_MACRO_MAP_AT): Likewise.
4883 (LINEMAPS_MACRO_ALLOCATED): Likewise.
4884 (LINEMAPS_MACRO_USED): Likewise.
4885 (LINEMAPS_MACRO_LOWEST_LOCATION): Likewise.
4886 (LINEMAPS_LAST_MACRO_MAP): Likewise.
4887 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
4888 (IS_ADHOC_LOC): Likewise.
4889 (COMBINE_LOCATION_DATA): Likewise.
4890 (SOURCE_LINE): Likewise.
4891 (SOURCE_COLUMN): Likewise.
4892 (LAST_SOURCE_LINE_LOCATION): Likewise.
4893 (LAST_SOURCE_LINE): Likewise.
4894 (LAST_SOURCE_COLUMN): Likewise.
4895 (LAST_SOURCE_LINE_LOCATION)
4896 (INCLUDED_FROM): Likewise.
4897 (MAIN_FILE_P): Likewise.
4898 (LINEMAP_FILE): Likewise.
4899 (LINEMAP_LINE): Likewise.
4900 (LINEMAP_SYSP): Likewise.
4901 (linemap_location_before_p): Likewise.
4902 * line-map.c (linemap_check_files_exited): Make local "map" const.
4903 (linemap_add): Use SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS.
4904 (linemap_line_start): Likewise.
4906 2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
4908 * aclocal.m4: Regenerated with automake-1.11.6.
4910 2015-05-13 David Malcolm <dmalcolm@redhat.com>
4912 * include/line-map.h (linemap_assert): Move up within the file to
4913 before all of the map accessor macros.
4914 (linemap_assert_fails): Likewise.
4915 (linemap_check_ordinary): Likewise.
4916 (linemap_macro_expansion_map_p): Likewise.
4918 2015-05-12 David Malcolm <dmalcolm@redhat.com>
4920 * directives.c (do_line): Set seen_line_directive on line_table.
4921 (do_linemarker): Likewise.
4922 * include/line-map.h (struct line_maps): Add new field
4923 "seen_line_directive".
4925 2015-05-08 Jason Merrill <jason@redhat.com>
4927 * include/cpplib.h: Add CPP_W_CXX11_COMPAT.
4928 (struct cpp_options): Add cpp_warn_cxx11_compat.
4929 * init.c (cpp_create_reader): Initialize it.
4930 * lex.c (lex_string): Add -Wc++11-compat warning.
4932 2015-05-05 David Malcolm <dmalcolm@redhat.com>
4934 * pch.c (cpp_valid_state): Fix indentation so that it reflects the
4937 2015-05-05 David Malcolm <dmalcolm@redhat.com>
4939 * include/line-map.h: Fix comment at the top of the file.
4940 (source_location): Rewrite and expand the comment for this
4941 typedef, adding an ascii-art table to clarify how source_location
4942 values are allocated.
4943 * line-map.c: Fix comment at the top of the file.
4945 2015-04-09 Richard Biener <rguenther@suse.de>
4948 * files.c (pch_open_file): Allow main and pre-included files
4949 when trying to open a PCH.
4951 2015-04-06 Jakub Jelinek <jakub@redhat.com>
4953 PR preprocessor/61977
4954 * lex.c (cpp_peek_token): If peektok is CPP_EOF, back it up
4955 with all tokens peeked by the current function.
4957 2015-04-02 Jakub Jelinek <jakub@redhat.com>
4959 PR preprocessor/61977
4960 * lex.c (cpp_peek_token): Temporarily clear pfile->cb.line_change.
4962 2015-03-23 Jakub Jelinek <jakub@redhat.com>
4964 PR preprocessor/65238
4965 * internal.h (_cpp_scan_out_logical_line): Add third argument.
4966 * directives.c (prepare_directive_trad): Pass false to it.
4967 * traditional.c (_cpp_read_logical_line_trad,
4968 _cpp_create_trad_definition): Likewise.
4969 (struct fun_macro): Add paramc field.
4970 (fun_like_macro): New function.
4971 (maybe_start_funlike): Handle NODE_BUILTIN macros. Initialize
4972 macro->paramc field.
4973 (save_argument): Use macro->paramc instead of
4974 macro->node->value.macro->paramc.
4975 (push_replacement_text): Formatting fix.
4976 (recursive_macro): Use fun_like_macro helper.
4977 (_cpp_scan_out_logical_line): Likewise. Add BUILTIN_MACRO_ARG
4978 argument. Initialize fmacro.paramc field. Handle builtin
4979 function-like macros.
4981 2015-03-16 Edward Smith-Rowland <3dw4rd@verizon.net>
4984 * lex.c (lex_number): If a number ends with digit-seps (') skip back
4985 and let lex_string take them.
4987 2015-03-02 Markus Trippelsdorf <markus@trippelsdorf.de>
4990 * lex.c (search_line_fast): Silence ubsan errors.
4992 2015-02-03 <dodji@redhat.com>
4994 PR preprocessor/64803
4995 * internal.h (cpp_reader::top_most_macro_node): New data member.
4996 * macro.c (enter_macro_context): Pass the location of the end of
4997 the top-most invocation of the function-like macro, or the
4998 location of the expansion point of the top-most object-like macro.
4999 (cpp_get_token_1): Store the top-most macro node in the new
5000 pfile->top_most_macro_node data member.
5001 (_cpp_pop_context): Clear the new cpp_reader::top_most_macro_node
5004 2015-01-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
5006 * lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON.
5008 2015-01-23 Marek Polacek <polacek@redhat.com>
5011 PR preprocessor/60570
5012 * directives.c (do_elif): Don't evaluate #elif conditionals
5013 when they don't need to be.
5015 2015-01-16 Jakub Jelinek <jakub@redhat.com>
5017 * expr.c (cpp_classify_number): Add N_() around ?: string
5018 literals used in cpp_error_with_line call as format string.
5020 2015-01-05 Jakub Jelinek <jakub@redhat.com>
5022 Update copyright years.
5024 2014-12-19 Jakub Jelinek <jakub@redhat.com>
5026 PR preprocessor/63831
5027 * directives.c (lex_macro_node): Remove __has_attribute__ handling.
5028 * internal.h (struct spec_node): Remove n__has_attribute__ field.
5029 (struct lexer_state): Remove in__has_attribute__ field.
5030 * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_ATTRIBUTE.
5031 * identifiers.c (_cpp_init_hashtable): Remove __has_attribute__
5033 * init.c (builtin_array): Add __has_attribute and __has_cpp_attribute.
5034 (cpp_init_special_builtins): Don't initialize __has_attribute
5035 or __has_cpp_attribute if CLK_ASM or pfile->cb.has_attribute is NULL.
5036 * traditional.c (enum ls): Remove ls_has_attribute,
5037 ls_has_attribute_close.
5038 (_cpp_scan_out_logical_line): Remove __has_attribute__ handling.
5039 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_ATTRIBUTE.
5040 * pch.c (cpp_read_state): Remove __has_attribute__ handling.
5041 * expr.c (eval_token): Likewise.
5042 (parse_has_attribute): Removed.
5044 2014-12-11 Uros Bizjak <ubizjak@gmail.com>
5046 * directives.c (cpp_define_formatted): Use xvasprintf.
5048 2014-12-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
5050 * line-map.c (linemap_position_for_loc_and_offset): Add new
5051 linemap_assert_fails.
5053 2014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
5055 * include/line-map.h (linemap_assert_fails): Declare.
5056 * line-map.c (linemap_position_for_loc_and_offset): Use it.
5058 2014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
5060 * line-map.c (linemap_add): Fix typo.
5061 (linemap_line_start): Fix whitespace.
5063 2014-11-29 John Schmerge <jbschmerge@gmail.com>
5065 PR preprocessor/41698
5066 * charset.c (one_utf8_to_utf16): Do not produce surrogate pairs
5069 2014-11-25 Jakub Jelinek <jakub@redhat.com>
5071 PR preprocessor/60436
5072 * line-map.c (linemap_line_start): If highest is above 0x60000000
5073 and we are still tracking columns or highest is above 0x70000000,
5076 2014-11-20 Uros Bizjak <ubizjak@gmail.com>
5079 * lex.c [__i386__ || __x86_64__]: Compile special SSE functions
5080 only for (__GNUC__ >= 5 || !defined(__PIC__)).
5082 2014-11-13 Manuel López-Ibáñez <manu@gcc.gnu.org>
5084 * include/line-map.h: Include EXPR, so that unused variable warnings
5087 2014-11-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
5090 * include/line-map.h (linemap_position_for_loc_and_offset):
5092 * line-map.c (linemap_position_for_loc_and_offset): New.
5094 2014-11-11 David Malcolm <dmalcolm@redhat.com>
5096 * ChangeLog.jit: New.
5098 2014-11-10 Edward Smith-Rowland <3dw4rd@verizon.net>
5100 * include/cpplib.h (cpp_callbacks): Add has_attribute.
5101 * internal.h (lexer_state): Add in__has_attribute__.
5102 * directives.c (lex_macro_node): Prevent use of __has_attribute__
5104 * expr.c (parse_has_attribute): New function; (eval_token): Look for
5105 __has_attribute__ and route to parse_has_attribute.
5106 * identifiers.c (_cpp_init_hashtable): Initialize n__has_attribute__.
5107 * pch.c (cpp_read_state): Initialize n__has_attribute__.
5108 * traditional.c (enum ls): Add ls_has_attribute, ls_has_attribute_close;
5109 (_cpp_scan_out_logical_line): Attend to __has_attribute__.
5111 2014-11-06 Joseph Myers <joseph@codesourcery.com>
5113 * include/cpp-id-data.h (struct cpp_macro): Update comment
5114 regarding parameters.
5115 * include/cpplib.h (struct cpp_macro_arg, struct cpp_identifier):
5116 Add spelling fields.
5117 (struct cpp_token): Update comment on macro_arg.
5118 * internal.h (_cpp_save_parameter): Add extra argument.
5119 (_cpp_spell_ident_ucns): New declaration.
5120 * lex.c (lex_identifier): Add SPELLING argument. Set *SPELLING to
5121 original spelling of identifier.
5122 (_cpp_lex_direct): Update calls to lex_identifier.
5123 (_cpp_spell_ident_ucns): New function, factored out of
5125 (cpp_spell_token): Adjust FORSTRING argument semantics to return
5126 original spelling of identifiers. Use _cpp_spell_ident_ucns in
5128 (_cpp_equiv_tokens): Check spellings of identifiers and macro
5129 arguments are identical.
5130 * macro.c (macro_arg_saved_data): New structure.
5131 (paste_tokens): Use original spellings of identifiers from
5133 (_cpp_save_parameter): Add argument SPELLING. Save both canonical
5135 (parse_params): Update calls to _cpp_save_parameter.
5136 (lex_expansion_token): Save spelling of macro argument tokens.
5137 (_cpp_create_definition): Extract canonical node from saved data.
5138 (cpp_macro_definition): Use UCNs in spelling of macro name. Use
5139 original spellings of macro argument tokens and identifiers.
5140 * traditional.c (scan_parameters): Update call to
5141 _cpp_save_parameter.
5143 2014-11-05 Joseph Myers <joseph@codesourcery.com>
5145 PR preprocessor/9449
5146 * init.c (lang_defaults): Enable extended identifiers for C++ and
5147 C99-based standards.
5149 2014-10-22 Alan Modra <amodra@gmail.com>
5151 * symtab.c (ht_create): Use obstack_specify_allocation in place of
5153 * files.c (_cpp_init_files): Likewise.
5154 * init.c (cpp_create_reader): Likewise.
5155 * identifiers.c (_cpp_init_hashtable): Likewise.
5157 2014-10-14 Manuel López-Ibáñez <manu@gcc.gnu.org>
5159 * include/line-map.h (linemap_location_from_macro_expansion_p):
5160 const struct line_maps * argument.
5161 (linemap_position_for_line_and_column): const struct line_map *
5163 * line-map.c (linemap_add_macro_token): Use correct argument name
5165 (linemap_position_for_line_and_column): const struct line_map *
5167 (linemap_macro_map_loc_to_def_point): Fix comment. Make static.
5168 (linemap_location_from_macro_expansion_p): const struct line_maps *
5170 (linemap_resolve_location): Fix argument names in comment.
5172 2014-10-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
5174 * lex.c (search_line_fast): Add new version to be used for Power8
5175 and later targets when Altivec is enabled. Restrict the existing
5176 Altivec version to big-endian systems so that lvsr is not used on
5177 little endian, where it is deprecated. Remove LE-specific code
5178 from the now-BE-only version.
5180 2014-10-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
5181 Jeff Law <law@redhat.com>
5183 * charset.c (convert_no_conversion): Reallocate memory with 25%
5186 2014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net>
5188 Implement SD-6: SG10 Feature Test Recommendations
5189 * internal.h (lexer_state, spec_nodes): Add in__has_include__.
5190 * directives.c: Support __has_include__ builtin.
5191 * expr.c (parse_has_include): New function to parse __has_include__
5192 builtin; (eval_token()): Use it.
5193 * files.c (_cpp_has_header()): New funtion to look for header;
5194 (open_file_failed()): Not an error to not find a header file for
5196 * identifiers.c (_cpp_init_hashtable()): Add entry for __has_include__.
5197 * pch.c (cpp_read_state): Lookup __has_include__.
5198 * traditional.c (enum ls, _cpp_scan_out_logical_line()): Walk through
5199 __has_include__ statements.
5201 2014-09-30 Bernd Edlinger <bernd.edlinger@hotmail.de>
5203 PR preprocessor/58893
5204 * errors.c (cpp_diagnostic): Fix possible out of bounds access.
5205 * files.c (_cpp_stack_include): Initialize src_loc for IT_CMDLINE.
5207 2014-09-24 Marek Polacek <polacek@redhat.com>
5211 * include/cpplib.h (enum cpp_ttype): Define CPP_KEYWORD.
5213 2014-09-17 Jan Hubicka <hubicka@ucw.cz>
5215 * charset.c (conversion): Rename to ...
5216 (cpp_conversion): ... this one; update.
5217 * files.c (file_hash_entry): Rename to ...
5218 (cpp_file_hash_entry): ... this one ; update.
5220 2014-09-17 Marek Polacek <polacek@redhat.com>
5223 * init.c (struct lang_flags): Remove cplusplus_comments.
5224 (cpp_set_lang): Likewise.
5225 (post_options): Likewise.
5226 * lex.c (_cpp_lex_direct): Disallow C++ style comments in C90/C94.
5228 2014-09-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
5230 * include/cpplib.h (struct cpp_options): Declare warn_normalize as
5231 int instead of enum.
5233 2014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
5235 * macro.c (replace_args): Use cpp_pedwarning, cpp_warning and
5237 * include/cpplib.h: Add CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC.
5238 * init.c (cpp_create_reader): Do not init to -1 here.
5239 * expr.c (num_binary_op): Use cpp_pedwarning.
5241 2014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
5243 * directives.c (check_eol_1): New.
5244 (check_eol_endif_labels): New.
5245 (check_eol): Call check_eol_1.
5246 (do_else,do_endif): Call check_eol_endif_labels.
5248 2014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
5250 * macro.c (warn_of_redefinition): Suppress warnings for builtins
5251 that lack the NODE_WARN flag, unless Wbuiltin-macro-redefined.
5252 (_cpp_create_definition): Use Wbuiltin-macro-redefined for
5253 builtins that lack the NODE_WARN flag.
5254 * directives.c (do_undef): Likewise.
5255 * init.c (cpp_init_special_builtins): Do not change flags
5256 depending on Wbuiltin-macro-redefined.
5258 2014-08-28 Edward Smith-Rowland <3dw4rd@verizon.net>
5260 PR cpp/23827 - standard C++ should not have hex float preprocessor
5262 * libcpp/init.c (lang_flags): Change CXX98 flag for extended numbers
5264 * libcpp/expr.c (cpp_classify_number): Weite error message for improper
5265 use of hex floating literal.
5267 2014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
5269 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z;
5270 Rename CLK_GNUCXX1Y, CLK_CXX1Y to CLK_GNUCXX14, CLK_CXX14;
5271 * init.c (struct lang_flags lang_defaults): Add column for trigraphs;
5272 Add rows for CLK_GNUCXX1Z, CLK_CXX1Z; (cpp_set_lang): Set trigraphs;
5273 (cpp_init_builtins): Set __cplusplus to 201402L for C++14;
5274 Set __cplusplus to 201500L for C++17.
5275 * expr.c (cpp_classify_number): Change C++1y to C++14 in binary
5276 constants error message.
5278 2014-08-20 Marek Polacek <polacek@redhat.com>
5280 * include/cpplib.h (cpp_options): Use signed char.
5281 * lex.c (_cpp_lex_direct): Don't warn in C++ mode.
5283 2014-08-19 Marek Polacek <polacek@redhat.com>
5285 * lex.c (_cpp_lex_direct): Fix a typo.
5287 2014-08-19 Marek Polacek <polacek@redhat.com>
5289 * charset.c (_cpp_valid_ucn): Warn only if -Wc90-c99-compat.
5290 * lex.c (_cpp_lex_direct): Likewise.
5291 * macro.c (replace_args): Likewise.
5292 (parse_params): Likewise.
5293 * include/cpplib.h (cpp_options): Change cpp_warn_c90_c99_compat
5296 2014-08-10 Marek Polacek <polacek@redhat.com>
5299 * lex.c (_cpp_lex_direct): Warn when -Wc90-c99-compat is in effect.
5300 * charset.c (_cpp_valid_ucn): Likewise.
5301 * include/cpplib.h (cpp_options): Add cpp_warn_c90_c99_compat.
5302 * macro.c (replace_args): Warn when -Wc90-c99-compat is in effect.
5303 (parse_params): Likewise.
5305 2014-07-27 Marek Polacek <polacek@redhat.com>
5308 * macro.c (builtin_macro): Add location parameter. Set
5309 location of builtin macro to the expansion point.
5310 (enter_macro_context): Pass location to builtin_macro.
5312 2014-07-16 Dodji Seketeli <dodji@redhat.com>
5314 Support location tracking for built-in macro tokens
5315 * include/line-map.h (line_maps::builtin_location): New data
5317 (line_map_init): Add a new parameter to initialize the new
5318 line_maps::builtin_location data member.
5319 * line-map.c (linemap_init): Initialize the
5320 line_maps::builtin_location data member.
5321 * macro.c (builtin_macro): Create a macro map and track the token
5322 resulting from the expansion of a built-in macro.
5324 2014-07-10 Edward Smith-Rowland <3dw4rd@verizon.net>
5325 Jonathan Wakely <jwakely@redhat.com>
5327 PR preprocessor/61389
5328 * macro.c (_cpp_arguments_ok, parse_params, create_iso_definition):
5329 Warning messages mention C++11 in c++ mode and C99 in c mode.
5330 * lex.c (lex_identifier_intern, lex_identifier): Ditto
5332 2014-07-09 Edward Smith-Rowland <3dw4rd@verizon.net>
5334 PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped
5336 * lex.c (lex_raw_string ()): Do not warn about invalid suffix
5337 if skipping. (lex_string ()): Ditto.
5339 2014-06-04 Edward Smith-Rowland <3dw4rd@verizon.net>
5342 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
5343 Combine user-defined escape logic with the other string and char logic.
5345 2014-05-26 Richard Biener <rguenther@suse.de>
5347 * configure.ac: Remove long long and __int64 type checks,
5348 add check for uint64_t and fail if that wasn't found.
5349 * include/cpplib.h (cpp_num_part): Use uint64_t.
5350 * config.in: Regenerate.
5351 * configure: Likewise.
5353 2014-05-21 Marek Polacek <polacek@redhat.com>
5356 * files.c (find_file_in_dir): Add parens around &&.
5358 2014-05-20 Edward Smith-Rowland <3dw4rd@verizon.net>
5361 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
5362 Check for user-defined literal strings and user-defined literal chars
5363 to escape necessary characters.
5365 2014-05-20 Richard Biener <rguenther@suse.de>
5367 * configure.ac: Copy gcc logic of detecting a 64bit type.
5368 Remove HOST_WIDE_INT define.
5369 * include/cpplib.h: typedef cpp_num_part to a 64bit type,
5370 similar to how hwint.h does it.
5371 * config.in: Regenerate.
5372 * configure: Likewise.
5374 2014-05-09 Joey Ye <joey.ye@arm.com>
5376 * files.c (find_file_in_dir): Always try to shorten for DOS
5378 * init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS.
5380 2014-05-07 Richard Biener <rguenther@suse.de>
5382 * configure.ac: Always set need_64bit_hwint to yes.
5383 * configure: Regenerated.
5385 2014-04-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5387 * lex.c: Remove Solaris 9 reference.
5389 2014-02-24 Walter Lee <walt@tilera.com>
5391 * configure.ac: Change "tilepro" triplet to "tilepro*".
5392 * configure: Regenerate.
5394 2014-02-19 Jakub Jelinek <jakub@redhat.com>
5396 PR preprocessor/58844
5397 * macro.c (enter_macro_context): Only push
5398 macro_real_token_count (macro) tokens rather than
5399 macro->count tokens, regardless of
5400 CPP_OPTION (pfile, track-macro-expansion).
5402 2014-02-07 Jakub Jelinek <jakub@redhat.com>
5404 PR preprocessor/56824
5405 * line-map.c (get_combined_adhoc_loc, linemap_get_expansion_line,
5406 linemap_get_expansion_filename, linemap_location_in_system_header_p,
5407 linemap_location_from_macro_expansion_p,
5408 linemap_macro_loc_to_spelling_point, linemap_macro_loc_to_def_point,
5409 linemap_macro_loc_to_exp_point, linemap_expand_location): Fix
5411 (linemap_compare_locations): Look through adhoc locations for both
5414 2014-01-23 Dodji Seketeli <dodji@redhat.com>
5416 PR PR preprocessor/58580
5417 * include/line-map.h (linemap_get_file_highest_location): Declare
5419 * line-map.c (linemap_get_file_highest_location): Define it.
5421 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
5423 Update copyright years
5425 2013-12-09 Joseph Myers <joseph@codesourcery.com>
5427 PR preprocessor/55715
5428 * expr.c (num_binary_op): Implement subtraction directly rather
5429 than with negation and falling through into addition case.
5431 2013-11-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
5433 * lex.c (search_line_fast): Correct for little endian.
5435 2013-11-15 Joseph Myers <joseph@codesourcery.com>
5437 * ucnid.tab: Add C11 and C11NOSTART data.
5438 * makeucnid.c (digit): Rename enum value to N99.
5439 (C11, N11, all_languages): New enum values.
5440 (NUM_CODE_POINTS, MAX_CODE_POINT): New macros.
5441 (flags, decomp, combining_value): Use NUM_CODE_POINTS as array
5443 (decomp): Use unsigned int as element type.
5444 (all_decomp): New array.
5445 (read_ucnid): Handle C11 and C11NOSTART. Use MAX_CODE_POINT.
5446 (read_table): Use MAX_CODE_POINT. Store all decompositions in
5448 (read_derived): Use MAX_CODE_POINT.
5449 (write_table): Use NUM_CODE_POINTS. Print N99, C11 and N11
5450 flags. Print whole array variable declaration rather than just
5452 (char_id_valid, write_context_switch): New functions.
5453 (main): Call write_context_switch.
5454 * ucnid.h: Regenerate.
5455 * include/cpplib.h (struct cpp_options): Add c11_identifiers.
5456 * init.c (struct lang_flags): Add c11_identifiers.
5457 (cpp_set_lang): Set c11_identifiers option from selected language.
5458 * internal.h (struct normalize_state): Document "previous" as
5459 previous starter character.
5460 (NORMALIZE_STATE_UPDATE_IDNUM): Take character as argument.
5461 * charset.c (DIG): Rename enum value to N99.
5462 (C11, N11): New enum values.
5463 (struct ucnrange): Give name to struct. Use short for flags and
5464 unsigned int for end of range. Include ucnid.h for whole variable
5466 (ucn_valid_in_identifier): Allow for characters up to 0x10FFFF.
5467 Allow for C11 in determining valid characters and valid start
5468 characters. Use check_nfc for non-Hangul context-dependent
5469 checks. Only store starter characters in nst->previous.
5470 (_cpp_valid_ucn): Pass new argument to
5471 NORMALIZE_STATE_UPDATE_IDNUM.
5472 * lex.c (lex_identifier): Pass new argument to
5473 NORMALIZE_STATE_UPDATE_IDNUM. Call NORMALIZE_STATE_UPDATE_IDNUM
5474 after initial non-UCN part of identifier.
5475 (lex_number): Pass new argument to NORMALIZE_STATE_UPDATE_IDNUM.
5477 2013-11-15 Joseph Myers <joseph@codesourcery.com>
5479 * ucnid.tab: Mark C99 digits as [C99DIG].
5480 * makeucnid.c (read_ucnid): Handle [C99DIG].
5481 (read_table): Don't check for digit characters.
5482 * ucnid.h: Regenerate.
5484 2013-11-06 Tobias Burnus <burnus@net-b.de>
5486 * macro.c (_cpp_builtin_macro_text): Correct
5487 wording of two warnings.
5489 2013-11-05 Tobias Burnus <burnus@net-b.de>
5491 * include/cpplib.h (CPP_W_DATE_TIME): Added.
5492 (cpp_options): Add warn_date_time.
5493 * init.c (cpp_create_reader): Init it.
5494 * macro.c (_cpp_builtin_macro_text): Warn when
5495 __DATE__/__TIME__/__TIMESTAMP__ is used.
5497 2013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
5499 Implement C++14 digit separators.
5500 * include/cpplib.h (cpp_options): Add digit_separators flag.
5501 * internal.h (DIGIT_SEP(c)): New macro.
5502 * expr.c (cpp_classify_number): Check improper placement of digit sep;
5503 (cpp_interpret_integer): Skip over digit separators.
5504 * init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add
5505 digit separator flags per language; (cpp_set_lang): Set
5507 * lex.c (lex_number): Add digits separator to allowable characters for
5510 2013-10-15 David Malcolm <dmalcolm@redhat.com>
5512 * Makefile.in (PICFLAG): New.
5513 (ALL_CFLAGS): Add PICFLAG.
5514 (ALL_CXXFLAGS): Likewise.
5515 * configure.ac: Add --enable-host-shared, setting up new
5517 * configure: Regenerate.
5519 2013-08-07 Richard Earnshaw <rearnsha@arm.com>
5521 * configure.ac: Set need_64bit_hwint for all arm targets.
5522 * configure: Regenerated.
5524 2013-07-20 Jakub Jelinek <jakub@redhat.com>
5526 PR preprocessor/57620
5527 * lex.c (lex_raw_string): Undo phase1 and phase2 transformations
5528 between R" and final " rather than only in between R"del( and )del".
5530 2013-07-10 Jakub Jelinek <jakub@redhat.com>
5532 PR preprocessor/57824
5533 * lex.c (lex_raw_string): Allow reading new-lines if
5534 in_deferred_pragma or if parsing_args and there is still
5535 data in the current buffer.
5537 * include/cpplib.h (cpp_token_val_index): Change parameter type to
5539 * lex.c (cpp_token_val_index): Likewise.
5541 PR preprocessor/57757
5542 * lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING
5543 or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that
5546 2013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
5548 * lex.c (lex_raw_string(), lex_string()): Constrain suffixes treated
5549 as concatenated literal and macro to just the patterns found in
5550 inttypes.h; (is_macro()): New.
5552 2013-06-24 Dehao Chen <dehao@google.com>
5554 * files.c (_cpp_stack_include): Fix the highest_location when header
5555 file is guarded by #ifndef and is included twice.
5557 2013-04-28 Jakub Jelinek <jakub@redhat.com>
5559 N3472 binary constants
5560 * include/cpplib.h (struct cpp_options): Fix a typo in user_literals
5561 field comment. Add binary_constants field.
5562 * init.c (struct lang_flags): Add binary_constants field.
5563 (lang_defaults): Add bin_cst column to the table.
5564 (cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants).
5565 * expr.c (cpp_classify_number): Talk about C++11 instead of C++0x
5566 in diagnostics. Accept binary constants if
5567 CPP_OPTION (pfile, binary_constants) even when pedantic. Adjust
5570 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
5572 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y.
5573 * init.c (lang_defaults): Add defaults for the latter.
5574 (cpp_init_builtins): Define __cplusplus as 201300L for the latter.
5575 * lex.c (_cpp_lex_direct): Update.
5577 2013-04-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
5580 * configure.ac: Require 64-bit int for arm*-*-rtems*.
5581 * configure: Regenerate.
5583 2013-03-06 Jakub Jelinek <jakub@redhat.com>
5586 * internal.h (struct cpp_buffer): Add to_free field.
5587 (_cpp_pop_file_buffer): Add third argument.
5588 * files.c (_cpp_stack_file): Set buffer->to_free.
5589 (_cpp_pop_file_buffer): Add to_free argument. Free to_free
5590 if non-NULL, and if equal to file->buffer_start, also clear
5591 file->buffer{,_start,_valid}.
5592 * directives.c (_cpp_pop_buffer): Pass buffer->to_free
5593 to _cpp_pop_file_buffer.
5595 2013-03-01 Jakub Jelinek <jakub@redhat.com>
5598 * files.c (_cpp_save_file_entries): Free result at the end.
5599 * pch.c (cpp_string_free): New function.
5600 (cpp_save_state): Use it in htab_create call.
5601 (cpp_write_pch_deps): Free ss->defs. Destroy ss->definedhash.
5603 2013-02-28 Jakub Jelinek <jakub@redhat.com>
5605 * files.c (_cpp_find_file): If returning early, before storing
5606 something to *hash_slot and *hash_slot is NULL, call htab_clear_slot
5607 on it. Access *hash_slot using void * type rather than
5608 struct file_hash_entry * to avoid aliasing issues.
5610 * configure.ac: Don't define ENABLE_CHECKING whenever
5611 --enable-checking is seen, instead use similar --enable-checking=yes
5612 vs. --enable-checking=release default as gcc/ subdir has and
5613 define ENABLE_CHECKING if ENABLE_CHECKING is defined in gcc/.
5614 Define ENABLE_VALGRIND_CHECKING if requested.
5615 * lex.c (new_buff): If ENABLE_VALGRIND_CHECKING, put _cpp_buff
5616 struct first in the allocated buffer and result->base after it.
5617 (_cpp_free_buff): If ENABLE_VALGRIND_CHECKING, free buff itself
5618 instead of buff->base.
5619 * config.in: Regenerated.
5620 * configure: Regenerated.
5622 2013-02-13 Ed Smith-Rowland <3dw4rd@verizon.net>
5625 * lex.c (lex_raw_string): Allow string literal with suffix
5626 beginning with 's' to be parsed as a C++11 user-defined literal.
5628 2013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
5630 Update copyright years.
5632 2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
5634 PR c++/54526 (again)
5635 * lex.c (_cpp_lex_direct): In C++11 mode, implement 2.5 p3, bullet 2.
5637 2013-01-03 Marc Glisse <marc.glisse@inria.fr>
5640 * line-map.c (get_combined_adhoc_loc): Cast from extern "C" type.
5641 (new_linemap): Likewise.
5642 (linemap_enter_macro): Likewise.
5644 2012-12-03 Jakub Jelinek <jakub@redhat.com>
5648 * files.c (read_file_guts): Allocate extra 16 bytes instead of
5649 1 byte at the end of buf. Pass size + 16 instead of size
5650 to _cpp_convert_input.
5651 * charset.c (_cpp_convert_input): Reallocate if there aren't
5652 at least 16 bytes beyond to.len in the buffer. Clear 16 bytes
5653 at to.text + to.len.
5655 2012-11-21 Steve Ellcey <sellcey@mips.com>
5658 * files.c (pch_open_file): Fix check for implicit_preinclude.
5660 2012-11-16 Simon Baldwin <simonb@google.com>
5662 * include/cpplib.h (struct cpp_options): Add canonical_system_headers.
5663 * files.c (find_file_in_dir): Call maybe_shorter_path() only if
5664 canonical_system_headers is set.
5665 * init.c (cpp_create_reader): Initialize canonical_system_headers.
5666 * configure.ac: Add new --enable-canonical-system-headers.
5667 * configure: Regenerate.
5668 * config.in: Regenerate.
5670 2012-11-09 Ed Smith-Rowland <3dw4rd@verizon.net>
5673 * include/cpplib.h (cpp_interpret_float_suffix): Add cpp_reader* arg.
5674 (cpp_interpret_int_suffix): Add cpp_reader* arg.
5675 * init.c (cpp_create_reader): Iitialize new flags.
5676 * expr.c (interpret_float_suffix): Use new flags.
5677 (cpp_interpret_float_suffix): Add cpp_reader* arg.
5678 (interpret_int_suffix): Use new flags.
5679 (cpp_interpret_int_suffix): Add cpp_reader* arg.
5680 (cpp_classify_number): Adjust calls to interpret_x_suffix.
5682 2012-10-23 Ian Bolton <ian.bolton@arm.com>
5683 Jim MacArthur <jim.macarthur@arm.com>
5684 Marcus Shawcroft <marcus.shawcroft@arm.com>
5685 Nigel Stephens <nigel.stephens@arm.com>
5686 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
5687 Richard Earnshaw <rearnsha@arm.com>
5688 Sofiane Naci <sofiane.naci@arm.com>
5689 Stephen Thomas <stephen.thomas@arm.com>
5690 Tejas Belagod <tejas.belagod@arm.com>
5691 Yufeng Zhang <yufeng.zhang@arm.com>
5693 * configure.ac: Enable AArch64.
5694 * configure: Regenerate.
5696 2012-10-23 Joseph Myers <joseph@codesourcery.com>
5698 * files.c (struct _cpp_file): Add implicit_preinclude.
5699 (pch_open_file): Allow a previously opened implicitly included
5701 (_cpp_find_file): Add implicit_preinclude argument. Free file and
5702 do not call open_file_failed if implicit_preinclude. Store
5703 implicit_preinclude value.
5704 (_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date):
5705 Update calls to _cpp_find_file.
5706 (_cpp_stack_include): Handle IT_DEFAULT.
5707 (cpp_push_default_include): New.
5708 * include/cpplib.h (cpp_push_default_include): Declare.
5709 * init.c (cpp_read_main_file): Update call to _cpp_find_file.
5710 * internal.h (enum include_type): Add IT_DEFAULT.
5711 (_cpp_find_file): Update prototype.
5713 2012-10-15 Tobias Burnus <burnus@net-b.de>
5715 * files.c (read_file_guts, _cpp_save_file_entries): Free memory
5717 * lex.c (warn_about_normalization): Ditto.
5718 * mkdeps.c (deps_save): Ditto.
5719 * pch.c (cpp_valid_state): Ditto.
5721 2012-10-04 Florian Weimer <fweimer@redhat.com>
5723 * directives.c (do_pragma_warning_or_error): New.
5724 (do_pragma_warning): New.
5725 (do_pragma_error): New.
5726 (_cpp_init_internal_pragmas): Register new pragmas.
5728 2012-09-25 Dehao Chen <dehao@google.com>
5731 * line-map.c (location_adhoc_data_hash): Fix the hash function.
5733 2012-09-25 Dehao Chen <dehao@google.com>
5736 * include/line-map.h (location_adhoc_data): Move location_adhoc_data
5738 (location_adhoc_data_map): Likewise.
5739 (line_maps): Likewise.
5740 (rebuild_location_adhoc_htab): New Function.
5741 * line-map.c (+rebuild_location_adhoc_htab): new Funcion.
5742 (get_combined_adhoc_loc): Move location_adhoc_data into GC.
5743 (location_adhoc_data_fini): Likewise.
5744 (linemap_init): Likewise.
5745 (location_adhoc_data_init): Remove Function.
5747 2012-09-19 Dehao Chen <dehao@google.com>
5749 * include/line-map.h (MAX_SOURCE_LOCATION): New value.
5750 (location_adhoc_data_fini): New.
5751 (get_combined_adhoc_loc): New.
5752 (get_data_from_adhoc_loc): New.
5753 (get_location_from_adhoc_loc): New.
5754 (location_adhoc_data_map): New.
5755 (COMBINE_LOCATION_DATA): New.
5756 (IS_ADHOC_LOC): New.
5757 (expanded_location): New field.
5758 (line_maps): New field.
5759 * line-map.c (location_adhoc_data): New.
5760 (location_adhoc_data_hash): New.
5761 (location_adhoc_data_eq): New.
5762 (location_adhoc_data_update): New.
5763 (get_combined_adhoc_loc): New.
5764 (get_data_from_adhoc_loc): New.
5765 (get_location_from_adhoc_loc): New.
5766 (location_adhoc_data_init): New.
5767 (location_adhoc_data_fini): New.
5768 (linemap_init): Initialize location_adhoc_data.
5769 (linemap_lookup): Change to use new location.
5770 (linemap_ordinary_map_lookup): Likewise.
5771 (linemap_macro_map_lookup): Likewise.
5772 (linemap_macro_map_loc_to_def_point): Likewise.
5773 (linemap_macro_map_loc_unwind_toward_spel): Likewise.
5774 (linemap_get_expansion_line): Likewise.
5775 (linemap_get_expansion_filename): Likewise.
5776 (linemap_location_in_system_header_p): Likewise.
5777 (linemap_location_from_macro_expansion_p): Likewise.
5778 (linemap_macro_loc_to_spelling_point): Likewise.
5779 (linemap_macro_loc_to_def_point): Likewise.
5780 (linemap_macro_loc_to_exp_point): Likewise.
5781 (linemap_resolve_location): Likewise.
5782 (linemap_unwind_toward_expansion): Likewise.
5783 (linemap_unwind_to_first_non_reserved_loc): Likewise.
5784 (linemap_expand_location): Likewise.
5785 (linemap_dump_location): Likewise.
5786 (linemap_line_start): Likewise.
5788 2012-05-25 Dodji Seketeli <dodji@redhat.com>
5790 PR preprocessor/53469
5791 * directives.c (do_pragma): Use the virtual location for the
5792 pragma token, instead of its spelling location.
5794 2012-08-14 Diego Novillo <dnovillo@google.com>
5796 Merge from cxx-conversion branch. Configury.
5798 * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
5799 * configure.ac: Likewise.
5800 * configure: Regenerate.
5802 2012-08-14 Lawrence Crowl <crowl@google.com>
5804 Merge from cxx-conversion branch. New C++ hash table.
5806 * include/symtab.h (typedef struct ht hash_table): Change the typedef
5807 name to cpp_hash_table. Update all users of the typedef.
5809 2012-07-30 Laurynas Biveinis <laurynas.biveinis@gmail.com>
5811 * include/line-map.h (line_map_macro): Use the "atomic" GTY option
5812 for the macro_locations field.
5814 2011-06-19 Uros Bizjak <ubizjak@gmail.com>
5816 * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
5817 __builtin_ia32_pcmpestri128 instead of asm.
5819 2012-06-04 Dimitrios Apostolou <jimis@gmx.net>
5821 * line-map.c (linemap_enter_macro): Don't zero max_column_hint in
5822 every macro. This improves performance by reducing the number of
5823 reallocations when track-macro-expansion is on.
5825 2012-06-04 Dodji Seketeli <dodji@redhat.com>
5827 PR preprocessor/53463
5828 * line-map.c (linemap_location_in_system_header_p): For built-in
5829 macro tokens, check the first expansion point location that is not
5830 for a token coming from a built-in macro.
5832 2012-05-29 Joseph Myers <joseph@codesourcery.com>
5834 * directives.c: Fix typos.
5835 * include/line-map.h: Fix typos.
5836 * line-map.c: Fix typos.
5837 * macro.c: Fix typos.
5839 2012-05-25 Dodji Seketeli <dodji@redhat.com>
5842 * lex.c (search_line_fast): Avoid unused local typedefs to simulate
5845 2012-05-29 Dodji Seketeli <dodji@redhat.com>
5847 PR preprocessor/53229
5848 * internal.h (cpp_reader::set_invocation_location): Remove.
5849 (cpp_reader::about_to_expand_macro_p): New member flag.
5850 * directives.c (do_pragma): Remove Kludge as
5851 pfile->set_invocation_location is no more.
5852 * macro.c (cpp_get_token_1): Do away with the use of
5853 cpp_reader::set_invocation_location. Just collect the macro
5854 expansion point when we are about to expand the top-most macro.
5855 Do not override cpp_reader::about_to_expand_macro_p.
5856 This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding
5857 properly handle locations of expansion points.
5858 (cpp_get_token_with_location): Adjust, as
5859 cpp_reader::set_invocation_location is no more.
5860 (paste_tokens): Take a virtual location parameter for
5861 the LHS of the pasting operator. Use it in diagnostics. Update
5863 (paste_all_tokens): Tighten the assert. Propagate the location of
5864 the expansion point when no virtual locations are available.
5865 Pass the virtual location to paste_tokens.
5866 (in_macro_expansion_p): New static function.
5867 (enter_macro_context): Set the cpp_reader::about_to_expand_macro_p
5868 flag until we really start expanding the macro.
5870 2012-05-16 Dodji Seketeli <dodji@redhat.com>
5872 PR preprocessor/7263
5873 * include/cpplib.h (cpp_classify_number): Take a location
5875 * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic
5876 macros that take a location parameter.
5877 (cpp_classify_number): Take a (virtual) location parameter. Use
5878 it for diagnostics. Adjust comments.
5879 (eval_token): Take a location parameter. Pass it to
5880 cpp_classify_number and to diagnostic routines.
5881 (_cpp_parse_expr): Use virtual locations of tokens when parsing
5882 expressions. Pass a virtual location to eval_token and to
5883 diagnostic routines.
5885 2012-05-10 Tristan Gingold <gingold@adacore.com>
5887 * expr.c (interpret_float_suffix): Add a guard.
5889 2012-05-02 Dodji Seketeli <dodji@redhat.com>
5891 Properly initialize cpp_context in destringize_and_run
5892 * directives.c (destringize_and_run): Properly initialize the new
5894 * macro.c (_cpp_pop_context): Assert that we shouldn't try to pop
5895 the initial base context, which has the same life time as the
5896 current instance of cpp_file.
5898 2012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
5899 Dodji Seketeli <dodji@seketeli.org>
5902 * libcpp/files.c (maybe_shorter_path): New.
5903 (find_file_in_dir): Use it.
5905 2012-04-30 Dodji Seketeli <dodji@redhat.com>
5907 Switch -ftrack-macro-expansion=2 on by default.
5908 * init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
5909 by default. Add comments.
5911 Strip "<built-in>" loc from displayed expansion context
5912 * include/line-map.h (linemap_unwind_toward_expansion): Fix typo
5914 (linemap_unwind_to_first_non_reserved_loc): Declare new function.
5915 * line-map.c (linemap_unwind_to_first_non_reserved_loc): Define
5918 Fix expansion point loc for macro-like tokens
5919 * macro.c (macro_of_context): New static function.
5920 (_cpp_push_token_context, push_extended_tokens_context): If the
5921 macro argument is NULL, it means we are continuing the expansion
5922 of the current macro, if any. Update comments.
5923 (_cpp_pop_context): Re-enable expansion of the macro only when we
5924 are really out of the context of the current expansion.
5926 Fix token pasting with -ftrack-macro-expansion
5927 * macro.c (paste_all_tokens): Put the token resulting from pasting
5928 into an extended token context with -ftrack-macro-location is in
5931 Fix cpp_sys_macro_p with -ftrack-macro-expansion
5932 * macro.c (cpp_sys_macro_p): Support -ftrack-macro-expansion.
5934 2012-04-29 Dodji Seketeli <dodji@redhat.com>
5936 * lex.c (lex_raw_string): Change C++ style comments into C style
5938 (lex_string): Likewise.
5940 2012-04-27 Ollie Wild <aaw@google.com>
5942 * include/cpplib.h (struct cpp_options): Add new field,
5943 warn_literal_suffix.
5944 (CPP_W_LITERAL_SUFFIX): New enum.
5945 * init.c (cpp_create_reader): Default initialization of
5946 warn_literal_suffix.
5947 * lex.c (lex_raw_string): Treat user-defined literals which don't
5948 begin with '_' as separate tokens and produce a warning.
5949 (lex_string): Ditto.
5951 2012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
5953 * line-map.c (linemap_resolve_location): Synchronize comments with
5954 those in line-map.h.
5955 * include/line-map.h (linemap_resolve_location): Fix spelling in
5958 2012-03-22 Richard Earnshaw <rearnsha@arm.com>
5960 * lex.c (search_line_fast): Provide Neon-optimized version for ARM.
5962 2012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5964 * lex.c: Remove Solaris 8 reference.
5966 2012-02-14 Walter Lee <walt@tilera.com>
5968 * configure.ac: Require 64-bit hwint for tilegx and tilepro.
5969 * configure: Regenerate.
5971 2012-01-09 Richard Guenther <rguenther@suse.de>
5973 * macro.c (_cpp_builtin_macro_text): Remove unused variable map.
5975 2012-01-09 Gary Funck <gary@intrepid.com>
5977 PR preprocessor/33919
5978 * files.c (_cpp_get_file_name): New. Implement file name
5980 * internal.h (_cpp_get_file_name): New prototype.
5981 * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
5982 to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
5984 2012-01-03 Olivier Hainque <hainque@adacore.com>
5986 * system.h: Prior to #define, #undef fopen and freopen unconditionally.
5988 2011-12-20 Joseph Myers <joseph@codesourcery.com>
5990 * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
5991 (CLK_STDC1X): Change to CLK_STDC11.
5992 * init.c (lang_defaults): Update comments.
5993 (cpp_init_builtins): Update language tests. Use 201112L for C11
5996 2011-12-20 Andreas Schwab <schwab@linux-m68k.org>
5998 * configure: Regenerate.
6000 2011-12-19 Andreas Schwab <schwab@linux-m68k.org>
6002 * configure: Regenerate.
6004 2011-12-07 Jakub Jelinek <jakub@redhat.com>
6007 * internal.h (_cpp_init_lexer): New prototype.
6008 * init.c (init_library): Call it.
6009 * lex.c (init_vectorized_lexer): Remove constructor attribute,
6011 (HAVE_init_vectorized_lexer): Define.
6012 (_cpp_init_lexer): New function.
6014 2011-12-03 Dodji Seketeli <dodji@redhat.com>
6016 * macro.c (tokens_buff_remove_last_token)
6017 (tokens_buff_put_token_to): Add an 'inline' function specifier to
6020 2011-11-22 Diego Novillo <dnovillo@google.com>
6022 * include/line-map.h (linemap_dump): Declare.
6023 (line_table_dump): Declare.
6024 * line-map.c (linemap_dump): New.
6025 (line_table_dump): New.
6027 2011-11-21 Ed Smith-Rowland <3dw4rd@verizon.net>
6030 * expr.c (cpp_userdef_char_remove_type): Fix typo.
6032 2011-11-03 Michael Matz <matz@suse.de>
6035 * configure.ac: Check for -fno-exceptions -fno-rtti.
6036 * configure: Regenerate.
6037 * Makefile.in (NOEXCEPTION_FLAGS): New flag.
6038 (ALL_CXXFLAGS): Use it.
6040 2011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
6042 * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
6044 2011-11-02 Jason Merrill <jason@redhat.com>
6047 * configure.ac: Add -Wno-narrowing to warning options.
6049 2011-10-31 Jason Merrill <jason@redhat.com>
6052 * init.c (cpp_init_builtins): Set __cplusplus for C++11.
6055 * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
6056 CLK_GNUCXX0X to CLK_GNUCXX11.
6058 2011-10-26 Ed Smith-Rowland <3dw4rd@verizon.net>
6060 Implement C++11 user-defined literals.
6061 * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
6062 cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
6063 cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
6064 cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
6065 (cpp_classify_number): Classify unrecognized tokens as user-defined
6067 * include/cpplib.h: Add new tokens for user-defined literals.
6068 * init.c: Add new preprocessor flag (cxx11).
6069 * lex.c: (lex_string, lex_raw_string): Handle user-defined literals
6070 including concatenation and promotion with suffixes.
6072 2011-10-24 Dodji Seketeli <dodji@redhat.com>
6074 * line-map.c (linemap_macro_map_lookup): Fix logic.
6076 2011-10-24 Dodji Seketeli <dodji@redhat.com>
6078 * include/line-map.h (linemap_expand_location): Take a line table
6079 parameter. Update comment.
6080 (linemap_resolve_location): Update comment.
6081 (linemap_expand_location_full): Remove.
6082 * line-map.c (linemap_resolve_location): Handle reserved
6083 locations; return a NULL map in those cases.
6084 (linemap_expand_location): If location is reserved, return a
6085 zeroed expanded location. Update comment. Take a line table to
6086 assert that the function takes non-virtual locations only.
6087 (linemap_expand_location_full): remove.
6088 (linemap_dump_location): Handle the fact that
6089 linemap_resolve_location can return NULL line maps when the
6090 location resolves to a reserved location.
6092 * line-map.c (linemap_macro_map_lookup): Fix logic.
6094 2011-10-22 Dodji Seketeli <dodji@redhat.com>
6097 * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
6098 context to act upon.
6099 * lex.c (_cpp_remaining_tokens_num_in_context): Likewise. Update
6101 (cpp_token_from_context_at): Likewise.
6102 (cpp_peek_token): Use the context to peek tokens from.
6104 2011-10-20 Dodji Seketeli <dodji@redhat.com>
6107 * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
6110 2011-10-18 Dodji Seketeli <dodji@redhat.com>
6113 * include/line-map.h (struct linemap_stats): Change the type of
6114 the members from size_t to long.
6115 * macro.c (macro_arg_token_iter_init): Unconditionally initialize
6118 2011-10-17 Dodji Seketeli <dodji@redhat.com>
6120 * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
6121 variable without using it if ENABLE_CHECKING is not defined. Mark
6122 the LOCATION parameter as being unused.
6124 2011-10-15 Tom Tromey <tromey@redhat.com>
6125 Dodji Seketeli <dodji@redhat.com>
6127 * include/line-map.h (struct line_maps::alloced_size_for_request):
6129 * line-map.c (new_linemap): Use set->alloced_size_for_request to
6130 get the actual allocated size of line maps.
6132 2011-10-15 Tom Tromey <tromey@redhat.com>
6133 Dodji Seketeli <dodji@redhat.com>
6135 * line-map.h (struct linemap_stats): Declare new struct.
6136 (linemap_get_statistics): Declare ...
6137 * line-map.c (linemap_get_statistics): ... new function.
6138 * macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
6139 Declare new counters.
6140 (enter_macro_context, replace_args): Update
6141 num_macro_tokens_counter.
6142 (cpp_get_token_1): Update num_expanded_macros_counter.
6144 2011-10-15 Tom Tromey <tromey@redhat.com>
6145 Dodji Seketeli <dodji@redhat.com>
6147 * include/cpplib.h (struct cpp_options)<debug>: New struct member.
6148 * include/line-map.h (linemap_dump_location): Declare ...
6149 * line-map.c (linemap_dump_location): ... new function.
6151 2011-10-15 Tom Tromey <tromey@redhat.com>
6152 Dodji Seketeli <dodji@redhat.com>
6154 * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
6156 * internal.h (struct macro_context): New struct.
6157 (enum context_tokens_kind): New enum.
6158 (struct cpp_context)<tokens_kind>: New member of type enum
6159 context_tokens_kind.
6160 (struct cpp_context)<macro>: Remove this. Replace it with an enum
6161 of macro and macro_context.
6162 (struct cpp_context)<direct_p>: Remove.
6163 (_cpp_remaining_tokens_num_in_context): Declare new function.
6164 * directives.c (destringize_and_run): Adjust.
6165 * lex.c (_cpp_remaining_tokens_num_in_context)
6166 (_cpp_token_from_context_at): Define new functions
6167 (cpp_peek_token): Use them.
6168 * init.c (cpp_create_reader): Initialize the base context to zero.
6169 (_cpp_token_from_context_at): Define new static function.
6170 (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
6171 _cpp_token_from_context_at.
6172 * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
6174 (enum macro_arg_token_kind): New enum.
6175 (struct macro_arg_token_iter): New struct.
6176 (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
6177 (alloc_expanded_arg_mem, ensure_expanded_arg_room)
6178 (delete_macro_args, set_arg_token, get_arg_token_location)
6179 (arg_token_ptr_at, macro_arg_token_iter_init)
6180 (macro_arg_token_iter_get_token)
6181 (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
6182 (expanded_token_index, tokens_buff_new, tokens_buff_count)
6183 (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
6184 (tokens_buff_add_token, tokens_buff_remove_last_token)
6185 (reached_end_of_context, consume_next_token_from_context): New
6187 (cpp_get_token_1): New static function. Split and extended from
6188 cpp_get_token. Use reached_end_of_context and
6189 consume_next_token_from_context. Unify its return point. Move
6190 the location tweaking from cpp_get_token_with_location in here.
6191 (cpp_get_token): Use cpp_get_token_1
6192 (stringify_arg): Use the new arg_token_at.
6193 (paste_all_tokens): Support tokens coming from extended tokens
6195 (collect_args): Return the number of collected arguments, by
6196 parameter. Store virtual locations of tokens that constitute the
6198 (funlike_invocation_p): Return the number of collected arguments,
6200 (enter_macro_context): Add a parameter for macro expansion point.
6201 Pass it to replace_args and to the "used" cpp callback. Get the
6202 number of function-like macro arguments from funlike_invocation_p,
6203 pass it to the new delete_macro_args to free the memory used by
6204 macro args. When -ftrack-macro-expansion is in effect, for macros
6205 that have no arguments, create a macro map for the macro expansion
6206 and use it to allocate proper virtual locations for tokens
6207 resulting from the expansion. Push an extended tokens context
6208 containing the tokens resulting from macro expansion and their
6210 (replace_args): Rename the different variables named 'count' into
6211 variables with more meaningful names. Create a macro map;
6212 allocate virtual locations of tokens resulting from this
6213 expansion. Use macro_arg_token_iter to iterate over tokens of a
6214 given macro. Handle the case of the argument of
6215 -ftrack-macro-expansion being < 2. Don't free macro arguments
6216 memory resulting from expand_arg here, as these are freed by the
6217 caller of replace_arg using delete_macro_args now. Push extended
6219 (next_context, push_ptoken_context, _cpp_push_token_context)
6220 (_cpp_push_text_context): Properly initialize the context.
6221 (expand_arg): Use the new alloc_expanded_arg_mem,
6222 push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
6223 (_cpp_pop_context): Really free the memory held by the context.
6224 Handle freeing memory used by extended tokens contexts.
6225 (cpp_get_token_with_location): Use cpp_get_token_1.
6226 (cpp_sys_macro_p): Adjust.
6227 (_cpp_backup_tokens): Support the new kinds of token contexts.
6228 * traditional.c (recursive_macro): Adjust.
6230 2011-10-15 Tom Tromey <tromey@redhat>
6231 Dodji Seketeli <dodji@redhat.com>
6233 * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
6235 (MAX_SOURCE_LOCATION): New constant.
6236 (struct line_map_ordinary, struct line_map_macro): New structs.
6237 (struct line_map): Turn this into a union of the two above. Add
6239 (struct maps_info): New struct.
6240 (struct line_maps)<info_ordinary, info_macro>: Two new fields.
6241 These now carry the map information that was previously scattered
6242 in struct line_maps.
6243 (struct map_info::allocated): Fix comment.
6244 (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
6245 (ORDINARY_MAP_STARTING_LINE_NUMBER)
6246 (ORDINARY_MAP_INCLUDER_FILE_INDEX)
6247 (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
6248 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
6249 (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
6250 (MACRO_MAP_EXPANSION_POINT_LOCATION)
6251 (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
6252 (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
6253 (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
6254 (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
6255 (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
6256 (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
6257 (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
6258 (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
6259 (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
6260 (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
6261 (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
6263 (linemap_check_ordinary, linemap_assert)
6264 (linemap_location_before_p): New macros.
6265 (linemap_position_for_line_and_column)
6266 (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
6267 (linemap_macro_expansion_map_p)
6268 (linemap_macro_map_loc_to_def_point)
6269 (linemap_macro_map_loc_unwind_once)
6270 (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
6271 (linemap_get_source_line linemap_get_source_column)
6272 (linemap_map_get_macro_name, linemap_get_file_path)
6273 (linemap_location_in_system_header_p)
6274 (linemap_location_from_macro_expansion_p): Declare new functions.
6275 (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
6276 (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
6277 accessors act on ordinary maps only.
6278 (INCLUDED_FROM): Return NULL for main files; use the new
6280 (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
6281 (struct expanded_location): Move here from gcc/input.h
6282 (linemap_resolve_location, linemap_expand_location)
6283 (linemap_expand_location_full): Declare new functions.
6284 * line-map.c: Include cpplib.h, internal.h
6285 (linemap_enter_macro, linemap_add_macro_token)
6286 (linemap_get_expansion_line, linemap_get_expansion_filename): New
6287 functions that are private to libcpp.
6288 (linemap_assert): New macro.
6289 (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
6290 (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
6291 (linemap_macro_map_loc_unwind_toward_spelling)
6292 (linemap_macro_map_loc_to_exp_point)
6293 (first_map_in_common_1, first_map_in_common): New static
6295 (new_linemap): Define new static functions. Extracted and
6297 (linemap_add): ... here. Use linemap_assert in lieu of abort
6299 (linemap_tracks_macro_expansion_locs_p)
6300 (linemap_add_macro_token, linemap_macro_expansion_map_p)
6301 (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
6302 (linemap_macro_map_loc_to_def_point)
6303 (linemap_macro_map_loc_unwind_once)
6304 (linemap_step_out_once, linemap_map_get_index)
6305 (linemap_get_source_line,linemap_get_source_column)
6306 (linemap_get_file_path, linemap_map_get_macro_name)
6307 (linemap_location_in_system_header_p)
6308 (linemap_location_originated_from_system_header_p)
6309 (linemap_location_from_macro_expansion_p)
6310 (linemap_tracks_macro_expansion_locs_p)
6311 (linemap_resolve_location, linemap_expand_location)
6312 (linemap_expand_location_full)
6313 (linemap_tracks_macro_expansion_locs_p)
6314 (linemap_position_for_line_and_column, linemap_compare_locations):
6315 Define new public functions.
6316 (linemap_init): Initialize ordinary and macro maps information in
6318 (linemap_check_files_exited): Use the new accessors.
6319 (linemap_free): Remove this dead code.
6320 (linemap_line_start): Assert this uses an ordinary map. Adjust to
6321 use the new ordinary map accessors and data structures. Don't
6322 overflow past the lowest possible macro token's location.
6323 (linemap_position_for_column): Assert the ordinary maps of the map
6324 set are really ordinary. Use ordinary map accessors.
6325 (linemap_lookup): Keep the same logic but generalize to allow
6326 lookup of both ordinary and macro maps. Do not crash when called
6327 with an empty line table.
6328 * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
6329 new API of line-map.h.
6330 * directives.c (start_directive, do_line, do_linemarker)
6331 (do_linemarker): Likewise.
6332 * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
6333 (make_cpp_dir, cpp_make_system_header): Likewise.
6334 * init.c (cpp_read_main_file): Likewise.
6335 * internal.h (CPP_INCREMENT_LINE): Likewise.
6336 (linemap_enter_macro, linemap_add_macro_token)
6337 (linemap_get_expansion_line, linemap_get_expansion_filename): New
6338 functions private to libcpp.
6339 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
6340 (skip_line_comment, skip_whitespace, lex_raw_string)
6341 (_cpp_lex_direct): Likewise.
6342 * macro.c (_cpp_builtin_macro_text): Likewise.
6343 (_cpp_aligned_alloc): Initialize the new name member of the macro.
6344 * traditional.c (copy_comment, _cpp_scan_out_logical_line):
6346 * errors.c (cpp_diagnostic): Adjust to new linemap API.
6348 2011-08-28 Dodji Seketeli <dodji@redhat.com>
6350 * line-map.c (linemap_add): Assert that reason must not be
6351 LC_RENAME when called for the first time on a "main input file".
6353 2011-08-22 Gabriel Charette <gchare@google.com>
6355 * init.c (cpp_create_reader): Inititalize forced_token_location_p.
6356 * internal.h (struct cpp_reader): Add field forced_token_location_p.
6357 * lex.c (_cpp_lex_direct): Use forced_token_location_p.
6358 (cpp_force_token_locations): New.
6359 (cpp_stop_forcing_token_locations): New.
6361 2011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6364 * init.c (cpp_init_builtins): Define __cplusplus 19971L.
6366 2011-08-18 Joseph Myers <joseph@codesourcery.com>
6368 * include/cpplib.h (struct cpp_options): Fix typo.
6370 2011-08-18 Joseph Myers <joseph@codesourcery.com>
6372 * include/cpplib.h (struct cpp_options): Add rliterals.
6373 * init.c (struct lang_flags, lang_defaults): Add rliterals.
6374 (cpp_set_lang): Set rliterals option.
6375 (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
6376 * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
6378 2011-08-15 Gabriel Charette <gchare@google.com>
6380 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
6381 Update all users to use linemap_position_for_column instead.
6383 2011-07-28 Gabriel Charette <gchare@google.com>
6385 * include/line-map.h (struct line_maps):
6386 Remove unused field last_listed. Update all users.
6388 2011-07-28 H.J. Lu <hongjiu.lu@intel.com>
6390 * configure.ac: Set need_64bit_hwint to yes for x86 targets.
6391 * configure: Regenerated.
6393 2011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6395 * system.h [__cplusplus]: Wrap C function declarations in extern "C".
6397 2011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6398 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6401 * configure.ac: Test AM_ICONV with CXX.
6402 * configure: Regenerate.
6403 * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
6405 2011-07-15 Dodji Seketeli <dodji@redhat.com>
6407 * directives.c (struct if_stack): Use source_location as type
6409 * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
6410 indent, def_pragma, used_define, used_undef>: Properly use
6411 source_location as parameter type, rather than unsigned int.
6413 2011-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6416 * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
6417 like i[34567]86-*-solaris2.1[0-9]*.
6418 * configure: Regenerate.
6420 2011-06-16 Jason Merrill <jason@redhat.com>
6423 * lex.c (lex_raw_string): Don't check for embedded NUL.
6425 2011-06-06 Dodji Seketeli <dodji@redhat.com>
6427 PR preprocessor/48532
6428 * directives.c (do_pragma): Don't forget the invocation location
6429 when parsing the pragma name of a namespaced pragma directive.
6431 2011-05-29 John Tytgat <John.Tytgat@aaug.net>
6433 * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
6435 2011-05-22 Uros Bizjak <ubizjak@gmail.com>
6438 * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
6439 is defined. Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
6441 2011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
6443 * system.h (ENUM_BITFIELD): Remove.
6445 2011-04-24 Jakub Jelinek <jakub@redhat.com>
6447 PR preprocessor/48740
6448 * lex.c (lex_raw_string): When raw string ends with
6449 ??) followed by raw prefix and ", ensure it is preprocessed
6450 with ??) rather than ??].
6452 2011-04-20 Jim Meyering <meyering@redhat.com>
6454 * files.c (destroy_cpp_file): Remove useless if-before-free.
6455 * init.c (cpp_destroy): Likewise.
6456 * macro.c (replace_args): Likewise.
6457 * pch.c (cpp_valid_state): Likewise.
6459 2011-03-25 Kai Tietz <ktietz@redhat.com>
6461 * files.c (file_hash_eq): Use filename_cmp
6463 (nonexistent_file_hash_eq): Likewise.
6464 (remap_filename): Likewise.
6465 Handle absolute DOS-path,
6466 (append_file_to_dir): Check for IS_DIR_SEPARATOR
6468 (read_name_map): Likewise.
6469 * linemap.c (linemap_add): Use filename_cmp
6471 * mkdeps.c (apply_vpath): Use filename_ncmp
6473 (deps_restore): Use filename_cmp instead of
6475 * init.c (read_original_directory): Use
6476 IS_DIR_SEPARATOR instead of checking for slash.
6478 2011-03-21 Michael Meissner <meissner@linux.vnet.ibm.com>
6480 PR preprocessor/48192
6481 * directives.c (do_ifdef): Do not consider conditional macros as
6484 * expr.c (parse_defined): Ditto.
6486 2011-03-18 Richard Henderson <rth@redhat.com>
6489 * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
6491 2011-11-04 Eric Botcazou <ebotcazou@adacore.com>
6492 Jakub Jelinek <jakub@redhat.com>
6494 PR preprocessor/39213
6495 * directives.c (end_directive): Call _cpp_remove_overlay for deferred
6496 pragmas as well in traditional mode.
6498 2010-11-17 Ian Lance Taylor <iant@google.com>
6501 * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of
6502 AC_LANG based on ENABLE_BUILD_WITH_CXX.
6504 2010-11-16 Kai Tietz <kai.tietz@onevision.com>
6506 PR preprocessor/17349
6507 * lex.c (save_comment): Handle in argument passing c++
6510 2010-11-02 Ian Lance Taylor <iant@google.com>
6512 * configure.ac: Use AC_SYS_LARGEFILE.
6513 * configure: Rebuild.
6514 * config.in: Rebuild.
6516 2010-10-19 Basile Starynkevitch <basile@starynkevitch.net>
6518 * line-map.h (source_location): Remove obsolete comment
6519 mentioning location_s.
6521 2010-09-29 Kai Tietz <kai.tietz@onevision.com>
6523 PR preprocessor/45362
6524 * directives.c (cpp_pop_definition): Make static.
6525 (do_pragma_push_macro): Reworked to store text
6527 (do_pragma_pop_macro): Add free text definition.
6528 (cpp_push_definition): Removed.
6529 * include/cpplib.h (cpp_push_definition): Removed.
6530 (cpp_pop_definition): Likewise.
6531 * internal.h (def_pragma_macro): Remove member 'value'
6532 and add new members 'definition', 'line',
6533 'syshdr', 'sued' and 'is_undef'.
6534 * pch.c (_cpp_restore_pushed_macros): Rework to work
6535 on text definition and store additional macro flags.
6536 (_cpp_save_pushed_macros): Likewise.
6538 2010-09-29 Joseph Myers <joseph@codesourcery.com>
6540 * include/cpplib.h (cpp_options): Rename warn_deprecated,
6541 warn_traditional, warn_long_long and pedantic.
6542 * directives.c (directive_diagnostics, _cpp_handle_directive):
6543 Update names of cpp_options members.
6544 * expr.c (cpp_classify_number, eval_token): Update names of
6545 cpp_options members.
6546 * init.c (cpp_create_reader, post_options): Update names of
6547 cpp_options members.
6548 * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
6549 cpp_options members.
6550 * macro.c (parse_params): Update names of cpp_options members.
6552 2010-09-15 Ian Lance Taylor <iant@google.com>
6554 * init.c: Fix type name in comment.
6556 2010-08-31 Jakub Jelinek <jakub@redhat.com>
6558 PR preprocessor/45457
6559 * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
6561 * directives.c (do_ifdef, do_ifndef): Likewise.
6563 2010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6565 * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
6567 2010-08-24 Richard Henderson <rth@redhat.com>
6570 * configure.ac (HAVE_SSE4): New check.
6571 * configure, config.in: Rebuild.
6572 * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
6574 2010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6576 * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
6577 etc. on Solaris 2/x86.
6579 2010-08-21 Richard Henderson <rth@redhat.com>
6580 Andi Kleen <ak@linux.intel.com>
6581 David S. Miller <davem@davemloft.net>
6583 * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
6584 (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
6585 (ptrdiff_t): Check via AC_CHECK_TYPE.
6586 * config.in, configure: Rebuild.
6587 * system.h: Include stdint.h, if available.
6588 * lex.c (WORDS_BIGENDIAN): Provide default.
6589 (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
6590 acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
6591 search_line_sse2, search_line_sse42, init_vectorized_lexer,
6592 search_line_fast): New.
6593 (_cpp_clean_line): Use search_line_fast. Restructure the fast
6594 loop to make it clear when we're leaving the loop. Stay in the
6595 fast loop for non-trigraph '?'.
6597 2010-06-11 Jakub Jelinek <jakub@redhat.com>
6599 * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
6601 (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
6602 (cpp_macro_definition): Remove const qual from second argument.
6603 * macro.c (enter_macro_context): Call user_builtin_macro callback for
6604 NODE_BUILTIN !NODE_USED macros.
6605 (warn_of_redefinition): Likewise. Remove const qual from second
6607 (cpp_macro_definition): Likewise.
6608 * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
6609 for NODE_BUILTIN !NODE_USED macros.
6611 2010-06-10 Joseph Myers <joseph@codesourcery.com>
6613 * include/cpplib.h (struct cpp_options): Remove show_column.
6614 * init.c (cpp_create_reader, post_options): Don't set show_column.
6616 2010-06-09 Joern Rennecke <joern.rennecke@embecosm.com>
6619 * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
6620 check that C++ compiler works.
6621 * configure: Regenerate.
6623 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
6625 * include/symtab.h (ht_identifier_ptr): New.
6627 2010-06-03 Joern Rennecke <joern.rennecke@embecosm.com>
6628 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6631 * configure.ac: Check for declaration of 'basename(char *)'.
6632 * configure: Regenerate.
6633 * config.in: Regenerate.
6635 2010-04-25 Joseph Myers <joseph@codesourcery.com>
6637 * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
6638 * init.c (lang_defaults): Add entries for new language variants.
6639 (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
6642 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
6645 * files.c (report_missing_guard): Test for #pragma once.
6647 2010-04-07 Simon Baldwin <simonb@google.com>
6649 * directives.c (do_diagnostic): Add warning reason argument,
6650 call appropriate error reporting function for code.
6651 (directive_diagnostics): Call specific warning functions with
6652 warning reason where appropriate.
6653 (do_error, do_warning, do_pragma_dependency): Add warning reason
6654 argument to do_diagnostic calls.
6655 * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
6656 _cpp_create_definition): Call specific warning functions with
6657 warning reason where appropriate.
6658 * Makefile.in: Add new diagnostic functions to gettext translations.
6659 * include/cpplib.h (struct cpp_callbacks): Add warning reason code
6661 (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
6662 CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
6663 (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
6664 CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
6665 CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
6666 CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
6667 CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
6668 CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
6669 CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
6670 warning reason codes.
6671 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
6672 cpp_warning_with_line, cpp_pedwarning_with_line,
6673 cpp_warning_with_line_syshdr): New specific error reporting functions.
6674 * pch.c (cpp_valid_state): Call specific warning functions with
6675 warning reason where appropriate.
6676 * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
6677 diagnostic handlers.
6678 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
6679 cpp_warning_with_line, cpp_pedwarning_with_line,
6680 cpp_warning_with_line_syshdr): New specific error reporting functions.
6681 * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
6682 specific warning functions with warning reason where appropriate.
6683 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
6684 warn_about_normalization, lex_identifier_intern, lex_identifier,
6685 _cpp_lex_direct): Ditto.
6686 * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
6687 narrow_str_to_charconst): Ditto.
6689 2010-04-06 Jakub Jelinek <jakub@redhat.com>
6691 PR preprocessor/43642
6692 * lex.c (lex_raw_string): Change type of TYPE variable to
6695 2010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6697 * aclocal.m4: Regenerate.
6699 2010-03-29 Jason Merrill <jason@redhat.com>
6701 More N3077 raw string changes
6702 * charset.c (cpp_interpret_string): Don't transform UCNs in raw
6704 * lex.c (bufring_append): Split out from...
6705 (lex_raw_string): ...here. Undo trigraph and line splicing
6706 transformations. Do process line notes in multi-line literals.
6707 (_cpp_process_line_notes): Ignore notes that were already handled.
6709 Some raw string changes from N3077
6710 * charset.c (cpp_interpret_string): Change inner delimiters to ().
6711 * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter.
6713 2010-02-11 Jakub Jelinek <jakub@redhat.com>
6715 * init.c (read_original_filename): Don't call read_original_directory
6716 if _cpp_handle_directive returns 0.
6718 2010-01-01 Joseph Myers <joseph@codesourcery.com>
6720 PR preprocessor/41947
6721 * expr.c (cpp_classify_number): Give error for hexadecimal
6722 floating-point constant with no digits before or after point.
6724 2009-11-20 Arnaud Charlet <charlet@adacore.com>
6726 * macro.c (enter_macro_context): Call cb.used callback if defined.
6727 * directives.c (do_idef, do_ifndef): Ditto.
6728 * include/cpplib.h (struct cpp_callbacks): Add used callback.
6730 2009-11-11 Kai Tietz <kai.tietz@onevision.com>
6732 * directives.c (do_pragma_push_macro): New pragma handler.
6733 (do_pragma_pop_macro): Likewise.
6734 (_cpp_init_internal_pragmas): Add push_macro and
6735 pop_macro handler to internal pragmas.
6736 (lex_macro_node_from_str): Removed.
6737 (cpp_push_definition): Replace lex_macro_node_from_str
6738 by _cpp_lex_identifier.
6739 (cpp_pop_definition): Likewise.
6740 * internal.h (_cpp_lex_identifier): New prototype.
6741 (def_pragma_macro): New structure.
6742 (cpp_reader): New member pushed_macros.
6743 * lex.c (_cpp_lex_identifier): New function.
6744 (lex_identifier_intern): New function.
6745 * init.c (cpp_create_reader): Initialize pushed_macros
6747 (cpp_destroy): Free elements in pushed_macros member.
6748 * pch.c (_cpp_save_pushed_macros): New function.
6749 (_cpp_restore_pushed_macros): Likewise.
6750 (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
6751 (cpp_read_state): Use _cpp_restore_pushed_macros.
6753 2009-10-19 Jakub Jelinek <jakub@redhat.com>
6755 * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
6756 (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
6757 and char32_cset_desc.
6758 (converter_for_type): Handle CPP_UTF8STRING.
6759 (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
6760 * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
6761 (parse_include): Reject raw strings.
6762 * include/cpplib.h (CPP_UTF8STRING): New token type.
6763 * internal.h (struct cpp_reader): Add utf8_cset_desc field.
6764 * lex.c (lex_raw_string): New function.
6765 (lex_string): Handle u8 string literals, call lex_raw_string
6766 for raw string literals.
6767 (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
6769 * macro.c (stringify_arg): Handle CPP_UTF8STRING.
6771 2009-10-14 Jakub Jelinek <jakub@redhat.com>
6773 PR preprocessor/41543
6774 * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
6775 * line-map.c (linemap_init): Initialize highest_location and
6776 highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
6778 2009-10-09 Jason Merrill <jason@redhat.com>
6780 * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
6782 2009-10-09 Neil Vachharajani <nvachhar@google.com>
6784 * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
6787 2009-09-23 Loren J. Rittle <ljrittle@acm.org>
6789 * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
6790 * configure: Rebuilt.
6792 2009-09-22 Richard Guenther <rguenther@suse.de>
6795 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
6797 2009-09-18 Chris Demetriou <cgd@google.com>
6799 PR preprocessor/28435:
6800 * include/cpplib.h (struct cpp_options): Add new member
6801 deps.need_preprocessor_output.
6802 * files.c (open_file_failed): If preprocessor output is needed
6803 always report an error.
6805 2009-09-13 Kai Tietz <kai.tietz@onevision.com>
6807 * configure.ac: Set for i?86-w64-mingw*
6808 need_64bit_hwint to yes.
6809 * configure: Regenerated.
6811 2009-09-10 Jason Merrill <jason@redhat.com>
6813 * directives.c (cpp_define): constify.
6815 2009-09-02 Ian Lance Taylor <iant@google.com>
6817 * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
6819 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6821 * configure.ac (AC_PREREQ): Bump to 2.64.
6823 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6825 * aclocal.m4: Regenerate.
6826 * config.in: Regenerate.
6827 * configure: Regenerate.
6829 2009-08-17 Tom Tromey <tromey@redhat.com>
6831 PR preprocessor/41067:
6832 * charset.c (convert_escape): Add missing ":" to error text.
6834 2009-07-27 Douglas B Rupp <rupp@gnat.com>
6836 * include/cpplib.h (INO_T_CPP): New macro.
6837 (struct cpp_dir): Use it.
6839 2009-07-20 Jerry Quinn <jlquinn@optonline.net>
6842 * configure.ac: Use = instead of == for testing
6843 ENABLE_BUILD_WITH_CXX.
6844 * configure: Rebuild.
6846 2009-07-17 Jerry Quinn <jlquinn@optonline.net>
6848 * directives.c (do_linemarker, do_line): Use CPP_STRING for
6850 * files.c (find_file_in_dir): Add cast from void* to char*.
6851 * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
6852 * Makefile.in: (WARN_CFLAGS): Use general and C-specific
6854 (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
6855 ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
6856 COMPILER_FLAGS): New.
6857 (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
6858 (COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS
6859 instead of ALL_CFLAGS.
6860 * configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings
6861 from other warnings. Add -Wc++-compat to C-specific warnings.
6862 Check for --enable-build-with-cxx. Set and substitute
6863 ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES
6864 according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before
6866 * configure: Rebuild.
6867 * include/cpp-id-data.h: Remove extern "C".
6868 * include/line-map.h: Likewise.
6869 * include/mkdeps.h: Likewise.
6870 * include/symtab.h: Likewise.
6871 * internal.h: Likewise.
6873 2009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
6875 * directives.c (parse_include): Add location argument. Update all
6877 (parse_answer): Likewise.
6878 (do_include_common): Error with exact location.
6879 (parse_assertion): Likewise.
6881 2009-06-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
6883 * expr.c (num_div_op): Take explicit location.
6885 2009-06-17 Ian Lance Taylor <iant@google.com>
6887 * include/cpplib.h (progname): Don't declare.
6889 2009-06-12 Ian Lance Taylor <iant@google.com>
6891 * include/cpplib.h (struct cpp_options): Add
6892 warn_cxx_operator_names field.
6893 (NODE_WARN_OPERATOR): Define.
6894 (struct cpp_hashnode): Increase flags field to 10 bits, decrease
6896 * init.c (mark_named_operators): Add flags parameter.
6897 (cpp_post_options): Pick flags value to pass to
6898 mark_named_operators.
6899 * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
6900 identifier is an operator name in C++.
6902 2009-06-01 Aldy Hernandez <aldyh@redhat.com>
6904 * include/line-map.h (LAST_SOURCE_COLUMN): New.
6906 2009-06-01 Ian Lance Taylor <iant@google.com>
6908 * include/cpp-id-data.h: Add extern "C".
6909 * include/line-map.h: Likewise.
6910 * include/mkdeps.h: Likewise.
6911 * include/symtab.h: Likewise.
6912 * internal.h: Likewise.
6914 2009-05-15 Ian Lance Taylor <iant@google.com>
6916 * include/cpplib.h (enum cpp_builtin_type): Rename from enum
6917 builtin_type. Change all uses.
6919 2009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
6922 * directives (do_linemarker): Compensate for the increment in
6923 location that occurs when we reach the end of line.
6924 * files (_cpp_stack_include): Mention _cpp_find_file in the
6927 2009-05-10 Joseph Myers <joseph@codesourcery.com>
6929 * include/cpplib.h (enum cpp_token_fld_kind): Add
6930 CPP_TOKEN_FLD_TOKEN_NO.
6931 (struct cpp_macro_arg, struct cpp_identifier): Define.
6932 (union cpp_token_u): Use struct cpp_identifier for identifiers.
6933 Use struct cpp_macro_arg for macro arguments. Add token_no for
6934 CPP_PASTE token numbers.
6935 * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
6936 do_pragma_poison, parse_assertion): Use val.node.node in place of
6938 * expr.c (parse_defined, eval_token): Use val.node.node in place
6940 * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
6941 cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
6942 cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
6943 place of val.arg_no. Use val.node.node in place of val.node.
6944 * macro.c (replace_args, cpp_get_token, parse_params,
6945 lex_expansion_token, create_iso_definition, cpp_macro_definition):
6946 Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
6947 Use val.node.node in place of val.node.
6949 2009-05-03 Joseph Myers <joseph@codesourcery.com>
6951 * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
6954 2009-04-25 Joseph Myers <joseph@codesourcery.com>
6956 PR preprocessor/39559
6957 * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
6958 constants larger than intmax_t in C99 mode.
6960 2009-04-21 Taras Glek <tglek@mozilla.com>
6962 * include/cpp-id-data.h: Update GTY annotations to new syntax.
6963 * include/cpplib.h: Likewise.
6964 * include/line-map.h: Likewise.
6965 * include/symtab.h: Likewise.
6967 2009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
6970 * lex.c (cpp_type2name): Take a flags parameter. Call
6971 cpp_named_operator2name for named operators and cpp_digraph2name
6973 (cpp_digraph2name): New.
6974 (cpp_spell_token): Use it.
6975 (cpp_output_token): Likewise.
6976 * include/cpplib.h (cpp_type2name): Update declaration.
6977 * init.c (cpp_named_operator2name): New.
6978 * internal.h (cpp_named_operator2name): Declare.
6980 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
6983 * init.c (cpp_create_reader): Wlong_long is disabled by default.
6984 * expr.c (cpp_classify_number): Give different messages for C and
6987 2009-04-19 Joseph Myers <joseph@codesourcery.com>
6989 PR preprocessor/20078
6990 * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
6992 * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
6993 (struct cpp_token): Change flags to unsigned short.
6994 * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
6995 (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
6996 (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
6998 * macro.c (macro_real_token_count): New.
6999 (enter_macro_context, replace_args): Use macro_real_token_count.
7000 (create_iso_definition): Record whitespace surrounding and digraph
7001 spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
7002 Set extra_tokens and save CPP_PASTE tokens with arg_no set for
7003 multiple consecutive ## tokens.
7004 (_cpp_create_definition): Initialize extra_tokens.
7005 (cpp_macro_definition): Use macro_real_token_count.
7007 2009-04-18 Joseph Myers <joseph@codesourcery.com>
7009 * directives.c (parse_include): Pass true to check_eol.
7011 2009-04-18 Joseph Myers <joseph@codesourcery.com>
7013 PR preprocessor/39646
7014 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
7015 * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
7016 * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
7019 2009-04-18 Joseph Myers <joseph@codesourcery.com>
7021 PR preprocessor/39647
7022 * directives.c (check_eol): Add parameter expand.
7023 (do_undef, parse_include, do_line, do_linemarker, do_ident,
7024 do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
7025 do_else, do_endif, do_assert, do_unassert): All callers changed.
7026 Pass true from do_line, false elsewhere.
7028 2009-04-12 Joseph Myers <joseph@codesourcery.com>
7030 PR preprocessor/31869
7031 * macro.c (stringify_arg): Handle NULL source token in padding
7032 token where previous padding token did not have source token with
7033 preceding whitespace.
7035 2009-04-09 Jakub Jelinek <jakub@redhat.com>
7037 * Makefile.in: Change copyright header to refer to version
7038 3 of the GNU General Public License and to point readers at the
7039 COPYING3 file and the FSF's license web page.
7040 * charset.c: Likewise.
7041 * directives-only.c: Likewise.
7042 * directives.c: Likewise.
7043 * errors.c: Likewise.
7045 * files.c: Likewise.
7046 * identifiers.c: Likewise.
7047 * include/cpp-id-data.h: Likewise.
7048 * include/cpplib.h: Likewise.
7049 * include/line-map.h: Likewise.
7050 * include/mkdeps.h: Likewise.
7051 * include/symtab.h: Likewise.
7053 * internal.h: Likewise.
7055 * line-map.c: Likewise.
7056 * macro.c: Likewise.
7057 * makeucnid.c: Likewise.
7058 * mkdeps.c: Likewise.
7060 * symtab.c: Likewise.
7061 * system.h: Likewise.
7062 * traditional.c: Likewise.
7063 * ucnid.tab: Likewise.
7064 * ucnid.h: Regenerate.
7066 2009-04-01 Janis Johnson <janis187@us.ibm.com>
7069 * include/cpplib.h (CPP_N_DEFAULT): Define.
7070 * expr.c (interpret_float_suffix): Recognize d or D for double,
7071 return new value for default.
7072 (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
7075 * expr.c (interpret_float_suffix): Reject invalid suffix that uses
7076 letters from decimal float and fixed-point suffixes.
7078 2009-03-31 Joseph Myers <joseph@codesourcery.com>
7080 PR preprocessor/15638
7081 * files.c (_cpp_find_file): Call open_file_failed after diagnosing
7083 (open_file_failed): Make error for missing file fatal.
7084 * include/cpplib.h (CPP_DL_FATAL): Define.
7086 2009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net>
7088 PR preprocessor/31932:
7089 * internal.h: Don't mention HAVE_ICONV_H.
7090 * configure, config.in: Rebuild.
7091 * configure.ac: Don't check for iconv.h.
7093 2009-03-30 Tom Tromey <tromey@redhat.com>
7095 PR preprocessor/39512:
7096 * line-map.c (linemap_init): Initialize 'reallocator' field.
7098 2009-03-30 Jakub Jelinek <jakub@redhat.com>
7101 * macro.c (cpp_get_token): If macro_to_expand returns NULL
7102 and used some tokens, add CPP_PADDING before next token.
7104 2009-03-29 Joseph Myers <joseph@codesourcery.com>
7106 PR preprocessor/34695
7107 * makedepend.c: Remove.
7108 * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
7109 (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
7110 * directives.c (cpp_errors): Remove.
7111 * errors.c (print_location, _cpp_begin_message, v_message):
7113 (cpp_error, cpp_error_with_line): Always use error callback.
7114 (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
7115 * include/cpplib.h (cpp_options): Remove pedantic_errors,
7116 inhibit_warnings, warn_system_headers, inhibit_errors,
7117 warnings_are_errors, client_diagnostic.
7118 (cpp_callbacks): Add extra arguments to error callback; make it
7120 (cpp_finish): Return void.
7121 (cpp_destroy): Remove inaccurate comment about return value.
7122 (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
7123 (CPP_DL_NOTE): Define.
7124 * include/line-map.h (linemap_print_containing_files): Remove.
7125 * init.c (cpp_finish): Do not check for or return number of
7127 * internal.h (cpp_reader): Remove errors field.
7128 * line-map.c (linemap_print_containing_files): Remove.
7129 * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
7130 about previous definition. Only emit it if previous diagnostic
7133 2009-03-28 Joseph Myers <joseph@codesourcery.com>
7135 * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
7138 2009-03-18 Jakub Jelinek <jakub@redhat.com>
7140 * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
7142 2009-02-21 Joseph Myers <joseph@codesourcery.com>
7144 * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
7146 (_cpp_lex_direct): Handle this.
7148 2009-02-15 Richard Guenther <rguenther@suse.de>
7152 2009-02-13 Richard Guenther <rguenther@suse.de>
7154 * configure.ac: Enable LFS.
7155 * configure: Re-generate.
7156 * config.in: Likewise.
7158 2009-01-05 Ben Elliston <bje@au.ibm.com>
7160 * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
7161 (.po.pox): Likewise.
7162 (po/$(PACKAGE).pot): Likewise.
7164 2008-12-10 Alexandre Oliva <aoliva@redhat.com>
7167 * pch.c (cpp_valid_state): Improve message for poisoned symbols.
7168 Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
7170 2008-11-29 Joseph Myers <joseph@codesourcery.com>
7172 * lex.c (cpp_token_len): Use 6 as default length.
7174 2008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org>
7176 * expr.c (struct op): Add location.
7177 (_cpp_parse_expr): Propagate locations throught the stack
7180 (check_promotion): Use explicit location in errors.
7182 2008-10-05 Matthew Gingell <gingell@adacore.com>
7183 Arnaud Charlet <charlet@adacore.com>
7185 * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
7186 (cpp_get_comments): New function.
7187 * internal.h (struct cpp_reader): Add comments field.
7188 * init.c (cpp_destroy): Free comments.
7189 * lex.c (store_comment, cpp_get_comments): New functions.
7190 (comments): New struct.
7191 (save_comment): Store comments in comments struct.
7193 2008-09-18 Simon Baldwin <simonb@google.com>
7195 * include/cpplib.h (struct cpp_options): Add new boolean flag
7196 warn_builtin_macro_redefined.
7197 * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
7198 * (struct builtin_operator): Split out from previous struct builtin,
7199 enhance extra const correctness.
7200 * (struct builtin_macro): Split out from previous struct builtin, add
7201 new always_warn_if_redefined flag, enhance const correctness.
7202 * (mark_named_operators): Use struct builtin_operator.
7203 * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
7204 to builtins selectively.
7205 * macro.c (warn_of_redefinition): Return false if a builtin macro
7206 is not flagged with NODE_WARN.
7208 2008-07-31 Jakub Jelinek <jakub@redhat.com>
7210 PR preprocessor/36649
7211 * files.c (struct report_missing_guard_data): New type.
7212 (report_missing_guard): Put paths into an array instead of printing
7213 them right away. Return 1 rather than 0.
7214 (report_missing_guard_cmp): New function.
7215 (_cpp_report_missing_guards): Sort and print paths gathered by
7216 report_missing_guard callback.
7218 2008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
7221 * directives.c (strtolinenum): Handle overflow.
7222 (do_line): Give a warning if line number overflowed.
7223 (do_linemarker): Update call to strtolinenum.
7225 2008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
7227 * include/line-map.h (linenum_type): New typedef.
7228 (struct line_map): Use it.
7229 (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
7230 (SOURCE_COLUMN): Likewise.
7231 * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
7232 source_location values in a variable of type linenum_type.
7233 * directives.c (struct if_stack): Use linenum_type.
7234 (strtoul_for_line): Rename as strtolinenum.
7235 (do_line): Use linenum_type.
7236 (do_linemarker): Use linenum_type and strtolinenum.
7237 (_cpp_do_file_change): Use linenum_t.
7238 * line-map.c (linemap_add): Likewise.
7239 (linemap_line_start): Likewise.
7240 * traditional.c (struct fun_macro): 'line' is a source_location.
7241 * errors.c (print_location): Use linenum_type.
7242 * directives-only.c (_cpp_preprocess_dir_only): Likewise.
7243 * internal.h (CPP_INCREMENT_LINE): Likewise.
7244 * lex.c (_cpp_skip_block_comment): Use source_location.
7246 2008-07-14 Ben Elliston <bje@au.ibm.com>
7248 * include/cpplib.h (NODE_CONDITIONAL): New.
7249 (struct cpp_callbacks): New macro_to_expand field.
7250 (struct cpp_hashnode): Adjust size of flags and type fields.
7251 (cpp_peek_token): Prototype.
7252 * lex.c (cpp_peek_token): New function.
7253 (_cpp_temp_token): Protect pre-existing lookaheads.
7254 * macro.c (cpp_get_token): Expand any conditional macros.
7255 (_cpp_backup_tokens_direct): New.
7256 (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
7257 (warn_of_redefinition): Silently allow redefined conditional
7259 (_cpp_create_definition): Remove the conditional flag when a user
7260 defines one of the conditional macros.
7261 * internal.h (_cpp_backup_tokens_direct): New prototype.
7263 2008-06-13 Andrew Haley <aph@redhat.com>
7265 PR preprocessor/33305
7266 * macro.c (replace_args): Print a warning for empty macro
7267 arguments in C89 and C++.
7269 2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7271 * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
7272 * configure: Regenerate.
7274 2008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7276 * Makefile.in (datarootdir): New variable.
7278 2008-06-12 H.J. Lu <hongjiu.lu@intel.com>
7280 PR preprocessor/36479
7281 * charset.c (cpp_interpret_string_notranslate): Also set
7282 narrow_cset_desc.width.
7284 2008-06-07 Joseph Myers <joseph@codesourcery.com>
7286 * configure.ac (parisc*64*-*-*): Remove.
7287 * configure: Regenerate.
7289 2008-05-30 Tom Tromey <tromey@redhat.com>
7291 PR preprocessor/36320:
7292 * internal.h (_cpp_parse_expr): Update.
7293 * expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error
7295 * directives.c (do_if): Update.
7296 (do_elif): Require expression if processing group.
7298 2008-05-30 Danny Smith <dannysmith@users.sourceforge.net>
7300 * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
7302 2008-05-21 Tom Tromey <tromey@redhat.com>
7304 PR preprocessor/27777:
7305 * lex.c (cpp_output_line_to_string): New function.
7306 * internal.h (_cpp_begin_message): Don't declare.
7307 * errors.c (_cpp_begin_message): Now static.
7308 * include/cpplib.h (cpp_output_line_to_string): Declare.
7309 * directives.c (do_diagnostic): Rewrote. Use
7310 cpp_output_line_to_string. Don't use _cpp_begin_message.
7312 2008-05-21 Tom Tromey <tromey@redhat.com>
7314 * include/symtab.h (HT_ALLOCED): Remove.
7315 (ht_purge): Declare.
7316 * symtab.c (DELETED): New define.
7317 (ht_lookup): Update comment.
7318 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED
7319 code. Use subobject allocator for strings, if it exists.
7320 (ht_expand): Handle deleted entries.
7321 (ht_forall): Likewise.
7322 (ht_purge): New function.
7323 (ht_dump_statistics): Print deletion statistics.
7325 2008-05-13 Tom Tromey <tromey@redhat.com>
7327 PR preprocessor/22168:
7328 * include/cpplib.h (struct cpp_options) <objc>: Update
7330 * expr.c (eval_token): Warn for use of assertions.
7331 * directives.c (directive_diagnostics): Warn about extensions.
7332 (DEPRECATED): New define.
7333 (DIRECTIVE_TABLE): Use it.
7335 2008-05-06 Tom Tromey <tromey@redhat.com>
7337 PR preprocessor/35313, PR preprocessor/36088:
7338 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
7339 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
7341 2008-05-04 David S. Miller <davem@davemloft.net>
7343 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
7344 * configure: Regenerate.
7346 2008-04-22 Daniel Franke <franke.daniel@gmail.com>
7348 * include/cpplib.h (cpp_define_formatted): New.
7349 * directives.c (cpp_define_formatted): New.
7351 2008-04-21 Tom Tromey <tromey@redhat.com>
7354 * charset.c (_cpp_convert_input): Add buffer_start argument.
7355 Ignore UTF-8 BOM if seen.
7356 * internal.h (_cpp_convert_input): Add argument.
7357 * files.c (struct _cpp_file) <buffer_start>: New field.
7358 (destroy_cpp_file): Free buffer_start, not buffer.
7359 (_cpp_pop_file_buffer): Likewise.
7360 (read_file_guts): Update.
7362 2008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
7364 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
7365 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
7366 (struct cpp_options): Added uliterals.
7367 (cpp_interpret_string): Update prototype.
7368 (cpp_interpret_string_notranslate): Idem.
7369 * charset.c (init_iconv_desc): New width member in cset_converter.
7370 (cpp_init_iconv): Add support for char{16,32}_cset_desc.
7371 (convert_ucn): Idem.
7372 (emit_numeric_escape): Idem.
7373 (convert_hex): Idem.
7374 (convert_oct): Idem.
7375 (convert_escape): Idem.
7376 (converter_for_type): New function.
7377 (cpp_interpret_string): Use converter_for_type, support u and U prefix.
7378 (cpp_interpret_string_notranslate): Match changed prototype.
7379 (wide_str_to_charconst): Use converter_for_type.
7380 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
7381 * directives.c (linemarker_dir): Macro U changed to UC.
7382 (parse_include): Idem.
7383 (register_pragma_1): Idem.
7384 (restore_registered_pragmas): Idem.
7385 (get__Pragma_string): Support CPP_STRING{16,32}.
7386 * expr.c (eval_token): Support CPP_CHAR{16,32}.
7387 * init.c (struct lang_flags): Added uliterals.
7388 (lang_defaults): Idem.
7389 * internal.h (struct cset_converter) <width>: New field.
7390 (struct cpp_reader) <char16_cset_desc>: Idem.
7391 (struct cpp_reader) <char32_cset_desc>: Idem.
7392 * lex.c (digraph_spellings): Macro U changed to UC.
7394 (lex_string): Add support for u'...', U'...', u"..." and U"...".
7395 (_cpp_lex_direct): Idem.
7396 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
7397 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
7399 2008-04-18 Paolo Bonzini <bonzini@gnu.org>
7402 * aclocal.m4: Regenerate.
7403 * configure: Regenerate.
7405 2008-04-17 Tom Tromey <tromey@redhat.com>
7408 * errors.c (cpp_error): Don't reference a token before the start
7411 2008-04-16 Tom Tromey <tromey@redhat.com>
7413 * Makefile.in (TAGS_SOURCES): New variable.
7416 2008-04-11 Kaz Kojima <kkojima@gcc.gnu.org>
7418 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
7420 * configure: Rebuilt.
7422 2008-04-02 Joseph Myers <joseph@codesourcery.com>
7424 * include/cpplib.h (struct cpp_callbacks): Add used_define,
7425 used_undef and before_define.
7426 (NODE_USED): Define.
7427 * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
7428 do_ifndef, cpp_pop_definition): Handle new flag and use new
7430 * expr.c (parse_defined): Handle new flag and use new callbacks.
7431 * macro.c (enter_macro_context, _cpp_free_definition): Handle new
7432 flag and use new callbacks.
7434 2008-04-01 Jakub Jelinek <jakub@redhat.com>
7437 * files.c (struct _cpp_file): Remove pch field.
7438 (pch_open_file): Don't set file->pch, just file->pchname.
7439 (should_stack_file): After pfile->cb.read_pch call
7440 free pchname and clear pchname, don't close file->fd.
7441 Test file->pchname instead of file->pch. Don't close fd after cb.
7442 (_cpp_stack_include): Test file->pchname instead of file->pch.
7444 2008-03-28 Tom Tromey <tromey@redhat.com>
7446 * Makefile.in (POSTCOMPILE): New variable.
7449 2008-03-13 Tom Tromey <tromey@redhat.com>
7452 * directives.c (destringize_and_run): Set pfile->directive.
7454 2008-03-06 Markus Milleder <markus.milleder@generali.at>
7456 PR preprocessor/35458
7457 * mkdeps.c (munge): Quote '#' with a '\'.
7459 2008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7461 PR preprocessor/35379
7462 * mkdeps.c (deps_write): Ensure the first target always appears
7463 in the first column, without leading backslash newline. Avoid
7464 some more extra whitespace.
7466 2008-02-25 Thiemo Seufer <ths@mips.com>
7468 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
7470 2008-02-19 Tom Tromey <tromey@redhat.com>
7472 * traditional.c (lex_identifier): Use CPP_HASHNODE.
7473 * lex.c (lex_identifier): Use CPP_HASHNODE.
7474 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
7476 * identifiers.c (alloc_node): Change return type.
7477 (_cpp_init_hashtable): Don't cast 'alloc_node'.
7478 (proxy_assertion_broken): New declaration.
7479 (cpp_forall_identifiers): Move comment.
7480 * line-map.c (linemap_add): Comment fix.
7481 (linemap_line_start): Indentation fix.
7483 2008-01-25 Jakub Jelinek <jakub@redhat.com>
7485 PR preprocessor/34692
7486 * macro.c (collect_args): Add pragma_buff argument. Push
7487 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
7488 than into arguments. Reset prevent_expansion and parsing_args
7489 state at CPP_PRAGMA_EOL/CPP_EOF.
7490 (funlike_invocation_p): Add pragma_buff argument, pass it through
7492 (enter_macro_context): Add result argument. Adjust
7493 funlike_invocation_p caller. Emit all deferred pragma tokens
7494 gathered during collect_args before the expansion, add a padding
7495 token. Return 2 instead of 1 if any pragma tokens were prepended.
7496 (cpp_get_token): If enter_macro_context returns 2, don't return
7497 a padding token, instead cycle to grab CPP_PRAGMA token.
7498 * directives.c (_cpp_handle_directive): If was_parsing_args
7499 in deferred pragma, leave parsing_args and prevent_expansion as is.
7501 2008-01-22 Tom Tromey <tromey@redhat.com>
7504 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
7505 __STDC_CONSTANT_MACROS.
7507 2008-01-07 Fred Fish <fnf@specifix.com>
7509 PR preprocessor/30363
7510 * traditional.c (replace_args_and_push): Add local variable
7511 cxtquote, calculate the replacement text size assuming a
7512 worst case of every input character quoted with backslash,
7513 and properly handle output quoting of quote characters in
7514 actual arguments used in function-like macros.
7516 2008-01-03 Tom Tromey <tromey@redhat.com>
7518 PR preprocessor/34602
7519 * directives.c (do_line): Don't try to spell EOF token.
7520 (do_linemarker): Add comment.
7522 2007-12-11 DJ Delorie <dj@redhat.com>
7524 * charset.c (convert_using_iconv): Close out any shift states,
7525 returning to the initial state.
7527 2007-12-06 Tom Tromey <tromey@redhat.com>
7530 * internal.h (struct cpp_reader) <file_hash_entries>: Changed
7532 <file_hash_entries_allocated, file_hash_entries_used>: Removed.
7533 * files.c (FILE_HASH_POOL_SIZE): New macro.
7534 (struct file_hash_entry_pool): New.
7535 (destroy_all_cpp_files): New function.
7536 (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
7537 (new_file_hash_entry): Update.
7538 (free_file_hash_entries): New function.
7539 (_cpp_cleanup_files): Call free_file_hash_entries and
7540 destroy_all_cpp_files.
7541 (cpp_clear_file_cache): New function.
7542 * include/cpplib.h (cpp_clear_file_cache): Declare.
7544 2007-12-03 Tom Tromey <tromey@redhat.com>
7546 PR preprocessor/34288
7547 * configure.ac, config.in: Rebuilt.
7548 * configure.ac: Check for ssize_t.
7550 2007-11-30 Tom Tromey <tromey@redhat.com>
7552 PR preprocessor/32868
7553 * macro.c (_cpp_create_definition): Special case
7554 __STDC_FORMAT_MACROS.
7556 2007-11-16 Michael Matz <matz@suse.de>
7558 * files.c (search_path_head): Fix check for absolute paths.
7560 2007-11-11 Tom Tromey <tromey@redhat.com>
7563 * include/cpplib.h (cpp_included_before): Declare.
7564 * files.c (struct file_hash_entry) <location>: New field.
7565 (_cpp_find_file): Initialize new field.
7566 (make_cpp_dir): Likewise.
7567 (cpp_included_before): New function.
7569 2007-11-01 Tom Tromey <tromey@redhat.com>
7571 PR preprocessor/30805
7572 * macro.c (paste_tokens): Handle padding token.
7573 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
7575 2007-10-31 Tom Tromey <tromey@redhat.com>
7577 PR preprocessor/30786
7578 * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
7579 * directives.c (_cpp_do__Pragma): Return error status.
7580 * internal.h (_cpp_do__Pragma): Update.
7581 * directives.c (get__Pragma_string): Back up if EOF seen.
7583 2007-09-06 Tom Tromey <tromey@redhat.com>
7585 * internal.h (struct cpp_reader) <invocation_location>: New
7587 (struct cpp_reader) <set_invocation_location>: Likewise.
7588 * init.c (cpp_set_line_map): New function.
7589 * line-map.c (linemap_add): Use linemap's allocator.
7590 * include/line-map.h (GTY): Define.
7591 (line_map_realloc): New typedef.
7592 (struct line_map): Mark with GTY.
7593 (struct line_maps): Likewise.
7594 (struct line_maps) <maps>: Likewise.
7595 (struct line_maps) <reallocator>: New field.
7596 * include/symtab.h (GTY): Conditionally define.
7597 * include/cpplib.h (cpp_set_line_map): Declare.
7598 (cpp_get_token_with_location): Declare.
7599 * macro.c (cpp_get_token): Set invocation_location on the reader.
7600 (cpp_get_token_with_location): New function.
7602 2007-08-30 Chao-ying Fu <fu@mips.com>
7604 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
7605 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
7606 (cpp_classify_number): Support decimal fixed-point constants without
7608 Warn about fixed-point constants when -pedantic.
7609 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
7610 comments to support fixed-point values.
7611 (CPP_N_FRACT, CPP_N_ACCUM): Define.
7613 2007-08-18 Tom Tromey <tromey@redhat.com>
7615 PR preprocessor/32974
7616 * directives.c (parse_include): Don't check for EOL when
7617 processing #pragma dependency.
7619 2007-07-30 Ollie Wild <aaw@google.com>
7621 * directives-only.c: New file.
7622 * internal.h (struct _cpp_dir_only_callbacks): New.
7623 (_cpp_preprocess_dir_only): New function.
7624 * directives.c (_cpp_handle_directive): Check directives_only before
7625 disabling execution of indented directives.
7626 * files.c (_cpp_stack_file): Add directives_only check.
7627 * include/cpplib.h (struct cpp_options): Add directives_only.
7628 (cpp_init_special_builtins): New function.
7629 * init.c (cpp_init_special_builtins): New function.
7630 (cpp_init_builtins): Move builtin_array initialization to
7631 cpp_init_special_builtins.
7632 (post_options): Check directives_only before setting
7633 pfile->state.prevent_expansion = 1.
7634 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
7635 is expanded inside a directive while -fdirectives-only is enabled.
7636 * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
7637 (libcpp_a_SOURCES): Add directives-only.c.
7639 2007-07-04 Uros Bizjak <ubizjak@gmail.com>
7641 * traditional.c (_cpp_scan_out_logical_line): Initialize
7642 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
7643 fmacro.args to prevent 'may be used uninitialized' warning.
7645 2007-07-03 Uros Bizjak <ubizjak@gmail.com>
7647 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
7649 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
7650 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
7651 for 'q' or 'Q' suffixes.
7653 2007-06-17 Danny Smith <dannysmith@users.sourceforge.net
7655 * files.c (open_file): Correct typo.
7657 2007-06-16 Vladimir Prus <vladimir@codesourcery.com>
7659 * files.c (open_file): Prevent the call
7660 for stat from overwriting errno.
7662 2007-06-09 Vladimir Prus <vladimir@codesourcery.com>
7664 * files.c (open_file): Account for the
7665 fact that on windows, opening a directory gives
7668 2007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
7670 PR preprocessor/23479
7671 * expr.c (cpp_classify_number): Implement 0b-prefixed binary
7673 (append_digit): Likewise.
7674 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
7675 binary integer constants.
7677 2007-05-31 Dave Korn <dave.korn@artimi.com>
7679 PR preprocessor/14331
7680 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
7682 2007-05-24 Ollie Wild <aaw@google.com>
7684 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
7685 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
7686 (cpp_write_pch_state): Save __COUNTER__ state.
7687 (cpp_valid_state): Check valid __COUNTER__ state.
7688 (cpp_read_state): Read new __COUNTER__ state.
7689 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
7690 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
7691 * internal.h (struct cpp_reader): Add counter member.
7693 2007-05-23 Simon Martin <simartin@users.sourceforge.net>
7695 PR preprocessor/20077
7696 * macro.c (create_iso_definition): Fixed the method to determine
7697 whether the token-pasting operator appears at the beginning or the end
7700 2007-05-21 Ian Lance Taylor <iant@google.com>
7702 * internal.h (struct cpp_reader): Add new fields:
7703 nonexistent_file_hash and nonexistent_file_ob.
7704 * files.c: Include "obstack.h".
7705 (find_file_in_dir): Before trying to open the file, look up the
7706 path name in the hash table of nonexistent files. After failing
7707 to open the file, add the path name to the hash table.
7708 (_cpp_find_file): Cache the results of looking up the file name
7709 starting with the quote and bracket chain heads, if we can.
7710 (nonexistent_file_hash_eq): New static function.
7711 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
7712 pfile->nonexistent_file_ob.
7713 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
7714 pfile->nonexistent_file_ob.
7716 2007-05-14 Janis Johnson <janis187@us.ibm.com>
7718 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
7721 * expr.c (interpret_float_suffix): Check for invalid suffix.
7723 2007-05-02 Eric Christopher <echristo@apple.com>
7725 * expr.c (num_div_op): Don't overflow if the result is
7728 2007-05-02 Tom Tromey <tromey@redhat.com>
7730 PR preprocessor/28709
7731 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
7733 2007-03-30 Michael Meissner <michael.meissner@amd.com>
7735 * directives.c (lex_macro_node_from_str): Fix alloca call to be
7738 2007-03-30 Richard Henderson <rth@redhat.com>
7740 * directives.c (lex_macro_node_from_str): New.
7741 (cpp_push_definition, cpp_pop_definition): New.
7742 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
7744 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
7746 * Makefile.in: Add dummy install-pdf target.
7748 2007-01-30 Tom Tromey <tromey@redhat.com>
7750 PR preprocessor/30468
7751 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
7754 2007-01-30 Tom Tromey <tromey@redhat.com>
7756 PR preprocessor/29966
7757 * macro.c (lex_expansion_token): Save and restore cpp_reader's
7759 (_cpp_create_definition): Don't restore cur_token here.
7760 * lex.c (_cpp_lex_token): Added assertion.
7762 2007-01-27 Tom Tromey <tromey@redhat.com>
7764 * configure: Rebuilt.
7766 2007-01-12 Tom Tromey <tromey@redhat.com>
7768 PR preprocessor/28227
7769 * directives.c (lex_macro_node): Added 'is_def_or_undef'
7771 (do_define): Update.
7774 (do_ifndef): Update.
7776 2007-01-11 Paolo Bonzini <bonzini@gnu.org>
7778 * configure: Regenerate.
7780 2007-01-11 Paolo Bonzini <bonzini@gnu.org>
7782 * configure: Regenerate.
7784 2007-01-04 Tom Tromey <tromey@redhat.com>
7786 PR preprocessor/28165
7787 * internal.h (cpp_in_primary_file): New function.
7788 * directives.c (do_include_next): Use cpp_in_primary_file.
7789 (do_pragma_once): Likewise.
7790 (do_pragma_system_header): Likewise.
7792 2006-12-29 Ian Lance Taylor <iant@google.com>
7794 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
7795 look backward at the end of the line unless we saw a backslash.
7797 2006-12-29 Jakub Jelinek <jakub@redhat.com>
7799 PR preprocessor/29612
7800 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
7801 only when new_sysp is non-zero.
7803 2006-12-28 Tom Tromey <tromey@redhat.com>
7805 PR preprocessor/30001
7806 * charset.c (_cpp_convert_input): Check that to.len is greater
7809 2006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
7811 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
7812 * configure: Rebuilt.
7814 2006-11-01 Douglas Gregor <doug.gregor@gmail.com>
7816 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
7817 for experimental C++0x mode.
7818 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
7819 adopted the preprocessor changes introduced in C99.
7821 2006-10-29 Joseph Myers <joseph@codesourcery.com>
7823 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
7824 depending on --enable-targets=all.
7825 * configure: Regenerate.
7827 2006-10-12 Jakub Jelinek <jakub@redhat.com>
7829 PR preprocessor/28709
7830 * macro.c (paste_tokens): Do error reporting here, use BUF with the
7831 spelled LHS token as opposed to spelling it again.
7832 (paste_all_tokens): Don't report errors here, just break on failure.
7834 2006-10-10 Brooks Moses <bmoses@stanford.edu>
7836 * Makefile.in: Added empty "pdf" target.
7838 2006-09-22 Geoffrey Keating <geoffk@apple.com>
7840 * configure.ac: Make need_64_bit_hwint case for x86-darwin
7841 match exactly the glob in gcc/config.gcc.
7842 * configure: Regenerate.
7844 2006-09-13 Joseph S. Myers <joseph@codesourcery.com>
7847 PR preprocessor/14634
7848 * lex.c (lex_string): Pedwarn for unterminated literals.
7850 2006-09-08 Eric Christopher <echristo@apple.com>
7852 * configure.ac: Add 64-bit HWI support for i?86-darwin.
7854 2006-08-14 Steve Ellcey <sje@cup.hp.com>
7858 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
7859 (CPP_LAST_EQ): Change.
7860 (CPP_LAST_PUNCTUATOR): Change.
7861 * expr.c (cpp_operator): Remove MIN and MAX.
7862 (reduce): Remove CPP_MIN and CPP_MAX.
7863 (num_binary_op): Ditto.
7864 * lex.c (_cpp_lex_direct): Ditto.
7865 (cpp_avoid_paste): Remove ? as legal symbol after > or <.
7867 2006-06-09 Jakub Jelinek <jakub@redhat.com>
7869 PR preprocessor/27746
7870 * directives.c (do_pragma): Handle pragma with valid namespace
7871 and invalid name coming from macro expansion.
7872 * directives.c (destringize_and_run): Initialize next field in
7877 * directives.c (destringize_and_run): Set NO_EXPAND on the
7880 * macro.c (_cpp_backup_tokens): Fix comment typo.
7882 2006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
7884 * Makefile.in (CATALOGS): Add po/ prefix.
7885 * configure: Regenerated.
7887 2006-05-23 Carlos O'Donell <carlos@codesourcery.com>
7889 * Makefile.in: Add install-html target. Add install-html to .PHONY
7891 2006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
7893 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
7894 * files.c (_cpp_get_file_stat): New function.
7895 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
7896 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
7897 * internal.h (_cpp_get_file_stat): Prototype.
7898 (struct cpp_buffer): Add timestamp.
7900 2006-01-23 Jakub Jelinek <jakub@redhat.com>
7902 PR preprocessor/25717
7903 * init.c (cpp_init_builtins): If __STDC__ will not change value
7904 between system headers and other sources, define it as a normal
7905 macro rather than a builtin.
7906 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
7907 cpp_in_system_header condition.
7909 2006-01-05 Paolo Bonzini <bonzini@gnu.org>
7911 * Makefile.in: Use -MMD instead of -MD.
7913 2006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
7914 Richard Henderson <rth@redhat.com>
7916 Merge from gomp branch:
7917 * directives.c (struct pragma_entry): Add is_deferred. Add ident
7918 entry to value union.
7919 (end_directive): Don't eat the line if in_deferred_pragma.
7920 (run_directive): Remove pragma hacks.
7921 (insert_pragma_entry): Remove.
7922 (new_pragma_entry): New.
7923 (register_pragma_1): Split out of register_pragma. Only handle
7924 the lookup tree and return the new entry.
7925 (cpp_register_pragma): Fill in the pragma entry here.
7926 (cpp_register_deferred_pragma): New.
7927 (register_pragma_internal): New.
7928 (_cpp_init_internal_pragmas): Use register_pragma_internal.
7929 (do_pragma): Allow pragma expansion after namespace. For deferred
7930 pragmas, don't slurp the line into a string.
7931 (destringize_and_run): Save tokens for deferred pragmas.
7932 (cpp_handle_deferred_pragma): Remove.
7933 * macro.c (builtin_macro): Remove pragma token hack.
7934 (_cpp_push_token_context): Rename from push_token_context and export.
7935 * internal.h (struct lexer_state): Add pragma_allow_expansion.
7936 (_cpp_push_token_context): Declare.
7937 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
7938 a token. Update the line number correctly if so.
7939 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
7940 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
7941 * include/cpplib.h (PRAGMA_EOL): New.
7942 (CPP_TOKEN_FLD_PRAGMA): New.
7943 (struct cpp_token): Add val.pragma.
7944 (struct cpp_options): Remove defer_pragmas.
7945 (cpp_handle_deferred_pragma): Remove.
7946 (cpp_register_deferred_pragma): Declare.
7948 2006-01-01 Jakub Jelinek <jakub@redhat.com>
7951 * directives.c (do_pragma): If pragma line ends with multi-line
7952 block comment, end the saved deferred pragma string before that
7953 comment. Handle embedded '\0' chars on the pragma line.
7955 2005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
7958 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
7960 2005-12-07 Jon Grimm <jgrimm2@us.ibm.com>
7961 Ben Elliston <bje@au.ibm.com>
7963 * include/cpplib.h (CPP_N_DFLOAT): New.
7964 * expr.c (interpret_float_suffix): Identify df, dd, and dl
7965 suffixes as decimal floating point constants.
7966 (cpp_classify_number): Disallow hexadecimal DFP constants.
7968 2005-11-14 Gerald Pfeifer <gerald@pfeifer.com>
7969 Ian Lance Taylor <ian@airs.com>
7971 * include/cpplib.h (struct cpp_callbacks): Annotate error with
7972 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
7974 2005-11-09 Per Bothner <per@bothner.com>
7975 Uros Bizjak <uros@kss-loka.si>
7978 * init.c (read_original_filename): Temporarily set
7979 state.in_directive before calling _cpp_lex_direct for
7982 2005-11-03 James E Wilson <wilson@specifix.com>
7984 PR preprocessor/24202
7985 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
7987 2005-11-04 Joseph S. Myers <joseph@codesourcery.com>
7989 * include/cpplib.h (struct cpp_callbacks): Make error take
7991 * errors.c (cpp_error): Update call to callback.
7993 2005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
7995 PR preprocessor/22042
7996 * macro.c (_cpp_builtin_macro_text): Lower the needed max
7998 (cpp_quote_string): Don't octalify non printable
8001 2005-11-03 Joseph S. Myers <joseph@codesourcery.com>
8004 * include/cpplib.h (struct cpp_options): Add client_diagnostic.
8005 (struct cpp_callbacks): Add error.
8006 * errors.c (cpp_error): If client_diagnostic, use error callback.
8007 * charset.c (convert_escape): Don't use %03o in diagnostic.
8009 2005-10-21 James E Wilson <wilson@specifix.com>
8011 PR preprocessor/15220
8012 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all
8013 callers. Pass to open_file_failed.
8014 (open_file_failed): New parameter angle_brackets. Fix all callers.
8015 Use in print_dep assignment.
8016 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
8017 * internal.h (_cpp_find_file): Add new parm to declaration.
8019 2005-10-08 Kazu Hirata <kazu@codesourcery.com>
8021 * configure.ac: Require 64-bit int for arm*-*-*eabi*.
8022 * configure: Regenerate.
8024 2005-10-04 Ian Lance Taylor <ian@airs.com>
8026 PR preprocessor/13726
8027 * directives.c (check_eol_return_comments): New static function.
8028 (parse_include): Add buf parameter. Change all callers.
8029 (do_include_common): If not discard comments, turn on
8030 save_comments. Pass collected comments to include callback.
8031 * include/cpplib.h (struct cpp_callbacks): Add new parameter to
8032 include callback: cpp_token list.
8034 2005-09-20 Joseph S. Myers <joseph@codesourcery.com>
8036 * include/cpplib.h (struct cpp_options): Add extended_identifiers.
8037 * init.c (struct lang_flags, lang_defaults): Add
8038 extended_identifiers.
8039 (cpp_set_lang): Use it.
8040 * lex.c (forms_identifier_p): Check extended_identifiers.
8042 2005-08-30 Jakub Jelinek <jakub@redhat.com>
8044 PR preprocessor/20348
8045 PR preprocessor/20356
8046 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
8049 2005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8051 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
8052 -Wmissing-format-attribute.
8054 * configure: Regenerate.
8056 2005-06-29 Kelley Cook <kcook@gcc.gnu.org>
8058 * all files: Update FSF address in copyright headers.
8059 * makeucnid.c (write_copyright): Update outputted FSF address.
8061 2005-06-13 Zack Weinberg <zack@codesourcery.com>
8063 * configure.ac: Invoke ZW_CREATE_DEPDIR and
8064 ZW_PROG_COMPILER_DEPENDENCIES.
8065 * aclocal.m4, configure: Regenerate.
8066 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
8068 (distclean): Clean up $(DEPDIR) and its contents.
8069 (.c.o): Use $(COMPILE).
8070 Include $(DEPDIR)/*.Po for most object->header dependencies.
8072 2005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
8074 * configure.ac: Check declarations for asprintf and vasprintf.
8075 * config.in: Regenerate.
8076 * configure: Likewise.
8078 * charset.c (conversion_loop): Use XRESIZEVEC.
8079 (convert_no_conversion): Likewise.
8080 (convert_using_iconv): Likewise.
8081 (init_iconv_desc): Cast return value of alloca.
8082 (cpp_host_to_exec_charset): Use XNEWVEC.
8083 (emit_numeric_escape): Use XRESIZEVEC.
8084 (cpp_interpret_string): Use XNEWVEC.
8085 (cpp_interpret_string): Use XRESIZEVEC.
8086 (_cpp_interpret_identifier): Cast return value of alloca.
8087 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
8088 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
8089 (parse_include): Use XNEWVEC.
8090 (insert_pragma_entry): Rename local variable "new" to
8092 (save_registered_pragmas): Cast return value of xmemdup.
8093 (destringize_and_run): Same for alloca.
8094 (parse_assertion): Likewise.
8095 (do_assert): Cast allocated storage to proper type.
8096 (cpp_define): Likewise.
8097 (_cpp_define_builtin): Likewise.
8098 (cpp_undef): Likewise.
8099 (handle_assertion): Likewise.
8100 (cpp_push_buffer): Rename local variable "new" to "new_buffer".
8101 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
8102 (CPP_UMINUS): Likewise.
8103 (struct cpp_operator): Rename from struct operator.
8104 (_cpp_expand_op_stack): Use XRESIZEVEC.
8105 * files.c (pch_open_file): Use XNEWVEC.
8106 (pch_open_file): Use XRESIZEVEC.
8107 (read_file_guts): Use XNEWVEC and XRESIZEVEC.
8108 (dir_name_of_file): Use XNEWVEC.
8109 (make_cpp_file): Use XCNEW.
8110 (make_cpp_dir): Likewise.
8111 (allocate_file_hash_entries): USE XNEWVEC.
8112 (cpp_included): Cast return value of htab_find_with_hash.
8113 (append_file_to_dir): Use XNEWVEC.
8114 (read_filename_string): Likewise. Use XRESIZEVEC too.
8115 (read_name_map): Cast return value of alloca. Use XRESIZEVEC.
8116 (remap_filename): Use XNEWVEC.
8117 (struct pchf_entry): Move definition out of struct pchf_data.
8118 (_cpp_save_file_entries): Use XCNEWVAR.
8119 (_cpp_read_file_entries): Use XNEWVAR.
8120 * identifiers.c (alloc_node): Use XOBNEW.
8121 * init.c (cpp_create_reader): Use XCNEW.
8122 (cpp_init_builtins): Cast of b->value to enum builtin_type.
8123 (read_original_directory): Cast return value of alloca.
8124 * lex.c (add_line_note): Use XRESIZEVEC.
8125 (warn_about_normalization): Use XNEWVEC.
8126 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
8127 (new_buff): Use XNEWVEC.
8128 * line-map.c (linemap_add): Use XRESIZEVEC.
8129 * macro.c (builtin_macro): Cast return value of alloca.
8130 (paste_tokens): Likewise.
8131 (expand_arg): Use XNEWVEC and XRESIZEVEC.
8132 (_cpp_save_parameter): Use XRESIZEVEC.
8133 (create_iso_definition): Cast allocated storage to proper type.
8134 (_cpp_create_definition): Likewise.
8135 (cpp_macro_definition): Use XRESIZEVEC.
8136 * makedepend.c (add_clm): Use XNEW.
8137 (add_dir): Likewise.
8138 * mkdeps.c (munge): Use XNEWVEC.
8139 (deps_init): Use XCNEW.
8140 (deps_add_target): Use XRESIZEVEC.
8141 (deps_add_default_target): Cast return value of alloca.
8142 (deps_add_dep): Use XRESIZEVEC.
8143 (deps_add_vpath): Likewise. Use XNEWVEC too.
8144 (deps_restore): Likewise.
8145 * pch.c (save_idents): Use XNEW and XNEWVEC.
8146 (cpp_save_state): Use XNEW.
8147 (count_defs): Cast return value of htab_find.
8148 (write_defs): Likewise.
8149 (cpp_write_pch_deps): Use XNEWVEC.
8150 (collect_ht_nodes): Use XRESIZEVEC.
8151 (cpp_valid_state): Use XNEWVEC.
8152 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup.
8153 * symtab.c (ht_create): Use XCNEW.
8154 (ht_lookup_with_hash): Cast return value of obstack_copy0.
8155 (ht_expand): Use XCNEWVEC.
8156 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
8157 (bool): Do not define if __cplusplus.
8159 2005-05-12 Zack Weinberg <zack@codesourcery.com>
8161 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
8162 (do_sccs): Delete function definition, #define to do_ident.
8163 (do_ident): Don't hardwire directive name.
8165 2005-05-12 Ryota Kunisawa <kunisawa@access.co.jp>
8168 * configure: Regenerate.
8170 2005-04-27 Andris Pavenis <pavenis@latnet.lv>
8172 * files.c: Include io.h for DJGPP to get prototype of setmode.
8174 2005-04-19 Per Bothner <per@bothner.com>
8176 PR preprocessor/20907
8177 * line-map.c (linemap_line_start): Fix bug when we need to increse
8178 column_bits but can re-use the current line_map.
8180 2005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8182 * system.h (fopen, fdopen, freopen): Define these to the unlocked
8183 libiberty functions.
8185 2005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8187 * configure.ac (libcpp_UNLOCKED_FUNCS): New.
8188 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
8189 * system.h (putchar, getc, getchar, clearerr, feof, fileno,
8190 fflush, fgetc, fgets, ferror, fread): Redefine to the associated
8192 (fwrite_unlocked): Fix prototype.
8194 * configure, config.in: Regenerate.
8196 2005-04-05 Jakub Jelinek <jakub@redhat.com>
8198 PR preprocessor/19475
8199 * macro.c (create_iso_definition): For < ISO C99, don't
8200 pedwarn if there is no whitespace between macro name and its
8201 replacement, but the replacement starts with a basic character
8204 2005-03-28 Andreas Jaeger <aj@suse.de>
8206 * lex.c (warn_about_normalization): Cast field width to int to
8209 2005-03-19 Joseph S. Myers <joseph@codesourcery.com>
8211 * configure.ac: Consistently use solaris2.1[0-9]* instead of
8213 * configure: Regenerate.
8215 2005-03-15 Geoffrey Keating <geoffk@apple.com>
8217 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
8218 UCN rather than printing an error.
8220 2005-03-14 Geoffrey Keating <geoffk@apple.com>
8222 * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
8224 2005-03-14 Geoffrey Keating <geoffk@apple.com>
8226 * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
8227 * charset.c: Update for new format of ucnid.h.
8228 (ucn_valid_in_identifier): Update for new format of ucnid.h.
8229 Add NST parameter, and update it; update callers.
8230 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort
8232 (convert_ucn): Pass normalize_state to cpp_valid_ucn.
8233 * internal.h (struct normalize_state): New.
8234 (INITIAL_NORMALIZE_STATE): New.
8235 (NORMALIZE_STATE_RESULT): New.
8236 (NORMALIZE_STATE_UPDATE_IDNUM): New.
8237 (_cpp_valid_ucn): New.
8238 * lex.c (warn_about_normalization): New.
8239 (forms_identifier_p): Add normalize_state parameter, update callers.
8240 (lex_identifier): Add normalize_state parameter, update callers. Keep
8242 (lex_number): Likewise.
8243 (_cpp_lex_direct): Pass normalize_state to subroutines. Check
8244 it with warn_about_normalization.
8248 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove
8249 comments about obsolete version of C++.
8250 * include/cpplib.h (enum cpp_normalize_level): New.
8251 (struct cpp_options): Add warn_normalize field.
8253 2005-03-11 Geoffrey Keating <geoffk@apple.com>
8255 * directives.c (glue_header_name): Update call to cpp_spell_token.
8256 * internal.h (_cpp_interpret_identifier): New.
8257 * charset.c (_cpp_interpret_identifier): New.
8258 (_cpp_valid_ucn): Allow UCN version of '$'.
8259 * lex.c (lex_identifier): Add extra parameter to indicate if initial
8260 character was '$' or '\'. Support identifiers with UCNs.
8261 (forms_identifier_p): Allow UCNs.
8262 (_cpp_lex_direct): Pass extra parameter to lex_identifier.
8264 (cpp_spell_token): Add FORSTRING parameter. Use it.
8265 (cpp_token_as_text): Update call to cpp_spell_token.
8266 (cpp_output_token): Write UCNs back out.
8267 (stringify_arg): Update call to cpp_spell_token.
8268 (paste_tokens): Likewise.
8269 (cpp_macro_definition): Likewise.
8270 * macro.c (stringify_arg): Likewise.
8271 (paste_tokens): Likewise.
8272 (cpp_macro_definition): Likewise.
8273 * include/cpplib.h: Add parameter to cpp_spell_token.
8275 2005-03-04 Jakub Jelinek <jakub@redhat.com>
8279 * macro.c (replace_args, cpp_get_token): Copy whole
8280 cpp_token_u instead of just cpp_string field from it.
8282 2005-02-28 Devang Patel <dpatel@apple.com>
8284 * directives.c (do_line): Save sysp early before line table is
8287 2005-02-20 Zack Weinberg <zack@codesourcery.com>
8290 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
8291 (cpp_host_to_exec_charset): New function.
8292 * include/cpplib.h: Declare cpp_host_to_exec_charset.
8294 2005-02-19 Devang Patel <dpatel@apple.com>
8296 * charset.c (_cpp_convert_input): Check '\r' before inserting
8299 2005-02-15 Eric Christopher <echristo@redhat.com>
8301 PR preprocessor/19077
8302 * macro.c (cpp_macro_definition): Move handling of whitespace
8303 to PREV_WHITE conditional. Remove overloading of len
8306 2005-02-14 Kazu Hirata <kazu@cs.umass.edu>
8308 * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
8309 traditional.c: Update copyright.
8311 2005-02-14 Paolo Bonzini <bonzini@gnu.org>
8314 * configure.ac: Check for declaration of basename and getopt.
8315 * config.in: Regenerate.
8316 * configure: Regenerate.
8317 * internal.h (ustrcspn): New.
8318 * macro.c (create_iso_definition): Fix allocation of memory.
8319 (padding_token): Add cast to remove const-ness.
8320 * pch.c (cpp_read_state): Use ustrcspn.
8322 2005-02-08 Mike Stump <mrs@apple.com>
8324 * files.c (pchf_adder): Remove.
8325 (struct pchf_adder_info): Likewise.
8326 (_cpp_save_file_entries): Write out all files so that #import works.
8328 2005-01-23 Joseph S. Myers <joseph@codesourcery.com>
8330 * configure: Regenerate.
8332 2005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
8334 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
8336 * include/cpplib.h: Also update copyright years.
8338 2005-01-03 Geoffrey Keating <geoffk@apple.com>
8340 * files.c (_cpp_find_file): Add files found by search_path_exhausted
8341 to the list of all files.
8343 2005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
8345 * internal.h: Update references to Cpp lib filenames.
8346 * directives.c: Likewise.
8348 * macro.c: Likewise.
8349 * traditional.c: Likewise.
8351 2004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
8353 PR preprocessor/15167
8354 * files.c (destroy_cpp_file): New function.
8355 (should_stack_file): Make a new file if the
8356 compared file is still stacked.
8358 2004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
8360 PR preprocessor/17610
8361 * directives.c (do_include_common): Error out if an empty filename
8362 is given for #include (or #include_next or #import).
8364 2004-11-27 Roger Sayle <roger@eyesopen.com>
8365 Zack Weinberg <zack@codesourcery.com>
8367 * internal.h: Replace all uses of uchar with unsigned char.
8368 * include/cpp-id-data.h: Likewise. Guard typedef of uchar
8369 with !IN_GCC, so uchar is only defined whilst building libcpp.
8371 2004-11-24 Kelley Cook <kcook@gcc.gnu.org>
8373 * aclocal.m4: Regenerate.
8375 2004-11-24 Roger Sayle <roger@eyesopen.com>
8377 PR preprocessor/15824
8378 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
8379 directly, instead of the non-existant "system.h" and "ansidecl.h".
8380 * configure: Regenerate.
8382 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
8383 Joseph Myers <joseph@codesourcery.com>
8385 * internal.h (struct lexer_state): Add in_deferred_pragma.
8386 * directives.c (struct pragma_entry): Add allow_expansion.
8387 (insert_pragma_entry): Take allow_expansion flag.
8388 (register_pragma): Likewise.
8389 (cpp_register_pragma): Likewise.
8390 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
8391 (do_pragma): Honor allow_expansion.
8392 (cpp_handle_deferred_pragma): Set in_deferred_pragma.
8393 * include/cpplib.h (cpp_register_pragma): Update prototype.
8395 2004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
8396 Mark Mitchell <mark@codesourcery.com>
8398 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
8399 need_64bit_hwint=yes.
8400 * configure: Regenerate.
8402 2004-11-09 Joseph S. Myers <joseph@codesourcery.com>
8404 * Makefile.in ($(PACKAGE).pot): New rule. Depend on
8406 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
8407 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
8408 Remove local srcdir path from generated file.
8410 2004-11-04 Zack Weinberg <zack@codesourcery.com>
8411 Gerald Pfeifer <gerald@pfeifer.com>
8413 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
8416 2004-10-27 Zack Weinberg <zack@codesourcery.com>
8419 * directives.c (do_pragma): Do not defer pragmas which are unknown.
8420 (cpp_handle_deferred_pragma): Add cast to silence warning.
8422 2004-10-14 Joseph S. Myers <jsm@polyomino.org.uk>
8424 * errors.c (_cpp_begin_message): Print "error: " for errors.
8426 2004-10-10 Andreas Jaeger <aj@suse.de>
8428 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
8429 * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
8431 2004-10-08 Andrew Pinski <pinskia@physics.uc.edu>
8433 * pch.c (cpp_write_pch_state): Remove variable z as it is not
8435 (cpp_read_state): Remove unused variables, m, d and mac_count.
8437 2004-09-29 Per Bothner <per@bothner.com>
8439 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore
8440 cb.line_change. Otherwise do_pragma will call the line_change
8441 call-back with a meaningless line number.
8443 2004-09-24 Zack Weinberg <zack@codesourcery.com>
8445 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
8446 programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
8447 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
8448 * aclocal.m4, configure: Regenerate.
8449 * init.c: Include localedir.h.
8450 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
8452 (.c.o): Use $(ALL_CFLAGS).
8453 (localedir.h, localedir.hs): New rules.
8454 (clean): Use rm -rf to remove directories.
8455 (distclean): Also delete localedir.h and localedir.hs.
8456 (init.o): Update dependencies.
8458 2004-09-22 Kelley Cook <kcook@gcc.gnu.org>
8460 * Makefile.in (aclocal.m4): Update dependencies.
8461 * configure.ac (AC_CONFIG_MACRO_DIR): New.
8462 * aclocal.m4, configure: Regenerate.
8464 2004-09-17 Zack Weinberg <zack@codesourcery.com>
8466 * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
8467 (_cpp_convert_input, _cpp_default_encoding): Add comments.
8468 Some other comments in this file also tweaked.
8470 * directives.c (do_pragma): Save current buffer position
8471 before lexing the pragma keywords; don't call
8472 _cpp_backup_tokens in the defer_pragmas case.
8474 2004-09-15 Per Bothner <per@bothner.com>
8476 * include/line-map.h (line_map_start): Add parameter names so
8477 preceding comment makes sense.
8478 (linemap_add): Remove from comment mention of non-existing parameter.
8480 2004-09-09 Matt Austern <austern@apple.com>
8481 Zack Weinberg <zack@codesourcery.com>
8483 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
8484 prefixes throughout. Add entry for PRAGMA. Remove
8485 unnecessary "= 0" from EQ.
8486 (enum cpp_ttype): Adjust OP and TK definitions to restore
8487 prefixes, via token-paste.
8488 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
8489 Change from #defines to additional cpp_ttype enumerators.
8490 (struct cpp_options): Add defer_pragmas.
8491 (cpp_handle_deferred_pragma): Prototype new interface.
8493 * internal.h (struct cpp_reader): Add directive_result.
8494 * directives.c (struct pragma_entry): Add is_internal field;
8495 give boolean fields type bool.
8496 (start_directive): Initialize pfile->directive_result.type.
8497 (_cpp_do__Pragma): Likewise.
8498 (run_directive): Do not crash if pfile->buffer->prev is NULL.
8499 (insert_pragma_entry): Add 'internal' argument; set new->is_internal
8501 (register_pragma): New static function, bulk of former
8502 cpp_register_pragma here; add 'internal' argument, pass along
8503 to insert_pragma_entry.
8504 (cpp_register_pragma): Now a wrapper around register_pragma which
8505 always passes false for 'internal' argument.
8506 (_cpp_init_internal_pragmas): Call register_pragma directly, passing
8507 true for 'internal'.
8508 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
8509 an internal pragma, save text till the end of the line as a CPP_PRAGMA
8510 token instead of executing the pragma.
8511 (cpp_handle_deferred_pragma): New interface.
8512 * lex.c (token_spellings): Adjust OP and TK definitions to
8513 match changes to cpplib.h.
8514 (_cpp_lex_token): Check for a directive-result token and
8515 return it if present.
8516 (cpp_token_val_index): Handle CPP_PRAGMA.
8517 * macro.c (cpp_builtin_macro_text): Correct comment.
8518 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
8520 2004-09-06 Serge Belyshev <belyshev@lubercy.com>
8522 PR preprocessor/14699
8523 * symtab.c (ht_dump_statistics): Change type of sum_of_squares
8524 from size_t to double.
8526 2004-08-28 Andreas Schwab <schwab@suse.de>
8527 Andreas Jaeger <aj@suse.de>
8529 * configure.ac: Set PACKAGE correctly.
8530 * configure: Regenerated.
8532 2004-08-25 Paolo Bonzini <bonzini@gnu.org>
8534 * Makefile.in: Add back top_builddir.
8536 2004-08-25 Paolo Bonzini <bonzini@gnu.org>
8538 * configure.ac: Replace Automake macro invocations
8539 with manual Autoconf checks and substitutions.
8540 * configure: Regenerate.
8541 * aclocal.m4: Regenerate.
8542 * config.in: Regenerate.
8543 * Makefile.am: Removed.
8544 * Makefile.in: Heavy simplification and reorganization.
8546 2004-08-09 Mark Mitchell <mark@codesourcery.com>
8548 * configure.ac (arm*-*-eabi*): New target.
8549 (arm*-*-symbianelf*): Likewise.
8550 * configure: Regenerated.
8552 2004-07-24 Bernardo Innocenti <bernie@develer.com>
8554 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
8555 * directives.c: Use XNEW-family macros from libiberty.
8557 * macro.c: Likewise.
8558 * cpplib.h (cpp_deps_style): Export enum with name.
8560 2004-07-23 Matthias Klose <doko@debian.org>
8562 * init.c (init_library): Use PACKAGE for the text domain.
8564 2004-07-16 Andris Pavenis <pavenis@latnet.lv>
8566 PR preprocessor/16366
8567 * internal.h (struct cpp_reader): New field dir_hash.
8568 * files.c (make_cpp_dir): Use dir_hash, not file_hash.
8569 (_cpp_init_files, _cpp_cleanup_files): Update for new field.
8571 2004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
8573 PR preprocessor/16192
8574 PR preprocessor/15913
8575 PR preprocessor/15572
8576 * expr.c (_cpp_parse_expr): Handle remaining cases where an
8577 expression is missing.
8578 * init.c (post_options): Traditional cpp doesn't do // comments.
8580 2004-06-30 Per Bothner <per@bothner.com>
8582 * include/line-map.h (fileline): Remove old typedef.
8583 * internal.h (struct cpp_reader): Use source_location typedef instead.
8585 2004-06-26 Zack Weinberg <zack@codesourcery.com>
8587 Partially revert patch of 2004-06-05.
8588 * files.c (search_cache): Remove pfile argument. Don't check
8589 for file that would be found by "" or <> search here...
8590 (_cpp_find_file): ...do it here, before calling find_file_in_dir.
8591 Do not apply directory-of-current-file correction to files
8592 found by this check. Rearrange code slightly.
8594 2004-06-21 Geoffrey Keating <geoffk@apple.com>
8596 * files.c (should_stack_file): Correct swapped parameters to call
8598 * pch.c (cpp_valid_state): Handle -fpreprocessed.
8600 2004-06-15 Paolo Bonzini <bonzini@gnu.org>
8602 * Makefile.in: Regenerate with automake 1.8.5.
8603 * aclocal.m4: Likewise.
8604 * configure: Regenerate.
8606 2004-06-11 Zack Weinberg <zack@codesourcery.com>
8608 * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
8609 * configure, config.in: Regenerate.
8610 * system.h: Unconditionally define bool as unsigned char,
8611 BOOL_BITFIELD as unsigned int.
8612 * .cvsignore: New file.
8614 2004-06-09 Geoffrey Keating <geoffk@apple.com>
8616 * traditional.c (push_replacement_text): Set macro->traditional.
8617 (save_replacement_text): Likewise.
8618 * pch.c (cpp_write_pch_state): Don't write list of defined macros.
8619 (struct save_macro_item): Delete.
8620 (struct save_macro_data): Use a character array not the previous
8622 (save_macros): Save macro as text not as internal structures.
8623 (cpp_prepare_state): Update for changes to save_macro_data.
8624 (cpp_read_state): Don't read macros defined in PCH. Restore
8626 * macro.c (create_iso_definition): Honour alloc_subobject.
8627 Clear traditional flag.
8628 (_cpp_create_definition): Honour alloc_subobject.
8629 * lex.c (cpp_token_val_index): New.
8630 * internal.h: Include cpp-id-data.h.
8631 (uchar): Move definition to cpp-id-data.h.
8633 (cpp_macro): Likewise.
8634 * directives.c (struct answer): Move to cpp-id-data.h.
8635 (do_assert): Honour alloc_subobject.
8637 * include/symtab.h (struct ht): Add field 'alloc_subobject'.
8638 * include/cpplib.h (struct cpp_string): Add GTY marker.
8639 (enum cpp_token_fld_kind): New.
8640 (struct cpp_token): Add GTY markers.
8641 (cpp_token_val_index): Prototype.
8642 (CPP_HASHNODE_VALUE_IDX): New.
8643 (struct cpp_hashnode): Don't skip fields of 'value' when marking.
8644 * include/cpp-id-data.h: New file.
8646 2004-06-09 Paolo Bonzini <bonzini@gnu.org>
8648 * Makefile.am (all-local): New.
8649 * Makefile.in: Regenerate.
8651 2004-06-06 Roger Sayle <roger@eyesopen.com>
8653 * Makefile.am (LIBICONV): Declare.
8654 (makedepend_LDADD): Use LIBICONV.
8655 * Makefile.in: Regenerate.
8657 2004-06-05 Andrew Pinski <pinskia@physics.uc.edu>
8659 * Makefile.am (LIBINTL): Declare
8660 (makedepend_LDADD): Use LIBINTL.
8661 * Makefile.in: Regenerate.
8663 2004-06-05 Zack Weinberg <zack@codesourcery.com>
8665 * Makefile.am: Add makedepend.
8666 * Makefile.in, aclocal.m4: Regenerate.
8667 * charset.c: Insert a space to avoid a warning.
8668 * directives.c: Include mkdeps.h.
8669 (_cpp_handle_directive): Reenable macro expander if appropriate.
8670 (undefine_macros): Inline body of _cpp_free_definition for speed.
8671 Do not call undef callback or _cpp_warn_if_unused_macro.
8672 (cpp_get_deps): New interface.
8673 * files.c (search_cache): Add pfile argument. Check for file
8674 that would be found by "" or <> search here...
8675 (_cpp_find_file): ...not here. Correct recorded start_dir of
8676 files found by directory-of-current-file search that would be
8677 found by "" or <> search.
8678 * init.c (cpp_add_dependency_target): Delete.
8679 * internal.h (struct lexer_state): Add discarding_output flag.
8680 * lex.c (lex_identifier): Compute hash function while scanning.
8681 * macro.c (cpp_scan_nooutput): Disable macro expansion outside
8683 * makedepend.c: New file.
8684 * mkdeps.c (struct deps): Add vpath vector.
8685 (apply_vpath, deps_add_vpath): New function.
8686 (deps_free): Free vpath vector.
8687 (deps_add_dep, deps_add_target): Use apply_vpath.
8688 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
8689 (ht_lookup_with_hash): New function.
8690 * cpplib.h, mkdeps.h: Update prototypes.
8691 * symtab.h: Update prototypes.
8692 (HT_HASHSTEP, HT_FINISH): New macros.
8694 2004-05-29 Geoffrey Keating <geoffk@apple.com>
8696 * symtab.c (ht_create): Set entries_owned.
8697 (ht_destroy): Honour entries_owned.
8698 (ht_expand): Likewise.
8700 * include/symtab.h (struct ht): New field 'entries_owned'
8701 (ht_load): New prototype.
8703 2004-05-26 Paolo Bonzini <bonzini@gnu.org>
8706 * configure.ac: Fix m4 quoting when picking
8707 the size of HOST_WIDE_INT.
8708 * configure: Regenerate.
8710 2004-05-25 Paolo Bonzini <bonzini@gnu.org>
8712 * Makefile.am: the correct directory for
8713 gettext include files is given by @INCINTL@.
8714 * Makefile.in: Regenerate.
8716 2004-05-24 Paolo Bonzini <bonzini@gnu.org>
8718 * system.h [!ENABLE_NLS]: dgettext takes two
8721 2004-05-23 Paolo Bonzini <bonzini@gnu.org>
8723 Moved libcpp from the gcc subdirectory to the toplevel.
8724 * Makefile.am: New file.
8725 * Makefile.in: Regenerate.
8726 * configure.ac: New file.
8727 * configure: Regenerate.
8728 * config.in: Regenerate.
8729 * charset.c: Moved from gcc/cppcharset.c. Add note about
8730 brokenness of input charset detection. Adjust for change
8731 in name of cppucnid.h.
8732 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
8733 * expr.c: Moved from gcc/cppexp.c.
8734 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
8735 Remove #define of O_BINARY, it is in system.h.
8736 * identifiers.c: Moved from gcc/cpphash.c.
8737 * internal.h: Moved from gcc/cpphash.h. Change header
8738 guard name. All other files adjusted to match name change.
8739 * init.c: Moved from gcc/cppinit.c.
8740 (init_library) [ENABLE_NLS]: Call bindtextdomain.
8741 * lex.c: Moved from gcc/cpplex.c.
8742 * directives.c: Moved from gcc/cpplib.c.
8743 * macro.c: Moved from gcc/cppmacro.c.
8744 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
8745 * traditional.c: Moved from gcc/cpptrad.c.
8746 * ucnid.h: Moved from gcc/cppucnid.h. Change header
8748 * ucnid.pl: Moved from gcc/cppucnid.pl.
8749 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header
8751 * symtab.c: Moved from gcc/hashtable.c.
8752 * line-map.c: Moved from gcc. Do not include intl.h.
8753 * mkdeps.c: Moved from gcc.
8754 * system.h: New file.
8755 * include/cpplib.h: Moved from gcc. Change header guard name.
8756 * include/line-map.h: Moved from gcc. Change header guard name.
8757 * include/mkdeps.h: Moved from gcc. Change header guard name.
8758 * include/symtab.h: Moved from gcc/hashtable.h. Change header
8761 Copyright (C) 2004-2025 Free Software Foundation, Inc.
8763 Copying and distribution of this file, with or without modification,
8764 are permitted in any medium without royalty provided the copyright
8765 notice and this notice are preserved.