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