1 2021-06-16 Jason Merrill <jason@redhat.com>
5 * line-map.c (linemap_compare_locations): Only use comparison with
6 LINE_MAP_MAX_LOCATION_WITH_COLS to avoid abort.
8 2021-05-20 Christophe Lyon <christophe.lyon@linaro.org>
9 Torbjörn Svensson <torbjorn.svensson@st.com>
12 * include/cpplib.h (cpp_builtin_type): Add BT_FILE_NAME entry.
13 * init.c (builtin_array): Likewise.
14 * macro.c (_cpp_builtin_macro_text): Add support for BT_FILE_NAME.
16 2021-05-20 Jakub Jelinek <jakub@redhat.com>
18 PR preprocessor/100646
19 * lex.c (cpp_directive_only_process): Treat end of file as termination
20 for !is_block comments.
22 2021-05-12 Jakub Jelinek <jakub@redhat.com>
24 PR preprocessor/100392
25 * lex.c (cpp_directive_only_process): If buffer doesn't end with '\n',
26 add buffer->rlimit[0] character to the printed range and
27 CPP_INCREMENT_LINE and increment line_count.
29 2021-05-11 Joseph Myers <joseph@codesourcery.com>
31 * include/cpplib.h (struct cpp_options): Add elifdef.
32 * init.c (struct lang_flags): Add elifdef.
33 (lang_defaults): Update to include elifdef initializers.
34 (cpp_set_lang): Set elifdef for pfile based on language.
35 * directives.c (STDC2X, ELIFDEF): New macros.
36 (EXTENSION): Increase value to 3.
37 (DIRECTIVE_TABLE): Add #elifdef and #elifndef.
38 (_cpp_handle_directive): Do not treat ELIFDEF directives as
39 directives for language versions without the #elifdef feature.
40 (do_elif): Handle #elifdef and #elifndef.
41 (do_elifdef, do_elifndef): New functions.
43 2021-05-11 Joseph Myers <joseph@codesourcery.com>
45 * lex.c (cpp_avoid_paste): Do not allow pasting CPP_NUMBER with
48 2021-05-11 Joseph Myers <joseph@codesourcery.com>
50 * init.c (lang_defaults): Enable digit separators for GNUC2X and
53 2021-05-07 Jakub Jelinek <jakub@redhat.com>
56 * lex.c (cpp_avoid_paste): Handle token1 CPP_PRAGMA like CPP_NAME.
58 2021-05-06 Joseph Myers <joseph@codesourcery.com>
62 * lex.c (lex_number): Reject adjacent digit separators here. Do
63 not allow digit separators before '.' or an exponent with sign.
64 * expr.c (cpp_classify_number): Do not check for adjacent digit
67 2021-05-03 H.J. Lu <hjl.tools@gmail.com>
70 * configure: Regenerated.
72 2021-04-29 Joseph Myers <joseph@codesourcery.com>
75 * directives.c (strtolinenum): Handle digit separators.
77 2021-04-19 Richard Biener <rguenther@suse.de>
79 PR preprocessor/100142
80 * line-map.c (linemap_position_for_loc_and_offset): Revert
81 unintended s/column_offset/column/ change.
83 2021-04-13 Nathan Sidwell <nathan@acm.org>
86 * line-map.c (line-map.c): Do not advance to linemaps for
89 2021-04-13 Eric Botcazou <ebotcazou@adacore.com>
91 * include/line-map.h (IS_MACRO_LOC): Delete.
92 * line-map.c (linemap_location_from_macro_expansion_p): Test
93 LINEMAPS_MACRO_LOWEST_LOCATION of the linemap.
95 2021-03-02 David Malcolm <dmalcolm@redhat.com>
98 * line-map.c (rich_location::maybe_add_fixit): Reject fix-it hints
101 2021-02-24 Nathan Sidwell <nathan@acm.org>
107 2021-02-24 Nathan Sidwell <nathan@acm.org>
110 * init.c (read_original_filename): Expunge all evidence of the
113 2021-02-18 Nathan Sidwell <nathan@acm.org>
116 * include/cpplib.h (cpp_find_header_unit): Rename to ...
117 (cpp_probe_header_unit): ... this.
118 * internal.h (_cp_find_header_unit): Declare.
119 * files.c (cpp_find_header_unit): Break apart to ..
120 (test_header_unit): ... this, and ...
121 (_cpp_find_header_unit): ... and, or and ...
122 (cpp_probe_header_unit): ... this.
123 * macro.c (cpp_get_token_1): Call _cpp_find_header_unit.
125 2021-02-16 Nathan Sidwell <nathan@acm.org>
127 * files.c (_cpp_stack_file): Make buffers end in unread \n.
129 2021-02-10 David Malcolm <dmalcolm@redhat.com>
131 PR preprocessor/96391
132 * line-map.c (linemap_compare_locations): Require that
133 the location be <= LINE_MAP_MAX_LOCATION_WITH_COLS when
134 treating locations as coming from the same macro expansion.
136 2021-02-04 Jakub Jelinek <jakub@redhat.com>
138 * expr.c (cpp_classify_number): Use make_signed_t<size_t> instead of
139 make_signed<size_t>::type in the diagnostics.
141 2021-02-03 Jakub Jelinek <jakub@redhat.com>
143 PR preprocessor/98882
144 * lex.c (cpp_directive_only_process): Don't assert that rlimit[-1]
145 is a newline, instead assert that rlimit[0] is either newline or
146 carriage return. When seeing '\\' followed by '\r', check limit
147 before accessing pos[1].
149 2021-02-03 Ed Smith-Rowland <3dw4rd@verizon.net>
151 * expr.c (interpret_int_suffix): Detect 'z' integer suffix.
152 (cpp_classify_number): Compat warning for use of 'z' suffix.
153 * include/cpplib.h (struct cpp_options): New flag.
154 (enum cpp_warning_reason): New flag.
155 (CPP_N_USERDEF): Comment C++0x -> C++11.
156 (CPP_N_SIZE_T): New flag for cpp_classify_number.
157 * init.c (cpp_set_lang): Initialize new flag.
159 2021-01-27 liuhongt <hongtao.liu@intel.com>
162 * lex.c (search_line_sse2): Replace builtins with == operator.
164 2021-01-26 Paul Fee <paul.f.fee@gmail.com>
166 * include/cpplib.h (c_lang): Add CXX23 and GNUCXX23.
167 * init.c (lang_defaults): Add rows for CXX23 and GNUCXX23.
168 (cpp_init_builtins): Set __cplusplus to 202100L for C++23.
170 2021-01-15 Nathan Sidwell <nathan@acm.org>
172 PR preprocessor/95253
173 * mkdeps.c (munge): Do not escape ':'.
175 2020-12-14 Nathan Sidwell <nathan@acm.org>
177 * include/cpplib.h (struct cpp_macro): Add imported_p field.
178 (struct cpp_hashnode): Tweak deferred field documentation.
179 * macro.c (_cpp_new_macro): Clear new field.
180 (cpp_get_deferred_macro, get_deferred_or_lazy_macro): Assert
183 2020-12-10 Jason Merrill <jason@redhat.com>
185 * init.c (cpp_init_builtins): Update __cplusplus for C++20.
187 2020-12-01 JeanHeyd Meneide <phdofthehouse@gmail.com>
189 * charset.c (init_iconv_desc): Initialize "to" and "from" fields.
190 * directives.c (cpp_get_narrow_charset_name): New function.
191 (cpp_get_wide_charset_name): Likewise.
192 * include/cpplib.h (cpp_get_narrow_charset_name): Prototype.
193 (cpp_get_wide_charset_name): Likewise.
194 * internal.h (cset_converter): Add "to" and "from" fields.
196 2020-11-27 Joseph Myers <joseph@codesourcery.com>
198 PR preprocessor/97602
199 * directives.c (strtolinenum): Check for overflow before it
200 occurs. Correct comment.
202 2020-11-24 Nathan Sidwell <nathan@acm.org>
204 * include/cpplib.h (struct cpp_hashnode): Add deferred field.
205 (cpp_set_deferred_macro): Define.
206 (cpp_get_deferred_macro): Declare.
207 (cpp_macro_definition): Reformat, add overload.
208 (cpp_macro_definition_location): Deal with deferred macro.
209 (cpp_alloc_token_string, cpp_compare_macro): Declare.
210 * internal.h (_cpp_notify_macro_use): Return bool
211 (_cpp_maybe_notify_macro_use): Likewise.
212 * directives.c (do_undef): Check macro is not undef before
214 (do_ifdef, do_ifndef): Deal with deferred macro.
215 * expr.c (parse_defined): Likewise.
216 * lex.c (cpp_allocate_token_string): Break out of ...
217 (create_literal): ... here. Call it.
218 (cpp_maybe_module_directive): Deal with deferred macro.
219 * macro.c (cpp_get_token_1): Deal with deferred macro.
220 (warn_of_redefinition): Deal with deferred macro.
221 (compare_macros): Rename to ...
222 (cpp_compare_macro): ... here. Make extern.
223 (cpp_get_deferred_macro): New.
224 (_cpp_notify_macro_use): Deal with deferred macro, return bool
225 indicating definedness.
226 (cpp_macro_definition): Deal with deferred macro.
228 2020-11-19 Nathan Sidwell <nathan@acm.org>
230 * include/cpplib.h (enum cpp_main_search): New.
231 (struct cpp_options): Add main_search field.
232 (cpp_main_loc): Declare.
233 (cpp_retrofit_as_include): Declare.
234 * internal.h (struct cpp_reader): Add main_loc field.
235 (_cpp_in_main_source_file): Not main if main is a header.
236 * init.c (cpp_read_main_file): Use main_search option to locate
237 main file. Set main_loc
238 * files.c (cpp_retrofit_as_include): New.
240 2020-11-19 Nathan Sidwell <nathan@acm.org>
242 * internal.h (cpp_in_system_header): Rename to ...
243 (_cpp_in_system_header): ... here.
244 (cpp_in_primary_file): Rename to ...
245 (_cpp_in_main_source_file): ... here. Compare main_file equality
246 and check main_search value.
247 * lex.c (maybe_va_opt_error, _cpp_lex_direct): Adjust for rename.
248 * macro.c (_cpp_builtin_macro_text): Likewise.
249 (replace_args): Likewise.
250 * directives.c (do_include_next): Likewise.
251 (do_pragma_once, do_pragma_system_header): Likewise.
252 * files.c (struct _cpp_file): Delete main_file field.
253 (pch_open): Check pfile->main_file equality.
254 (make_cpp_file): Drop cpp_reader parm, don't set main_file.
255 (_cpp_find_file): Adjust.
256 (_cpp_stack_file): Check pfile->main_file equality.
257 (struct report_missing_guard_data): Add cpp_reader field.
258 (report_missing_guard): Check pfile->main_file equality.
259 (_cpp_report_missing_guards): Adjust.
261 2020-11-18 Nathan Sidwell <nathan@acm.org>
263 * include/cpplib.h (struct cpp_options): Add module_directives
265 (NODE_MODULE): New node flag.
266 (struct cpp_hashnode): Make rid-code a bitfield, increase bits in
267 flags and swap with type field.
268 * init.c (post_options): Create module-directive identifier nodes.
269 * internal.h (struct lexer_state): Add directive_file_token &
270 n_modules fields. Add module node enumerator.
271 * lex.c (cpp_maybe_module_directive): New.
272 (_cpp_lex_token): Call it.
273 (cpp_output_token): Add '"' around CPP_HEADER_NAME token.
274 (do_peek_ident, do_peek_module): New.
275 (cpp_directives_only): Detect module-directive lines.
276 * macro.c (cpp_get_token_1): Deal with directive_file_token
279 2020-11-18 Nathan Sidwell <nathan@acm.org>
281 * files.c (struct _cpp_file): Add header_unit field.
282 (_cpp_stack_file): Add header unit support.
283 (cpp_find_header_unit): New.
284 * include/cpplib.h (cpp_find_header_unit): Declare.
286 2020-11-18 Nathan Sidwell <nathan@acm.org>
288 * include/cpplib.h (struct cpp_options): Add modules to
290 * include/mkdeps.h (deps_add_module_target): Declare.
291 (deps_add_module_dep): Declare.
292 * mkdeps.c (class mkdeps): Add modules, module_name, cmi_name,
293 is_header_unit fields. Adjust cdtors.
294 (deps_add_module_target, deps_add_module_dep): New.
295 (make_write): Write module dependencies, if enabled.
297 2020-11-17 Nathan Sidwell <nathan@acm.org>
299 * include/cpplib.h (struct cpp_callbacks): Add
300 user_deferred_macro & translate_include.
302 2020-11-17 Nathan Sidwell <nathan@acm.org>
304 * include/line-map.h (enum lc_reason): Add LC_MODULE.
306 (line_map_new_raw): Declare.
307 (linemap_enter_macro): Move declaration from internal.h
308 (linemap_module_loc, linemap_module_reparent)
309 (linemap_module_restore): Declare.
310 (linemap_lookup_macro_indec): Declare.
311 * internal.h (linemap_enter_macro): Moved to line-map.h.
312 * line-map.c (linemap_new_raw): New, broken out of ...
313 (new_linemap): ... here. Call it.
314 (LAST_SOURCE_LINE_LOCATION): New.
315 (liemap_module_loc, linemap_module_reparent)
316 (linemap_module_restore): New.
317 (linemap_lookup_macro_index): New, broken out of ...
318 (linemap_macro_map_lookup): ... here. Call it.
319 (linemap_dump): Add module dump.
321 2020-11-17 Nathan Sidwell <nathan@acm.org>
323 PR preprocessor/97858
324 * mkdeps.c (munge): Drop varadic args, we only ever use one.
326 2020-11-13 Joseph Myers <joseph@codesourcery.com>
328 * expr.c (cpp_classify_number): Update diagnostic for binary
329 constants for C. Also diagnose binary constants for
331 * init.c (lang_defaults): Enable binary constants for GNUC2X and
334 2020-11-13 Piotr H. Dabrowski <phd@phd.re>
337 * include/cpplib.h: Added cpp_define_unused(), cpp_define_formatted_unused()
338 * directives.c: Likewise.
340 2020-11-12 Joseph Myers <joseph@codesourcery.com>
342 * include/cpplib.h (struct cpp_callbacks): Add bool argument to
344 (enum cpp_builtin_type): Add BT_HAS_STD_ATTRIBUTE.
345 * init.c (builtin_array): Add __has_c_attribute.
346 (cpp_init_special_builtins): Handle BT_HAS_STD_ATTRIBUTE.
347 * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_STD_ATTRIBUTE.
348 Update call to has_attribute for BT_HAS_ATTRIBUTE.
349 * traditional.c (fun_like_macro): Handle BT_HAS_STD_ATTRIBUTE.
351 2020-11-12 Nicholas Guriev <guriev-ns@ya.ru>
354 * files.c (_cpp_find_file): Use CPP_DL_NOTE not CPP_DL_ERROR in call to
357 2020-11-07 Lewis Hyatt <lhyatt@gmail.com>
359 * generated_cpp_wcwidth.h: Regenerated from Unicode 13.0.0 data.
361 2020-11-06 Nathan Sidwell <nathan@acm.org>
363 * include/cpplib.h (enum class CPP_time_kind): New.
364 (cpp_get_date): Declare.
365 * internal.h (struct cpp_reader): Replace source_date_epoch with
366 time_stamp and time_stamp_kind.
367 * init.c (cpp_create_reader): Initialize them.
368 * macro.c (_cpp_builtin_macro_text): Use cpp_get_date.
369 (cpp_get_date): Broken out from _cpp_builtin_macro_text and
372 2020-11-03 Nathan Sidwell <nathan@acm.org>
374 * lex.c (cpp_peek_token): Do not peek past CPP_PRAGMA.
375 (_cpp_lex_direct): Handle EOF in pragma when setting need_line,
376 not when needing a line.
378 2020-11-03 Nathan Sidwell <nathan@acm.org>
380 * lex.c (_cpp_clean_line): Fix DOS off-by-one error.
382 2020-11-03 Nathan Sidwell <nathan@acm.org>
384 * init.c (cpp_read_main_file): Use cpp_get_deps result.
386 2020-11-03 Nathan Sidwell <nathan@acm.org>
388 * include/mkdeps.h: Include cpplib.h
389 (deps_write): Adjust first parm type.
390 * mkdeps.c: Include internal.h
391 (make_write): Adjust first parm type. Check phony option
393 (deps_write): Adjust first parm type.
394 * init.c (cpp_read_main_file): Use get_deps.
395 * directives.c (cpp_get_deps): Check option before initializing.
397 2020-11-02 Nathan Sidwell <nathan@acm.org>
399 * internal.h (_cpp_notify_macro_use): Add location parm.
400 (_cpp_maybe_notify_macro_use): Likewise.
401 * directives.c (_cpp_do_file_change): Check we've not changed file
402 when optimizing a rewind.
403 (do_ifdef): Pass location to _cpp_maybe_notify_macro_use.
404 (do_ifndef): Likewise. Delete obsolete comment about powerpc.
405 * expr.c (parse_defined): Pass location to
406 _cpp_maybe_notify_macro_use.
407 * macro.c (enter_macro_context): Likewise.
408 (warn_of_redefinition): Break out helper function. Call it.
409 (compare_macros): New function broken out of warn_of_redefinition.
410 (_cpp_new_macro): Zero all fields.
411 (_cpp_notify_macro_use): Add location parameter.
413 2020-10-20 Nathan Sidwell <nathan@acm.org>
415 * lex.c (_cpp_lex_direct): Do not complete EOF processing when
417 * macro.c (collect_args): Do not unwind fake EOF.
418 (funlike_invocation_p): Do not unwind fake EOF.
419 (cpp_context): Replace abort with gcc_assert.
421 2020-10-19 Nathan Sidwell <nathan@acm.org>
423 * internal.h (struct cpp_reader): Rename 'eof' field to 'endarg'.
424 * init.c (cpp_create_reader): Adjust.
425 * macro.c (collect_args): Use endarg for separator. Always rewind
428 2020-10-08 Nathan Sidwell <nathan@acm.org>
430 * internal.h (enum include_type): Rename IT_MAIN_INJECT to
432 * init.c (cpp_read_main_file): If there is no line marker, adjust
433 the initial line marker.
434 (read_original_filename): Return bool, peek the buffer directly
435 before trying to tokenize.
436 (read_original_directory): Likewise. Directly prod the string
438 * files.c (_cpp_stack_file): Adjust for IT_PRE_MAIN change.
440 2020-09-26 Jakub Jelinek <jakub@redhat.com>
443 * lex.c (search_line_fast): Only use _ARCH_PWR8 Altivec version
446 2020-09-17 Patrick Palka <ppalka@redhat.com>
449 * include/line-map.h (first_map_in_common): Declare.
450 * line-map.c (first_map_in_common): Remove static.
452 2020-09-07 Martin Storsjö <martin@martin.st>
454 * files.c (remap_filename): Make a strchr return value pointer
457 2020-07-30 H.J. Lu <hjl.tools@gmail.com>
460 * configure: Regenerated.
462 2020-07-29 Tiziano Müller <tiziano.mueller@chem.uzh.ch>
464 * init.c (builtin_array): Add xref comment.
465 * traditional.c (fun_like_macro): Add HAS_INCLUDE codes.
467 2020-07-28 Jakub Jelinek <jakub@redhat.com>
469 PR preprocessor/96323
470 * lex.c (lex_raw_string): For c == '\n' don't continue after reporting
471 an prefix delimiter error.
473 2020-07-28 Nathan Sidwell <nathan@acm.org>
475 * init.c (cpp_read_main_file): Always use the last map for
478 2020-07-20 Nathan Sidwell <nathan@acm.org>
480 * line-map.c (linemap_add): Simplify column overflow calculation.
481 Add comment about range and column bit init.
482 (linemap_ordinary_map_lookup): Refactor for RAII
483 (linemap_macro_map_lookup): Likewise.
485 2020-07-14 Lewis Hyatt <lhyatt@gmail.com>
487 PR preprocessor/49973
489 * include/cpplib.h (struct cpp_options): Removed support for -ftabstop,
490 which is now handled by diagnostic_context.
491 (class cpp_display_width_computation): New class.
492 (cpp_byte_column_to_display_column): Add optional tabstop argument.
493 (cpp_display_width): Likewise.
494 (cpp_display_column_to_byte_column): Likewise.
496 (cpp_display_width_computation::cpp_display_width_computation): New
498 (cpp_display_width_computation::advance_display_cols): Likewise.
499 (compute_next_display_width): Removed and implemented this
500 functionality in a new function...
501 (cpp_display_width_computation::process_next_codepoint): ...here.
502 (cpp_byte_column_to_display_column): Added tabstop argument.
503 Reimplemented in terms of class cpp_display_width_computation.
504 (cpp_display_column_to_byte_column): Likewise.
505 * init.c (cpp_create_reader): Remove handling of -ftabstop, which is now
506 handled by diagnostic_context.
508 2020-07-07 Nathan Sidwell <nathan@acm.org>
510 * directives.c (do_linemarker): Optimize rewinding to line zero.
511 * files.c (_cpp_stack_file): Start on line zero when about to inject
513 (cpp_push_include, cpp_push_default_include): Use highest_line as
515 * include/cpplib.h (cpp_read_main_file): Add injecting parm.
516 * init.c (cpp_read_main_file): Likewise, inform _cpp_stack_file.
517 * internal.h (enum include_type): Add IT_MAIN_INJECT.
519 2020-05-29 H.J. Lu <hjl.tools@gmail.com>
522 * configure: Regenerated.
524 2020-05-23 David Edelsohn <dje.gcc@gmail.com>
526 * Makefile.in (AR): Substitute @AR@.
527 * configure.ac (CHECK_PROG AR): New.
528 * configure: Regenerate.
530 2020-05-20 Nathan Sidwell <nathan@acm.org>
532 * internal.h (typedef _cpp_file): Delete, unnecessary in C++.
533 (enum _cpp_find_file_kind): New.
534 (_cpp_find_file): Use it, not 3 bools.
535 * files.c (_cpp_find_file): Use _cpp_find_file_kind enum, not
537 (cpp_make_system_header): Break overly long line.
538 (_cpp_stack_include, _cpp_fake_include)
539 (_cpp_do_file_change, _cpp_compare_file_date, _cpp_has_header): Adjust.
540 * init.c (cpp_read_main): Adjust _cpp_find_file call.
542 2020-05-18 Nathan Sidwell <nathan@acm.org>
544 * include/cpplib.h (cpp_get_otions, cpp_get_callbacks)
545 (cpp_get_deps): Mark as PURE.
546 * include/line-map.h (get_combined_adhoc_loc)
547 (get_location_from_adhoc_loc, get_pure_location): Reformat decls.
548 * internal.h (struct lexer_state): Clarify comment.
549 * system.h: Remove now-unneeded bool hackery.
550 * files.c (_cpp_find_file): Store LOC not highest_location.
552 PR preprocessor/95149
553 * lex.c (struct lit_accum): New.
554 (bufring_append): Replace by lit_accum::append.
555 (lex_raw_string): Reimplement, using fragments of the old version.
556 (lex_string): Adjust lex_raw_string call.
558 PR preprocessor/95182
559 * macro.c (collect_args): Preserve EOFif we fell out of the main
561 (cpp_get_token_1): Reformat a couple of short lines.
563 2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
565 * configure: Regenerated.
567 2020-05-13 Jason Merrill <jason@redhat.com>
569 * include/cpplib.h (enum c_lang): Change CXX2A to CXX20.
570 * init.c, lex.c: Adjust.
572 2020-05-12 Nathan Sidwell <nathan@acm.org>
574 EOF location is at end of file
575 PR preprocessor/95013
576 * lex.c (lex_raw_string): Process line notes before incrementing.
577 Correct incrementing condition. Adjust for new
578 _cpp_get_fresh_line EOF behaviour.
579 (_cpp_get_fresh_line): Do not pop buffer at EOF, increment line
581 (_cpp_lex_direct): Adjust for new _cpp_get_fresh_line behaviour.
582 (cpp_directive_only_process): Assert we got a fresh line.
583 * traditional.c (_cpp_read_logical_line_trad): Adjust for new
584 _cpp_get_fresh_line behaviour.
586 2020-05-12 H.J. Lu <hongjiu.lu@intel.com>
588 * Makefile.in (CET_HOST_FLAGS): New.
589 (COMPILER): Add $(CET_HOST_FLAGS).
590 * configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and
591 AC_SUBST(CET_HOST_FLAGS). Clear CET_HOST_FLAGS if jit isn't
593 * aclocal.m4: Regenerated.
594 * configure: Likewise.
596 2020-05-08 Nathan Sidwell <nathan@acm.org>
598 Reimplement directives only processing, support raw literals.
599 * directives-only.c: Delete.
600 * Makefile.in (libcpp_a_OBJS, libcpp_a_SOURCES): Remove it.
601 * include/cpplib.h (enum CPP_DO_task): New enum.
602 (cpp_directive_only_preprocess): Declare.
603 * internal.h (_cpp_dir_only_callbacks): Delete.
604 (_cpp_preprocess_dir_only): Delete.
605 * lex.c (do_peek_backslask, do_peek_next, do_peek_prev): New.
606 (cpp_directives_only_process): New implementation.
608 2020-02-14 Jakub Jelinek <jakub@redhat.com>
610 Partially implement P1042R1: __VA_OPT__ wording clarifications
611 PR preprocessor/92319
612 * macro.c (expand_arg): Move declarations before vaopt_state
614 (class vaopt_state): Move enum update_type definition earlier. Remove
615 m_allowed member, add m_arg and m_update members.
616 (vaopt_state::vaopt_state): Change last argument from bool any_args
617 to macro_arg *arg, initialize m_arg and m_update instead of m_allowed.
618 (vaopt_state::update): When bumping m_state from 1 to 2 and m_update
619 is ERROR, determine if __VA_ARGS__ expansion has any non-CPP_PADDING
620 tokens and set m_update to INCLUDE if it has any, DROP otherwise.
621 Return m_update instead of m_allowed ? INCLUDE : DROP in m_state >= 2.
622 (replace_args, create_iso_definition): Adjust last argument to
625 2020-02-05 Martin Sebor <msebor@redhat.com>
627 * include/cpplib.h (cpp_builtin_type): Remove trailing comma to
628 avoid pedantic warnings in C++ 98 mode.
630 2020-02-04 Jakub Jelinek <jakub@redhat.com>
632 * macro.c (builtin_has_include): Diagnose __has_include* use outside
633 of preprocessing directives.
635 PR preprocessor/93545
636 * macro.c (cpp_get_token_no_padding): New function.
637 (builtin_has_include): Use it instead of cpp_get_token. Don't check
640 2020-02-01 Andrew Burgess <andrew.burgess@embecosm.com>
642 * configure: Regenerate.
644 2020-01-28 Nathan Sidwell <nathan@acm.org>
646 PR preprocessor/93452
647 * internal.h (struct spec_nodes): Drop n__has_include{,_next}.
648 * directives.c (lex_macro_node): Don't check __has_include redef.
649 * expr.c (eval_token): Drop __has_include eval.
650 (parse_has_include): Move to ...
651 * macro.c (builtin_has_include): ... here.
652 (_cpp_builtin_macro_text): Eval __has_include{,_next}.
653 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_INCLUDE{,_NEXT}.
654 * init.c (builtin_array): Add them.
655 (cpp_init_builtins): Drop __has_include{,_next} init here ...
656 * pch.c (cpp_read_state): ... and here.
657 * traditional.c (enum ls): Drop has_include states ...
658 (_cpp_scan_out_logical_line): ... and here.
660 2020-01-27 Andrew Burgess <andrew.burgess@embecosm.com>
662 * configure: Regenerate.
664 2020-01-24 Nathan Sidwell <nathan@acm.org>
666 * expr.c (parse_has_include): Remove bogus controlling macro code.
668 2020-01-20 Nathan Sidwell <nathan@acm.org>
670 PR preprocessor/80005
671 * include/cpplib.h (BT_HAS_ATTRIBUTE): Fix comment.
672 * internal.h (struct lexer_state): Delete in__has_include field.
673 (struct spec_nodes): Rename n__has_include{,_next}__ fields.
674 (_cpp_defined_macro_p): New.
675 (_cpp_find_file): Add has_include parm.
676 * directives.c (lex_macro_node): Combine defined,
677 __has_inline{,_next} checking.
678 (do_ifdef, do_ifndef): Use _cpp_defined_macro_p.
679 (_cpp_init_directives): Refactor.
680 * expr.c (parse_defined): Use _cpp_defined_macro_p.
681 (eval_token): Adjust parse_has_include calls.
682 (parse_has_include): Add OP parameter. Reimplement.
683 * files.c (_cpp_find_file): Add HAS_INCLUDE parm. Use it to
684 inhibit error message.
685 (_cpp_stack_include): Adjust _cpp_find_file call.
686 (_cpp_fake_include, _cpp_compare_file_date): Likewise.
687 (open_file_failed): Remove in__has_include check.
688 (_cpp_has_header): Adjust _cpp_find_file call.
689 * identifiers.c (_cpp_init_hashtable): Don't init
690 __has_include{,_next} here ...
691 * init.c (cpp_init_builtins): ... init them here. Define as
693 (cpp_read_main_file): Adjust _cpp_find_file call.
694 * pch.c (cpp_read_state): Adjust __has_include{,_next} access.
695 * traditional.c (_cpp_scan_out_locgical_line): Likewise.
697 PR preprocessor/93306
698 * expr.c (parse_has_include): Refactor. Check skip_eval before
701 2020-01-10 David Malcolm <dmalcolm@redhat.com>
703 * include/line-map.h (class diagnostic_path): New forward decl.
704 (rich_location::get_path): New accessor.
705 (rich_location::set_path): New function.
706 (rich_location::m_path): New field.
707 * line-map.c (rich_location::rich_location): Initialize m_path.
709 2020-01-01 Jakub Jelinek <jakub@redhat.com>
711 Update copyright years.
713 2019-12-18 David Malcolm <dmalcolm@redhat.com>
715 PR preprocessor/92982
717 (cpp_string_location_reader::cpp_string_location_reader): Delete
718 initialization of m_line_table.
719 * include/cpplib.h (cpp_string_location_reader::m_line_table):
720 Delete unused member.
722 2019-12-14 Jakub Jelinek <jakub@redhat.com>
724 PR preprocessor/92919
725 * charset.c (wide_str_to_charconst): If str contains just the
726 NUL terminator, punt quietly.
728 2019-12-09 David Malcolm <dmalcolm@redhat.com>
730 * include/line-map.h (label_text::label_text): Make private.
731 (label_text::borrow): New.
732 (label_text::take): New.
733 (label_text::take_or_copy): New.
735 2019-12-09 Lewis Hyatt <lhyatt@gmail.com>
737 PR preprocessor/49973
738 * generated_cpp_wcwidth.h: New file generated by
739 ../contrib/unicode/gen_wcwidth.py, supports new cpp_wcwidth function.
740 * charset.c (compute_next_display_width): New function to help
741 implement display columns.
742 (cpp_byte_column_to_display_column): Likewise.
743 (cpp_display_column_to_byte_column): Likewise.
744 (cpp_wcwidth): Likewise.
745 * include/cpplib.h (cpp_byte_column_to_display_column): Declare.
746 (cpp_display_column_to_byte_column): Declare.
747 (cpp_wcwidth): Declare.
748 (cpp_display_width): New function.
750 2019-11-14 Joseph Myers <joseph@codesourcery.com>
752 * charset.c (narrow_str_to_charconst): Make CPP_UTF8CHAR constants
754 * init.c (lang_defaults): Set utf8_char_literals for GNUC2X and
757 2019-11-07 Jakub Jelinek <jakub@redhat.com>
759 PR c++/91370 - Implement P1041R4 and P1139R2 - Stronger Unicode reqs
760 * charset.c (narrow_str_to_charconst): Add TYPE argument. For
761 CPP_UTF8CHAR diagnose whenever number of chars is > 1, using
762 CPP_DL_ERROR instead of CPP_DL_WARNING.
763 (wide_str_to_charconst): For CPP_CHAR16 or CPP_CHAR32, use
764 CPP_DL_ERROR instead of CPP_DL_WARNING when multiple char16_t
765 or char32_t chars are needed.
766 (cpp_interpret_charconst): Adjust narrow_str_to_charconst caller.
768 2019-11-05 Tim van Deurzen <tim@kompiler.org>
770 * cpplib.h: Add spaceship operator for C++.
771 * lex.c: Implement conditional lexing of spaceship operator for C++20.
773 2019-10-31 Jakub Jelinek <jakub@redhat.com>
775 PR preprocessor/92296
776 * internal.h (struct def_pragma_macro): Add is_builtin bitfield.
777 (_cpp_restore_special_builtin): Declare.
778 * init.c (_cpp_restore_special_builtin): New function.
779 * directives.c (do_pragma_push_macro): For NT_BUILTIN_MACRO
780 set is_builtin and don't try to grab definition.
781 (cpp_pop_definition): Use _cpp_restore_special_builtin to restore
784 2019-10-15 Nathan Sidwell <nathan@acm.org>
786 * include/line-map.h (struct maps_info_ordinary): Make cache
788 (struct maps_info_macro): Likewise.
789 (LINEMAPS_CACHE): Remove non-ref accessor. Constify ref accessor.
790 (LINEMAPS_ORDINARY_CACHE, LINEMAPS_MACRO_CACHE): Likewise.
791 (LINEMAPS_ORDINARY_MAP_AT, LINEMAPS_MACRO_MAP_AT): Use
792 LINEMAPS_USED and LINEMAPS_MAP_AT.
793 (linemap_lookup): Constify line_map arg.
794 linemap.c (linemap_ordinary_map_lookup, linemap_macro_map_lookup):
795 Constify line_map arg.
797 2019-10-11 Joseph Myers <joseph@codesourcery.com>
799 * include/cpplib.h (struct cpp_options): Add dfp_constants and
800 cpp_warn_c11_c2x_compat.
801 (enum cpp_warning_reason): Add CPP_W_C11_C2X_COMPAT.
802 * init.c (struct lang_flags): Add dfp_constants.
803 (lang_defaults): Set dfp_constants to 1 for GNUC2X and STDC2X and
804 0 for other languages.
805 (cpp_set_lang): Set dfp_constants from language.
806 (cpp_create_reader): Set cpp_warn_c11_c2x_compat to -1.
807 * expr.c (interpret_float_suffix): Mention DFP constants as C2X in
809 (cpp_classify_number): Do not diagnose DFP constants for languages
810 setting dfp_constants, unless cpp_warn_c11_c2x_compat.
812 2019-10-04 Nathan Sidwell <nathan@acm.org>
814 PR preprocessor/91991
815 * line-map.c (linemap_line_start): Clear max_column_hint if we run
818 2019-10-02 Richard Biener <rguenther@suse.de>
820 * internal.h (enum include_type): Remove trailing comma.
822 2019-10-02 Joseph Myers <joseph@codesourcery.com>
824 * include/cpplib.h (struct cpp_options): Add member scope.
825 * init.c (struct lang_flags, lang_defaults): Likewise.
826 (cpp_set_lang): Set scope member of pfile.
827 * lex.c (_cpp_lex_direct): Test CPP_OPTION (pfile, scope) not
828 CPP_OPTION (pfile, cplusplus) for creating CPP_SCOPE tokens.
830 2019-09-26 Eric Botcazou <ebotcazou@adacore.com>
832 * charset.c (UCS_LIMIT): New macro.
833 (ucn_valid_in_identifier): Use it instead of a hardcoded constant.
834 (_cpp_valid_ucn): Issue a pedantic warning for UCNs larger than
835 UCS_LIMIT outside of identifiers in C and in C++2a or later.
837 2019-09-19 Lewis Hyatt <lhyatt@gmail.com>
840 * charset.c (_cpp_valid_utf8): New function to help lex UTF-8 tokens.
841 * internal.h (_cpp_valid_utf8): Declare.
842 * lex.c (forms_identifier_p): Use it to recognize UTF-8 identifiers.
843 (_cpp_lex_direct): Handle UTF-8 in identifiers and CPP_OTHER tokens.
844 Do all work in "default" case to avoid slowing down typical code paths.
845 Also handle $ and UCN in the default case for consistency.
847 2019-08-30 Nathan Sidwell <nathan@acm.org>
849 New # semantics for popping to "" name.
851 * directives.c (do_linemarker): Popping to "" name means get the
852 name from the include stack..
854 2019-09-05 Nathan Sidwell <nathan@acm.org>
856 PR preprocessor/91639
857 * directives.c (do_include_common): Tell lexer we're a #include.
858 * files.c (_cpp_stack_file): Lexer will have always incremented.
859 * internal.h (struct cpp_context): Extend in_directive's
861 * lex.c (_cpp_lex_direct): Increment line for final \n when lexing
863 * line-map.c (linemap_line_start): Remember if we overflowed.
865 2019-09-03 Ulrich Weigand <uweigand@de.ibm.com>
867 * directives.c: Remove references to spu from comments.
870 2019-08-29 Nathan Sidwell <nathan@acm.org>
872 * internal.h (enum include_type): Add IT_MAIN, IT_DIRECTIVE_HWM,
874 (_cpp_stack_file): Take include_type, not a bool.
875 * files.c (_cpp_find_file): Refactor to not hide an if inside a
877 (should_stack_file): Break apart to ...
878 (is_known_idempotent_file, has_unique_contents): ... these.
879 (_cpp_stack_file): Replace IMPORT boolean with include_type enum.
880 Refactor to use new predicates. Do linemap compensation here ...
881 (_cpp_stack_include): ... not here.
882 * init.c (cpp_read_main_file): Pass IT_MAIN to _cpp_stack_file.
884 2019-08-28 Nathan Sidwell <nathan@acm.org>
886 * directives-only.c (_cpp_preprocess_dir_only): Use false, not
887 zero for _cpp_handle_directive call.
888 * directives.c (_cpp_handle_directive): Indented is bool.
889 * files.c (struct _cpp_file): Make bools 1 bit bitfields.
890 * internal.h (enum include_type): Reformat and comment.
891 (struct cpp_buffer): Make flags 1 bit bitfields.
892 (_cpp_handle_directive): Indented is bool.
894 2019-07-09 Martin Sebor <msebor@redhat.com>
896 * include/line-map.h: Change class-key from class to struct and vice
897 versa to match convention and avoid -Wclass-is-pod and -Wstruct-no-pod.
900 2019-07-03 Martin Liska <mliska@suse.cz>
902 * line-map.c (linemap_get_expansion_filename): Remove
904 * mkdeps.c (make_write): Likewise.
906 2019-07-02 qing zhao <qing.zhao@oracle.com>
908 PR preprocessor/90581
909 * directives.c (do_include_common): Replace CPP_STACK_MAX with
910 CPP_OPTION (pfile, max_include_depth).
911 * include/cpplib.h (struct cpp_options): Add new field
913 * init.c (cpp_create_reader): Initiate new field max_include_depth.
914 * internal.h: Delete CPP_STACK_MAX.
916 2019-06-26 Nathan Sidwell <nathan@acm.org>
918 PR preprocessor/90927
919 * mkdeps.c (mkdeps::vec::operator[]): Add non-const variant.
920 (deps_add_target): Deal with out of order unquoted targets.
922 2019-05-19 Andrew Pinski <apinski@marvell.com>
925 * lex.c (cpp_token_val_index <case SPELL_OPERATOR>): If tok->flags
926 has NAMED_OP set, then return CPP_TOKEN_FLD_NODE.
928 2019-05-14 Martin Liska <mliska@suse.cz>
930 PR preprocessor/90382
931 * line-map.c (first_map_in_common_1): Handle ADHOC
934 2019-05-14 Martin Liska <mliska@suse.cz>
936 PR preprocessor/90382
937 * include/line-map.h (get_data_from_adhoc_loc): Add const to
939 (get_location_from_adhoc_loc): Likewise.
940 * line-map.c(get_data_from_adhoc_loc): Add const to
942 (get_location_from_adhoc_loc): Likewise.
943 (get_combined_adhoc_loc): Use get_location_from_adhoc_loc
944 (or get_data_from_adhoc_loc).
945 (get_range_from_adhoc_loc): Likewise.
946 (get_pure_location): Likewise.
947 (linemap_position_for_loc_and_offset): Likewise.
948 (linemap_lookup): Likewise.
949 (linemap_ordinary_map_lookup): Likewise.
950 (linemap_macro_map_lookup): Likewise.
951 (linemap_get_expansion_line): Likewise.
952 (linemap_get_expansion_filename): Likewise.
953 (linemap_location_in_system_header_p): Likewise.
954 (linemap_location_from_macro_expansion_p): Likewise.
955 (linemap_macro_loc_to_exp_point): Likewise.
956 (linemap_resolve_location): Likewise.
957 (linemap_unwind_toward_expansion): Likewise.
958 (linemap_unwind_to_first_non_reserved_loc): Likewise.
959 (linemap_expand_location): Likewise.
960 (linemap_dump_location): Likewise.
962 2019-05-07 Nathan Sidwell <nathan@acm.org>
964 * files.c (_cpp_stack_file): Empty filenames aren't dependencies.
965 * mkdeps.c (deps_add_dep): Assert not empty.
967 * include/mkdeps.h (deps_write): Add PHONY arg.
968 (deps_phony_targets): Delete.
969 * init.c (cpp_finish): Just call deps_write.
970 * mkdeps.c (struct mkdeps): Add local vector class. Reimplement
972 (munge): Munge to static buffer.
973 (apply_vpath): Adjust vector handling.
974 (deps_init, deps_free): Use new, delete.
975 (deps_add_target): Do not munge here. Record quoting low water mark.
976 (deps_add_dep): Do not munge here.
977 (deps_add_vpath): Adjust vector handling.
978 (make_write_name): New. Munge on demand here.
979 (make_write_vec): New.
980 (deps_phony_targets): Delete.
982 (deps_write): Forward to deps_Write.
983 (deps_save, deps_restore): Adjust vector handling.
985 2019-05-06 Nathan Sidwell <nathan@acm.org>
987 * include/mkdeps.h: Rename struct deps to struct mkdeps.
988 * mkdeps.c: Likewise.
989 * include/cpplib.h (cpp_get_deps): Rename return type..
990 * directives.c (cpp_get_deps): Likewise.
991 * internal.h (struct cpp_reader): Rename deps field type.
993 2019-04-03 Jonathan Wakely <jwakely@redhat.com>
995 * files.c (search_path_exhausted): Fix typo in comment.
997 2019-02-26 Martin Liska <mliska@suse.cz>
999 * symtab.c (ht_dump_statistics): Make
1000 horizontal alignment for statistics.
1002 2019-02-20 David Malcolm <dmalcolm@redhat.com>
1005 * include/line-map.h (linenum_arith_t): New typedef.
1008 2019-02-18 Martin Liska <mliska@suse.cz>
1011 * line-map.c (linemap_line_start): Use 1UL in order
1014 2019-02-11 Martin Liska <mliska@suse.cz>
1017 * line-map.c (linemap_line_start): Don't reuse the existing line
1018 map if the line offset is sufficiently large to cause overflow
1019 when computing location_t values.
1021 2019-01-26 Jakub Jelinek <jakub@redhat.com>
1023 PR preprocessor/88974
1024 * directives.c (SEEN_EOL): Move macro to ...
1025 * internal.h (SEEN_EOL): ... here.
1026 * expr.c (parse_has_include): Don't cpp_get_token if SEEN_EOL ().
1028 2019-01-01 Jakub Jelinek <jakub@redhat.com>
1030 Update copyright years.
1032 2018-11-27 Mike Gulick <mgulick@mathworks.com>
1034 PR preprocessor/83173
1035 * location-example.txt: Update example -fdump-internal-locations
1038 2018-11-27 Mike Gulick <mgulick@mathworks.com>
1040 PR preprocessor/83173
1041 * files.c (_cpp_stack_include): Check if
1042 line_table->highest_location is past current line before
1045 2018-11-13 David Malcolm <dmalcolm@redhat.com>
1047 * charset.c: Replace "source_location" with "location_t".
1048 * directives-only.c: Likewise.
1049 * directives.c: Likewise.
1050 * errors.c: Likewise.
1052 * files.c: Likewise.
1053 * include/cpplib.h: Likewise. Rename MAX_SOURCE_LOCATION to
1055 * include/line-map.h: Likewise.
1057 * internal.h: Likewise.
1059 * line-map.c: Likewise.
1060 * location-example.txt: Likewise.
1061 * macro.c: Likewise.
1063 * traditional.c: Likewise.
1065 2018-11-07 Hafiz Abid Qadeer <abidh@codesourcery.com>
1067 * configure: Regenerated.
1069 2018-11-05 Martin Liska <mliska@suse.cz>
1071 * symtab.c (ht_dump_statistics): Replace %zu with %lu format.
1073 2018-11-05 Martin Liska <mliska@suse.cz>
1075 * symtab.c (ht_dump_statistics): Fix format and
1076 pass missing argument.
1078 2018-11-05 Martin Liska <mliska@suse.cz>
1080 * symtab.c (ht_dump_statistics): Make dump conditional
1081 based on alloc_subobject.
1083 2018-10-31 Joseph Myers <joseph@codesourcery.com>
1086 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
1087 * aclocal.m4, config.in, configure: Regenerate.
1089 2018-10-31 Nathan Sidwell <nathan@acm.org>
1091 * internal.h (struct cpp_reader): Rename forced_token_location_p
1092 to forced_token_location and drop its pointerness.
1093 * include/cpplib.h (cpp_force_token_locations): Take location, not
1095 * init.c (cpp_create_reader): Adjust.
1096 * lex.c (cpp_read_main_file):
1098 * directives.c (do_include_common): Commonize cleanup path.
1099 (_cpp_pop_buffer): Fix leak.
1101 * include/line-map.h (IS_ORDINARY_LOC, IS_MACRO_LOC): New
1103 (IS_ADHOC_LOC): Move earlier.
1104 (MAP_ORDINARY_P): Use IS_ORDINARY_LOC.
1105 * line-map.c (linemap_location_from_macro_expansion_p): Use
1108 * include/cpplib.h (cpp_macro_definition_location): Make inline.
1109 * macro.c (warn_of_redefinition): Fix comments, examine macro
1111 (cpp_macro_definition_location): Don't define here.
1113 * include/cpplib.h (HT_NODE): Don't cast NODE.
1114 (NODE_LEN, NODE_NAME): Use HT_NODE.
1116 * directives.c (DIRECTIVE_TABLE): Drop historical frequency
1118 * files.c (_cpp_stack_file): Fix indentation.
1120 2018-10-17 Joseph Myers <joseph@codesourcery.com>
1122 * include/cpplib.h (enum c_lang): Add CLK_GNUC2X and CLK_STDC2X.
1123 * init.c (lang_defaults): Add GNUC2X and STDC2X entries.
1124 (cpp_init_builtins): Define __STDC_VERSION__ to 202000L for C2X.
1126 2018-10-11 David Malcolm <dmalcolm@redhat.com>
1128 * macro.c (_cpp_arguments_ok): If the argument count is wrong, add
1129 a note showing the definition of the macro.
1131 2018-10-11 Nathan Sidwell <nathan@acm.org>
1133 * include/line-map.h (LINEMAPS_MACRO_LOWEST_LOCATION): Fix
1135 * line-map.c (linemap_enter_macro): Use RAII. Clear all of the
1138 2018-10-09 David Malcolm <dmalcolm@redhat.com>
1140 * charset.c (noop_error_cb): Rename to...
1141 (noop_diagnostic_cb): ...this, converting params to enums.
1142 (cpp_interpret_string_ranges): Update for renaming and enums.
1143 * directives.c (check_eol_1): Convert reason to enum.
1144 (do_diagnostic): Convert code and reason to enum.
1145 (do_error): Use CPP_W_NONE rather than 0.
1146 (do_pragma_dependency): Likewise.
1147 * errors.c (cpp_diagnostic_at): Convert level and reason to enums.
1148 Update for renaming.
1149 (cpp_diagnostic): Convert level and reason to enums.
1150 (cpp_error): Convert level to enum.
1151 (cpp_warning): Convert reason to enums.
1152 (cpp_pedwarning): Likewise.
1153 (cpp_warning_syshdr): Likewise.
1154 (cpp_diagnostic_with_line): Convert level and reason to enums.
1155 Update for renaming.
1156 (cpp_error_with_line): Convert level to enum.
1157 (cpp_warning_with_line): Convert reason to enums.
1158 (cpp_pedwarning_with_line): Likewise.
1159 (cpp_warning_with_line_syshdr): Likewise.
1160 (cpp_error_at): Convert level to enum.
1161 (cpp_errno): Likewise.
1162 (cpp_errno_filename): Likewise.
1163 * include/cpplib.h (enum cpp_diagnostic_level): Name this enum,
1164 and move to before struct cpp_callbacks.
1165 (enum cpp_warning_reason): Likewise.
1166 (cpp_callbacks::diagnostic): Convert params from int to enums.
1167 (cpp_error): Convert int param to enum cpp_diagnostic_level.
1168 (cpp_warning): Convert int param to enum cpp_warning_reason.
1169 (cpp_pedwarning): Likewise.
1170 (cpp_warning_syshdr): Likewise.
1171 (cpp_errno): Convert int param to enum cpp_diagnostic_level.
1172 (cpp_errno_filename): Likewise.
1173 (cpp_error_with_line): Likewise.
1174 (cpp_warning_with_line): Convert int param to enum
1176 (cpp_pedwarning_with_line): Likewise.
1177 (cpp_warning_with_line_syshdr): Likewise.
1178 (cpp_error_at): Convert int param to enum cpp_diagnostic_level.
1179 * macro.c (create_iso_definition): Convert int to enum.
1180 (_cpp_create_definition): Likewise.
1182 2018-09-17 David Malcolm <dmalcolm@redhat.com>
1184 * include/line-map.h (range_label::get_text): Add param
1187 2018-08-30 Nathan Sidwell <nathan@acm.org>
1189 * include/line-map.h (enum lc_reason): Comment each member
1191 (struct line_maps): Fix reallocator comment.
1193 2018-08-27 David Malcolm <dmalcolm@redhat.com>
1196 * include/line-map.h (enum range_display_kind): New enum.
1197 (struct location_range): Replace field "m_show_caret_p" with
1198 "m_range_display_kind", converting from bool to the new enum.
1199 (class rich_location): Add example of line insertion fix-it hint.
1200 (rich_location::add_range): Convert param "show_caret_p" from bool
1201 to enum range_display_kind and rename to "range_display_kind",
1202 giving it a default of SHOW_RANGE_WITHOUT_CARET.
1203 (rich_location::set_range): Likewise, albeit without a default.
1204 * line-map.c (rich_location::rich_location): Update for conversion
1205 of show_caret_p to tri-state enum.
1206 (rich_location::add_range): Likewise.
1207 (rich_location::set_range): Likewise.
1209 2018-08-24 H.J. Lu <hongjiu.lu@intel.com>
1212 * line-map.c (pure_location_p): Return true if linemap_lookup
1214 (linemap_add): Set start_location to 0 if we run out of line map
1217 2018-08-20 Nathan Sidwell <nathan@acm.org>
1219 * include/cpplib.h: Fixup some whitespace.
1220 (cpp_hashnode): Reduce type to 2 bit & flags to 8.
1222 * include/cpplib.h (NODE_BUILTIN, NODE_MACRO_ARG): Delete.
1224 (enum node_type): Replace NT_MACRO with NT_USER_MACRO,
1225 NT_BUILTIN_MACRO, NT_MACRO_ARG. Delete NT_ASSERTION.
1226 (NTV_MACRO, NTV_ANSWER, NTV_BUILTIN, NTV_ARGUMENT, NTV_NONE):
1228 (CPP_HASHNODE_VALUE_IDX): Delete.
1229 (union _cpp_hashnode_value): GTY tag from enum node_type directly.
1230 (struct cpp_hashnode): Adjust GTY desc for value field.
1231 (cpp_user_macro_p, cpp_builtin_macro_p, cpp_macro_p): Adjust.
1232 * directives.c (undefine_macros): Clear value.anwers, adjust flag
1234 (_cpp_test_assertion): No need to check NT_ASSERTION.
1235 (do_assert, do_unassert): Likewise.
1236 * init.c (cpp_init_special_builtins): Set type not flags.
1237 * macro.c (struct macro_arg_saved_data): Add type field.
1238 (cpp_get_token_1): Check type not NT_VOID.
1239 (_cpp_free_definition): Adjust flag clearing. Nullify
1241 (_cpp_save_parameter, _cpp_unsave_parameters): Save and restore
1243 (lex_expansion_token): Check type not flags.
1244 (_cpp_create_definition): Set type to NT_USER_MACRO.
1245 (_cpp_notify_macro_use): Adjust type checking.
1246 * pch.c (write_macdef, count_defs, write_defs, cpp_valid_state)
1247 (save_macros): Adjust node type/flag handling.
1248 * traditional.c (_cpp_scan_out_logical_line): Check type not flags.
1250 * directives.c (do_undef): Use cpp_macro_p & cpp_builtin_macro_p.
1251 * include/cpplib.h (enum cpp_macro_kind): Remove trailing comma.
1252 (cpp_fun_like_macro_p): Make inline, define.
1253 * macro.c (cpp_define_lazily): Use UCHAR_MAX.
1254 (cpp_fun_like_macro_p): Delete.
1256 * Makefile.in (TAGS_SOURCES): Remove cpp-id-data.h.
1257 * include/cpp-id-data.h: Delete.
1258 * internal.h: Include cpplib.h not cpp-id-data.h.
1260 * include/cpp-id-data.h (struct answer): Delete.
1261 * include/cpplib.h (struct answer): Don't forward-declare.
1262 (enum cpp_macro_kind): Add cmk_assert.
1263 (struct cpp_macro): Union parms and next assert chain.
1264 (union _cpp_hashnode_value): 'answer' field is cpp_macro.
1265 * directives.c (parse_answer): Convert to use cpp_macro. Return
1267 (parse_assertion, find_answer, _cpp_test_assertion, cpp_do_assert)
1268 (cpp_do_unassert): Convert to use cpp_macro.
1269 * macro.c (warn_of_redefinition, _cpp_new_macro)
1270 (check_trad_stringification, cpp_macro_definition): Adjust macro
1272 * traditional.c (_cpp_replacement_text_len)
1273 (_cpp_copy_replacement_text, _cpp_create_trad_definition): Likewise.
1275 2018-08-17 Nathan Sidwell <nathan@acm.org>
1277 * include/cpplib.h (struct cpp_callbacks): Replace
1278 user_builtin_macro with user_lazy_macro.
1279 (struct cpp_macro): add lazy field.
1280 (enum cpp_builtin_type): Remove BT_FIRST_USER, BT_LAST_USER.
1281 (cpp_define_lazily): Declare.
1282 * macro.c (enter_macro_context) Use _cpp_maybe_notify_macro_use.
1283 (warn_of_redefinition): Use cpp_builtin_macro_p, directly call
1284 user_lazy_macro hook.
1285 (_cpp_new_macro): Clear lazy field.
1286 (cpp_define_lazily): Define.
1287 (_cpp_notify_macro_use): Adjust lazy definition code.
1288 (cpp_macro_definition): No need to do lazy definition here.
1289 * pch.c (write_macdef, save_macros): Likewise.
1291 * include/cpplib.h (enum cpp_macro_kind): New.
1292 (struct cpp_macro): Make body trailing array. Add kind field,
1293 delete traditional flag.
1294 * internal.h (_cpp_new_macro): Declare.
1295 (_cpp_reserve_room): New inline.
1296 (_cpp_commit_buf): Declare.
1297 (_cpp_create_trad_definition): Return new macro.
1298 * lex.c (_cpp_commit_buff): New.
1299 * macro.c (macro_real_token_count): Count backwards.
1300 (replace_args): Pointer equality not orderedness.
1301 (_cpp_save_parameter): Use _cpp_reserve_room.
1302 (alloc_expansion_token): Delete.
1303 (lex_expansion_token): Return macro pointer. Use _cpp_reserve_room.
1304 (create_iso_definition): Allocate macro itself. Adjust for
1305 different allocation ordering.
1306 (_cpp_new_macro): New.
1307 (_cpp_create_definition): Adjust for API changes.
1308 * traditional.c (push_replacement_text): Don't set traditional
1310 (save_replacement_text): Likewise.
1311 (_cpp_create_trad_definition): Allocate macro itself, Adjust for
1312 different allocation ordering.
1314 * cpp-id-data.h (uchar, UC): Move to internal.h
1315 (struct cpp_macro): Move to cpplib.h.
1316 * internal.h (uchar, UC): From cpp-id-data.h.
1317 * include/cpplib.h (struct cpp_macro): From cpp-id-data.h.
1319 2018-08-16 Nathan Sidwell <nathan@acm.org>
1321 * internal.h (_cpp_save_parameter): Take parmno, not macro.
1322 (_cpp_unsave_parameters): Declare.
1323 * macro.c (_cpp_save_parameter): Take parm number, not macro.
1324 Return true on success.
1325 (_cpp_unsave_parameters): New.
1326 (parse_params): Take parm_no and variadic pointers, not macro.
1327 Reimplement parsing logic.
1328 (create_iso_definition): Adjust parse_params changes. Call
1329 _cpp_unsave_parameters here.
1330 (_cpp_create_definition): Don't unsave params here.
1331 * traditional.c (scan_parameters): Take n_param pointer, adjust.
1332 (_cpp_create_trad_definition): Ajust scan_parameters change. Call
1333 _cpp_unsave_parameters.
1335 * include/cpplib.h (cpp_user_macro_p, cpp_builtin_macro_p)
1336 (cpp_macro_p): New inlines.
1337 * directives.c (do_pragma_poison): Use cpp_macro_p.
1338 (do_ifdef, do_ifndef): Likewise. Use _cpp_maybe_notify_macro_use.
1339 (cpp_pop_definition): Use cpp_macro_p. Move _cpp_free_definition
1340 earlier. Don't zap node directly.
1341 * expr.c (parse_defined): Use _cpp_maybe_notify_macro_use &
1343 * files.c (should_stack_file): Use cpp_macro_p.
1344 * identifiers.c (cpp_defined): Likewise.
1345 * internal.h (_cpp_mark_macro): Use cpp_user_macro_p.
1346 (_cpp_notify_macro_use): Declare.
1347 (_cpp_maybe_notify_macro_use): New inline.
1348 * lex.c (is_macro): Use cpp_macro_p.
1349 * macro.c (_cpp_warn_if_unused_macro): Use cpp_user_macro_p.
1350 (enter_macro_context): Likewise.
1351 (_cpp_create_definition): Use cpp_builtin_macro_p,
1352 cpp_user_macro_p. Move _cpp_free_definition earlier.
1353 (_cpp_notify_macro_use): New, broken out of multiple call sites.
1354 * traditional.c (fun_like_macro_p): Use cpp_builtin_macro_p.
1355 (maybe_start_funlike, _cpp_scan_out_logical_line)
1356 (push_replacement_text): Likewise.
1358 2018-08-15 David Malcolm <dmalcolm@redhat.com>
1360 * include/line-map.h (struct location_range): Add "m_label" field.
1361 (class rich_location): Add description of labels to leading
1363 (rich_location::rich_location): Add "label" param, defaulting to
1365 (rich_location::add_range): Likewise.
1366 (struct label_text): New struct.
1367 (class range_label): New abstract base class.
1368 * line-map.c (rich_location::rich_location): Add "label" param;
1370 (rich_location::add_range): Likewise.
1372 2018-08-08 Nathan Sidwell <nathan@acm.org>
1374 Make linemap::included_from a location
1376 * include/line-map.h (struct line_map_ordinary): Replace
1377 included_from map index with included_at source_location.
1378 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Delete.
1379 (LAST_SOURCE_LINE_LOCATION): Delete.
1380 (LAST_SOURCE_LINE, LAST_SOURCE_COLUMN): Delete.
1381 (linemap_included_from): New.
1382 (linemap_included_from_linemap): Declare.
1383 (MAIN_FILE_P): Adjust.
1384 * line-map.c (linemap_included_from_linemap): New.
1385 (lonemap_check_files_exited): Use linemap_included_at.
1386 (linemap_add): Adjust inclusion setting.
1387 (linemap_dump, linemap_dump_location): Adjust.
1388 * directives.c (do_linemarker): Use linemap_included_at.
1390 2018-08-07 Nathan Sidwell <nathan@acm.org>
1392 * line-map.c: (linemap_init): Set default allocator here.
1393 (new_linemap): Rather than here. Refactor allocation logic.
1395 2018-07-20 David Malcolm <dmalcolm@redhat.com>
1397 * include/line-map.h (rich_location::set_range): Remove redundant
1398 line_maps * parameter.
1399 * line-map.c (rich_location::set_range): Likewise.
1401 2018-07-18 Bernd Edlinger <bernd.edlinger@hotmail.de>
1404 * macro.c (enter_macro_context): Change the location info for builtin
1405 macros and _Pragma from location of the closing parenthesis to location
1406 of the macro expansion point.
1408 2018-07-17 Jason Franklin <j_fra@fastmail.us>
1409 Jakub Jelinek <jakub@redhat.com>
1411 * lex.c (_cpp_lex_direct): Use CPP_DL_NOTE instead of CPP_DL_PEDWARN,
1412 CPP_DL_WARNING or CPP_DL_ERROR for note that diagnostics for C++ style
1413 comments is reported only once per file and guard those calls on the
1414 preceding cpp_error returning true.
1416 2018-07-03 Nathan Sidwell <nathan@acm.org>
1418 Reorg line_map data structures for better packing.
1419 * include/line-map.h (enum lc_reason): Add LC_HWM.
1420 (LINE_MAP_MAX_LOCATION): Define here.
1421 (struct line_map): Move reason field to line_map_ordinary. Adjust
1423 (struct line_map_ordinary): Reorder fields for less padding.
1424 (struct line_map_macro): Likewise.
1425 (MAP_ORDINARY_P): New.
1426 (linemap_check_ordinary, linemap_check_macro): Adjust.
1427 * line-map.c (LINE_MAP_MAX_SOURCE_LOCATION): Delete.
1428 (new_linemap): Take start_location, not reason. Adjust.
1429 (linemap_add, linemap_enter_macro): Adjust.
1430 (linemap_line_start): Likewise.
1431 (linemap_macro_expansion_map_p): Use MAP_ORDINARY_P.
1432 (linemap_macro_loc_to_spelling_point): Likewise.
1433 (linemap_macro_loc_to_def_point): Likewise.
1434 (linemap_dump): Likewise.
1436 2018-05-23 Jason Merrill <jason@redhat.com>
1438 * system.h: #include <new> earlier.
1440 2018-05-17 Jason Merrill <jason@redhat.com>
1442 * line-map.c (linemap_init): Use placement new.
1443 * system.h: #include <new>.
1445 2018-03-14 David Malcolm <dmalcolm@redhat.com>
1447 * include/line-map.h (compare): New function on linenum_type.
1449 2018-02-28 Jonathan Wakely <jwakely@redhat.com>
1451 PR preprocessor/84517
1452 * lex.c (is_macro_not_literal_suffix): New function.
1453 (lex_raw_string, lex_string): Use is_macro_not_literal_suffix to
1454 decide when to issue -Wliteral-suffix warnings.
1456 2018-02-16 Richard Biener <rguenther@suse.de>
1459 * line-map.c (linemap_init): Avoid broken value-init when compiling
1462 2018-02-15 Jason Merrill <jason@redhat.com>
1463 Jakub Jelinek <jakub@redhat.com>
1465 PR preprocessor/83063 - __VA_OPT__ and ##
1466 PR preprocessor/83708
1467 * macro.c (vaopt_state): Reorder m_last_was_paste before m_state.
1468 (vaopt_state::vaopt_state): Adjust.
1469 (vaopt_state::update_flags): Add BEGIN and END.
1470 (vaopt_state::update): Return them.
1471 (copy_paste_flag): Factor out of replace_args.
1472 (last_token_is): New.
1473 (replace_args): Handle BEGIN and END. Avoid padding there.
1474 (tokens_buff_last_token_ptr): Return NULL if no tokens.
1476 2018-01-31 Jakub Jelinek <jakub@redhat.com>
1478 PR preprocessor/69869
1479 * traditional.c (skip_macro_block_comment): Return bool, true if
1480 the macro block comment is unterminated.
1481 (copy_comment): Use return value from skip_macro_block_comment instead
1484 2018-01-27 Jakub Jelinek <jakub@redhat.com>
1486 * include/cpplib.h (enum cpp_builtin_type): Change BT_LAST_USER from
1487 BT_FIRST_USER + 31 to BT_FIRST_USER + 63.
1489 2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
1492 * include/cpplib.h (cpp_callbacks::remap_filename): New callback.
1493 * macro.c (_cpp_builtin_macro_text): Call remap_filename for
1494 __FILE__ and __BASE_FILE__.
1496 2018-01-10 Kelvin Nilsen <kelvin@gcc.gnu.org>
1498 * lex.c (search_line_fast): Remove illegal coercion of an
1499 unaligned pointer value to vector pointer type and replace with
1500 use of __builtin_vec_vsx_ld () built-in function, which operates
1501 on unaligned pointer values.
1503 2018-01-03 Jakub Jelinek <jakub@redhat.com>
1505 Update copyright years.
1507 2017-12-20 Michael Weiser <michael.weiser@gmx.de>
1509 PR preprocessor/83492
1510 * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]:
1511 Fix selection of big-endian shift parameters by using
1514 2017-12-14 Bernd Edlinger <bernd.edlinger@hotmail.de>
1516 * internal.h (maybe_print_line): Change signature.
1518 2017-12-05 Jakub Jelinek <jakub@redhat.com>
1521 * expr.c (interpret_float_suffix): Avoid memcmp.
1522 (interpret_int_suffix): Likewise. Don't check for if.
1524 2017-12-01 Jason Merrill <jason@redhat.com>
1526 PR c++/79228 - extensions hide C++14 complex literal operators
1527 * expr.c (interpret_float_suffix): Ignore 'i' in C++14 and up.
1528 (interpret_int_suffix): Likewise.
1530 2017-11-28 David Malcolm <dmalcolm@redhat.com>
1533 * include/line-map.h (LINE_MAP_MAX_COLUMN_NUMBER): Move here.
1534 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): ...from here.
1535 (rich_location::maybe_add_fixit): Reject fix-it hints in which
1536 the start column exceeds the next column.
1538 2017-11-20 Eric Gallager <egall@gwmail.gwu.edu>
1540 PR preprocessor/81794
1541 * macro.c (check_trad_stringification): Have warning be controlled
1544 2017-11-20 David Malcolm <dmalcolm@redhat.com>
1547 * include/cpplib.h (cpp_macro_definition_location): New decl.
1548 * macro.c (cpp_macro_definition): New function.
1550 2017-11-13 Tom Tromey <tom@tromey.com>
1552 * pch.c (cpp_read_state): Set n__VA_OPT__.
1553 * macro.c (vaopt_state): New class.
1554 (_cpp_arguments_ok): Check va_opt flag.
1555 (replace_args, create_iso_definition): Use vaopt_state.
1556 * lex.c (lex_identifier_intern): Possibly issue errors for
1558 (lex_identifier): Likewise.
1559 (maybe_va_opt_error): New function.
1560 * internal.h (struct lexer_state) <va_args_ok>: Update comment.
1561 (struct spec_nodes) <n__VA_OPT__>: New field.
1562 * init.c (struct lang_flags) <va_opt>: New field.
1563 (lang_defaults): Add entries for C++2A. Update all entries for
1565 (cpp_set_lang): Initialize va_opt.
1566 * include/cpplib.h (struct cpp_options) <va_opt>: New field.
1567 * identifiers.c (_cpp_init_hashtable): Initialize n__VA_OPT__.
1569 2017-11-13 David Malcolm <dmalcolm@redhat.com>
1571 * include/line-map.h (linenum_type): Move this typedef and the
1572 comment describing column numbering to near the top of the file.
1574 2017-11-06 Mukesh Kapoor <mukesh.kapoor@oracle.com>
1577 * lex.c (lex_string): When checking for a valid macro for the
1578 warning related to -Wliteral-suffix (CPP_W_LITERAL_SUFFIX),
1579 check that the macro name does not start with an underscore
1580 before calling is_macro().
1582 2017-11-05 Tom de Vries <tom@codesourcery.com>
1585 * lex.c (BUF_APPEND): Remove semicolon after
1588 2017-10-31 David Malcolm <dmalcolm@redhat.com>
1590 * directives.c (_cpp_handle_directive): Update for renaming of
1591 cpp_error_at_richloc to cpp_error_at.
1592 * errors.c (cpp_diagnostic_at_richloc): Rename to...
1593 (cpp_diagnostic_at): ...this, dropping the location_t-based
1595 (cpp_diagnostic): Update for removal of location_t-based
1597 (cpp_error_at): Likewise.
1598 (cpp_error_at_richloc): Rename to...
1599 (cpp_error_at): ...this, and update for renaming of
1600 cpp_diagnostic_at_richloc.
1601 * include/cpplib.h (cpp_error_at_richloc): Rename to...
1602 (cpp_error_at): ...this.
1604 2017-10-30 Joseph Myers <joseph@codesourcery.com>
1606 * include/cpplib.h (enum c_lang): Add CLK_GNUC17 and CLK_STDC17.
1607 * init.c (lang_defaults): Add GNUC17 and STDC17 data.
1608 (cpp_init_builtins): Handle C17 value of __STDC_VERSION__.
1610 2017-10-10 Nathan Sidwell <nathan@acm.org>
1612 PR preprocessor/82506
1613 * macro.c (cpp_quote_string): Escape raw LFs.
1615 2017-09-15 Andrew Sutton <andrew.n.sutton@gmail.com>
1616 Jakub Jelinek <jakub@redhat.com>
1618 Add support for -std=c++2a.
1619 * include/cpplib.h (c_lang): Add CXX2A and GNUCXX2A.
1620 * init.c (lang_defaults): Add rows for CXX2A and GNUCXX2A.
1621 (cpp_init_builtins): Set __cplusplus to 201709L for C++2a.
1623 2017-09-15 Jakub Jelinek <jakub@redhat.com>
1625 * include/cpplib.h (enum c_lang): Rename CLK_GNUCXX1Z
1626 to CLK_GNUCXX17 and CLK_CXX1Z to CLK_CXX17.
1627 * init.c (lang_defaults, cpp_init_builtins): Likewise.
1628 * expr.c (cpp_classify_number): Use C++17 instead of C++1z
1631 2017-07-07 David Malcolm <dmalcolm@redhat.com>
1634 * line-map.c (linemap_macro_loc_to_def_point): Preserve range
1635 information for macro expansions by delaying resolving ad-hoc
1636 locations until within the loop.
1638 2017-07-06 David Malcolm <dmalcolm@redhat.com>
1641 * include/line-map.h (enum location_aspect): New enum.
1642 (linemap_client_expand_location_to_spelling_point): Add
1643 enum location_aspect param.
1644 * line-map.c (rich_location::get_expanded_location): Update for
1645 new param of linemap_client_expand_location_to_spelling_point.
1646 (rich_location::maybe_add_fixit): Likewise.
1647 (fixit_hint::affects_line_p): Likewise.
1649 2017-06-21 Jakub Jelinek <jakub@redhat.com>
1651 * line-map.c (location_adhoc_data_update): Perform addition in
1652 uintptr_t type rather than char * type. Read *data using
1653 ptrdiff_t type instead of int64_t.
1654 (get_combined_adhoc_loc): Change offset type to ptrdiff_t from
1657 2017-06-20 David Malcolm <dmalcolm@redhat.com>
1659 * include/line-map.h (class rich_location): Document that attempts
1660 to delete or replace a range *affecting* multiple lines will fail.
1661 * line-map.c (rich_location::maybe_add_fixit): Implement this
1664 2017-06-09 David Malcolm <dmalcolm@redhat.com>
1666 * include/line-map.h
1667 (rich_location::fixits_cannot_be_auto_applied): New method.
1668 (rich_location::fixits_can_be_auto_applied_p): New accessor.
1669 (rich_location::m_fixits_cannot_be_auto_applied): New field.
1670 * line-map.c (rich_location::rich_location): Initialize new field.
1672 2017-06-05 David Malcolm <dmalcolm@redhat.com>
1674 * include/cpplib.h (struct cpp_callbacks): Add "comment"
1676 * lex.c (_cpp_lex_direct): Call the comment callback if non-NULL.
1678 2017-05-02 David Malcolm <dmalcolm@redhat.com>
1680 * include/line-map.h (class rich_location): Update description of
1682 (class fixit_hint): Likewise.
1683 (fixit_hint::ends_with_newline_p): New decl.
1684 * line-map.c (rich_location::maybe_add_fixit): Support newlines
1685 in fix-it hints that are insertions of single lines at the start
1686 of a line. Don't consolidate into such fix-it hints.
1687 (fixit_hint::ends_with_newline_p): New method.
1689 2017-05-01 David Malcolm <dmalcolm@redhat.com>
1691 * include/line-map.h (source_range::intersects_line_p): Delete.
1692 (rich_location::add_fixit): Delete.
1693 (rich_location::maybe_add_fixit): New method.
1694 (class fixit_hint): Reimplement in terms of...
1695 (class fixit_replace): ...this.
1696 (class fixit_insert): Delete.
1697 * line-map.c (linemap_position_for_loc_and_offset): Drop overzealous
1698 linemap_assert_fails.
1699 (source_range::intersects_line_p): Rename to...
1700 (fixit_hint::affects_line_p): New function.
1701 (rich_location::add_fixit_insert_before): Reimplement in terms of
1702 maybe_add_fixit, moving validation there.
1703 (rich_location::add_fixit_insert_after): Likewise.
1704 (column_before_p): Delete.
1705 (rich_location::add_fixit_replace): Reimplement in terms of
1706 maybe_add_fixit, moving validation there. Convert closed input range
1708 (rich_location::add_fixit): Delete.
1709 (rich_location::maybe_add_fixit): New function.
1710 (fixit_insert::fixit_insert): Delete.
1711 (fixit_insert::~fixit_insert): Delete.
1712 (fixit_insert::affects_line_p): Delete.
1713 (fixit_insert::maybe_append_replace): Delete.
1714 (fixit_replace::fixit_replace): Rename to...
1715 (fixit_hint::fixit_hint): ...this, rewriting as necessary.
1716 (fixit_replace::~fixit_replace): Delete.
1717 (fixit_replace::affects_line_p): Delete.
1718 (fixit_replace::maybe_append_replace): Rename to...
1719 (fixit_hint::maybe_append): ...this, rewriting as necessary.
1721 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
1723 * include/line-map.h (LINEMAPS_MACRO_MAPS): Fix typo in comment.
1724 * lex.c (search_line_fast): Likewise.
1725 * pch.h (cpp_valid_state): Likewise.
1727 2017-03-21 Andreas Schwab <schwab@suse.de>
1729 * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]:
1730 Convert 64-bit value to boolean before passing to
1733 2017-03-16 Jason Merrill <jason@redhat.com>
1735 * init.c (cpp_init_builtins): Update __cplusplus for C++17.
1737 2017-02-09 Gerald Pfeifer <gerald@pfeifer.com>
1739 * Makefile.in (po/$(PACKAGE).pot): Adjust bug reporting URL.
1741 2017-01-10 David Malcolm <dmalcolm@redhat.com>
1744 * line-map.c (linemap_position_for_column): When calling
1745 linemap_start_line, detect if a new linemap was created with
1746 0 column bits, and bail out early if this is the case.
1747 (linemap_position_for_loc_and_offset): Replace overzealous
1748 linemap_assert_fails with a simple conditional; use correct
1751 2017-01-07 David Malcolm <dmalcolm@redhat.com>
1754 * line-map.c (linemap_line_start): When determining if the highest
1755 column given out so far will fit into a proposed change to the
1756 current map, use the effective number of column bits, rather than
1757 the total number of column + range bits.
1759 2017-01-01 Jakub Jelinek <jakub@redhat.com>
1761 Update copyright years.
1763 2016-12-15 David Malcolm <dmalcolm@redhat.com>
1765 PR preprocessor/78680
1766 PR preprocessor/78811
1767 * lex.c (_cpp_lex_direct): Only determine the end-location of
1768 the token and build a range for non-reserved start locations.
1769 Do not do it for EOF tokens.
1771 2016-12-12 David Malcolm <dmalcolm@redhat.com>
1773 PR preprocessor/78680
1774 * lex.c (_cpp_lex_direct): Ensure line notes are processed before
1775 computing the end-point of the token.
1777 2016-11-23 Paolo Bonzini <bonzini@gnu.org>
1779 * include/cpplib.h (struct cpp_options): Add new member
1780 warn_expansion_to_defined.
1781 (CPP_W_EXPANSION_TO_DEFINED): New enum member.
1782 * expr.c (parse_defined): Warn for all uses of "defined"
1783 in macros, and tie warning to CPP_W_EXPANSION_TO_DEFINED.
1784 Make it a pedwarning instead of a warning.
1785 * system.h (HAVE_DESIGNATED_INITIALIZERS): Do not use
1786 "defined" in macros.
1788 2016-11-17 David Malcolm <dmalcolm@redhat.com>
1790 * charset.c (cpp_interpret_string_1): Skip locations from
1791 loc_reader when advancing 'p' when handling raw strings.
1793 2016-11-16 Jakub Jelinek <jakub@redhat.com>
1796 * configure.ac (ENABLE_ASSERT_CHECKING): Define if gcc configure
1797 would define that macro.
1798 * configure: Regenerated.
1799 * config.in: Regenerated.
1801 2016-11-08 Richard Earnshaw <rearnsha@arm.com>
1803 * lex.c (search_line_fast): New implementation for AArch64.
1805 2016-10-25 David Malcolm <dmalcolm@redhat.com>
1807 * files.c (destroy_cpp_file): Free file->path.
1809 2016-10-25 David Malcolm <dmalcolm@redhat.com>
1811 * include/line-map.h (line_maps::~line_maps): New dtor.
1812 (location_adhoc_data_fini): Delete decl.
1813 * line-map.c (line_maps::~line_maps): New dtor.
1814 (location_adhoc_data_fini): Delete.
1816 2016-10-21 Andris Pavenis <andris.pavenis@iki.fi>
1818 PR preprocessor/71681
1819 * files.c (remap_filename): Fix handling -remap in subdirectories.
1821 2016-10-12 Jakub Jelinek <jakub@redhat.com>
1823 * include/cpplib.h (struct cpp_options): Add
1824 cpp_warn_implicit_fallthrough.
1825 * init.c (cpp_create_reader): Initialize it to 0.
1826 * lex.c (fallthrough_comment_p): Handle different
1827 cpp_warn_implicit_fallthrough levels. Whitespace fixes.
1829 2016-10-08 Jakub Jelinek <jakub@redhat.com>
1831 * lex.c (fallthrough_comment_p): Accept Else, fallthrough.
1833 * lex.c (fallthrough_comment_p): Extend to handle more common FALLTHRU
1836 * lex.c (fallthrough_comment_p): Fix off-by-one size comparison
1838 (_cpp_lex_direct): Allow arbitrary comments in between
1839 fallthrough_comment_p comment and following token.
1841 2016-10-04 Kelvin Nilsen <kelvin@gcc.gnu.org>
1844 * lex.c (search_line_fast): Add a FALLTHROUGH comment to correct
1845 compiler error in the version of this function that is
1846 conditionally compiled when GCC_VERSION >= 4005 and both
1847 __ALTIVEC__ and __BIG_ENDIAN__ symbols are defined.
1849 2016-09-26 Marek Polacek <polacek@redhat.com>
1850 Jakub Jelinek <jakub@redhat.com>
1853 * include/cpplib.h (PREV_FALLTHROUGH): Define.
1854 * internal.h (CPP_FALLTHRU): Define.
1855 * lex.c (fallthrough_comment_p): New function.
1856 (_cpp_lex_direct): Set PREV_FALLTHROUGH on tokens succeeding a falls
1859 2016-09-23 David Malcolm <dmalcolm@redhat.com>
1861 PR preprocessor/77672
1862 * charset.c (cpp_interpret_string_1): Add a source_range for the
1863 NUL-terminator, using the location of the trailing quote of the
1866 2016-09-21 Jason Merrill <jason@redhat.com>
1868 * line-map.c (linemap_location_from_macro_definition_p): New.
1869 * line-map.h: Declare it.
1871 2016-09-15 David Malcolm <dmalcolm@redhat.com>
1873 * include/line-map.h (class rich_location): Note that newlines
1874 aren't supported in fix-it text.
1875 * line-map.c (rich_location::add_fixit_insert_before): Reject
1876 attempts to add fix-its containing newlines.
1877 (rich_location::add_fixit_replace): Likewise.
1879 2016-09-13 David Malcolm <dmalcolm@redhat.com>
1881 * include/line-map.h (class rich_location): Add description of
1882 fix-it hints to leading comment.
1883 (rich_location::add_fixit_insert): Rename both overloaded methods
1885 (rich_location::add_fixit_insert_before): ...this, updating their
1887 (rich_location::add_fixit_insert_after): Two new overloaded
1889 (rich_location::stop_supporting_fixits): New method.
1890 * line-map.c (rich_location::add_fixit_insert): Rename both
1891 overloaded methods to..
1892 (rich_location::add_fixit_insert_before): ...this, updating their
1894 (rich_location::add_fixit_insert_after): Two new methods.
1895 (rich_location::reject_impossible_fixit): Split out
1896 failure-handling into...
1897 (rich_location::stop_supporting_fixits): New method.
1899 2016-09-02 David Malcolm <dmalcolm@redhat.com>
1901 * include/line-map.h (rich_location::seen_impossible_fixit_p): New
1904 2016-08-31 David Malcolm <dmalcolm@redhat.com>
1906 * include/line-map.h (class fixit_remove): Remove stray decl.
1907 (fixit_hint::affects_line_p): Make const.
1908 (fixit_insert::affects_line_p): Likewise.
1909 (fixit_replace::affects_line_p): Likewise.
1910 * line-map.c (fixit_insert::affects_line_p): Likewise.
1911 (fixit_replace::affects_line_p): Likewise.
1913 2016-08-30 David Malcolm <dmalcolm@redhat.com>
1915 * include/line-map.h (class semi_embedded_vec): New class.
1916 (semi_embedded_vec<T, NUM_EMBEDDED>::semi_embedded_vec): New ctor.
1917 (semi_embedded_vec<T, NUM_EMBEDDED>::~semi_embedded_vec): New
1919 (semi_embedded_vec<T, NUM_EMBEDDED>::operator[]): New methods.
1920 (semi_embedded_vec<T, NUM_EMBEDDED>::push): New method.
1921 (semi_embedded_vec<T, NUM_EMBEDDED>::truncate): New method.
1922 (rich_location::get_num_locations): Reimplement in terms of
1924 (rich_location::get_range): Make non-inline.
1925 (rich_location::get_num_fixit_hints): Reimplement in terms of
1927 (rich_location::add_fixit): New function.
1928 (rich_location::MAX_RANGES): Rename to...
1929 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this.
1930 (rich_location::MAX_FIXIT_HINTS): Rename to...
1931 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this, and make
1933 (rich_location::m_num_ranges): Eliminate in favor of...
1934 (rich_location::m_ranges): ...this, converting from a fixed-size
1935 array to a semi_embedded_vec.
1936 (rich_location::m_num_fixit_hints): Eliminate in favor of...
1937 (rich_location::m_fixit_hints): ...this, converting from a
1938 fixed-size array to a semi_embedded_vec.
1939 * line-map.c (rich_location::rich_location): Update for above
1941 (rich_location::~rich_location): Likewise.
1942 (rich_location::get_loc): Likewise.
1943 (rich_location::get_range): New methods.
1944 (rich_location::add_range): Update for above changes.
1945 (rich_location::set_range): Likewise.
1946 (rich_location::add_fixit_insert): Likewise.
1947 (rich_location::add_fixit_replace): Likewise.
1948 (rich_location::get_last_fixit_hint): Likewise.
1949 (rich_location::reject_impossible_fixit): Likewise.
1950 (rich_location::add_fixit): New method.
1952 2016-08-30 David Malcolm <dmalcolm@redhat.com>
1954 * include/line-map.h (rich_location::add_fixit_insert): Add
1955 comments. Add overload omitting the source_location param.
1956 (rich_location::add_fixit_remove): Add comments. Add overloads
1957 omitting the range, and accepting a source_location.
1958 (rich_location::add_fixit_replace): Likewise.
1959 * line-map.c (rich_location::add_fixit_insert): Add comments. Add
1960 overload omitting the source_location param.
1961 (rich_location::add_fixit_remove): Add comments. Add overloads
1962 omitting the range, and accepting a source_location.
1963 (rich_location::add_fixit_replace): Likewise.
1965 2016-08-26 David Malcolm <dmalcolm@redhat.com>
1967 * include/line-map.h (get_pure_location): New decl.
1968 * line-map.c (get_pure_location): Move here, from gcc/input.c, adding
1969 a line_maps * param.
1970 (rich_location::add_fixit_insert): Call get_pure_location on "where".
1971 (rich_location::add_fixit_replace): Call get_pure_location on the
1974 2016-08-26 David Malcolm <dmalcolm@redhat.com>
1976 * include/line-map.h (rich_location): Eliminate unimplemented
1977 constructor based on source_range.
1978 (rich_location::get_last_fixit_hint): New method.
1979 (rich_location::reject_impossible_fixit): New method.
1980 (rich_location): Add fields m_line_table and
1981 m_seen_impossible_fixit.
1982 (fixit_hint::maybe_append_replace): New pure virtual function.
1983 (fixit_insert::maybe_append_replace): New function.
1984 (fixit_replace::maybe_append_replace): New function.
1985 * line-map.c (rich_location::rich_location): Initialize
1986 m_line_table and m_seen_impossible_fixit.
1987 (rich_location::add_fixit_insert): Call
1988 reject_impossible_fixit and bail out if true.
1989 (column_before_p): New function.
1990 (rich_location::add_fixit_replace): Call reject_impossible_fixit
1991 and bail out if true. Attempt to consolidate with neighboring
1993 (rich_location::get_last_fixit_hint): New method.
1994 (rich_location::reject_impossible_fixit): New method.
1995 (fixit_insert::maybe_append_replace): New method.
1996 (fixit_replace::maybe_append_replace): New method.
1998 2016-08-23 David Malcolm <dmalcolm@redhat.com>
2000 * include/line-map.h (source_range::from_locations): New method.
2002 2016-08-19 David Malcolm <dmalcolm@redhat.com>
2004 * include/line-map.h (fixit_hint::kind): Delete REPLACE.
2005 (class fixit_remove): Delete.
2006 * line-map.c (rich_location::add_fixit_remove): Reimplement
2007 by calling add_fixit_replace with an empty string.
2008 (fixit_remove::fixit_remove): Delete.
2009 (fixit_remove::affects_line_p): Delete.
2011 2016-08-19 Joseph Myers <joseph@codesourcery.com>
2014 * include/cpplib.h (CPP_N_FLOATN, CPP_N_FLOATNX)
2015 (CPP_N_WIDTH_FLOATN_NX, CPP_FLOATN_SHIFT, CPP_FLOATN_MAX): New
2017 * expr.c (interpret_float_suffix): Handle fN, fNx, FN and FNx
2020 2016-08-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
2022 * expr.c (eval_token): Append "evaluates to 0" to Wundef diagnostic.
2024 2016-08-18 David Malcolm <dmalcolm@redhat.com>
2026 * directives.c (directive_names): New array.
2027 (_cpp_handle_directive): Offer spelling suggestions for misspelled
2029 * errors.c (cpp_diagnostic_at_richloc): New function.
2030 (cpp_error_at_richloc): New function.
2031 * include/cpplib.h (struct cpp_callbacks): Add field
2033 (cpp_error_at_richloc): New decl.
2035 2016-08-18 Marek Polacek <polacek@redhat.com>
2038 * pch.c (write_macdef): Add CPP_FALLTHRU.
2040 2016-08-12 Marek Polacek <polacek@redhat.com>
2043 * lex.c (search_line_fast): Add FALLTHRU.
2044 (_cpp_lex_direct): Likewise.
2045 (cpp_token_val_index): Adjust fall through comment.
2046 * macro.c (parse_params): Add FALLTHRU.
2047 * pch.c (count_defs): Adjust fall through comment.
2048 (write_defs): Likewise.
2050 2016-08-06 David Malcolm <dmalcolm@redhat.com>
2053 * charset.c (_cpp_valid_ucn): Replace overzealous assert with one
2054 that allows for char_range to be non-NULL when loc_reader is NULL.
2056 2016-08-05 David Malcolm <dmalcolm@redhat.com>
2058 * charset.c (cpp_substring_ranges::cpp_substring_ranges): New
2060 (cpp_substring_ranges::~cpp_substring_ranges): New destructor.
2061 (cpp_substring_ranges::add_range): New method.
2062 (cpp_substring_ranges::add_n_ranges): New method.
2063 (_cpp_valid_ucn): Add "char_range" and "loc_reader" params; if
2064 they are non-NULL, read position information from *loc_reader
2065 and update char_range->m_finish accordingly.
2066 (convert_ucn): Add "char_range", "loc_reader", and "ranges"
2067 params. If loc_reader is non-NULL, read location information from
2068 it, and update *ranges accordingly, using char_range.
2069 Conditionalize the conversion into tbuf on tbuf being non-NULL.
2070 (convert_hex): Likewise, conditionalizing the call to
2071 emit_numeric_escape on tbuf.
2072 (convert_oct): Likewise.
2073 (convert_escape): Add params "loc_reader" and "ranges". If
2074 loc_reader is non-NULL, read location information from it, and
2075 update *ranges accordingly. Conditionalize the conversion into
2076 tbuf on tbuf being non-NULL.
2077 (cpp_interpret_string): Rename to...
2078 (cpp_interpret_string_1): ...this, adding params "loc_readers" and
2079 "out". Use "to" to conditionalize the initialization and usage of
2080 "tbuf", such as running the converter. If "loc_readers" is
2081 non-NULL, use the instances within it, reading location
2082 information from them, and passing them to convert_escape; likewise
2083 write to "out" if loc_readers is non-NULL. Check for leading
2084 quote and issue an error if it is not present. Update boundary
2085 check from "== limit" to ">= limit" to protect against erroneous
2086 location values to calls that are not parsing string literals.
2087 (cpp_interpret_string): Reimplement in terms to
2088 cpp_interpret_string_1.
2089 (noop_error_cb): New function.
2090 (cpp_interpret_string_ranges): New function.
2091 (cpp_string_location_reader::cpp_string_location_reader): New
2093 (cpp_string_location_reader::get_next): New method.
2094 * include/cpplib.h (class cpp_string_location_reader): New class.
2095 (class cpp_substring_ranges): New class.
2096 (cpp_interpret_string_ranges): New prototype.
2097 * internal.h (_cpp_valid_ucn): Add params "char_range" and
2099 * lex.c (forms_identifier_p): Pass NULL for new params to
2102 2016-08-01 Andreas Schwab <schwab@suse.de>
2104 * include/cpplib.h: Fix comment typo.
2106 2016-07-27 David Malcolm <dmalcolm@redhat.com>
2108 * include/line-map.h (source_location): Fix line numbers in
2111 2016-07-11 David Malcolm <dmalcolm@redhat.com>
2113 * include/line-map.h (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES):
2114 Move here from line-map.c.
2115 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
2116 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): Move from
2118 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
2120 2016-06-22 David Malcolm <dmalcolm@redhat.com>
2122 * directives.c (do_include_common): Pass on "location" to
2124 * errors.c (cpp_diagnostic): Reimplement in terms of...
2125 (cpp_diagnostic_at): New function.
2126 (cpp_error_at): New function.
2127 (cpp_errno_filename): Add "loc" param and use it by using
2128 cpp_error_at rather than cpp_error.
2129 * files.c (find_file_in_dir): Add "loc" param and pass it to
2131 (_cpp_find_file): Add "loc" param. Use it to convert calls to
2132 cpp_error to cpp_error_at, and pass it to find_file_in_dir and
2134 (read_file_guts): Add "loc" param. Use it to convert calls to
2135 cpp_error to cpp_error_at. Pass it to cpp_errno_filename.
2136 (read_file): Add "loc" param. Pass it to open_file_failed and
2138 (should_stack_file): Add "loc" param. Pass it to read_file.
2139 (_cpp_stack_file): Add "loc" param. Pass it to should_stack_file.
2140 (_cpp_stack_include): Add "loc" param. Pass it to
2141 _cpp_find_file and _cpp_stack_file.
2142 (open_file_failed): Add "loc" param. Pass it to
2144 (_cpp_fake_include): Add 0 as a source_location in call to
2146 (_cpp_compare_file_date): Likewise.
2147 (cpp_push_include): Likewise for call to _cpp_stack_include.
2148 (cpp_push_default_include): Likewise.
2149 (_cpp_save_file_entries): Likewise for call to open_file_failed.
2150 (_cpp_has_header): Likewise for call to _cpp_find_file.
2151 * include/cpplib.h (cpp_errno_filename): Add source_location
2153 (cpp_error_at): New declaration.
2154 * init.c (cpp_read_main_file): Add 0 as a source_location in calls
2155 to _cpp_find_file and _cpp_stack_file.
2156 * internal.h (_cpp_find_file): Add source_location param.
2157 (_cpp_stack_file): Likewise.
2158 (_cpp_stack_include): Likewise.
2160 2016-06-22 David Malcolm <dmalcolm@redhat.com>
2162 * include/line-map.h (fixit_hint::get_start_loc): New pure virtual
2164 (fixit_hint::maybe_get_end_loc): Likewise.
2165 (fixit_insert::get_start_loc): New function, implementing
2166 fixit_hint::get_start_loc.
2167 (fixit_insert::maybe_get_end_loc): New function, implementing
2168 fixit_hint::maybe_get_end_loc.
2169 (fixit_remove::get_start_loc): New function, implementing
2170 fixit_hint::get_start_loc.
2171 (fixit_remove::maybe_get_end_loc): New function, implementing
2172 fixit_hint::maybe_get_end_loc.
2173 (fixit_replace::get_start_loc): New function, implementing
2174 fixit_hint::get_start_loc.
2175 (fixit_replace::maybe_get_end_loc): New function, implementing
2176 fixit_hint::maybe_get_end_loc.
2178 2016-06-21 John David Anglin <danglin@gcc.gnu.org>
2180 * line-map.c (location_adhoc_data_update): Use int64_t instead of
2182 (get_combined_adhoc_loc): Likewise.
2184 2016-06-01 Eduard Sanou <dhole@openmailbox.org>
2186 * include/cpplib.h (cpp_callbacks): Add get_source_date_epoch
2188 * include/cpplib.h (cpp_init_source_date_epoch): Remove prototype.
2189 * init.c (cpp_init_source_date_epoch): Remove function.
2190 * init.c (cpp_create_reader): Initialize pfile->source_date_epoch.
2191 * internal.h (cpp_reader): Extend comment about source_date_epoch.
2192 * macro.c (_cpp_builtin_macro_text): Use get_source_date_epoch
2193 callback only once, read pfile->source_date_epoch on future passes.
2194 Check that get_source_date_epoch callback is not NULL.
2196 2016-05-20 Martin Liska <mliska@suse.cz>
2198 * config.in: Regenerated.
2199 * configure: Likewise.
2200 * configure.ac: Handle --enable-valgrind-annotations.
2201 * lex.c (new_buff): Use ENABLE_VALGRIND_ANNOTATIONS instead
2202 of ENABLE_VALGRIND_CHECKING.
2203 (_cpp_free_buff): Likewise.
2205 2016-04-28 Eduard Sanou <dhole@openmailbox.org>
2206 Matthias Klose <doko@debian.org>
2208 * include/cpplib.h (cpp_init_source_date_epoch): Prototype.
2209 * init.c (cpp_init_source_date_epoch): New function.
2210 * internal.h: Added source_date_epoch variable to struct
2211 cpp_reader to store a reproducible date.
2212 * macro.c (_cpp_builtin_macro_text): Set pfile->date timestamp from
2213 pfile->source_date_epoch instead of localtime if source_date_epoch is
2214 set, to be used for __DATE__ and __TIME__ macros to help reproducible
2217 2016-04-13 Bernd Schmidt <bschmidt@redhat.com>
2219 Patch from Roger Orr <rogero@howzatt.demon.co.uk>
2220 PR preprocessor/69650
2221 * directives.c (do_linemarker): Reread map after calling
2224 2016-04-06 Richard Henderson <rth@redhat.com>
2226 PR preprocessor/61817
2227 PR preprocessor/69391
2228 * internal.h (_cpp_builtin_macro_text): Update decl.
2229 * macro.c (_cpp_builtin_macro_text): Accept location for __LINE__.
2230 (builtin_macro): Accept a second location for __LINE__.
2231 (enter_macro_context): Compute both virtual and real expansion
2232 locations for the macro.
2234 2016-03-25 Bernd Schmidt <bschmidt@redhat.com>
2237 * directives.c (do_linemarker): Test for file left but not entered
2239 * line-map.c (linemap_add): Not here.
2241 2016-03-21 Jakub Jelinek <jakub@redhat.com>
2244 * include/cpplib.h (cpp_fun_like_macro_p): New prototype.
2245 * macro.c (cpp_fun_like_macro_p): New function.
2247 2016-03-15 Richard Henderson <rth@redhat.com>
2249 * line-map.c (new_linemap): Make alloc_size a size_t.
2251 2016-03-14 Jason Merrill <jason@redhat.com>
2253 * expr.c (cpp_classify_number): Hex floats are new in C++1z.
2254 * init.c (lang_defaults): Likewise.
2256 2016-03-09 David Malcolm <dmalcolm@redhat.com>
2260 * line-map.c (linemap_macro_map_loc_unwind_toward_spelling): Move
2262 * include/line-map.h
2263 (linemap_macro_map_loc_unwind_toward_spelling): ...here,
2264 converting from static to extern.
2266 2016-03-09 David Malcolm <dmalcolm@redhat.com>
2270 * include/line-map.h (source_range::debug): Delete.
2271 (struct location_range): Update comment. Replace
2272 expanded_location fields "m_start", "m_finish", and "m_caret" with
2273 a source_location field: "m_loc".
2274 (class rich_location): Reword comment.
2275 (rich_location::get_loc): Reimplement in terms of a new overloaded
2276 variant which takes an unsigned int.
2277 (rich_location::get_loc_addr): Delete.
2278 (rich_location::add_range): Drop params "start" and "finish" in
2279 favor of param "loc". Drop overloaded variants taking a
2280 source_range or location_range *.
2281 (rich_location::lazily_expand_location): Delete in favor of...
2282 (rich_location::get_expanded_location): New decl.
2283 (rich_location::m_loc): Delete field.
2284 (rich_location::m_column_override): New field.
2285 * line-map.c (rich_location::rich_location): Drop name of
2286 line_maps * param. Update initializations for deletion of field
2287 "m_loc" and addition of field "m_column_override". Reimplement
2288 body as a call to add_range. Delete overloaded variant taking a
2290 (rich_location::get_loc): New function.
2291 (rich_location::lazily_expand_location): Delete in favor of...
2292 (rich_location::get_expanded_location): New function.
2293 (rich_location::override_column): Reimplement.
2294 (rich_location::add_range): Drop params "start" and "finish" in
2295 favor of param "loc". Eliminate location expansion in favor of
2296 simply storing loc. Drop overloaded variants taking a
2297 source_range or location_range *.
2298 (rich_location::set_range): Eliminate location expansion.
2300 2016-02-29 David Malcolm <dmalcolm@redhat.com>
2302 PR preprocessor/69985
2303 (linemap_position_for_loc_and_offset): Rename param from "offset"
2304 to "column_offset". Right-shift the column_offset by m_range_bits
2305 of the pertinent ordinary map whenever offsetting a
2306 source_location. For clarity, offset the column by the column
2307 offset, rather than the other way around.
2309 2016-02-23 David Malcolm <dmalcolm@redhat.com>
2311 PR preprocessor/69126
2312 PR preprocessor/69543
2313 * line-map.c (linemap_compare_locations): At the function top,
2314 replace inlined bodies of get_location_from_adhoc_loc with calls
2315 to get_location_from_adhoc_loc. Add a pair of calls to
2316 get_location_from_adhoc_loc at the bottom of the function, to
2317 avoid meaningless comparisons of ad-hoc and non-ad-hoc locations.
2319 2016-02-08 David Malcolm <dmalcolm@redhat.com>
2321 PR preprocessor/69664
2322 * errors.c (cpp_diagnostic_with_line): Only call
2323 rich_location::override_column if the column is non-zero.
2324 * line-map.c (rich_location::override_column): Update columns
2325 within m_ranges[0]. Add assertions to verify that doing so is
2328 2016-02-05 Jakub Jelinek <jakub@redhat.com>
2331 * charset.c (cpp_interpret_charconst): Clear *PCHARS_SEEN
2332 and *UNSIGNEDP if bailing out early due to errors.
2334 2016-01-28 Jakub Jelinek <jakub@redhat.com>
2337 * files.c (_cpp_find_file): Set file->implicit_preinclude even if
2338 included from file->implicit_preinclude header.
2340 * directives.c (destringize_and_run): Adjust prototype.
2342 2016-01-27 David Malcolm <dmalcolm@redhat.com>
2344 PR preprocessor/69126
2345 * directives.c (destringize_and_run): Add expansion_loc param; use
2346 it when handling unexpanded pragmas to fixup the locations of the
2348 (_cpp_do__Pragma): Add expansion_loc param and use it when calling
2349 destringize_and_run.
2350 * internal.h (_cpp_do__Pragma): Add expansion_loc param.
2351 * macro.c (builtin_macro): Pass expansion location of _Pragma to
2354 2016-01-14 David Malcolm <dmalcolm@redhat.com>
2356 PR preprocessor/69177
2357 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): New
2359 (LINE_MAP_MAX_LOCATION_WITH_COLS): Add note about unit tests
2361 (can_be_stored_compactly_p): Reduce threshold from
2362 LINE_MAP_MAX_LOCATION_WITH_COLS to
2363 LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES.
2364 (get_combined_adhoc_loc): Likewise.
2365 (get_range_from_loc): Likewise.
2366 (linemap_line_start): Ensure that a new ordinary map is created
2367 when transitioning from range-packing being enabled to disabled,
2368 at the LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES threshold. Set
2369 range_bits to 0 for new ordinary maps when beyond this limit.
2370 Prevent the "increase the column bits of a freshly created map"
2371 optimization if the range bits has reduced.
2373 2016-01-08 Jakub Jelinek <jakub@redhat.com>
2376 * files.c (cpp_included_before): If IS_ADHOC_LOC (location), lookup
2377 real location from the line_table.
2379 2016-01-04 Jakub Jelinek <jakub@redhat.com>
2381 Update copyright years.
2383 2015-12-22 David Malcolm <dmalcolm@redhat.com>
2385 * line-map.c (get_combined_adhoc_loc): Remove condition
2386 on locus < RESERVED_LOCATION_COUNT when considering
2387 whether a caret == start == finish location can be
2388 simply stored as the caret location.
2390 2015-12-07 David Malcolm <dmalcolm@redhat.com>
2392 * include/line-map.h (rich_location::set_range): Add line_maps *
2393 param; convert param from source_range to source_location. Drop
2394 "overwrite_loc_p" param.
2395 * line-map.c (rich_location::set_range): Likewise, acting as if
2396 "overwrite_loc_p" were true, and getting range from the location.
2398 2015-11-20 David Malcolm <dmalcolm@redhat.com>
2401 * include/line-map.h (source_range::intersects_line_p): New
2403 (rich_location::~rich_location): New.
2404 (rich_location::add_fixit_insert): New method.
2405 (rich_location::add_fixit_remove): New method.
2406 (rich_location::add_fixit_replace): New method.
2407 (rich_location::get_num_fixit_hints): New accessor.
2408 (rich_location::get_fixit_hint): New accessor.
2409 (rich_location::MAX_FIXIT_HINTS): New constant.
2410 (rich_location::m_num_fixit_hints): New field.
2411 (rich_location::m_fixit_hints): New field.
2412 (class fixit_hint): New class.
2413 (class fixit_insert): New class.
2414 (class fixit_remove): New class.
2415 (class fixit_replace): New class.
2416 * line-map.c (source_range::intersects_line_p): New method.
2417 (rich_location::rich_location): Add initialization of
2418 m_num_fixit_hints to both ctors.
2419 (rich_location::~rich_location): New.
2420 (rich_location::add_fixit_insert): New method.
2421 (rich_location::add_fixit_remove): New method.
2422 (rich_location::add_fixit_replace): New method.
2423 (fixit_insert::fixit_insert): New.
2424 (fixit_insert::~fixit_insert): New.
2425 (fixit_insert::affects_line_p): New.
2426 (fixit_remove::fixit_remove): New.
2427 (fixit_remove::affects_line_p): New.
2428 (fixit_replace::fixit_replace): New.
2429 (fixit_replace::~fixit_replace): New.
2430 (fixit_replace::affects_line_p): New.
2432 2015-11-19 Jakub Jelinek <jakub@redhat.com>
2434 PR preprocessor/60736
2435 * include/cpplib.h (cpp_errno_filename): New prototype.
2436 * errors.c (cpp_errno): Don't handle msgid "" specially, use
2437 _(msgid) instead of msgid as argument to cpp_error.
2438 (cpp_errno_filename): New function.
2439 * files.c (read_file_guts): Use cpp_errno_filename instead of
2441 (open_file_failed): Likewise. Use file->name if file->path is NULL
2444 2015-11-13 David Malcolm <dmalcolm@redhat.com>
2446 * errors.c (cpp_diagnostic): Pass pfile->line_table to
2448 (cpp_diagnostic_with_line): Likewise.
2449 * include/cpplib.h (struct cpp_token): Update comment for src_loc
2450 to indicate that the range of the token is "baked into" the
2452 * include/line-map.h (source_location): Update the descriptive
2453 comment to reflect the packing scheme for short ranges, adding
2454 worked examples of location encoding.
2455 (struct line_map_ordinary): Drop field "column_bits" in favor
2456 of field "m_column_and_range_bits"; add field "m_range_bits".
2457 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
2458 (location_adhoc_data): Add source_range field.
2459 (struct line_maps): Add fields "default_range_bits",
2460 "num_optimized_ranges" and "num_unoptimized_ranges".
2461 (get_combined_adhoc_loc): Add source_range param.
2462 (get_range_from_loc): New declaration.
2463 (pure_location_p): New prototype.
2464 (COMBINE_LOCATION_DATA): Add source_range param.
2465 (SOURCE_LINE): Update for renaming of column_bits.
2466 (SOURCE_COLUMN): Likewise. Shift the column right by the map's
2468 (LAST_SOURCE_LINE_LOCATION): Update for renaming of column_bits.
2469 (linemap_position_for_line_and_column): Add line_maps * params.
2470 (rich_location::rich_location): Likewise.
2471 * lex.c (_cpp_lex_direct): Capture the range of the token, baking
2472 it into token->src_loc via a call to COMBINE_LOCATION_DATA.
2473 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): Reduce from 1U << 17 to
2475 (location_adhoc_data_hash): Add the src_range into
2477 (location_adhoc_data_eq): Require equality of the src_range
2479 (can_be_stored_compactly_p): New function.
2480 (get_combined_adhoc_loc): Add src_range param, and store it,
2481 via a bit-packing scheme for short ranges, otherwise within the
2482 lookaside table. Remove the requirement that data is non-NULL.
2483 (get_range_from_adhoc_loc): New function.
2484 (get_range_from_loc): New function.
2485 (pure_location_p): New function.
2486 (linemap_add): Ensure that start_location has zero for the
2487 range_bits, unless we're past LINE_MAP_MAX_LOCATION_WITH_COLS.
2488 Initialize range_bits to zero. Assert that the start_location
2490 (linemap_line_start): Assert that the
2491 column_and_range_bits >= range_bits.
2492 Update determinination of whether we need to start a new map
2493 using the effective column bits, without the range bits.
2494 Use the set's default_range_bits in new maps, apart from
2495 those with column_bits == 0, which should also have 0 range_bits.
2496 Increase the column bits for new maps by the range bits.
2497 When adding lines to an existing map, use set->highest_line
2498 directly rather than offsetting highest by SOURCE_COLUMN.
2499 Add assertions to sanity-check the return value.
2500 (linemap_position_for_column): Offset to_column by range_bits.
2501 Update set->highest_location if necessary.
2502 (linemap_position_for_line_and_column): Add line_maps * param.
2503 Update the calculation to offset the column by range_bits, and
2504 conditionalize it on being <= LINE_MAP_MAX_LOCATION_WITH_COLS.
2505 Bound it by LINEMAPS_MACRO_LOWEST_LOCATION. Update
2506 set->highest_location if necessary.
2507 (linemap_position_for_loc_and_offset): Handle ad-hoc locations;
2508 pass "set" to linemap_position_for_line_and_column.
2509 (linemap_macro_map_loc_unwind_toward_spelling): Add line_maps
2510 param. Handle ad-hoc locations.
2511 (linemap_location_in_system_header_p): Pass on "set" to call to
2512 linemap_macro_map_loc_unwind_toward_spelling.
2513 (linemap_macro_loc_to_spelling_point): Retain ad-hoc locations.
2514 Pass on "set" to call to
2515 linemap_macro_map_loc_unwind_toward_spelling.
2516 (linemap_resolve_location): Retain ad-hoc locations. Pass on
2517 "set" to call to linemap_macro_map_loc_unwind_toward_spelling.
2518 (linemap_unwind_toward_expansion): Pass on "set" to call to
2519 linemap_macro_map_loc_unwind_toward_spelling.
2520 (linemap_expand_location): Extract the data pointer before
2521 extracting the location.
2522 (rich_location::rich_location): Add line_maps param; use it to
2523 extract the range from the source_location.
2524 * location-example.txt: Regenerate, showing new representation.
2526 2015-11-06 David Malcolm <dmalcolm@redhat.com>
2528 * errors.c (cpp_diagnostic): Update for change in signature
2529 of "error" callback.
2530 (cpp_diagnostic_with_line): Likewise, calling override_column
2531 on the rich_location.
2532 * include/cpplib.h (struct cpp_callbacks): Within "error"
2533 callback, convert param from source_location to rich_location *,
2534 and drop column_override param.
2535 * include/line-map.h (struct source_range): New struct.
2536 (struct location_range): New struct.
2537 (class rich_location): New class.
2538 (linemap_client_expand_location_to_spelling_point): New declaration.
2539 * line-map.c (rich_location::rich_location): New ctors.
2540 (rich_location::lazily_expand_location): New method.
2541 (rich_location::override_column): New method.
2542 (rich_location::add_range): New methods.
2543 (rich_location::set_range): New method.
2545 2015-11-06 David Malcolm <dmalcolm@redhat.com>
2547 * include/line-map.h (struct linemap_stats): Add fields
2548 "adhoc_table_size" and "adhoc_table_entries_used".
2549 * line-map.c (linemap_get_statistics): Populate above fields.
2551 2015-11-04 Mikhail Maltsev <maltsevm@gmail.com>
2553 * config.in: Regenerate.
2554 * configure: Regenerate.
2555 * configure.ac: Remove ENABLE_CHECKING.
2557 2015-11-03 Uros Bizjak <ubizjak@gmail.com>
2559 * lex.c (search_line_sse42): Correctly advance the pointer to an
2562 2015-11-02 David Malcolm <dmalcolm@redhat.com>
2564 * include/line-map.h (source_location): In the table in the
2565 descriptive comment, show UNKNOWN_LOCATION, BUILTINS_LOCATION,
2566 LINE_MAP_MAX_LOCATION_WITH_COLS, LINE_MAP_MAX_SOURCE_LOCATION.
2567 Add notes about ad-hoc values.
2569 2015-10-21 Mikhail Maltsev <maltsevm@gmail.com>
2571 * include/line-map.h: Use CHECKING_P instead of ENABLE_CHECKING.
2573 * macro.c (struct macro_arg_token_iter, set_arg_token,
2574 macro_arg_token_iter_init, macro_arg_token_iter_forward,
2575 macro_arg_token_iter_get_token, macro_arg_token_iter_get_location,
2576 alloc_expanded_arg_mem, _cpp_backup_tokens): Likewise.
2578 * config.in: Regenerate.
2579 * configure: Regenerate.
2580 * configure.ac (CHECKING_P): Define.
2581 * system.h (fancy_abort): Declare.
2583 (gcc_assert): Define. Use CHECKING_P.
2585 2015-10-13 Mikhail Maltsev <maltsevm@gmail.com>
2587 * system.h (CHECKING_P, gcc_checking_assert): Define.
2589 2015-09-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
2592 * line-map.c (linemap_position_for_loc_and_offset): Handle the
2593 case of long lines encoded in multiple maps.
2595 2015-09-07 Marek Polacek <polacek@redhat.com>
2597 * system.h (INTTYPE_MINIMUM): Rewrite to avoid shift warning.
2599 2015-08-06 Yaakov Selkowitz <yselkowi@redhat.com>
2601 * configure: Regenerate.
2603 2015-07-08 Thomas Schwinge <thomas@codesourcery.com>
2605 * include/line-map.h (RESERVED_LOCATION_COUNT): Change type to
2608 2015-07-02 Paolo Carlini <paolo.carlini@oracle.com>
2610 PR preprocessor/53690
2611 * charset.c (_cpp_valid_ucn): Add cppchar_t * parameter and change
2612 return type to bool. Fix encoding of \u0000 and \U00000000 in C++.
2613 (convert_ucn): Adjust call.
2614 * lex.c (forms_identifier_p): Likewise.
2615 * internal.h (_cpp_valid_ucn): Adjust declaration.
2617 2015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
2619 Implement N4197 - Adding u8 character literals
2620 * include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens;
2621 (struct cpp_options): Add utf8_char_literals.
2622 * init.c (struct lang_flags): Add utf8_char_literals;
2623 (struct lang_flags lang_defaults): Add column for utf8_char_literals.
2624 * macro.c (stringify_arg()): Treat CPP_UTF8CHAR token;
2625 * expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()):
2626 Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens;
2627 (cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token;
2628 (eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token.
2629 * lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens.
2630 * charset.c (converter_for_type(), cpp_interpret_charconst()):
2631 Treat CPP_UTF8CHAR token.
2633 2015-06-30 Uros Bizjak <ubizjak@gmail.com>
2635 * lex.c (search_line_sse42) [__GCC_ASM_FLAG_OUTPUTS__]: New main
2636 loop using asm flag outputs.
2638 2015-06-08 Marek Polacek <polacek@redhat.com>
2641 * line-map.c (linemap_position_for_loc_and_offset): Remove
2642 linemap_assert_fails; reverse conditions.
2644 2015-05-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
2646 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER
2647 LINE_MAP_MAX_LOCATION_WITH_COLS,LINE_MAP_MAX_SOURCE_LOCATION):
2649 (linemap_line_start): Use them.
2650 (linemap_position_for_column): Use them.
2652 2015-05-20 David Malcolm <dmalcolm@redhat.com>
2654 * include/line-map.h (MAP_START_LOCATION): Eliminate the non-const
2655 variant, and tweak comment for the const variant.
2656 (ORDINARY_MAP_STARTING_LINE_NUMBER): Drop the non-const variant.
2657 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
2658 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
2659 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
2660 (ORDINARY_MAP_FILE_NAME): Drop the non-const variant.
2661 (MACRO_MAP_MACRO): Likewise.
2662 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
2663 (MACRO_MAP_LOCATIONS): Likewise.
2664 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
2665 * line-map.c (linemap_add): Replace writes through macros with
2666 direct field accesses.
2667 (linemap_enter_macro): Likewise.
2668 (linemap_line_start): Likewise.
2670 2015-05-19 David Malcolm <dmalcolm@redhat.com>
2672 * directives.c (do_line): Strengthen local "map" from
2673 const line_map * to const line_map_ordinary *.
2674 (do_linemarker): Likewise.
2675 (_cpp_do_file_change): Assert that we're not dealing with
2676 a macro map. Introduce local "ord_map" via a call to
2677 linemap_check_ordinary, guarded within the check for
2678 non-NULL. Use it for typesafety.
2679 * files.c (cpp_make_system_header): Strengthen local "map" from
2680 const line_map * to const line_map_ordinary *.
2681 * include/cpplib.h (struct cpp_callbacks): Likewise for second
2682 parameter of "file_change" callback.
2683 * include/line-map.h (struct line_map): Convert from a struct
2684 containing a union to a base class.
2685 (struct line_map_ordinary): Convert to a subclass of line_map.
2686 (struct line_map_macro): Likewise.
2687 (linemap_check_ordinary): Strengthen return type from line_map *
2688 to line_map_ordinary *, and add a const-variant.
2689 (linemap_check_macro): New pair of functions.
2690 (ORDINARY_MAP_STARTING_LINE_NUMBER): Strengthen param from
2691 const line_map * to const line_map_ordinary *, eliminating call
2692 to linemap_check_ordinary. Likewise for the non-const variant.
2693 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
2694 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
2695 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Likewise.
2696 (ORDINARY_MAP_FILE_NAME): Likewise.
2697 (MACRO_MAP_MACRO): Strengthen param from const line_map * to
2698 const line_map_macro *. Likewise for the non-const variant.
2699 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
2700 (MACRO_MAP_LOCATIONS): Likewise.
2701 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
2702 (struct maps_info): Replace with...
2703 (struct maps_info_ordinary):...this and...
2704 (struct maps_info_macro): ...this.
2705 (struct line_maps): Convert fields "info_ordinary" and
2706 "info_macro" to the above new structs.
2707 (LINEMAPS_MAP_INFO): Delete both functions.
2708 (LINEMAPS_MAPS): Likewise.
2709 (LINEMAPS_ALLOCATED): Rewrite both variants to avoid using
2711 (LINEMAPS_USED): Likewise.
2712 (LINEMAPS_CACHE): Likewise.
2713 (LINEMAPS_MAP_AT): Likewise.
2714 (LINEMAPS_ORDINARY_MAPS): Strengthen return type from line_map *
2715 to line_map_ordinary *.
2716 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
2717 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
2718 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
2719 (LINEMAPS_MACRO_MAPS): Strengthen return type from line_map * to
2721 (LINEMAPS_MACRO_MAP_AT): Likewise.
2722 (LINEMAPS_LAST_MACRO_MAP): Likewise.
2723 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
2724 (linemap_map_get_macro_name): Strengthen param from
2725 const line_map * to const line_map_macro *.
2726 (SOURCE_LINE): Strengthen first param from const line_map * to
2727 const line_map_ordinary *, removing call to
2728 linemap_check_ordinary.
2729 (SOURCE_COLUMN): Likewise.
2730 (LAST_SOURCE_LINE_LOCATION): Likewise.
2731 (LAST_SOURCE_LINE): Strengthen first param from const line_map *
2732 to const line_map_ordinary *.
2733 (LAST_SOURCE_COLUMN): Likewise.
2734 (INCLUDED_FROM): Strengthen return type from line_map * to
2735 line_map_ordinary *., and second param from const line_map *
2736 to const line_map_ordinary *, removing call to
2737 linemap_check_ordinary.
2738 (MAIN_FILE_P): Strengthen param from const line_map * to
2739 const line_map_ordinary *, removing call to
2740 linemap_check_ordinary.
2741 (linemap_position_for_line_and_column): Strengthen param from
2742 const line_map * to const line_map_ordinary *.
2743 (LINEMAP_FILE): Strengthen param from const line_map * to
2744 const line_map_ordinary *, removing call to
2745 linemap_check_ordinary.
2746 (LINEMAP_LINE): Likewise.
2747 (LINEMAP_SYSP): Likewise.
2748 (linemap_resolve_location): Strengthen final param from
2749 const line_map ** to const line_map_ordinary **.
2750 * internal.h (CPP_INCREMENT_LINE): Likewise for local "map".
2751 (linemap_enter_macro): Strengthen return type from
2752 const line_map * to const line_map_macro *.
2753 (linemap_add_macro_token): Likewise for first param.
2754 * line-map.c (linemap_check_files_exited): Strengthen local "map"
2755 from const line_map * to const line_map_ordinary *.
2756 (new_linemap): Introduce local "map_size" and use it when
2757 calculating how large the buffer should be. Rewrite based
2758 on change of info_macro and info_ordinary into distinct types.
2759 (linemap_add): Strengthen locals "map" and "from" from line_map *
2760 to line_map_ordinary *.
2761 (linemap_enter_macro): Strengthen return type from
2762 const line_map * to const line_map_macro *, and local "map" from
2763 line_map * to line_map_macro *.
2764 (linemap_add_macro_token): Strengthen param "map" from
2765 const line_map * to const line_map_macro *.
2766 (linemap_line_start): Strengthen local "map" from line_map * to
2767 line_map_ordinary *.
2768 (linemap_position_for_column): Likewise.
2769 (linemap_position_for_line_and_column): Strengthen first param
2770 from const line_map * to const line_map_ordinary *.
2771 (linemap_position_for_loc_and_offset): Strengthen local "map" from
2772 const line_map * to const line_map_ordinary *.
2773 (linemap_ordinary_map_lookup): Likewise for return type and locals
2774 "cached" and "result".
2775 (linemap_macro_map_lookup): Strengthen return type and locals
2776 "cached" and "result" from const line_map * to
2777 const line_map_macro *.
2778 (linemap_macro_map_loc_to_exp_point): Likewise for param "map".
2779 (linemap_macro_map_loc_to_def_point): Likewise.
2780 (linemap_macro_map_loc_unwind_toward_spelling): Likewise.
2781 (linemap_get_expansion_line): Strengthen local "map" from
2782 const line_map * to const line_map_ordinary *.
2783 (linemap_get_expansion_filename): Likewise.
2784 (linemap_map_get_macro_name): Strengthen param from
2785 const line_map * to const line_map_macro *.
2786 (linemap_location_in_system_header_p): Add call to
2787 linemap_check_ordinary in region guarded by
2788 !linemap_macro_expansion_map_p. Introduce local "macro_map" via
2789 linemap_check_macro in other region, using it in place of "map"
2791 (first_map_in_common_1): Add calls to linemap_check_macro.
2792 (trace_include): Strengthen param "map" from const line_map * to
2793 const line_map_ordinary *.
2794 (linemap_macro_loc_to_spelling_point): Strengthen final param from
2795 const line_map ** to const line_map_ordinary **. Replace a
2796 C-style cast with a const_cast, and add calls to
2797 linemap_check_macro and linemap_check_ordinary.
2798 (linemap_macro_loc_to_def_point): Likewise.
2799 (linemap_macro_loc_to_exp_point): Likewise.
2800 (linemap_resolve_location): Strengthen final param from
2801 const line_map ** to const line_map_ordinary **.
2802 (linemap_unwind_toward_expansion): Introduce local "macro_map" via
2803 a checked cast and use it in place of *map.
2804 (linemap_unwind_to_first_non_reserved_loc): Strengthen local
2805 "map1" from const line_map * to const line_map_ordinary *.
2806 (linemap_expand_location): Introduce local "ord_map" via a checked
2807 cast and use it in place of map.
2808 (linemap_dump): Make local "map" const. Strengthen local
2809 "includer_map" from line_map * to const line_map_ordinary *.
2810 Introduce locals "ord_map" and "macro_map" via checked casts and
2811 use them in place of "map" for typesafety.
2812 (linemap_dump_location): Strengthen local "map" from
2813 const line_map * to const line_map_ordinary *.
2814 (linemap_get_file_highest_location): Update for elimination of
2816 (linemap_get_statistics): Strengthen local "cur_map" from
2817 line_map * to const line_map_macro *. Update uses of sizeof to
2818 use the appropriate line_map subclasses.
2819 * macro.c (_cpp_warn_if_unused_macro): Add call to
2820 linemap_check_ordinary.
2821 (builtin_macro): Strengthen local "map" from const line_map * to
2822 const line_map_macro *.
2823 (enter_macro_context): Likewise.
2824 (replace_args): Likewise.
2825 (tokens_buff_put_token_to): Likewise for param "map".
2826 (tokens_buff_add_token): Likewise.
2828 2015-05-13 David Malcolm <dmalcolm@redhat.com>
2830 * include/line-map.h (source_location): Add a reference to
2831 location-example.txt to the descriptive comment.
2832 * location-example.txt: New file.
2834 2015-05-13 David Malcolm <dmalcolm@redhat.com>
2836 * include/line-map.h (MAX_SOURCE_LOCATION): Convert from a macro
2837 to a const source_location.
2838 (RESERVED_LOCATION_COUNT): Likewise.
2839 (linemap_check_ordinary): Convert from a macro to a pair of inline
2840 functions, for const/non-const arguments.
2841 (MAP_START_LOCATION): Likewise.
2842 (ORDINARY_MAP_STARTING_LINE_NUMBER): Likewise.
2843 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
2844 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
2845 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Convert from a macro to a
2846 pair of inline functions, for const/non-const arguments, where the
2848 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): New function.
2849 (ORDINARY_MAP_FILE_NAME): Convert from a macro to a pair of inline
2850 functions, for const/non-const arguments.
2851 (MACRO_MAP_MACRO): Likewise.
2852 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
2853 (MACRO_MAP_LOCATIONS): Likewise.
2854 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
2855 (LINEMAPS_MAP_INFO): Likewise.
2856 (LINEMAPS_MAPS): Likewise.
2857 (LINEMAPS_ALLOCATED): Likewise.
2858 (LINEMAPS_USED): Likewise.
2859 (LINEMAPS_CACHE): Likewise.
2860 (LINEMAPS_ORDINARY_CACHE): Likewise.
2861 (LINEMAPS_MACRO_CACHE): Likewise.
2862 (LINEMAPS_MAP_AT): Convert from a macro to an inline function.
2863 (LINEMAPS_LAST_MAP): Likewise.
2864 (LINEMAPS_LAST_ALLOCATED_MAP): Likewise.
2865 (LINEMAPS_ORDINARY_MAPS): Likewise.
2866 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
2867 (LINEMAPS_ORDINARY_ALLOCATED): Likewise.
2868 (LINEMAPS_ORDINARY_USED): Likewise.
2869 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
2870 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
2871 (LINEMAPS_MACRO_MAPS): Likewise.
2872 (LINEMAPS_MACRO_MAP_AT): Likewise.
2873 (LINEMAPS_MACRO_ALLOCATED): Likewise.
2874 (LINEMAPS_MACRO_USED): Likewise.
2875 (LINEMAPS_MACRO_LOWEST_LOCATION): Likewise.
2876 (LINEMAPS_LAST_MACRO_MAP): Likewise.
2877 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
2878 (IS_ADHOC_LOC): Likewise.
2879 (COMBINE_LOCATION_DATA): Likewise.
2880 (SOURCE_LINE): Likewise.
2881 (SOURCE_COLUMN): Likewise.
2882 (LAST_SOURCE_LINE_LOCATION): Likewise.
2883 (LAST_SOURCE_LINE): Likewise.
2884 (LAST_SOURCE_COLUMN): Likewise.
2885 (LAST_SOURCE_LINE_LOCATION)
2886 (INCLUDED_FROM): Likewise.
2887 (MAIN_FILE_P): Likewise.
2888 (LINEMAP_FILE): Likewise.
2889 (LINEMAP_LINE): Likewise.
2890 (LINEMAP_SYSP): Likewise.
2891 (linemap_location_before_p): Likewise.
2892 * line-map.c (linemap_check_files_exited): Make local "map" const.
2893 (linemap_add): Use SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS.
2894 (linemap_line_start): Likewise.
2896 2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
2898 * aclocal.m4: Regenerated with automake-1.11.6.
2900 2015-05-13 David Malcolm <dmalcolm@redhat.com>
2902 * include/line-map.h (linemap_assert): Move up within the file to
2903 before all of the map accessor macros.
2904 (linemap_assert_fails): Likewise.
2905 (linemap_check_ordinary): Likewise.
2906 (linemap_macro_expansion_map_p): Likewise.
2908 2015-05-12 David Malcolm <dmalcolm@redhat.com>
2910 * directives.c (do_line): Set seen_line_directive on line_table.
2911 (do_linemarker): Likewise.
2912 * include/line-map.h (struct line_maps): Add new field
2913 "seen_line_directive".
2915 2015-05-08 Jason Merrill <jason@redhat.com>
2917 * include/cpplib.h: Add CPP_W_CXX11_COMPAT.
2918 (struct cpp_options): Add cpp_warn_cxx11_compat.
2919 * init.c (cpp_create_reader): Initialize it.
2920 * lex.c (lex_string): Add -Wc++11-compat warning.
2922 2015-05-05 David Malcolm <dmalcolm@redhat.com>
2924 * pch.c (cpp_valid_state): Fix indentation so that it reflects the
2927 2015-05-05 David Malcolm <dmalcolm@redhat.com>
2929 * include/line-map.h: Fix comment at the top of the file.
2930 (source_location): Rewrite and expand the comment for this
2931 typedef, adding an ascii-art table to clarify how source_location
2932 values are allocated.
2933 * line-map.c: Fix comment at the top of the file.
2935 2015-04-09 Richard Biener <rguenther@suse.de>
2938 * files.c (pch_open_file): Allow main and pre-included files
2939 when trying to open a PCH.
2941 2015-04-06 Jakub Jelinek <jakub@redhat.com>
2943 PR preprocessor/61977
2944 * lex.c (cpp_peek_token): If peektok is CPP_EOF, back it up
2945 with all tokens peeked by the current function.
2947 2015-04-02 Jakub Jelinek <jakub@redhat.com>
2949 PR preprocessor/61977
2950 * lex.c (cpp_peek_token): Temporarily clear pfile->cb.line_change.
2952 2015-03-23 Jakub Jelinek <jakub@redhat.com>
2954 PR preprocessor/65238
2955 * internal.h (_cpp_scan_out_logical_line): Add third argument.
2956 * directives.c (prepare_directive_trad): Pass false to it.
2957 * traditional.c (_cpp_read_logical_line_trad,
2958 _cpp_create_trad_definition): Likewise.
2959 (struct fun_macro): Add paramc field.
2960 (fun_like_macro): New function.
2961 (maybe_start_funlike): Handle NODE_BUILTIN macros. Initialize
2962 macro->paramc field.
2963 (save_argument): Use macro->paramc instead of
2964 macro->node->value.macro->paramc.
2965 (push_replacement_text): Formatting fix.
2966 (recursive_macro): Use fun_like_macro helper.
2967 (_cpp_scan_out_logical_line): Likewise. Add BUILTIN_MACRO_ARG
2968 argument. Initialize fmacro.paramc field. Handle builtin
2969 function-like macros.
2971 2015-03-16 Edward Smith-Rowland <3dw4rd@verizon.net>
2974 * lex.c (lex_number): If a number ends with digit-seps (') skip back
2975 and let lex_string take them.
2977 2015-03-02 Markus Trippelsdorf <markus@trippelsdorf.de>
2980 * lex.c (search_line_fast): Silence ubsan errors.
2982 2015-02-03 <dodji@redhat.com>
2984 PR preprocessor/64803
2985 * internal.h (cpp_reader::top_most_macro_node): New data member.
2986 * macro.c (enter_macro_context): Pass the location of the end of
2987 the top-most invocation of the function-like macro, or the
2988 location of the expansion point of the top-most object-like macro.
2989 (cpp_get_token_1): Store the top-most macro node in the new
2990 pfile->top_most_macro_node data member.
2991 (_cpp_pop_context): Clear the new cpp_reader::top_most_macro_node
2994 2015-01-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
2996 * lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON.
2998 2015-01-23 Marek Polacek <polacek@redhat.com>
3001 PR preprocessor/60570
3002 * directives.c (do_elif): Don't evaluate #elif conditionals
3003 when they don't need to be.
3005 2015-01-16 Jakub Jelinek <jakub@redhat.com>
3007 * expr.c (cpp_classify_number): Add N_() around ?: string
3008 literals used in cpp_error_with_line call as format string.
3010 2015-01-05 Jakub Jelinek <jakub@redhat.com>
3012 Update copyright years.
3014 2014-12-19 Jakub Jelinek <jakub@redhat.com>
3016 PR preprocessor/63831
3017 * directives.c (lex_macro_node): Remove __has_attribute__ handling.
3018 * internal.h (struct spec_node): Remove n__has_attribute__ field.
3019 (struct lexer_state): Remove in__has_attribute__ field.
3020 * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_ATTRIBUTE.
3021 * identifiers.c (_cpp_init_hashtable): Remove __has_attribute__
3023 * init.c (builtin_array): Add __has_attribute and __has_cpp_attribute.
3024 (cpp_init_special_builtins): Don't initialize __has_attribute
3025 or __has_cpp_attribute if CLK_ASM or pfile->cb.has_attribute is NULL.
3026 * traditional.c (enum ls): Remove ls_has_attribute,
3027 ls_has_attribute_close.
3028 (_cpp_scan_out_logical_line): Remove __has_attribute__ handling.
3029 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_ATTRIBUTE.
3030 * pch.c (cpp_read_state): Remove __has_attribute__ handling.
3031 * expr.c (eval_token): Likewise.
3032 (parse_has_attribute): Removed.
3034 2014-12-11 Uros Bizjak <ubizjak@gmail.com>
3036 * directives.c (cpp_define_formatted): Use xvasprintf.
3038 2014-12-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
3040 * line-map.c (linemap_position_for_loc_and_offset): Add new
3041 linemap_assert_fails.
3043 2014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
3045 * include/line-map.h (linemap_assert_fails): Declare.
3046 * line-map.c (linemap_position_for_loc_and_offset): Use it.
3048 2014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
3050 * line-map.c (linemap_add): Fix typo.
3051 (linemap_line_start): Fix whitespace.
3053 2014-11-29 John Schmerge <jbschmerge@gmail.com>
3055 PR preprocessor/41698
3056 * charset.c (one_utf8_to_utf16): Do not produce surrogate pairs
3059 2014-11-25 Jakub Jelinek <jakub@redhat.com>
3061 PR preprocessor/60436
3062 * line-map.c (linemap_line_start): If highest is above 0x60000000
3063 and we are still tracking columns or highest is above 0x70000000,
3066 2014-11-20 Uros Bizjak <ubizjak@gmail.com>
3069 * lex.c [__i386__ || __x86_64__]: Compile special SSE functions
3070 only for (__GNUC__ >= 5 || !defined(__PIC__)).
3072 2014-11-13 Manuel López-Ibáñez <manu@gcc.gnu.org>
3074 * include/line-map.h: Include EXPR, so that unused variable warnings
3077 2014-11-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
3080 * include/line-map.h (linemap_position_for_loc_and_offset):
3082 * line-map.c (linemap_position_for_loc_and_offset): New.
3084 2014-11-11 David Malcolm <dmalcolm@redhat.com>
3086 * ChangeLog.jit: New.
3088 2014-11-10 Edward Smith-Rowland <3dw4rd@verizon.net>
3090 * include/cpplib.h (cpp_callbacks): Add has_attribute.
3091 * internal.h (lexer_state): Add in__has_attribute__.
3092 * directives.c (lex_macro_node): Prevent use of __has_attribute__
3094 * expr.c (parse_has_attribute): New function; (eval_token): Look for
3095 __has_attribute__ and route to parse_has_attribute.
3096 * identifiers.c (_cpp_init_hashtable): Initialize n__has_attribute__.
3097 * pch.c (cpp_read_state): Initialize n__has_attribute__.
3098 * traditional.c (enum ls): Add ls_has_attribute, ls_has_attribute_close;
3099 (_cpp_scan_out_logical_line): Attend to __has_attribute__.
3101 2014-11-06 Joseph Myers <joseph@codesourcery.com>
3103 * include/cpp-id-data.h (struct cpp_macro): Update comment
3104 regarding parameters.
3105 * include/cpplib.h (struct cpp_macro_arg, struct cpp_identifier):
3106 Add spelling fields.
3107 (struct cpp_token): Update comment on macro_arg.
3108 * internal.h (_cpp_save_parameter): Add extra argument.
3109 (_cpp_spell_ident_ucns): New declaration.
3110 * lex.c (lex_identifier): Add SPELLING argument. Set *SPELLING to
3111 original spelling of identifier.
3112 (_cpp_lex_direct): Update calls to lex_identifier.
3113 (_cpp_spell_ident_ucns): New function, factored out of
3115 (cpp_spell_token): Adjust FORSTRING argument semantics to return
3116 original spelling of identifiers. Use _cpp_spell_ident_ucns in
3118 (_cpp_equiv_tokens): Check spellings of identifiers and macro
3119 arguments are identical.
3120 * macro.c (macro_arg_saved_data): New structure.
3121 (paste_tokens): Use original spellings of identifiers from
3123 (_cpp_save_parameter): Add argument SPELLING. Save both canonical
3125 (parse_params): Update calls to _cpp_save_parameter.
3126 (lex_expansion_token): Save spelling of macro argument tokens.
3127 (_cpp_create_definition): Extract canonical node from saved data.
3128 (cpp_macro_definition): Use UCNs in spelling of macro name. Use
3129 original spellings of macro argument tokens and identifiers.
3130 * traditional.c (scan_parameters): Update call to
3131 _cpp_save_parameter.
3133 2014-11-05 Joseph Myers <joseph@codesourcery.com>
3135 PR preprocessor/9449
3136 * init.c (lang_defaults): Enable extended identifiers for C++ and
3137 C99-based standards.
3139 2014-10-22 Alan Modra <amodra@gmail.com>
3141 * symtab.c (ht_create): Use obstack_specify_allocation in place of
3143 * files.c (_cpp_init_files): Likewise.
3144 * init.c (cpp_create_reader): Likewise.
3145 * identifiers.c (_cpp_init_hashtable): Likewise.
3147 2014-10-14 Manuel López-Ibáñez <manu@gcc.gnu.org>
3149 * include/line-map.h (linemap_location_from_macro_expansion_p):
3150 const struct line_maps * argument.
3151 (linemap_position_for_line_and_column): const struct line_map *
3153 * line-map.c (linemap_add_macro_token): Use correct argument name
3155 (linemap_position_for_line_and_column): const struct line_map *
3157 (linemap_macro_map_loc_to_def_point): Fix comment. Make static.
3158 (linemap_location_from_macro_expansion_p): const struct line_maps *
3160 (linemap_resolve_location): Fix argument names in comment.
3162 2014-10-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
3164 * lex.c (search_line_fast): Add new version to be used for Power8
3165 and later targets when Altivec is enabled. Restrict the existing
3166 Altivec version to big-endian systems so that lvsr is not used on
3167 little endian, where it is deprecated. Remove LE-specific code
3168 from the now-BE-only version.
3170 2014-10-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
3171 Jeff Law <law@redhat.com>
3173 * charset.c (convert_no_conversion): Reallocate memory with 25%
3176 2014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net>
3178 Implement SD-6: SG10 Feature Test Recommendations
3179 * internal.h (lexer_state, spec_nodes): Add in__has_include__.
3180 * directives.c: Support __has_include__ builtin.
3181 * expr.c (parse_has_include): New function to parse __has_include__
3182 builtin; (eval_token()): Use it.
3183 * files.c (_cpp_has_header()): New funtion to look for header;
3184 (open_file_failed()): Not an error to not find a header file for
3186 * identifiers.c (_cpp_init_hashtable()): Add entry for __has_include__.
3187 * pch.c (cpp_read_state): Lookup __has_include__.
3188 * traditional.c (enum ls, _cpp_scan_out_logical_line()): Walk through
3189 __has_include__ statements.
3191 2014-09-30 Bernd Edlinger <bernd.edlinger@hotmail.de>
3193 PR preprocessor/58893
3194 * errors.c (cpp_diagnostic): Fix possible out of bounds access.
3195 * files.c (_cpp_stack_include): Initialize src_loc for IT_CMDLINE.
3197 2014-09-24 Marek Polacek <polacek@redhat.com>
3201 * include/cpplib.h (enum cpp_ttype): Define CPP_KEYWORD.
3203 2014-09-17 Jan Hubicka <hubicka@ucw.cz>
3205 * charset.c (conversion): Rename to ...
3206 (cpp_conversion): ... this one; update.
3207 * files.c (file_hash_entry): Rename to ...
3208 (cpp_file_hash_entry): ... this one ; update.
3210 2014-09-17 Marek Polacek <polacek@redhat.com>
3213 * init.c (struct lang_flags): Remove cplusplus_comments.
3214 (cpp_set_lang): Likewise.
3215 (post_options): Likewise.
3216 * lex.c (_cpp_lex_direct): Disallow C++ style comments in C90/C94.
3218 2014-09-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
3220 * include/cpplib.h (struct cpp_options): Declare warn_normalize as
3221 int instead of enum.
3223 2014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
3225 * macro.c (replace_args): Use cpp_pedwarning, cpp_warning and
3227 * include/cpplib.h: Add CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC.
3228 * init.c (cpp_create_reader): Do not init to -1 here.
3229 * expr.c (num_binary_op): Use cpp_pedwarning.
3231 2014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
3233 * directives.c (check_eol_1): New.
3234 (check_eol_endif_labels): New.
3235 (check_eol): Call check_eol_1.
3236 (do_else,do_endif): Call check_eol_endif_labels.
3238 2014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
3240 * macro.c (warn_of_redefinition): Suppress warnings for builtins
3241 that lack the NODE_WARN flag, unless Wbuiltin-macro-redefined.
3242 (_cpp_create_definition): Use Wbuiltin-macro-redefined for
3243 builtins that lack the NODE_WARN flag.
3244 * directives.c (do_undef): Likewise.
3245 * init.c (cpp_init_special_builtins): Do not change flags
3246 depending on Wbuiltin-macro-redefined.
3248 2014-08-28 Edward Smith-Rowland <3dw4rd@verizon.net>
3250 PR cpp/23827 - standard C++ should not have hex float preprocessor
3252 * libcpp/init.c (lang_flags): Change CXX98 flag for extended numbers
3254 * libcpp/expr.c (cpp_classify_number): Weite error message for improper
3255 use of hex floating literal.
3257 2014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
3259 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z;
3260 Rename CLK_GNUCXX1Y, CLK_CXX1Y to CLK_GNUCXX14, CLK_CXX14;
3261 * init.c (struct lang_flags lang_defaults): Add column for trigraphs;
3262 Add rows for CLK_GNUCXX1Z, CLK_CXX1Z; (cpp_set_lang): Set trigraphs;
3263 (cpp_init_builtins): Set __cplusplus to 201402L for C++14;
3264 Set __cplusplus to 201500L for C++17.
3265 * expr.c (cpp_classify_number): Change C++1y to C++14 in binary
3266 constants error message.
3268 2014-08-20 Marek Polacek <polacek@redhat.com>
3270 * include/cpplib.h (cpp_options): Use signed char.
3271 * lex.c (_cpp_lex_direct): Don't warn in C++ mode.
3273 2014-08-19 Marek Polacek <polacek@redhat.com>
3275 * lex.c (_cpp_lex_direct): Fix a typo.
3277 2014-08-19 Marek Polacek <polacek@redhat.com>
3279 * charset.c (_cpp_valid_ucn): Warn only if -Wc90-c99-compat.
3280 * lex.c (_cpp_lex_direct): Likewise.
3281 * macro.c (replace_args): Likewise.
3282 (parse_params): Likewise.
3283 * include/cpplib.h (cpp_options): Change cpp_warn_c90_c99_compat
3286 2014-08-10 Marek Polacek <polacek@redhat.com>
3289 * lex.c (_cpp_lex_direct): Warn when -Wc90-c99-compat is in effect.
3290 * charset.c (_cpp_valid_ucn): Likewise.
3291 * include/cpplib.h (cpp_options): Add cpp_warn_c90_c99_compat.
3292 * macro.c (replace_args): Warn when -Wc90-c99-compat is in effect.
3293 (parse_params): Likewise.
3295 2014-07-27 Marek Polacek <polacek@redhat.com>
3298 * macro.c (builtin_macro): Add location parameter. Set
3299 location of builtin macro to the expansion point.
3300 (enter_macro_context): Pass location to builtin_macro.
3302 2014-07-16 Dodji Seketeli <dodji@redhat.com>
3304 Support location tracking for built-in macro tokens
3305 * include/line-map.h (line_maps::builtin_location): New data
3307 (line_map_init): Add a new parameter to initialize the new
3308 line_maps::builtin_location data member.
3309 * line-map.c (linemap_init): Initialize the
3310 line_maps::builtin_location data member.
3311 * macro.c (builtin_macro): Create a macro map and track the token
3312 resulting from the expansion of a built-in macro.
3314 2014-07-10 Edward Smith-Rowland <3dw4rd@verizon.net>
3315 Jonathan Wakely <jwakely@redhat.com>
3317 PR preprocessor/61389
3318 * macro.c (_cpp_arguments_ok, parse_params, create_iso_definition):
3319 Warning messages mention C++11 in c++ mode and C99 in c mode.
3320 * lex.c (lex_identifier_intern, lex_identifier): Ditto
3322 2014-07-09 Edward Smith-Rowland <3dw4rd@verizon.net>
3324 PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped
3326 * lex.c (lex_raw_string ()): Do not warn about invalid suffix
3327 if skipping. (lex_string ()): Ditto.
3329 2014-06-04 Edward Smith-Rowland <3dw4rd@verizon.net>
3332 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
3333 Combine user-defined escape logic with the other string and char logic.
3335 2014-05-26 Richard Biener <rguenther@suse.de>
3337 * configure.ac: Remove long long and __int64 type checks,
3338 add check for uint64_t and fail if that wasn't found.
3339 * include/cpplib.h (cpp_num_part): Use uint64_t.
3340 * config.in: Regenerate.
3341 * configure: Likewise.
3343 2014-05-21 Marek Polacek <polacek@redhat.com>
3346 * files.c (find_file_in_dir): Add parens around &&.
3348 2014-05-20 Edward Smith-Rowland <3dw4rd@verizon.net>
3351 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
3352 Check for user-defined literal strings and user-defined literal chars
3353 to escape necessary characters.
3355 2014-05-20 Richard Biener <rguenther@suse.de>
3357 * configure.ac: Copy gcc logic of detecting a 64bit type.
3358 Remove HOST_WIDE_INT define.
3359 * include/cpplib.h: typedef cpp_num_part to a 64bit type,
3360 similar to how hwint.h does it.
3361 * config.in: Regenerate.
3362 * configure: Likewise.
3364 2014-05-09 Joey Ye <joey.ye@arm.com>
3366 * files.c (find_file_in_dir): Always try to shorten for DOS
3368 * init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS.
3370 2014-05-07 Richard Biener <rguenther@suse.de>
3372 * configure.ac: Always set need_64bit_hwint to yes.
3373 * configure: Regenerated.
3375 2014-04-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3377 * lex.c: Remove Solaris 9 reference.
3379 2014-02-24 Walter Lee <walt@tilera.com>
3381 * configure.ac: Change "tilepro" triplet to "tilepro*".
3382 * configure: Regenerate.
3384 2014-02-19 Jakub Jelinek <jakub@redhat.com>
3386 PR preprocessor/58844
3387 * macro.c (enter_macro_context): Only push
3388 macro_real_token_count (macro) tokens rather than
3389 macro->count tokens, regardless of
3390 CPP_OPTION (pfile, track-macro-expansion).
3392 2014-02-07 Jakub Jelinek <jakub@redhat.com>
3394 PR preprocessor/56824
3395 * line-map.c (get_combined_adhoc_loc, linemap_get_expansion_line,
3396 linemap_get_expansion_filename, linemap_location_in_system_header_p,
3397 linemap_location_from_macro_expansion_p,
3398 linemap_macro_loc_to_spelling_point, linemap_macro_loc_to_def_point,
3399 linemap_macro_loc_to_exp_point, linemap_expand_location): Fix
3401 (linemap_compare_locations): Look through adhoc locations for both
3404 2014-01-23 Dodji Seketeli <dodji@redhat.com>
3406 PR PR preprocessor/58580
3407 * include/line-map.h (linemap_get_file_highest_location): Declare
3409 * line-map.c (linemap_get_file_highest_location): Define it.
3411 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
3413 Update copyright years
3415 2013-12-09 Joseph Myers <joseph@codesourcery.com>
3417 PR preprocessor/55715
3418 * expr.c (num_binary_op): Implement subtraction directly rather
3419 than with negation and falling through into addition case.
3421 2013-11-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
3423 * lex.c (search_line_fast): Correct for little endian.
3425 2013-11-15 Joseph Myers <joseph@codesourcery.com>
3427 * ucnid.tab: Add C11 and C11NOSTART data.
3428 * makeucnid.c (digit): Rename enum value to N99.
3429 (C11, N11, all_languages): New enum values.
3430 (NUM_CODE_POINTS, MAX_CODE_POINT): New macros.
3431 (flags, decomp, combining_value): Use NUM_CODE_POINTS as array
3433 (decomp): Use unsigned int as element type.
3434 (all_decomp): New array.
3435 (read_ucnid): Handle C11 and C11NOSTART. Use MAX_CODE_POINT.
3436 (read_table): Use MAX_CODE_POINT. Store all decompositions in
3438 (read_derived): Use MAX_CODE_POINT.
3439 (write_table): Use NUM_CODE_POINTS. Print N99, C11 and N11
3440 flags. Print whole array variable declaration rather than just
3442 (char_id_valid, write_context_switch): New functions.
3443 (main): Call write_context_switch.
3444 * ucnid.h: Regenerate.
3445 * include/cpplib.h (struct cpp_options): Add c11_identifiers.
3446 * init.c (struct lang_flags): Add c11_identifiers.
3447 (cpp_set_lang): Set c11_identifiers option from selected language.
3448 * internal.h (struct normalize_state): Document "previous" as
3449 previous starter character.
3450 (NORMALIZE_STATE_UPDATE_IDNUM): Take character as argument.
3451 * charset.c (DIG): Rename enum value to N99.
3452 (C11, N11): New enum values.
3453 (struct ucnrange): Give name to struct. Use short for flags and
3454 unsigned int for end of range. Include ucnid.h for whole variable
3456 (ucn_valid_in_identifier): Allow for characters up to 0x10FFFF.
3457 Allow for C11 in determining valid characters and valid start
3458 characters. Use check_nfc for non-Hangul context-dependent
3459 checks. Only store starter characters in nst->previous.
3460 (_cpp_valid_ucn): Pass new argument to
3461 NORMALIZE_STATE_UPDATE_IDNUM.
3462 * lex.c (lex_identifier): Pass new argument to
3463 NORMALIZE_STATE_UPDATE_IDNUM. Call NORMALIZE_STATE_UPDATE_IDNUM
3464 after initial non-UCN part of identifier.
3465 (lex_number): Pass new argument to NORMALIZE_STATE_UPDATE_IDNUM.
3467 2013-11-15 Joseph Myers <joseph@codesourcery.com>
3469 * ucnid.tab: Mark C99 digits as [C99DIG].
3470 * makeucnid.c (read_ucnid): Handle [C99DIG].
3471 (read_table): Don't check for digit characters.
3472 * ucnid.h: Regenerate.
3474 2013-11-06 Tobias Burnus <burnus@net-b.de>
3476 * macro.c (_cpp_builtin_macro_text): Correct
3477 wording of two warnings.
3479 2013-11-05 Tobias Burnus <burnus@net-b.de>
3481 * include/cpplib.h (CPP_W_DATE_TIME): Added.
3482 (cpp_options): Add warn_date_time.
3483 * init.c (cpp_create_reader): Init it.
3484 * macro.c (_cpp_builtin_macro_text): Warn when
3485 __DATE__/__TIME__/__TIMESTAMP__ is used.
3487 2013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
3489 Implement C++14 digit separators.
3490 * include/cpplib.h (cpp_options): Add digit_separators flag.
3491 * internal.h (DIGIT_SEP(c)): New macro.
3492 * expr.c (cpp_classify_number): Check improper placement of digit sep;
3493 (cpp_interpret_integer): Skip over digit separators.
3494 * init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add
3495 digit separator flags per language; (cpp_set_lang): Set
3497 * lex.c (lex_number): Add digits separator to allowable characters for
3500 2013-10-15 David Malcolm <dmalcolm@redhat.com>
3502 * Makefile.in (PICFLAG): New.
3503 (ALL_CFLAGS): Add PICFLAG.
3504 (ALL_CXXFLAGS): Likewise.
3505 * configure.ac: Add --enable-host-shared, setting up new
3507 * configure: Regenerate.
3509 2013-08-07 Richard Earnshaw <rearnsha@arm.com>
3511 * configure.ac: Set need_64bit_hwint for all arm targets.
3512 * configure: Regenerated.
3514 2013-07-20 Jakub Jelinek <jakub@redhat.com>
3516 PR preprocessor/57620
3517 * lex.c (lex_raw_string): Undo phase1 and phase2 transformations
3518 between R" and final " rather than only in between R"del( and )del".
3520 2013-07-10 Jakub Jelinek <jakub@redhat.com>
3522 PR preprocessor/57824
3523 * lex.c (lex_raw_string): Allow reading new-lines if
3524 in_deferred_pragma or if parsing_args and there is still
3525 data in the current buffer.
3527 * include/cpplib.h (cpp_token_val_index): Change parameter type to
3529 * lex.c (cpp_token_val_index): Likewise.
3531 PR preprocessor/57757
3532 * lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING
3533 or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that
3536 2013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
3538 * lex.c (lex_raw_string(), lex_string()): Constrain suffixes treated
3539 as concatenated literal and macro to just the patterns found in
3540 inttypes.h; (is_macro()): New.
3542 2013-06-24 Dehao Chen <dehao@google.com>
3544 * files.c (_cpp_stack_include): Fix the highest_location when header
3545 file is guarded by #ifndef and is included twice.
3547 2013-04-28 Jakub Jelinek <jakub@redhat.com>
3549 N3472 binary constants
3550 * include/cpplib.h (struct cpp_options): Fix a typo in user_literals
3551 field comment. Add binary_constants field.
3552 * init.c (struct lang_flags): Add binary_constants field.
3553 (lang_defaults): Add bin_cst column to the table.
3554 (cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants).
3555 * expr.c (cpp_classify_number): Talk about C++11 instead of C++0x
3556 in diagnostics. Accept binary constants if
3557 CPP_OPTION (pfile, binary_constants) even when pedantic. Adjust
3560 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
3562 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y.
3563 * init.c (lang_defaults): Add defaults for the latter.
3564 (cpp_init_builtins): Define __cplusplus as 201300L for the latter.
3565 * lex.c (_cpp_lex_direct): Update.
3567 2013-04-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
3570 * configure.ac: Require 64-bit int for arm*-*-rtems*.
3571 * configure: Regenerate.
3573 2013-03-06 Jakub Jelinek <jakub@redhat.com>
3576 * internal.h (struct cpp_buffer): Add to_free field.
3577 (_cpp_pop_file_buffer): Add third argument.
3578 * files.c (_cpp_stack_file): Set buffer->to_free.
3579 (_cpp_pop_file_buffer): Add to_free argument. Free to_free
3580 if non-NULL, and if equal to file->buffer_start, also clear
3581 file->buffer{,_start,_valid}.
3582 * directives.c (_cpp_pop_buffer): Pass buffer->to_free
3583 to _cpp_pop_file_buffer.
3585 2013-03-01 Jakub Jelinek <jakub@redhat.com>
3588 * files.c (_cpp_save_file_entries): Free result at the end.
3589 * pch.c (cpp_string_free): New function.
3590 (cpp_save_state): Use it in htab_create call.
3591 (cpp_write_pch_deps): Free ss->defs. Destroy ss->definedhash.
3593 2013-02-28 Jakub Jelinek <jakub@redhat.com>
3595 * files.c (_cpp_find_file): If returning early, before storing
3596 something to *hash_slot and *hash_slot is NULL, call htab_clear_slot
3597 on it. Access *hash_slot using void * type rather than
3598 struct file_hash_entry * to avoid aliasing issues.
3600 * configure.ac: Don't define ENABLE_CHECKING whenever
3601 --enable-checking is seen, instead use similar --enable-checking=yes
3602 vs. --enable-checking=release default as gcc/ subdir has and
3603 define ENABLE_CHECKING if ENABLE_CHECKING is defined in gcc/.
3604 Define ENABLE_VALGRIND_CHECKING if requested.
3605 * lex.c (new_buff): If ENABLE_VALGRIND_CHECKING, put _cpp_buff
3606 struct first in the allocated buffer and result->base after it.
3607 (_cpp_free_buff): If ENABLE_VALGRIND_CHECKING, free buff itself
3608 instead of buff->base.
3609 * config.in: Regenerated.
3610 * configure: Regenerated.
3612 2013-02-13 Ed Smith-Rowland <3dw4rd@verizon.net>
3615 * lex.c (lex_raw_string): Allow string literal with suffix
3616 beginning with 's' to be parsed as a C++11 user-defined literal.
3618 2013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
3620 Update copyright years.
3622 2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
3624 PR c++/54526 (again)
3625 * lex.c (_cpp_lex_direct): In C++11 mode, implement 2.5 p3, bullet 2.
3627 2013-01-03 Marc Glisse <marc.glisse@inria.fr>
3630 * line-map.c (get_combined_adhoc_loc): Cast from extern "C" type.
3631 (new_linemap): Likewise.
3632 (linemap_enter_macro): Likewise.
3634 2012-12-03 Jakub Jelinek <jakub@redhat.com>
3638 * files.c (read_file_guts): Allocate extra 16 bytes instead of
3639 1 byte at the end of buf. Pass size + 16 instead of size
3640 to _cpp_convert_input.
3641 * charset.c (_cpp_convert_input): Reallocate if there aren't
3642 at least 16 bytes beyond to.len in the buffer. Clear 16 bytes
3643 at to.text + to.len.
3645 2012-11-21 Steve Ellcey <sellcey@mips.com>
3648 * files.c (pch_open_file): Fix check for implicit_preinclude.
3650 2012-11-16 Simon Baldwin <simonb@google.com>
3652 * include/cpplib.h (struct cpp_options): Add canonical_system_headers.
3653 * files.c (find_file_in_dir): Call maybe_shorter_path() only if
3654 canonical_system_headers is set.
3655 * init.c (cpp_create_reader): Initialize canonical_system_headers.
3656 * configure.ac: Add new --enable-canonical-system-headers.
3657 * configure: Regenerate.
3658 * config.in: Regenerate.
3660 2012-11-09 Ed Smith-Rowland <3dw4rd@verizon.net>
3663 * include/cpplib.h (cpp_interpret_float_suffix): Add cpp_reader* arg.
3664 (cpp_interpret_int_suffix): Add cpp_reader* arg.
3665 * init.c (cpp_create_reader): Iitialize new flags.
3666 * expr.c (interpret_float_suffix): Use new flags.
3667 (cpp_interpret_float_suffix): Add cpp_reader* arg.
3668 (interpret_int_suffix): Use new flags.
3669 (cpp_interpret_int_suffix): Add cpp_reader* arg.
3670 (cpp_classify_number): Adjust calls to interpret_x_suffix.
3672 2012-10-23 Ian Bolton <ian.bolton@arm.com>
3673 Jim MacArthur <jim.macarthur@arm.com>
3674 Marcus Shawcroft <marcus.shawcroft@arm.com>
3675 Nigel Stephens <nigel.stephens@arm.com>
3676 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
3677 Richard Earnshaw <rearnsha@arm.com>
3678 Sofiane Naci <sofiane.naci@arm.com>
3679 Stephen Thomas <stephen.thomas@arm.com>
3680 Tejas Belagod <tejas.belagod@arm.com>
3681 Yufeng Zhang <yufeng.zhang@arm.com>
3683 * configure.ac: Enable AArch64.
3684 * configure: Regenerate.
3686 2012-10-23 Joseph Myers <joseph@codesourcery.com>
3688 * files.c (struct _cpp_file): Add implicit_preinclude.
3689 (pch_open_file): Allow a previously opened implicitly included
3691 (_cpp_find_file): Add implicit_preinclude argument. Free file and
3692 do not call open_file_failed if implicit_preinclude. Store
3693 implicit_preinclude value.
3694 (_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date):
3695 Update calls to _cpp_find_file.
3696 (_cpp_stack_include): Handle IT_DEFAULT.
3697 (cpp_push_default_include): New.
3698 * include/cpplib.h (cpp_push_default_include): Declare.
3699 * init.c (cpp_read_main_file): Update call to _cpp_find_file.
3700 * internal.h (enum include_type): Add IT_DEFAULT.
3701 (_cpp_find_file): Update prototype.
3703 2012-10-15 Tobias Burnus <burnus@net-b.de>
3705 * files.c (read_file_guts, _cpp_save_file_entries): Free memory
3707 * lex.c (warn_about_normalization): Ditto.
3708 * mkdeps.c (deps_save): Ditto.
3709 * pch.c (cpp_valid_state): Ditto.
3711 2012-10-04 Florian Weimer <fweimer@redhat.com>
3713 * directives.c (do_pragma_warning_or_error): New.
3714 (do_pragma_warning): New.
3715 (do_pragma_error): New.
3716 (_cpp_init_internal_pragmas): Register new pragmas.
3718 2012-09-25 Dehao Chen <dehao@google.com>
3721 * line-map.c (location_adhoc_data_hash): Fix the hash function.
3723 2012-09-25 Dehao Chen <dehao@google.com>
3726 * include/line-map.h (location_adhoc_data): Move location_adhoc_data
3728 (location_adhoc_data_map): Likewise.
3729 (line_maps): Likewise.
3730 (rebuild_location_adhoc_htab): New Function.
3731 * line-map.c (+rebuild_location_adhoc_htab): new Funcion.
3732 (get_combined_adhoc_loc): Move location_adhoc_data into GC.
3733 (location_adhoc_data_fini): Likewise.
3734 (linemap_init): Likewise.
3735 (location_adhoc_data_init): Remove Function.
3737 2012-09-19 Dehao Chen <dehao@google.com>
3739 * include/line-map.h (MAX_SOURCE_LOCATION): New value.
3740 (location_adhoc_data_fini): New.
3741 (get_combined_adhoc_loc): New.
3742 (get_data_from_adhoc_loc): New.
3743 (get_location_from_adhoc_loc): New.
3744 (location_adhoc_data_map): New.
3745 (COMBINE_LOCATION_DATA): New.
3746 (IS_ADHOC_LOC): New.
3747 (expanded_location): New field.
3748 (line_maps): New field.
3749 * line-map.c (location_adhoc_data): New.
3750 (location_adhoc_data_hash): New.
3751 (location_adhoc_data_eq): New.
3752 (location_adhoc_data_update): New.
3753 (get_combined_adhoc_loc): New.
3754 (get_data_from_adhoc_loc): New.
3755 (get_location_from_adhoc_loc): New.
3756 (location_adhoc_data_init): New.
3757 (location_adhoc_data_fini): New.
3758 (linemap_init): Initialize location_adhoc_data.
3759 (linemap_lookup): Change to use new location.
3760 (linemap_ordinary_map_lookup): Likewise.
3761 (linemap_macro_map_lookup): Likewise.
3762 (linemap_macro_map_loc_to_def_point): Likewise.
3763 (linemap_macro_map_loc_unwind_toward_spel): Likewise.
3764 (linemap_get_expansion_line): Likewise.
3765 (linemap_get_expansion_filename): Likewise.
3766 (linemap_location_in_system_header_p): Likewise.
3767 (linemap_location_from_macro_expansion_p): Likewise.
3768 (linemap_macro_loc_to_spelling_point): Likewise.
3769 (linemap_macro_loc_to_def_point): Likewise.
3770 (linemap_macro_loc_to_exp_point): Likewise.
3771 (linemap_resolve_location): Likewise.
3772 (linemap_unwind_toward_expansion): Likewise.
3773 (linemap_unwind_to_first_non_reserved_loc): Likewise.
3774 (linemap_expand_location): Likewise.
3775 (linemap_dump_location): Likewise.
3776 (linemap_line_start): Likewise.
3778 2012-05-25 Dodji Seketeli <dodji@redhat.com>
3780 PR preprocessor/53469
3781 * directives.c (do_pragma): Use the virtual location for the
3782 pragma token, instead of its spelling location.
3784 2012-08-14 Diego Novillo <dnovillo@google.com>
3786 Merge from cxx-conversion branch. Configury.
3788 * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
3789 * configure.ac: Likewise.
3790 * configure: Regenerate.
3792 2012-08-14 Lawrence Crowl <crowl@google.com>
3794 Merge from cxx-conversion branch. New C++ hash table.
3796 * include/symtab.h (typedef struct ht hash_table): Change the typedef
3797 name to cpp_hash_table. Update all users of the typedef.
3799 2012-07-30 Laurynas Biveinis <laurynas.biveinis@gmail.com>
3801 * include/line-map.h (line_map_macro): Use the "atomic" GTY option
3802 for the macro_locations field.
3804 2011-06-19 Uros Bizjak <ubizjak@gmail.com>
3806 * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
3807 __builtin_ia32_pcmpestri128 instead of asm.
3809 2012-06-04 Dimitrios Apostolou <jimis@gmx.net>
3811 * line-map.c (linemap_enter_macro): Don't zero max_column_hint in
3812 every macro. This improves performance by reducing the number of
3813 reallocations when track-macro-expansion is on.
3815 2012-06-04 Dodji Seketeli <dodji@redhat.com>
3817 PR preprocessor/53463
3818 * line-map.c (linemap_location_in_system_header_p): For built-in
3819 macro tokens, check the first expansion point location that is not
3820 for a token coming from a built-in macro.
3822 2012-05-29 Joseph Myers <joseph@codesourcery.com>
3824 * directives.c: Fix typos.
3825 * include/line-map.h: Fix typos.
3826 * line-map.c: Fix typos.
3827 * macro.c: Fix typos.
3829 2012-05-25 Dodji Seketeli <dodji@redhat.com>
3832 * lex.c (search_line_fast): Avoid unused local typedefs to simulate
3835 2012-05-29 Dodji Seketeli <dodji@redhat.com>
3837 PR preprocessor/53229
3838 * internal.h (cpp_reader::set_invocation_location): Remove.
3839 (cpp_reader::about_to_expand_macro_p): New member flag.
3840 * directives.c (do_pragma): Remove Kludge as
3841 pfile->set_invocation_location is no more.
3842 * macro.c (cpp_get_token_1): Do away with the use of
3843 cpp_reader::set_invocation_location. Just collect the macro
3844 expansion point when we are about to expand the top-most macro.
3845 Do not override cpp_reader::about_to_expand_macro_p.
3846 This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding
3847 properly handle locations of expansion points.
3848 (cpp_get_token_with_location): Adjust, as
3849 cpp_reader::set_invocation_location is no more.
3850 (paste_tokens): Take a virtual location parameter for
3851 the LHS of the pasting operator. Use it in diagnostics. Update
3853 (paste_all_tokens): Tighten the assert. Propagate the location of
3854 the expansion point when no virtual locations are available.
3855 Pass the virtual location to paste_tokens.
3856 (in_macro_expansion_p): New static function.
3857 (enter_macro_context): Set the cpp_reader::about_to_expand_macro_p
3858 flag until we really start expanding the macro.
3860 2012-05-16 Dodji Seketeli <dodji@redhat.com>
3862 PR preprocessor/7263
3863 * include/cpplib.h (cpp_classify_number): Take a location
3865 * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic
3866 macros that take a location parameter.
3867 (cpp_classify_number): Take a (virtual) location parameter. Use
3868 it for diagnostics. Adjust comments.
3869 (eval_token): Take a location parameter. Pass it to
3870 cpp_classify_number and to diagnostic routines.
3871 (_cpp_parse_expr): Use virtual locations of tokens when parsing
3872 expressions. Pass a virtual location to eval_token and to
3873 diagnostic routines.
3875 2012-05-10 Tristan Gingold <gingold@adacore.com>
3877 * expr.c (interpret_float_suffix): Add a guard.
3879 2012-05-02 Dodji Seketeli <dodji@redhat.com>
3881 Properly initialize cpp_context in destringize_and_run
3882 * directives.c (destringize_and_run): Properly initialize the new
3884 * macro.c (_cpp_pop_context): Assert that we shouldn't try to pop
3885 the initial base context, which has the same life time as the
3886 current instance of cpp_file.
3888 2012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
3889 Dodji Seketeli <dodji@seketeli.org>
3892 * libcpp/files.c (maybe_shorter_path): New.
3893 (find_file_in_dir): Use it.
3895 2012-04-30 Dodji Seketeli <dodji@redhat.com>
3897 Switch -ftrack-macro-expansion=2 on by default.
3898 * init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
3899 by default. Add comments.
3901 Strip "<built-in>" loc from displayed expansion context
3902 * include/line-map.h (linemap_unwind_toward_expansion): Fix typo
3904 (linemap_unwind_to_first_non_reserved_loc): Declare new function.
3905 * line-map.c (linemap_unwind_to_first_non_reserved_loc): Define
3908 Fix expansion point loc for macro-like tokens
3909 * macro.c (macro_of_context): New static function.
3910 (_cpp_push_token_context, push_extended_tokens_context): If the
3911 macro argument is NULL, it means we are continuing the expansion
3912 of the current macro, if any. Update comments.
3913 (_cpp_pop_context): Re-enable expansion of the macro only when we
3914 are really out of the context of the current expansion.
3916 Fix token pasting with -ftrack-macro-expansion
3917 * macro.c (paste_all_tokens): Put the token resulting from pasting
3918 into an extended token context with -ftrack-macro-location is in
3921 Fix cpp_sys_macro_p with -ftrack-macro-expansion
3922 * macro.c (cpp_sys_macro_p): Support -ftrack-macro-expansion.
3924 2012-04-29 Dodji Seketeli <dodji@redhat.com>
3926 * lex.c (lex_raw_string): Change C++ style comments into C style
3928 (lex_string): Likewise.
3930 2012-04-27 Ollie Wild <aaw@google.com>
3932 * include/cpplib.h (struct cpp_options): Add new field,
3933 warn_literal_suffix.
3934 (CPP_W_LITERAL_SUFFIX): New enum.
3935 * init.c (cpp_create_reader): Default initialization of
3936 warn_literal_suffix.
3937 * lex.c (lex_raw_string): Treat user-defined literals which don't
3938 begin with '_' as separate tokens and produce a warning.
3939 (lex_string): Ditto.
3941 2012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
3943 * line-map.c (linemap_resolve_location): Synchronize comments with
3944 those in line-map.h.
3945 * include/line-map.h (linemap_resolve_location): Fix spelling in
3948 2012-03-22 Richard Earnshaw <rearnsha@arm.com>
3950 * lex.c (search_line_fast): Provide Neon-optimized version for ARM.
3952 2012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3954 * lex.c: Remove Solaris 8 reference.
3956 2012-02-14 Walter Lee <walt@tilera.com>
3958 * configure.ac: Require 64-bit hwint for tilegx and tilepro.
3959 * configure: Regenerate.
3961 2012-01-09 Richard Guenther <rguenther@suse.de>
3963 * macro.c (_cpp_builtin_macro_text): Remove unused variable map.
3965 2012-01-09 Gary Funck <gary@intrepid.com>
3967 PR preprocessor/33919
3968 * files.c (_cpp_get_file_name): New. Implement file name
3970 * internal.h (_cpp_get_file_name): New prototype.
3971 * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
3972 to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
3974 2012-01-03 Olivier Hainque <hainque@adacore.com>
3976 * system.h: Prior to #define, #undef fopen and freopen unconditionally.
3978 2011-12-20 Joseph Myers <joseph@codesourcery.com>
3980 * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
3981 (CLK_STDC1X): Change to CLK_STDC11.
3982 * init.c (lang_defaults): Update comments.
3983 (cpp_init_builtins): Update language tests. Use 201112L for C11
3986 2011-12-20 Andreas Schwab <schwab@linux-m68k.org>
3988 * configure: Regenerate.
3990 2011-12-19 Andreas Schwab <schwab@linux-m68k.org>
3992 * configure: Regenerate.
3994 2011-12-07 Jakub Jelinek <jakub@redhat.com>
3997 * internal.h (_cpp_init_lexer): New prototype.
3998 * init.c (init_library): Call it.
3999 * lex.c (init_vectorized_lexer): Remove constructor attribute,
4001 (HAVE_init_vectorized_lexer): Define.
4002 (_cpp_init_lexer): New function.
4004 2011-12-03 Dodji Seketeli <dodji@redhat.com>
4006 * macro.c (tokens_buff_remove_last_token)
4007 (tokens_buff_put_token_to): Add an 'inline' function specifier to
4010 2011-11-22 Diego Novillo <dnovillo@google.com>
4012 * include/line-map.h (linemap_dump): Declare.
4013 (line_table_dump): Declare.
4014 * line-map.c (linemap_dump): New.
4015 (line_table_dump): New.
4017 2011-11-21 Ed Smith-Rowland <3dw4rd@verizon.net>
4020 * expr.c (cpp_userdef_char_remove_type): Fix typo.
4022 2011-11-03 Michael Matz <matz@suse.de>
4025 * configure.ac: Check for -fno-exceptions -fno-rtti.
4026 * configure: Regenerate.
4027 * Makefile.in (NOEXCEPTION_FLAGS): New flag.
4028 (ALL_CXXFLAGS): Use it.
4030 2011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
4032 * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
4034 2011-11-02 Jason Merrill <jason@redhat.com>
4037 * configure.ac: Add -Wno-narrowing to warning options.
4039 2011-10-31 Jason Merrill <jason@redhat.com>
4042 * init.c (cpp_init_builtins): Set __cplusplus for C++11.
4045 * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
4046 CLK_GNUCXX0X to CLK_GNUCXX11.
4048 2011-10-26 Ed Smith-Rowland <3dw4rd@verizon.net>
4050 Implement C++11 user-defined literals.
4051 * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
4052 cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
4053 cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
4054 cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
4055 (cpp_classify_number): Classify unrecognized tokens as user-defined
4057 * include/cpplib.h: Add new tokens for user-defined literals.
4058 * init.c: Add new preprocessor flag (cxx11).
4059 * lex.c: (lex_string, lex_raw_string): Handle user-defined literals
4060 including concatenation and promotion with suffixes.
4062 2011-10-24 Dodji Seketeli <dodji@redhat.com>
4064 * line-map.c (linemap_macro_map_lookup): Fix logic.
4066 2011-10-24 Dodji Seketeli <dodji@redhat.com>
4068 * include/line-map.h (linemap_expand_location): Take a line table
4069 parameter. Update comment.
4070 (linemap_resolve_location): Update comment.
4071 (linemap_expand_location_full): Remove.
4072 * line-map.c (linemap_resolve_location): Handle reserved
4073 locations; return a NULL map in those cases.
4074 (linemap_expand_location): If location is reserved, return a
4075 zeroed expanded location. Update comment. Take a line table to
4076 assert that the function takes non-virtual locations only.
4077 (linemap_expand_location_full): remove.
4078 (linemap_dump_location): Handle the fact that
4079 linemap_resolve_location can return NULL line maps when the
4080 location resolves to a reserved location.
4082 * line-map.c (linemap_macro_map_lookup): Fix logic.
4084 2011-10-22 Dodji Seketeli <dodji@redhat.com>
4087 * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
4088 context to act upon.
4089 * lex.c (_cpp_remaining_tokens_num_in_context): Likewise. Update
4091 (cpp_token_from_context_at): Likewise.
4092 (cpp_peek_token): Use the context to peek tokens from.
4094 2011-10-20 Dodji Seketeli <dodji@redhat.com>
4097 * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
4100 2011-10-18 Dodji Seketeli <dodji@redhat.com>
4103 * include/line-map.h (struct linemap_stats): Change the type of
4104 the members from size_t to long.
4105 * macro.c (macro_arg_token_iter_init): Unconditionally initialize
4108 2011-10-17 Dodji Seketeli <dodji@redhat.com>
4110 * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
4111 variable without using it if ENABLE_CHECKING is not defined. Mark
4112 the LOCATION parameter as being unused.
4114 2011-10-15 Tom Tromey <tromey@redhat.com>
4115 Dodji Seketeli <dodji@redhat.com>
4117 * include/line-map.h (struct line_maps::alloced_size_for_request):
4119 * line-map.c (new_linemap): Use set->alloced_size_for_request to
4120 get the actual allocated size of line maps.
4122 2011-10-15 Tom Tromey <tromey@redhat.com>
4123 Dodji Seketeli <dodji@redhat.com>
4125 * line-map.h (struct linemap_stats): Declare new struct.
4126 (linemap_get_statistics): Declare ...
4127 * line-map.c (linemap_get_statistics): ... new function.
4128 * macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
4129 Declare new counters.
4130 (enter_macro_context, replace_args): Update
4131 num_macro_tokens_counter.
4132 (cpp_get_token_1): Update num_expanded_macros_counter.
4134 2011-10-15 Tom Tromey <tromey@redhat.com>
4135 Dodji Seketeli <dodji@redhat.com>
4137 * include/cpplib.h (struct cpp_options)<debug>: New struct member.
4138 * include/line-map.h (linemap_dump_location): Declare ...
4139 * line-map.c (linemap_dump_location): ... new function.
4141 2011-10-15 Tom Tromey <tromey@redhat.com>
4142 Dodji Seketeli <dodji@redhat.com>
4144 * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
4146 * internal.h (struct macro_context): New struct.
4147 (enum context_tokens_kind): New enum.
4148 (struct cpp_context)<tokens_kind>: New member of type enum
4149 context_tokens_kind.
4150 (struct cpp_context)<macro>: Remove this. Replace it with an enum
4151 of macro and macro_context.
4152 (struct cpp_context)<direct_p>: Remove.
4153 (_cpp_remaining_tokens_num_in_context): Declare new function.
4154 * directives.c (destringize_and_run): Adjust.
4155 * lex.c (_cpp_remaining_tokens_num_in_context)
4156 (_cpp_token_from_context_at): Define new functions
4157 (cpp_peek_token): Use them.
4158 * init.c (cpp_create_reader): Initialize the base context to zero.
4159 (_cpp_token_from_context_at): Define new static function.
4160 (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
4161 _cpp_token_from_context_at.
4162 * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
4164 (enum macro_arg_token_kind): New enum.
4165 (struct macro_arg_token_iter): New struct.
4166 (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
4167 (alloc_expanded_arg_mem, ensure_expanded_arg_room)
4168 (delete_macro_args, set_arg_token, get_arg_token_location)
4169 (arg_token_ptr_at, macro_arg_token_iter_init)
4170 (macro_arg_token_iter_get_token)
4171 (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
4172 (expanded_token_index, tokens_buff_new, tokens_buff_count)
4173 (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
4174 (tokens_buff_add_token, tokens_buff_remove_last_token)
4175 (reached_end_of_context, consume_next_token_from_context): New
4177 (cpp_get_token_1): New static function. Split and extended from
4178 cpp_get_token. Use reached_end_of_context and
4179 consume_next_token_from_context. Unify its return point. Move
4180 the location tweaking from cpp_get_token_with_location in here.
4181 (cpp_get_token): Use cpp_get_token_1
4182 (stringify_arg): Use the new arg_token_at.
4183 (paste_all_tokens): Support tokens coming from extended tokens
4185 (collect_args): Return the number of collected arguments, by
4186 parameter. Store virtual locations of tokens that constitute the
4188 (funlike_invocation_p): Return the number of collected arguments,
4190 (enter_macro_context): Add a parameter for macro expansion point.
4191 Pass it to replace_args and to the "used" cpp callback. Get the
4192 number of function-like macro arguments from funlike_invocation_p,
4193 pass it to the new delete_macro_args to free the memory used by
4194 macro args. When -ftrack-macro-expansion is in effect, for macros
4195 that have no arguments, create a macro map for the macro expansion
4196 and use it to allocate proper virtual locations for tokens
4197 resulting from the expansion. Push an extended tokens context
4198 containing the tokens resulting from macro expansion and their
4200 (replace_args): Rename the different variables named 'count' into
4201 variables with more meaningful names. Create a macro map;
4202 allocate virtual locations of tokens resulting from this
4203 expansion. Use macro_arg_token_iter to iterate over tokens of a
4204 given macro. Handle the case of the argument of
4205 -ftrack-macro-expansion being < 2. Don't free macro arguments
4206 memory resulting from expand_arg here, as these are freed by the
4207 caller of replace_arg using delete_macro_args now. Push extended
4209 (next_context, push_ptoken_context, _cpp_push_token_context)
4210 (_cpp_push_text_context): Properly initialize the context.
4211 (expand_arg): Use the new alloc_expanded_arg_mem,
4212 push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
4213 (_cpp_pop_context): Really free the memory held by the context.
4214 Handle freeing memory used by extended tokens contexts.
4215 (cpp_get_token_with_location): Use cpp_get_token_1.
4216 (cpp_sys_macro_p): Adjust.
4217 (_cpp_backup_tokens): Support the new kinds of token contexts.
4218 * traditional.c (recursive_macro): Adjust.
4220 2011-10-15 Tom Tromey <tromey@redhat>
4221 Dodji Seketeli <dodji@redhat.com>
4223 * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
4225 (MAX_SOURCE_LOCATION): New constant.
4226 (struct line_map_ordinary, struct line_map_macro): New structs.
4227 (struct line_map): Turn this into a union of the two above. Add
4229 (struct maps_info): New struct.
4230 (struct line_maps)<info_ordinary, info_macro>: Two new fields.
4231 These now carry the map information that was previously scattered
4232 in struct line_maps.
4233 (struct map_info::allocated): Fix comment.
4234 (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
4235 (ORDINARY_MAP_STARTING_LINE_NUMBER)
4236 (ORDINARY_MAP_INCLUDER_FILE_INDEX)
4237 (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
4238 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
4239 (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
4240 (MACRO_MAP_EXPANSION_POINT_LOCATION)
4241 (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
4242 (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
4243 (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
4244 (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
4245 (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
4246 (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
4247 (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
4248 (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
4249 (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
4250 (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
4251 (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
4253 (linemap_check_ordinary, linemap_assert)
4254 (linemap_location_before_p): New macros.
4255 (linemap_position_for_line_and_column)
4256 (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
4257 (linemap_macro_expansion_map_p)
4258 (linemap_macro_map_loc_to_def_point)
4259 (linemap_macro_map_loc_unwind_once)
4260 (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
4261 (linemap_get_source_line linemap_get_source_column)
4262 (linemap_map_get_macro_name, linemap_get_file_path)
4263 (linemap_location_in_system_header_p)
4264 (linemap_location_from_macro_expansion_p): Declare new functions.
4265 (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
4266 (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
4267 accessors act on ordinary maps only.
4268 (INCLUDED_FROM): Return NULL for main files; use the new
4270 (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
4271 (struct expanded_location): Move here from gcc/input.h
4272 (linemap_resolve_location, linemap_expand_location)
4273 (linemap_expand_location_full): Declare new functions.
4274 * line-map.c: Include cpplib.h, internal.h
4275 (linemap_enter_macro, linemap_add_macro_token)
4276 (linemap_get_expansion_line, linemap_get_expansion_filename): New
4277 functions that are private to libcpp.
4278 (linemap_assert): New macro.
4279 (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
4280 (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
4281 (linemap_macro_map_loc_unwind_toward_spelling)
4282 (linemap_macro_map_loc_to_exp_point)
4283 (first_map_in_common_1, first_map_in_common): New static
4285 (new_linemap): Define new static functions. Extracted and
4287 (linemap_add): ... here. Use linemap_assert in lieu of abort
4289 (linemap_tracks_macro_expansion_locs_p)
4290 (linemap_add_macro_token, linemap_macro_expansion_map_p)
4291 (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
4292 (linemap_macro_map_loc_to_def_point)
4293 (linemap_macro_map_loc_unwind_once)
4294 (linemap_step_out_once, linemap_map_get_index)
4295 (linemap_get_source_line,linemap_get_source_column)
4296 (linemap_get_file_path, linemap_map_get_macro_name)
4297 (linemap_location_in_system_header_p)
4298 (linemap_location_originated_from_system_header_p)
4299 (linemap_location_from_macro_expansion_p)
4300 (linemap_tracks_macro_expansion_locs_p)
4301 (linemap_resolve_location, linemap_expand_location)
4302 (linemap_expand_location_full)
4303 (linemap_tracks_macro_expansion_locs_p)
4304 (linemap_position_for_line_and_column, linemap_compare_locations):
4305 Define new public functions.
4306 (linemap_init): Initialize ordinary and macro maps information in
4308 (linemap_check_files_exited): Use the new accessors.
4309 (linemap_free): Remove this dead code.
4310 (linemap_line_start): Assert this uses an ordinary map. Adjust to
4311 use the new ordinary map accessors and data structures. Don't
4312 overflow past the lowest possible macro token's location.
4313 (linemap_position_for_column): Assert the ordinary maps of the map
4314 set are really ordinary. Use ordinary map accessors.
4315 (linemap_lookup): Keep the same logic but generalize to allow
4316 lookup of both ordinary and macro maps. Do not crash when called
4317 with an empty line table.
4318 * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
4319 new API of line-map.h.
4320 * directives.c (start_directive, do_line, do_linemarker)
4321 (do_linemarker): Likewise.
4322 * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
4323 (make_cpp_dir, cpp_make_system_header): Likewise.
4324 * init.c (cpp_read_main_file): Likewise.
4325 * internal.h (CPP_INCREMENT_LINE): Likewise.
4326 (linemap_enter_macro, linemap_add_macro_token)
4327 (linemap_get_expansion_line, linemap_get_expansion_filename): New
4328 functions private to libcpp.
4329 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
4330 (skip_line_comment, skip_whitespace, lex_raw_string)
4331 (_cpp_lex_direct): Likewise.
4332 * macro.c (_cpp_builtin_macro_text): Likewise.
4333 (_cpp_aligned_alloc): Initialize the new name member of the macro.
4334 * traditional.c (copy_comment, _cpp_scan_out_logical_line):
4336 * errors.c (cpp_diagnostic): Adjust to new linemap API.
4338 2011-08-28 Dodji Seketeli <dodji@redhat.com>
4340 * line-map.c (linemap_add): Assert that reason must not be
4341 LC_RENAME when called for the first time on a "main input file".
4343 2011-08-22 Gabriel Charette <gchare@google.com>
4345 * init.c (cpp_create_reader): Inititalize forced_token_location_p.
4346 * internal.h (struct cpp_reader): Add field forced_token_location_p.
4347 * lex.c (_cpp_lex_direct): Use forced_token_location_p.
4348 (cpp_force_token_locations): New.
4349 (cpp_stop_forcing_token_locations): New.
4351 2011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4354 * init.c (cpp_init_builtins): Define __cplusplus 19971L.
4356 2011-08-18 Joseph Myers <joseph@codesourcery.com>
4358 * include/cpplib.h (struct cpp_options): Fix typo.
4360 2011-08-18 Joseph Myers <joseph@codesourcery.com>
4362 * include/cpplib.h (struct cpp_options): Add rliterals.
4363 * init.c (struct lang_flags, lang_defaults): Add rliterals.
4364 (cpp_set_lang): Set rliterals option.
4365 (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
4366 * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
4368 2011-08-15 Gabriel Charette <gchare@google.com>
4370 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
4371 Update all users to use linemap_position_for_column instead.
4373 2011-07-28 Gabriel Charette <gchare@google.com>
4375 * include/line-map.h (struct line_maps):
4376 Remove unused field last_listed. Update all users.
4378 2011-07-28 H.J. Lu <hongjiu.lu@intel.com>
4380 * configure.ac: Set need_64bit_hwint to yes for x86 targets.
4381 * configure: Regenerated.
4383 2011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4385 * system.h [__cplusplus]: Wrap C function declarations in extern "C".
4387 2011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4388 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4391 * configure.ac: Test AM_ICONV with CXX.
4392 * configure: Regenerate.
4393 * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
4395 2011-07-15 Dodji Seketeli <dodji@redhat.com>
4397 * directives.c (struct if_stack): Use source_location as type
4399 * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
4400 indent, def_pragma, used_define, used_undef>: Properly use
4401 source_location as parameter type, rather than unsigned int.
4403 2011-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4406 * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
4407 like i[34567]86-*-solaris2.1[0-9]*.
4408 * configure: Regenerate.
4410 2011-06-16 Jason Merrill <jason@redhat.com>
4413 * lex.c (lex_raw_string): Don't check for embedded NUL.
4415 2011-06-06 Dodji Seketeli <dodji@redhat.com>
4417 PR preprocessor/48532
4418 * directives.c (do_pragma): Don't forget the invocation location
4419 when parsing the pragma name of a namespaced pragma directive.
4421 2011-05-29 John Tytgat <John.Tytgat@aaug.net>
4423 * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
4425 2011-05-22 Uros Bizjak <ubizjak@gmail.com>
4428 * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
4429 is defined. Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
4431 2011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
4433 * system.h (ENUM_BITFIELD): Remove.
4435 2011-04-24 Jakub Jelinek <jakub@redhat.com>
4437 PR preprocessor/48740
4438 * lex.c (lex_raw_string): When raw string ends with
4439 ??) followed by raw prefix and ", ensure it is preprocessed
4440 with ??) rather than ??].
4442 2011-04-20 Jim Meyering <meyering@redhat.com>
4444 * files.c (destroy_cpp_file): Remove useless if-before-free.
4445 * init.c (cpp_destroy): Likewise.
4446 * macro.c (replace_args): Likewise.
4447 * pch.c (cpp_valid_state): Likewise.
4449 2011-03-25 Kai Tietz <ktietz@redhat.com>
4451 * files.c (file_hash_eq): Use filename_cmp
4453 (nonexistent_file_hash_eq): Likewise.
4454 (remap_filename): Likewise.
4455 Handle absolute DOS-path,
4456 (append_file_to_dir): Check for IS_DIR_SEPARATOR
4458 (read_name_map): Likewise.
4459 * linemap.c (linemap_add): Use filename_cmp
4461 * mkdeps.c (apply_vpath): Use filename_ncmp
4463 (deps_restore): Use filename_cmp instead of
4465 * init.c (read_original_directory): Use
4466 IS_DIR_SEPARATOR instead of checking for slash.
4468 2011-03-21 Michael Meissner <meissner@linux.vnet.ibm.com>
4470 PR preprocessor/48192
4471 * directives.c (do_ifdef): Do not consider conditional macros as
4474 * expr.c (parse_defined): Ditto.
4476 2011-03-18 Richard Henderson <rth@redhat.com>
4479 * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
4481 2011-11-04 Eric Botcazou <ebotcazou@adacore.com>
4482 Jakub Jelinek <jakub@redhat.com>
4484 PR preprocessor/39213
4485 * directives.c (end_directive): Call _cpp_remove_overlay for deferred
4486 pragmas as well in traditional mode.
4488 2010-11-17 Ian Lance Taylor <iant@google.com>
4491 * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of
4492 AC_LANG based on ENABLE_BUILD_WITH_CXX.
4494 2010-11-16 Kai Tietz <kai.tietz@onevision.com>
4496 PR preprocessor/17349
4497 * lex.c (save_comment): Handle in argument passing c++
4500 2010-11-02 Ian Lance Taylor <iant@google.com>
4502 * configure.ac: Use AC_SYS_LARGEFILE.
4503 * configure: Rebuild.
4504 * config.in: Rebuild.
4506 2010-10-19 Basile Starynkevitch <basile@starynkevitch.net>
4508 * line-map.h (source_location): Remove obsolete comment
4509 mentioning location_s.
4511 2010-09-29 Kai Tietz <kai.tietz@onevision.com>
4513 PR preprocessor/45362
4514 * directives.c (cpp_pop_definition): Make static.
4515 (do_pragma_push_macro): Reworked to store text
4517 (do_pragma_pop_macro): Add free text definition.
4518 (cpp_push_definition): Removed.
4519 * include/cpplib.h (cpp_push_definition): Removed.
4520 (cpp_pop_definition): Likewise.
4521 * internal.h (def_pragma_macro): Remove member 'value'
4522 and add new members 'definition', 'line',
4523 'syshdr', 'sued' and 'is_undef'.
4524 * pch.c (_cpp_restore_pushed_macros): Rework to work
4525 on text definition and store additional macro flags.
4526 (_cpp_save_pushed_macros): Likewise.
4528 2010-09-29 Joseph Myers <joseph@codesourcery.com>
4530 * include/cpplib.h (cpp_options): Rename warn_deprecated,
4531 warn_traditional, warn_long_long and pedantic.
4532 * directives.c (directive_diagnostics, _cpp_handle_directive):
4533 Update names of cpp_options members.
4534 * expr.c (cpp_classify_number, eval_token): Update names of
4535 cpp_options members.
4536 * init.c (cpp_create_reader, post_options): Update names of
4537 cpp_options members.
4538 * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
4539 cpp_options members.
4540 * macro.c (parse_params): Update names of cpp_options members.
4542 2010-09-15 Ian Lance Taylor <iant@google.com>
4544 * init.c: Fix type name in comment.
4546 2010-08-31 Jakub Jelinek <jakub@redhat.com>
4548 PR preprocessor/45457
4549 * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
4551 * directives.c (do_ifdef, do_ifndef): Likewise.
4553 2010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4555 * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
4557 2010-08-24 Richard Henderson <rth@redhat.com>
4560 * configure.ac (HAVE_SSE4): New check.
4561 * configure, config.in: Rebuild.
4562 * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
4564 2010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4566 * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
4567 etc. on Solaris 2/x86.
4569 2010-08-21 Richard Henderson <rth@redhat.com>
4570 Andi Kleen <ak@linux.intel.com>
4571 David S. Miller <davem@davemloft.net>
4573 * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
4574 (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
4575 (ptrdiff_t): Check via AC_CHECK_TYPE.
4576 * config.in, configure: Rebuild.
4577 * system.h: Include stdint.h, if available.
4578 * lex.c (WORDS_BIGENDIAN): Provide default.
4579 (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
4580 acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
4581 search_line_sse2, search_line_sse42, init_vectorized_lexer,
4582 search_line_fast): New.
4583 (_cpp_clean_line): Use search_line_fast. Restructure the fast
4584 loop to make it clear when we're leaving the loop. Stay in the
4585 fast loop for non-trigraph '?'.
4587 2010-06-11 Jakub Jelinek <jakub@redhat.com>
4589 * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
4591 (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
4592 (cpp_macro_definition): Remove const qual from second argument.
4593 * macro.c (enter_macro_context): Call user_builtin_macro callback for
4594 NODE_BUILTIN !NODE_USED macros.
4595 (warn_of_redefinition): Likewise. Remove const qual from second
4597 (cpp_macro_definition): Likewise.
4598 * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
4599 for NODE_BUILTIN !NODE_USED macros.
4601 2010-06-10 Joseph Myers <joseph@codesourcery.com>
4603 * include/cpplib.h (struct cpp_options): Remove show_column.
4604 * init.c (cpp_create_reader, post_options): Don't set show_column.
4606 2010-06-09 Joern Rennecke <joern.rennecke@embecosm.com>
4609 * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
4610 check that C++ compiler works.
4611 * configure: Regenerate.
4613 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
4615 * include/symtab.h (ht_identifier_ptr): New.
4617 2010-06-03 Joern Rennecke <joern.rennecke@embecosm.com>
4618 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4621 * configure.ac: Check for declaration of 'basename(char *)'.
4622 * configure: Regenerate.
4623 * config.in: Regenerate.
4625 2010-04-25 Joseph Myers <joseph@codesourcery.com>
4627 * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
4628 * init.c (lang_defaults): Add entries for new language variants.
4629 (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
4632 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
4635 * files.c (report_missing_guard): Test for #pragma once.
4637 2010-04-07 Simon Baldwin <simonb@google.com>
4639 * directives.c (do_diagnostic): Add warning reason argument,
4640 call appropriate error reporting function for code.
4641 (directive_diagnostics): Call specific warning functions with
4642 warning reason where appropriate.
4643 (do_error, do_warning, do_pragma_dependency): Add warning reason
4644 argument to do_diagnostic calls.
4645 * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
4646 _cpp_create_definition): Call specific warning functions with
4647 warning reason where appropriate.
4648 * Makefile.in: Add new diagnostic functions to gettext translations.
4649 * include/cpplib.h (struct cpp_callbacks): Add warning reason code
4651 (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
4652 CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
4653 (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
4654 CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
4655 CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
4656 CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
4657 CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
4658 CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
4659 CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
4660 warning reason codes.
4661 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
4662 cpp_warning_with_line, cpp_pedwarning_with_line,
4663 cpp_warning_with_line_syshdr): New specific error reporting functions.
4664 * pch.c (cpp_valid_state): Call specific warning functions with
4665 warning reason where appropriate.
4666 * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
4667 diagnostic handlers.
4668 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
4669 cpp_warning_with_line, cpp_pedwarning_with_line,
4670 cpp_warning_with_line_syshdr): New specific error reporting functions.
4671 * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
4672 specific warning functions with warning reason where appropriate.
4673 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
4674 warn_about_normalization, lex_identifier_intern, lex_identifier,
4675 _cpp_lex_direct): Ditto.
4676 * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
4677 narrow_str_to_charconst): Ditto.
4679 2010-04-06 Jakub Jelinek <jakub@redhat.com>
4681 PR preprocessor/43642
4682 * lex.c (lex_raw_string): Change type of TYPE variable to
4685 2010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4687 * aclocal.m4: Regenerate.
4689 2010-03-29 Jason Merrill <jason@redhat.com>
4691 More N3077 raw string changes
4692 * charset.c (cpp_interpret_string): Don't transform UCNs in raw
4694 * lex.c (bufring_append): Split out from...
4695 (lex_raw_string): ...here. Undo trigraph and line splicing
4696 transformations. Do process line notes in multi-line literals.
4697 (_cpp_process_line_notes): Ignore notes that were already handled.
4699 Some raw string changes from N3077
4700 * charset.c (cpp_interpret_string): Change inner delimiters to ().
4701 * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter.
4703 2010-02-11 Jakub Jelinek <jakub@redhat.com>
4705 * init.c (read_original_filename): Don't call read_original_directory
4706 if _cpp_handle_directive returns 0.
4708 2010-01-01 Joseph Myers <joseph@codesourcery.com>
4710 PR preprocessor/41947
4711 * expr.c (cpp_classify_number): Give error for hexadecimal
4712 floating-point constant with no digits before or after point.
4714 2009-11-20 Arnaud Charlet <charlet@adacore.com>
4716 * macro.c (enter_macro_context): Call cb.used callback if defined.
4717 * directives.c (do_idef, do_ifndef): Ditto.
4718 * include/cpplib.h (struct cpp_callbacks): Add used callback.
4720 2009-11-11 Kai Tietz <kai.tietz@onevision.com>
4722 * directives.c (do_pragma_push_macro): New pragma handler.
4723 (do_pragma_pop_macro): Likewise.
4724 (_cpp_init_internal_pragmas): Add push_macro and
4725 pop_macro handler to internal pragmas.
4726 (lex_macro_node_from_str): Removed.
4727 (cpp_push_definition): Replace lex_macro_node_from_str
4728 by _cpp_lex_identifier.
4729 (cpp_pop_definition): Likewise.
4730 * internal.h (_cpp_lex_identifier): New prototype.
4731 (def_pragma_macro): New structure.
4732 (cpp_reader): New member pushed_macros.
4733 * lex.c (_cpp_lex_identifier): New function.
4734 (lex_identifier_intern): New function.
4735 * init.c (cpp_create_reader): Initialize pushed_macros
4737 (cpp_destroy): Free elements in pushed_macros member.
4738 * pch.c (_cpp_save_pushed_macros): New function.
4739 (_cpp_restore_pushed_macros): Likewise.
4740 (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
4741 (cpp_read_state): Use _cpp_restore_pushed_macros.
4743 2009-10-19 Jakub Jelinek <jakub@redhat.com>
4745 * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
4746 (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
4747 and char32_cset_desc.
4748 (converter_for_type): Handle CPP_UTF8STRING.
4749 (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
4750 * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
4751 (parse_include): Reject raw strings.
4752 * include/cpplib.h (CPP_UTF8STRING): New token type.
4753 * internal.h (struct cpp_reader): Add utf8_cset_desc field.
4754 * lex.c (lex_raw_string): New function.
4755 (lex_string): Handle u8 string literals, call lex_raw_string
4756 for raw string literals.
4757 (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
4759 * macro.c (stringify_arg): Handle CPP_UTF8STRING.
4761 2009-10-14 Jakub Jelinek <jakub@redhat.com>
4763 PR preprocessor/41543
4764 * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
4765 * line-map.c (linemap_init): Initialize highest_location and
4766 highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
4768 2009-10-09 Jason Merrill <jason@redhat.com>
4770 * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
4772 2009-10-09 Neil Vachharajani <nvachhar@google.com>
4774 * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
4777 2009-09-23 Loren J. Rittle <ljrittle@acm.org>
4779 * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
4780 * configure: Rebuilt.
4782 2009-09-22 Richard Guenther <rguenther@suse.de>
4785 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
4787 2009-09-18 Chris Demetriou <cgd@google.com>
4789 PR preprocessor/28435:
4790 * include/cpplib.h (struct cpp_options): Add new member
4791 deps.need_preprocessor_output.
4792 * files.c (open_file_failed): If preprocessor output is needed
4793 always report an error.
4795 2009-09-13 Kai Tietz <kai.tietz@onevision.com>
4797 * configure.ac: Set for i?86-w64-mingw*
4798 need_64bit_hwint to yes.
4799 * configure: Regenerated.
4801 2009-09-10 Jason Merrill <jason@redhat.com>
4803 * directives.c (cpp_define): constify.
4805 2009-09-02 Ian Lance Taylor <iant@google.com>
4807 * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
4809 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4811 * configure.ac (AC_PREREQ): Bump to 2.64.
4813 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4815 * aclocal.m4: Regenerate.
4816 * config.in: Regenerate.
4817 * configure: Regenerate.
4819 2009-08-17 Tom Tromey <tromey@redhat.com>
4821 PR preprocessor/41067:
4822 * charset.c (convert_escape): Add missing ":" to error text.
4824 2009-07-27 Douglas B Rupp <rupp@gnat.com>
4826 * include/cpplib.h (INO_T_CPP): New macro.
4827 (struct cpp_dir): Use it.
4829 2009-07-20 Jerry Quinn <jlquinn@optonline.net>
4832 * configure.ac: Use = instead of == for testing
4833 ENABLE_BUILD_WITH_CXX.
4834 * configure: Rebuild.
4836 2009-07-17 Jerry Quinn <jlquinn@optonline.net>
4838 * directives.c (do_linemarker, do_line): Use CPP_STRING for
4840 * files.c (find_file_in_dir): Add cast from void* to char*.
4841 * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
4842 * Makefile.in: (WARN_CFLAGS): Use general and C-specific
4844 (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
4845 ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
4846 COMPILER_FLAGS): New.
4847 (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
4848 (COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS
4849 instead of ALL_CFLAGS.
4850 * configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings
4851 from other warnings. Add -Wc++-compat to C-specific warnings.
4852 Check for --enable-build-with-cxx. Set and substitute
4853 ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES
4854 according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before
4856 * configure: Rebuild.
4857 * include/cpp-id-data.h: Remove extern "C".
4858 * include/line-map.h: Likewise.
4859 * include/mkdeps.h: Likewise.
4860 * include/symtab.h: Likewise.
4861 * internal.h: Likewise.
4863 2009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4865 * directives.c (parse_include): Add location argument. Update all
4867 (parse_answer): Likewise.
4868 (do_include_common): Error with exact location.
4869 (parse_assertion): Likewise.
4871 2009-06-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
4873 * expr.c (num_div_op): Take explicit location.
4875 2009-06-17 Ian Lance Taylor <iant@google.com>
4877 * include/cpplib.h (progname): Don't declare.
4879 2009-06-12 Ian Lance Taylor <iant@google.com>
4881 * include/cpplib.h (struct cpp_options): Add
4882 warn_cxx_operator_names field.
4883 (NODE_WARN_OPERATOR): Define.
4884 (struct cpp_hashnode): Increase flags field to 10 bits, decrease
4886 * init.c (mark_named_operators): Add flags parameter.
4887 (cpp_post_options): Pick flags value to pass to
4888 mark_named_operators.
4889 * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
4890 identifier is an operator name in C++.
4892 2009-06-01 Aldy Hernandez <aldyh@redhat.com>
4894 * include/line-map.h (LAST_SOURCE_COLUMN): New.
4896 2009-06-01 Ian Lance Taylor <iant@google.com>
4898 * include/cpp-id-data.h: Add extern "C".
4899 * include/line-map.h: Likewise.
4900 * include/mkdeps.h: Likewise.
4901 * include/symtab.h: Likewise.
4902 * internal.h: Likewise.
4904 2009-05-15 Ian Lance Taylor <iant@google.com>
4906 * include/cpplib.h (enum cpp_builtin_type): Rename from enum
4907 builtin_type. Change all uses.
4909 2009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4912 * directives (do_linemarker): Compensate for the increment in
4913 location that occurs when we reach the end of line.
4914 * files (_cpp_stack_include): Mention _cpp_find_file in the
4917 2009-05-10 Joseph Myers <joseph@codesourcery.com>
4919 * include/cpplib.h (enum cpp_token_fld_kind): Add
4920 CPP_TOKEN_FLD_TOKEN_NO.
4921 (struct cpp_macro_arg, struct cpp_identifier): Define.
4922 (union cpp_token_u): Use struct cpp_identifier for identifiers.
4923 Use struct cpp_macro_arg for macro arguments. Add token_no for
4924 CPP_PASTE token numbers.
4925 * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
4926 do_pragma_poison, parse_assertion): Use val.node.node in place of
4928 * expr.c (parse_defined, eval_token): Use val.node.node in place
4930 * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
4931 cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
4932 cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
4933 place of val.arg_no. Use val.node.node in place of val.node.
4934 * macro.c (replace_args, cpp_get_token, parse_params,
4935 lex_expansion_token, create_iso_definition, cpp_macro_definition):
4936 Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
4937 Use val.node.node in place of val.node.
4939 2009-05-03 Joseph Myers <joseph@codesourcery.com>
4941 * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
4944 2009-04-25 Joseph Myers <joseph@codesourcery.com>
4946 PR preprocessor/39559
4947 * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
4948 constants larger than intmax_t in C99 mode.
4950 2009-04-21 Taras Glek <tglek@mozilla.com>
4952 * include/cpp-id-data.h: Update GTY annotations to new syntax.
4953 * include/cpplib.h: Likewise.
4954 * include/line-map.h: Likewise.
4955 * include/symtab.h: Likewise.
4957 2009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4960 * lex.c (cpp_type2name): Take a flags parameter. Call
4961 cpp_named_operator2name for named operators and cpp_digraph2name
4963 (cpp_digraph2name): New.
4964 (cpp_spell_token): Use it.
4965 (cpp_output_token): Likewise.
4966 * include/cpplib.h (cpp_type2name): Update declaration.
4967 * init.c (cpp_named_operator2name): New.
4968 * internal.h (cpp_named_operator2name): Declare.
4970 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4973 * init.c (cpp_create_reader): Wlong_long is disabled by default.
4974 * expr.c (cpp_classify_number): Give different messages for C and
4977 2009-04-19 Joseph Myers <joseph@codesourcery.com>
4979 PR preprocessor/20078
4980 * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
4982 * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
4983 (struct cpp_token): Change flags to unsigned short.
4984 * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
4985 (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
4986 (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
4988 * macro.c (macro_real_token_count): New.
4989 (enter_macro_context, replace_args): Use macro_real_token_count.
4990 (create_iso_definition): Record whitespace surrounding and digraph
4991 spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
4992 Set extra_tokens and save CPP_PASTE tokens with arg_no set for
4993 multiple consecutive ## tokens.
4994 (_cpp_create_definition): Initialize extra_tokens.
4995 (cpp_macro_definition): Use macro_real_token_count.
4997 2009-04-18 Joseph Myers <joseph@codesourcery.com>
4999 * directives.c (parse_include): Pass true to check_eol.
5001 2009-04-18 Joseph Myers <joseph@codesourcery.com>
5003 PR preprocessor/39646
5004 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
5005 * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
5006 * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
5009 2009-04-18 Joseph Myers <joseph@codesourcery.com>
5011 PR preprocessor/39647
5012 * directives.c (check_eol): Add parameter expand.
5013 (do_undef, parse_include, do_line, do_linemarker, do_ident,
5014 do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
5015 do_else, do_endif, do_assert, do_unassert): All callers changed.
5016 Pass true from do_line, false elsewhere.
5018 2009-04-12 Joseph Myers <joseph@codesourcery.com>
5020 PR preprocessor/31869
5021 * macro.c (stringify_arg): Handle NULL source token in padding
5022 token where previous padding token did not have source token with
5023 preceding whitespace.
5025 2009-04-09 Jakub Jelinek <jakub@redhat.com>
5027 * Makefile.in: Change copyright header to refer to version
5028 3 of the GNU General Public License and to point readers at the
5029 COPYING3 file and the FSF's license web page.
5030 * charset.c: Likewise.
5031 * directives-only.c: Likewise.
5032 * directives.c: Likewise.
5033 * errors.c: Likewise.
5035 * files.c: Likewise.
5036 * identifiers.c: Likewise.
5037 * include/cpp-id-data.h: Likewise.
5038 * include/cpplib.h: Likewise.
5039 * include/line-map.h: Likewise.
5040 * include/mkdeps.h: Likewise.
5041 * include/symtab.h: Likewise.
5043 * internal.h: Likewise.
5045 * line-map.c: Likewise.
5046 * macro.c: Likewise.
5047 * makeucnid.c: Likewise.
5048 * mkdeps.c: Likewise.
5050 * symtab.c: Likewise.
5051 * system.h: Likewise.
5052 * traditional.c: Likewise.
5053 * ucnid.tab: Likewise.
5054 * ucnid.h: Regenerate.
5056 2009-04-01 Janis Johnson <janis187@us.ibm.com>
5059 * include/cpplib.h (CPP_N_DEFAULT): Define.
5060 * expr.c (interpret_float_suffix): Recognize d or D for double,
5061 return new value for default.
5062 (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
5065 * expr.c (interpret_float_suffix): Reject invalid suffix that uses
5066 letters from decimal float and fixed-point suffixes.
5068 2009-03-31 Joseph Myers <joseph@codesourcery.com>
5070 PR preprocessor/15638
5071 * files.c (_cpp_find_file): Call open_file_failed after diagnosing
5073 (open_file_failed): Make error for missing file fatal.
5074 * include/cpplib.h (CPP_DL_FATAL): Define.
5076 2009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net>
5078 PR preprocessor/31932:
5079 * internal.h: Don't mention HAVE_ICONV_H.
5080 * configure, config.in: Rebuild.
5081 * configure.ac: Don't check for iconv.h.
5083 2009-03-30 Tom Tromey <tromey@redhat.com>
5085 PR preprocessor/39512:
5086 * line-map.c (linemap_init): Initialize 'reallocator' field.
5088 2009-03-30 Jakub Jelinek <jakub@redhat.com>
5091 * macro.c (cpp_get_token): If macro_to_expand returns NULL
5092 and used some tokens, add CPP_PADDING before next token.
5094 2009-03-29 Joseph Myers <joseph@codesourcery.com>
5096 PR preprocessor/34695
5097 * makedepend.c: Remove.
5098 * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
5099 (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
5100 * directives.c (cpp_errors): Remove.
5101 * errors.c (print_location, _cpp_begin_message, v_message):
5103 (cpp_error, cpp_error_with_line): Always use error callback.
5104 (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
5105 * include/cpplib.h (cpp_options): Remove pedantic_errors,
5106 inhibit_warnings, warn_system_headers, inhibit_errors,
5107 warnings_are_errors, client_diagnostic.
5108 (cpp_callbacks): Add extra arguments to error callback; make it
5110 (cpp_finish): Return void.
5111 (cpp_destroy): Remove inaccurate comment about return value.
5112 (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
5113 (CPP_DL_NOTE): Define.
5114 * include/line-map.h (linemap_print_containing_files): Remove.
5115 * init.c (cpp_finish): Do not check for or return number of
5117 * internal.h (cpp_reader): Remove errors field.
5118 * line-map.c (linemap_print_containing_files): Remove.
5119 * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
5120 about previous definition. Only emit it if previous diagnostic
5123 2009-03-28 Joseph Myers <joseph@codesourcery.com>
5125 * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
5128 2009-03-18 Jakub Jelinek <jakub@redhat.com>
5130 * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
5132 2009-02-21 Joseph Myers <joseph@codesourcery.com>
5134 * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
5136 (_cpp_lex_direct): Handle this.
5138 2009-02-15 Richard Guenther <rguenther@suse.de>
5142 2009-02-13 Richard Guenther <rguenther@suse.de>
5144 * configure.ac: Enable LFS.
5145 * configure: Re-generate.
5146 * config.in: Likewise.
5148 2009-01-05 Ben Elliston <bje@au.ibm.com>
5150 * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
5151 (.po.pox): Likewise.
5152 (po/$(PACKAGE).pot): Likewise.
5154 2008-12-10 Alexandre Oliva <aoliva@redhat.com>
5157 * pch.c (cpp_valid_state): Improve message for poisoned symbols.
5158 Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
5160 2008-11-29 Joseph Myers <joseph@codesourcery.com>
5162 * lex.c (cpp_token_len): Use 6 as default length.
5164 2008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org>
5166 * expr.c (struct op): Add location.
5167 (_cpp_parse_expr): Propagate locations throught the stack
5170 (check_promotion): Use explicit location in errors.
5172 2008-10-05 Matthew Gingell <gingell@adacore.com>
5173 Arnaud Charlet <charlet@adacore.com>
5175 * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
5176 (cpp_get_comments): New function.
5177 * internal.h (struct cpp_reader): Add comments field.
5178 * init.c (cpp_destroy): Free comments.
5179 * lex.c (store_comment, cpp_get_comments): New functions.
5180 (comments): New struct.
5181 (save_comment): Store comments in comments struct.
5183 2008-09-18 Simon Baldwin <simonb@google.com>
5185 * include/cpplib.h (struct cpp_options): Add new boolean flag
5186 warn_builtin_macro_redefined.
5187 * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
5188 * (struct builtin_operator): Split out from previous struct builtin,
5189 enhance extra const correctness.
5190 * (struct builtin_macro): Split out from previous struct builtin, add
5191 new always_warn_if_redefined flag, enhance const correctness.
5192 * (mark_named_operators): Use struct builtin_operator.
5193 * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
5194 to builtins selectively.
5195 * macro.c (warn_of_redefinition): Return false if a builtin macro
5196 is not flagged with NODE_WARN.
5198 2008-07-31 Jakub Jelinek <jakub@redhat.com>
5200 PR preprocessor/36649
5201 * files.c (struct report_missing_guard_data): New type.
5202 (report_missing_guard): Put paths into an array instead of printing
5203 them right away. Return 1 rather than 0.
5204 (report_missing_guard_cmp): New function.
5205 (_cpp_report_missing_guards): Sort and print paths gathered by
5206 report_missing_guard callback.
5208 2008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5211 * directives.c (strtolinenum): Handle overflow.
5212 (do_line): Give a warning if line number overflowed.
5213 (do_linemarker): Update call to strtolinenum.
5215 2008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5217 * include/line-map.h (linenum_type): New typedef.
5218 (struct line_map): Use it.
5219 (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
5220 (SOURCE_COLUMN): Likewise.
5221 * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
5222 source_location values in a variable of type linenum_type.
5223 * directives.c (struct if_stack): Use linenum_type.
5224 (strtoul_for_line): Rename as strtolinenum.
5225 (do_line): Use linenum_type.
5226 (do_linemarker): Use linenum_type and strtolinenum.
5227 (_cpp_do_file_change): Use linenum_t.
5228 * line-map.c (linemap_add): Likewise.
5229 (linemap_line_start): Likewise.
5230 * traditional.c (struct fun_macro): 'line' is a source_location.
5231 * errors.c (print_location): Use linenum_type.
5232 * directives-only.c (_cpp_preprocess_dir_only): Likewise.
5233 * internal.h (CPP_INCREMENT_LINE): Likewise.
5234 * lex.c (_cpp_skip_block_comment): Use source_location.
5236 2008-07-14 Ben Elliston <bje@au.ibm.com>
5238 * include/cpplib.h (NODE_CONDITIONAL): New.
5239 (struct cpp_callbacks): New macro_to_expand field.
5240 (struct cpp_hashnode): Adjust size of flags and type fields.
5241 (cpp_peek_token): Prototype.
5242 * lex.c (cpp_peek_token): New function.
5243 (_cpp_temp_token): Protect pre-existing lookaheads.
5244 * macro.c (cpp_get_token): Expand any conditional macros.
5245 (_cpp_backup_tokens_direct): New.
5246 (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
5247 (warn_of_redefinition): Silently allow redefined conditional
5249 (_cpp_create_definition): Remove the conditional flag when a user
5250 defines one of the conditional macros.
5251 * internal.h (_cpp_backup_tokens_direct): New prototype.
5253 2008-06-13 Andrew Haley <aph@redhat.com>
5255 PR preprocessor/33305
5256 * macro.c (replace_args): Print a warning for empty macro
5257 arguments in C89 and C++.
5259 2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5261 * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
5262 * configure: Regenerate.
5264 2008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5266 * Makefile.in (datarootdir): New variable.
5268 2008-06-12 H.J. Lu <hongjiu.lu@intel.com>
5270 PR preprocessor/36479
5271 * charset.c (cpp_interpret_string_notranslate): Also set
5272 narrow_cset_desc.width.
5274 2008-06-07 Joseph Myers <joseph@codesourcery.com>
5276 * configure.ac (parisc*64*-*-*): Remove.
5277 * configure: Regenerate.
5279 2008-05-30 Tom Tromey <tromey@redhat.com>
5281 PR preprocessor/36320:
5282 * internal.h (_cpp_parse_expr): Update.
5283 * expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error
5285 * directives.c (do_if): Update.
5286 (do_elif): Require expression if processing group.
5288 2008-05-30 Danny Smith <dannysmith@users.sourceforge.net>
5290 * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
5292 2008-05-21 Tom Tromey <tromey@redhat.com>
5294 PR preprocessor/27777:
5295 * lex.c (cpp_output_line_to_string): New function.
5296 * internal.h (_cpp_begin_message): Don't declare.
5297 * errors.c (_cpp_begin_message): Now static.
5298 * include/cpplib.h (cpp_output_line_to_string): Declare.
5299 * directives.c (do_diagnostic): Rewrote. Use
5300 cpp_output_line_to_string. Don't use _cpp_begin_message.
5302 2008-05-21 Tom Tromey <tromey@redhat.com>
5304 * include/symtab.h (HT_ALLOCED): Remove.
5305 (ht_purge): Declare.
5306 * symtab.c (DELETED): New define.
5307 (ht_lookup): Update comment.
5308 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED
5309 code. Use subobject allocator for strings, if it exists.
5310 (ht_expand): Handle deleted entries.
5311 (ht_forall): Likewise.
5312 (ht_purge): New function.
5313 (ht_dump_statistics): Print deletion statistics.
5315 2008-05-13 Tom Tromey <tromey@redhat.com>
5317 PR preprocessor/22168:
5318 * include/cpplib.h (struct cpp_options) <objc>: Update
5320 * expr.c (eval_token): Warn for use of assertions.
5321 * directives.c (directive_diagnostics): Warn about extensions.
5322 (DEPRECATED): New define.
5323 (DIRECTIVE_TABLE): Use it.
5325 2008-05-06 Tom Tromey <tromey@redhat.com>
5327 PR preprocessor/35313, PR preprocessor/36088:
5328 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
5329 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
5331 2008-05-04 David S. Miller <davem@davemloft.net>
5333 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
5334 * configure: Regenerate.
5336 2008-04-22 Daniel Franke <franke.daniel@gmail.com>
5338 * include/cpplib.h (cpp_define_formatted): New.
5339 * directives.c (cpp_define_formatted): New.
5341 2008-04-21 Tom Tromey <tromey@redhat.com>
5344 * charset.c (_cpp_convert_input): Add buffer_start argument.
5345 Ignore UTF-8 BOM if seen.
5346 * internal.h (_cpp_convert_input): Add argument.
5347 * files.c (struct _cpp_file) <buffer_start>: New field.
5348 (destroy_cpp_file): Free buffer_start, not buffer.
5349 (_cpp_pop_file_buffer): Likewise.
5350 (read_file_guts): Update.
5352 2008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
5354 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
5355 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
5356 (struct cpp_options): Added uliterals.
5357 (cpp_interpret_string): Update prototype.
5358 (cpp_interpret_string_notranslate): Idem.
5359 * charset.c (init_iconv_desc): New width member in cset_converter.
5360 (cpp_init_iconv): Add support for char{16,32}_cset_desc.
5361 (convert_ucn): Idem.
5362 (emit_numeric_escape): Idem.
5363 (convert_hex): Idem.
5364 (convert_oct): Idem.
5365 (convert_escape): Idem.
5366 (converter_for_type): New function.
5367 (cpp_interpret_string): Use converter_for_type, support u and U prefix.
5368 (cpp_interpret_string_notranslate): Match changed prototype.
5369 (wide_str_to_charconst): Use converter_for_type.
5370 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
5371 * directives.c (linemarker_dir): Macro U changed to UC.
5372 (parse_include): Idem.
5373 (register_pragma_1): Idem.
5374 (restore_registered_pragmas): Idem.
5375 (get__Pragma_string): Support CPP_STRING{16,32}.
5376 * expr.c (eval_token): Support CPP_CHAR{16,32}.
5377 * init.c (struct lang_flags): Added uliterals.
5378 (lang_defaults): Idem.
5379 * internal.h (struct cset_converter) <width>: New field.
5380 (struct cpp_reader) <char16_cset_desc>: Idem.
5381 (struct cpp_reader) <char32_cset_desc>: Idem.
5382 * lex.c (digraph_spellings): Macro U changed to UC.
5384 (lex_string): Add support for u'...', U'...', u"..." and U"...".
5385 (_cpp_lex_direct): Idem.
5386 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
5387 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
5389 2008-04-18 Paolo Bonzini <bonzini@gnu.org>
5392 * aclocal.m4: Regenerate.
5393 * configure: Regenerate.
5395 2008-04-17 Tom Tromey <tromey@redhat.com>
5398 * errors.c (cpp_error): Don't reference a token before the start
5401 2008-04-16 Tom Tromey <tromey@redhat.com>
5403 * Makefile.in (TAGS_SOURCES): New variable.
5406 2008-04-11 Kaz Kojima <kkojima@gcc.gnu.org>
5408 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
5410 * configure: Rebuilt.
5412 2008-04-02 Joseph Myers <joseph@codesourcery.com>
5414 * include/cpplib.h (struct cpp_callbacks): Add used_define,
5415 used_undef and before_define.
5416 (NODE_USED): Define.
5417 * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
5418 do_ifndef, cpp_pop_definition): Handle new flag and use new
5420 * expr.c (parse_defined): Handle new flag and use new callbacks.
5421 * macro.c (enter_macro_context, _cpp_free_definition): Handle new
5422 flag and use new callbacks.
5424 2008-04-01 Jakub Jelinek <jakub@redhat.com>
5427 * files.c (struct _cpp_file): Remove pch field.
5428 (pch_open_file): Don't set file->pch, just file->pchname.
5429 (should_stack_file): After pfile->cb.read_pch call
5430 free pchname and clear pchname, don't close file->fd.
5431 Test file->pchname instead of file->pch. Don't close fd after cb.
5432 (_cpp_stack_include): Test file->pchname instead of file->pch.
5434 2008-03-28 Tom Tromey <tromey@redhat.com>
5436 * Makefile.in (POSTCOMPILE): New variable.
5439 2008-03-13 Tom Tromey <tromey@redhat.com>
5442 * directives.c (destringize_and_run): Set pfile->directive.
5444 2008-03-06 Markus Milleder <markus.milleder@generali.at>
5446 PR preprocessor/35458
5447 * mkdeps.c (munge): Quote '#' with a '\'.
5449 2008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5451 PR preprocessor/35379
5452 * mkdeps.c (deps_write): Ensure the first target always appears
5453 in the first column, without leading backslash newline. Avoid
5454 some more extra whitespace.
5456 2008-02-25 Thiemo Seufer <ths@mips.com>
5458 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
5460 2008-02-19 Tom Tromey <tromey@redhat.com>
5462 * traditional.c (lex_identifier): Use CPP_HASHNODE.
5463 * lex.c (lex_identifier): Use CPP_HASHNODE.
5464 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
5466 * identifiers.c (alloc_node): Change return type.
5467 (_cpp_init_hashtable): Don't cast 'alloc_node'.
5468 (proxy_assertion_broken): New declaration.
5469 (cpp_forall_identifiers): Move comment.
5470 * line-map.c (linemap_add): Comment fix.
5471 (linemap_line_start): Indentation fix.
5473 2008-01-25 Jakub Jelinek <jakub@redhat.com>
5475 PR preprocessor/34692
5476 * macro.c (collect_args): Add pragma_buff argument. Push
5477 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
5478 than into arguments. Reset prevent_expansion and parsing_args
5479 state at CPP_PRAGMA_EOL/CPP_EOF.
5480 (funlike_invocation_p): Add pragma_buff argument, pass it through
5482 (enter_macro_context): Add result argument. Adjust
5483 funlike_invocation_p caller. Emit all deferred pragma tokens
5484 gathered during collect_args before the expansion, add a padding
5485 token. Return 2 instead of 1 if any pragma tokens were prepended.
5486 (cpp_get_token): If enter_macro_context returns 2, don't return
5487 a padding token, instead cycle to grab CPP_PRAGMA token.
5488 * directives.c (_cpp_handle_directive): If was_parsing_args
5489 in deferred pragma, leave parsing_args and prevent_expansion as is.
5491 2008-01-22 Tom Tromey <tromey@redhat.com>
5494 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
5495 __STDC_CONSTANT_MACROS.
5497 2008-01-07 Fred Fish <fnf@specifix.com>
5499 PR preprocessor/30363
5500 * traditional.c (replace_args_and_push): Add local variable
5501 cxtquote, calculate the replacement text size assuming a
5502 worst case of every input character quoted with backslash,
5503 and properly handle output quoting of quote characters in
5504 actual arguments used in function-like macros.
5506 2008-01-03 Tom Tromey <tromey@redhat.com>
5508 PR preprocessor/34602
5509 * directives.c (do_line): Don't try to spell EOF token.
5510 (do_linemarker): Add comment.
5512 2007-12-11 DJ Delorie <dj@redhat.com>
5514 * charset.c (convert_using_iconv): Close out any shift states,
5515 returning to the initial state.
5517 2007-12-06 Tom Tromey <tromey@redhat.com>
5520 * internal.h (struct cpp_reader) <file_hash_entries>: Changed
5522 <file_hash_entries_allocated, file_hash_entries_used>: Removed.
5523 * files.c (FILE_HASH_POOL_SIZE): New macro.
5524 (struct file_hash_entry_pool): New.
5525 (destroy_all_cpp_files): New function.
5526 (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
5527 (new_file_hash_entry): Update.
5528 (free_file_hash_entries): New function.
5529 (_cpp_cleanup_files): Call free_file_hash_entries and
5530 destroy_all_cpp_files.
5531 (cpp_clear_file_cache): New function.
5532 * include/cpplib.h (cpp_clear_file_cache): Declare.
5534 2007-12-03 Tom Tromey <tromey@redhat.com>
5536 PR preprocessor/34288
5537 * configure.ac, config.in: Rebuilt.
5538 * configure.ac: Check for ssize_t.
5540 2007-11-30 Tom Tromey <tromey@redhat.com>
5542 PR preprocessor/32868
5543 * macro.c (_cpp_create_definition): Special case
5544 __STDC_FORMAT_MACROS.
5546 2007-11-16 Michael Matz <matz@suse.de>
5548 * files.c (search_path_head): Fix check for absolute paths.
5550 2007-11-11 Tom Tromey <tromey@redhat.com>
5553 * include/cpplib.h (cpp_included_before): Declare.
5554 * files.c (struct file_hash_entry) <location>: New field.
5555 (_cpp_find_file): Initialize new field.
5556 (make_cpp_dir): Likewise.
5557 (cpp_included_before): New function.
5559 2007-11-01 Tom Tromey <tromey@redhat.com>
5561 PR preprocessor/30805
5562 * macro.c (paste_tokens): Handle padding token.
5563 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
5565 2007-10-31 Tom Tromey <tromey@redhat.com>
5567 PR preprocessor/30786
5568 * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
5569 * directives.c (_cpp_do__Pragma): Return error status.
5570 * internal.h (_cpp_do__Pragma): Update.
5571 * directives.c (get__Pragma_string): Back up if EOF seen.
5573 2007-09-06 Tom Tromey <tromey@redhat.com>
5575 * internal.h (struct cpp_reader) <invocation_location>: New
5577 (struct cpp_reader) <set_invocation_location>: Likewise.
5578 * init.c (cpp_set_line_map): New function.
5579 * line-map.c (linemap_add): Use linemap's allocator.
5580 * include/line-map.h (GTY): Define.
5581 (line_map_realloc): New typedef.
5582 (struct line_map): Mark with GTY.
5583 (struct line_maps): Likewise.
5584 (struct line_maps) <maps>: Likewise.
5585 (struct line_maps) <reallocator>: New field.
5586 * include/symtab.h (GTY): Conditionally define.
5587 * include/cpplib.h (cpp_set_line_map): Declare.
5588 (cpp_get_token_with_location): Declare.
5589 * macro.c (cpp_get_token): Set invocation_location on the reader.
5590 (cpp_get_token_with_location): New function.
5592 2007-08-30 Chao-ying Fu <fu@mips.com>
5594 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
5595 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
5596 (cpp_classify_number): Support decimal fixed-point constants without
5598 Warn about fixed-point constants when -pedantic.
5599 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
5600 comments to support fixed-point values.
5601 (CPP_N_FRACT, CPP_N_ACCUM): Define.
5603 2007-08-18 Tom Tromey <tromey@redhat.com>
5605 PR preprocessor/32974
5606 * directives.c (parse_include): Don't check for EOL when
5607 processing #pragma dependency.
5609 2007-07-30 Ollie Wild <aaw@google.com>
5611 * directives-only.c: New file.
5612 * internal.h (struct _cpp_dir_only_callbacks): New.
5613 (_cpp_preprocess_dir_only): New function.
5614 * directives.c (_cpp_handle_directive): Check directives_only before
5615 disabling execution of indented directives.
5616 * files.c (_cpp_stack_file): Add directives_only check.
5617 * include/cpplib.h (struct cpp_options): Add directives_only.
5618 (cpp_init_special_builtins): New function.
5619 * init.c (cpp_init_special_builtins): New function.
5620 (cpp_init_builtins): Move builtin_array initialization to
5621 cpp_init_special_builtins.
5622 (post_options): Check directives_only before setting
5623 pfile->state.prevent_expansion = 1.
5624 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
5625 is expanded inside a directive while -fdirectives-only is enabled.
5626 * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
5627 (libcpp_a_SOURCES): Add directives-only.c.
5629 2007-07-04 Uros Bizjak <ubizjak@gmail.com>
5631 * traditional.c (_cpp_scan_out_logical_line): Initialize
5632 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
5633 fmacro.args to prevent 'may be used uninitialized' warning.
5635 2007-07-03 Uros Bizjak <ubizjak@gmail.com>
5637 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
5639 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
5640 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
5641 for 'q' or 'Q' suffixes.
5643 2007-06-17 Danny Smith <dannysmith@users.sourceforge.net
5645 * files.c (open_file): Correct typo.
5647 2007-06-16 Vladimir Prus <vladimir@codesourcery.com>
5649 * files.c (open_file): Prevent the call
5650 for stat from overwriting errno.
5652 2007-06-09 Vladimir Prus <vladimir@codesourcery.com>
5654 * files.c (open_file): Account for the
5655 fact that on windows, opening a directory gives
5658 2007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
5660 PR preprocessor/23479
5661 * expr.c (cpp_classify_number): Implement 0b-prefixed binary
5663 (append_digit): Likewise.
5664 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
5665 binary integer constants.
5667 2007-05-31 Dave Korn <dave.korn@artimi.com>
5669 PR preprocessor/14331
5670 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
5672 2007-05-24 Ollie Wild <aaw@google.com>
5674 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
5675 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
5676 (cpp_write_pch_state): Save __COUNTER__ state.
5677 (cpp_valid_state): Check valid __COUNTER__ state.
5678 (cpp_read_state): Read new __COUNTER__ state.
5679 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
5680 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
5681 * internal.h (struct cpp_reader): Add counter member.
5683 2007-05-23 Simon Martin <simartin@users.sourceforge.net>
5685 PR preprocessor/20077
5686 * macro.c (create_iso_definition): Fixed the method to determine
5687 whether the token-pasting operator appears at the beginning or the end
5690 2007-05-21 Ian Lance Taylor <iant@google.com>
5692 * internal.h (struct cpp_reader): Add new fields:
5693 nonexistent_file_hash and nonexistent_file_ob.
5694 * files.c: Include "obstack.h".
5695 (find_file_in_dir): Before trying to open the file, look up the
5696 path name in the hash table of nonexistent files. After failing
5697 to open the file, add the path name to the hash table.
5698 (_cpp_find_file): Cache the results of looking up the file name
5699 starting with the quote and bracket chain heads, if we can.
5700 (nonexistent_file_hash_eq): New static function.
5701 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
5702 pfile->nonexistent_file_ob.
5703 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
5704 pfile->nonexistent_file_ob.
5706 2007-05-14 Janis Johnson <janis187@us.ibm.com>
5708 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
5711 * expr.c (interpret_float_suffix): Check for invalid suffix.
5713 2007-05-02 Eric Christopher <echristo@apple.com>
5715 * expr.c (num_div_op): Don't overflow if the result is
5718 2007-05-02 Tom Tromey <tromey@redhat.com>
5720 PR preprocessor/28709
5721 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
5723 2007-03-30 Michael Meissner <michael.meissner@amd.com>
5725 * directives.c (lex_macro_node_from_str): Fix alloca call to be
5728 2007-03-30 Richard Henderson <rth@redhat.com>
5730 * directives.c (lex_macro_node_from_str): New.
5731 (cpp_push_definition, cpp_pop_definition): New.
5732 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
5734 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
5736 * Makefile.in: Add dummy install-pdf target.
5738 2007-01-30 Tom Tromey <tromey@redhat.com>
5740 PR preprocessor/30468
5741 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
5744 2007-01-30 Tom Tromey <tromey@redhat.com>
5746 PR preprocessor/29966
5747 * macro.c (lex_expansion_token): Save and restore cpp_reader's
5749 (_cpp_create_definition): Don't restore cur_token here.
5750 * lex.c (_cpp_lex_token): Added assertion.
5752 2007-01-27 Tom Tromey <tromey@redhat.com>
5754 * configure: Rebuilt.
5756 2007-01-12 Tom Tromey <tromey@redhat.com>
5758 PR preprocessor/28227
5759 * directives.c (lex_macro_node): Added 'is_def_or_undef'
5761 (do_define): Update.
5764 (do_ifndef): Update.
5766 2007-01-11 Paolo Bonzini <bonzini@gnu.org>
5768 * configure: Regenerate.
5770 2007-01-11 Paolo Bonzini <bonzini@gnu.org>
5772 * configure: Regenerate.
5774 2007-01-04 Tom Tromey <tromey@redhat.com>
5776 PR preprocessor/28165
5777 * internal.h (cpp_in_primary_file): New function.
5778 * directives.c (do_include_next): Use cpp_in_primary_file.
5779 (do_pragma_once): Likewise.
5780 (do_pragma_system_header): Likewise.
5782 2006-12-29 Ian Lance Taylor <iant@google.com>
5784 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
5785 look backward at the end of the line unless we saw a backslash.
5787 2006-12-29 Jakub Jelinek <jakub@redhat.com>
5789 PR preprocessor/29612
5790 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
5791 only when new_sysp is non-zero.
5793 2006-12-28 Tom Tromey <tromey@redhat.com>
5795 PR preprocessor/30001
5796 * charset.c (_cpp_convert_input): Check that to.len is greater
5799 2006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
5801 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
5802 * configure: Rebuilt.
5804 2006-11-01 Douglas Gregor <doug.gregor@gmail.com>
5806 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
5807 for experimental C++0x mode.
5808 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
5809 adopted the preprocessor changes introduced in C99.
5811 2006-10-29 Joseph Myers <joseph@codesourcery.com>
5813 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
5814 depending on --enable-targets=all.
5815 * configure: Regenerate.
5817 2006-10-12 Jakub Jelinek <jakub@redhat.com>
5819 PR preprocessor/28709
5820 * macro.c (paste_tokens): Do error reporting here, use BUF with the
5821 spelled LHS token as opposed to spelling it again.
5822 (paste_all_tokens): Don't report errors here, just break on failure.
5824 2006-10-10 Brooks Moses <bmoses@stanford.edu>
5826 * Makefile.in: Added empty "pdf" target.
5828 2006-09-22 Geoffrey Keating <geoffk@apple.com>
5830 * configure.ac: Make need_64_bit_hwint case for x86-darwin
5831 match exactly the glob in gcc/config.gcc.
5832 * configure: Regenerate.
5834 2006-09-13 Joseph S. Myers <joseph@codesourcery.com>
5837 PR preprocessor/14634
5838 * lex.c (lex_string): Pedwarn for unterminated literals.
5840 2006-09-08 Eric Christopher <echristo@apple.com>
5842 * configure.ac: Add 64-bit HWI support for i?86-darwin.
5844 2006-08-14 Steve Ellcey <sje@cup.hp.com>
5848 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
5849 (CPP_LAST_EQ): Change.
5850 (CPP_LAST_PUNCTUATOR): Change.
5851 * expr.c (cpp_operator): Remove MIN and MAX.
5852 (reduce): Remove CPP_MIN and CPP_MAX.
5853 (num_binary_op): Ditto.
5854 * lex.c (_cpp_lex_direct): Ditto.
5855 (cpp_avoid_paste): Remove ? as legal symbol after > or <.
5857 2006-06-09 Jakub Jelinek <jakub@redhat.com>
5859 PR preprocessor/27746
5860 * directives.c (do_pragma): Handle pragma with valid namespace
5861 and invalid name coming from macro expansion.
5862 * directives.c (destringize_and_run): Initialize next field in
5867 * directives.c (destringize_and_run): Set NO_EXPAND on the
5870 * macro.c (_cpp_backup_tokens): Fix comment typo.
5872 2006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
5874 * Makefile.in (CATALOGS): Add po/ prefix.
5875 * configure: Regenerated.
5877 2006-05-23 Carlos O'Donell <carlos@codesourcery.com>
5879 * Makefile.in: Add install-html target. Add install-html to .PHONY
5881 2006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
5883 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
5884 * files.c (_cpp_get_file_stat): New function.
5885 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
5886 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
5887 * internal.h (_cpp_get_file_stat): Prototype.
5888 (struct cpp_buffer): Add timestamp.
5890 2006-01-23 Jakub Jelinek <jakub@redhat.com>
5892 PR preprocessor/25717
5893 * init.c (cpp_init_builtins): If __STDC__ will not change value
5894 between system headers and other sources, define it as a normal
5895 macro rather than a builtin.
5896 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
5897 cpp_in_system_header condition.
5899 2006-01-05 Paolo Bonzini <bonzini@gnu.org>
5901 * Makefile.in: Use -MMD instead of -MD.
5903 2006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
5904 Richard Henderson <rth@redhat.com>
5906 Merge from gomp branch:
5907 * directives.c (struct pragma_entry): Add is_deferred. Add ident
5908 entry to value union.
5909 (end_directive): Don't eat the line if in_deferred_pragma.
5910 (run_directive): Remove pragma hacks.
5911 (insert_pragma_entry): Remove.
5912 (new_pragma_entry): New.
5913 (register_pragma_1): Split out of register_pragma. Only handle
5914 the lookup tree and return the new entry.
5915 (cpp_register_pragma): Fill in the pragma entry here.
5916 (cpp_register_deferred_pragma): New.
5917 (register_pragma_internal): New.
5918 (_cpp_init_internal_pragmas): Use register_pragma_internal.
5919 (do_pragma): Allow pragma expansion after namespace. For deferred
5920 pragmas, don't slurp the line into a string.
5921 (destringize_and_run): Save tokens for deferred pragmas.
5922 (cpp_handle_deferred_pragma): Remove.
5923 * macro.c (builtin_macro): Remove pragma token hack.
5924 (_cpp_push_token_context): Rename from push_token_context and export.
5925 * internal.h (struct lexer_state): Add pragma_allow_expansion.
5926 (_cpp_push_token_context): Declare.
5927 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
5928 a token. Update the line number correctly if so.
5929 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
5930 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
5931 * include/cpplib.h (PRAGMA_EOL): New.
5932 (CPP_TOKEN_FLD_PRAGMA): New.
5933 (struct cpp_token): Add val.pragma.
5934 (struct cpp_options): Remove defer_pragmas.
5935 (cpp_handle_deferred_pragma): Remove.
5936 (cpp_register_deferred_pragma): Declare.
5938 2006-01-01 Jakub Jelinek <jakub@redhat.com>
5941 * directives.c (do_pragma): If pragma line ends with multi-line
5942 block comment, end the saved deferred pragma string before that
5943 comment. Handle embedded '\0' chars on the pragma line.
5945 2005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
5948 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
5950 2005-12-07 Jon Grimm <jgrimm2@us.ibm.com>
5951 Ben Elliston <bje@au.ibm.com>
5953 * include/cpplib.h (CPP_N_DFLOAT): New.
5954 * expr.c (interpret_float_suffix): Identify df, dd, and dl
5955 suffixes as decimal floating point constants.
5956 (cpp_classify_number): Disallow hexadecimal DFP constants.
5958 2005-11-14 Gerald Pfeifer <gerald@pfeifer.com>
5959 Ian Lance Taylor <ian@airs.com>
5961 * include/cpplib.h (struct cpp_callbacks): Annotate error with
5962 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
5964 2005-11-09 Per Bothner <per@bothner.com>
5965 Uros Bizjak <uros@kss-loka.si>
5968 * init.c (read_original_filename): Temporarily set
5969 state.in_directive before calling _cpp_lex_direct for
5972 2005-11-03 James E Wilson <wilson@specifix.com>
5974 PR preprocessor/24202
5975 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
5977 2005-11-04 Joseph S. Myers <joseph@codesourcery.com>
5979 * include/cpplib.h (struct cpp_callbacks): Make error take
5981 * errors.c (cpp_error): Update call to callback.
5983 2005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
5985 PR preprocessor/22042
5986 * macro.c (_cpp_builtin_macro_text): Lower the needed max
5988 (cpp_quote_string): Don't octalify non printable
5991 2005-11-03 Joseph S. Myers <joseph@codesourcery.com>
5994 * include/cpplib.h (struct cpp_options): Add client_diagnostic.
5995 (struct cpp_callbacks): Add error.
5996 * errors.c (cpp_error): If client_diagnostic, use error callback.
5997 * charset.c (convert_escape): Don't use %03o in diagnostic.
5999 2005-10-21 James E Wilson <wilson@specifix.com>
6001 PR preprocessor/15220
6002 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all
6003 callers. Pass to open_file_failed.
6004 (open_file_failed): New parameter angle_brackets. Fix all callers.
6005 Use in print_dep assignment.
6006 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
6007 * internal.h (_cpp_find_file): Add new parm to declaration.
6009 2005-10-08 Kazu Hirata <kazu@codesourcery.com>
6011 * configure.ac: Require 64-bit int for arm*-*-*eabi*.
6012 * configure: Regenerate.
6014 2005-10-04 Ian Lance Taylor <ian@airs.com>
6016 PR preprocessor/13726
6017 * directives.c (check_eol_return_comments): New static function.
6018 (parse_include): Add buf parameter. Change all callers.
6019 (do_include_common): If not discard comments, turn on
6020 save_comments. Pass collected comments to include callback.
6021 * include/cpplib.h (struct cpp_callbacks): Add new parameter to
6022 include callback: cpp_token list.
6024 2005-09-20 Joseph S. Myers <joseph@codesourcery.com>
6026 * include/cpplib.h (struct cpp_options): Add extended_identifiers.
6027 * init.c (struct lang_flags, lang_defaults): Add
6028 extended_identifiers.
6029 (cpp_set_lang): Use it.
6030 * lex.c (forms_identifier_p): Check extended_identifiers.
6032 2005-08-30 Jakub Jelinek <jakub@redhat.com>
6034 PR preprocessor/20348
6035 PR preprocessor/20356
6036 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
6039 2005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6041 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
6042 -Wmissing-format-attribute.
6044 * configure: Regenerate.
6046 2005-06-29 Kelley Cook <kcook@gcc.gnu.org>
6048 * all files: Update FSF address in copyright headers.
6049 * makeucnid.c (write_copyright): Update outputted FSF address.
6051 2005-06-13 Zack Weinberg <zack@codesourcery.com>
6053 * configure.ac: Invoke ZW_CREATE_DEPDIR and
6054 ZW_PROG_COMPILER_DEPENDENCIES.
6055 * aclocal.m4, configure: Regenerate.
6056 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
6058 (distclean): Clean up $(DEPDIR) and its contents.
6059 (.c.o): Use $(COMPILE).
6060 Include $(DEPDIR)/*.Po for most object->header dependencies.
6062 2005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
6064 * configure.ac: Check declarations for asprintf and vasprintf.
6065 * config.in: Regenerate.
6066 * configure: Likewise.
6068 * charset.c (conversion_loop): Use XRESIZEVEC.
6069 (convert_no_conversion): Likewise.
6070 (convert_using_iconv): Likewise.
6071 (init_iconv_desc): Cast return value of alloca.
6072 (cpp_host_to_exec_charset): Use XNEWVEC.
6073 (emit_numeric_escape): Use XRESIZEVEC.
6074 (cpp_interpret_string): Use XNEWVEC.
6075 (cpp_interpret_string): Use XRESIZEVEC.
6076 (_cpp_interpret_identifier): Cast return value of alloca.
6077 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
6078 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
6079 (parse_include): Use XNEWVEC.
6080 (insert_pragma_entry): Rename local variable "new" to
6082 (save_registered_pragmas): Cast return value of xmemdup.
6083 (destringize_and_run): Same for alloca.
6084 (parse_assertion): Likewise.
6085 (do_assert): Cast allocated storage to proper type.
6086 (cpp_define): Likewise.
6087 (_cpp_define_builtin): Likewise.
6088 (cpp_undef): Likewise.
6089 (handle_assertion): Likewise.
6090 (cpp_push_buffer): Rename local variable "new" to "new_buffer".
6091 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
6092 (CPP_UMINUS): Likewise.
6093 (struct cpp_operator): Rename from struct operator.
6094 (_cpp_expand_op_stack): Use XRESIZEVEC.
6095 * files.c (pch_open_file): Use XNEWVEC.
6096 (pch_open_file): Use XRESIZEVEC.
6097 (read_file_guts): Use XNEWVEC and XRESIZEVEC.
6098 (dir_name_of_file): Use XNEWVEC.
6099 (make_cpp_file): Use XCNEW.
6100 (make_cpp_dir): Likewise.
6101 (allocate_file_hash_entries): USE XNEWVEC.
6102 (cpp_included): Cast return value of htab_find_with_hash.
6103 (append_file_to_dir): Use XNEWVEC.
6104 (read_filename_string): Likewise. Use XRESIZEVEC too.
6105 (read_name_map): Cast return value of alloca. Use XRESIZEVEC.
6106 (remap_filename): Use XNEWVEC.
6107 (struct pchf_entry): Move definition out of struct pchf_data.
6108 (_cpp_save_file_entries): Use XCNEWVAR.
6109 (_cpp_read_file_entries): Use XNEWVAR.
6110 * identifiers.c (alloc_node): Use XOBNEW.
6111 * init.c (cpp_create_reader): Use XCNEW.
6112 (cpp_init_builtins): Cast of b->value to enum builtin_type.
6113 (read_original_directory): Cast return value of alloca.
6114 * lex.c (add_line_note): Use XRESIZEVEC.
6115 (warn_about_normalization): Use XNEWVEC.
6116 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
6117 (new_buff): Use XNEWVEC.
6118 * line-map.c (linemap_add): Use XRESIZEVEC.
6119 * macro.c (builtin_macro): Cast return value of alloca.
6120 (paste_tokens): Likewise.
6121 (expand_arg): Use XNEWVEC and XRESIZEVEC.
6122 (_cpp_save_parameter): Use XRESIZEVEC.
6123 (create_iso_definition): Cast allocated storage to proper type.
6124 (_cpp_create_definition): Likewise.
6125 (cpp_macro_definition): Use XRESIZEVEC.
6126 * makedepend.c (add_clm): Use XNEW.
6127 (add_dir): Likewise.
6128 * mkdeps.c (munge): Use XNEWVEC.
6129 (deps_init): Use XCNEW.
6130 (deps_add_target): Use XRESIZEVEC.
6131 (deps_add_default_target): Cast return value of alloca.
6132 (deps_add_dep): Use XRESIZEVEC.
6133 (deps_add_vpath): Likewise. Use XNEWVEC too.
6134 (deps_restore): Likewise.
6135 * pch.c (save_idents): Use XNEW and XNEWVEC.
6136 (cpp_save_state): Use XNEW.
6137 (count_defs): Cast return value of htab_find.
6138 (write_defs): Likewise.
6139 (cpp_write_pch_deps): Use XNEWVEC.
6140 (collect_ht_nodes): Use XRESIZEVEC.
6141 (cpp_valid_state): Use XNEWVEC.
6142 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup.
6143 * symtab.c (ht_create): Use XCNEW.
6144 (ht_lookup_with_hash): Cast return value of obstack_copy0.
6145 (ht_expand): Use XCNEWVEC.
6146 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
6147 (bool): Do not define if __cplusplus.
6149 2005-05-12 Zack Weinberg <zack@codesourcery.com>
6151 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
6152 (do_sccs): Delete function definition, #define to do_ident.
6153 (do_ident): Don't hardwire directive name.
6155 2005-05-12 Ryota Kunisawa <kunisawa@access.co.jp>
6158 * configure: Regenerate.
6160 2005-04-27 Andris Pavenis <pavenis@latnet.lv>
6162 * files.c: Include io.h for DJGPP to get prototype of setmode.
6164 2005-04-19 Per Bothner <per@bothner.com>
6166 PR preprocessor/20907
6167 * line-map.c (linemap_line_start): Fix bug when we need to increse
6168 column_bits but can re-use the current line_map.
6170 2005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6172 * system.h (fopen, fdopen, freopen): Define these to the unlocked
6173 libiberty functions.
6175 2005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6177 * configure.ac (libcpp_UNLOCKED_FUNCS): New.
6178 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
6179 * system.h (putchar, getc, getchar, clearerr, feof, fileno,
6180 fflush, fgetc, fgets, ferror, fread): Redefine to the associated
6182 (fwrite_unlocked): Fix prototype.
6184 * configure, config.in: Regenerate.
6186 2005-04-05 Jakub Jelinek <jakub@redhat.com>
6188 PR preprocessor/19475
6189 * macro.c (create_iso_definition): For < ISO C99, don't
6190 pedwarn if there is no whitespace between macro name and its
6191 replacement, but the replacement starts with a basic character
6194 2005-03-28 Andreas Jaeger <aj@suse.de>
6196 * lex.c (warn_about_normalization): Cast field width to int to
6199 2005-03-19 Joseph S. Myers <joseph@codesourcery.com>
6201 * configure.ac: Consistently use solaris2.1[0-9]* instead of
6203 * configure: Regenerate.
6205 2005-03-15 Geoffrey Keating <geoffk@apple.com>
6207 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
6208 UCN rather than printing an error.
6210 2005-03-14 Geoffrey Keating <geoffk@apple.com>
6212 * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
6214 2005-03-14 Geoffrey Keating <geoffk@apple.com>
6216 * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
6217 * charset.c: Update for new format of ucnid.h.
6218 (ucn_valid_in_identifier): Update for new format of ucnid.h.
6219 Add NST parameter, and update it; update callers.
6220 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort
6222 (convert_ucn): Pass normalize_state to cpp_valid_ucn.
6223 * internal.h (struct normalize_state): New.
6224 (INITIAL_NORMALIZE_STATE): New.
6225 (NORMALIZE_STATE_RESULT): New.
6226 (NORMALIZE_STATE_UPDATE_IDNUM): New.
6227 (_cpp_valid_ucn): New.
6228 * lex.c (warn_about_normalization): New.
6229 (forms_identifier_p): Add normalize_state parameter, update callers.
6230 (lex_identifier): Add normalize_state parameter, update callers. Keep
6232 (lex_number): Likewise.
6233 (_cpp_lex_direct): Pass normalize_state to subroutines. Check
6234 it with warn_about_normalization.
6238 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove
6239 comments about obsolete version of C++.
6240 * include/cpplib.h (enum cpp_normalize_level): New.
6241 (struct cpp_options): Add warn_normalize field.
6243 2005-03-11 Geoffrey Keating <geoffk@apple.com>
6245 * directives.c (glue_header_name): Update call to cpp_spell_token.
6246 * internal.h (_cpp_interpret_identifier): New.
6247 * charset.c (_cpp_interpret_identifier): New.
6248 (_cpp_valid_ucn): Allow UCN version of '$'.
6249 * lex.c (lex_identifier): Add extra parameter to indicate if initial
6250 character was '$' or '\'. Support identifiers with UCNs.
6251 (forms_identifier_p): Allow UCNs.
6252 (_cpp_lex_direct): Pass extra parameter to lex_identifier.
6254 (cpp_spell_token): Add FORSTRING parameter. Use it.
6255 (cpp_token_as_text): Update call to cpp_spell_token.
6256 (cpp_output_token): Write UCNs back out.
6257 (stringify_arg): Update call to cpp_spell_token.
6258 (paste_tokens): Likewise.
6259 (cpp_macro_definition): Likewise.
6260 * macro.c (stringify_arg): Likewise.
6261 (paste_tokens): Likewise.
6262 (cpp_macro_definition): Likewise.
6263 * include/cpplib.h: Add parameter to cpp_spell_token.
6265 2005-03-04 Jakub Jelinek <jakub@redhat.com>
6269 * macro.c (replace_args, cpp_get_token): Copy whole
6270 cpp_token_u instead of just cpp_string field from it.
6272 2005-02-28 Devang Patel <dpatel@apple.com>
6274 * directives.c (do_line): Save sysp early before line table is
6277 2005-02-20 Zack Weinberg <zack@codesourcery.com>
6280 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
6281 (cpp_host_to_exec_charset): New function.
6282 * include/cpplib.h: Declare cpp_host_to_exec_charset.
6284 2005-02-19 Devang Patel <dpatel@apple.com>
6286 * charset.c (_cpp_convert_input): Check '\r' before inserting
6289 2005-02-15 Eric Christopher <echristo@redhat.com>
6291 PR preprocessor/19077
6292 * macro.c (cpp_macro_definition): Move handling of whitespace
6293 to PREV_WHITE conditional. Remove overloading of len
6296 2005-02-14 Kazu Hirata <kazu@cs.umass.edu>
6298 * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
6299 traditional.c: Update copyright.
6301 2005-02-14 Paolo Bonzini <bonzini@gnu.org>
6304 * configure.ac: Check for declaration of basename and getopt.
6305 * config.in: Regenerate.
6306 * configure: Regenerate.
6307 * internal.h (ustrcspn): New.
6308 * macro.c (create_iso_definition): Fix allocation of memory.
6309 (padding_token): Add cast to remove const-ness.
6310 * pch.c (cpp_read_state): Use ustrcspn.
6312 2005-02-08 Mike Stump <mrs@apple.com>
6314 * files.c (pchf_adder): Remove.
6315 (struct pchf_adder_info): Likewise.
6316 (_cpp_save_file_entries): Write out all files so that #import works.
6318 2005-01-23 Joseph S. Myers <joseph@codesourcery.com>
6320 * configure: Regenerate.
6322 2005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
6324 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
6326 * include/cpplib.h: Also update copyright years.
6328 2005-01-03 Geoffrey Keating <geoffk@apple.com>
6330 * files.c (_cpp_find_file): Add files found by search_path_exhausted
6331 to the list of all files.
6333 2005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
6335 * internal.h: Update references to Cpp lib filenames.
6336 * directives.c: Likewise.
6338 * macro.c: Likewise.
6339 * traditional.c: Likewise.
6341 2004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
6343 PR preprocessor/15167
6344 * files.c (destroy_cpp_file): New function.
6345 (should_stack_file): Make a new file if the
6346 compared file is still stacked.
6348 2004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
6350 PR preprocessor/17610
6351 * directives.c (do_include_common): Error out if an empty filename
6352 is given for #include (or #include_next or #import).
6354 2004-11-27 Roger Sayle <roger@eyesopen.com>
6355 Zack Weinberg <zack@codesourcery.com>
6357 * internal.h: Replace all uses of uchar with unsigned char.
6358 * include/cpp-id-data.h: Likewise. Guard typedef of uchar
6359 with !IN_GCC, so uchar is only defined whilst building libcpp.
6361 2004-11-24 Kelley Cook <kcook@gcc.gnu.org>
6363 * aclocal.m4: Regenerate.
6365 2004-11-24 Roger Sayle <roger@eyesopen.com>
6367 PR preprocessor/15824
6368 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
6369 directly, instead of the non-existant "system.h" and "ansidecl.h".
6370 * configure: Regenerate.
6372 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
6373 Joseph Myers <joseph@codesourcery.com>
6375 * internal.h (struct lexer_state): Add in_deferred_pragma.
6376 * directives.c (struct pragma_entry): Add allow_expansion.
6377 (insert_pragma_entry): Take allow_expansion flag.
6378 (register_pragma): Likewise.
6379 (cpp_register_pragma): Likewise.
6380 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
6381 (do_pragma): Honor allow_expansion.
6382 (cpp_handle_deferred_pragma): Set in_deferred_pragma.
6383 * include/cpplib.h (cpp_register_pragma): Update prototype.
6385 2004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
6386 Mark Mitchell <mark@codesourcery.com>
6388 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
6389 need_64bit_hwint=yes.
6390 * configure: Regenerate.
6392 2004-11-09 Joseph S. Myers <joseph@codesourcery.com>
6394 * Makefile.in ($(PACKAGE).pot): New rule. Depend on
6396 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
6397 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
6398 Remove local srcdir path from generated file.
6400 2004-11-04 Zack Weinberg <zack@codesourcery.com>
6401 Gerald Pfeifer <gerald@pfeifer.com>
6403 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
6406 2004-10-27 Zack Weinberg <zack@codesourcery.com>
6409 * directives.c (do_pragma): Do not defer pragmas which are unknown.
6410 (cpp_handle_deferred_pragma): Add cast to silence warning.
6412 2004-10-14 Joseph S. Myers <jsm@polyomino.org.uk>
6414 * errors.c (_cpp_begin_message): Print "error: " for errors.
6416 2004-10-10 Andreas Jaeger <aj@suse.de>
6418 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
6419 * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
6421 2004-10-08 Andrew Pinski <pinskia@physics.uc.edu>
6423 * pch.c (cpp_write_pch_state): Remove variable z as it is not
6425 (cpp_read_state): Remove unused variables, m, d and mac_count.
6427 2004-09-29 Per Bothner <per@bothner.com>
6429 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore
6430 cb.line_change. Otherwise do_pragma will call the line_change
6431 call-back with a meaningless line number.
6433 2004-09-24 Zack Weinberg <zack@codesourcery.com>
6435 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
6436 programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
6437 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
6438 * aclocal.m4, configure: Regenerate.
6439 * init.c: Include localedir.h.
6440 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
6442 (.c.o): Use $(ALL_CFLAGS).
6443 (localedir.h, localedir.hs): New rules.
6444 (clean): Use rm -rf to remove directories.
6445 (distclean): Also delete localedir.h and localedir.hs.
6446 (init.o): Update dependencies.
6448 2004-09-22 Kelley Cook <kcook@gcc.gnu.org>
6450 * Makefile.in (aclocal.m4): Update dependencies.
6451 * configure.ac (AC_CONFIG_MACRO_DIR): New.
6452 * aclocal.m4, configure: Regenerate.
6454 2004-09-17 Zack Weinberg <zack@codesourcery.com>
6456 * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
6457 (_cpp_convert_input, _cpp_default_encoding): Add comments.
6458 Some other comments in this file also tweaked.
6460 * directives.c (do_pragma): Save current buffer position
6461 before lexing the pragma keywords; don't call
6462 _cpp_backup_tokens in the defer_pragmas case.
6464 2004-09-15 Per Bothner <per@bothner.com>
6466 * include/line-map.h (line_map_start): Add parameter names so
6467 preceding comment makes sense.
6468 (linemap_add): Remove from comment mention of non-existing parameter.
6470 2004-09-09 Matt Austern <austern@apple.com>
6471 Zack Weinberg <zack@codesourcery.com>
6473 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
6474 prefixes throughout. Add entry for PRAGMA. Remove
6475 unnecessary "= 0" from EQ.
6476 (enum cpp_ttype): Adjust OP and TK definitions to restore
6477 prefixes, via token-paste.
6478 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
6479 Change from #defines to additional cpp_ttype enumerators.
6480 (struct cpp_options): Add defer_pragmas.
6481 (cpp_handle_deferred_pragma): Prototype new interface.
6483 * internal.h (struct cpp_reader): Add directive_result.
6484 * directives.c (struct pragma_entry): Add is_internal field;
6485 give boolean fields type bool.
6486 (start_directive): Initialize pfile->directive_result.type.
6487 (_cpp_do__Pragma): Likewise.
6488 (run_directive): Do not crash if pfile->buffer->prev is NULL.
6489 (insert_pragma_entry): Add 'internal' argument; set new->is_internal
6491 (register_pragma): New static function, bulk of former
6492 cpp_register_pragma here; add 'internal' argument, pass along
6493 to insert_pragma_entry.
6494 (cpp_register_pragma): Now a wrapper around register_pragma which
6495 always passes false for 'internal' argument.
6496 (_cpp_init_internal_pragmas): Call register_pragma directly, passing
6497 true for 'internal'.
6498 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
6499 an internal pragma, save text till the end of the line as a CPP_PRAGMA
6500 token instead of executing the pragma.
6501 (cpp_handle_deferred_pragma): New interface.
6502 * lex.c (token_spellings): Adjust OP and TK definitions to
6503 match changes to cpplib.h.
6504 (_cpp_lex_token): Check for a directive-result token and
6505 return it if present.
6506 (cpp_token_val_index): Handle CPP_PRAGMA.
6507 * macro.c (cpp_builtin_macro_text): Correct comment.
6508 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
6510 2004-09-06 Serge Belyshev <belyshev@lubercy.com>
6512 PR preprocessor/14699
6513 * symtab.c (ht_dump_statistics): Change type of sum_of_squares
6514 from size_t to double.
6516 2004-08-28 Andreas Schwab <schwab@suse.de>
6517 Andreas Jaeger <aj@suse.de>
6519 * configure.ac: Set PACKAGE correctly.
6520 * configure: Regenerated.
6522 2004-08-25 Paolo Bonzini <bonzini@gnu.org>
6524 * Makefile.in: Add back top_builddir.
6526 2004-08-25 Paolo Bonzini <bonzini@gnu.org>
6528 * configure.ac: Replace Automake macro invocations
6529 with manual Autoconf checks and substitutions.
6530 * configure: Regenerate.
6531 * aclocal.m4: Regenerate.
6532 * config.in: Regenerate.
6533 * Makefile.am: Removed.
6534 * Makefile.in: Heavy simplification and reorganization.
6536 2004-08-09 Mark Mitchell <mark@codesourcery.com>
6538 * configure.ac (arm*-*-eabi*): New target.
6539 (arm*-*-symbianelf*): Likewise.
6540 * configure: Regenerated.
6542 2004-07-24 Bernardo Innocenti <bernie@develer.com>
6544 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
6545 * directives.c: Use XNEW-family macros from libiberty.
6547 * macro.c: Likewise.
6548 * cpplib.h (cpp_deps_style): Export enum with name.
6550 2004-07-23 Matthias Klose <doko@debian.org>
6552 * init.c (init_library): Use PACKAGE for the text domain.
6554 2004-07-16 Andris Pavenis <pavenis@latnet.lv>
6556 PR preprocessor/16366
6557 * internal.h (struct cpp_reader): New field dir_hash.
6558 * files.c (make_cpp_dir): Use dir_hash, not file_hash.
6559 (_cpp_init_files, _cpp_cleanup_files): Update for new field.
6561 2004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
6563 PR preprocessor/16192
6564 PR preprocessor/15913
6565 PR preprocessor/15572
6566 * expr.c (_cpp_parse_expr): Handle remaining cases where an
6567 expression is missing.
6568 * init.c (post_options): Traditional cpp doesn't do // comments.
6570 2004-06-30 Per Bothner <per@bothner.com>
6572 * include/line-map.h (fileline): Remove old typedef.
6573 * internal.h (struct cpp_reader): Use source_location typedef instead.
6575 2004-06-26 Zack Weinberg <zack@codesourcery.com>
6577 Partially revert patch of 2004-06-05.
6578 * files.c (search_cache): Remove pfile argument. Don't check
6579 for file that would be found by "" or <> search here...
6580 (_cpp_find_file): ...do it here, before calling find_file_in_dir.
6581 Do not apply directory-of-current-file correction to files
6582 found by this check. Rearrange code slightly.
6584 2004-06-21 Geoffrey Keating <geoffk@apple.com>
6586 * files.c (should_stack_file): Correct swapped parameters to call
6588 * pch.c (cpp_valid_state): Handle -fpreprocessed.
6590 2004-06-15 Paolo Bonzini <bonzini@gnu.org>
6592 * Makefile.in: Regenerate with automake 1.8.5.
6593 * aclocal.m4: Likewise.
6594 * configure: Regenerate.
6596 2004-06-11 Zack Weinberg <zack@codesourcery.com>
6598 * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
6599 * configure, config.in: Regenerate.
6600 * system.h: Unconditionally define bool as unsigned char,
6601 BOOL_BITFIELD as unsigned int.
6602 * .cvsignore: New file.
6604 2004-06-09 Geoffrey Keating <geoffk@apple.com>
6606 * traditional.c (push_replacement_text): Set macro->traditional.
6607 (save_replacement_text): Likewise.
6608 * pch.c (cpp_write_pch_state): Don't write list of defined macros.
6609 (struct save_macro_item): Delete.
6610 (struct save_macro_data): Use a character array not the previous
6612 (save_macros): Save macro as text not as internal structures.
6613 (cpp_prepare_state): Update for changes to save_macro_data.
6614 (cpp_read_state): Don't read macros defined in PCH. Restore
6616 * macro.c (create_iso_definition): Honour alloc_subobject.
6617 Clear traditional flag.
6618 (_cpp_create_definition): Honour alloc_subobject.
6619 * lex.c (cpp_token_val_index): New.
6620 * internal.h: Include cpp-id-data.h.
6621 (uchar): Move definition to cpp-id-data.h.
6623 (cpp_macro): Likewise.
6624 * directives.c (struct answer): Move to cpp-id-data.h.
6625 (do_assert): Honour alloc_subobject.
6627 * include/symtab.h (struct ht): Add field 'alloc_subobject'.
6628 * include/cpplib.h (struct cpp_string): Add GTY marker.
6629 (enum cpp_token_fld_kind): New.
6630 (struct cpp_token): Add GTY markers.
6631 (cpp_token_val_index): Prototype.
6632 (CPP_HASHNODE_VALUE_IDX): New.
6633 (struct cpp_hashnode): Don't skip fields of 'value' when marking.
6634 * include/cpp-id-data.h: New file.
6636 2004-06-09 Paolo Bonzini <bonzini@gnu.org>
6638 * Makefile.am (all-local): New.
6639 * Makefile.in: Regenerate.
6641 2004-06-06 Roger Sayle <roger@eyesopen.com>
6643 * Makefile.am (LIBICONV): Declare.
6644 (makedepend_LDADD): Use LIBICONV.
6645 * Makefile.in: Regenerate.
6647 2004-06-05 Andrew Pinski <pinskia@physics.uc.edu>
6649 * Makefile.am (LIBINTL): Declare
6650 (makedepend_LDADD): Use LIBINTL.
6651 * Makefile.in: Regenerate.
6653 2004-06-05 Zack Weinberg <zack@codesourcery.com>
6655 * Makefile.am: Add makedepend.
6656 * Makefile.in, aclocal.m4: Regenerate.
6657 * charset.c: Insert a space to avoid a warning.
6658 * directives.c: Include mkdeps.h.
6659 (_cpp_handle_directive): Reenable macro expander if appropriate.
6660 (undefine_macros): Inline body of _cpp_free_definition for speed.
6661 Do not call undef callback or _cpp_warn_if_unused_macro.
6662 (cpp_get_deps): New interface.
6663 * files.c (search_cache): Add pfile argument. Check for file
6664 that would be found by "" or <> search here...
6665 (_cpp_find_file): ...not here. Correct recorded start_dir of
6666 files found by directory-of-current-file search that would be
6667 found by "" or <> search.
6668 * init.c (cpp_add_dependency_target): Delete.
6669 * internal.h (struct lexer_state): Add discarding_output flag.
6670 * lex.c (lex_identifier): Compute hash function while scanning.
6671 * macro.c (cpp_scan_nooutput): Disable macro expansion outside
6673 * makedepend.c: New file.
6674 * mkdeps.c (struct deps): Add vpath vector.
6675 (apply_vpath, deps_add_vpath): New function.
6676 (deps_free): Free vpath vector.
6677 (deps_add_dep, deps_add_target): Use apply_vpath.
6678 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
6679 (ht_lookup_with_hash): New function.
6680 * cpplib.h, mkdeps.h: Update prototypes.
6681 * symtab.h: Update prototypes.
6682 (HT_HASHSTEP, HT_FINISH): New macros.
6684 2004-05-29 Geoffrey Keating <geoffk@apple.com>
6686 * symtab.c (ht_create): Set entries_owned.
6687 (ht_destroy): Honour entries_owned.
6688 (ht_expand): Likewise.
6690 * include/symtab.h (struct ht): New field 'entries_owned'
6691 (ht_load): New prototype.
6693 2004-05-26 Paolo Bonzini <bonzini@gnu.org>
6696 * configure.ac: Fix m4 quoting when picking
6697 the size of HOST_WIDE_INT.
6698 * configure: Regenerate.
6700 2004-05-25 Paolo Bonzini <bonzini@gnu.org>
6702 * Makefile.am: the correct directory for
6703 gettext include files is given by @INCINTL@.
6704 * Makefile.in: Regenerate.
6706 2004-05-24 Paolo Bonzini <bonzini@gnu.org>
6708 * system.h [!ENABLE_NLS]: dgettext takes two
6711 2004-05-23 Paolo Bonzini <bonzini@gnu.org>
6713 Moved libcpp from the gcc subdirectory to the toplevel.
6714 * Makefile.am: New file.
6715 * Makefile.in: Regenerate.
6716 * configure.ac: New file.
6717 * configure: Regenerate.
6718 * config.in: Regenerate.
6719 * charset.c: Moved from gcc/cppcharset.c. Add note about
6720 brokenness of input charset detection. Adjust for change
6721 in name of cppucnid.h.
6722 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
6723 * expr.c: Moved from gcc/cppexp.c.
6724 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
6725 Remove #define of O_BINARY, it is in system.h.
6726 * identifiers.c: Moved from gcc/cpphash.c.
6727 * internal.h: Moved from gcc/cpphash.h. Change header
6728 guard name. All other files adjusted to match name change.
6729 * init.c: Moved from gcc/cppinit.c.
6730 (init_library) [ENABLE_NLS]: Call bindtextdomain.
6731 * lex.c: Moved from gcc/cpplex.c.
6732 * directives.c: Moved from gcc/cpplib.c.
6733 * macro.c: Moved from gcc/cppmacro.c.
6734 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
6735 * traditional.c: Moved from gcc/cpptrad.c.
6736 * ucnid.h: Moved from gcc/cppucnid.h. Change header
6738 * ucnid.pl: Moved from gcc/cppucnid.pl.
6739 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header
6741 * symtab.c: Moved from gcc/hashtable.c.
6742 * line-map.c: Moved from gcc. Do not include intl.h.
6743 * mkdeps.c: Moved from gcc.
6744 * system.h: New file.
6745 * include/cpplib.h: Moved from gcc. Change header guard name.
6746 * include/line-map.h: Moved from gcc. Change header guard name.
6747 * include/mkdeps.h: Moved from gcc. Change header guard name.
6748 * include/symtab.h: Moved from gcc/hashtable.h. Change header
6751 Copyright (C) 2004-2021 Free Software Foundation, Inc.
6753 Copying and distribution of this file, with or without modification,
6754 are permitted in any medium without royalty provided the copyright
6755 notice and this notice are preserved.