Debian Codegraph @

libcpp/ChangeLog

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