]> git.ipfire.org Git - thirdparty/gcc.git/blame - libcpp/ChangeLog
Daily bump.
[thirdparty/gcc.git] / libcpp / ChangeLog
CommitLineData
738808bd
GA
12023-07-06 Thomas Schwinge <thomas@codesourcery.com>
2
3 * include/symtab.h (struct ht_identifier): Document different
4 rationale.
5
6f78df4c
GA
62023-06-23 Marek Polacek <polacek@redhat.com>
7
8 * include/cpplib.h (c_lang): Add CXX26 and GNUCXX26.
9 * init.cc (lang_defaults): Add rows for CXX26 and GNUCXX26.
10 (cpp_init_builtins): Set __cplusplus to 202400L for C++26.
11 Set __cplusplus to 202302L for C++23.
12
132023-06-23 Ben Boeckel <me@benboeckel.net>
14
15 * charset.cc: Allow `UCS_LIMIT` in UTF-8 strings.
16
270742ce
GA
172023-06-22 David Malcolm <dmalcolm@redhat.com>
18
19 * charset.cc (get_cppchar_property): New function template, based
20 on...
21 (cpp_wcwidth): ...this function. Rework to use the above.
22 Include "combining-chars.inc".
23 (cpp_is_combining_char): New function
24 Include "printable-chars.inc".
25 (cpp_is_printable_char): New function
26 * combining-chars.inc: New file, generated by
27 contrib/unicode/gen-combining-chars.py.
28 * include/cpplib.h (cpp_is_combining_char): New function decl.
29 (cpp_is_printable_char): New function decl.
30 * printable-chars.inc: New file, generated by
31 contrib/unicode/gen-printable-chars.py.
32
bfc6d29f
GA
332023-06-20 Lewis Hyatt <lhyatt@gmail.com>
34
35 PR c++/66290
36 * macro.cc (_cpp_create_definition): Add location argument.
37 * internal.h (_cpp_create_definition): Adjust prototype.
38 * directives.cc (do_define): Pass new location argument to
39 _cpp_create_definition.
40 (do_undef): Stop passing inferior location to cpp_warning_with_line;
41 the default from cpp_warning is better.
42 (cpp_pop_definition): Pass new location argument to
43 _cpp_create_definition.
44 * pch.cc (cpp_read_state): Likewise.
45
e517d3f5
GA
462023-06-19 Ben Boeckel <ben.boeckel@kitware.com>
47
48 * charset.cc: Reject encodings of codepoints above 0x10FFFF.
49 UTF-16 does not support such codepoints and therefore all
50 Unicode rejects such values.
51
7ff79341
GA
522023-06-15 Marek Polacek <polacek@redhat.com>
53
54 * configure.ac (--enable-host-shared): Don't set PICFLAG here.
55 (--enable-host-pie): New check. Set PICFLAG after this check.
56 * configure: Regenerate.
57
582023-06-15 Jakub Jelinek <jakub@redhat.com>
59
60 PR preprocessor/80753
61 * files.cc (struct _cpp_file): Add deferred_error bitfield.
62 (_cpp_find_file): When finding a file in cache with deferred_error
63 set in _cpp_FFK_NORMAL mode, call open_file_failed and clear the flag.
64 Set deferred_error in _cpp_FFK_HAS_INCLUDE mode if open_file_failed
65 hasn't been called.
66
4d68c7f7
GA
672023-04-30 Jeff Law <jlaw@ventanamicro>
68
69 Revert:
70 2023-04-30 Longjun Luo <luolongjuna@gmail.com>
71
72 * init.cc (builtin_array): Do not always warn for a redefinition
73 of __LINE__.
74
752023-04-30 Longjun Luo <luolongjuna@gmail.com>
76
77 * init.cc (builtin_array): Do not always warn for a redefinition
78 of __LINE__.
79
810b924f
GA
802023-03-25 David Malcolm <dmalcolm@redhat.com>
81
82 PR analyzer/109098
83 * charset.cc (cpp_valid_utf8_p): New function.
84 * include/cpplib.h (cpp_valid_utf8_p): New prototype.
85
5c389a5c
GA
862023-03-16 Jakub Jelinek <jakub@redhat.com>
87
88 * makeucnid.cc (write_copyright): Update Unicode copyright years
89 up to 2022.
90 * makeuname2c.cc (write_copyright): Likewise.
91 * ucnid.h: Regenerated.
92 * uname2c.h: Regenerated.
93
a9835599
GA
942023-03-13 Lewis Hyatt <lhyatt@gmail.com>
95
96 PR preprocessor/67046
97 * directives.cc (_cpp_do__Pragma): Increment pfile->keep_tokens to
98 ensure the returned string token is valid.
99
1002023-03-13 Lewis Hyatt <lhyatt@gmail.com>
101
102 * generated_cpp_wcwidth.h: Regenerated for Unicode 15.
103
4bc2d9f6
GA
1042022-12-07 Joseph Myers <joseph@codesourcery.com>
105
106 * init.cc (lang_defaults): Enable va_opt for STDC2X.
107 * lex.cc (maybe_va_opt_error): Adjust diagnostic message for C.
108 * macro.cc (_cpp_arguments_ok): Update comment.
109
8761284f
GA
1102022-11-23 Marek Polacek <polacek@redhat.com>
111
112 Revert:
113 2022-11-23 Marek Polacek <polacek@redhat.com>
114
115 * configure.ac (--enable-host-shared): Don't set PICFLAG here.
116 (--enable-host-pie): New check. Set PICFLAG after this check.
117 * configure: Regenerate.
118
1192022-11-23 Marek Polacek <polacek@redhat.com>
120
121 * configure.ac (--enable-host-shared): Don't set PICFLAG here.
122 (--enable-host-pie): New check. Set PICFLAG after this check.
123 * configure: Regenerate.
124
8b7fee1d
GA
1252022-11-21 Lewis Hyatt <lhyatt@gmail.com>
126
127 * directives.cc (do_pragma): Fix memory leak in token buffer. Fix
128 unwanted paste between two tokens.
129
1302022-11-21 Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
131
132 * files.cc: Ensure pattern matches before use.
133
1342022-11-21 Martin Liska <mliska@suse.cz>
135
136 * config.in: Re-configure.
137
fb98ede8
GA
1382022-11-19 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
139
140 PR preprocessor/107691
141 * configure.ac: Add valgrind header checks.
142 * configure: Regenerate.
143
1442022-11-18 Richard Purdie <richard.purdie@linuxfoundation.org>
145
146 * macro.cc (_cpp_builtin_macro_text): Don't remap filenames within
147 directives.
148
05788e9b
GA
1492022-11-05 Lewis Hyatt <lhyatt@gmail.com>
150
151 PR preprocessor/55971
152 * lex.cc (get_fresh_line_impl): New function refactoring the code
153 from...
154 (_cpp_get_fresh_line): ...here.
155 (lex_raw_string): Use the new version of get_fresh_line_impl() to
156 support raw strings containing new lines when processing a directive.
157
1582022-11-04 Jakub Jelinek <jakub@redhat.com>
159
160 * makeuname2c.cc (struct generated): Update from Unicode 15.0.0
161 table 4-8.
162 * ucnid.h: Regenerated for Unicode 15.0.0.
163 * uname2c.h: Likewise.
164
87f9c4a4
GA
1652022-10-19 Lewis Hyatt <lhyatt@gmail.com>
166
167 * include/cpplib.h (struct cpp_string): Use new "string_length" GTY.
168 * include/symtab.h (struct ht_identifier): Likewise.
169
baeec7cc
GA
1702022-10-14 Joseph Myers <joseph@codesourcery.com>
171
172 * charset.cc (ucn_valid_in_identifier): Check xid_identifiers not
173 cplusplus to determine whether to use CXX23 and NXX23 flags.
174 * include/cpplib.h (struct cpp_options): Add xid_identifiers.
175 * init.cc (struct lang_flags, lang_defaults): Add xid_identifiers.
176 (cpp_set_lang): Set xid_identifiers.
177 * lex.cc (warn_about_normalization): Add parameter identifier.
178 Only pedwarn about non-NFC for identifiers, not pp-numbers.
179 (_cpp_lex_direct): Update calls to warn_about_normalization.
180
1812022-10-14 Jakub Jelinek <jakub@redhat.com>
182
183 * include/cpplib.h (CPP_N_BFLOAT16): Define.
184 * expr.cc (interpret_float_suffix): Handle bf16 and BF16 suffixes for
185 C++.
186
9e79a25b
GA
1872022-09-28 Eugene Rozenfeld <erozen@microsoft.com>
188
189 * include/line-map.h: Add discriminator to location_adhoc_data.
190 (get_combined_adhoc_loc): Add discriminator parameter.
191 (get_discriminator_from_adhoc_loc): Add external declaration.
192 (get_discriminator_from_loc): Add external declaration.
193 (COMBINE_LOCATION_DATA): Add discriminator parameter.
194 * lex.cc (get_location_for_byte_range_in_cur_line) Pass 0 discriminator
195 in a call to COMBINE_LOCATION_DATA.
196 (warn_about_normalization): Pass 0 discriminator in a call to
197 COMBINE_LOCATION_DATA.
198 (_cpp_lex_direct): Pass 0 discriminator in a call to
199 COMBINE_LOCATION_DATA.
200 * line-map.cc (location_adhoc_data_hash): Use discriminator compute
201 location_adhoc_data hash.
202 (location_adhoc_data_eq): Use discriminator when comparing
203 location_adhoc_data.
204 (can_be_stored_compactly_p): Check discriminator to determine
205 compact storage.
206 (get_combined_adhoc_loc): Add discriminator parameter.
207 (get_discriminator_from_adhoc_loc): New function to get the discriminator
208 from an ad-hoc location.
209 (get_discriminator_from_loc): New function to get the discriminator
210 from a location.
211
1f16a020
GA
2122022-09-27 Jakub Jelinek <jakub@redhat.com>
213
214 PR c++/106652
215 PR c++/85518
216 * expr.cc (interpret_float_suffix): Allow {f,F}{16,32,64,128} and
217 {f,F}{32,64,128}x suffixes for C++.
218
2e7ad70c
GA
2192022-09-08 Lewis Hyatt <lhyatt@gmail.com>
220
221 * line-map.cc (location_adhoc_data_update): Remove reliance on
222 undefined behavior.
223 (get_combined_adhoc_loc): Likewise.
224 (rebuild_location_adhoc_htab): Fix issue where the htab was not
225 properly updated.
226
fe2a8ce9
GA
2272022-09-07 Joseph Myers <joseph@codesourcery.com>
228
229 * include/cpplib.h (struct cpp_options): Add true_false.
230 * expr.cc (eval_token): Check true_false not cplusplus to
231 determine whether to handle true and false keywords.
232 * init.cc (struct lang_flags): Add true_false.
233 (lang_defaults): Update.
234 (cpp_set_lang): Set true_false.
235
2362022-09-07 Jakub Jelinek <jakub@redhat.com>
237
238 * include/cpplib.h (struct cpp_options): Add cpp_warn_unicode member.
239 (enum cpp_warning_reason): Add CPP_W_UNICODE.
240 * init.cc (cpp_create_reader): Initialize cpp_warn_unicode.
241 * charset.cc (_cpp_valid_ucn): In possible identifier contexts, don't
242 handle \u{ or \N{ specially in -std=c* modes except -std=c++2{3,b}.
243 In possible identifier contexts, don't emit an error and punt
244 if \N isn't followed by {, or if \N{} surrounds some lower case
245 letters or _. In possible identifier contexts when not C++23, don't
246 emit an error but warning about unknown character names and treat as
247 separate tokens. When treating as separate tokens \u{ or \N{, emit
248 warnings.
249
47d2dcd1
GA
2502022-09-05 Joseph Myers <joseph@codesourcery.com>
251
252 * init.cc (lang_defaults): Disable trigraphs for C2x.
253
c64b0947
GA
2542022-09-02 David Malcolm <dmalcolm@redhat.com>
255
256 PR c/90885
257 * include/cpplib.h (BOL): Move macro to 1 << 12 since it is
258 not used by C/C++'s unsigned char token flags.
259 (DECIMAL_INT): New, using 1 << 6, so that it is visible as
260 part of C/C++'s 8 bits of token flags.
261
bb0a1556
GA
2622022-09-01 Jakub Jelinek <jakub@redhat.com>
263
264 PR c++/106655
265 * include/cpplib.h (struct cpp_options): Implement C++23
266 P2295R6 - Support for UTF-8 as a portable source file encoding.
267 Add cpp_warn_invalid_utf8 and cpp_input_charset_explicit fields.
268 (enum cpp_warning_reason): Add CPP_W_INVALID_UTF8 enumerator.
269 * init.cc (cpp_create_reader): Initialize cpp_warn_invalid_utf8
270 and cpp_input_charset_explicit.
271 * charset.cc (_cpp_valid_utf8): Adjust function comment.
272 * lex.cc (UCS_LIMIT): Define.
273 (utf8_continuation): New const variable.
274 (utf8_signifier): Move earlier in the file.
275 (_cpp_warn_invalid_utf8, _cpp_handle_multibyte_utf8): New functions.
276 (_cpp_skip_block_comment): Handle -Winvalid-utf8 warning.
277 (skip_line_comment): Likewise.
278 (lex_raw_string, lex_string): Likewise.
279 (_cpp_lex_direct): Likewise.
280
542c60c4
GA
2812022-08-31 Jakub Jelinek <jakub@redhat.com>
282
283 PR preprocessor/106778
284 * makeuname2c.cc (write_nodes): Reverse order of && operands in
285 assert.
286
16f542d6
GA
2872022-08-26 Jakub Jelinek <jakub@redhat.com>
288
289 PR c++/106647
290 * charset.cc (wide_str_to_charconst): Implement P2362R3 - Remove
291 non-encodable wide character literals and multicharacter. For
292 C++23 use CPP_DL_ERROR instead of CPP_DL_WARNING for
293 "character constant too long for its type" diagnostics on CPP_WCHAR
294 literals.
295
2962022-08-26 Jakub Jelinek <jakub@redhat.com>
297
298 PR c++/106648
299 * charset.cc: Implement C++23 P2071R2 - Named universal character
300 escapes. Include uname2c.h.
301 (hangul_syllables, hangul_count): New variables.
302 (struct uname2c_data): New type.
303 (_cpp_uname2c, _cpp_uname2c_uax44_lm2): New functions.
304 (_cpp_valid_ucn): Use them. Handle named universal character escapes.
305 (convert_ucn): Adjust comment.
306 (convert_escape): Call convert_ucn even for \N.
307 (_cpp_interpret_identifier): Handle named universal character escapes.
308 * lex.cc (get_bidi_ucn): Fix up function comment formatting.
309 (get_bidi_named): New function.
310 (forms_identifier_p, lex_string): Handle named universal character
311 escapes.
312 * makeuname2c.cc: New file. Small parts copied from makeucnid.cc.
313 * uname2c.h: New generated file.
314
e8fc33aa
GA
3152022-08-24 Jakub Jelinek <jakub@redhat.com>
316
317 PR c++/106646
318 * init.cc: Implement C++23 P2437R1 - Support for #warning.
319 (lang_defaults): Set warning_directive for GNUCXX23 and CXX23.
320 * directives.cc (directive_diagnostics): Use different wording of
321 #warning pedwarn for C++.
322
d6a39c25
GA
3232022-08-20 Jakub Jelinek <jakub@redhat.com>
324
325 PR c++/106645
326 * include/cpplib.h (struct cpp_options): Implement
327 P2290R3 - Delimited escape sequences. Add delimite_escape_seqs
328 member.
329 * init.cc (struct lang_flags): Likewise.
330 (lang_defaults): Add delim column.
331 (cpp_set_lang): Copy over delimite_escape_seqs.
332 * charset.cc (extend_char_range): New function.
333 (_cpp_valid_ucn): Use it. Handle delimited escape sequences.
334 (convert_hex): Likewise.
335 (convert_oct): Likewise.
336 (convert_ucn): Use extend_char_range.
337 (convert_escape): Call convert_oct even for \o.
338 (_cpp_interpret_identifier): Handle delimited escape sequences.
339 * lex.cc (get_bidi_ucn_1): Likewise. Add end argument, fill it in.
340 (get_bidi_ucn): Adjust get_bidi_ucn_1 caller. Use end argument to
341 compute num_bytes.
342
30afe5e7
GA
3432022-08-18 Joseph Myers <joseph@codesourcery.com>
344
345 * include/cpplib.h (struct cpp_options): Add warning_directive.
346 * init.cc (struct lang_flags, lang_defaults): Add
347 warning_directive.
348 * directives.cc (DIRECTIVE_TABLE): Mark #warning as STDC2X not
349 EXTENSION.
350 (directive_diagnostics): Diagnose #warning with -Wc11-c2x-compat,
351 or with -pedantic for a standard not supporting #warning.
352
47a61e65
GA
3532022-08-16 Tom Honermann <tom@honermann.net>
354
355 PR c++/106423
356 * include/cpplib.h (cpp_warning_reason): Add CPP_W_CXX20_COMPAT.
357 * init.cc (cpp_create_reader): Add cpp_warn_cxx20_compat.
358
5f17badb
GA
3592022-08-08 Tom Honermann <tom@honermann.net>
360
361 PR preprocessor/106426
362 * charset.cc (narrow_str_to_charconst): Set signedness of CPP_UTF8CHAR
363 literals based on unsigned_utf8char.
364 * include/cpplib.h (cpp_options): Add unsigned_utf8char.
365 * init.cc (cpp_create_reader): Initialize unsigned_utf8char.
366
bdc7b765
GA
3672022-07-15 Jonathan Wakely <jwakely@redhat.com>
368
369 * include/line-map.h (label_text::take_or_copy): Remove.
370 (label_text::moved_from): Rename to release.
371 (label_text::m_buffer, label_text::m_owned): Make private.
372 (label_text::get, label_text::is_owned): New accessors.
373
cff72485
GA
3742022-07-13 Marek Polacek <polacek@redhat.com>
375
376 PR preprocessor/106272
377 * include/line-map.h (class label_text): Don't std::move in a return
378 statement.
379
b53ebbc5
GA
3802022-07-10 Lewis Hyatt <lhyatt@gmail.com>
381
382 PR preprocessor/97498
383 * directives.cc (destringize_and_run): Override the location of
384 the CPP_PRAGMA token from a _Pragma directive to the location of
385 the expansion point, as is done for the tokens lexed from it.
386
6345c414
GA
3872022-07-07 David Malcolm <dmalcolm@redhat.com>
388
389 * include/line-map.h: Include <utility>.
390 (class label_text): Delete maybe_free method in favor of a
391 destructor. Add move ctor and assignment operator. Add deletion
392 of the copy ctor and copy-assignment operator. Rename field
393 m_caller_owned to m_owned. Add std::move where necessary; add
394 moved_from member function.
395
fb29fdea
GA
3962022-06-28 Lewis Hyatt <lhyatt@gmail.com>
397
398 * ucnid.h: Regenerated for Unicode 14.0.
399
b2b72757
GA
4002022-06-26 Lewis Hyatt <lhyatt@gmail.com>
401
402 * generated_cpp_wcwidth.h: Generated from updated Unicode data files.
403
05f220c2
GA
4042022-05-29 Jakub Jelinek <jakub@redhat.com>
405
406 PR preprocessor/105732
407 * expr.cc (_cpp_parse_expr): Handle CPP_PADDING by just another
408 token.
409
57f2ce6a
GA
4102022-05-20 David Malcolm <dmalcolm@redhat.com>
411
412 * lex.cc: Replace uses of "FINAL" and "OVERRIDE" with "final" and
413 "override".
414
e8d68f0a
GA
4152022-02-11 Joseph Myers <joseph@codesourcery.com>
416
417 * Makefile.in (po/$(PACKAGE).pot): Also handle cpp_warning_at,
418 cpp_pedwarning_at and cpp_error_at.
419
ae7e4af9
GA
4202022-02-01 Jakub Jelinek <jakub@redhat.com>
421
422 PR preprocessor/104147
423 * macro.cc (funlike_invocation_p): For padding prefer a token
424 with val.source non-NULL especially if it has PREV_WHITE set
425 on val.source->flags. Add gcc_assert that CPP_PADDING tokens
426 don't have PREV_WHITE set in flags.
427
4282022-02-01 Jakub Jelinek <jakub@redhat.com>
429
430 * directives.cc (destringize_and_run): Push &pfile->avoid_paste
431 instead of a copy of pfile->directive_result for the CPP_PADDING
432 case.
433
bb99171b
GA
4342022-01-24 Marek Polacek <polacek@redhat.com>
435
436 PR preprocessor/104030
437 * include/cpplib.h (enum cpp_bidirectional_level): Add
438 bidirectional_ucn. Set values explicitly.
439 * internal.h (cpp_reader): Adjust warn_bidi_p.
440 * lex.cc (maybe_warn_bidi_on_close): Don't warn about UCNs
441 unless UCN checking is on.
442 (maybe_warn_bidi_on_char): Likewise.
443
7a761ae6
GA
4442022-01-18 Richard Biener <rguenther@suse.de>
445
446 * include/line-map.h (class line_maps): Re-arrange fields
447 to minimize padding.
448 (class rich_location): Likewise.
449 * line-map.cc (rich_location::rich_location): Adjust.
450
fc829782
GA
4512022-01-17 Martin Liska <mliska@suse.cz>
452
453 * Makefile.in: Rename .c names to .cc.
454
4552022-01-17 Martin Liska <mliska@suse.cz>
456
457 * Makefile.in: Rename .c names to .cc.
458 * charset.cc (convert_escape): Likewise.
459 * directives.cc (directive_diagnostics): Likewise.
460 (_cpp_handle_directive): Likewise.
461 (lex_macro_node): Likewise.
462 * include/cpplib.h (struct _cpp_file): Likewise.
463 (PURE_ZERO): Likewise.
464 (cpp_defined): Likewise.
465 (cpp_error_at): Likewise.
466 (cpp_forall_identifiers): Likewise.
467 (cpp_compare_macros): Likewise.
468 (cpp_get_converted_source): Likewise.
469 (cpp_read_state): Likewise.
470 (cpp_directive_only_process): Likewise.
471 (struct cpp_decoded_char): Likewise.
472 * include/line-map.h (enum lc_reason): Likewise.
473 (enum location_aspect): Likewise.
474 * include/mkdeps.h: Likewise.
475 * init.cc (cpp_destroy): Likewise.
476 (cpp_finish): Likewise.
477 * internal.h (struct cpp_reader): Likewise.
478 (_cpp_defined_macro_p): Likewise.
479 (_cpp_backup_tokens_direct): Likewise.
480 (_cpp_destroy_hashtable): Likewise.
481 (_cpp_has_header): Likewise.
482 (_cpp_expand_op_stack): Likewise.
483 (_cpp_commit_buff): Likewise.
484 (_cpp_restore_special_builtin): Likewise.
485 (_cpp_bracket_include): Likewise.
486 (_cpp_replacement_text_len): Likewise.
487 (ufputs): Likewise.
488 * line-map.cc (linemap_macro_loc_to_exp_point): Likewise.
489 (linemap_check_files_exited): Likewise.
490 (line_map_new_raw): Likewise.
491 * traditional.cc (enum ls): Likewise.
492
4932022-01-17 Martin Liska <mliska@suse.cz>
494
495 * charset.c: Moved to...
496 * charset.cc: ...here.
497 * directives.c: Moved to...
498 * directives.cc: ...here.
499 * errors.c: Moved to...
500 * errors.cc: ...here.
501 * expr.c: Moved to...
502 * expr.cc: ...here.
503 * files.c: Moved to...
504 * files.cc: ...here.
505 * identifiers.c: Moved to...
506 * identifiers.cc: ...here.
507 * init.c: Moved to...
508 * init.cc: ...here.
509 * lex.c: Moved to...
510 * lex.cc: ...here.
511 * line-map.c: Moved to...
512 * line-map.cc: ...here.
513 * macro.c: Moved to...
514 * macro.cc: ...here.
515 * makeucnid.c: Moved to...
516 * makeucnid.cc: ...here.
517 * mkdeps.c: Moved to...
518 * mkdeps.cc: ...here.
519 * pch.c: Moved to...
520 * pch.cc: ...here.
521 * symtab.c: Moved to...
522 * symtab.cc: ...here.
523 * traditional.c: Moved to...
524 * traditional.cc: ...here.
525
9248ee41
GA
5262022-01-15 Martin Sebor <msebor@redhat.com>
527
528 * files.c (_cpp_find_file): Substitute a valid pointer for
529 an invalid one to avoid -Wuse-after-free.
530
02a8a01b
GA
5312022-01-12 Clément Chigot <clement.chigot@atos.net>
532
533 * configure.ac: Check sizeof ino_t and dev_t.
534 * config.in: Regenerate.
535 * configure: Regenerate.
536 * include/cpplib.h (INO_T_CPP): Change for AIX.
537 (DEV_T_CPP): New macro.
538 (struct cpp_dir): Use it.
539
84790a9d
GA
5402021-12-30 Jakub Jelinek <jakub@redhat.com>
541
542 PR preprocessor/89971
543 * macro.c (replace_args): For ##__VA_OPT__, if __VA_OPT__ expands
544 to no tokens at all, drop PASTE_LEFT flag from the previous token.
545
70e4cb66
GA
5462021-12-04 Jakub Jelinek <jakub@redhat.com>
547
548 PR preprocessor/102432
549 * lex.c (_cpp_lex_direct): If buffer->need_line while
550 pfile->state.in_deferred_pragma, return CPP_PRAGMA_EOL token instead
551 of assertion failure.
552
03a9bd05
GA
5532021-12-03 Jakub Jelinek <jakub@redhat.com>
554
555 PR pch/71934
556 * include/line-map.h (class line_maps): Add GTY((callback)) to
557 reallocator and round_alloc_size members.
558
40fa651e
GA
5592021-12-01 Jakub Jelinek <jakub@redhat.com>
560
561 PR c++/100977
562 * init.c (struct lang_flags): Remove cxx23_identifiers.
563 (lang_defaults): Remove cxx23_identifiers initializers.
564 (cpp_set_lang): Don't copy cxx23_identifiers.
565 * include/cpplib.h (struct cpp_options): Adjust comment about
566 c11_identifiers. Remove cxx23_identifiers field.
567 * lex.c (warn_about_normalization): Use cplusplus instead of
568 cxx23_identifiers.
569 * charset.c (ucn_valid_in_identifier): Likewise.
570
5712021-12-01 Jakub Jelinek <jakub@redhat.com>
572
573 PR preprocessor/103415
574 * macro.c (stringify_arg): Remove va_opt argument and va_opt handling.
575 (paste_tokens): On successful paste or in PREV_WHITE and
576 PREV_FALLTHROUGH flags from the *plhs token to the new token.
577 (replace_args): Adjust stringify_arg callers. For #__VA_OPT__,
578 perform token pasting in a separate loop before stringify_arg call.
579
c177e806
GA
5802021-11-30 Richard Biener <rguenther@suse.de>
581
582 * charset.c (convert_escape): Remove unreachable break.
583
5842021-11-30 Jakub Jelinek <jakub@redhat.com>
585
586 PR c++/100977
587 * init.c (lang_defaults): Enable cxx23_identifiers for
588 -std={gnu,c}++{11,14,17,20} too.
589
87cd82c8
GA
5902021-11-29 Eric Gallager <egallager@gcc.gnu.org>
591
592 PR other/103021
593 * Makefile.in: Use ETAGS variable in TAGS target.
594 * configure: Regenerate.
595 * configure.ac: Allow ETAGS variable to be overridden.
596
e1d43592
GA
5972021-11-23 Christophe Lyon <christophe.lyon@foss.st.com>
598
599 PR preprocessor/103355
600 * system.h (ATTR_LIKELY): Fix definition.
601
6022021-11-23 Marek Polacek <polacek@redhat.com>
603 Jonathan Wakely <jwakely@redhat.com>
604
605 PR preprocessor/103355
606 * lex.c: Use ATTR_LIKELY instead of [[likely]].
607 * system.h (ATTR_LIKELY): Define.
608
06be28f6
GA
6092021-11-22 Jakub Jelinek <jakub@redhat.com>
610 Tobias Burnus <tobias@codesourcery.com>
611
612 PR preprocessor/103165
613 * internal.h (struct lexer_state): Add ignore__Pragma field.
614 * macro.c (builtin_macro): Don't interpret _Pragma if
615 pfile->state.ignore__Pragma.
616 (expand_arg): Temporarily set pfile->state.ignore__Pragma to 1.
617
280d2838
GA
6182021-11-17 David Malcolm <dmalcolm@redhat.com>
619
620 PR preprocessor/103026
621 * lex.c (struct bidi::context): New.
622 (bidi::vec): Convert to a vec of context rather than unsigned
623 char.
624 (bidi::ctx_at): Rename to...
625 (bidi::pop_kind_at): ...this and reimplement for above change.
626 (bidi::current_ctx): Update for change to vec.
627 (bidi::current_ctx_ucn_p): Likewise.
628 (bidi::current_ctx_loc): New.
629 (bidi::on_char): Update for usage of context struct. Add "loc"
630 param and pass it when pushing contexts.
631 (get_location_for_byte_range_in_cur_line): New.
632 (get_bidi_utf8): Rename to...
633 (get_bidi_utf8_1): ...this, reintroducing...
634 (get_bidi_utf8): ...as a wrapper, setting *OUT when the result is
635 not NONE.
636 (get_bidi_ucn): Rename to...
637 (get_bidi_ucn_1): ...this, reintroducing...
638 (get_bidi_ucn): ...as a wrapper, setting *OUT when the result is
639 not NONE.
640 (class unpaired_bidi_rich_location): New.
641 (maybe_warn_bidi_on_close): Use unpaired_bidi_rich_location when
642 reporting on unpaired bidi chars. Split into singular vs plural
643 spellings.
644 (maybe_warn_bidi_on_char): Pass in a location_t rather than a
645 const uchar * and use it when emitting warnings, and when calling
646 bidi::on_char.
647 (_cpp_skip_block_comment): Capture location when kind is not NONE
648 and pass it to maybe_warn_bidi_on_char.
649 (skip_line_comment): Likewise.
650 (forms_identifier_p): Likewise.
651 (lex_raw_string): Likewise.
652 (lex_string): Likewise.
653
6542021-11-17 David Malcolm <dmalcolm@redhat.com>
655
656 PR preprocessor/103026
657 * lex.c (maybe_warn_bidi_on_close): Use a rich_location
658 and call set_escape_on_output (true) on it.
659 (maybe_warn_bidi_on_char): Likewise.
660
6612021-11-17 Jakub Jelinek <jakub@redhat.com>
662
663 PR preprocessor/103130
664 * lex.c (cpp_directive_only_process): Treat even \*/ as end of block
665 comment.
666
6672021-11-17 Marek Polacek <polacek@redhat.com>
668
669 PR preprocessor/103026
670 * include/cpplib.h (enum cpp_bidirectional_level): New.
671 (struct cpp_options): Add cpp_warn_bidirectional.
672 (enum cpp_warning_reason): Add CPP_W_BIDIRECTIONAL.
673 * internal.h (struct cpp_reader): Add warn_bidi_p member
674 function.
675 * init.c (cpp_create_reader): Set cpp_warn_bidirectional.
676 * lex.c (bidi): New namespace.
677 (get_bidi_utf8): New function.
678 (get_bidi_ucn): Likewise.
679 (maybe_warn_bidi_on_close): Likewise.
680 (maybe_warn_bidi_on_char): Likewise.
681 (_cpp_skip_block_comment): Implement warning about bidirectional
682 control characters.
683 (skip_line_comment): Likewise.
684 (forms_identifier_p): Likewise.
685 (lex_identifier): Likewise.
686 (lex_string): Likewise.
687 (lex_raw_string): Likewise.
688
cf82e8d9
GA
6892021-11-01 David Malcolm <dmalcolm@redhat.com>
690
691 * charset.c (convert_escape): Use encoding_rich_location when
692 complaining about nonprintable unknown escape sequences.
693 (cpp_display_width_computation::::cpp_display_width_computation):
694 Pass in policy rather than tabstop.
695 (cpp_display_width_computation::process_next_codepoint): Add "out"
696 param and populate *out if non-NULL.
697 (cpp_display_width_computation::advance_display_cols): Pass NULL
698 to process_next_codepoint.
699 (cpp_byte_column_to_display_column): Pass in policy rather than
700 tabstop. Pass NULL to process_next_codepoint.
701 (cpp_display_column_to_byte_column): Pass in policy rather than
702 tabstop.
703 * errors.c (cpp_diagnostic_get_current_location): New function,
704 splitting out the logic from...
705 (cpp_diagnostic): ...here.
706 (cpp_warning_at): New function.
707 (cpp_pedwarning_at): New function.
708 * include/cpplib.h (cpp_warning_at): New decl for rich_location.
709 (cpp_pedwarning_at): Likewise.
710 (struct cpp_decoded_char): New.
711 (struct cpp_char_column_policy): New.
712 (cpp_display_width_computation::cpp_display_width_computation):
713 Replace "tabstop" param with "policy".
714 (cpp_display_width_computation::process_next_codepoint): Add "out"
715 param.
716 (cpp_display_width_computation::m_tabstop): Replace with...
717 (cpp_display_width_computation::m_policy): ...this.
718 (cpp_byte_column_to_display_column): Replace "tabstop" param with
719 "policy".
720 (cpp_display_width): Likewise.
721 (cpp_display_column_to_byte_column): Likewise.
722 * include/line-map.h (rich_location::escape_on_output_p): New.
723 (rich_location::set_escape_on_output): New.
724 (rich_location::m_escape_on_output): New.
725 * internal.h (cpp_diagnostic_get_current_location): New decl.
726 (class encoding_rich_location): New.
727 * lex.c (skip_whitespace): Use encoding_rich_location when
728 complaining about null characters.
729 (warn_about_normalization): Generate a source range when
730 complaining about improperly normalized tokens, rather than just a
731 point, and use encoding_rich_location so that the source code
732 is escaped on printing.
733 * line-map.c (rich_location::rich_location): Initialize
734 m_escape_on_output.
735
4c61300f
GA
7362021-10-29 Tobias Burnus <tobias@codesourcery.com>
737
738 PR c++/102409
739 * directives.c (destringize_and_run): Add PRAGMA_OP to the
740 CPP_PRAGMA token's flags to mark is as coming from _Pragma.
741 * include/cpplib.h (PRAGMA_OP): #define, to be used with token flags.
742 * macro.c (collect_args): Only handle CPP_PRAGMA special if PRAGMA_OP
743 is set.
744
c2bd5d8a
GA
7452021-10-22 Eric Gallager <egallager@gcc.gnu.org>
746
747 PR other/102663
748 * Makefile.in: Add dummy install-dvi target.
749
ce4d1f63
GA
7502021-10-18 Martin Liska <mliska@suse.cz>
751
752 * charset.c (convert_oct): Remove unused but set variable.
753
57c7ec62
GA
7542021-10-06 Jakub Jelinek <jakub@redhat.com>
755
756 * init.c (lang_defaults): Implement P2334R1, enable elifdef for
757 -std=c++23 and -std=gnu++23.
758 * directives.c (_cpp_handle_directive): Support elifdef/elifndef if
759 either CPP_OPTION (pfile, elifdef) or !CPP_OPTION (pfile, std).
760 (do_elif): For older non-std modes if pedantic pedwarn about
761 #elifdef/#elifndef directives that change behavior.
762
e11c6046
GA
7632021-09-01 Jakub Jelinek <jakub@redhat.com>
764
765 PR c++/100977
766 * include/cpplib.h (struct cpp_options): Add cxx23_identifiers.
767 * charset.c (CXX23, NXX23): New enumerators.
768 (CID, NFC, NKC, CTX): Renumber.
769 (ucn_valid_in_identifier): Implement P1949R7 - use CXX23 and
770 NXX23 flags for cxx23_identifiers. For start character in
771 non-pedantic mode, allow characters that are allowed as start
772 characters in any of the supported language modes, rather than
773 disallowing characters allowed only as non-start characters in
774 current mode but for characters from other language modes allowing
775 them even if they are never allowed at start.
776 * init.c (struct lang_flags): Add cxx23_identifiers.
777 (lang_defaults): Add cxx23_identifiers column.
778 (cpp_set_lang): Initialize CPP_OPTION (pfile, cxx23_identifiers).
779 * lex.c (warn_about_normalization): If cxx23_identifiers, use
780 cpp_pedwarning_with_line instead of cpp_warning_with_line for
781 "is not in NFC" diagnostics.
782 * makeucnid.c: Adjust usage comment.
783 (CXX23, NXX23): New enumerators.
784 (all_languages): Add CXX23.
785 (not_NFC, not_NFKC, maybe_not_NFC): Renumber.
786 (read_derivedcore): New function.
787 (write_table): Print also CXX23 and NXX23 columns.
788 (main): Require 5 arguments instead of 4, call read_derivedcore.
789 * ucnid.h: Regenerated using Unicode 13.0.0 files.
790
7912021-09-01 Jason Merrill <jason@redhat.com>
792
793 * macro.c (replace_args): When __VA_OPT__ is on the LHS of ##,
794 remove trailing avoid_paste tokens.
795
7962021-09-01 Jakub Jelinek <jakub@redhat.com>
797
798 PR preprocessor/101488
799 * macro.c (replace_args): Fix up handling of CPP_PADDING tokens at the
800 start or end of __VA_OPT__ arguments when preceeded or followed by ##.
801
6d51ee43
GA
8022021-08-31 Martin Sebor <msebor@redhat.com>
803
804 * include/line-map.h (class rich_location): Disable copying and
805 assignment.
806
85d77ac4
GA
8072021-08-25 Lewis Hyatt <lhyatt@gmail.com>
808
809 PR other/93067
810 * charset.c (init_iconv_desc): Adapt to permit PFILE argument to
811 be NULL.
812 (_cpp_convert_input): Likewise. Also move UTF-8 BOM logic to...
813 (cpp_check_utf8_bom): ...here. New function.
814 (cpp_input_conversion_is_trivial): New function.
815 * files.c (read_file_guts): Allow PFILE argument to be NULL. Add
816 INPUT_CHARSET argument as an alternate source of this information.
817 (read_file): Pass the new argument to read_file_guts.
818 (cpp_get_converted_source): New function.
819 * include/cpplib.h (struct cpp_converted_source): Declare.
820 (cpp_get_converted_source): Declare.
821 (cpp_input_conversion_is_trivial): Declare.
822 (cpp_check_utf8_bom): Declare.
823
2d14d64b
GA
8242021-08-17 Jakub Jelinek <jakub@redhat.com>
825
826 * macro.c (vaopt_state): Add m_stringify member.
827 (vaopt_state::vaopt_state): Initialize it.
828 (vaopt_state::update): Overwrite it.
829 (vaopt_state::stringify): New method.
830 (stringify_arg): Replace arg argument with first, count arguments
831 and add va_opt argument. Use first instead of arg->first and
832 count instead of arg->count, for va_opt add paste_tokens handling.
833 (paste_tokens): Fix up len calculation. Don't spell rhs twice,
834 instead use %.*s to supply lhs and rhs spelling lengths. Don't call
835 _cpp_backup_tokens here.
836 (paste_all_tokens): Call it here instead.
837 (replace_args): Adjust stringify_arg caller. For vaopt_state::END
838 if stringify is true handle __VA_OPT__ stringification.
839 (create_iso_definition): Handle # __VA_OPT__ similarly to # macro_arg.
840
72be20e2
GA
8412021-08-12 Jakub Jelinek <jakub@redhat.com>
842
843 PR preprocessor/101638
844 * macro.c (cpp_sys_macro_p): Return true instead of
845 crashing on builtin macros.
846
8ebf4fb5
GA
8472021-08-05 Jakub Jelinek <jakub@redhat.com>
848
849 PR c++/100977
850 * ucnid.h: Regenerated using Unicode 13.0.0 files.
851
8522021-08-05 Jakub Jelinek <jakub@redhat.com>
853
854 PR c++/100977
855 * makeucnid.c (write_table): Fix computation of last_combine.
856 * ucnid.h: Regenerated using Unicode 6.3.0 files.
857
9a61dfdb
GA
8582021-06-16 Jason Merrill <jason@redhat.com>
859
860 PR c++/100796
861 PR preprocessor/96391
862 * line-map.c (linemap_compare_locations): Only use comparison with
863 LINE_MAP_MAX_LOCATION_WITH_COLS to avoid abort.
864
ea34e2ed
GA
8652021-05-20 Christophe Lyon <christophe.lyon@linaro.org>
866 Torbjörn Svensson <torbjorn.svensson@st.com>
867
868 PR c/42579
869 * include/cpplib.h (cpp_builtin_type): Add BT_FILE_NAME entry.
870 * init.c (builtin_array): Likewise.
871 * macro.c (_cpp_builtin_macro_text): Add support for BT_FILE_NAME.
872
8732021-05-20 Jakub Jelinek <jakub@redhat.com>
874
875 PR preprocessor/100646
876 * lex.c (cpp_directive_only_process): Treat end of file as termination
877 for !is_block comments.
878
0ff3a0f2
GA
8792021-05-12 Jakub Jelinek <jakub@redhat.com>
880
881 PR preprocessor/100392
882 * lex.c (cpp_directive_only_process): If buffer doesn't end with '\n',
883 add buffer->rlimit[0] character to the printed range and
884 CPP_INCREMENT_LINE and increment line_count.
885
037e3661
GA
8862021-05-11 Joseph Myers <joseph@codesourcery.com>
887
888 * include/cpplib.h (struct cpp_options): Add elifdef.
889 * init.c (struct lang_flags): Add elifdef.
890 (lang_defaults): Update to include elifdef initializers.
891 (cpp_set_lang): Set elifdef for pfile based on language.
892 * directives.c (STDC2X, ELIFDEF): New macros.
893 (EXTENSION): Increase value to 3.
894 (DIRECTIVE_TABLE): Add #elifdef and #elifndef.
895 (_cpp_handle_directive): Do not treat ELIFDEF directives as
896 directives for language versions without the #elifdef feature.
897 (do_elif): Handle #elifdef and #elifndef.
898 (do_elifdef, do_elifndef): New functions.
899
9002021-05-11 Joseph Myers <joseph@codesourcery.com>
901
902 * lex.c (cpp_avoid_paste): Do not allow pasting CPP_NUMBER with
903 CPP_CHAR.
904
9052021-05-11 Joseph Myers <joseph@codesourcery.com>
906
907 * init.c (lang_defaults): Enable digit separators for GNUC2X and
908 STDC2X.
909
62d87a32
GA
9102021-05-07 Jakub Jelinek <jakub@redhat.com>
911
912 PR c/100450
913 * lex.c (cpp_avoid_paste): Handle token1 CPP_PRAGMA like CPP_NAME.
914
cfe82a0c
GA
9152021-05-06 Joseph Myers <joseph@codesourcery.com>
916
917 PR c++/83873
918 PR preprocessor/97604
919 * lex.c (lex_number): Reject adjacent digit separators here. Do
920 not allow digit separators before '.' or an exponent with sign.
921 * expr.c (cpp_classify_number): Do not check for adjacent digit
922 separators here.
923
e690396d
GA
9242021-05-03 H.J. Lu <hjl.tools@gmail.com>
925
926 PR bootstrap/99703
927 * configure: Regenerated.
928
3c8e539d
GA
9292021-04-29 Joseph Myers <joseph@codesourcery.com>
930
931 PR preprocessor/82359
932 * directives.c (strtolinenum): Handle digit separators.
933
6e81e015
GA
9342021-04-19 Richard Biener <rguenther@suse.de>
935
936 PR preprocessor/100142
937 * line-map.c (linemap_position_for_loc_and_offset): Revert
938 unintended s/column_offset/column/ change.
939
6d0d35d5
GA
9402021-04-13 Nathan Sidwell <nathan@acm.org>
941
942 PR preprocessor/99446
943 * line-map.c (line-map.c): Do not advance to linemaps for
944 different files.
945
9462021-04-13 Eric Botcazou <ebotcazou@adacore.com>
947
948 * include/line-map.h (IS_MACRO_LOC): Delete.
949 * line-map.c (linemap_location_from_macro_expansion_p): Test
950 LINEMAPS_MACRO_LOWEST_LOCATION of the linemap.
951
d97a92dc
GA
9522021-03-02 David Malcolm <dmalcolm@redhat.com>
953
954 PR c/99323
955 * line-map.c (rich_location::maybe_add_fixit): Reject fix-it hints
956 at column 0.
957
4028d01a
GA
9582021-02-24 Nathan Sidwell <nathan@acm.org>
959
960 PR c++/98718
961 * include/line-map.h
962 * line-map.c
963
9642021-02-24 Nathan Sidwell <nathan@acm.org>
965
966 PR c++/99072
967 * init.c (read_original_filename): Expunge all evidence of the
968 original filename.
969
bf81237e
GA
9702021-02-18 Nathan Sidwell <nathan@acm.org>
971
972 PR c++/99023
973 * include/cpplib.h (cpp_find_header_unit): Rename to ...
974 (cpp_probe_header_unit): ... this.
975 * internal.h (_cp_find_header_unit): Declare.
976 * files.c (cpp_find_header_unit): Break apart to ..
977 (test_header_unit): ... this, and ...
978 (_cpp_find_header_unit): ... and, or and ...
979 (cpp_probe_header_unit): ... this.
980 * macro.c (cpp_get_token_1): Call _cpp_find_header_unit.
981
0e804ce3
GA
9822021-02-16 Nathan Sidwell <nathan@acm.org>
983
984 * files.c (_cpp_stack_file): Make buffers end in unread \n.
985
4b37c3ea
GA
9862021-02-10 David Malcolm <dmalcolm@redhat.com>
987
988 PR preprocessor/96391
989 * line-map.c (linemap_compare_locations): Require that
990 the location be <= LINE_MAP_MAX_LOCATION_WITH_COLS when
991 treating locations as coming from the same macro expansion.
992
a19dd5e6
GA
9932021-02-04 Jakub Jelinek <jakub@redhat.com>
994
995 * expr.c (cpp_classify_number): Use make_signed_t<size_t> instead of
996 make_signed<size_t>::type in the diagnostics.
997
9faaa807
GA
9982021-02-03 Jakub Jelinek <jakub@redhat.com>
999
1000 PR preprocessor/98882
1001 * lex.c (cpp_directive_only_process): Don't assert that rlimit[-1]
1002 is a newline, instead assert that rlimit[0] is either newline or
1003 carriage return. When seeing '\\' followed by '\r', check limit
1004 before accessing pos[1].
1005
10062021-02-03 Ed Smith-Rowland <3dw4rd@verizon.net>
1007
1008 * expr.c (interpret_int_suffix): Detect 'z' integer suffix.
1009 (cpp_classify_number): Compat warning for use of 'z' suffix.
1010 * include/cpplib.h (struct cpp_options): New flag.
1011 (enum cpp_warning_reason): New flag.
1012 (CPP_N_USERDEF): Comment C++0x -> C++11.
1013 (CPP_N_SIZE_T): New flag for cpp_classify_number.
1014 * init.c (cpp_set_lang): Initialize new flag.
1015
aa69f0a8
GA
10162021-01-27 liuhongt <hongtao.liu@intel.com>
1017
1018 PR target/98833
1019 * lex.c (search_line_sse2): Replace builtins with == operator.
1020
e62bb7f0
GA
10212021-01-26 Paul Fee <paul.f.fee@gmail.com>
1022
1023 * include/cpplib.h (c_lang): Add CXX23 and GNUCXX23.
1024 * init.c (lang_defaults): Add rows for CXX23 and GNUCXX23.
1025 (cpp_init_builtins): Set __cplusplus to 202100L for C++23.
1026
2f7f0d32
GA
10272021-01-15 Nathan Sidwell <nathan@acm.org>
1028
1029 PR preprocessor/95253
1030 * mkdeps.c (munge): Do not escape ':'.
1031
d52945ce
GA
10322020-12-14 Nathan Sidwell <nathan@acm.org>
1033
1034 * include/cpplib.h (struct cpp_macro): Add imported_p field.
1035 (struct cpp_hashnode): Tweak deferred field documentation.
1036 * macro.c (_cpp_new_macro): Clear new field.
1037 (cpp_get_deferred_macro, get_deferred_or_lazy_macro): Assert
1038 more.
1039
35af8778
GA
10402020-12-10 Jason Merrill <jason@redhat.com>
1041
1042 * init.c (cpp_init_builtins): Update __cplusplus for C++20.
1043
e0f5e792
GA
10442020-12-01 JeanHeyd Meneide <phdofthehouse@gmail.com>
1045
1046 * charset.c (init_iconv_desc): Initialize "to" and "from" fields.
1047 * directives.c (cpp_get_narrow_charset_name): New function.
1048 (cpp_get_wide_charset_name): Likewise.
1049 * include/cpplib.h (cpp_get_narrow_charset_name): Prototype.
1050 (cpp_get_wide_charset_name): Likewise.
1051 * internal.h (cset_converter): Add "to" and "from" fields.
1052
e87559d2
GA
10532020-11-27 Joseph Myers <joseph@codesourcery.com>
1054
1055 PR preprocessor/97602
1056 * directives.c (strtolinenum): Check for overflow before it
1057 occurs. Correct comment.
1058
1e2c9a27
GA
10592020-11-24 Nathan Sidwell <nathan@acm.org>
1060
1061 * include/cpplib.h (struct cpp_hashnode): Add deferred field.
1062 (cpp_set_deferred_macro): Define.
1063 (cpp_get_deferred_macro): Declare.
1064 (cpp_macro_definition): Reformat, add overload.
1065 (cpp_macro_definition_location): Deal with deferred macro.
1066 (cpp_alloc_token_string, cpp_compare_macro): Declare.
1067 * internal.h (_cpp_notify_macro_use): Return bool
1068 (_cpp_maybe_notify_macro_use): Likewise.
1069 * directives.c (do_undef): Check macro is not undef before
1070 warning.
1071 (do_ifdef, do_ifndef): Deal with deferred macro.
1072 * expr.c (parse_defined): Likewise.
1073 * lex.c (cpp_allocate_token_string): Break out of ...
1074 (create_literal): ... here. Call it.
1075 (cpp_maybe_module_directive): Deal with deferred macro.
1076 * macro.c (cpp_get_token_1): Deal with deferred macro.
1077 (warn_of_redefinition): Deal with deferred macro.
1078 (compare_macros): Rename to ...
1079 (cpp_compare_macro): ... here. Make extern.
1080 (cpp_get_deferred_macro): New.
1081 (_cpp_notify_macro_use): Deal with deferred macro, return bool
1082 indicating definedness.
1083 (cpp_macro_definition): Deal with deferred macro.
1084
d62586ee
GA
10852020-11-19 Nathan Sidwell <nathan@acm.org>
1086
1087 * include/cpplib.h (enum cpp_main_search): New.
1088 (struct cpp_options): Add main_search field.
1089 (cpp_main_loc): Declare.
1090 (cpp_retrofit_as_include): Declare.
1091 * internal.h (struct cpp_reader): Add main_loc field.
1092 (_cpp_in_main_source_file): Not main if main is a header.
1093 * init.c (cpp_read_main_file): Use main_search option to locate
1094 main file. Set main_loc
1095 * files.c (cpp_retrofit_as_include): New.
1096
10972020-11-19 Nathan Sidwell <nathan@acm.org>
1098
1099 * internal.h (cpp_in_system_header): Rename to ...
1100 (_cpp_in_system_header): ... here.
1101 (cpp_in_primary_file): Rename to ...
1102 (_cpp_in_main_source_file): ... here. Compare main_file equality
1103 and check main_search value.
1104 * lex.c (maybe_va_opt_error, _cpp_lex_direct): Adjust for rename.
1105 * macro.c (_cpp_builtin_macro_text): Likewise.
1106 (replace_args): Likewise.
1107 * directives.c (do_include_next): Likewise.
1108 (do_pragma_once, do_pragma_system_header): Likewise.
1109 * files.c (struct _cpp_file): Delete main_file field.
1110 (pch_open): Check pfile->main_file equality.
1111 (make_cpp_file): Drop cpp_reader parm, don't set main_file.
1112 (_cpp_find_file): Adjust.
1113 (_cpp_stack_file): Check pfile->main_file equality.
1114 (struct report_missing_guard_data): Add cpp_reader field.
1115 (report_missing_guard): Check pfile->main_file equality.
1116 (_cpp_report_missing_guards): Adjust.
1117
25bb75f8
GA
11182020-11-18 Nathan Sidwell <nathan@acm.org>
1119
1120 * include/cpplib.h (struct cpp_options): Add module_directives
1121 option.
1122 (NODE_MODULE): New node flag.
1123 (struct cpp_hashnode): Make rid-code a bitfield, increase bits in
1124 flags and swap with type field.
1125 * init.c (post_options): Create module-directive identifier nodes.
1126 * internal.h (struct lexer_state): Add directive_file_token &
1127 n_modules fields. Add module node enumerator.
1128 * lex.c (cpp_maybe_module_directive): New.
1129 (_cpp_lex_token): Call it.
1130 (cpp_output_token): Add '"' around CPP_HEADER_NAME token.
1131 (do_peek_ident, do_peek_module): New.
1132 (cpp_directives_only): Detect module-directive lines.
1133 * macro.c (cpp_get_token_1): Deal with directive_file_token
1134 triggering.
1135
11362020-11-18 Nathan Sidwell <nathan@acm.org>
1137
1138 * files.c (struct _cpp_file): Add header_unit field.
1139 (_cpp_stack_file): Add header unit support.
1140 (cpp_find_header_unit): New.
1141 * include/cpplib.h (cpp_find_header_unit): Declare.
1142
11432020-11-18 Nathan Sidwell <nathan@acm.org>
1144
1145 * include/cpplib.h (struct cpp_options): Add modules to
1146 dep-options.
1147 * include/mkdeps.h (deps_add_module_target): Declare.
1148 (deps_add_module_dep): Declare.
1149 * mkdeps.c (class mkdeps): Add modules, module_name, cmi_name,
1150 is_header_unit fields. Adjust cdtors.
1151 (deps_add_module_target, deps_add_module_dep): New.
1152 (make_write): Write module dependencies, if enabled.
1153
4dabb037
GA
11542020-11-17 Nathan Sidwell <nathan@acm.org>
1155
1156 * include/cpplib.h (struct cpp_callbacks): Add
1157 user_deferred_macro & translate_include.
1158
11592020-11-17 Nathan Sidwell <nathan@acm.org>
1160
1161 * include/line-map.h (enum lc_reason): Add LC_MODULE.
1162 (MAP_MODULE_P): New.
1163 (line_map_new_raw): Declare.
1164 (linemap_enter_macro): Move declaration from internal.h
1165 (linemap_module_loc, linemap_module_reparent)
1166 (linemap_module_restore): Declare.
1167 (linemap_lookup_macro_indec): Declare.
1168 * internal.h (linemap_enter_macro): Moved to line-map.h.
1169 * line-map.c (linemap_new_raw): New, broken out of ...
1170 (new_linemap): ... here. Call it.
1171 (LAST_SOURCE_LINE_LOCATION): New.
1172 (liemap_module_loc, linemap_module_reparent)
1173 (linemap_module_restore): New.
1174 (linemap_lookup_macro_index): New, broken out of ...
1175 (linemap_macro_map_lookup): ... here. Call it.
1176 (linemap_dump): Add module dump.
1177
11782020-11-17 Nathan Sidwell <nathan@acm.org>
1179
1180 PR preprocessor/97858
1181 * mkdeps.c (munge): Drop varadic args, we only ever use one.
1182
77f67db2
GA
11832020-11-13 Joseph Myers <joseph@codesourcery.com>
1184
1185 * expr.c (cpp_classify_number): Update diagnostic for binary
1186 constants for C. Also diagnose binary constants for
1187 -Wc11-c2x-compat.
1188 * init.c (lang_defaults): Enable binary constants for GNUC2X and
1189 STDC2X.
1190
11912020-11-13 Piotr H. Dabrowski <phd@phd.re>
1192
1193 PR c++/91318
1194 * include/cpplib.h: Added cpp_define_unused(), cpp_define_formatted_unused()
1195 * directives.c: Likewise.
1196
a5a11525
GA
11972020-11-12 Joseph Myers <joseph@codesourcery.com>
1198
1199 * include/cpplib.h (struct cpp_callbacks): Add bool argument to
1200 has_attribute.
1201 (enum cpp_builtin_type): Add BT_HAS_STD_ATTRIBUTE.
1202 * init.c (builtin_array): Add __has_c_attribute.
1203 (cpp_init_special_builtins): Handle BT_HAS_STD_ATTRIBUTE.
1204 * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_STD_ATTRIBUTE.
1205 Update call to has_attribute for BT_HAS_ATTRIBUTE.
1206 * traditional.c (fun_like_macro): Handle BT_HAS_STD_ATTRIBUTE.
1207
12082020-11-12 Nicholas Guriev <guriev-ns@ya.ru>
1209
1210 PR pch/86674
1211 * files.c (_cpp_find_file): Use CPP_DL_NOTE not CPP_DL_ERROR in call to
1212 cpp_error.
1213
2da7ee05
GA
12142020-11-07 Lewis Hyatt <lhyatt@gmail.com>
1215
1216 * generated_cpp_wcwidth.h: Regenerated from Unicode 13.0.0 data.
1217
44cab2d8
GA
12182020-11-06 Nathan Sidwell <nathan@acm.org>
1219
1220 * include/cpplib.h (enum class CPP_time_kind): New.
1221 (cpp_get_date): Declare.
1222 * internal.h (struct cpp_reader): Replace source_date_epoch with
1223 time_stamp and time_stamp_kind.
1224 * init.c (cpp_create_reader): Initialize them.
1225 * macro.c (_cpp_builtin_macro_text): Use cpp_get_date.
1226 (cpp_get_date): Broken out from _cpp_builtin_macro_text and
1227 genericized.
1228
fd2325ea
GA
12292020-11-03 Nathan Sidwell <nathan@acm.org>
1230
1231 * lex.c (cpp_peek_token): Do not peek past CPP_PRAGMA.
1232 (_cpp_lex_direct): Handle EOF in pragma when setting need_line,
1233 not when needing a line.
1234
12352020-11-03 Nathan Sidwell <nathan@acm.org>
1236
1237 * lex.c (_cpp_clean_line): Fix DOS off-by-one error.
1238
12392020-11-03 Nathan Sidwell <nathan@acm.org>
1240
1241 * init.c (cpp_read_main_file): Use cpp_get_deps result.
1242
12432020-11-03 Nathan Sidwell <nathan@acm.org>
1244
1245 * include/mkdeps.h: Include cpplib.h
1246 (deps_write): Adjust first parm type.
1247 * mkdeps.c: Include internal.h
1248 (make_write): Adjust first parm type. Check phony option
1249 directly.
1250 (deps_write): Adjust first parm type.
1251 * init.c (cpp_read_main_file): Use get_deps.
1252 * directives.c (cpp_get_deps): Check option before initializing.
1253
88ce3d5f
GA
12542020-11-02 Nathan Sidwell <nathan@acm.org>
1255
1256 * internal.h (_cpp_notify_macro_use): Add location parm.
1257 (_cpp_maybe_notify_macro_use): Likewise.
1258 * directives.c (_cpp_do_file_change): Check we've not changed file
1259 when optimizing a rewind.
1260 (do_ifdef): Pass location to _cpp_maybe_notify_macro_use.
1261 (do_ifndef): Likewise. Delete obsolete comment about powerpc.
1262 * expr.c (parse_defined): Pass location to
1263 _cpp_maybe_notify_macro_use.
1264 * macro.c (enter_macro_context): Likewise.
1265 (warn_of_redefinition): Break out helper function. Call it.
1266 (compare_macros): New function broken out of warn_of_redefinition.
1267 (_cpp_new_macro): Zero all fields.
1268 (_cpp_notify_macro_use): Add location parameter.
1269
e2e04288
GA
12702020-10-20 Nathan Sidwell <nathan@acm.org>
1271
1272 * lex.c (_cpp_lex_direct): Do not complete EOF processing when
1273 parsing_args.
1274 * macro.c (collect_args): Do not unwind fake EOF.
1275 (funlike_invocation_p): Do not unwind fake EOF.
1276 (cpp_context): Replace abort with gcc_assert.
1277
970d683f
GA
12782020-10-19 Nathan Sidwell <nathan@acm.org>
1279
1280 * internal.h (struct cpp_reader): Rename 'eof' field to 'endarg'.
1281 * init.c (cpp_create_reader): Adjust.
1282 * macro.c (collect_args): Use endarg for separator. Always rewind
1283 in the not-fn case.
1284
da9df699
GA
12852020-10-08 Nathan Sidwell <nathan@acm.org>
1286
1287 * internal.h (enum include_type): Rename IT_MAIN_INJECT to
1288 IT_PRE_MAIN.
1289 * init.c (cpp_read_main_file): If there is no line marker, adjust
1290 the initial line marker.
1291 (read_original_filename): Return bool, peek the buffer directly
1292 before trying to tokenize.
1293 (read_original_directory): Likewise. Directly prod the string
1294 literal.
1295 * files.c (_cpp_stack_file): Adjust for IT_PRE_MAIN change.
1296
91dd4a38
GA
12972020-09-26 Jakub Jelinek <jakub@redhat.com>
1298
1299 PR bootstrap/97163
1300 * lex.c (search_line_fast): Only use _ARCH_PWR8 Altivec version
1301 for GCC >= 4.5.
1302
2aad20c0
GA
13032020-09-17 Patrick Palka <ppalka@redhat.com>
1304
1305 PR c/80076
1306 * include/line-map.h (first_map_in_common): Declare.
1307 * line-map.c (first_map_in_common): Remove static.
1308
a995c40d
GA
13092020-09-07 Martin Storsjö <martin@martin.st>
1310
1311 * files.c (remap_filename): Make a strchr return value pointer
1312 to const.
1313
d48cca8f
GA
13142020-07-30 H.J. Lu <hjl.tools@gmail.com>
1315
1316 PR bootstrap/96202
1317 * configure: Regenerated.
1318
bea7a391
GA
13192020-07-29 Tiziano Müller <tiziano.mueller@chem.uzh.ch>
1320
1321 * init.c (builtin_array): Add xref comment.
1322 * traditional.c (fun_like_macro): Add HAS_INCLUDE codes.
1323
7ebb7d0c
GA
13242020-07-28 Jakub Jelinek <jakub@redhat.com>
1325
1326 PR preprocessor/96323
1327 * lex.c (lex_raw_string): For c == '\n' don't continue after reporting
1328 an prefix delimiter error.
1329
13302020-07-28 Nathan Sidwell <nathan@acm.org>
1331
1332 * init.c (cpp_read_main_file): Always use the last map for
1333 the return value.
1334
0933f508
GA
13352020-07-20 Nathan Sidwell <nathan@acm.org>
1336
1337 * line-map.c (linemap_add): Simplify column overflow calculation.
1338 Add comment about range and column bit init.
1339 (linemap_ordinary_map_lookup): Refactor for RAII
1340 (linemap_macro_map_lookup): Likewise.
1341
8ca07a30
GA
13422020-07-14 Lewis Hyatt <lhyatt@gmail.com>
1343
1344 PR preprocessor/49973
1345 PR other/86904
1346 * include/cpplib.h (struct cpp_options): Removed support for -ftabstop,
1347 which is now handled by diagnostic_context.
1348 (class cpp_display_width_computation): New class.
1349 (cpp_byte_column_to_display_column): Add optional tabstop argument.
1350 (cpp_display_width): Likewise.
1351 (cpp_display_column_to_byte_column): Likewise.
1352 * charset.c
1353 (cpp_display_width_computation::cpp_display_width_computation): New
1354 function.
1355 (cpp_display_width_computation::advance_display_cols): Likewise.
1356 (compute_next_display_width): Removed and implemented this
1357 functionality in a new function...
1358 (cpp_display_width_computation::process_next_codepoint): ...here.
1359 (cpp_byte_column_to_display_column): Added tabstop argument.
1360 Reimplemented in terms of class cpp_display_width_computation.
1361 (cpp_display_column_to_byte_column): Likewise.
1362 * init.c (cpp_create_reader): Remove handling of -ftabstop, which is now
1363 handled by diagnostic_context.
1364
f60ee68d
GA
13652020-07-07 Nathan Sidwell <nathan@acm.org>
1366
1367 * directives.c (do_linemarker): Optimize rewinding to line zero.
1368 * files.c (_cpp_stack_file): Start on line zero when about to inject
1369 headers.
1370 (cpp_push_include, cpp_push_default_include): Use highest_line as
1371 the location.
1372 * include/cpplib.h (cpp_read_main_file): Add injecting parm.
1373 * init.c (cpp_read_main_file): Likewise, inform _cpp_stack_file.
1374 * internal.h (enum include_type): Add IT_MAIN_INJECT.
1375
885ef72f
GA
13762020-05-29 H.J. Lu <hjl.tools@gmail.com>
1377
1378 PR bootstrap/95413
1379 * configure: Regenerated.
1380
731c4ce0
DE
13812020-05-23 David Edelsohn <dje.gcc@gmail.com>
1382
1383 * Makefile.in (AR): Substitute @AR@.
1384 * configure.ac (CHECK_PROG AR): New.
1385 * configure: Regenerate.
1386
4623a6f2
NS
13872020-05-20 Nathan Sidwell <nathan@acm.org>
1388
1389 * internal.h (typedef _cpp_file): Delete, unnecessary in C++.
1390 (enum _cpp_find_file_kind): New.
1391 (_cpp_find_file): Use it, not 3 bools.
1392 * files.c (_cpp_find_file): Use _cpp_find_file_kind enum, not
1393 bools.
1394 (cpp_make_system_header): Break overly long line.
1395 (_cpp_stack_include, _cpp_fake_include)
1396 (_cpp_do_file_change, _cpp_compare_file_date, _cpp_has_header): Adjust.
1397 * init.c (cpp_read_main): Adjust _cpp_find_file call.
1398
a641d6d3
NS
13992020-05-18 Nathan Sidwell <nathan@acm.org>
1400
7cf3f604
NS
1401 * include/cpplib.h (cpp_get_otions, cpp_get_callbacks)
1402 (cpp_get_deps): Mark as PURE.
1403 * include/line-map.h (get_combined_adhoc_loc)
1404 (get_location_from_adhoc_loc, get_pure_location): Reformat decls.
1405 * internal.h (struct lexer_state): Clarify comment.
1406 * system.h: Remove now-unneeded bool hackery.
1407 * files.c (_cpp_find_file): Store LOC not highest_location.
1408
ed63c387
NS
1409 PR preprocessor/95149
1410 * lex.c (struct lit_accum): New.
1411 (bufring_append): Replace by lit_accum::append.
1412 (lex_raw_string): Reimplement, using fragments of the old version.
1413 (lex_string): Adjust lex_raw_string call.
1414
a641d6d3
NS
1415 PR preprocessor/95182
1416 * macro.c (collect_args): Preserve EOFif we fell out of the main
1417 file.
1418 (cpp_get_token_1): Reformat a couple of short lines.
1419
8d286dd1
L
14202020-05-14 H.J. Lu <hongjiu.lu@intel.com>
1421
1422 * configure: Regenerated.
1423
b04445d4
JM
14242020-05-13 Jason Merrill <jason@redhat.com>
1425
1426 * include/cpplib.h (enum c_lang): Change CXX2A to CXX20.
1427 * init.c, lex.c: Adjust.
1428
2a0225e4
NS
14292020-05-12 Nathan Sidwell <nathan@acm.org>
1430
1431 EOF location is at end of file
1432 PR preprocessor/95013
1433 * lex.c (lex_raw_string): Process line notes before incrementing.
1434 Correct incrementing condition. Adjust for new
1435 _cpp_get_fresh_line EOF behaviour.
1436 (_cpp_get_fresh_line): Do not pop buffer at EOF, increment line
1437 instead.
1438 (_cpp_lex_direct): Adjust for new _cpp_get_fresh_line behaviour.
1439 (cpp_directive_only_process): Assert we got a fresh line.
1440 * traditional.c (_cpp_read_logical_line_trad): Adjust for new
1441 _cpp_get_fresh_line behaviour.
1442
051da742
L
14432020-05-12 H.J. Lu <hongjiu.lu@intel.com>
1444
1445 * Makefile.in (CET_HOST_FLAGS): New.
1446 (COMPILER): Add $(CET_HOST_FLAGS).
1447 * configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and
1448 AC_SUBST(CET_HOST_FLAGS). Clear CET_HOST_FLAGS if jit isn't
1449 enabled.
1450 * aclocal.m4: Regenerated.
1451 * configure: Likewise.
1452
b224c376
NS
14532020-05-08 Nathan Sidwell <nathan@acm.org>
1454
1455 Reimplement directives only processing, support raw literals.
1456 * directives-only.c: Delete.
1457 * Makefile.in (libcpp_a_OBJS, libcpp_a_SOURCES): Remove it.
1458 * include/cpplib.h (enum CPP_DO_task): New enum.
1459 (cpp_directive_only_preprocess): Declare.
1460 * internal.h (_cpp_dir_only_callbacks): Delete.
1461 (_cpp_preprocess_dir_only): Delete.
1462 * lex.c (do_peek_backslask, do_peek_next, do_peek_prev): New.
1463 (cpp_directives_only_process): New implementation.
1464
e235031d
JJ
14652020-02-14 Jakub Jelinek <jakub@redhat.com>
1466
1467 Partially implement P1042R1: __VA_OPT__ wording clarifications
1468 PR preprocessor/92319
1469 * macro.c (expand_arg): Move declarations before vaopt_state
1470 definition.
1471 (class vaopt_state): Move enum update_type definition earlier. Remove
1472 m_allowed member, add m_arg and m_update members.
1473 (vaopt_state::vaopt_state): Change last argument from bool any_args
1474 to macro_arg *arg, initialize m_arg and m_update instead of m_allowed.
1475 (vaopt_state::update): When bumping m_state from 1 to 2 and m_update
1476 is ERROR, determine if __VA_ARGS__ expansion has any non-CPP_PADDING
1477 tokens and set m_update to INCLUDE if it has any, DROP otherwise.
1478 Return m_update instead of m_allowed ? INCLUDE : DROP in m_state >= 2.
1479 (replace_args, create_iso_definition): Adjust last argument to
1480 vaopt_state ctor.
1481
297aa668
MS
14822020-02-05 Martin Sebor <msebor@redhat.com>
1483
1484 * include/cpplib.h (cpp_builtin_type): Remove trailing comma to
1485 avoid pedantic warnings in C++ 98 mode.
1486
c04babd9
JJ
14872020-02-04 Jakub Jelinek <jakub@redhat.com>
1488
f8d6e448
JJ
1489 * macro.c (builtin_has_include): Diagnose __has_include* use outside
1490 of preprocessing directives.
1491
c04babd9
JJ
1492 PR preprocessor/93545
1493 * macro.c (cpp_get_token_no_padding): New function.
1494 (builtin_has_include): Use it instead of cpp_get_token. Don't check
1495 SEEN_EOL.
1496
20fa702b
AB
14972020-02-01 Andrew Burgess <andrew.burgess@embecosm.com>
1498
1499 * configure: Regenerate.
1500
3d056cbf
NS
15012020-01-28 Nathan Sidwell <nathan@acm.org>
1502
1503 PR preprocessor/93452
1504 * internal.h (struct spec_nodes): Drop n__has_include{,_next}.
1505 * directives.c (lex_macro_node): Don't check __has_include redef.
1506 * expr.c (eval_token): Drop __has_include eval.
1507 (parse_has_include): Move to ...
1508 * macro.c (builtin_has_include): ... here.
1509 (_cpp_builtin_macro_text): Eval __has_include{,_next}.
1510 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_INCLUDE{,_NEXT}.
1511 * init.c (builtin_array): Add them.
1512 (cpp_init_builtins): Drop __has_include{,_next} init here ...
1513 * pch.c (cpp_read_state): ... and here.
1514 * traditional.c (enum ls): Drop has_include states ...
1515 (_cpp_scan_out_logical_line): ... and here.
1516
e7c26e04
AB
15172020-01-27 Andrew Burgess <andrew.burgess@embecosm.com>
1518
1519 * configure: Regenerate.
1520
a1f6eff2
NS
15212020-01-24 Nathan Sidwell <nathan@acm.org>
1522
1523 * expr.c (parse_has_include): Remove bogus controlling macro code.
1524
ad1a3914
NS
15252020-01-20 Nathan Sidwell <nathan@acm.org>
1526
1527 PR preprocessor/80005
1528 * include/cpplib.h (BT_HAS_ATTRIBUTE): Fix comment.
1529 * internal.h (struct lexer_state): Delete in__has_include field.
1530 (struct spec_nodes): Rename n__has_include{,_next}__ fields.
1531 (_cpp_defined_macro_p): New.
1532 (_cpp_find_file): Add has_include parm.
1533 * directives.c (lex_macro_node): Combine defined,
1534 __has_inline{,_next} checking.
1535 (do_ifdef, do_ifndef): Use _cpp_defined_macro_p.
1536 (_cpp_init_directives): Refactor.
1537 * expr.c (parse_defined): Use _cpp_defined_macro_p.
1538 (eval_token): Adjust parse_has_include calls.
1539 (parse_has_include): Add OP parameter. Reimplement.
1540 * files.c (_cpp_find_file): Add HAS_INCLUDE parm. Use it to
1541 inhibit error message.
1542 (_cpp_stack_include): Adjust _cpp_find_file call.
1543 (_cpp_fake_include, _cpp_compare_file_date): Likewise.
1544 (open_file_failed): Remove in__has_include check.
1545 (_cpp_has_header): Adjust _cpp_find_file call.
1546 * identifiers.c (_cpp_init_hashtable): Don't init
1547 __has_include{,_next} here ...
1548 * init.c (cpp_init_builtins): ... init them here. Define as
1549 macros.
1550 (cpp_read_main_file): Adjust _cpp_find_file call.
1551 * pch.c (cpp_read_state): Adjust __has_include{,_next} access.
1552 * traditional.c (_cpp_scan_out_locgical_line): Likewise.
bf09d886
NS
1553
1554 PR preprocessor/93306
1555 * expr.c (parse_has_include): Refactor. Check skip_eval before
1556 looking.
1557
4bc1899b
DM
15582020-01-10 David Malcolm <dmalcolm@redhat.com>
1559
1560 * include/line-map.h (class diagnostic_path): New forward decl.
1561 (rich_location::get_path): New accessor.
1562 (rich_location::set_path): New function.
1563 (rich_location::m_path): New field.
1564 * line-map.c (rich_location::rich_location): Initialize m_path.
1565
8d9254fc
JJ
15662020-01-01 Jakub Jelinek <jakub@redhat.com>
1567
1568 Update copyright years.
1569
6dd0c820
DM
15702019-12-18 David Malcolm <dmalcolm@redhat.com>
1571
1572 PR preprocessor/92982
1573 * charset.c
1574 (cpp_string_location_reader::cpp_string_location_reader): Delete
1575 initialization of m_line_table.
1576 * include/cpplib.h (cpp_string_location_reader::m_line_table):
1577 Delete unused member.
1578
937a778e
JJ
15792019-12-14 Jakub Jelinek <jakub@redhat.com>
1580
1581 PR preprocessor/92919
1582 * charset.c (wide_str_to_charconst): If str contains just the
1583 NUL terminator, punt quietly.
1584
d68f5d45
DM
15852019-12-09 David Malcolm <dmalcolm@redhat.com>
1586
1587 * include/line-map.h (label_text::label_text): Make private.
1588 (label_text::borrow): New.
1589 (label_text::take): New.
1590 (label_text::take_or_copy): New.
1591
ee925640
LH
15922019-12-09 Lewis Hyatt <lhyatt@gmail.com>
1593
1594 PR preprocessor/49973
1595 * generated_cpp_wcwidth.h: New file generated by
1596 ../contrib/unicode/gen_wcwidth.py, supports new cpp_wcwidth function.
1597 * charset.c (compute_next_display_width): New function to help
1598 implement display columns.
1599 (cpp_byte_column_to_display_column): Likewise.
1600 (cpp_display_column_to_byte_column): Likewise.
1601 (cpp_wcwidth): Likewise.
1602 * include/cpplib.h (cpp_byte_column_to_display_column): Declare.
1603 (cpp_display_column_to_byte_column): Declare.
1604 (cpp_wcwidth): Declare.
1605 (cpp_display_width): New function.
1606
7c5890cc
JM
16072019-11-14 Joseph Myers <joseph@codesourcery.com>
1608
1609 * charset.c (narrow_str_to_charconst): Make CPP_UTF8CHAR constants
1610 unsigned for C.
1611 * init.c (lang_defaults): Set utf8_char_literals for GNUC2X and
1612 STDC2X.
1613
2c03d736
JJ
16142019-11-07 Jakub Jelinek <jakub@redhat.com>
1615
1616 PR c++/91370 - Implement P1041R4 and P1139R2 - Stronger Unicode reqs
1617 * charset.c (narrow_str_to_charconst): Add TYPE argument. For
1618 CPP_UTF8CHAR diagnose whenever number of chars is > 1, using
1619 CPP_DL_ERROR instead of CPP_DL_WARNING.
1620 (wide_str_to_charconst): For CPP_CHAR16 or CPP_CHAR32, use
1621 CPP_DL_ERROR instead of CPP_DL_WARNING when multiple char16_t
1622 or char32_t chars are needed.
1623 (cpp_interpret_charconst): Adjust narrow_str_to_charconst caller.
1624
b7689b96
JM
16252019-11-05 Tim van Deurzen <tim@kompiler.org>
1626
1627 * cpplib.h: Add spaceship operator for C++.
1628 * lex.c: Implement conditional lexing of spaceship operator for C++20.
1629
aa23e73b
JJ
16302019-10-31 Jakub Jelinek <jakub@redhat.com>
1631
1632 PR preprocessor/92296
1633 * internal.h (struct def_pragma_macro): Add is_builtin bitfield.
1634 (_cpp_restore_special_builtin): Declare.
1635 * init.c (_cpp_restore_special_builtin): New function.
1636 * directives.c (do_pragma_push_macro): For NT_BUILTIN_MACRO
1637 set is_builtin and don't try to grab definition.
1638 (cpp_pop_definition): Use _cpp_restore_special_builtin to restore
1639 builtin macros.
1640
9158f0ba
NS
16412019-10-15 Nathan Sidwell <nathan@acm.org>
1642
1643 * include/line-map.h (struct maps_info_ordinary): Make cache
1644 mutable.
1645 (struct maps_info_macro): Likewise.
1646 (LINEMAPS_CACHE): Remove non-ref accessor. Constify ref accessor.
1647 (LINEMAPS_ORDINARY_CACHE, LINEMAPS_MACRO_CACHE): Likewise.
1648 (LINEMAPS_ORDINARY_MAP_AT, LINEMAPS_MACRO_MAP_AT): Use
1649 LINEMAPS_USED and LINEMAPS_MAP_AT.
1650 (linemap_lookup): Constify line_map arg.
1651 linemap.c (linemap_ordinary_map_lookup, linemap_macro_map_lookup):
1652 Constify line_map arg.
1653
175a85b2
JM
16542019-10-11 Joseph Myers <joseph@codesourcery.com>
1655
1656 * include/cpplib.h (struct cpp_options): Add dfp_constants and
1657 cpp_warn_c11_c2x_compat.
1658 (enum cpp_warning_reason): Add CPP_W_C11_C2X_COMPAT.
1659 * init.c (struct lang_flags): Add dfp_constants.
1660 (lang_defaults): Set dfp_constants to 1 for GNUC2X and STDC2X and
1661 0 for other languages.
1662 (cpp_set_lang): Set dfp_constants from language.
1663 (cpp_create_reader): Set cpp_warn_c11_c2x_compat to -1.
1664 * expr.c (interpret_float_suffix): Mention DFP constants as C2X in
1665 comment.
1666 (cpp_classify_number): Do not diagnose DFP constants for languages
1667 setting dfp_constants, unless cpp_warn_c11_c2x_compat.
1668
924b9276
NS
16692019-10-04 Nathan Sidwell <nathan@acm.org>
1670
1671 PR preprocessor/91991
1672 * line-map.c (linemap_line_start): Clear max_column_hint if we run
1673 out of locations.
1674
68710ac7
RB
16752019-10-02 Richard Biener <rguenther@suse.de>
1676
1677 * internal.h (enum include_type): Remove trailing comma.
1678
93313b94
JM
16792019-10-02 Joseph Myers <joseph@codesourcery.com>
1680
1681 * include/cpplib.h (struct cpp_options): Add member scope.
1682 * init.c (struct lang_flags, lang_defaults): Likewise.
1683 (cpp_set_lang): Set scope member of pfile.
1684 * lex.c (_cpp_lex_direct): Test CPP_OPTION (pfile, scope) not
1685 CPP_OPTION (pfile, cplusplus) for creating CPP_SCOPE tokens.
1686
0900e29c
EB
16872019-09-26 Eric Botcazou <ebotcazou@adacore.com>
1688
1689 * charset.c (UCS_LIMIT): New macro.
1690 (ucn_valid_in_identifier): Use it instead of a hardcoded constant.
1691 (_cpp_valid_ucn): Issue a pedantic warning for UCNs larger than
1692 UCS_LIMIT outside of identifiers in C and in C++2a or later.
1693
7d112d66
LH
16942019-09-19 Lewis Hyatt <lhyatt@gmail.com>
1695
1696 PR c/67224
1697 * charset.c (_cpp_valid_utf8): New function to help lex UTF-8 tokens.
1698 * internal.h (_cpp_valid_utf8): Declare.
1699 * lex.c (forms_identifier_p): Use it to recognize UTF-8 identifiers.
1700 (_cpp_lex_direct): Handle UTF-8 in identifiers and CPP_OTHER tokens.
1701 Do all work in "default" case to avoid slowing down typical code paths.
1702 Also handle $ and UCN in the default case for consistency.
1703
400b8274
NS
17042019-08-30 Nathan Sidwell <nathan@acm.org>
1705
1706 New # semantics for popping to "" name.
1707 libcpp/
1708 * directives.c (do_linemarker): Popping to "" name means get the
1709 name from the include stack..
1710
056f95ec
NS
17112019-09-05 Nathan Sidwell <nathan@acm.org>
1712
1713 PR preprocessor/91639
1714 * directives.c (do_include_common): Tell lexer we're a #include.
1715 * files.c (_cpp_stack_file): Lexer will have always incremented.
1716 * internal.h (struct cpp_context): Extend in_directive's
1717 semantics.
1718 * lex.c (_cpp_lex_direct): Increment line for final \n when lexing
1719 for an ISO #include.
1720 * line-map.c (linemap_line_start): Remember if we overflowed.
1721
2f2aeda9
UW
17222019-09-03 Ulrich Weigand <uweigand@de.ibm.com>
1723
1724 * directives.c: Remove references to spu from comments.
1725 * expr.c: Likewise.
1726
b0d11f1e
NS
17272019-08-29 Nathan Sidwell <nathan@acm.org>
1728
1729 * internal.h (enum include_type): Add IT_MAIN, IT_DIRECTIVE_HWM,
1730 IT_HEADER_HWM.
1731 (_cpp_stack_file): Take include_type, not a bool.
1732 * files.c (_cpp_find_file): Refactor to not hide an if inside a
1733 for conditional.
1734 (should_stack_file): Break apart to ...
1735 (is_known_idempotent_file, has_unique_contents): ... these.
1736 (_cpp_stack_file): Replace IMPORT boolean with include_type enum.
1737 Refactor to use new predicates. Do linemap compensation here ...
1738 (_cpp_stack_include): ... not here.
1739 * init.c (cpp_read_main_file): Pass IT_MAIN to _cpp_stack_file.
1740
a0be978a
NS
17412019-08-28 Nathan Sidwell <nathan@acm.org>
1742
1743 * directives-only.c (_cpp_preprocess_dir_only): Use false, not
1744 zero for _cpp_handle_directive call.
1745 * directives.c (_cpp_handle_directive): Indented is bool.
1746 * files.c (struct _cpp_file): Make bools 1 bit bitfields.
1747 * internal.h (enum include_type): Reformat and comment.
1748 (struct cpp_buffer): Make flags 1 bit bitfields.
1749 (_cpp_handle_directive): Indented is bool.
1750
6c1dae73
MS
17512019-07-09 Martin Sebor <msebor@redhat.com>
1752
1753 * include/line-map.h: Change class-key from class to struct and vice
1754 versa to match convention and avoid -Wclass-is-pod and -Wstruct-no-pod.
1755 * mkdeps.c: Same.
1756
8ba6ea87
ML
17572019-07-03 Martin Liska <mliska@suse.cz>
1758
1759 * line-map.c (linemap_get_expansion_filename): Remove
1760 dead assignemts.
1761 * mkdeps.c (make_write): Likewise.
1762
1c6ffbab
QZ
17632019-07-02 qing zhao <qing.zhao@oracle.com>
1764
1765 PR preprocessor/90581
1766 * directives.c (do_include_common): Replace CPP_STACK_MAX with
1767 CPP_OPTION (pfile, max_include_depth).
1768 * include/cpplib.h (struct cpp_options): Add new field
1769 max_include_depth.
1770 * init.c (cpp_create_reader): Initiate new field max_include_depth.
1771 * internal.h: Delete CPP_STACK_MAX.
1772
66d7749b
NS
17732019-06-26 Nathan Sidwell <nathan@acm.org>
1774
1775 PR preprocessor/90927
1776 * mkdeps.c (mkdeps::vec::operator[]): Add non-const variant.
1777 (deps_add_target): Deal with out of order unquoted targets.
1778
3f23e487
AP
17792019-05-19 Andrew Pinski <apinski@marvell.com>
1780
1781 PR pch/81721
1782 * lex.c (cpp_token_val_index <case SPELL_OPERATOR>): If tok->flags
1783 has NAMED_OP set, then return CPP_TOKEN_FLD_NODE.
1784
19eda56d
ML
17852019-05-14 Martin Liska <mliska@suse.cz>
1786
1787 PR preprocessor/90382
1788 * line-map.c (first_map_in_common_1): Handle ADHOC
1789 locations.
1790
e6fc8353
ML
17912019-05-14 Martin Liska <mliska@suse.cz>
1792
1793 PR preprocessor/90382
1794 * include/line-map.h (get_data_from_adhoc_loc): Add const to
1795 the first argument.
1796 (get_location_from_adhoc_loc): Likewise.
1797 * line-map.c(get_data_from_adhoc_loc): Add const to
1798 the first argument.
1799 (get_location_from_adhoc_loc): Likewise.
1800 (get_combined_adhoc_loc): Use get_location_from_adhoc_loc
1801 (or get_data_from_adhoc_loc).
1802 (get_range_from_adhoc_loc): Likewise.
1803 (get_pure_location): Likewise.
1804 (linemap_position_for_loc_and_offset): Likewise.
1805 (linemap_lookup): Likewise.
1806 (linemap_ordinary_map_lookup): Likewise.
1807 (linemap_macro_map_lookup): Likewise.
1808 (linemap_get_expansion_line): Likewise.
1809 (linemap_get_expansion_filename): Likewise.
1810 (linemap_location_in_system_header_p): Likewise.
1811 (linemap_location_from_macro_expansion_p): Likewise.
1812 (linemap_macro_loc_to_exp_point): Likewise.
1813 (linemap_resolve_location): Likewise.
1814 (linemap_unwind_toward_expansion): Likewise.
1815 (linemap_unwind_to_first_non_reserved_loc): Likewise.
1816 (linemap_expand_location): Likewise.
1817 (linemap_dump_location): Likewise.
1818
d7b6aee8
NS
18192019-05-07 Nathan Sidwell <nathan@acm.org>
1820
61145d93
NS
1821 * files.c (_cpp_stack_file): Empty filenames aren't dependencies.
1822 * mkdeps.c (deps_add_dep): Assert not empty.
1823
d7b6aee8
NS
1824 * include/mkdeps.h (deps_write): Add PHONY arg.
1825 (deps_phony_targets): Delete.
1826 * init.c (cpp_finish): Just call deps_write.
1827 * mkdeps.c (struct mkdeps): Add local vector class. Reimplement
1828 vector handling.
1829 (munge): Munge to static buffer.
1830 (apply_vpath): Adjust vector handling.
1831 (deps_init, deps_free): Use new, delete.
1832 (deps_add_target): Do not munge here. Record quoting low water mark.
1833 (deps_add_dep): Do not munge here.
1834 (deps_add_vpath): Adjust vector handling.
1835 (make_write_name): New. Munge on demand here.
1836 (make_write_vec): New.
1837 (deps_phony_targets): Delete.
1838 (make_write): New.
1839 (deps_write): Forward to deps_Write.
1840 (deps_save, deps_restore): Adjust vector handling.
1841
b744fc85
NS
18422019-05-06 Nathan Sidwell <nathan@acm.org>
1843
1844 * include/mkdeps.h: Rename struct deps to struct mkdeps.
1845 * mkdeps.c: Likewise.
1846 * include/cpplib.h (cpp_get_deps): Rename return type..
1847 * directives.c (cpp_get_deps): Likewise.
1848 * internal.h (struct cpp_reader): Rename deps field type.
1849
0bf12a52
JW
18502019-04-03 Jonathan Wakely <jwakely@redhat.com>
1851
1852 * files.c (search_path_exhausted): Fix typo in comment.
1853
60448173
ML
18542019-02-26 Martin Liska <mliska@suse.cz>
1855
1856 * symtab.c (ht_dump_statistics): Make
1857 horizontal alignment for statistics.
1858
200a8e1a
DM
18592019-02-20 David Malcolm <dmalcolm@redhat.com>
1860
1861 PR c/89410
1862 * include/line-map.h (linenum_arith_t): New typedef.
1863 (compare): Use it.
1864
a5f87af7
ML
18652019-02-18 Martin Liska <mliska@suse.cz>
1866
1867 PR c++/89383
1868 * line-map.c (linemap_line_start): Use 1UL in order
1869 to not overflow.
1870
a4553534
DM
18712019-02-11 Martin Liska <mliska@suse.cz>
1872
1873 PR lto/88147
1874 * line-map.c (linemap_line_start): Don't reuse the existing line
1875 map if the line offset is sufficiently large to cause overflow
1876 when computing location_t values.
1877
18f5df94
JJ
18782019-01-26 Jakub Jelinek <jakub@redhat.com>
1879
1880 PR preprocessor/88974
1881 * directives.c (SEEN_EOL): Move macro to ...
1882 * internal.h (SEEN_EOL): ... here.
1883 * expr.c (parse_has_include): Don't cpp_get_token if SEEN_EOL ().
1884
a5544970
JJ
18852019-01-01 Jakub Jelinek <jakub@redhat.com>
1886
1887 Update copyright years.
1888
bc65bad2
MG
18892018-11-27 Mike Gulick <mgulick@mathworks.com>
1890
1891 PR preprocessor/83173
1892 * location-example.txt: Update example -fdump-internal-locations
1893 output.
1894
56c79e7f
MG
18952018-11-27 Mike Gulick <mgulick@mathworks.com>
1896
1897 PR preprocessor/83173
1898 * files.c (_cpp_stack_include): Check if
1899 line_table->highest_location is past current line before
1900 decrementing.
1901
620e594b
DM
19022018-11-13 David Malcolm <dmalcolm@redhat.com>
1903
1904 * charset.c: Replace "source_location" with "location_t".
1905 * directives-only.c: Likewise.
1906 * directives.c: Likewise.
1907 * errors.c: Likewise.
1908 * expr.c: Likewise.
1909 * files.c: Likewise.
1910 * include/cpplib.h: Likewise. Rename MAX_SOURCE_LOCATION to
1911 MAX_LOCATION_T.
1912 * include/line-map.h: Likewise.
1913 * init.c: Likewise.
1914 * internal.h: Likewise.
1915 * lex.c: Likewise.
1916 * line-map.c: Likewise.
1917 * location-example.txt: Likewise.
1918 * macro.c: Likewise.
1919 * pch.c: Likewise.
1920 * traditional.c: Likewise.
1921
e9f3803d
HAQ
19222018-11-07 Hafiz Abid Qadeer <abidh@codesourcery.com>
1923
1924 * configure: Regenerated.
1925
546f678c
ML
19262018-11-05 Martin Liska <mliska@suse.cz>
1927
1928 * symtab.c (ht_dump_statistics): Replace %zu with %lu format.
1929
037903cb
ML
19302018-11-05 Martin Liska <mliska@suse.cz>
1931
1932 * symtab.c (ht_dump_statistics): Fix format and
1933 pass missing argument.
1934
46aeb07f
ML
19352018-11-05 Martin Liska <mliska@suse.cz>
1936
1937 * symtab.c (ht_dump_statistics): Make dump conditional
1938 based on alloc_subobject.
1939
22e05272
JM
19402018-10-31 Joseph Myers <joseph@codesourcery.com>
1941
1942 PR bootstrap/82856
1943 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
1944 * aclocal.m4, config.in, configure: Regenerate.
1945
ff65e980
NS
19462018-10-31 Nathan Sidwell <nathan@acm.org>
1947
f3f6029d
NS
1948 * internal.h (struct cpp_reader): Rename forced_token_location_p
1949 to forced_token_location and drop its pointerness.
1950 * include/cpplib.h (cpp_force_token_locations): Take location, not
1951 pointer to one.
1952 * init.c (cpp_create_reader): Adjust.
1953 * lex.c (cpp_read_main_file):
1954
705b0c05
NS
1955 * directives.c (do_include_common): Commonize cleanup path.
1956 (_cpp_pop_buffer): Fix leak.
1957
87bacc2b
NS
1958 * include/line-map.h (IS_ORDINARY_LOC, IS_MACRO_LOC): New
1959 predicates.
1960 (IS_ADHOC_LOC): Move earlier.
1961 (MAP_ORDINARY_P): Use IS_ORDINARY_LOC.
1962 * line-map.c (linemap_location_from_macro_expansion_p): Use
1963 IS_MACRO_LOC.
1964
c9fb347e
NS
1965 * include/cpplib.h (cpp_macro_definition_location): Make inline.
1966 * macro.c (warn_of_redefinition): Fix comments, examine macro
1967 type, use C++ for.
1968 (cpp_macro_definition_location): Don't define here.
1969
43af5ef1
NS
1970 * include/cpplib.h (HT_NODE): Don't cast NODE.
1971 (NODE_LEN, NODE_NAME): Use HT_NODE.
1972
ff65e980
NS
1973 * directives.c (DIRECTIVE_TABLE): Drop historical frequency
1974 comments.
1975 * files.c (_cpp_stack_file): Fix indentation.
1976
9f936c86
JM
19772018-10-17 Joseph Myers <joseph@codesourcery.com>
1978
1979 * include/cpplib.h (enum c_lang): Add CLK_GNUC2X and CLK_STDC2X.
1980 * init.c (lang_defaults): Add GNUC2X and STDC2X entries.
1981 (cpp_init_builtins): Define __STDC_VERSION__ to 202000L for C2X.
1982
954ad112
DM
19832018-10-11 David Malcolm <dmalcolm@redhat.com>
1984
1985 * macro.c (_cpp_arguments_ok): If the argument count is wrong, add
1986 a note showing the definition of the macro.
1987
c1b48b29
NS
19882018-10-11 Nathan Sidwell <nathan@acm.org>
1989
1990 * include/line-map.h (LINEMAPS_MACRO_LOWEST_LOCATION): Fix
1991 off-by-one error.
1992 * line-map.c (linemap_enter_macro): Use RAII. Clear all of the
1993 macro_locations.
1994
c24300ba
DM
19952018-10-09 David Malcolm <dmalcolm@redhat.com>
1996
1997 * charset.c (noop_error_cb): Rename to...
1998 (noop_diagnostic_cb): ...this, converting params to enums.
1999 (cpp_interpret_string_ranges): Update for renaming and enums.
2000 * directives.c (check_eol_1): Convert reason to enum.
2001 (do_diagnostic): Convert code and reason to enum.
2002 (do_error): Use CPP_W_NONE rather than 0.
2003 (do_pragma_dependency): Likewise.
2004 * errors.c (cpp_diagnostic_at): Convert level and reason to enums.
2005 Update for renaming.
2006 (cpp_diagnostic): Convert level and reason to enums.
2007 (cpp_error): Convert level to enum.
2008 (cpp_warning): Convert reason to enums.
2009 (cpp_pedwarning): Likewise.
2010 (cpp_warning_syshdr): Likewise.
2011 (cpp_diagnostic_with_line): Convert level and reason to enums.
2012 Update for renaming.
2013 (cpp_error_with_line): Convert level to enum.
2014 (cpp_warning_with_line): Convert reason to enums.
2015 (cpp_pedwarning_with_line): Likewise.
2016 (cpp_warning_with_line_syshdr): Likewise.
2017 (cpp_error_at): Convert level to enum.
2018 (cpp_errno): Likewise.
2019 (cpp_errno_filename): Likewise.
2020 * include/cpplib.h (enum cpp_diagnostic_level): Name this enum,
2021 and move to before struct cpp_callbacks.
2022 (enum cpp_warning_reason): Likewise.
2023 (cpp_callbacks::diagnostic): Convert params from int to enums.
2024 (cpp_error): Convert int param to enum cpp_diagnostic_level.
2025 (cpp_warning): Convert int param to enum cpp_warning_reason.
2026 (cpp_pedwarning): Likewise.
2027 (cpp_warning_syshdr): Likewise.
2028 (cpp_errno): Convert int param to enum cpp_diagnostic_level.
2029 (cpp_errno_filename): Likewise.
2030 (cpp_error_with_line): Likewise.
2031 (cpp_warning_with_line): Convert int param to enum
2032 cpp_warning_reason.
2033 (cpp_pedwarning_with_line): Likewise.
2034 (cpp_warning_with_line_syshdr): Likewise.
2035 (cpp_error_at): Convert int param to enum cpp_diagnostic_level.
2036 * macro.c (create_iso_definition): Convert int to enum.
2037 (_cpp_create_definition): Likewise.
2038
9c4a4b3c
DM
20392018-09-17 David Malcolm <dmalcolm@redhat.com>
2040
2041 * include/line-map.h (range_label::get_text): Add param
2042 "range_idx".
2043
24c35f68
NS
20442018-08-30 Nathan Sidwell <nathan@acm.org>
2045
2046 * include/line-map.h (enum lc_reason): Comment each member
2047 separately.
2048 (struct line_maps): Fix reallocator comment.
2049
85204e23
DM
20502018-08-27 David Malcolm <dmalcolm@redhat.com>
2051
2052 PR 87091
2053 * include/line-map.h (enum range_display_kind): New enum.
2054 (struct location_range): Replace field "m_show_caret_p" with
2055 "m_range_display_kind", converting from bool to the new enum.
2056 (class rich_location): Add example of line insertion fix-it hint.
2057 (rich_location::add_range): Convert param "show_caret_p" from bool
2058 to enum range_display_kind and rename to "range_display_kind",
2059 giving it a default of SHOW_RANGE_WITHOUT_CARET.
2060 (rich_location::set_range): Likewise, albeit without a default.
2061 * line-map.c (rich_location::rich_location): Update for conversion
2062 of show_caret_p to tri-state enum.
2063 (rich_location::add_range): Likewise.
2064 (rich_location::set_range): Likewise.
2065
cf806c7d
L
20662018-08-24 H.J. Lu <hongjiu.lu@intel.com>
2067
2068 PR bootstrap/86872
2069 * line-map.c (pure_location_p): Return true if linemap_lookup
2070 returns NULL.
2071 (linemap_add): Set start_location to 0 if we run out of line map
2072 space.
2073
3fb558b1
NS
20742018-08-20 Nathan Sidwell <nathan@acm.org>
2075
a5a35247
NS
2076 * include/cpplib.h: Fixup some whitespace.
2077 (cpp_hashnode): Reduce type to 2 bit & flags to 8.
2078
a570d97f
NS
2079 * include/cpplib.h (NODE_BUILTIN, NODE_MACRO_ARG): Delete.
2080 Renumber others.
2081 (enum node_type): Replace NT_MACRO with NT_USER_MACRO,
2082 NT_BUILTIN_MACRO, NT_MACRO_ARG. Delete NT_ASSERTION.
2083 (NTV_MACRO, NTV_ANSWER, NTV_BUILTIN, NTV_ARGUMENT, NTV_NONE):
2084 Delete.
2085 (CPP_HASHNODE_VALUE_IDX): Delete.
2086 (union _cpp_hashnode_value): GTY tag from enum node_type directly.
2087 (struct cpp_hashnode): Adjust GTY desc for value field.
2088 (cpp_user_macro_p, cpp_builtin_macro_p, cpp_macro_p): Adjust.
2089 * directives.c (undefine_macros): Clear value.anwers, adjust flag
2090 clearing.
2091 (_cpp_test_assertion): No need to check NT_ASSERTION.
2092 (do_assert, do_unassert): Likewise.
2093 * init.c (cpp_init_special_builtins): Set type not flags.
2094 * macro.c (struct macro_arg_saved_data): Add type field.
2095 (cpp_get_token_1): Check type not NT_VOID.
2096 (_cpp_free_definition): Adjust flag clearing. Nullify
2097 value.answers.
2098 (_cpp_save_parameter, _cpp_unsave_parameters): Save and restore
2099 type.
2100 (lex_expansion_token): Check type not flags.
2101 (_cpp_create_definition): Set type to NT_USER_MACRO.
2102 (_cpp_notify_macro_use): Adjust type checking.
2103 * pch.c (write_macdef, count_defs, write_defs, cpp_valid_state)
2104 (save_macros): Adjust node type/flag handling.
2105 * traditional.c (_cpp_scan_out_logical_line): Check type not flags.
2106
7692e253
NS
2107 * directives.c (do_undef): Use cpp_macro_p & cpp_builtin_macro_p.
2108 * include/cpplib.h (enum cpp_macro_kind): Remove trailing comma.
2109 (cpp_fun_like_macro_p): Make inline, define.
2110 * macro.c (cpp_define_lazily): Use UCHAR_MAX.
2111 (cpp_fun_like_macro_p): Delete.
2112
abcd1775
NS
2113 * Makefile.in (TAGS_SOURCES): Remove cpp-id-data.h.
2114 * include/cpp-id-data.h: Delete.
2115 * internal.h: Include cpplib.h not cpp-id-data.h.
2116
3fb558b1
NS
2117 * include/cpp-id-data.h (struct answer): Delete.
2118 * include/cpplib.h (struct answer): Don't forward-declare.
2119 (enum cpp_macro_kind): Add cmk_assert.
2120 (struct cpp_macro): Union parms and next assert chain.
2121 (union _cpp_hashnode_value): 'answer' field is cpp_macro.
2122 * directives.c (parse_answer): Convert to use cpp_macro. Return
2123 true on success.
2124 (parse_assertion, find_answer, _cpp_test_assertion, cpp_do_assert)
2125 (cpp_do_unassert): Convert to use cpp_macro.
2126 * macro.c (warn_of_redefinition, _cpp_new_macro)
2127 (check_trad_stringification, cpp_macro_definition): Adjust macro
2128 parm access.
2129 * traditional.c (_cpp_replacement_text_len)
2130 (_cpp_copy_replacement_text, _cpp_create_trad_definition): Likewise.
2131
c5d725c0
NS
21322018-08-17 Nathan Sidwell <nathan@acm.org>
2133
800c0e98
NS
2134 * include/cpplib.h (struct cpp_callbacks): Replace
2135 user_builtin_macro with user_lazy_macro.
2136 (struct cpp_macro): add lazy field.
2137 (enum cpp_builtin_type): Remove BT_FIRST_USER, BT_LAST_USER.
2138 (cpp_define_lazily): Declare.
2139 * macro.c (enter_macro_context) Use _cpp_maybe_notify_macro_use.
2140 (warn_of_redefinition): Use cpp_builtin_macro_p, directly call
2141 user_lazy_macro hook.
2142 (_cpp_new_macro): Clear lazy field.
2143 (cpp_define_lazily): Define.
2144 (_cpp_notify_macro_use): Adjust lazy definition code.
2145 (cpp_macro_definition): No need to do lazy definition here.
2146 * pch.c (write_macdef, save_macros): Likewise.
2147
10f04917
NS
2148 * include/cpplib.h (enum cpp_macro_kind): New.
2149 (struct cpp_macro): Make body trailing array. Add kind field,
2150 delete traditional flag.
2151 * internal.h (_cpp_new_macro): Declare.
2152 (_cpp_reserve_room): New inline.
2153 (_cpp_commit_buf): Declare.
2154 (_cpp_create_trad_definition): Return new macro.
2155 * lex.c (_cpp_commit_buff): New.
2156 * macro.c (macro_real_token_count): Count backwards.
2157 (replace_args): Pointer equality not orderedness.
2158 (_cpp_save_parameter): Use _cpp_reserve_room.
2159 (alloc_expansion_token): Delete.
2160 (lex_expansion_token): Return macro pointer. Use _cpp_reserve_room.
2161 (create_iso_definition): Allocate macro itself. Adjust for
2162 different allocation ordering.
2163 (_cpp_new_macro): New.
2164 (_cpp_create_definition): Adjust for API changes.
2165 * traditional.c (push_replacement_text): Don't set traditional
2166 flag.
2167 (save_replacement_text): Likewise.
2168 (_cpp_create_trad_definition): Allocate macro itself, Adjust for
2169 different allocation ordering.
2170
c5d725c0
NS
2171 * cpp-id-data.h (uchar, UC): Move to internal.h
2172 (struct cpp_macro): Move to cpplib.h.
2173 * internal.h (uchar, UC): From cpp-id-data.h.
2174 * include/cpplib.h (struct cpp_macro): From cpp-id-data.h.
2175
3f6677f4
NS
21762018-08-16 Nathan Sidwell <nathan@acm.org>
2177
729a01f7
NS
2178 * internal.h (_cpp_save_parameter): Take parmno, not macro.
2179 (_cpp_unsave_parameters): Declare.
2180 * macro.c (_cpp_save_parameter): Take parm number, not macro.
2181 Return true on success.
2182 (_cpp_unsave_parameters): New.
2183 (parse_params): Take parm_no and variadic pointers, not macro.
2184 Reimplement parsing logic.
2185 (create_iso_definition): Adjust parse_params changes. Call
2186 _cpp_unsave_parameters here.
2187 (_cpp_create_definition): Don't unsave params here.
2188 * traditional.c (scan_parameters): Take n_param pointer, adjust.
2189 (_cpp_create_trad_definition): Ajust scan_parameters change. Call
2190 _cpp_unsave_parameters.
2191
3f6677f4
NS
2192 * include/cpplib.h (cpp_user_macro_p, cpp_builtin_macro_p)
2193 (cpp_macro_p): New inlines.
2194 * directives.c (do_pragma_poison): Use cpp_macro_p.
2195 (do_ifdef, do_ifndef): Likewise. Use _cpp_maybe_notify_macro_use.
2196 (cpp_pop_definition): Use cpp_macro_p. Move _cpp_free_definition
2197 earlier. Don't zap node directly.
2198 * expr.c (parse_defined): Use _cpp_maybe_notify_macro_use &
2199 cpp_macro_p.
2200 * files.c (should_stack_file): Use cpp_macro_p.
2201 * identifiers.c (cpp_defined): Likewise.
2202 * internal.h (_cpp_mark_macro): Use cpp_user_macro_p.
2203 (_cpp_notify_macro_use): Declare.
2204 (_cpp_maybe_notify_macro_use): New inline.
2205 * lex.c (is_macro): Use cpp_macro_p.
2206 * macro.c (_cpp_warn_if_unused_macro): Use cpp_user_macro_p.
2207 (enter_macro_context): Likewise.
2208 (_cpp_create_definition): Use cpp_builtin_macro_p,
2209 cpp_user_macro_p. Move _cpp_free_definition earlier.
2210 (_cpp_notify_macro_use): New, broken out of multiple call sites.
2211 * traditional.c (fun_like_macro_p): Use cpp_builtin_macro_p.
2212 (maybe_start_funlike, _cpp_scan_out_logical_line)
2213 (push_replacement_text): Likewise.
2214
96e6ae57
DM
22152018-08-15 David Malcolm <dmalcolm@redhat.com>
2216
2217 * include/line-map.h (struct location_range): Add "m_label" field.
2218 (class rich_location): Add description of labels to leading
2219 comment.
2220 (rich_location::rich_location): Add "label" param, defaulting to
2221 NULL.
2222 (rich_location::add_range): Likewise.
2223 (struct label_text): New struct.
2224 (class range_label): New abstract base class.
2225 * line-map.c (rich_location::rich_location): Add "label" param;
2226 use it.
2227 (rich_location::add_range): Likewise.
2228
f10a9135
NS
22292018-08-08 Nathan Sidwell <nathan@acm.org>
2230
2231 Make linemap::included_from a location
2232 libcpp/
2233 * include/line-map.h (struct line_map_ordinary): Replace
2234 included_from map index with included_at source_location.
2235 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Delete.
2236 (LAST_SOURCE_LINE_LOCATION): Delete.
2237 (LAST_SOURCE_LINE, LAST_SOURCE_COLUMN): Delete.
2238 (linemap_included_from): New.
2239 (linemap_included_from_linemap): Declare.
2240 (MAIN_FILE_P): Adjust.
2241 * line-map.c (linemap_included_from_linemap): New.
2242 (lonemap_check_files_exited): Use linemap_included_at.
2243 (linemap_add): Adjust inclusion setting.
2244 (linemap_dump, linemap_dump_location): Adjust.
2245 * directives.c (do_linemarker): Use linemap_included_at.
2246
e81c3c4d
NS
22472018-08-07 Nathan Sidwell <nathan@acm.org>
2248
2249 * line-map.c: (linemap_init): Set default allocator here.
2250 (new_linemap): Rather than here. Refactor allocation logic.
2251
181463c2
DM
22522018-07-20 David Malcolm <dmalcolm@redhat.com>
2253
2254 * include/line-map.h (rich_location::set_range): Remove redundant
2255 line_maps * parameter.
2256 * line-map.c (rich_location::set_range): Likewise.
2257
6f41f92b
BE
22582018-07-18 Bernd Edlinger <bernd.edlinger@hotmail.de>
2259
2260 PR 69558
2261 * macro.c (enter_macro_context): Change the location info for builtin
2262 macros and _Pragma from location of the closing parenthesis to location
2263 of the macro expansion point.
2264
0c86a39d
JJ
22652018-07-17 Jason Franklin <j_fra@fastmail.us>
2266 Jakub Jelinek <jakub@redhat.com>
2267
2268 * lex.c (_cpp_lex_direct): Use CPP_DL_NOTE instead of CPP_DL_PEDWARN,
2269 CPP_DL_WARNING or CPP_DL_ERROR for note that diagnostics for C++ style
2270 comments is reported only once per file and guard those calls on the
2271 preceding cpp_error returning true.
2272
42a98b43
NS
22732018-07-03 Nathan Sidwell <nathan@acm.org>
2274
2275 Reorg line_map data structures for better packing.
2276 * include/line-map.h (enum lc_reason): Add LC_HWM.
2277 (LINE_MAP_MAX_LOCATION): Define here.
2278 (struct line_map): Move reason field to line_map_ordinary. Adjust
2279 GTY tagging.
2280 (struct line_map_ordinary): Reorder fields for less padding.
2281 (struct line_map_macro): Likewise.
2282 (MAP_ORDINARY_P): New.
2283 (linemap_check_ordinary, linemap_check_macro): Adjust.
2284 * line-map.c (LINE_MAP_MAX_SOURCE_LOCATION): Delete.
2285 (new_linemap): Take start_location, not reason. Adjust.
2286 (linemap_add, linemap_enter_macro): Adjust.
2287 (linemap_line_start): Likewise.
2288 (linemap_macro_expansion_map_p): Use MAP_ORDINARY_P.
2289 (linemap_macro_loc_to_spelling_point): Likewise.
2290 (linemap_macro_loc_to_def_point): Likewise.
2291 (linemap_dump): Likewise.
2292
a6b29221
JM
22932018-05-23 Jason Merrill <jason@redhat.com>
2294
2295 * system.h: #include <new> earlier.
2296
b2ff7457
JM
22972018-05-17 Jason Merrill <jason@redhat.com>
2298
2299 * line-map.c (linemap_init): Use placement new.
2300 * system.h: #include <new>.
2301
082284da
DM
23022018-03-14 David Malcolm <dmalcolm@redhat.com>
2303
2304 * include/line-map.h (compare): New function on linenum_type.
2305
b44f8ad8
JW
23062018-02-28 Jonathan Wakely <jwakely@redhat.com>
2307
2308 PR preprocessor/84517
2309 * lex.c (is_macro_not_literal_suffix): New function.
2310 (lex_raw_string, lex_string): Use is_macro_not_literal_suffix to
2311 decide when to issue -Wliteral-suffix warnings.
2312
fe74f9b4
RB
23132018-02-16 Richard Biener <rguenther@suse.de>
2314
2315 PR bootstrap/82939
2316 * line-map.c (linemap_init): Avoid broken value-init when compiling
2317 with GCC 4.2.
2318
60887f8c
JM
23192018-02-15 Jason Merrill <jason@redhat.com>
2320 Jakub Jelinek <jakub@redhat.com>
2321
2322 PR preprocessor/83063 - __VA_OPT__ and ##
2323 PR preprocessor/83708
2324 * macro.c (vaopt_state): Reorder m_last_was_paste before m_state.
2325 (vaopt_state::vaopt_state): Adjust.
2326 (vaopt_state::update_flags): Add BEGIN and END.
2327 (vaopt_state::update): Return them.
2328 (copy_paste_flag): Factor out of replace_args.
2329 (last_token_is): New.
2330 (replace_args): Handle BEGIN and END. Avoid padding there.
2331 (tokens_buff_last_token_ptr): Return NULL if no tokens.
2332
1306a81d
JJ
23332018-01-31 Jakub Jelinek <jakub@redhat.com>
2334
2335 PR preprocessor/69869
2336 * traditional.c (skip_macro_block_comment): Return bool, true if
2337 the macro block comment is unterminated.
2338 (copy_comment): Use return value from skip_macro_block_comment instead
2339 of always false.
2340
53723269
JJ
23412018-01-27 Jakub Jelinek <jakub@redhat.com>
2342
2343 * include/cpplib.h (enum cpp_builtin_type): Change BT_LAST_USER from
2344 BT_FIRST_USER + 31 to BT_FIRST_USER + 63.
2345
7365279f
BK
23462018-01-18 Boris Kolpackov <boris@codesynthesis.com>
2347
92a285c1
ML
2348 PR other/70268
2349 * include/cpplib.h (cpp_callbacks::remap_filename): New callback.
2350 * macro.c (_cpp_builtin_macro_text): Call remap_filename for
2351 __FILE__ and __BASE_FILE__.
7365279f 2352
a3a821c9
KN
23532018-01-10 Kelvin Nilsen <kelvin@gcc.gnu.org>
2354
2355 * lex.c (search_line_fast): Remove illegal coercion of an
2356 unaligned pointer value to vector pointer type and replace with
2357 use of __builtin_vec_vsx_ld () built-in function, which operates
2358 on unaligned pointer values.
2359
85ec4feb
JJ
23602018-01-03 Jakub Jelinek <jakub@redhat.com>
2361
2362 Update copyright years.
2363
35c4515b
MW
23642017-12-20 Michael Weiser <michael.weiser@gmx.de>
2365
2366 PR preprocessor/83492
2367 * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]:
2368 Fix selection of big-endian shift parameters by using
2369 __ARM_BIG_ENDIAN.
2370
c65e18d3
BE
23712017-12-14 Bernd Edlinger <bernd.edlinger@hotmail.de>
2372
2373 * internal.h (maybe_print_line): Change signature.
7365279f 2374
a7b1ce04
JJ
23752017-12-05 Jakub Jelinek <jakub@redhat.com>
2376
2377 PR c++/79228
2378 * expr.c (interpret_float_suffix): Avoid memcmp.
2379 (interpret_int_suffix): Likewise. Don't check for if.
2380
f2b8b8ad
JM
23812017-12-01 Jason Merrill <jason@redhat.com>
2382
2383 PR c++/79228 - extensions hide C++14 complex literal operators
2384 * expr.c (interpret_float_suffix): Ignore 'i' in C++14 and up.
2385 (interpret_int_suffix): Likewise.
2386
6df8934f
DM
23872017-11-28 David Malcolm <dmalcolm@redhat.com>
2388
2389 PR c/82050
2390 * include/line-map.h (LINE_MAP_MAX_COLUMN_NUMBER): Move here.
2391 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): ...from here.
2392 (rich_location::maybe_add_fixit): Reject fix-it hints in which
2393 the start column exceeds the next column.
2394
34b81eb9
EG
23952017-11-20 Eric Gallager <egall@gwmail.gwu.edu>
2396
2397 PR preprocessor/81794
2398 * macro.c (check_trad_stringification): Have warning be controlled
2399 by -Wtraditional.
2400
01ada121
DM
24012017-11-20 David Malcolm <dmalcolm@redhat.com>
2402
2403 PR c++/72786
2404 * include/cpplib.h (cpp_macro_definition_location): New decl.
2405 * macro.c (cpp_macro_definition): New function.
2406
fb771b9d
TT
24072017-11-13 Tom Tromey <tom@tromey.com>
2408
2409 * pch.c (cpp_read_state): Set n__VA_OPT__.
2410 * macro.c (vaopt_state): New class.
2411 (_cpp_arguments_ok): Check va_opt flag.
2412 (replace_args, create_iso_definition): Use vaopt_state.
2413 * lex.c (lex_identifier_intern): Possibly issue errors for
2414 __VA_OPT__.
2415 (lex_identifier): Likewise.
2416 (maybe_va_opt_error): New function.
2417 * internal.h (struct lexer_state) <va_args_ok>: Update comment.
2418 (struct spec_nodes) <n__VA_OPT__>: New field.
2419 * init.c (struct lang_flags) <va_opt>: New field.
2420 (lang_defaults): Add entries for C++2A. Update all entries for
2421 va_opt.
2422 (cpp_set_lang): Initialize va_opt.
2423 * include/cpplib.h (struct cpp_options) <va_opt>: New field.
2424 * identifiers.c (_cpp_init_hashtable): Initialize n__VA_OPT__.
2425
846b84fb
DM
24262017-11-13 David Malcolm <dmalcolm@redhat.com>
2427
2428 * include/line-map.h (linenum_type): Move this typedef and the
2429 comment describing column numbering to near the top of the file.
2430
7d19c460
MK
24312017-11-06 Mukesh Kapoor <mukesh.kapoor@oracle.com>
2432
2433 PR c++/80955
2434 * lex.c (lex_string): When checking for a valid macro for the
2435 warning related to -Wliteral-suffix (CPP_W_LITERAL_SUFFIX),
2436 check that the macro name does not start with an underscore
2437 before calling is_macro().
2438
c830c7d5
TV
24392017-11-05 Tom de Vries <tom@codesourcery.com>
2440
2441 PR other/82784
2442 * lex.c (BUF_APPEND): Remove semicolon after
2443 "do {} while (0)".
2444
64a5912c
DM
24452017-10-31 David Malcolm <dmalcolm@redhat.com>
2446
2447 * directives.c (_cpp_handle_directive): Update for renaming of
2448 cpp_error_at_richloc to cpp_error_at.
2449 * errors.c (cpp_diagnostic_at_richloc): Rename to...
2450 (cpp_diagnostic_at): ...this, dropping the location_t-based
2451 implementation.
2452 (cpp_diagnostic): Update for removal of location_t-based
2453 cpp_diagnostic_at.
2454 (cpp_error_at): Likewise.
2455 (cpp_error_at_richloc): Rename to...
2456 (cpp_error_at): ...this, and update for renaming of
2457 cpp_diagnostic_at_richloc.
2458 * include/cpplib.h (cpp_error_at_richloc): Rename to...
2459 (cpp_error_at): ...this.
2460
c76dc9c3
JM
24612017-10-30 Joseph Myers <joseph@codesourcery.com>
2462
2463 * include/cpplib.h (enum c_lang): Add CLK_GNUC17 and CLK_STDC17.
2464 * init.c (lang_defaults): Add GNUC17 and STDC17 data.
2465 (cpp_init_builtins): Handle C17 value of __STDC_VERSION__.
2466
35b82d26
NS
24672017-10-10 Nathan Sidwell <nathan@acm.org>
2468
2469 PR preprocessor/82506
2470 * macro.c (cpp_quote_string): Escape raw LFs.
2471
026a79f7
AS
24722017-09-15 Andrew Sutton <andrew.n.sutton@gmail.com>
2473 Jakub Jelinek <jakub@redhat.com>
2474
2475 Add support for -std=c++2a.
2476 * include/cpplib.h (c_lang): Add CXX2A and GNUCXX2A.
2477 * init.c (lang_defaults): Add rows for CXX2A and GNUCXX2A.
2478 (cpp_init_builtins): Set __cplusplus to 201709L for C++2a.
2479
7b936140
JJ
24802017-09-15 Jakub Jelinek <jakub@redhat.com>
2481
2482 * include/cpplib.h (enum c_lang): Rename CLK_GNUCXX1Z
2483 to CLK_GNUCXX17 and CLK_CXX1Z to CLK_CXX17.
2484 * init.c (lang_defaults, cpp_init_builtins): Likewise.
2485 * expr.c (cpp_classify_number): Use C++17 instead of C++1z
2486 in diagnostics.
2487
738f7c2e
DM
24882017-07-07 David Malcolm <dmalcolm@redhat.com>
2489
2490 PR c++/79300
2491 * line-map.c (linemap_macro_loc_to_def_point): Preserve range
2492 information for macro expansions by delaying resolving ad-hoc
2493 locations until within the loop.
2494
c471c6ed
DM
24952017-07-06 David Malcolm <dmalcolm@redhat.com>
2496
2497 PR c++/79300
2498 * include/line-map.h (enum location_aspect): New enum.
2499 (linemap_client_expand_location_to_spelling_point): Add
2500 enum location_aspect param.
2501 * line-map.c (rich_location::get_expanded_location): Update for
2502 new param of linemap_client_expand_location_to_spelling_point.
2503 (rich_location::maybe_add_fixit): Likewise.
2504 (fixit_hint::affects_line_p): Likewise.
2505
6d522731
JJ
25062017-06-21 Jakub Jelinek <jakub@redhat.com>
2507
2508 * line-map.c (location_adhoc_data_update): Perform addition in
2509 uintptr_t type rather than char * type. Read *data using
2510 ptrdiff_t type instead of int64_t.
2511 (get_combined_adhoc_loc): Change offset type to ptrdiff_t from
2512 int64_t.
2513
c7a980b8
DM
25142017-06-20 David Malcolm <dmalcolm@redhat.com>
2515
2516 * include/line-map.h (class rich_location): Document that attempts
2517 to delete or replace a range *affecting* multiple lines will fail.
2518 * line-map.c (rich_location::maybe_add_fixit): Implement this
2519 restriction.
2520
b09649fd
DM
25212017-06-09 David Malcolm <dmalcolm@redhat.com>
2522
2523 * include/line-map.h
2524 (rich_location::fixits_cannot_be_auto_applied): New method.
2525 (rich_location::fixits_can_be_auto_applied_p): New accessor.
2526 (rich_location::m_fixits_cannot_be_auto_applied): New field.
2527 * line-map.c (rich_location::rich_location): Initialize new field.
2528
05945a1b
DM
25292017-06-05 David Malcolm <dmalcolm@redhat.com>
2530
2531 * include/cpplib.h (struct cpp_callbacks): Add "comment"
2532 callback.
2533 * lex.c (_cpp_lex_direct): Call the comment callback if non-NULL.
2534
ad53f123
DM
25352017-05-02 David Malcolm <dmalcolm@redhat.com>
2536
2537 * include/line-map.h (class rich_location): Update description of
2538 newline handling.
2539 (class fixit_hint): Likewise.
2540 (fixit_hint::ends_with_newline_p): New decl.
2541 * line-map.c (rich_location::maybe_add_fixit): Support newlines
2542 in fix-it hints that are insertions of single lines at the start
2543 of a line. Don't consolidate into such fix-it hints.
2544 (fixit_hint::ends_with_newline_p): New method.
2545
338035aa
DM
25462017-05-01 David Malcolm <dmalcolm@redhat.com>
2547
2548 * include/line-map.h (source_range::intersects_line_p): Delete.
2549 (rich_location::add_fixit): Delete.
2550 (rich_location::maybe_add_fixit): New method.
2551 (class fixit_hint): Reimplement in terms of...
2552 (class fixit_replace): ...this.
2553 (class fixit_insert): Delete.
2554 * line-map.c (linemap_position_for_loc_and_offset): Drop overzealous
2555 linemap_assert_fails.
2556 (source_range::intersects_line_p): Rename to...
2557 (fixit_hint::affects_line_p): New function.
2558 (rich_location::add_fixit_insert_before): Reimplement in terms of
2559 maybe_add_fixit, moving validation there.
2560 (rich_location::add_fixit_insert_after): Likewise.
2561 (column_before_p): Delete.
2562 (rich_location::add_fixit_replace): Reimplement in terms of
2563 maybe_add_fixit, moving validation there. Convert closed input range
2564 to half-open range.
2565 (rich_location::add_fixit): Delete.
2566 (rich_location::maybe_add_fixit): New function.
2567 (fixit_insert::fixit_insert): Delete.
2568 (fixit_insert::~fixit_insert): Delete.
2569 (fixit_insert::affects_line_p): Delete.
2570 (fixit_insert::maybe_append_replace): Delete.
2571 (fixit_replace::fixit_replace): Rename to...
2572 (fixit_hint::fixit_hint): ...this, rewriting as necessary.
2573 (fixit_replace::~fixit_replace): Delete.
2574 (fixit_replace::affects_line_p): Delete.
2575 (fixit_replace::maybe_append_replace): Rename to...
2576 (fixit_hint::maybe_append): ...this, rewriting as necessary.
2577
5764ee3c
JW
25782017-04-03 Jonathan Wakely <jwakely@redhat.com>
2579
2580 * include/line-map.h (LINEMAPS_MACRO_MAPS): Fix typo in comment.
2581 * lex.c (search_line_fast): Likewise.
2582 * pch.h (cpp_valid_state): Likewise.
2583
8c00ae24
AS
25842017-03-21 Andreas Schwab <schwab@suse.de>
2585
2586 * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]:
2587 Convert 64-bit value to boolean before passing to
2588 __builtin_expect.
2589
85e653c9
JM
25902017-03-16 Jason Merrill <jason@redhat.com>
2591
2592 * init.c (cpp_init_builtins): Update __cplusplus for C++17.
2593
e228c50f
GP
25942017-02-09 Gerald Pfeifer <gerald@pfeifer.com>
2595
2596 * Makefile.in (po/$(PACKAGE).pot): Adjust bug reporting URL.
2597
b9f4757f
DM
25982017-01-10 David Malcolm <dmalcolm@redhat.com>
2599
2600 PR c++/77949
2601 * line-map.c (linemap_position_for_column): When calling
2602 linemap_start_line, detect if a new linemap was created with
2603 0 column bits, and bail out early if this is the case.
2604 (linemap_position_for_loc_and_offset): Replace overzealous
2605 linemap_assert_fails with a simple conditional; use correct
2606 bit count.
2607
5ccf1d8d
DM
26082017-01-07 David Malcolm <dmalcolm@redhat.com>
2609
2610 PR c++/72803
2611 * line-map.c (linemap_line_start): When determining if the highest
2612 column given out so far will fit into a proposed change to the
2613 current map, use the effective number of column bits, rather than
2614 the total number of column + range bits.
2615
cbe34bb5
JJ
26162017-01-01 Jakub Jelinek <jakub@redhat.com>
2617
2618 Update copyright years.
2619
a3998c2f
DM
26202016-12-15 David Malcolm <dmalcolm@redhat.com>
2621
2622 PR preprocessor/78680
2623 PR preprocessor/78811
2624 * lex.c (_cpp_lex_direct): Only determine the end-location of
2625 the token and build a range for non-reserved start locations.
2626 Do not do it for EOF tokens.
2627
470a60b2
DM
26282016-12-12 David Malcolm <dmalcolm@redhat.com>
2629
2630 PR preprocessor/78680
2631 * lex.c (_cpp_lex_direct): Ensure line notes are processed before
2632 computing the end-point of the token.
2633
fb2675cb
PB
26342016-11-23 Paolo Bonzini <bonzini@gnu.org>
2635
2636 * include/cpplib.h (struct cpp_options): Add new member
2637 warn_expansion_to_defined.
2638 (CPP_W_EXPANSION_TO_DEFINED): New enum member.
2639 * expr.c (parse_defined): Warn for all uses of "defined"
2640 in macros, and tie warning to CPP_W_EXPANSION_TO_DEFINED.
2641 Make it a pedwarning instead of a warning.
2642 * system.h (HAVE_DESIGNATED_INITIALIZERS): Do not use
2643 "defined" in macros.
2644
b8f56412
DM
26452016-11-17 David Malcolm <dmalcolm@redhat.com>
2646
2647 * charset.c (cpp_interpret_string_1): Skip locations from
2648 loc_reader when advancing 'p' when handling raw strings.
2649
3549e181
JJ
26502016-11-16 Jakub Jelinek <jakub@redhat.com>
2651
2652 PR bootstrap/72823
2653 * configure.ac (ENABLE_ASSERT_CHECKING): Define if gcc configure
2654 would define that macro.
2655 * configure: Regenerated.
2656 * config.in: Regenerated.
2657
a6ac871c
RE
26582016-11-08 Richard Earnshaw <rearnsha@arm.com>
2659
2660 * lex.c (search_line_fast): New implementation for AArch64.
2661
f5ea989d
DM
26622016-10-25 David Malcolm <dmalcolm@redhat.com>
2663
2664 * files.c (destroy_cpp_file): Free file->path.
2665
2be1b796
DM
26662016-10-25 David Malcolm <dmalcolm@redhat.com>
2667
2668 * include/line-map.h (line_maps::~line_maps): New dtor.
2669 (location_adhoc_data_fini): Delete decl.
2670 * line-map.c (line_maps::~line_maps): New dtor.
2671 (location_adhoc_data_fini): Delete.
2672
58f30963
AP
26732016-10-21 Andris Pavenis <andris.pavenis@iki.fi>
2674
2675 PR preprocessor/71681
2676 * files.c (remap_filename): Fix handling -remap in subdirectories.
2677
70f6d5e1
JJ
26782016-10-12 Jakub Jelinek <jakub@redhat.com>
2679
2680 * include/cpplib.h (struct cpp_options): Add
2681 cpp_warn_implicit_fallthrough.
2682 * init.c (cpp_create_reader): Initialize it to 0.
2683 * lex.c (fallthrough_comment_p): Handle different
2684 cpp_warn_implicit_fallthrough levels. Whitespace fixes.
2685
7bad794a
JJ
26862016-10-08 Jakub Jelinek <jakub@redhat.com>
2687
ee19ef45
JJ
2688 * lex.c (fallthrough_comment_p): Accept Else, fallthrough.
2689
81b02905
JJ
2690 * lex.c (fallthrough_comment_p): Extend to handle more common FALLTHRU
2691 comment styles.
2692
7bad794a
JJ
2693 * lex.c (fallthrough_comment_p): Fix off-by-one size comparison
2694 errors, cleanup.
2695 (_cpp_lex_direct): Allow arbitrary comments in between
2696 fallthrough_comment_p comment and following token.
2697
67ef83c6
KN
26982016-10-04 Kelvin Nilsen <kelvin@gcc.gnu.org>
2699
2700 PR target/77847
2701 * lex.c (search_line_fast): Add a FALLTHROUGH comment to correct
2702 compiler error in the version of this function that is
2703 conditionally compiled when GCC_VERSION >= 4005 and both
2704 __ALTIVEC__ and __BIG_ENDIAN__ symbols are defined.
2705
81fea426
MP
27062016-09-26 Marek Polacek <polacek@redhat.com>
2707 Jakub Jelinek <jakub@redhat.com>
2708
2709 PR c/7652
2710 * include/cpplib.h (PREV_FALLTHROUGH): Define.
2711 * internal.h (CPP_FALLTHRU): Define.
2712 * lex.c (fallthrough_comment_p): New function.
2713 (_cpp_lex_direct): Set PREV_FALLTHROUGH on tokens succeeding a falls
2714 through comment.
2715
bbd6fcf3
DM
27162016-09-23 David Malcolm <dmalcolm@redhat.com>
2717
2718 PR preprocessor/77672
2719 * charset.c (cpp_interpret_string_1): Add a source_range for the
2720 NUL-terminator, using the location of the trailing quote of the
2721 final string.
2722
63cb3926
JM
27232016-09-21 Jason Merrill <jason@redhat.com>
2724
2725 * line-map.c (linemap_location_from_macro_definition_p): New.
2726 * line-map.h: Declare it.
2727
31316208
DM
27282016-09-15 David Malcolm <dmalcolm@redhat.com>
2729
2730 * include/line-map.h (class rich_location): Note that newlines
2731 aren't supported in fix-it text.
2732 * line-map.c (rich_location::add_fixit_insert_before): Reject
2733 attempts to add fix-its containing newlines.
2734 (rich_location::add_fixit_replace): Likewise.
2735
254830ba
DM
27362016-09-13 David Malcolm <dmalcolm@redhat.com>
2737
2738 * include/line-map.h (class rich_location): Add description of
2739 fix-it hints to leading comment.
2740 (rich_location::add_fixit_insert): Rename both overloaded methods
2741 to..
2742 (rich_location::add_fixit_insert_before): ...this, updating their
2743 comments.
2744 (rich_location::add_fixit_insert_after): Two new overloaded
2745 methods.
2746 (rich_location::stop_supporting_fixits): New method.
2747 * line-map.c (rich_location::add_fixit_insert): Rename both
2748 overloaded methods to..
2749 (rich_location::add_fixit_insert_before): ...this, updating their
2750 comments.
2751 (rich_location::add_fixit_insert_after): Two new methods.
2752 (rich_location::reject_impossible_fixit): Split out
2753 failure-handling into...
2754 (rich_location::stop_supporting_fixits): New method.
2755
c65236d6
DM
27562016-09-02 David Malcolm <dmalcolm@redhat.com>
2757
2758 * include/line-map.h (rich_location::seen_impossible_fixit_p): New
2759 accessor.
2760
3d4f9f87
DM
27612016-08-31 David Malcolm <dmalcolm@redhat.com>
2762
2763 * include/line-map.h (class fixit_remove): Remove stray decl.
2764 (fixit_hint::affects_line_p): Make const.
2765 (fixit_insert::affects_line_p): Likewise.
2766 (fixit_replace::affects_line_p): Likewise.
2767 * line-map.c (fixit_insert::affects_line_p): Likewise.
2768 (fixit_replace::affects_line_p): Likewise.
2769
b816477a
DM
27702016-08-30 David Malcolm <dmalcolm@redhat.com>
2771
2772 * include/line-map.h (class semi_embedded_vec): New class.
2773 (semi_embedded_vec<T, NUM_EMBEDDED>::semi_embedded_vec): New ctor.
2774 (semi_embedded_vec<T, NUM_EMBEDDED>::~semi_embedded_vec): New
2775 dtor.
2776 (semi_embedded_vec<T, NUM_EMBEDDED>::operator[]): New methods.
2777 (semi_embedded_vec<T, NUM_EMBEDDED>::push): New method.
2778 (semi_embedded_vec<T, NUM_EMBEDDED>::truncate): New method.
2779 (rich_location::get_num_locations): Reimplement in terms of
2780 m_ranges.
2781 (rich_location::get_range): Make non-inline.
2782 (rich_location::get_num_fixit_hints): Reimplement in terms of
2783 m_fixit_hints.
2784 (rich_location::add_fixit): New function.
2785 (rich_location::MAX_RANGES): Rename to...
2786 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this.
2787 (rich_location::MAX_FIXIT_HINTS): Rename to...
2788 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this, and make
2789 private.
2790 (rich_location::m_num_ranges): Eliminate in favor of...
2791 (rich_location::m_ranges): ...this, converting from a fixed-size
2792 array to a semi_embedded_vec.
2793 (rich_location::m_num_fixit_hints): Eliminate in favor of...
2794 (rich_location::m_fixit_hints): ...this, converting from a
2795 fixed-size array to a semi_embedded_vec.
2796 * line-map.c (rich_location::rich_location): Update for above
2797 changes.
2798 (rich_location::~rich_location): Likewise.
2799 (rich_location::get_loc): Likewise.
2800 (rich_location::get_range): New methods.
2801 (rich_location::add_range): Update for above changes.
2802 (rich_location::set_range): Likewise.
2803 (rich_location::add_fixit_insert): Likewise.
2804 (rich_location::add_fixit_replace): Likewise.
2805 (rich_location::get_last_fixit_hint): Likewise.
2806 (rich_location::reject_impossible_fixit): Likewise.
2807 (rich_location::add_fixit): New method.
2808
f9087798
DM
28092016-08-30 David Malcolm <dmalcolm@redhat.com>
2810
2811 * include/line-map.h (rich_location::add_fixit_insert): Add
2812 comments. Add overload omitting the source_location param.
2813 (rich_location::add_fixit_remove): Add comments. Add overloads
2814 omitting the range, and accepting a source_location.
2815 (rich_location::add_fixit_replace): Likewise.
2816 * line-map.c (rich_location::add_fixit_insert): Add comments. Add
2817 overload omitting the source_location param.
2818 (rich_location::add_fixit_remove): Add comments. Add overloads
2819 omitting the range, and accepting a source_location.
2820 (rich_location::add_fixit_replace): Likewise.
2821
2aa51413
DM
28222016-08-26 David Malcolm <dmalcolm@redhat.com>
2823
2824 * include/line-map.h (get_pure_location): New decl.
2825 * line-map.c (get_pure_location): Move here, from gcc/input.c, adding
2826 a line_maps * param.
2827 (rich_location::add_fixit_insert): Call get_pure_location on "where".
2828 (rich_location::add_fixit_replace): Call get_pure_location on the
2829 end-points.
2830
ee908516
DM
28312016-08-26 David Malcolm <dmalcolm@redhat.com>
2832
2833 * include/line-map.h (rich_location): Eliminate unimplemented
2834 constructor based on source_range.
2835 (rich_location::get_last_fixit_hint): New method.
2836 (rich_location::reject_impossible_fixit): New method.
2837 (rich_location): Add fields m_line_table and
2838 m_seen_impossible_fixit.
2839 (fixit_hint::maybe_append_replace): New pure virtual function.
2840 (fixit_insert::maybe_append_replace): New function.
2841 (fixit_replace::maybe_append_replace): New function.
2842 * line-map.c (rich_location::rich_location): Initialize
2843 m_line_table and m_seen_impossible_fixit.
2844 (rich_location::add_fixit_insert): Call
2845 reject_impossible_fixit and bail out if true.
2846 (column_before_p): New function.
2847 (rich_location::add_fixit_replace): Call reject_impossible_fixit
2848 and bail out if true. Attempt to consolidate with neighboring
2849 fixits.
2850 (rich_location::get_last_fixit_hint): New method.
2851 (rich_location::reject_impossible_fixit): New method.
2852 (fixit_insert::maybe_append_replace): New method.
2853 (fixit_replace::maybe_append_replace): New method.
2854
d672cded
DM
28552016-08-23 David Malcolm <dmalcolm@redhat.com>
2856
2857 * include/line-map.h (source_range::from_locations): New method.
2858
2ffe0809
DM
28592016-08-19 David Malcolm <dmalcolm@redhat.com>
2860
2861 * include/line-map.h (fixit_hint::kind): Delete REPLACE.
2862 (class fixit_remove): Delete.
2863 * line-map.c (rich_location::add_fixit_remove): Reimplement
2864 by calling add_fixit_replace with an empty string.
2865 (fixit_remove::fixit_remove): Delete.
2866 (fixit_remove::affects_line_p): Delete.
2867
c65699ef
JM
28682016-08-19 Joseph Myers <joseph@codesourcery.com>
2869
2870 PR c/32187
2871 * include/cpplib.h (CPP_N_FLOATN, CPP_N_FLOATNX)
2872 (CPP_N_WIDTH_FLOATN_NX, CPP_FLOATN_SHIFT, CPP_FLOATN_MAX): New
2873 macros.
2874 * expr.c (interpret_float_suffix): Handle fN, fNx, FN and FNx
2875 suffixes.
2876
fcf830ab
PK
28772016-08-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
2878
2879 * expr.c (eval_token): Append "evaluates to 0" to Wundef diagnostic.
2880
cb18fd07
DM
28812016-08-18 David Malcolm <dmalcolm@redhat.com>
2882
2883 * directives.c (directive_names): New array.
2884 (_cpp_handle_directive): Offer spelling suggestions for misspelled
2885 directives.
2886 * errors.c (cpp_diagnostic_at_richloc): New function.
2887 (cpp_error_at_richloc): New function.
2888 * include/cpplib.h (struct cpp_callbacks): Add field
2889 "get_suggestion".
2890 (cpp_error_at_richloc): New decl.
2891
9c62c873
MP
28922016-08-18 Marek Polacek <polacek@redhat.com>
2893
2894 PR c/7652
2895 * pch.c (write_macdef): Add CPP_FALLTHRU.
2896
191816a3
MP
28972016-08-12 Marek Polacek <polacek@redhat.com>
2898
2899 PR c/7652
2900 * lex.c (search_line_fast): Add FALLTHRU.
2901 (_cpp_lex_direct): Likewise.
2902 (cpp_token_val_index): Adjust fall through comment.
2903 * macro.c (parse_params): Add FALLTHRU.
2904 * pch.c (count_defs): Adjust fall through comment.
2905 (write_defs): Likewise.
2906
e7864d68
DM
29072016-08-06 David Malcolm <dmalcolm@redhat.com>
2908
2909 PR bootstrap/72823
2910 * charset.c (_cpp_valid_ucn): Replace overzealous assert with one
2911 that allows for char_range to be non-NULL when loc_reader is NULL.
2912
88fa5555
DM
29132016-08-05 David Malcolm <dmalcolm@redhat.com>
2914
2915 * charset.c (cpp_substring_ranges::cpp_substring_ranges): New
2916 constructor.
2917 (cpp_substring_ranges::~cpp_substring_ranges): New destructor.
2918 (cpp_substring_ranges::add_range): New method.
2919 (cpp_substring_ranges::add_n_ranges): New method.
2920 (_cpp_valid_ucn): Add "char_range" and "loc_reader" params; if
2921 they are non-NULL, read position information from *loc_reader
2922 and update char_range->m_finish accordingly.
2923 (convert_ucn): Add "char_range", "loc_reader", and "ranges"
2924 params. If loc_reader is non-NULL, read location information from
2925 it, and update *ranges accordingly, using char_range.
2926 Conditionalize the conversion into tbuf on tbuf being non-NULL.
2927 (convert_hex): Likewise, conditionalizing the call to
2928 emit_numeric_escape on tbuf.
2929 (convert_oct): Likewise.
2930 (convert_escape): Add params "loc_reader" and "ranges". If
2931 loc_reader is non-NULL, read location information from it, and
2932 update *ranges accordingly. Conditionalize the conversion into
2933 tbuf on tbuf being non-NULL.
2934 (cpp_interpret_string): Rename to...
2935 (cpp_interpret_string_1): ...this, adding params "loc_readers" and
2936 "out". Use "to" to conditionalize the initialization and usage of
2937 "tbuf", such as running the converter. If "loc_readers" is
2938 non-NULL, use the instances within it, reading location
2939 information from them, and passing them to convert_escape; likewise
2940 write to "out" if loc_readers is non-NULL. Check for leading
2941 quote and issue an error if it is not present. Update boundary
2942 check from "== limit" to ">= limit" to protect against erroneous
2943 location values to calls that are not parsing string literals.
2944 (cpp_interpret_string): Reimplement in terms to
2945 cpp_interpret_string_1.
2946 (noop_error_cb): New function.
2947 (cpp_interpret_string_ranges): New function.
2948 (cpp_string_location_reader::cpp_string_location_reader): New
2949 constructor.
2950 (cpp_string_location_reader::get_next): New method.
2951 * include/cpplib.h (class cpp_string_location_reader): New class.
2952 (class cpp_substring_ranges): New class.
2953 (cpp_interpret_string_ranges): New prototype.
2954 * internal.h (_cpp_valid_ucn): Add params "char_range" and
2955 "loc_reader".
2956 * lex.c (forms_identifier_p): Pass NULL for new params to
2957 _cpp_valid_ucn.
2958
8204be6c
AS
29592016-08-01 Andreas Schwab <schwab@suse.de>
2960
2961 * include/cpplib.h: Fix comment typo.
2962
a01fc549
DM
29632016-07-27 David Malcolm <dmalcolm@redhat.com>
2964
2965 * include/line-map.h (source_location): Fix line numbers in
2966 comment.
2967
741d3be5
DM
29682016-07-11 David Malcolm <dmalcolm@redhat.com>
2969
2970 * include/line-map.h (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES):
2971 Move here from line-map.c.
2972 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
2973 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): Move from
2974 here to line-map.h.
2975 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
2976
ac81cf0b
DM
29772016-06-22 David Malcolm <dmalcolm@redhat.com>
2978
2979 * directives.c (do_include_common): Pass on "location" to
2980 _cpp_stack_include.
2981 * errors.c (cpp_diagnostic): Reimplement in terms of...
2982 (cpp_diagnostic_at): New function.
2983 (cpp_error_at): New function.
2984 (cpp_errno_filename): Add "loc" param and use it by using
2985 cpp_error_at rather than cpp_error.
2986 * files.c (find_file_in_dir): Add "loc" param and pass it to
2987 open_file_failed.
2988 (_cpp_find_file): Add "loc" param. Use it to convert calls to
2989 cpp_error to cpp_error_at, and pass it to find_file_in_dir and
2990 open_file_failed.
2991 (read_file_guts): Add "loc" param. Use it to convert calls to
2992 cpp_error to cpp_error_at. Pass it to cpp_errno_filename.
2993 (read_file): Add "loc" param. Pass it to open_file_failed and
2994 read_file_guts.
2995 (should_stack_file): Add "loc" param. Pass it to read_file.
2996 (_cpp_stack_file): Add "loc" param. Pass it to should_stack_file.
2997 (_cpp_stack_include): Add "loc" param. Pass it to
2998 _cpp_find_file and _cpp_stack_file.
2999 (open_file_failed): Add "loc" param. Pass it to
3000 cpp_errno_filename.
3001 (_cpp_fake_include): Add 0 as a source_location in call to
3002 _cpp_find_file.
3003 (_cpp_compare_file_date): Likewise.
3004 (cpp_push_include): Likewise for call to _cpp_stack_include.
3005 (cpp_push_default_include): Likewise.
3006 (_cpp_save_file_entries): Likewise for call to open_file_failed.
3007 (_cpp_has_header): Likewise for call to _cpp_find_file.
3008 * include/cpplib.h (cpp_errno_filename): Add source_location
3009 param.
3010 (cpp_error_at): New declaration.
3011 * init.c (cpp_read_main_file): Add 0 as a source_location in calls
3012 to _cpp_find_file and _cpp_stack_file.
3013 * internal.h (_cpp_find_file): Add source_location param.
3014 (_cpp_stack_file): Likewise.
3015 (_cpp_stack_include): Likewise.
3016
a93eac6a
DM
30172016-06-22 David Malcolm <dmalcolm@redhat.com>
3018
3019 * include/line-map.h (fixit_hint::get_start_loc): New pure virtual
3020 function.
3021 (fixit_hint::maybe_get_end_loc): Likewise.
3022 (fixit_insert::get_start_loc): New function, implementing
3023 fixit_hint::get_start_loc.
3024 (fixit_insert::maybe_get_end_loc): New function, implementing
3025 fixit_hint::maybe_get_end_loc.
3026 (fixit_remove::get_start_loc): New function, implementing
3027 fixit_hint::get_start_loc.
3028 (fixit_remove::maybe_get_end_loc): New function, implementing
3029 fixit_hint::maybe_get_end_loc.
3030 (fixit_replace::get_start_loc): New function, implementing
3031 fixit_hint::get_start_loc.
3032 (fixit_replace::maybe_get_end_loc): New function, implementing
3033 fixit_hint::maybe_get_end_loc.
3034
fe55692c
JDA
30352016-06-21 John David Anglin <danglin@gcc.gnu.org>
3036
3037 * line-map.c (location_adhoc_data_update): Use int64_t instead of
3038 long long.
3039 (get_combined_adhoc_loc): Likewise.
3040
15c98b2e
ES
30412016-06-01 Eduard Sanou <dhole@openmailbox.org>
3042
3043 * include/cpplib.h (cpp_callbacks): Add get_source_date_epoch
3044 callback.
3045 * include/cpplib.h (cpp_init_source_date_epoch): Remove prototype.
3046 * init.c (cpp_init_source_date_epoch): Remove function.
3047 * init.c (cpp_create_reader): Initialize pfile->source_date_epoch.
3048 * internal.h (cpp_reader): Extend comment about source_date_epoch.
3049 * macro.c (_cpp_builtin_macro_text): Use get_source_date_epoch
3050 callback only once, read pfile->source_date_epoch on future passes.
3051 Check that get_source_date_epoch callback is not NULL.
3052
ceb17928
ML
30532016-05-20 Martin Liska <mliska@suse.cz>
3054
3055 * config.in: Regenerated.
3056 * configure: Likewise.
3057 * configure.ac: Handle --enable-valgrind-annotations.
3058 * lex.c (new_buff): Use ENABLE_VALGRIND_ANNOTATIONS instead
3059 of ENABLE_VALGRIND_CHECKING.
3060 (_cpp_free_buff): Likewise.
3061
174f6622
ES
30622016-04-28 Eduard Sanou <dhole@openmailbox.org>
3063 Matthias Klose <doko@debian.org>
3064
3065 * include/cpplib.h (cpp_init_source_date_epoch): Prototype.
3066 * init.c (cpp_init_source_date_epoch): New function.
3067 * internal.h: Added source_date_epoch variable to struct
3068 cpp_reader to store a reproducible date.
7365279f
BK
3069 * macro.c (_cpp_builtin_macro_text): Set pfile->date timestamp from
3070 pfile->source_date_epoch instead of localtime if source_date_epoch is
3071 set, to be used for __DATE__ and __TIME__ macros to help reproducible
174f6622
ES
3072 builds.
3073
12de2245
BS
30742016-04-13 Bernd Schmidt <bschmidt@redhat.com>
3075
3076 Patch from Roger Orr <rogero@howzatt.demon.co.uk>
3077 PR preprocessor/69650
3078 * directives.c (do_linemarker): Reread map after calling
3079 cpp_get_token.
3080
64824205
RH
30812016-04-06 Richard Henderson <rth@redhat.com>
3082
3083 PR preprocessor/61817
3084 PR preprocessor/69391
3085 * internal.h (_cpp_builtin_macro_text): Update decl.
3086 * macro.c (_cpp_builtin_macro_text): Accept location for __LINE__.
3087 (builtin_macro): Accept a second location for __LINE__.
3088 (enter_macro_context): Compute both virtual and real expansion
3089 locations for the macro.
3090
3caf0ca1
BS
30912016-03-25 Bernd Schmidt <bschmidt@redhat.com>
3092
3093 PR lto/69650
3094 * directives.c (do_linemarker): Test for file left but not entered
3095 here.
3096 * line-map.c (linemap_add): Not here.
3097
6b366948
JJ
30982016-03-21 Jakub Jelinek <jakub@redhat.com>
3099
3100 PR target/70296
3101 * include/cpplib.h (cpp_fun_like_macro_p): New prototype.
3102 * macro.c (cpp_fun_like_macro_p): New function.
3103
64567cfd
RH
31042016-03-15 Richard Henderson <rth@redhat.com>
3105
3106 * line-map.c (new_linemap): Make alloc_size a size_t.
3107
2aaeea19
JM
31082016-03-14 Jason Merrill <jason@redhat.com>
3109
3110 * expr.c (cpp_classify_number): Hex floats are new in C++1z.
3111 * init.c (lang_defaults): Likewise.
3112
b4f3232d
DM
31132016-03-09 David Malcolm <dmalcolm@redhat.com>
3114
3115 PR c/68473
3116 PR c++/70105
3117 * line-map.c (linemap_macro_map_loc_unwind_toward_spelling): Move
3118 decl...
3119 * include/line-map.h
3120 (linemap_macro_map_loc_unwind_toward_spelling): ...here,
3121 converting from static to extern.
3122
40499f81
DM
31232016-03-09 David Malcolm <dmalcolm@redhat.com>
3124
3125 PR c/68473
3126 PR c++/70105
3127 * include/line-map.h (source_range::debug): Delete.
3128 (struct location_range): Update comment. Replace
3129 expanded_location fields "m_start", "m_finish", and "m_caret" with
3130 a source_location field: "m_loc".
3131 (class rich_location): Reword comment.
3132 (rich_location::get_loc): Reimplement in terms of a new overloaded
3133 variant which takes an unsigned int.
3134 (rich_location::get_loc_addr): Delete.
3135 (rich_location::add_range): Drop params "start" and "finish" in
3136 favor of param "loc". Drop overloaded variants taking a
3137 source_range or location_range *.
3138 (rich_location::lazily_expand_location): Delete in favor of...
3139 (rich_location::get_expanded_location): New decl.
3140 (rich_location::m_loc): Delete field.
3141 (rich_location::m_column_override): New field.
3142 * line-map.c (rich_location::rich_location): Drop name of
3143 line_maps * param. Update initializations for deletion of field
3144 "m_loc" and addition of field "m_column_override". Reimplement
3145 body as a call to add_range. Delete overloaded variant taking a
3146 source_range.
3147 (rich_location::get_loc): New function.
3148 (rich_location::lazily_expand_location): Delete in favor of...
3149 (rich_location::get_expanded_location): New function.
3150 (rich_location::override_column): Reimplement.
3151 (rich_location::add_range): Drop params "start" and "finish" in
3152 favor of param "loc". Eliminate location expansion in favor of
3153 simply storing loc. Drop overloaded variants taking a
3154 source_range or location_range *.
3155 (rich_location::set_range): Eliminate location expansion.
3156
7168133a
DM
31572016-02-29 David Malcolm <dmalcolm@redhat.com>
3158
3159 PR preprocessor/69985
3160 (linemap_position_for_loc_and_offset): Rename param from "offset"
3161 to "column_offset". Right-shift the column_offset by m_range_bits
3162 of the pertinent ordinary map whenever offsetting a
3163 source_location. For clarity, offset the column by the column
3164 offset, rather than the other way around.
3165
196440f8
DM
31662016-02-23 David Malcolm <dmalcolm@redhat.com>
3167
3168 PR preprocessor/69126
3169 PR preprocessor/69543
3170 * line-map.c (linemap_compare_locations): At the function top,
3171 replace inlined bodies of get_location_from_adhoc_loc with calls
3172 to get_location_from_adhoc_loc. Add a pair of calls to
3173 get_location_from_adhoc_loc at the bottom of the function, to
3174 avoid meaningless comparisons of ad-hoc and non-ad-hoc locations.
3175
44714d8c
DM
31762016-02-08 David Malcolm <dmalcolm@redhat.com>
3177
3178 PR preprocessor/69664
3179 * errors.c (cpp_diagnostic_with_line): Only call
3180 rich_location::override_column if the column is non-zero.
3181 * line-map.c (rich_location::override_column): Update columns
3182 within m_ranges[0]. Add assertions to verify that doing so is
3183 sane.
3184
b5c1c988
JJ
31852016-02-05 Jakub Jelinek <jakub@redhat.com>
3186
3187 PR c++/69628
3188 * charset.c (cpp_interpret_charconst): Clear *PCHARS_SEEN
3189 and *UNSIGNEDP if bailing out early due to errors.
3190
e2eb5056
JJ
31912016-01-28 Jakub Jelinek <jakub@redhat.com>
3192
4bda5946
JJ
3193 PR pch/68176
3194 * files.c (_cpp_find_file): Set file->implicit_preinclude even if
3195 included from file->implicit_preinclude header.
3196
e2eb5056
JJ
3197 * directives.c (destringize_and_run): Adjust prototype.
3198
0afff540
DM
31992016-01-27 David Malcolm <dmalcolm@redhat.com>
3200
3201 PR preprocessor/69126
3202 * directives.c (destringize_and_run): Add expansion_loc param; use
3203 it when handling unexpanded pragmas to fixup the locations of the
3204 synthesized tokens.
3205 (_cpp_do__Pragma): Add expansion_loc param and use it when calling
3206 destringize_and_run.
3207 * internal.h (_cpp_do__Pragma): Add expansion_loc param.
3208 * macro.c (builtin_macro): Pass expansion location of _Pragma to
3209 _cpp_do__Pragma.
3210
c7df95d8
DM
32112016-01-14 David Malcolm <dmalcolm@redhat.com>
3212
3213 PR preprocessor/69177
3214 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): New
3215 constant.
3216 (LINE_MAP_MAX_LOCATION_WITH_COLS): Add note about unit tests
3217 to comment.
3218 (can_be_stored_compactly_p): Reduce threshold from
3219 LINE_MAP_MAX_LOCATION_WITH_COLS to
3220 LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES.
3221 (get_combined_adhoc_loc): Likewise.
3222 (get_range_from_loc): Likewise.
3223 (linemap_line_start): Ensure that a new ordinary map is created
3224 when transitioning from range-packing being enabled to disabled,
3225 at the LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES threshold. Set
3226 range_bits to 0 for new ordinary maps when beyond this limit.
3227 Prevent the "increase the column bits of a freshly created map"
3228 optimization if the range bits has reduced.
3229
53290e07
JJ
32302016-01-08 Jakub Jelinek <jakub@redhat.com>
3231
3232 PR c++/69145
3233 * files.c (cpp_included_before): If IS_ADHOC_LOC (location), lookup
3234 real location from the line_table.
3235
818ab71a
JJ
32362016-01-04 Jakub Jelinek <jakub@redhat.com>
3237
3238 Update copyright years.
3239
329590d7
DM
32402015-12-22 David Malcolm <dmalcolm@redhat.com>
3241
3242 * line-map.c (get_combined_adhoc_loc): Remove condition
3243 on locus < RESERVED_LOCATION_COUNT when considering
3244 whether a caret == start == finish location can be
3245 simply stored as the caret location.
3246
f79520bb
DM
32472015-12-07 David Malcolm <dmalcolm@redhat.com>
3248
3249 * include/line-map.h (rich_location::set_range): Add line_maps *
3250 param; convert param from source_range to source_location. Drop
3251 "overwrite_loc_p" param.
3252 * line-map.c (rich_location::set_range): Likewise, acting as if
3253 "overwrite_loc_p" were true, and getting range from the location.
3254
a87a86e1
DM
32552015-11-20 David Malcolm <dmalcolm@redhat.com>
3256
3257 PR 62314
3258 * include/line-map.h (source_range::intersects_line_p): New
3259 method.
3260 (rich_location::~rich_location): New.
3261 (rich_location::add_fixit_insert): New method.
3262 (rich_location::add_fixit_remove): New method.
3263 (rich_location::add_fixit_replace): New method.
3264 (rich_location::get_num_fixit_hints): New accessor.
3265 (rich_location::get_fixit_hint): New accessor.
3266 (rich_location::MAX_FIXIT_HINTS): New constant.
3267 (rich_location::m_num_fixit_hints): New field.
3268 (rich_location::m_fixit_hints): New field.
3269 (class fixit_hint): New class.
3270 (class fixit_insert): New class.
3271 (class fixit_remove): New class.
3272 (class fixit_replace): New class.
3273 * line-map.c (source_range::intersects_line_p): New method.
3274 (rich_location::rich_location): Add initialization of
3275 m_num_fixit_hints to both ctors.
3276 (rich_location::~rich_location): New.
3277 (rich_location::add_fixit_insert): New method.
3278 (rich_location::add_fixit_remove): New method.
3279 (rich_location::add_fixit_replace): New method.
3280 (fixit_insert::fixit_insert): New.
3281 (fixit_insert::~fixit_insert): New.
3282 (fixit_insert::affects_line_p): New.
3283 (fixit_remove::fixit_remove): New.
3284 (fixit_remove::affects_line_p): New.
3285 (fixit_replace::fixit_replace): New.
3286 (fixit_replace::~fixit_replace): New.
3287 (fixit_replace::affects_line_p): New.
3288
46ce03de
JJ
32892015-11-19 Jakub Jelinek <jakub@redhat.com>
3290
3291 PR preprocessor/60736
3292 * include/cpplib.h (cpp_errno_filename): New prototype.
3293 * errors.c (cpp_errno): Don't handle msgid "" specially, use
3294 _(msgid) instead of msgid as argument to cpp_error.
3295 (cpp_errno_filename): New function.
3296 * files.c (read_file_guts): Use cpp_errno_filename instead of
3297 cpp_errno.
3298 (open_file_failed): Likewise. Use file->name if file->path is NULL
3299 in diagnostics.
3300
ebedc9a3
DM
33012015-11-13 David Malcolm <dmalcolm@redhat.com>
3302
3303 * errors.c (cpp_diagnostic): Pass pfile->line_table to
3304 rich_location ctor.
3305 (cpp_diagnostic_with_line): Likewise.
3306 * include/cpplib.h (struct cpp_token): Update comment for src_loc
3307 to indicate that the range of the token is "baked into" the
3308 source_location.
3309 * include/line-map.h (source_location): Update the descriptive
3310 comment to reflect the packing scheme for short ranges, adding
3311 worked examples of location encoding.
3312 (struct line_map_ordinary): Drop field "column_bits" in favor
3313 of field "m_column_and_range_bits"; add field "m_range_bits".
3314 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
3315 (location_adhoc_data): Add source_range field.
3316 (struct line_maps): Add fields "default_range_bits",
3317 "num_optimized_ranges" and "num_unoptimized_ranges".
3318 (get_combined_adhoc_loc): Add source_range param.
3319 (get_range_from_loc): New declaration.
3320 (pure_location_p): New prototype.
3321 (COMBINE_LOCATION_DATA): Add source_range param.
3322 (SOURCE_LINE): Update for renaming of column_bits.
3323 (SOURCE_COLUMN): Likewise. Shift the column right by the map's
3324 range_bits.
3325 (LAST_SOURCE_LINE_LOCATION): Update for renaming of column_bits.
3326 (linemap_position_for_line_and_column): Add line_maps * params.
3327 (rich_location::rich_location): Likewise.
3328 * lex.c (_cpp_lex_direct): Capture the range of the token, baking
3329 it into token->src_loc via a call to COMBINE_LOCATION_DATA.
3330 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): Reduce from 1U << 17 to
3331 1U << 12.
3332 (location_adhoc_data_hash): Add the src_range into
3333 the hash value.
3334 (location_adhoc_data_eq): Require equality of the src_range
3335 values.
3336 (can_be_stored_compactly_p): New function.
3337 (get_combined_adhoc_loc): Add src_range param, and store it,
3338 via a bit-packing scheme for short ranges, otherwise within the
3339 lookaside table. Remove the requirement that data is non-NULL.
3340 (get_range_from_adhoc_loc): New function.
3341 (get_range_from_loc): New function.
3342 (pure_location_p): New function.
3343 (linemap_add): Ensure that start_location has zero for the
3344 range_bits, unless we're past LINE_MAP_MAX_LOCATION_WITH_COLS.
3345 Initialize range_bits to zero. Assert that the start_location
3346 is "pure".
3347 (linemap_line_start): Assert that the
3348 column_and_range_bits >= range_bits.
3349 Update determinination of whether we need to start a new map
3350 using the effective column bits, without the range bits.
3351 Use the set's default_range_bits in new maps, apart from
3352 those with column_bits == 0, which should also have 0 range_bits.
3353 Increase the column bits for new maps by the range bits.
3354 When adding lines to an existing map, use set->highest_line
3355 directly rather than offsetting highest by SOURCE_COLUMN.
3356 Add assertions to sanity-check the return value.
3357 (linemap_position_for_column): Offset to_column by range_bits.
3358 Update set->highest_location if necessary.
3359 (linemap_position_for_line_and_column): Add line_maps * param.
3360 Update the calculation to offset the column by range_bits, and
3361 conditionalize it on being <= LINE_MAP_MAX_LOCATION_WITH_COLS.
3362 Bound it by LINEMAPS_MACRO_LOWEST_LOCATION. Update
3363 set->highest_location if necessary.
3364 (linemap_position_for_loc_and_offset): Handle ad-hoc locations;
3365 pass "set" to linemap_position_for_line_and_column.
3366 (linemap_macro_map_loc_unwind_toward_spelling): Add line_maps
3367 param. Handle ad-hoc locations.
3368 (linemap_location_in_system_header_p): Pass on "set" to call to
3369 linemap_macro_map_loc_unwind_toward_spelling.
3370 (linemap_macro_loc_to_spelling_point): Retain ad-hoc locations.
3371 Pass on "set" to call to
3372 linemap_macro_map_loc_unwind_toward_spelling.
3373 (linemap_resolve_location): Retain ad-hoc locations. Pass on
3374 "set" to call to linemap_macro_map_loc_unwind_toward_spelling.
3375 (linemap_unwind_toward_expansion): Pass on "set" to call to
3376 linemap_macro_map_loc_unwind_toward_spelling.
3377 (linemap_expand_location): Extract the data pointer before
3378 extracting the location.
3379 (rich_location::rich_location): Add line_maps param; use it to
3380 extract the range from the source_location.
3381 * location-example.txt: Regenerate, showing new representation.
3382
8a645150
DM
33832015-11-06 David Malcolm <dmalcolm@redhat.com>
3384
3385 * errors.c (cpp_diagnostic): Update for change in signature
3386 of "error" callback.
3387 (cpp_diagnostic_with_line): Likewise, calling override_column
3388 on the rich_location.
3389 * include/cpplib.h (struct cpp_callbacks): Within "error"
3390 callback, convert param from source_location to rich_location *,
3391 and drop column_override param.
3392 * include/line-map.h (struct source_range): New struct.
3393 (struct location_range): New struct.
3394 (class rich_location): New class.
3395 (linemap_client_expand_location_to_spelling_point): New declaration.
3396 * line-map.c (rich_location::rich_location): New ctors.
3397 (rich_location::lazily_expand_location): New method.
3398 (rich_location::override_column): New method.
3399 (rich_location::add_range): New methods.
3400 (rich_location::set_range): New method.
3401
ee015909
DM
34022015-11-06 David Malcolm <dmalcolm@redhat.com>
3403
3404 * include/line-map.h (struct linemap_stats): Add fields
3405 "adhoc_table_size" and "adhoc_table_entries_used".
3406 * line-map.c (linemap_get_statistics): Populate above fields.
3407
a6c764d0
MM
34082015-11-04 Mikhail Maltsev <maltsevm@gmail.com>
3409
3410 * config.in: Regenerate.
3411 * configure: Regenerate.
3412 * configure.ac: Remove ENABLE_CHECKING.
3413
49445904
UB
34142015-11-03 Uros Bizjak <ubizjak@gmail.com>
3415
3416 * lex.c (search_line_sse42): Correctly advance the pointer to an
3417 aligned address.
3418
525ce910
DM
34192015-11-02 David Malcolm <dmalcolm@redhat.com>
3420
3421 * include/line-map.h (source_location): In the table in the
3422 descriptive comment, show UNKNOWN_LOCATION, BUILTINS_LOCATION,
3423 LINE_MAP_MAX_LOCATION_WITH_COLS, LINE_MAP_MAX_SOURCE_LOCATION.
3424 Add notes about ad-hoc values.
3425
7ec491c0
MM
34262015-10-21 Mikhail Maltsev <maltsevm@gmail.com>
3427
22d66382
MM
3428 * include/line-map.h: Use CHECKING_P instead of ENABLE_CHECKING.
3429 * init.c: Likewise.
3430 * macro.c (struct macro_arg_token_iter, set_arg_token,
3431 macro_arg_token_iter_init, macro_arg_token_iter_forward,
3432 macro_arg_token_iter_get_token, macro_arg_token_iter_get_location,
3433 alloc_expanded_arg_mem, _cpp_backup_tokens): Likewise.
3434
7ec491c0
MM
3435 * config.in: Regenerate.
3436 * configure: Regenerate.
3437 * configure.ac (CHECKING_P): Define.
3438 * system.h (fancy_abort): Declare.
3439 (abort): Define.
3440 (gcc_assert): Define. Use CHECKING_P.
3441
179b8d05
MM
34422015-10-13 Mikhail Maltsev <maltsevm@gmail.com>
3443
3444 * system.h (CHECKING_P, gcc_checking_assert): Define.
3445
87b470b3
MLI
34462015-09-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
3447
3448 PR c/66415
3449 * line-map.c (linemap_position_for_loc_and_offset): Handle the
3450 case of long lines encoded in multiple maps.
3451
85bc8baa
MP
34522015-09-07 Marek Polacek <polacek@redhat.com>
3453
3454 * system.h (INTTYPE_MINIMUM): Rewrite to avoid shift warning.
3455
bf5372e7
YS
34562015-08-06 Yaakov Selkowitz <yselkowi@redhat.com>
3457
3458 * configure: Regenerate.
3459
d17f7d59
TS
34602015-07-08 Thomas Schwinge <thomas@codesourcery.com>
3461
3462 * include/line-map.h (RESERVED_LOCATION_COUNT): Change type to
3463 source_location.
3464
fbb22910
PC
34652015-07-02 Paolo Carlini <paolo.carlini@oracle.com>
3466
d885793d 3467 PR preprocessor/53690
fbb22910
PC
3468 * charset.c (_cpp_valid_ucn): Add cppchar_t * parameter and change
3469 return type to bool. Fix encoding of \u0000 and \U00000000 in C++.
3470 (convert_ucn): Adjust call.
3471 * lex.c (forms_identifier_p): Likewise.
3472 * internal.h (_cpp_valid_ucn): Adjust declaration.
3473
fe95b036
ESR
34742015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
3475
3476 Implement N4197 - Adding u8 character literals
3477 * include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens;
3478 (struct cpp_options): Add utf8_char_literals.
3479 * init.c (struct lang_flags): Add utf8_char_literals;
3480 (struct lang_flags lang_defaults): Add column for utf8_char_literals.
fbb22910 3481 * macro.c (stringify_arg()): Treat CPP_UTF8CHAR token;
fe95b036
ESR
3482 * expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()):
3483 Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens;
3484 (cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token;
3485 (eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token.
3486 * lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens.
3487 * charset.c (converter_for_type(), cpp_interpret_charconst()):
3488 Treat CPP_UTF8CHAR token.
3489
dc6bcf52
UB
34902015-06-30 Uros Bizjak <ubizjak@gmail.com>
3491
3492 * lex.c (search_line_sse42) [__GCC_ASM_FLAG_OUTPUTS__]: New main
3493 loop using asm flag outputs.
3494
a1661b90
MP
34952015-06-08 Marek Polacek <polacek@redhat.com>
3496
3497 PR c/66415
3498 * line-map.c (linemap_position_for_loc_and_offset): Remove
3499 linemap_assert_fails; reverse conditions.
3500
815facd3
MLI
35012015-05-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
3502
3503 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER
3504 LINE_MAP_MAX_LOCATION_WITH_COLS,LINE_MAP_MAX_SOURCE_LOCATION):
3505 New constants.
3506 (linemap_line_start): Use them.
3507 (linemap_position_for_column): Use them.
3508
c819ed29
DM
35092015-05-20 David Malcolm <dmalcolm@redhat.com>
3510
3511 * include/line-map.h (MAP_START_LOCATION): Eliminate the non-const
3512 variant, and tweak comment for the const variant.
3513 (ORDINARY_MAP_STARTING_LINE_NUMBER): Drop the non-const variant.
3514 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
3515 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
3516 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
3517 (ORDINARY_MAP_FILE_NAME): Drop the non-const variant.
3518 (MACRO_MAP_MACRO): Likewise.
3519 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
3520 (MACRO_MAP_LOCATIONS): Likewise.
3521 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
3522 * line-map.c (linemap_add): Replace writes through macros with
3523 direct field accesses.
3524 (linemap_enter_macro): Likewise.
3525 (linemap_line_start): Likewise.
3526
0e50b624
DM
35272015-05-19 David Malcolm <dmalcolm@redhat.com>
3528
3529 * directives.c (do_line): Strengthen local "map" from
3530 const line_map * to const line_map_ordinary *.
3531 (do_linemarker): Likewise.
3532 (_cpp_do_file_change): Assert that we're not dealing with
3533 a macro map. Introduce local "ord_map" via a call to
3534 linemap_check_ordinary, guarded within the check for
3535 non-NULL. Use it for typesafety.
3536 * files.c (cpp_make_system_header): Strengthen local "map" from
3537 const line_map * to const line_map_ordinary *.
3538 * include/cpplib.h (struct cpp_callbacks): Likewise for second
3539 parameter of "file_change" callback.
3540 * include/line-map.h (struct line_map): Convert from a struct
3541 containing a union to a base class.
3542 (struct line_map_ordinary): Convert to a subclass of line_map.
3543 (struct line_map_macro): Likewise.
3544 (linemap_check_ordinary): Strengthen return type from line_map *
3545 to line_map_ordinary *, and add a const-variant.
3546 (linemap_check_macro): New pair of functions.
3547 (ORDINARY_MAP_STARTING_LINE_NUMBER): Strengthen param from
3548 const line_map * to const line_map_ordinary *, eliminating call
3549 to linemap_check_ordinary. Likewise for the non-const variant.
3550 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
3551 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
3552 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Likewise.
3553 (ORDINARY_MAP_FILE_NAME): Likewise.
3554 (MACRO_MAP_MACRO): Strengthen param from const line_map * to
3555 const line_map_macro *. Likewise for the non-const variant.
3556 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
3557 (MACRO_MAP_LOCATIONS): Likewise.
3558 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
3559 (struct maps_info): Replace with...
3560 (struct maps_info_ordinary):...this and...
3561 (struct maps_info_macro): ...this.
3562 (struct line_maps): Convert fields "info_ordinary" and
3563 "info_macro" to the above new structs.
3564 (LINEMAPS_MAP_INFO): Delete both functions.
3565 (LINEMAPS_MAPS): Likewise.
3566 (LINEMAPS_ALLOCATED): Rewrite both variants to avoid using
3567 LINEMAPS_MAP_INFO.
3568 (LINEMAPS_USED): Likewise.
3569 (LINEMAPS_CACHE): Likewise.
3570 (LINEMAPS_MAP_AT): Likewise.
3571 (LINEMAPS_ORDINARY_MAPS): Strengthen return type from line_map *
3572 to line_map_ordinary *.
3573 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
3574 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
3575 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
3576 (LINEMAPS_MACRO_MAPS): Strengthen return type from line_map * to
3577 line_map_macro *.
3578 (LINEMAPS_MACRO_MAP_AT): Likewise.
3579 (LINEMAPS_LAST_MACRO_MAP): Likewise.
3580 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
3581 (linemap_map_get_macro_name): Strengthen param from
3582 const line_map * to const line_map_macro *.
3583 (SOURCE_LINE): Strengthen first param from const line_map * to
3584 const line_map_ordinary *, removing call to
3585 linemap_check_ordinary.
3586 (SOURCE_COLUMN): Likewise.
3587 (LAST_SOURCE_LINE_LOCATION): Likewise.
3588 (LAST_SOURCE_LINE): Strengthen first param from const line_map *
3589 to const line_map_ordinary *.
3590 (LAST_SOURCE_COLUMN): Likewise.
3591 (INCLUDED_FROM): Strengthen return type from line_map * to
3592 line_map_ordinary *., and second param from const line_map *
3593 to const line_map_ordinary *, removing call to
3594 linemap_check_ordinary.
3595 (MAIN_FILE_P): Strengthen param from const line_map * to
3596 const line_map_ordinary *, removing call to
3597 linemap_check_ordinary.
3598 (linemap_position_for_line_and_column): Strengthen param from
3599 const line_map * to const line_map_ordinary *.
3600 (LINEMAP_FILE): Strengthen param from const line_map * to
3601 const line_map_ordinary *, removing call to
3602 linemap_check_ordinary.
3603 (LINEMAP_LINE): Likewise.
3604 (LINEMAP_SYSP): Likewise.
3605 (linemap_resolve_location): Strengthen final param from
3606 const line_map ** to const line_map_ordinary **.
3607 * internal.h (CPP_INCREMENT_LINE): Likewise for local "map".
3608 (linemap_enter_macro): Strengthen return type from
3609 const line_map * to const line_map_macro *.
3610 (linemap_add_macro_token): Likewise for first param.
3611 * line-map.c (linemap_check_files_exited): Strengthen local "map"
3612 from const line_map * to const line_map_ordinary *.
3613 (new_linemap): Introduce local "map_size" and use it when
3614 calculating how large the buffer should be. Rewrite based
3615 on change of info_macro and info_ordinary into distinct types.
3616 (linemap_add): Strengthen locals "map" and "from" from line_map *
3617 to line_map_ordinary *.
3618 (linemap_enter_macro): Strengthen return type from
3619 const line_map * to const line_map_macro *, and local "map" from
3620 line_map * to line_map_macro *.
3621 (linemap_add_macro_token): Strengthen param "map" from
3622 const line_map * to const line_map_macro *.
3623 (linemap_line_start): Strengthen local "map" from line_map * to
3624 line_map_ordinary *.
3625 (linemap_position_for_column): Likewise.
3626 (linemap_position_for_line_and_column): Strengthen first param
3627 from const line_map * to const line_map_ordinary *.
3628 (linemap_position_for_loc_and_offset): Strengthen local "map" from
3629 const line_map * to const line_map_ordinary *.
3630 (linemap_ordinary_map_lookup): Likewise for return type and locals
3631 "cached" and "result".
3632 (linemap_macro_map_lookup): Strengthen return type and locals
3633 "cached" and "result" from const line_map * to
3634 const line_map_macro *.
3635 (linemap_macro_map_loc_to_exp_point): Likewise for param "map".
3636 (linemap_macro_map_loc_to_def_point): Likewise.
3637 (linemap_macro_map_loc_unwind_toward_spelling): Likewise.
3638 (linemap_get_expansion_line): Strengthen local "map" from
3639 const line_map * to const line_map_ordinary *.
3640 (linemap_get_expansion_filename): Likewise.
3641 (linemap_map_get_macro_name): Strengthen param from
3642 const line_map * to const line_map_macro *.
3643 (linemap_location_in_system_header_p): Add call to
3644 linemap_check_ordinary in region guarded by
3645 !linemap_macro_expansion_map_p. Introduce local "macro_map" via
3646 linemap_check_macro in other region, using it in place of "map"
3647 for typesafety.
3648 (first_map_in_common_1): Add calls to linemap_check_macro.
3649 (trace_include): Strengthen param "map" from const line_map * to
3650 const line_map_ordinary *.
3651 (linemap_macro_loc_to_spelling_point): Strengthen final param from
3652 const line_map ** to const line_map_ordinary **. Replace a
3653 C-style cast with a const_cast, and add calls to
3654 linemap_check_macro and linemap_check_ordinary.
3655 (linemap_macro_loc_to_def_point): Likewise.
3656 (linemap_macro_loc_to_exp_point): Likewise.
3657 (linemap_resolve_location): Strengthen final param from
3658 const line_map ** to const line_map_ordinary **.
3659 (linemap_unwind_toward_expansion): Introduce local "macro_map" via
3660 a checked cast and use it in place of *map.
3661 (linemap_unwind_to_first_non_reserved_loc): Strengthen local
3662 "map1" from const line_map * to const line_map_ordinary *.
3663 (linemap_expand_location): Introduce local "ord_map" via a checked
3664 cast and use it in place of map.
3665 (linemap_dump): Make local "map" const. Strengthen local
3666 "includer_map" from line_map * to const line_map_ordinary *.
3667 Introduce locals "ord_map" and "macro_map" via checked casts and
3668 use them in place of "map" for typesafety.
3669 (linemap_dump_location): Strengthen local "map" from
3670 const line_map * to const line_map_ordinary *.
3671 (linemap_get_file_highest_location): Update for elimination of
3672 union.
3673 (linemap_get_statistics): Strengthen local "cur_map" from
3674 line_map * to const line_map_macro *. Update uses of sizeof to
3675 use the appropriate line_map subclasses.
3676 * macro.c (_cpp_warn_if_unused_macro): Add call to
3677 linemap_check_ordinary.
3678 (builtin_macro): Strengthen local "map" from const line_map * to
3679 const line_map_macro *.
3680 (enter_macro_context): Likewise.
3681 (replace_args): Likewise.
3682 (tokens_buff_put_token_to): Likewise for param "map".
3683 (tokens_buff_add_token): Likewise.
3684
ba4ad400
DM
36852015-05-13 David Malcolm <dmalcolm@redhat.com>
3686
3687 * include/line-map.h (source_location): Add a reference to
3688 location-example.txt to the descriptive comment.
3689 * location-example.txt: New file.
3690
0501dbd9
DM
36912015-05-13 David Malcolm <dmalcolm@redhat.com>
3692
3693 * include/line-map.h (MAX_SOURCE_LOCATION): Convert from a macro
3694 to a const source_location.
3695 (RESERVED_LOCATION_COUNT): Likewise.
3696 (linemap_check_ordinary): Convert from a macro to a pair of inline
3697 functions, for const/non-const arguments.
3698 (MAP_START_LOCATION): Likewise.
3699 (ORDINARY_MAP_STARTING_LINE_NUMBER): Likewise.
3700 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
3701 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
3702 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Convert from a macro to a
3703 pair of inline functions, for const/non-const arguments, where the
3704 latter is named...
3705 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): New function.
3706 (ORDINARY_MAP_FILE_NAME): Convert from a macro to a pair of inline
3707 functions, for const/non-const arguments.
3708 (MACRO_MAP_MACRO): Likewise.
3709 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
3710 (MACRO_MAP_LOCATIONS): Likewise.
3711 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
3712 (LINEMAPS_MAP_INFO): Likewise.
3713 (LINEMAPS_MAPS): Likewise.
3714 (LINEMAPS_ALLOCATED): Likewise.
3715 (LINEMAPS_USED): Likewise.
3716 (LINEMAPS_CACHE): Likewise.
3717 (LINEMAPS_ORDINARY_CACHE): Likewise.
3718 (LINEMAPS_MACRO_CACHE): Likewise.
3719 (LINEMAPS_MAP_AT): Convert from a macro to an inline function.
3720 (LINEMAPS_LAST_MAP): Likewise.
3721 (LINEMAPS_LAST_ALLOCATED_MAP): Likewise.
3722 (LINEMAPS_ORDINARY_MAPS): Likewise.
3723 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
3724 (LINEMAPS_ORDINARY_ALLOCATED): Likewise.
3725 (LINEMAPS_ORDINARY_USED): Likewise.
3726 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
3727 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
3728 (LINEMAPS_MACRO_MAPS): Likewise.
3729 (LINEMAPS_MACRO_MAP_AT): Likewise.
3730 (LINEMAPS_MACRO_ALLOCATED): Likewise.
3731 (LINEMAPS_MACRO_USED): Likewise.
3732 (LINEMAPS_MACRO_LOWEST_LOCATION): Likewise.
3733 (LINEMAPS_LAST_MACRO_MAP): Likewise.
3734 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
3735 (IS_ADHOC_LOC): Likewise.
3736 (COMBINE_LOCATION_DATA): Likewise.
3737 (SOURCE_LINE): Likewise.
3738 (SOURCE_COLUMN): Likewise.
3739 (LAST_SOURCE_LINE_LOCATION): Likewise.
3740 (LAST_SOURCE_LINE): Likewise.
3741 (LAST_SOURCE_COLUMN): Likewise.
3742 (LAST_SOURCE_LINE_LOCATION)
3743 (INCLUDED_FROM): Likewise.
3744 (MAIN_FILE_P): Likewise.
3745 (LINEMAP_FILE): Likewise.
3746 (LINEMAP_LINE): Likewise.
3747 (LINEMAP_SYSP): Likewise.
3748 (linemap_location_before_p): Likewise.
3749 * line-map.c (linemap_check_files_exited): Make local "map" const.
3750 (linemap_add): Use SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS.
3751 (linemap_line_start): Likewise.
3752
eb70f327
MH
37532015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
3754
3755 * aclocal.m4: Regenerated with automake-1.11.6.
3756
60c12095
DM
37572015-05-13 David Malcolm <dmalcolm@redhat.com>
3758
3759 * include/line-map.h (linemap_assert): Move up within the file to
3760 before all of the map accessor macros.
3761 (linemap_assert_fails): Likewise.
3762 (linemap_check_ordinary): Likewise.
3763 (linemap_macro_expansion_map_p): Likewise.
3764
c3388e62
DM
37652015-05-12 David Malcolm <dmalcolm@redhat.com>
3766
3767 * directives.c (do_line): Set seen_line_directive on line_table.
3768 (do_linemarker): Likewise.
3769 * include/line-map.h (struct line_maps): Add new field
3770 "seen_line_directive".
3771
fe191308
JM
37722015-05-08 Jason Merrill <jason@redhat.com>
3773
3774 * include/cpplib.h: Add CPP_W_CXX11_COMPAT.
3775 (struct cpp_options): Add cpp_warn_cxx11_compat.
3776 * init.c (cpp_create_reader): Initialize it.
3777 * lex.c (lex_string): Add -Wc++11-compat warning.
3778
21c0a521
DM
37792015-05-05 David Malcolm <dmalcolm@redhat.com>
3780
3781 * pch.c (cpp_valid_state): Fix indentation so that it reflects the
3782 block structure.
3783
c87b25e6
DM
37842015-05-05 David Malcolm <dmalcolm@redhat.com>
3785
3786 * include/line-map.h: Fix comment at the top of the file.
3787 (source_location): Rewrite and expand the comment for this
3788 typedef, adding an ascii-art table to clarify how source_location
3789 values are allocated.
3790 * line-map.c: Fix comment at the top of the file.
3791
ca708025
RB
37922015-04-09 Richard Biener <rguenther@suse.de>
3793
3794 PR pch/65550
3795 * files.c (pch_open_file): Allow main and pre-included files
3796 when trying to open a PCH.
3797
e4b33ee5
JJ
37982015-04-06 Jakub Jelinek <jakub@redhat.com>
3799
3800 PR preprocessor/61977
3801 * lex.c (cpp_peek_token): If peektok is CPP_EOF, back it up
3802 with all tokens peeked by the current function.
3803
b8cd77f4
JJ
38042015-04-02 Jakub Jelinek <jakub@redhat.com>
3805
3806 PR preprocessor/61977
3807 * lex.c (cpp_peek_token): Temporarily clear pfile->cb.line_change.
3808
fb136e35
JJ
38092015-03-23 Jakub Jelinek <jakub@redhat.com>
3810
3811 PR preprocessor/65238
3812 * internal.h (_cpp_scan_out_logical_line): Add third argument.
3813 * directives.c (prepare_directive_trad): Pass false to it.
3814 * traditional.c (_cpp_read_logical_line_trad,
3815 _cpp_create_trad_definition): Likewise.
3816 (struct fun_macro): Add paramc field.
3817 (fun_like_macro): New function.
3818 (maybe_start_funlike): Handle NODE_BUILTIN macros. Initialize
3819 macro->paramc field.
3820 (save_argument): Use macro->paramc instead of
3821 macro->node->value.macro->paramc.
3822 (push_replacement_text): Formatting fix.
3823 (recursive_macro): Use fun_like_macro helper.
3824 (_cpp_scan_out_logical_line): Likewise. Add BUILTIN_MACRO_ARG
3825 argument. Initialize fmacro.paramc field. Handle builtin
3826 function-like macros.
3827
a5858a3d
ESR
38282015-03-16 Edward Smith-Rowland <3dw4rd@verizon.net>
3829
3830 PR c++/64626
3831 * lex.c (lex_number): If a number ends with digit-seps (') skip back
3832 and let lex_string take them.
3833
44d95244
MT
38342015-03-02 Markus Trippelsdorf <markus@trippelsdorf.de>
3835
3836 PR target/65261
3837 * lex.c (search_line_fast): Silence ubsan errors.
3838
f8abc9ba
DS
38392015-02-03 <dodji@redhat.com>
3840
3841 PR preprocessor/64803
3842 * internal.h (cpp_reader::top_most_macro_node): New data member.
3843 * macro.c (enter_macro_context): Pass the location of the end of
3844 the top-most invocation of the function-like macro, or the
3845 location of the expansion point of the top-most object-like macro.
3846 (cpp_get_token_1): Store the top-most macro node in the new
3847 pfile->top_most_macro_node data member.
3848 (_cpp_pop_context): Clear the new cpp_reader::top_most_macro_node
3849 data member.
3850
95d0610c
SN
38512015-01-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
3852
3853 * lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON.
3854
10ef8f28
MP
38552015-01-23 Marek Polacek <polacek@redhat.com>
3856
3857 DR#412
3858 PR preprocessor/60570
3859 * directives.c (do_elif): Don't evaluate #elif conditionals
3860 when they don't need to be.
3861
6e6cb471
JJ
38622015-01-16 Jakub Jelinek <jakub@redhat.com>
3863
3864 * expr.c (cpp_classify_number): Add N_() around ?: string
3865 literals used in cpp_error_with_line call as format string.
3866
5624e564
JJ
38672015-01-05 Jakub Jelinek <jakub@redhat.com>
3868
3869 Update copyright years.
3870
1f8d3e84
JJ
38712014-12-19 Jakub Jelinek <jakub@redhat.com>
3872
3873 PR preprocessor/63831
3874 * directives.c (lex_macro_node): Remove __has_attribute__ handling.
3875 * internal.h (struct spec_node): Remove n__has_attribute__ field.
3876 (struct lexer_state): Remove in__has_attribute__ field.
3877 * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_ATTRIBUTE.
3878 * identifiers.c (_cpp_init_hashtable): Remove __has_attribute__
3879 handling.
3880 * init.c (builtin_array): Add __has_attribute and __has_cpp_attribute.
3881 (cpp_init_special_builtins): Don't initialize __has_attribute
3882 or __has_cpp_attribute if CLK_ASM or pfile->cb.has_attribute is NULL.
3883 * traditional.c (enum ls): Remove ls_has_attribute,
3884 ls_has_attribute_close.
3885 (_cpp_scan_out_logical_line): Remove __has_attribute__ handling.
3886 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_ATTRIBUTE.
3887 * pch.c (cpp_read_state): Remove __has_attribute__ handling.
3888 * expr.c (eval_token): Likewise.
3889 (parse_has_attribute): Removed.
3890
01ca36af
UB
38912014-12-11 Uros Bizjak <ubizjak@gmail.com>
3892
3893 * directives.c (cpp_define_formatted): Use xvasprintf.
3894
b93c0722
MLI
38952014-12-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
3896
3897 * line-map.c (linemap_position_for_loc_and_offset): Add new
3898 linemap_assert_fails.
3899
73bd8329
MLI
39002014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
3901
3902 * include/line-map.h (linemap_assert_fails): Declare.
3903 * line-map.c (linemap_position_for_loc_and_offset): Use it.
3904
9c320ab1
MLI
39052014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
3906
49445904
UB
3907 * line-map.c (linemap_add): Fix typo.
3908 (linemap_line_start): Fix whitespace.
9c320ab1 3909
81fee4a7
JM
39102014-11-29 John Schmerge <jbschmerge@gmail.com>
3911
3912 PR preprocessor/41698
3913 * charset.c (one_utf8_to_utf16): Do not produce surrogate pairs
3914 for 0xffff.
3915
43ba1c6c
JJ
39162014-11-25 Jakub Jelinek <jakub@redhat.com>
3917
3918 PR preprocessor/60436
3919 * line-map.c (linemap_line_start): If highest is above 0x60000000
3920 and we are still tracking columns or highest is above 0x70000000,
3921 force add_map.
3922
8a23b100
UB
39232014-11-20 Uros Bizjak <ubizjak@gmail.com>
3924
3925 PR target/63966
1b6b13f3
UB
3926 * lex.c [__i386__ || __x86_64__]: Compile special SSE functions
3927 only for (__GNUC__ >= 5 || !defined(__PIC__)).
8a23b100 3928
d82f1e13
MLI
39292014-11-13 Manuel López-Ibáñez <manu@gcc.gnu.org>
3930
3931 * include/line-map.h: Include EXPR, so that unused variable warnings
3932 do not occur.
3933
3aa34c1d
MLI
39342014-11-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
3935
3936 PR fortran/44054
3937 * include/line-map.h (linemap_position_for_loc_and_offset):
3938 Declare.
3939 * line-map.c (linemap_position_for_loc_and_offset): New.
3940
35485da9
DM
39412014-11-11 David Malcolm <dmalcolm@redhat.com>
3942
3943 * ChangeLog.jit: New.
3944
42fd12b1
ESR
39452014-11-10 Edward Smith-Rowland <3dw4rd@verizon.net>
3946
3947 * include/cpplib.h (cpp_callbacks): Add has_attribute.
3948 * internal.h (lexer_state): Add in__has_attribute__.
3949 * directives.c (lex_macro_node): Prevent use of __has_attribute__
3950 as a macro.
3951 * expr.c (parse_has_attribute): New function; (eval_token): Look for
3952 __has_attribute__ and route to parse_has_attribute.
3953 * identifiers.c (_cpp_init_hashtable): Initialize n__has_attribute__.
3954 * pch.c (cpp_read_state): Initialize n__has_attribute__.
3955 * traditional.c (enum ls): Add ls_has_attribute, ls_has_attribute_close;
3956 (_cpp_scan_out_logical_line): Attend to __has_attribute__.
3957
be5ffc59
JM
39582014-11-06 Joseph Myers <joseph@codesourcery.com>
3959
3960 * include/cpp-id-data.h (struct cpp_macro): Update comment
3961 regarding parameters.
3962 * include/cpplib.h (struct cpp_macro_arg, struct cpp_identifier):
3963 Add spelling fields.
3964 (struct cpp_token): Update comment on macro_arg.
3965 * internal.h (_cpp_save_parameter): Add extra argument.
3966 (_cpp_spell_ident_ucns): New declaration.
3967 * lex.c (lex_identifier): Add SPELLING argument. Set *SPELLING to
3968 original spelling of identifier.
3969 (_cpp_lex_direct): Update calls to lex_identifier.
3970 (_cpp_spell_ident_ucns): New function, factored out of
3971 cpp_spell_token.
3972 (cpp_spell_token): Adjust FORSTRING argument semantics to return
3973 original spelling of identifiers. Use _cpp_spell_ident_ucns in
3974 !FORSTRING case.
3975 (_cpp_equiv_tokens): Check spellings of identifiers and macro
3976 arguments are identical.
3977 * macro.c (macro_arg_saved_data): New structure.
3978 (paste_tokens): Use original spellings of identifiers from
3979 cpp_spell_token.
3980 (_cpp_save_parameter): Add argument SPELLING. Save both canonical
3981 node and its value.
3982 (parse_params): Update calls to _cpp_save_parameter.
3983 (lex_expansion_token): Save spelling of macro argument tokens.
3984 (_cpp_create_definition): Extract canonical node from saved data.
3985 (cpp_macro_definition): Use UCNs in spelling of macro name. Use
3986 original spellings of macro argument tokens and identifiers.
3987 * traditional.c (scan_parameters): Update call to
3988 _cpp_save_parameter.
3989
701cade1
JM
39902014-11-05 Joseph Myers <joseph@codesourcery.com>
3991
3992 PR preprocessor/9449
3993 * init.c (lang_defaults): Enable extended identifiers for C++ and
3994 C99-based standards.
3995
19a9ba64
AM
39962014-10-22 Alan Modra <amodra@gmail.com>
3997
3998 * symtab.c (ht_create): Use obstack_specify_allocation in place of
3999 _obstack_begin.
4000 * files.c (_cpp_init_files): Likewise.
4001 * init.c (cpp_create_reader): Likewise.
4002 * identifiers.c (_cpp_init_hashtable): Likewise.
4003
3aac0952
MLI
40042014-10-14 Manuel López-Ibáñez <manu@gcc.gnu.org>
4005
4006 * include/line-map.h (linemap_location_from_macro_expansion_p):
4007 const struct line_maps * argument.
4008 (linemap_position_for_line_and_column): const struct line_map *
4009 argument.
4010 * line-map.c (linemap_add_macro_token): Use correct argument name
4011 in comment.
4012 (linemap_position_for_line_and_column): const struct line_map *
4013 argument.
4014 (linemap_macro_map_loc_to_def_point): Fix comment. Make static.
4015 (linemap_location_from_macro_expansion_p): const struct line_maps *
4016 argument.
4017 (linemap_resolve_location): Fix argument names in comment.
4018
0ccaaab0
BS
40192014-10-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
4020
4021 * lex.c (search_line_fast): Add new version to be used for Power8
4022 and later targets when Altivec is enabled. Restrict the existing
4023 Altivec version to big-endian systems so that lvsr is not used on
4024 little endian, where it is deprecated. Remove LE-specific code
4025 from the now-BE-only version.
4026
dc257367
BE
40272014-10-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
4028 Jeff Law <law@redhat.com>
4029
4030 * charset.c (convert_no_conversion): Reallocate memory with 25%
4031 headroom.
4032
a15f7cb8
ESR
40332014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net>
4034
4035 Implement SD-6: SG10 Feature Test Recommendations
4036 * internal.h (lexer_state, spec_nodes): Add in__has_include__.
4037 * directives.c: Support __has_include__ builtin.
4038 * expr.c (parse_has_include): New function to parse __has_include__
4039 builtin; (eval_token()): Use it.
4040 * files.c (_cpp_has_header()): New funtion to look for header;
4041 (open_file_failed()): Not an error to not find a header file for
4042 __has_include__.
4043 * identifiers.c (_cpp_init_hashtable()): Add entry for __has_include__.
4044 * pch.c (cpp_read_state): Lookup __has_include__.
4045 * traditional.c (enum ls, _cpp_scan_out_logical_line()): Walk through
4046 __has_include__ statements.
4047
cc811a8a
BE
40482014-09-30 Bernd Edlinger <bernd.edlinger@hotmail.de>
4049
4050 PR preprocessor/58893
4051 * errors.c (cpp_diagnostic): Fix possible out of bounds access.
4052 * files.c (_cpp_stack_include): Initialize src_loc for IT_CMDLINE.
4053
083e891e
MP
40542014-09-24 Marek Polacek <polacek@redhat.com>
4055
4056 PR c/61405
4057 PR c/53874
4058 * include/cpplib.h (enum cpp_ttype): Define CPP_KEYWORD.
4059
d87fc699
JH
40602014-09-17 Jan Hubicka <hubicka@ucw.cz>
4061
4062 * charset.c (conversion): Rename to ...
4063 (cpp_conversion): ... this one; update.
4064 * files.c (file_hash_entry): Rename to ...
4065 (cpp_file_hash_entry): ... this one ; update.
4066
909eb89c
MP
40672014-09-17 Marek Polacek <polacek@redhat.com>
4068
4069 PR c/61854
4070 * init.c (struct lang_flags): Remove cplusplus_comments.
4071 (cpp_set_lang): Likewise.
4072 (post_options): Likewise.
4073 * lex.c (_cpp_lex_direct): Disallow C++ style comments in C90/C94.
4074
1ef33fd4
MLI
40752014-09-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
4076
4077 * include/cpplib.h (struct cpp_options): Declare warn_normalize as
4078 int instead of enum.
4079
2b71f4a4
MLI
40802014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
4081
4082 * macro.c (replace_args): Use cpp_pedwarning, cpp_warning and
4083 CPP_W flags.
4084 * include/cpplib.h: Add CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC.
4085 * init.c (cpp_create_reader): Do not init to -1 here.
4086 * expr.c (num_binary_op): Use cpp_pedwarning.
4087
81b5d104
MLI
40882014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
4089
4090 * directives.c (check_eol_1): New.
4091 (check_eol_endif_labels): New.
4092 (check_eol): Call check_eol_1.
4093 (do_else,do_endif): Call check_eol_endif_labels.
4094
b753b37b
MLI
40952014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
4096
4097 * macro.c (warn_of_redefinition): Suppress warnings for builtins
4098 that lack the NODE_WARN flag, unless Wbuiltin-macro-redefined.
4099 (_cpp_create_definition): Use Wbuiltin-macro-redefined for
4100 builtins that lack the NODE_WARN flag.
4101 * directives.c (do_undef): Likewise.
4102 * init.c (cpp_init_special_builtins): Do not change flags
4103 depending on Wbuiltin-macro-redefined.
4104
7c05e50c
ESR
41052014-08-28 Edward Smith-Rowland <3dw4rd@verizon.net>
4106
4107 PR cpp/23827 - standard C++ should not have hex float preprocessor
4108 tokens
4109 * libcpp/init.c (lang_flags): Change CXX98 flag for extended numbers
4110 from 1 to 0.
4111 * libcpp/expr.c (cpp_classify_number): Weite error message for improper
4112 use of hex floating literal.
4113
e4276ba5
ESR
41142014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
4115
4116 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z;
4117 Rename CLK_GNUCXX1Y, CLK_CXX1Y to CLK_GNUCXX14, CLK_CXX14;
4118 * init.c (struct lang_flags lang_defaults): Add column for trigraphs;
4119 Add rows for CLK_GNUCXX1Z, CLK_CXX1Z; (cpp_set_lang): Set trigraphs;
4120 (cpp_init_builtins): Set __cplusplus to 201402L for C++14;
4121 Set __cplusplus to 201500L for C++17.
4122 * expr.c (cpp_classify_number): Change C++1y to C++14 in binary
4123 constants error message.
4124
dd3ff077
MP
41252014-08-20 Marek Polacek <polacek@redhat.com>
4126
4127 * include/cpplib.h (cpp_options): Use signed char.
4128 * lex.c (_cpp_lex_direct): Don't warn in C++ mode.
4129
3f4f5c9a
MP
41302014-08-19 Marek Polacek <polacek@redhat.com>
4131
4132 * lex.c (_cpp_lex_direct): Fix a typo.
4133
177cce46
MP
41342014-08-19 Marek Polacek <polacek@redhat.com>
4135
4136 * charset.c (_cpp_valid_ucn): Warn only if -Wc90-c99-compat.
4137 * lex.c (_cpp_lex_direct): Likewise.
4138 * macro.c (replace_args): Likewise.
4139 (parse_params): Likewise.
4140 * include/cpplib.h (cpp_options): Change cpp_warn_c90_c99_compat
4141 to char.
4142
f3bede71
MP
41432014-08-10 Marek Polacek <polacek@redhat.com>
4144
4145 PR c/51849
4146 * lex.c (_cpp_lex_direct): Warn when -Wc90-c99-compat is in effect.
4147 * charset.c (_cpp_valid_ucn): Likewise.
4148 * include/cpplib.h (cpp_options): Add cpp_warn_c90_c99_compat.
4149 * macro.c (replace_args): Warn when -Wc90-c99-compat is in effect.
4150 (parse_params): Likewise.
4151
61eb99f6
MP
41522014-07-27 Marek Polacek <polacek@redhat.com>
4153
4154 PR c/61861
4155 * macro.c (builtin_macro): Add location parameter. Set
4156 location of builtin macro to the expansion point.
4157 (enter_macro_context): Pass location to builtin_macro.
4158
c468587a
DS
41592014-07-16 Dodji Seketeli <dodji@redhat.com>
4160
4161 Support location tracking for built-in macro tokens
4162 * include/line-map.h (line_maps::builtin_location): New data
4163 member.
4164 (line_map_init): Add a new parameter to initialize the new
4165 line_maps::builtin_location data member.
4166 * line-map.c (linemap_init): Initialize the
4167 line_maps::builtin_location data member.
4168 * macro.c (builtin_macro): Create a macro map and track the token
4169 resulting from the expansion of a built-in macro.
4170
3976796b
ESR
41712014-07-10 Edward Smith-Rowland <3dw4rd@verizon.net>
4172 Jonathan Wakely <jwakely@redhat.com>
4173
c786fca6 4174 PR preprocessor/61389
3976796b
ESR
4175 * macro.c (_cpp_arguments_ok, parse_params, create_iso_definition):
4176 Warning messages mention C++11 in c++ mode and C99 in c mode.
4177 * lex.c (lex_identifier_intern, lex_identifier): Ditto
4178
7aee8646
ESR
41792014-07-09 Edward Smith-Rowland <3dw4rd@verizon.net>
4180
4181 PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped
4182 by preprocessor
4183 * lex.c (lex_raw_string ()): Do not warn about invalid suffix
4184 if skipping. (lex_string ()): Ditto.
4185
98ba7482
ESR
41862014-06-04 Edward Smith-Rowland <3dw4rd@verizon.net>
4187
4188 PR c++/61038
4189 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
4190 Combine user-defined escape logic with the other string and char logic.
4191
edf6ddf6
RB
41922014-05-26 Richard Biener <rguenther@suse.de>
4193
4194 * configure.ac: Remove long long and __int64 type checks,
4195 add check for uint64_t and fail if that wasn't found.
4196 * include/cpplib.h (cpp_num_part): Use uint64_t.
4197 * config.in: Regenerate.
4198 * configure: Likewise.
4199
28939589
MP
42002014-05-21 Marek Polacek <polacek@redhat.com>
4201
4202 PR c/61212
4203 * files.c (find_file_in_dir): Add parens around &&.
4204
49039169
ESR
42052014-05-20 Edward Smith-Rowland <3dw4rd@verizon.net>
4206
28939589 4207 PR c++/61038
49039169
ESR
4208 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
4209 Check for user-defined literal strings and user-defined literal chars
4210 to escape necessary characters.
4211
54da09ee
RB
42122014-05-20 Richard Biener <rguenther@suse.de>
4213
4214 * configure.ac: Copy gcc logic of detecting a 64bit type.
4215 Remove HOST_WIDE_INT define.
4216 * include/cpplib.h: typedef cpp_num_part to a 64bit type,
4217 similar to how hwint.h does it.
4218 * config.in: Regenerate.
4219 * configure: Likewise.
4220
eac3e079
JY
42212014-05-09 Joey Ye <joey.ye@arm.com>
4222
4223 * files.c (find_file_in_dir): Always try to shorten for DOS
4224 non-system headers.
4225 * init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS.
4226
f543058d
RB
42272014-05-07 Richard Biener <rguenther@suse.de>
4228
4229 * configure.ac: Always set need_64bit_hwint to yes.
4230 * configure: Regenerated.
4231
d9f069ab
RO
42322014-04-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4233
4234 * lex.c: Remove Solaris 9 reference.
4235
341c653c
WL
42362014-02-24 Walter Lee <walt@tilera.com>
4237
4238 * configure.ac: Change "tilepro" triplet to "tilepro*".
4239 * configure: Regenerate.
4240
179652df
JJ
42412014-02-19 Jakub Jelinek <jakub@redhat.com>
4242
4243 PR preprocessor/58844
4244 * macro.c (enter_macro_context): Only push
4245 macro_real_token_count (macro) tokens rather than
4246 macro->count tokens, regardless of
4247 CPP_OPTION (pfile, track-macro-expansion).
4248
acf601ae
JJ
42492014-02-07 Jakub Jelinek <jakub@redhat.com>
4250
4251 PR preprocessor/56824
4252 * line-map.c (get_combined_adhoc_loc, linemap_get_expansion_line,
4253 linemap_get_expansion_filename, linemap_location_in_system_header_p,
4254 linemap_location_from_macro_expansion_p,
4255 linemap_macro_loc_to_spelling_point, linemap_macro_loc_to_def_point,
4256 linemap_macro_loc_to_exp_point, linemap_expand_location): Fix
4257 formatting.
4258 (linemap_compare_locations): Look through adhoc locations for both
4259 l0 and l1.
4260
7ecc3eb9
DS
42612014-01-23 Dodji Seketeli <dodji@redhat.com>
4262
4263 PR PR preprocessor/58580
4264 * include/line-map.h (linemap_get_file_highest_location): Declare
4265 new function.
4266 * line-map.c (linemap_get_file_highest_location): Define it.
4267
35c3d610
RS
42682014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
4269
4270 Update copyright years
4271
3a4efce7
JM
42722013-12-09 Joseph Myers <joseph@codesourcery.com>
4273
4274 PR preprocessor/55715
4275 * expr.c (num_binary_op): Implement subtraction directly rather
4276 than with negation and falling through into addition case.
4277
aadce585
BS
42782013-11-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
4279
4280 * lex.c (search_line_fast): Correct for little endian.
4281
d3f4ff8b
JM
42822013-11-15 Joseph Myers <joseph@codesourcery.com>
4283
4284 * ucnid.tab: Add C11 and C11NOSTART data.
4285 * makeucnid.c (digit): Rename enum value to N99.
4286 (C11, N11, all_languages): New enum values.
4287 (NUM_CODE_POINTS, MAX_CODE_POINT): New macros.
4288 (flags, decomp, combining_value): Use NUM_CODE_POINTS as array
4289 size.
4290 (decomp): Use unsigned int as element type.
4291 (all_decomp): New array.
4292 (read_ucnid): Handle C11 and C11NOSTART. Use MAX_CODE_POINT.
4293 (read_table): Use MAX_CODE_POINT. Store all decompositions in
4294 all_decomp.
4295 (read_derived): Use MAX_CODE_POINT.
4296 (write_table): Use NUM_CODE_POINTS. Print N99, C11 and N11
4297 flags. Print whole array variable declaration rather than just
4298 array contents.
4299 (char_id_valid, write_context_switch): New functions.
4300 (main): Call write_context_switch.
4301 * ucnid.h: Regenerate.
4302 * include/cpplib.h (struct cpp_options): Add c11_identifiers.
4303 * init.c (struct lang_flags): Add c11_identifiers.
4304 (cpp_set_lang): Set c11_identifiers option from selected language.
4305 * internal.h (struct normalize_state): Document "previous" as
4306 previous starter character.
4307 (NORMALIZE_STATE_UPDATE_IDNUM): Take character as argument.
4308 * charset.c (DIG): Rename enum value to N99.
4309 (C11, N11): New enum values.
4310 (struct ucnrange): Give name to struct. Use short for flags and
4311 unsigned int for end of range. Include ucnid.h for whole variable
4312 declaration.
4313 (ucn_valid_in_identifier): Allow for characters up to 0x10FFFF.
4314 Allow for C11 in determining valid characters and valid start
4315 characters. Use check_nfc for non-Hangul context-dependent
4316 checks. Only store starter characters in nst->previous.
4317 (_cpp_valid_ucn): Pass new argument to
4318 NORMALIZE_STATE_UPDATE_IDNUM.
4319 * lex.c (lex_identifier): Pass new argument to
4320 NORMALIZE_STATE_UPDATE_IDNUM. Call NORMALIZE_STATE_UPDATE_IDNUM
4321 after initial non-UCN part of identifier.
4322 (lex_number): Pass new argument to NORMALIZE_STATE_UPDATE_IDNUM.
4323
54848ff8
JM
43242013-11-15 Joseph Myers <joseph@codesourcery.com>
4325
4326 * ucnid.tab: Mark C99 digits as [C99DIG].
4327 * makeucnid.c (read_ucnid): Handle [C99DIG].
4328 (read_table): Don't check for digit characters.
4329 * ucnid.h: Regenerate.
4330
5157b91e
TB
43312013-11-06 Tobias Burnus <burnus@net-b.de>
4332
4333 * macro.c (_cpp_builtin_macro_text): Correct
4334 wording of two warnings.
4335
e8ff5196
TB
43362013-11-05 Tobias Burnus <burnus@net-b.de>
4337
4338 * include/cpplib.h (CPP_W_DATE_TIME): Added.
4339 (cpp_options): Add warn_date_time.
4340 * init.c (cpp_create_reader): Init it.
4341 * macro.c (_cpp_builtin_macro_text): Warn when
4342 __DATE__/__TIME__/__TIMESTAMP__ is used.
4343
7057e645
ESR
43442013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
4345
e8ff5196 4346 Implement C++14 digit separators.
7057e645
ESR
4347 * include/cpplib.h (cpp_options): Add digit_separators flag.
4348 * internal.h (DIGIT_SEP(c)): New macro.
4349 * expr.c (cpp_classify_number): Check improper placement of digit sep;
4350 (cpp_interpret_integer): Skip over digit separators.
4351 * init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add
4352 digit separator flags per language; (cpp_set_lang): Set
4353 digit_separators
4354 * lex.c (lex_number): Add digits separator to allowable characters for
4355 C++14.
4356
459260ec
DM
43572013-10-15 David Malcolm <dmalcolm@redhat.com>
4358
4359 * Makefile.in (PICFLAG): New.
4360 (ALL_CFLAGS): Add PICFLAG.
4361 (ALL_CXXFLAGS): Likewise.
4362 * configure.ac: Add --enable-host-shared, setting up new
4363 PICFLAG variable.
4364 * configure: Regenerate.
4365
fd6eea0c
RE
43662013-08-07 Richard Earnshaw <rearnsha@arm.com>
4367
4368 * configure.ac: Set need_64bit_hwint for all arm targets.
4369 * configure: Regenerated.
4370
8cf88735
JJ
43712013-07-20 Jakub Jelinek <jakub@redhat.com>
4372
4373 PR preprocessor/57620
4374 * lex.c (lex_raw_string): Undo phase1 and phase2 transformations
4375 between R" and final " rather than only in between R"del( and )del".
4376
87e356ba
JJ
43772013-07-10 Jakub Jelinek <jakub@redhat.com>
4378
d5e48350
JJ
4379 PR preprocessor/57824
4380 * lex.c (lex_raw_string): Allow reading new-lines if
4381 in_deferred_pragma or if parsing_args and there is still
4382 data in the current buffer.
4383
c26302d5
JJ
4384 * include/cpplib.h (cpp_token_val_index): Change parameter type to
4385 const cpp_token *.
4386 * lex.c (cpp_token_val_index): Likewise.
4387
87e356ba
JJ
4388 PR preprocessor/57757
4389 * lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING
4390 or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that
4391 starts if a-zA-Z_.
4392
c865f923
ESR
43932013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
4394
4395 * lex.c (lex_raw_string(), lex_string()): Constrain suffixes treated
4396 as concatenated literal and macro to just the patterns found in
4397 inttypes.h; (is_macro()): New.
4398
39953c79
DC
43992013-06-24 Dehao Chen <dehao@google.com>
4400
4401 * files.c (_cpp_stack_include): Fix the highest_location when header
4402 file is guarded by #ifndef and is included twice.
4403
01187df0
JJ
44042013-04-28 Jakub Jelinek <jakub@redhat.com>
4405
4406 N3472 binary constants
4407 * include/cpplib.h (struct cpp_options): Fix a typo in user_literals
4408 field comment. Add binary_constants field.
4409 * init.c (struct lang_flags): Add binary_constants field.
4410 (lang_defaults): Add bin_cst column to the table.
4411 (cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants).
4412 * expr.c (cpp_classify_number): Talk about C++11 instead of C++0x
4413 in diagnostics. Accept binary constants if
4414 CPP_OPTION (pfile, binary_constants) even when pedantic. Adjust
4415 pedwarn message.
4416
61949153
PC
44172013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
4418
4419 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y.
4420 * init.c (lang_defaults): Add defaults for the latter.
4421 (cpp_init_builtins): Define __cplusplus as 201300L for the latter.
4422 * lex.c (_cpp_lex_direct): Update.
4423
994a4cc0
SH
44242013-04-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
4425
4426 PR target/56771
4427 * configure.ac: Require 64-bit int for arm*-*-rtems*.
4428 * configure: Regenerate.
4429
28937f11
JJ
44302013-03-06 Jakub Jelinek <jakub@redhat.com>
4431
4432 PR middle-end/56461
4433 * internal.h (struct cpp_buffer): Add to_free field.
4434 (_cpp_pop_file_buffer): Add third argument.
4435 * files.c (_cpp_stack_file): Set buffer->to_free.
4436 (_cpp_pop_file_buffer): Add to_free argument. Free to_free
4437 if non-NULL, and if equal to file->buffer_start, also clear
4438 file->buffer{,_start,_valid}.
4439 * directives.c (_cpp_pop_buffer): Pass buffer->to_free
4440 to _cpp_pop_file_buffer.
4441
3b8af25b
JJ
44422013-03-01 Jakub Jelinek <jakub@redhat.com>
4443
4444 PR middle-end/56461
4445 * files.c (_cpp_save_file_entries): Free result at the end.
4446 * pch.c (cpp_string_free): New function.
4447 (cpp_save_state): Use it in htab_create call.
4448 (cpp_write_pch_deps): Free ss->defs. Destroy ss->definedhash.
4449
1a80db97
JJ
44502013-02-28 Jakub Jelinek <jakub@redhat.com>
4451
15fd8332
JJ
4452 * files.c (_cpp_find_file): If returning early, before storing
4453 something to *hash_slot and *hash_slot is NULL, call htab_clear_slot
4454 on it. Access *hash_slot using void * type rather than
4455 struct file_hash_entry * to avoid aliasing issues.
4456
1a80db97
JJ
4457 * configure.ac: Don't define ENABLE_CHECKING whenever
4458 --enable-checking is seen, instead use similar --enable-checking=yes
4459 vs. --enable-checking=release default as gcc/ subdir has and
4460 define ENABLE_CHECKING if ENABLE_CHECKING is defined in gcc/.
4461 Define ENABLE_VALGRIND_CHECKING if requested.
4462 * lex.c (new_buff): If ENABLE_VALGRIND_CHECKING, put _cpp_buff
4463 struct first in the allocated buffer and result->base after it.
4464 (_cpp_free_buff): If ENABLE_VALGRIND_CHECKING, free buff itself
4465 instead of buff->base.
4466 * config.in: Regenerated.
4467 * configure: Regenerated.
4468
561f7fc7
ESR
44692013-02-13 Ed Smith-Rowland <3dw4rd@verizon.net>
4470
4471 PR c++/55582
61949153 4472 * lex.c (lex_raw_string): Allow string literal with suffix
561f7fc7
ESR
4473 beginning with 's' to be parsed as a C++11 user-defined literal.
4474
500f3ed9
RS
44752013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
4476
4477 Update copyright years.
4478
1582c677
PC
44792013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
4480
4481 PR c++/54526 (again)
4482 * lex.c (_cpp_lex_direct): In C++11 mode, implement 2.5 p3, bullet 2.
4483
8ac16127
MG
44842013-01-03 Marc Glisse <marc.glisse@inria.fr>
4485
4486 PR bootstrap/50177
4487 * line-map.c (get_combined_adhoc_loc): Cast from extern "C" type.
4488 (new_linemap): Likewise.
4489 (linemap_enter_macro): Likewise.
4490
f41e5bd1
JJ
44912012-12-03 Jakub Jelinek <jakub@redhat.com>
4492
4493 PR bootstrap/55380
4494 PR other/54691
4495 * files.c (read_file_guts): Allocate extra 16 bytes instead of
4496 1 byte at the end of buf. Pass size + 16 instead of size
4497 to _cpp_convert_input.
4498 * charset.c (_cpp_convert_input): Reallocate if there aren't
4499 at least 16 bytes beyond to.len in the buffer. Clear 16 bytes
4500 at to.text + to.len.
4501
31962032
SE
45022012-11-21 Steve Ellcey <sellcey@mips.com>
4503
4504 PR pch/55399
4505 * files.c (pch_open_file): Fix check for implicit_preinclude.
4506
5dc99c46
SB
45072012-11-16 Simon Baldwin <simonb@google.com>
4508
4509 * include/cpplib.h (struct cpp_options): Add canonical_system_headers.
4510 * files.c (find_file_in_dir): Call maybe_shorter_path() only if
4511 canonical_system_headers is set.
4512 * init.c (cpp_create_reader): Initialize canonical_system_headers.
4513 * configure.ac: Add new --enable-canonical-system-headers.
4514 * configure: Regenerate.
4515 * config.in: Regenerate.
4516
a4a0016d
ESR
45172012-11-09 Ed Smith-Rowland <3dw4rd@verizon.net>
4518
4519 PR c++/54413
4520 * include/cpplib.h (cpp_interpret_float_suffix): Add cpp_reader* arg.
4521 (cpp_interpret_int_suffix): Add cpp_reader* arg.
4522 * init.c (cpp_create_reader): Iitialize new flags.
4523 * expr.c (interpret_float_suffix): Use new flags.
4524 (cpp_interpret_float_suffix): Add cpp_reader* arg.
4525 (interpret_int_suffix): Use new flags.
4526 (cpp_interpret_int_suffix): Add cpp_reader* arg.
4527 (cpp_classify_number): Adjust calls to interpret_x_suffix.
4528
04ce690f
IB
45292012-10-23 Ian Bolton <ian.bolton@arm.com>
4530 Jim MacArthur <jim.macarthur@arm.com>
4531 Marcus Shawcroft <marcus.shawcroft@arm.com>
4532 Nigel Stephens <nigel.stephens@arm.com>
4533 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
4534 Richard Earnshaw <rearnsha@arm.com>
4535 Sofiane Naci <sofiane.naci@arm.com>
4536 Stephen Thomas <stephen.thomas@arm.com>
4537 Tejas Belagod <tejas.belagod@arm.com>
4538 Yufeng Zhang <yufeng.zhang@arm.com>
4539
4540 * configure.ac: Enable AArch64.
4541 * configure: Regenerate.
4542
1efcb8c6
JM
45432012-10-23 Joseph Myers <joseph@codesourcery.com>
4544
4545 * files.c (struct _cpp_file): Add implicit_preinclude.
4546 (pch_open_file): Allow a previously opened implicitly included
4547 file.
4548 (_cpp_find_file): Add implicit_preinclude argument. Free file and
4549 do not call open_file_failed if implicit_preinclude. Store
4550 implicit_preinclude value.
4551 (_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date):
4552 Update calls to _cpp_find_file.
4553 (_cpp_stack_include): Handle IT_DEFAULT.
4554 (cpp_push_default_include): New.
4555 * include/cpplib.h (cpp_push_default_include): Declare.
4556 * init.c (cpp_read_main_file): Update call to _cpp_find_file.
4557 * internal.h (enum include_type): Add IT_DEFAULT.
4558 (_cpp_find_file): Update prototype.
4559
55e7f907
TB
45602012-10-15 Tobias Burnus <burnus@net-b.de>
4561
4562 * files.c (read_file_guts, _cpp_save_file_entries): Free memory
4563 before returning.
4564 * lex.c (warn_about_normalization): Ditto.
4565 * mkdeps.c (deps_save): Ditto.
4566 * pch.c (cpp_valid_state): Ditto.
4567
f591bd8f
FW
45682012-10-04 Florian Weimer <fweimer@redhat.com>
4569
4570 * directives.c (do_pragma_warning_or_error): New.
4571 (do_pragma_warning): New.
4572 (do_pragma_error): New.
4573 (_cpp_init_internal_pragmas): Register new pragmas.
4574
ec6e0399
DC
45752012-09-25 Dehao Chen <dehao@google.com>
4576
4577 PR middle-end/54704
4578 * line-map.c (location_adhoc_data_hash): Fix the hash function.
4579
52187008
DC
45802012-09-25 Dehao Chen <dehao@google.com>
4581
4582 PR middle-end/54645
4583 * include/line-map.h (location_adhoc_data): Move location_adhoc_data
4584 into GC.
4585 (location_adhoc_data_map): Likewise.
4586 (line_maps): Likewise.
4587 (rebuild_location_adhoc_htab): New Function.
4588 * line-map.c (+rebuild_location_adhoc_htab): new Funcion.
4589 (get_combined_adhoc_loc): Move location_adhoc_data into GC.
4590 (location_adhoc_data_fini): Likewise.
4591 (linemap_init): Likewise.
4592 (location_adhoc_data_init): Remove Function.
4593
5368224f
DC
45942012-09-19 Dehao Chen <dehao@google.com>
4595
4596 * include/line-map.h (MAX_SOURCE_LOCATION): New value.
4597 (location_adhoc_data_fini): New.
4598 (get_combined_adhoc_loc): New.
4599 (get_data_from_adhoc_loc): New.
4600 (get_location_from_adhoc_loc): New.
4601 (location_adhoc_data_map): New.
4602 (COMBINE_LOCATION_DATA): New.
4603 (IS_ADHOC_LOC): New.
4604 (expanded_location): New field.
4605 (line_maps): New field.
4606 * line-map.c (location_adhoc_data): New.
4607 (location_adhoc_data_hash): New.
4608 (location_adhoc_data_eq): New.
4609 (location_adhoc_data_update): New.
4610 (get_combined_adhoc_loc): New.
4611 (get_data_from_adhoc_loc): New.
4612 (get_location_from_adhoc_loc): New.
4613 (location_adhoc_data_init): New.
4614 (location_adhoc_data_fini): New.
4615 (linemap_init): Initialize location_adhoc_data.
4616 (linemap_lookup): Change to use new location.
4617 (linemap_ordinary_map_lookup): Likewise.
4618 (linemap_macro_map_lookup): Likewise.
4619 (linemap_macro_map_loc_to_def_point): Likewise.
4620 (linemap_macro_map_loc_unwind_toward_spel): Likewise.
4621 (linemap_get_expansion_line): Likewise.
4622 (linemap_get_expansion_filename): Likewise.
4623 (linemap_location_in_system_header_p): Likewise.
4624 (linemap_location_from_macro_expansion_p): Likewise.
4625 (linemap_macro_loc_to_spelling_point): Likewise.
4626 (linemap_macro_loc_to_def_point): Likewise.
4627 (linemap_macro_loc_to_exp_point): Likewise.
4628 (linemap_resolve_location): Likewise.
4629 (linemap_unwind_toward_expansion): Likewise.
4630 (linemap_unwind_to_first_non_reserved_loc): Likewise.
4631 (linemap_expand_location): Likewise.
4632 (linemap_dump_location): Likewise.
4633 (linemap_line_start): Likewise.
4634
f3d25c65
DS
46352012-05-25 Dodji Seketeli <dodji@redhat.com>
4636
4637 PR preprocessor/53469
4638 * directives.c (do_pragma): Use the virtual location for the
4639 pragma token, instead of its spelling location.
4640
0823efed
DN
46412012-08-14 Diego Novillo <dnovillo@google.com>
4642
4643 Merge from cxx-conversion branch. Configury.
4644
4645 * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
4646 * configure.ac: Likewise.
4647 * configure: Regenerate.
4648
46492012-08-14 Lawrence Crowl <crowl@google.com>
4650
4651 Merge from cxx-conversion branch. New C++ hash table.
4652
4653 * include/symtab.h (typedef struct ht hash_table): Change the typedef
4654 name to cpp_hash_table. Update all users of the typedef.
4655
c0fd3497
LB
46562012-07-30 Laurynas Biveinis <laurynas.biveinis@gmail.com>
4657
4658 * include/line-map.h (line_map_macro): Use the "atomic" GTY option
4659 for the macro_locations field.
4660
d35d1c0f
UB
46612011-06-19 Uros Bizjak <ubizjak@gmail.com>
4662
4663 * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
4664 __builtin_ia32_pcmpestri128 instead of asm.
4665
d86d2119
DA
46662012-06-04 Dimitrios Apostolou <jimis@gmx.net>
4667
4668 * line-map.c (linemap_enter_macro): Don't zero max_column_hint in
4669 every macro. This improves performance by reducing the number of
4670 reallocations when track-macro-expansion is on.
4671
7ca643e1
DS
46722012-06-04 Dodji Seketeli <dodji@redhat.com>
4673
4674 PR preprocessor/53463
4675 * line-map.c (linemap_location_in_system_header_p): For built-in
4676 macro tokens, check the first expansion point location that is not
4677 for a token coming from a built-in macro.
4678
7d9641cc
JM
46792012-05-29 Joseph Myers <joseph@codesourcery.com>
4680
4681 * directives.c: Fix typos.
4682 * include/line-map.h: Fix typos.
4683 * line-map.c: Fix typos.
4684 * macro.c: Fix typos.
4685
53a103d3
DS
46862012-05-25 Dodji Seketeli <dodji@redhat.com>
4687
4688 PR bootstrap/53459
4689 * lex.c (search_line_fast): Avoid unused local typedefs to simulate
4690 a static assertion.
4691
828a7f76
DS
46922012-05-29 Dodji Seketeli <dodji@redhat.com>
4693
4694 PR preprocessor/53229
4695 * internal.h (cpp_reader::set_invocation_location): Remove.
4696 (cpp_reader::about_to_expand_macro_p): New member flag.
4697 * directives.c (do_pragma): Remove Kludge as
4698 pfile->set_invocation_location is no more.
4699 * macro.c (cpp_get_token_1): Do away with the use of
4700 cpp_reader::set_invocation_location. Just collect the macro
4701 expansion point when we are about to expand the top-most macro.
4702 Do not override cpp_reader::about_to_expand_macro_p.
4703 This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding
4704 properly handle locations of expansion points.
4705 (cpp_get_token_with_location): Adjust, as
4706 cpp_reader::set_invocation_location is no more.
4707 (paste_tokens): Take a virtual location parameter for
4708 the LHS of the pasting operator. Use it in diagnostics. Update
4709 comments.
4710 (paste_all_tokens): Tighten the assert. Propagate the location of
4711 the expansion point when no virtual locations are available.
4712 Pass the virtual location to paste_tokens.
4713 (in_macro_expansion_p): New static function.
4714 (enter_macro_context): Set the cpp_reader::about_to_expand_macro_p
4715 flag until we really start expanding the macro.
4716
0b2c4be5
DS
47172012-05-16 Dodji Seketeli <dodji@redhat.com>
4718
4719 PR preprocessor/7263
4720 * include/cpplib.h (cpp_classify_number): Take a location
4721 parameter.
4722 * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic
4723 macros that take a location parameter.
4724 (cpp_classify_number): Take a (virtual) location parameter. Use
4725 it for diagnostics. Adjust comments.
4726 (eval_token): Take a location parameter. Pass it to
4727 cpp_classify_number and to diagnostic routines.
4728 (_cpp_parse_expr): Use virtual locations of tokens when parsing
4729 expressions. Pass a virtual location to eval_token and to
4730 diagnostic routines.
4731
638d2065
TG
47322012-05-10 Tristan Gingold <gingold@adacore.com>
4733
4734 * expr.c (interpret_float_suffix): Add a guard.
4735
3ad64f53
DS
47362012-05-02 Dodji Seketeli <dodji@redhat.com>
4737
4738 Properly initialize cpp_context in destringize_and_run
4739 * directives.c (destringize_and_run): Properly initialize the new
4740 context.
4741 * macro.c (_cpp_pop_context): Assert that we shouldn't try to pop
4742 the initial base context, which has the same life time as the
4743 current instance of cpp_file.
4744
b193dfa8
MLI
47452012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
4746 Dodji Seketeli <dodji@seketeli.org>
4747
3efc2959 4748 PR c++/52974
b193dfa8
MLI
4749 * libcpp/files.c (maybe_shorter_path): New.
4750 (find_file_in_dir): Use it.
4751
4e65a470
DS
47522012-04-30 Dodji Seketeli <dodji@redhat.com>
4753
51fce2d3
DS
4754 Switch -ftrack-macro-expansion=2 on by default.
4755 * init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
4756 by default. Add comments.
4757
c4ca1a09
DS
4758 Strip "<built-in>" loc from displayed expansion context
4759 * include/line-map.h (linemap_unwind_toward_expansion): Fix typo
4760 in comment.
4761 (linemap_unwind_to_first_non_reserved_loc): Declare new function.
4762 * line-map.c (linemap_unwind_to_first_non_reserved_loc): Define
4763 new function.
4764
3600218c
DS
4765 Fix expansion point loc for macro-like tokens
4766 * macro.c (macro_of_context): New static function.
4767 (_cpp_push_token_context, push_extended_tokens_context): If the
4768 macro argument is NULL, it means we are continuing the expansion
4769 of the current macro, if any. Update comments.
4770 (_cpp_pop_context): Re-enable expansion of the macro only when we
4771 are really out of the context of the current expansion.
4772
0ff2b8a0
DS
4773 Fix token pasting with -ftrack-macro-expansion
4774 * macro.c (paste_all_tokens): Put the token resulting from pasting
4775 into an extended token context with -ftrack-macro-location is in
4776 effect.
4777
4e65a470
DS
4778 Fix cpp_sys_macro_p with -ftrack-macro-expansion
4779 * macro.c (cpp_sys_macro_p): Support -ftrack-macro-expansion.
4780
112448b4
DS
47812012-04-29 Dodji Seketeli <dodji@redhat.com>
4782
4783 * lex.c (lex_raw_string): Change C++ style comments into C style
4784 comments.
19a9ba64 4785 (lex_string): Likewise.
112448b4 4786
7f5f5f98
OW
47872012-04-27 Ollie Wild <aaw@google.com>
4788
4789 * include/cpplib.h (struct cpp_options): Add new field,
4790 warn_literal_suffix.
4791 (CPP_W_LITERAL_SUFFIX): New enum.
4792 * init.c (cpp_create_reader): Default initialization of
4793 warn_literal_suffix.
4794 * lex.c (lex_raw_string): Treat user-defined literals which don't
4795 begin with '_' as separate tokens and produce a warning.
4796 (lex_string): Ditto.
4797
1d72e96f
MLI
47982012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
4799
4800 * line-map.c (linemap_resolve_location): Synchronize comments with
4801 those in line-map.h.
4802 * include/line-map.h (linemap_resolve_location): Fix spelling in
4803 comment.
4804
e75b54a2
RE
48052012-03-22 Richard Earnshaw <rearnsha@arm.com>
4806
4807 * lex.c (search_line_fast): Provide Neon-optimized version for ARM.
4808
7888f266
RO
48092012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4810
4811 * lex.c: Remove Solaris 8 reference.
4812
dd552284
WL
48132012-02-14 Walter Lee <walt@tilera.com>
4814
4815 * configure.ac: Require 64-bit hwint for tilegx and tilepro.
4816 * configure: Regenerate.
4817
2c5cbc31
RG
48182012-01-09 Richard Guenther <rguenther@suse.de>
4819
4820 * macro.c (_cpp_builtin_macro_text): Remove unused variable map.
4821
b492b686
GF
48222012-01-09 Gary Funck <gary@intrepid.com>
4823
4824 PR preprocessor/33919
4825 * files.c (_cpp_get_file_name): New. Implement file name
4826 access function.
4827 * internal.h (_cpp_get_file_name): New prototype.
4828 * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
4829 to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
4830
75291c57
OH
48312012-01-03 Olivier Hainque <hainque@adacore.com>
4832
4833 * system.h: Prior to #define, #undef fopen and freopen unconditionally.
4834
48b0b196
JM
48352011-12-20 Joseph Myers <joseph@codesourcery.com>
4836
4837 * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
4838 (CLK_STDC1X): Change to CLK_STDC11.
4839 * init.c (lang_defaults): Update comments.
4840 (cpp_init_builtins): Update language tests. Use 201112L for C11
4841 __STDC_VERSION__.
4842
4a5e00ca
AS
48432011-12-20 Andreas Schwab <schwab@linux-m68k.org>
4844
4845 * configure: Regenerate.
4846
095af58f
AS
48472011-12-19 Andreas Schwab <schwab@linux-m68k.org>
4848
4849 * configure: Regenerate.
4850
b0c084b7
JJ
48512011-12-07 Jakub Jelinek <jakub@redhat.com>
4852
4853 PR bootstrap/50237
4854 * internal.h (_cpp_init_lexer): New prototype.
4855 * init.c (init_library): Call it.
4856 * lex.c (init_vectorized_lexer): Remove constructor attribute,
4857 add inline keyword.
4858 (HAVE_init_vectorized_lexer): Define.
4859 (_cpp_init_lexer): New function.
4860
9b554be9
DS
48612011-12-03 Dodji Seketeli <dodji@redhat.com>
4862
4863 * macro.c (tokens_buff_remove_last_token)
4864 (tokens_buff_put_token_to): Add an 'inline' function specifier to
4865 the prototype.
4866
8dcf72a8
DN
48672011-11-22 Diego Novillo <dnovillo@google.com>
4868
4869 * include/line-map.h (linemap_dump): Declare.
4870 (line_table_dump): Declare.
4871 * line-map.c (linemap_dump): New.
4872 (line_table_dump): New.
4873
7e74ce3f
ESR
48742011-11-21 Ed Smith-Rowland <3dw4rd@verizon.net>
4875
4876 PR c++/50958
4877 * expr.c (cpp_userdef_char_remove_type): Fix typo.
4878
e9411247
MM
48792011-11-03 Michael Matz <matz@suse.de>
4880
4881 PR bootstrap/50857
4882 * configure.ac: Check for -fno-exceptions -fno-rtti.
4883 * configure: Regenerate.
4884 * Makefile.in (NOEXCEPTION_FLAGS): New flag.
4885 (ALL_CXXFLAGS): Use it.
4886
0c1dace3
PC
48872011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
4888
4889 * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
4890
25339f10
JM
48912011-11-02 Jason Merrill <jason@redhat.com>
4892
4893 PR c++/50810
4894 * configure.ac: Add -Wno-narrowing to warning options.
4895
97e3ad20
JM
48962011-10-31 Jason Merrill <jason@redhat.com>
4897
1fb80b0c
JM
4898 PR libstdc++/1773
4899 * init.c (cpp_init_builtins): Set __cplusplus for C++11.
4900
97e3ad20
JM
4901 PR c++/50920
4902 * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
4903 CLK_GNUCXX0X to CLK_GNUCXX11.
4904
3ce4f9e4
ESR
49052011-10-26 Ed Smith-Rowland <3dw4rd@verizon.net>
4906
4907 Implement C++11 user-defined literals.
4908 * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
4909 cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
4910 cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
4911 cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
4912 (cpp_classify_number): Classify unrecognized tokens as user-defined
4913 literals.
4914 * include/cpplib.h: Add new tokens for user-defined literals.
4915 * init.c: Add new preprocessor flag (cxx11).
4916 * lex.c: (lex_string, lex_raw_string): Handle user-defined literals
4917 including concatenation and promotion with suffixes.
4918
3bb0c8db
DS
49192011-10-24 Dodji Seketeli <dodji@redhat.com>
4920
4921 * line-map.c (linemap_macro_map_lookup): Fix logic.
4922
84756fd4
DS
49232011-10-24 Dodji Seketeli <dodji@redhat.com>
4924
4925 * include/line-map.h (linemap_expand_location): Take a line table
4926 parameter. Update comment.
4927 (linemap_resolve_location): Update comment.
4928 (linemap_expand_location_full): Remove.
4929 * line-map.c (linemap_resolve_location): Handle reserved
4930 locations; return a NULL map in those cases.
4931 (linemap_expand_location): If location is reserved, return a
4932 zeroed expanded location. Update comment. Take a line table to
4933 assert that the function takes non-virtual locations only.
4934 (linemap_expand_location_full): remove.
4935 (linemap_dump_location): Handle the fact that
4936 linemap_resolve_location can return NULL line maps when the
4937 location resolves to a reserved location.
4938
4939 * line-map.c (linemap_macro_map_lookup): Fix logic.
4940
ad2305ad
DS
49412011-10-22 Dodji Seketeli <dodji@redhat.com>
4942
4943 PR bootstrap/50778
4944 * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
4945 context to act upon.
4946 * lex.c (_cpp_remaining_tokens_num_in_context): Likewise. Update
4947 comment.
4948 (cpp_token_from_context_at): Likewise.
4949 (cpp_peek_token): Use the context to peek tokens from.
4950
cbbcf655
DS
49512011-10-20 Dodji Seketeli <dodji@redhat.com>
4952
4953 PR bootstrap/50801
4954 * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
4955 number of tokens.
4956
d17687f6
DS
49572011-10-18 Dodji Seketeli <dodji@redhat.com>
4958
4959 PR bootstrap/50760
4960 * include/line-map.h (struct linemap_stats): Change the type of
19a9ba64 4961 the members from size_t to long.
d17687f6 4962 * macro.c (macro_arg_token_iter_init): Unconditionally initialize
19a9ba64 4963 iter->location_ptr.
d17687f6 4964
411f92de
DS
49652011-10-17 Dodji Seketeli <dodji@redhat.com>
4966
4967 * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
19a9ba64
AM
4968 variable without using it if ENABLE_CHECKING is not defined. Mark
4969 the LOCATION parameter as being unused.
411f92de 4970
b9bd6f74
TT
49712011-10-15 Tom Tromey <tromey@redhat.com>
4972 Dodji Seketeli <dodji@redhat.com>
4973
4974 * include/line-map.h (struct line_maps::alloced_size_for_request):
4975 New member.
4976 * line-map.c (new_linemap): Use set->alloced_size_for_request to
4977 get the actual allocated size of line maps.
4978
64a1a422
TT
49792011-10-15 Tom Tromey <tromey@redhat.com>
4980 Dodji Seketeli <dodji@redhat.com>
4981
4982 * line-map.h (struct linemap_stats): Declare new struct.
4983 (linemap_get_statistics): Declare ...
4984 * line-map.c (linemap_get_statistics): ... new function.
4985 * macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
4986 Declare new counters.
4987 (enter_macro_context, replace_args): Update
4988 num_macro_tokens_counter.
4989 (cpp_get_token_1): Update num_expanded_macros_counter.
4990
847e697a
TT
49912011-10-15 Tom Tromey <tromey@redhat.com>
4992 Dodji Seketeli <dodji@redhat.com>
4993
4994 * include/cpplib.h (struct cpp_options)<debug>: New struct member.
4995 * include/line-map.h (linemap_dump_location): Declare ...
4996 * line-map.c (linemap_dump_location): ... new function.
4997
92582b75
TT
49982011-10-15 Tom Tromey <tromey@redhat.com>
4999 Dodji Seketeli <dodji@redhat.com>
5000
5001 * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
5002 New option.
5003 * internal.h (struct macro_context): New struct.
5004 (enum context_tokens_kind): New enum.
5005 (struct cpp_context)<tokens_kind>: New member of type enum
5006 context_tokens_kind.
5007 (struct cpp_context)<macro>: Remove this. Replace it with an enum
5008 of macro and macro_context.
5009 (struct cpp_context)<direct_p>: Remove.
5010 (_cpp_remaining_tokens_num_in_context): Declare new function.
5011 * directives.c (destringize_and_run): Adjust.
5012 * lex.c (_cpp_remaining_tokens_num_in_context)
5013 (_cpp_token_from_context_at): Define new functions
5014 (cpp_peek_token): Use them.
5015 * init.c (cpp_create_reader): Initialize the base context to zero.
5016 (_cpp_token_from_context_at): Define new static function.
5017 (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
5018 _cpp_token_from_context_at.
5019 * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
5020 members.
5021 (enum macro_arg_token_kind): New enum.
5022 (struct macro_arg_token_iter): New struct.
5023 (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
5024 (alloc_expanded_arg_mem, ensure_expanded_arg_room)
5025 (delete_macro_args, set_arg_token, get_arg_token_location)
5026 (arg_token_ptr_at, macro_arg_token_iter_init)
5027 (macro_arg_token_iter_get_token)
5028 (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
5029 (expanded_token_index, tokens_buff_new, tokens_buff_count)
5030 (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
5031 (tokens_buff_add_token, tokens_buff_remove_last_token)
5032 (reached_end_of_context, consume_next_token_from_context): New
5033 static functions.
5034 (cpp_get_token_1): New static function. Split and extended from
5035 cpp_get_token. Use reached_end_of_context and
5036 consume_next_token_from_context. Unify its return point. Move
5037 the location tweaking from cpp_get_token_with_location in here.
5038 (cpp_get_token): Use cpp_get_token_1
5039 (stringify_arg): Use the new arg_token_at.
5040 (paste_all_tokens): Support tokens coming from extended tokens
5041 contexts.
5042 (collect_args): Return the number of collected arguments, by
5043 parameter. Store virtual locations of tokens that constitute the
5044 collected args.
5045 (funlike_invocation_p): Return the number of collected arguments,
5046 by parameter.
5047 (enter_macro_context): Add a parameter for macro expansion point.
5048 Pass it to replace_args and to the "used" cpp callback. Get the
5049 number of function-like macro arguments from funlike_invocation_p,
5050 pass it to the new delete_macro_args to free the memory used by
5051 macro args. When -ftrack-macro-expansion is in effect, for macros
5052 that have no arguments, create a macro map for the macro expansion
5053 and use it to allocate proper virtual locations for tokens
5054 resulting from the expansion. Push an extended tokens context
5055 containing the tokens resulting from macro expansion and their
5056 virtual locations.
5057 (replace_args): Rename the different variables named 'count' into
5058 variables with more meaningful names. Create a macro map;
5059 allocate virtual locations of tokens resulting from this
5060 expansion. Use macro_arg_token_iter to iterate over tokens of a
5061 given macro. Handle the case of the argument of
5062 -ftrack-macro-expansion being < 2. Don't free macro arguments
5063 memory resulting from expand_arg here, as these are freed by the
5064 caller of replace_arg using delete_macro_args now. Push extended
5065 token context.
5066 (next_context, push_ptoken_context, _cpp_push_token_context)
5067 (_cpp_push_text_context): Properly initialize the context.
5068 (expand_arg): Use the new alloc_expanded_arg_mem,
5069 push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
5070 (_cpp_pop_context): Really free the memory held by the context.
5071 Handle freeing memory used by extended tokens contexts.
5072 (cpp_get_token_with_location): Use cpp_get_token_1.
5073 (cpp_sys_macro_p): Adjust.
5074 (_cpp_backup_tokens): Support the new kinds of token contexts.
5075 * traditional.c (recursive_macro): Adjust.
5076
46427374
TT
50772011-10-15 Tom Tromey <tromey@redhat>
5078 Dodji Seketeli <dodji@redhat.com>
5079
5080 * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
5081 member.
5082 (MAX_SOURCE_LOCATION): New constant.
5083 (struct line_map_ordinary, struct line_map_macro): New structs.
19a9ba64 5084 (struct line_map): Turn this into a union of the two above. Add
46427374
TT
5085 comments.
5086 (struct maps_info): New struct.
5087 (struct line_maps)<info_ordinary, info_macro>: Two new fields.
5088 These now carry the map information that was previously scattered
5089 in struct line_maps.
5090 (struct map_info::allocated): Fix comment.
5091 (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
5092 (ORDINARY_MAP_STARTING_LINE_NUMBER)
5093 (ORDINARY_MAP_INCLUDER_FILE_INDEX)
5094 (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
5095 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
5096 (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
5097 (MACRO_MAP_EXPANSION_POINT_LOCATION)
5098 (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
5099 (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
5100 (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
5101 (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
5102 (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
5103 (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
5104 (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
5105 (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
5106 (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
5107 (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
5108 (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
5109 information.
5110 (linemap_check_ordinary, linemap_assert)
5111 (linemap_location_before_p): New macros.
5112 (linemap_position_for_line_and_column)
5113 (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
5114 (linemap_macro_expansion_map_p)
5115 (linemap_macro_map_loc_to_def_point)
5116 (linemap_macro_map_loc_unwind_once)
5117 (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
5118 (linemap_get_source_line linemap_get_source_column)
5119 (linemap_map_get_macro_name, linemap_get_file_path)
5120 (linemap_location_in_system_header_p)
5121 (linemap_location_from_macro_expansion_p): Declare new functions.
5122 (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
5123 (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
5124 accessors act on ordinary maps only.
5125 (INCLUDED_FROM): Return NULL for main files; use the new
5126 accessors.
5127 (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
5128 (struct expanded_location): Move here from gcc/input.h
5129 (linemap_resolve_location, linemap_expand_location)
5130 (linemap_expand_location_full): Declare new functions.
5131 * line-map.c: Include cpplib.h, internal.h
5132 (linemap_enter_macro, linemap_add_macro_token)
5133 (linemap_get_expansion_line, linemap_get_expansion_filename): New
5134 functions that are private to libcpp.
5135 (linemap_assert): New macro.
5136 (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
5137 (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
5138 (linemap_macro_map_loc_unwind_toward_spelling)
5139 (linemap_macro_map_loc_to_exp_point)
5140 (first_map_in_common_1, first_map_in_common): New static
5141 functions.
5142 (new_linemap): Define new static functions. Extracted and
5143 enhanced from ...
5144 (linemap_add): ... here. Use linemap_assert in lieu of abort
5145 previously.
5146 (linemap_tracks_macro_expansion_locs_p)
5147 (linemap_add_macro_token, linemap_macro_expansion_map_p)
5148 (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
5149 (linemap_macro_map_loc_to_def_point)
5150 (linemap_macro_map_loc_unwind_once)
5151 (linemap_step_out_once, linemap_map_get_index)
5152 (linemap_get_source_line,linemap_get_source_column)
5153 (linemap_get_file_path, linemap_map_get_macro_name)
5154 (linemap_location_in_system_header_p)
5155 (linemap_location_originated_from_system_header_p)
5156 (linemap_location_from_macro_expansion_p)
5157 (linemap_tracks_macro_expansion_locs_p)
5158 (linemap_resolve_location, linemap_expand_location)
5159 (linemap_expand_location_full)
5160 (linemap_tracks_macro_expansion_locs_p)
5161 (linemap_position_for_line_and_column, linemap_compare_locations):
5162 Define new public functions.
5163 (linemap_init): Initialize ordinary and macro maps information in
5164 the map set.
5165 (linemap_check_files_exited): Use the new accessors.
5166 (linemap_free): Remove this dead code.
5167 (linemap_line_start): Assert this uses an ordinary map. Adjust to
5168 use the new ordinary map accessors and data structures. Don't
5169 overflow past the lowest possible macro token's location.
5170 (linemap_position_for_column): Assert the ordinary maps of the map
5171 set are really ordinary. Use ordinary map accessors.
5172 (linemap_lookup): Keep the same logic but generalize to allow
5173 lookup of both ordinary and macro maps. Do not crash when called
5174 with an empty line table.
5175 * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
5176 new API of line-map.h.
5177 * directives.c (start_directive, do_line, do_linemarker)
5178 (do_linemarker): Likewise.
5179 * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
5180 (make_cpp_dir, cpp_make_system_header): Likewise.
5181 * init.c (cpp_read_main_file): Likewise.
5182 * internal.h (CPP_INCREMENT_LINE): Likewise.
5183 (linemap_enter_macro, linemap_add_macro_token)
5184 (linemap_get_expansion_line, linemap_get_expansion_filename): New
5185 functions private to libcpp.
5186 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
5187 (skip_line_comment, skip_whitespace, lex_raw_string)
5188 (_cpp_lex_direct): Likewise.
5189 * macro.c (_cpp_builtin_macro_text): Likewise.
5190 (_cpp_aligned_alloc): Initialize the new name member of the macro.
5191 * traditional.c (copy_comment, _cpp_scan_out_logical_line):
5192 Likewise.
5193 * errors.c (cpp_diagnostic): Adjust to new linemap API.
5194
892a371f
DS
51952011-08-28 Dodji Seketeli <dodji@redhat.com>
5196
5197 * line-map.c (linemap_add): Assert that reason must not be
5198 LC_RENAME when called for the first time on a "main input file".
5199
e3dfef44
GC
52002011-08-22 Gabriel Charette <gchare@google.com>
5201
5202 * init.c (cpp_create_reader): Inititalize forced_token_location_p.
5203 * internal.h (struct cpp_reader): Add field forced_token_location_p.
5204 * lex.c (_cpp_lex_direct): Use forced_token_location_p.
5205 (cpp_force_token_locations): New.
5206 (cpp_stop_forcing_token_locations): New.
5207
32fe396e
RO
52082011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5209
5210 PR libstdc++/1773
5211 * init.c (cpp_init_builtins): Define __cplusplus 19971L.
5212
7c1ffff9
JM
52132011-08-18 Joseph Myers <joseph@codesourcery.com>
5214
5215 * include/cpplib.h (struct cpp_options): Fix typo.
5216
a48e3dd1
JM
52172011-08-18 Joseph Myers <joseph@codesourcery.com>
5218
5219 * include/cpplib.h (struct cpp_options): Add rliterals.
5220 * init.c (struct lang_flags, lang_defaults): Add rliterals.
5221 (cpp_set_lang): Set rliterals option.
5222 (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
5223 * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
5224
3f6ced10
GC
52252011-08-15 Gabriel Charette <gchare@google.com>
5226
5227 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
5228 Update all users to use linemap_position_for_column instead.
5229
0681d04c
GC
52302011-07-28 Gabriel Charette <gchare@google.com>
5231
5232 * include/line-map.h (struct line_maps):
5233 Remove unused field last_listed. Update all users.
5234
5e9627ca
L
52352011-07-28 H.J. Lu <hongjiu.lu@intel.com>
5236
5237 * configure.ac: Set need_64bit_hwint to yes for x86 targets.
5238 * configure: Regenerated.
5239
a024b70f
RO
52402011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5241
5242 * system.h [__cplusplus]: Wrap C function declarations in extern "C".
5243
5b6d595b
RO
52442011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5245 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5246
5247 PR bootstrap/49794
5248 * configure.ac: Test AM_ICONV with CXX.
5249 * configure: Regenerate.
5250 * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
5251
d0a9fbe1
DS
52522011-07-15 Dodji Seketeli <dodji@redhat.com>
5253
5254 * directives.c (struct if_stack): Use source_location as type
5255 here.
5256 * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
5257 indent, def_pragma, used_define, used_undef>: Properly use
5258 source_location as parameter type, rather than unsigned int.
5259
fbdd5d87
RO
52602011-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5261
5262 PR target/39150
5263 * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
5264 like i[34567]86-*-solaris2.1[0-9]*.
5265 * configure: Regenerate.
5266
8787a05a
JM
52672011-06-16 Jason Merrill <jason@redhat.com>
5268
5269 PR c++/45399
5270 * lex.c (lex_raw_string): Don't check for embedded NUL.
5271
38fbfaf6
DS
52722011-06-06 Dodji Seketeli <dodji@redhat.com>
5273
5274 PR preprocessor/48532
5275 * directives.c (do_pragma): Don't forget the invocation location
5276 when parsing the pragma name of a namespaced pragma directive.
5277
fc0993ac
JT
52782011-05-29 John Tytgat <John.Tytgat@aaug.net>
5279
5280 * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
5281
ef230b38
UB
52822011-05-22 Uros Bizjak <ubizjak@gmail.com>
5283
5284 PR target/49104
5285 * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
5286 is defined. Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
5287
e5b0dad8
JK
52882011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
5289
5290 * system.h (ENUM_BITFIELD): Remove.
5291
6cfae070
JJ
52922011-04-24 Jakub Jelinek <jakub@redhat.com>
5293
5294 PR preprocessor/48740
5295 * lex.c (lex_raw_string): When raw string ends with
5296 ??) followed by raw prefix and ", ensure it is preprocessed
5297 with ??) rather than ??].
5298
04695783
JM
52992011-04-20 Jim Meyering <meyering@redhat.com>
5300
5301 * files.c (destroy_cpp_file): Remove useless if-before-free.
5302 * init.c (cpp_destroy): Likewise.
5303 * macro.c (replace_args): Likewise.
5304 * pch.c (cpp_valid_state): Likewise.
5305
4489800d
KT
53062011-03-25 Kai Tietz <ktietz@redhat.com>
5307
5308 * files.c (file_hash_eq): Use filename_cmp
5309 instead of strcmp.
5310 (nonexistent_file_hash_eq): Likewise.
5311 (remap_filename): Likewise.
5312 Handle absolute DOS-path,
5313 (append_file_to_dir): Check for IS_DIR_SEPARATOR
5314 instead of slash.
5315 (read_name_map): Likewise.
5316 * linemap.c (linemap_add): Use filename_cmp
5317 instead of strcmp.
5318 * mkdeps.c (apply_vpath): Use filename_ncmp
5319 instead of strncmp.
5320 (deps_restore): Use filename_cmp instead of
5321 strcmp.
5322 * init.c (read_original_directory): Use
5323 IS_DIR_SEPARATOR instead of checking for slash.
5324
f3c33d9d
MM
53252011-03-21 Michael Meissner <meissner@linux.vnet.ibm.com>
5326
5327 PR preprocessor/48192
5328 * directives.c (do_ifdef): Do not consider conditional macros as
5329 being defined.
5330 (do_ifndef): Ditto.
5331 * expr.c (parse_defined): Ditto.
5332
01956319
RH
53332011-03-18 Richard Henderson <rth@redhat.com>
5334
5335 PR bootstrap/45381
5336 * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
5337
c5a62c6f 53382011-11-04 Eric Botcazou <ebotcazou@adacore.com>
19a9ba64 5339 Jakub Jelinek <jakub@redhat.com>
c5a62c6f
EB
5340
5341 PR preprocessor/39213
5342 * directives.c (end_directive): Call _cpp_remove_overlay for deferred
5343 pragmas as well in traditional mode.
5344
0e1a989c
ILT
53452010-11-17 Ian Lance Taylor <iant@google.com>
5346
5347 PR bootstrap/45538
5348 * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of
5349 AC_LANG based on ENABLE_BUILD_WITH_CXX.
5350
651a20b5
KT
53512010-11-16 Kai Tietz <kai.tietz@onevision.com>
5352
5353 PR preprocessor/17349
5354 * lex.c (save_comment): Handle in argument passing c++
5355 comments special.
5356
480767a9
ILT
53572010-11-02 Ian Lance Taylor <iant@google.com>
5358
5359 * configure.ac: Use AC_SYS_LARGEFILE.
5360 * configure: Rebuild.
5361 * config.in: Rebuild.
5362
078419c9 53632010-10-19 Basile Starynkevitch <basile@starynkevitch.net>
480767a9 5364
078419c9
BS
5365 * line-map.h (source_location): Remove obsolete comment
5366 mentioning location_s.
5367
d6874138
KT
53682010-09-29 Kai Tietz <kai.tietz@onevision.com>
5369
5370 PR preprocessor/45362
5371 * directives.c (cpp_pop_definition): Make static.
5372 (do_pragma_push_macro): Reworked to store text
5373 definition.
5374 (do_pragma_pop_macro): Add free text definition.
5375 (cpp_push_definition): Removed.
5376 * include/cpplib.h (cpp_push_definition): Removed.
5377 (cpp_pop_definition): Likewise.
5378 * internal.h (def_pragma_macro): Remove member 'value'
5379 and add new members 'definition', 'line',
5380 'syshdr', 'sued' and 'is_undef'.
5381 * pch.c (_cpp_restore_pushed_macros): Rework to work
5382 on text definition and store additional macro flags.
5383 (_cpp_save_pushed_macros): Likewise.
5384
e3339d0f
JM
53852010-09-29 Joseph Myers <joseph@codesourcery.com>
5386
5387 * include/cpplib.h (cpp_options): Rename warn_deprecated,
5388 warn_traditional, warn_long_long and pedantic.
5389 * directives.c (directive_diagnostics, _cpp_handle_directive):
5390 Update names of cpp_options members.
5391 * expr.c (cpp_classify_number, eval_token): Update names of
5392 cpp_options members.
5393 * init.c (cpp_create_reader, post_options): Update names of
5394 cpp_options members.
5395 * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
5396 cpp_options members.
5397 * macro.c (parse_params): Update names of cpp_options members.
5398
128465e6
ILT
53992010-09-15 Ian Lance Taylor <iant@google.com>
5400
5401 * init.c: Fix type name in comment.
5402
a69d2520
JJ
54032010-08-31 Jakub Jelinek <jakub@redhat.com>
5404
5405 PR preprocessor/45457
5406 * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
5407 needed.
5408 * directives.c (do_ifdef, do_ifndef): Likewise.
5409
707bcb7a
RO
54102010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5411
5412 * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
5413
6f173e52
RH
54142010-08-24 Richard Henderson <rth@redhat.com>
5415
5416 PR bootstrap/45376
5417 * configure.ac (HAVE_SSE4): New check.
5418 * configure, config.in: Rebuild.
5419 * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
5420
789d73cb
RO
54212010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5422
5423 * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
5424 etc. on Solaris 2/x86.
5425
246a2fcb
RH
54262010-08-21 Richard Henderson <rth@redhat.com>
5427 Andi Kleen <ak@linux.intel.com>
5428 David S. Miller <davem@davemloft.net>
5429
5430 * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
5431 (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
5432 (ptrdiff_t): Check via AC_CHECK_TYPE.
5433 * config.in, configure: Rebuild.
5434 * system.h: Include stdint.h, if available.
5435 * lex.c (WORDS_BIGENDIAN): Provide default.
5436 (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
5437 acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
5438 search_line_sse2, search_line_sse42, init_vectorized_lexer,
5439 search_line_fast): New.
5440 (_cpp_clean_line): Use search_line_fast. Restructure the fast
5441 loop to make it clear when we're leaving the loop. Stay in the
5442 fast loop for non-trigraph '?'.
5443
8e680db5
JJ
54442010-06-11 Jakub Jelinek <jakub@redhat.com>
5445
5446 * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
5447 callback.
5448 (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
5449 (cpp_macro_definition): Remove const qual from second argument.
5450 * macro.c (enter_macro_context): Call user_builtin_macro callback for
5451 NODE_BUILTIN !NODE_USED macros.
5452 (warn_of_redefinition): Likewise. Remove const qual from second
5453 argument.
5454 (cpp_macro_definition): Likewise.
5455 * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
5456 for NODE_BUILTIN !NODE_USED macros.
5457
1cb42611
JM
54582010-06-10 Joseph Myers <joseph@codesourcery.com>
5459
5460 * include/cpplib.h (struct cpp_options): Remove show_column.
5461 * init.c (cpp_create_reader, post_options): Don't set show_column.
5462
ff5dfc48
JR
54632010-06-09 Joern Rennecke <joern.rennecke@embecosm.com>
5464
5465 PR bootstrap/44432
5466 * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
5467 check that C++ compiler works.
5468 * configure: Regenerate.
5469
a9429e29
LB
54702010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
5471
5472 * include/symtab.h (ht_identifier_ptr): New.
5473
c3f247f4
RW
54742010-06-03 Joern Rennecke <joern.rennecke@embecosm.com>
5475 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5476
5477 PR bootstrap/42798
5478 * configure.ac: Check for declaration of 'basename(char *)'.
5479 * configure: Regenerate.
5480 * config.in: Regenerate.
5481
2778d766
JM
54822010-04-25 Joseph Myers <joseph@codesourcery.com>
5483
5484 * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
5485 * init.c (lang_defaults): Add entries for new language variants.
5486 (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
5487 variants.
5488
d8a12e84
MLI
54892010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
5490
5491 PR cpp/43195
5492 * files.c (report_missing_guard): Test for #pragma once.
5493
87cf0651
SB
54942010-04-07 Simon Baldwin <simonb@google.com>
5495
5496 * directives.c (do_diagnostic): Add warning reason argument,
5497 call appropriate error reporting function for code.
5498 (directive_diagnostics): Call specific warning functions with
5499 warning reason where appropriate.
5500 (do_error, do_warning, do_pragma_dependency): Add warning reason
5501 argument to do_diagnostic calls.
5502 * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
5503 _cpp_create_definition): Call specific warning functions with
5504 warning reason where appropriate.
5505 * Makefile.in: Add new diagnostic functions to gettext translations.
5506 * include/cpplib.h (struct cpp_callbacks): Add warning reason code
5507 to error callback.
5508 (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
5509 CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
5510 (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
5511 CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
5512 CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
5513 CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
5514 CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
5515 CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
5516 CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
5517 warning reason codes.
5518 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
5519 cpp_warning_with_line, cpp_pedwarning_with_line,
5520 cpp_warning_with_line_syshdr): New specific error reporting functions.
5521 * pch.c (cpp_valid_state): Call specific warning functions with
5522 warning reason where appropriate.
5523 * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
5524 diagnostic handlers.
5525 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
5526 cpp_warning_with_line, cpp_pedwarning_with_line,
5527 cpp_warning_with_line_syshdr): New specific error reporting functions.
5528 * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
5529 specific warning functions with warning reason where appropriate.
5530 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
5531 warn_about_normalization, lex_identifier_intern, lex_identifier,
5532 _cpp_lex_direct): Ditto.
5533 * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
5534 narrow_str_to_charconst): Ditto.
5535
d947ada0
JJ
55362010-04-06 Jakub Jelinek <jakub@redhat.com>
5537
5538 PR preprocessor/43642
5539 * lex.c (lex_raw_string): Change type of TYPE variable to
5540 unsigned char.
5541
4d9e8446
RW
55422010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5543
5544 * aclocal.m4: Regenerate.
5545
52150625
JM
55462010-03-29 Jason Merrill <jason@redhat.com>
5547
00a81b8b
JM
5548 More N3077 raw string changes
5549 * charset.c (cpp_interpret_string): Don't transform UCNs in raw
5550 strings.
5551 * lex.c (bufring_append): Split out from...
5552 (lex_raw_string): ...here. Undo trigraph and line splicing
5553 transformations. Do process line notes in multi-line literals.
5554 (_cpp_process_line_notes): Ignore notes that were already handled.
5555
52150625
JM
5556 Some raw string changes from N3077
5557 * charset.c (cpp_interpret_string): Change inner delimiters to ().
5558 * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter.
5559
709d7160
JJ
55602010-02-11 Jakub Jelinek <jakub@redhat.com>
5561
5562 * init.c (read_original_filename): Don't call read_original_directory
5563 if _cpp_handle_directive returns 0.
5564
dadab4fd
JM
55652010-01-01 Joseph Myers <joseph@codesourcery.com>
5566
5567 PR preprocessor/41947
5568 * expr.c (cpp_classify_number): Give error for hexadecimal
5569 floating-point constant with no digits before or after point.
5570
3de8a540
AC
55712009-11-20 Arnaud Charlet <charlet@adacore.com>
5572
5573 * macro.c (enter_macro_context): Call cb.used callback if defined.
5574 * directives.c (do_idef, do_ifndef): Ditto.
5575 * include/cpplib.h (struct cpp_callbacks): Add used callback.
5576
17e7cb85
KT
55772009-11-11 Kai Tietz <kai.tietz@onevision.com>
5578
5579 * directives.c (do_pragma_push_macro): New pragma handler.
5580 (do_pragma_pop_macro): Likewise.
5581 (_cpp_init_internal_pragmas): Add push_macro and
5582 pop_macro handler to internal pragmas.
5583 (lex_macro_node_from_str): Removed.
5584 (cpp_push_definition): Replace lex_macro_node_from_str
5585 by _cpp_lex_identifier.
5586 (cpp_pop_definition): Likewise.
5587 * internal.h (_cpp_lex_identifier): New prototype.
5588 (def_pragma_macro): New structure.
5589 (cpp_reader): New member pushed_macros.
5590 * lex.c (_cpp_lex_identifier): New function.
5591 (lex_identifier_intern): New function.
5592 * init.c (cpp_create_reader): Initialize pushed_macros
5593 member.
5594 (cpp_destroy): Free elements in pushed_macros member.
5595 * pch.c (_cpp_save_pushed_macros): New function.
5596 (_cpp_restore_pushed_macros): Likewise.
5597 (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
5598 (cpp_read_state): Use _cpp_restore_pushed_macros.
5599
2c6e3f55
JJ
56002009-10-19 Jakub Jelinek <jakub@redhat.com>
5601
5602 * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
5603 (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
5604 and char32_cset_desc.
5605 (converter_for_type): Handle CPP_UTF8STRING.
5606 (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
5607 * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
5608 (parse_include): Reject raw strings.
5609 * include/cpplib.h (CPP_UTF8STRING): New token type.
5610 * internal.h (struct cpp_reader): Add utf8_cset_desc field.
5611 * lex.c (lex_raw_string): New function.
5612 (lex_string): Handle u8 string literals, call lex_raw_string
5613 for raw string literals.
5614 (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
5615 sequences.
5616 * macro.c (stringify_arg): Handle CPP_UTF8STRING.
5617
96c169e1
JJ
56182009-10-14 Jakub Jelinek <jakub@redhat.com>
5619
5620 PR preprocessor/41543
5621 * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
5622 * line-map.c (linemap_init): Initialize highest_location and
5623 highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
5624
30c99a9e
JM
56252009-10-09 Jason Merrill <jason@redhat.com>
5626
5627 * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
5628
2214382c
NV
56292009-10-09 Neil Vachharajani <nvachhar@google.com>
5630
5631 * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
5632 sccs.
5633
e02222d2
LR
56342009-09-23 Loren J. Rittle <ljrittle@acm.org>
5635
5636 * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
5637 * configure: Rebuilt.
5638
9a8a2b7a
RG
56392009-09-22 Richard Guenther <rguenther@suse.de>
5640
5641 PR pch/38987
5642 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
5643
74dc6a11
CD
56442009-09-18 Chris Demetriou <cgd@google.com>
5645
5646 PR preprocessor/28435:
5647 * include/cpplib.h (struct cpp_options): Add new member
5648 deps.need_preprocessor_output.
5649 * files.c (open_file_failed): If preprocessor output is needed
5650 always report an error.
5651
933608b7
KT
56522009-09-13 Kai Tietz <kai.tietz@onevision.com>
5653
5654 * configure.ac: Set for i?86-w64-mingw*
5655 need_64bit_hwint to yes.
5656 * configure: Regenerated.
5657
86373e7e
JM
56582009-09-10 Jason Merrill <jason@redhat.com>
5659
5660 * directives.c (cpp_define): constify.
5661
fd2ab214
ILT
56622009-09-02 Ian Lance Taylor <iant@google.com>
5663
5664 * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
5665
df58e648
RW
56662009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5667
5668 * configure.ac (AC_PREREQ): Bump to 2.64.
5669
5213506e
RW
56702009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5671
5672 * aclocal.m4: Regenerate.
5673 * config.in: Regenerate.
5674 * configure: Regenerate.
5675
709a22df
TT
56762009-08-17 Tom Tromey <tromey@redhat.com>
5677
5678 PR preprocessor/41067:
5679 * charset.c (convert_escape): Add missing ":" to error text.
5680
0c539b47
DR
56812009-07-27 Douglas B Rupp <rupp@gnat.com>
5682
5683 * include/cpplib.h (INO_T_CPP): New macro.
5684 (struct cpp_dir): Use it.
5685
2b69c841
JQ
56862009-07-20 Jerry Quinn <jlquinn@optonline.net>
5687
5688 PR regression/40800
5689 * configure.ac: Use = instead of == for testing
5690 ENABLE_BUILD_WITH_CXX.
5691 * configure: Rebuild.
5692
f1bf410c
JQ
56932009-07-17 Jerry Quinn <jlquinn@optonline.net>
5694
5695 * directives.c (do_linemarker, do_line): Use CPP_STRING for
5696 ignored enum value.
5697 * files.c (find_file_in_dir): Add cast from void* to char*.
5698 * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
5699 * Makefile.in: (WARN_CFLAGS): Use general and C-specific
5700 warnings.
5701 (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
5702 ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
5703 COMPILER_FLAGS): New.
5704 (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
5705 (COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS
5706 instead of ALL_CFLAGS.
5707 * configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings
5708 from other warnings. Add -Wc++-compat to C-specific warnings.
5709 Check for --enable-build-with-cxx. Set and substitute
5710 ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES
5711 according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before
5712 AC_CHECK_HEADERS.
5713 * configure: Rebuild.
5714 * include/cpp-id-data.h: Remove extern "C".
5715 * include/line-map.h: Likewise.
5716 * include/mkdeps.h: Likewise.
5717 * include/symtab.h: Likewise.
5718 * internal.h: Likewise.
5719
a28fbdba
MLI
57202009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5721
5722 * directives.c (parse_include): Add location argument. Update all
5723 calls.
5724 (parse_answer): Likewise.
5725 (do_include_common): Error with exact location.
5726 (parse_assertion): Likewise.
5727
b506a5a2
MLI
57282009-06-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
5729
5730 * expr.c (num_div_op): Take explicit location.
5731
7d8847a4
ILT
57322009-06-17 Ian Lance Taylor <iant@google.com>
5733
5734 * include/cpplib.h (progname): Don't declare.
5735
3d8b2a98
ILT
57362009-06-12 Ian Lance Taylor <iant@google.com>
5737
5738 * include/cpplib.h (struct cpp_options): Add
5739 warn_cxx_operator_names field.
5740 (NODE_WARN_OPERATOR): Define.
5741 (struct cpp_hashnode): Increase flags field to 10 bits, decrease
5742 type to 6 bits.
5743 * init.c (mark_named_operators): Add flags parameter.
5744 (cpp_post_options): Pick flags value to pass to
5745 mark_named_operators.
5746 * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
5747 identifier is an operator name in C++.
5748
e74fe492
AH
57492009-06-01 Aldy Hernandez <aldyh@redhat.com>
5750
5751 * include/line-map.h (LAST_SOURCE_COLUMN): New.
5752
4851089f
ILT
57532009-06-01 Ian Lance Taylor <iant@google.com>
5754
5755 * include/cpp-id-data.h: Add extern "C".
5756 * include/line-map.h: Likewise.
5757 * include/mkdeps.h: Likewise.
5758 * include/symtab.h: Likewise.
5759 * internal.h: Likewise.
5760
7e5487a2
ILT
57612009-05-15 Ian Lance Taylor <iant@google.com>
5762
5763 * include/cpplib.h (enum cpp_builtin_type): Rename from enum
5764 builtin_type. Change all uses.
5765
00b0c19b
MLI
57662009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5767
5768 PR cpp/36674
5769 * directives (do_linemarker): Compensate for the increment in
5770 location that occurs when we reach the end of line.
5771 * files (_cpp_stack_include): Mention _cpp_find_file in the
5772 comment.
5773
9a0c6187
JM
57742009-05-10 Joseph Myers <joseph@codesourcery.com>
5775
5776 * include/cpplib.h (enum cpp_token_fld_kind): Add
5777 CPP_TOKEN_FLD_TOKEN_NO.
5778 (struct cpp_macro_arg, struct cpp_identifier): Define.
5779 (union cpp_token_u): Use struct cpp_identifier for identifiers.
5780 Use struct cpp_macro_arg for macro arguments. Add token_no for
5781 CPP_PASTE token numbers.
5782 * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
5783 do_pragma_poison, parse_assertion): Use val.node.node in place of
5784 val.node.
5785 * expr.c (parse_defined, eval_token): Use val.node.node in place
5786 of val.node.
5787 * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
5788 cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
5789 cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
5790 place of val.arg_no. Use val.node.node in place of val.node.
5791 * macro.c (replace_args, cpp_get_token, parse_params,
5792 lex_expansion_token, create_iso_definition, cpp_macro_definition):
5793 Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
5794 Use val.node.node in place of val.node.
5795
9e322bc1
JM
57962009-05-03 Joseph Myers <joseph@codesourcery.com>
5797
5798 * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
5799 UTF-8 sequences.
5800
f88d0772
JM
58012009-04-25 Joseph Myers <joseph@codesourcery.com>
5802
5803 PR preprocessor/39559
5804 * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
5805 constants larger than intmax_t in C99 mode.
5806
d1b38208
TG
58072009-04-21 Taras Glek <tglek@mozilla.com>
5808
5809 * include/cpp-id-data.h: Update GTY annotations to new syntax.
5810 * include/cpplib.h: Likewise.
5811 * include/line-map.h: Likewise.
5812 * include/symtab.h: Likewise.
5813
cfc93532
MLI
58142009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5815
5816 PR c++/14875
5817 * lex.c (cpp_type2name): Take a flags parameter. Call
5818 cpp_named_operator2name for named operators and cpp_digraph2name
5819 for digraphs.
5820 (cpp_digraph2name): New.
5821 (cpp_spell_token): Use it.
5822 (cpp_output_token): Likewise.
5823 * include/cpplib.h (cpp_type2name): Update declaration.
5824 * init.c (cpp_named_operator2name): New.
5825 * internal.h (cpp_named_operator2name): Declare.
5826
9c650d90
MLI
58272009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5828
5829 PR c++/13358
5830 * init.c (cpp_create_reader): Wlong_long is disabled by default.
5831 * expr.c (cpp_classify_number): Give different messages for C and
5832 C++ front-ends.
5833
aa508502
JM
58342009-04-19 Joseph Myers <joseph@codesourcery.com>
5835
5836 PR preprocessor/20078
5837 * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
5838 field.
5839 * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
5840 (struct cpp_token): Change flags to unsigned short.
5841 * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
5842 (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
5843 (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
5844 tokens.
5845 * macro.c (macro_real_token_count): New.
5846 (enter_macro_context, replace_args): Use macro_real_token_count.
5847 (create_iso_definition): Record whitespace surrounding and digraph
5848 spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
5849 Set extra_tokens and save CPP_PASTE tokens with arg_no set for
5850 multiple consecutive ## tokens.
5851 (_cpp_create_definition): Initialize extra_tokens.
5852 (cpp_macro_definition): Use macro_real_token_count.
5853
61cc8223
JM
58542009-04-18 Joseph Myers <joseph@codesourcery.com>
5855
5856 * directives.c (parse_include): Pass true to check_eol.
5857
c7f9c0b9
JM
58582009-04-18 Joseph Myers <joseph@codesourcery.com>
5859
5860 PR preprocessor/39646
5861 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
5862 * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
5863 * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
5864 place of LC_RENAME.
5865
a5cb563b
JM
58662009-04-18 Joseph Myers <joseph@codesourcery.com>
5867
5868 PR preprocessor/39647
5869 * directives.c (check_eol): Add parameter expand.
5870 (do_undef, parse_include, do_line, do_linemarker, do_ident,
5871 do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
5872 do_else, do_endif, do_assert, do_unassert): All callers changed.
5873 Pass true from do_line, false elsewhere.
5874
18f41a1b
JM
58752009-04-12 Joseph Myers <joseph@codesourcery.com>
5876
5877 PR preprocessor/31869
5878 * macro.c (stringify_arg): Handle NULL source token in padding
5879 token where previous padding token did not have source token with
5880 preceding whitespace.
5881
748086b7
JJ
58822009-04-09 Jakub Jelinek <jakub@redhat.com>
5883
5884 * Makefile.in: Change copyright header to refer to version
5885 3 of the GNU General Public License and to point readers at the
5886 COPYING3 file and the FSF's license web page.
5887 * charset.c: Likewise.
5888 * directives-only.c: Likewise.
5889 * directives.c: Likewise.
5890 * errors.c: Likewise.
5891 * expr.c: Likewise.
5892 * files.c: Likewise.
5893 * identifiers.c: Likewise.
5894 * include/cpp-id-data.h: Likewise.
5895 * include/cpplib.h: Likewise.
5896 * include/line-map.h: Likewise.
5897 * include/mkdeps.h: Likewise.
5898 * include/symtab.h: Likewise.
5899 * init.c: Likewise.
5900 * internal.h: Likewise.
5901 * lex.c: Likewise.
5902 * line-map.c: Likewise.
5903 * macro.c: Likewise.
5904 * makeucnid.c: Likewise.
5905 * mkdeps.c: Likewise.
5906 * pch.c: Likewise.
5907 * symtab.c: Likewise.
5908 * system.h: Likewise.
5909 * traditional.c: Likewise.
5910 * ucnid.tab: Likewise.
5911 * ucnid.h: Regenerate.
5912
eec49116
JJ
59132009-04-01 Janis Johnson <janis187@us.ibm.com>
5914
839a3b8a
JJ
5915 PR c/39027
5916 * include/cpplib.h (CPP_N_DEFAULT): Define.
5917 * expr.c (interpret_float_suffix): Recognize d or D for double,
5918 return new value for default.
5919 (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
5920
eec49116
JJ
5921 PR c/33466
5922 * expr.c (interpret_float_suffix): Reject invalid suffix that uses
5923 letters from decimal float and fixed-point suffixes.
5924
47580d22
JM
59252009-03-31 Joseph Myers <joseph@codesourcery.com>
5926
5927 PR preprocessor/15638
5928 * files.c (_cpp_find_file): Call open_file_failed after diagnosing
5929 invalid PCH.
5930 (open_file_failed): Make error for missing file fatal.
5931 * include/cpplib.h (CPP_DL_FATAL): Define.
5932
5a2df0fa
SV
59332009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net>
5934
5935 PR preprocessor/31932:
5936 * internal.h: Don't mention HAVE_ICONV_H.
5937 * configure, config.in: Rebuild.
5938 * configure.ac: Don't check for iconv.h.
5939
c1a8a3c6
TT
59402009-03-30 Tom Tromey <tromey@redhat.com>
5941
5942 PR preprocessor/39512:
5943 * line-map.c (linemap_init): Initialize 'reallocator' field.
5944
a37a7b8a
JJ
59452009-03-30 Jakub Jelinek <jakub@redhat.com>
5946
5947 PR target/39558
5948 * macro.c (cpp_get_token): If macro_to_expand returns NULL
5949 and used some tokens, add CPP_PADDING before next token.
5950
148e4216
JM
59512009-03-29 Joseph Myers <joseph@codesourcery.com>
5952
5953 PR preprocessor/34695
5954 * makedepend.c: Remove.
5955 * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
5956 (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
5957 * directives.c (cpp_errors): Remove.
5958 * errors.c (print_location, _cpp_begin_message, v_message):
5959 Remove.
5960 (cpp_error, cpp_error_with_line): Always use error callback.
5961 (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
5962 * include/cpplib.h (cpp_options): Remove pedantic_errors,
5963 inhibit_warnings, warn_system_headers, inhibit_errors,
5964 warnings_are_errors, client_diagnostic.
5965 (cpp_callbacks): Add extra arguments to error callback; make it
5966 return bool.
5967 (cpp_finish): Return void.
5968 (cpp_destroy): Remove inaccurate comment about return value.
5969 (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
5970 (CPP_DL_NOTE): Define.
5971 * include/line-map.h (linemap_print_containing_files): Remove.
5972 * init.c (cpp_finish): Do not check for or return number of
5973 errors.
5974 * internal.h (cpp_reader): Remove errors field.
5975 * line-map.c (linemap_print_containing_files): Remove.
5976 * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
5977 about previous definition. Only emit it if previous diagnostic
5978 was emitted.
5979
f1450211
JM
59802009-03-28 Joseph Myers <joseph@codesourcery.com>
5981
5982 * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
5983 mkinstalldirs.
5984
8f5929e1
JJ
59852009-03-18 Jakub Jelinek <jakub@redhat.com>
5986
5987 * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
5988
4bb09c26
JM
59892009-02-21 Joseph Myers <joseph@codesourcery.com>
5990
5991 * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
5992 header name.
5993 (_cpp_lex_direct): Handle this.
5994
68c9ab45
RG
59952009-02-15 Richard Guenther <rguenther@suse.de>
5996
5997 Revert last change.
5998
601b3e1a
RG
59992009-02-13 Richard Guenther <rguenther@suse.de>
6000
6001 * configure.ac: Enable LFS.
6002 * configure: Re-generate.
6003 * config.in: Likewise.
6004
fc0cd180
BE
60052009-01-05 Ben Elliston <bje@au.ibm.com>
6006
6007 * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
6008 (.po.pox): Likewise.
6009 (po/$(PACKAGE).pot): Likewise.
6010
db89a3be
AO
60112008-12-10 Alexandre Oliva <aoliva@redhat.com>
6012
6013 PR target/37033
6014 * pch.c (cpp_valid_state): Improve message for poisoned symbols.
6015 Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
6016
cc955282
JM
60172008-11-29 Joseph Myers <joseph@codesourcery.com>
6018
6019 * lex.c (cpp_token_len): Use 6 as default length.
6020
47960aaf
MLI
60212008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org>
6022
6023 * expr.c (struct op): Add location.
6024 (_cpp_parse_expr): Propagate locations throught the stack
6025 of expressions.
6026 (reduce): Likewise.
6027 (check_promotion): Use explicit location in errors.
6028
631d0d36
MG
60292008-10-05 Matthew Gingell <gingell@adacore.com>
6030 Arnaud Charlet <charlet@adacore.com>
6031
6032 * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
6033 (cpp_get_comments): New function.
6034 * internal.h (struct cpp_reader): Add comments field.
6035 * init.c (cpp_destroy): Free comments.
6036 * lex.c (store_comment, cpp_get_comments): New functions.
6037 (comments): New struct.
6038 (save_comment): Store comments in comments struct.
6039
c047ce93
SB
60402008-09-18 Simon Baldwin <simonb@google.com>
6041
6042 * include/cpplib.h (struct cpp_options): Add new boolean flag
6043 warn_builtin_macro_redefined.
6044 * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
6045 * (struct builtin_operator): Split out from previous struct builtin,
6046 enhance extra const correctness.
6047 * (struct builtin_macro): Split out from previous struct builtin, add
6048 new always_warn_if_redefined flag, enhance const correctness.
6049 * (mark_named_operators): Use struct builtin_operator.
6050 * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
6051 to builtins selectively.
6052 * macro.c (warn_of_redefinition): Return false if a builtin macro
6053 is not flagged with NODE_WARN.
6054
affa55c6
JJ
60552008-07-31 Jakub Jelinek <jakub@redhat.com>
6056
6057 PR preprocessor/36649
6058 * files.c (struct report_missing_guard_data): New type.
6059 (report_missing_guard): Put paths into an array instead of printing
6060 them right away. Return 1 rather than 0.
6061 (report_missing_guard_cmp): New function.
6062 (_cpp_report_missing_guards): Sort and print paths gathered by
6063 report_missing_guard callback.
6064
3b8f20a1
MLI
60652008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
6066
6067 PR 28079
6068 * directives.c (strtolinenum): Handle overflow.
6069 (do_line): Give a warning if line number overflowed.
6070 (do_linemarker): Update call to strtolinenum.
6071
1bb64668
MLI
60722008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
6073
6074 * include/line-map.h (linenum_type): New typedef.
6075 (struct line_map): Use it.
6076 (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
6077 (SOURCE_COLUMN): Likewise.
6078 * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
6079 source_location values in a variable of type linenum_type.
6080 * directives.c (struct if_stack): Use linenum_type.
6081 (strtoul_for_line): Rename as strtolinenum.
6082 (do_line): Use linenum_type.
6083 (do_linemarker): Use linenum_type and strtolinenum.
6084 (_cpp_do_file_change): Use linenum_t.
6085 * line-map.c (linemap_add): Likewise.
6086 (linemap_line_start): Likewise.
6087 * traditional.c (struct fun_macro): 'line' is a source_location.
6088 * errors.c (print_location): Use linenum_type.
6089 * directives-only.c (_cpp_preprocess_dir_only): Likewise.
6090 * internal.h (CPP_INCREMENT_LINE): Likewise.
6091 * lex.c (_cpp_skip_block_comment): Use source_location.
19a9ba64 6092
5950c3c9
BE
60932008-07-14 Ben Elliston <bje@au.ibm.com>
6094
6095 * include/cpplib.h (NODE_CONDITIONAL): New.
6096 (struct cpp_callbacks): New macro_to_expand field.
6097 (struct cpp_hashnode): Adjust size of flags and type fields.
6098 (cpp_peek_token): Prototype.
6099 * lex.c (cpp_peek_token): New function.
6100 (_cpp_temp_token): Protect pre-existing lookaheads.
6101 * macro.c (cpp_get_token): Expand any conditional macros.
6102 (_cpp_backup_tokens_direct): New.
6103 (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
6104 (warn_of_redefinition): Silently allow redefined conditional
6105 macros.
6106 (_cpp_create_definition): Remove the conditional flag when a user
6107 defines one of the conditional macros.
6108 * internal.h (_cpp_backup_tokens_direct): New prototype.
6109
e85edc9e
AH
61102008-06-13 Andrew Haley <aph@redhat.com>
6111
6112 PR preprocessor/33305
6113 * macro.c (replace_args): Print a warning for empty macro
6114 arguments in C89 and C++.
6115
18c04407
RW
61162008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6117
6118 * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
6119 * configure: Regenerate.
6120
2d09b640
RW
61212008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6122
6123 * Makefile.in (datarootdir): New variable.
6124
0b7c73cc
L
61252008-06-12 H.J. Lu <hongjiu.lu@intel.com>
6126
6127 PR preprocessor/36479
6128 * charset.c (cpp_interpret_string_notranslate): Also set
6129 narrow_cset_desc.width.
6130
cd985f66
JM
61312008-06-07 Joseph Myers <joseph@codesourcery.com>
6132
6133 * configure.ac (parisc*64*-*-*): Remove.
6134 * configure: Regenerate.
6135
d750887f
TT
61362008-05-30 Tom Tromey <tromey@redhat.com>
6137
6138 PR preprocessor/36320:
6139 * internal.h (_cpp_parse_expr): Update.
6140 * expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error
6141 messages.
6142 * directives.c (do_if): Update.
6143 (do_elif): Require expression if processing group.
6144
c100de59
DS
61452008-05-30 Danny Smith <dannysmith@users.sourceforge.net>
6146
6147 * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
6148
5d6342eb
TT
61492008-05-21 Tom Tromey <tromey@redhat.com>
6150
6151 PR preprocessor/27777:
6152 * lex.c (cpp_output_line_to_string): New function.
6153 * internal.h (_cpp_begin_message): Don't declare.
6154 * errors.c (_cpp_begin_message): Now static.
6155 * include/cpplib.h (cpp_output_line_to_string): Declare.
6156 * directives.c (do_diagnostic): Rewrote. Use
6157 cpp_output_line_to_string. Don't use _cpp_begin_message.
6158
dae4174e
TT
61592008-05-21 Tom Tromey <tromey@redhat.com>
6160
6161 * include/symtab.h (HT_ALLOCED): Remove.
6162 (ht_purge): Declare.
6163 * symtab.c (DELETED): New define.
6164 (ht_lookup): Update comment.
6165 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED
6166 code. Use subobject allocator for strings, if it exists.
6167 (ht_expand): Handle deleted entries.
6168 (ht_forall): Likewise.
6169 (ht_purge): New function.
6170 (ht_dump_statistics): Print deletion statistics.
6171
899015a0
TT
61722008-05-13 Tom Tromey <tromey@redhat.com>
6173
6174 PR preprocessor/22168:
6175 * include/cpplib.h (struct cpp_options) <objc>: Update
6176 documentation.
6177 * expr.c (eval_token): Warn for use of assertions.
6178 * directives.c (directive_diagnostics): Warn about extensions.
6179 (DEPRECATED): New define.
6180 (DIRECTIVE_TABLE): Use it.
6181
71c10038
TT
61822008-05-06 Tom Tromey <tromey@redhat.com>
6183
6184 PR preprocessor/35313, PR preprocessor/36088:
6185 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
6186 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
6187
2bd0fe3d
DM
61882008-05-04 David S. Miller <davem@davemloft.net>
6189
6190 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
6191 * configure: Regenerate.
6192
28f68625
DF
61932008-04-22 Daniel Franke <franke.daniel@gmail.com>
6194
6195 * include/cpplib.h (cpp_define_formatted): New.
6196 * directives.c (cpp_define_formatted): New.
6197
688e7a53
TT
61982008-04-21 Tom Tromey <tromey@redhat.com>
6199
6200 PR libcpp/33415:
6201 * charset.c (_cpp_convert_input): Add buffer_start argument.
6202 Ignore UTF-8 BOM if seen.
6203 * internal.h (_cpp_convert_input): Add argument.
6204 * files.c (struct _cpp_file) <buffer_start>: New field.
6205 (destroy_cpp_file): Free buffer_start, not buffer.
6206 (_cpp_pop_file_buffer): Likewise.
6207 (read_file_guts): Update.
6208
b6baa67d
KVH
62092008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
6210
6211 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
6212 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
6213 (struct cpp_options): Added uliterals.
6214 (cpp_interpret_string): Update prototype.
6215 (cpp_interpret_string_notranslate): Idem.
6216 * charset.c (init_iconv_desc): New width member in cset_converter.
6217 (cpp_init_iconv): Add support for char{16,32}_cset_desc.
6218 (convert_ucn): Idem.
6219 (emit_numeric_escape): Idem.
6220 (convert_hex): Idem.
6221 (convert_oct): Idem.
6222 (convert_escape): Idem.
6223 (converter_for_type): New function.
6224 (cpp_interpret_string): Use converter_for_type, support u and U prefix.
6225 (cpp_interpret_string_notranslate): Match changed prototype.
6226 (wide_str_to_charconst): Use converter_for_type.
6227 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
6228 * directives.c (linemarker_dir): Macro U changed to UC.
6229 (parse_include): Idem.
6230 (register_pragma_1): Idem.
6231 (restore_registered_pragmas): Idem.
6232 (get__Pragma_string): Support CPP_STRING{16,32}.
6233 * expr.c (eval_token): Support CPP_CHAR{16,32}.
6234 * init.c (struct lang_flags): Added uliterals.
6235 (lang_defaults): Idem.
6236 * internal.h (struct cset_converter) <width>: New field.
6237 (struct cpp_reader) <char16_cset_desc>: Idem.
6238 (struct cpp_reader) <char32_cset_desc>: Idem.
6239 * lex.c (digraph_spellings): Macro U changed to UC.
6240 (OP, TK): Idem.
6241 (lex_string): Add support for u'...', U'...', u"..." and U"...".
6242 (_cpp_lex_direct): Idem.
6243 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
6244 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
6245
deb984e6
PB
62462008-04-18 Paolo Bonzini <bonzini@gnu.org>
6247
6248 PR bootstrap/35457
6249 * aclocal.m4: Regenerate.
6250 * configure: Regenerate.
6251
bf048bea
TT
62522008-04-17 Tom Tromey <tromey@redhat.com>
6253
6254 PR libcpp/34866:
6255 * errors.c (cpp_error): Don't reference a token before the start
6256 of the current run.
6257
7f27b0f8
TT
62582008-04-16 Tom Tromey <tromey@redhat.com>
6259
6260 * Makefile.in (TAGS_SOURCES): New variable.
6261 (TAGS): New target.
6262
a1fcb9a1
KK
62632008-04-11 Kaz Kojima <kkojima@gcc.gnu.org>
6264
6265 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
6266 and shbe-*-*.
6267 * configure: Rebuilt.
6268
93d45d9e
JM
62692008-04-02 Joseph Myers <joseph@codesourcery.com>
6270
6271 * include/cpplib.h (struct cpp_callbacks): Add used_define,
6272 used_undef and before_define.
6273 (NODE_USED): Define.
6274 * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
6275 do_ifndef, cpp_pop_definition): Handle new flag and use new
6276 callbacks.
6277 * expr.c (parse_defined): Handle new flag and use new callbacks.
6278 * macro.c (enter_macro_context, _cpp_free_definition): Handle new
6279 flag and use new callbacks.
6280
d4c32e1d
JJ
62812008-04-01 Jakub Jelinek <jakub@redhat.com>
6282
6283 PR pch/13675
6284 * files.c (struct _cpp_file): Remove pch field.
6285 (pch_open_file): Don't set file->pch, just file->pchname.
6286 (should_stack_file): After pfile->cb.read_pch call
6287 free pchname and clear pchname, don't close file->fd.
6288 Test file->pchname instead of file->pch. Don't close fd after cb.
6289 (_cpp_stack_include): Test file->pchname instead of file->pch.
6290
161031e3
TT
62912008-03-28 Tom Tromey <tromey@redhat.com>
6292
6293 * Makefile.in (POSTCOMPILE): New variable.
6294 (.c.o): Use it.
6295
14ccf800
TT
62962008-03-13 Tom Tromey <tromey@redhat.com>
6297
6298 PR libcpp/35322:
6299 * directives.c (destringize_and_run): Set pfile->directive.
6300
830465c6
MM
63012008-03-06 Markus Milleder <markus.milleder@generali.at>
6302
6303 PR preprocessor/35458
6304 * mkdeps.c (munge): Quote '#' with a '\'.
6305
d482a073
RW
63062008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6307
6308 PR preprocessor/35379
6309 * mkdeps.c (deps_write): Ensure the first target always appears
6310 in the first column, without leading backslash newline. Avoid
6311 some more extra whitespace.
6312
185a6cc1
TS
63132008-02-25 Thiemo Seufer <ths@mips.com>
6314
d482a073 6315 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
185a6cc1 6316
2bf41bf0
TT
63172008-02-19 Tom Tromey <tromey@redhat.com>
6318
6319 * traditional.c (lex_identifier): Use CPP_HASHNODE.
6320 * lex.c (lex_identifier): Use CPP_HASHNODE.
6321 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
6322 do-while.
6323 * identifiers.c (alloc_node): Change return type.
6324 (_cpp_init_hashtable): Don't cast 'alloc_node'.
6325 (proxy_assertion_broken): New declaration.
6326 (cpp_forall_identifiers): Move comment.
6327 * line-map.c (linemap_add): Comment fix.
6328 (linemap_line_start): Indentation fix.
6329
765d600a
JJ
63302008-01-25 Jakub Jelinek <jakub@redhat.com>
6331
6332 PR preprocessor/34692
6333 * macro.c (collect_args): Add pragma_buff argument. Push
6334 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
6335 than into arguments. Reset prevent_expansion and parsing_args
6336 state at CPP_PRAGMA_EOL/CPP_EOF.
6337 (funlike_invocation_p): Add pragma_buff argument, pass it through
6338 to collect_args.
6339 (enter_macro_context): Add result argument. Adjust
6340 funlike_invocation_p caller. Emit all deferred pragma tokens
6341 gathered during collect_args before the expansion, add a padding
6342 token. Return 2 instead of 1 if any pragma tokens were prepended.
6343 (cpp_get_token): If enter_macro_context returns 2, don't return
6344 a padding token, instead cycle to grab CPP_PRAGMA token.
6345 * directives.c (_cpp_handle_directive): If was_parsing_args
6346 in deferred pragma, leave parsing_args and prevent_expansion as is.
6347
ec46053b
TT
63482008-01-22 Tom Tromey <tromey@redhat.com>
6349
765d600a 6350 PR c++/34859
ec46053b
TT
6351 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
6352 __STDC_CONSTANT_MACROS.
6353
681c6ab0
FF
63542008-01-07 Fred Fish <fnf@specifix.com>
6355
765d600a 6356 PR preprocessor/30363
681c6ab0 6357 * traditional.c (replace_args_and_push): Add local variable
19a9ba64 6358 cxtquote, calculate the replacement text size assuming a
681c6ab0
FF
6359 worst case of every input character quoted with backslash,
6360 and properly handle output quoting of quote characters in
6361 actual arguments used in function-like macros.
6362
33ae4837
TT
63632008-01-03 Tom Tromey <tromey@redhat.com>
6364
765d600a 6365 PR preprocessor/34602
33ae4837
TT
6366 * directives.c (do_line): Don't try to spell EOF token.
6367 (do_linemarker): Add comment.
6368
675575f5
DD
63692007-12-11 DJ Delorie <dj@redhat.com>
6370
6371 * charset.c (convert_using_iconv): Close out any shift states,
6372 returning to the initial state.
6373
97f6bd40
TT
63742007-12-06 Tom Tromey <tromey@redhat.com>
6375
765d600a 6376 PR c/29172
97f6bd40
TT
6377 * internal.h (struct cpp_reader) <file_hash_entries>: Changed
6378 type.
6379 <file_hash_entries_allocated, file_hash_entries_used>: Removed.
6380 * files.c (FILE_HASH_POOL_SIZE): New macro.
6381 (struct file_hash_entry_pool): New.
6382 (destroy_all_cpp_files): New function.
6383 (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
6384 (new_file_hash_entry): Update.
6385 (free_file_hash_entries): New function.
6386 (_cpp_cleanup_files): Call free_file_hash_entries and
6387 destroy_all_cpp_files.
6388 (cpp_clear_file_cache): New function.
6389 * include/cpplib.h (cpp_clear_file_cache): Declare.
6390
d56a25e1
TT
63912007-12-03 Tom Tromey <tromey@redhat.com>
6392
765d600a 6393 PR preprocessor/34288
d56a25e1
TT
6394 * configure.ac, config.in: Rebuilt.
6395 * configure.ac: Check for ssize_t.
6396
607f74e9
TT
63972007-11-30 Tom Tromey <tromey@redhat.com>
6398
765d600a 6399 PR preprocessor/32868
607f74e9
TT
6400 * macro.c (_cpp_create_definition): Special case
6401 __STDC_FORMAT_MACROS.
6402
b0f4807f
MM
64032007-11-16 Michael Matz <matz@suse.de>
6404
6405 * files.c (search_path_head): Fix check for absolute paths.
6406
f1e20710
TT
64072007-11-11 Tom Tromey <tromey@redhat.com>
6408
765d600a 6409 PR c++/17557
f1e20710
TT
6410 * include/cpplib.h (cpp_included_before): Declare.
6411 * files.c (struct file_hash_entry) <location>: New field.
6412 (_cpp_find_file): Initialize new field.
6413 (make_cpp_dir): Likewise.
6414 (cpp_included_before): New function.
6415
f373b44d
TT
64162007-11-01 Tom Tromey <tromey@redhat.com>
6417
765d600a 6418 PR preprocessor/30805
f373b44d
TT
6419 * macro.c (paste_tokens): Handle padding token.
6420 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
6421
5b9a40df
TT
64222007-10-31 Tom Tromey <tromey@redhat.com>
6423
765d600a 6424 PR preprocessor/30786
5b9a40df
TT
6425 * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
6426 * directives.c (_cpp_do__Pragma): Return error status.
6427 * internal.h (_cpp_do__Pragma): Update.
6428 * directives.c (get__Pragma_string): Back up if EOF seen.
6429
5ffeb913
TT
64302007-09-06 Tom Tromey <tromey@redhat.com>
6431
6432 * internal.h (struct cpp_reader) <invocation_location>: New
6433 field.
6434 (struct cpp_reader) <set_invocation_location>: Likewise.
6435 * init.c (cpp_set_line_map): New function.
6436 * line-map.c (linemap_add): Use linemap's allocator.
6437 * include/line-map.h (GTY): Define.
6438 (line_map_realloc): New typedef.
6439 (struct line_map): Mark with GTY.
6440 (struct line_maps): Likewise.
6441 (struct line_maps) <maps>: Likewise.
6442 (struct line_maps) <reallocator>: New field.
6443 * include/symtab.h (GTY): Conditionally define.
6444 * include/cpplib.h (cpp_set_line_map): Declare.
6445 (cpp_get_token_with_location): Declare.
6446 * macro.c (cpp_get_token): Set invocation_location on the reader.
6447 (cpp_get_token_with_location): New function.
6448
ac6b1c67
CF
64492007-08-30 Chao-ying Fu <fu@mips.com>
6450
6451 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
6452 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
6453 (cpp_classify_number): Support decimal fixed-point constants without
6454 exponents.
6455 Warn about fixed-point constants when -pedantic.
6456 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
6457 comments to support fixed-point values.
6458 (CPP_N_FRACT, CPP_N_ACCUM): Define.
6459
cda5e672
TT
64602007-08-18 Tom Tromey <tromey@redhat.com>
6461
765d600a 6462 PR preprocessor/32974
cda5e672
TT
6463 * directives.c (parse_include): Don't check for EOL when
6464 processing #pragma dependency.
6465
ccfc4c91
OW
64662007-07-30 Ollie Wild <aaw@google.com>
6467
6468 * directives-only.c: New file.
6469 * internal.h (struct _cpp_dir_only_callbacks): New.
6470 (_cpp_preprocess_dir_only): New function.
6471 * directives.c (_cpp_handle_directive): Check directives_only before
6472 disabling execution of indented directives.
6473 * files.c (_cpp_stack_file): Add directives_only check.
6474 * include/cpplib.h (struct cpp_options): Add directives_only.
6475 (cpp_init_special_builtins): New function.
6476 * init.c (cpp_init_special_builtins): New function.
6477 (cpp_init_builtins): Move builtin_array initialization to
6478 cpp_init_special_builtins.
6479 (post_options): Check directives_only before setting
6480 pfile->state.prevent_expansion = 1.
6481 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
6482 is expanded inside a directive while -fdirectives-only is enabled.
6483 * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
6484 (libcpp_a_SOURCES): Add directives-only.c.
6485
a206413a
UB
64862007-07-04 Uros Bizjak <ubizjak@gmail.com>
6487
6488 * traditional.c (_cpp_scan_out_logical_line): Initialize
6489 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
6490 fmacro.args to prevent 'may be used uninitialized' warning.
6491
c77cd3d1
UB
64922007-07-03 Uros Bizjak <ubizjak@gmail.com>
6493
6494 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
6495 Add new constants.
6496 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
6497 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
6498 for 'q' or 'Q' suffixes.
6499
66938a1d
DS
65002007-06-17 Danny Smith <dannysmith@users.sourceforge.net
6501
e1311401 6502 * files.c (open_file): Correct typo.
66938a1d 6503
71995ede
VP
65042007-06-16 Vladimir Prus <vladimir@codesourcery.com>
6505
e1311401 6506 * files.c (open_file): Prevent the call
71995ede
VP
6507 for stat from overwriting errno.
6508
84152c25
VP
65092007-06-09 Vladimir Prus <vladimir@codesourcery.com>
6510
e1311401 6511 * files.c (open_file): Account for the
19a9ba64
AM
6512 fact that on windows, opening a directory gives
6513 EACCES.
84152c25 6514
f7fd775f
JW
65152007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
6516
6517 PR preprocessor/23479
6518 * expr.c (cpp_classify_number): Implement 0b-prefixed binary
6519 integer constants.
6520 (append_digit): Likewise.
6521 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
6522 binary integer constants.
6523
ed0e74e0
DK
65242007-05-31 Dave Korn <dave.korn@artimi.com>
6525
6526 PR preprocessor/14331
6527 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
6528
a702045a
OW
65292007-05-24 Ollie Wild <aaw@google.com>
6530
6531 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
6532 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
6533 (cpp_write_pch_state): Save __COUNTER__ state.
6534 (cpp_valid_state): Check valid __COUNTER__ state.
6535 (cpp_read_state): Read new __COUNTER__ state.
6536 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
6537 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
6538 * internal.h (struct cpp_reader): Add counter member.
6539
126e073b
SM
65402007-05-23 Simon Martin <simartin@users.sourceforge.net>
6541
6542 PR preprocessor/20077
6543 * macro.c (create_iso_definition): Fixed the method to determine
6544 whether the token-pasting operator appears at the beginning or the end
6545 of a macro.
6546
0b4cafec
ILT
65472007-05-21 Ian Lance Taylor <iant@google.com>
6548
6549 * internal.h (struct cpp_reader): Add new fields:
6550 nonexistent_file_hash and nonexistent_file_ob.
6551 * files.c: Include "obstack.h".
6552 (find_file_in_dir): Before trying to open the file, look up the
6553 path name in the hash table of nonexistent files. After failing
6554 to open the file, add the path name to the hash table.
6555 (_cpp_find_file): Cache the results of looking up the file name
6556 starting with the quote and bracket chain heads, if we can.
6557 (nonexistent_file_hash_eq): New static function.
6558 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
6559 pfile->nonexistent_file_ob.
6560 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
6561 pfile->nonexistent_file_ob.
6562
30e04921
JJ
65632007-05-14 Janis Johnson <janis187@us.ibm.com>
6564
19a9ba64 6565 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
5a6bb57e 6566
30e04921
JJ
6567 PR c/31924
6568 * expr.c (interpret_float_suffix): Check for invalid suffix.
6569
22a8a52d
EC
65702007-05-02 Eric Christopher <echristo@apple.com>
6571
6572 * expr.c (num_div_op): Don't overflow if the result is
6573 zero.
6574
fca35e1b
TT
65752007-05-02 Tom Tromey <tromey@redhat.com>
6576
765d600a 6577 PR preprocessor/28709
fca35e1b
TT
6578 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
6579
4cd97075
MM
65802007-03-30 Michael Meissner <michael.meissner@amd.com>
6581
6582 * directives.c (lex_macro_node_from_str): Fix alloca call to be
6583 type correct.
6584
121de39f
RH
65852007-03-30 Richard Henderson <rth@redhat.com>
6586
6587 * directives.c (lex_macro_node_from_str): New.
6588 (cpp_push_definition, cpp_pop_definition): New.
6589 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
6590
4fcb360b
BM
65912007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
6592
6593 * Makefile.in: Add dummy install-pdf target.
6594
67e64439
TT
65952007-01-30 Tom Tromey <tromey@redhat.com>
6596
765d600a 6597 PR preprocessor/30468
67e64439
TT
6598 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
6599 './'.
6600
ee380365
TT
66012007-01-30 Tom Tromey <tromey@redhat.com>
6602
765d600a 6603 PR preprocessor/29966
ee380365
TT
6604 * macro.c (lex_expansion_token): Save and restore cpp_reader's
6605 cur_token.
6606 (_cpp_create_definition): Don't restore cur_token here.
6607 * lex.c (_cpp_lex_token): Added assertion.
6608
024abeb3
TT
66092007-01-27 Tom Tromey <tromey@redhat.com>
6610
6611 * configure: Rebuilt.
6612
ee1c2a10
TT
66132007-01-12 Tom Tromey <tromey@redhat.com>
6614
765d600a 6615 PR preprocessor/28227
ee1c2a10
TT
6616 * directives.c (lex_macro_node): Added 'is_def_or_undef'
6617 argument.
6618 (do_define): Update.
6619 (do_undef): Update.
6620 (do_ifdef): Update.
6621 (do_ifndef): Update.
6622
67214c16
PB
66232007-01-11 Paolo Bonzini <bonzini@gnu.org>
6624
6625 * configure: Regenerate.
6626
1aa6ca40
PB
66272007-01-11 Paolo Bonzini <bonzini@gnu.org>
6628
6629 * configure: Regenerate.
6630
705e2d28
TT
66312007-01-04 Tom Tromey <tromey@redhat.com>
6632
765d600a 6633 PR preprocessor/28165
705e2d28
TT
6634 * internal.h (cpp_in_primary_file): New function.
6635 * directives.c (do_include_next): Use cpp_in_primary_file.
6636 (do_pragma_once): Likewise.
6637 (do_pragma_system_header): Likewise.
6638
7af45bd4
ILT
66392006-12-29 Ian Lance Taylor <iant@google.com>
6640
6641 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
6642 look backward at the end of the line unless we saw a backslash.
6643
9d30f270
JJ
66442006-12-29 Jakub Jelinek <jakub@redhat.com>
6645
6646 PR preprocessor/29612
6647 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
6648 only when new_sysp is non-zero.
6649
30b0edc0
TT
66502006-12-28 Tom Tromey <tromey@redhat.com>
6651
765d600a 6652 PR preprocessor/30001
30b0edc0
TT
6653 * charset.c (_cpp_convert_input): Check that to.len is greater
6654 than zero.
6655
85d9c13c
TS
66562006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
6657
6658 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
83cc06b2 6659 * configure: Rebuilt.
85d9c13c 6660
dfafdaa6
DG
66612006-11-01 Douglas Gregor <doug.gregor@gmail.com>
6662
6663 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
6664 for experimental C++0x mode.
6665 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
6666 adopted the preprocessor changes introduced in C99.
6667
0f45f0f5
JM
66682006-10-29 Joseph Myers <joseph@codesourcery.com>
6669
6670 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
6671 depending on --enable-targets=all.
6672 * configure: Regenerate.
6673
de000d22
JJ
66742006-10-12 Jakub Jelinek <jakub@redhat.com>
6675
6676 PR preprocessor/28709
6677 * macro.c (paste_tokens): Do error reporting here, use BUF with the
6678 spelled LHS token as opposed to spelling it again.
6679 (paste_all_tokens): Don't report errors here, just break on failure.
6680
b5422ad7
BM
66812006-10-10 Brooks Moses <bmoses@stanford.edu>
6682
6683 * Makefile.in: Added empty "pdf" target.
6684
aaf50ff2
GK
66852006-09-22 Geoffrey Keating <geoffk@apple.com>
6686
6687 * configure.ac: Make need_64_bit_hwint case for x86-darwin
6688 match exactly the glob in gcc/config.gcc.
6689 * configure: Regenerate.
6690
c663e301
JM
66912006-09-13 Joseph S. Myers <joseph@codesourcery.com>
6692
6693 PR c/28768
6694 PR preprocessor/14634
6695 * lex.c (lex_string): Pedwarn for unterminated literals.
6696
f7288899
EC
66972006-09-08 Eric Christopher <echristo@apple.com>
6698
6699 * configure.ac: Add 64-bit HWI support for i?86-darwin.
6700
b52dbbf8
SE
67012006-08-14 Steve Ellcey <sje@cup.hp.com>
6702
6703 PR c++/28288
6704 PR c++/14556
6705 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
6706 (CPP_LAST_EQ): Change.
6707 (CPP_LAST_PUNCTUATOR): Change.
6708 * expr.c (cpp_operator): Remove MIN and MAX.
6709 (reduce): Remove CPP_MIN and CPP_MAX.
6710 (num_binary_op): Ditto.
6711 * lex.c (_cpp_lex_direct): Ditto.
6712 (cpp_avoid_paste): Remove ? as legal symbol after > or <.
6713
1c90c6f9
JJ
67142006-06-09 Jakub Jelinek <jakub@redhat.com>
6715
6716 PR preprocessor/27746
6717 * directives.c (do_pragma): Handle pragma with valid namespace
6718 and invalid name coming from macro expansion.
6719 * directives.c (destringize_and_run): Initialize next field in
6720 context.
6721
6722 PR c/27747
6723 PR c++/27748
6724 * directives.c (destringize_and_run): Set NO_EXPAND on the
6725 tokens.
6726
6727 * macro.c (_cpp_backup_tokens): Fix comment typo.
6728
5c3c3683
DJ
67292006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
6730
6731 * Makefile.in (CATALOGS): Add po/ prefix.
6732 * configure: Regenerated.
6733
b2bd74bc
CD
67342006-05-23 Carlos O'Donell <carlos@codesourcery.com>
6735
6736 * Makefile.in: Add install-html target. Add install-html to .PHONY
6737
be8ac3e2
GZ
67382006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
6739
6740 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
6741 * files.c (_cpp_get_file_stat): New function.
6742 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
6743 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
6744 * internal.h (_cpp_get_file_stat): Prototype.
6745 (struct cpp_buffer): Add timestamp.
6746
83900997
JJ
67472006-01-23 Jakub Jelinek <jakub@redhat.com>
6748
6749 PR preprocessor/25717
6750 * init.c (cpp_init_builtins): If __STDC__ will not change value
6751 between system headers and other sources, define it as a normal
6752 macro rather than a builtin.
6753 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
6754 cpp_in_system_header condition.
6755
67562006-01-05 Paolo Bonzini <bonzini@gnu.org>
9220c30c
PB
6757
6758 * Makefile.in: Use -MMD instead of -MD.
6759
bc4071dd
RH
67602006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
6761 Richard Henderson <rth@redhat.com>
6762
6763 Merge from gomp branch:
6764 * directives.c (struct pragma_entry): Add is_deferred. Add ident
6765 entry to value union.
6766 (end_directive): Don't eat the line if in_deferred_pragma.
6767 (run_directive): Remove pragma hacks.
6768 (insert_pragma_entry): Remove.
6769 (new_pragma_entry): New.
6770 (register_pragma_1): Split out of register_pragma. Only handle
6771 the lookup tree and return the new entry.
6772 (cpp_register_pragma): Fill in the pragma entry here.
6773 (cpp_register_deferred_pragma): New.
6774 (register_pragma_internal): New.
6775 (_cpp_init_internal_pragmas): Use register_pragma_internal.
6776 (do_pragma): Allow pragma expansion after namespace. For deferred
6777 pragmas, don't slurp the line into a string.
6778 (destringize_and_run): Save tokens for deferred pragmas.
6779 (cpp_handle_deferred_pragma): Remove.
6780 * macro.c (builtin_macro): Remove pragma token hack.
6781 (_cpp_push_token_context): Rename from push_token_context and export.
6782 * internal.h (struct lexer_state): Add pragma_allow_expansion.
6783 (_cpp_push_token_context): Declare.
6784 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
6785 a token. Update the line number correctly if so.
6786 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
6787 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
6788 * include/cpplib.h (PRAGMA_EOL): New.
6789 (CPP_TOKEN_FLD_PRAGMA): New.
6790 (struct cpp_token): Add val.pragma.
6791 (struct cpp_options): Remove defer_pragmas.
6792 (cpp_handle_deferred_pragma): Remove.
6793 (cpp_register_deferred_pragma): Declare.
6794
d09e893f
JJ
67952006-01-01 Jakub Jelinek <jakub@redhat.com>
6796
6797 PR c++/25294
6798 * directives.c (do_pragma): If pragma line ends with multi-line
6799 block comment, end the saved deferred pragma string before that
6800 comment. Handle embedded '\0' chars on the pragma line.
6801
ab84748a
VR
68022005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
6803
6804 PR c++/23333
6805 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
6806
ad6ed77e
JG
68072005-12-07 Jon Grimm <jgrimm2@us.ibm.com>
6808 Ben Elliston <bje@au.ibm.com>
6809
6810 * include/cpplib.h (CPP_N_DFLOAT): New.
6811 * expr.c (interpret_float_suffix): Identify df, dd, and dl
6812 suffixes as decimal floating point constants.
6813 (cpp_classify_number): Disallow hexadecimal DFP constants.
6814
ba096620 68152005-11-14 Gerald Pfeifer <gerald@pfeifer.com>
bc4071dd 6816 Ian Lance Taylor <ian@airs.com>
ba096620
GP
6817
6818 * include/cpplib.h (struct cpp_callbacks): Annotate error with
6819 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
6820
456b8ce5
UB
68212005-11-09 Per Bothner <per@bothner.com>
6822 Uros Bizjak <uros@kss-loka.si>
f7288899 6823
456b8ce5
UB
6824 PR c/24101
6825 * init.c (read_original_filename): Temporarily set
6826 state.in_directive before calling _cpp_lex_direct for
6827 CPP_HASH tokens.
6828
5571f74f
JW
68292005-11-03 James E Wilson <wilson@specifix.com>
6830
6831 PR preprocessor/24202
6832 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
6833
a63607ed
JM
68342005-11-04 Joseph S. Myers <joseph@codesourcery.com>
6835
6836 * include/cpplib.h (struct cpp_callbacks): Make error take
6837 va_list* parameter.
6838 * errors.c (cpp_error): Update call to callback.
6839
651ed942
AP
68402005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
6841
6842 PR preprocessor/22042
6843 * macro.c (_cpp_builtin_macro_text): Lower the needed max
6844 buffer size.
6845 (cpp_quote_string): Don't octalify non printable
6846 charactors.
6847
178b58b5
JM
68482005-11-03 Joseph S. Myers <joseph@codesourcery.com>
6849
6850 PR c++/17964
6851 * include/cpplib.h (struct cpp_options): Add client_diagnostic.
6852 (struct cpp_callbacks): Add error.
6853 * errors.c (cpp_error): If client_diagnostic, use error callback.
6854 * charset.c (convert_escape): Don't use %03o in diagnostic.
6855
3ee5ed11 68562005-10-21 James E Wilson <wilson@specifix.com>
6568f34b
JW
6857
6858 PR preprocessor/15220
6859 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all
6860 callers. Pass to open_file_failed.
6861 (open_file_failed): New parameter angle_brackets. Fix all callers.
6862 Use in print_dep assignment.
6863 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
6864 * internal.h (_cpp_find_file): Add new parm to declaration.
f7288899 6865
077fc835
KH
68662005-10-08 Kazu Hirata <kazu@codesourcery.com>
6867
6868 * configure.ac: Require 64-bit int for arm*-*-*eabi*.
6869 * configure: Regenerate.
6870
cbc43ae0
ILT
68712005-10-04 Ian Lance Taylor <ian@airs.com>
6872
6873 PR preprocessor/13726
6874 * directives.c (check_eol_return_comments): New static function.
6875 (parse_include): Add buf parameter. Change all callers.
6876 (do_include_common): If not discard comments, turn on
6877 save_comments. Pass collected comments to include callback.
6878 * include/cpplib.h (struct cpp_callbacks): Add new parameter to
6879 include callback: cpp_token list.
6880
af15a2fe
JM
68812005-09-20 Joseph S. Myers <joseph@codesourcery.com>
6882
6883 * include/cpplib.h (struct cpp_options): Add extended_identifiers.
6884 * init.c (struct lang_flags, lang_defaults): Add
6885 extended_identifiers.
6886 (cpp_set_lang): Use it.
6887 * lex.c (forms_identifier_p): Check extended_identifiers.
6888
f5eab47e
JJ
68892005-08-30 Jakub Jelinek <jakub@redhat.com>
6890
6891 PR preprocessor/20348
6892 PR preprocessor/20356
6893 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
6894 2004-06-05 changes.
6895
467129e6
KG
68962005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6897
6898 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
6899 -Wmissing-format-attribute.
6900
6901 * configure: Regenerate.
6902
200031d1
KC
69032005-06-29 Kelley Cook <kcook@gcc.gnu.org>
6904
6905 * all files: Update FSF address in copyright headers.
6906 * makeucnid.c (write_copyright): Update outputted FSF address.
6907
f610dd5f
ZW
69082005-06-13 Zack Weinberg <zack@codesourcery.com>
6909
6910 * configure.ac: Invoke ZW_CREATE_DEPDIR and
6911 ZW_PROG_COMPILER_DEPENDENCIES.
6912 * aclocal.m4, configure: Regenerate.
6913 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
6914 New variables.
6915 (distclean): Clean up $(DEPDIR) and its contents.
6916 (.c.o): Use $(COMPILE).
6917 Include $(DEPDIR)/*.Po for most object->header dependencies.
6918
c3f829c1
GDR
69192005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
6920
6921 * configure.ac: Check declarations for asprintf and vasprintf.
6922 * config.in: Regenerate.
6923 * configure: Likewise.
6924
6925 * charset.c (conversion_loop): Use XRESIZEVEC.
6926 (convert_no_conversion): Likewise.
6927 (convert_using_iconv): Likewise.
6928 (init_iconv_desc): Cast return value of alloca.
6929 (cpp_host_to_exec_charset): Use XNEWVEC.
6930 (emit_numeric_escape): Use XRESIZEVEC.
6931 (cpp_interpret_string): Use XNEWVEC.
6932 (cpp_interpret_string): Use XRESIZEVEC.
6933 (_cpp_interpret_identifier): Cast return value of alloca.
6934 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
6935 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
6936 (parse_include): Use XNEWVEC.
6937 (insert_pragma_entry): Rename local variable "new" to
f610dd5f 6938 "new_entry".
c3f829c1
GDR
6939 (save_registered_pragmas): Cast return value of xmemdup.
6940 (destringize_and_run): Same for alloca.
6941 (parse_assertion): Likewise.
6942 (do_assert): Cast allocated storage to proper type.
6943 (cpp_define): Likewise.
6944 (_cpp_define_builtin): Likewise.
6945 (cpp_undef): Likewise.
6946 (handle_assertion): Likewise.
6947 (cpp_push_buffer): Rename local variable "new" to "new_buffer".
6948 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
6949 (CPP_UMINUS): Likewise.
6950 (struct cpp_operator): Rename from struct operator.
6951 (_cpp_expand_op_stack): Use XRESIZEVEC.
6952 * files.c (pch_open_file): Use XNEWVEC.
6953 (pch_open_file): Use XRESIZEVEC.
6954 (read_file_guts): Use XNEWVEC and XRESIZEVEC.
6955 (dir_name_of_file): Use XNEWVEC.
6956 (make_cpp_file): Use XCNEW.
6957 (make_cpp_dir): Likewise.
6958 (allocate_file_hash_entries): USE XNEWVEC.
6959 (cpp_included): Cast return value of htab_find_with_hash.
6960 (append_file_to_dir): Use XNEWVEC.
6961 (read_filename_string): Likewise. Use XRESIZEVEC too.
6962 (read_name_map): Cast return value of alloca. Use XRESIZEVEC.
6963 (remap_filename): Use XNEWVEC.
6964 (struct pchf_entry): Move definition out of struct pchf_data.
6965 (_cpp_save_file_entries): Use XCNEWVAR.
6966 (_cpp_read_file_entries): Use XNEWVAR.
6967 * identifiers.c (alloc_node): Use XOBNEW.
6968 * init.c (cpp_create_reader): Use XCNEW.
6969 (cpp_init_builtins): Cast of b->value to enum builtin_type.
6970 (read_original_directory): Cast return value of alloca.
6971 * lex.c (add_line_note): Use XRESIZEVEC.
6972 (warn_about_normalization): Use XNEWVEC.
6973 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
6974 (new_buff): Use XNEWVEC.
6975 * line-map.c (linemap_add): Use XRESIZEVEC.
6976 * macro.c (builtin_macro): Cast return value of alloca.
6977 (paste_tokens): Likewise.
6978 (expand_arg): Use XNEWVEC and XRESIZEVEC.
6979 (_cpp_save_parameter): Use XRESIZEVEC.
6980 (create_iso_definition): Cast allocated storage to proper type.
6981 (_cpp_create_definition): Likewise.
6982 (cpp_macro_definition): Use XRESIZEVEC.
6983 * makedepend.c (add_clm): Use XNEW.
6984 (add_dir): Likewise.
6985 * mkdeps.c (munge): Use XNEWVEC.
6986 (deps_init): Use XCNEW.
6987 (deps_add_target): Use XRESIZEVEC.
6988 (deps_add_default_target): Cast return value of alloca.
6989 (deps_add_dep): Use XRESIZEVEC.
6990 (deps_add_vpath): Likewise. Use XNEWVEC too.
6991 (deps_restore): Likewise.
6992 * pch.c (save_idents): Use XNEW and XNEWVEC.
6993 (cpp_save_state): Use XNEW.
6994 (count_defs): Cast return value of htab_find.
6995 (write_defs): Likewise.
6996 (cpp_write_pch_deps): Use XNEWVEC.
6997 (collect_ht_nodes): Use XRESIZEVEC.
6998 (cpp_valid_state): Use XNEWVEC.
6999 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup.
7000 * symtab.c (ht_create): Use XCNEW.
7001 (ht_lookup_with_hash): Cast return value of obstack_copy0.
7002 (ht_expand): Use XCNEWVEC.
7003 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
7004 (bool): Do not define if __cplusplus.
7005
1ed17cd5
ZW
70062005-05-12 Zack Weinberg <zack@codesourcery.com>
7007
7008 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
7009 (do_sccs): Delete function definition, #define to do_ident.
7010 (do_ident): Don't hardwire directive name.
7011
5a8c20ce
RK
70122005-05-12 Ryota Kunisawa <kunisawa@access.co.jp>
7013
7014 PR bootstrap/21230
7015 * configure: Regenerate.
7016
473c5bc9
AP
70172005-04-27 Andris Pavenis <pavenis@latnet.lv>
7018
7019 * files.c: Include io.h for DJGPP to get prototype of setmode.
7020
c1fc5047
PB
70212005-04-19 Per Bothner <per@bothner.com>
7022
7023 PR preprocessor/20907
7024 * line-map.c (linemap_line_start): Fix bug when we need to increse
7025 column_bits but can re-use the current line_map.
7026
042630ad
KG
70272005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7028
7029 * system.h (fopen, fdopen, freopen): Define these to the unlocked
7030 libiberty functions.
7031
0d667716
KG
70322005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7033
7034 * configure.ac (libcpp_UNLOCKED_FUNCS): New.
7035 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
7036 * system.h (putchar, getc, getchar, clearerr, feof, fileno,
7037 fflush, fgetc, fgets, ferror, fread): Redefine to the associated
7038 _unlocked function.
7039 (fwrite_unlocked): Fix prototype.
1ed17cd5 7040
0d667716
KG
7041 * configure, config.in: Regenerate.
7042
cae064e7
JJ
70432005-04-05 Jakub Jelinek <jakub@redhat.com>
7044
7045 PR preprocessor/19475
7046 * macro.c (create_iso_definition): For < ISO C99, don't
7047 pedwarn if there is no whitespace between macro name and its
7048 replacement, but the replacement starts with a basic character
7049 set character.
7050
cbada204
AJ
70512005-03-28 Andreas Jaeger <aj@suse.de>
7052
7053 * lex.c (warn_about_normalization): Cast field width to int to
7054 avoid warning.
7055
f42eccdb
JM
70562005-03-19 Joseph S. Myers <joseph@codesourcery.com>
7057
7058 * configure.ac: Consistently use solaris2.1[0-9]* instead of
7059 solaris2.1[0-9].
7060 * configure: Regenerate.
7061
c79e602b
GK
70622005-03-15 Geoffrey Keating <geoffk@apple.com>
7063
7064 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
7065 UCN rather than printing an error.
7066
50668cf6
GK
70672005-03-14 Geoffrey Keating <geoffk@apple.com>
7068
6baba9bb
GK
7069 * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
7070
70712005-03-14 Geoffrey Keating <geoffk@apple.com>
1ed17cd5 7072
50668cf6
GK
7073 * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
7074 * charset.c: Update for new format of ucnid.h.
7075 (ucn_valid_in_identifier): Update for new format of ucnid.h.
7076 Add NST parameter, and update it; update callers.
7077 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort
7078 with cpp_error.
7079 (convert_ucn): Pass normalize_state to cpp_valid_ucn.
7080 * internal.h (struct normalize_state): New.
7081 (INITIAL_NORMALIZE_STATE): New.
7082 (NORMALIZE_STATE_RESULT): New.
7083 (NORMALIZE_STATE_UPDATE_IDNUM): New.
7084 (_cpp_valid_ucn): New.
7085 * lex.c (warn_about_normalization): New.
7086 (forms_identifier_p): Add normalize_state parameter, update callers.
7087 (lex_identifier): Add normalize_state parameter, update callers. Keep
7088 the state current.
7089 (lex_number): Likewise.
7090 (_cpp_lex_direct): Pass normalize_state to subroutines. Check
7091 it with warn_about_normalization.
7092 * makeucnid.c: New.
7093 * ucnid.h: Replace.
7094 * ucnid.pl: Remove.
7095 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove
7096 comments about obsolete version of C++.
7097 * include/cpplib.h (enum cpp_normalize_level): New.
7098 (struct cpp_options): Add warn_normalize field.
7099
47e20491
GK
71002005-03-11 Geoffrey Keating <geoffk@apple.com>
7101
7102 * directives.c (glue_header_name): Update call to cpp_spell_token.
7103 * internal.h (_cpp_interpret_identifier): New.
7104 * charset.c (_cpp_interpret_identifier): New.
7105 (_cpp_valid_ucn): Allow UCN version of '$'.
7106 * lex.c (lex_identifier): Add extra parameter to indicate if initial
7107 character was '$' or '\'. Support identifiers with UCNs.
7108 (forms_identifier_p): Allow UCNs.
7109 (_cpp_lex_direct): Pass extra parameter to lex_identifier.
7110 (utf8_to_ucn): New.
7111 (cpp_spell_token): Add FORSTRING parameter. Use it.
7112 (cpp_token_as_text): Update call to cpp_spell_token.
7113 (cpp_output_token): Write UCNs back out.
7114 (stringify_arg): Update call to cpp_spell_token.
7115 (paste_tokens): Likewise.
7116 (cpp_macro_definition): Likewise.
7117 * macro.c (stringify_arg): Likewise.
7118 (paste_tokens): Likewise.
7119 (cpp_macro_definition): Likewise.
7120 * include/cpplib.h: Add parameter to cpp_spell_token.
7121
73096711
JJ
71222005-03-04 Jakub Jelinek <jakub@redhat.com>
7123
7124 PR bootstrap/20282
7125 PR bootstrap/20305
7126 * macro.c (replace_args, cpp_get_token): Copy whole
7127 cpp_token_u instead of just cpp_string field from it.
7128
2203a881
DP
71292005-02-28 Devang Patel <dpatel@apple.com>
7130
7131 * directives.c (do_line): Save sysp early before line table is
7132 realloc'ed.
1ed17cd5 7133
c5ff069d
ZW
71342005-02-20 Zack Weinberg <zack@codesourcery.com>
7135
7136 PR 18785
7137 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
7138 (cpp_host_to_exec_charset): New function.
7139 * include/cpplib.h: Declare cpp_host_to_exec_charset.
7140
04c90eea
DP
71412005-02-19 Devang Patel <dpatel@apple.com>
7142
7143 * charset.c (_cpp_convert_input): Check '\r' before inserting
7144 '\n' at the end.
c5ff069d 7145
6da55c00
EC
71462005-02-15 Eric Christopher <echristo@redhat.com>
7147
7148 PR preprocessor/19077
7149 * macro.c (cpp_macro_definition): Move handling of whitespace
7150 to PREV_WHITE conditional. Remove overloading of len
7151 variable.
7152
31c3e631
KH
71532005-02-14 Kazu Hirata <kazu@cs.umass.edu>
7154
7155 * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
7156 traditional.c: Update copyright.
7157
be0f1e54
PB
71582005-02-14 Paolo Bonzini <bonzini@gnu.org>
7159
7160 PR bootstrap/19818
7161 * configure.ac: Check for declaration of basename and getopt.
7162 * config.in: Regenerate.
7163 * configure: Regenerate.
7164 * internal.h (ustrcspn): New.
7165 * macro.c (create_iso_definition): Fix allocation of memory.
7166 (padding_token): Add cast to remove const-ness.
7167 * pch.c (cpp_read_state): Use ustrcspn.
7168
ecddfb39
MS
71692005-02-08 Mike Stump <mrs@apple.com>
7170
7171 * files.c (pchf_adder): Remove.
7172 (struct pchf_adder_info): Likewise.
7173 (_cpp_save_file_entries): Write out all files so that #import works.
7174
9fcdd891
JM
71752005-01-23 Joseph S. Myers <joseph@codesourcery.com>
7176
7177 * configure: Regenerate.
7178
ecfd72e7
TS
71792005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
7180
7181 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
7182
6c25a4f7 7183 * include/cpplib.h: Also update copyright years.
c5ff069d 7184
942926ad
GK
71852005-01-03 Geoffrey Keating <geoffk@apple.com>
7186
7187 * files.c (_cpp_find_file): Add files found by search_path_exhausted
7188 to the list of all files.
7189
a2566ae9
GDR
71902005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
7191
7192 * internal.h: Update references to Cpp lib filenames.
7193 * directives.c: Likewise.
7194 * init.c: Likewise.
7195 * macro.c: Likewise.
7196 * traditional.c: Likewise.
7197
1b449375
EB
71982004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
7199
7200 PR preprocessor/15167
7201 * files.c (destroy_cpp_file): New function.
7202 (should_stack_file): Make a new file if the
7203 compared file is still stacked.
7204
28303828
NN
72052004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
7206
c5ff069d 7207 PR preprocessor/17610
28303828
NN
7208 * directives.c (do_include_common): Error out if an empty filename
7209 is given for #include (or #include_next or #import).
7210
c812785a
RS
72112004-11-27 Roger Sayle <roger@eyesopen.com>
7212 Zack Weinberg <zack@codesourcery.com>
7213
7214 * internal.h: Replace all uses of uchar with unsigned char.
7215 * include/cpp-id-data.h: Likewise. Guard typedef of uchar
7216 with !IN_GCC, so uchar is only defined whilst building libcpp.
7217
f91eaa01
KC
72182004-11-24 Kelley Cook <kcook@gcc.gnu.org>
7219
7220 * aclocal.m4: Regenerate.
7221
f78ce0c2
RS
72222004-11-24 Roger Sayle <roger@eyesopen.com>
7223
7224 PR preprocessor/15824
7225 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
7226 directly, instead of the non-existant "system.h" and "ansidecl.h".
7227 * configure: Regenerate.
7228
b5b3e36a 72292004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
c5ff069d 7230 Joseph Myers <joseph@codesourcery.com>
b5b3e36a
DJ
7231
7232 * internal.h (struct lexer_state): Add in_deferred_pragma.
7233 * directives.c (struct pragma_entry): Add allow_expansion.
7234 (insert_pragma_entry): Take allow_expansion flag.
7235 (register_pragma): Likewise.
7236 (cpp_register_pragma): Likewise.
7237 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
7238 (do_pragma): Honor allow_expansion.
7239 (cpp_handle_deferred_pragma): Set in_deferred_pragma.
7240 * include/cpplib.h (cpp_register_pragma): Update prototype.
7241
a8e68029 72422004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
c5ff069d 7243 Mark Mitchell <mark@codesourcery.com>
a8e68029
DJ
7244
7245 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
7246 need_64bit_hwint=yes.
7247 * configure: Regenerate.
7248
50f47ee0
JM
72492004-11-09 Joseph S. Myers <joseph@codesourcery.com>
7250
7251 * Makefile.in ($(PACKAGE).pot): New rule. Depend on
7252 po/$(PACKAGE).pot.
7253 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
7254 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
7255 Remove local srcdir path from generated file.
7256
968e08d6 72572004-11-04 Zack Weinberg <zack@codesourcery.com>
c5ff069d 7258 Gerald Pfeifer <gerald@pfeifer.com>
968e08d6
ZW
7259
7260 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
7261 as well.
7262
3da3d587
ZW
72632004-10-27 Zack Weinberg <zack@codesourcery.com>
7264
7265 PR 18075
7266 * directives.c (do_pragma): Do not defer pragmas which are unknown.
7267 (cpp_handle_deferred_pragma): Add cast to silence warning.
7268
ac24fc25
JM
72692004-10-14 Joseph S. Myers <jsm@polyomino.org.uk>
7270
7271 * errors.c (_cpp_begin_message): Print "error: " for errors.
7272
7731405b
AJ
72732004-10-10 Andreas Jaeger <aj@suse.de>
7274
7275 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
7276 * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
7277
646544e3
AP
72782004-10-08 Andrew Pinski <pinskia@physics.uc.edu>
7279
7280 * pch.c (cpp_write_pch_state): Remove variable z as it is not
7281 used.
7282 (cpp_read_state): Remove unused variables, m, d and mac_count.
7283
67a74146
PB
72842004-09-29 Per Bothner <per@bothner.com>
7285
7286 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore
7287 cb.line_change. Otherwise do_pragma will call the line_change
7288 call-back with a meaningless line number.
7289
018a4785
ZW
72902004-09-24 Zack Weinberg <zack@codesourcery.com>
7291
7292 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
7293 programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
7294 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
7295 * aclocal.m4, configure: Regenerate.
7296 * init.c: Include localedir.h.
7297 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
7298 (DEFS): Delete.
7299 (.c.o): Use $(ALL_CFLAGS).
7300 (localedir.h, localedir.hs): New rules.
7301 (clean): Use rm -rf to remove directories.
7302 (distclean): Also delete localedir.h and localedir.hs.
7303 (init.o): Update dependencies.
7304
88fa57d7
KC
73052004-09-22 Kelley Cook <kcook@gcc.gnu.org>
7306
7307 * Makefile.in (aclocal.m4): Update dependencies.
7308 * configure.ac (AC_CONFIG_MACRO_DIR): New.
7309 * aclocal.m4, configure: Regenerate.
7310
8f8e9aa5
ZW
73112004-09-17 Zack Weinberg <zack@codesourcery.com>
7312
a29f62d9
ZW
7313 * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
7314 (_cpp_convert_input, _cpp_default_encoding): Add comments.
7315 Some other comments in this file also tweaked.
7316
8f8e9aa5
ZW
7317 * directives.c (do_pragma): Save current buffer position
7318 before lexing the pragma keywords; don't call
7319 _cpp_backup_tokens in the defer_pragmas case.
7320
a2981930
PB
73212004-09-15 Per Bothner <per@bothner.com>
7322
7323 * include/line-map.h (line_map_start): Add parameter names so
7324 preceding comment makes sense.
7325 (linemap_add): Remove from comment mention of non-existing parameter.
7326
21b11495
ZW
73272004-09-09 Matt Austern <austern@apple.com>
7328 Zack Weinberg <zack@codesourcery.com>
7329
7330 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
7331 prefixes throughout. Add entry for PRAGMA. Remove
7332 unnecessary "= 0" from EQ.
7333 (enum cpp_ttype): Adjust OP and TK definitions to restore
7334 prefixes, via token-paste.
7335 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
7336 Change from #defines to additional cpp_ttype enumerators.
7337 (struct cpp_options): Add defer_pragmas.
7338 (cpp_handle_deferred_pragma): Prototype new interface.
7339
7340 * internal.h (struct cpp_reader): Add directive_result.
7341 * directives.c (struct pragma_entry): Add is_internal field;
7342 give boolean fields type bool.
7343 (start_directive): Initialize pfile->directive_result.type.
7344 (_cpp_do__Pragma): Likewise.
7345 (run_directive): Do not crash if pfile->buffer->prev is NULL.
7346 (insert_pragma_entry): Add 'internal' argument; set new->is_internal
7347 from it.
7348 (register_pragma): New static function, bulk of former
7349 cpp_register_pragma here; add 'internal' argument, pass along
7350 to insert_pragma_entry.
7351 (cpp_register_pragma): Now a wrapper around register_pragma which
7352 always passes false for 'internal' argument.
7353 (_cpp_init_internal_pragmas): Call register_pragma directly, passing
7354 true for 'internal'.
7355 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
7356 an internal pragma, save text till the end of the line as a CPP_PRAGMA
7357 token instead of executing the pragma.
7358 (cpp_handle_deferred_pragma): New interface.
7359 * lex.c (token_spellings): Adjust OP and TK definitions to
7360 match changes to cpplib.h.
7361 (_cpp_lex_token): Check for a directive-result token and
7362 return it if present.
7363 (cpp_token_val_index): Handle CPP_PRAGMA.
7364 * macro.c (cpp_builtin_macro_text): Correct comment.
7365 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
7366
0fd9e8dd
SB
73672004-09-06 Serge Belyshev <belyshev@lubercy.com>
7368
7369 PR preprocessor/14699
7370 * symtab.c (ht_dump_statistics): Change type of sum_of_squares
7371 from size_t to double.
7372
39b8ce7f
AS
73732004-08-28 Andreas Schwab <schwab@suse.de>
7374 Andreas Jaeger <aj@suse.de>
7375
7376 * configure.ac: Set PACKAGE correctly.
7377 * configure: Regenerated.
7378
5d1f4b27
PB
73792004-08-25 Paolo Bonzini <bonzini@gnu.org>
7380
7381 * Makefile.in: Add back top_builddir.
7382
078e3ffe
PB
73832004-08-25 Paolo Bonzini <bonzini@gnu.org>
7384
7385 * configure.ac: Replace Automake macro invocations
7386 with manual Autoconf checks and substitutions.
7387 * configure: Regenerate.
7388 * aclocal.m4: Regenerate.
7389 * config.in: Regenerate.
7390 * Makefile.am: Removed.
7391 * Makefile.in: Heavy simplification and reorganization.
7392
b3f8d95d
MM
73932004-08-09 Mark Mitchell <mark@codesourcery.com>
7394
7395 * configure.ac (arm*-*-eabi*): New target.
7396 (arm*-*-symbianelf*): Likewise.
7397 * configure: Regenerated.
7398
72bb2c39
BI
73992004-07-24 Bernardo Innocenti <bernie@develer.com>
7400
7401 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
7402 * directives.c: Use XNEW-family macros from libiberty.
7403 * lex.c: Likewise.
7404 * macro.c: Likewise.
7405 * cpplib.h (cpp_deps_style): Export enum with name.
7406
21b11495 74072004-07-23 Matthias Klose <doko@debian.org>
72bb2c39 7408
21b11495 7409 * init.c (init_library): Use PACKAGE for the text domain.
85eac2a0 7410
a23ee064
AP
74112004-07-16 Andris Pavenis <pavenis@latnet.lv>
7412
7413 PR preprocessor/16366
7414 * internal.h (struct cpp_reader): New field dir_hash.
7415 * files.c (make_cpp_dir): Use dir_hash, not file_hash.
7416 (_cpp_init_files, _cpp_cleanup_files): Update for new field.
7417
a09d4744
NB
74182004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
7419
7420 PR preprocessor/16192
7421 PR preprocessor/15913
7422 PR preprocessor/15572
7423 * expr.c (_cpp_parse_expr): Handle remaining cases where an
7424 expression is missing.
7425 * init.c (post_options): Traditional cpp doesn't do // comments.
7426
f58f7def
PB
74272004-06-30 Per Bothner <per@bothner.com>
7428
7429 * include/line-map.h (fileline): Remove old typedef.
7430 * internal.h (struct cpp_reader): Use source_location typedef instead.
7431
e83d8d43
ZW
74322004-06-26 Zack Weinberg <zack@codesourcery.com>
7433
7434 Partially revert patch of 2004-06-05.
7435 * files.c (search_cache): Remove pfile argument. Don't check
7436 for file that would be found by "" or <> search here...
7437 (_cpp_find_file): ...do it here, before calling find_file_in_dir.
7438 Do not apply directory-of-current-file correction to files
7439 found by this check. Rearrange code slightly.
7440
c0d578e6
GK
74412004-06-21 Geoffrey Keating <geoffk@apple.com>
7442
7443 * files.c (should_stack_file): Correct swapped parameters to call
7444 to cb.read_pch.
7445 * pch.c (cpp_valid_state): Handle -fpreprocessed.
7446
159d5224
PB
74472004-06-15 Paolo Bonzini <bonzini@gnu.org>
7448
7449 * Makefile.in: Regenerate with automake 1.8.5.
7450 * aclocal.m4: Likewise.
7451 * configure: Regenerate.
7452
2fac9c01
ZW
74532004-06-11 Zack Weinberg <zack@codesourcery.com>
7454
7455 * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
7456 * configure, config.in: Regenerate.
7457 * system.h: Unconditionally define bool as unsigned char,
7458 BOOL_BITFIELD as unsigned int.
7459 * .cvsignore: New file.
7460
d8044160
GK
74612004-06-09 Geoffrey Keating <geoffk@apple.com>
7462
7463 * traditional.c (push_replacement_text): Set macro->traditional.
7464 (save_replacement_text): Likewise.
7465 * pch.c (cpp_write_pch_state): Don't write list of defined macros.
7466 (struct save_macro_item): Delete.
7467 (struct save_macro_data): Use a character array not the previous
7468 structured format.
7469 (save_macros): Save macro as text not as internal structures.
7470 (cpp_prepare_state): Update for changes to save_macro_data.
7471 (cpp_read_state): Don't read macros defined in PCH. Restore
2cf22451 7472 -D macros as text.
d8044160
GK
7473 * macro.c (create_iso_definition): Honour alloc_subobject.
7474 Clear traditional flag.
7475 (_cpp_create_definition): Honour alloc_subobject.
7476 * lex.c (cpp_token_val_index): New.
7477 * internal.h: Include cpp-id-data.h.
7478 (uchar): Move definition to cpp-id-data.h.
7479 (U): Likewise.
7480 (cpp_macro): Likewise.
7481 * directives.c (struct answer): Move to cpp-id-data.h.
7482 (do_assert): Honour alloc_subobject.
2cf22451
ZW
7483
7484 * include/symtab.h (struct ht): Add field 'alloc_subobject'.
7485 * include/cpplib.h (struct cpp_string): Add GTY marker.
7486 (enum cpp_token_fld_kind): New.
7487 (struct cpp_token): Add GTY markers.
7488 (cpp_token_val_index): Prototype.
7489 (CPP_HASHNODE_VALUE_IDX): New.
7490 (struct cpp_hashnode): Don't skip fields of 'value' when marking.
7491 * include/cpp-id-data.h: New file.
d8044160 7492
0ca8e815
PB
74932004-06-09 Paolo Bonzini <bonzini@gnu.org>
7494
7495 * Makefile.am (all-local): New.
7496 * Makefile.in: Regenerate.
7497
b51fa00f
RS
74982004-06-06 Roger Sayle <roger@eyesopen.com>
7499
7500 * Makefile.am (LIBICONV): Declare.
7501 (makedepend_LDADD): Use LIBICONV.
7502 * Makefile.in: Regenerate.
7503
5e2f3f39
AP
75042004-06-05 Andrew Pinski <pinskia@physics.uc.edu>
7505
7506 * Makefile.am (LIBINTL): Declare
7507 (makedepend_LDADD): Use LIBINTL.
7508 * Makefile.in: Regenerate.
7509
c6e83800
ZW
75102004-06-05 Zack Weinberg <zack@codesourcery.com>
7511
7512 * Makefile.am: Add makedepend.
7513 * Makefile.in, aclocal.m4: Regenerate.
7514 * charset.c: Insert a space to avoid a warning.
7515 * directives.c: Include mkdeps.h.
7516 (_cpp_handle_directive): Reenable macro expander if appropriate.
7517 (undefine_macros): Inline body of _cpp_free_definition for speed.
7518 Do not call undef callback or _cpp_warn_if_unused_macro.
7519 (cpp_get_deps): New interface.
7520 * files.c (search_cache): Add pfile argument. Check for file
7521 that would be found by "" or <> search here...
7522 (_cpp_find_file): ...not here. Correct recorded start_dir of
7523 files found by directory-of-current-file search that would be
7524 found by "" or <> search.
7525 * init.c (cpp_add_dependency_target): Delete.
7526 * internal.h (struct lexer_state): Add discarding_output flag.
7527 * lex.c (lex_identifier): Compute hash function while scanning.
7528 * macro.c (cpp_scan_nooutput): Disable macro expansion outside
7529 directives.
7530 * makedepend.c: New file.
7531 * mkdeps.c (struct deps): Add vpath vector.
7532 (apply_vpath, deps_add_vpath): New function.
7533 (deps_free): Free vpath vector.
7534 (deps_add_dep, deps_add_target): Use apply_vpath.
7535 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
7536 (ht_lookup_with_hash): New function.
7537 * cpplib.h, mkdeps.h: Update prototypes.
7538 * symtab.h: Update prototypes.
7539 (HT_HASHSTEP, HT_FINISH): New macros.
7540
b453c95f
GK
75412004-05-29 Geoffrey Keating <geoffk@apple.com>
7542
7543 * symtab.c (ht_create): Set entries_owned.
7544 (ht_destroy): Honour entries_owned.
7545 (ht_expand): Likewise.
7546 (ht_load): New.
2cf22451
ZW
7547 * include/symtab.h (struct ht): New field 'entries_owned'
7548 (ht_load): New prototype.
b453c95f 7549
963e23c5
PB
75502004-05-26 Paolo Bonzini <bonzini@gnu.org>
7551
7552 PR bootstrap/15651
7553 * configure.ac: Fix m4 quoting when picking
7554 the size of HOST_WIDE_INT.
7555 * configure: Regenerate.
7556
0429bc77
PB
75572004-05-25 Paolo Bonzini <bonzini@gnu.org>
7558
7559 * Makefile.am: the correct directory for
7560 gettext include files is given by @INCINTL@.
7561 * Makefile.in: Regenerate.
7562
c86dd7db
PB
75632004-05-24 Paolo Bonzini <bonzini@gnu.org>
7564
7565 * system.h [!ENABLE_NLS]: dgettext takes two
7566 parameters.
7567
4f4e53dd
PB
75682004-05-23 Paolo Bonzini <bonzini@gnu.org>
7569
7570 Moved libcpp from the gcc subdirectory to the toplevel.
7571 * Makefile.am: New file.
7572 * Makefile.in: Regenerate.
7573 * configure.ac: New file.
7574 * configure: Regenerate.
7575 * config.in: Regenerate.
7576 * charset.c: Moved from gcc/cppcharset.c. Add note about
7577 brokenness of input charset detection. Adjust for change
7578 in name of cppucnid.h.
7579 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
7580 * expr.c: Moved from gcc/cppexp.c.
7581 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
7582 Remove #define of O_BINARY, it is in system.h.
7583 * identifiers.c: Moved from gcc/cpphash.c.
7584 * internal.h: Moved from gcc/cpphash.h. Change header
7585 guard name. All other files adjusted to match name change.
7586 * init.c: Moved from gcc/cppinit.c.
7587 (init_library) [ENABLE_NLS]: Call bindtextdomain.
7588 * lex.c: Moved from gcc/cpplex.c.
7589 * directives.c: Moved from gcc/cpplib.c.
7590 * macro.c: Moved from gcc/cppmacro.c.
7591 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
7592 * traditional.c: Moved from gcc/cpptrad.c.
7593 * ucnid.h: Moved from gcc/cppucnid.h. Change header
7594 guard name.
7595 * ucnid.pl: Moved from gcc/cppucnid.pl.
7596 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header
7597 guard name.
7598 * symtab.c: Moved from gcc/hashtable.c.
7599 * line-map.c: Moved from gcc. Do not include intl.h.
7600 * mkdeps.c: Moved from gcc.
7601 * system.h: New file.
2cf22451
ZW
7602 * include/cpplib.h: Moved from gcc. Change header guard name.
7603 * include/line-map.h: Moved from gcc. Change header guard name.
7604 * include/mkdeps.h: Moved from gcc. Change header guard name.
7605 * include/symtab.h: Moved from gcc/hashtable.h. Change header
7606 guard name.
818ab71a 7607\f
68127a8e 7608Copyright (C) 2004-2023 Free Software Foundation, Inc.
818ab71a
JJ
7609
7610Copying and distribution of this file, with or without modification,
7611are permitted in any medium without royalty provided the copyright
7612notice and this notice are preserved.