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