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