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