1 2021-11-01 David Malcolm <dmalcolm@redhat.com>
3 * charset.c (convert_escape): Use encoding_rich_location when
4 complaining about nonprintable unknown escape sequences.
5 (cpp_display_width_computation::::cpp_display_width_computation):
6 Pass in policy rather than tabstop.
7 (cpp_display_width_computation::process_next_codepoint): Add "out"
8 param and populate *out if non-NULL.
9 (cpp_display_width_computation::advance_display_cols): Pass NULL
10 to process_next_codepoint.
11 (cpp_byte_column_to_display_column): Pass in policy rather than
12 tabstop. Pass NULL to process_next_codepoint.
13 (cpp_display_column_to_byte_column): Pass in policy rather than
15 * errors.c (cpp_diagnostic_get_current_location): New function,
16 splitting out the logic from...
17 (cpp_diagnostic): ...here.
18 (cpp_warning_at): New function.
19 (cpp_pedwarning_at): New function.
20 * include/cpplib.h (cpp_warning_at): New decl for rich_location.
21 (cpp_pedwarning_at): Likewise.
22 (struct cpp_decoded_char): New.
23 (struct cpp_char_column_policy): New.
24 (cpp_display_width_computation::cpp_display_width_computation):
25 Replace "tabstop" param with "policy".
26 (cpp_display_width_computation::process_next_codepoint): Add "out"
28 (cpp_display_width_computation::m_tabstop): Replace with...
29 (cpp_display_width_computation::m_policy): ...this.
30 (cpp_byte_column_to_display_column): Replace "tabstop" param with
32 (cpp_display_width): Likewise.
33 (cpp_display_column_to_byte_column): Likewise.
34 * include/line-map.h (rich_location::escape_on_output_p): New.
35 (rich_location::set_escape_on_output): New.
36 (rich_location::m_escape_on_output): New.
37 * internal.h (cpp_diagnostic_get_current_location): New decl.
38 (class encoding_rich_location): New.
39 * lex.c (skip_whitespace): Use encoding_rich_location when
40 complaining about null characters.
41 (warn_about_normalization): Generate a source range when
42 complaining about improperly normalized tokens, rather than just a
43 point, and use encoding_rich_location so that the source code
44 is escaped on printing.
45 * line-map.c (rich_location::rich_location): Initialize
48 2021-10-29 Tobias Burnus <tobias@codesourcery.com>
51 * directives.c (destringize_and_run): Add PRAGMA_OP to the
52 CPP_PRAGMA token's flags to mark is as coming from _Pragma.
53 * include/cpplib.h (PRAGMA_OP): #define, to be used with token flags.
54 * macro.c (collect_args): Only handle CPP_PRAGMA special if PRAGMA_OP
57 2021-10-22 Eric Gallager <egallager@gcc.gnu.org>
60 * Makefile.in: Add dummy install-dvi target.
62 2021-10-18 Martin Liska <mliska@suse.cz>
64 * charset.c (convert_oct): Remove unused but set variable.
66 2021-10-06 Jakub Jelinek <jakub@redhat.com>
68 * init.c (lang_defaults): Implement P2334R1, enable elifdef for
69 -std=c++23 and -std=gnu++23.
70 * directives.c (_cpp_handle_directive): Support elifdef/elifndef if
71 either CPP_OPTION (pfile, elifdef) or !CPP_OPTION (pfile, std).
72 (do_elif): For older non-std modes if pedantic pedwarn about
73 #elifdef/#elifndef directives that change behavior.
75 2021-09-01 Jakub Jelinek <jakub@redhat.com>
78 * include/cpplib.h (struct cpp_options): Add cxx23_identifiers.
79 * charset.c (CXX23, NXX23): New enumerators.
80 (CID, NFC, NKC, CTX): Renumber.
81 (ucn_valid_in_identifier): Implement P1949R7 - use CXX23 and
82 NXX23 flags for cxx23_identifiers. For start character in
83 non-pedantic mode, allow characters that are allowed as start
84 characters in any of the supported language modes, rather than
85 disallowing characters allowed only as non-start characters in
86 current mode but for characters from other language modes allowing
87 them even if they are never allowed at start.
88 * init.c (struct lang_flags): Add cxx23_identifiers.
89 (lang_defaults): Add cxx23_identifiers column.
90 (cpp_set_lang): Initialize CPP_OPTION (pfile, cxx23_identifiers).
91 * lex.c (warn_about_normalization): If cxx23_identifiers, use
92 cpp_pedwarning_with_line instead of cpp_warning_with_line for
93 "is not in NFC" diagnostics.
94 * makeucnid.c: Adjust usage comment.
95 (CXX23, NXX23): New enumerators.
96 (all_languages): Add CXX23.
97 (not_NFC, not_NFKC, maybe_not_NFC): Renumber.
98 (read_derivedcore): New function.
99 (write_table): Print also CXX23 and NXX23 columns.
100 (main): Require 5 arguments instead of 4, call read_derivedcore.
101 * ucnid.h: Regenerated using Unicode 13.0.0 files.
103 2021-09-01 Jason Merrill <jason@redhat.com>
105 * macro.c (replace_args): When __VA_OPT__ is on the LHS of ##,
106 remove trailing avoid_paste tokens.
108 2021-09-01 Jakub Jelinek <jakub@redhat.com>
110 PR preprocessor/101488
111 * macro.c (replace_args): Fix up handling of CPP_PADDING tokens at the
112 start or end of __VA_OPT__ arguments when preceeded or followed by ##.
114 2021-08-31 Martin Sebor <msebor@redhat.com>
116 * include/line-map.h (class rich_location): Disable copying and
119 2021-08-25 Lewis Hyatt <lhyatt@gmail.com>
122 * charset.c (init_iconv_desc): Adapt to permit PFILE argument to
124 (_cpp_convert_input): Likewise. Also move UTF-8 BOM logic to...
125 (cpp_check_utf8_bom): ...here. New function.
126 (cpp_input_conversion_is_trivial): New function.
127 * files.c (read_file_guts): Allow PFILE argument to be NULL. Add
128 INPUT_CHARSET argument as an alternate source of this information.
129 (read_file): Pass the new argument to read_file_guts.
130 (cpp_get_converted_source): New function.
131 * include/cpplib.h (struct cpp_converted_source): Declare.
132 (cpp_get_converted_source): Declare.
133 (cpp_input_conversion_is_trivial): Declare.
134 (cpp_check_utf8_bom): Declare.
136 2021-08-17 Jakub Jelinek <jakub@redhat.com>
138 * macro.c (vaopt_state): Add m_stringify member.
139 (vaopt_state::vaopt_state): Initialize it.
140 (vaopt_state::update): Overwrite it.
141 (vaopt_state::stringify): New method.
142 (stringify_arg): Replace arg argument with first, count arguments
143 and add va_opt argument. Use first instead of arg->first and
144 count instead of arg->count, for va_opt add paste_tokens handling.
145 (paste_tokens): Fix up len calculation. Don't spell rhs twice,
146 instead use %.*s to supply lhs and rhs spelling lengths. Don't call
147 _cpp_backup_tokens here.
148 (paste_all_tokens): Call it here instead.
149 (replace_args): Adjust stringify_arg caller. For vaopt_state::END
150 if stringify is true handle __VA_OPT__ stringification.
151 (create_iso_definition): Handle # __VA_OPT__ similarly to # macro_arg.
153 2021-08-12 Jakub Jelinek <jakub@redhat.com>
155 PR preprocessor/101638
156 * macro.c (cpp_sys_macro_p): Return true instead of
157 crashing on builtin macros.
159 2021-08-05 Jakub Jelinek <jakub@redhat.com>
162 * ucnid.h: Regenerated using Unicode 13.0.0 files.
164 2021-08-05 Jakub Jelinek <jakub@redhat.com>
167 * makeucnid.c (write_table): Fix computation of last_combine.
168 * ucnid.h: Regenerated using Unicode 6.3.0 files.
170 2021-06-16 Jason Merrill <jason@redhat.com>
173 PR preprocessor/96391
174 * line-map.c (linemap_compare_locations): Only use comparison with
175 LINE_MAP_MAX_LOCATION_WITH_COLS to avoid abort.
177 2021-05-20 Christophe Lyon <christophe.lyon@linaro.org>
178 Torbjörn Svensson <torbjorn.svensson@st.com>
181 * include/cpplib.h (cpp_builtin_type): Add BT_FILE_NAME entry.
182 * init.c (builtin_array): Likewise.
183 * macro.c (_cpp_builtin_macro_text): Add support for BT_FILE_NAME.
185 2021-05-20 Jakub Jelinek <jakub@redhat.com>
187 PR preprocessor/100646
188 * lex.c (cpp_directive_only_process): Treat end of file as termination
189 for !is_block comments.
191 2021-05-12 Jakub Jelinek <jakub@redhat.com>
193 PR preprocessor/100392
194 * lex.c (cpp_directive_only_process): If buffer doesn't end with '\n',
195 add buffer->rlimit[0] character to the printed range and
196 CPP_INCREMENT_LINE and increment line_count.
198 2021-05-11 Joseph Myers <joseph@codesourcery.com>
200 * include/cpplib.h (struct cpp_options): Add elifdef.
201 * init.c (struct lang_flags): Add elifdef.
202 (lang_defaults): Update to include elifdef initializers.
203 (cpp_set_lang): Set elifdef for pfile based on language.
204 * directives.c (STDC2X, ELIFDEF): New macros.
205 (EXTENSION): Increase value to 3.
206 (DIRECTIVE_TABLE): Add #elifdef and #elifndef.
207 (_cpp_handle_directive): Do not treat ELIFDEF directives as
208 directives for language versions without the #elifdef feature.
209 (do_elif): Handle #elifdef and #elifndef.
210 (do_elifdef, do_elifndef): New functions.
212 2021-05-11 Joseph Myers <joseph@codesourcery.com>
214 * lex.c (cpp_avoid_paste): Do not allow pasting CPP_NUMBER with
217 2021-05-11 Joseph Myers <joseph@codesourcery.com>
219 * init.c (lang_defaults): Enable digit separators for GNUC2X and
222 2021-05-07 Jakub Jelinek <jakub@redhat.com>
225 * lex.c (cpp_avoid_paste): Handle token1 CPP_PRAGMA like CPP_NAME.
227 2021-05-06 Joseph Myers <joseph@codesourcery.com>
230 PR preprocessor/97604
231 * lex.c (lex_number): Reject adjacent digit separators here. Do
232 not allow digit separators before '.' or an exponent with sign.
233 * expr.c (cpp_classify_number): Do not check for adjacent digit
236 2021-05-03 H.J. Lu <hjl.tools@gmail.com>
239 * configure: Regenerated.
241 2021-04-29 Joseph Myers <joseph@codesourcery.com>
243 PR preprocessor/82359
244 * directives.c (strtolinenum): Handle digit separators.
246 2021-04-19 Richard Biener <rguenther@suse.de>
248 PR preprocessor/100142
249 * line-map.c (linemap_position_for_loc_and_offset): Revert
250 unintended s/column_offset/column/ change.
252 2021-04-13 Nathan Sidwell <nathan@acm.org>
254 PR preprocessor/99446
255 * line-map.c (line-map.c): Do not advance to linemaps for
258 2021-04-13 Eric Botcazou <ebotcazou@adacore.com>
260 * include/line-map.h (IS_MACRO_LOC): Delete.
261 * line-map.c (linemap_location_from_macro_expansion_p): Test
262 LINEMAPS_MACRO_LOWEST_LOCATION of the linemap.
264 2021-03-02 David Malcolm <dmalcolm@redhat.com>
267 * line-map.c (rich_location::maybe_add_fixit): Reject fix-it hints
270 2021-02-24 Nathan Sidwell <nathan@acm.org>
276 2021-02-24 Nathan Sidwell <nathan@acm.org>
279 * init.c (read_original_filename): Expunge all evidence of the
282 2021-02-18 Nathan Sidwell <nathan@acm.org>
285 * include/cpplib.h (cpp_find_header_unit): Rename to ...
286 (cpp_probe_header_unit): ... this.
287 * internal.h (_cp_find_header_unit): Declare.
288 * files.c (cpp_find_header_unit): Break apart to ..
289 (test_header_unit): ... this, and ...
290 (_cpp_find_header_unit): ... and, or and ...
291 (cpp_probe_header_unit): ... this.
292 * macro.c (cpp_get_token_1): Call _cpp_find_header_unit.
294 2021-02-16 Nathan Sidwell <nathan@acm.org>
296 * files.c (_cpp_stack_file): Make buffers end in unread \n.
298 2021-02-10 David Malcolm <dmalcolm@redhat.com>
300 PR preprocessor/96391
301 * line-map.c (linemap_compare_locations): Require that
302 the location be <= LINE_MAP_MAX_LOCATION_WITH_COLS when
303 treating locations as coming from the same macro expansion.
305 2021-02-04 Jakub Jelinek <jakub@redhat.com>
307 * expr.c (cpp_classify_number): Use make_signed_t<size_t> instead of
308 make_signed<size_t>::type in the diagnostics.
310 2021-02-03 Jakub Jelinek <jakub@redhat.com>
312 PR preprocessor/98882
313 * lex.c (cpp_directive_only_process): Don't assert that rlimit[-1]
314 is a newline, instead assert that rlimit[0] is either newline or
315 carriage return. When seeing '\\' followed by '\r', check limit
316 before accessing pos[1].
318 2021-02-03 Ed Smith-Rowland <3dw4rd@verizon.net>
320 * expr.c (interpret_int_suffix): Detect 'z' integer suffix.
321 (cpp_classify_number): Compat warning for use of 'z' suffix.
322 * include/cpplib.h (struct cpp_options): New flag.
323 (enum cpp_warning_reason): New flag.
324 (CPP_N_USERDEF): Comment C++0x -> C++11.
325 (CPP_N_SIZE_T): New flag for cpp_classify_number.
326 * init.c (cpp_set_lang): Initialize new flag.
328 2021-01-27 liuhongt <hongtao.liu@intel.com>
331 * lex.c (search_line_sse2): Replace builtins with == operator.
333 2021-01-26 Paul Fee <paul.f.fee@gmail.com>
335 * include/cpplib.h (c_lang): Add CXX23 and GNUCXX23.
336 * init.c (lang_defaults): Add rows for CXX23 and GNUCXX23.
337 (cpp_init_builtins): Set __cplusplus to 202100L for C++23.
339 2021-01-15 Nathan Sidwell <nathan@acm.org>
341 PR preprocessor/95253
342 * mkdeps.c (munge): Do not escape ':'.
344 2020-12-14 Nathan Sidwell <nathan@acm.org>
346 * include/cpplib.h (struct cpp_macro): Add imported_p field.
347 (struct cpp_hashnode): Tweak deferred field documentation.
348 * macro.c (_cpp_new_macro): Clear new field.
349 (cpp_get_deferred_macro, get_deferred_or_lazy_macro): Assert
352 2020-12-10 Jason Merrill <jason@redhat.com>
354 * init.c (cpp_init_builtins): Update __cplusplus for C++20.
356 2020-12-01 JeanHeyd Meneide <phdofthehouse@gmail.com>
358 * charset.c (init_iconv_desc): Initialize "to" and "from" fields.
359 * directives.c (cpp_get_narrow_charset_name): New function.
360 (cpp_get_wide_charset_name): Likewise.
361 * include/cpplib.h (cpp_get_narrow_charset_name): Prototype.
362 (cpp_get_wide_charset_name): Likewise.
363 * internal.h (cset_converter): Add "to" and "from" fields.
365 2020-11-27 Joseph Myers <joseph@codesourcery.com>
367 PR preprocessor/97602
368 * directives.c (strtolinenum): Check for overflow before it
369 occurs. Correct comment.
371 2020-11-24 Nathan Sidwell <nathan@acm.org>
373 * include/cpplib.h (struct cpp_hashnode): Add deferred field.
374 (cpp_set_deferred_macro): Define.
375 (cpp_get_deferred_macro): Declare.
376 (cpp_macro_definition): Reformat, add overload.
377 (cpp_macro_definition_location): Deal with deferred macro.
378 (cpp_alloc_token_string, cpp_compare_macro): Declare.
379 * internal.h (_cpp_notify_macro_use): Return bool
380 (_cpp_maybe_notify_macro_use): Likewise.
381 * directives.c (do_undef): Check macro is not undef before
383 (do_ifdef, do_ifndef): Deal with deferred macro.
384 * expr.c (parse_defined): Likewise.
385 * lex.c (cpp_allocate_token_string): Break out of ...
386 (create_literal): ... here. Call it.
387 (cpp_maybe_module_directive): Deal with deferred macro.
388 * macro.c (cpp_get_token_1): Deal with deferred macro.
389 (warn_of_redefinition): Deal with deferred macro.
390 (compare_macros): Rename to ...
391 (cpp_compare_macro): ... here. Make extern.
392 (cpp_get_deferred_macro): New.
393 (_cpp_notify_macro_use): Deal with deferred macro, return bool
394 indicating definedness.
395 (cpp_macro_definition): Deal with deferred macro.
397 2020-11-19 Nathan Sidwell <nathan@acm.org>
399 * include/cpplib.h (enum cpp_main_search): New.
400 (struct cpp_options): Add main_search field.
401 (cpp_main_loc): Declare.
402 (cpp_retrofit_as_include): Declare.
403 * internal.h (struct cpp_reader): Add main_loc field.
404 (_cpp_in_main_source_file): Not main if main is a header.
405 * init.c (cpp_read_main_file): Use main_search option to locate
406 main file. Set main_loc
407 * files.c (cpp_retrofit_as_include): New.
409 2020-11-19 Nathan Sidwell <nathan@acm.org>
411 * internal.h (cpp_in_system_header): Rename to ...
412 (_cpp_in_system_header): ... here.
413 (cpp_in_primary_file): Rename to ...
414 (_cpp_in_main_source_file): ... here. Compare main_file equality
415 and check main_search value.
416 * lex.c (maybe_va_opt_error, _cpp_lex_direct): Adjust for rename.
417 * macro.c (_cpp_builtin_macro_text): Likewise.
418 (replace_args): Likewise.
419 * directives.c (do_include_next): Likewise.
420 (do_pragma_once, do_pragma_system_header): Likewise.
421 * files.c (struct _cpp_file): Delete main_file field.
422 (pch_open): Check pfile->main_file equality.
423 (make_cpp_file): Drop cpp_reader parm, don't set main_file.
424 (_cpp_find_file): Adjust.
425 (_cpp_stack_file): Check pfile->main_file equality.
426 (struct report_missing_guard_data): Add cpp_reader field.
427 (report_missing_guard): Check pfile->main_file equality.
428 (_cpp_report_missing_guards): Adjust.
430 2020-11-18 Nathan Sidwell <nathan@acm.org>
432 * include/cpplib.h (struct cpp_options): Add module_directives
434 (NODE_MODULE): New node flag.
435 (struct cpp_hashnode): Make rid-code a bitfield, increase bits in
436 flags and swap with type field.
437 * init.c (post_options): Create module-directive identifier nodes.
438 * internal.h (struct lexer_state): Add directive_file_token &
439 n_modules fields. Add module node enumerator.
440 * lex.c (cpp_maybe_module_directive): New.
441 (_cpp_lex_token): Call it.
442 (cpp_output_token): Add '"' around CPP_HEADER_NAME token.
443 (do_peek_ident, do_peek_module): New.
444 (cpp_directives_only): Detect module-directive lines.
445 * macro.c (cpp_get_token_1): Deal with directive_file_token
448 2020-11-18 Nathan Sidwell <nathan@acm.org>
450 * files.c (struct _cpp_file): Add header_unit field.
451 (_cpp_stack_file): Add header unit support.
452 (cpp_find_header_unit): New.
453 * include/cpplib.h (cpp_find_header_unit): Declare.
455 2020-11-18 Nathan Sidwell <nathan@acm.org>
457 * include/cpplib.h (struct cpp_options): Add modules to
459 * include/mkdeps.h (deps_add_module_target): Declare.
460 (deps_add_module_dep): Declare.
461 * mkdeps.c (class mkdeps): Add modules, module_name, cmi_name,
462 is_header_unit fields. Adjust cdtors.
463 (deps_add_module_target, deps_add_module_dep): New.
464 (make_write): Write module dependencies, if enabled.
466 2020-11-17 Nathan Sidwell <nathan@acm.org>
468 * include/cpplib.h (struct cpp_callbacks): Add
469 user_deferred_macro & translate_include.
471 2020-11-17 Nathan Sidwell <nathan@acm.org>
473 * include/line-map.h (enum lc_reason): Add LC_MODULE.
475 (line_map_new_raw): Declare.
476 (linemap_enter_macro): Move declaration from internal.h
477 (linemap_module_loc, linemap_module_reparent)
478 (linemap_module_restore): Declare.
479 (linemap_lookup_macro_indec): Declare.
480 * internal.h (linemap_enter_macro): Moved to line-map.h.
481 * line-map.c (linemap_new_raw): New, broken out of ...
482 (new_linemap): ... here. Call it.
483 (LAST_SOURCE_LINE_LOCATION): New.
484 (liemap_module_loc, linemap_module_reparent)
485 (linemap_module_restore): New.
486 (linemap_lookup_macro_index): New, broken out of ...
487 (linemap_macro_map_lookup): ... here. Call it.
488 (linemap_dump): Add module dump.
490 2020-11-17 Nathan Sidwell <nathan@acm.org>
492 PR preprocessor/97858
493 * mkdeps.c (munge): Drop varadic args, we only ever use one.
495 2020-11-13 Joseph Myers <joseph@codesourcery.com>
497 * expr.c (cpp_classify_number): Update diagnostic for binary
498 constants for C. Also diagnose binary constants for
500 * init.c (lang_defaults): Enable binary constants for GNUC2X and
503 2020-11-13 Piotr H. Dabrowski <phd@phd.re>
506 * include/cpplib.h: Added cpp_define_unused(), cpp_define_formatted_unused()
507 * directives.c: Likewise.
509 2020-11-12 Joseph Myers <joseph@codesourcery.com>
511 * include/cpplib.h (struct cpp_callbacks): Add bool argument to
513 (enum cpp_builtin_type): Add BT_HAS_STD_ATTRIBUTE.
514 * init.c (builtin_array): Add __has_c_attribute.
515 (cpp_init_special_builtins): Handle BT_HAS_STD_ATTRIBUTE.
516 * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_STD_ATTRIBUTE.
517 Update call to has_attribute for BT_HAS_ATTRIBUTE.
518 * traditional.c (fun_like_macro): Handle BT_HAS_STD_ATTRIBUTE.
520 2020-11-12 Nicholas Guriev <guriev-ns@ya.ru>
523 * files.c (_cpp_find_file): Use CPP_DL_NOTE not CPP_DL_ERROR in call to
526 2020-11-07 Lewis Hyatt <lhyatt@gmail.com>
528 * generated_cpp_wcwidth.h: Regenerated from Unicode 13.0.0 data.
530 2020-11-06 Nathan Sidwell <nathan@acm.org>
532 * include/cpplib.h (enum class CPP_time_kind): New.
533 (cpp_get_date): Declare.
534 * internal.h (struct cpp_reader): Replace source_date_epoch with
535 time_stamp and time_stamp_kind.
536 * init.c (cpp_create_reader): Initialize them.
537 * macro.c (_cpp_builtin_macro_text): Use cpp_get_date.
538 (cpp_get_date): Broken out from _cpp_builtin_macro_text and
541 2020-11-03 Nathan Sidwell <nathan@acm.org>
543 * lex.c (cpp_peek_token): Do not peek past CPP_PRAGMA.
544 (_cpp_lex_direct): Handle EOF in pragma when setting need_line,
545 not when needing a line.
547 2020-11-03 Nathan Sidwell <nathan@acm.org>
549 * lex.c (_cpp_clean_line): Fix DOS off-by-one error.
551 2020-11-03 Nathan Sidwell <nathan@acm.org>
553 * init.c (cpp_read_main_file): Use cpp_get_deps result.
555 2020-11-03 Nathan Sidwell <nathan@acm.org>
557 * include/mkdeps.h: Include cpplib.h
558 (deps_write): Adjust first parm type.
559 * mkdeps.c: Include internal.h
560 (make_write): Adjust first parm type. Check phony option
562 (deps_write): Adjust first parm type.
563 * init.c (cpp_read_main_file): Use get_deps.
564 * directives.c (cpp_get_deps): Check option before initializing.
566 2020-11-02 Nathan Sidwell <nathan@acm.org>
568 * internal.h (_cpp_notify_macro_use): Add location parm.
569 (_cpp_maybe_notify_macro_use): Likewise.
570 * directives.c (_cpp_do_file_change): Check we've not changed file
571 when optimizing a rewind.
572 (do_ifdef): Pass location to _cpp_maybe_notify_macro_use.
573 (do_ifndef): Likewise. Delete obsolete comment about powerpc.
574 * expr.c (parse_defined): Pass location to
575 _cpp_maybe_notify_macro_use.
576 * macro.c (enter_macro_context): Likewise.
577 (warn_of_redefinition): Break out helper function. Call it.
578 (compare_macros): New function broken out of warn_of_redefinition.
579 (_cpp_new_macro): Zero all fields.
580 (_cpp_notify_macro_use): Add location parameter.
582 2020-10-20 Nathan Sidwell <nathan@acm.org>
584 * lex.c (_cpp_lex_direct): Do not complete EOF processing when
586 * macro.c (collect_args): Do not unwind fake EOF.
587 (funlike_invocation_p): Do not unwind fake EOF.
588 (cpp_context): Replace abort with gcc_assert.
590 2020-10-19 Nathan Sidwell <nathan@acm.org>
592 * internal.h (struct cpp_reader): Rename 'eof' field to 'endarg'.
593 * init.c (cpp_create_reader): Adjust.
594 * macro.c (collect_args): Use endarg for separator. Always rewind
597 2020-10-08 Nathan Sidwell <nathan@acm.org>
599 * internal.h (enum include_type): Rename IT_MAIN_INJECT to
601 * init.c (cpp_read_main_file): If there is no line marker, adjust
602 the initial line marker.
603 (read_original_filename): Return bool, peek the buffer directly
604 before trying to tokenize.
605 (read_original_directory): Likewise. Directly prod the string
607 * files.c (_cpp_stack_file): Adjust for IT_PRE_MAIN change.
609 2020-09-26 Jakub Jelinek <jakub@redhat.com>
612 * lex.c (search_line_fast): Only use _ARCH_PWR8 Altivec version
615 2020-09-17 Patrick Palka <ppalka@redhat.com>
618 * include/line-map.h (first_map_in_common): Declare.
619 * line-map.c (first_map_in_common): Remove static.
621 2020-09-07 Martin Storsjö <martin@martin.st>
623 * files.c (remap_filename): Make a strchr return value pointer
626 2020-07-30 H.J. Lu <hjl.tools@gmail.com>
629 * configure: Regenerated.
631 2020-07-29 Tiziano Müller <tiziano.mueller@chem.uzh.ch>
633 * init.c (builtin_array): Add xref comment.
634 * traditional.c (fun_like_macro): Add HAS_INCLUDE codes.
636 2020-07-28 Jakub Jelinek <jakub@redhat.com>
638 PR preprocessor/96323
639 * lex.c (lex_raw_string): For c == '\n' don't continue after reporting
640 an prefix delimiter error.
642 2020-07-28 Nathan Sidwell <nathan@acm.org>
644 * init.c (cpp_read_main_file): Always use the last map for
647 2020-07-20 Nathan Sidwell <nathan@acm.org>
649 * line-map.c (linemap_add): Simplify column overflow calculation.
650 Add comment about range and column bit init.
651 (linemap_ordinary_map_lookup): Refactor for RAII
652 (linemap_macro_map_lookup): Likewise.
654 2020-07-14 Lewis Hyatt <lhyatt@gmail.com>
656 PR preprocessor/49973
658 * include/cpplib.h (struct cpp_options): Removed support for -ftabstop,
659 which is now handled by diagnostic_context.
660 (class cpp_display_width_computation): New class.
661 (cpp_byte_column_to_display_column): Add optional tabstop argument.
662 (cpp_display_width): Likewise.
663 (cpp_display_column_to_byte_column): Likewise.
665 (cpp_display_width_computation::cpp_display_width_computation): New
667 (cpp_display_width_computation::advance_display_cols): Likewise.
668 (compute_next_display_width): Removed and implemented this
669 functionality in a new function...
670 (cpp_display_width_computation::process_next_codepoint): ...here.
671 (cpp_byte_column_to_display_column): Added tabstop argument.
672 Reimplemented in terms of class cpp_display_width_computation.
673 (cpp_display_column_to_byte_column): Likewise.
674 * init.c (cpp_create_reader): Remove handling of -ftabstop, which is now
675 handled by diagnostic_context.
677 2020-07-07 Nathan Sidwell <nathan@acm.org>
679 * directives.c (do_linemarker): Optimize rewinding to line zero.
680 * files.c (_cpp_stack_file): Start on line zero when about to inject
682 (cpp_push_include, cpp_push_default_include): Use highest_line as
684 * include/cpplib.h (cpp_read_main_file): Add injecting parm.
685 * init.c (cpp_read_main_file): Likewise, inform _cpp_stack_file.
686 * internal.h (enum include_type): Add IT_MAIN_INJECT.
688 2020-05-29 H.J. Lu <hjl.tools@gmail.com>
691 * configure: Regenerated.
693 2020-05-23 David Edelsohn <dje.gcc@gmail.com>
695 * Makefile.in (AR): Substitute @AR@.
696 * configure.ac (CHECK_PROG AR): New.
697 * configure: Regenerate.
699 2020-05-20 Nathan Sidwell <nathan@acm.org>
701 * internal.h (typedef _cpp_file): Delete, unnecessary in C++.
702 (enum _cpp_find_file_kind): New.
703 (_cpp_find_file): Use it, not 3 bools.
704 * files.c (_cpp_find_file): Use _cpp_find_file_kind enum, not
706 (cpp_make_system_header): Break overly long line.
707 (_cpp_stack_include, _cpp_fake_include)
708 (_cpp_do_file_change, _cpp_compare_file_date, _cpp_has_header): Adjust.
709 * init.c (cpp_read_main): Adjust _cpp_find_file call.
711 2020-05-18 Nathan Sidwell <nathan@acm.org>
713 * include/cpplib.h (cpp_get_otions, cpp_get_callbacks)
714 (cpp_get_deps): Mark as PURE.
715 * include/line-map.h (get_combined_adhoc_loc)
716 (get_location_from_adhoc_loc, get_pure_location): Reformat decls.
717 * internal.h (struct lexer_state): Clarify comment.
718 * system.h: Remove now-unneeded bool hackery.
719 * files.c (_cpp_find_file): Store LOC not highest_location.
721 PR preprocessor/95149
722 * lex.c (struct lit_accum): New.
723 (bufring_append): Replace by lit_accum::append.
724 (lex_raw_string): Reimplement, using fragments of the old version.
725 (lex_string): Adjust lex_raw_string call.
727 PR preprocessor/95182
728 * macro.c (collect_args): Preserve EOFif we fell out of the main
730 (cpp_get_token_1): Reformat a couple of short lines.
732 2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
734 * configure: Regenerated.
736 2020-05-13 Jason Merrill <jason@redhat.com>
738 * include/cpplib.h (enum c_lang): Change CXX2A to CXX20.
739 * init.c, lex.c: Adjust.
741 2020-05-12 Nathan Sidwell <nathan@acm.org>
743 EOF location is at end of file
744 PR preprocessor/95013
745 * lex.c (lex_raw_string): Process line notes before incrementing.
746 Correct incrementing condition. Adjust for new
747 _cpp_get_fresh_line EOF behaviour.
748 (_cpp_get_fresh_line): Do not pop buffer at EOF, increment line
750 (_cpp_lex_direct): Adjust for new _cpp_get_fresh_line behaviour.
751 (cpp_directive_only_process): Assert we got a fresh line.
752 * traditional.c (_cpp_read_logical_line_trad): Adjust for new
753 _cpp_get_fresh_line behaviour.
755 2020-05-12 H.J. Lu <hongjiu.lu@intel.com>
757 * Makefile.in (CET_HOST_FLAGS): New.
758 (COMPILER): Add $(CET_HOST_FLAGS).
759 * configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and
760 AC_SUBST(CET_HOST_FLAGS). Clear CET_HOST_FLAGS if jit isn't
762 * aclocal.m4: Regenerated.
763 * configure: Likewise.
765 2020-05-08 Nathan Sidwell <nathan@acm.org>
767 Reimplement directives only processing, support raw literals.
768 * directives-only.c: Delete.
769 * Makefile.in (libcpp_a_OBJS, libcpp_a_SOURCES): Remove it.
770 * include/cpplib.h (enum CPP_DO_task): New enum.
771 (cpp_directive_only_preprocess): Declare.
772 * internal.h (_cpp_dir_only_callbacks): Delete.
773 (_cpp_preprocess_dir_only): Delete.
774 * lex.c (do_peek_backslask, do_peek_next, do_peek_prev): New.
775 (cpp_directives_only_process): New implementation.
777 2020-02-14 Jakub Jelinek <jakub@redhat.com>
779 Partially implement P1042R1: __VA_OPT__ wording clarifications
780 PR preprocessor/92319
781 * macro.c (expand_arg): Move declarations before vaopt_state
783 (class vaopt_state): Move enum update_type definition earlier. Remove
784 m_allowed member, add m_arg and m_update members.
785 (vaopt_state::vaopt_state): Change last argument from bool any_args
786 to macro_arg *arg, initialize m_arg and m_update instead of m_allowed.
787 (vaopt_state::update): When bumping m_state from 1 to 2 and m_update
788 is ERROR, determine if __VA_ARGS__ expansion has any non-CPP_PADDING
789 tokens and set m_update to INCLUDE if it has any, DROP otherwise.
790 Return m_update instead of m_allowed ? INCLUDE : DROP in m_state >= 2.
791 (replace_args, create_iso_definition): Adjust last argument to
794 2020-02-05 Martin Sebor <msebor@redhat.com>
796 * include/cpplib.h (cpp_builtin_type): Remove trailing comma to
797 avoid pedantic warnings in C++ 98 mode.
799 2020-02-04 Jakub Jelinek <jakub@redhat.com>
801 * macro.c (builtin_has_include): Diagnose __has_include* use outside
802 of preprocessing directives.
804 PR preprocessor/93545
805 * macro.c (cpp_get_token_no_padding): New function.
806 (builtin_has_include): Use it instead of cpp_get_token. Don't check
809 2020-02-01 Andrew Burgess <andrew.burgess@embecosm.com>
811 * configure: Regenerate.
813 2020-01-28 Nathan Sidwell <nathan@acm.org>
815 PR preprocessor/93452
816 * internal.h (struct spec_nodes): Drop n__has_include{,_next}.
817 * directives.c (lex_macro_node): Don't check __has_include redef.
818 * expr.c (eval_token): Drop __has_include eval.
819 (parse_has_include): Move to ...
820 * macro.c (builtin_has_include): ... here.
821 (_cpp_builtin_macro_text): Eval __has_include{,_next}.
822 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_INCLUDE{,_NEXT}.
823 * init.c (builtin_array): Add them.
824 (cpp_init_builtins): Drop __has_include{,_next} init here ...
825 * pch.c (cpp_read_state): ... and here.
826 * traditional.c (enum ls): Drop has_include states ...
827 (_cpp_scan_out_logical_line): ... and here.
829 2020-01-27 Andrew Burgess <andrew.burgess@embecosm.com>
831 * configure: Regenerate.
833 2020-01-24 Nathan Sidwell <nathan@acm.org>
835 * expr.c (parse_has_include): Remove bogus controlling macro code.
837 2020-01-20 Nathan Sidwell <nathan@acm.org>
839 PR preprocessor/80005
840 * include/cpplib.h (BT_HAS_ATTRIBUTE): Fix comment.
841 * internal.h (struct lexer_state): Delete in__has_include field.
842 (struct spec_nodes): Rename n__has_include{,_next}__ fields.
843 (_cpp_defined_macro_p): New.
844 (_cpp_find_file): Add has_include parm.
845 * directives.c (lex_macro_node): Combine defined,
846 __has_inline{,_next} checking.
847 (do_ifdef, do_ifndef): Use _cpp_defined_macro_p.
848 (_cpp_init_directives): Refactor.
849 * expr.c (parse_defined): Use _cpp_defined_macro_p.
850 (eval_token): Adjust parse_has_include calls.
851 (parse_has_include): Add OP parameter. Reimplement.
852 * files.c (_cpp_find_file): Add HAS_INCLUDE parm. Use it to
853 inhibit error message.
854 (_cpp_stack_include): Adjust _cpp_find_file call.
855 (_cpp_fake_include, _cpp_compare_file_date): Likewise.
856 (open_file_failed): Remove in__has_include check.
857 (_cpp_has_header): Adjust _cpp_find_file call.
858 * identifiers.c (_cpp_init_hashtable): Don't init
859 __has_include{,_next} here ...
860 * init.c (cpp_init_builtins): ... init them here. Define as
862 (cpp_read_main_file): Adjust _cpp_find_file call.
863 * pch.c (cpp_read_state): Adjust __has_include{,_next} access.
864 * traditional.c (_cpp_scan_out_locgical_line): Likewise.
866 PR preprocessor/93306
867 * expr.c (parse_has_include): Refactor. Check skip_eval before
870 2020-01-10 David Malcolm <dmalcolm@redhat.com>
872 * include/line-map.h (class diagnostic_path): New forward decl.
873 (rich_location::get_path): New accessor.
874 (rich_location::set_path): New function.
875 (rich_location::m_path): New field.
876 * line-map.c (rich_location::rich_location): Initialize m_path.
878 2020-01-01 Jakub Jelinek <jakub@redhat.com>
880 Update copyright years.
882 2019-12-18 David Malcolm <dmalcolm@redhat.com>
884 PR preprocessor/92982
886 (cpp_string_location_reader::cpp_string_location_reader): Delete
887 initialization of m_line_table.
888 * include/cpplib.h (cpp_string_location_reader::m_line_table):
889 Delete unused member.
891 2019-12-14 Jakub Jelinek <jakub@redhat.com>
893 PR preprocessor/92919
894 * charset.c (wide_str_to_charconst): If str contains just the
895 NUL terminator, punt quietly.
897 2019-12-09 David Malcolm <dmalcolm@redhat.com>
899 * include/line-map.h (label_text::label_text): Make private.
900 (label_text::borrow): New.
901 (label_text::take): New.
902 (label_text::take_or_copy): New.
904 2019-12-09 Lewis Hyatt <lhyatt@gmail.com>
906 PR preprocessor/49973
907 * generated_cpp_wcwidth.h: New file generated by
908 ../contrib/unicode/gen_wcwidth.py, supports new cpp_wcwidth function.
909 * charset.c (compute_next_display_width): New function to help
910 implement display columns.
911 (cpp_byte_column_to_display_column): Likewise.
912 (cpp_display_column_to_byte_column): Likewise.
913 (cpp_wcwidth): Likewise.
914 * include/cpplib.h (cpp_byte_column_to_display_column): Declare.
915 (cpp_display_column_to_byte_column): Declare.
916 (cpp_wcwidth): Declare.
917 (cpp_display_width): New function.
919 2019-11-14 Joseph Myers <joseph@codesourcery.com>
921 * charset.c (narrow_str_to_charconst): Make CPP_UTF8CHAR constants
923 * init.c (lang_defaults): Set utf8_char_literals for GNUC2X and
926 2019-11-07 Jakub Jelinek <jakub@redhat.com>
928 PR c++/91370 - Implement P1041R4 and P1139R2 - Stronger Unicode reqs
929 * charset.c (narrow_str_to_charconst): Add TYPE argument. For
930 CPP_UTF8CHAR diagnose whenever number of chars is > 1, using
931 CPP_DL_ERROR instead of CPP_DL_WARNING.
932 (wide_str_to_charconst): For CPP_CHAR16 or CPP_CHAR32, use
933 CPP_DL_ERROR instead of CPP_DL_WARNING when multiple char16_t
934 or char32_t chars are needed.
935 (cpp_interpret_charconst): Adjust narrow_str_to_charconst caller.
937 2019-11-05 Tim van Deurzen <tim@kompiler.org>
939 * cpplib.h: Add spaceship operator for C++.
940 * lex.c: Implement conditional lexing of spaceship operator for C++20.
942 2019-10-31 Jakub Jelinek <jakub@redhat.com>
944 PR preprocessor/92296
945 * internal.h (struct def_pragma_macro): Add is_builtin bitfield.
946 (_cpp_restore_special_builtin): Declare.
947 * init.c (_cpp_restore_special_builtin): New function.
948 * directives.c (do_pragma_push_macro): For NT_BUILTIN_MACRO
949 set is_builtin and don't try to grab definition.
950 (cpp_pop_definition): Use _cpp_restore_special_builtin to restore
953 2019-10-15 Nathan Sidwell <nathan@acm.org>
955 * include/line-map.h (struct maps_info_ordinary): Make cache
957 (struct maps_info_macro): Likewise.
958 (LINEMAPS_CACHE): Remove non-ref accessor. Constify ref accessor.
959 (LINEMAPS_ORDINARY_CACHE, LINEMAPS_MACRO_CACHE): Likewise.
960 (LINEMAPS_ORDINARY_MAP_AT, LINEMAPS_MACRO_MAP_AT): Use
961 LINEMAPS_USED and LINEMAPS_MAP_AT.
962 (linemap_lookup): Constify line_map arg.
963 linemap.c (linemap_ordinary_map_lookup, linemap_macro_map_lookup):
964 Constify line_map arg.
966 2019-10-11 Joseph Myers <joseph@codesourcery.com>
968 * include/cpplib.h (struct cpp_options): Add dfp_constants and
969 cpp_warn_c11_c2x_compat.
970 (enum cpp_warning_reason): Add CPP_W_C11_C2X_COMPAT.
971 * init.c (struct lang_flags): Add dfp_constants.
972 (lang_defaults): Set dfp_constants to 1 for GNUC2X and STDC2X and
973 0 for other languages.
974 (cpp_set_lang): Set dfp_constants from language.
975 (cpp_create_reader): Set cpp_warn_c11_c2x_compat to -1.
976 * expr.c (interpret_float_suffix): Mention DFP constants as C2X in
978 (cpp_classify_number): Do not diagnose DFP constants for languages
979 setting dfp_constants, unless cpp_warn_c11_c2x_compat.
981 2019-10-04 Nathan Sidwell <nathan@acm.org>
983 PR preprocessor/91991
984 * line-map.c (linemap_line_start): Clear max_column_hint if we run
987 2019-10-02 Richard Biener <rguenther@suse.de>
989 * internal.h (enum include_type): Remove trailing comma.
991 2019-10-02 Joseph Myers <joseph@codesourcery.com>
993 * include/cpplib.h (struct cpp_options): Add member scope.
994 * init.c (struct lang_flags, lang_defaults): Likewise.
995 (cpp_set_lang): Set scope member of pfile.
996 * lex.c (_cpp_lex_direct): Test CPP_OPTION (pfile, scope) not
997 CPP_OPTION (pfile, cplusplus) for creating CPP_SCOPE tokens.
999 2019-09-26 Eric Botcazou <ebotcazou@adacore.com>
1001 * charset.c (UCS_LIMIT): New macro.
1002 (ucn_valid_in_identifier): Use it instead of a hardcoded constant.
1003 (_cpp_valid_ucn): Issue a pedantic warning for UCNs larger than
1004 UCS_LIMIT outside of identifiers in C and in C++2a or later.
1006 2019-09-19 Lewis Hyatt <lhyatt@gmail.com>
1009 * charset.c (_cpp_valid_utf8): New function to help lex UTF-8 tokens.
1010 * internal.h (_cpp_valid_utf8): Declare.
1011 * lex.c (forms_identifier_p): Use it to recognize UTF-8 identifiers.
1012 (_cpp_lex_direct): Handle UTF-8 in identifiers and CPP_OTHER tokens.
1013 Do all work in "default" case to avoid slowing down typical code paths.
1014 Also handle $ and UCN in the default case for consistency.
1016 2019-08-30 Nathan Sidwell <nathan@acm.org>
1018 New # semantics for popping to "" name.
1020 * directives.c (do_linemarker): Popping to "" name means get the
1021 name from the include stack..
1023 2019-09-05 Nathan Sidwell <nathan@acm.org>
1025 PR preprocessor/91639
1026 * directives.c (do_include_common): Tell lexer we're a #include.
1027 * files.c (_cpp_stack_file): Lexer will have always incremented.
1028 * internal.h (struct cpp_context): Extend in_directive's
1030 * lex.c (_cpp_lex_direct): Increment line for final \n when lexing
1031 for an ISO #include.
1032 * line-map.c (linemap_line_start): Remember if we overflowed.
1034 2019-09-03 Ulrich Weigand <uweigand@de.ibm.com>
1036 * directives.c: Remove references to spu from comments.
1039 2019-08-29 Nathan Sidwell <nathan@acm.org>
1041 * internal.h (enum include_type): Add IT_MAIN, IT_DIRECTIVE_HWM,
1043 (_cpp_stack_file): Take include_type, not a bool.
1044 * files.c (_cpp_find_file): Refactor to not hide an if inside a
1046 (should_stack_file): Break apart to ...
1047 (is_known_idempotent_file, has_unique_contents): ... these.
1048 (_cpp_stack_file): Replace IMPORT boolean with include_type enum.
1049 Refactor to use new predicates. Do linemap compensation here ...
1050 (_cpp_stack_include): ... not here.
1051 * init.c (cpp_read_main_file): Pass IT_MAIN to _cpp_stack_file.
1053 2019-08-28 Nathan Sidwell <nathan@acm.org>
1055 * directives-only.c (_cpp_preprocess_dir_only): Use false, not
1056 zero for _cpp_handle_directive call.
1057 * directives.c (_cpp_handle_directive): Indented is bool.
1058 * files.c (struct _cpp_file): Make bools 1 bit bitfields.
1059 * internal.h (enum include_type): Reformat and comment.
1060 (struct cpp_buffer): Make flags 1 bit bitfields.
1061 (_cpp_handle_directive): Indented is bool.
1063 2019-07-09 Martin Sebor <msebor@redhat.com>
1065 * include/line-map.h: Change class-key from class to struct and vice
1066 versa to match convention and avoid -Wclass-is-pod and -Wstruct-no-pod.
1069 2019-07-03 Martin Liska <mliska@suse.cz>
1071 * line-map.c (linemap_get_expansion_filename): Remove
1073 * mkdeps.c (make_write): Likewise.
1075 2019-07-02 qing zhao <qing.zhao@oracle.com>
1077 PR preprocessor/90581
1078 * directives.c (do_include_common): Replace CPP_STACK_MAX with
1079 CPP_OPTION (pfile, max_include_depth).
1080 * include/cpplib.h (struct cpp_options): Add new field
1082 * init.c (cpp_create_reader): Initiate new field max_include_depth.
1083 * internal.h: Delete CPP_STACK_MAX.
1085 2019-06-26 Nathan Sidwell <nathan@acm.org>
1087 PR preprocessor/90927
1088 * mkdeps.c (mkdeps::vec::operator[]): Add non-const variant.
1089 (deps_add_target): Deal with out of order unquoted targets.
1091 2019-05-19 Andrew Pinski <apinski@marvell.com>
1094 * lex.c (cpp_token_val_index <case SPELL_OPERATOR>): If tok->flags
1095 has NAMED_OP set, then return CPP_TOKEN_FLD_NODE.
1097 2019-05-14 Martin Liska <mliska@suse.cz>
1099 PR preprocessor/90382
1100 * line-map.c (first_map_in_common_1): Handle ADHOC
1103 2019-05-14 Martin Liska <mliska@suse.cz>
1105 PR preprocessor/90382
1106 * include/line-map.h (get_data_from_adhoc_loc): Add const to
1108 (get_location_from_adhoc_loc): Likewise.
1109 * line-map.c(get_data_from_adhoc_loc): Add const to
1111 (get_location_from_adhoc_loc): Likewise.
1112 (get_combined_adhoc_loc): Use get_location_from_adhoc_loc
1113 (or get_data_from_adhoc_loc).
1114 (get_range_from_adhoc_loc): Likewise.
1115 (get_pure_location): Likewise.
1116 (linemap_position_for_loc_and_offset): Likewise.
1117 (linemap_lookup): Likewise.
1118 (linemap_ordinary_map_lookup): Likewise.
1119 (linemap_macro_map_lookup): Likewise.
1120 (linemap_get_expansion_line): Likewise.
1121 (linemap_get_expansion_filename): Likewise.
1122 (linemap_location_in_system_header_p): Likewise.
1123 (linemap_location_from_macro_expansion_p): Likewise.
1124 (linemap_macro_loc_to_exp_point): Likewise.
1125 (linemap_resolve_location): Likewise.
1126 (linemap_unwind_toward_expansion): Likewise.
1127 (linemap_unwind_to_first_non_reserved_loc): Likewise.
1128 (linemap_expand_location): Likewise.
1129 (linemap_dump_location): Likewise.
1131 2019-05-07 Nathan Sidwell <nathan@acm.org>
1133 * files.c (_cpp_stack_file): Empty filenames aren't dependencies.
1134 * mkdeps.c (deps_add_dep): Assert not empty.
1136 * include/mkdeps.h (deps_write): Add PHONY arg.
1137 (deps_phony_targets): Delete.
1138 * init.c (cpp_finish): Just call deps_write.
1139 * mkdeps.c (struct mkdeps): Add local vector class. Reimplement
1141 (munge): Munge to static buffer.
1142 (apply_vpath): Adjust vector handling.
1143 (deps_init, deps_free): Use new, delete.
1144 (deps_add_target): Do not munge here. Record quoting low water mark.
1145 (deps_add_dep): Do not munge here.
1146 (deps_add_vpath): Adjust vector handling.
1147 (make_write_name): New. Munge on demand here.
1148 (make_write_vec): New.
1149 (deps_phony_targets): Delete.
1151 (deps_write): Forward to deps_Write.
1152 (deps_save, deps_restore): Adjust vector handling.
1154 2019-05-06 Nathan Sidwell <nathan@acm.org>
1156 * include/mkdeps.h: Rename struct deps to struct mkdeps.
1157 * mkdeps.c: Likewise.
1158 * include/cpplib.h (cpp_get_deps): Rename return type..
1159 * directives.c (cpp_get_deps): Likewise.
1160 * internal.h (struct cpp_reader): Rename deps field type.
1162 2019-04-03 Jonathan Wakely <jwakely@redhat.com>
1164 * files.c (search_path_exhausted): Fix typo in comment.
1166 2019-02-26 Martin Liska <mliska@suse.cz>
1168 * symtab.c (ht_dump_statistics): Make
1169 horizontal alignment for statistics.
1171 2019-02-20 David Malcolm <dmalcolm@redhat.com>
1174 * include/line-map.h (linenum_arith_t): New typedef.
1177 2019-02-18 Martin Liska <mliska@suse.cz>
1180 * line-map.c (linemap_line_start): Use 1UL in order
1183 2019-02-11 Martin Liska <mliska@suse.cz>
1186 * line-map.c (linemap_line_start): Don't reuse the existing line
1187 map if the line offset is sufficiently large to cause overflow
1188 when computing location_t values.
1190 2019-01-26 Jakub Jelinek <jakub@redhat.com>
1192 PR preprocessor/88974
1193 * directives.c (SEEN_EOL): Move macro to ...
1194 * internal.h (SEEN_EOL): ... here.
1195 * expr.c (parse_has_include): Don't cpp_get_token if SEEN_EOL ().
1197 2019-01-01 Jakub Jelinek <jakub@redhat.com>
1199 Update copyright years.
1201 2018-11-27 Mike Gulick <mgulick@mathworks.com>
1203 PR preprocessor/83173
1204 * location-example.txt: Update example -fdump-internal-locations
1207 2018-11-27 Mike Gulick <mgulick@mathworks.com>
1209 PR preprocessor/83173
1210 * files.c (_cpp_stack_include): Check if
1211 line_table->highest_location is past current line before
1214 2018-11-13 David Malcolm <dmalcolm@redhat.com>
1216 * charset.c: Replace "source_location" with "location_t".
1217 * directives-only.c: Likewise.
1218 * directives.c: Likewise.
1219 * errors.c: Likewise.
1221 * files.c: Likewise.
1222 * include/cpplib.h: Likewise. Rename MAX_SOURCE_LOCATION to
1224 * include/line-map.h: Likewise.
1226 * internal.h: Likewise.
1228 * line-map.c: Likewise.
1229 * location-example.txt: Likewise.
1230 * macro.c: Likewise.
1232 * traditional.c: Likewise.
1234 2018-11-07 Hafiz Abid Qadeer <abidh@codesourcery.com>
1236 * configure: Regenerated.
1238 2018-11-05 Martin Liska <mliska@suse.cz>
1240 * symtab.c (ht_dump_statistics): Replace %zu with %lu format.
1242 2018-11-05 Martin Liska <mliska@suse.cz>
1244 * symtab.c (ht_dump_statistics): Fix format and
1245 pass missing argument.
1247 2018-11-05 Martin Liska <mliska@suse.cz>
1249 * symtab.c (ht_dump_statistics): Make dump conditional
1250 based on alloc_subobject.
1252 2018-10-31 Joseph Myers <joseph@codesourcery.com>
1255 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
1256 * aclocal.m4, config.in, configure: Regenerate.
1258 2018-10-31 Nathan Sidwell <nathan@acm.org>
1260 * internal.h (struct cpp_reader): Rename forced_token_location_p
1261 to forced_token_location and drop its pointerness.
1262 * include/cpplib.h (cpp_force_token_locations): Take location, not
1264 * init.c (cpp_create_reader): Adjust.
1265 * lex.c (cpp_read_main_file):
1267 * directives.c (do_include_common): Commonize cleanup path.
1268 (_cpp_pop_buffer): Fix leak.
1270 * include/line-map.h (IS_ORDINARY_LOC, IS_MACRO_LOC): New
1272 (IS_ADHOC_LOC): Move earlier.
1273 (MAP_ORDINARY_P): Use IS_ORDINARY_LOC.
1274 * line-map.c (linemap_location_from_macro_expansion_p): Use
1277 * include/cpplib.h (cpp_macro_definition_location): Make inline.
1278 * macro.c (warn_of_redefinition): Fix comments, examine macro
1280 (cpp_macro_definition_location): Don't define here.
1282 * include/cpplib.h (HT_NODE): Don't cast NODE.
1283 (NODE_LEN, NODE_NAME): Use HT_NODE.
1285 * directives.c (DIRECTIVE_TABLE): Drop historical frequency
1287 * files.c (_cpp_stack_file): Fix indentation.
1289 2018-10-17 Joseph Myers <joseph@codesourcery.com>
1291 * include/cpplib.h (enum c_lang): Add CLK_GNUC2X and CLK_STDC2X.
1292 * init.c (lang_defaults): Add GNUC2X and STDC2X entries.
1293 (cpp_init_builtins): Define __STDC_VERSION__ to 202000L for C2X.
1295 2018-10-11 David Malcolm <dmalcolm@redhat.com>
1297 * macro.c (_cpp_arguments_ok): If the argument count is wrong, add
1298 a note showing the definition of the macro.
1300 2018-10-11 Nathan Sidwell <nathan@acm.org>
1302 * include/line-map.h (LINEMAPS_MACRO_LOWEST_LOCATION): Fix
1304 * line-map.c (linemap_enter_macro): Use RAII. Clear all of the
1307 2018-10-09 David Malcolm <dmalcolm@redhat.com>
1309 * charset.c (noop_error_cb): Rename to...
1310 (noop_diagnostic_cb): ...this, converting params to enums.
1311 (cpp_interpret_string_ranges): Update for renaming and enums.
1312 * directives.c (check_eol_1): Convert reason to enum.
1313 (do_diagnostic): Convert code and reason to enum.
1314 (do_error): Use CPP_W_NONE rather than 0.
1315 (do_pragma_dependency): Likewise.
1316 * errors.c (cpp_diagnostic_at): Convert level and reason to enums.
1317 Update for renaming.
1318 (cpp_diagnostic): Convert level and reason to enums.
1319 (cpp_error): Convert level to enum.
1320 (cpp_warning): Convert reason to enums.
1321 (cpp_pedwarning): Likewise.
1322 (cpp_warning_syshdr): Likewise.
1323 (cpp_diagnostic_with_line): Convert level and reason to enums.
1324 Update for renaming.
1325 (cpp_error_with_line): Convert level to enum.
1326 (cpp_warning_with_line): Convert reason to enums.
1327 (cpp_pedwarning_with_line): Likewise.
1328 (cpp_warning_with_line_syshdr): Likewise.
1329 (cpp_error_at): Convert level to enum.
1330 (cpp_errno): Likewise.
1331 (cpp_errno_filename): Likewise.
1332 * include/cpplib.h (enum cpp_diagnostic_level): Name this enum,
1333 and move to before struct cpp_callbacks.
1334 (enum cpp_warning_reason): Likewise.
1335 (cpp_callbacks::diagnostic): Convert params from int to enums.
1336 (cpp_error): Convert int param to enum cpp_diagnostic_level.
1337 (cpp_warning): Convert int param to enum cpp_warning_reason.
1338 (cpp_pedwarning): Likewise.
1339 (cpp_warning_syshdr): Likewise.
1340 (cpp_errno): Convert int param to enum cpp_diagnostic_level.
1341 (cpp_errno_filename): Likewise.
1342 (cpp_error_with_line): Likewise.
1343 (cpp_warning_with_line): Convert int param to enum
1345 (cpp_pedwarning_with_line): Likewise.
1346 (cpp_warning_with_line_syshdr): Likewise.
1347 (cpp_error_at): Convert int param to enum cpp_diagnostic_level.
1348 * macro.c (create_iso_definition): Convert int to enum.
1349 (_cpp_create_definition): Likewise.
1351 2018-09-17 David Malcolm <dmalcolm@redhat.com>
1353 * include/line-map.h (range_label::get_text): Add param
1356 2018-08-30 Nathan Sidwell <nathan@acm.org>
1358 * include/line-map.h (enum lc_reason): Comment each member
1360 (struct line_maps): Fix reallocator comment.
1362 2018-08-27 David Malcolm <dmalcolm@redhat.com>
1365 * include/line-map.h (enum range_display_kind): New enum.
1366 (struct location_range): Replace field "m_show_caret_p" with
1367 "m_range_display_kind", converting from bool to the new enum.
1368 (class rich_location): Add example of line insertion fix-it hint.
1369 (rich_location::add_range): Convert param "show_caret_p" from bool
1370 to enum range_display_kind and rename to "range_display_kind",
1371 giving it a default of SHOW_RANGE_WITHOUT_CARET.
1372 (rich_location::set_range): Likewise, albeit without a default.
1373 * line-map.c (rich_location::rich_location): Update for conversion
1374 of show_caret_p to tri-state enum.
1375 (rich_location::add_range): Likewise.
1376 (rich_location::set_range): Likewise.
1378 2018-08-24 H.J. Lu <hongjiu.lu@intel.com>
1381 * line-map.c (pure_location_p): Return true if linemap_lookup
1383 (linemap_add): Set start_location to 0 if we run out of line map
1386 2018-08-20 Nathan Sidwell <nathan@acm.org>
1388 * include/cpplib.h: Fixup some whitespace.
1389 (cpp_hashnode): Reduce type to 2 bit & flags to 8.
1391 * include/cpplib.h (NODE_BUILTIN, NODE_MACRO_ARG): Delete.
1393 (enum node_type): Replace NT_MACRO with NT_USER_MACRO,
1394 NT_BUILTIN_MACRO, NT_MACRO_ARG. Delete NT_ASSERTION.
1395 (NTV_MACRO, NTV_ANSWER, NTV_BUILTIN, NTV_ARGUMENT, NTV_NONE):
1397 (CPP_HASHNODE_VALUE_IDX): Delete.
1398 (union _cpp_hashnode_value): GTY tag from enum node_type directly.
1399 (struct cpp_hashnode): Adjust GTY desc for value field.
1400 (cpp_user_macro_p, cpp_builtin_macro_p, cpp_macro_p): Adjust.
1401 * directives.c (undefine_macros): Clear value.anwers, adjust flag
1403 (_cpp_test_assertion): No need to check NT_ASSERTION.
1404 (do_assert, do_unassert): Likewise.
1405 * init.c (cpp_init_special_builtins): Set type not flags.
1406 * macro.c (struct macro_arg_saved_data): Add type field.
1407 (cpp_get_token_1): Check type not NT_VOID.
1408 (_cpp_free_definition): Adjust flag clearing. Nullify
1410 (_cpp_save_parameter, _cpp_unsave_parameters): Save and restore
1412 (lex_expansion_token): Check type not flags.
1413 (_cpp_create_definition): Set type to NT_USER_MACRO.
1414 (_cpp_notify_macro_use): Adjust type checking.
1415 * pch.c (write_macdef, count_defs, write_defs, cpp_valid_state)
1416 (save_macros): Adjust node type/flag handling.
1417 * traditional.c (_cpp_scan_out_logical_line): Check type not flags.
1419 * directives.c (do_undef): Use cpp_macro_p & cpp_builtin_macro_p.
1420 * include/cpplib.h (enum cpp_macro_kind): Remove trailing comma.
1421 (cpp_fun_like_macro_p): Make inline, define.
1422 * macro.c (cpp_define_lazily): Use UCHAR_MAX.
1423 (cpp_fun_like_macro_p): Delete.
1425 * Makefile.in (TAGS_SOURCES): Remove cpp-id-data.h.
1426 * include/cpp-id-data.h: Delete.
1427 * internal.h: Include cpplib.h not cpp-id-data.h.
1429 * include/cpp-id-data.h (struct answer): Delete.
1430 * include/cpplib.h (struct answer): Don't forward-declare.
1431 (enum cpp_macro_kind): Add cmk_assert.
1432 (struct cpp_macro): Union parms and next assert chain.
1433 (union _cpp_hashnode_value): 'answer' field is cpp_macro.
1434 * directives.c (parse_answer): Convert to use cpp_macro. Return
1436 (parse_assertion, find_answer, _cpp_test_assertion, cpp_do_assert)
1437 (cpp_do_unassert): Convert to use cpp_macro.
1438 * macro.c (warn_of_redefinition, _cpp_new_macro)
1439 (check_trad_stringification, cpp_macro_definition): Adjust macro
1441 * traditional.c (_cpp_replacement_text_len)
1442 (_cpp_copy_replacement_text, _cpp_create_trad_definition): Likewise.
1444 2018-08-17 Nathan Sidwell <nathan@acm.org>
1446 * include/cpplib.h (struct cpp_callbacks): Replace
1447 user_builtin_macro with user_lazy_macro.
1448 (struct cpp_macro): add lazy field.
1449 (enum cpp_builtin_type): Remove BT_FIRST_USER, BT_LAST_USER.
1450 (cpp_define_lazily): Declare.
1451 * macro.c (enter_macro_context) Use _cpp_maybe_notify_macro_use.
1452 (warn_of_redefinition): Use cpp_builtin_macro_p, directly call
1453 user_lazy_macro hook.
1454 (_cpp_new_macro): Clear lazy field.
1455 (cpp_define_lazily): Define.
1456 (_cpp_notify_macro_use): Adjust lazy definition code.
1457 (cpp_macro_definition): No need to do lazy definition here.
1458 * pch.c (write_macdef, save_macros): Likewise.
1460 * include/cpplib.h (enum cpp_macro_kind): New.
1461 (struct cpp_macro): Make body trailing array. Add kind field,
1462 delete traditional flag.
1463 * internal.h (_cpp_new_macro): Declare.
1464 (_cpp_reserve_room): New inline.
1465 (_cpp_commit_buf): Declare.
1466 (_cpp_create_trad_definition): Return new macro.
1467 * lex.c (_cpp_commit_buff): New.
1468 * macro.c (macro_real_token_count): Count backwards.
1469 (replace_args): Pointer equality not orderedness.
1470 (_cpp_save_parameter): Use _cpp_reserve_room.
1471 (alloc_expansion_token): Delete.
1472 (lex_expansion_token): Return macro pointer. Use _cpp_reserve_room.
1473 (create_iso_definition): Allocate macro itself. Adjust for
1474 different allocation ordering.
1475 (_cpp_new_macro): New.
1476 (_cpp_create_definition): Adjust for API changes.
1477 * traditional.c (push_replacement_text): Don't set traditional
1479 (save_replacement_text): Likewise.
1480 (_cpp_create_trad_definition): Allocate macro itself, Adjust for
1481 different allocation ordering.
1483 * cpp-id-data.h (uchar, UC): Move to internal.h
1484 (struct cpp_macro): Move to cpplib.h.
1485 * internal.h (uchar, UC): From cpp-id-data.h.
1486 * include/cpplib.h (struct cpp_macro): From cpp-id-data.h.
1488 2018-08-16 Nathan Sidwell <nathan@acm.org>
1490 * internal.h (_cpp_save_parameter): Take parmno, not macro.
1491 (_cpp_unsave_parameters): Declare.
1492 * macro.c (_cpp_save_parameter): Take parm number, not macro.
1493 Return true on success.
1494 (_cpp_unsave_parameters): New.
1495 (parse_params): Take parm_no and variadic pointers, not macro.
1496 Reimplement parsing logic.
1497 (create_iso_definition): Adjust parse_params changes. Call
1498 _cpp_unsave_parameters here.
1499 (_cpp_create_definition): Don't unsave params here.
1500 * traditional.c (scan_parameters): Take n_param pointer, adjust.
1501 (_cpp_create_trad_definition): Ajust scan_parameters change. Call
1502 _cpp_unsave_parameters.
1504 * include/cpplib.h (cpp_user_macro_p, cpp_builtin_macro_p)
1505 (cpp_macro_p): New inlines.
1506 * directives.c (do_pragma_poison): Use cpp_macro_p.
1507 (do_ifdef, do_ifndef): Likewise. Use _cpp_maybe_notify_macro_use.
1508 (cpp_pop_definition): Use cpp_macro_p. Move _cpp_free_definition
1509 earlier. Don't zap node directly.
1510 * expr.c (parse_defined): Use _cpp_maybe_notify_macro_use &
1512 * files.c (should_stack_file): Use cpp_macro_p.
1513 * identifiers.c (cpp_defined): Likewise.
1514 * internal.h (_cpp_mark_macro): Use cpp_user_macro_p.
1515 (_cpp_notify_macro_use): Declare.
1516 (_cpp_maybe_notify_macro_use): New inline.
1517 * lex.c (is_macro): Use cpp_macro_p.
1518 * macro.c (_cpp_warn_if_unused_macro): Use cpp_user_macro_p.
1519 (enter_macro_context): Likewise.
1520 (_cpp_create_definition): Use cpp_builtin_macro_p,
1521 cpp_user_macro_p. Move _cpp_free_definition earlier.
1522 (_cpp_notify_macro_use): New, broken out of multiple call sites.
1523 * traditional.c (fun_like_macro_p): Use cpp_builtin_macro_p.
1524 (maybe_start_funlike, _cpp_scan_out_logical_line)
1525 (push_replacement_text): Likewise.
1527 2018-08-15 David Malcolm <dmalcolm@redhat.com>
1529 * include/line-map.h (struct location_range): Add "m_label" field.
1530 (class rich_location): Add description of labels to leading
1532 (rich_location::rich_location): Add "label" param, defaulting to
1534 (rich_location::add_range): Likewise.
1535 (struct label_text): New struct.
1536 (class range_label): New abstract base class.
1537 * line-map.c (rich_location::rich_location): Add "label" param;
1539 (rich_location::add_range): Likewise.
1541 2018-08-08 Nathan Sidwell <nathan@acm.org>
1543 Make linemap::included_from a location
1545 * include/line-map.h (struct line_map_ordinary): Replace
1546 included_from map index with included_at source_location.
1547 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Delete.
1548 (LAST_SOURCE_LINE_LOCATION): Delete.
1549 (LAST_SOURCE_LINE, LAST_SOURCE_COLUMN): Delete.
1550 (linemap_included_from): New.
1551 (linemap_included_from_linemap): Declare.
1552 (MAIN_FILE_P): Adjust.
1553 * line-map.c (linemap_included_from_linemap): New.
1554 (lonemap_check_files_exited): Use linemap_included_at.
1555 (linemap_add): Adjust inclusion setting.
1556 (linemap_dump, linemap_dump_location): Adjust.
1557 * directives.c (do_linemarker): Use linemap_included_at.
1559 2018-08-07 Nathan Sidwell <nathan@acm.org>
1561 * line-map.c: (linemap_init): Set default allocator here.
1562 (new_linemap): Rather than here. Refactor allocation logic.
1564 2018-07-20 David Malcolm <dmalcolm@redhat.com>
1566 * include/line-map.h (rich_location::set_range): Remove redundant
1567 line_maps * parameter.
1568 * line-map.c (rich_location::set_range): Likewise.
1570 2018-07-18 Bernd Edlinger <bernd.edlinger@hotmail.de>
1573 * macro.c (enter_macro_context): Change the location info for builtin
1574 macros and _Pragma from location of the closing parenthesis to location
1575 of the macro expansion point.
1577 2018-07-17 Jason Franklin <j_fra@fastmail.us>
1578 Jakub Jelinek <jakub@redhat.com>
1580 * lex.c (_cpp_lex_direct): Use CPP_DL_NOTE instead of CPP_DL_PEDWARN,
1581 CPP_DL_WARNING or CPP_DL_ERROR for note that diagnostics for C++ style
1582 comments is reported only once per file and guard those calls on the
1583 preceding cpp_error returning true.
1585 2018-07-03 Nathan Sidwell <nathan@acm.org>
1587 Reorg line_map data structures for better packing.
1588 * include/line-map.h (enum lc_reason): Add LC_HWM.
1589 (LINE_MAP_MAX_LOCATION): Define here.
1590 (struct line_map): Move reason field to line_map_ordinary. Adjust
1592 (struct line_map_ordinary): Reorder fields for less padding.
1593 (struct line_map_macro): Likewise.
1594 (MAP_ORDINARY_P): New.
1595 (linemap_check_ordinary, linemap_check_macro): Adjust.
1596 * line-map.c (LINE_MAP_MAX_SOURCE_LOCATION): Delete.
1597 (new_linemap): Take start_location, not reason. Adjust.
1598 (linemap_add, linemap_enter_macro): Adjust.
1599 (linemap_line_start): Likewise.
1600 (linemap_macro_expansion_map_p): Use MAP_ORDINARY_P.
1601 (linemap_macro_loc_to_spelling_point): Likewise.
1602 (linemap_macro_loc_to_def_point): Likewise.
1603 (linemap_dump): Likewise.
1605 2018-05-23 Jason Merrill <jason@redhat.com>
1607 * system.h: #include <new> earlier.
1609 2018-05-17 Jason Merrill <jason@redhat.com>
1611 * line-map.c (linemap_init): Use placement new.
1612 * system.h: #include <new>.
1614 2018-03-14 David Malcolm <dmalcolm@redhat.com>
1616 * include/line-map.h (compare): New function on linenum_type.
1618 2018-02-28 Jonathan Wakely <jwakely@redhat.com>
1620 PR preprocessor/84517
1621 * lex.c (is_macro_not_literal_suffix): New function.
1622 (lex_raw_string, lex_string): Use is_macro_not_literal_suffix to
1623 decide when to issue -Wliteral-suffix warnings.
1625 2018-02-16 Richard Biener <rguenther@suse.de>
1628 * line-map.c (linemap_init): Avoid broken value-init when compiling
1631 2018-02-15 Jason Merrill <jason@redhat.com>
1632 Jakub Jelinek <jakub@redhat.com>
1634 PR preprocessor/83063 - __VA_OPT__ and ##
1635 PR preprocessor/83708
1636 * macro.c (vaopt_state): Reorder m_last_was_paste before m_state.
1637 (vaopt_state::vaopt_state): Adjust.
1638 (vaopt_state::update_flags): Add BEGIN and END.
1639 (vaopt_state::update): Return them.
1640 (copy_paste_flag): Factor out of replace_args.
1641 (last_token_is): New.
1642 (replace_args): Handle BEGIN and END. Avoid padding there.
1643 (tokens_buff_last_token_ptr): Return NULL if no tokens.
1645 2018-01-31 Jakub Jelinek <jakub@redhat.com>
1647 PR preprocessor/69869
1648 * traditional.c (skip_macro_block_comment): Return bool, true if
1649 the macro block comment is unterminated.
1650 (copy_comment): Use return value from skip_macro_block_comment instead
1653 2018-01-27 Jakub Jelinek <jakub@redhat.com>
1655 * include/cpplib.h (enum cpp_builtin_type): Change BT_LAST_USER from
1656 BT_FIRST_USER + 31 to BT_FIRST_USER + 63.
1658 2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
1661 * include/cpplib.h (cpp_callbacks::remap_filename): New callback.
1662 * macro.c (_cpp_builtin_macro_text): Call remap_filename for
1663 __FILE__ and __BASE_FILE__.
1665 2018-01-10 Kelvin Nilsen <kelvin@gcc.gnu.org>
1667 * lex.c (search_line_fast): Remove illegal coercion of an
1668 unaligned pointer value to vector pointer type and replace with
1669 use of __builtin_vec_vsx_ld () built-in function, which operates
1670 on unaligned pointer values.
1672 2018-01-03 Jakub Jelinek <jakub@redhat.com>
1674 Update copyright years.
1676 2017-12-20 Michael Weiser <michael.weiser@gmx.de>
1678 PR preprocessor/83492
1679 * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]:
1680 Fix selection of big-endian shift parameters by using
1683 2017-12-14 Bernd Edlinger <bernd.edlinger@hotmail.de>
1685 * internal.h (maybe_print_line): Change signature.
1687 2017-12-05 Jakub Jelinek <jakub@redhat.com>
1690 * expr.c (interpret_float_suffix): Avoid memcmp.
1691 (interpret_int_suffix): Likewise. Don't check for if.
1693 2017-12-01 Jason Merrill <jason@redhat.com>
1695 PR c++/79228 - extensions hide C++14 complex literal operators
1696 * expr.c (interpret_float_suffix): Ignore 'i' in C++14 and up.
1697 (interpret_int_suffix): Likewise.
1699 2017-11-28 David Malcolm <dmalcolm@redhat.com>
1702 * include/line-map.h (LINE_MAP_MAX_COLUMN_NUMBER): Move here.
1703 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): ...from here.
1704 (rich_location::maybe_add_fixit): Reject fix-it hints in which
1705 the start column exceeds the next column.
1707 2017-11-20 Eric Gallager <egall@gwmail.gwu.edu>
1709 PR preprocessor/81794
1710 * macro.c (check_trad_stringification): Have warning be controlled
1713 2017-11-20 David Malcolm <dmalcolm@redhat.com>
1716 * include/cpplib.h (cpp_macro_definition_location): New decl.
1717 * macro.c (cpp_macro_definition): New function.
1719 2017-11-13 Tom Tromey <tom@tromey.com>
1721 * pch.c (cpp_read_state): Set n__VA_OPT__.
1722 * macro.c (vaopt_state): New class.
1723 (_cpp_arguments_ok): Check va_opt flag.
1724 (replace_args, create_iso_definition): Use vaopt_state.
1725 * lex.c (lex_identifier_intern): Possibly issue errors for
1727 (lex_identifier): Likewise.
1728 (maybe_va_opt_error): New function.
1729 * internal.h (struct lexer_state) <va_args_ok>: Update comment.
1730 (struct spec_nodes) <n__VA_OPT__>: New field.
1731 * init.c (struct lang_flags) <va_opt>: New field.
1732 (lang_defaults): Add entries for C++2A. Update all entries for
1734 (cpp_set_lang): Initialize va_opt.
1735 * include/cpplib.h (struct cpp_options) <va_opt>: New field.
1736 * identifiers.c (_cpp_init_hashtable): Initialize n__VA_OPT__.
1738 2017-11-13 David Malcolm <dmalcolm@redhat.com>
1740 * include/line-map.h (linenum_type): Move this typedef and the
1741 comment describing column numbering to near the top of the file.
1743 2017-11-06 Mukesh Kapoor <mukesh.kapoor@oracle.com>
1746 * lex.c (lex_string): When checking for a valid macro for the
1747 warning related to -Wliteral-suffix (CPP_W_LITERAL_SUFFIX),
1748 check that the macro name does not start with an underscore
1749 before calling is_macro().
1751 2017-11-05 Tom de Vries <tom@codesourcery.com>
1754 * lex.c (BUF_APPEND): Remove semicolon after
1757 2017-10-31 David Malcolm <dmalcolm@redhat.com>
1759 * directives.c (_cpp_handle_directive): Update for renaming of
1760 cpp_error_at_richloc to cpp_error_at.
1761 * errors.c (cpp_diagnostic_at_richloc): Rename to...
1762 (cpp_diagnostic_at): ...this, dropping the location_t-based
1764 (cpp_diagnostic): Update for removal of location_t-based
1766 (cpp_error_at): Likewise.
1767 (cpp_error_at_richloc): Rename to...
1768 (cpp_error_at): ...this, and update for renaming of
1769 cpp_diagnostic_at_richloc.
1770 * include/cpplib.h (cpp_error_at_richloc): Rename to...
1771 (cpp_error_at): ...this.
1773 2017-10-30 Joseph Myers <joseph@codesourcery.com>
1775 * include/cpplib.h (enum c_lang): Add CLK_GNUC17 and CLK_STDC17.
1776 * init.c (lang_defaults): Add GNUC17 and STDC17 data.
1777 (cpp_init_builtins): Handle C17 value of __STDC_VERSION__.
1779 2017-10-10 Nathan Sidwell <nathan@acm.org>
1781 PR preprocessor/82506
1782 * macro.c (cpp_quote_string): Escape raw LFs.
1784 2017-09-15 Andrew Sutton <andrew.n.sutton@gmail.com>
1785 Jakub Jelinek <jakub@redhat.com>
1787 Add support for -std=c++2a.
1788 * include/cpplib.h (c_lang): Add CXX2A and GNUCXX2A.
1789 * init.c (lang_defaults): Add rows for CXX2A and GNUCXX2A.
1790 (cpp_init_builtins): Set __cplusplus to 201709L for C++2a.
1792 2017-09-15 Jakub Jelinek <jakub@redhat.com>
1794 * include/cpplib.h (enum c_lang): Rename CLK_GNUCXX1Z
1795 to CLK_GNUCXX17 and CLK_CXX1Z to CLK_CXX17.
1796 * init.c (lang_defaults, cpp_init_builtins): Likewise.
1797 * expr.c (cpp_classify_number): Use C++17 instead of C++1z
1800 2017-07-07 David Malcolm <dmalcolm@redhat.com>
1803 * line-map.c (linemap_macro_loc_to_def_point): Preserve range
1804 information for macro expansions by delaying resolving ad-hoc
1805 locations until within the loop.
1807 2017-07-06 David Malcolm <dmalcolm@redhat.com>
1810 * include/line-map.h (enum location_aspect): New enum.
1811 (linemap_client_expand_location_to_spelling_point): Add
1812 enum location_aspect param.
1813 * line-map.c (rich_location::get_expanded_location): Update for
1814 new param of linemap_client_expand_location_to_spelling_point.
1815 (rich_location::maybe_add_fixit): Likewise.
1816 (fixit_hint::affects_line_p): Likewise.
1818 2017-06-21 Jakub Jelinek <jakub@redhat.com>
1820 * line-map.c (location_adhoc_data_update): Perform addition in
1821 uintptr_t type rather than char * type. Read *data using
1822 ptrdiff_t type instead of int64_t.
1823 (get_combined_adhoc_loc): Change offset type to ptrdiff_t from
1826 2017-06-20 David Malcolm <dmalcolm@redhat.com>
1828 * include/line-map.h (class rich_location): Document that attempts
1829 to delete or replace a range *affecting* multiple lines will fail.
1830 * line-map.c (rich_location::maybe_add_fixit): Implement this
1833 2017-06-09 David Malcolm <dmalcolm@redhat.com>
1835 * include/line-map.h
1836 (rich_location::fixits_cannot_be_auto_applied): New method.
1837 (rich_location::fixits_can_be_auto_applied_p): New accessor.
1838 (rich_location::m_fixits_cannot_be_auto_applied): New field.
1839 * line-map.c (rich_location::rich_location): Initialize new field.
1841 2017-06-05 David Malcolm <dmalcolm@redhat.com>
1843 * include/cpplib.h (struct cpp_callbacks): Add "comment"
1845 * lex.c (_cpp_lex_direct): Call the comment callback if non-NULL.
1847 2017-05-02 David Malcolm <dmalcolm@redhat.com>
1849 * include/line-map.h (class rich_location): Update description of
1851 (class fixit_hint): Likewise.
1852 (fixit_hint::ends_with_newline_p): New decl.
1853 * line-map.c (rich_location::maybe_add_fixit): Support newlines
1854 in fix-it hints that are insertions of single lines at the start
1855 of a line. Don't consolidate into such fix-it hints.
1856 (fixit_hint::ends_with_newline_p): New method.
1858 2017-05-01 David Malcolm <dmalcolm@redhat.com>
1860 * include/line-map.h (source_range::intersects_line_p): Delete.
1861 (rich_location::add_fixit): Delete.
1862 (rich_location::maybe_add_fixit): New method.
1863 (class fixit_hint): Reimplement in terms of...
1864 (class fixit_replace): ...this.
1865 (class fixit_insert): Delete.
1866 * line-map.c (linemap_position_for_loc_and_offset): Drop overzealous
1867 linemap_assert_fails.
1868 (source_range::intersects_line_p): Rename to...
1869 (fixit_hint::affects_line_p): New function.
1870 (rich_location::add_fixit_insert_before): Reimplement in terms of
1871 maybe_add_fixit, moving validation there.
1872 (rich_location::add_fixit_insert_after): Likewise.
1873 (column_before_p): Delete.
1874 (rich_location::add_fixit_replace): Reimplement in terms of
1875 maybe_add_fixit, moving validation there. Convert closed input range
1877 (rich_location::add_fixit): Delete.
1878 (rich_location::maybe_add_fixit): New function.
1879 (fixit_insert::fixit_insert): Delete.
1880 (fixit_insert::~fixit_insert): Delete.
1881 (fixit_insert::affects_line_p): Delete.
1882 (fixit_insert::maybe_append_replace): Delete.
1883 (fixit_replace::fixit_replace): Rename to...
1884 (fixit_hint::fixit_hint): ...this, rewriting as necessary.
1885 (fixit_replace::~fixit_replace): Delete.
1886 (fixit_replace::affects_line_p): Delete.
1887 (fixit_replace::maybe_append_replace): Rename to...
1888 (fixit_hint::maybe_append): ...this, rewriting as necessary.
1890 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
1892 * include/line-map.h (LINEMAPS_MACRO_MAPS): Fix typo in comment.
1893 * lex.c (search_line_fast): Likewise.
1894 * pch.h (cpp_valid_state): Likewise.
1896 2017-03-21 Andreas Schwab <schwab@suse.de>
1898 * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]:
1899 Convert 64-bit value to boolean before passing to
1902 2017-03-16 Jason Merrill <jason@redhat.com>
1904 * init.c (cpp_init_builtins): Update __cplusplus for C++17.
1906 2017-02-09 Gerald Pfeifer <gerald@pfeifer.com>
1908 * Makefile.in (po/$(PACKAGE).pot): Adjust bug reporting URL.
1910 2017-01-10 David Malcolm <dmalcolm@redhat.com>
1913 * line-map.c (linemap_position_for_column): When calling
1914 linemap_start_line, detect if a new linemap was created with
1915 0 column bits, and bail out early if this is the case.
1916 (linemap_position_for_loc_and_offset): Replace overzealous
1917 linemap_assert_fails with a simple conditional; use correct
1920 2017-01-07 David Malcolm <dmalcolm@redhat.com>
1923 * line-map.c (linemap_line_start): When determining if the highest
1924 column given out so far will fit into a proposed change to the
1925 current map, use the effective number of column bits, rather than
1926 the total number of column + range bits.
1928 2017-01-01 Jakub Jelinek <jakub@redhat.com>
1930 Update copyright years.
1932 2016-12-15 David Malcolm <dmalcolm@redhat.com>
1934 PR preprocessor/78680
1935 PR preprocessor/78811
1936 * lex.c (_cpp_lex_direct): Only determine the end-location of
1937 the token and build a range for non-reserved start locations.
1938 Do not do it for EOF tokens.
1940 2016-12-12 David Malcolm <dmalcolm@redhat.com>
1942 PR preprocessor/78680
1943 * lex.c (_cpp_lex_direct): Ensure line notes are processed before
1944 computing the end-point of the token.
1946 2016-11-23 Paolo Bonzini <bonzini@gnu.org>
1948 * include/cpplib.h (struct cpp_options): Add new member
1949 warn_expansion_to_defined.
1950 (CPP_W_EXPANSION_TO_DEFINED): New enum member.
1951 * expr.c (parse_defined): Warn for all uses of "defined"
1952 in macros, and tie warning to CPP_W_EXPANSION_TO_DEFINED.
1953 Make it a pedwarning instead of a warning.
1954 * system.h (HAVE_DESIGNATED_INITIALIZERS): Do not use
1955 "defined" in macros.
1957 2016-11-17 David Malcolm <dmalcolm@redhat.com>
1959 * charset.c (cpp_interpret_string_1): Skip locations from
1960 loc_reader when advancing 'p' when handling raw strings.
1962 2016-11-16 Jakub Jelinek <jakub@redhat.com>
1965 * configure.ac (ENABLE_ASSERT_CHECKING): Define if gcc configure
1966 would define that macro.
1967 * configure: Regenerated.
1968 * config.in: Regenerated.
1970 2016-11-08 Richard Earnshaw <rearnsha@arm.com>
1972 * lex.c (search_line_fast): New implementation for AArch64.
1974 2016-10-25 David Malcolm <dmalcolm@redhat.com>
1976 * files.c (destroy_cpp_file): Free file->path.
1978 2016-10-25 David Malcolm <dmalcolm@redhat.com>
1980 * include/line-map.h (line_maps::~line_maps): New dtor.
1981 (location_adhoc_data_fini): Delete decl.
1982 * line-map.c (line_maps::~line_maps): New dtor.
1983 (location_adhoc_data_fini): Delete.
1985 2016-10-21 Andris Pavenis <andris.pavenis@iki.fi>
1987 PR preprocessor/71681
1988 * files.c (remap_filename): Fix handling -remap in subdirectories.
1990 2016-10-12 Jakub Jelinek <jakub@redhat.com>
1992 * include/cpplib.h (struct cpp_options): Add
1993 cpp_warn_implicit_fallthrough.
1994 * init.c (cpp_create_reader): Initialize it to 0.
1995 * lex.c (fallthrough_comment_p): Handle different
1996 cpp_warn_implicit_fallthrough levels. Whitespace fixes.
1998 2016-10-08 Jakub Jelinek <jakub@redhat.com>
2000 * lex.c (fallthrough_comment_p): Accept Else, fallthrough.
2002 * lex.c (fallthrough_comment_p): Extend to handle more common FALLTHRU
2005 * lex.c (fallthrough_comment_p): Fix off-by-one size comparison
2007 (_cpp_lex_direct): Allow arbitrary comments in between
2008 fallthrough_comment_p comment and following token.
2010 2016-10-04 Kelvin Nilsen <kelvin@gcc.gnu.org>
2013 * lex.c (search_line_fast): Add a FALLTHROUGH comment to correct
2014 compiler error in the version of this function that is
2015 conditionally compiled when GCC_VERSION >= 4005 and both
2016 __ALTIVEC__ and __BIG_ENDIAN__ symbols are defined.
2018 2016-09-26 Marek Polacek <polacek@redhat.com>
2019 Jakub Jelinek <jakub@redhat.com>
2022 * include/cpplib.h (PREV_FALLTHROUGH): Define.
2023 * internal.h (CPP_FALLTHRU): Define.
2024 * lex.c (fallthrough_comment_p): New function.
2025 (_cpp_lex_direct): Set PREV_FALLTHROUGH on tokens succeeding a falls
2028 2016-09-23 David Malcolm <dmalcolm@redhat.com>
2030 PR preprocessor/77672
2031 * charset.c (cpp_interpret_string_1): Add a source_range for the
2032 NUL-terminator, using the location of the trailing quote of the
2035 2016-09-21 Jason Merrill <jason@redhat.com>
2037 * line-map.c (linemap_location_from_macro_definition_p): New.
2038 * line-map.h: Declare it.
2040 2016-09-15 David Malcolm <dmalcolm@redhat.com>
2042 * include/line-map.h (class rich_location): Note that newlines
2043 aren't supported in fix-it text.
2044 * line-map.c (rich_location::add_fixit_insert_before): Reject
2045 attempts to add fix-its containing newlines.
2046 (rich_location::add_fixit_replace): Likewise.
2048 2016-09-13 David Malcolm <dmalcolm@redhat.com>
2050 * include/line-map.h (class rich_location): Add description of
2051 fix-it hints to leading comment.
2052 (rich_location::add_fixit_insert): Rename both overloaded methods
2054 (rich_location::add_fixit_insert_before): ...this, updating their
2056 (rich_location::add_fixit_insert_after): Two new overloaded
2058 (rich_location::stop_supporting_fixits): New method.
2059 * line-map.c (rich_location::add_fixit_insert): Rename both
2060 overloaded methods to..
2061 (rich_location::add_fixit_insert_before): ...this, updating their
2063 (rich_location::add_fixit_insert_after): Two new methods.
2064 (rich_location::reject_impossible_fixit): Split out
2065 failure-handling into...
2066 (rich_location::stop_supporting_fixits): New method.
2068 2016-09-02 David Malcolm <dmalcolm@redhat.com>
2070 * include/line-map.h (rich_location::seen_impossible_fixit_p): New
2073 2016-08-31 David Malcolm <dmalcolm@redhat.com>
2075 * include/line-map.h (class fixit_remove): Remove stray decl.
2076 (fixit_hint::affects_line_p): Make const.
2077 (fixit_insert::affects_line_p): Likewise.
2078 (fixit_replace::affects_line_p): Likewise.
2079 * line-map.c (fixit_insert::affects_line_p): Likewise.
2080 (fixit_replace::affects_line_p): Likewise.
2082 2016-08-30 David Malcolm <dmalcolm@redhat.com>
2084 * include/line-map.h (class semi_embedded_vec): New class.
2085 (semi_embedded_vec<T, NUM_EMBEDDED>::semi_embedded_vec): New ctor.
2086 (semi_embedded_vec<T, NUM_EMBEDDED>::~semi_embedded_vec): New
2088 (semi_embedded_vec<T, NUM_EMBEDDED>::operator[]): New methods.
2089 (semi_embedded_vec<T, NUM_EMBEDDED>::push): New method.
2090 (semi_embedded_vec<T, NUM_EMBEDDED>::truncate): New method.
2091 (rich_location::get_num_locations): Reimplement in terms of
2093 (rich_location::get_range): Make non-inline.
2094 (rich_location::get_num_fixit_hints): Reimplement in terms of
2096 (rich_location::add_fixit): New function.
2097 (rich_location::MAX_RANGES): Rename to...
2098 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this.
2099 (rich_location::MAX_FIXIT_HINTS): Rename to...
2100 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this, and make
2102 (rich_location::m_num_ranges): Eliminate in favor of...
2103 (rich_location::m_ranges): ...this, converting from a fixed-size
2104 array to a semi_embedded_vec.
2105 (rich_location::m_num_fixit_hints): Eliminate in favor of...
2106 (rich_location::m_fixit_hints): ...this, converting from a
2107 fixed-size array to a semi_embedded_vec.
2108 * line-map.c (rich_location::rich_location): Update for above
2110 (rich_location::~rich_location): Likewise.
2111 (rich_location::get_loc): Likewise.
2112 (rich_location::get_range): New methods.
2113 (rich_location::add_range): Update for above changes.
2114 (rich_location::set_range): Likewise.
2115 (rich_location::add_fixit_insert): Likewise.
2116 (rich_location::add_fixit_replace): Likewise.
2117 (rich_location::get_last_fixit_hint): Likewise.
2118 (rich_location::reject_impossible_fixit): Likewise.
2119 (rich_location::add_fixit): New method.
2121 2016-08-30 David Malcolm <dmalcolm@redhat.com>
2123 * include/line-map.h (rich_location::add_fixit_insert): Add
2124 comments. Add overload omitting the source_location param.
2125 (rich_location::add_fixit_remove): Add comments. Add overloads
2126 omitting the range, and accepting a source_location.
2127 (rich_location::add_fixit_replace): Likewise.
2128 * line-map.c (rich_location::add_fixit_insert): Add comments. Add
2129 overload omitting the source_location param.
2130 (rich_location::add_fixit_remove): Add comments. Add overloads
2131 omitting the range, and accepting a source_location.
2132 (rich_location::add_fixit_replace): Likewise.
2134 2016-08-26 David Malcolm <dmalcolm@redhat.com>
2136 * include/line-map.h (get_pure_location): New decl.
2137 * line-map.c (get_pure_location): Move here, from gcc/input.c, adding
2138 a line_maps * param.
2139 (rich_location::add_fixit_insert): Call get_pure_location on "where".
2140 (rich_location::add_fixit_replace): Call get_pure_location on the
2143 2016-08-26 David Malcolm <dmalcolm@redhat.com>
2145 * include/line-map.h (rich_location): Eliminate unimplemented
2146 constructor based on source_range.
2147 (rich_location::get_last_fixit_hint): New method.
2148 (rich_location::reject_impossible_fixit): New method.
2149 (rich_location): Add fields m_line_table and
2150 m_seen_impossible_fixit.
2151 (fixit_hint::maybe_append_replace): New pure virtual function.
2152 (fixit_insert::maybe_append_replace): New function.
2153 (fixit_replace::maybe_append_replace): New function.
2154 * line-map.c (rich_location::rich_location): Initialize
2155 m_line_table and m_seen_impossible_fixit.
2156 (rich_location::add_fixit_insert): Call
2157 reject_impossible_fixit and bail out if true.
2158 (column_before_p): New function.
2159 (rich_location::add_fixit_replace): Call reject_impossible_fixit
2160 and bail out if true. Attempt to consolidate with neighboring
2162 (rich_location::get_last_fixit_hint): New method.
2163 (rich_location::reject_impossible_fixit): New method.
2164 (fixit_insert::maybe_append_replace): New method.
2165 (fixit_replace::maybe_append_replace): New method.
2167 2016-08-23 David Malcolm <dmalcolm@redhat.com>
2169 * include/line-map.h (source_range::from_locations): New method.
2171 2016-08-19 David Malcolm <dmalcolm@redhat.com>
2173 * include/line-map.h (fixit_hint::kind): Delete REPLACE.
2174 (class fixit_remove): Delete.
2175 * line-map.c (rich_location::add_fixit_remove): Reimplement
2176 by calling add_fixit_replace with an empty string.
2177 (fixit_remove::fixit_remove): Delete.
2178 (fixit_remove::affects_line_p): Delete.
2180 2016-08-19 Joseph Myers <joseph@codesourcery.com>
2183 * include/cpplib.h (CPP_N_FLOATN, CPP_N_FLOATNX)
2184 (CPP_N_WIDTH_FLOATN_NX, CPP_FLOATN_SHIFT, CPP_FLOATN_MAX): New
2186 * expr.c (interpret_float_suffix): Handle fN, fNx, FN and FNx
2189 2016-08-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
2191 * expr.c (eval_token): Append "evaluates to 0" to Wundef diagnostic.
2193 2016-08-18 David Malcolm <dmalcolm@redhat.com>
2195 * directives.c (directive_names): New array.
2196 (_cpp_handle_directive): Offer spelling suggestions for misspelled
2198 * errors.c (cpp_diagnostic_at_richloc): New function.
2199 (cpp_error_at_richloc): New function.
2200 * include/cpplib.h (struct cpp_callbacks): Add field
2202 (cpp_error_at_richloc): New decl.
2204 2016-08-18 Marek Polacek <polacek@redhat.com>
2207 * pch.c (write_macdef): Add CPP_FALLTHRU.
2209 2016-08-12 Marek Polacek <polacek@redhat.com>
2212 * lex.c (search_line_fast): Add FALLTHRU.
2213 (_cpp_lex_direct): Likewise.
2214 (cpp_token_val_index): Adjust fall through comment.
2215 * macro.c (parse_params): Add FALLTHRU.
2216 * pch.c (count_defs): Adjust fall through comment.
2217 (write_defs): Likewise.
2219 2016-08-06 David Malcolm <dmalcolm@redhat.com>
2222 * charset.c (_cpp_valid_ucn): Replace overzealous assert with one
2223 that allows for char_range to be non-NULL when loc_reader is NULL.
2225 2016-08-05 David Malcolm <dmalcolm@redhat.com>
2227 * charset.c (cpp_substring_ranges::cpp_substring_ranges): New
2229 (cpp_substring_ranges::~cpp_substring_ranges): New destructor.
2230 (cpp_substring_ranges::add_range): New method.
2231 (cpp_substring_ranges::add_n_ranges): New method.
2232 (_cpp_valid_ucn): Add "char_range" and "loc_reader" params; if
2233 they are non-NULL, read position information from *loc_reader
2234 and update char_range->m_finish accordingly.
2235 (convert_ucn): Add "char_range", "loc_reader", and "ranges"
2236 params. If loc_reader is non-NULL, read location information from
2237 it, and update *ranges accordingly, using char_range.
2238 Conditionalize the conversion into tbuf on tbuf being non-NULL.
2239 (convert_hex): Likewise, conditionalizing the call to
2240 emit_numeric_escape on tbuf.
2241 (convert_oct): Likewise.
2242 (convert_escape): Add params "loc_reader" and "ranges". If
2243 loc_reader is non-NULL, read location information from it, and
2244 update *ranges accordingly. Conditionalize the conversion into
2245 tbuf on tbuf being non-NULL.
2246 (cpp_interpret_string): Rename to...
2247 (cpp_interpret_string_1): ...this, adding params "loc_readers" and
2248 "out". Use "to" to conditionalize the initialization and usage of
2249 "tbuf", such as running the converter. If "loc_readers" is
2250 non-NULL, use the instances within it, reading location
2251 information from them, and passing them to convert_escape; likewise
2252 write to "out" if loc_readers is non-NULL. Check for leading
2253 quote and issue an error if it is not present. Update boundary
2254 check from "== limit" to ">= limit" to protect against erroneous
2255 location values to calls that are not parsing string literals.
2256 (cpp_interpret_string): Reimplement in terms to
2257 cpp_interpret_string_1.
2258 (noop_error_cb): New function.
2259 (cpp_interpret_string_ranges): New function.
2260 (cpp_string_location_reader::cpp_string_location_reader): New
2262 (cpp_string_location_reader::get_next): New method.
2263 * include/cpplib.h (class cpp_string_location_reader): New class.
2264 (class cpp_substring_ranges): New class.
2265 (cpp_interpret_string_ranges): New prototype.
2266 * internal.h (_cpp_valid_ucn): Add params "char_range" and
2268 * lex.c (forms_identifier_p): Pass NULL for new params to
2271 2016-08-01 Andreas Schwab <schwab@suse.de>
2273 * include/cpplib.h: Fix comment typo.
2275 2016-07-27 David Malcolm <dmalcolm@redhat.com>
2277 * include/line-map.h (source_location): Fix line numbers in
2280 2016-07-11 David Malcolm <dmalcolm@redhat.com>
2282 * include/line-map.h (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES):
2283 Move here from line-map.c.
2284 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
2285 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): Move from
2287 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
2289 2016-06-22 David Malcolm <dmalcolm@redhat.com>
2291 * directives.c (do_include_common): Pass on "location" to
2293 * errors.c (cpp_diagnostic): Reimplement in terms of...
2294 (cpp_diagnostic_at): New function.
2295 (cpp_error_at): New function.
2296 (cpp_errno_filename): Add "loc" param and use it by using
2297 cpp_error_at rather than cpp_error.
2298 * files.c (find_file_in_dir): Add "loc" param and pass it to
2300 (_cpp_find_file): Add "loc" param. Use it to convert calls to
2301 cpp_error to cpp_error_at, and pass it to find_file_in_dir and
2303 (read_file_guts): Add "loc" param. Use it to convert calls to
2304 cpp_error to cpp_error_at. Pass it to cpp_errno_filename.
2305 (read_file): Add "loc" param. Pass it to open_file_failed and
2307 (should_stack_file): Add "loc" param. Pass it to read_file.
2308 (_cpp_stack_file): Add "loc" param. Pass it to should_stack_file.
2309 (_cpp_stack_include): Add "loc" param. Pass it to
2310 _cpp_find_file and _cpp_stack_file.
2311 (open_file_failed): Add "loc" param. Pass it to
2313 (_cpp_fake_include): Add 0 as a source_location in call to
2315 (_cpp_compare_file_date): Likewise.
2316 (cpp_push_include): Likewise for call to _cpp_stack_include.
2317 (cpp_push_default_include): Likewise.
2318 (_cpp_save_file_entries): Likewise for call to open_file_failed.
2319 (_cpp_has_header): Likewise for call to _cpp_find_file.
2320 * include/cpplib.h (cpp_errno_filename): Add source_location
2322 (cpp_error_at): New declaration.
2323 * init.c (cpp_read_main_file): Add 0 as a source_location in calls
2324 to _cpp_find_file and _cpp_stack_file.
2325 * internal.h (_cpp_find_file): Add source_location param.
2326 (_cpp_stack_file): Likewise.
2327 (_cpp_stack_include): Likewise.
2329 2016-06-22 David Malcolm <dmalcolm@redhat.com>
2331 * include/line-map.h (fixit_hint::get_start_loc): New pure virtual
2333 (fixit_hint::maybe_get_end_loc): Likewise.
2334 (fixit_insert::get_start_loc): New function, implementing
2335 fixit_hint::get_start_loc.
2336 (fixit_insert::maybe_get_end_loc): New function, implementing
2337 fixit_hint::maybe_get_end_loc.
2338 (fixit_remove::get_start_loc): New function, implementing
2339 fixit_hint::get_start_loc.
2340 (fixit_remove::maybe_get_end_loc): New function, implementing
2341 fixit_hint::maybe_get_end_loc.
2342 (fixit_replace::get_start_loc): New function, implementing
2343 fixit_hint::get_start_loc.
2344 (fixit_replace::maybe_get_end_loc): New function, implementing
2345 fixit_hint::maybe_get_end_loc.
2347 2016-06-21 John David Anglin <danglin@gcc.gnu.org>
2349 * line-map.c (location_adhoc_data_update): Use int64_t instead of
2351 (get_combined_adhoc_loc): Likewise.
2353 2016-06-01 Eduard Sanou <dhole@openmailbox.org>
2355 * include/cpplib.h (cpp_callbacks): Add get_source_date_epoch
2357 * include/cpplib.h (cpp_init_source_date_epoch): Remove prototype.
2358 * init.c (cpp_init_source_date_epoch): Remove function.
2359 * init.c (cpp_create_reader): Initialize pfile->source_date_epoch.
2360 * internal.h (cpp_reader): Extend comment about source_date_epoch.
2361 * macro.c (_cpp_builtin_macro_text): Use get_source_date_epoch
2362 callback only once, read pfile->source_date_epoch on future passes.
2363 Check that get_source_date_epoch callback is not NULL.
2365 2016-05-20 Martin Liska <mliska@suse.cz>
2367 * config.in: Regenerated.
2368 * configure: Likewise.
2369 * configure.ac: Handle --enable-valgrind-annotations.
2370 * lex.c (new_buff): Use ENABLE_VALGRIND_ANNOTATIONS instead
2371 of ENABLE_VALGRIND_CHECKING.
2372 (_cpp_free_buff): Likewise.
2374 2016-04-28 Eduard Sanou <dhole@openmailbox.org>
2375 Matthias Klose <doko@debian.org>
2377 * include/cpplib.h (cpp_init_source_date_epoch): Prototype.
2378 * init.c (cpp_init_source_date_epoch): New function.
2379 * internal.h: Added source_date_epoch variable to struct
2380 cpp_reader to store a reproducible date.
2381 * macro.c (_cpp_builtin_macro_text): Set pfile->date timestamp from
2382 pfile->source_date_epoch instead of localtime if source_date_epoch is
2383 set, to be used for __DATE__ and __TIME__ macros to help reproducible
2386 2016-04-13 Bernd Schmidt <bschmidt@redhat.com>
2388 Patch from Roger Orr <rogero@howzatt.demon.co.uk>
2389 PR preprocessor/69650
2390 * directives.c (do_linemarker): Reread map after calling
2393 2016-04-06 Richard Henderson <rth@redhat.com>
2395 PR preprocessor/61817
2396 PR preprocessor/69391
2397 * internal.h (_cpp_builtin_macro_text): Update decl.
2398 * macro.c (_cpp_builtin_macro_text): Accept location for __LINE__.
2399 (builtin_macro): Accept a second location for __LINE__.
2400 (enter_macro_context): Compute both virtual and real expansion
2401 locations for the macro.
2403 2016-03-25 Bernd Schmidt <bschmidt@redhat.com>
2406 * directives.c (do_linemarker): Test for file left but not entered
2408 * line-map.c (linemap_add): Not here.
2410 2016-03-21 Jakub Jelinek <jakub@redhat.com>
2413 * include/cpplib.h (cpp_fun_like_macro_p): New prototype.
2414 * macro.c (cpp_fun_like_macro_p): New function.
2416 2016-03-15 Richard Henderson <rth@redhat.com>
2418 * line-map.c (new_linemap): Make alloc_size a size_t.
2420 2016-03-14 Jason Merrill <jason@redhat.com>
2422 * expr.c (cpp_classify_number): Hex floats are new in C++1z.
2423 * init.c (lang_defaults): Likewise.
2425 2016-03-09 David Malcolm <dmalcolm@redhat.com>
2429 * line-map.c (linemap_macro_map_loc_unwind_toward_spelling): Move
2431 * include/line-map.h
2432 (linemap_macro_map_loc_unwind_toward_spelling): ...here,
2433 converting from static to extern.
2435 2016-03-09 David Malcolm <dmalcolm@redhat.com>
2439 * include/line-map.h (source_range::debug): Delete.
2440 (struct location_range): Update comment. Replace
2441 expanded_location fields "m_start", "m_finish", and "m_caret" with
2442 a source_location field: "m_loc".
2443 (class rich_location): Reword comment.
2444 (rich_location::get_loc): Reimplement in terms of a new overloaded
2445 variant which takes an unsigned int.
2446 (rich_location::get_loc_addr): Delete.
2447 (rich_location::add_range): Drop params "start" and "finish" in
2448 favor of param "loc". Drop overloaded variants taking a
2449 source_range or location_range *.
2450 (rich_location::lazily_expand_location): Delete in favor of...
2451 (rich_location::get_expanded_location): New decl.
2452 (rich_location::m_loc): Delete field.
2453 (rich_location::m_column_override): New field.
2454 * line-map.c (rich_location::rich_location): Drop name of
2455 line_maps * param. Update initializations for deletion of field
2456 "m_loc" and addition of field "m_column_override". Reimplement
2457 body as a call to add_range. Delete overloaded variant taking a
2459 (rich_location::get_loc): New function.
2460 (rich_location::lazily_expand_location): Delete in favor of...
2461 (rich_location::get_expanded_location): New function.
2462 (rich_location::override_column): Reimplement.
2463 (rich_location::add_range): Drop params "start" and "finish" in
2464 favor of param "loc". Eliminate location expansion in favor of
2465 simply storing loc. Drop overloaded variants taking a
2466 source_range or location_range *.
2467 (rich_location::set_range): Eliminate location expansion.
2469 2016-02-29 David Malcolm <dmalcolm@redhat.com>
2471 PR preprocessor/69985
2472 (linemap_position_for_loc_and_offset): Rename param from "offset"
2473 to "column_offset". Right-shift the column_offset by m_range_bits
2474 of the pertinent ordinary map whenever offsetting a
2475 source_location. For clarity, offset the column by the column
2476 offset, rather than the other way around.
2478 2016-02-23 David Malcolm <dmalcolm@redhat.com>
2480 PR preprocessor/69126
2481 PR preprocessor/69543
2482 * line-map.c (linemap_compare_locations): At the function top,
2483 replace inlined bodies of get_location_from_adhoc_loc with calls
2484 to get_location_from_adhoc_loc. Add a pair of calls to
2485 get_location_from_adhoc_loc at the bottom of the function, to
2486 avoid meaningless comparisons of ad-hoc and non-ad-hoc locations.
2488 2016-02-08 David Malcolm <dmalcolm@redhat.com>
2490 PR preprocessor/69664
2491 * errors.c (cpp_diagnostic_with_line): Only call
2492 rich_location::override_column if the column is non-zero.
2493 * line-map.c (rich_location::override_column): Update columns
2494 within m_ranges[0]. Add assertions to verify that doing so is
2497 2016-02-05 Jakub Jelinek <jakub@redhat.com>
2500 * charset.c (cpp_interpret_charconst): Clear *PCHARS_SEEN
2501 and *UNSIGNEDP if bailing out early due to errors.
2503 2016-01-28 Jakub Jelinek <jakub@redhat.com>
2506 * files.c (_cpp_find_file): Set file->implicit_preinclude even if
2507 included from file->implicit_preinclude header.
2509 * directives.c (destringize_and_run): Adjust prototype.
2511 2016-01-27 David Malcolm <dmalcolm@redhat.com>
2513 PR preprocessor/69126
2514 * directives.c (destringize_and_run): Add expansion_loc param; use
2515 it when handling unexpanded pragmas to fixup the locations of the
2517 (_cpp_do__Pragma): Add expansion_loc param and use it when calling
2518 destringize_and_run.
2519 * internal.h (_cpp_do__Pragma): Add expansion_loc param.
2520 * macro.c (builtin_macro): Pass expansion location of _Pragma to
2523 2016-01-14 David Malcolm <dmalcolm@redhat.com>
2525 PR preprocessor/69177
2526 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): New
2528 (LINE_MAP_MAX_LOCATION_WITH_COLS): Add note about unit tests
2530 (can_be_stored_compactly_p): Reduce threshold from
2531 LINE_MAP_MAX_LOCATION_WITH_COLS to
2532 LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES.
2533 (get_combined_adhoc_loc): Likewise.
2534 (get_range_from_loc): Likewise.
2535 (linemap_line_start): Ensure that a new ordinary map is created
2536 when transitioning from range-packing being enabled to disabled,
2537 at the LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES threshold. Set
2538 range_bits to 0 for new ordinary maps when beyond this limit.
2539 Prevent the "increase the column bits of a freshly created map"
2540 optimization if the range bits has reduced.
2542 2016-01-08 Jakub Jelinek <jakub@redhat.com>
2545 * files.c (cpp_included_before): If IS_ADHOC_LOC (location), lookup
2546 real location from the line_table.
2548 2016-01-04 Jakub Jelinek <jakub@redhat.com>
2550 Update copyright years.
2552 2015-12-22 David Malcolm <dmalcolm@redhat.com>
2554 * line-map.c (get_combined_adhoc_loc): Remove condition
2555 on locus < RESERVED_LOCATION_COUNT when considering
2556 whether a caret == start == finish location can be
2557 simply stored as the caret location.
2559 2015-12-07 David Malcolm <dmalcolm@redhat.com>
2561 * include/line-map.h (rich_location::set_range): Add line_maps *
2562 param; convert param from source_range to source_location. Drop
2563 "overwrite_loc_p" param.
2564 * line-map.c (rich_location::set_range): Likewise, acting as if
2565 "overwrite_loc_p" were true, and getting range from the location.
2567 2015-11-20 David Malcolm <dmalcolm@redhat.com>
2570 * include/line-map.h (source_range::intersects_line_p): New
2572 (rich_location::~rich_location): New.
2573 (rich_location::add_fixit_insert): New method.
2574 (rich_location::add_fixit_remove): New method.
2575 (rich_location::add_fixit_replace): New method.
2576 (rich_location::get_num_fixit_hints): New accessor.
2577 (rich_location::get_fixit_hint): New accessor.
2578 (rich_location::MAX_FIXIT_HINTS): New constant.
2579 (rich_location::m_num_fixit_hints): New field.
2580 (rich_location::m_fixit_hints): New field.
2581 (class fixit_hint): New class.
2582 (class fixit_insert): New class.
2583 (class fixit_remove): New class.
2584 (class fixit_replace): New class.
2585 * line-map.c (source_range::intersects_line_p): New method.
2586 (rich_location::rich_location): Add initialization of
2587 m_num_fixit_hints to both ctors.
2588 (rich_location::~rich_location): New.
2589 (rich_location::add_fixit_insert): New method.
2590 (rich_location::add_fixit_remove): New method.
2591 (rich_location::add_fixit_replace): New method.
2592 (fixit_insert::fixit_insert): New.
2593 (fixit_insert::~fixit_insert): New.
2594 (fixit_insert::affects_line_p): New.
2595 (fixit_remove::fixit_remove): New.
2596 (fixit_remove::affects_line_p): New.
2597 (fixit_replace::fixit_replace): New.
2598 (fixit_replace::~fixit_replace): New.
2599 (fixit_replace::affects_line_p): New.
2601 2015-11-19 Jakub Jelinek <jakub@redhat.com>
2603 PR preprocessor/60736
2604 * include/cpplib.h (cpp_errno_filename): New prototype.
2605 * errors.c (cpp_errno): Don't handle msgid "" specially, use
2606 _(msgid) instead of msgid as argument to cpp_error.
2607 (cpp_errno_filename): New function.
2608 * files.c (read_file_guts): Use cpp_errno_filename instead of
2610 (open_file_failed): Likewise. Use file->name if file->path is NULL
2613 2015-11-13 David Malcolm <dmalcolm@redhat.com>
2615 * errors.c (cpp_diagnostic): Pass pfile->line_table to
2617 (cpp_diagnostic_with_line): Likewise.
2618 * include/cpplib.h (struct cpp_token): Update comment for src_loc
2619 to indicate that the range of the token is "baked into" the
2621 * include/line-map.h (source_location): Update the descriptive
2622 comment to reflect the packing scheme for short ranges, adding
2623 worked examples of location encoding.
2624 (struct line_map_ordinary): Drop field "column_bits" in favor
2625 of field "m_column_and_range_bits"; add field "m_range_bits".
2626 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
2627 (location_adhoc_data): Add source_range field.
2628 (struct line_maps): Add fields "default_range_bits",
2629 "num_optimized_ranges" and "num_unoptimized_ranges".
2630 (get_combined_adhoc_loc): Add source_range param.
2631 (get_range_from_loc): New declaration.
2632 (pure_location_p): New prototype.
2633 (COMBINE_LOCATION_DATA): Add source_range param.
2634 (SOURCE_LINE): Update for renaming of column_bits.
2635 (SOURCE_COLUMN): Likewise. Shift the column right by the map's
2637 (LAST_SOURCE_LINE_LOCATION): Update for renaming of column_bits.
2638 (linemap_position_for_line_and_column): Add line_maps * params.
2639 (rich_location::rich_location): Likewise.
2640 * lex.c (_cpp_lex_direct): Capture the range of the token, baking
2641 it into token->src_loc via a call to COMBINE_LOCATION_DATA.
2642 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): Reduce from 1U << 17 to
2644 (location_adhoc_data_hash): Add the src_range into
2646 (location_adhoc_data_eq): Require equality of the src_range
2648 (can_be_stored_compactly_p): New function.
2649 (get_combined_adhoc_loc): Add src_range param, and store it,
2650 via a bit-packing scheme for short ranges, otherwise within the
2651 lookaside table. Remove the requirement that data is non-NULL.
2652 (get_range_from_adhoc_loc): New function.
2653 (get_range_from_loc): New function.
2654 (pure_location_p): New function.
2655 (linemap_add): Ensure that start_location has zero for the
2656 range_bits, unless we're past LINE_MAP_MAX_LOCATION_WITH_COLS.
2657 Initialize range_bits to zero. Assert that the start_location
2659 (linemap_line_start): Assert that the
2660 column_and_range_bits >= range_bits.
2661 Update determinination of whether we need to start a new map
2662 using the effective column bits, without the range bits.
2663 Use the set's default_range_bits in new maps, apart from
2664 those with column_bits == 0, which should also have 0 range_bits.
2665 Increase the column bits for new maps by the range bits.
2666 When adding lines to an existing map, use set->highest_line
2667 directly rather than offsetting highest by SOURCE_COLUMN.
2668 Add assertions to sanity-check the return value.
2669 (linemap_position_for_column): Offset to_column by range_bits.
2670 Update set->highest_location if necessary.
2671 (linemap_position_for_line_and_column): Add line_maps * param.
2672 Update the calculation to offset the column by range_bits, and
2673 conditionalize it on being <= LINE_MAP_MAX_LOCATION_WITH_COLS.
2674 Bound it by LINEMAPS_MACRO_LOWEST_LOCATION. Update
2675 set->highest_location if necessary.
2676 (linemap_position_for_loc_and_offset): Handle ad-hoc locations;
2677 pass "set" to linemap_position_for_line_and_column.
2678 (linemap_macro_map_loc_unwind_toward_spelling): Add line_maps
2679 param. Handle ad-hoc locations.
2680 (linemap_location_in_system_header_p): Pass on "set" to call to
2681 linemap_macro_map_loc_unwind_toward_spelling.
2682 (linemap_macro_loc_to_spelling_point): Retain ad-hoc locations.
2683 Pass on "set" to call to
2684 linemap_macro_map_loc_unwind_toward_spelling.
2685 (linemap_resolve_location): Retain ad-hoc locations. Pass on
2686 "set" to call to linemap_macro_map_loc_unwind_toward_spelling.
2687 (linemap_unwind_toward_expansion): Pass on "set" to call to
2688 linemap_macro_map_loc_unwind_toward_spelling.
2689 (linemap_expand_location): Extract the data pointer before
2690 extracting the location.
2691 (rich_location::rich_location): Add line_maps param; use it to
2692 extract the range from the source_location.
2693 * location-example.txt: Regenerate, showing new representation.
2695 2015-11-06 David Malcolm <dmalcolm@redhat.com>
2697 * errors.c (cpp_diagnostic): Update for change in signature
2698 of "error" callback.
2699 (cpp_diagnostic_with_line): Likewise, calling override_column
2700 on the rich_location.
2701 * include/cpplib.h (struct cpp_callbacks): Within "error"
2702 callback, convert param from source_location to rich_location *,
2703 and drop column_override param.
2704 * include/line-map.h (struct source_range): New struct.
2705 (struct location_range): New struct.
2706 (class rich_location): New class.
2707 (linemap_client_expand_location_to_spelling_point): New declaration.
2708 * line-map.c (rich_location::rich_location): New ctors.
2709 (rich_location::lazily_expand_location): New method.
2710 (rich_location::override_column): New method.
2711 (rich_location::add_range): New methods.
2712 (rich_location::set_range): New method.
2714 2015-11-06 David Malcolm <dmalcolm@redhat.com>
2716 * include/line-map.h (struct linemap_stats): Add fields
2717 "adhoc_table_size" and "adhoc_table_entries_used".
2718 * line-map.c (linemap_get_statistics): Populate above fields.
2720 2015-11-04 Mikhail Maltsev <maltsevm@gmail.com>
2722 * config.in: Regenerate.
2723 * configure: Regenerate.
2724 * configure.ac: Remove ENABLE_CHECKING.
2726 2015-11-03 Uros Bizjak <ubizjak@gmail.com>
2728 * lex.c (search_line_sse42): Correctly advance the pointer to an
2731 2015-11-02 David Malcolm <dmalcolm@redhat.com>
2733 * include/line-map.h (source_location): In the table in the
2734 descriptive comment, show UNKNOWN_LOCATION, BUILTINS_LOCATION,
2735 LINE_MAP_MAX_LOCATION_WITH_COLS, LINE_MAP_MAX_SOURCE_LOCATION.
2736 Add notes about ad-hoc values.
2738 2015-10-21 Mikhail Maltsev <maltsevm@gmail.com>
2740 * include/line-map.h: Use CHECKING_P instead of ENABLE_CHECKING.
2742 * macro.c (struct macro_arg_token_iter, set_arg_token,
2743 macro_arg_token_iter_init, macro_arg_token_iter_forward,
2744 macro_arg_token_iter_get_token, macro_arg_token_iter_get_location,
2745 alloc_expanded_arg_mem, _cpp_backup_tokens): Likewise.
2747 * config.in: Regenerate.
2748 * configure: Regenerate.
2749 * configure.ac (CHECKING_P): Define.
2750 * system.h (fancy_abort): Declare.
2752 (gcc_assert): Define. Use CHECKING_P.
2754 2015-10-13 Mikhail Maltsev <maltsevm@gmail.com>
2756 * system.h (CHECKING_P, gcc_checking_assert): Define.
2758 2015-09-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
2761 * line-map.c (linemap_position_for_loc_and_offset): Handle the
2762 case of long lines encoded in multiple maps.
2764 2015-09-07 Marek Polacek <polacek@redhat.com>
2766 * system.h (INTTYPE_MINIMUM): Rewrite to avoid shift warning.
2768 2015-08-06 Yaakov Selkowitz <yselkowi@redhat.com>
2770 * configure: Regenerate.
2772 2015-07-08 Thomas Schwinge <thomas@codesourcery.com>
2774 * include/line-map.h (RESERVED_LOCATION_COUNT): Change type to
2777 2015-07-02 Paolo Carlini <paolo.carlini@oracle.com>
2779 PR preprocessor/53690
2780 * charset.c (_cpp_valid_ucn): Add cppchar_t * parameter and change
2781 return type to bool. Fix encoding of \u0000 and \U00000000 in C++.
2782 (convert_ucn): Adjust call.
2783 * lex.c (forms_identifier_p): Likewise.
2784 * internal.h (_cpp_valid_ucn): Adjust declaration.
2786 2015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
2788 Implement N4197 - Adding u8 character literals
2789 * include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens;
2790 (struct cpp_options): Add utf8_char_literals.
2791 * init.c (struct lang_flags): Add utf8_char_literals;
2792 (struct lang_flags lang_defaults): Add column for utf8_char_literals.
2793 * macro.c (stringify_arg()): Treat CPP_UTF8CHAR token;
2794 * expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()):
2795 Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens;
2796 (cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token;
2797 (eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token.
2798 * lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens.
2799 * charset.c (converter_for_type(), cpp_interpret_charconst()):
2800 Treat CPP_UTF8CHAR token.
2802 2015-06-30 Uros Bizjak <ubizjak@gmail.com>
2804 * lex.c (search_line_sse42) [__GCC_ASM_FLAG_OUTPUTS__]: New main
2805 loop using asm flag outputs.
2807 2015-06-08 Marek Polacek <polacek@redhat.com>
2810 * line-map.c (linemap_position_for_loc_and_offset): Remove
2811 linemap_assert_fails; reverse conditions.
2813 2015-05-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
2815 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER
2816 LINE_MAP_MAX_LOCATION_WITH_COLS,LINE_MAP_MAX_SOURCE_LOCATION):
2818 (linemap_line_start): Use them.
2819 (linemap_position_for_column): Use them.
2821 2015-05-20 David Malcolm <dmalcolm@redhat.com>
2823 * include/line-map.h (MAP_START_LOCATION): Eliminate the non-const
2824 variant, and tweak comment for the const variant.
2825 (ORDINARY_MAP_STARTING_LINE_NUMBER): Drop the non-const variant.
2826 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
2827 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
2828 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
2829 (ORDINARY_MAP_FILE_NAME): Drop the non-const variant.
2830 (MACRO_MAP_MACRO): Likewise.
2831 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
2832 (MACRO_MAP_LOCATIONS): Likewise.
2833 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
2834 * line-map.c (linemap_add): Replace writes through macros with
2835 direct field accesses.
2836 (linemap_enter_macro): Likewise.
2837 (linemap_line_start): Likewise.
2839 2015-05-19 David Malcolm <dmalcolm@redhat.com>
2841 * directives.c (do_line): Strengthen local "map" from
2842 const line_map * to const line_map_ordinary *.
2843 (do_linemarker): Likewise.
2844 (_cpp_do_file_change): Assert that we're not dealing with
2845 a macro map. Introduce local "ord_map" via a call to
2846 linemap_check_ordinary, guarded within the check for
2847 non-NULL. Use it for typesafety.
2848 * files.c (cpp_make_system_header): Strengthen local "map" from
2849 const line_map * to const line_map_ordinary *.
2850 * include/cpplib.h (struct cpp_callbacks): Likewise for second
2851 parameter of "file_change" callback.
2852 * include/line-map.h (struct line_map): Convert from a struct
2853 containing a union to a base class.
2854 (struct line_map_ordinary): Convert to a subclass of line_map.
2855 (struct line_map_macro): Likewise.
2856 (linemap_check_ordinary): Strengthen return type from line_map *
2857 to line_map_ordinary *, and add a const-variant.
2858 (linemap_check_macro): New pair of functions.
2859 (ORDINARY_MAP_STARTING_LINE_NUMBER): Strengthen param from
2860 const line_map * to const line_map_ordinary *, eliminating call
2861 to linemap_check_ordinary. Likewise for the non-const variant.
2862 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
2863 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
2864 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Likewise.
2865 (ORDINARY_MAP_FILE_NAME): Likewise.
2866 (MACRO_MAP_MACRO): Strengthen param from const line_map * to
2867 const line_map_macro *. Likewise for the non-const variant.
2868 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
2869 (MACRO_MAP_LOCATIONS): Likewise.
2870 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
2871 (struct maps_info): Replace with...
2872 (struct maps_info_ordinary):...this and...
2873 (struct maps_info_macro): ...this.
2874 (struct line_maps): Convert fields "info_ordinary" and
2875 "info_macro" to the above new structs.
2876 (LINEMAPS_MAP_INFO): Delete both functions.
2877 (LINEMAPS_MAPS): Likewise.
2878 (LINEMAPS_ALLOCATED): Rewrite both variants to avoid using
2880 (LINEMAPS_USED): Likewise.
2881 (LINEMAPS_CACHE): Likewise.
2882 (LINEMAPS_MAP_AT): Likewise.
2883 (LINEMAPS_ORDINARY_MAPS): Strengthen return type from line_map *
2884 to line_map_ordinary *.
2885 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
2886 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
2887 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
2888 (LINEMAPS_MACRO_MAPS): Strengthen return type from line_map * to
2890 (LINEMAPS_MACRO_MAP_AT): Likewise.
2891 (LINEMAPS_LAST_MACRO_MAP): Likewise.
2892 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
2893 (linemap_map_get_macro_name): Strengthen param from
2894 const line_map * to const line_map_macro *.
2895 (SOURCE_LINE): Strengthen first param from const line_map * to
2896 const line_map_ordinary *, removing call to
2897 linemap_check_ordinary.
2898 (SOURCE_COLUMN): Likewise.
2899 (LAST_SOURCE_LINE_LOCATION): Likewise.
2900 (LAST_SOURCE_LINE): Strengthen first param from const line_map *
2901 to const line_map_ordinary *.
2902 (LAST_SOURCE_COLUMN): Likewise.
2903 (INCLUDED_FROM): Strengthen return type from line_map * to
2904 line_map_ordinary *., and second param from const line_map *
2905 to const line_map_ordinary *, removing call to
2906 linemap_check_ordinary.
2907 (MAIN_FILE_P): Strengthen param from const line_map * to
2908 const line_map_ordinary *, removing call to
2909 linemap_check_ordinary.
2910 (linemap_position_for_line_and_column): Strengthen param from
2911 const line_map * to const line_map_ordinary *.
2912 (LINEMAP_FILE): Strengthen param from const line_map * to
2913 const line_map_ordinary *, removing call to
2914 linemap_check_ordinary.
2915 (LINEMAP_LINE): Likewise.
2916 (LINEMAP_SYSP): Likewise.
2917 (linemap_resolve_location): Strengthen final param from
2918 const line_map ** to const line_map_ordinary **.
2919 * internal.h (CPP_INCREMENT_LINE): Likewise for local "map".
2920 (linemap_enter_macro): Strengthen return type from
2921 const line_map * to const line_map_macro *.
2922 (linemap_add_macro_token): Likewise for first param.
2923 * line-map.c (linemap_check_files_exited): Strengthen local "map"
2924 from const line_map * to const line_map_ordinary *.
2925 (new_linemap): Introduce local "map_size" and use it when
2926 calculating how large the buffer should be. Rewrite based
2927 on change of info_macro and info_ordinary into distinct types.
2928 (linemap_add): Strengthen locals "map" and "from" from line_map *
2929 to line_map_ordinary *.
2930 (linemap_enter_macro): Strengthen return type from
2931 const line_map * to const line_map_macro *, and local "map" from
2932 line_map * to line_map_macro *.
2933 (linemap_add_macro_token): Strengthen param "map" from
2934 const line_map * to const line_map_macro *.
2935 (linemap_line_start): Strengthen local "map" from line_map * to
2936 line_map_ordinary *.
2937 (linemap_position_for_column): Likewise.
2938 (linemap_position_for_line_and_column): Strengthen first param
2939 from const line_map * to const line_map_ordinary *.
2940 (linemap_position_for_loc_and_offset): Strengthen local "map" from
2941 const line_map * to const line_map_ordinary *.
2942 (linemap_ordinary_map_lookup): Likewise for return type and locals
2943 "cached" and "result".
2944 (linemap_macro_map_lookup): Strengthen return type and locals
2945 "cached" and "result" from const line_map * to
2946 const line_map_macro *.
2947 (linemap_macro_map_loc_to_exp_point): Likewise for param "map".
2948 (linemap_macro_map_loc_to_def_point): Likewise.
2949 (linemap_macro_map_loc_unwind_toward_spelling): Likewise.
2950 (linemap_get_expansion_line): Strengthen local "map" from
2951 const line_map * to const line_map_ordinary *.
2952 (linemap_get_expansion_filename): Likewise.
2953 (linemap_map_get_macro_name): Strengthen param from
2954 const line_map * to const line_map_macro *.
2955 (linemap_location_in_system_header_p): Add call to
2956 linemap_check_ordinary in region guarded by
2957 !linemap_macro_expansion_map_p. Introduce local "macro_map" via
2958 linemap_check_macro in other region, using it in place of "map"
2960 (first_map_in_common_1): Add calls to linemap_check_macro.
2961 (trace_include): Strengthen param "map" from const line_map * to
2962 const line_map_ordinary *.
2963 (linemap_macro_loc_to_spelling_point): Strengthen final param from
2964 const line_map ** to const line_map_ordinary **. Replace a
2965 C-style cast with a const_cast, and add calls to
2966 linemap_check_macro and linemap_check_ordinary.
2967 (linemap_macro_loc_to_def_point): Likewise.
2968 (linemap_macro_loc_to_exp_point): Likewise.
2969 (linemap_resolve_location): Strengthen final param from
2970 const line_map ** to const line_map_ordinary **.
2971 (linemap_unwind_toward_expansion): Introduce local "macro_map" via
2972 a checked cast and use it in place of *map.
2973 (linemap_unwind_to_first_non_reserved_loc): Strengthen local
2974 "map1" from const line_map * to const line_map_ordinary *.
2975 (linemap_expand_location): Introduce local "ord_map" via a checked
2976 cast and use it in place of map.
2977 (linemap_dump): Make local "map" const. Strengthen local
2978 "includer_map" from line_map * to const line_map_ordinary *.
2979 Introduce locals "ord_map" and "macro_map" via checked casts and
2980 use them in place of "map" for typesafety.
2981 (linemap_dump_location): Strengthen local "map" from
2982 const line_map * to const line_map_ordinary *.
2983 (linemap_get_file_highest_location): Update for elimination of
2985 (linemap_get_statistics): Strengthen local "cur_map" from
2986 line_map * to const line_map_macro *. Update uses of sizeof to
2987 use the appropriate line_map subclasses.
2988 * macro.c (_cpp_warn_if_unused_macro): Add call to
2989 linemap_check_ordinary.
2990 (builtin_macro): Strengthen local "map" from const line_map * to
2991 const line_map_macro *.
2992 (enter_macro_context): Likewise.
2993 (replace_args): Likewise.
2994 (tokens_buff_put_token_to): Likewise for param "map".
2995 (tokens_buff_add_token): Likewise.
2997 2015-05-13 David Malcolm <dmalcolm@redhat.com>
2999 * include/line-map.h (source_location): Add a reference to
3000 location-example.txt to the descriptive comment.
3001 * location-example.txt: New file.
3003 2015-05-13 David Malcolm <dmalcolm@redhat.com>
3005 * include/line-map.h (MAX_SOURCE_LOCATION): Convert from a macro
3006 to a const source_location.
3007 (RESERVED_LOCATION_COUNT): Likewise.
3008 (linemap_check_ordinary): Convert from a macro to a pair of inline
3009 functions, for const/non-const arguments.
3010 (MAP_START_LOCATION): Likewise.
3011 (ORDINARY_MAP_STARTING_LINE_NUMBER): Likewise.
3012 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
3013 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
3014 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Convert from a macro to a
3015 pair of inline functions, for const/non-const arguments, where the
3017 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): New function.
3018 (ORDINARY_MAP_FILE_NAME): Convert from a macro to a pair of inline
3019 functions, for const/non-const arguments.
3020 (MACRO_MAP_MACRO): Likewise.
3021 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
3022 (MACRO_MAP_LOCATIONS): Likewise.
3023 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
3024 (LINEMAPS_MAP_INFO): Likewise.
3025 (LINEMAPS_MAPS): Likewise.
3026 (LINEMAPS_ALLOCATED): Likewise.
3027 (LINEMAPS_USED): Likewise.
3028 (LINEMAPS_CACHE): Likewise.
3029 (LINEMAPS_ORDINARY_CACHE): Likewise.
3030 (LINEMAPS_MACRO_CACHE): Likewise.
3031 (LINEMAPS_MAP_AT): Convert from a macro to an inline function.
3032 (LINEMAPS_LAST_MAP): Likewise.
3033 (LINEMAPS_LAST_ALLOCATED_MAP): Likewise.
3034 (LINEMAPS_ORDINARY_MAPS): Likewise.
3035 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
3036 (LINEMAPS_ORDINARY_ALLOCATED): Likewise.
3037 (LINEMAPS_ORDINARY_USED): Likewise.
3038 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
3039 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
3040 (LINEMAPS_MACRO_MAPS): Likewise.
3041 (LINEMAPS_MACRO_MAP_AT): Likewise.
3042 (LINEMAPS_MACRO_ALLOCATED): Likewise.
3043 (LINEMAPS_MACRO_USED): Likewise.
3044 (LINEMAPS_MACRO_LOWEST_LOCATION): Likewise.
3045 (LINEMAPS_LAST_MACRO_MAP): Likewise.
3046 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
3047 (IS_ADHOC_LOC): Likewise.
3048 (COMBINE_LOCATION_DATA): Likewise.
3049 (SOURCE_LINE): Likewise.
3050 (SOURCE_COLUMN): Likewise.
3051 (LAST_SOURCE_LINE_LOCATION): Likewise.
3052 (LAST_SOURCE_LINE): Likewise.
3053 (LAST_SOURCE_COLUMN): Likewise.
3054 (LAST_SOURCE_LINE_LOCATION)
3055 (INCLUDED_FROM): Likewise.
3056 (MAIN_FILE_P): Likewise.
3057 (LINEMAP_FILE): Likewise.
3058 (LINEMAP_LINE): Likewise.
3059 (LINEMAP_SYSP): Likewise.
3060 (linemap_location_before_p): Likewise.
3061 * line-map.c (linemap_check_files_exited): Make local "map" const.
3062 (linemap_add): Use SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS.
3063 (linemap_line_start): Likewise.
3065 2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
3067 * aclocal.m4: Regenerated with automake-1.11.6.
3069 2015-05-13 David Malcolm <dmalcolm@redhat.com>
3071 * include/line-map.h (linemap_assert): Move up within the file to
3072 before all of the map accessor macros.
3073 (linemap_assert_fails): Likewise.
3074 (linemap_check_ordinary): Likewise.
3075 (linemap_macro_expansion_map_p): Likewise.
3077 2015-05-12 David Malcolm <dmalcolm@redhat.com>
3079 * directives.c (do_line): Set seen_line_directive on line_table.
3080 (do_linemarker): Likewise.
3081 * include/line-map.h (struct line_maps): Add new field
3082 "seen_line_directive".
3084 2015-05-08 Jason Merrill <jason@redhat.com>
3086 * include/cpplib.h: Add CPP_W_CXX11_COMPAT.
3087 (struct cpp_options): Add cpp_warn_cxx11_compat.
3088 * init.c (cpp_create_reader): Initialize it.
3089 * lex.c (lex_string): Add -Wc++11-compat warning.
3091 2015-05-05 David Malcolm <dmalcolm@redhat.com>
3093 * pch.c (cpp_valid_state): Fix indentation so that it reflects the
3096 2015-05-05 David Malcolm <dmalcolm@redhat.com>
3098 * include/line-map.h: Fix comment at the top of the file.
3099 (source_location): Rewrite and expand the comment for this
3100 typedef, adding an ascii-art table to clarify how source_location
3101 values are allocated.
3102 * line-map.c: Fix comment at the top of the file.
3104 2015-04-09 Richard Biener <rguenther@suse.de>
3107 * files.c (pch_open_file): Allow main and pre-included files
3108 when trying to open a PCH.
3110 2015-04-06 Jakub Jelinek <jakub@redhat.com>
3112 PR preprocessor/61977
3113 * lex.c (cpp_peek_token): If peektok is CPP_EOF, back it up
3114 with all tokens peeked by the current function.
3116 2015-04-02 Jakub Jelinek <jakub@redhat.com>
3118 PR preprocessor/61977
3119 * lex.c (cpp_peek_token): Temporarily clear pfile->cb.line_change.
3121 2015-03-23 Jakub Jelinek <jakub@redhat.com>
3123 PR preprocessor/65238
3124 * internal.h (_cpp_scan_out_logical_line): Add third argument.
3125 * directives.c (prepare_directive_trad): Pass false to it.
3126 * traditional.c (_cpp_read_logical_line_trad,
3127 _cpp_create_trad_definition): Likewise.
3128 (struct fun_macro): Add paramc field.
3129 (fun_like_macro): New function.
3130 (maybe_start_funlike): Handle NODE_BUILTIN macros. Initialize
3131 macro->paramc field.
3132 (save_argument): Use macro->paramc instead of
3133 macro->node->value.macro->paramc.
3134 (push_replacement_text): Formatting fix.
3135 (recursive_macro): Use fun_like_macro helper.
3136 (_cpp_scan_out_logical_line): Likewise. Add BUILTIN_MACRO_ARG
3137 argument. Initialize fmacro.paramc field. Handle builtin
3138 function-like macros.
3140 2015-03-16 Edward Smith-Rowland <3dw4rd@verizon.net>
3143 * lex.c (lex_number): If a number ends with digit-seps (') skip back
3144 and let lex_string take them.
3146 2015-03-02 Markus Trippelsdorf <markus@trippelsdorf.de>
3149 * lex.c (search_line_fast): Silence ubsan errors.
3151 2015-02-03 <dodji@redhat.com>
3153 PR preprocessor/64803
3154 * internal.h (cpp_reader::top_most_macro_node): New data member.
3155 * macro.c (enter_macro_context): Pass the location of the end of
3156 the top-most invocation of the function-like macro, or the
3157 location of the expansion point of the top-most object-like macro.
3158 (cpp_get_token_1): Store the top-most macro node in the new
3159 pfile->top_most_macro_node data member.
3160 (_cpp_pop_context): Clear the new cpp_reader::top_most_macro_node
3163 2015-01-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
3165 * lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON.
3167 2015-01-23 Marek Polacek <polacek@redhat.com>
3170 PR preprocessor/60570
3171 * directives.c (do_elif): Don't evaluate #elif conditionals
3172 when they don't need to be.
3174 2015-01-16 Jakub Jelinek <jakub@redhat.com>
3176 * expr.c (cpp_classify_number): Add N_() around ?: string
3177 literals used in cpp_error_with_line call as format string.
3179 2015-01-05 Jakub Jelinek <jakub@redhat.com>
3181 Update copyright years.
3183 2014-12-19 Jakub Jelinek <jakub@redhat.com>
3185 PR preprocessor/63831
3186 * directives.c (lex_macro_node): Remove __has_attribute__ handling.
3187 * internal.h (struct spec_node): Remove n__has_attribute__ field.
3188 (struct lexer_state): Remove in__has_attribute__ field.
3189 * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_ATTRIBUTE.
3190 * identifiers.c (_cpp_init_hashtable): Remove __has_attribute__
3192 * init.c (builtin_array): Add __has_attribute and __has_cpp_attribute.
3193 (cpp_init_special_builtins): Don't initialize __has_attribute
3194 or __has_cpp_attribute if CLK_ASM or pfile->cb.has_attribute is NULL.
3195 * traditional.c (enum ls): Remove ls_has_attribute,
3196 ls_has_attribute_close.
3197 (_cpp_scan_out_logical_line): Remove __has_attribute__ handling.
3198 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_ATTRIBUTE.
3199 * pch.c (cpp_read_state): Remove __has_attribute__ handling.
3200 * expr.c (eval_token): Likewise.
3201 (parse_has_attribute): Removed.
3203 2014-12-11 Uros Bizjak <ubizjak@gmail.com>
3205 * directives.c (cpp_define_formatted): Use xvasprintf.
3207 2014-12-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
3209 * line-map.c (linemap_position_for_loc_and_offset): Add new
3210 linemap_assert_fails.
3212 2014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
3214 * include/line-map.h (linemap_assert_fails): Declare.
3215 * line-map.c (linemap_position_for_loc_and_offset): Use it.
3217 2014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
3219 * line-map.c (linemap_add): Fix typo.
3220 (linemap_line_start): Fix whitespace.
3222 2014-11-29 John Schmerge <jbschmerge@gmail.com>
3224 PR preprocessor/41698
3225 * charset.c (one_utf8_to_utf16): Do not produce surrogate pairs
3228 2014-11-25 Jakub Jelinek <jakub@redhat.com>
3230 PR preprocessor/60436
3231 * line-map.c (linemap_line_start): If highest is above 0x60000000
3232 and we are still tracking columns or highest is above 0x70000000,
3235 2014-11-20 Uros Bizjak <ubizjak@gmail.com>
3238 * lex.c [__i386__ || __x86_64__]: Compile special SSE functions
3239 only for (__GNUC__ >= 5 || !defined(__PIC__)).
3241 2014-11-13 Manuel López-Ibáñez <manu@gcc.gnu.org>
3243 * include/line-map.h: Include EXPR, so that unused variable warnings
3246 2014-11-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
3249 * include/line-map.h (linemap_position_for_loc_and_offset):
3251 * line-map.c (linemap_position_for_loc_and_offset): New.
3253 2014-11-11 David Malcolm <dmalcolm@redhat.com>
3255 * ChangeLog.jit: New.
3257 2014-11-10 Edward Smith-Rowland <3dw4rd@verizon.net>
3259 * include/cpplib.h (cpp_callbacks): Add has_attribute.
3260 * internal.h (lexer_state): Add in__has_attribute__.
3261 * directives.c (lex_macro_node): Prevent use of __has_attribute__
3263 * expr.c (parse_has_attribute): New function; (eval_token): Look for
3264 __has_attribute__ and route to parse_has_attribute.
3265 * identifiers.c (_cpp_init_hashtable): Initialize n__has_attribute__.
3266 * pch.c (cpp_read_state): Initialize n__has_attribute__.
3267 * traditional.c (enum ls): Add ls_has_attribute, ls_has_attribute_close;
3268 (_cpp_scan_out_logical_line): Attend to __has_attribute__.
3270 2014-11-06 Joseph Myers <joseph@codesourcery.com>
3272 * include/cpp-id-data.h (struct cpp_macro): Update comment
3273 regarding parameters.
3274 * include/cpplib.h (struct cpp_macro_arg, struct cpp_identifier):
3275 Add spelling fields.
3276 (struct cpp_token): Update comment on macro_arg.
3277 * internal.h (_cpp_save_parameter): Add extra argument.
3278 (_cpp_spell_ident_ucns): New declaration.
3279 * lex.c (lex_identifier): Add SPELLING argument. Set *SPELLING to
3280 original spelling of identifier.
3281 (_cpp_lex_direct): Update calls to lex_identifier.
3282 (_cpp_spell_ident_ucns): New function, factored out of
3284 (cpp_spell_token): Adjust FORSTRING argument semantics to return
3285 original spelling of identifiers. Use _cpp_spell_ident_ucns in
3287 (_cpp_equiv_tokens): Check spellings of identifiers and macro
3288 arguments are identical.
3289 * macro.c (macro_arg_saved_data): New structure.
3290 (paste_tokens): Use original spellings of identifiers from
3292 (_cpp_save_parameter): Add argument SPELLING. Save both canonical
3294 (parse_params): Update calls to _cpp_save_parameter.
3295 (lex_expansion_token): Save spelling of macro argument tokens.
3296 (_cpp_create_definition): Extract canonical node from saved data.
3297 (cpp_macro_definition): Use UCNs in spelling of macro name. Use
3298 original spellings of macro argument tokens and identifiers.
3299 * traditional.c (scan_parameters): Update call to
3300 _cpp_save_parameter.
3302 2014-11-05 Joseph Myers <joseph@codesourcery.com>
3304 PR preprocessor/9449
3305 * init.c (lang_defaults): Enable extended identifiers for C++ and
3306 C99-based standards.
3308 2014-10-22 Alan Modra <amodra@gmail.com>
3310 * symtab.c (ht_create): Use obstack_specify_allocation in place of
3312 * files.c (_cpp_init_files): Likewise.
3313 * init.c (cpp_create_reader): Likewise.
3314 * identifiers.c (_cpp_init_hashtable): Likewise.
3316 2014-10-14 Manuel López-Ibáñez <manu@gcc.gnu.org>
3318 * include/line-map.h (linemap_location_from_macro_expansion_p):
3319 const struct line_maps * argument.
3320 (linemap_position_for_line_and_column): const struct line_map *
3322 * line-map.c (linemap_add_macro_token): Use correct argument name
3324 (linemap_position_for_line_and_column): const struct line_map *
3326 (linemap_macro_map_loc_to_def_point): Fix comment. Make static.
3327 (linemap_location_from_macro_expansion_p): const struct line_maps *
3329 (linemap_resolve_location): Fix argument names in comment.
3331 2014-10-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
3333 * lex.c (search_line_fast): Add new version to be used for Power8
3334 and later targets when Altivec is enabled. Restrict the existing
3335 Altivec version to big-endian systems so that lvsr is not used on
3336 little endian, where it is deprecated. Remove LE-specific code
3337 from the now-BE-only version.
3339 2014-10-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
3340 Jeff Law <law@redhat.com>
3342 * charset.c (convert_no_conversion): Reallocate memory with 25%
3345 2014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net>
3347 Implement SD-6: SG10 Feature Test Recommendations
3348 * internal.h (lexer_state, spec_nodes): Add in__has_include__.
3349 * directives.c: Support __has_include__ builtin.
3350 * expr.c (parse_has_include): New function to parse __has_include__
3351 builtin; (eval_token()): Use it.
3352 * files.c (_cpp_has_header()): New funtion to look for header;
3353 (open_file_failed()): Not an error to not find a header file for
3355 * identifiers.c (_cpp_init_hashtable()): Add entry for __has_include__.
3356 * pch.c (cpp_read_state): Lookup __has_include__.
3357 * traditional.c (enum ls, _cpp_scan_out_logical_line()): Walk through
3358 __has_include__ statements.
3360 2014-09-30 Bernd Edlinger <bernd.edlinger@hotmail.de>
3362 PR preprocessor/58893
3363 * errors.c (cpp_diagnostic): Fix possible out of bounds access.
3364 * files.c (_cpp_stack_include): Initialize src_loc for IT_CMDLINE.
3366 2014-09-24 Marek Polacek <polacek@redhat.com>
3370 * include/cpplib.h (enum cpp_ttype): Define CPP_KEYWORD.
3372 2014-09-17 Jan Hubicka <hubicka@ucw.cz>
3374 * charset.c (conversion): Rename to ...
3375 (cpp_conversion): ... this one; update.
3376 * files.c (file_hash_entry): Rename to ...
3377 (cpp_file_hash_entry): ... this one ; update.
3379 2014-09-17 Marek Polacek <polacek@redhat.com>
3382 * init.c (struct lang_flags): Remove cplusplus_comments.
3383 (cpp_set_lang): Likewise.
3384 (post_options): Likewise.
3385 * lex.c (_cpp_lex_direct): Disallow C++ style comments in C90/C94.
3387 2014-09-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
3389 * include/cpplib.h (struct cpp_options): Declare warn_normalize as
3390 int instead of enum.
3392 2014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
3394 * macro.c (replace_args): Use cpp_pedwarning, cpp_warning and
3396 * include/cpplib.h: Add CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC.
3397 * init.c (cpp_create_reader): Do not init to -1 here.
3398 * expr.c (num_binary_op): Use cpp_pedwarning.
3400 2014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
3402 * directives.c (check_eol_1): New.
3403 (check_eol_endif_labels): New.
3404 (check_eol): Call check_eol_1.
3405 (do_else,do_endif): Call check_eol_endif_labels.
3407 2014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
3409 * macro.c (warn_of_redefinition): Suppress warnings for builtins
3410 that lack the NODE_WARN flag, unless Wbuiltin-macro-redefined.
3411 (_cpp_create_definition): Use Wbuiltin-macro-redefined for
3412 builtins that lack the NODE_WARN flag.
3413 * directives.c (do_undef): Likewise.
3414 * init.c (cpp_init_special_builtins): Do not change flags
3415 depending on Wbuiltin-macro-redefined.
3417 2014-08-28 Edward Smith-Rowland <3dw4rd@verizon.net>
3419 PR cpp/23827 - standard C++ should not have hex float preprocessor
3421 * libcpp/init.c (lang_flags): Change CXX98 flag for extended numbers
3423 * libcpp/expr.c (cpp_classify_number): Weite error message for improper
3424 use of hex floating literal.
3426 2014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
3428 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z;
3429 Rename CLK_GNUCXX1Y, CLK_CXX1Y to CLK_GNUCXX14, CLK_CXX14;
3430 * init.c (struct lang_flags lang_defaults): Add column for trigraphs;
3431 Add rows for CLK_GNUCXX1Z, CLK_CXX1Z; (cpp_set_lang): Set trigraphs;
3432 (cpp_init_builtins): Set __cplusplus to 201402L for C++14;
3433 Set __cplusplus to 201500L for C++17.
3434 * expr.c (cpp_classify_number): Change C++1y to C++14 in binary
3435 constants error message.
3437 2014-08-20 Marek Polacek <polacek@redhat.com>
3439 * include/cpplib.h (cpp_options): Use signed char.
3440 * lex.c (_cpp_lex_direct): Don't warn in C++ mode.
3442 2014-08-19 Marek Polacek <polacek@redhat.com>
3444 * lex.c (_cpp_lex_direct): Fix a typo.
3446 2014-08-19 Marek Polacek <polacek@redhat.com>
3448 * charset.c (_cpp_valid_ucn): Warn only if -Wc90-c99-compat.
3449 * lex.c (_cpp_lex_direct): Likewise.
3450 * macro.c (replace_args): Likewise.
3451 (parse_params): Likewise.
3452 * include/cpplib.h (cpp_options): Change cpp_warn_c90_c99_compat
3455 2014-08-10 Marek Polacek <polacek@redhat.com>
3458 * lex.c (_cpp_lex_direct): Warn when -Wc90-c99-compat is in effect.
3459 * charset.c (_cpp_valid_ucn): Likewise.
3460 * include/cpplib.h (cpp_options): Add cpp_warn_c90_c99_compat.
3461 * macro.c (replace_args): Warn when -Wc90-c99-compat is in effect.
3462 (parse_params): Likewise.
3464 2014-07-27 Marek Polacek <polacek@redhat.com>
3467 * macro.c (builtin_macro): Add location parameter. Set
3468 location of builtin macro to the expansion point.
3469 (enter_macro_context): Pass location to builtin_macro.
3471 2014-07-16 Dodji Seketeli <dodji@redhat.com>
3473 Support location tracking for built-in macro tokens
3474 * include/line-map.h (line_maps::builtin_location): New data
3476 (line_map_init): Add a new parameter to initialize the new
3477 line_maps::builtin_location data member.
3478 * line-map.c (linemap_init): Initialize the
3479 line_maps::builtin_location data member.
3480 * macro.c (builtin_macro): Create a macro map and track the token
3481 resulting from the expansion of a built-in macro.
3483 2014-07-10 Edward Smith-Rowland <3dw4rd@verizon.net>
3484 Jonathan Wakely <jwakely@redhat.com>
3486 PR preprocessor/61389
3487 * macro.c (_cpp_arguments_ok, parse_params, create_iso_definition):
3488 Warning messages mention C++11 in c++ mode and C99 in c mode.
3489 * lex.c (lex_identifier_intern, lex_identifier): Ditto
3491 2014-07-09 Edward Smith-Rowland <3dw4rd@verizon.net>
3493 PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped
3495 * lex.c (lex_raw_string ()): Do not warn about invalid suffix
3496 if skipping. (lex_string ()): Ditto.
3498 2014-06-04 Edward Smith-Rowland <3dw4rd@verizon.net>
3501 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
3502 Combine user-defined escape logic with the other string and char logic.
3504 2014-05-26 Richard Biener <rguenther@suse.de>
3506 * configure.ac: Remove long long and __int64 type checks,
3507 add check for uint64_t and fail if that wasn't found.
3508 * include/cpplib.h (cpp_num_part): Use uint64_t.
3509 * config.in: Regenerate.
3510 * configure: Likewise.
3512 2014-05-21 Marek Polacek <polacek@redhat.com>
3515 * files.c (find_file_in_dir): Add parens around &&.
3517 2014-05-20 Edward Smith-Rowland <3dw4rd@verizon.net>
3520 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
3521 Check for user-defined literal strings and user-defined literal chars
3522 to escape necessary characters.
3524 2014-05-20 Richard Biener <rguenther@suse.de>
3526 * configure.ac: Copy gcc logic of detecting a 64bit type.
3527 Remove HOST_WIDE_INT define.
3528 * include/cpplib.h: typedef cpp_num_part to a 64bit type,
3529 similar to how hwint.h does it.
3530 * config.in: Regenerate.
3531 * configure: Likewise.
3533 2014-05-09 Joey Ye <joey.ye@arm.com>
3535 * files.c (find_file_in_dir): Always try to shorten for DOS
3537 * init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS.
3539 2014-05-07 Richard Biener <rguenther@suse.de>
3541 * configure.ac: Always set need_64bit_hwint to yes.
3542 * configure: Regenerated.
3544 2014-04-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3546 * lex.c: Remove Solaris 9 reference.
3548 2014-02-24 Walter Lee <walt@tilera.com>
3550 * configure.ac: Change "tilepro" triplet to "tilepro*".
3551 * configure: Regenerate.
3553 2014-02-19 Jakub Jelinek <jakub@redhat.com>
3555 PR preprocessor/58844
3556 * macro.c (enter_macro_context): Only push
3557 macro_real_token_count (macro) tokens rather than
3558 macro->count tokens, regardless of
3559 CPP_OPTION (pfile, track-macro-expansion).
3561 2014-02-07 Jakub Jelinek <jakub@redhat.com>
3563 PR preprocessor/56824
3564 * line-map.c (get_combined_adhoc_loc, linemap_get_expansion_line,
3565 linemap_get_expansion_filename, linemap_location_in_system_header_p,
3566 linemap_location_from_macro_expansion_p,
3567 linemap_macro_loc_to_spelling_point, linemap_macro_loc_to_def_point,
3568 linemap_macro_loc_to_exp_point, linemap_expand_location): Fix
3570 (linemap_compare_locations): Look through adhoc locations for both
3573 2014-01-23 Dodji Seketeli <dodji@redhat.com>
3575 PR PR preprocessor/58580
3576 * include/line-map.h (linemap_get_file_highest_location): Declare
3578 * line-map.c (linemap_get_file_highest_location): Define it.
3580 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
3582 Update copyright years
3584 2013-12-09 Joseph Myers <joseph@codesourcery.com>
3586 PR preprocessor/55715
3587 * expr.c (num_binary_op): Implement subtraction directly rather
3588 than with negation and falling through into addition case.
3590 2013-11-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
3592 * lex.c (search_line_fast): Correct for little endian.
3594 2013-11-15 Joseph Myers <joseph@codesourcery.com>
3596 * ucnid.tab: Add C11 and C11NOSTART data.
3597 * makeucnid.c (digit): Rename enum value to N99.
3598 (C11, N11, all_languages): New enum values.
3599 (NUM_CODE_POINTS, MAX_CODE_POINT): New macros.
3600 (flags, decomp, combining_value): Use NUM_CODE_POINTS as array
3602 (decomp): Use unsigned int as element type.
3603 (all_decomp): New array.
3604 (read_ucnid): Handle C11 and C11NOSTART. Use MAX_CODE_POINT.
3605 (read_table): Use MAX_CODE_POINT. Store all decompositions in
3607 (read_derived): Use MAX_CODE_POINT.
3608 (write_table): Use NUM_CODE_POINTS. Print N99, C11 and N11
3609 flags. Print whole array variable declaration rather than just
3611 (char_id_valid, write_context_switch): New functions.
3612 (main): Call write_context_switch.
3613 * ucnid.h: Regenerate.
3614 * include/cpplib.h (struct cpp_options): Add c11_identifiers.
3615 * init.c (struct lang_flags): Add c11_identifiers.
3616 (cpp_set_lang): Set c11_identifiers option from selected language.
3617 * internal.h (struct normalize_state): Document "previous" as
3618 previous starter character.
3619 (NORMALIZE_STATE_UPDATE_IDNUM): Take character as argument.
3620 * charset.c (DIG): Rename enum value to N99.
3621 (C11, N11): New enum values.
3622 (struct ucnrange): Give name to struct. Use short for flags and
3623 unsigned int for end of range. Include ucnid.h for whole variable
3625 (ucn_valid_in_identifier): Allow for characters up to 0x10FFFF.
3626 Allow for C11 in determining valid characters and valid start
3627 characters. Use check_nfc for non-Hangul context-dependent
3628 checks. Only store starter characters in nst->previous.
3629 (_cpp_valid_ucn): Pass new argument to
3630 NORMALIZE_STATE_UPDATE_IDNUM.
3631 * lex.c (lex_identifier): Pass new argument to
3632 NORMALIZE_STATE_UPDATE_IDNUM. Call NORMALIZE_STATE_UPDATE_IDNUM
3633 after initial non-UCN part of identifier.
3634 (lex_number): Pass new argument to NORMALIZE_STATE_UPDATE_IDNUM.
3636 2013-11-15 Joseph Myers <joseph@codesourcery.com>
3638 * ucnid.tab: Mark C99 digits as [C99DIG].
3639 * makeucnid.c (read_ucnid): Handle [C99DIG].
3640 (read_table): Don't check for digit characters.
3641 * ucnid.h: Regenerate.
3643 2013-11-06 Tobias Burnus <burnus@net-b.de>
3645 * macro.c (_cpp_builtin_macro_text): Correct
3646 wording of two warnings.
3648 2013-11-05 Tobias Burnus <burnus@net-b.de>
3650 * include/cpplib.h (CPP_W_DATE_TIME): Added.
3651 (cpp_options): Add warn_date_time.
3652 * init.c (cpp_create_reader): Init it.
3653 * macro.c (_cpp_builtin_macro_text): Warn when
3654 __DATE__/__TIME__/__TIMESTAMP__ is used.
3656 2013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
3658 Implement C++14 digit separators.
3659 * include/cpplib.h (cpp_options): Add digit_separators flag.
3660 * internal.h (DIGIT_SEP(c)): New macro.
3661 * expr.c (cpp_classify_number): Check improper placement of digit sep;
3662 (cpp_interpret_integer): Skip over digit separators.
3663 * init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add
3664 digit separator flags per language; (cpp_set_lang): Set
3666 * lex.c (lex_number): Add digits separator to allowable characters for
3669 2013-10-15 David Malcolm <dmalcolm@redhat.com>
3671 * Makefile.in (PICFLAG): New.
3672 (ALL_CFLAGS): Add PICFLAG.
3673 (ALL_CXXFLAGS): Likewise.
3674 * configure.ac: Add --enable-host-shared, setting up new
3676 * configure: Regenerate.
3678 2013-08-07 Richard Earnshaw <rearnsha@arm.com>
3680 * configure.ac: Set need_64bit_hwint for all arm targets.
3681 * configure: Regenerated.
3683 2013-07-20 Jakub Jelinek <jakub@redhat.com>
3685 PR preprocessor/57620
3686 * lex.c (lex_raw_string): Undo phase1 and phase2 transformations
3687 between R" and final " rather than only in between R"del( and )del".
3689 2013-07-10 Jakub Jelinek <jakub@redhat.com>
3691 PR preprocessor/57824
3692 * lex.c (lex_raw_string): Allow reading new-lines if
3693 in_deferred_pragma or if parsing_args and there is still
3694 data in the current buffer.
3696 * include/cpplib.h (cpp_token_val_index): Change parameter type to
3698 * lex.c (cpp_token_val_index): Likewise.
3700 PR preprocessor/57757
3701 * lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING
3702 or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that
3705 2013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
3707 * lex.c (lex_raw_string(), lex_string()): Constrain suffixes treated
3708 as concatenated literal and macro to just the patterns found in
3709 inttypes.h; (is_macro()): New.
3711 2013-06-24 Dehao Chen <dehao@google.com>
3713 * files.c (_cpp_stack_include): Fix the highest_location when header
3714 file is guarded by #ifndef and is included twice.
3716 2013-04-28 Jakub Jelinek <jakub@redhat.com>
3718 N3472 binary constants
3719 * include/cpplib.h (struct cpp_options): Fix a typo in user_literals
3720 field comment. Add binary_constants field.
3721 * init.c (struct lang_flags): Add binary_constants field.
3722 (lang_defaults): Add bin_cst column to the table.
3723 (cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants).
3724 * expr.c (cpp_classify_number): Talk about C++11 instead of C++0x
3725 in diagnostics. Accept binary constants if
3726 CPP_OPTION (pfile, binary_constants) even when pedantic. Adjust
3729 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
3731 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y.
3732 * init.c (lang_defaults): Add defaults for the latter.
3733 (cpp_init_builtins): Define __cplusplus as 201300L for the latter.
3734 * lex.c (_cpp_lex_direct): Update.
3736 2013-04-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
3739 * configure.ac: Require 64-bit int for arm*-*-rtems*.
3740 * configure: Regenerate.
3742 2013-03-06 Jakub Jelinek <jakub@redhat.com>
3745 * internal.h (struct cpp_buffer): Add to_free field.
3746 (_cpp_pop_file_buffer): Add third argument.
3747 * files.c (_cpp_stack_file): Set buffer->to_free.
3748 (_cpp_pop_file_buffer): Add to_free argument. Free to_free
3749 if non-NULL, and if equal to file->buffer_start, also clear
3750 file->buffer{,_start,_valid}.
3751 * directives.c (_cpp_pop_buffer): Pass buffer->to_free
3752 to _cpp_pop_file_buffer.
3754 2013-03-01 Jakub Jelinek <jakub@redhat.com>
3757 * files.c (_cpp_save_file_entries): Free result at the end.
3758 * pch.c (cpp_string_free): New function.
3759 (cpp_save_state): Use it in htab_create call.
3760 (cpp_write_pch_deps): Free ss->defs. Destroy ss->definedhash.
3762 2013-02-28 Jakub Jelinek <jakub@redhat.com>
3764 * files.c (_cpp_find_file): If returning early, before storing
3765 something to *hash_slot and *hash_slot is NULL, call htab_clear_slot
3766 on it. Access *hash_slot using void * type rather than
3767 struct file_hash_entry * to avoid aliasing issues.
3769 * configure.ac: Don't define ENABLE_CHECKING whenever
3770 --enable-checking is seen, instead use similar --enable-checking=yes
3771 vs. --enable-checking=release default as gcc/ subdir has and
3772 define ENABLE_CHECKING if ENABLE_CHECKING is defined in gcc/.
3773 Define ENABLE_VALGRIND_CHECKING if requested.
3774 * lex.c (new_buff): If ENABLE_VALGRIND_CHECKING, put _cpp_buff
3775 struct first in the allocated buffer and result->base after it.
3776 (_cpp_free_buff): If ENABLE_VALGRIND_CHECKING, free buff itself
3777 instead of buff->base.
3778 * config.in: Regenerated.
3779 * configure: Regenerated.
3781 2013-02-13 Ed Smith-Rowland <3dw4rd@verizon.net>
3784 * lex.c (lex_raw_string): Allow string literal with suffix
3785 beginning with 's' to be parsed as a C++11 user-defined literal.
3787 2013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
3789 Update copyright years.
3791 2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
3793 PR c++/54526 (again)
3794 * lex.c (_cpp_lex_direct): In C++11 mode, implement 2.5 p3, bullet 2.
3796 2013-01-03 Marc Glisse <marc.glisse@inria.fr>
3799 * line-map.c (get_combined_adhoc_loc): Cast from extern "C" type.
3800 (new_linemap): Likewise.
3801 (linemap_enter_macro): Likewise.
3803 2012-12-03 Jakub Jelinek <jakub@redhat.com>
3807 * files.c (read_file_guts): Allocate extra 16 bytes instead of
3808 1 byte at the end of buf. Pass size + 16 instead of size
3809 to _cpp_convert_input.
3810 * charset.c (_cpp_convert_input): Reallocate if there aren't
3811 at least 16 bytes beyond to.len in the buffer. Clear 16 bytes
3812 at to.text + to.len.
3814 2012-11-21 Steve Ellcey <sellcey@mips.com>
3817 * files.c (pch_open_file): Fix check for implicit_preinclude.
3819 2012-11-16 Simon Baldwin <simonb@google.com>
3821 * include/cpplib.h (struct cpp_options): Add canonical_system_headers.
3822 * files.c (find_file_in_dir): Call maybe_shorter_path() only if
3823 canonical_system_headers is set.
3824 * init.c (cpp_create_reader): Initialize canonical_system_headers.
3825 * configure.ac: Add new --enable-canonical-system-headers.
3826 * configure: Regenerate.
3827 * config.in: Regenerate.
3829 2012-11-09 Ed Smith-Rowland <3dw4rd@verizon.net>
3832 * include/cpplib.h (cpp_interpret_float_suffix): Add cpp_reader* arg.
3833 (cpp_interpret_int_suffix): Add cpp_reader* arg.
3834 * init.c (cpp_create_reader): Iitialize new flags.
3835 * expr.c (interpret_float_suffix): Use new flags.
3836 (cpp_interpret_float_suffix): Add cpp_reader* arg.
3837 (interpret_int_suffix): Use new flags.
3838 (cpp_interpret_int_suffix): Add cpp_reader* arg.
3839 (cpp_classify_number): Adjust calls to interpret_x_suffix.
3841 2012-10-23 Ian Bolton <ian.bolton@arm.com>
3842 Jim MacArthur <jim.macarthur@arm.com>
3843 Marcus Shawcroft <marcus.shawcroft@arm.com>
3844 Nigel Stephens <nigel.stephens@arm.com>
3845 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
3846 Richard Earnshaw <rearnsha@arm.com>
3847 Sofiane Naci <sofiane.naci@arm.com>
3848 Stephen Thomas <stephen.thomas@arm.com>
3849 Tejas Belagod <tejas.belagod@arm.com>
3850 Yufeng Zhang <yufeng.zhang@arm.com>
3852 * configure.ac: Enable AArch64.
3853 * configure: Regenerate.
3855 2012-10-23 Joseph Myers <joseph@codesourcery.com>
3857 * files.c (struct _cpp_file): Add implicit_preinclude.
3858 (pch_open_file): Allow a previously opened implicitly included
3860 (_cpp_find_file): Add implicit_preinclude argument. Free file and
3861 do not call open_file_failed if implicit_preinclude. Store
3862 implicit_preinclude value.
3863 (_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date):
3864 Update calls to _cpp_find_file.
3865 (_cpp_stack_include): Handle IT_DEFAULT.
3866 (cpp_push_default_include): New.
3867 * include/cpplib.h (cpp_push_default_include): Declare.
3868 * init.c (cpp_read_main_file): Update call to _cpp_find_file.
3869 * internal.h (enum include_type): Add IT_DEFAULT.
3870 (_cpp_find_file): Update prototype.
3872 2012-10-15 Tobias Burnus <burnus@net-b.de>
3874 * files.c (read_file_guts, _cpp_save_file_entries): Free memory
3876 * lex.c (warn_about_normalization): Ditto.
3877 * mkdeps.c (deps_save): Ditto.
3878 * pch.c (cpp_valid_state): Ditto.
3880 2012-10-04 Florian Weimer <fweimer@redhat.com>
3882 * directives.c (do_pragma_warning_or_error): New.
3883 (do_pragma_warning): New.
3884 (do_pragma_error): New.
3885 (_cpp_init_internal_pragmas): Register new pragmas.
3887 2012-09-25 Dehao Chen <dehao@google.com>
3890 * line-map.c (location_adhoc_data_hash): Fix the hash function.
3892 2012-09-25 Dehao Chen <dehao@google.com>
3895 * include/line-map.h (location_adhoc_data): Move location_adhoc_data
3897 (location_adhoc_data_map): Likewise.
3898 (line_maps): Likewise.
3899 (rebuild_location_adhoc_htab): New Function.
3900 * line-map.c (+rebuild_location_adhoc_htab): new Funcion.
3901 (get_combined_adhoc_loc): Move location_adhoc_data into GC.
3902 (location_adhoc_data_fini): Likewise.
3903 (linemap_init): Likewise.
3904 (location_adhoc_data_init): Remove Function.
3906 2012-09-19 Dehao Chen <dehao@google.com>
3908 * include/line-map.h (MAX_SOURCE_LOCATION): New value.
3909 (location_adhoc_data_fini): New.
3910 (get_combined_adhoc_loc): New.
3911 (get_data_from_adhoc_loc): New.
3912 (get_location_from_adhoc_loc): New.
3913 (location_adhoc_data_map): New.
3914 (COMBINE_LOCATION_DATA): New.
3915 (IS_ADHOC_LOC): New.
3916 (expanded_location): New field.
3917 (line_maps): New field.
3918 * line-map.c (location_adhoc_data): New.
3919 (location_adhoc_data_hash): New.
3920 (location_adhoc_data_eq): New.
3921 (location_adhoc_data_update): New.
3922 (get_combined_adhoc_loc): New.
3923 (get_data_from_adhoc_loc): New.
3924 (get_location_from_adhoc_loc): New.
3925 (location_adhoc_data_init): New.
3926 (location_adhoc_data_fini): New.
3927 (linemap_init): Initialize location_adhoc_data.
3928 (linemap_lookup): Change to use new location.
3929 (linemap_ordinary_map_lookup): Likewise.
3930 (linemap_macro_map_lookup): Likewise.
3931 (linemap_macro_map_loc_to_def_point): Likewise.
3932 (linemap_macro_map_loc_unwind_toward_spel): Likewise.
3933 (linemap_get_expansion_line): Likewise.
3934 (linemap_get_expansion_filename): Likewise.
3935 (linemap_location_in_system_header_p): Likewise.
3936 (linemap_location_from_macro_expansion_p): Likewise.
3937 (linemap_macro_loc_to_spelling_point): Likewise.
3938 (linemap_macro_loc_to_def_point): Likewise.
3939 (linemap_macro_loc_to_exp_point): Likewise.
3940 (linemap_resolve_location): Likewise.
3941 (linemap_unwind_toward_expansion): Likewise.
3942 (linemap_unwind_to_first_non_reserved_loc): Likewise.
3943 (linemap_expand_location): Likewise.
3944 (linemap_dump_location): Likewise.
3945 (linemap_line_start): Likewise.
3947 2012-05-25 Dodji Seketeli <dodji@redhat.com>
3949 PR preprocessor/53469
3950 * directives.c (do_pragma): Use the virtual location for the
3951 pragma token, instead of its spelling location.
3953 2012-08-14 Diego Novillo <dnovillo@google.com>
3955 Merge from cxx-conversion branch. Configury.
3957 * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
3958 * configure.ac: Likewise.
3959 * configure: Regenerate.
3961 2012-08-14 Lawrence Crowl <crowl@google.com>
3963 Merge from cxx-conversion branch. New C++ hash table.
3965 * include/symtab.h (typedef struct ht hash_table): Change the typedef
3966 name to cpp_hash_table. Update all users of the typedef.
3968 2012-07-30 Laurynas Biveinis <laurynas.biveinis@gmail.com>
3970 * include/line-map.h (line_map_macro): Use the "atomic" GTY option
3971 for the macro_locations field.
3973 2011-06-19 Uros Bizjak <ubizjak@gmail.com>
3975 * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
3976 __builtin_ia32_pcmpestri128 instead of asm.
3978 2012-06-04 Dimitrios Apostolou <jimis@gmx.net>
3980 * line-map.c (linemap_enter_macro): Don't zero max_column_hint in
3981 every macro. This improves performance by reducing the number of
3982 reallocations when track-macro-expansion is on.
3984 2012-06-04 Dodji Seketeli <dodji@redhat.com>
3986 PR preprocessor/53463
3987 * line-map.c (linemap_location_in_system_header_p): For built-in
3988 macro tokens, check the first expansion point location that is not
3989 for a token coming from a built-in macro.
3991 2012-05-29 Joseph Myers <joseph@codesourcery.com>
3993 * directives.c: Fix typos.
3994 * include/line-map.h: Fix typos.
3995 * line-map.c: Fix typos.
3996 * macro.c: Fix typos.
3998 2012-05-25 Dodji Seketeli <dodji@redhat.com>
4001 * lex.c (search_line_fast): Avoid unused local typedefs to simulate
4004 2012-05-29 Dodji Seketeli <dodji@redhat.com>
4006 PR preprocessor/53229
4007 * internal.h (cpp_reader::set_invocation_location): Remove.
4008 (cpp_reader::about_to_expand_macro_p): New member flag.
4009 * directives.c (do_pragma): Remove Kludge as
4010 pfile->set_invocation_location is no more.
4011 * macro.c (cpp_get_token_1): Do away with the use of
4012 cpp_reader::set_invocation_location. Just collect the macro
4013 expansion point when we are about to expand the top-most macro.
4014 Do not override cpp_reader::about_to_expand_macro_p.
4015 This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding
4016 properly handle locations of expansion points.
4017 (cpp_get_token_with_location): Adjust, as
4018 cpp_reader::set_invocation_location is no more.
4019 (paste_tokens): Take a virtual location parameter for
4020 the LHS of the pasting operator. Use it in diagnostics. Update
4022 (paste_all_tokens): Tighten the assert. Propagate the location of
4023 the expansion point when no virtual locations are available.
4024 Pass the virtual location to paste_tokens.
4025 (in_macro_expansion_p): New static function.
4026 (enter_macro_context): Set the cpp_reader::about_to_expand_macro_p
4027 flag until we really start expanding the macro.
4029 2012-05-16 Dodji Seketeli <dodji@redhat.com>
4031 PR preprocessor/7263
4032 * include/cpplib.h (cpp_classify_number): Take a location
4034 * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic
4035 macros that take a location parameter.
4036 (cpp_classify_number): Take a (virtual) location parameter. Use
4037 it for diagnostics. Adjust comments.
4038 (eval_token): Take a location parameter. Pass it to
4039 cpp_classify_number and to diagnostic routines.
4040 (_cpp_parse_expr): Use virtual locations of tokens when parsing
4041 expressions. Pass a virtual location to eval_token and to
4042 diagnostic routines.
4044 2012-05-10 Tristan Gingold <gingold@adacore.com>
4046 * expr.c (interpret_float_suffix): Add a guard.
4048 2012-05-02 Dodji Seketeli <dodji@redhat.com>
4050 Properly initialize cpp_context in destringize_and_run
4051 * directives.c (destringize_and_run): Properly initialize the new
4053 * macro.c (_cpp_pop_context): Assert that we shouldn't try to pop
4054 the initial base context, which has the same life time as the
4055 current instance of cpp_file.
4057 2012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
4058 Dodji Seketeli <dodji@seketeli.org>
4061 * libcpp/files.c (maybe_shorter_path): New.
4062 (find_file_in_dir): Use it.
4064 2012-04-30 Dodji Seketeli <dodji@redhat.com>
4066 Switch -ftrack-macro-expansion=2 on by default.
4067 * init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
4068 by default. Add comments.
4070 Strip "<built-in>" loc from displayed expansion context
4071 * include/line-map.h (linemap_unwind_toward_expansion): Fix typo
4073 (linemap_unwind_to_first_non_reserved_loc): Declare new function.
4074 * line-map.c (linemap_unwind_to_first_non_reserved_loc): Define
4077 Fix expansion point loc for macro-like tokens
4078 * macro.c (macro_of_context): New static function.
4079 (_cpp_push_token_context, push_extended_tokens_context): If the
4080 macro argument is NULL, it means we are continuing the expansion
4081 of the current macro, if any. Update comments.
4082 (_cpp_pop_context): Re-enable expansion of the macro only when we
4083 are really out of the context of the current expansion.
4085 Fix token pasting with -ftrack-macro-expansion
4086 * macro.c (paste_all_tokens): Put the token resulting from pasting
4087 into an extended token context with -ftrack-macro-location is in
4090 Fix cpp_sys_macro_p with -ftrack-macro-expansion
4091 * macro.c (cpp_sys_macro_p): Support -ftrack-macro-expansion.
4093 2012-04-29 Dodji Seketeli <dodji@redhat.com>
4095 * lex.c (lex_raw_string): Change C++ style comments into C style
4097 (lex_string): Likewise.
4099 2012-04-27 Ollie Wild <aaw@google.com>
4101 * include/cpplib.h (struct cpp_options): Add new field,
4102 warn_literal_suffix.
4103 (CPP_W_LITERAL_SUFFIX): New enum.
4104 * init.c (cpp_create_reader): Default initialization of
4105 warn_literal_suffix.
4106 * lex.c (lex_raw_string): Treat user-defined literals which don't
4107 begin with '_' as separate tokens and produce a warning.
4108 (lex_string): Ditto.
4110 2012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
4112 * line-map.c (linemap_resolve_location): Synchronize comments with
4113 those in line-map.h.
4114 * include/line-map.h (linemap_resolve_location): Fix spelling in
4117 2012-03-22 Richard Earnshaw <rearnsha@arm.com>
4119 * lex.c (search_line_fast): Provide Neon-optimized version for ARM.
4121 2012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4123 * lex.c: Remove Solaris 8 reference.
4125 2012-02-14 Walter Lee <walt@tilera.com>
4127 * configure.ac: Require 64-bit hwint for tilegx and tilepro.
4128 * configure: Regenerate.
4130 2012-01-09 Richard Guenther <rguenther@suse.de>
4132 * macro.c (_cpp_builtin_macro_text): Remove unused variable map.
4134 2012-01-09 Gary Funck <gary@intrepid.com>
4136 PR preprocessor/33919
4137 * files.c (_cpp_get_file_name): New. Implement file name
4139 * internal.h (_cpp_get_file_name): New prototype.
4140 * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
4141 to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
4143 2012-01-03 Olivier Hainque <hainque@adacore.com>
4145 * system.h: Prior to #define, #undef fopen and freopen unconditionally.
4147 2011-12-20 Joseph Myers <joseph@codesourcery.com>
4149 * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
4150 (CLK_STDC1X): Change to CLK_STDC11.
4151 * init.c (lang_defaults): Update comments.
4152 (cpp_init_builtins): Update language tests. Use 201112L for C11
4155 2011-12-20 Andreas Schwab <schwab@linux-m68k.org>
4157 * configure: Regenerate.
4159 2011-12-19 Andreas Schwab <schwab@linux-m68k.org>
4161 * configure: Regenerate.
4163 2011-12-07 Jakub Jelinek <jakub@redhat.com>
4166 * internal.h (_cpp_init_lexer): New prototype.
4167 * init.c (init_library): Call it.
4168 * lex.c (init_vectorized_lexer): Remove constructor attribute,
4170 (HAVE_init_vectorized_lexer): Define.
4171 (_cpp_init_lexer): New function.
4173 2011-12-03 Dodji Seketeli <dodji@redhat.com>
4175 * macro.c (tokens_buff_remove_last_token)
4176 (tokens_buff_put_token_to): Add an 'inline' function specifier to
4179 2011-11-22 Diego Novillo <dnovillo@google.com>
4181 * include/line-map.h (linemap_dump): Declare.
4182 (line_table_dump): Declare.
4183 * line-map.c (linemap_dump): New.
4184 (line_table_dump): New.
4186 2011-11-21 Ed Smith-Rowland <3dw4rd@verizon.net>
4189 * expr.c (cpp_userdef_char_remove_type): Fix typo.
4191 2011-11-03 Michael Matz <matz@suse.de>
4194 * configure.ac: Check for -fno-exceptions -fno-rtti.
4195 * configure: Regenerate.
4196 * Makefile.in (NOEXCEPTION_FLAGS): New flag.
4197 (ALL_CXXFLAGS): Use it.
4199 2011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
4201 * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
4203 2011-11-02 Jason Merrill <jason@redhat.com>
4206 * configure.ac: Add -Wno-narrowing to warning options.
4208 2011-10-31 Jason Merrill <jason@redhat.com>
4211 * init.c (cpp_init_builtins): Set __cplusplus for C++11.
4214 * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
4215 CLK_GNUCXX0X to CLK_GNUCXX11.
4217 2011-10-26 Ed Smith-Rowland <3dw4rd@verizon.net>
4219 Implement C++11 user-defined literals.
4220 * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
4221 cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
4222 cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
4223 cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
4224 (cpp_classify_number): Classify unrecognized tokens as user-defined
4226 * include/cpplib.h: Add new tokens for user-defined literals.
4227 * init.c: Add new preprocessor flag (cxx11).
4228 * lex.c: (lex_string, lex_raw_string): Handle user-defined literals
4229 including concatenation and promotion with suffixes.
4231 2011-10-24 Dodji Seketeli <dodji@redhat.com>
4233 * line-map.c (linemap_macro_map_lookup): Fix logic.
4235 2011-10-24 Dodji Seketeli <dodji@redhat.com>
4237 * include/line-map.h (linemap_expand_location): Take a line table
4238 parameter. Update comment.
4239 (linemap_resolve_location): Update comment.
4240 (linemap_expand_location_full): Remove.
4241 * line-map.c (linemap_resolve_location): Handle reserved
4242 locations; return a NULL map in those cases.
4243 (linemap_expand_location): If location is reserved, return a
4244 zeroed expanded location. Update comment. Take a line table to
4245 assert that the function takes non-virtual locations only.
4246 (linemap_expand_location_full): remove.
4247 (linemap_dump_location): Handle the fact that
4248 linemap_resolve_location can return NULL line maps when the
4249 location resolves to a reserved location.
4251 * line-map.c (linemap_macro_map_lookup): Fix logic.
4253 2011-10-22 Dodji Seketeli <dodji@redhat.com>
4256 * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
4257 context to act upon.
4258 * lex.c (_cpp_remaining_tokens_num_in_context): Likewise. Update
4260 (cpp_token_from_context_at): Likewise.
4261 (cpp_peek_token): Use the context to peek tokens from.
4263 2011-10-20 Dodji Seketeli <dodji@redhat.com>
4266 * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
4269 2011-10-18 Dodji Seketeli <dodji@redhat.com>
4272 * include/line-map.h (struct linemap_stats): Change the type of
4273 the members from size_t to long.
4274 * macro.c (macro_arg_token_iter_init): Unconditionally initialize
4277 2011-10-17 Dodji Seketeli <dodji@redhat.com>
4279 * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
4280 variable without using it if ENABLE_CHECKING is not defined. Mark
4281 the LOCATION parameter as being unused.
4283 2011-10-15 Tom Tromey <tromey@redhat.com>
4284 Dodji Seketeli <dodji@redhat.com>
4286 * include/line-map.h (struct line_maps::alloced_size_for_request):
4288 * line-map.c (new_linemap): Use set->alloced_size_for_request to
4289 get the actual allocated size of line maps.
4291 2011-10-15 Tom Tromey <tromey@redhat.com>
4292 Dodji Seketeli <dodji@redhat.com>
4294 * line-map.h (struct linemap_stats): Declare new struct.
4295 (linemap_get_statistics): Declare ...
4296 * line-map.c (linemap_get_statistics): ... new function.
4297 * macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
4298 Declare new counters.
4299 (enter_macro_context, replace_args): Update
4300 num_macro_tokens_counter.
4301 (cpp_get_token_1): Update num_expanded_macros_counter.
4303 2011-10-15 Tom Tromey <tromey@redhat.com>
4304 Dodji Seketeli <dodji@redhat.com>
4306 * include/cpplib.h (struct cpp_options)<debug>: New struct member.
4307 * include/line-map.h (linemap_dump_location): Declare ...
4308 * line-map.c (linemap_dump_location): ... new function.
4310 2011-10-15 Tom Tromey <tromey@redhat.com>
4311 Dodji Seketeli <dodji@redhat.com>
4313 * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
4315 * internal.h (struct macro_context): New struct.
4316 (enum context_tokens_kind): New enum.
4317 (struct cpp_context)<tokens_kind>: New member of type enum
4318 context_tokens_kind.
4319 (struct cpp_context)<macro>: Remove this. Replace it with an enum
4320 of macro and macro_context.
4321 (struct cpp_context)<direct_p>: Remove.
4322 (_cpp_remaining_tokens_num_in_context): Declare new function.
4323 * directives.c (destringize_and_run): Adjust.
4324 * lex.c (_cpp_remaining_tokens_num_in_context)
4325 (_cpp_token_from_context_at): Define new functions
4326 (cpp_peek_token): Use them.
4327 * init.c (cpp_create_reader): Initialize the base context to zero.
4328 (_cpp_token_from_context_at): Define new static function.
4329 (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
4330 _cpp_token_from_context_at.
4331 * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
4333 (enum macro_arg_token_kind): New enum.
4334 (struct macro_arg_token_iter): New struct.
4335 (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
4336 (alloc_expanded_arg_mem, ensure_expanded_arg_room)
4337 (delete_macro_args, set_arg_token, get_arg_token_location)
4338 (arg_token_ptr_at, macro_arg_token_iter_init)
4339 (macro_arg_token_iter_get_token)
4340 (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
4341 (expanded_token_index, tokens_buff_new, tokens_buff_count)
4342 (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
4343 (tokens_buff_add_token, tokens_buff_remove_last_token)
4344 (reached_end_of_context, consume_next_token_from_context): New
4346 (cpp_get_token_1): New static function. Split and extended from
4347 cpp_get_token. Use reached_end_of_context and
4348 consume_next_token_from_context. Unify its return point. Move
4349 the location tweaking from cpp_get_token_with_location in here.
4350 (cpp_get_token): Use cpp_get_token_1
4351 (stringify_arg): Use the new arg_token_at.
4352 (paste_all_tokens): Support tokens coming from extended tokens
4354 (collect_args): Return the number of collected arguments, by
4355 parameter. Store virtual locations of tokens that constitute the
4357 (funlike_invocation_p): Return the number of collected arguments,
4359 (enter_macro_context): Add a parameter for macro expansion point.
4360 Pass it to replace_args and to the "used" cpp callback. Get the
4361 number of function-like macro arguments from funlike_invocation_p,
4362 pass it to the new delete_macro_args to free the memory used by
4363 macro args. When -ftrack-macro-expansion is in effect, for macros
4364 that have no arguments, create a macro map for the macro expansion
4365 and use it to allocate proper virtual locations for tokens
4366 resulting from the expansion. Push an extended tokens context
4367 containing the tokens resulting from macro expansion and their
4369 (replace_args): Rename the different variables named 'count' into
4370 variables with more meaningful names. Create a macro map;
4371 allocate virtual locations of tokens resulting from this
4372 expansion. Use macro_arg_token_iter to iterate over tokens of a
4373 given macro. Handle the case of the argument of
4374 -ftrack-macro-expansion being < 2. Don't free macro arguments
4375 memory resulting from expand_arg here, as these are freed by the
4376 caller of replace_arg using delete_macro_args now. Push extended
4378 (next_context, push_ptoken_context, _cpp_push_token_context)
4379 (_cpp_push_text_context): Properly initialize the context.
4380 (expand_arg): Use the new alloc_expanded_arg_mem,
4381 push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
4382 (_cpp_pop_context): Really free the memory held by the context.
4383 Handle freeing memory used by extended tokens contexts.
4384 (cpp_get_token_with_location): Use cpp_get_token_1.
4385 (cpp_sys_macro_p): Adjust.
4386 (_cpp_backup_tokens): Support the new kinds of token contexts.
4387 * traditional.c (recursive_macro): Adjust.
4389 2011-10-15 Tom Tromey <tromey@redhat>
4390 Dodji Seketeli <dodji@redhat.com>
4392 * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
4394 (MAX_SOURCE_LOCATION): New constant.
4395 (struct line_map_ordinary, struct line_map_macro): New structs.
4396 (struct line_map): Turn this into a union of the two above. Add
4398 (struct maps_info): New struct.
4399 (struct line_maps)<info_ordinary, info_macro>: Two new fields.
4400 These now carry the map information that was previously scattered
4401 in struct line_maps.
4402 (struct map_info::allocated): Fix comment.
4403 (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
4404 (ORDINARY_MAP_STARTING_LINE_NUMBER)
4405 (ORDINARY_MAP_INCLUDER_FILE_INDEX)
4406 (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
4407 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
4408 (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
4409 (MACRO_MAP_EXPANSION_POINT_LOCATION)
4410 (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
4411 (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
4412 (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
4413 (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
4414 (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
4415 (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
4416 (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
4417 (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
4418 (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
4419 (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
4420 (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
4422 (linemap_check_ordinary, linemap_assert)
4423 (linemap_location_before_p): New macros.
4424 (linemap_position_for_line_and_column)
4425 (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
4426 (linemap_macro_expansion_map_p)
4427 (linemap_macro_map_loc_to_def_point)
4428 (linemap_macro_map_loc_unwind_once)
4429 (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
4430 (linemap_get_source_line linemap_get_source_column)
4431 (linemap_map_get_macro_name, linemap_get_file_path)
4432 (linemap_location_in_system_header_p)
4433 (linemap_location_from_macro_expansion_p): Declare new functions.
4434 (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
4435 (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
4436 accessors act on ordinary maps only.
4437 (INCLUDED_FROM): Return NULL for main files; use the new
4439 (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
4440 (struct expanded_location): Move here from gcc/input.h
4441 (linemap_resolve_location, linemap_expand_location)
4442 (linemap_expand_location_full): Declare new functions.
4443 * line-map.c: Include cpplib.h, internal.h
4444 (linemap_enter_macro, linemap_add_macro_token)
4445 (linemap_get_expansion_line, linemap_get_expansion_filename): New
4446 functions that are private to libcpp.
4447 (linemap_assert): New macro.
4448 (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
4449 (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
4450 (linemap_macro_map_loc_unwind_toward_spelling)
4451 (linemap_macro_map_loc_to_exp_point)
4452 (first_map_in_common_1, first_map_in_common): New static
4454 (new_linemap): Define new static functions. Extracted and
4456 (linemap_add): ... here. Use linemap_assert in lieu of abort
4458 (linemap_tracks_macro_expansion_locs_p)
4459 (linemap_add_macro_token, linemap_macro_expansion_map_p)
4460 (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
4461 (linemap_macro_map_loc_to_def_point)
4462 (linemap_macro_map_loc_unwind_once)
4463 (linemap_step_out_once, linemap_map_get_index)
4464 (linemap_get_source_line,linemap_get_source_column)
4465 (linemap_get_file_path, linemap_map_get_macro_name)
4466 (linemap_location_in_system_header_p)
4467 (linemap_location_originated_from_system_header_p)
4468 (linemap_location_from_macro_expansion_p)
4469 (linemap_tracks_macro_expansion_locs_p)
4470 (linemap_resolve_location, linemap_expand_location)
4471 (linemap_expand_location_full)
4472 (linemap_tracks_macro_expansion_locs_p)
4473 (linemap_position_for_line_and_column, linemap_compare_locations):
4474 Define new public functions.
4475 (linemap_init): Initialize ordinary and macro maps information in
4477 (linemap_check_files_exited): Use the new accessors.
4478 (linemap_free): Remove this dead code.
4479 (linemap_line_start): Assert this uses an ordinary map. Adjust to
4480 use the new ordinary map accessors and data structures. Don't
4481 overflow past the lowest possible macro token's location.
4482 (linemap_position_for_column): Assert the ordinary maps of the map
4483 set are really ordinary. Use ordinary map accessors.
4484 (linemap_lookup): Keep the same logic but generalize to allow
4485 lookup of both ordinary and macro maps. Do not crash when called
4486 with an empty line table.
4487 * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
4488 new API of line-map.h.
4489 * directives.c (start_directive, do_line, do_linemarker)
4490 (do_linemarker): Likewise.
4491 * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
4492 (make_cpp_dir, cpp_make_system_header): Likewise.
4493 * init.c (cpp_read_main_file): Likewise.
4494 * internal.h (CPP_INCREMENT_LINE): Likewise.
4495 (linemap_enter_macro, linemap_add_macro_token)
4496 (linemap_get_expansion_line, linemap_get_expansion_filename): New
4497 functions private to libcpp.
4498 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
4499 (skip_line_comment, skip_whitespace, lex_raw_string)
4500 (_cpp_lex_direct): Likewise.
4501 * macro.c (_cpp_builtin_macro_text): Likewise.
4502 (_cpp_aligned_alloc): Initialize the new name member of the macro.
4503 * traditional.c (copy_comment, _cpp_scan_out_logical_line):
4505 * errors.c (cpp_diagnostic): Adjust to new linemap API.
4507 2011-08-28 Dodji Seketeli <dodji@redhat.com>
4509 * line-map.c (linemap_add): Assert that reason must not be
4510 LC_RENAME when called for the first time on a "main input file".
4512 2011-08-22 Gabriel Charette <gchare@google.com>
4514 * init.c (cpp_create_reader): Inititalize forced_token_location_p.
4515 * internal.h (struct cpp_reader): Add field forced_token_location_p.
4516 * lex.c (_cpp_lex_direct): Use forced_token_location_p.
4517 (cpp_force_token_locations): New.
4518 (cpp_stop_forcing_token_locations): New.
4520 2011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4523 * init.c (cpp_init_builtins): Define __cplusplus 19971L.
4525 2011-08-18 Joseph Myers <joseph@codesourcery.com>
4527 * include/cpplib.h (struct cpp_options): Fix typo.
4529 2011-08-18 Joseph Myers <joseph@codesourcery.com>
4531 * include/cpplib.h (struct cpp_options): Add rliterals.
4532 * init.c (struct lang_flags, lang_defaults): Add rliterals.
4533 (cpp_set_lang): Set rliterals option.
4534 (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
4535 * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
4537 2011-08-15 Gabriel Charette <gchare@google.com>
4539 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
4540 Update all users to use linemap_position_for_column instead.
4542 2011-07-28 Gabriel Charette <gchare@google.com>
4544 * include/line-map.h (struct line_maps):
4545 Remove unused field last_listed. Update all users.
4547 2011-07-28 H.J. Lu <hongjiu.lu@intel.com>
4549 * configure.ac: Set need_64bit_hwint to yes for x86 targets.
4550 * configure: Regenerated.
4552 2011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4554 * system.h [__cplusplus]: Wrap C function declarations in extern "C".
4556 2011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4557 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4560 * configure.ac: Test AM_ICONV with CXX.
4561 * configure: Regenerate.
4562 * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
4564 2011-07-15 Dodji Seketeli <dodji@redhat.com>
4566 * directives.c (struct if_stack): Use source_location as type
4568 * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
4569 indent, def_pragma, used_define, used_undef>: Properly use
4570 source_location as parameter type, rather than unsigned int.
4572 2011-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4575 * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
4576 like i[34567]86-*-solaris2.1[0-9]*.
4577 * configure: Regenerate.
4579 2011-06-16 Jason Merrill <jason@redhat.com>
4582 * lex.c (lex_raw_string): Don't check for embedded NUL.
4584 2011-06-06 Dodji Seketeli <dodji@redhat.com>
4586 PR preprocessor/48532
4587 * directives.c (do_pragma): Don't forget the invocation location
4588 when parsing the pragma name of a namespaced pragma directive.
4590 2011-05-29 John Tytgat <John.Tytgat@aaug.net>
4592 * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
4594 2011-05-22 Uros Bizjak <ubizjak@gmail.com>
4597 * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
4598 is defined. Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
4600 2011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
4602 * system.h (ENUM_BITFIELD): Remove.
4604 2011-04-24 Jakub Jelinek <jakub@redhat.com>
4606 PR preprocessor/48740
4607 * lex.c (lex_raw_string): When raw string ends with
4608 ??) followed by raw prefix and ", ensure it is preprocessed
4609 with ??) rather than ??].
4611 2011-04-20 Jim Meyering <meyering@redhat.com>
4613 * files.c (destroy_cpp_file): Remove useless if-before-free.
4614 * init.c (cpp_destroy): Likewise.
4615 * macro.c (replace_args): Likewise.
4616 * pch.c (cpp_valid_state): Likewise.
4618 2011-03-25 Kai Tietz <ktietz@redhat.com>
4620 * files.c (file_hash_eq): Use filename_cmp
4622 (nonexistent_file_hash_eq): Likewise.
4623 (remap_filename): Likewise.
4624 Handle absolute DOS-path,
4625 (append_file_to_dir): Check for IS_DIR_SEPARATOR
4627 (read_name_map): Likewise.
4628 * linemap.c (linemap_add): Use filename_cmp
4630 * mkdeps.c (apply_vpath): Use filename_ncmp
4632 (deps_restore): Use filename_cmp instead of
4634 * init.c (read_original_directory): Use
4635 IS_DIR_SEPARATOR instead of checking for slash.
4637 2011-03-21 Michael Meissner <meissner@linux.vnet.ibm.com>
4639 PR preprocessor/48192
4640 * directives.c (do_ifdef): Do not consider conditional macros as
4643 * expr.c (parse_defined): Ditto.
4645 2011-03-18 Richard Henderson <rth@redhat.com>
4648 * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
4650 2011-11-04 Eric Botcazou <ebotcazou@adacore.com>
4651 Jakub Jelinek <jakub@redhat.com>
4653 PR preprocessor/39213
4654 * directives.c (end_directive): Call _cpp_remove_overlay for deferred
4655 pragmas as well in traditional mode.
4657 2010-11-17 Ian Lance Taylor <iant@google.com>
4660 * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of
4661 AC_LANG based on ENABLE_BUILD_WITH_CXX.
4663 2010-11-16 Kai Tietz <kai.tietz@onevision.com>
4665 PR preprocessor/17349
4666 * lex.c (save_comment): Handle in argument passing c++
4669 2010-11-02 Ian Lance Taylor <iant@google.com>
4671 * configure.ac: Use AC_SYS_LARGEFILE.
4672 * configure: Rebuild.
4673 * config.in: Rebuild.
4675 2010-10-19 Basile Starynkevitch <basile@starynkevitch.net>
4677 * line-map.h (source_location): Remove obsolete comment
4678 mentioning location_s.
4680 2010-09-29 Kai Tietz <kai.tietz@onevision.com>
4682 PR preprocessor/45362
4683 * directives.c (cpp_pop_definition): Make static.
4684 (do_pragma_push_macro): Reworked to store text
4686 (do_pragma_pop_macro): Add free text definition.
4687 (cpp_push_definition): Removed.
4688 * include/cpplib.h (cpp_push_definition): Removed.
4689 (cpp_pop_definition): Likewise.
4690 * internal.h (def_pragma_macro): Remove member 'value'
4691 and add new members 'definition', 'line',
4692 'syshdr', 'sued' and 'is_undef'.
4693 * pch.c (_cpp_restore_pushed_macros): Rework to work
4694 on text definition and store additional macro flags.
4695 (_cpp_save_pushed_macros): Likewise.
4697 2010-09-29 Joseph Myers <joseph@codesourcery.com>
4699 * include/cpplib.h (cpp_options): Rename warn_deprecated,
4700 warn_traditional, warn_long_long and pedantic.
4701 * directives.c (directive_diagnostics, _cpp_handle_directive):
4702 Update names of cpp_options members.
4703 * expr.c (cpp_classify_number, eval_token): Update names of
4704 cpp_options members.
4705 * init.c (cpp_create_reader, post_options): Update names of
4706 cpp_options members.
4707 * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
4708 cpp_options members.
4709 * macro.c (parse_params): Update names of cpp_options members.
4711 2010-09-15 Ian Lance Taylor <iant@google.com>
4713 * init.c: Fix type name in comment.
4715 2010-08-31 Jakub Jelinek <jakub@redhat.com>
4717 PR preprocessor/45457
4718 * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
4720 * directives.c (do_ifdef, do_ifndef): Likewise.
4722 2010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4724 * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
4726 2010-08-24 Richard Henderson <rth@redhat.com>
4729 * configure.ac (HAVE_SSE4): New check.
4730 * configure, config.in: Rebuild.
4731 * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
4733 2010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4735 * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
4736 etc. on Solaris 2/x86.
4738 2010-08-21 Richard Henderson <rth@redhat.com>
4739 Andi Kleen <ak@linux.intel.com>
4740 David S. Miller <davem@davemloft.net>
4742 * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
4743 (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
4744 (ptrdiff_t): Check via AC_CHECK_TYPE.
4745 * config.in, configure: Rebuild.
4746 * system.h: Include stdint.h, if available.
4747 * lex.c (WORDS_BIGENDIAN): Provide default.
4748 (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
4749 acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
4750 search_line_sse2, search_line_sse42, init_vectorized_lexer,
4751 search_line_fast): New.
4752 (_cpp_clean_line): Use search_line_fast. Restructure the fast
4753 loop to make it clear when we're leaving the loop. Stay in the
4754 fast loop for non-trigraph '?'.
4756 2010-06-11 Jakub Jelinek <jakub@redhat.com>
4758 * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
4760 (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
4761 (cpp_macro_definition): Remove const qual from second argument.
4762 * macro.c (enter_macro_context): Call user_builtin_macro callback for
4763 NODE_BUILTIN !NODE_USED macros.
4764 (warn_of_redefinition): Likewise. Remove const qual from second
4766 (cpp_macro_definition): Likewise.
4767 * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
4768 for NODE_BUILTIN !NODE_USED macros.
4770 2010-06-10 Joseph Myers <joseph@codesourcery.com>
4772 * include/cpplib.h (struct cpp_options): Remove show_column.
4773 * init.c (cpp_create_reader, post_options): Don't set show_column.
4775 2010-06-09 Joern Rennecke <joern.rennecke@embecosm.com>
4778 * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
4779 check that C++ compiler works.
4780 * configure: Regenerate.
4782 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
4784 * include/symtab.h (ht_identifier_ptr): New.
4786 2010-06-03 Joern Rennecke <joern.rennecke@embecosm.com>
4787 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4790 * configure.ac: Check for declaration of 'basename(char *)'.
4791 * configure: Regenerate.
4792 * config.in: Regenerate.
4794 2010-04-25 Joseph Myers <joseph@codesourcery.com>
4796 * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
4797 * init.c (lang_defaults): Add entries for new language variants.
4798 (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
4801 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
4804 * files.c (report_missing_guard): Test for #pragma once.
4806 2010-04-07 Simon Baldwin <simonb@google.com>
4808 * directives.c (do_diagnostic): Add warning reason argument,
4809 call appropriate error reporting function for code.
4810 (directive_diagnostics): Call specific warning functions with
4811 warning reason where appropriate.
4812 (do_error, do_warning, do_pragma_dependency): Add warning reason
4813 argument to do_diagnostic calls.
4814 * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
4815 _cpp_create_definition): Call specific warning functions with
4816 warning reason where appropriate.
4817 * Makefile.in: Add new diagnostic functions to gettext translations.
4818 * include/cpplib.h (struct cpp_callbacks): Add warning reason code
4820 (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
4821 CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
4822 (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
4823 CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
4824 CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
4825 CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
4826 CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
4827 CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
4828 CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
4829 warning reason codes.
4830 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
4831 cpp_warning_with_line, cpp_pedwarning_with_line,
4832 cpp_warning_with_line_syshdr): New specific error reporting functions.
4833 * pch.c (cpp_valid_state): Call specific warning functions with
4834 warning reason where appropriate.
4835 * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
4836 diagnostic handlers.
4837 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
4838 cpp_warning_with_line, cpp_pedwarning_with_line,
4839 cpp_warning_with_line_syshdr): New specific error reporting functions.
4840 * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
4841 specific warning functions with warning reason where appropriate.
4842 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
4843 warn_about_normalization, lex_identifier_intern, lex_identifier,
4844 _cpp_lex_direct): Ditto.
4845 * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
4846 narrow_str_to_charconst): Ditto.
4848 2010-04-06 Jakub Jelinek <jakub@redhat.com>
4850 PR preprocessor/43642
4851 * lex.c (lex_raw_string): Change type of TYPE variable to
4854 2010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4856 * aclocal.m4: Regenerate.
4858 2010-03-29 Jason Merrill <jason@redhat.com>
4860 More N3077 raw string changes
4861 * charset.c (cpp_interpret_string): Don't transform UCNs in raw
4863 * lex.c (bufring_append): Split out from...
4864 (lex_raw_string): ...here. Undo trigraph and line splicing
4865 transformations. Do process line notes in multi-line literals.
4866 (_cpp_process_line_notes): Ignore notes that were already handled.
4868 Some raw string changes from N3077
4869 * charset.c (cpp_interpret_string): Change inner delimiters to ().
4870 * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter.
4872 2010-02-11 Jakub Jelinek <jakub@redhat.com>
4874 * init.c (read_original_filename): Don't call read_original_directory
4875 if _cpp_handle_directive returns 0.
4877 2010-01-01 Joseph Myers <joseph@codesourcery.com>
4879 PR preprocessor/41947
4880 * expr.c (cpp_classify_number): Give error for hexadecimal
4881 floating-point constant with no digits before or after point.
4883 2009-11-20 Arnaud Charlet <charlet@adacore.com>
4885 * macro.c (enter_macro_context): Call cb.used callback if defined.
4886 * directives.c (do_idef, do_ifndef): Ditto.
4887 * include/cpplib.h (struct cpp_callbacks): Add used callback.
4889 2009-11-11 Kai Tietz <kai.tietz@onevision.com>
4891 * directives.c (do_pragma_push_macro): New pragma handler.
4892 (do_pragma_pop_macro): Likewise.
4893 (_cpp_init_internal_pragmas): Add push_macro and
4894 pop_macro handler to internal pragmas.
4895 (lex_macro_node_from_str): Removed.
4896 (cpp_push_definition): Replace lex_macro_node_from_str
4897 by _cpp_lex_identifier.
4898 (cpp_pop_definition): Likewise.
4899 * internal.h (_cpp_lex_identifier): New prototype.
4900 (def_pragma_macro): New structure.
4901 (cpp_reader): New member pushed_macros.
4902 * lex.c (_cpp_lex_identifier): New function.
4903 (lex_identifier_intern): New function.
4904 * init.c (cpp_create_reader): Initialize pushed_macros
4906 (cpp_destroy): Free elements in pushed_macros member.
4907 * pch.c (_cpp_save_pushed_macros): New function.
4908 (_cpp_restore_pushed_macros): Likewise.
4909 (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
4910 (cpp_read_state): Use _cpp_restore_pushed_macros.
4912 2009-10-19 Jakub Jelinek <jakub@redhat.com>
4914 * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
4915 (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
4916 and char32_cset_desc.
4917 (converter_for_type): Handle CPP_UTF8STRING.
4918 (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
4919 * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
4920 (parse_include): Reject raw strings.
4921 * include/cpplib.h (CPP_UTF8STRING): New token type.
4922 * internal.h (struct cpp_reader): Add utf8_cset_desc field.
4923 * lex.c (lex_raw_string): New function.
4924 (lex_string): Handle u8 string literals, call lex_raw_string
4925 for raw string literals.
4926 (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
4928 * macro.c (stringify_arg): Handle CPP_UTF8STRING.
4930 2009-10-14 Jakub Jelinek <jakub@redhat.com>
4932 PR preprocessor/41543
4933 * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
4934 * line-map.c (linemap_init): Initialize highest_location and
4935 highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
4937 2009-10-09 Jason Merrill <jason@redhat.com>
4939 * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
4941 2009-10-09 Neil Vachharajani <nvachhar@google.com>
4943 * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
4946 2009-09-23 Loren J. Rittle <ljrittle@acm.org>
4948 * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
4949 * configure: Rebuilt.
4951 2009-09-22 Richard Guenther <rguenther@suse.de>
4954 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
4956 2009-09-18 Chris Demetriou <cgd@google.com>
4958 PR preprocessor/28435:
4959 * include/cpplib.h (struct cpp_options): Add new member
4960 deps.need_preprocessor_output.
4961 * files.c (open_file_failed): If preprocessor output is needed
4962 always report an error.
4964 2009-09-13 Kai Tietz <kai.tietz@onevision.com>
4966 * configure.ac: Set for i?86-w64-mingw*
4967 need_64bit_hwint to yes.
4968 * configure: Regenerated.
4970 2009-09-10 Jason Merrill <jason@redhat.com>
4972 * directives.c (cpp_define): constify.
4974 2009-09-02 Ian Lance Taylor <iant@google.com>
4976 * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
4978 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4980 * configure.ac (AC_PREREQ): Bump to 2.64.
4982 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4984 * aclocal.m4: Regenerate.
4985 * config.in: Regenerate.
4986 * configure: Regenerate.
4988 2009-08-17 Tom Tromey <tromey@redhat.com>
4990 PR preprocessor/41067:
4991 * charset.c (convert_escape): Add missing ":" to error text.
4993 2009-07-27 Douglas B Rupp <rupp@gnat.com>
4995 * include/cpplib.h (INO_T_CPP): New macro.
4996 (struct cpp_dir): Use it.
4998 2009-07-20 Jerry Quinn <jlquinn@optonline.net>
5001 * configure.ac: Use = instead of == for testing
5002 ENABLE_BUILD_WITH_CXX.
5003 * configure: Rebuild.
5005 2009-07-17 Jerry Quinn <jlquinn@optonline.net>
5007 * directives.c (do_linemarker, do_line): Use CPP_STRING for
5009 * files.c (find_file_in_dir): Add cast from void* to char*.
5010 * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
5011 * Makefile.in: (WARN_CFLAGS): Use general and C-specific
5013 (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
5014 ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
5015 COMPILER_FLAGS): New.
5016 (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
5017 (COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS
5018 instead of ALL_CFLAGS.
5019 * configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings
5020 from other warnings. Add -Wc++-compat to C-specific warnings.
5021 Check for --enable-build-with-cxx. Set and substitute
5022 ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES
5023 according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before
5025 * configure: Rebuild.
5026 * include/cpp-id-data.h: Remove extern "C".
5027 * include/line-map.h: Likewise.
5028 * include/mkdeps.h: Likewise.
5029 * include/symtab.h: Likewise.
5030 * internal.h: Likewise.
5032 2009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5034 * directives.c (parse_include): Add location argument. Update all
5036 (parse_answer): Likewise.
5037 (do_include_common): Error with exact location.
5038 (parse_assertion): Likewise.
5040 2009-06-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
5042 * expr.c (num_div_op): Take explicit location.
5044 2009-06-17 Ian Lance Taylor <iant@google.com>
5046 * include/cpplib.h (progname): Don't declare.
5048 2009-06-12 Ian Lance Taylor <iant@google.com>
5050 * include/cpplib.h (struct cpp_options): Add
5051 warn_cxx_operator_names field.
5052 (NODE_WARN_OPERATOR): Define.
5053 (struct cpp_hashnode): Increase flags field to 10 bits, decrease
5055 * init.c (mark_named_operators): Add flags parameter.
5056 (cpp_post_options): Pick flags value to pass to
5057 mark_named_operators.
5058 * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
5059 identifier is an operator name in C++.
5061 2009-06-01 Aldy Hernandez <aldyh@redhat.com>
5063 * include/line-map.h (LAST_SOURCE_COLUMN): New.
5065 2009-06-01 Ian Lance Taylor <iant@google.com>
5067 * include/cpp-id-data.h: Add extern "C".
5068 * include/line-map.h: Likewise.
5069 * include/mkdeps.h: Likewise.
5070 * include/symtab.h: Likewise.
5071 * internal.h: Likewise.
5073 2009-05-15 Ian Lance Taylor <iant@google.com>
5075 * include/cpplib.h (enum cpp_builtin_type): Rename from enum
5076 builtin_type. Change all uses.
5078 2009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5081 * directives (do_linemarker): Compensate for the increment in
5082 location that occurs when we reach the end of line.
5083 * files (_cpp_stack_include): Mention _cpp_find_file in the
5086 2009-05-10 Joseph Myers <joseph@codesourcery.com>
5088 * include/cpplib.h (enum cpp_token_fld_kind): Add
5089 CPP_TOKEN_FLD_TOKEN_NO.
5090 (struct cpp_macro_arg, struct cpp_identifier): Define.
5091 (union cpp_token_u): Use struct cpp_identifier for identifiers.
5092 Use struct cpp_macro_arg for macro arguments. Add token_no for
5093 CPP_PASTE token numbers.
5094 * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
5095 do_pragma_poison, parse_assertion): Use val.node.node in place of
5097 * expr.c (parse_defined, eval_token): Use val.node.node in place
5099 * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
5100 cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
5101 cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
5102 place of val.arg_no. Use val.node.node in place of val.node.
5103 * macro.c (replace_args, cpp_get_token, parse_params,
5104 lex_expansion_token, create_iso_definition, cpp_macro_definition):
5105 Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
5106 Use val.node.node in place of val.node.
5108 2009-05-03 Joseph Myers <joseph@codesourcery.com>
5110 * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
5113 2009-04-25 Joseph Myers <joseph@codesourcery.com>
5115 PR preprocessor/39559
5116 * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
5117 constants larger than intmax_t in C99 mode.
5119 2009-04-21 Taras Glek <tglek@mozilla.com>
5121 * include/cpp-id-data.h: Update GTY annotations to new syntax.
5122 * include/cpplib.h: Likewise.
5123 * include/line-map.h: Likewise.
5124 * include/symtab.h: Likewise.
5126 2009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5129 * lex.c (cpp_type2name): Take a flags parameter. Call
5130 cpp_named_operator2name for named operators and cpp_digraph2name
5132 (cpp_digraph2name): New.
5133 (cpp_spell_token): Use it.
5134 (cpp_output_token): Likewise.
5135 * include/cpplib.h (cpp_type2name): Update declaration.
5136 * init.c (cpp_named_operator2name): New.
5137 * internal.h (cpp_named_operator2name): Declare.
5139 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5142 * init.c (cpp_create_reader): Wlong_long is disabled by default.
5143 * expr.c (cpp_classify_number): Give different messages for C and
5146 2009-04-19 Joseph Myers <joseph@codesourcery.com>
5148 PR preprocessor/20078
5149 * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
5151 * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
5152 (struct cpp_token): Change flags to unsigned short.
5153 * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
5154 (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
5155 (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
5157 * macro.c (macro_real_token_count): New.
5158 (enter_macro_context, replace_args): Use macro_real_token_count.
5159 (create_iso_definition): Record whitespace surrounding and digraph
5160 spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
5161 Set extra_tokens and save CPP_PASTE tokens with arg_no set for
5162 multiple consecutive ## tokens.
5163 (_cpp_create_definition): Initialize extra_tokens.
5164 (cpp_macro_definition): Use macro_real_token_count.
5166 2009-04-18 Joseph Myers <joseph@codesourcery.com>
5168 * directives.c (parse_include): Pass true to check_eol.
5170 2009-04-18 Joseph Myers <joseph@codesourcery.com>
5172 PR preprocessor/39646
5173 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
5174 * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
5175 * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
5178 2009-04-18 Joseph Myers <joseph@codesourcery.com>
5180 PR preprocessor/39647
5181 * directives.c (check_eol): Add parameter expand.
5182 (do_undef, parse_include, do_line, do_linemarker, do_ident,
5183 do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
5184 do_else, do_endif, do_assert, do_unassert): All callers changed.
5185 Pass true from do_line, false elsewhere.
5187 2009-04-12 Joseph Myers <joseph@codesourcery.com>
5189 PR preprocessor/31869
5190 * macro.c (stringify_arg): Handle NULL source token in padding
5191 token where previous padding token did not have source token with
5192 preceding whitespace.
5194 2009-04-09 Jakub Jelinek <jakub@redhat.com>
5196 * Makefile.in: Change copyright header to refer to version
5197 3 of the GNU General Public License and to point readers at the
5198 COPYING3 file and the FSF's license web page.
5199 * charset.c: Likewise.
5200 * directives-only.c: Likewise.
5201 * directives.c: Likewise.
5202 * errors.c: Likewise.
5204 * files.c: Likewise.
5205 * identifiers.c: Likewise.
5206 * include/cpp-id-data.h: Likewise.
5207 * include/cpplib.h: Likewise.
5208 * include/line-map.h: Likewise.
5209 * include/mkdeps.h: Likewise.
5210 * include/symtab.h: Likewise.
5212 * internal.h: Likewise.
5214 * line-map.c: Likewise.
5215 * macro.c: Likewise.
5216 * makeucnid.c: Likewise.
5217 * mkdeps.c: Likewise.
5219 * symtab.c: Likewise.
5220 * system.h: Likewise.
5221 * traditional.c: Likewise.
5222 * ucnid.tab: Likewise.
5223 * ucnid.h: Regenerate.
5225 2009-04-01 Janis Johnson <janis187@us.ibm.com>
5228 * include/cpplib.h (CPP_N_DEFAULT): Define.
5229 * expr.c (interpret_float_suffix): Recognize d or D for double,
5230 return new value for default.
5231 (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
5234 * expr.c (interpret_float_suffix): Reject invalid suffix that uses
5235 letters from decimal float and fixed-point suffixes.
5237 2009-03-31 Joseph Myers <joseph@codesourcery.com>
5239 PR preprocessor/15638
5240 * files.c (_cpp_find_file): Call open_file_failed after diagnosing
5242 (open_file_failed): Make error for missing file fatal.
5243 * include/cpplib.h (CPP_DL_FATAL): Define.
5245 2009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net>
5247 PR preprocessor/31932:
5248 * internal.h: Don't mention HAVE_ICONV_H.
5249 * configure, config.in: Rebuild.
5250 * configure.ac: Don't check for iconv.h.
5252 2009-03-30 Tom Tromey <tromey@redhat.com>
5254 PR preprocessor/39512:
5255 * line-map.c (linemap_init): Initialize 'reallocator' field.
5257 2009-03-30 Jakub Jelinek <jakub@redhat.com>
5260 * macro.c (cpp_get_token): If macro_to_expand returns NULL
5261 and used some tokens, add CPP_PADDING before next token.
5263 2009-03-29 Joseph Myers <joseph@codesourcery.com>
5265 PR preprocessor/34695
5266 * makedepend.c: Remove.
5267 * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
5268 (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
5269 * directives.c (cpp_errors): Remove.
5270 * errors.c (print_location, _cpp_begin_message, v_message):
5272 (cpp_error, cpp_error_with_line): Always use error callback.
5273 (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
5274 * include/cpplib.h (cpp_options): Remove pedantic_errors,
5275 inhibit_warnings, warn_system_headers, inhibit_errors,
5276 warnings_are_errors, client_diagnostic.
5277 (cpp_callbacks): Add extra arguments to error callback; make it
5279 (cpp_finish): Return void.
5280 (cpp_destroy): Remove inaccurate comment about return value.
5281 (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
5282 (CPP_DL_NOTE): Define.
5283 * include/line-map.h (linemap_print_containing_files): Remove.
5284 * init.c (cpp_finish): Do not check for or return number of
5286 * internal.h (cpp_reader): Remove errors field.
5287 * line-map.c (linemap_print_containing_files): Remove.
5288 * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
5289 about previous definition. Only emit it if previous diagnostic
5292 2009-03-28 Joseph Myers <joseph@codesourcery.com>
5294 * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
5297 2009-03-18 Jakub Jelinek <jakub@redhat.com>
5299 * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
5301 2009-02-21 Joseph Myers <joseph@codesourcery.com>
5303 * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
5305 (_cpp_lex_direct): Handle this.
5307 2009-02-15 Richard Guenther <rguenther@suse.de>
5311 2009-02-13 Richard Guenther <rguenther@suse.de>
5313 * configure.ac: Enable LFS.
5314 * configure: Re-generate.
5315 * config.in: Likewise.
5317 2009-01-05 Ben Elliston <bje@au.ibm.com>
5319 * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
5320 (.po.pox): Likewise.
5321 (po/$(PACKAGE).pot): Likewise.
5323 2008-12-10 Alexandre Oliva <aoliva@redhat.com>
5326 * pch.c (cpp_valid_state): Improve message for poisoned symbols.
5327 Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
5329 2008-11-29 Joseph Myers <joseph@codesourcery.com>
5331 * lex.c (cpp_token_len): Use 6 as default length.
5333 2008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org>
5335 * expr.c (struct op): Add location.
5336 (_cpp_parse_expr): Propagate locations throught the stack
5339 (check_promotion): Use explicit location in errors.
5341 2008-10-05 Matthew Gingell <gingell@adacore.com>
5342 Arnaud Charlet <charlet@adacore.com>
5344 * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
5345 (cpp_get_comments): New function.
5346 * internal.h (struct cpp_reader): Add comments field.
5347 * init.c (cpp_destroy): Free comments.
5348 * lex.c (store_comment, cpp_get_comments): New functions.
5349 (comments): New struct.
5350 (save_comment): Store comments in comments struct.
5352 2008-09-18 Simon Baldwin <simonb@google.com>
5354 * include/cpplib.h (struct cpp_options): Add new boolean flag
5355 warn_builtin_macro_redefined.
5356 * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
5357 * (struct builtin_operator): Split out from previous struct builtin,
5358 enhance extra const correctness.
5359 * (struct builtin_macro): Split out from previous struct builtin, add
5360 new always_warn_if_redefined flag, enhance const correctness.
5361 * (mark_named_operators): Use struct builtin_operator.
5362 * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
5363 to builtins selectively.
5364 * macro.c (warn_of_redefinition): Return false if a builtin macro
5365 is not flagged with NODE_WARN.
5367 2008-07-31 Jakub Jelinek <jakub@redhat.com>
5369 PR preprocessor/36649
5370 * files.c (struct report_missing_guard_data): New type.
5371 (report_missing_guard): Put paths into an array instead of printing
5372 them right away. Return 1 rather than 0.
5373 (report_missing_guard_cmp): New function.
5374 (_cpp_report_missing_guards): Sort and print paths gathered by
5375 report_missing_guard callback.
5377 2008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5380 * directives.c (strtolinenum): Handle overflow.
5381 (do_line): Give a warning if line number overflowed.
5382 (do_linemarker): Update call to strtolinenum.
5384 2008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5386 * include/line-map.h (linenum_type): New typedef.
5387 (struct line_map): Use it.
5388 (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
5389 (SOURCE_COLUMN): Likewise.
5390 * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
5391 source_location values in a variable of type linenum_type.
5392 * directives.c (struct if_stack): Use linenum_type.
5393 (strtoul_for_line): Rename as strtolinenum.
5394 (do_line): Use linenum_type.
5395 (do_linemarker): Use linenum_type and strtolinenum.
5396 (_cpp_do_file_change): Use linenum_t.
5397 * line-map.c (linemap_add): Likewise.
5398 (linemap_line_start): Likewise.
5399 * traditional.c (struct fun_macro): 'line' is a source_location.
5400 * errors.c (print_location): Use linenum_type.
5401 * directives-only.c (_cpp_preprocess_dir_only): Likewise.
5402 * internal.h (CPP_INCREMENT_LINE): Likewise.
5403 * lex.c (_cpp_skip_block_comment): Use source_location.
5405 2008-07-14 Ben Elliston <bje@au.ibm.com>
5407 * include/cpplib.h (NODE_CONDITIONAL): New.
5408 (struct cpp_callbacks): New macro_to_expand field.
5409 (struct cpp_hashnode): Adjust size of flags and type fields.
5410 (cpp_peek_token): Prototype.
5411 * lex.c (cpp_peek_token): New function.
5412 (_cpp_temp_token): Protect pre-existing lookaheads.
5413 * macro.c (cpp_get_token): Expand any conditional macros.
5414 (_cpp_backup_tokens_direct): New.
5415 (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
5416 (warn_of_redefinition): Silently allow redefined conditional
5418 (_cpp_create_definition): Remove the conditional flag when a user
5419 defines one of the conditional macros.
5420 * internal.h (_cpp_backup_tokens_direct): New prototype.
5422 2008-06-13 Andrew Haley <aph@redhat.com>
5424 PR preprocessor/33305
5425 * macro.c (replace_args): Print a warning for empty macro
5426 arguments in C89 and C++.
5428 2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5430 * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
5431 * configure: Regenerate.
5433 2008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5435 * Makefile.in (datarootdir): New variable.
5437 2008-06-12 H.J. Lu <hongjiu.lu@intel.com>
5439 PR preprocessor/36479
5440 * charset.c (cpp_interpret_string_notranslate): Also set
5441 narrow_cset_desc.width.
5443 2008-06-07 Joseph Myers <joseph@codesourcery.com>
5445 * configure.ac (parisc*64*-*-*): Remove.
5446 * configure: Regenerate.
5448 2008-05-30 Tom Tromey <tromey@redhat.com>
5450 PR preprocessor/36320:
5451 * internal.h (_cpp_parse_expr): Update.
5452 * expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error
5454 * directives.c (do_if): Update.
5455 (do_elif): Require expression if processing group.
5457 2008-05-30 Danny Smith <dannysmith@users.sourceforge.net>
5459 * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
5461 2008-05-21 Tom Tromey <tromey@redhat.com>
5463 PR preprocessor/27777:
5464 * lex.c (cpp_output_line_to_string): New function.
5465 * internal.h (_cpp_begin_message): Don't declare.
5466 * errors.c (_cpp_begin_message): Now static.
5467 * include/cpplib.h (cpp_output_line_to_string): Declare.
5468 * directives.c (do_diagnostic): Rewrote. Use
5469 cpp_output_line_to_string. Don't use _cpp_begin_message.
5471 2008-05-21 Tom Tromey <tromey@redhat.com>
5473 * include/symtab.h (HT_ALLOCED): Remove.
5474 (ht_purge): Declare.
5475 * symtab.c (DELETED): New define.
5476 (ht_lookup): Update comment.
5477 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED
5478 code. Use subobject allocator for strings, if it exists.
5479 (ht_expand): Handle deleted entries.
5480 (ht_forall): Likewise.
5481 (ht_purge): New function.
5482 (ht_dump_statistics): Print deletion statistics.
5484 2008-05-13 Tom Tromey <tromey@redhat.com>
5486 PR preprocessor/22168:
5487 * include/cpplib.h (struct cpp_options) <objc>: Update
5489 * expr.c (eval_token): Warn for use of assertions.
5490 * directives.c (directive_diagnostics): Warn about extensions.
5491 (DEPRECATED): New define.
5492 (DIRECTIVE_TABLE): Use it.
5494 2008-05-06 Tom Tromey <tromey@redhat.com>
5496 PR preprocessor/35313, PR preprocessor/36088:
5497 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
5498 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
5500 2008-05-04 David S. Miller <davem@davemloft.net>
5502 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
5503 * configure: Regenerate.
5505 2008-04-22 Daniel Franke <franke.daniel@gmail.com>
5507 * include/cpplib.h (cpp_define_formatted): New.
5508 * directives.c (cpp_define_formatted): New.
5510 2008-04-21 Tom Tromey <tromey@redhat.com>
5513 * charset.c (_cpp_convert_input): Add buffer_start argument.
5514 Ignore UTF-8 BOM if seen.
5515 * internal.h (_cpp_convert_input): Add argument.
5516 * files.c (struct _cpp_file) <buffer_start>: New field.
5517 (destroy_cpp_file): Free buffer_start, not buffer.
5518 (_cpp_pop_file_buffer): Likewise.
5519 (read_file_guts): Update.
5521 2008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
5523 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
5524 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
5525 (struct cpp_options): Added uliterals.
5526 (cpp_interpret_string): Update prototype.
5527 (cpp_interpret_string_notranslate): Idem.
5528 * charset.c (init_iconv_desc): New width member in cset_converter.
5529 (cpp_init_iconv): Add support for char{16,32}_cset_desc.
5530 (convert_ucn): Idem.
5531 (emit_numeric_escape): Idem.
5532 (convert_hex): Idem.
5533 (convert_oct): Idem.
5534 (convert_escape): Idem.
5535 (converter_for_type): New function.
5536 (cpp_interpret_string): Use converter_for_type, support u and U prefix.
5537 (cpp_interpret_string_notranslate): Match changed prototype.
5538 (wide_str_to_charconst): Use converter_for_type.
5539 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
5540 * directives.c (linemarker_dir): Macro U changed to UC.
5541 (parse_include): Idem.
5542 (register_pragma_1): Idem.
5543 (restore_registered_pragmas): Idem.
5544 (get__Pragma_string): Support CPP_STRING{16,32}.
5545 * expr.c (eval_token): Support CPP_CHAR{16,32}.
5546 * init.c (struct lang_flags): Added uliterals.
5547 (lang_defaults): Idem.
5548 * internal.h (struct cset_converter) <width>: New field.
5549 (struct cpp_reader) <char16_cset_desc>: Idem.
5550 (struct cpp_reader) <char32_cset_desc>: Idem.
5551 * lex.c (digraph_spellings): Macro U changed to UC.
5553 (lex_string): Add support for u'...', U'...', u"..." and U"...".
5554 (_cpp_lex_direct): Idem.
5555 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
5556 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
5558 2008-04-18 Paolo Bonzini <bonzini@gnu.org>
5561 * aclocal.m4: Regenerate.
5562 * configure: Regenerate.
5564 2008-04-17 Tom Tromey <tromey@redhat.com>
5567 * errors.c (cpp_error): Don't reference a token before the start
5570 2008-04-16 Tom Tromey <tromey@redhat.com>
5572 * Makefile.in (TAGS_SOURCES): New variable.
5575 2008-04-11 Kaz Kojima <kkojima@gcc.gnu.org>
5577 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
5579 * configure: Rebuilt.
5581 2008-04-02 Joseph Myers <joseph@codesourcery.com>
5583 * include/cpplib.h (struct cpp_callbacks): Add used_define,
5584 used_undef and before_define.
5585 (NODE_USED): Define.
5586 * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
5587 do_ifndef, cpp_pop_definition): Handle new flag and use new
5589 * expr.c (parse_defined): Handle new flag and use new callbacks.
5590 * macro.c (enter_macro_context, _cpp_free_definition): Handle new
5591 flag and use new callbacks.
5593 2008-04-01 Jakub Jelinek <jakub@redhat.com>
5596 * files.c (struct _cpp_file): Remove pch field.
5597 (pch_open_file): Don't set file->pch, just file->pchname.
5598 (should_stack_file): After pfile->cb.read_pch call
5599 free pchname and clear pchname, don't close file->fd.
5600 Test file->pchname instead of file->pch. Don't close fd after cb.
5601 (_cpp_stack_include): Test file->pchname instead of file->pch.
5603 2008-03-28 Tom Tromey <tromey@redhat.com>
5605 * Makefile.in (POSTCOMPILE): New variable.
5608 2008-03-13 Tom Tromey <tromey@redhat.com>
5611 * directives.c (destringize_and_run): Set pfile->directive.
5613 2008-03-06 Markus Milleder <markus.milleder@generali.at>
5615 PR preprocessor/35458
5616 * mkdeps.c (munge): Quote '#' with a '\'.
5618 2008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5620 PR preprocessor/35379
5621 * mkdeps.c (deps_write): Ensure the first target always appears
5622 in the first column, without leading backslash newline. Avoid
5623 some more extra whitespace.
5625 2008-02-25 Thiemo Seufer <ths@mips.com>
5627 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
5629 2008-02-19 Tom Tromey <tromey@redhat.com>
5631 * traditional.c (lex_identifier): Use CPP_HASHNODE.
5632 * lex.c (lex_identifier): Use CPP_HASHNODE.
5633 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
5635 * identifiers.c (alloc_node): Change return type.
5636 (_cpp_init_hashtable): Don't cast 'alloc_node'.
5637 (proxy_assertion_broken): New declaration.
5638 (cpp_forall_identifiers): Move comment.
5639 * line-map.c (linemap_add): Comment fix.
5640 (linemap_line_start): Indentation fix.
5642 2008-01-25 Jakub Jelinek <jakub@redhat.com>
5644 PR preprocessor/34692
5645 * macro.c (collect_args): Add pragma_buff argument. Push
5646 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
5647 than into arguments. Reset prevent_expansion and parsing_args
5648 state at CPP_PRAGMA_EOL/CPP_EOF.
5649 (funlike_invocation_p): Add pragma_buff argument, pass it through
5651 (enter_macro_context): Add result argument. Adjust
5652 funlike_invocation_p caller. Emit all deferred pragma tokens
5653 gathered during collect_args before the expansion, add a padding
5654 token. Return 2 instead of 1 if any pragma tokens were prepended.
5655 (cpp_get_token): If enter_macro_context returns 2, don't return
5656 a padding token, instead cycle to grab CPP_PRAGMA token.
5657 * directives.c (_cpp_handle_directive): If was_parsing_args
5658 in deferred pragma, leave parsing_args and prevent_expansion as is.
5660 2008-01-22 Tom Tromey <tromey@redhat.com>
5663 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
5664 __STDC_CONSTANT_MACROS.
5666 2008-01-07 Fred Fish <fnf@specifix.com>
5668 PR preprocessor/30363
5669 * traditional.c (replace_args_and_push): Add local variable
5670 cxtquote, calculate the replacement text size assuming a
5671 worst case of every input character quoted with backslash,
5672 and properly handle output quoting of quote characters in
5673 actual arguments used in function-like macros.
5675 2008-01-03 Tom Tromey <tromey@redhat.com>
5677 PR preprocessor/34602
5678 * directives.c (do_line): Don't try to spell EOF token.
5679 (do_linemarker): Add comment.
5681 2007-12-11 DJ Delorie <dj@redhat.com>
5683 * charset.c (convert_using_iconv): Close out any shift states,
5684 returning to the initial state.
5686 2007-12-06 Tom Tromey <tromey@redhat.com>
5689 * internal.h (struct cpp_reader) <file_hash_entries>: Changed
5691 <file_hash_entries_allocated, file_hash_entries_used>: Removed.
5692 * files.c (FILE_HASH_POOL_SIZE): New macro.
5693 (struct file_hash_entry_pool): New.
5694 (destroy_all_cpp_files): New function.
5695 (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
5696 (new_file_hash_entry): Update.
5697 (free_file_hash_entries): New function.
5698 (_cpp_cleanup_files): Call free_file_hash_entries and
5699 destroy_all_cpp_files.
5700 (cpp_clear_file_cache): New function.
5701 * include/cpplib.h (cpp_clear_file_cache): Declare.
5703 2007-12-03 Tom Tromey <tromey@redhat.com>
5705 PR preprocessor/34288
5706 * configure.ac, config.in: Rebuilt.
5707 * configure.ac: Check for ssize_t.
5709 2007-11-30 Tom Tromey <tromey@redhat.com>
5711 PR preprocessor/32868
5712 * macro.c (_cpp_create_definition): Special case
5713 __STDC_FORMAT_MACROS.
5715 2007-11-16 Michael Matz <matz@suse.de>
5717 * files.c (search_path_head): Fix check for absolute paths.
5719 2007-11-11 Tom Tromey <tromey@redhat.com>
5722 * include/cpplib.h (cpp_included_before): Declare.
5723 * files.c (struct file_hash_entry) <location>: New field.
5724 (_cpp_find_file): Initialize new field.
5725 (make_cpp_dir): Likewise.
5726 (cpp_included_before): New function.
5728 2007-11-01 Tom Tromey <tromey@redhat.com>
5730 PR preprocessor/30805
5731 * macro.c (paste_tokens): Handle padding token.
5732 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
5734 2007-10-31 Tom Tromey <tromey@redhat.com>
5736 PR preprocessor/30786
5737 * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
5738 * directives.c (_cpp_do__Pragma): Return error status.
5739 * internal.h (_cpp_do__Pragma): Update.
5740 * directives.c (get__Pragma_string): Back up if EOF seen.
5742 2007-09-06 Tom Tromey <tromey@redhat.com>
5744 * internal.h (struct cpp_reader) <invocation_location>: New
5746 (struct cpp_reader) <set_invocation_location>: Likewise.
5747 * init.c (cpp_set_line_map): New function.
5748 * line-map.c (linemap_add): Use linemap's allocator.
5749 * include/line-map.h (GTY): Define.
5750 (line_map_realloc): New typedef.
5751 (struct line_map): Mark with GTY.
5752 (struct line_maps): Likewise.
5753 (struct line_maps) <maps>: Likewise.
5754 (struct line_maps) <reallocator>: New field.
5755 * include/symtab.h (GTY): Conditionally define.
5756 * include/cpplib.h (cpp_set_line_map): Declare.
5757 (cpp_get_token_with_location): Declare.
5758 * macro.c (cpp_get_token): Set invocation_location on the reader.
5759 (cpp_get_token_with_location): New function.
5761 2007-08-30 Chao-ying Fu <fu@mips.com>
5763 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
5764 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
5765 (cpp_classify_number): Support decimal fixed-point constants without
5767 Warn about fixed-point constants when -pedantic.
5768 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
5769 comments to support fixed-point values.
5770 (CPP_N_FRACT, CPP_N_ACCUM): Define.
5772 2007-08-18 Tom Tromey <tromey@redhat.com>
5774 PR preprocessor/32974
5775 * directives.c (parse_include): Don't check for EOL when
5776 processing #pragma dependency.
5778 2007-07-30 Ollie Wild <aaw@google.com>
5780 * directives-only.c: New file.
5781 * internal.h (struct _cpp_dir_only_callbacks): New.
5782 (_cpp_preprocess_dir_only): New function.
5783 * directives.c (_cpp_handle_directive): Check directives_only before
5784 disabling execution of indented directives.
5785 * files.c (_cpp_stack_file): Add directives_only check.
5786 * include/cpplib.h (struct cpp_options): Add directives_only.
5787 (cpp_init_special_builtins): New function.
5788 * init.c (cpp_init_special_builtins): New function.
5789 (cpp_init_builtins): Move builtin_array initialization to
5790 cpp_init_special_builtins.
5791 (post_options): Check directives_only before setting
5792 pfile->state.prevent_expansion = 1.
5793 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
5794 is expanded inside a directive while -fdirectives-only is enabled.
5795 * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
5796 (libcpp_a_SOURCES): Add directives-only.c.
5798 2007-07-04 Uros Bizjak <ubizjak@gmail.com>
5800 * traditional.c (_cpp_scan_out_logical_line): Initialize
5801 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
5802 fmacro.args to prevent 'may be used uninitialized' warning.
5804 2007-07-03 Uros Bizjak <ubizjak@gmail.com>
5806 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
5808 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
5809 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
5810 for 'q' or 'Q' suffixes.
5812 2007-06-17 Danny Smith <dannysmith@users.sourceforge.net
5814 * files.c (open_file): Correct typo.
5816 2007-06-16 Vladimir Prus <vladimir@codesourcery.com>
5818 * files.c (open_file): Prevent the call
5819 for stat from overwriting errno.
5821 2007-06-09 Vladimir Prus <vladimir@codesourcery.com>
5823 * files.c (open_file): Account for the
5824 fact that on windows, opening a directory gives
5827 2007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
5829 PR preprocessor/23479
5830 * expr.c (cpp_classify_number): Implement 0b-prefixed binary
5832 (append_digit): Likewise.
5833 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
5834 binary integer constants.
5836 2007-05-31 Dave Korn <dave.korn@artimi.com>
5838 PR preprocessor/14331
5839 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
5841 2007-05-24 Ollie Wild <aaw@google.com>
5843 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
5844 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
5845 (cpp_write_pch_state): Save __COUNTER__ state.
5846 (cpp_valid_state): Check valid __COUNTER__ state.
5847 (cpp_read_state): Read new __COUNTER__ state.
5848 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
5849 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
5850 * internal.h (struct cpp_reader): Add counter member.
5852 2007-05-23 Simon Martin <simartin@users.sourceforge.net>
5854 PR preprocessor/20077
5855 * macro.c (create_iso_definition): Fixed the method to determine
5856 whether the token-pasting operator appears at the beginning or the end
5859 2007-05-21 Ian Lance Taylor <iant@google.com>
5861 * internal.h (struct cpp_reader): Add new fields:
5862 nonexistent_file_hash and nonexistent_file_ob.
5863 * files.c: Include "obstack.h".
5864 (find_file_in_dir): Before trying to open the file, look up the
5865 path name in the hash table of nonexistent files. After failing
5866 to open the file, add the path name to the hash table.
5867 (_cpp_find_file): Cache the results of looking up the file name
5868 starting with the quote and bracket chain heads, if we can.
5869 (nonexistent_file_hash_eq): New static function.
5870 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
5871 pfile->nonexistent_file_ob.
5872 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
5873 pfile->nonexistent_file_ob.
5875 2007-05-14 Janis Johnson <janis187@us.ibm.com>
5877 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
5880 * expr.c (interpret_float_suffix): Check for invalid suffix.
5882 2007-05-02 Eric Christopher <echristo@apple.com>
5884 * expr.c (num_div_op): Don't overflow if the result is
5887 2007-05-02 Tom Tromey <tromey@redhat.com>
5889 PR preprocessor/28709
5890 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
5892 2007-03-30 Michael Meissner <michael.meissner@amd.com>
5894 * directives.c (lex_macro_node_from_str): Fix alloca call to be
5897 2007-03-30 Richard Henderson <rth@redhat.com>
5899 * directives.c (lex_macro_node_from_str): New.
5900 (cpp_push_definition, cpp_pop_definition): New.
5901 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
5903 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
5905 * Makefile.in: Add dummy install-pdf target.
5907 2007-01-30 Tom Tromey <tromey@redhat.com>
5909 PR preprocessor/30468
5910 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
5913 2007-01-30 Tom Tromey <tromey@redhat.com>
5915 PR preprocessor/29966
5916 * macro.c (lex_expansion_token): Save and restore cpp_reader's
5918 (_cpp_create_definition): Don't restore cur_token here.
5919 * lex.c (_cpp_lex_token): Added assertion.
5921 2007-01-27 Tom Tromey <tromey@redhat.com>
5923 * configure: Rebuilt.
5925 2007-01-12 Tom Tromey <tromey@redhat.com>
5927 PR preprocessor/28227
5928 * directives.c (lex_macro_node): Added 'is_def_or_undef'
5930 (do_define): Update.
5933 (do_ifndef): Update.
5935 2007-01-11 Paolo Bonzini <bonzini@gnu.org>
5937 * configure: Regenerate.
5939 2007-01-11 Paolo Bonzini <bonzini@gnu.org>
5941 * configure: Regenerate.
5943 2007-01-04 Tom Tromey <tromey@redhat.com>
5945 PR preprocessor/28165
5946 * internal.h (cpp_in_primary_file): New function.
5947 * directives.c (do_include_next): Use cpp_in_primary_file.
5948 (do_pragma_once): Likewise.
5949 (do_pragma_system_header): Likewise.
5951 2006-12-29 Ian Lance Taylor <iant@google.com>
5953 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
5954 look backward at the end of the line unless we saw a backslash.
5956 2006-12-29 Jakub Jelinek <jakub@redhat.com>
5958 PR preprocessor/29612
5959 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
5960 only when new_sysp is non-zero.
5962 2006-12-28 Tom Tromey <tromey@redhat.com>
5964 PR preprocessor/30001
5965 * charset.c (_cpp_convert_input): Check that to.len is greater
5968 2006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
5970 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
5971 * configure: Rebuilt.
5973 2006-11-01 Douglas Gregor <doug.gregor@gmail.com>
5975 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
5976 for experimental C++0x mode.
5977 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
5978 adopted the preprocessor changes introduced in C99.
5980 2006-10-29 Joseph Myers <joseph@codesourcery.com>
5982 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
5983 depending on --enable-targets=all.
5984 * configure: Regenerate.
5986 2006-10-12 Jakub Jelinek <jakub@redhat.com>
5988 PR preprocessor/28709
5989 * macro.c (paste_tokens): Do error reporting here, use BUF with the
5990 spelled LHS token as opposed to spelling it again.
5991 (paste_all_tokens): Don't report errors here, just break on failure.
5993 2006-10-10 Brooks Moses <bmoses@stanford.edu>
5995 * Makefile.in: Added empty "pdf" target.
5997 2006-09-22 Geoffrey Keating <geoffk@apple.com>
5999 * configure.ac: Make need_64_bit_hwint case for x86-darwin
6000 match exactly the glob in gcc/config.gcc.
6001 * configure: Regenerate.
6003 2006-09-13 Joseph S. Myers <joseph@codesourcery.com>
6006 PR preprocessor/14634
6007 * lex.c (lex_string): Pedwarn for unterminated literals.
6009 2006-09-08 Eric Christopher <echristo@apple.com>
6011 * configure.ac: Add 64-bit HWI support for i?86-darwin.
6013 2006-08-14 Steve Ellcey <sje@cup.hp.com>
6017 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
6018 (CPP_LAST_EQ): Change.
6019 (CPP_LAST_PUNCTUATOR): Change.
6020 * expr.c (cpp_operator): Remove MIN and MAX.
6021 (reduce): Remove CPP_MIN and CPP_MAX.
6022 (num_binary_op): Ditto.
6023 * lex.c (_cpp_lex_direct): Ditto.
6024 (cpp_avoid_paste): Remove ? as legal symbol after > or <.
6026 2006-06-09 Jakub Jelinek <jakub@redhat.com>
6028 PR preprocessor/27746
6029 * directives.c (do_pragma): Handle pragma with valid namespace
6030 and invalid name coming from macro expansion.
6031 * directives.c (destringize_and_run): Initialize next field in
6036 * directives.c (destringize_and_run): Set NO_EXPAND on the
6039 * macro.c (_cpp_backup_tokens): Fix comment typo.
6041 2006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
6043 * Makefile.in (CATALOGS): Add po/ prefix.
6044 * configure: Regenerated.
6046 2006-05-23 Carlos O'Donell <carlos@codesourcery.com>
6048 * Makefile.in: Add install-html target. Add install-html to .PHONY
6050 2006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
6052 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
6053 * files.c (_cpp_get_file_stat): New function.
6054 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
6055 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
6056 * internal.h (_cpp_get_file_stat): Prototype.
6057 (struct cpp_buffer): Add timestamp.
6059 2006-01-23 Jakub Jelinek <jakub@redhat.com>
6061 PR preprocessor/25717
6062 * init.c (cpp_init_builtins): If __STDC__ will not change value
6063 between system headers and other sources, define it as a normal
6064 macro rather than a builtin.
6065 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
6066 cpp_in_system_header condition.
6068 2006-01-05 Paolo Bonzini <bonzini@gnu.org>
6070 * Makefile.in: Use -MMD instead of -MD.
6072 2006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
6073 Richard Henderson <rth@redhat.com>
6075 Merge from gomp branch:
6076 * directives.c (struct pragma_entry): Add is_deferred. Add ident
6077 entry to value union.
6078 (end_directive): Don't eat the line if in_deferred_pragma.
6079 (run_directive): Remove pragma hacks.
6080 (insert_pragma_entry): Remove.
6081 (new_pragma_entry): New.
6082 (register_pragma_1): Split out of register_pragma. Only handle
6083 the lookup tree and return the new entry.
6084 (cpp_register_pragma): Fill in the pragma entry here.
6085 (cpp_register_deferred_pragma): New.
6086 (register_pragma_internal): New.
6087 (_cpp_init_internal_pragmas): Use register_pragma_internal.
6088 (do_pragma): Allow pragma expansion after namespace. For deferred
6089 pragmas, don't slurp the line into a string.
6090 (destringize_and_run): Save tokens for deferred pragmas.
6091 (cpp_handle_deferred_pragma): Remove.
6092 * macro.c (builtin_macro): Remove pragma token hack.
6093 (_cpp_push_token_context): Rename from push_token_context and export.
6094 * internal.h (struct lexer_state): Add pragma_allow_expansion.
6095 (_cpp_push_token_context): Declare.
6096 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
6097 a token. Update the line number correctly if so.
6098 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
6099 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
6100 * include/cpplib.h (PRAGMA_EOL): New.
6101 (CPP_TOKEN_FLD_PRAGMA): New.
6102 (struct cpp_token): Add val.pragma.
6103 (struct cpp_options): Remove defer_pragmas.
6104 (cpp_handle_deferred_pragma): Remove.
6105 (cpp_register_deferred_pragma): Declare.
6107 2006-01-01 Jakub Jelinek <jakub@redhat.com>
6110 * directives.c (do_pragma): If pragma line ends with multi-line
6111 block comment, end the saved deferred pragma string before that
6112 comment. Handle embedded '\0' chars on the pragma line.
6114 2005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
6117 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
6119 2005-12-07 Jon Grimm <jgrimm2@us.ibm.com>
6120 Ben Elliston <bje@au.ibm.com>
6122 * include/cpplib.h (CPP_N_DFLOAT): New.
6123 * expr.c (interpret_float_suffix): Identify df, dd, and dl
6124 suffixes as decimal floating point constants.
6125 (cpp_classify_number): Disallow hexadecimal DFP constants.
6127 2005-11-14 Gerald Pfeifer <gerald@pfeifer.com>
6128 Ian Lance Taylor <ian@airs.com>
6130 * include/cpplib.h (struct cpp_callbacks): Annotate error with
6131 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
6133 2005-11-09 Per Bothner <per@bothner.com>
6134 Uros Bizjak <uros@kss-loka.si>
6137 * init.c (read_original_filename): Temporarily set
6138 state.in_directive before calling _cpp_lex_direct for
6141 2005-11-03 James E Wilson <wilson@specifix.com>
6143 PR preprocessor/24202
6144 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
6146 2005-11-04 Joseph S. Myers <joseph@codesourcery.com>
6148 * include/cpplib.h (struct cpp_callbacks): Make error take
6150 * errors.c (cpp_error): Update call to callback.
6152 2005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
6154 PR preprocessor/22042
6155 * macro.c (_cpp_builtin_macro_text): Lower the needed max
6157 (cpp_quote_string): Don't octalify non printable
6160 2005-11-03 Joseph S. Myers <joseph@codesourcery.com>
6163 * include/cpplib.h (struct cpp_options): Add client_diagnostic.
6164 (struct cpp_callbacks): Add error.
6165 * errors.c (cpp_error): If client_diagnostic, use error callback.
6166 * charset.c (convert_escape): Don't use %03o in diagnostic.
6168 2005-10-21 James E Wilson <wilson@specifix.com>
6170 PR preprocessor/15220
6171 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all
6172 callers. Pass to open_file_failed.
6173 (open_file_failed): New parameter angle_brackets. Fix all callers.
6174 Use in print_dep assignment.
6175 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
6176 * internal.h (_cpp_find_file): Add new parm to declaration.
6178 2005-10-08 Kazu Hirata <kazu@codesourcery.com>
6180 * configure.ac: Require 64-bit int for arm*-*-*eabi*.
6181 * configure: Regenerate.
6183 2005-10-04 Ian Lance Taylor <ian@airs.com>
6185 PR preprocessor/13726
6186 * directives.c (check_eol_return_comments): New static function.
6187 (parse_include): Add buf parameter. Change all callers.
6188 (do_include_common): If not discard comments, turn on
6189 save_comments. Pass collected comments to include callback.
6190 * include/cpplib.h (struct cpp_callbacks): Add new parameter to
6191 include callback: cpp_token list.
6193 2005-09-20 Joseph S. Myers <joseph@codesourcery.com>
6195 * include/cpplib.h (struct cpp_options): Add extended_identifiers.
6196 * init.c (struct lang_flags, lang_defaults): Add
6197 extended_identifiers.
6198 (cpp_set_lang): Use it.
6199 * lex.c (forms_identifier_p): Check extended_identifiers.
6201 2005-08-30 Jakub Jelinek <jakub@redhat.com>
6203 PR preprocessor/20348
6204 PR preprocessor/20356
6205 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
6208 2005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6210 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
6211 -Wmissing-format-attribute.
6213 * configure: Regenerate.
6215 2005-06-29 Kelley Cook <kcook@gcc.gnu.org>
6217 * all files: Update FSF address in copyright headers.
6218 * makeucnid.c (write_copyright): Update outputted FSF address.
6220 2005-06-13 Zack Weinberg <zack@codesourcery.com>
6222 * configure.ac: Invoke ZW_CREATE_DEPDIR and
6223 ZW_PROG_COMPILER_DEPENDENCIES.
6224 * aclocal.m4, configure: Regenerate.
6225 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
6227 (distclean): Clean up $(DEPDIR) and its contents.
6228 (.c.o): Use $(COMPILE).
6229 Include $(DEPDIR)/*.Po for most object->header dependencies.
6231 2005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
6233 * configure.ac: Check declarations for asprintf and vasprintf.
6234 * config.in: Regenerate.
6235 * configure: Likewise.
6237 * charset.c (conversion_loop): Use XRESIZEVEC.
6238 (convert_no_conversion): Likewise.
6239 (convert_using_iconv): Likewise.
6240 (init_iconv_desc): Cast return value of alloca.
6241 (cpp_host_to_exec_charset): Use XNEWVEC.
6242 (emit_numeric_escape): Use XRESIZEVEC.
6243 (cpp_interpret_string): Use XNEWVEC.
6244 (cpp_interpret_string): Use XRESIZEVEC.
6245 (_cpp_interpret_identifier): Cast return value of alloca.
6246 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
6247 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
6248 (parse_include): Use XNEWVEC.
6249 (insert_pragma_entry): Rename local variable "new" to
6251 (save_registered_pragmas): Cast return value of xmemdup.
6252 (destringize_and_run): Same for alloca.
6253 (parse_assertion): Likewise.
6254 (do_assert): Cast allocated storage to proper type.
6255 (cpp_define): Likewise.
6256 (_cpp_define_builtin): Likewise.
6257 (cpp_undef): Likewise.
6258 (handle_assertion): Likewise.
6259 (cpp_push_buffer): Rename local variable "new" to "new_buffer".
6260 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
6261 (CPP_UMINUS): Likewise.
6262 (struct cpp_operator): Rename from struct operator.
6263 (_cpp_expand_op_stack): Use XRESIZEVEC.
6264 * files.c (pch_open_file): Use XNEWVEC.
6265 (pch_open_file): Use XRESIZEVEC.
6266 (read_file_guts): Use XNEWVEC and XRESIZEVEC.
6267 (dir_name_of_file): Use XNEWVEC.
6268 (make_cpp_file): Use XCNEW.
6269 (make_cpp_dir): Likewise.
6270 (allocate_file_hash_entries): USE XNEWVEC.
6271 (cpp_included): Cast return value of htab_find_with_hash.
6272 (append_file_to_dir): Use XNEWVEC.
6273 (read_filename_string): Likewise. Use XRESIZEVEC too.
6274 (read_name_map): Cast return value of alloca. Use XRESIZEVEC.
6275 (remap_filename): Use XNEWVEC.
6276 (struct pchf_entry): Move definition out of struct pchf_data.
6277 (_cpp_save_file_entries): Use XCNEWVAR.
6278 (_cpp_read_file_entries): Use XNEWVAR.
6279 * identifiers.c (alloc_node): Use XOBNEW.
6280 * init.c (cpp_create_reader): Use XCNEW.
6281 (cpp_init_builtins): Cast of b->value to enum builtin_type.
6282 (read_original_directory): Cast return value of alloca.
6283 * lex.c (add_line_note): Use XRESIZEVEC.
6284 (warn_about_normalization): Use XNEWVEC.
6285 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
6286 (new_buff): Use XNEWVEC.
6287 * line-map.c (linemap_add): Use XRESIZEVEC.
6288 * macro.c (builtin_macro): Cast return value of alloca.
6289 (paste_tokens): Likewise.
6290 (expand_arg): Use XNEWVEC and XRESIZEVEC.
6291 (_cpp_save_parameter): Use XRESIZEVEC.
6292 (create_iso_definition): Cast allocated storage to proper type.
6293 (_cpp_create_definition): Likewise.
6294 (cpp_macro_definition): Use XRESIZEVEC.
6295 * makedepend.c (add_clm): Use XNEW.
6296 (add_dir): Likewise.
6297 * mkdeps.c (munge): Use XNEWVEC.
6298 (deps_init): Use XCNEW.
6299 (deps_add_target): Use XRESIZEVEC.
6300 (deps_add_default_target): Cast return value of alloca.
6301 (deps_add_dep): Use XRESIZEVEC.
6302 (deps_add_vpath): Likewise. Use XNEWVEC too.
6303 (deps_restore): Likewise.
6304 * pch.c (save_idents): Use XNEW and XNEWVEC.
6305 (cpp_save_state): Use XNEW.
6306 (count_defs): Cast return value of htab_find.
6307 (write_defs): Likewise.
6308 (cpp_write_pch_deps): Use XNEWVEC.
6309 (collect_ht_nodes): Use XRESIZEVEC.
6310 (cpp_valid_state): Use XNEWVEC.
6311 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup.
6312 * symtab.c (ht_create): Use XCNEW.
6313 (ht_lookup_with_hash): Cast return value of obstack_copy0.
6314 (ht_expand): Use XCNEWVEC.
6315 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
6316 (bool): Do not define if __cplusplus.
6318 2005-05-12 Zack Weinberg <zack@codesourcery.com>
6320 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
6321 (do_sccs): Delete function definition, #define to do_ident.
6322 (do_ident): Don't hardwire directive name.
6324 2005-05-12 Ryota Kunisawa <kunisawa@access.co.jp>
6327 * configure: Regenerate.
6329 2005-04-27 Andris Pavenis <pavenis@latnet.lv>
6331 * files.c: Include io.h for DJGPP to get prototype of setmode.
6333 2005-04-19 Per Bothner <per@bothner.com>
6335 PR preprocessor/20907
6336 * line-map.c (linemap_line_start): Fix bug when we need to increse
6337 column_bits but can re-use the current line_map.
6339 2005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6341 * system.h (fopen, fdopen, freopen): Define these to the unlocked
6342 libiberty functions.
6344 2005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6346 * configure.ac (libcpp_UNLOCKED_FUNCS): New.
6347 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
6348 * system.h (putchar, getc, getchar, clearerr, feof, fileno,
6349 fflush, fgetc, fgets, ferror, fread): Redefine to the associated
6351 (fwrite_unlocked): Fix prototype.
6353 * configure, config.in: Regenerate.
6355 2005-04-05 Jakub Jelinek <jakub@redhat.com>
6357 PR preprocessor/19475
6358 * macro.c (create_iso_definition): For < ISO C99, don't
6359 pedwarn if there is no whitespace between macro name and its
6360 replacement, but the replacement starts with a basic character
6363 2005-03-28 Andreas Jaeger <aj@suse.de>
6365 * lex.c (warn_about_normalization): Cast field width to int to
6368 2005-03-19 Joseph S. Myers <joseph@codesourcery.com>
6370 * configure.ac: Consistently use solaris2.1[0-9]* instead of
6372 * configure: Regenerate.
6374 2005-03-15 Geoffrey Keating <geoffk@apple.com>
6376 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
6377 UCN rather than printing an error.
6379 2005-03-14 Geoffrey Keating <geoffk@apple.com>
6381 * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
6383 2005-03-14 Geoffrey Keating <geoffk@apple.com>
6385 * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
6386 * charset.c: Update for new format of ucnid.h.
6387 (ucn_valid_in_identifier): Update for new format of ucnid.h.
6388 Add NST parameter, and update it; update callers.
6389 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort
6391 (convert_ucn): Pass normalize_state to cpp_valid_ucn.
6392 * internal.h (struct normalize_state): New.
6393 (INITIAL_NORMALIZE_STATE): New.
6394 (NORMALIZE_STATE_RESULT): New.
6395 (NORMALIZE_STATE_UPDATE_IDNUM): New.
6396 (_cpp_valid_ucn): New.
6397 * lex.c (warn_about_normalization): New.
6398 (forms_identifier_p): Add normalize_state parameter, update callers.
6399 (lex_identifier): Add normalize_state parameter, update callers. Keep
6401 (lex_number): Likewise.
6402 (_cpp_lex_direct): Pass normalize_state to subroutines. Check
6403 it with warn_about_normalization.
6407 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove
6408 comments about obsolete version of C++.
6409 * include/cpplib.h (enum cpp_normalize_level): New.
6410 (struct cpp_options): Add warn_normalize field.
6412 2005-03-11 Geoffrey Keating <geoffk@apple.com>
6414 * directives.c (glue_header_name): Update call to cpp_spell_token.
6415 * internal.h (_cpp_interpret_identifier): New.
6416 * charset.c (_cpp_interpret_identifier): New.
6417 (_cpp_valid_ucn): Allow UCN version of '$'.
6418 * lex.c (lex_identifier): Add extra parameter to indicate if initial
6419 character was '$' or '\'. Support identifiers with UCNs.
6420 (forms_identifier_p): Allow UCNs.
6421 (_cpp_lex_direct): Pass extra parameter to lex_identifier.
6423 (cpp_spell_token): Add FORSTRING parameter. Use it.
6424 (cpp_token_as_text): Update call to cpp_spell_token.
6425 (cpp_output_token): Write UCNs back out.
6426 (stringify_arg): Update call to cpp_spell_token.
6427 (paste_tokens): Likewise.
6428 (cpp_macro_definition): Likewise.
6429 * macro.c (stringify_arg): Likewise.
6430 (paste_tokens): Likewise.
6431 (cpp_macro_definition): Likewise.
6432 * include/cpplib.h: Add parameter to cpp_spell_token.
6434 2005-03-04 Jakub Jelinek <jakub@redhat.com>
6438 * macro.c (replace_args, cpp_get_token): Copy whole
6439 cpp_token_u instead of just cpp_string field from it.
6441 2005-02-28 Devang Patel <dpatel@apple.com>
6443 * directives.c (do_line): Save sysp early before line table is
6446 2005-02-20 Zack Weinberg <zack@codesourcery.com>
6449 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
6450 (cpp_host_to_exec_charset): New function.
6451 * include/cpplib.h: Declare cpp_host_to_exec_charset.
6453 2005-02-19 Devang Patel <dpatel@apple.com>
6455 * charset.c (_cpp_convert_input): Check '\r' before inserting
6458 2005-02-15 Eric Christopher <echristo@redhat.com>
6460 PR preprocessor/19077
6461 * macro.c (cpp_macro_definition): Move handling of whitespace
6462 to PREV_WHITE conditional. Remove overloading of len
6465 2005-02-14 Kazu Hirata <kazu@cs.umass.edu>
6467 * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
6468 traditional.c: Update copyright.
6470 2005-02-14 Paolo Bonzini <bonzini@gnu.org>
6473 * configure.ac: Check for declaration of basename and getopt.
6474 * config.in: Regenerate.
6475 * configure: Regenerate.
6476 * internal.h (ustrcspn): New.
6477 * macro.c (create_iso_definition): Fix allocation of memory.
6478 (padding_token): Add cast to remove const-ness.
6479 * pch.c (cpp_read_state): Use ustrcspn.
6481 2005-02-08 Mike Stump <mrs@apple.com>
6483 * files.c (pchf_adder): Remove.
6484 (struct pchf_adder_info): Likewise.
6485 (_cpp_save_file_entries): Write out all files so that #import works.
6487 2005-01-23 Joseph S. Myers <joseph@codesourcery.com>
6489 * configure: Regenerate.
6491 2005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
6493 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
6495 * include/cpplib.h: Also update copyright years.
6497 2005-01-03 Geoffrey Keating <geoffk@apple.com>
6499 * files.c (_cpp_find_file): Add files found by search_path_exhausted
6500 to the list of all files.
6502 2005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
6504 * internal.h: Update references to Cpp lib filenames.
6505 * directives.c: Likewise.
6507 * macro.c: Likewise.
6508 * traditional.c: Likewise.
6510 2004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
6512 PR preprocessor/15167
6513 * files.c (destroy_cpp_file): New function.
6514 (should_stack_file): Make a new file if the
6515 compared file is still stacked.
6517 2004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
6519 PR preprocessor/17610
6520 * directives.c (do_include_common): Error out if an empty filename
6521 is given for #include (or #include_next or #import).
6523 2004-11-27 Roger Sayle <roger@eyesopen.com>
6524 Zack Weinberg <zack@codesourcery.com>
6526 * internal.h: Replace all uses of uchar with unsigned char.
6527 * include/cpp-id-data.h: Likewise. Guard typedef of uchar
6528 with !IN_GCC, so uchar is only defined whilst building libcpp.
6530 2004-11-24 Kelley Cook <kcook@gcc.gnu.org>
6532 * aclocal.m4: Regenerate.
6534 2004-11-24 Roger Sayle <roger@eyesopen.com>
6536 PR preprocessor/15824
6537 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
6538 directly, instead of the non-existant "system.h" and "ansidecl.h".
6539 * configure: Regenerate.
6541 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
6542 Joseph Myers <joseph@codesourcery.com>
6544 * internal.h (struct lexer_state): Add in_deferred_pragma.
6545 * directives.c (struct pragma_entry): Add allow_expansion.
6546 (insert_pragma_entry): Take allow_expansion flag.
6547 (register_pragma): Likewise.
6548 (cpp_register_pragma): Likewise.
6549 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
6550 (do_pragma): Honor allow_expansion.
6551 (cpp_handle_deferred_pragma): Set in_deferred_pragma.
6552 * include/cpplib.h (cpp_register_pragma): Update prototype.
6554 2004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
6555 Mark Mitchell <mark@codesourcery.com>
6557 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
6558 need_64bit_hwint=yes.
6559 * configure: Regenerate.
6561 2004-11-09 Joseph S. Myers <joseph@codesourcery.com>
6563 * Makefile.in ($(PACKAGE).pot): New rule. Depend on
6565 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
6566 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
6567 Remove local srcdir path from generated file.
6569 2004-11-04 Zack Weinberg <zack@codesourcery.com>
6570 Gerald Pfeifer <gerald@pfeifer.com>
6572 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
6575 2004-10-27 Zack Weinberg <zack@codesourcery.com>
6578 * directives.c (do_pragma): Do not defer pragmas which are unknown.
6579 (cpp_handle_deferred_pragma): Add cast to silence warning.
6581 2004-10-14 Joseph S. Myers <jsm@polyomino.org.uk>
6583 * errors.c (_cpp_begin_message): Print "error: " for errors.
6585 2004-10-10 Andreas Jaeger <aj@suse.de>
6587 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
6588 * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
6590 2004-10-08 Andrew Pinski <pinskia@physics.uc.edu>
6592 * pch.c (cpp_write_pch_state): Remove variable z as it is not
6594 (cpp_read_state): Remove unused variables, m, d and mac_count.
6596 2004-09-29 Per Bothner <per@bothner.com>
6598 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore
6599 cb.line_change. Otherwise do_pragma will call the line_change
6600 call-back with a meaningless line number.
6602 2004-09-24 Zack Weinberg <zack@codesourcery.com>
6604 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
6605 programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
6606 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
6607 * aclocal.m4, configure: Regenerate.
6608 * init.c: Include localedir.h.
6609 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
6611 (.c.o): Use $(ALL_CFLAGS).
6612 (localedir.h, localedir.hs): New rules.
6613 (clean): Use rm -rf to remove directories.
6614 (distclean): Also delete localedir.h and localedir.hs.
6615 (init.o): Update dependencies.
6617 2004-09-22 Kelley Cook <kcook@gcc.gnu.org>
6619 * Makefile.in (aclocal.m4): Update dependencies.
6620 * configure.ac (AC_CONFIG_MACRO_DIR): New.
6621 * aclocal.m4, configure: Regenerate.
6623 2004-09-17 Zack Weinberg <zack@codesourcery.com>
6625 * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
6626 (_cpp_convert_input, _cpp_default_encoding): Add comments.
6627 Some other comments in this file also tweaked.
6629 * directives.c (do_pragma): Save current buffer position
6630 before lexing the pragma keywords; don't call
6631 _cpp_backup_tokens in the defer_pragmas case.
6633 2004-09-15 Per Bothner <per@bothner.com>
6635 * include/line-map.h (line_map_start): Add parameter names so
6636 preceding comment makes sense.
6637 (linemap_add): Remove from comment mention of non-existing parameter.
6639 2004-09-09 Matt Austern <austern@apple.com>
6640 Zack Weinberg <zack@codesourcery.com>
6642 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
6643 prefixes throughout. Add entry for PRAGMA. Remove
6644 unnecessary "= 0" from EQ.
6645 (enum cpp_ttype): Adjust OP and TK definitions to restore
6646 prefixes, via token-paste.
6647 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
6648 Change from #defines to additional cpp_ttype enumerators.
6649 (struct cpp_options): Add defer_pragmas.
6650 (cpp_handle_deferred_pragma): Prototype new interface.
6652 * internal.h (struct cpp_reader): Add directive_result.
6653 * directives.c (struct pragma_entry): Add is_internal field;
6654 give boolean fields type bool.
6655 (start_directive): Initialize pfile->directive_result.type.
6656 (_cpp_do__Pragma): Likewise.
6657 (run_directive): Do not crash if pfile->buffer->prev is NULL.
6658 (insert_pragma_entry): Add 'internal' argument; set new->is_internal
6660 (register_pragma): New static function, bulk of former
6661 cpp_register_pragma here; add 'internal' argument, pass along
6662 to insert_pragma_entry.
6663 (cpp_register_pragma): Now a wrapper around register_pragma which
6664 always passes false for 'internal' argument.
6665 (_cpp_init_internal_pragmas): Call register_pragma directly, passing
6666 true for 'internal'.
6667 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
6668 an internal pragma, save text till the end of the line as a CPP_PRAGMA
6669 token instead of executing the pragma.
6670 (cpp_handle_deferred_pragma): New interface.
6671 * lex.c (token_spellings): Adjust OP and TK definitions to
6672 match changes to cpplib.h.
6673 (_cpp_lex_token): Check for a directive-result token and
6674 return it if present.
6675 (cpp_token_val_index): Handle CPP_PRAGMA.
6676 * macro.c (cpp_builtin_macro_text): Correct comment.
6677 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
6679 2004-09-06 Serge Belyshev <belyshev@lubercy.com>
6681 PR preprocessor/14699
6682 * symtab.c (ht_dump_statistics): Change type of sum_of_squares
6683 from size_t to double.
6685 2004-08-28 Andreas Schwab <schwab@suse.de>
6686 Andreas Jaeger <aj@suse.de>
6688 * configure.ac: Set PACKAGE correctly.
6689 * configure: Regenerated.
6691 2004-08-25 Paolo Bonzini <bonzini@gnu.org>
6693 * Makefile.in: Add back top_builddir.
6695 2004-08-25 Paolo Bonzini <bonzini@gnu.org>
6697 * configure.ac: Replace Automake macro invocations
6698 with manual Autoconf checks and substitutions.
6699 * configure: Regenerate.
6700 * aclocal.m4: Regenerate.
6701 * config.in: Regenerate.
6702 * Makefile.am: Removed.
6703 * Makefile.in: Heavy simplification and reorganization.
6705 2004-08-09 Mark Mitchell <mark@codesourcery.com>
6707 * configure.ac (arm*-*-eabi*): New target.
6708 (arm*-*-symbianelf*): Likewise.
6709 * configure: Regenerated.
6711 2004-07-24 Bernardo Innocenti <bernie@develer.com>
6713 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
6714 * directives.c: Use XNEW-family macros from libiberty.
6716 * macro.c: Likewise.
6717 * cpplib.h (cpp_deps_style): Export enum with name.
6719 2004-07-23 Matthias Klose <doko@debian.org>
6721 * init.c (init_library): Use PACKAGE for the text domain.
6723 2004-07-16 Andris Pavenis <pavenis@latnet.lv>
6725 PR preprocessor/16366
6726 * internal.h (struct cpp_reader): New field dir_hash.
6727 * files.c (make_cpp_dir): Use dir_hash, not file_hash.
6728 (_cpp_init_files, _cpp_cleanup_files): Update for new field.
6730 2004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
6732 PR preprocessor/16192
6733 PR preprocessor/15913
6734 PR preprocessor/15572
6735 * expr.c (_cpp_parse_expr): Handle remaining cases where an
6736 expression is missing.
6737 * init.c (post_options): Traditional cpp doesn't do // comments.
6739 2004-06-30 Per Bothner <per@bothner.com>
6741 * include/line-map.h (fileline): Remove old typedef.
6742 * internal.h (struct cpp_reader): Use source_location typedef instead.
6744 2004-06-26 Zack Weinberg <zack@codesourcery.com>
6746 Partially revert patch of 2004-06-05.
6747 * files.c (search_cache): Remove pfile argument. Don't check
6748 for file that would be found by "" or <> search here...
6749 (_cpp_find_file): ...do it here, before calling find_file_in_dir.
6750 Do not apply directory-of-current-file correction to files
6751 found by this check. Rearrange code slightly.
6753 2004-06-21 Geoffrey Keating <geoffk@apple.com>
6755 * files.c (should_stack_file): Correct swapped parameters to call
6757 * pch.c (cpp_valid_state): Handle -fpreprocessed.
6759 2004-06-15 Paolo Bonzini <bonzini@gnu.org>
6761 * Makefile.in: Regenerate with automake 1.8.5.
6762 * aclocal.m4: Likewise.
6763 * configure: Regenerate.
6765 2004-06-11 Zack Weinberg <zack@codesourcery.com>
6767 * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
6768 * configure, config.in: Regenerate.
6769 * system.h: Unconditionally define bool as unsigned char,
6770 BOOL_BITFIELD as unsigned int.
6771 * .cvsignore: New file.
6773 2004-06-09 Geoffrey Keating <geoffk@apple.com>
6775 * traditional.c (push_replacement_text): Set macro->traditional.
6776 (save_replacement_text): Likewise.
6777 * pch.c (cpp_write_pch_state): Don't write list of defined macros.
6778 (struct save_macro_item): Delete.
6779 (struct save_macro_data): Use a character array not the previous
6781 (save_macros): Save macro as text not as internal structures.
6782 (cpp_prepare_state): Update for changes to save_macro_data.
6783 (cpp_read_state): Don't read macros defined in PCH. Restore
6785 * macro.c (create_iso_definition): Honour alloc_subobject.
6786 Clear traditional flag.
6787 (_cpp_create_definition): Honour alloc_subobject.
6788 * lex.c (cpp_token_val_index): New.
6789 * internal.h: Include cpp-id-data.h.
6790 (uchar): Move definition to cpp-id-data.h.
6792 (cpp_macro): Likewise.
6793 * directives.c (struct answer): Move to cpp-id-data.h.
6794 (do_assert): Honour alloc_subobject.
6796 * include/symtab.h (struct ht): Add field 'alloc_subobject'.
6797 * include/cpplib.h (struct cpp_string): Add GTY marker.
6798 (enum cpp_token_fld_kind): New.
6799 (struct cpp_token): Add GTY markers.
6800 (cpp_token_val_index): Prototype.
6801 (CPP_HASHNODE_VALUE_IDX): New.
6802 (struct cpp_hashnode): Don't skip fields of 'value' when marking.
6803 * include/cpp-id-data.h: New file.
6805 2004-06-09 Paolo Bonzini <bonzini@gnu.org>
6807 * Makefile.am (all-local): New.
6808 * Makefile.in: Regenerate.
6810 2004-06-06 Roger Sayle <roger@eyesopen.com>
6812 * Makefile.am (LIBICONV): Declare.
6813 (makedepend_LDADD): Use LIBICONV.
6814 * Makefile.in: Regenerate.
6816 2004-06-05 Andrew Pinski <pinskia@physics.uc.edu>
6818 * Makefile.am (LIBINTL): Declare
6819 (makedepend_LDADD): Use LIBINTL.
6820 * Makefile.in: Regenerate.
6822 2004-06-05 Zack Weinberg <zack@codesourcery.com>
6824 * Makefile.am: Add makedepend.
6825 * Makefile.in, aclocal.m4: Regenerate.
6826 * charset.c: Insert a space to avoid a warning.
6827 * directives.c: Include mkdeps.h.
6828 (_cpp_handle_directive): Reenable macro expander if appropriate.
6829 (undefine_macros): Inline body of _cpp_free_definition for speed.
6830 Do not call undef callback or _cpp_warn_if_unused_macro.
6831 (cpp_get_deps): New interface.
6832 * files.c (search_cache): Add pfile argument. Check for file
6833 that would be found by "" or <> search here...
6834 (_cpp_find_file): ...not here. Correct recorded start_dir of
6835 files found by directory-of-current-file search that would be
6836 found by "" or <> search.
6837 * init.c (cpp_add_dependency_target): Delete.
6838 * internal.h (struct lexer_state): Add discarding_output flag.
6839 * lex.c (lex_identifier): Compute hash function while scanning.
6840 * macro.c (cpp_scan_nooutput): Disable macro expansion outside
6842 * makedepend.c: New file.
6843 * mkdeps.c (struct deps): Add vpath vector.
6844 (apply_vpath, deps_add_vpath): New function.
6845 (deps_free): Free vpath vector.
6846 (deps_add_dep, deps_add_target): Use apply_vpath.
6847 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
6848 (ht_lookup_with_hash): New function.
6849 * cpplib.h, mkdeps.h: Update prototypes.
6850 * symtab.h: Update prototypes.
6851 (HT_HASHSTEP, HT_FINISH): New macros.
6853 2004-05-29 Geoffrey Keating <geoffk@apple.com>
6855 * symtab.c (ht_create): Set entries_owned.
6856 (ht_destroy): Honour entries_owned.
6857 (ht_expand): Likewise.
6859 * include/symtab.h (struct ht): New field 'entries_owned'
6860 (ht_load): New prototype.
6862 2004-05-26 Paolo Bonzini <bonzini@gnu.org>
6865 * configure.ac: Fix m4 quoting when picking
6866 the size of HOST_WIDE_INT.
6867 * configure: Regenerate.
6869 2004-05-25 Paolo Bonzini <bonzini@gnu.org>
6871 * Makefile.am: the correct directory for
6872 gettext include files is given by @INCINTL@.
6873 * Makefile.in: Regenerate.
6875 2004-05-24 Paolo Bonzini <bonzini@gnu.org>
6877 * system.h [!ENABLE_NLS]: dgettext takes two
6880 2004-05-23 Paolo Bonzini <bonzini@gnu.org>
6882 Moved libcpp from the gcc subdirectory to the toplevel.
6883 * Makefile.am: New file.
6884 * Makefile.in: Regenerate.
6885 * configure.ac: New file.
6886 * configure: Regenerate.
6887 * config.in: Regenerate.
6888 * charset.c: Moved from gcc/cppcharset.c. Add note about
6889 brokenness of input charset detection. Adjust for change
6890 in name of cppucnid.h.
6891 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
6892 * expr.c: Moved from gcc/cppexp.c.
6893 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
6894 Remove #define of O_BINARY, it is in system.h.
6895 * identifiers.c: Moved from gcc/cpphash.c.
6896 * internal.h: Moved from gcc/cpphash.h. Change header
6897 guard name. All other files adjusted to match name change.
6898 * init.c: Moved from gcc/cppinit.c.
6899 (init_library) [ENABLE_NLS]: Call bindtextdomain.
6900 * lex.c: Moved from gcc/cpplex.c.
6901 * directives.c: Moved from gcc/cpplib.c.
6902 * macro.c: Moved from gcc/cppmacro.c.
6903 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
6904 * traditional.c: Moved from gcc/cpptrad.c.
6905 * ucnid.h: Moved from gcc/cppucnid.h. Change header
6907 * ucnid.pl: Moved from gcc/cppucnid.pl.
6908 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header
6910 * symtab.c: Moved from gcc/hashtable.c.
6911 * line-map.c: Moved from gcc. Do not include intl.h.
6912 * mkdeps.c: Moved from gcc.
6913 * system.h: New file.
6914 * include/cpplib.h: Moved from gcc. Change header guard name.
6915 * include/line-map.h: Moved from gcc. Change header guard name.
6916 * include/mkdeps.h: Moved from gcc. Change header guard name.
6917 * include/symtab.h: Moved from gcc/hashtable.h. Change header
6920 Copyright (C) 2004-2021 Free Software Foundation, Inc.
6922 Copying and distribution of this file, with or without modification,
6923 are permitted in any medium without royalty provided the copyright
6924 notice and this notice are preserved.