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