1 2019-01-01 Jakub Jelinek <jakub@redhat.com>
3 Update copyright years.
5 2018-11-27 Mike Gulick <mgulick@mathworks.com>
8 * location-example.txt: Update example -fdump-internal-locations
11 2018-11-27 Mike Gulick <mgulick@mathworks.com>
14 * files.c (_cpp_stack_include): Check if
15 line_table->highest_location is past current line before
18 2018-11-13 David Malcolm <dmalcolm@redhat.com>
20 * charset.c: Replace "source_location" with "location_t".
21 * directives-only.c: Likewise.
22 * directives.c: Likewise.
26 * include/cpplib.h: Likewise. Rename MAX_SOURCE_LOCATION to
28 * include/line-map.h: Likewise.
30 * internal.h: Likewise.
32 * line-map.c: Likewise.
33 * location-example.txt: Likewise.
36 * traditional.c: Likewise.
38 2018-11-07 Hafiz Abid Qadeer <abidh@codesourcery.com>
40 * configure: Regenerated.
42 2018-11-05 Martin Liska <mliska@suse.cz>
44 * symtab.c (ht_dump_statistics): Replace %zu with %lu format.
46 2018-11-05 Martin Liska <mliska@suse.cz>
48 * symtab.c (ht_dump_statistics): Fix format and
49 pass missing argument.
51 2018-11-05 Martin Liska <mliska@suse.cz>
53 * symtab.c (ht_dump_statistics): Make dump conditional
54 based on alloc_subobject.
56 2018-10-31 Joseph Myers <joseph@codesourcery.com>
59 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
60 * aclocal.m4, config.in, configure: Regenerate.
62 2018-10-31 Nathan Sidwell <nathan@acm.org>
64 * internal.h (struct cpp_reader): Rename forced_token_location_p
65 to forced_token_location and drop its pointerness.
66 * include/cpplib.h (cpp_force_token_locations): Take location, not
68 * init.c (cpp_create_reader): Adjust.
69 * lex.c (cpp_read_main_file):
71 * directives.c (do_include_common): Commonize cleanup path.
72 (_cpp_pop_buffer): Fix leak.
74 * include/line-map.h (IS_ORDINARY_LOC, IS_MACRO_LOC): New
76 (IS_ADHOC_LOC): Move earlier.
77 (MAP_ORDINARY_P): Use IS_ORDINARY_LOC.
78 * line-map.c (linemap_location_from_macro_expansion_p): Use
81 * include/cpplib.h (cpp_macro_definition_location): Make inline.
82 * macro.c (warn_of_redefinition): Fix comments, examine macro
84 (cpp_macro_definition_location): Don't define here.
86 * include/cpplib.h (HT_NODE): Don't cast NODE.
87 (NODE_LEN, NODE_NAME): Use HT_NODE.
89 * directives.c (DIRECTIVE_TABLE): Drop historical frequency
91 * files.c (_cpp_stack_file): Fix indentation.
93 2018-10-17 Joseph Myers <joseph@codesourcery.com>
95 * include/cpplib.h (enum c_lang): Add CLK_GNUC2X and CLK_STDC2X.
96 * init.c (lang_defaults): Add GNUC2X and STDC2X entries.
97 (cpp_init_builtins): Define __STDC_VERSION__ to 202000L for C2X.
99 2018-10-11 David Malcolm <dmalcolm@redhat.com>
101 * macro.c (_cpp_arguments_ok): If the argument count is wrong, add
102 a note showing the definition of the macro.
104 2018-10-11 Nathan Sidwell <nathan@acm.org>
106 * include/line-map.h (LINEMAPS_MACRO_LOWEST_LOCATION): Fix
108 * line-map.c (linemap_enter_macro): Use RAII. Clear all of the
111 2018-10-09 David Malcolm <dmalcolm@redhat.com>
113 * charset.c (noop_error_cb): Rename to...
114 (noop_diagnostic_cb): ...this, converting params to enums.
115 (cpp_interpret_string_ranges): Update for renaming and enums.
116 * directives.c (check_eol_1): Convert reason to enum.
117 (do_diagnostic): Convert code and reason to enum.
118 (do_error): Use CPP_W_NONE rather than 0.
119 (do_pragma_dependency): Likewise.
120 * errors.c (cpp_diagnostic_at): Convert level and reason to enums.
122 (cpp_diagnostic): Convert level and reason to enums.
123 (cpp_error): Convert level to enum.
124 (cpp_warning): Convert reason to enums.
125 (cpp_pedwarning): Likewise.
126 (cpp_warning_syshdr): Likewise.
127 (cpp_diagnostic_with_line): Convert level and reason to enums.
129 (cpp_error_with_line): Convert level to enum.
130 (cpp_warning_with_line): Convert reason to enums.
131 (cpp_pedwarning_with_line): Likewise.
132 (cpp_warning_with_line_syshdr): Likewise.
133 (cpp_error_at): Convert level to enum.
134 (cpp_errno): Likewise.
135 (cpp_errno_filename): Likewise.
136 * include/cpplib.h (enum cpp_diagnostic_level): Name this enum,
137 and move to before struct cpp_callbacks.
138 (enum cpp_warning_reason): Likewise.
139 (cpp_callbacks::diagnostic): Convert params from int to enums.
140 (cpp_error): Convert int param to enum cpp_diagnostic_level.
141 (cpp_warning): Convert int param to enum cpp_warning_reason.
142 (cpp_pedwarning): Likewise.
143 (cpp_warning_syshdr): Likewise.
144 (cpp_errno): Convert int param to enum cpp_diagnostic_level.
145 (cpp_errno_filename): Likewise.
146 (cpp_error_with_line): Likewise.
147 (cpp_warning_with_line): Convert int param to enum
149 (cpp_pedwarning_with_line): Likewise.
150 (cpp_warning_with_line_syshdr): Likewise.
151 (cpp_error_at): Convert int param to enum cpp_diagnostic_level.
152 * macro.c (create_iso_definition): Convert int to enum.
153 (_cpp_create_definition): Likewise.
155 2018-09-17 David Malcolm <dmalcolm@redhat.com>
157 * include/line-map.h (range_label::get_text): Add param
160 2018-08-30 Nathan Sidwell <nathan@acm.org>
162 * include/line-map.h (enum lc_reason): Comment each member
164 (struct line_maps): Fix reallocator comment.
166 2018-08-27 David Malcolm <dmalcolm@redhat.com>
169 * include/line-map.h (enum range_display_kind): New enum.
170 (struct location_range): Replace field "m_show_caret_p" with
171 "m_range_display_kind", converting from bool to the new enum.
172 (class rich_location): Add example of line insertion fix-it hint.
173 (rich_location::add_range): Convert param "show_caret_p" from bool
174 to enum range_display_kind and rename to "range_display_kind",
175 giving it a default of SHOW_RANGE_WITHOUT_CARET.
176 (rich_location::set_range): Likewise, albeit without a default.
177 * line-map.c (rich_location::rich_location): Update for conversion
178 of show_caret_p to tri-state enum.
179 (rich_location::add_range): Likewise.
180 (rich_location::set_range): Likewise.
182 2018-08-24 H.J. Lu <hongjiu.lu@intel.com>
185 * line-map.c (pure_location_p): Return true if linemap_lookup
187 (linemap_add): Set start_location to 0 if we run out of line map
190 2018-08-20 Nathan Sidwell <nathan@acm.org>
192 * include/cpplib.h: Fixup some whitespace.
193 (cpp_hashnode): Reduce type to 2 bit & flags to 8.
195 * include/cpplib.h (NODE_BUILTIN, NODE_MACRO_ARG): Delete.
197 (enum node_type): Replace NT_MACRO with NT_USER_MACRO,
198 NT_BUILTIN_MACRO, NT_MACRO_ARG. Delete NT_ASSERTION.
199 (NTV_MACRO, NTV_ANSWER, NTV_BUILTIN, NTV_ARGUMENT, NTV_NONE):
201 (CPP_HASHNODE_VALUE_IDX): Delete.
202 (union _cpp_hashnode_value): GTY tag from enum node_type directly.
203 (struct cpp_hashnode): Adjust GTY desc for value field.
204 (cpp_user_macro_p, cpp_builtin_macro_p, cpp_macro_p): Adjust.
205 * directives.c (undefine_macros): Clear value.anwers, adjust flag
207 (_cpp_test_assertion): No need to check NT_ASSERTION.
208 (do_assert, do_unassert): Likewise.
209 * init.c (cpp_init_special_builtins): Set type not flags.
210 * macro.c (struct macro_arg_saved_data): Add type field.
211 (cpp_get_token_1): Check type not NT_VOID.
212 (_cpp_free_definition): Adjust flag clearing. Nullify
214 (_cpp_save_parameter, _cpp_unsave_parameters): Save and restore
216 (lex_expansion_token): Check type not flags.
217 (_cpp_create_definition): Set type to NT_USER_MACRO.
218 (_cpp_notify_macro_use): Adjust type checking.
219 * pch.c (write_macdef, count_defs, write_defs, cpp_valid_state)
220 (save_macros): Adjust node type/flag handling.
221 * traditional.c (_cpp_scan_out_logical_line): Check type not flags.
223 * directives.c (do_undef): Use cpp_macro_p & cpp_builtin_macro_p.
224 * include/cpplib.h (enum cpp_macro_kind): Remove trailing comma.
225 (cpp_fun_like_macro_p): Make inline, define.
226 * macro.c (cpp_define_lazily): Use UCHAR_MAX.
227 (cpp_fun_like_macro_p): Delete.
229 * Makefile.in (TAGS_SOURCES): Remove cpp-id-data.h.
230 * include/cpp-id-data.h: Delete.
231 * internal.h: Include cpplib.h not cpp-id-data.h.
233 * include/cpp-id-data.h (struct answer): Delete.
234 * include/cpplib.h (struct answer): Don't forward-declare.
235 (enum cpp_macro_kind): Add cmk_assert.
236 (struct cpp_macro): Union parms and next assert chain.
237 (union _cpp_hashnode_value): 'answer' field is cpp_macro.
238 * directives.c (parse_answer): Convert to use cpp_macro. Return
240 (parse_assertion, find_answer, _cpp_test_assertion, cpp_do_assert)
241 (cpp_do_unassert): Convert to use cpp_macro.
242 * macro.c (warn_of_redefinition, _cpp_new_macro)
243 (check_trad_stringification, cpp_macro_definition): Adjust macro
245 * traditional.c (_cpp_replacement_text_len)
246 (_cpp_copy_replacement_text, _cpp_create_trad_definition): Likewise.
248 2018-08-17 Nathan Sidwell <nathan@acm.org>
250 * include/cpplib.h (struct cpp_callbacks): Replace
251 user_builtin_macro with user_lazy_macro.
252 (struct cpp_macro): add lazy field.
253 (enum cpp_builtin_type): Remove BT_FIRST_USER, BT_LAST_USER.
254 (cpp_define_lazily): Declare.
255 * macro.c (enter_macro_context) Use _cpp_maybe_notify_macro_use.
256 (warn_of_redefinition): Use cpp_builtin_macro_p, directly call
257 user_lazy_macro hook.
258 (_cpp_new_macro): Clear lazy field.
259 (cpp_define_lazily): Define.
260 (_cpp_notify_macro_use): Adjust lazy definition code.
261 (cpp_macro_definition): No need to do lazy definition here.
262 * pch.c (write_macdef, save_macros): Likewise.
264 * include/cpplib.h (enum cpp_macro_kind): New.
265 (struct cpp_macro): Make body trailing array. Add kind field,
266 delete traditional flag.
267 * internal.h (_cpp_new_macro): Declare.
268 (_cpp_reserve_room): New inline.
269 (_cpp_commit_buf): Declare.
270 (_cpp_create_trad_definition): Return new macro.
271 * lex.c (_cpp_commit_buff): New.
272 * macro.c (macro_real_token_count): Count backwards.
273 (replace_args): Pointer equality not orderedness.
274 (_cpp_save_parameter): Use _cpp_reserve_room.
275 (alloc_expansion_token): Delete.
276 (lex_expansion_token): Return macro pointer. Use _cpp_reserve_room.
277 (create_iso_definition): Allocate macro itself. Adjust for
278 different allocation ordering.
279 (_cpp_new_macro): New.
280 (_cpp_create_definition): Adjust for API changes.
281 * traditional.c (push_replacement_text): Don't set traditional
283 (save_replacement_text): Likewise.
284 (_cpp_create_trad_definition): Allocate macro itself, Adjust for
285 different allocation ordering.
287 * cpp-id-data.h (uchar, UC): Move to internal.h
288 (struct cpp_macro): Move to cpplib.h.
289 * internal.h (uchar, UC): From cpp-id-data.h.
290 * include/cpplib.h (struct cpp_macro): From cpp-id-data.h.
292 2018-08-16 Nathan Sidwell <nathan@acm.org>
294 * internal.h (_cpp_save_parameter): Take parmno, not macro.
295 (_cpp_unsave_parameters): Declare.
296 * macro.c (_cpp_save_parameter): Take parm number, not macro.
297 Return true on success.
298 (_cpp_unsave_parameters): New.
299 (parse_params): Take parm_no and variadic pointers, not macro.
300 Reimplement parsing logic.
301 (create_iso_definition): Adjust parse_params changes. Call
302 _cpp_unsave_parameters here.
303 (_cpp_create_definition): Don't unsave params here.
304 * traditional.c (scan_parameters): Take n_param pointer, adjust.
305 (_cpp_create_trad_definition): Ajust scan_parameters change. Call
306 _cpp_unsave_parameters.
308 * include/cpplib.h (cpp_user_macro_p, cpp_builtin_macro_p)
309 (cpp_macro_p): New inlines.
310 * directives.c (do_pragma_poison): Use cpp_macro_p.
311 (do_ifdef, do_ifndef): Likewise. Use _cpp_maybe_notify_macro_use.
312 (cpp_pop_definition): Use cpp_macro_p. Move _cpp_free_definition
313 earlier. Don't zap node directly.
314 * expr.c (parse_defined): Use _cpp_maybe_notify_macro_use &
316 * files.c (should_stack_file): Use cpp_macro_p.
317 * identifiers.c (cpp_defined): Likewise.
318 * internal.h (_cpp_mark_macro): Use cpp_user_macro_p.
319 (_cpp_notify_macro_use): Declare.
320 (_cpp_maybe_notify_macro_use): New inline.
321 * lex.c (is_macro): Use cpp_macro_p.
322 * macro.c (_cpp_warn_if_unused_macro): Use cpp_user_macro_p.
323 (enter_macro_context): Likewise.
324 (_cpp_create_definition): Use cpp_builtin_macro_p,
325 cpp_user_macro_p. Move _cpp_free_definition earlier.
326 (_cpp_notify_macro_use): New, broken out of multiple call sites.
327 * traditional.c (fun_like_macro_p): Use cpp_builtin_macro_p.
328 (maybe_start_funlike, _cpp_scan_out_logical_line)
329 (push_replacement_text): Likewise.
331 2018-08-15 David Malcolm <dmalcolm@redhat.com>
333 * include/line-map.h (struct location_range): Add "m_label" field.
334 (class rich_location): Add description of labels to leading
336 (rich_location::rich_location): Add "label" param, defaulting to
338 (rich_location::add_range): Likewise.
339 (struct label_text): New struct.
340 (class range_label): New abstract base class.
341 * line-map.c (rich_location::rich_location): Add "label" param;
343 (rich_location::add_range): Likewise.
345 2018-08-08 Nathan Sidwell <nathan@acm.org>
347 Make linemap::included_from a location
349 * include/line-map.h (struct line_map_ordinary): Replace
350 included_from map index with included_at source_location.
351 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Delete.
352 (LAST_SOURCE_LINE_LOCATION): Delete.
353 (LAST_SOURCE_LINE, LAST_SOURCE_COLUMN): Delete.
354 (linemap_included_from): New.
355 (linemap_included_from_linemap): Declare.
356 (MAIN_FILE_P): Adjust.
357 * line-map.c (linemap_included_from_linemap): New.
358 (lonemap_check_files_exited): Use linemap_included_at.
359 (linemap_add): Adjust inclusion setting.
360 (linemap_dump, linemap_dump_location): Adjust.
361 * directives.c (do_linemarker): Use linemap_included_at.
363 2018-08-07 Nathan Sidwell <nathan@acm.org>
365 * line-map.c: (linemap_init): Set default allocator here.
366 (new_linemap): Rather than here. Refactor allocation logic.
368 2018-07-20 David Malcolm <dmalcolm@redhat.com>
370 * include/line-map.h (rich_location::set_range): Remove redundant
371 line_maps * parameter.
372 * line-map.c (rich_location::set_range): Likewise.
374 2018-07-18 Bernd Edlinger <bernd.edlinger@hotmail.de>
377 * macro.c (enter_macro_context): Change the location info for builtin
378 macros and _Pragma from location of the closing parenthesis to location
379 of the macro expansion point.
381 2018-07-17 Jason Franklin <j_fra@fastmail.us>
382 Jakub Jelinek <jakub@redhat.com>
384 * lex.c (_cpp_lex_direct): Use CPP_DL_NOTE instead of CPP_DL_PEDWARN,
385 CPP_DL_WARNING or CPP_DL_ERROR for note that diagnostics for C++ style
386 comments is reported only once per file and guard those calls on the
387 preceding cpp_error returning true.
389 2018-07-03 Nathan Sidwell <nathan@acm.org>
391 Reorg line_map data structures for better packing.
392 * include/line-map.h (enum lc_reason): Add LC_HWM.
393 (LINE_MAP_MAX_LOCATION): Define here.
394 (struct line_map): Move reason field to line_map_ordinary. Adjust
396 (struct line_map_ordinary): Reorder fields for less padding.
397 (struct line_map_macro): Likewise.
398 (MAP_ORDINARY_P): New.
399 (linemap_check_ordinary, linemap_check_macro): Adjust.
400 * line-map.c (LINE_MAP_MAX_SOURCE_LOCATION): Delete.
401 (new_linemap): Take start_location, not reason. Adjust.
402 (linemap_add, linemap_enter_macro): Adjust.
403 (linemap_line_start): Likewise.
404 (linemap_macro_expansion_map_p): Use MAP_ORDINARY_P.
405 (linemap_macro_loc_to_spelling_point): Likewise.
406 (linemap_macro_loc_to_def_point): Likewise.
407 (linemap_dump): Likewise.
409 2018-05-23 Jason Merrill <jason@redhat.com>
411 * system.h: #include <new> earlier.
413 2018-05-17 Jason Merrill <jason@redhat.com>
415 * line-map.c (linemap_init): Use placement new.
416 * system.h: #include <new>.
418 2018-03-14 David Malcolm <dmalcolm@redhat.com>
420 * include/line-map.h (compare): New function on linenum_type.
422 2018-02-28 Jonathan Wakely <jwakely@redhat.com>
424 PR preprocessor/84517
425 * lex.c (is_macro_not_literal_suffix): New function.
426 (lex_raw_string, lex_string): Use is_macro_not_literal_suffix to
427 decide when to issue -Wliteral-suffix warnings.
429 2018-02-16 Richard Biener <rguenther@suse.de>
432 * line-map.c (linemap_init): Avoid broken value-init when compiling
435 2018-02-15 Jason Merrill <jason@redhat.com>
436 Jakub Jelinek <jakub@redhat.com>
438 PR preprocessor/83063 - __VA_OPT__ and ##
439 PR preprocessor/83708
440 * macro.c (vaopt_state): Reorder m_last_was_paste before m_state.
441 (vaopt_state::vaopt_state): Adjust.
442 (vaopt_state::update_flags): Add BEGIN and END.
443 (vaopt_state::update): Return them.
444 (copy_paste_flag): Factor out of replace_args.
445 (last_token_is): New.
446 (replace_args): Handle BEGIN and END. Avoid padding there.
447 (tokens_buff_last_token_ptr): Return NULL if no tokens.
449 2018-01-31 Jakub Jelinek <jakub@redhat.com>
451 PR preprocessor/69869
452 * traditional.c (skip_macro_block_comment): Return bool, true if
453 the macro block comment is unterminated.
454 (copy_comment): Use return value from skip_macro_block_comment instead
457 2018-01-27 Jakub Jelinek <jakub@redhat.com>
459 * include/cpplib.h (enum cpp_builtin_type): Change BT_LAST_USER from
460 BT_FIRST_USER + 31 to BT_FIRST_USER + 63.
462 2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
465 * include/cpplib.h (cpp_callbacks::remap_filename): New callback.
466 * macro.c (_cpp_builtin_macro_text): Call remap_filename for
467 __FILE__ and __BASE_FILE__.
469 2018-01-10 Kelvin Nilsen <kelvin@gcc.gnu.org>
471 * lex.c (search_line_fast): Remove illegal coercion of an
472 unaligned pointer value to vector pointer type and replace with
473 use of __builtin_vec_vsx_ld () built-in function, which operates
474 on unaligned pointer values.
476 2018-01-03 Jakub Jelinek <jakub@redhat.com>
478 Update copyright years.
480 2017-12-20 Michael Weiser <michael.weiser@gmx.de>
482 PR preprocessor/83492
483 * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]:
484 Fix selection of big-endian shift parameters by using
487 2017-12-14 Bernd Edlinger <bernd.edlinger@hotmail.de>
489 * internal.h (maybe_print_line): Change signature.
491 2017-12-05 Jakub Jelinek <jakub@redhat.com>
494 * expr.c (interpret_float_suffix): Avoid memcmp.
495 (interpret_int_suffix): Likewise. Don't check for if.
497 2017-12-01 Jason Merrill <jason@redhat.com>
499 PR c++/79228 - extensions hide C++14 complex literal operators
500 * expr.c (interpret_float_suffix): Ignore 'i' in C++14 and up.
501 (interpret_int_suffix): Likewise.
503 2017-11-28 David Malcolm <dmalcolm@redhat.com>
506 * include/line-map.h (LINE_MAP_MAX_COLUMN_NUMBER): Move here.
507 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): ...from here.
508 (rich_location::maybe_add_fixit): Reject fix-it hints in which
509 the start column exceeds the next column.
511 2017-11-20 Eric Gallager <egall@gwmail.gwu.edu>
513 PR preprocessor/81794
514 * macro.c (check_trad_stringification): Have warning be controlled
517 2017-11-20 David Malcolm <dmalcolm@redhat.com>
520 * include/cpplib.h (cpp_macro_definition_location): New decl.
521 * macro.c (cpp_macro_definition): New function.
523 2017-11-13 Tom Tromey <tom@tromey.com>
525 * pch.c (cpp_read_state): Set n__VA_OPT__.
526 * macro.c (vaopt_state): New class.
527 (_cpp_arguments_ok): Check va_opt flag.
528 (replace_args, create_iso_definition): Use vaopt_state.
529 * lex.c (lex_identifier_intern): Possibly issue errors for
531 (lex_identifier): Likewise.
532 (maybe_va_opt_error): New function.
533 * internal.h (struct lexer_state) <va_args_ok>: Update comment.
534 (struct spec_nodes) <n__VA_OPT__>: New field.
535 * init.c (struct lang_flags) <va_opt>: New field.
536 (lang_defaults): Add entries for C++2A. Update all entries for
538 (cpp_set_lang): Initialize va_opt.
539 * include/cpplib.h (struct cpp_options) <va_opt>: New field.
540 * identifiers.c (_cpp_init_hashtable): Initialize n__VA_OPT__.
542 2017-11-13 David Malcolm <dmalcolm@redhat.com>
544 * include/line-map.h (linenum_type): Move this typedef and the
545 comment describing column numbering to near the top of the file.
547 2017-11-06 Mukesh Kapoor <mukesh.kapoor@oracle.com>
550 * lex.c (lex_string): When checking for a valid macro for the
551 warning related to -Wliteral-suffix (CPP_W_LITERAL_SUFFIX),
552 check that the macro name does not start with an underscore
553 before calling is_macro().
555 2017-11-05 Tom de Vries <tom@codesourcery.com>
558 * lex.c (BUF_APPEND): Remove semicolon after
561 2017-10-31 David Malcolm <dmalcolm@redhat.com>
563 * directives.c (_cpp_handle_directive): Update for renaming of
564 cpp_error_at_richloc to cpp_error_at.
565 * errors.c (cpp_diagnostic_at_richloc): Rename to...
566 (cpp_diagnostic_at): ...this, dropping the location_t-based
568 (cpp_diagnostic): Update for removal of location_t-based
570 (cpp_error_at): Likewise.
571 (cpp_error_at_richloc): Rename to...
572 (cpp_error_at): ...this, and update for renaming of
573 cpp_diagnostic_at_richloc.
574 * include/cpplib.h (cpp_error_at_richloc): Rename to...
575 (cpp_error_at): ...this.
577 2017-10-30 Joseph Myers <joseph@codesourcery.com>
579 * include/cpplib.h (enum c_lang): Add CLK_GNUC17 and CLK_STDC17.
580 * init.c (lang_defaults): Add GNUC17 and STDC17 data.
581 (cpp_init_builtins): Handle C17 value of __STDC_VERSION__.
583 2017-10-10 Nathan Sidwell <nathan@acm.org>
585 PR preprocessor/82506
586 * macro.c (cpp_quote_string): Escape raw LFs.
588 2017-09-15 Andrew Sutton <andrew.n.sutton@gmail.com>
589 Jakub Jelinek <jakub@redhat.com>
591 Add support for -std=c++2a.
592 * include/cpplib.h (c_lang): Add CXX2A and GNUCXX2A.
593 * init.c (lang_defaults): Add rows for CXX2A and GNUCXX2A.
594 (cpp_init_builtins): Set __cplusplus to 201709L for C++2a.
596 2017-09-15 Jakub Jelinek <jakub@redhat.com>
598 * include/cpplib.h (enum c_lang): Rename CLK_GNUCXX1Z
599 to CLK_GNUCXX17 and CLK_CXX1Z to CLK_CXX17.
600 * init.c (lang_defaults, cpp_init_builtins): Likewise.
601 * expr.c (cpp_classify_number): Use C++17 instead of C++1z
604 2017-07-07 David Malcolm <dmalcolm@redhat.com>
607 * line-map.c (linemap_macro_loc_to_def_point): Preserve range
608 information for macro expansions by delaying resolving ad-hoc
609 locations until within the loop.
611 2017-07-06 David Malcolm <dmalcolm@redhat.com>
614 * include/line-map.h (enum location_aspect): New enum.
615 (linemap_client_expand_location_to_spelling_point): Add
616 enum location_aspect param.
617 * line-map.c (rich_location::get_expanded_location): Update for
618 new param of linemap_client_expand_location_to_spelling_point.
619 (rich_location::maybe_add_fixit): Likewise.
620 (fixit_hint::affects_line_p): Likewise.
622 2017-06-21 Jakub Jelinek <jakub@redhat.com>
624 * line-map.c (location_adhoc_data_update): Perform addition in
625 uintptr_t type rather than char * type. Read *data using
626 ptrdiff_t type instead of int64_t.
627 (get_combined_adhoc_loc): Change offset type to ptrdiff_t from
630 2017-06-20 David Malcolm <dmalcolm@redhat.com>
632 * include/line-map.h (class rich_location): Document that attempts
633 to delete or replace a range *affecting* multiple lines will fail.
634 * line-map.c (rich_location::maybe_add_fixit): Implement this
637 2017-06-09 David Malcolm <dmalcolm@redhat.com>
640 (rich_location::fixits_cannot_be_auto_applied): New method.
641 (rich_location::fixits_can_be_auto_applied_p): New accessor.
642 (rich_location::m_fixits_cannot_be_auto_applied): New field.
643 * line-map.c (rich_location::rich_location): Initialize new field.
645 2017-06-05 David Malcolm <dmalcolm@redhat.com>
647 * include/cpplib.h (struct cpp_callbacks): Add "comment"
649 * lex.c (_cpp_lex_direct): Call the comment callback if non-NULL.
651 2017-05-02 David Malcolm <dmalcolm@redhat.com>
653 * include/line-map.h (class rich_location): Update description of
655 (class fixit_hint): Likewise.
656 (fixit_hint::ends_with_newline_p): New decl.
657 * line-map.c (rich_location::maybe_add_fixit): Support newlines
658 in fix-it hints that are insertions of single lines at the start
659 of a line. Don't consolidate into such fix-it hints.
660 (fixit_hint::ends_with_newline_p): New method.
662 2017-05-01 David Malcolm <dmalcolm@redhat.com>
664 * include/line-map.h (source_range::intersects_line_p): Delete.
665 (rich_location::add_fixit): Delete.
666 (rich_location::maybe_add_fixit): New method.
667 (class fixit_hint): Reimplement in terms of...
668 (class fixit_replace): ...this.
669 (class fixit_insert): Delete.
670 * line-map.c (linemap_position_for_loc_and_offset): Drop overzealous
671 linemap_assert_fails.
672 (source_range::intersects_line_p): Rename to...
673 (fixit_hint::affects_line_p): New function.
674 (rich_location::add_fixit_insert_before): Reimplement in terms of
675 maybe_add_fixit, moving validation there.
676 (rich_location::add_fixit_insert_after): Likewise.
677 (column_before_p): Delete.
678 (rich_location::add_fixit_replace): Reimplement in terms of
679 maybe_add_fixit, moving validation there. Convert closed input range
681 (rich_location::add_fixit): Delete.
682 (rich_location::maybe_add_fixit): New function.
683 (fixit_insert::fixit_insert): Delete.
684 (fixit_insert::~fixit_insert): Delete.
685 (fixit_insert::affects_line_p): Delete.
686 (fixit_insert::maybe_append_replace): Delete.
687 (fixit_replace::fixit_replace): Rename to...
688 (fixit_hint::fixit_hint): ...this, rewriting as necessary.
689 (fixit_replace::~fixit_replace): Delete.
690 (fixit_replace::affects_line_p): Delete.
691 (fixit_replace::maybe_append_replace): Rename to...
692 (fixit_hint::maybe_append): ...this, rewriting as necessary.
694 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
696 * include/line-map.h (LINEMAPS_MACRO_MAPS): Fix typo in comment.
697 * lex.c (search_line_fast): Likewise.
698 * pch.h (cpp_valid_state): Likewise.
700 2017-03-21 Andreas Schwab <schwab@suse.de>
702 * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]:
703 Convert 64-bit value to boolean before passing to
706 2017-03-16 Jason Merrill <jason@redhat.com>
708 * init.c (cpp_init_builtins): Update __cplusplus for C++17.
710 2017-02-09 Gerald Pfeifer <gerald@pfeifer.com>
712 * Makefile.in (po/$(PACKAGE).pot): Adjust bug reporting URL.
714 2017-01-10 David Malcolm <dmalcolm@redhat.com>
717 * line-map.c (linemap_position_for_column): When calling
718 linemap_start_line, detect if a new linemap was created with
719 0 column bits, and bail out early if this is the case.
720 (linemap_position_for_loc_and_offset): Replace overzealous
721 linemap_assert_fails with a simple conditional; use correct
724 2017-01-07 David Malcolm <dmalcolm@redhat.com>
727 * line-map.c (linemap_line_start): When determining if the highest
728 column given out so far will fit into a proposed change to the
729 current map, use the effective number of column bits, rather than
730 the total number of column + range bits.
732 2017-01-01 Jakub Jelinek <jakub@redhat.com>
734 Update copyright years.
736 2016-12-15 David Malcolm <dmalcolm@redhat.com>
738 PR preprocessor/78680
739 PR preprocessor/78811
740 * lex.c (_cpp_lex_direct): Only determine the end-location of
741 the token and build a range for non-reserved start locations.
742 Do not do it for EOF tokens.
744 2016-12-12 David Malcolm <dmalcolm@redhat.com>
746 PR preprocessor/78680
747 * lex.c (_cpp_lex_direct): Ensure line notes are processed before
748 computing the end-point of the token.
750 2016-11-23 Paolo Bonzini <bonzini@gnu.org>
752 * include/cpplib.h (struct cpp_options): Add new member
753 warn_expansion_to_defined.
754 (CPP_W_EXPANSION_TO_DEFINED): New enum member.
755 * expr.c (parse_defined): Warn for all uses of "defined"
756 in macros, and tie warning to CPP_W_EXPANSION_TO_DEFINED.
757 Make it a pedwarning instead of a warning.
758 * system.h (HAVE_DESIGNATED_INITIALIZERS): Do not use
761 2016-11-17 David Malcolm <dmalcolm@redhat.com>
763 * charset.c (cpp_interpret_string_1): Skip locations from
764 loc_reader when advancing 'p' when handling raw strings.
766 2016-11-16 Jakub Jelinek <jakub@redhat.com>
769 * configure.ac (ENABLE_ASSERT_CHECKING): Define if gcc configure
770 would define that macro.
771 * configure: Regenerated.
772 * config.in: Regenerated.
774 2016-11-08 Richard Earnshaw <rearnsha@arm.com>
776 * lex.c (search_line_fast): New implementation for AArch64.
778 2016-10-25 David Malcolm <dmalcolm@redhat.com>
780 * files.c (destroy_cpp_file): Free file->path.
782 2016-10-25 David Malcolm <dmalcolm@redhat.com>
784 * include/line-map.h (line_maps::~line_maps): New dtor.
785 (location_adhoc_data_fini): Delete decl.
786 * line-map.c (line_maps::~line_maps): New dtor.
787 (location_adhoc_data_fini): Delete.
789 2016-10-21 Andris Pavenis <andris.pavenis@iki.fi>
791 PR preprocessor/71681
792 * files.c (remap_filename): Fix handling -remap in subdirectories.
794 2016-10-12 Jakub Jelinek <jakub@redhat.com>
796 * include/cpplib.h (struct cpp_options): Add
797 cpp_warn_implicit_fallthrough.
798 * init.c (cpp_create_reader): Initialize it to 0.
799 * lex.c (fallthrough_comment_p): Handle different
800 cpp_warn_implicit_fallthrough levels. Whitespace fixes.
802 2016-10-08 Jakub Jelinek <jakub@redhat.com>
804 * lex.c (fallthrough_comment_p): Accept Else, fallthrough.
806 * lex.c (fallthrough_comment_p): Extend to handle more common FALLTHRU
809 * lex.c (fallthrough_comment_p): Fix off-by-one size comparison
811 (_cpp_lex_direct): Allow arbitrary comments in between
812 fallthrough_comment_p comment and following token.
814 2016-10-04 Kelvin Nilsen <kelvin@gcc.gnu.org>
817 * lex.c (search_line_fast): Add a FALLTHROUGH comment to correct
818 compiler error in the version of this function that is
819 conditionally compiled when GCC_VERSION >= 4005 and both
820 __ALTIVEC__ and __BIG_ENDIAN__ symbols are defined.
822 2016-09-26 Marek Polacek <polacek@redhat.com>
823 Jakub Jelinek <jakub@redhat.com>
826 * include/cpplib.h (PREV_FALLTHROUGH): Define.
827 * internal.h (CPP_FALLTHRU): Define.
828 * lex.c (fallthrough_comment_p): New function.
829 (_cpp_lex_direct): Set PREV_FALLTHROUGH on tokens succeeding a falls
832 2016-09-23 David Malcolm <dmalcolm@redhat.com>
834 PR preprocessor/77672
835 * charset.c (cpp_interpret_string_1): Add a source_range for the
836 NUL-terminator, using the location of the trailing quote of the
839 2016-09-21 Jason Merrill <jason@redhat.com>
841 * line-map.c (linemap_location_from_macro_definition_p): New.
842 * line-map.h: Declare it.
844 2016-09-15 David Malcolm <dmalcolm@redhat.com>
846 * include/line-map.h (class rich_location): Note that newlines
847 aren't supported in fix-it text.
848 * line-map.c (rich_location::add_fixit_insert_before): Reject
849 attempts to add fix-its containing newlines.
850 (rich_location::add_fixit_replace): Likewise.
852 2016-09-13 David Malcolm <dmalcolm@redhat.com>
854 * include/line-map.h (class rich_location): Add description of
855 fix-it hints to leading comment.
856 (rich_location::add_fixit_insert): Rename both overloaded methods
858 (rich_location::add_fixit_insert_before): ...this, updating their
860 (rich_location::add_fixit_insert_after): Two new overloaded
862 (rich_location::stop_supporting_fixits): New method.
863 * line-map.c (rich_location::add_fixit_insert): Rename both
864 overloaded methods to..
865 (rich_location::add_fixit_insert_before): ...this, updating their
867 (rich_location::add_fixit_insert_after): Two new methods.
868 (rich_location::reject_impossible_fixit): Split out
869 failure-handling into...
870 (rich_location::stop_supporting_fixits): New method.
872 2016-09-02 David Malcolm <dmalcolm@redhat.com>
874 * include/line-map.h (rich_location::seen_impossible_fixit_p): New
877 2016-08-31 David Malcolm <dmalcolm@redhat.com>
879 * include/line-map.h (class fixit_remove): Remove stray decl.
880 (fixit_hint::affects_line_p): Make const.
881 (fixit_insert::affects_line_p): Likewise.
882 (fixit_replace::affects_line_p): Likewise.
883 * line-map.c (fixit_insert::affects_line_p): Likewise.
884 (fixit_replace::affects_line_p): Likewise.
886 2016-08-30 David Malcolm <dmalcolm@redhat.com>
888 * include/line-map.h (class semi_embedded_vec): New class.
889 (semi_embedded_vec<T, NUM_EMBEDDED>::semi_embedded_vec): New ctor.
890 (semi_embedded_vec<T, NUM_EMBEDDED>::~semi_embedded_vec): New
892 (semi_embedded_vec<T, NUM_EMBEDDED>::operator[]): New methods.
893 (semi_embedded_vec<T, NUM_EMBEDDED>::push): New method.
894 (semi_embedded_vec<T, NUM_EMBEDDED>::truncate): New method.
895 (rich_location::get_num_locations): Reimplement in terms of
897 (rich_location::get_range): Make non-inline.
898 (rich_location::get_num_fixit_hints): Reimplement in terms of
900 (rich_location::add_fixit): New function.
901 (rich_location::MAX_RANGES): Rename to...
902 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this.
903 (rich_location::MAX_FIXIT_HINTS): Rename to...
904 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this, and make
906 (rich_location::m_num_ranges): Eliminate in favor of...
907 (rich_location::m_ranges): ...this, converting from a fixed-size
908 array to a semi_embedded_vec.
909 (rich_location::m_num_fixit_hints): Eliminate in favor of...
910 (rich_location::m_fixit_hints): ...this, converting from a
911 fixed-size array to a semi_embedded_vec.
912 * line-map.c (rich_location::rich_location): Update for above
914 (rich_location::~rich_location): Likewise.
915 (rich_location::get_loc): Likewise.
916 (rich_location::get_range): New methods.
917 (rich_location::add_range): Update for above changes.
918 (rich_location::set_range): Likewise.
919 (rich_location::add_fixit_insert): Likewise.
920 (rich_location::add_fixit_replace): Likewise.
921 (rich_location::get_last_fixit_hint): Likewise.
922 (rich_location::reject_impossible_fixit): Likewise.
923 (rich_location::add_fixit): New method.
925 2016-08-30 David Malcolm <dmalcolm@redhat.com>
927 * include/line-map.h (rich_location::add_fixit_insert): Add
928 comments. Add overload omitting the source_location param.
929 (rich_location::add_fixit_remove): Add comments. Add overloads
930 omitting the range, and accepting a source_location.
931 (rich_location::add_fixit_replace): Likewise.
932 * line-map.c (rich_location::add_fixit_insert): Add comments. Add
933 overload omitting the source_location param.
934 (rich_location::add_fixit_remove): Add comments. Add overloads
935 omitting the range, and accepting a source_location.
936 (rich_location::add_fixit_replace): Likewise.
938 2016-08-26 David Malcolm <dmalcolm@redhat.com>
940 * include/line-map.h (get_pure_location): New decl.
941 * line-map.c (get_pure_location): Move here, from gcc/input.c, adding
943 (rich_location::add_fixit_insert): Call get_pure_location on "where".
944 (rich_location::add_fixit_replace): Call get_pure_location on the
947 2016-08-26 David Malcolm <dmalcolm@redhat.com>
949 * include/line-map.h (rich_location): Eliminate unimplemented
950 constructor based on source_range.
951 (rich_location::get_last_fixit_hint): New method.
952 (rich_location::reject_impossible_fixit): New method.
953 (rich_location): Add fields m_line_table and
954 m_seen_impossible_fixit.
955 (fixit_hint::maybe_append_replace): New pure virtual function.
956 (fixit_insert::maybe_append_replace): New function.
957 (fixit_replace::maybe_append_replace): New function.
958 * line-map.c (rich_location::rich_location): Initialize
959 m_line_table and m_seen_impossible_fixit.
960 (rich_location::add_fixit_insert): Call
961 reject_impossible_fixit and bail out if true.
962 (column_before_p): New function.
963 (rich_location::add_fixit_replace): Call reject_impossible_fixit
964 and bail out if true. Attempt to consolidate with neighboring
966 (rich_location::get_last_fixit_hint): New method.
967 (rich_location::reject_impossible_fixit): New method.
968 (fixit_insert::maybe_append_replace): New method.
969 (fixit_replace::maybe_append_replace): New method.
971 2016-08-23 David Malcolm <dmalcolm@redhat.com>
973 * include/line-map.h (source_range::from_locations): New method.
975 2016-08-19 David Malcolm <dmalcolm@redhat.com>
977 * include/line-map.h (fixit_hint::kind): Delete REPLACE.
978 (class fixit_remove): Delete.
979 * line-map.c (rich_location::add_fixit_remove): Reimplement
980 by calling add_fixit_replace with an empty string.
981 (fixit_remove::fixit_remove): Delete.
982 (fixit_remove::affects_line_p): Delete.
984 2016-08-19 Joseph Myers <joseph@codesourcery.com>
987 * include/cpplib.h (CPP_N_FLOATN, CPP_N_FLOATNX)
988 (CPP_N_WIDTH_FLOATN_NX, CPP_FLOATN_SHIFT, CPP_FLOATN_MAX): New
990 * expr.c (interpret_float_suffix): Handle fN, fNx, FN and FNx
993 2016-08-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
995 * expr.c (eval_token): Append "evaluates to 0" to Wundef diagnostic.
997 2016-08-18 David Malcolm <dmalcolm@redhat.com>
999 * directives.c (directive_names): New array.
1000 (_cpp_handle_directive): Offer spelling suggestions for misspelled
1002 * errors.c (cpp_diagnostic_at_richloc): New function.
1003 (cpp_error_at_richloc): New function.
1004 * include/cpplib.h (struct cpp_callbacks): Add field
1006 (cpp_error_at_richloc): New decl.
1008 2016-08-18 Marek Polacek <polacek@redhat.com>
1011 * pch.c (write_macdef): Add CPP_FALLTHRU.
1013 2016-08-12 Marek Polacek <polacek@redhat.com>
1016 * lex.c (search_line_fast): Add FALLTHRU.
1017 (_cpp_lex_direct): Likewise.
1018 (cpp_token_val_index): Adjust fall through comment.
1019 * macro.c (parse_params): Add FALLTHRU.
1020 * pch.c (count_defs): Adjust fall through comment.
1021 (write_defs): Likewise.
1023 2016-08-06 David Malcolm <dmalcolm@redhat.com>
1026 * charset.c (_cpp_valid_ucn): Replace overzealous assert with one
1027 that allows for char_range to be non-NULL when loc_reader is NULL.
1029 2016-08-05 David Malcolm <dmalcolm@redhat.com>
1031 * charset.c (cpp_substring_ranges::cpp_substring_ranges): New
1033 (cpp_substring_ranges::~cpp_substring_ranges): New destructor.
1034 (cpp_substring_ranges::add_range): New method.
1035 (cpp_substring_ranges::add_n_ranges): New method.
1036 (_cpp_valid_ucn): Add "char_range" and "loc_reader" params; if
1037 they are non-NULL, read position information from *loc_reader
1038 and update char_range->m_finish accordingly.
1039 (convert_ucn): Add "char_range", "loc_reader", and "ranges"
1040 params. If loc_reader is non-NULL, read location information from
1041 it, and update *ranges accordingly, using char_range.
1042 Conditionalize the conversion into tbuf on tbuf being non-NULL.
1043 (convert_hex): Likewise, conditionalizing the call to
1044 emit_numeric_escape on tbuf.
1045 (convert_oct): Likewise.
1046 (convert_escape): Add params "loc_reader" and "ranges". If
1047 loc_reader is non-NULL, read location information from it, and
1048 update *ranges accordingly. Conditionalize the conversion into
1049 tbuf on tbuf being non-NULL.
1050 (cpp_interpret_string): Rename to...
1051 (cpp_interpret_string_1): ...this, adding params "loc_readers" and
1052 "out". Use "to" to conditionalize the initialization and usage of
1053 "tbuf", such as running the converter. If "loc_readers" is
1054 non-NULL, use the instances within it, reading location
1055 information from them, and passing them to convert_escape; likewise
1056 write to "out" if loc_readers is non-NULL. Check for leading
1057 quote and issue an error if it is not present. Update boundary
1058 check from "== limit" to ">= limit" to protect against erroneous
1059 location values to calls that are not parsing string literals.
1060 (cpp_interpret_string): Reimplement in terms to
1061 cpp_interpret_string_1.
1062 (noop_error_cb): New function.
1063 (cpp_interpret_string_ranges): New function.
1064 (cpp_string_location_reader::cpp_string_location_reader): New
1066 (cpp_string_location_reader::get_next): New method.
1067 * include/cpplib.h (class cpp_string_location_reader): New class.
1068 (class cpp_substring_ranges): New class.
1069 (cpp_interpret_string_ranges): New prototype.
1070 * internal.h (_cpp_valid_ucn): Add params "char_range" and
1072 * lex.c (forms_identifier_p): Pass NULL for new params to
1075 2016-08-01 Andreas Schwab <schwab@suse.de>
1077 * include/cpplib.h: Fix comment typo.
1079 2016-07-27 David Malcolm <dmalcolm@redhat.com>
1081 * include/line-map.h (source_location): Fix line numbers in
1084 2016-07-11 David Malcolm <dmalcolm@redhat.com>
1086 * include/line-map.h (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES):
1087 Move here from line-map.c.
1088 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
1089 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): Move from
1091 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
1093 2016-06-22 David Malcolm <dmalcolm@redhat.com>
1095 * directives.c (do_include_common): Pass on "location" to
1097 * errors.c (cpp_diagnostic): Reimplement in terms of...
1098 (cpp_diagnostic_at): New function.
1099 (cpp_error_at): New function.
1100 (cpp_errno_filename): Add "loc" param and use it by using
1101 cpp_error_at rather than cpp_error.
1102 * files.c (find_file_in_dir): Add "loc" param and pass it to
1104 (_cpp_find_file): Add "loc" param. Use it to convert calls to
1105 cpp_error to cpp_error_at, and pass it to find_file_in_dir and
1107 (read_file_guts): Add "loc" param. Use it to convert calls to
1108 cpp_error to cpp_error_at. Pass it to cpp_errno_filename.
1109 (read_file): Add "loc" param. Pass it to open_file_failed and
1111 (should_stack_file): Add "loc" param. Pass it to read_file.
1112 (_cpp_stack_file): Add "loc" param. Pass it to should_stack_file.
1113 (_cpp_stack_include): Add "loc" param. Pass it to
1114 _cpp_find_file and _cpp_stack_file.
1115 (open_file_failed): Add "loc" param. Pass it to
1117 (_cpp_fake_include): Add 0 as a source_location in call to
1119 (_cpp_compare_file_date): Likewise.
1120 (cpp_push_include): Likewise for call to _cpp_stack_include.
1121 (cpp_push_default_include): Likewise.
1122 (_cpp_save_file_entries): Likewise for call to open_file_failed.
1123 (_cpp_has_header): Likewise for call to _cpp_find_file.
1124 * include/cpplib.h (cpp_errno_filename): Add source_location
1126 (cpp_error_at): New declaration.
1127 * init.c (cpp_read_main_file): Add 0 as a source_location in calls
1128 to _cpp_find_file and _cpp_stack_file.
1129 * internal.h (_cpp_find_file): Add source_location param.
1130 (_cpp_stack_file): Likewise.
1131 (_cpp_stack_include): Likewise.
1133 2016-06-22 David Malcolm <dmalcolm@redhat.com>
1135 * include/line-map.h (fixit_hint::get_start_loc): New pure virtual
1137 (fixit_hint::maybe_get_end_loc): Likewise.
1138 (fixit_insert::get_start_loc): New function, implementing
1139 fixit_hint::get_start_loc.
1140 (fixit_insert::maybe_get_end_loc): New function, implementing
1141 fixit_hint::maybe_get_end_loc.
1142 (fixit_remove::get_start_loc): New function, implementing
1143 fixit_hint::get_start_loc.
1144 (fixit_remove::maybe_get_end_loc): New function, implementing
1145 fixit_hint::maybe_get_end_loc.
1146 (fixit_replace::get_start_loc): New function, implementing
1147 fixit_hint::get_start_loc.
1148 (fixit_replace::maybe_get_end_loc): New function, implementing
1149 fixit_hint::maybe_get_end_loc.
1151 2016-06-21 John David Anglin <danglin@gcc.gnu.org>
1153 * line-map.c (location_adhoc_data_update): Use int64_t instead of
1155 (get_combined_adhoc_loc): Likewise.
1157 2016-06-01 Eduard Sanou <dhole@openmailbox.org>
1159 * include/cpplib.h (cpp_callbacks): Add get_source_date_epoch
1161 * include/cpplib.h (cpp_init_source_date_epoch): Remove prototype.
1162 * init.c (cpp_init_source_date_epoch): Remove function.
1163 * init.c (cpp_create_reader): Initialize pfile->source_date_epoch.
1164 * internal.h (cpp_reader): Extend comment about source_date_epoch.
1165 * macro.c (_cpp_builtin_macro_text): Use get_source_date_epoch
1166 callback only once, read pfile->source_date_epoch on future passes.
1167 Check that get_source_date_epoch callback is not NULL.
1169 2016-05-20 Martin Liska <mliska@suse.cz>
1171 * config.in: Regenerated.
1172 * configure: Likewise.
1173 * configure.ac: Handle --enable-valgrind-annotations.
1174 * lex.c (new_buff): Use ENABLE_VALGRIND_ANNOTATIONS instead
1175 of ENABLE_VALGRIND_CHECKING.
1176 (_cpp_free_buff): Likewise.
1178 2016-04-28 Eduard Sanou <dhole@openmailbox.org>
1179 Matthias Klose <doko@debian.org>
1181 * include/cpplib.h (cpp_init_source_date_epoch): Prototype.
1182 * init.c (cpp_init_source_date_epoch): New function.
1183 * internal.h: Added source_date_epoch variable to struct
1184 cpp_reader to store a reproducible date.
1185 * macro.c (_cpp_builtin_macro_text): Set pfile->date timestamp from
1186 pfile->source_date_epoch instead of localtime if source_date_epoch is
1187 set, to be used for __DATE__ and __TIME__ macros to help reproducible
1190 2016-04-13 Bernd Schmidt <bschmidt@redhat.com>
1192 Patch from Roger Orr <rogero@howzatt.demon.co.uk>
1193 PR preprocessor/69650
1194 * directives.c (do_linemarker): Reread map after calling
1197 2016-04-06 Richard Henderson <rth@redhat.com>
1199 PR preprocessor/61817
1200 PR preprocessor/69391
1201 * internal.h (_cpp_builtin_macro_text): Update decl.
1202 * macro.c (_cpp_builtin_macro_text): Accept location for __LINE__.
1203 (builtin_macro): Accept a second location for __LINE__.
1204 (enter_macro_context): Compute both virtual and real expansion
1205 locations for the macro.
1207 2016-03-25 Bernd Schmidt <bschmidt@redhat.com>
1210 * directives.c (do_linemarker): Test for file left but not entered
1212 * line-map.c (linemap_add): Not here.
1214 2016-03-21 Jakub Jelinek <jakub@redhat.com>
1217 * include/cpplib.h (cpp_fun_like_macro_p): New prototype.
1218 * macro.c (cpp_fun_like_macro_p): New function.
1220 2016-03-15 Richard Henderson <rth@redhat.com>
1222 * line-map.c (new_linemap): Make alloc_size a size_t.
1224 2016-03-14 Jason Merrill <jason@redhat.com>
1226 * expr.c (cpp_classify_number): Hex floats are new in C++1z.
1227 * init.c (lang_defaults): Likewise.
1229 2016-03-09 David Malcolm <dmalcolm@redhat.com>
1233 * line-map.c (linemap_macro_map_loc_unwind_toward_spelling): Move
1235 * include/line-map.h
1236 (linemap_macro_map_loc_unwind_toward_spelling): ...here,
1237 converting from static to extern.
1239 2016-03-09 David Malcolm <dmalcolm@redhat.com>
1243 * include/line-map.h (source_range::debug): Delete.
1244 (struct location_range): Update comment. Replace
1245 expanded_location fields "m_start", "m_finish", and "m_caret" with
1246 a source_location field: "m_loc".
1247 (class rich_location): Reword comment.
1248 (rich_location::get_loc): Reimplement in terms of a new overloaded
1249 variant which takes an unsigned int.
1250 (rich_location::get_loc_addr): Delete.
1251 (rich_location::add_range): Drop params "start" and "finish" in
1252 favor of param "loc". Drop overloaded variants taking a
1253 source_range or location_range *.
1254 (rich_location::lazily_expand_location): Delete in favor of...
1255 (rich_location::get_expanded_location): New decl.
1256 (rich_location::m_loc): Delete field.
1257 (rich_location::m_column_override): New field.
1258 * line-map.c (rich_location::rich_location): Drop name of
1259 line_maps * param. Update initializations for deletion of field
1260 "m_loc" and addition of field "m_column_override". Reimplement
1261 body as a call to add_range. Delete overloaded variant taking a
1263 (rich_location::get_loc): New function.
1264 (rich_location::lazily_expand_location): Delete in favor of...
1265 (rich_location::get_expanded_location): New function.
1266 (rich_location::override_column): Reimplement.
1267 (rich_location::add_range): Drop params "start" and "finish" in
1268 favor of param "loc". Eliminate location expansion in favor of
1269 simply storing loc. Drop overloaded variants taking a
1270 source_range or location_range *.
1271 (rich_location::set_range): Eliminate location expansion.
1273 2016-02-29 David Malcolm <dmalcolm@redhat.com>
1275 PR preprocessor/69985
1276 (linemap_position_for_loc_and_offset): Rename param from "offset"
1277 to "column_offset". Right-shift the column_offset by m_range_bits
1278 of the pertinent ordinary map whenever offsetting a
1279 source_location. For clarity, offset the column by the column
1280 offset, rather than the other way around.
1282 2016-02-23 David Malcolm <dmalcolm@redhat.com>
1284 PR preprocessor/69126
1285 PR preprocessor/69543
1286 * line-map.c (linemap_compare_locations): At the function top,
1287 replace inlined bodies of get_location_from_adhoc_loc with calls
1288 to get_location_from_adhoc_loc. Add a pair of calls to
1289 get_location_from_adhoc_loc at the bottom of the function, to
1290 avoid meaningless comparisons of ad-hoc and non-ad-hoc locations.
1292 2016-02-08 David Malcolm <dmalcolm@redhat.com>
1294 PR preprocessor/69664
1295 * errors.c (cpp_diagnostic_with_line): Only call
1296 rich_location::override_column if the column is non-zero.
1297 * line-map.c (rich_location::override_column): Update columns
1298 within m_ranges[0]. Add assertions to verify that doing so is
1301 2016-02-05 Jakub Jelinek <jakub@redhat.com>
1304 * charset.c (cpp_interpret_charconst): Clear *PCHARS_SEEN
1305 and *UNSIGNEDP if bailing out early due to errors.
1307 2016-01-28 Jakub Jelinek <jakub@redhat.com>
1310 * files.c (_cpp_find_file): Set file->implicit_preinclude even if
1311 included from file->implicit_preinclude header.
1313 * directives.c (destringize_and_run): Adjust prototype.
1315 2016-01-27 David Malcolm <dmalcolm@redhat.com>
1317 PR preprocessor/69126
1318 * directives.c (destringize_and_run): Add expansion_loc param; use
1319 it when handling unexpanded pragmas to fixup the locations of the
1321 (_cpp_do__Pragma): Add expansion_loc param and use it when calling
1322 destringize_and_run.
1323 * internal.h (_cpp_do__Pragma): Add expansion_loc param.
1324 * macro.c (builtin_macro): Pass expansion location of _Pragma to
1327 2016-01-14 David Malcolm <dmalcolm@redhat.com>
1329 PR preprocessor/69177
1330 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): New
1332 (LINE_MAP_MAX_LOCATION_WITH_COLS): Add note about unit tests
1334 (can_be_stored_compactly_p): Reduce threshold from
1335 LINE_MAP_MAX_LOCATION_WITH_COLS to
1336 LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES.
1337 (get_combined_adhoc_loc): Likewise.
1338 (get_range_from_loc): Likewise.
1339 (linemap_line_start): Ensure that a new ordinary map is created
1340 when transitioning from range-packing being enabled to disabled,
1341 at the LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES threshold. Set
1342 range_bits to 0 for new ordinary maps when beyond this limit.
1343 Prevent the "increase the column bits of a freshly created map"
1344 optimization if the range bits has reduced.
1346 2016-01-08 Jakub Jelinek <jakub@redhat.com>
1349 * files.c (cpp_included_before): If IS_ADHOC_LOC (location), lookup
1350 real location from the line_table.
1352 2016-01-04 Jakub Jelinek <jakub@redhat.com>
1354 Update copyright years.
1356 2015-12-22 David Malcolm <dmalcolm@redhat.com>
1358 * line-map.c (get_combined_adhoc_loc): Remove condition
1359 on locus < RESERVED_LOCATION_COUNT when considering
1360 whether a caret == start == finish location can be
1361 simply stored as the caret location.
1363 2015-12-07 David Malcolm <dmalcolm@redhat.com>
1365 * include/line-map.h (rich_location::set_range): Add line_maps *
1366 param; convert param from source_range to source_location. Drop
1367 "overwrite_loc_p" param.
1368 * line-map.c (rich_location::set_range): Likewise, acting as if
1369 "overwrite_loc_p" were true, and getting range from the location.
1371 2015-11-20 David Malcolm <dmalcolm@redhat.com>
1374 * include/line-map.h (source_range::intersects_line_p): New
1376 (rich_location::~rich_location): New.
1377 (rich_location::add_fixit_insert): New method.
1378 (rich_location::add_fixit_remove): New method.
1379 (rich_location::add_fixit_replace): New method.
1380 (rich_location::get_num_fixit_hints): New accessor.
1381 (rich_location::get_fixit_hint): New accessor.
1382 (rich_location::MAX_FIXIT_HINTS): New constant.
1383 (rich_location::m_num_fixit_hints): New field.
1384 (rich_location::m_fixit_hints): New field.
1385 (class fixit_hint): New class.
1386 (class fixit_insert): New class.
1387 (class fixit_remove): New class.
1388 (class fixit_replace): New class.
1389 * line-map.c (source_range::intersects_line_p): New method.
1390 (rich_location::rich_location): Add initialization of
1391 m_num_fixit_hints to both ctors.
1392 (rich_location::~rich_location): New.
1393 (rich_location::add_fixit_insert): New method.
1394 (rich_location::add_fixit_remove): New method.
1395 (rich_location::add_fixit_replace): New method.
1396 (fixit_insert::fixit_insert): New.
1397 (fixit_insert::~fixit_insert): New.
1398 (fixit_insert::affects_line_p): New.
1399 (fixit_remove::fixit_remove): New.
1400 (fixit_remove::affects_line_p): New.
1401 (fixit_replace::fixit_replace): New.
1402 (fixit_replace::~fixit_replace): New.
1403 (fixit_replace::affects_line_p): New.
1405 2015-11-19 Jakub Jelinek <jakub@redhat.com>
1407 PR preprocessor/60736
1408 * include/cpplib.h (cpp_errno_filename): New prototype.
1409 * errors.c (cpp_errno): Don't handle msgid "" specially, use
1410 _(msgid) instead of msgid as argument to cpp_error.
1411 (cpp_errno_filename): New function.
1412 * files.c (read_file_guts): Use cpp_errno_filename instead of
1414 (open_file_failed): Likewise. Use file->name if file->path is NULL
1417 2015-11-13 David Malcolm <dmalcolm@redhat.com>
1419 * errors.c (cpp_diagnostic): Pass pfile->line_table to
1421 (cpp_diagnostic_with_line): Likewise.
1422 * include/cpplib.h (struct cpp_token): Update comment for src_loc
1423 to indicate that the range of the token is "baked into" the
1425 * include/line-map.h (source_location): Update the descriptive
1426 comment to reflect the packing scheme for short ranges, adding
1427 worked examples of location encoding.
1428 (struct line_map_ordinary): Drop field "column_bits" in favor
1429 of field "m_column_and_range_bits"; add field "m_range_bits".
1430 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
1431 (location_adhoc_data): Add source_range field.
1432 (struct line_maps): Add fields "default_range_bits",
1433 "num_optimized_ranges" and "num_unoptimized_ranges".
1434 (get_combined_adhoc_loc): Add source_range param.
1435 (get_range_from_loc): New declaration.
1436 (pure_location_p): New prototype.
1437 (COMBINE_LOCATION_DATA): Add source_range param.
1438 (SOURCE_LINE): Update for renaming of column_bits.
1439 (SOURCE_COLUMN): Likewise. Shift the column right by the map's
1441 (LAST_SOURCE_LINE_LOCATION): Update for renaming of column_bits.
1442 (linemap_position_for_line_and_column): Add line_maps * params.
1443 (rich_location::rich_location): Likewise.
1444 * lex.c (_cpp_lex_direct): Capture the range of the token, baking
1445 it into token->src_loc via a call to COMBINE_LOCATION_DATA.
1446 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): Reduce from 1U << 17 to
1448 (location_adhoc_data_hash): Add the src_range into
1450 (location_adhoc_data_eq): Require equality of the src_range
1452 (can_be_stored_compactly_p): New function.
1453 (get_combined_adhoc_loc): Add src_range param, and store it,
1454 via a bit-packing scheme for short ranges, otherwise within the
1455 lookaside table. Remove the requirement that data is non-NULL.
1456 (get_range_from_adhoc_loc): New function.
1457 (get_range_from_loc): New function.
1458 (pure_location_p): New function.
1459 (linemap_add): Ensure that start_location has zero for the
1460 range_bits, unless we're past LINE_MAP_MAX_LOCATION_WITH_COLS.
1461 Initialize range_bits to zero. Assert that the start_location
1463 (linemap_line_start): Assert that the
1464 column_and_range_bits >= range_bits.
1465 Update determinination of whether we need to start a new map
1466 using the effective column bits, without the range bits.
1467 Use the set's default_range_bits in new maps, apart from
1468 those with column_bits == 0, which should also have 0 range_bits.
1469 Increase the column bits for new maps by the range bits.
1470 When adding lines to an existing map, use set->highest_line
1471 directly rather than offsetting highest by SOURCE_COLUMN.
1472 Add assertions to sanity-check the return value.
1473 (linemap_position_for_column): Offset to_column by range_bits.
1474 Update set->highest_location if necessary.
1475 (linemap_position_for_line_and_column): Add line_maps * param.
1476 Update the calculation to offset the column by range_bits, and
1477 conditionalize it on being <= LINE_MAP_MAX_LOCATION_WITH_COLS.
1478 Bound it by LINEMAPS_MACRO_LOWEST_LOCATION. Update
1479 set->highest_location if necessary.
1480 (linemap_position_for_loc_and_offset): Handle ad-hoc locations;
1481 pass "set" to linemap_position_for_line_and_column.
1482 (linemap_macro_map_loc_unwind_toward_spelling): Add line_maps
1483 param. Handle ad-hoc locations.
1484 (linemap_location_in_system_header_p): Pass on "set" to call to
1485 linemap_macro_map_loc_unwind_toward_spelling.
1486 (linemap_macro_loc_to_spelling_point): Retain ad-hoc locations.
1487 Pass on "set" to call to
1488 linemap_macro_map_loc_unwind_toward_spelling.
1489 (linemap_resolve_location): Retain ad-hoc locations. Pass on
1490 "set" to call to linemap_macro_map_loc_unwind_toward_spelling.
1491 (linemap_unwind_toward_expansion): Pass on "set" to call to
1492 linemap_macro_map_loc_unwind_toward_spelling.
1493 (linemap_expand_location): Extract the data pointer before
1494 extracting the location.
1495 (rich_location::rich_location): Add line_maps param; use it to
1496 extract the range from the source_location.
1497 * location-example.txt: Regenerate, showing new representation.
1499 2015-11-06 David Malcolm <dmalcolm@redhat.com>
1501 * errors.c (cpp_diagnostic): Update for change in signature
1502 of "error" callback.
1503 (cpp_diagnostic_with_line): Likewise, calling override_column
1504 on the rich_location.
1505 * include/cpplib.h (struct cpp_callbacks): Within "error"
1506 callback, convert param from source_location to rich_location *,
1507 and drop column_override param.
1508 * include/line-map.h (struct source_range): New struct.
1509 (struct location_range): New struct.
1510 (class rich_location): New class.
1511 (linemap_client_expand_location_to_spelling_point): New declaration.
1512 * line-map.c (rich_location::rich_location): New ctors.
1513 (rich_location::lazily_expand_location): New method.
1514 (rich_location::override_column): New method.
1515 (rich_location::add_range): New methods.
1516 (rich_location::set_range): New method.
1518 2015-11-06 David Malcolm <dmalcolm@redhat.com>
1520 * include/line-map.h (struct linemap_stats): Add fields
1521 "adhoc_table_size" and "adhoc_table_entries_used".
1522 * line-map.c (linemap_get_statistics): Populate above fields.
1524 2015-11-04 Mikhail Maltsev <maltsevm@gmail.com>
1526 * config.in: Regenerate.
1527 * configure: Regenerate.
1528 * configure.ac: Remove ENABLE_CHECKING.
1530 2015-11-03 Uros Bizjak <ubizjak@gmail.com>
1532 * lex.c (search_line_sse42): Correctly advance the pointer to an
1535 2015-11-02 David Malcolm <dmalcolm@redhat.com>
1537 * include/line-map.h (source_location): In the table in the
1538 descriptive comment, show UNKNOWN_LOCATION, BUILTINS_LOCATION,
1539 LINE_MAP_MAX_LOCATION_WITH_COLS, LINE_MAP_MAX_SOURCE_LOCATION.
1540 Add notes about ad-hoc values.
1542 2015-10-21 Mikhail Maltsev <maltsevm@gmail.com>
1544 * include/line-map.h: Use CHECKING_P instead of ENABLE_CHECKING.
1546 * macro.c (struct macro_arg_token_iter, set_arg_token,
1547 macro_arg_token_iter_init, macro_arg_token_iter_forward,
1548 macro_arg_token_iter_get_token, macro_arg_token_iter_get_location,
1549 alloc_expanded_arg_mem, _cpp_backup_tokens): Likewise.
1551 * config.in: Regenerate.
1552 * configure: Regenerate.
1553 * configure.ac (CHECKING_P): Define.
1554 * system.h (fancy_abort): Declare.
1556 (gcc_assert): Define. Use CHECKING_P.
1558 2015-10-13 Mikhail Maltsev <maltsevm@gmail.com>
1560 * system.h (CHECKING_P, gcc_checking_assert): Define.
1562 2015-09-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
1565 * line-map.c (linemap_position_for_loc_and_offset): Handle the
1566 case of long lines encoded in multiple maps.
1568 2015-09-07 Marek Polacek <polacek@redhat.com>
1570 * system.h (INTTYPE_MINIMUM): Rewrite to avoid shift warning.
1572 2015-08-06 Yaakov Selkowitz <yselkowi@redhat.com>
1574 * configure: Regenerate.
1576 2015-07-08 Thomas Schwinge <thomas@codesourcery.com>
1578 * include/line-map.h (RESERVED_LOCATION_COUNT): Change type to
1581 2015-07-02 Paolo Carlini <paolo.carlini@oracle.com>
1583 PR preprocessor/53690
1584 * charset.c (_cpp_valid_ucn): Add cppchar_t * parameter and change
1585 return type to bool. Fix encoding of \u0000 and \U00000000 in C++.
1586 (convert_ucn): Adjust call.
1587 * lex.c (forms_identifier_p): Likewise.
1588 * internal.h (_cpp_valid_ucn): Adjust declaration.
1590 2015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
1592 Implement N4197 - Adding u8 character literals
1593 * include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens;
1594 (struct cpp_options): Add utf8_char_literals.
1595 * init.c (struct lang_flags): Add utf8_char_literals;
1596 (struct lang_flags lang_defaults): Add column for utf8_char_literals.
1597 * macro.c (stringify_arg()): Treat CPP_UTF8CHAR token;
1598 * expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()):
1599 Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens;
1600 (cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token;
1601 (eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token.
1602 * lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens.
1603 * charset.c (converter_for_type(), cpp_interpret_charconst()):
1604 Treat CPP_UTF8CHAR token.
1606 2015-06-30 Uros Bizjak <ubizjak@gmail.com>
1608 * lex.c (search_line_sse42) [__GCC_ASM_FLAG_OUTPUTS__]: New main
1609 loop using asm flag outputs.
1611 2015-06-08 Marek Polacek <polacek@redhat.com>
1614 * line-map.c (linemap_position_for_loc_and_offset): Remove
1615 linemap_assert_fails; reverse conditions.
1617 2015-05-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
1619 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER
1620 LINE_MAP_MAX_LOCATION_WITH_COLS,LINE_MAP_MAX_SOURCE_LOCATION):
1622 (linemap_line_start): Use them.
1623 (linemap_position_for_column): Use them.
1625 2015-05-20 David Malcolm <dmalcolm@redhat.com>
1627 * include/line-map.h (MAP_START_LOCATION): Eliminate the non-const
1628 variant, and tweak comment for the const variant.
1629 (ORDINARY_MAP_STARTING_LINE_NUMBER): Drop the non-const variant.
1630 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
1631 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
1632 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
1633 (ORDINARY_MAP_FILE_NAME): Drop the non-const variant.
1634 (MACRO_MAP_MACRO): Likewise.
1635 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
1636 (MACRO_MAP_LOCATIONS): Likewise.
1637 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
1638 * line-map.c (linemap_add): Replace writes through macros with
1639 direct field accesses.
1640 (linemap_enter_macro): Likewise.
1641 (linemap_line_start): Likewise.
1643 2015-05-19 David Malcolm <dmalcolm@redhat.com>
1645 * directives.c (do_line): Strengthen local "map" from
1646 const line_map * to const line_map_ordinary *.
1647 (do_linemarker): Likewise.
1648 (_cpp_do_file_change): Assert that we're not dealing with
1649 a macro map. Introduce local "ord_map" via a call to
1650 linemap_check_ordinary, guarded within the check for
1651 non-NULL. Use it for typesafety.
1652 * files.c (cpp_make_system_header): Strengthen local "map" from
1653 const line_map * to const line_map_ordinary *.
1654 * include/cpplib.h (struct cpp_callbacks): Likewise for second
1655 parameter of "file_change" callback.
1656 * include/line-map.h (struct line_map): Convert from a struct
1657 containing a union to a base class.
1658 (struct line_map_ordinary): Convert to a subclass of line_map.
1659 (struct line_map_macro): Likewise.
1660 (linemap_check_ordinary): Strengthen return type from line_map *
1661 to line_map_ordinary *, and add a const-variant.
1662 (linemap_check_macro): New pair of functions.
1663 (ORDINARY_MAP_STARTING_LINE_NUMBER): Strengthen param from
1664 const line_map * to const line_map_ordinary *, eliminating call
1665 to linemap_check_ordinary. Likewise for the non-const variant.
1666 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
1667 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
1668 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Likewise.
1669 (ORDINARY_MAP_FILE_NAME): Likewise.
1670 (MACRO_MAP_MACRO): Strengthen param from const line_map * to
1671 const line_map_macro *. Likewise for the non-const variant.
1672 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
1673 (MACRO_MAP_LOCATIONS): Likewise.
1674 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
1675 (struct maps_info): Replace with...
1676 (struct maps_info_ordinary):...this and...
1677 (struct maps_info_macro): ...this.
1678 (struct line_maps): Convert fields "info_ordinary" and
1679 "info_macro" to the above new structs.
1680 (LINEMAPS_MAP_INFO): Delete both functions.
1681 (LINEMAPS_MAPS): Likewise.
1682 (LINEMAPS_ALLOCATED): Rewrite both variants to avoid using
1684 (LINEMAPS_USED): Likewise.
1685 (LINEMAPS_CACHE): Likewise.
1686 (LINEMAPS_MAP_AT): Likewise.
1687 (LINEMAPS_ORDINARY_MAPS): Strengthen return type from line_map *
1688 to line_map_ordinary *.
1689 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
1690 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
1691 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
1692 (LINEMAPS_MACRO_MAPS): Strengthen return type from line_map * to
1694 (LINEMAPS_MACRO_MAP_AT): Likewise.
1695 (LINEMAPS_LAST_MACRO_MAP): Likewise.
1696 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
1697 (linemap_map_get_macro_name): Strengthen param from
1698 const line_map * to const line_map_macro *.
1699 (SOURCE_LINE): Strengthen first param from const line_map * to
1700 const line_map_ordinary *, removing call to
1701 linemap_check_ordinary.
1702 (SOURCE_COLUMN): Likewise.
1703 (LAST_SOURCE_LINE_LOCATION): Likewise.
1704 (LAST_SOURCE_LINE): Strengthen first param from const line_map *
1705 to const line_map_ordinary *.
1706 (LAST_SOURCE_COLUMN): Likewise.
1707 (INCLUDED_FROM): Strengthen return type from line_map * to
1708 line_map_ordinary *., and second param from const line_map *
1709 to const line_map_ordinary *, removing call to
1710 linemap_check_ordinary.
1711 (MAIN_FILE_P): Strengthen param from const line_map * to
1712 const line_map_ordinary *, removing call to
1713 linemap_check_ordinary.
1714 (linemap_position_for_line_and_column): Strengthen param from
1715 const line_map * to const line_map_ordinary *.
1716 (LINEMAP_FILE): Strengthen param from const line_map * to
1717 const line_map_ordinary *, removing call to
1718 linemap_check_ordinary.
1719 (LINEMAP_LINE): Likewise.
1720 (LINEMAP_SYSP): Likewise.
1721 (linemap_resolve_location): Strengthen final param from
1722 const line_map ** to const line_map_ordinary **.
1723 * internal.h (CPP_INCREMENT_LINE): Likewise for local "map".
1724 (linemap_enter_macro): Strengthen return type from
1725 const line_map * to const line_map_macro *.
1726 (linemap_add_macro_token): Likewise for first param.
1727 * line-map.c (linemap_check_files_exited): Strengthen local "map"
1728 from const line_map * to const line_map_ordinary *.
1729 (new_linemap): Introduce local "map_size" and use it when
1730 calculating how large the buffer should be. Rewrite based
1731 on change of info_macro and info_ordinary into distinct types.
1732 (linemap_add): Strengthen locals "map" and "from" from line_map *
1733 to line_map_ordinary *.
1734 (linemap_enter_macro): Strengthen return type from
1735 const line_map * to const line_map_macro *, and local "map" from
1736 line_map * to line_map_macro *.
1737 (linemap_add_macro_token): Strengthen param "map" from
1738 const line_map * to const line_map_macro *.
1739 (linemap_line_start): Strengthen local "map" from line_map * to
1740 line_map_ordinary *.
1741 (linemap_position_for_column): Likewise.
1742 (linemap_position_for_line_and_column): Strengthen first param
1743 from const line_map * to const line_map_ordinary *.
1744 (linemap_position_for_loc_and_offset): Strengthen local "map" from
1745 const line_map * to const line_map_ordinary *.
1746 (linemap_ordinary_map_lookup): Likewise for return type and locals
1747 "cached" and "result".
1748 (linemap_macro_map_lookup): Strengthen return type and locals
1749 "cached" and "result" from const line_map * to
1750 const line_map_macro *.
1751 (linemap_macro_map_loc_to_exp_point): Likewise for param "map".
1752 (linemap_macro_map_loc_to_def_point): Likewise.
1753 (linemap_macro_map_loc_unwind_toward_spelling): Likewise.
1754 (linemap_get_expansion_line): Strengthen local "map" from
1755 const line_map * to const line_map_ordinary *.
1756 (linemap_get_expansion_filename): Likewise.
1757 (linemap_map_get_macro_name): Strengthen param from
1758 const line_map * to const line_map_macro *.
1759 (linemap_location_in_system_header_p): Add call to
1760 linemap_check_ordinary in region guarded by
1761 !linemap_macro_expansion_map_p. Introduce local "macro_map" via
1762 linemap_check_macro in other region, using it in place of "map"
1764 (first_map_in_common_1): Add calls to linemap_check_macro.
1765 (trace_include): Strengthen param "map" from const line_map * to
1766 const line_map_ordinary *.
1767 (linemap_macro_loc_to_spelling_point): Strengthen final param from
1768 const line_map ** to const line_map_ordinary **. Replace a
1769 C-style cast with a const_cast, and add calls to
1770 linemap_check_macro and linemap_check_ordinary.
1771 (linemap_macro_loc_to_def_point): Likewise.
1772 (linemap_macro_loc_to_exp_point): Likewise.
1773 (linemap_resolve_location): Strengthen final param from
1774 const line_map ** to const line_map_ordinary **.
1775 (linemap_unwind_toward_expansion): Introduce local "macro_map" via
1776 a checked cast and use it in place of *map.
1777 (linemap_unwind_to_first_non_reserved_loc): Strengthen local
1778 "map1" from const line_map * to const line_map_ordinary *.
1779 (linemap_expand_location): Introduce local "ord_map" via a checked
1780 cast and use it in place of map.
1781 (linemap_dump): Make local "map" const. Strengthen local
1782 "includer_map" from line_map * to const line_map_ordinary *.
1783 Introduce locals "ord_map" and "macro_map" via checked casts and
1784 use them in place of "map" for typesafety.
1785 (linemap_dump_location): Strengthen local "map" from
1786 const line_map * to const line_map_ordinary *.
1787 (linemap_get_file_highest_location): Update for elimination of
1789 (linemap_get_statistics): Strengthen local "cur_map" from
1790 line_map * to const line_map_macro *. Update uses of sizeof to
1791 use the appropriate line_map subclasses.
1792 * macro.c (_cpp_warn_if_unused_macro): Add call to
1793 linemap_check_ordinary.
1794 (builtin_macro): Strengthen local "map" from const line_map * to
1795 const line_map_macro *.
1796 (enter_macro_context): Likewise.
1797 (replace_args): Likewise.
1798 (tokens_buff_put_token_to): Likewise for param "map".
1799 (tokens_buff_add_token): Likewise.
1801 2015-05-13 David Malcolm <dmalcolm@redhat.com>
1803 * include/line-map.h (source_location): Add a reference to
1804 location-example.txt to the descriptive comment.
1805 * location-example.txt: New file.
1807 2015-05-13 David Malcolm <dmalcolm@redhat.com>
1809 * include/line-map.h (MAX_SOURCE_LOCATION): Convert from a macro
1810 to a const source_location.
1811 (RESERVED_LOCATION_COUNT): Likewise.
1812 (linemap_check_ordinary): Convert from a macro to a pair of inline
1813 functions, for const/non-const arguments.
1814 (MAP_START_LOCATION): Likewise.
1815 (ORDINARY_MAP_STARTING_LINE_NUMBER): Likewise.
1816 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
1817 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
1818 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Convert from a macro to a
1819 pair of inline functions, for const/non-const arguments, where the
1821 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): New function.
1822 (ORDINARY_MAP_FILE_NAME): Convert from a macro to a pair of inline
1823 functions, for const/non-const arguments.
1824 (MACRO_MAP_MACRO): Likewise.
1825 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
1826 (MACRO_MAP_LOCATIONS): Likewise.
1827 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
1828 (LINEMAPS_MAP_INFO): Likewise.
1829 (LINEMAPS_MAPS): Likewise.
1830 (LINEMAPS_ALLOCATED): Likewise.
1831 (LINEMAPS_USED): Likewise.
1832 (LINEMAPS_CACHE): Likewise.
1833 (LINEMAPS_ORDINARY_CACHE): Likewise.
1834 (LINEMAPS_MACRO_CACHE): Likewise.
1835 (LINEMAPS_MAP_AT): Convert from a macro to an inline function.
1836 (LINEMAPS_LAST_MAP): Likewise.
1837 (LINEMAPS_LAST_ALLOCATED_MAP): Likewise.
1838 (LINEMAPS_ORDINARY_MAPS): Likewise.
1839 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
1840 (LINEMAPS_ORDINARY_ALLOCATED): Likewise.
1841 (LINEMAPS_ORDINARY_USED): Likewise.
1842 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
1843 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
1844 (LINEMAPS_MACRO_MAPS): Likewise.
1845 (LINEMAPS_MACRO_MAP_AT): Likewise.
1846 (LINEMAPS_MACRO_ALLOCATED): Likewise.
1847 (LINEMAPS_MACRO_USED): Likewise.
1848 (LINEMAPS_MACRO_LOWEST_LOCATION): Likewise.
1849 (LINEMAPS_LAST_MACRO_MAP): Likewise.
1850 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
1851 (IS_ADHOC_LOC): Likewise.
1852 (COMBINE_LOCATION_DATA): Likewise.
1853 (SOURCE_LINE): Likewise.
1854 (SOURCE_COLUMN): Likewise.
1855 (LAST_SOURCE_LINE_LOCATION): Likewise.
1856 (LAST_SOURCE_LINE): Likewise.
1857 (LAST_SOURCE_COLUMN): Likewise.
1858 (LAST_SOURCE_LINE_LOCATION)
1859 (INCLUDED_FROM): Likewise.
1860 (MAIN_FILE_P): Likewise.
1861 (LINEMAP_FILE): Likewise.
1862 (LINEMAP_LINE): Likewise.
1863 (LINEMAP_SYSP): Likewise.
1864 (linemap_location_before_p): Likewise.
1865 * line-map.c (linemap_check_files_exited): Make local "map" const.
1866 (linemap_add): Use SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS.
1867 (linemap_line_start): Likewise.
1869 2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
1871 * aclocal.m4: Regenerated with automake-1.11.6.
1873 2015-05-13 David Malcolm <dmalcolm@redhat.com>
1875 * include/line-map.h (linemap_assert): Move up within the file to
1876 before all of the map accessor macros.
1877 (linemap_assert_fails): Likewise.
1878 (linemap_check_ordinary): Likewise.
1879 (linemap_macro_expansion_map_p): Likewise.
1881 2015-05-12 David Malcolm <dmalcolm@redhat.com>
1883 * directives.c (do_line): Set seen_line_directive on line_table.
1884 (do_linemarker): Likewise.
1885 * include/line-map.h (struct line_maps): Add new field
1886 "seen_line_directive".
1888 2015-05-08 Jason Merrill <jason@redhat.com>
1890 * include/cpplib.h: Add CPP_W_CXX11_COMPAT.
1891 (struct cpp_options): Add cpp_warn_cxx11_compat.
1892 * init.c (cpp_create_reader): Initialize it.
1893 * lex.c (lex_string): Add -Wc++11-compat warning.
1895 2015-05-05 David Malcolm <dmalcolm@redhat.com>
1897 * pch.c (cpp_valid_state): Fix indentation so that it reflects the
1900 2015-05-05 David Malcolm <dmalcolm@redhat.com>
1902 * include/line-map.h: Fix comment at the top of the file.
1903 (source_location): Rewrite and expand the comment for this
1904 typedef, adding an ascii-art table to clarify how source_location
1905 values are allocated.
1906 * line-map.c: Fix comment at the top of the file.
1908 2015-04-09 Richard Biener <rguenther@suse.de>
1911 * files.c (pch_open_file): Allow main and pre-included files
1912 when trying to open a PCH.
1914 2015-04-06 Jakub Jelinek <jakub@redhat.com>
1916 PR preprocessor/61977
1917 * lex.c (cpp_peek_token): If peektok is CPP_EOF, back it up
1918 with all tokens peeked by the current function.
1920 2015-04-02 Jakub Jelinek <jakub@redhat.com>
1922 PR preprocessor/61977
1923 * lex.c (cpp_peek_token): Temporarily clear pfile->cb.line_change.
1925 2015-03-23 Jakub Jelinek <jakub@redhat.com>
1927 PR preprocessor/65238
1928 * internal.h (_cpp_scan_out_logical_line): Add third argument.
1929 * directives.c (prepare_directive_trad): Pass false to it.
1930 * traditional.c (_cpp_read_logical_line_trad,
1931 _cpp_create_trad_definition): Likewise.
1932 (struct fun_macro): Add paramc field.
1933 (fun_like_macro): New function.
1934 (maybe_start_funlike): Handle NODE_BUILTIN macros. Initialize
1935 macro->paramc field.
1936 (save_argument): Use macro->paramc instead of
1937 macro->node->value.macro->paramc.
1938 (push_replacement_text): Formatting fix.
1939 (recursive_macro): Use fun_like_macro helper.
1940 (_cpp_scan_out_logical_line): Likewise. Add BUILTIN_MACRO_ARG
1941 argument. Initialize fmacro.paramc field. Handle builtin
1942 function-like macros.
1944 2015-03-16 Edward Smith-Rowland <3dw4rd@verizon.net>
1947 * lex.c (lex_number): If a number ends with digit-seps (') skip back
1948 and let lex_string take them.
1950 2015-03-02 Markus Trippelsdorf <markus@trippelsdorf.de>
1953 * lex.c (search_line_fast): Silence ubsan errors.
1955 2015-02-03 <dodji@redhat.com>
1957 PR preprocessor/64803
1958 * internal.h (cpp_reader::top_most_macro_node): New data member.
1959 * macro.c (enter_macro_context): Pass the location of the end of
1960 the top-most invocation of the function-like macro, or the
1961 location of the expansion point of the top-most object-like macro.
1962 (cpp_get_token_1): Store the top-most macro node in the new
1963 pfile->top_most_macro_node data member.
1964 (_cpp_pop_context): Clear the new cpp_reader::top_most_macro_node
1967 2015-01-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
1969 * lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON.
1971 2015-01-23 Marek Polacek <polacek@redhat.com>
1974 PR preprocessor/60570
1975 * directives.c (do_elif): Don't evaluate #elif conditionals
1976 when they don't need to be.
1978 2015-01-16 Jakub Jelinek <jakub@redhat.com>
1980 * expr.c (cpp_classify_number): Add N_() around ?: string
1981 literals used in cpp_error_with_line call as format string.
1983 2015-01-05 Jakub Jelinek <jakub@redhat.com>
1985 Update copyright years.
1987 2014-12-19 Jakub Jelinek <jakub@redhat.com>
1989 PR preprocessor/63831
1990 * directives.c (lex_macro_node): Remove __has_attribute__ handling.
1991 * internal.h (struct spec_node): Remove n__has_attribute__ field.
1992 (struct lexer_state): Remove in__has_attribute__ field.
1993 * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_ATTRIBUTE.
1994 * identifiers.c (_cpp_init_hashtable): Remove __has_attribute__
1996 * init.c (builtin_array): Add __has_attribute and __has_cpp_attribute.
1997 (cpp_init_special_builtins): Don't initialize __has_attribute
1998 or __has_cpp_attribute if CLK_ASM or pfile->cb.has_attribute is NULL.
1999 * traditional.c (enum ls): Remove ls_has_attribute,
2000 ls_has_attribute_close.
2001 (_cpp_scan_out_logical_line): Remove __has_attribute__ handling.
2002 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_ATTRIBUTE.
2003 * pch.c (cpp_read_state): Remove __has_attribute__ handling.
2004 * expr.c (eval_token): Likewise.
2005 (parse_has_attribute): Removed.
2007 2014-12-11 Uros Bizjak <ubizjak@gmail.com>
2009 * directives.c (cpp_define_formatted): Use xvasprintf.
2011 2014-12-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
2013 * line-map.c (linemap_position_for_loc_and_offset): Add new
2014 linemap_assert_fails.
2016 2014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
2018 * include/line-map.h (linemap_assert_fails): Declare.
2019 * line-map.c (linemap_position_for_loc_and_offset): Use it.
2021 2014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
2023 * line-map.c (linemap_add): Fix typo.
2024 (linemap_line_start): Fix whitespace.
2026 2014-11-29 John Schmerge <jbschmerge@gmail.com>
2028 PR preprocessor/41698
2029 * charset.c (one_utf8_to_utf16): Do not produce surrogate pairs
2032 2014-11-25 Jakub Jelinek <jakub@redhat.com>
2034 PR preprocessor/60436
2035 * line-map.c (linemap_line_start): If highest is above 0x60000000
2036 and we are still tracking columns or highest is above 0x70000000,
2039 2014-11-20 Uros Bizjak <ubizjak@gmail.com>
2042 * lex.c [__i386__ || __x86_64__]: Compile special SSE functions
2043 only for (__GNUC__ >= 5 || !defined(__PIC__)).
2045 2014-11-13 Manuel López-Ibáñez <manu@gcc.gnu.org>
2047 * include/line-map.h: Include EXPR, so that unused variable warnings
2050 2014-11-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
2053 * include/line-map.h (linemap_position_for_loc_and_offset):
2055 * line-map.c (linemap_position_for_loc_and_offset): New.
2057 2014-11-11 David Malcolm <dmalcolm@redhat.com>
2059 * ChangeLog.jit: New.
2061 2014-11-10 Edward Smith-Rowland <3dw4rd@verizon.net>
2063 * include/cpplib.h (cpp_callbacks): Add has_attribute.
2064 * internal.h (lexer_state): Add in__has_attribute__.
2065 * directives.c (lex_macro_node): Prevent use of __has_attribute__
2067 * expr.c (parse_has_attribute): New function; (eval_token): Look for
2068 __has_attribute__ and route to parse_has_attribute.
2069 * identifiers.c (_cpp_init_hashtable): Initialize n__has_attribute__.
2070 * pch.c (cpp_read_state): Initialize n__has_attribute__.
2071 * traditional.c (enum ls): Add ls_has_attribute, ls_has_attribute_close;
2072 (_cpp_scan_out_logical_line): Attend to __has_attribute__.
2074 2014-11-06 Joseph Myers <joseph@codesourcery.com>
2076 * include/cpp-id-data.h (struct cpp_macro): Update comment
2077 regarding parameters.
2078 * include/cpplib.h (struct cpp_macro_arg, struct cpp_identifier):
2079 Add spelling fields.
2080 (struct cpp_token): Update comment on macro_arg.
2081 * internal.h (_cpp_save_parameter): Add extra argument.
2082 (_cpp_spell_ident_ucns): New declaration.
2083 * lex.c (lex_identifier): Add SPELLING argument. Set *SPELLING to
2084 original spelling of identifier.
2085 (_cpp_lex_direct): Update calls to lex_identifier.
2086 (_cpp_spell_ident_ucns): New function, factored out of
2088 (cpp_spell_token): Adjust FORSTRING argument semantics to return
2089 original spelling of identifiers. Use _cpp_spell_ident_ucns in
2091 (_cpp_equiv_tokens): Check spellings of identifiers and macro
2092 arguments are identical.
2093 * macro.c (macro_arg_saved_data): New structure.
2094 (paste_tokens): Use original spellings of identifiers from
2096 (_cpp_save_parameter): Add argument SPELLING. Save both canonical
2098 (parse_params): Update calls to _cpp_save_parameter.
2099 (lex_expansion_token): Save spelling of macro argument tokens.
2100 (_cpp_create_definition): Extract canonical node from saved data.
2101 (cpp_macro_definition): Use UCNs in spelling of macro name. Use
2102 original spellings of macro argument tokens and identifiers.
2103 * traditional.c (scan_parameters): Update call to
2104 _cpp_save_parameter.
2106 2014-11-05 Joseph Myers <joseph@codesourcery.com>
2108 PR preprocessor/9449
2109 * init.c (lang_defaults): Enable extended identifiers for C++ and
2110 C99-based standards.
2112 2014-10-22 Alan Modra <amodra@gmail.com>
2114 * symtab.c (ht_create): Use obstack_specify_allocation in place of
2116 * files.c (_cpp_init_files): Likewise.
2117 * init.c (cpp_create_reader): Likewise.
2118 * identifiers.c (_cpp_init_hashtable): Likewise.
2120 2014-10-14 Manuel López-Ibáñez <manu@gcc.gnu.org>
2122 * include/line-map.h (linemap_location_from_macro_expansion_p):
2123 const struct line_maps * argument.
2124 (linemap_position_for_line_and_column): const struct line_map *
2126 * line-map.c (linemap_add_macro_token): Use correct argument name
2128 (linemap_position_for_line_and_column): const struct line_map *
2130 (linemap_macro_map_loc_to_def_point): Fix comment. Make static.
2131 (linemap_location_from_macro_expansion_p): const struct line_maps *
2133 (linemap_resolve_location): Fix argument names in comment.
2135 2014-10-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
2137 * lex.c (search_line_fast): Add new version to be used for Power8
2138 and later targets when Altivec is enabled. Restrict the existing
2139 Altivec version to big-endian systems so that lvsr is not used on
2140 little endian, where it is deprecated. Remove LE-specific code
2141 from the now-BE-only version.
2143 2014-10-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
2144 Jeff Law <law@redhat.com>
2146 * charset.c (convert_no_conversion): Reallocate memory with 25%
2149 2014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net>
2151 Implement SD-6: SG10 Feature Test Recommendations
2152 * internal.h (lexer_state, spec_nodes): Add in__has_include__.
2153 * directives.c: Support __has_include__ builtin.
2154 * expr.c (parse_has_include): New function to parse __has_include__
2155 builtin; (eval_token()): Use it.
2156 * files.c (_cpp_has_header()): New funtion to look for header;
2157 (open_file_failed()): Not an error to not find a header file for
2159 * identifiers.c (_cpp_init_hashtable()): Add entry for __has_include__.
2160 * pch.c (cpp_read_state): Lookup __has_include__.
2161 * traditional.c (enum ls, _cpp_scan_out_logical_line()): Walk through
2162 __has_include__ statements.
2164 2014-09-30 Bernd Edlinger <bernd.edlinger@hotmail.de>
2166 PR preprocessor/58893
2167 * errors.c (cpp_diagnostic): Fix possible out of bounds access.
2168 * files.c (_cpp_stack_include): Initialize src_loc for IT_CMDLINE.
2170 2014-09-24 Marek Polacek <polacek@redhat.com>
2174 * include/cpplib.h (enum cpp_ttype): Define CPP_KEYWORD.
2176 2014-09-17 Jan Hubicka <hubicka@ucw.cz>
2178 * charset.c (conversion): Rename to ...
2179 (cpp_conversion): ... this one; update.
2180 * files.c (file_hash_entry): Rename to ...
2181 (cpp_file_hash_entry): ... this one ; update.
2183 2014-09-17 Marek Polacek <polacek@redhat.com>
2186 * init.c (struct lang_flags): Remove cplusplus_comments.
2187 (cpp_set_lang): Likewise.
2188 (post_options): Likewise.
2189 * lex.c (_cpp_lex_direct): Disallow C++ style comments in C90/C94.
2191 2014-09-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
2193 * include/cpplib.h (struct cpp_options): Declare warn_normalize as
2194 int instead of enum.
2196 2014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
2198 * macro.c (replace_args): Use cpp_pedwarning, cpp_warning and
2200 * include/cpplib.h: Add CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC.
2201 * init.c (cpp_create_reader): Do not init to -1 here.
2202 * expr.c (num_binary_op): Use cpp_pedwarning.
2204 2014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
2206 * directives.c (check_eol_1): New.
2207 (check_eol_endif_labels): New.
2208 (check_eol): Call check_eol_1.
2209 (do_else,do_endif): Call check_eol_endif_labels.
2211 2014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
2213 * macro.c (warn_of_redefinition): Suppress warnings for builtins
2214 that lack the NODE_WARN flag, unless Wbuiltin-macro-redefined.
2215 (_cpp_create_definition): Use Wbuiltin-macro-redefined for
2216 builtins that lack the NODE_WARN flag.
2217 * directives.c (do_undef): Likewise.
2218 * init.c (cpp_init_special_builtins): Do not change flags
2219 depending on Wbuiltin-macro-redefined.
2221 2014-08-28 Edward Smith-Rowland <3dw4rd@verizon.net>
2223 PR cpp/23827 - standard C++ should not have hex float preprocessor
2225 * libcpp/init.c (lang_flags): Change CXX98 flag for extended numbers
2227 * libcpp/expr.c (cpp_classify_number): Weite error message for improper
2228 use of hex floating literal.
2230 2014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
2232 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z;
2233 Rename CLK_GNUCXX1Y, CLK_CXX1Y to CLK_GNUCXX14, CLK_CXX14;
2234 * init.c (struct lang_flags lang_defaults): Add column for trigraphs;
2235 Add rows for CLK_GNUCXX1Z, CLK_CXX1Z; (cpp_set_lang): Set trigraphs;
2236 (cpp_init_builtins): Set __cplusplus to 201402L for C++14;
2237 Set __cplusplus to 201500L for C++17.
2238 * expr.c (cpp_classify_number): Change C++1y to C++14 in binary
2239 constants error message.
2241 2014-08-20 Marek Polacek <polacek@redhat.com>
2243 * include/cpplib.h (cpp_options): Use signed char.
2244 * lex.c (_cpp_lex_direct): Don't warn in C++ mode.
2246 2014-08-19 Marek Polacek <polacek@redhat.com>
2248 * lex.c (_cpp_lex_direct): Fix a typo.
2250 2014-08-19 Marek Polacek <polacek@redhat.com>
2252 * charset.c (_cpp_valid_ucn): Warn only if -Wc90-c99-compat.
2253 * lex.c (_cpp_lex_direct): Likewise.
2254 * macro.c (replace_args): Likewise.
2255 (parse_params): Likewise.
2256 * include/cpplib.h (cpp_options): Change cpp_warn_c90_c99_compat
2259 2014-08-10 Marek Polacek <polacek@redhat.com>
2262 * lex.c (_cpp_lex_direct): Warn when -Wc90-c99-compat is in effect.
2263 * charset.c (_cpp_valid_ucn): Likewise.
2264 * include/cpplib.h (cpp_options): Add cpp_warn_c90_c99_compat.
2265 * macro.c (replace_args): Warn when -Wc90-c99-compat is in effect.
2266 (parse_params): Likewise.
2268 2014-07-27 Marek Polacek <polacek@redhat.com>
2271 * macro.c (builtin_macro): Add location parameter. Set
2272 location of builtin macro to the expansion point.
2273 (enter_macro_context): Pass location to builtin_macro.
2275 2014-07-16 Dodji Seketeli <dodji@redhat.com>
2277 Support location tracking for built-in macro tokens
2278 * include/line-map.h (line_maps::builtin_location): New data
2280 (line_map_init): Add a new parameter to initialize the new
2281 line_maps::builtin_location data member.
2282 * line-map.c (linemap_init): Initialize the
2283 line_maps::builtin_location data member.
2284 * macro.c (builtin_macro): Create a macro map and track the token
2285 resulting from the expansion of a built-in macro.
2287 2014-07-10 Edward Smith-Rowland <3dw4rd@verizon.net>
2288 Jonathan Wakely <jwakely@redhat.com>
2290 PR preprocessor/61389
2291 * macro.c (_cpp_arguments_ok, parse_params, create_iso_definition):
2292 Warning messages mention C++11 in c++ mode and C99 in c mode.
2293 * lex.c (lex_identifier_intern, lex_identifier): Ditto
2295 2014-07-09 Edward Smith-Rowland <3dw4rd@verizon.net>
2297 PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped
2299 * lex.c (lex_raw_string ()): Do not warn about invalid suffix
2300 if skipping. (lex_string ()): Ditto.
2302 2014-06-04 Edward Smith-Rowland <3dw4rd@verizon.net>
2305 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
2306 Combine user-defined escape logic with the other string and char logic.
2308 2014-05-26 Richard Biener <rguenther@suse.de>
2310 * configure.ac: Remove long long and __int64 type checks,
2311 add check for uint64_t and fail if that wasn't found.
2312 * include/cpplib.h (cpp_num_part): Use uint64_t.
2313 * config.in: Regenerate.
2314 * configure: Likewise.
2316 2014-05-21 Marek Polacek <polacek@redhat.com>
2319 * files.c (find_file_in_dir): Add parens around &&.
2321 2014-05-20 Edward Smith-Rowland <3dw4rd@verizon.net>
2324 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
2325 Check for user-defined literal strings and user-defined literal chars
2326 to escape necessary characters.
2328 2014-05-20 Richard Biener <rguenther@suse.de>
2330 * configure.ac: Copy gcc logic of detecting a 64bit type.
2331 Remove HOST_WIDE_INT define.
2332 * include/cpplib.h: typedef cpp_num_part to a 64bit type,
2333 similar to how hwint.h does it.
2334 * config.in: Regenerate.
2335 * configure: Likewise.
2337 2014-05-09 Joey Ye <joey.ye@arm.com>
2339 * files.c (find_file_in_dir): Always try to shorten for DOS
2341 * init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS.
2343 2014-05-07 Richard Biener <rguenther@suse.de>
2345 * configure.ac: Always set need_64bit_hwint to yes.
2346 * configure: Regenerated.
2348 2014-04-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2350 * lex.c: Remove Solaris 9 reference.
2352 2014-02-24 Walter Lee <walt@tilera.com>
2354 * configure.ac: Change "tilepro" triplet to "tilepro*".
2355 * configure: Regenerate.
2357 2014-02-19 Jakub Jelinek <jakub@redhat.com>
2359 PR preprocessor/58844
2360 * macro.c (enter_macro_context): Only push
2361 macro_real_token_count (macro) tokens rather than
2362 macro->count tokens, regardless of
2363 CPP_OPTION (pfile, track-macro-expansion).
2365 2014-02-07 Jakub Jelinek <jakub@redhat.com>
2367 PR preprocessor/56824
2368 * line-map.c (get_combined_adhoc_loc, linemap_get_expansion_line,
2369 linemap_get_expansion_filename, linemap_location_in_system_header_p,
2370 linemap_location_from_macro_expansion_p,
2371 linemap_macro_loc_to_spelling_point, linemap_macro_loc_to_def_point,
2372 linemap_macro_loc_to_exp_point, linemap_expand_location): Fix
2374 (linemap_compare_locations): Look through adhoc locations for both
2377 2014-01-23 Dodji Seketeli <dodji@redhat.com>
2379 PR PR preprocessor/58580
2380 * include/line-map.h (linemap_get_file_highest_location): Declare
2382 * line-map.c (linemap_get_file_highest_location): Define it.
2384 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
2386 Update copyright years
2388 2013-12-09 Joseph Myers <joseph@codesourcery.com>
2390 PR preprocessor/55715
2391 * expr.c (num_binary_op): Implement subtraction directly rather
2392 than with negation and falling through into addition case.
2394 2013-11-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
2396 * lex.c (search_line_fast): Correct for little endian.
2398 2013-11-15 Joseph Myers <joseph@codesourcery.com>
2400 * ucnid.tab: Add C11 and C11NOSTART data.
2401 * makeucnid.c (digit): Rename enum value to N99.
2402 (C11, N11, all_languages): New enum values.
2403 (NUM_CODE_POINTS, MAX_CODE_POINT): New macros.
2404 (flags, decomp, combining_value): Use NUM_CODE_POINTS as array
2406 (decomp): Use unsigned int as element type.
2407 (all_decomp): New array.
2408 (read_ucnid): Handle C11 and C11NOSTART. Use MAX_CODE_POINT.
2409 (read_table): Use MAX_CODE_POINT. Store all decompositions in
2411 (read_derived): Use MAX_CODE_POINT.
2412 (write_table): Use NUM_CODE_POINTS. Print N99, C11 and N11
2413 flags. Print whole array variable declaration rather than just
2415 (char_id_valid, write_context_switch): New functions.
2416 (main): Call write_context_switch.
2417 * ucnid.h: Regenerate.
2418 * include/cpplib.h (struct cpp_options): Add c11_identifiers.
2419 * init.c (struct lang_flags): Add c11_identifiers.
2420 (cpp_set_lang): Set c11_identifiers option from selected language.
2421 * internal.h (struct normalize_state): Document "previous" as
2422 previous starter character.
2423 (NORMALIZE_STATE_UPDATE_IDNUM): Take character as argument.
2424 * charset.c (DIG): Rename enum value to N99.
2425 (C11, N11): New enum values.
2426 (struct ucnrange): Give name to struct. Use short for flags and
2427 unsigned int for end of range. Include ucnid.h for whole variable
2429 (ucn_valid_in_identifier): Allow for characters up to 0x10FFFF.
2430 Allow for C11 in determining valid characters and valid start
2431 characters. Use check_nfc for non-Hangul context-dependent
2432 checks. Only store starter characters in nst->previous.
2433 (_cpp_valid_ucn): Pass new argument to
2434 NORMALIZE_STATE_UPDATE_IDNUM.
2435 * lex.c (lex_identifier): Pass new argument to
2436 NORMALIZE_STATE_UPDATE_IDNUM. Call NORMALIZE_STATE_UPDATE_IDNUM
2437 after initial non-UCN part of identifier.
2438 (lex_number): Pass new argument to NORMALIZE_STATE_UPDATE_IDNUM.
2440 2013-11-15 Joseph Myers <joseph@codesourcery.com>
2442 * ucnid.tab: Mark C99 digits as [C99DIG].
2443 * makeucnid.c (read_ucnid): Handle [C99DIG].
2444 (read_table): Don't check for digit characters.
2445 * ucnid.h: Regenerate.
2447 2013-11-06 Tobias Burnus <burnus@net-b.de>
2449 * macro.c (_cpp_builtin_macro_text): Correct
2450 wording of two warnings.
2452 2013-11-05 Tobias Burnus <burnus@net-b.de>
2454 * include/cpplib.h (CPP_W_DATE_TIME): Added.
2455 (cpp_options): Add warn_date_time.
2456 * init.c (cpp_create_reader): Init it.
2457 * macro.c (_cpp_builtin_macro_text): Warn when
2458 __DATE__/__TIME__/__TIMESTAMP__ is used.
2460 2013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
2462 Implement C++14 digit separators.
2463 * include/cpplib.h (cpp_options): Add digit_separators flag.
2464 * internal.h (DIGIT_SEP(c)): New macro.
2465 * expr.c (cpp_classify_number): Check improper placement of digit sep;
2466 (cpp_interpret_integer): Skip over digit separators.
2467 * init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add
2468 digit separator flags per language; (cpp_set_lang): Set
2470 * lex.c (lex_number): Add digits separator to allowable characters for
2473 2013-10-15 David Malcolm <dmalcolm@redhat.com>
2475 * Makefile.in (PICFLAG): New.
2476 (ALL_CFLAGS): Add PICFLAG.
2477 (ALL_CXXFLAGS): Likewise.
2478 * configure.ac: Add --enable-host-shared, setting up new
2480 * configure: Regenerate.
2482 2013-08-07 Richard Earnshaw <rearnsha@arm.com>
2484 * configure.ac: Set need_64bit_hwint for all arm targets.
2485 * configure: Regenerated.
2487 2013-07-20 Jakub Jelinek <jakub@redhat.com>
2489 PR preprocessor/57620
2490 * lex.c (lex_raw_string): Undo phase1 and phase2 transformations
2491 between R" and final " rather than only in between R"del( and )del".
2493 2013-07-10 Jakub Jelinek <jakub@redhat.com>
2495 PR preprocessor/57824
2496 * lex.c (lex_raw_string): Allow reading new-lines if
2497 in_deferred_pragma or if parsing_args and there is still
2498 data in the current buffer.
2500 * include/cpplib.h (cpp_token_val_index): Change parameter type to
2502 * lex.c (cpp_token_val_index): Likewise.
2504 PR preprocessor/57757
2505 * lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING
2506 or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that
2509 2013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
2511 * lex.c (lex_raw_string(), lex_string()): Constrain suffixes treated
2512 as concatenated literal and macro to just the patterns found in
2513 inttypes.h; (is_macro()): New.
2515 2013-06-24 Dehao Chen <dehao@google.com>
2517 * files.c (_cpp_stack_include): Fix the highest_location when header
2518 file is guarded by #ifndef and is included twice.
2520 2013-04-28 Jakub Jelinek <jakub@redhat.com>
2522 N3472 binary constants
2523 * include/cpplib.h (struct cpp_options): Fix a typo in user_literals
2524 field comment. Add binary_constants field.
2525 * init.c (struct lang_flags): Add binary_constants field.
2526 (lang_defaults): Add bin_cst column to the table.
2527 (cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants).
2528 * expr.c (cpp_classify_number): Talk about C++11 instead of C++0x
2529 in diagnostics. Accept binary constants if
2530 CPP_OPTION (pfile, binary_constants) even when pedantic. Adjust
2533 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
2535 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y.
2536 * init.c (lang_defaults): Add defaults for the latter.
2537 (cpp_init_builtins): Define __cplusplus as 201300L for the latter.
2538 * lex.c (_cpp_lex_direct): Update.
2540 2013-04-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
2543 * configure.ac: Require 64-bit int for arm*-*-rtems*.
2544 * configure: Regenerate.
2546 2013-03-06 Jakub Jelinek <jakub@redhat.com>
2549 * internal.h (struct cpp_buffer): Add to_free field.
2550 (_cpp_pop_file_buffer): Add third argument.
2551 * files.c (_cpp_stack_file): Set buffer->to_free.
2552 (_cpp_pop_file_buffer): Add to_free argument. Free to_free
2553 if non-NULL, and if equal to file->buffer_start, also clear
2554 file->buffer{,_start,_valid}.
2555 * directives.c (_cpp_pop_buffer): Pass buffer->to_free
2556 to _cpp_pop_file_buffer.
2558 2013-03-01 Jakub Jelinek <jakub@redhat.com>
2561 * files.c (_cpp_save_file_entries): Free result at the end.
2562 * pch.c (cpp_string_free): New function.
2563 (cpp_save_state): Use it in htab_create call.
2564 (cpp_write_pch_deps): Free ss->defs. Destroy ss->definedhash.
2566 2013-02-28 Jakub Jelinek <jakub@redhat.com>
2568 * files.c (_cpp_find_file): If returning early, before storing
2569 something to *hash_slot and *hash_slot is NULL, call htab_clear_slot
2570 on it. Access *hash_slot using void * type rather than
2571 struct file_hash_entry * to avoid aliasing issues.
2573 * configure.ac: Don't define ENABLE_CHECKING whenever
2574 --enable-checking is seen, instead use similar --enable-checking=yes
2575 vs. --enable-checking=release default as gcc/ subdir has and
2576 define ENABLE_CHECKING if ENABLE_CHECKING is defined in gcc/.
2577 Define ENABLE_VALGRIND_CHECKING if requested.
2578 * lex.c (new_buff): If ENABLE_VALGRIND_CHECKING, put _cpp_buff
2579 struct first in the allocated buffer and result->base after it.
2580 (_cpp_free_buff): If ENABLE_VALGRIND_CHECKING, free buff itself
2581 instead of buff->base.
2582 * config.in: Regenerated.
2583 * configure: Regenerated.
2585 2013-02-13 Ed Smith-Rowland <3dw4rd@verizon.net>
2588 * lex.c (lex_raw_string): Allow string literal with suffix
2589 beginning with 's' to be parsed as a C++11 user-defined literal.
2591 2013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
2593 Update copyright years.
2595 2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
2597 PR c++/54526 (again)
2598 * lex.c (_cpp_lex_direct): In C++11 mode, implement 2.5 p3, bullet 2.
2600 2013-01-03 Marc Glisse <marc.glisse@inria.fr>
2603 * line-map.c (get_combined_adhoc_loc): Cast from extern "C" type.
2604 (new_linemap): Likewise.
2605 (linemap_enter_macro): Likewise.
2607 2012-12-03 Jakub Jelinek <jakub@redhat.com>
2611 * files.c (read_file_guts): Allocate extra 16 bytes instead of
2612 1 byte at the end of buf. Pass size + 16 instead of size
2613 to _cpp_convert_input.
2614 * charset.c (_cpp_convert_input): Reallocate if there aren't
2615 at least 16 bytes beyond to.len in the buffer. Clear 16 bytes
2616 at to.text + to.len.
2618 2012-11-21 Steve Ellcey <sellcey@mips.com>
2621 * files.c (pch_open_file): Fix check for implicit_preinclude.
2623 2012-11-16 Simon Baldwin <simonb@google.com>
2625 * include/cpplib.h (struct cpp_options): Add canonical_system_headers.
2626 * files.c (find_file_in_dir): Call maybe_shorter_path() only if
2627 canonical_system_headers is set.
2628 * init.c (cpp_create_reader): Initialize canonical_system_headers.
2629 * configure.ac: Add new --enable-canonical-system-headers.
2630 * configure: Regenerate.
2631 * config.in: Regenerate.
2633 2012-11-09 Ed Smith-Rowland <3dw4rd@verizon.net>
2636 * include/cpplib.h (cpp_interpret_float_suffix): Add cpp_reader* arg.
2637 (cpp_interpret_int_suffix): Add cpp_reader* arg.
2638 * init.c (cpp_create_reader): Iitialize new flags.
2639 * expr.c (interpret_float_suffix): Use new flags.
2640 (cpp_interpret_float_suffix): Add cpp_reader* arg.
2641 (interpret_int_suffix): Use new flags.
2642 (cpp_interpret_int_suffix): Add cpp_reader* arg.
2643 (cpp_classify_number): Adjust calls to interpret_x_suffix.
2645 2012-10-23 Ian Bolton <ian.bolton@arm.com>
2646 Jim MacArthur <jim.macarthur@arm.com>
2647 Marcus Shawcroft <marcus.shawcroft@arm.com>
2648 Nigel Stephens <nigel.stephens@arm.com>
2649 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
2650 Richard Earnshaw <rearnsha@arm.com>
2651 Sofiane Naci <sofiane.naci@arm.com>
2652 Stephen Thomas <stephen.thomas@arm.com>
2653 Tejas Belagod <tejas.belagod@arm.com>
2654 Yufeng Zhang <yufeng.zhang@arm.com>
2656 * configure.ac: Enable AArch64.
2657 * configure: Regenerate.
2659 2012-10-23 Joseph Myers <joseph@codesourcery.com>
2661 * files.c (struct _cpp_file): Add implicit_preinclude.
2662 (pch_open_file): Allow a previously opened implicitly included
2664 (_cpp_find_file): Add implicit_preinclude argument. Free file and
2665 do not call open_file_failed if implicit_preinclude. Store
2666 implicit_preinclude value.
2667 (_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date):
2668 Update calls to _cpp_find_file.
2669 (_cpp_stack_include): Handle IT_DEFAULT.
2670 (cpp_push_default_include): New.
2671 * include/cpplib.h (cpp_push_default_include): Declare.
2672 * init.c (cpp_read_main_file): Update call to _cpp_find_file.
2673 * internal.h (enum include_type): Add IT_DEFAULT.
2674 (_cpp_find_file): Update prototype.
2676 2012-10-15 Tobias Burnus <burnus@net-b.de>
2678 * files.c (read_file_guts, _cpp_save_file_entries): Free memory
2680 * lex.c (warn_about_normalization): Ditto.
2681 * mkdeps.c (deps_save): Ditto.
2682 * pch.c (cpp_valid_state): Ditto.
2684 2012-10-04 Florian Weimer <fweimer@redhat.com>
2686 * directives.c (do_pragma_warning_or_error): New.
2687 (do_pragma_warning): New.
2688 (do_pragma_error): New.
2689 (_cpp_init_internal_pragmas): Register new pragmas.
2691 2012-09-25 Dehao Chen <dehao@google.com>
2694 * line-map.c (location_adhoc_data_hash): Fix the hash function.
2696 2012-09-25 Dehao Chen <dehao@google.com>
2699 * include/line-map.h (location_adhoc_data): Move location_adhoc_data
2701 (location_adhoc_data_map): Likewise.
2702 (line_maps): Likewise.
2703 (rebuild_location_adhoc_htab): New Function.
2704 * line-map.c (+rebuild_location_adhoc_htab): new Funcion.
2705 (get_combined_adhoc_loc): Move location_adhoc_data into GC.
2706 (location_adhoc_data_fini): Likewise.
2707 (linemap_init): Likewise.
2708 (location_adhoc_data_init): Remove Function.
2710 2012-09-19 Dehao Chen <dehao@google.com>
2712 * include/line-map.h (MAX_SOURCE_LOCATION): New value.
2713 (location_adhoc_data_fini): New.
2714 (get_combined_adhoc_loc): New.
2715 (get_data_from_adhoc_loc): New.
2716 (get_location_from_adhoc_loc): New.
2717 (location_adhoc_data_map): New.
2718 (COMBINE_LOCATION_DATA): New.
2719 (IS_ADHOC_LOC): New.
2720 (expanded_location): New field.
2721 (line_maps): New field.
2722 * line-map.c (location_adhoc_data): New.
2723 (location_adhoc_data_hash): New.
2724 (location_adhoc_data_eq): New.
2725 (location_adhoc_data_update): New.
2726 (get_combined_adhoc_loc): New.
2727 (get_data_from_adhoc_loc): New.
2728 (get_location_from_adhoc_loc): New.
2729 (location_adhoc_data_init): New.
2730 (location_adhoc_data_fini): New.
2731 (linemap_init): Initialize location_adhoc_data.
2732 (linemap_lookup): Change to use new location.
2733 (linemap_ordinary_map_lookup): Likewise.
2734 (linemap_macro_map_lookup): Likewise.
2735 (linemap_macro_map_loc_to_def_point): Likewise.
2736 (linemap_macro_map_loc_unwind_toward_spel): Likewise.
2737 (linemap_get_expansion_line): Likewise.
2738 (linemap_get_expansion_filename): Likewise.
2739 (linemap_location_in_system_header_p): Likewise.
2740 (linemap_location_from_macro_expansion_p): Likewise.
2741 (linemap_macro_loc_to_spelling_point): Likewise.
2742 (linemap_macro_loc_to_def_point): Likewise.
2743 (linemap_macro_loc_to_exp_point): Likewise.
2744 (linemap_resolve_location): Likewise.
2745 (linemap_unwind_toward_expansion): Likewise.
2746 (linemap_unwind_to_first_non_reserved_loc): Likewise.
2747 (linemap_expand_location): Likewise.
2748 (linemap_dump_location): Likewise.
2749 (linemap_line_start): Likewise.
2751 2012-05-25 Dodji Seketeli <dodji@redhat.com>
2753 PR preprocessor/53469
2754 * directives.c (do_pragma): Use the virtual location for the
2755 pragma token, instead of its spelling location.
2757 2012-08-14 Diego Novillo <dnovillo@google.com>
2759 Merge from cxx-conversion branch. Configury.
2761 * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
2762 * configure.ac: Likewise.
2763 * configure: Regenerate.
2765 2012-08-14 Lawrence Crowl <crowl@google.com>
2767 Merge from cxx-conversion branch. New C++ hash table.
2769 * include/symtab.h (typedef struct ht hash_table): Change the typedef
2770 name to cpp_hash_table. Update all users of the typedef.
2772 2012-07-30 Laurynas Biveinis <laurynas.biveinis@gmail.com>
2774 * include/line-map.h (line_map_macro): Use the "atomic" GTY option
2775 for the macro_locations field.
2777 2011-06-19 Uros Bizjak <ubizjak@gmail.com>
2779 * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
2780 __builtin_ia32_pcmpestri128 instead of asm.
2782 2012-06-04 Dimitrios Apostolou <jimis@gmx.net>
2784 * line-map.c (linemap_enter_macro): Don't zero max_column_hint in
2785 every macro. This improves performance by reducing the number of
2786 reallocations when track-macro-expansion is on.
2788 2012-06-04 Dodji Seketeli <dodji@redhat.com>
2790 PR preprocessor/53463
2791 * line-map.c (linemap_location_in_system_header_p): For built-in
2792 macro tokens, check the first expansion point location that is not
2793 for a token coming from a built-in macro.
2795 2012-05-29 Joseph Myers <joseph@codesourcery.com>
2797 * directives.c: Fix typos.
2798 * include/line-map.h: Fix typos.
2799 * line-map.c: Fix typos.
2800 * macro.c: Fix typos.
2802 2012-05-25 Dodji Seketeli <dodji@redhat.com>
2805 * lex.c (search_line_fast): Avoid unused local typedefs to simulate
2808 2012-05-29 Dodji Seketeli <dodji@redhat.com>
2810 PR preprocessor/53229
2811 * internal.h (cpp_reader::set_invocation_location): Remove.
2812 (cpp_reader::about_to_expand_macro_p): New member flag.
2813 * directives.c (do_pragma): Remove Kludge as
2814 pfile->set_invocation_location is no more.
2815 * macro.c (cpp_get_token_1): Do away with the use of
2816 cpp_reader::set_invocation_location. Just collect the macro
2817 expansion point when we are about to expand the top-most macro.
2818 Do not override cpp_reader::about_to_expand_macro_p.
2819 This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding
2820 properly handle locations of expansion points.
2821 (cpp_get_token_with_location): Adjust, as
2822 cpp_reader::set_invocation_location is no more.
2823 (paste_tokens): Take a virtual location parameter for
2824 the LHS of the pasting operator. Use it in diagnostics. Update
2826 (paste_all_tokens): Tighten the assert. Propagate the location of
2827 the expansion point when no virtual locations are available.
2828 Pass the virtual location to paste_tokens.
2829 (in_macro_expansion_p): New static function.
2830 (enter_macro_context): Set the cpp_reader::about_to_expand_macro_p
2831 flag until we really start expanding the macro.
2833 2012-05-16 Dodji Seketeli <dodji@redhat.com>
2835 PR preprocessor/7263
2836 * include/cpplib.h (cpp_classify_number): Take a location
2838 * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic
2839 macros that take a location parameter.
2840 (cpp_classify_number): Take a (virtual) location parameter. Use
2841 it for diagnostics. Adjust comments.
2842 (eval_token): Take a location parameter. Pass it to
2843 cpp_classify_number and to diagnostic routines.
2844 (_cpp_parse_expr): Use virtual locations of tokens when parsing
2845 expressions. Pass a virtual location to eval_token and to
2846 diagnostic routines.
2848 2012-05-10 Tristan Gingold <gingold@adacore.com>
2850 * expr.c (interpret_float_suffix): Add a guard.
2852 2012-05-02 Dodji Seketeli <dodji@redhat.com>
2854 Properly initialize cpp_context in destringize_and_run
2855 * directives.c (destringize_and_run): Properly initialize the new
2857 * macro.c (_cpp_pop_context): Assert that we shouldn't try to pop
2858 the initial base context, which has the same life time as the
2859 current instance of cpp_file.
2861 2012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
2862 Dodji Seketeli <dodji@seketeli.org>
2865 * libcpp/files.c (maybe_shorter_path): New.
2866 (find_file_in_dir): Use it.
2868 2012-04-30 Dodji Seketeli <dodji@redhat.com>
2870 Switch -ftrack-macro-expansion=2 on by default.
2871 * init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
2872 by default. Add comments.
2874 Strip "<built-in>" loc from displayed expansion context
2875 * include/line-map.h (linemap_unwind_toward_expansion): Fix typo
2877 (linemap_unwind_to_first_non_reserved_loc): Declare new function.
2878 * line-map.c (linemap_unwind_to_first_non_reserved_loc): Define
2881 Fix expansion point loc for macro-like tokens
2882 * macro.c (macro_of_context): New static function.
2883 (_cpp_push_token_context, push_extended_tokens_context): If the
2884 macro argument is NULL, it means we are continuing the expansion
2885 of the current macro, if any. Update comments.
2886 (_cpp_pop_context): Re-enable expansion of the macro only when we
2887 are really out of the context of the current expansion.
2889 Fix token pasting with -ftrack-macro-expansion
2890 * macro.c (paste_all_tokens): Put the token resulting from pasting
2891 into an extended token context with -ftrack-macro-location is in
2894 Fix cpp_sys_macro_p with -ftrack-macro-expansion
2895 * macro.c (cpp_sys_macro_p): Support -ftrack-macro-expansion.
2897 2012-04-29 Dodji Seketeli <dodji@redhat.com>
2899 * lex.c (lex_raw_string): Change C++ style comments into C style
2901 (lex_string): Likewise.
2903 2012-04-27 Ollie Wild <aaw@google.com>
2905 * include/cpplib.h (struct cpp_options): Add new field,
2906 warn_literal_suffix.
2907 (CPP_W_LITERAL_SUFFIX): New enum.
2908 * init.c (cpp_create_reader): Default initialization of
2909 warn_literal_suffix.
2910 * lex.c (lex_raw_string): Treat user-defined literals which don't
2911 begin with '_' as separate tokens and produce a warning.
2912 (lex_string): Ditto.
2914 2012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
2916 * line-map.c (linemap_resolve_location): Synchronize comments with
2917 those in line-map.h.
2918 * include/line-map.h (linemap_resolve_location): Fix spelling in
2921 2012-03-22 Richard Earnshaw <rearnsha@arm.com>
2923 * lex.c (search_line_fast): Provide Neon-optimized version for ARM.
2925 2012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2927 * lex.c: Remove Solaris 8 reference.
2929 2012-02-14 Walter Lee <walt@tilera.com>
2931 * configure.ac: Require 64-bit hwint for tilegx and tilepro.
2932 * configure: Regenerate.
2934 2012-01-09 Richard Guenther <rguenther@suse.de>
2936 * macro.c (_cpp_builtin_macro_text): Remove unused variable map.
2938 2012-01-09 Gary Funck <gary@intrepid.com>
2940 PR preprocessor/33919
2941 * files.c (_cpp_get_file_name): New. Implement file name
2943 * internal.h (_cpp_get_file_name): New prototype.
2944 * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
2945 to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
2947 2012-01-03 Olivier Hainque <hainque@adacore.com>
2949 * system.h: Prior to #define, #undef fopen and freopen unconditionally.
2951 2011-12-20 Joseph Myers <joseph@codesourcery.com>
2953 * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
2954 (CLK_STDC1X): Change to CLK_STDC11.
2955 * init.c (lang_defaults): Update comments.
2956 (cpp_init_builtins): Update language tests. Use 201112L for C11
2959 2011-12-20 Andreas Schwab <schwab@linux-m68k.org>
2961 * configure: Regenerate.
2963 2011-12-19 Andreas Schwab <schwab@linux-m68k.org>
2965 * configure: Regenerate.
2967 2011-12-07 Jakub Jelinek <jakub@redhat.com>
2970 * internal.h (_cpp_init_lexer): New prototype.
2971 * init.c (init_library): Call it.
2972 * lex.c (init_vectorized_lexer): Remove constructor attribute,
2974 (HAVE_init_vectorized_lexer): Define.
2975 (_cpp_init_lexer): New function.
2977 2011-12-03 Dodji Seketeli <dodji@redhat.com>
2979 * macro.c (tokens_buff_remove_last_token)
2980 (tokens_buff_put_token_to): Add an 'inline' function specifier to
2983 2011-11-22 Diego Novillo <dnovillo@google.com>
2985 * include/line-map.h (linemap_dump): Declare.
2986 (line_table_dump): Declare.
2987 * line-map.c (linemap_dump): New.
2988 (line_table_dump): New.
2990 2011-11-21 Ed Smith-Rowland <3dw4rd@verizon.net>
2993 * expr.c (cpp_userdef_char_remove_type): Fix typo.
2995 2011-11-03 Michael Matz <matz@suse.de>
2998 * configure.ac: Check for -fno-exceptions -fno-rtti.
2999 * configure: Regenerate.
3000 * Makefile.in (NOEXCEPTION_FLAGS): New flag.
3001 (ALL_CXXFLAGS): Use it.
3003 2011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
3005 * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
3007 2011-11-02 Jason Merrill <jason@redhat.com>
3010 * configure.ac: Add -Wno-narrowing to warning options.
3012 2011-10-31 Jason Merrill <jason@redhat.com>
3015 * init.c (cpp_init_builtins): Set __cplusplus for C++11.
3018 * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
3019 CLK_GNUCXX0X to CLK_GNUCXX11.
3021 2011-10-26 Ed Smith-Rowland <3dw4rd@verizon.net>
3023 Implement C++11 user-defined literals.
3024 * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
3025 cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
3026 cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
3027 cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
3028 (cpp_classify_number): Classify unrecognized tokens as user-defined
3030 * include/cpplib.h: Add new tokens for user-defined literals.
3031 * init.c: Add new preprocessor flag (cxx11).
3032 * lex.c: (lex_string, lex_raw_string): Handle user-defined literals
3033 including concatenation and promotion with suffixes.
3035 2011-10-24 Dodji Seketeli <dodji@redhat.com>
3037 * line-map.c (linemap_macro_map_lookup): Fix logic.
3039 2011-10-24 Dodji Seketeli <dodji@redhat.com>
3041 * include/line-map.h (linemap_expand_location): Take a line table
3042 parameter. Update comment.
3043 (linemap_resolve_location): Update comment.
3044 (linemap_expand_location_full): Remove.
3045 * line-map.c (linemap_resolve_location): Handle reserved
3046 locations; return a NULL map in those cases.
3047 (linemap_expand_location): If location is reserved, return a
3048 zeroed expanded location. Update comment. Take a line table to
3049 assert that the function takes non-virtual locations only.
3050 (linemap_expand_location_full): remove.
3051 (linemap_dump_location): Handle the fact that
3052 linemap_resolve_location can return NULL line maps when the
3053 location resolves to a reserved location.
3055 * line-map.c (linemap_macro_map_lookup): Fix logic.
3057 2011-10-22 Dodji Seketeli <dodji@redhat.com>
3060 * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
3061 context to act upon.
3062 * lex.c (_cpp_remaining_tokens_num_in_context): Likewise. Update
3064 (cpp_token_from_context_at): Likewise.
3065 (cpp_peek_token): Use the context to peek tokens from.
3067 2011-10-20 Dodji Seketeli <dodji@redhat.com>
3070 * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
3073 2011-10-18 Dodji Seketeli <dodji@redhat.com>
3076 * include/line-map.h (struct linemap_stats): Change the type of
3077 the members from size_t to long.
3078 * macro.c (macro_arg_token_iter_init): Unconditionally initialize
3081 2011-10-17 Dodji Seketeli <dodji@redhat.com>
3083 * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
3084 variable without using it if ENABLE_CHECKING is not defined. Mark
3085 the LOCATION parameter as being unused.
3087 2011-10-15 Tom Tromey <tromey@redhat.com>
3088 Dodji Seketeli <dodji@redhat.com>
3090 * include/line-map.h (struct line_maps::alloced_size_for_request):
3092 * line-map.c (new_linemap): Use set->alloced_size_for_request to
3093 get the actual allocated size of line maps.
3095 2011-10-15 Tom Tromey <tromey@redhat.com>
3096 Dodji Seketeli <dodji@redhat.com>
3098 * line-map.h (struct linemap_stats): Declare new struct.
3099 (linemap_get_statistics): Declare ...
3100 * line-map.c (linemap_get_statistics): ... new function.
3101 * macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
3102 Declare new counters.
3103 (enter_macro_context, replace_args): Update
3104 num_macro_tokens_counter.
3105 (cpp_get_token_1): Update num_expanded_macros_counter.
3107 2011-10-15 Tom Tromey <tromey@redhat.com>
3108 Dodji Seketeli <dodji@redhat.com>
3110 * include/cpplib.h (struct cpp_options)<debug>: New struct member.
3111 * include/line-map.h (linemap_dump_location): Declare ...
3112 * line-map.c (linemap_dump_location): ... new function.
3114 2011-10-15 Tom Tromey <tromey@redhat.com>
3115 Dodji Seketeli <dodji@redhat.com>
3117 * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
3119 * internal.h (struct macro_context): New struct.
3120 (enum context_tokens_kind): New enum.
3121 (struct cpp_context)<tokens_kind>: New member of type enum
3122 context_tokens_kind.
3123 (struct cpp_context)<macro>: Remove this. Replace it with an enum
3124 of macro and macro_context.
3125 (struct cpp_context)<direct_p>: Remove.
3126 (_cpp_remaining_tokens_num_in_context): Declare new function.
3127 * directives.c (destringize_and_run): Adjust.
3128 * lex.c (_cpp_remaining_tokens_num_in_context)
3129 (_cpp_token_from_context_at): Define new functions
3130 (cpp_peek_token): Use them.
3131 * init.c (cpp_create_reader): Initialize the base context to zero.
3132 (_cpp_token_from_context_at): Define new static function.
3133 (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
3134 _cpp_token_from_context_at.
3135 * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
3137 (enum macro_arg_token_kind): New enum.
3138 (struct macro_arg_token_iter): New struct.
3139 (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
3140 (alloc_expanded_arg_mem, ensure_expanded_arg_room)
3141 (delete_macro_args, set_arg_token, get_arg_token_location)
3142 (arg_token_ptr_at, macro_arg_token_iter_init)
3143 (macro_arg_token_iter_get_token)
3144 (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
3145 (expanded_token_index, tokens_buff_new, tokens_buff_count)
3146 (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
3147 (tokens_buff_add_token, tokens_buff_remove_last_token)
3148 (reached_end_of_context, consume_next_token_from_context): New
3150 (cpp_get_token_1): New static function. Split and extended from
3151 cpp_get_token. Use reached_end_of_context and
3152 consume_next_token_from_context. Unify its return point. Move
3153 the location tweaking from cpp_get_token_with_location in here.
3154 (cpp_get_token): Use cpp_get_token_1
3155 (stringify_arg): Use the new arg_token_at.
3156 (paste_all_tokens): Support tokens coming from extended tokens
3158 (collect_args): Return the number of collected arguments, by
3159 parameter. Store virtual locations of tokens that constitute the
3161 (funlike_invocation_p): Return the number of collected arguments,
3163 (enter_macro_context): Add a parameter for macro expansion point.
3164 Pass it to replace_args and to the "used" cpp callback. Get the
3165 number of function-like macro arguments from funlike_invocation_p,
3166 pass it to the new delete_macro_args to free the memory used by
3167 macro args. When -ftrack-macro-expansion is in effect, for macros
3168 that have no arguments, create a macro map for the macro expansion
3169 and use it to allocate proper virtual locations for tokens
3170 resulting from the expansion. Push an extended tokens context
3171 containing the tokens resulting from macro expansion and their
3173 (replace_args): Rename the different variables named 'count' into
3174 variables with more meaningful names. Create a macro map;
3175 allocate virtual locations of tokens resulting from this
3176 expansion. Use macro_arg_token_iter to iterate over tokens of a
3177 given macro. Handle the case of the argument of
3178 -ftrack-macro-expansion being < 2. Don't free macro arguments
3179 memory resulting from expand_arg here, as these are freed by the
3180 caller of replace_arg using delete_macro_args now. Push extended
3182 (next_context, push_ptoken_context, _cpp_push_token_context)
3183 (_cpp_push_text_context): Properly initialize the context.
3184 (expand_arg): Use the new alloc_expanded_arg_mem,
3185 push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
3186 (_cpp_pop_context): Really free the memory held by the context.
3187 Handle freeing memory used by extended tokens contexts.
3188 (cpp_get_token_with_location): Use cpp_get_token_1.
3189 (cpp_sys_macro_p): Adjust.
3190 (_cpp_backup_tokens): Support the new kinds of token contexts.
3191 * traditional.c (recursive_macro): Adjust.
3193 2011-10-15 Tom Tromey <tromey@redhat>
3194 Dodji Seketeli <dodji@redhat.com>
3196 * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
3198 (MAX_SOURCE_LOCATION): New constant.
3199 (struct line_map_ordinary, struct line_map_macro): New structs.
3200 (struct line_map): Turn this into a union of the two above. Add
3202 (struct maps_info): New struct.
3203 (struct line_maps)<info_ordinary, info_macro>: Two new fields.
3204 These now carry the map information that was previously scattered
3205 in struct line_maps.
3206 (struct map_info::allocated): Fix comment.
3207 (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
3208 (ORDINARY_MAP_STARTING_LINE_NUMBER)
3209 (ORDINARY_MAP_INCLUDER_FILE_INDEX)
3210 (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
3211 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
3212 (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
3213 (MACRO_MAP_EXPANSION_POINT_LOCATION)
3214 (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
3215 (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
3216 (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
3217 (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
3218 (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
3219 (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
3220 (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
3221 (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
3222 (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
3223 (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
3224 (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
3226 (linemap_check_ordinary, linemap_assert)
3227 (linemap_location_before_p): New macros.
3228 (linemap_position_for_line_and_column)
3229 (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
3230 (linemap_macro_expansion_map_p)
3231 (linemap_macro_map_loc_to_def_point)
3232 (linemap_macro_map_loc_unwind_once)
3233 (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
3234 (linemap_get_source_line linemap_get_source_column)
3235 (linemap_map_get_macro_name, linemap_get_file_path)
3236 (linemap_location_in_system_header_p)
3237 (linemap_location_from_macro_expansion_p): Declare new functions.
3238 (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
3239 (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
3240 accessors act on ordinary maps only.
3241 (INCLUDED_FROM): Return NULL for main files; use the new
3243 (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
3244 (struct expanded_location): Move here from gcc/input.h
3245 (linemap_resolve_location, linemap_expand_location)
3246 (linemap_expand_location_full): Declare new functions.
3247 * line-map.c: Include cpplib.h, internal.h
3248 (linemap_enter_macro, linemap_add_macro_token)
3249 (linemap_get_expansion_line, linemap_get_expansion_filename): New
3250 functions that are private to libcpp.
3251 (linemap_assert): New macro.
3252 (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
3253 (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
3254 (linemap_macro_map_loc_unwind_toward_spelling)
3255 (linemap_macro_map_loc_to_exp_point)
3256 (first_map_in_common_1, first_map_in_common): New static
3258 (new_linemap): Define new static functions. Extracted and
3260 (linemap_add): ... here. Use linemap_assert in lieu of abort
3262 (linemap_tracks_macro_expansion_locs_p)
3263 (linemap_add_macro_token, linemap_macro_expansion_map_p)
3264 (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
3265 (linemap_macro_map_loc_to_def_point)
3266 (linemap_macro_map_loc_unwind_once)
3267 (linemap_step_out_once, linemap_map_get_index)
3268 (linemap_get_source_line,linemap_get_source_column)
3269 (linemap_get_file_path, linemap_map_get_macro_name)
3270 (linemap_location_in_system_header_p)
3271 (linemap_location_originated_from_system_header_p)
3272 (linemap_location_from_macro_expansion_p)
3273 (linemap_tracks_macro_expansion_locs_p)
3274 (linemap_resolve_location, linemap_expand_location)
3275 (linemap_expand_location_full)
3276 (linemap_tracks_macro_expansion_locs_p)
3277 (linemap_position_for_line_and_column, linemap_compare_locations):
3278 Define new public functions.
3279 (linemap_init): Initialize ordinary and macro maps information in
3281 (linemap_check_files_exited): Use the new accessors.
3282 (linemap_free): Remove this dead code.
3283 (linemap_line_start): Assert this uses an ordinary map. Adjust to
3284 use the new ordinary map accessors and data structures. Don't
3285 overflow past the lowest possible macro token's location.
3286 (linemap_position_for_column): Assert the ordinary maps of the map
3287 set are really ordinary. Use ordinary map accessors.
3288 (linemap_lookup): Keep the same logic but generalize to allow
3289 lookup of both ordinary and macro maps. Do not crash when called
3290 with an empty line table.
3291 * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
3292 new API of line-map.h.
3293 * directives.c (start_directive, do_line, do_linemarker)
3294 (do_linemarker): Likewise.
3295 * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
3296 (make_cpp_dir, cpp_make_system_header): Likewise.
3297 * init.c (cpp_read_main_file): Likewise.
3298 * internal.h (CPP_INCREMENT_LINE): Likewise.
3299 (linemap_enter_macro, linemap_add_macro_token)
3300 (linemap_get_expansion_line, linemap_get_expansion_filename): New
3301 functions private to libcpp.
3302 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
3303 (skip_line_comment, skip_whitespace, lex_raw_string)
3304 (_cpp_lex_direct): Likewise.
3305 * macro.c (_cpp_builtin_macro_text): Likewise.
3306 (_cpp_aligned_alloc): Initialize the new name member of the macro.
3307 * traditional.c (copy_comment, _cpp_scan_out_logical_line):
3309 * errors.c (cpp_diagnostic): Adjust to new linemap API.
3311 2011-08-28 Dodji Seketeli <dodji@redhat.com>
3313 * line-map.c (linemap_add): Assert that reason must not be
3314 LC_RENAME when called for the first time on a "main input file".
3316 2011-08-22 Gabriel Charette <gchare@google.com>
3318 * init.c (cpp_create_reader): Inititalize forced_token_location_p.
3319 * internal.h (struct cpp_reader): Add field forced_token_location_p.
3320 * lex.c (_cpp_lex_direct): Use forced_token_location_p.
3321 (cpp_force_token_locations): New.
3322 (cpp_stop_forcing_token_locations): New.
3324 2011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3327 * init.c (cpp_init_builtins): Define __cplusplus 19971L.
3329 2011-08-18 Joseph Myers <joseph@codesourcery.com>
3331 * include/cpplib.h (struct cpp_options): Fix typo.
3333 2011-08-18 Joseph Myers <joseph@codesourcery.com>
3335 * include/cpplib.h (struct cpp_options): Add rliterals.
3336 * init.c (struct lang_flags, lang_defaults): Add rliterals.
3337 (cpp_set_lang): Set rliterals option.
3338 (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
3339 * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
3341 2011-08-15 Gabriel Charette <gchare@google.com>
3343 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
3344 Update all users to use linemap_position_for_column instead.
3346 2011-07-28 Gabriel Charette <gchare@google.com>
3348 * include/line-map.h (struct line_maps):
3349 Remove unused field last_listed. Update all users.
3351 2011-07-28 H.J. Lu <hongjiu.lu@intel.com>
3353 * configure.ac: Set need_64bit_hwint to yes for x86 targets.
3354 * configure: Regenerated.
3356 2011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3358 * system.h [__cplusplus]: Wrap C function declarations in extern "C".
3360 2011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3361 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3364 * configure.ac: Test AM_ICONV with CXX.
3365 * configure: Regenerate.
3366 * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
3368 2011-07-15 Dodji Seketeli <dodji@redhat.com>
3370 * directives.c (struct if_stack): Use source_location as type
3372 * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
3373 indent, def_pragma, used_define, used_undef>: Properly use
3374 source_location as parameter type, rather than unsigned int.
3376 2011-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3379 * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
3380 like i[34567]86-*-solaris2.1[0-9]*.
3381 * configure: Regenerate.
3383 2011-06-16 Jason Merrill <jason@redhat.com>
3386 * lex.c (lex_raw_string): Don't check for embedded NUL.
3388 2011-06-06 Dodji Seketeli <dodji@redhat.com>
3390 PR preprocessor/48532
3391 * directives.c (do_pragma): Don't forget the invocation location
3392 when parsing the pragma name of a namespaced pragma directive.
3394 2011-05-29 John Tytgat <John.Tytgat@aaug.net>
3396 * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
3398 2011-05-22 Uros Bizjak <ubizjak@gmail.com>
3401 * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
3402 is defined. Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
3404 2011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
3406 * system.h (ENUM_BITFIELD): Remove.
3408 2011-04-24 Jakub Jelinek <jakub@redhat.com>
3410 PR preprocessor/48740
3411 * lex.c (lex_raw_string): When raw string ends with
3412 ??) followed by raw prefix and ", ensure it is preprocessed
3413 with ??) rather than ??].
3415 2011-04-20 Jim Meyering <meyering@redhat.com>
3417 * files.c (destroy_cpp_file): Remove useless if-before-free.
3418 * init.c (cpp_destroy): Likewise.
3419 * macro.c (replace_args): Likewise.
3420 * pch.c (cpp_valid_state): Likewise.
3422 2011-03-25 Kai Tietz <ktietz@redhat.com>
3424 * files.c (file_hash_eq): Use filename_cmp
3426 (nonexistent_file_hash_eq): Likewise.
3427 (remap_filename): Likewise.
3428 Handle absolute DOS-path,
3429 (append_file_to_dir): Check for IS_DIR_SEPARATOR
3431 (read_name_map): Likewise.
3432 * linemap.c (linemap_add): Use filename_cmp
3434 * mkdeps.c (apply_vpath): Use filename_ncmp
3436 (deps_restore): Use filename_cmp instead of
3438 * init.c (read_original_directory): Use
3439 IS_DIR_SEPARATOR instead of checking for slash.
3441 2011-03-21 Michael Meissner <meissner@linux.vnet.ibm.com>
3443 PR preprocessor/48192
3444 * directives.c (do_ifdef): Do not consider conditional macros as
3447 * expr.c (parse_defined): Ditto.
3449 2011-03-18 Richard Henderson <rth@redhat.com>
3452 * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
3454 2011-11-04 Eric Botcazou <ebotcazou@adacore.com>
3455 Jakub Jelinek <jakub@redhat.com>
3457 PR preprocessor/39213
3458 * directives.c (end_directive): Call _cpp_remove_overlay for deferred
3459 pragmas as well in traditional mode.
3461 2010-11-17 Ian Lance Taylor <iant@google.com>
3464 * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of
3465 AC_LANG based on ENABLE_BUILD_WITH_CXX.
3467 2010-11-16 Kai Tietz <kai.tietz@onevision.com>
3469 PR preprocessor/17349
3470 * lex.c (save_comment): Handle in argument passing c++
3473 2010-11-02 Ian Lance Taylor <iant@google.com>
3475 * configure.ac: Use AC_SYS_LARGEFILE.
3476 * configure: Rebuild.
3477 * config.in: Rebuild.
3479 2010-10-19 Basile Starynkevitch <basile@starynkevitch.net>
3481 * line-map.h (source_location): Remove obsolete comment
3482 mentioning location_s.
3484 2010-09-29 Kai Tietz <kai.tietz@onevision.com>
3486 PR preprocessor/45362
3487 * directives.c (cpp_pop_definition): Make static.
3488 (do_pragma_push_macro): Reworked to store text
3490 (do_pragma_pop_macro): Add free text definition.
3491 (cpp_push_definition): Removed.
3492 * include/cpplib.h (cpp_push_definition): Removed.
3493 (cpp_pop_definition): Likewise.
3494 * internal.h (def_pragma_macro): Remove member 'value'
3495 and add new members 'definition', 'line',
3496 'syshdr', 'sued' and 'is_undef'.
3497 * pch.c (_cpp_restore_pushed_macros): Rework to work
3498 on text definition and store additional macro flags.
3499 (_cpp_save_pushed_macros): Likewise.
3501 2010-09-29 Joseph Myers <joseph@codesourcery.com>
3503 * include/cpplib.h (cpp_options): Rename warn_deprecated,
3504 warn_traditional, warn_long_long and pedantic.
3505 * directives.c (directive_diagnostics, _cpp_handle_directive):
3506 Update names of cpp_options members.
3507 * expr.c (cpp_classify_number, eval_token): Update names of
3508 cpp_options members.
3509 * init.c (cpp_create_reader, post_options): Update names of
3510 cpp_options members.
3511 * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
3512 cpp_options members.
3513 * macro.c (parse_params): Update names of cpp_options members.
3515 2010-09-15 Ian Lance Taylor <iant@google.com>
3517 * init.c: Fix type name in comment.
3519 2010-08-31 Jakub Jelinek <jakub@redhat.com>
3521 PR preprocessor/45457
3522 * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
3524 * directives.c (do_ifdef, do_ifndef): Likewise.
3526 2010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3528 * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
3530 2010-08-24 Richard Henderson <rth@redhat.com>
3533 * configure.ac (HAVE_SSE4): New check.
3534 * configure, config.in: Rebuild.
3535 * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
3537 2010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3539 * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
3540 etc. on Solaris 2/x86.
3542 2010-08-21 Richard Henderson <rth@redhat.com>
3543 Andi Kleen <ak@linux.intel.com>
3544 David S. Miller <davem@davemloft.net>
3546 * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
3547 (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
3548 (ptrdiff_t): Check via AC_CHECK_TYPE.
3549 * config.in, configure: Rebuild.
3550 * system.h: Include stdint.h, if available.
3551 * lex.c (WORDS_BIGENDIAN): Provide default.
3552 (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
3553 acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
3554 search_line_sse2, search_line_sse42, init_vectorized_lexer,
3555 search_line_fast): New.
3556 (_cpp_clean_line): Use search_line_fast. Restructure the fast
3557 loop to make it clear when we're leaving the loop. Stay in the
3558 fast loop for non-trigraph '?'.
3560 2010-06-11 Jakub Jelinek <jakub@redhat.com>
3562 * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
3564 (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
3565 (cpp_macro_definition): Remove const qual from second argument.
3566 * macro.c (enter_macro_context): Call user_builtin_macro callback for
3567 NODE_BUILTIN !NODE_USED macros.
3568 (warn_of_redefinition): Likewise. Remove const qual from second
3570 (cpp_macro_definition): Likewise.
3571 * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
3572 for NODE_BUILTIN !NODE_USED macros.
3574 2010-06-10 Joseph Myers <joseph@codesourcery.com>
3576 * include/cpplib.h (struct cpp_options): Remove show_column.
3577 * init.c (cpp_create_reader, post_options): Don't set show_column.
3579 2010-06-09 Joern Rennecke <joern.rennecke@embecosm.com>
3582 * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
3583 check that C++ compiler works.
3584 * configure: Regenerate.
3586 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
3588 * include/symtab.h (ht_identifier_ptr): New.
3590 2010-06-03 Joern Rennecke <joern.rennecke@embecosm.com>
3591 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3594 * configure.ac: Check for declaration of 'basename(char *)'.
3595 * configure: Regenerate.
3596 * config.in: Regenerate.
3598 2010-04-25 Joseph Myers <joseph@codesourcery.com>
3600 * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
3601 * init.c (lang_defaults): Add entries for new language variants.
3602 (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
3605 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
3608 * files.c (report_missing_guard): Test for #pragma once.
3610 2010-04-07 Simon Baldwin <simonb@google.com>
3612 * directives.c (do_diagnostic): Add warning reason argument,
3613 call appropriate error reporting function for code.
3614 (directive_diagnostics): Call specific warning functions with
3615 warning reason where appropriate.
3616 (do_error, do_warning, do_pragma_dependency): Add warning reason
3617 argument to do_diagnostic calls.
3618 * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
3619 _cpp_create_definition): Call specific warning functions with
3620 warning reason where appropriate.
3621 * Makefile.in: Add new diagnostic functions to gettext translations.
3622 * include/cpplib.h (struct cpp_callbacks): Add warning reason code
3624 (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
3625 CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
3626 (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
3627 CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
3628 CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
3629 CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
3630 CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
3631 CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
3632 CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
3633 warning reason codes.
3634 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
3635 cpp_warning_with_line, cpp_pedwarning_with_line,
3636 cpp_warning_with_line_syshdr): New specific error reporting functions.
3637 * pch.c (cpp_valid_state): Call specific warning functions with
3638 warning reason where appropriate.
3639 * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
3640 diagnostic handlers.
3641 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
3642 cpp_warning_with_line, cpp_pedwarning_with_line,
3643 cpp_warning_with_line_syshdr): New specific error reporting functions.
3644 * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
3645 specific warning functions with warning reason where appropriate.
3646 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
3647 warn_about_normalization, lex_identifier_intern, lex_identifier,
3648 _cpp_lex_direct): Ditto.
3649 * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
3650 narrow_str_to_charconst): Ditto.
3652 2010-04-06 Jakub Jelinek <jakub@redhat.com>
3654 PR preprocessor/43642
3655 * lex.c (lex_raw_string): Change type of TYPE variable to
3658 2010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3660 * aclocal.m4: Regenerate.
3662 2010-03-29 Jason Merrill <jason@redhat.com>
3664 More N3077 raw string changes
3665 * charset.c (cpp_interpret_string): Don't transform UCNs in raw
3667 * lex.c (bufring_append): Split out from...
3668 (lex_raw_string): ...here. Undo trigraph and line splicing
3669 transformations. Do process line notes in multi-line literals.
3670 (_cpp_process_line_notes): Ignore notes that were already handled.
3672 Some raw string changes from N3077
3673 * charset.c (cpp_interpret_string): Change inner delimiters to ().
3674 * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter.
3676 2010-02-11 Jakub Jelinek <jakub@redhat.com>
3678 * init.c (read_original_filename): Don't call read_original_directory
3679 if _cpp_handle_directive returns 0.
3681 2010-01-01 Joseph Myers <joseph@codesourcery.com>
3683 PR preprocessor/41947
3684 * expr.c (cpp_classify_number): Give error for hexadecimal
3685 floating-point constant with no digits before or after point.
3687 2009-11-20 Arnaud Charlet <charlet@adacore.com>
3689 * macro.c (enter_macro_context): Call cb.used callback if defined.
3690 * directives.c (do_idef, do_ifndef): Ditto.
3691 * include/cpplib.h (struct cpp_callbacks): Add used callback.
3693 2009-11-11 Kai Tietz <kai.tietz@onevision.com>
3695 * directives.c (do_pragma_push_macro): New pragma handler.
3696 (do_pragma_pop_macro): Likewise.
3697 (_cpp_init_internal_pragmas): Add push_macro and
3698 pop_macro handler to internal pragmas.
3699 (lex_macro_node_from_str): Removed.
3700 (cpp_push_definition): Replace lex_macro_node_from_str
3701 by _cpp_lex_identifier.
3702 (cpp_pop_definition): Likewise.
3703 * internal.h (_cpp_lex_identifier): New prototype.
3704 (def_pragma_macro): New structure.
3705 (cpp_reader): New member pushed_macros.
3706 * lex.c (_cpp_lex_identifier): New function.
3707 (lex_identifier_intern): New function.
3708 * init.c (cpp_create_reader): Initialize pushed_macros
3710 (cpp_destroy): Free elements in pushed_macros member.
3711 * pch.c (_cpp_save_pushed_macros): New function.
3712 (_cpp_restore_pushed_macros): Likewise.
3713 (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
3714 (cpp_read_state): Use _cpp_restore_pushed_macros.
3716 2009-10-19 Jakub Jelinek <jakub@redhat.com>
3718 * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
3719 (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
3720 and char32_cset_desc.
3721 (converter_for_type): Handle CPP_UTF8STRING.
3722 (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
3723 * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
3724 (parse_include): Reject raw strings.
3725 * include/cpplib.h (CPP_UTF8STRING): New token type.
3726 * internal.h (struct cpp_reader): Add utf8_cset_desc field.
3727 * lex.c (lex_raw_string): New function.
3728 (lex_string): Handle u8 string literals, call lex_raw_string
3729 for raw string literals.
3730 (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
3732 * macro.c (stringify_arg): Handle CPP_UTF8STRING.
3734 2009-10-14 Jakub Jelinek <jakub@redhat.com>
3736 PR preprocessor/41543
3737 * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
3738 * line-map.c (linemap_init): Initialize highest_location and
3739 highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
3741 2009-10-09 Jason Merrill <jason@redhat.com>
3743 * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
3745 2009-10-09 Neil Vachharajani <nvachhar@google.com>
3747 * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
3750 2009-09-23 Loren J. Rittle <ljrittle@acm.org>
3752 * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
3753 * configure: Rebuilt.
3755 2009-09-22 Richard Guenther <rguenther@suse.de>
3758 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
3760 2009-09-18 Chris Demetriou <cgd@google.com>
3762 PR preprocessor/28435:
3763 * include/cpplib.h (struct cpp_options): Add new member
3764 deps.need_preprocessor_output.
3765 * files.c (open_file_failed): If preprocessor output is needed
3766 always report an error.
3768 2009-09-13 Kai Tietz <kai.tietz@onevision.com>
3770 * configure.ac: Set for i?86-w64-mingw*
3771 need_64bit_hwint to yes.
3772 * configure: Regenerated.
3774 2009-09-10 Jason Merrill <jason@redhat.com>
3776 * directives.c (cpp_define): constify.
3778 2009-09-02 Ian Lance Taylor <iant@google.com>
3780 * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
3782 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3784 * configure.ac (AC_PREREQ): Bump to 2.64.
3786 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3788 * aclocal.m4: Regenerate.
3789 * config.in: Regenerate.
3790 * configure: Regenerate.
3792 2009-08-17 Tom Tromey <tromey@redhat.com>
3794 PR preprocessor/41067:
3795 * charset.c (convert_escape): Add missing ":" to error text.
3797 2009-07-27 Douglas B Rupp <rupp@gnat.com>
3799 * include/cpplib.h (INO_T_CPP): New macro.
3800 (struct cpp_dir): Use it.
3802 2009-07-20 Jerry Quinn <jlquinn@optonline.net>
3805 * configure.ac: Use = instead of == for testing
3806 ENABLE_BUILD_WITH_CXX.
3807 * configure: Rebuild.
3809 2009-07-17 Jerry Quinn <jlquinn@optonline.net>
3811 * directives.c (do_linemarker, do_line): Use CPP_STRING for
3813 * files.c (find_file_in_dir): Add cast from void* to char*.
3814 * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
3815 * Makefile.in: (WARN_CFLAGS): Use general and C-specific
3817 (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
3818 ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
3819 COMPILER_FLAGS): New.
3820 (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
3821 (COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS
3822 instead of ALL_CFLAGS.
3823 * configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings
3824 from other warnings. Add -Wc++-compat to C-specific warnings.
3825 Check for --enable-build-with-cxx. Set and substitute
3826 ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES
3827 according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before
3829 * configure: Rebuild.
3830 * include/cpp-id-data.h: Remove extern "C".
3831 * include/line-map.h: Likewise.
3832 * include/mkdeps.h: Likewise.
3833 * include/symtab.h: Likewise.
3834 * internal.h: Likewise.
3836 2009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3838 * directives.c (parse_include): Add location argument. Update all
3840 (parse_answer): Likewise.
3841 (do_include_common): Error with exact location.
3842 (parse_assertion): Likewise.
3844 2009-06-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
3846 * expr.c (num_div_op): Take explicit location.
3848 2009-06-17 Ian Lance Taylor <iant@google.com>
3850 * include/cpplib.h (progname): Don't declare.
3852 2009-06-12 Ian Lance Taylor <iant@google.com>
3854 * include/cpplib.h (struct cpp_options): Add
3855 warn_cxx_operator_names field.
3856 (NODE_WARN_OPERATOR): Define.
3857 (struct cpp_hashnode): Increase flags field to 10 bits, decrease
3859 * init.c (mark_named_operators): Add flags parameter.
3860 (cpp_post_options): Pick flags value to pass to
3861 mark_named_operators.
3862 * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
3863 identifier is an operator name in C++.
3865 2009-06-01 Aldy Hernandez <aldyh@redhat.com>
3867 * include/line-map.h (LAST_SOURCE_COLUMN): New.
3869 2009-06-01 Ian Lance Taylor <iant@google.com>
3871 * include/cpp-id-data.h: Add extern "C".
3872 * include/line-map.h: Likewise.
3873 * include/mkdeps.h: Likewise.
3874 * include/symtab.h: Likewise.
3875 * internal.h: Likewise.
3877 2009-05-15 Ian Lance Taylor <iant@google.com>
3879 * include/cpplib.h (enum cpp_builtin_type): Rename from enum
3880 builtin_type. Change all uses.
3882 2009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3885 * directives (do_linemarker): Compensate for the increment in
3886 location that occurs when we reach the end of line.
3887 * files (_cpp_stack_include): Mention _cpp_find_file in the
3890 2009-05-10 Joseph Myers <joseph@codesourcery.com>
3892 * include/cpplib.h (enum cpp_token_fld_kind): Add
3893 CPP_TOKEN_FLD_TOKEN_NO.
3894 (struct cpp_macro_arg, struct cpp_identifier): Define.
3895 (union cpp_token_u): Use struct cpp_identifier for identifiers.
3896 Use struct cpp_macro_arg for macro arguments. Add token_no for
3897 CPP_PASTE token numbers.
3898 * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
3899 do_pragma_poison, parse_assertion): Use val.node.node in place of
3901 * expr.c (parse_defined, eval_token): Use val.node.node in place
3903 * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
3904 cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
3905 cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
3906 place of val.arg_no. Use val.node.node in place of val.node.
3907 * macro.c (replace_args, cpp_get_token, parse_params,
3908 lex_expansion_token, create_iso_definition, cpp_macro_definition):
3909 Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
3910 Use val.node.node in place of val.node.
3912 2009-05-03 Joseph Myers <joseph@codesourcery.com>
3914 * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
3917 2009-04-25 Joseph Myers <joseph@codesourcery.com>
3919 PR preprocessor/39559
3920 * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
3921 constants larger than intmax_t in C99 mode.
3923 2009-04-21 Taras Glek <tglek@mozilla.com>
3925 * include/cpp-id-data.h: Update GTY annotations to new syntax.
3926 * include/cpplib.h: Likewise.
3927 * include/line-map.h: Likewise.
3928 * include/symtab.h: Likewise.
3930 2009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3933 * lex.c (cpp_type2name): Take a flags parameter. Call
3934 cpp_named_operator2name for named operators and cpp_digraph2name
3936 (cpp_digraph2name): New.
3937 (cpp_spell_token): Use it.
3938 (cpp_output_token): Likewise.
3939 * include/cpplib.h (cpp_type2name): Update declaration.
3940 * init.c (cpp_named_operator2name): New.
3941 * internal.h (cpp_named_operator2name): Declare.
3943 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3946 * init.c (cpp_create_reader): Wlong_long is disabled by default.
3947 * expr.c (cpp_classify_number): Give different messages for C and
3950 2009-04-19 Joseph Myers <joseph@codesourcery.com>
3952 PR preprocessor/20078
3953 * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
3955 * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
3956 (struct cpp_token): Change flags to unsigned short.
3957 * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
3958 (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
3959 (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
3961 * macro.c (macro_real_token_count): New.
3962 (enter_macro_context, replace_args): Use macro_real_token_count.
3963 (create_iso_definition): Record whitespace surrounding and digraph
3964 spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
3965 Set extra_tokens and save CPP_PASTE tokens with arg_no set for
3966 multiple consecutive ## tokens.
3967 (_cpp_create_definition): Initialize extra_tokens.
3968 (cpp_macro_definition): Use macro_real_token_count.
3970 2009-04-18 Joseph Myers <joseph@codesourcery.com>
3972 * directives.c (parse_include): Pass true to check_eol.
3974 2009-04-18 Joseph Myers <joseph@codesourcery.com>
3976 PR preprocessor/39646
3977 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
3978 * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
3979 * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
3982 2009-04-18 Joseph Myers <joseph@codesourcery.com>
3984 PR preprocessor/39647
3985 * directives.c (check_eol): Add parameter expand.
3986 (do_undef, parse_include, do_line, do_linemarker, do_ident,
3987 do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
3988 do_else, do_endif, do_assert, do_unassert): All callers changed.
3989 Pass true from do_line, false elsewhere.
3991 2009-04-12 Joseph Myers <joseph@codesourcery.com>
3993 PR preprocessor/31869
3994 * macro.c (stringify_arg): Handle NULL source token in padding
3995 token where previous padding token did not have source token with
3996 preceding whitespace.
3998 2009-04-09 Jakub Jelinek <jakub@redhat.com>
4000 * Makefile.in: Change copyright header to refer to version
4001 3 of the GNU General Public License and to point readers at the
4002 COPYING3 file and the FSF's license web page.
4003 * charset.c: Likewise.
4004 * directives-only.c: Likewise.
4005 * directives.c: Likewise.
4006 * errors.c: Likewise.
4008 * files.c: Likewise.
4009 * identifiers.c: Likewise.
4010 * include/cpp-id-data.h: Likewise.
4011 * include/cpplib.h: Likewise.
4012 * include/line-map.h: Likewise.
4013 * include/mkdeps.h: Likewise.
4014 * include/symtab.h: Likewise.
4016 * internal.h: Likewise.
4018 * line-map.c: Likewise.
4019 * macro.c: Likewise.
4020 * makeucnid.c: Likewise.
4021 * mkdeps.c: Likewise.
4023 * symtab.c: Likewise.
4024 * system.h: Likewise.
4025 * traditional.c: Likewise.
4026 * ucnid.tab: Likewise.
4027 * ucnid.h: Regenerate.
4029 2009-04-01 Janis Johnson <janis187@us.ibm.com>
4032 * include/cpplib.h (CPP_N_DEFAULT): Define.
4033 * expr.c (interpret_float_suffix): Recognize d or D for double,
4034 return new value for default.
4035 (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
4038 * expr.c (interpret_float_suffix): Reject invalid suffix that uses
4039 letters from decimal float and fixed-point suffixes.
4041 2009-03-31 Joseph Myers <joseph@codesourcery.com>
4043 PR preprocessor/15638
4044 * files.c (_cpp_find_file): Call open_file_failed after diagnosing
4046 (open_file_failed): Make error for missing file fatal.
4047 * include/cpplib.h (CPP_DL_FATAL): Define.
4049 2009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net>
4051 PR preprocessor/31932:
4052 * internal.h: Don't mention HAVE_ICONV_H.
4053 * configure, config.in: Rebuild.
4054 * configure.ac: Don't check for iconv.h.
4056 2009-03-30 Tom Tromey <tromey@redhat.com>
4058 PR preprocessor/39512:
4059 * line-map.c (linemap_init): Initialize 'reallocator' field.
4061 2009-03-30 Jakub Jelinek <jakub@redhat.com>
4064 * macro.c (cpp_get_token): If macro_to_expand returns NULL
4065 and used some tokens, add CPP_PADDING before next token.
4067 2009-03-29 Joseph Myers <joseph@codesourcery.com>
4069 PR preprocessor/34695
4070 * makedepend.c: Remove.
4071 * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
4072 (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
4073 * directives.c (cpp_errors): Remove.
4074 * errors.c (print_location, _cpp_begin_message, v_message):
4076 (cpp_error, cpp_error_with_line): Always use error callback.
4077 (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
4078 * include/cpplib.h (cpp_options): Remove pedantic_errors,
4079 inhibit_warnings, warn_system_headers, inhibit_errors,
4080 warnings_are_errors, client_diagnostic.
4081 (cpp_callbacks): Add extra arguments to error callback; make it
4083 (cpp_finish): Return void.
4084 (cpp_destroy): Remove inaccurate comment about return value.
4085 (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
4086 (CPP_DL_NOTE): Define.
4087 * include/line-map.h (linemap_print_containing_files): Remove.
4088 * init.c (cpp_finish): Do not check for or return number of
4090 * internal.h (cpp_reader): Remove errors field.
4091 * line-map.c (linemap_print_containing_files): Remove.
4092 * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
4093 about previous definition. Only emit it if previous diagnostic
4096 2009-03-28 Joseph Myers <joseph@codesourcery.com>
4098 * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
4101 2009-03-18 Jakub Jelinek <jakub@redhat.com>
4103 * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
4105 2009-02-21 Joseph Myers <joseph@codesourcery.com>
4107 * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
4109 (_cpp_lex_direct): Handle this.
4111 2009-02-15 Richard Guenther <rguenther@suse.de>
4115 2009-02-13 Richard Guenther <rguenther@suse.de>
4117 * configure.ac: Enable LFS.
4118 * configure: Re-generate.
4119 * config.in: Likewise.
4121 2009-01-05 Ben Elliston <bje@au.ibm.com>
4123 * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
4124 (.po.pox): Likewise.
4125 (po/$(PACKAGE).pot): Likewise.
4127 2008-12-10 Alexandre Oliva <aoliva@redhat.com>
4130 * pch.c (cpp_valid_state): Improve message for poisoned symbols.
4131 Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
4133 2008-11-29 Joseph Myers <joseph@codesourcery.com>
4135 * lex.c (cpp_token_len): Use 6 as default length.
4137 2008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org>
4139 * expr.c (struct op): Add location.
4140 (_cpp_parse_expr): Propagate locations throught the stack
4143 (check_promotion): Use explicit location in errors.
4145 2008-10-05 Matthew Gingell <gingell@adacore.com>
4146 Arnaud Charlet <charlet@adacore.com>
4148 * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
4149 (cpp_get_comments): New function.
4150 * internal.h (struct cpp_reader): Add comments field.
4151 * init.c (cpp_destroy): Free comments.
4152 * lex.c (store_comment, cpp_get_comments): New functions.
4153 (comments): New struct.
4154 (save_comment): Store comments in comments struct.
4156 2008-09-18 Simon Baldwin <simonb@google.com>
4158 * include/cpplib.h (struct cpp_options): Add new boolean flag
4159 warn_builtin_macro_redefined.
4160 * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
4161 * (struct builtin_operator): Split out from previous struct builtin,
4162 enhance extra const correctness.
4163 * (struct builtin_macro): Split out from previous struct builtin, add
4164 new always_warn_if_redefined flag, enhance const correctness.
4165 * (mark_named_operators): Use struct builtin_operator.
4166 * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
4167 to builtins selectively.
4168 * macro.c (warn_of_redefinition): Return false if a builtin macro
4169 is not flagged with NODE_WARN.
4171 2008-07-31 Jakub Jelinek <jakub@redhat.com>
4173 PR preprocessor/36649
4174 * files.c (struct report_missing_guard_data): New type.
4175 (report_missing_guard): Put paths into an array instead of printing
4176 them right away. Return 1 rather than 0.
4177 (report_missing_guard_cmp): New function.
4178 (_cpp_report_missing_guards): Sort and print paths gathered by
4179 report_missing_guard callback.
4181 2008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4184 * directives.c (strtolinenum): Handle overflow.
4185 (do_line): Give a warning if line number overflowed.
4186 (do_linemarker): Update call to strtolinenum.
4188 2008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4190 * include/line-map.h (linenum_type): New typedef.
4191 (struct line_map): Use it.
4192 (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
4193 (SOURCE_COLUMN): Likewise.
4194 * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
4195 source_location values in a variable of type linenum_type.
4196 * directives.c (struct if_stack): Use linenum_type.
4197 (strtoul_for_line): Rename as strtolinenum.
4198 (do_line): Use linenum_type.
4199 (do_linemarker): Use linenum_type and strtolinenum.
4200 (_cpp_do_file_change): Use linenum_t.
4201 * line-map.c (linemap_add): Likewise.
4202 (linemap_line_start): Likewise.
4203 * traditional.c (struct fun_macro): 'line' is a source_location.
4204 * errors.c (print_location): Use linenum_type.
4205 * directives-only.c (_cpp_preprocess_dir_only): Likewise.
4206 * internal.h (CPP_INCREMENT_LINE): Likewise.
4207 * lex.c (_cpp_skip_block_comment): Use source_location.
4209 2008-07-14 Ben Elliston <bje@au.ibm.com>
4211 * include/cpplib.h (NODE_CONDITIONAL): New.
4212 (struct cpp_callbacks): New macro_to_expand field.
4213 (struct cpp_hashnode): Adjust size of flags and type fields.
4214 (cpp_peek_token): Prototype.
4215 * lex.c (cpp_peek_token): New function.
4216 (_cpp_temp_token): Protect pre-existing lookaheads.
4217 * macro.c (cpp_get_token): Expand any conditional macros.
4218 (_cpp_backup_tokens_direct): New.
4219 (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
4220 (warn_of_redefinition): Silently allow redefined conditional
4222 (_cpp_create_definition): Remove the conditional flag when a user
4223 defines one of the conditional macros.
4224 * internal.h (_cpp_backup_tokens_direct): New prototype.
4226 2008-06-13 Andrew Haley <aph@redhat.com>
4228 PR preprocessor/33305
4229 * macro.c (replace_args): Print a warning for empty macro
4230 arguments in C89 and C++.
4232 2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4234 * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
4235 * configure: Regenerate.
4237 2008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4239 * Makefile.in (datarootdir): New variable.
4241 2008-06-12 H.J. Lu <hongjiu.lu@intel.com>
4243 PR preprocessor/36479
4244 * charset.c (cpp_interpret_string_notranslate): Also set
4245 narrow_cset_desc.width.
4247 2008-06-07 Joseph Myers <joseph@codesourcery.com>
4249 * configure.ac (parisc*64*-*-*): Remove.
4250 * configure: Regenerate.
4252 2008-05-30 Tom Tromey <tromey@redhat.com>
4254 PR preprocessor/36320:
4255 * internal.h (_cpp_parse_expr): Update.
4256 * expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error
4258 * directives.c (do_if): Update.
4259 (do_elif): Require expression if processing group.
4261 2008-05-30 Danny Smith <dannysmith@users.sourceforge.net>
4263 * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
4265 2008-05-21 Tom Tromey <tromey@redhat.com>
4267 PR preprocessor/27777:
4268 * lex.c (cpp_output_line_to_string): New function.
4269 * internal.h (_cpp_begin_message): Don't declare.
4270 * errors.c (_cpp_begin_message): Now static.
4271 * include/cpplib.h (cpp_output_line_to_string): Declare.
4272 * directives.c (do_diagnostic): Rewrote. Use
4273 cpp_output_line_to_string. Don't use _cpp_begin_message.
4275 2008-05-21 Tom Tromey <tromey@redhat.com>
4277 * include/symtab.h (HT_ALLOCED): Remove.
4278 (ht_purge): Declare.
4279 * symtab.c (DELETED): New define.
4280 (ht_lookup): Update comment.
4281 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED
4282 code. Use subobject allocator for strings, if it exists.
4283 (ht_expand): Handle deleted entries.
4284 (ht_forall): Likewise.
4285 (ht_purge): New function.
4286 (ht_dump_statistics): Print deletion statistics.
4288 2008-05-13 Tom Tromey <tromey@redhat.com>
4290 PR preprocessor/22168:
4291 * include/cpplib.h (struct cpp_options) <objc>: Update
4293 * expr.c (eval_token): Warn for use of assertions.
4294 * directives.c (directive_diagnostics): Warn about extensions.
4295 (DEPRECATED): New define.
4296 (DIRECTIVE_TABLE): Use it.
4298 2008-05-06 Tom Tromey <tromey@redhat.com>
4300 PR preprocessor/35313, PR preprocessor/36088:
4301 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
4302 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
4304 2008-05-04 David S. Miller <davem@davemloft.net>
4306 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
4307 * configure: Regenerate.
4309 2008-04-22 Daniel Franke <franke.daniel@gmail.com>
4311 * include/cpplib.h (cpp_define_formatted): New.
4312 * directives.c (cpp_define_formatted): New.
4314 2008-04-21 Tom Tromey <tromey@redhat.com>
4317 * charset.c (_cpp_convert_input): Add buffer_start argument.
4318 Ignore UTF-8 BOM if seen.
4319 * internal.h (_cpp_convert_input): Add argument.
4320 * files.c (struct _cpp_file) <buffer_start>: New field.
4321 (destroy_cpp_file): Free buffer_start, not buffer.
4322 (_cpp_pop_file_buffer): Likewise.
4323 (read_file_guts): Update.
4325 2008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
4327 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
4328 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
4329 (struct cpp_options): Added uliterals.
4330 (cpp_interpret_string): Update prototype.
4331 (cpp_interpret_string_notranslate): Idem.
4332 * charset.c (init_iconv_desc): New width member in cset_converter.
4333 (cpp_init_iconv): Add support for char{16,32}_cset_desc.
4334 (convert_ucn): Idem.
4335 (emit_numeric_escape): Idem.
4336 (convert_hex): Idem.
4337 (convert_oct): Idem.
4338 (convert_escape): Idem.
4339 (converter_for_type): New function.
4340 (cpp_interpret_string): Use converter_for_type, support u and U prefix.
4341 (cpp_interpret_string_notranslate): Match changed prototype.
4342 (wide_str_to_charconst): Use converter_for_type.
4343 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
4344 * directives.c (linemarker_dir): Macro U changed to UC.
4345 (parse_include): Idem.
4346 (register_pragma_1): Idem.
4347 (restore_registered_pragmas): Idem.
4348 (get__Pragma_string): Support CPP_STRING{16,32}.
4349 * expr.c (eval_token): Support CPP_CHAR{16,32}.
4350 * init.c (struct lang_flags): Added uliterals.
4351 (lang_defaults): Idem.
4352 * internal.h (struct cset_converter) <width>: New field.
4353 (struct cpp_reader) <char16_cset_desc>: Idem.
4354 (struct cpp_reader) <char32_cset_desc>: Idem.
4355 * lex.c (digraph_spellings): Macro U changed to UC.
4357 (lex_string): Add support for u'...', U'...', u"..." and U"...".
4358 (_cpp_lex_direct): Idem.
4359 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
4360 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
4362 2008-04-18 Paolo Bonzini <bonzini@gnu.org>
4365 * aclocal.m4: Regenerate.
4366 * configure: Regenerate.
4368 2008-04-17 Tom Tromey <tromey@redhat.com>
4371 * errors.c (cpp_error): Don't reference a token before the start
4374 2008-04-16 Tom Tromey <tromey@redhat.com>
4376 * Makefile.in (TAGS_SOURCES): New variable.
4379 2008-04-11 Kaz Kojima <kkojima@gcc.gnu.org>
4381 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
4383 * configure: Rebuilt.
4385 2008-04-02 Joseph Myers <joseph@codesourcery.com>
4387 * include/cpplib.h (struct cpp_callbacks): Add used_define,
4388 used_undef and before_define.
4389 (NODE_USED): Define.
4390 * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
4391 do_ifndef, cpp_pop_definition): Handle new flag and use new
4393 * expr.c (parse_defined): Handle new flag and use new callbacks.
4394 * macro.c (enter_macro_context, _cpp_free_definition): Handle new
4395 flag and use new callbacks.
4397 2008-04-01 Jakub Jelinek <jakub@redhat.com>
4400 * files.c (struct _cpp_file): Remove pch field.
4401 (pch_open_file): Don't set file->pch, just file->pchname.
4402 (should_stack_file): After pfile->cb.read_pch call
4403 free pchname and clear pchname, don't close file->fd.
4404 Test file->pchname instead of file->pch. Don't close fd after cb.
4405 (_cpp_stack_include): Test file->pchname instead of file->pch.
4407 2008-03-28 Tom Tromey <tromey@redhat.com>
4409 * Makefile.in (POSTCOMPILE): New variable.
4412 2008-03-13 Tom Tromey <tromey@redhat.com>
4415 * directives.c (destringize_and_run): Set pfile->directive.
4417 2008-03-06 Markus Milleder <markus.milleder@generali.at>
4419 PR preprocessor/35458
4420 * mkdeps.c (munge): Quote '#' with a '\'.
4422 2008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4424 PR preprocessor/35379
4425 * mkdeps.c (deps_write): Ensure the first target always appears
4426 in the first column, without leading backslash newline. Avoid
4427 some more extra whitespace.
4429 2008-02-25 Thiemo Seufer <ths@mips.com>
4431 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
4433 2008-02-19 Tom Tromey <tromey@redhat.com>
4435 * traditional.c (lex_identifier): Use CPP_HASHNODE.
4436 * lex.c (lex_identifier): Use CPP_HASHNODE.
4437 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
4439 * identifiers.c (alloc_node): Change return type.
4440 (_cpp_init_hashtable): Don't cast 'alloc_node'.
4441 (proxy_assertion_broken): New declaration.
4442 (cpp_forall_identifiers): Move comment.
4443 * line-map.c (linemap_add): Comment fix.
4444 (linemap_line_start): Indentation fix.
4446 2008-01-25 Jakub Jelinek <jakub@redhat.com>
4448 PR preprocessor/34692
4449 * macro.c (collect_args): Add pragma_buff argument. Push
4450 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
4451 than into arguments. Reset prevent_expansion and parsing_args
4452 state at CPP_PRAGMA_EOL/CPP_EOF.
4453 (funlike_invocation_p): Add pragma_buff argument, pass it through
4455 (enter_macro_context): Add result argument. Adjust
4456 funlike_invocation_p caller. Emit all deferred pragma tokens
4457 gathered during collect_args before the expansion, add a padding
4458 token. Return 2 instead of 1 if any pragma tokens were prepended.
4459 (cpp_get_token): If enter_macro_context returns 2, don't return
4460 a padding token, instead cycle to grab CPP_PRAGMA token.
4461 * directives.c (_cpp_handle_directive): If was_parsing_args
4462 in deferred pragma, leave parsing_args and prevent_expansion as is.
4464 2008-01-22 Tom Tromey <tromey@redhat.com>
4467 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
4468 __STDC_CONSTANT_MACROS.
4470 2008-01-07 Fred Fish <fnf@specifix.com>
4472 PR preprocessor/30363
4473 * traditional.c (replace_args_and_push): Add local variable
4474 cxtquote, calculate the replacement text size assuming a
4475 worst case of every input character quoted with backslash,
4476 and properly handle output quoting of quote characters in
4477 actual arguments used in function-like macros.
4479 2008-01-03 Tom Tromey <tromey@redhat.com>
4481 PR preprocessor/34602
4482 * directives.c (do_line): Don't try to spell EOF token.
4483 (do_linemarker): Add comment.
4485 2007-12-11 DJ Delorie <dj@redhat.com>
4487 * charset.c (convert_using_iconv): Close out any shift states,
4488 returning to the initial state.
4490 2007-12-06 Tom Tromey <tromey@redhat.com>
4493 * internal.h (struct cpp_reader) <file_hash_entries>: Changed
4495 <file_hash_entries_allocated, file_hash_entries_used>: Removed.
4496 * files.c (FILE_HASH_POOL_SIZE): New macro.
4497 (struct file_hash_entry_pool): New.
4498 (destroy_all_cpp_files): New function.
4499 (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
4500 (new_file_hash_entry): Update.
4501 (free_file_hash_entries): New function.
4502 (_cpp_cleanup_files): Call free_file_hash_entries and
4503 destroy_all_cpp_files.
4504 (cpp_clear_file_cache): New function.
4505 * include/cpplib.h (cpp_clear_file_cache): Declare.
4507 2007-12-03 Tom Tromey <tromey@redhat.com>
4509 PR preprocessor/34288
4510 * configure.ac, config.in: Rebuilt.
4511 * configure.ac: Check for ssize_t.
4513 2007-11-30 Tom Tromey <tromey@redhat.com>
4515 PR preprocessor/32868
4516 * macro.c (_cpp_create_definition): Special case
4517 __STDC_FORMAT_MACROS.
4519 2007-11-16 Michael Matz <matz@suse.de>
4521 * files.c (search_path_head): Fix check for absolute paths.
4523 2007-11-11 Tom Tromey <tromey@redhat.com>
4526 * include/cpplib.h (cpp_included_before): Declare.
4527 * files.c (struct file_hash_entry) <location>: New field.
4528 (_cpp_find_file): Initialize new field.
4529 (make_cpp_dir): Likewise.
4530 (cpp_included_before): New function.
4532 2007-11-01 Tom Tromey <tromey@redhat.com>
4534 PR preprocessor/30805
4535 * macro.c (paste_tokens): Handle padding token.
4536 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
4538 2007-10-31 Tom Tromey <tromey@redhat.com>
4540 PR preprocessor/30786
4541 * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
4542 * directives.c (_cpp_do__Pragma): Return error status.
4543 * internal.h (_cpp_do__Pragma): Update.
4544 * directives.c (get__Pragma_string): Back up if EOF seen.
4546 2007-09-06 Tom Tromey <tromey@redhat.com>
4548 * internal.h (struct cpp_reader) <invocation_location>: New
4550 (struct cpp_reader) <set_invocation_location>: Likewise.
4551 * init.c (cpp_set_line_map): New function.
4552 * line-map.c (linemap_add): Use linemap's allocator.
4553 * include/line-map.h (GTY): Define.
4554 (line_map_realloc): New typedef.
4555 (struct line_map): Mark with GTY.
4556 (struct line_maps): Likewise.
4557 (struct line_maps) <maps>: Likewise.
4558 (struct line_maps) <reallocator>: New field.
4559 * include/symtab.h (GTY): Conditionally define.
4560 * include/cpplib.h (cpp_set_line_map): Declare.
4561 (cpp_get_token_with_location): Declare.
4562 * macro.c (cpp_get_token): Set invocation_location on the reader.
4563 (cpp_get_token_with_location): New function.
4565 2007-08-30 Chao-ying Fu <fu@mips.com>
4567 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
4568 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
4569 (cpp_classify_number): Support decimal fixed-point constants without
4571 Warn about fixed-point constants when -pedantic.
4572 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
4573 comments to support fixed-point values.
4574 (CPP_N_FRACT, CPP_N_ACCUM): Define.
4576 2007-08-18 Tom Tromey <tromey@redhat.com>
4578 PR preprocessor/32974
4579 * directives.c (parse_include): Don't check for EOL when
4580 processing #pragma dependency.
4582 2007-07-30 Ollie Wild <aaw@google.com>
4584 * directives-only.c: New file.
4585 * internal.h (struct _cpp_dir_only_callbacks): New.
4586 (_cpp_preprocess_dir_only): New function.
4587 * directives.c (_cpp_handle_directive): Check directives_only before
4588 disabling execution of indented directives.
4589 * files.c (_cpp_stack_file): Add directives_only check.
4590 * include/cpplib.h (struct cpp_options): Add directives_only.
4591 (cpp_init_special_builtins): New function.
4592 * init.c (cpp_init_special_builtins): New function.
4593 (cpp_init_builtins): Move builtin_array initialization to
4594 cpp_init_special_builtins.
4595 (post_options): Check directives_only before setting
4596 pfile->state.prevent_expansion = 1.
4597 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
4598 is expanded inside a directive while -fdirectives-only is enabled.
4599 * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
4600 (libcpp_a_SOURCES): Add directives-only.c.
4602 2007-07-04 Uros Bizjak <ubizjak@gmail.com>
4604 * traditional.c (_cpp_scan_out_logical_line): Initialize
4605 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
4606 fmacro.args to prevent 'may be used uninitialized' warning.
4608 2007-07-03 Uros Bizjak <ubizjak@gmail.com>
4610 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
4612 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
4613 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
4614 for 'q' or 'Q' suffixes.
4616 2007-06-17 Danny Smith <dannysmith@users.sourceforge.net
4618 * files.c (open_file): Correct typo.
4620 2007-06-16 Vladimir Prus <vladimir@codesourcery.com>
4622 * files.c (open_file): Prevent the call
4623 for stat from overwriting errno.
4625 2007-06-09 Vladimir Prus <vladimir@codesourcery.com>
4627 * files.c (open_file): Account for the
4628 fact that on windows, opening a directory gives
4631 2007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
4633 PR preprocessor/23479
4634 * expr.c (cpp_classify_number): Implement 0b-prefixed binary
4636 (append_digit): Likewise.
4637 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
4638 binary integer constants.
4640 2007-05-31 Dave Korn <dave.korn@artimi.com>
4642 PR preprocessor/14331
4643 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
4645 2007-05-24 Ollie Wild <aaw@google.com>
4647 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
4648 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
4649 (cpp_write_pch_state): Save __COUNTER__ state.
4650 (cpp_valid_state): Check valid __COUNTER__ state.
4651 (cpp_read_state): Read new __COUNTER__ state.
4652 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
4653 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
4654 * internal.h (struct cpp_reader): Add counter member.
4656 2007-05-23 Simon Martin <simartin@users.sourceforge.net>
4658 PR preprocessor/20077
4659 * macro.c (create_iso_definition): Fixed the method to determine
4660 whether the token-pasting operator appears at the beginning or the end
4663 2007-05-21 Ian Lance Taylor <iant@google.com>
4665 * internal.h (struct cpp_reader): Add new fields:
4666 nonexistent_file_hash and nonexistent_file_ob.
4667 * files.c: Include "obstack.h".
4668 (find_file_in_dir): Before trying to open the file, look up the
4669 path name in the hash table of nonexistent files. After failing
4670 to open the file, add the path name to the hash table.
4671 (_cpp_find_file): Cache the results of looking up the file name
4672 starting with the quote and bracket chain heads, if we can.
4673 (nonexistent_file_hash_eq): New static function.
4674 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
4675 pfile->nonexistent_file_ob.
4676 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
4677 pfile->nonexistent_file_ob.
4679 2007-05-14 Janis Johnson <janis187@us.ibm.com>
4681 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
4684 * expr.c (interpret_float_suffix): Check for invalid suffix.
4686 2007-05-02 Eric Christopher <echristo@apple.com>
4688 * expr.c (num_div_op): Don't overflow if the result is
4691 2007-05-02 Tom Tromey <tromey@redhat.com>
4693 PR preprocessor/28709
4694 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
4696 2007-03-30 Michael Meissner <michael.meissner@amd.com>
4698 * directives.c (lex_macro_node_from_str): Fix alloca call to be
4701 2007-03-30 Richard Henderson <rth@redhat.com>
4703 * directives.c (lex_macro_node_from_str): New.
4704 (cpp_push_definition, cpp_pop_definition): New.
4705 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
4707 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
4709 * Makefile.in: Add dummy install-pdf target.
4711 2007-01-30 Tom Tromey <tromey@redhat.com>
4713 PR preprocessor/30468
4714 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
4717 2007-01-30 Tom Tromey <tromey@redhat.com>
4719 PR preprocessor/29966
4720 * macro.c (lex_expansion_token): Save and restore cpp_reader's
4722 (_cpp_create_definition): Don't restore cur_token here.
4723 * lex.c (_cpp_lex_token): Added assertion.
4725 2007-01-27 Tom Tromey <tromey@redhat.com>
4727 * configure: Rebuilt.
4729 2007-01-12 Tom Tromey <tromey@redhat.com>
4731 PR preprocessor/28227
4732 * directives.c (lex_macro_node): Added 'is_def_or_undef'
4734 (do_define): Update.
4737 (do_ifndef): Update.
4739 2007-01-11 Paolo Bonzini <bonzini@gnu.org>
4741 * configure: Regenerate.
4743 2007-01-11 Paolo Bonzini <bonzini@gnu.org>
4745 * configure: Regenerate.
4747 2007-01-04 Tom Tromey <tromey@redhat.com>
4749 PR preprocessor/28165
4750 * internal.h (cpp_in_primary_file): New function.
4751 * directives.c (do_include_next): Use cpp_in_primary_file.
4752 (do_pragma_once): Likewise.
4753 (do_pragma_system_header): Likewise.
4755 2006-12-29 Ian Lance Taylor <iant@google.com>
4757 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
4758 look backward at the end of the line unless we saw a backslash.
4760 2006-12-29 Jakub Jelinek <jakub@redhat.com>
4762 PR preprocessor/29612
4763 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
4764 only when new_sysp is non-zero.
4766 2006-12-28 Tom Tromey <tromey@redhat.com>
4768 PR preprocessor/30001
4769 * charset.c (_cpp_convert_input): Check that to.len is greater
4772 2006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
4774 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
4775 * configure: Rebuilt.
4777 2006-11-01 Douglas Gregor <doug.gregor@gmail.com>
4779 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
4780 for experimental C++0x mode.
4781 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
4782 adopted the preprocessor changes introduced in C99.
4784 2006-10-29 Joseph Myers <joseph@codesourcery.com>
4786 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
4787 depending on --enable-targets=all.
4788 * configure: Regenerate.
4790 2006-10-12 Jakub Jelinek <jakub@redhat.com>
4792 PR preprocessor/28709
4793 * macro.c (paste_tokens): Do error reporting here, use BUF with the
4794 spelled LHS token as opposed to spelling it again.
4795 (paste_all_tokens): Don't report errors here, just break on failure.
4797 2006-10-10 Brooks Moses <bmoses@stanford.edu>
4799 * Makefile.in: Added empty "pdf" target.
4801 2006-09-22 Geoffrey Keating <geoffk@apple.com>
4803 * configure.ac: Make need_64_bit_hwint case for x86-darwin
4804 match exactly the glob in gcc/config.gcc.
4805 * configure: Regenerate.
4807 2006-09-13 Joseph S. Myers <joseph@codesourcery.com>
4810 PR preprocessor/14634
4811 * lex.c (lex_string): Pedwarn for unterminated literals.
4813 2006-09-08 Eric Christopher <echristo@apple.com>
4815 * configure.ac: Add 64-bit HWI support for i?86-darwin.
4817 2006-08-14 Steve Ellcey <sje@cup.hp.com>
4821 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
4822 (CPP_LAST_EQ): Change.
4823 (CPP_LAST_PUNCTUATOR): Change.
4824 * expr.c (cpp_operator): Remove MIN and MAX.
4825 (reduce): Remove CPP_MIN and CPP_MAX.
4826 (num_binary_op): Ditto.
4827 * lex.c (_cpp_lex_direct): Ditto.
4828 (cpp_avoid_paste): Remove ? as legal symbol after > or <.
4830 2006-06-09 Jakub Jelinek <jakub@redhat.com>
4832 PR preprocessor/27746
4833 * directives.c (do_pragma): Handle pragma with valid namespace
4834 and invalid name coming from macro expansion.
4835 * directives.c (destringize_and_run): Initialize next field in
4840 * directives.c (destringize_and_run): Set NO_EXPAND on the
4843 * macro.c (_cpp_backup_tokens): Fix comment typo.
4845 2006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
4847 * Makefile.in (CATALOGS): Add po/ prefix.
4848 * configure: Regenerated.
4850 2006-05-23 Carlos O'Donell <carlos@codesourcery.com>
4852 * Makefile.in: Add install-html target. Add install-html to .PHONY
4854 2006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
4856 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
4857 * files.c (_cpp_get_file_stat): New function.
4858 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
4859 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
4860 * internal.h (_cpp_get_file_stat): Prototype.
4861 (struct cpp_buffer): Add timestamp.
4863 2006-01-23 Jakub Jelinek <jakub@redhat.com>
4865 PR preprocessor/25717
4866 * init.c (cpp_init_builtins): If __STDC__ will not change value
4867 between system headers and other sources, define it as a normal
4868 macro rather than a builtin.
4869 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
4870 cpp_in_system_header condition.
4872 2006-01-05 Paolo Bonzini <bonzini@gnu.org>
4874 * Makefile.in: Use -MMD instead of -MD.
4876 2006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
4877 Richard Henderson <rth@redhat.com>
4879 Merge from gomp branch:
4880 * directives.c (struct pragma_entry): Add is_deferred. Add ident
4881 entry to value union.
4882 (end_directive): Don't eat the line if in_deferred_pragma.
4883 (run_directive): Remove pragma hacks.
4884 (insert_pragma_entry): Remove.
4885 (new_pragma_entry): New.
4886 (register_pragma_1): Split out of register_pragma. Only handle
4887 the lookup tree and return the new entry.
4888 (cpp_register_pragma): Fill in the pragma entry here.
4889 (cpp_register_deferred_pragma): New.
4890 (register_pragma_internal): New.
4891 (_cpp_init_internal_pragmas): Use register_pragma_internal.
4892 (do_pragma): Allow pragma expansion after namespace. For deferred
4893 pragmas, don't slurp the line into a string.
4894 (destringize_and_run): Save tokens for deferred pragmas.
4895 (cpp_handle_deferred_pragma): Remove.
4896 * macro.c (builtin_macro): Remove pragma token hack.
4897 (_cpp_push_token_context): Rename from push_token_context and export.
4898 * internal.h (struct lexer_state): Add pragma_allow_expansion.
4899 (_cpp_push_token_context): Declare.
4900 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
4901 a token. Update the line number correctly if so.
4902 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
4903 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
4904 * include/cpplib.h (PRAGMA_EOL): New.
4905 (CPP_TOKEN_FLD_PRAGMA): New.
4906 (struct cpp_token): Add val.pragma.
4907 (struct cpp_options): Remove defer_pragmas.
4908 (cpp_handle_deferred_pragma): Remove.
4909 (cpp_register_deferred_pragma): Declare.
4911 2006-01-01 Jakub Jelinek <jakub@redhat.com>
4914 * directives.c (do_pragma): If pragma line ends with multi-line
4915 block comment, end the saved deferred pragma string before that
4916 comment. Handle embedded '\0' chars on the pragma line.
4918 2005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
4921 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
4923 2005-12-07 Jon Grimm <jgrimm2@us.ibm.com>
4924 Ben Elliston <bje@au.ibm.com>
4926 * include/cpplib.h (CPP_N_DFLOAT): New.
4927 * expr.c (interpret_float_suffix): Identify df, dd, and dl
4928 suffixes as decimal floating point constants.
4929 (cpp_classify_number): Disallow hexadecimal DFP constants.
4931 2005-11-14 Gerald Pfeifer <gerald@pfeifer.com>
4932 Ian Lance Taylor <ian@airs.com>
4934 * include/cpplib.h (struct cpp_callbacks): Annotate error with
4935 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
4937 2005-11-09 Per Bothner <per@bothner.com>
4938 Uros Bizjak <uros@kss-loka.si>
4941 * init.c (read_original_filename): Temporarily set
4942 state.in_directive before calling _cpp_lex_direct for
4945 2005-11-03 James E Wilson <wilson@specifix.com>
4947 PR preprocessor/24202
4948 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
4950 2005-11-04 Joseph S. Myers <joseph@codesourcery.com>
4952 * include/cpplib.h (struct cpp_callbacks): Make error take
4954 * errors.c (cpp_error): Update call to callback.
4956 2005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
4958 PR preprocessor/22042
4959 * macro.c (_cpp_builtin_macro_text): Lower the needed max
4961 (cpp_quote_string): Don't octalify non printable
4964 2005-11-03 Joseph S. Myers <joseph@codesourcery.com>
4967 * include/cpplib.h (struct cpp_options): Add client_diagnostic.
4968 (struct cpp_callbacks): Add error.
4969 * errors.c (cpp_error): If client_diagnostic, use error callback.
4970 * charset.c (convert_escape): Don't use %03o in diagnostic.
4972 2005-10-21 James E Wilson <wilson@specifix.com>
4974 PR preprocessor/15220
4975 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all
4976 callers. Pass to open_file_failed.
4977 (open_file_failed): New parameter angle_brackets. Fix all callers.
4978 Use in print_dep assignment.
4979 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
4980 * internal.h (_cpp_find_file): Add new parm to declaration.
4982 2005-10-08 Kazu Hirata <kazu@codesourcery.com>
4984 * configure.ac: Require 64-bit int for arm*-*-*eabi*.
4985 * configure: Regenerate.
4987 2005-10-04 Ian Lance Taylor <ian@airs.com>
4989 PR preprocessor/13726
4990 * directives.c (check_eol_return_comments): New static function.
4991 (parse_include): Add buf parameter. Change all callers.
4992 (do_include_common): If not discard comments, turn on
4993 save_comments. Pass collected comments to include callback.
4994 * include/cpplib.h (struct cpp_callbacks): Add new parameter to
4995 include callback: cpp_token list.
4997 2005-09-20 Joseph S. Myers <joseph@codesourcery.com>
4999 * include/cpplib.h (struct cpp_options): Add extended_identifiers.
5000 * init.c (struct lang_flags, lang_defaults): Add
5001 extended_identifiers.
5002 (cpp_set_lang): Use it.
5003 * lex.c (forms_identifier_p): Check extended_identifiers.
5005 2005-08-30 Jakub Jelinek <jakub@redhat.com>
5007 PR preprocessor/20348
5008 PR preprocessor/20356
5009 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
5012 2005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5014 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
5015 -Wmissing-format-attribute.
5017 * configure: Regenerate.
5019 2005-06-29 Kelley Cook <kcook@gcc.gnu.org>
5021 * all files: Update FSF address in copyright headers.
5022 * makeucnid.c (write_copyright): Update outputted FSF address.
5024 2005-06-13 Zack Weinberg <zack@codesourcery.com>
5026 * configure.ac: Invoke ZW_CREATE_DEPDIR and
5027 ZW_PROG_COMPILER_DEPENDENCIES.
5028 * aclocal.m4, configure: Regenerate.
5029 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
5031 (distclean): Clean up $(DEPDIR) and its contents.
5032 (.c.o): Use $(COMPILE).
5033 Include $(DEPDIR)/*.Po for most object->header dependencies.
5035 2005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
5037 * configure.ac: Check declarations for asprintf and vasprintf.
5038 * config.in: Regenerate.
5039 * configure: Likewise.
5041 * charset.c (conversion_loop): Use XRESIZEVEC.
5042 (convert_no_conversion): Likewise.
5043 (convert_using_iconv): Likewise.
5044 (init_iconv_desc): Cast return value of alloca.
5045 (cpp_host_to_exec_charset): Use XNEWVEC.
5046 (emit_numeric_escape): Use XRESIZEVEC.
5047 (cpp_interpret_string): Use XNEWVEC.
5048 (cpp_interpret_string): Use XRESIZEVEC.
5049 (_cpp_interpret_identifier): Cast return value of alloca.
5050 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
5051 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
5052 (parse_include): Use XNEWVEC.
5053 (insert_pragma_entry): Rename local variable "new" to
5055 (save_registered_pragmas): Cast return value of xmemdup.
5056 (destringize_and_run): Same for alloca.
5057 (parse_assertion): Likewise.
5058 (do_assert): Cast allocated storage to proper type.
5059 (cpp_define): Likewise.
5060 (_cpp_define_builtin): Likewise.
5061 (cpp_undef): Likewise.
5062 (handle_assertion): Likewise.
5063 (cpp_push_buffer): Rename local variable "new" to "new_buffer".
5064 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
5065 (CPP_UMINUS): Likewise.
5066 (struct cpp_operator): Rename from struct operator.
5067 (_cpp_expand_op_stack): Use XRESIZEVEC.
5068 * files.c (pch_open_file): Use XNEWVEC.
5069 (pch_open_file): Use XRESIZEVEC.
5070 (read_file_guts): Use XNEWVEC and XRESIZEVEC.
5071 (dir_name_of_file): Use XNEWVEC.
5072 (make_cpp_file): Use XCNEW.
5073 (make_cpp_dir): Likewise.
5074 (allocate_file_hash_entries): USE XNEWVEC.
5075 (cpp_included): Cast return value of htab_find_with_hash.
5076 (append_file_to_dir): Use XNEWVEC.
5077 (read_filename_string): Likewise. Use XRESIZEVEC too.
5078 (read_name_map): Cast return value of alloca. Use XRESIZEVEC.
5079 (remap_filename): Use XNEWVEC.
5080 (struct pchf_entry): Move definition out of struct pchf_data.
5081 (_cpp_save_file_entries): Use XCNEWVAR.
5082 (_cpp_read_file_entries): Use XNEWVAR.
5083 * identifiers.c (alloc_node): Use XOBNEW.
5084 * init.c (cpp_create_reader): Use XCNEW.
5085 (cpp_init_builtins): Cast of b->value to enum builtin_type.
5086 (read_original_directory): Cast return value of alloca.
5087 * lex.c (add_line_note): Use XRESIZEVEC.
5088 (warn_about_normalization): Use XNEWVEC.
5089 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
5090 (new_buff): Use XNEWVEC.
5091 * line-map.c (linemap_add): Use XRESIZEVEC.
5092 * macro.c (builtin_macro): Cast return value of alloca.
5093 (paste_tokens): Likewise.
5094 (expand_arg): Use XNEWVEC and XRESIZEVEC.
5095 (_cpp_save_parameter): Use XRESIZEVEC.
5096 (create_iso_definition): Cast allocated storage to proper type.
5097 (_cpp_create_definition): Likewise.
5098 (cpp_macro_definition): Use XRESIZEVEC.
5099 * makedepend.c (add_clm): Use XNEW.
5100 (add_dir): Likewise.
5101 * mkdeps.c (munge): Use XNEWVEC.
5102 (deps_init): Use XCNEW.
5103 (deps_add_target): Use XRESIZEVEC.
5104 (deps_add_default_target): Cast return value of alloca.
5105 (deps_add_dep): Use XRESIZEVEC.
5106 (deps_add_vpath): Likewise. Use XNEWVEC too.
5107 (deps_restore): Likewise.
5108 * pch.c (save_idents): Use XNEW and XNEWVEC.
5109 (cpp_save_state): Use XNEW.
5110 (count_defs): Cast return value of htab_find.
5111 (write_defs): Likewise.
5112 (cpp_write_pch_deps): Use XNEWVEC.
5113 (collect_ht_nodes): Use XRESIZEVEC.
5114 (cpp_valid_state): Use XNEWVEC.
5115 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup.
5116 * symtab.c (ht_create): Use XCNEW.
5117 (ht_lookup_with_hash): Cast return value of obstack_copy0.
5118 (ht_expand): Use XCNEWVEC.
5119 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
5120 (bool): Do not define if __cplusplus.
5122 2005-05-12 Zack Weinberg <zack@codesourcery.com>
5124 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
5125 (do_sccs): Delete function definition, #define to do_ident.
5126 (do_ident): Don't hardwire directive name.
5128 2005-05-12 Ryota Kunisawa <kunisawa@access.co.jp>
5131 * configure: Regenerate.
5133 2005-04-27 Andris Pavenis <pavenis@latnet.lv>
5135 * files.c: Include io.h for DJGPP to get prototype of setmode.
5137 2005-04-19 Per Bothner <per@bothner.com>
5139 PR preprocessor/20907
5140 * line-map.c (linemap_line_start): Fix bug when we need to increse
5141 column_bits but can re-use the current line_map.
5143 2005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5145 * system.h (fopen, fdopen, freopen): Define these to the unlocked
5146 libiberty functions.
5148 2005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5150 * configure.ac (libcpp_UNLOCKED_FUNCS): New.
5151 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
5152 * system.h (putchar, getc, getchar, clearerr, feof, fileno,
5153 fflush, fgetc, fgets, ferror, fread): Redefine to the associated
5155 (fwrite_unlocked): Fix prototype.
5157 * configure, config.in: Regenerate.
5159 2005-04-05 Jakub Jelinek <jakub@redhat.com>
5161 PR preprocessor/19475
5162 * macro.c (create_iso_definition): For < ISO C99, don't
5163 pedwarn if there is no whitespace between macro name and its
5164 replacement, but the replacement starts with a basic character
5167 2005-03-28 Andreas Jaeger <aj@suse.de>
5169 * lex.c (warn_about_normalization): Cast field width to int to
5172 2005-03-19 Joseph S. Myers <joseph@codesourcery.com>
5174 * configure.ac: Consistently use solaris2.1[0-9]* instead of
5176 * configure: Regenerate.
5178 2005-03-15 Geoffrey Keating <geoffk@apple.com>
5180 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
5181 UCN rather than printing an error.
5183 2005-03-14 Geoffrey Keating <geoffk@apple.com>
5185 * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
5187 2005-03-14 Geoffrey Keating <geoffk@apple.com>
5189 * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
5190 * charset.c: Update for new format of ucnid.h.
5191 (ucn_valid_in_identifier): Update for new format of ucnid.h.
5192 Add NST parameter, and update it; update callers.
5193 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort
5195 (convert_ucn): Pass normalize_state to cpp_valid_ucn.
5196 * internal.h (struct normalize_state): New.
5197 (INITIAL_NORMALIZE_STATE): New.
5198 (NORMALIZE_STATE_RESULT): New.
5199 (NORMALIZE_STATE_UPDATE_IDNUM): New.
5200 (_cpp_valid_ucn): New.
5201 * lex.c (warn_about_normalization): New.
5202 (forms_identifier_p): Add normalize_state parameter, update callers.
5203 (lex_identifier): Add normalize_state parameter, update callers. Keep
5205 (lex_number): Likewise.
5206 (_cpp_lex_direct): Pass normalize_state to subroutines. Check
5207 it with warn_about_normalization.
5211 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove
5212 comments about obsolete version of C++.
5213 * include/cpplib.h (enum cpp_normalize_level): New.
5214 (struct cpp_options): Add warn_normalize field.
5216 2005-03-11 Geoffrey Keating <geoffk@apple.com>
5218 * directives.c (glue_header_name): Update call to cpp_spell_token.
5219 * internal.h (_cpp_interpret_identifier): New.
5220 * charset.c (_cpp_interpret_identifier): New.
5221 (_cpp_valid_ucn): Allow UCN version of '$'.
5222 * lex.c (lex_identifier): Add extra parameter to indicate if initial
5223 character was '$' or '\'. Support identifiers with UCNs.
5224 (forms_identifier_p): Allow UCNs.
5225 (_cpp_lex_direct): Pass extra parameter to lex_identifier.
5227 (cpp_spell_token): Add FORSTRING parameter. Use it.
5228 (cpp_token_as_text): Update call to cpp_spell_token.
5229 (cpp_output_token): Write UCNs back out.
5230 (stringify_arg): Update call to cpp_spell_token.
5231 (paste_tokens): Likewise.
5232 (cpp_macro_definition): Likewise.
5233 * macro.c (stringify_arg): Likewise.
5234 (paste_tokens): Likewise.
5235 (cpp_macro_definition): Likewise.
5236 * include/cpplib.h: Add parameter to cpp_spell_token.
5238 2005-03-04 Jakub Jelinek <jakub@redhat.com>
5242 * macro.c (replace_args, cpp_get_token): Copy whole
5243 cpp_token_u instead of just cpp_string field from it.
5245 2005-02-28 Devang Patel <dpatel@apple.com>
5247 * directives.c (do_line): Save sysp early before line table is
5250 2005-02-20 Zack Weinberg <zack@codesourcery.com>
5253 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
5254 (cpp_host_to_exec_charset): New function.
5255 * include/cpplib.h: Declare cpp_host_to_exec_charset.
5257 2005-02-19 Devang Patel <dpatel@apple.com>
5259 * charset.c (_cpp_convert_input): Check '\r' before inserting
5262 2005-02-15 Eric Christopher <echristo@redhat.com>
5264 PR preprocessor/19077
5265 * macro.c (cpp_macro_definition): Move handling of whitespace
5266 to PREV_WHITE conditional. Remove overloading of len
5269 2005-02-14 Kazu Hirata <kazu@cs.umass.edu>
5271 * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
5272 traditional.c: Update copyright.
5274 2005-02-14 Paolo Bonzini <bonzini@gnu.org>
5277 * configure.ac: Check for declaration of basename and getopt.
5278 * config.in: Regenerate.
5279 * configure: Regenerate.
5280 * internal.h (ustrcspn): New.
5281 * macro.c (create_iso_definition): Fix allocation of memory.
5282 (padding_token): Add cast to remove const-ness.
5283 * pch.c (cpp_read_state): Use ustrcspn.
5285 2005-02-08 Mike Stump <mrs@apple.com>
5287 * files.c (pchf_adder): Remove.
5288 (struct pchf_adder_info): Likewise.
5289 (_cpp_save_file_entries): Write out all files so that #import works.
5291 2005-01-23 Joseph S. Myers <joseph@codesourcery.com>
5293 * configure: Regenerate.
5295 2005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
5297 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
5299 * include/cpplib.h: Also update copyright years.
5301 2005-01-03 Geoffrey Keating <geoffk@apple.com>
5303 * files.c (_cpp_find_file): Add files found by search_path_exhausted
5304 to the list of all files.
5306 2005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
5308 * internal.h: Update references to Cpp lib filenames.
5309 * directives.c: Likewise.
5311 * macro.c: Likewise.
5312 * traditional.c: Likewise.
5314 2004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
5316 PR preprocessor/15167
5317 * files.c (destroy_cpp_file): New function.
5318 (should_stack_file): Make a new file if the
5319 compared file is still stacked.
5321 2004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
5323 PR preprocessor/17610
5324 * directives.c (do_include_common): Error out if an empty filename
5325 is given for #include (or #include_next or #import).
5327 2004-11-27 Roger Sayle <roger@eyesopen.com>
5328 Zack Weinberg <zack@codesourcery.com>
5330 * internal.h: Replace all uses of uchar with unsigned char.
5331 * include/cpp-id-data.h: Likewise. Guard typedef of uchar
5332 with !IN_GCC, so uchar is only defined whilst building libcpp.
5334 2004-11-24 Kelley Cook <kcook@gcc.gnu.org>
5336 * aclocal.m4: Regenerate.
5338 2004-11-24 Roger Sayle <roger@eyesopen.com>
5340 PR preprocessor/15824
5341 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
5342 directly, instead of the non-existant "system.h" and "ansidecl.h".
5343 * configure: Regenerate.
5345 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
5346 Joseph Myers <joseph@codesourcery.com>
5348 * internal.h (struct lexer_state): Add in_deferred_pragma.
5349 * directives.c (struct pragma_entry): Add allow_expansion.
5350 (insert_pragma_entry): Take allow_expansion flag.
5351 (register_pragma): Likewise.
5352 (cpp_register_pragma): Likewise.
5353 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
5354 (do_pragma): Honor allow_expansion.
5355 (cpp_handle_deferred_pragma): Set in_deferred_pragma.
5356 * include/cpplib.h (cpp_register_pragma): Update prototype.
5358 2004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
5359 Mark Mitchell <mark@codesourcery.com>
5361 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
5362 need_64bit_hwint=yes.
5363 * configure: Regenerate.
5365 2004-11-09 Joseph S. Myers <joseph@codesourcery.com>
5367 * Makefile.in ($(PACKAGE).pot): New rule. Depend on
5369 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
5370 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
5371 Remove local srcdir path from generated file.
5373 2004-11-04 Zack Weinberg <zack@codesourcery.com>
5374 Gerald Pfeifer <gerald@pfeifer.com>
5376 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
5379 2004-10-27 Zack Weinberg <zack@codesourcery.com>
5382 * directives.c (do_pragma): Do not defer pragmas which are unknown.
5383 (cpp_handle_deferred_pragma): Add cast to silence warning.
5385 2004-10-14 Joseph S. Myers <jsm@polyomino.org.uk>
5387 * errors.c (_cpp_begin_message): Print "error: " for errors.
5389 2004-10-10 Andreas Jaeger <aj@suse.de>
5391 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
5392 * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
5394 2004-10-08 Andrew Pinski <pinskia@physics.uc.edu>
5396 * pch.c (cpp_write_pch_state): Remove variable z as it is not
5398 (cpp_read_state): Remove unused variables, m, d and mac_count.
5400 2004-09-29 Per Bothner <per@bothner.com>
5402 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore
5403 cb.line_change. Otherwise do_pragma will call the line_change
5404 call-back with a meaningless line number.
5406 2004-09-24 Zack Weinberg <zack@codesourcery.com>
5408 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
5409 programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
5410 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
5411 * aclocal.m4, configure: Regenerate.
5412 * init.c: Include localedir.h.
5413 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
5415 (.c.o): Use $(ALL_CFLAGS).
5416 (localedir.h, localedir.hs): New rules.
5417 (clean): Use rm -rf to remove directories.
5418 (distclean): Also delete localedir.h and localedir.hs.
5419 (init.o): Update dependencies.
5421 2004-09-22 Kelley Cook <kcook@gcc.gnu.org>
5423 * Makefile.in (aclocal.m4): Update dependencies.
5424 * configure.ac (AC_CONFIG_MACRO_DIR): New.
5425 * aclocal.m4, configure: Regenerate.
5427 2004-09-17 Zack Weinberg <zack@codesourcery.com>
5429 * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
5430 (_cpp_convert_input, _cpp_default_encoding): Add comments.
5431 Some other comments in this file also tweaked.
5433 * directives.c (do_pragma): Save current buffer position
5434 before lexing the pragma keywords; don't call
5435 _cpp_backup_tokens in the defer_pragmas case.
5437 2004-09-15 Per Bothner <per@bothner.com>
5439 * include/line-map.h (line_map_start): Add parameter names so
5440 preceding comment makes sense.
5441 (linemap_add): Remove from comment mention of non-existing parameter.
5443 2004-09-09 Matt Austern <austern@apple.com>
5444 Zack Weinberg <zack@codesourcery.com>
5446 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
5447 prefixes throughout. Add entry for PRAGMA. Remove
5448 unnecessary "= 0" from EQ.
5449 (enum cpp_ttype): Adjust OP and TK definitions to restore
5450 prefixes, via token-paste.
5451 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
5452 Change from #defines to additional cpp_ttype enumerators.
5453 (struct cpp_options): Add defer_pragmas.
5454 (cpp_handle_deferred_pragma): Prototype new interface.
5456 * internal.h (struct cpp_reader): Add directive_result.
5457 * directives.c (struct pragma_entry): Add is_internal field;
5458 give boolean fields type bool.
5459 (start_directive): Initialize pfile->directive_result.type.
5460 (_cpp_do__Pragma): Likewise.
5461 (run_directive): Do not crash if pfile->buffer->prev is NULL.
5462 (insert_pragma_entry): Add 'internal' argument; set new->is_internal
5464 (register_pragma): New static function, bulk of former
5465 cpp_register_pragma here; add 'internal' argument, pass along
5466 to insert_pragma_entry.
5467 (cpp_register_pragma): Now a wrapper around register_pragma which
5468 always passes false for 'internal' argument.
5469 (_cpp_init_internal_pragmas): Call register_pragma directly, passing
5470 true for 'internal'.
5471 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
5472 an internal pragma, save text till the end of the line as a CPP_PRAGMA
5473 token instead of executing the pragma.
5474 (cpp_handle_deferred_pragma): New interface.
5475 * lex.c (token_spellings): Adjust OP and TK definitions to
5476 match changes to cpplib.h.
5477 (_cpp_lex_token): Check for a directive-result token and
5478 return it if present.
5479 (cpp_token_val_index): Handle CPP_PRAGMA.
5480 * macro.c (cpp_builtin_macro_text): Correct comment.
5481 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
5483 2004-09-06 Serge Belyshev <belyshev@lubercy.com>
5485 PR preprocessor/14699
5486 * symtab.c (ht_dump_statistics): Change type of sum_of_squares
5487 from size_t to double.
5489 2004-08-28 Andreas Schwab <schwab@suse.de>
5490 Andreas Jaeger <aj@suse.de>
5492 * configure.ac: Set PACKAGE correctly.
5493 * configure: Regenerated.
5495 2004-08-25 Paolo Bonzini <bonzini@gnu.org>
5497 * Makefile.in: Add back top_builddir.
5499 2004-08-25 Paolo Bonzini <bonzini@gnu.org>
5501 * configure.ac: Replace Automake macro invocations
5502 with manual Autoconf checks and substitutions.
5503 * configure: Regenerate.
5504 * aclocal.m4: Regenerate.
5505 * config.in: Regenerate.
5506 * Makefile.am: Removed.
5507 * Makefile.in: Heavy simplification and reorganization.
5509 2004-08-09 Mark Mitchell <mark@codesourcery.com>
5511 * configure.ac (arm*-*-eabi*): New target.
5512 (arm*-*-symbianelf*): Likewise.
5513 * configure: Regenerated.
5515 2004-07-24 Bernardo Innocenti <bernie@develer.com>
5517 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
5518 * directives.c: Use XNEW-family macros from libiberty.
5520 * macro.c: Likewise.
5521 * cpplib.h (cpp_deps_style): Export enum with name.
5523 2004-07-23 Matthias Klose <doko@debian.org>
5525 * init.c (init_library): Use PACKAGE for the text domain.
5527 2004-07-16 Andris Pavenis <pavenis@latnet.lv>
5529 PR preprocessor/16366
5530 * internal.h (struct cpp_reader): New field dir_hash.
5531 * files.c (make_cpp_dir): Use dir_hash, not file_hash.
5532 (_cpp_init_files, _cpp_cleanup_files): Update for new field.
5534 2004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
5536 PR preprocessor/16192
5537 PR preprocessor/15913
5538 PR preprocessor/15572
5539 * expr.c (_cpp_parse_expr): Handle remaining cases where an
5540 expression is missing.
5541 * init.c (post_options): Traditional cpp doesn't do // comments.
5543 2004-06-30 Per Bothner <per@bothner.com>
5545 * include/line-map.h (fileline): Remove old typedef.
5546 * internal.h (struct cpp_reader): Use source_location typedef instead.
5548 2004-06-26 Zack Weinberg <zack@codesourcery.com>
5550 Partially revert patch of 2004-06-05.
5551 * files.c (search_cache): Remove pfile argument. Don't check
5552 for file that would be found by "" or <> search here...
5553 (_cpp_find_file): ...do it here, before calling find_file_in_dir.
5554 Do not apply directory-of-current-file correction to files
5555 found by this check. Rearrange code slightly.
5557 2004-06-21 Geoffrey Keating <geoffk@apple.com>
5559 * files.c (should_stack_file): Correct swapped parameters to call
5561 * pch.c (cpp_valid_state): Handle -fpreprocessed.
5563 2004-06-15 Paolo Bonzini <bonzini@gnu.org>
5565 * Makefile.in: Regenerate with automake 1.8.5.
5566 * aclocal.m4: Likewise.
5567 * configure: Regenerate.
5569 2004-06-11 Zack Weinberg <zack@codesourcery.com>
5571 * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
5572 * configure, config.in: Regenerate.
5573 * system.h: Unconditionally define bool as unsigned char,
5574 BOOL_BITFIELD as unsigned int.
5575 * .cvsignore: New file.
5577 2004-06-09 Geoffrey Keating <geoffk@apple.com>
5579 * traditional.c (push_replacement_text): Set macro->traditional.
5580 (save_replacement_text): Likewise.
5581 * pch.c (cpp_write_pch_state): Don't write list of defined macros.
5582 (struct save_macro_item): Delete.
5583 (struct save_macro_data): Use a character array not the previous
5585 (save_macros): Save macro as text not as internal structures.
5586 (cpp_prepare_state): Update for changes to save_macro_data.
5587 (cpp_read_state): Don't read macros defined in PCH. Restore
5589 * macro.c (create_iso_definition): Honour alloc_subobject.
5590 Clear traditional flag.
5591 (_cpp_create_definition): Honour alloc_subobject.
5592 * lex.c (cpp_token_val_index): New.
5593 * internal.h: Include cpp-id-data.h.
5594 (uchar): Move definition to cpp-id-data.h.
5596 (cpp_macro): Likewise.
5597 * directives.c (struct answer): Move to cpp-id-data.h.
5598 (do_assert): Honour alloc_subobject.
5600 * include/symtab.h (struct ht): Add field 'alloc_subobject'.
5601 * include/cpplib.h (struct cpp_string): Add GTY marker.
5602 (enum cpp_token_fld_kind): New.
5603 (struct cpp_token): Add GTY markers.
5604 (cpp_token_val_index): Prototype.
5605 (CPP_HASHNODE_VALUE_IDX): New.
5606 (struct cpp_hashnode): Don't skip fields of 'value' when marking.
5607 * include/cpp-id-data.h: New file.
5609 2004-06-09 Paolo Bonzini <bonzini@gnu.org>
5611 * Makefile.am (all-local): New.
5612 * Makefile.in: Regenerate.
5614 2004-06-06 Roger Sayle <roger@eyesopen.com>
5616 * Makefile.am (LIBICONV): Declare.
5617 (makedepend_LDADD): Use LIBICONV.
5618 * Makefile.in: Regenerate.
5620 2004-06-05 Andrew Pinski <pinskia@physics.uc.edu>
5622 * Makefile.am (LIBINTL): Declare
5623 (makedepend_LDADD): Use LIBINTL.
5624 * Makefile.in: Regenerate.
5626 2004-06-05 Zack Weinberg <zack@codesourcery.com>
5628 * Makefile.am: Add makedepend.
5629 * Makefile.in, aclocal.m4: Regenerate.
5630 * charset.c: Insert a space to avoid a warning.
5631 * directives.c: Include mkdeps.h.
5632 (_cpp_handle_directive): Reenable macro expander if appropriate.
5633 (undefine_macros): Inline body of _cpp_free_definition for speed.
5634 Do not call undef callback or _cpp_warn_if_unused_macro.
5635 (cpp_get_deps): New interface.
5636 * files.c (search_cache): Add pfile argument. Check for file
5637 that would be found by "" or <> search here...
5638 (_cpp_find_file): ...not here. Correct recorded start_dir of
5639 files found by directory-of-current-file search that would be
5640 found by "" or <> search.
5641 * init.c (cpp_add_dependency_target): Delete.
5642 * internal.h (struct lexer_state): Add discarding_output flag.
5643 * lex.c (lex_identifier): Compute hash function while scanning.
5644 * macro.c (cpp_scan_nooutput): Disable macro expansion outside
5646 * makedepend.c: New file.
5647 * mkdeps.c (struct deps): Add vpath vector.
5648 (apply_vpath, deps_add_vpath): New function.
5649 (deps_free): Free vpath vector.
5650 (deps_add_dep, deps_add_target): Use apply_vpath.
5651 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
5652 (ht_lookup_with_hash): New function.
5653 * cpplib.h, mkdeps.h: Update prototypes.
5654 * symtab.h: Update prototypes.
5655 (HT_HASHSTEP, HT_FINISH): New macros.
5657 2004-05-29 Geoffrey Keating <geoffk@apple.com>
5659 * symtab.c (ht_create): Set entries_owned.
5660 (ht_destroy): Honour entries_owned.
5661 (ht_expand): Likewise.
5663 * include/symtab.h (struct ht): New field 'entries_owned'
5664 (ht_load): New prototype.
5666 2004-05-26 Paolo Bonzini <bonzini@gnu.org>
5669 * configure.ac: Fix m4 quoting when picking
5670 the size of HOST_WIDE_INT.
5671 * configure: Regenerate.
5673 2004-05-25 Paolo Bonzini <bonzini@gnu.org>
5675 * Makefile.am: the correct directory for
5676 gettext include files is given by @INCINTL@.
5677 * Makefile.in: Regenerate.
5679 2004-05-24 Paolo Bonzini <bonzini@gnu.org>
5681 * system.h [!ENABLE_NLS]: dgettext takes two
5684 2004-05-23 Paolo Bonzini <bonzini@gnu.org>
5686 Moved libcpp from the gcc subdirectory to the toplevel.
5687 * Makefile.am: New file.
5688 * Makefile.in: Regenerate.
5689 * configure.ac: New file.
5690 * configure: Regenerate.
5691 * config.in: Regenerate.
5692 * charset.c: Moved from gcc/cppcharset.c. Add note about
5693 brokenness of input charset detection. Adjust for change
5694 in name of cppucnid.h.
5695 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
5696 * expr.c: Moved from gcc/cppexp.c.
5697 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
5698 Remove #define of O_BINARY, it is in system.h.
5699 * identifiers.c: Moved from gcc/cpphash.c.
5700 * internal.h: Moved from gcc/cpphash.h. Change header
5701 guard name. All other files adjusted to match name change.
5702 * init.c: Moved from gcc/cppinit.c.
5703 (init_library) [ENABLE_NLS]: Call bindtextdomain.
5704 * lex.c: Moved from gcc/cpplex.c.
5705 * directives.c: Moved from gcc/cpplib.c.
5706 * macro.c: Moved from gcc/cppmacro.c.
5707 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
5708 * traditional.c: Moved from gcc/cpptrad.c.
5709 * ucnid.h: Moved from gcc/cppucnid.h. Change header
5711 * ucnid.pl: Moved from gcc/cppucnid.pl.
5712 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header
5714 * symtab.c: Moved from gcc/hashtable.c.
5715 * line-map.c: Moved from gcc. Do not include intl.h.
5716 * mkdeps.c: Moved from gcc.
5717 * system.h: New file.
5718 * include/cpplib.h: Moved from gcc. Change header guard name.
5719 * include/line-map.h: Moved from gcc. Change header guard name.
5720 * include/mkdeps.h: Moved from gcc. Change header guard name.
5721 * include/symtab.h: Moved from gcc/hashtable.h. Change header
5724 Copyright (C) 2004-2019 Free Software Foundation, Inc.
5726 Copying and distribution of this file, with or without modification,
5727 are permitted in any medium without royalty provided the copyright
5728 notice and this notice are preserved.