]> git.ipfire.org Git - thirdparty/gcc.git/blame - libcpp/ChangeLog
Update ChangeLog and version files for release
[thirdparty/gcc.git] / libcpp / ChangeLog
CommitLineData
ff4bf326
JJ
12023-05-29 Release Manager
2
3 * GCC 11.4.0 released.
4
10fa11e4
GA
52022-08-02 Lewis Hyatt <lhyatt@gmail.com>
6
7 Backported from master:
8 2022-07-10 Lewis Hyatt <lhyatt@gmail.com>
9
10 PR preprocessor/97498
11 * directives.c (destringize_and_run): Override the location of
12 the CPP_PRAGMA token from a _Pragma directive to the location of
13 the expansion point, as is done for the tokens lexed from it.
14
232bbea5
GA
152022-06-15 Jakub Jelinek <jakub@redhat.com>
16
17 Backported from master:
18 2022-05-29 Jakub Jelinek <jakub@redhat.com>
19
20 PR preprocessor/105732
21 * expr.c (_cpp_parse_expr): Handle CPP_PADDING by just another
22 token.
23
2d280e7e
RB
242022-04-21 Release Manager
25
26 * GCC 11.3.0 released.
27
7e6f9909
GA
282022-02-19 Jakub Jelinek <jakub@redhat.com>
29
30 Backported from master:
31 2022-02-01 Jakub Jelinek <jakub@redhat.com>
32
33 PR preprocessor/104147
34 * macro.c (funlike_invocation_p): For padding prefer a token
35 with val.source non-NULL especially if it has PREV_WHITE set
36 on val.source->flags. Add gcc_assert that CPP_PADDING tokens
37 don't have PREV_WHITE set in flags.
38
392022-02-19 Jakub Jelinek <jakub@redhat.com>
40
41 Backported from master:
42 2022-02-01 Jakub Jelinek <jakub@redhat.com>
43
44 * directives.c (destringize_and_run): Push &pfile->avoid_paste
45 instead of a copy of pfile->directive_result for the CPP_PADDING
46 case.
47
c403f6ce
GA
482022-01-24 Jakub Jelinek <jakub@redhat.com>
49
50 Backported from master:
51 2021-12-30 Jakub Jelinek <jakub@redhat.com>
52
53 PR preprocessor/89971
54 * macro.c (replace_args): For ##__VA_OPT__, if __VA_OPT__ expands
55 to no tokens at all, drop PASTE_LEFT flag from the previous token.
56
173232a0
GA
572021-12-04 Jakub Jelinek <jakub@redhat.com>
58
59 Backported from master:
60 2021-12-04 Jakub Jelinek <jakub@redhat.com>
61
62 PR preprocessor/102432
63 * lex.c (_cpp_lex_direct): If buffer->need_line while
64 pfile->state.in_deferred_pragma, return CPP_PRAGMA_EOL token instead
65 of assertion failure.
66
90e6db52
GA
672021-11-29 Jakub Jelinek <jakub@redhat.com>
68
69 Backported from master:
70 2021-11-17 Jakub Jelinek <jakub@redhat.com>
71
72 PR preprocessor/103130
73 * lex.c (cpp_directive_only_process): Treat even \*/ as end of block
74 comment.
75
7319c2c9
GA
762021-08-12 Jakub Jelinek <jakub@redhat.com>
77
78 Backported from master:
79 2021-08-12 Jakub Jelinek <jakub@redhat.com>
80
81 PR preprocessor/101638
82 * macro.c (cpp_sys_macro_p): Return true instead of
83 crashing on builtin macros.
84
7ca38856
RB
852021-07-28 Release Manager
86
87 * GCC 11.2.0 released.
88
f5402be3
GA
892021-06-16 Jason Merrill <jason@redhat.com>
90
91 PR c++/100796
92 PR preprocessor/96391
93 * line-map.c (linemap_compare_locations): Only use comparison with
94 LINE_MAP_MAX_LOCATION_WITH_COLS to avoid abort.
95
6d2de5e5
GA
962021-05-31 Jakub Jelinek <jakub@redhat.com>
97
98 Backported from master:
99 2021-05-20 Jakub Jelinek <jakub@redhat.com>
100
101 PR preprocessor/100646
102 * lex.c (cpp_directive_only_process): Treat end of file as termination
103 for !is_block comments.
104
3aac2872
GA
1052021-05-12 Jakub Jelinek <jakub@redhat.com>
106
107 Backported from master:
108 2021-05-12 Jakub Jelinek <jakub@redhat.com>
109
110 PR preprocessor/100392
111 * lex.c (cpp_directive_only_process): If buffer doesn't end with '\n',
112 add buffer->rlimit[0] character to the printed range and
113 CPP_INCREMENT_LINE and increment line_count.
114
99964f67
GA
1152021-05-07 Jakub Jelinek <jakub@redhat.com>
116
117 Backported from master:
118 2021-05-07 Jakub Jelinek <jakub@redhat.com>
119
120 PR c/100450
121 * lex.c (cpp_avoid_paste): Handle token1 CPP_PRAGMA like CPP_NAME.
122
d81efb06
JJ
1232021-04-27 Release Manager
124
125 * GCC 11.1.0 released.
126
6e81e015
GA
1272021-04-19 Richard Biener <rguenther@suse.de>
128
129 PR preprocessor/100142
130 * line-map.c (linemap_position_for_loc_and_offset): Revert
131 unintended s/column_offset/column/ change.
132
6d0d35d5
GA
1332021-04-13 Nathan Sidwell <nathan@acm.org>
134
135 PR preprocessor/99446
136 * line-map.c (line-map.c): Do not advance to linemaps for
137 different files.
138
1392021-04-13 Eric Botcazou <ebotcazou@adacore.com>
140
141 * include/line-map.h (IS_MACRO_LOC): Delete.
142 * line-map.c (linemap_location_from_macro_expansion_p): Test
143 LINEMAPS_MACRO_LOWEST_LOCATION of the linemap.
144
d97a92dc
GA
1452021-03-02 David Malcolm <dmalcolm@redhat.com>
146
147 PR c/99323
148 * line-map.c (rich_location::maybe_add_fixit): Reject fix-it hints
149 at column 0.
150
4028d01a
GA
1512021-02-24 Nathan Sidwell <nathan@acm.org>
152
153 PR c++/98718
154 * include/line-map.h
155 * line-map.c
156
1572021-02-24 Nathan Sidwell <nathan@acm.org>
158
159 PR c++/99072
160 * init.c (read_original_filename): Expunge all evidence of the
161 original filename.
162
bf81237e
GA
1632021-02-18 Nathan Sidwell <nathan@acm.org>
164
165 PR c++/99023
166 * include/cpplib.h (cpp_find_header_unit): Rename to ...
167 (cpp_probe_header_unit): ... this.
168 * internal.h (_cp_find_header_unit): Declare.
169 * files.c (cpp_find_header_unit): Break apart to ..
170 (test_header_unit): ... this, and ...
171 (_cpp_find_header_unit): ... and, or and ...
172 (cpp_probe_header_unit): ... this.
173 * macro.c (cpp_get_token_1): Call _cpp_find_header_unit.
174
0e804ce3
GA
1752021-02-16 Nathan Sidwell <nathan@acm.org>
176
177 * files.c (_cpp_stack_file): Make buffers end in unread \n.
178
4b37c3ea
GA
1792021-02-10 David Malcolm <dmalcolm@redhat.com>
180
181 PR preprocessor/96391
182 * line-map.c (linemap_compare_locations): Require that
183 the location be <= LINE_MAP_MAX_LOCATION_WITH_COLS when
184 treating locations as coming from the same macro expansion.
185
a19dd5e6
GA
1862021-02-04 Jakub Jelinek <jakub@redhat.com>
187
188 * expr.c (cpp_classify_number): Use make_signed_t<size_t> instead of
189 make_signed<size_t>::type in the diagnostics.
190
9faaa807
GA
1912021-02-03 Jakub Jelinek <jakub@redhat.com>
192
193 PR preprocessor/98882
194 * lex.c (cpp_directive_only_process): Don't assert that rlimit[-1]
195 is a newline, instead assert that rlimit[0] is either newline or
196 carriage return. When seeing '\\' followed by '\r', check limit
197 before accessing pos[1].
198
1992021-02-03 Ed Smith-Rowland <3dw4rd@verizon.net>
200
201 * expr.c (interpret_int_suffix): Detect 'z' integer suffix.
202 (cpp_classify_number): Compat warning for use of 'z' suffix.
203 * include/cpplib.h (struct cpp_options): New flag.
204 (enum cpp_warning_reason): New flag.
205 (CPP_N_USERDEF): Comment C++0x -> C++11.
206 (CPP_N_SIZE_T): New flag for cpp_classify_number.
207 * init.c (cpp_set_lang): Initialize new flag.
208
aa69f0a8
GA
2092021-01-27 liuhongt <hongtao.liu@intel.com>
210
211 PR target/98833
212 * lex.c (search_line_sse2): Replace builtins with == operator.
213
e62bb7f0
GA
2142021-01-26 Paul Fee <paul.f.fee@gmail.com>
215
216 * include/cpplib.h (c_lang): Add CXX23 and GNUCXX23.
217 * init.c (lang_defaults): Add rows for CXX23 and GNUCXX23.
218 (cpp_init_builtins): Set __cplusplus to 202100L for C++23.
219
2f7f0d32
GA
2202021-01-15 Nathan Sidwell <nathan@acm.org>
221
222 PR preprocessor/95253
223 * mkdeps.c (munge): Do not escape ':'.
224
d52945ce
GA
2252020-12-14 Nathan Sidwell <nathan@acm.org>
226
227 * include/cpplib.h (struct cpp_macro): Add imported_p field.
228 (struct cpp_hashnode): Tweak deferred field documentation.
229 * macro.c (_cpp_new_macro): Clear new field.
230 (cpp_get_deferred_macro, get_deferred_or_lazy_macro): Assert
231 more.
232
35af8778
GA
2332020-12-10 Jason Merrill <jason@redhat.com>
234
235 * init.c (cpp_init_builtins): Update __cplusplus for C++20.
236
e0f5e792
GA
2372020-12-01 JeanHeyd Meneide <phdofthehouse@gmail.com>
238
239 * charset.c (init_iconv_desc): Initialize "to" and "from" fields.
240 * directives.c (cpp_get_narrow_charset_name): New function.
241 (cpp_get_wide_charset_name): Likewise.
242 * include/cpplib.h (cpp_get_narrow_charset_name): Prototype.
243 (cpp_get_wide_charset_name): Likewise.
244 * internal.h (cset_converter): Add "to" and "from" fields.
245
e87559d2
GA
2462020-11-27 Joseph Myers <joseph@codesourcery.com>
247
248 PR preprocessor/97602
249 * directives.c (strtolinenum): Check for overflow before it
250 occurs. Correct comment.
251
1e2c9a27
GA
2522020-11-24 Nathan Sidwell <nathan@acm.org>
253
254 * include/cpplib.h (struct cpp_hashnode): Add deferred field.
255 (cpp_set_deferred_macro): Define.
256 (cpp_get_deferred_macro): Declare.
257 (cpp_macro_definition): Reformat, add overload.
258 (cpp_macro_definition_location): Deal with deferred macro.
259 (cpp_alloc_token_string, cpp_compare_macro): Declare.
260 * internal.h (_cpp_notify_macro_use): Return bool
261 (_cpp_maybe_notify_macro_use): Likewise.
262 * directives.c (do_undef): Check macro is not undef before
263 warning.
264 (do_ifdef, do_ifndef): Deal with deferred macro.
265 * expr.c (parse_defined): Likewise.
266 * lex.c (cpp_allocate_token_string): Break out of ...
267 (create_literal): ... here. Call it.
268 (cpp_maybe_module_directive): Deal with deferred macro.
269 * macro.c (cpp_get_token_1): Deal with deferred macro.
270 (warn_of_redefinition): Deal with deferred macro.
271 (compare_macros): Rename to ...
272 (cpp_compare_macro): ... here. Make extern.
273 (cpp_get_deferred_macro): New.
274 (_cpp_notify_macro_use): Deal with deferred macro, return bool
275 indicating definedness.
276 (cpp_macro_definition): Deal with deferred macro.
277
d62586ee
GA
2782020-11-19 Nathan Sidwell <nathan@acm.org>
279
280 * include/cpplib.h (enum cpp_main_search): New.
281 (struct cpp_options): Add main_search field.
282 (cpp_main_loc): Declare.
283 (cpp_retrofit_as_include): Declare.
284 * internal.h (struct cpp_reader): Add main_loc field.
285 (_cpp_in_main_source_file): Not main if main is a header.
286 * init.c (cpp_read_main_file): Use main_search option to locate
287 main file. Set main_loc
288 * files.c (cpp_retrofit_as_include): New.
289
2902020-11-19 Nathan Sidwell <nathan@acm.org>
291
292 * internal.h (cpp_in_system_header): Rename to ...
293 (_cpp_in_system_header): ... here.
294 (cpp_in_primary_file): Rename to ...
295 (_cpp_in_main_source_file): ... here. Compare main_file equality
296 and check main_search value.
297 * lex.c (maybe_va_opt_error, _cpp_lex_direct): Adjust for rename.
298 * macro.c (_cpp_builtin_macro_text): Likewise.
299 (replace_args): Likewise.
300 * directives.c (do_include_next): Likewise.
301 (do_pragma_once, do_pragma_system_header): Likewise.
302 * files.c (struct _cpp_file): Delete main_file field.
303 (pch_open): Check pfile->main_file equality.
304 (make_cpp_file): Drop cpp_reader parm, don't set main_file.
305 (_cpp_find_file): Adjust.
306 (_cpp_stack_file): Check pfile->main_file equality.
307 (struct report_missing_guard_data): Add cpp_reader field.
308 (report_missing_guard): Check pfile->main_file equality.
309 (_cpp_report_missing_guards): Adjust.
310
25bb75f8
GA
3112020-11-18 Nathan Sidwell <nathan@acm.org>
312
313 * include/cpplib.h (struct cpp_options): Add module_directives
314 option.
315 (NODE_MODULE): New node flag.
316 (struct cpp_hashnode): Make rid-code a bitfield, increase bits in
317 flags and swap with type field.
318 * init.c (post_options): Create module-directive identifier nodes.
319 * internal.h (struct lexer_state): Add directive_file_token &
320 n_modules fields. Add module node enumerator.
321 * lex.c (cpp_maybe_module_directive): New.
322 (_cpp_lex_token): Call it.
323 (cpp_output_token): Add '"' around CPP_HEADER_NAME token.
324 (do_peek_ident, do_peek_module): New.
325 (cpp_directives_only): Detect module-directive lines.
326 * macro.c (cpp_get_token_1): Deal with directive_file_token
327 triggering.
328
3292020-11-18 Nathan Sidwell <nathan@acm.org>
330
331 * files.c (struct _cpp_file): Add header_unit field.
332 (_cpp_stack_file): Add header unit support.
333 (cpp_find_header_unit): New.
334 * include/cpplib.h (cpp_find_header_unit): Declare.
335
3362020-11-18 Nathan Sidwell <nathan@acm.org>
337
338 * include/cpplib.h (struct cpp_options): Add modules to
339 dep-options.
340 * include/mkdeps.h (deps_add_module_target): Declare.
341 (deps_add_module_dep): Declare.
342 * mkdeps.c (class mkdeps): Add modules, module_name, cmi_name,
343 is_header_unit fields. Adjust cdtors.
344 (deps_add_module_target, deps_add_module_dep): New.
345 (make_write): Write module dependencies, if enabled.
346
4dabb037
GA
3472020-11-17 Nathan Sidwell <nathan@acm.org>
348
349 * include/cpplib.h (struct cpp_callbacks): Add
350 user_deferred_macro & translate_include.
351
3522020-11-17 Nathan Sidwell <nathan@acm.org>
353
354 * include/line-map.h (enum lc_reason): Add LC_MODULE.
355 (MAP_MODULE_P): New.
356 (line_map_new_raw): Declare.
357 (linemap_enter_macro): Move declaration from internal.h
358 (linemap_module_loc, linemap_module_reparent)
359 (linemap_module_restore): Declare.
360 (linemap_lookup_macro_indec): Declare.
361 * internal.h (linemap_enter_macro): Moved to line-map.h.
362 * line-map.c (linemap_new_raw): New, broken out of ...
363 (new_linemap): ... here. Call it.
364 (LAST_SOURCE_LINE_LOCATION): New.
365 (liemap_module_loc, linemap_module_reparent)
366 (linemap_module_restore): New.
367 (linemap_lookup_macro_index): New, broken out of ...
368 (linemap_macro_map_lookup): ... here. Call it.
369 (linemap_dump): Add module dump.
370
3712020-11-17 Nathan Sidwell <nathan@acm.org>
372
373 PR preprocessor/97858
374 * mkdeps.c (munge): Drop varadic args, we only ever use one.
375
77f67db2
GA
3762020-11-13 Joseph Myers <joseph@codesourcery.com>
377
378 * expr.c (cpp_classify_number): Update diagnostic for binary
379 constants for C. Also diagnose binary constants for
380 -Wc11-c2x-compat.
381 * init.c (lang_defaults): Enable binary constants for GNUC2X and
382 STDC2X.
383
3842020-11-13 Piotr H. Dabrowski <phd@phd.re>
385
386 PR c++/91318
387 * include/cpplib.h: Added cpp_define_unused(), cpp_define_formatted_unused()
388 * directives.c: Likewise.
389
a5a11525
GA
3902020-11-12 Joseph Myers <joseph@codesourcery.com>
391
392 * include/cpplib.h (struct cpp_callbacks): Add bool argument to
393 has_attribute.
394 (enum cpp_builtin_type): Add BT_HAS_STD_ATTRIBUTE.
395 * init.c (builtin_array): Add __has_c_attribute.
396 (cpp_init_special_builtins): Handle BT_HAS_STD_ATTRIBUTE.
397 * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_STD_ATTRIBUTE.
398 Update call to has_attribute for BT_HAS_ATTRIBUTE.
399 * traditional.c (fun_like_macro): Handle BT_HAS_STD_ATTRIBUTE.
400
4012020-11-12 Nicholas Guriev <guriev-ns@ya.ru>
402
403 PR pch/86674
404 * files.c (_cpp_find_file): Use CPP_DL_NOTE not CPP_DL_ERROR in call to
405 cpp_error.
406
2da7ee05
GA
4072020-11-07 Lewis Hyatt <lhyatt@gmail.com>
408
409 * generated_cpp_wcwidth.h: Regenerated from Unicode 13.0.0 data.
410
44cab2d8
GA
4112020-11-06 Nathan Sidwell <nathan@acm.org>
412
413 * include/cpplib.h (enum class CPP_time_kind): New.
414 (cpp_get_date): Declare.
415 * internal.h (struct cpp_reader): Replace source_date_epoch with
416 time_stamp and time_stamp_kind.
417 * init.c (cpp_create_reader): Initialize them.
418 * macro.c (_cpp_builtin_macro_text): Use cpp_get_date.
419 (cpp_get_date): Broken out from _cpp_builtin_macro_text and
420 genericized.
421
fd2325ea
GA
4222020-11-03 Nathan Sidwell <nathan@acm.org>
423
424 * lex.c (cpp_peek_token): Do not peek past CPP_PRAGMA.
425 (_cpp_lex_direct): Handle EOF in pragma when setting need_line,
426 not when needing a line.
427
4282020-11-03 Nathan Sidwell <nathan@acm.org>
429
430 * lex.c (_cpp_clean_line): Fix DOS off-by-one error.
431
4322020-11-03 Nathan Sidwell <nathan@acm.org>
433
434 * init.c (cpp_read_main_file): Use cpp_get_deps result.
435
4362020-11-03 Nathan Sidwell <nathan@acm.org>
437
438 * include/mkdeps.h: Include cpplib.h
439 (deps_write): Adjust first parm type.
440 * mkdeps.c: Include internal.h
441 (make_write): Adjust first parm type. Check phony option
442 directly.
443 (deps_write): Adjust first parm type.
444 * init.c (cpp_read_main_file): Use get_deps.
445 * directives.c (cpp_get_deps): Check option before initializing.
446
88ce3d5f
GA
4472020-11-02 Nathan Sidwell <nathan@acm.org>
448
449 * internal.h (_cpp_notify_macro_use): Add location parm.
450 (_cpp_maybe_notify_macro_use): Likewise.
451 * directives.c (_cpp_do_file_change): Check we've not changed file
452 when optimizing a rewind.
453 (do_ifdef): Pass location to _cpp_maybe_notify_macro_use.
454 (do_ifndef): Likewise. Delete obsolete comment about powerpc.
455 * expr.c (parse_defined): Pass location to
456 _cpp_maybe_notify_macro_use.
457 * macro.c (enter_macro_context): Likewise.
458 (warn_of_redefinition): Break out helper function. Call it.
459 (compare_macros): New function broken out of warn_of_redefinition.
460 (_cpp_new_macro): Zero all fields.
461 (_cpp_notify_macro_use): Add location parameter.
462
e2e04288
GA
4632020-10-20 Nathan Sidwell <nathan@acm.org>
464
465 * lex.c (_cpp_lex_direct): Do not complete EOF processing when
466 parsing_args.
467 * macro.c (collect_args): Do not unwind fake EOF.
468 (funlike_invocation_p): Do not unwind fake EOF.
469 (cpp_context): Replace abort with gcc_assert.
470
970d683f
GA
4712020-10-19 Nathan Sidwell <nathan@acm.org>
472
473 * internal.h (struct cpp_reader): Rename 'eof' field to 'endarg'.
474 * init.c (cpp_create_reader): Adjust.
475 * macro.c (collect_args): Use endarg for separator. Always rewind
476 in the not-fn case.
477
da9df699
GA
4782020-10-08 Nathan Sidwell <nathan@acm.org>
479
480 * internal.h (enum include_type): Rename IT_MAIN_INJECT to
481 IT_PRE_MAIN.
482 * init.c (cpp_read_main_file): If there is no line marker, adjust
483 the initial line marker.
484 (read_original_filename): Return bool, peek the buffer directly
485 before trying to tokenize.
486 (read_original_directory): Likewise. Directly prod the string
487 literal.
488 * files.c (_cpp_stack_file): Adjust for IT_PRE_MAIN change.
489
91dd4a38
GA
4902020-09-26 Jakub Jelinek <jakub@redhat.com>
491
492 PR bootstrap/97163
493 * lex.c (search_line_fast): Only use _ARCH_PWR8 Altivec version
494 for GCC >= 4.5.
495
2aad20c0
GA
4962020-09-17 Patrick Palka <ppalka@redhat.com>
497
498 PR c/80076
499 * include/line-map.h (first_map_in_common): Declare.
500 * line-map.c (first_map_in_common): Remove static.
501
a995c40d
GA
5022020-09-07 Martin Storsjö <martin@martin.st>
503
504 * files.c (remap_filename): Make a strchr return value pointer
505 to const.
506
d48cca8f
GA
5072020-07-30 H.J. Lu <hjl.tools@gmail.com>
508
509 PR bootstrap/96202
510 * configure: Regenerated.
511
bea7a391
GA
5122020-07-29 Tiziano Müller <tiziano.mueller@chem.uzh.ch>
513
514 * init.c (builtin_array): Add xref comment.
515 * traditional.c (fun_like_macro): Add HAS_INCLUDE codes.
516
7ebb7d0c
GA
5172020-07-28 Jakub Jelinek <jakub@redhat.com>
518
519 PR preprocessor/96323
520 * lex.c (lex_raw_string): For c == '\n' don't continue after reporting
521 an prefix delimiter error.
522
5232020-07-28 Nathan Sidwell <nathan@acm.org>
524
525 * init.c (cpp_read_main_file): Always use the last map for
526 the return value.
527
0933f508
GA
5282020-07-20 Nathan Sidwell <nathan@acm.org>
529
530 * line-map.c (linemap_add): Simplify column overflow calculation.
531 Add comment about range and column bit init.
532 (linemap_ordinary_map_lookup): Refactor for RAII
533 (linemap_macro_map_lookup): Likewise.
534
8ca07a30
GA
5352020-07-14 Lewis Hyatt <lhyatt@gmail.com>
536
537 PR preprocessor/49973
538 PR other/86904
539 * include/cpplib.h (struct cpp_options): Removed support for -ftabstop,
540 which is now handled by diagnostic_context.
541 (class cpp_display_width_computation): New class.
542 (cpp_byte_column_to_display_column): Add optional tabstop argument.
543 (cpp_display_width): Likewise.
544 (cpp_display_column_to_byte_column): Likewise.
545 * charset.c
546 (cpp_display_width_computation::cpp_display_width_computation): New
547 function.
548 (cpp_display_width_computation::advance_display_cols): Likewise.
549 (compute_next_display_width): Removed and implemented this
550 functionality in a new function...
551 (cpp_display_width_computation::process_next_codepoint): ...here.
552 (cpp_byte_column_to_display_column): Added tabstop argument.
553 Reimplemented in terms of class cpp_display_width_computation.
554 (cpp_display_column_to_byte_column): Likewise.
555 * init.c (cpp_create_reader): Remove handling of -ftabstop, which is now
556 handled by diagnostic_context.
557
f60ee68d
GA
5582020-07-07 Nathan Sidwell <nathan@acm.org>
559
560 * directives.c (do_linemarker): Optimize rewinding to line zero.
561 * files.c (_cpp_stack_file): Start on line zero when about to inject
562 headers.
563 (cpp_push_include, cpp_push_default_include): Use highest_line as
564 the location.
565 * include/cpplib.h (cpp_read_main_file): Add injecting parm.
566 * init.c (cpp_read_main_file): Likewise, inform _cpp_stack_file.
567 * internal.h (enum include_type): Add IT_MAIN_INJECT.
568
885ef72f
GA
5692020-05-29 H.J. Lu <hjl.tools@gmail.com>
570
571 PR bootstrap/95413
572 * configure: Regenerated.
573
731c4ce0
DE
5742020-05-23 David Edelsohn <dje.gcc@gmail.com>
575
576 * Makefile.in (AR): Substitute @AR@.
577 * configure.ac (CHECK_PROG AR): New.
578 * configure: Regenerate.
579
4623a6f2
NS
5802020-05-20 Nathan Sidwell <nathan@acm.org>
581
582 * internal.h (typedef _cpp_file): Delete, unnecessary in C++.
583 (enum _cpp_find_file_kind): New.
584 (_cpp_find_file): Use it, not 3 bools.
585 * files.c (_cpp_find_file): Use _cpp_find_file_kind enum, not
586 bools.
587 (cpp_make_system_header): Break overly long line.
588 (_cpp_stack_include, _cpp_fake_include)
589 (_cpp_do_file_change, _cpp_compare_file_date, _cpp_has_header): Adjust.
590 * init.c (cpp_read_main): Adjust _cpp_find_file call.
591
a641d6d3
NS
5922020-05-18 Nathan Sidwell <nathan@acm.org>
593
7cf3f604
NS
594 * include/cpplib.h (cpp_get_otions, cpp_get_callbacks)
595 (cpp_get_deps): Mark as PURE.
596 * include/line-map.h (get_combined_adhoc_loc)
597 (get_location_from_adhoc_loc, get_pure_location): Reformat decls.
598 * internal.h (struct lexer_state): Clarify comment.
599 * system.h: Remove now-unneeded bool hackery.
600 * files.c (_cpp_find_file): Store LOC not highest_location.
601
ed63c387
NS
602 PR preprocessor/95149
603 * lex.c (struct lit_accum): New.
604 (bufring_append): Replace by lit_accum::append.
605 (lex_raw_string): Reimplement, using fragments of the old version.
606 (lex_string): Adjust lex_raw_string call.
607
a641d6d3
NS
608 PR preprocessor/95182
609 * macro.c (collect_args): Preserve EOFif we fell out of the main
610 file.
611 (cpp_get_token_1): Reformat a couple of short lines.
612
8d286dd1
L
6132020-05-14 H.J. Lu <hongjiu.lu@intel.com>
614
615 * configure: Regenerated.
616
b04445d4
JM
6172020-05-13 Jason Merrill <jason@redhat.com>
618
619 * include/cpplib.h (enum c_lang): Change CXX2A to CXX20.
620 * init.c, lex.c: Adjust.
621
2a0225e4
NS
6222020-05-12 Nathan Sidwell <nathan@acm.org>
623
624 EOF location is at end of file
625 PR preprocessor/95013
626 * lex.c (lex_raw_string): Process line notes before incrementing.
627 Correct incrementing condition. Adjust for new
628 _cpp_get_fresh_line EOF behaviour.
629 (_cpp_get_fresh_line): Do not pop buffer at EOF, increment line
630 instead.
631 (_cpp_lex_direct): Adjust for new _cpp_get_fresh_line behaviour.
632 (cpp_directive_only_process): Assert we got a fresh line.
633 * traditional.c (_cpp_read_logical_line_trad): Adjust for new
634 _cpp_get_fresh_line behaviour.
635
051da742
L
6362020-05-12 H.J. Lu <hongjiu.lu@intel.com>
637
638 * Makefile.in (CET_HOST_FLAGS): New.
639 (COMPILER): Add $(CET_HOST_FLAGS).
640 * configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and
641 AC_SUBST(CET_HOST_FLAGS). Clear CET_HOST_FLAGS if jit isn't
642 enabled.
643 * aclocal.m4: Regenerated.
644 * configure: Likewise.
645
b224c376
NS
6462020-05-08 Nathan Sidwell <nathan@acm.org>
647
648 Reimplement directives only processing, support raw literals.
649 * directives-only.c: Delete.
650 * Makefile.in (libcpp_a_OBJS, libcpp_a_SOURCES): Remove it.
651 * include/cpplib.h (enum CPP_DO_task): New enum.
652 (cpp_directive_only_preprocess): Declare.
653 * internal.h (_cpp_dir_only_callbacks): Delete.
654 (_cpp_preprocess_dir_only): Delete.
655 * lex.c (do_peek_backslask, do_peek_next, do_peek_prev): New.
656 (cpp_directives_only_process): New implementation.
657
e235031d
JJ
6582020-02-14 Jakub Jelinek <jakub@redhat.com>
659
660 Partially implement P1042R1: __VA_OPT__ wording clarifications
661 PR preprocessor/92319
662 * macro.c (expand_arg): Move declarations before vaopt_state
663 definition.
664 (class vaopt_state): Move enum update_type definition earlier. Remove
665 m_allowed member, add m_arg and m_update members.
666 (vaopt_state::vaopt_state): Change last argument from bool any_args
667 to macro_arg *arg, initialize m_arg and m_update instead of m_allowed.
668 (vaopt_state::update): When bumping m_state from 1 to 2 and m_update
669 is ERROR, determine if __VA_ARGS__ expansion has any non-CPP_PADDING
670 tokens and set m_update to INCLUDE if it has any, DROP otherwise.
671 Return m_update instead of m_allowed ? INCLUDE : DROP in m_state >= 2.
672 (replace_args, create_iso_definition): Adjust last argument to
673 vaopt_state ctor.
674
297aa668
MS
6752020-02-05 Martin Sebor <msebor@redhat.com>
676
677 * include/cpplib.h (cpp_builtin_type): Remove trailing comma to
678 avoid pedantic warnings in C++ 98 mode.
679
c04babd9
JJ
6802020-02-04 Jakub Jelinek <jakub@redhat.com>
681
f8d6e448
JJ
682 * macro.c (builtin_has_include): Diagnose __has_include* use outside
683 of preprocessing directives.
684
c04babd9
JJ
685 PR preprocessor/93545
686 * macro.c (cpp_get_token_no_padding): New function.
687 (builtin_has_include): Use it instead of cpp_get_token. Don't check
688 SEEN_EOL.
689
20fa702b
AB
6902020-02-01 Andrew Burgess <andrew.burgess@embecosm.com>
691
692 * configure: Regenerate.
693
3d056cbf
NS
6942020-01-28 Nathan Sidwell <nathan@acm.org>
695
696 PR preprocessor/93452
697 * internal.h (struct spec_nodes): Drop n__has_include{,_next}.
698 * directives.c (lex_macro_node): Don't check __has_include redef.
699 * expr.c (eval_token): Drop __has_include eval.
700 (parse_has_include): Move to ...
701 * macro.c (builtin_has_include): ... here.
702 (_cpp_builtin_macro_text): Eval __has_include{,_next}.
703 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_INCLUDE{,_NEXT}.
704 * init.c (builtin_array): Add them.
705 (cpp_init_builtins): Drop __has_include{,_next} init here ...
706 * pch.c (cpp_read_state): ... and here.
707 * traditional.c (enum ls): Drop has_include states ...
708 (_cpp_scan_out_logical_line): ... and here.
709
e7c26e04
AB
7102020-01-27 Andrew Burgess <andrew.burgess@embecosm.com>
711
712 * configure: Regenerate.
713
a1f6eff2
NS
7142020-01-24 Nathan Sidwell <nathan@acm.org>
715
716 * expr.c (parse_has_include): Remove bogus controlling macro code.
717
ad1a3914
NS
7182020-01-20 Nathan Sidwell <nathan@acm.org>
719
720 PR preprocessor/80005
721 * include/cpplib.h (BT_HAS_ATTRIBUTE): Fix comment.
722 * internal.h (struct lexer_state): Delete in__has_include field.
723 (struct spec_nodes): Rename n__has_include{,_next}__ fields.
724 (_cpp_defined_macro_p): New.
725 (_cpp_find_file): Add has_include parm.
726 * directives.c (lex_macro_node): Combine defined,
727 __has_inline{,_next} checking.
728 (do_ifdef, do_ifndef): Use _cpp_defined_macro_p.
729 (_cpp_init_directives): Refactor.
730 * expr.c (parse_defined): Use _cpp_defined_macro_p.
731 (eval_token): Adjust parse_has_include calls.
732 (parse_has_include): Add OP parameter. Reimplement.
733 * files.c (_cpp_find_file): Add HAS_INCLUDE parm. Use it to
734 inhibit error message.
735 (_cpp_stack_include): Adjust _cpp_find_file call.
736 (_cpp_fake_include, _cpp_compare_file_date): Likewise.
737 (open_file_failed): Remove in__has_include check.
738 (_cpp_has_header): Adjust _cpp_find_file call.
739 * identifiers.c (_cpp_init_hashtable): Don't init
740 __has_include{,_next} here ...
741 * init.c (cpp_init_builtins): ... init them here. Define as
742 macros.
743 (cpp_read_main_file): Adjust _cpp_find_file call.
744 * pch.c (cpp_read_state): Adjust __has_include{,_next} access.
745 * traditional.c (_cpp_scan_out_locgical_line): Likewise.
bf09d886
NS
746
747 PR preprocessor/93306
748 * expr.c (parse_has_include): Refactor. Check skip_eval before
749 looking.
750
4bc1899b
DM
7512020-01-10 David Malcolm <dmalcolm@redhat.com>
752
753 * include/line-map.h (class diagnostic_path): New forward decl.
754 (rich_location::get_path): New accessor.
755 (rich_location::set_path): New function.
756 (rich_location::m_path): New field.
757 * line-map.c (rich_location::rich_location): Initialize m_path.
758
8d9254fc
JJ
7592020-01-01 Jakub Jelinek <jakub@redhat.com>
760
761 Update copyright years.
762
6dd0c820
DM
7632019-12-18 David Malcolm <dmalcolm@redhat.com>
764
765 PR preprocessor/92982
766 * charset.c
767 (cpp_string_location_reader::cpp_string_location_reader): Delete
768 initialization of m_line_table.
769 * include/cpplib.h (cpp_string_location_reader::m_line_table):
770 Delete unused member.
771
937a778e
JJ
7722019-12-14 Jakub Jelinek <jakub@redhat.com>
773
774 PR preprocessor/92919
775 * charset.c (wide_str_to_charconst): If str contains just the
776 NUL terminator, punt quietly.
777
d68f5d45
DM
7782019-12-09 David Malcolm <dmalcolm@redhat.com>
779
780 * include/line-map.h (label_text::label_text): Make private.
781 (label_text::borrow): New.
782 (label_text::take): New.
783 (label_text::take_or_copy): New.
784
ee925640
LH
7852019-12-09 Lewis Hyatt <lhyatt@gmail.com>
786
787 PR preprocessor/49973
788 * generated_cpp_wcwidth.h: New file generated by
789 ../contrib/unicode/gen_wcwidth.py, supports new cpp_wcwidth function.
790 * charset.c (compute_next_display_width): New function to help
791 implement display columns.
792 (cpp_byte_column_to_display_column): Likewise.
793 (cpp_display_column_to_byte_column): Likewise.
794 (cpp_wcwidth): Likewise.
795 * include/cpplib.h (cpp_byte_column_to_display_column): Declare.
796 (cpp_display_column_to_byte_column): Declare.
797 (cpp_wcwidth): Declare.
798 (cpp_display_width): New function.
799
7c5890cc
JM
8002019-11-14 Joseph Myers <joseph@codesourcery.com>
801
802 * charset.c (narrow_str_to_charconst): Make CPP_UTF8CHAR constants
803 unsigned for C.
804 * init.c (lang_defaults): Set utf8_char_literals for GNUC2X and
805 STDC2X.
806
2c03d736
JJ
8072019-11-07 Jakub Jelinek <jakub@redhat.com>
808
809 PR c++/91370 - Implement P1041R4 and P1139R2 - Stronger Unicode reqs
810 * charset.c (narrow_str_to_charconst): Add TYPE argument. For
811 CPP_UTF8CHAR diagnose whenever number of chars is > 1, using
812 CPP_DL_ERROR instead of CPP_DL_WARNING.
813 (wide_str_to_charconst): For CPP_CHAR16 or CPP_CHAR32, use
814 CPP_DL_ERROR instead of CPP_DL_WARNING when multiple char16_t
815 or char32_t chars are needed.
816 (cpp_interpret_charconst): Adjust narrow_str_to_charconst caller.
817
b7689b96
JM
8182019-11-05 Tim van Deurzen <tim@kompiler.org>
819
820 * cpplib.h: Add spaceship operator for C++.
821 * lex.c: Implement conditional lexing of spaceship operator for C++20.
822
aa23e73b
JJ
8232019-10-31 Jakub Jelinek <jakub@redhat.com>
824
825 PR preprocessor/92296
826 * internal.h (struct def_pragma_macro): Add is_builtin bitfield.
827 (_cpp_restore_special_builtin): Declare.
828 * init.c (_cpp_restore_special_builtin): New function.
829 * directives.c (do_pragma_push_macro): For NT_BUILTIN_MACRO
830 set is_builtin and don't try to grab definition.
831 (cpp_pop_definition): Use _cpp_restore_special_builtin to restore
832 builtin macros.
833
9158f0ba
NS
8342019-10-15 Nathan Sidwell <nathan@acm.org>
835
836 * include/line-map.h (struct maps_info_ordinary): Make cache
837 mutable.
838 (struct maps_info_macro): Likewise.
839 (LINEMAPS_CACHE): Remove non-ref accessor. Constify ref accessor.
840 (LINEMAPS_ORDINARY_CACHE, LINEMAPS_MACRO_CACHE): Likewise.
841 (LINEMAPS_ORDINARY_MAP_AT, LINEMAPS_MACRO_MAP_AT): Use
842 LINEMAPS_USED and LINEMAPS_MAP_AT.
843 (linemap_lookup): Constify line_map arg.
844 linemap.c (linemap_ordinary_map_lookup, linemap_macro_map_lookup):
845 Constify line_map arg.
846
175a85b2
JM
8472019-10-11 Joseph Myers <joseph@codesourcery.com>
848
849 * include/cpplib.h (struct cpp_options): Add dfp_constants and
850 cpp_warn_c11_c2x_compat.
851 (enum cpp_warning_reason): Add CPP_W_C11_C2X_COMPAT.
852 * init.c (struct lang_flags): Add dfp_constants.
853 (lang_defaults): Set dfp_constants to 1 for GNUC2X and STDC2X and
854 0 for other languages.
855 (cpp_set_lang): Set dfp_constants from language.
856 (cpp_create_reader): Set cpp_warn_c11_c2x_compat to -1.
857 * expr.c (interpret_float_suffix): Mention DFP constants as C2X in
858 comment.
859 (cpp_classify_number): Do not diagnose DFP constants for languages
860 setting dfp_constants, unless cpp_warn_c11_c2x_compat.
861
924b9276
NS
8622019-10-04 Nathan Sidwell <nathan@acm.org>
863
864 PR preprocessor/91991
865 * line-map.c (linemap_line_start): Clear max_column_hint if we run
866 out of locations.
867
68710ac7
RB
8682019-10-02 Richard Biener <rguenther@suse.de>
869
870 * internal.h (enum include_type): Remove trailing comma.
871
93313b94
JM
8722019-10-02 Joseph Myers <joseph@codesourcery.com>
873
874 * include/cpplib.h (struct cpp_options): Add member scope.
875 * init.c (struct lang_flags, lang_defaults): Likewise.
876 (cpp_set_lang): Set scope member of pfile.
877 * lex.c (_cpp_lex_direct): Test CPP_OPTION (pfile, scope) not
878 CPP_OPTION (pfile, cplusplus) for creating CPP_SCOPE tokens.
879
0900e29c
EB
8802019-09-26 Eric Botcazou <ebotcazou@adacore.com>
881
882 * charset.c (UCS_LIMIT): New macro.
883 (ucn_valid_in_identifier): Use it instead of a hardcoded constant.
884 (_cpp_valid_ucn): Issue a pedantic warning for UCNs larger than
885 UCS_LIMIT outside of identifiers in C and in C++2a or later.
886
7d112d66
LH
8872019-09-19 Lewis Hyatt <lhyatt@gmail.com>
888
889 PR c/67224
890 * charset.c (_cpp_valid_utf8): New function to help lex UTF-8 tokens.
891 * internal.h (_cpp_valid_utf8): Declare.
892 * lex.c (forms_identifier_p): Use it to recognize UTF-8 identifiers.
893 (_cpp_lex_direct): Handle UTF-8 in identifiers and CPP_OTHER tokens.
894 Do all work in "default" case to avoid slowing down typical code paths.
895 Also handle $ and UCN in the default case for consistency.
896
400b8274
NS
8972019-08-30 Nathan Sidwell <nathan@acm.org>
898
899 New # semantics for popping to "" name.
900 libcpp/
901 * directives.c (do_linemarker): Popping to "" name means get the
902 name from the include stack..
903
056f95ec
NS
9042019-09-05 Nathan Sidwell <nathan@acm.org>
905
906 PR preprocessor/91639
907 * directives.c (do_include_common): Tell lexer we're a #include.
908 * files.c (_cpp_stack_file): Lexer will have always incremented.
909 * internal.h (struct cpp_context): Extend in_directive's
910 semantics.
911 * lex.c (_cpp_lex_direct): Increment line for final \n when lexing
912 for an ISO #include.
913 * line-map.c (linemap_line_start): Remember if we overflowed.
914
2f2aeda9
UW
9152019-09-03 Ulrich Weigand <uweigand@de.ibm.com>
916
917 * directives.c: Remove references to spu from comments.
918 * expr.c: Likewise.
919
b0d11f1e
NS
9202019-08-29 Nathan Sidwell <nathan@acm.org>
921
922 * internal.h (enum include_type): Add IT_MAIN, IT_DIRECTIVE_HWM,
923 IT_HEADER_HWM.
924 (_cpp_stack_file): Take include_type, not a bool.
925 * files.c (_cpp_find_file): Refactor to not hide an if inside a
926 for conditional.
927 (should_stack_file): Break apart to ...
928 (is_known_idempotent_file, has_unique_contents): ... these.
929 (_cpp_stack_file): Replace IMPORT boolean with include_type enum.
930 Refactor to use new predicates. Do linemap compensation here ...
931 (_cpp_stack_include): ... not here.
932 * init.c (cpp_read_main_file): Pass IT_MAIN to _cpp_stack_file.
933
a0be978a
NS
9342019-08-28 Nathan Sidwell <nathan@acm.org>
935
936 * directives-only.c (_cpp_preprocess_dir_only): Use false, not
937 zero for _cpp_handle_directive call.
938 * directives.c (_cpp_handle_directive): Indented is bool.
939 * files.c (struct _cpp_file): Make bools 1 bit bitfields.
940 * internal.h (enum include_type): Reformat and comment.
941 (struct cpp_buffer): Make flags 1 bit bitfields.
942 (_cpp_handle_directive): Indented is bool.
943
6c1dae73
MS
9442019-07-09 Martin Sebor <msebor@redhat.com>
945
946 * include/line-map.h: Change class-key from class to struct and vice
947 versa to match convention and avoid -Wclass-is-pod and -Wstruct-no-pod.
948 * mkdeps.c: Same.
949
8ba6ea87
ML
9502019-07-03 Martin Liska <mliska@suse.cz>
951
952 * line-map.c (linemap_get_expansion_filename): Remove
953 dead assignemts.
954 * mkdeps.c (make_write): Likewise.
955
1c6ffbab
QZ
9562019-07-02 qing zhao <qing.zhao@oracle.com>
957
958 PR preprocessor/90581
959 * directives.c (do_include_common): Replace CPP_STACK_MAX with
960 CPP_OPTION (pfile, max_include_depth).
961 * include/cpplib.h (struct cpp_options): Add new field
962 max_include_depth.
963 * init.c (cpp_create_reader): Initiate new field max_include_depth.
964 * internal.h: Delete CPP_STACK_MAX.
965
66d7749b
NS
9662019-06-26 Nathan Sidwell <nathan@acm.org>
967
968 PR preprocessor/90927
969 * mkdeps.c (mkdeps::vec::operator[]): Add non-const variant.
970 (deps_add_target): Deal with out of order unquoted targets.
971
3f23e487
AP
9722019-05-19 Andrew Pinski <apinski@marvell.com>
973
974 PR pch/81721
975 * lex.c (cpp_token_val_index <case SPELL_OPERATOR>): If tok->flags
976 has NAMED_OP set, then return CPP_TOKEN_FLD_NODE.
977
19eda56d
ML
9782019-05-14 Martin Liska <mliska@suse.cz>
979
980 PR preprocessor/90382
981 * line-map.c (first_map_in_common_1): Handle ADHOC
982 locations.
983
e6fc8353
ML
9842019-05-14 Martin Liska <mliska@suse.cz>
985
986 PR preprocessor/90382
987 * include/line-map.h (get_data_from_adhoc_loc): Add const to
988 the first argument.
989 (get_location_from_adhoc_loc): Likewise.
990 * line-map.c(get_data_from_adhoc_loc): Add const to
991 the first argument.
992 (get_location_from_adhoc_loc): Likewise.
993 (get_combined_adhoc_loc): Use get_location_from_adhoc_loc
994 (or get_data_from_adhoc_loc).
995 (get_range_from_adhoc_loc): Likewise.
996 (get_pure_location): Likewise.
997 (linemap_position_for_loc_and_offset): Likewise.
998 (linemap_lookup): Likewise.
999 (linemap_ordinary_map_lookup): Likewise.
1000 (linemap_macro_map_lookup): Likewise.
1001 (linemap_get_expansion_line): Likewise.
1002 (linemap_get_expansion_filename): Likewise.
1003 (linemap_location_in_system_header_p): Likewise.
1004 (linemap_location_from_macro_expansion_p): Likewise.
1005 (linemap_macro_loc_to_exp_point): Likewise.
1006 (linemap_resolve_location): Likewise.
1007 (linemap_unwind_toward_expansion): Likewise.
1008 (linemap_unwind_to_first_non_reserved_loc): Likewise.
1009 (linemap_expand_location): Likewise.
1010 (linemap_dump_location): Likewise.
1011
d7b6aee8
NS
10122019-05-07 Nathan Sidwell <nathan@acm.org>
1013
61145d93
NS
1014 * files.c (_cpp_stack_file): Empty filenames aren't dependencies.
1015 * mkdeps.c (deps_add_dep): Assert not empty.
1016
d7b6aee8
NS
1017 * include/mkdeps.h (deps_write): Add PHONY arg.
1018 (deps_phony_targets): Delete.
1019 * init.c (cpp_finish): Just call deps_write.
1020 * mkdeps.c (struct mkdeps): Add local vector class. Reimplement
1021 vector handling.
1022 (munge): Munge to static buffer.
1023 (apply_vpath): Adjust vector handling.
1024 (deps_init, deps_free): Use new, delete.
1025 (deps_add_target): Do not munge here. Record quoting low water mark.
1026 (deps_add_dep): Do not munge here.
1027 (deps_add_vpath): Adjust vector handling.
1028 (make_write_name): New. Munge on demand here.
1029 (make_write_vec): New.
1030 (deps_phony_targets): Delete.
1031 (make_write): New.
1032 (deps_write): Forward to deps_Write.
1033 (deps_save, deps_restore): Adjust vector handling.
1034
b744fc85
NS
10352019-05-06 Nathan Sidwell <nathan@acm.org>
1036
1037 * include/mkdeps.h: Rename struct deps to struct mkdeps.
1038 * mkdeps.c: Likewise.
1039 * include/cpplib.h (cpp_get_deps): Rename return type..
1040 * directives.c (cpp_get_deps): Likewise.
1041 * internal.h (struct cpp_reader): Rename deps field type.
1042
0bf12a52
JW
10432019-04-03 Jonathan Wakely <jwakely@redhat.com>
1044
1045 * files.c (search_path_exhausted): Fix typo in comment.
1046
60448173
ML
10472019-02-26 Martin Liska <mliska@suse.cz>
1048
1049 * symtab.c (ht_dump_statistics): Make
1050 horizontal alignment for statistics.
1051
200a8e1a
DM
10522019-02-20 David Malcolm <dmalcolm@redhat.com>
1053
1054 PR c/89410
1055 * include/line-map.h (linenum_arith_t): New typedef.
1056 (compare): Use it.
1057
a5f87af7
ML
10582019-02-18 Martin Liska <mliska@suse.cz>
1059
1060 PR c++/89383
1061 * line-map.c (linemap_line_start): Use 1UL in order
1062 to not overflow.
1063
a4553534
DM
10642019-02-11 Martin Liska <mliska@suse.cz>
1065
1066 PR lto/88147
1067 * line-map.c (linemap_line_start): Don't reuse the existing line
1068 map if the line offset is sufficiently large to cause overflow
1069 when computing location_t values.
1070
18f5df94
JJ
10712019-01-26 Jakub Jelinek <jakub@redhat.com>
1072
1073 PR preprocessor/88974
1074 * directives.c (SEEN_EOL): Move macro to ...
1075 * internal.h (SEEN_EOL): ... here.
1076 * expr.c (parse_has_include): Don't cpp_get_token if SEEN_EOL ().
1077
a5544970
JJ
10782019-01-01 Jakub Jelinek <jakub@redhat.com>
1079
1080 Update copyright years.
1081
bc65bad2
MG
10822018-11-27 Mike Gulick <mgulick@mathworks.com>
1083
1084 PR preprocessor/83173
1085 * location-example.txt: Update example -fdump-internal-locations
1086 output.
1087
56c79e7f
MG
10882018-11-27 Mike Gulick <mgulick@mathworks.com>
1089
1090 PR preprocessor/83173
1091 * files.c (_cpp_stack_include): Check if
1092 line_table->highest_location is past current line before
1093 decrementing.
1094
620e594b
DM
10952018-11-13 David Malcolm <dmalcolm@redhat.com>
1096
1097 * charset.c: Replace "source_location" with "location_t".
1098 * directives-only.c: Likewise.
1099 * directives.c: Likewise.
1100 * errors.c: Likewise.
1101 * expr.c: Likewise.
1102 * files.c: Likewise.
1103 * include/cpplib.h: Likewise. Rename MAX_SOURCE_LOCATION to
1104 MAX_LOCATION_T.
1105 * include/line-map.h: Likewise.
1106 * init.c: Likewise.
1107 * internal.h: Likewise.
1108 * lex.c: Likewise.
1109 * line-map.c: Likewise.
1110 * location-example.txt: Likewise.
1111 * macro.c: Likewise.
1112 * pch.c: Likewise.
1113 * traditional.c: Likewise.
1114
e9f3803d
HAQ
11152018-11-07 Hafiz Abid Qadeer <abidh@codesourcery.com>
1116
1117 * configure: Regenerated.
1118
546f678c
ML
11192018-11-05 Martin Liska <mliska@suse.cz>
1120
1121 * symtab.c (ht_dump_statistics): Replace %zu with %lu format.
1122
037903cb
ML
11232018-11-05 Martin Liska <mliska@suse.cz>
1124
1125 * symtab.c (ht_dump_statistics): Fix format and
1126 pass missing argument.
1127
46aeb07f
ML
11282018-11-05 Martin Liska <mliska@suse.cz>
1129
1130 * symtab.c (ht_dump_statistics): Make dump conditional
1131 based on alloc_subobject.
1132
22e05272
JM
11332018-10-31 Joseph Myers <joseph@codesourcery.com>
1134
1135 PR bootstrap/82856
1136 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
1137 * aclocal.m4, config.in, configure: Regenerate.
1138
ff65e980
NS
11392018-10-31 Nathan Sidwell <nathan@acm.org>
1140
f3f6029d
NS
1141 * internal.h (struct cpp_reader): Rename forced_token_location_p
1142 to forced_token_location and drop its pointerness.
1143 * include/cpplib.h (cpp_force_token_locations): Take location, not
1144 pointer to one.
1145 * init.c (cpp_create_reader): Adjust.
1146 * lex.c (cpp_read_main_file):
1147
705b0c05
NS
1148 * directives.c (do_include_common): Commonize cleanup path.
1149 (_cpp_pop_buffer): Fix leak.
1150
87bacc2b
NS
1151 * include/line-map.h (IS_ORDINARY_LOC, IS_MACRO_LOC): New
1152 predicates.
1153 (IS_ADHOC_LOC): Move earlier.
1154 (MAP_ORDINARY_P): Use IS_ORDINARY_LOC.
1155 * line-map.c (linemap_location_from_macro_expansion_p): Use
1156 IS_MACRO_LOC.
1157
c9fb347e
NS
1158 * include/cpplib.h (cpp_macro_definition_location): Make inline.
1159 * macro.c (warn_of_redefinition): Fix comments, examine macro
1160 type, use C++ for.
1161 (cpp_macro_definition_location): Don't define here.
1162
43af5ef1
NS
1163 * include/cpplib.h (HT_NODE): Don't cast NODE.
1164 (NODE_LEN, NODE_NAME): Use HT_NODE.
1165
ff65e980
NS
1166 * directives.c (DIRECTIVE_TABLE): Drop historical frequency
1167 comments.
1168 * files.c (_cpp_stack_file): Fix indentation.
1169
9f936c86
JM
11702018-10-17 Joseph Myers <joseph@codesourcery.com>
1171
1172 * include/cpplib.h (enum c_lang): Add CLK_GNUC2X and CLK_STDC2X.
1173 * init.c (lang_defaults): Add GNUC2X and STDC2X entries.
1174 (cpp_init_builtins): Define __STDC_VERSION__ to 202000L for C2X.
1175
954ad112
DM
11762018-10-11 David Malcolm <dmalcolm@redhat.com>
1177
1178 * macro.c (_cpp_arguments_ok): If the argument count is wrong, add
1179 a note showing the definition of the macro.
1180
c1b48b29
NS
11812018-10-11 Nathan Sidwell <nathan@acm.org>
1182
1183 * include/line-map.h (LINEMAPS_MACRO_LOWEST_LOCATION): Fix
1184 off-by-one error.
1185 * line-map.c (linemap_enter_macro): Use RAII. Clear all of the
1186 macro_locations.
1187
c24300ba
DM
11882018-10-09 David Malcolm <dmalcolm@redhat.com>
1189
1190 * charset.c (noop_error_cb): Rename to...
1191 (noop_diagnostic_cb): ...this, converting params to enums.
1192 (cpp_interpret_string_ranges): Update for renaming and enums.
1193 * directives.c (check_eol_1): Convert reason to enum.
1194 (do_diagnostic): Convert code and reason to enum.
1195 (do_error): Use CPP_W_NONE rather than 0.
1196 (do_pragma_dependency): Likewise.
1197 * errors.c (cpp_diagnostic_at): Convert level and reason to enums.
1198 Update for renaming.
1199 (cpp_diagnostic): Convert level and reason to enums.
1200 (cpp_error): Convert level to enum.
1201 (cpp_warning): Convert reason to enums.
1202 (cpp_pedwarning): Likewise.
1203 (cpp_warning_syshdr): Likewise.
1204 (cpp_diagnostic_with_line): Convert level and reason to enums.
1205 Update for renaming.
1206 (cpp_error_with_line): Convert level to enum.
1207 (cpp_warning_with_line): Convert reason to enums.
1208 (cpp_pedwarning_with_line): Likewise.
1209 (cpp_warning_with_line_syshdr): Likewise.
1210 (cpp_error_at): Convert level to enum.
1211 (cpp_errno): Likewise.
1212 (cpp_errno_filename): Likewise.
1213 * include/cpplib.h (enum cpp_diagnostic_level): Name this enum,
1214 and move to before struct cpp_callbacks.
1215 (enum cpp_warning_reason): Likewise.
1216 (cpp_callbacks::diagnostic): Convert params from int to enums.
1217 (cpp_error): Convert int param to enum cpp_diagnostic_level.
1218 (cpp_warning): Convert int param to enum cpp_warning_reason.
1219 (cpp_pedwarning): Likewise.
1220 (cpp_warning_syshdr): Likewise.
1221 (cpp_errno): Convert int param to enum cpp_diagnostic_level.
1222 (cpp_errno_filename): Likewise.
1223 (cpp_error_with_line): Likewise.
1224 (cpp_warning_with_line): Convert int param to enum
1225 cpp_warning_reason.
1226 (cpp_pedwarning_with_line): Likewise.
1227 (cpp_warning_with_line_syshdr): Likewise.
1228 (cpp_error_at): Convert int param to enum cpp_diagnostic_level.
1229 * macro.c (create_iso_definition): Convert int to enum.
1230 (_cpp_create_definition): Likewise.
1231
9c4a4b3c
DM
12322018-09-17 David Malcolm <dmalcolm@redhat.com>
1233
1234 * include/line-map.h (range_label::get_text): Add param
1235 "range_idx".
1236
24c35f68
NS
12372018-08-30 Nathan Sidwell <nathan@acm.org>
1238
1239 * include/line-map.h (enum lc_reason): Comment each member
1240 separately.
1241 (struct line_maps): Fix reallocator comment.
1242
85204e23
DM
12432018-08-27 David Malcolm <dmalcolm@redhat.com>
1244
1245 PR 87091
1246 * include/line-map.h (enum range_display_kind): New enum.
1247 (struct location_range): Replace field "m_show_caret_p" with
1248 "m_range_display_kind", converting from bool to the new enum.
1249 (class rich_location): Add example of line insertion fix-it hint.
1250 (rich_location::add_range): Convert param "show_caret_p" from bool
1251 to enum range_display_kind and rename to "range_display_kind",
1252 giving it a default of SHOW_RANGE_WITHOUT_CARET.
1253 (rich_location::set_range): Likewise, albeit without a default.
1254 * line-map.c (rich_location::rich_location): Update for conversion
1255 of show_caret_p to tri-state enum.
1256 (rich_location::add_range): Likewise.
1257 (rich_location::set_range): Likewise.
1258
cf806c7d
L
12592018-08-24 H.J. Lu <hongjiu.lu@intel.com>
1260
1261 PR bootstrap/86872
1262 * line-map.c (pure_location_p): Return true if linemap_lookup
1263 returns NULL.
1264 (linemap_add): Set start_location to 0 if we run out of line map
1265 space.
1266
3fb558b1
NS
12672018-08-20 Nathan Sidwell <nathan@acm.org>
1268
a5a35247
NS
1269 * include/cpplib.h: Fixup some whitespace.
1270 (cpp_hashnode): Reduce type to 2 bit & flags to 8.
1271
a570d97f
NS
1272 * include/cpplib.h (NODE_BUILTIN, NODE_MACRO_ARG): Delete.
1273 Renumber others.
1274 (enum node_type): Replace NT_MACRO with NT_USER_MACRO,
1275 NT_BUILTIN_MACRO, NT_MACRO_ARG. Delete NT_ASSERTION.
1276 (NTV_MACRO, NTV_ANSWER, NTV_BUILTIN, NTV_ARGUMENT, NTV_NONE):
1277 Delete.
1278 (CPP_HASHNODE_VALUE_IDX): Delete.
1279 (union _cpp_hashnode_value): GTY tag from enum node_type directly.
1280 (struct cpp_hashnode): Adjust GTY desc for value field.
1281 (cpp_user_macro_p, cpp_builtin_macro_p, cpp_macro_p): Adjust.
1282 * directives.c (undefine_macros): Clear value.anwers, adjust flag
1283 clearing.
1284 (_cpp_test_assertion): No need to check NT_ASSERTION.
1285 (do_assert, do_unassert): Likewise.
1286 * init.c (cpp_init_special_builtins): Set type not flags.
1287 * macro.c (struct macro_arg_saved_data): Add type field.
1288 (cpp_get_token_1): Check type not NT_VOID.
1289 (_cpp_free_definition): Adjust flag clearing. Nullify
1290 value.answers.
1291 (_cpp_save_parameter, _cpp_unsave_parameters): Save and restore
1292 type.
1293 (lex_expansion_token): Check type not flags.
1294 (_cpp_create_definition): Set type to NT_USER_MACRO.
1295 (_cpp_notify_macro_use): Adjust type checking.
1296 * pch.c (write_macdef, count_defs, write_defs, cpp_valid_state)
1297 (save_macros): Adjust node type/flag handling.
1298 * traditional.c (_cpp_scan_out_logical_line): Check type not flags.
1299
7692e253
NS
1300 * directives.c (do_undef): Use cpp_macro_p & cpp_builtin_macro_p.
1301 * include/cpplib.h (enum cpp_macro_kind): Remove trailing comma.
1302 (cpp_fun_like_macro_p): Make inline, define.
1303 * macro.c (cpp_define_lazily): Use UCHAR_MAX.
1304 (cpp_fun_like_macro_p): Delete.
1305
abcd1775
NS
1306 * Makefile.in (TAGS_SOURCES): Remove cpp-id-data.h.
1307 * include/cpp-id-data.h: Delete.
1308 * internal.h: Include cpplib.h not cpp-id-data.h.
1309
3fb558b1
NS
1310 * include/cpp-id-data.h (struct answer): Delete.
1311 * include/cpplib.h (struct answer): Don't forward-declare.
1312 (enum cpp_macro_kind): Add cmk_assert.
1313 (struct cpp_macro): Union parms and next assert chain.
1314 (union _cpp_hashnode_value): 'answer' field is cpp_macro.
1315 * directives.c (parse_answer): Convert to use cpp_macro. Return
1316 true on success.
1317 (parse_assertion, find_answer, _cpp_test_assertion, cpp_do_assert)
1318 (cpp_do_unassert): Convert to use cpp_macro.
1319 * macro.c (warn_of_redefinition, _cpp_new_macro)
1320 (check_trad_stringification, cpp_macro_definition): Adjust macro
1321 parm access.
1322 * traditional.c (_cpp_replacement_text_len)
1323 (_cpp_copy_replacement_text, _cpp_create_trad_definition): Likewise.
1324
c5d725c0
NS
13252018-08-17 Nathan Sidwell <nathan@acm.org>
1326
800c0e98
NS
1327 * include/cpplib.h (struct cpp_callbacks): Replace
1328 user_builtin_macro with user_lazy_macro.
1329 (struct cpp_macro): add lazy field.
1330 (enum cpp_builtin_type): Remove BT_FIRST_USER, BT_LAST_USER.
1331 (cpp_define_lazily): Declare.
1332 * macro.c (enter_macro_context) Use _cpp_maybe_notify_macro_use.
1333 (warn_of_redefinition): Use cpp_builtin_macro_p, directly call
1334 user_lazy_macro hook.
1335 (_cpp_new_macro): Clear lazy field.
1336 (cpp_define_lazily): Define.
1337 (_cpp_notify_macro_use): Adjust lazy definition code.
1338 (cpp_macro_definition): No need to do lazy definition here.
1339 * pch.c (write_macdef, save_macros): Likewise.
1340
10f04917
NS
1341 * include/cpplib.h (enum cpp_macro_kind): New.
1342 (struct cpp_macro): Make body trailing array. Add kind field,
1343 delete traditional flag.
1344 * internal.h (_cpp_new_macro): Declare.
1345 (_cpp_reserve_room): New inline.
1346 (_cpp_commit_buf): Declare.
1347 (_cpp_create_trad_definition): Return new macro.
1348 * lex.c (_cpp_commit_buff): New.
1349 * macro.c (macro_real_token_count): Count backwards.
1350 (replace_args): Pointer equality not orderedness.
1351 (_cpp_save_parameter): Use _cpp_reserve_room.
1352 (alloc_expansion_token): Delete.
1353 (lex_expansion_token): Return macro pointer. Use _cpp_reserve_room.
1354 (create_iso_definition): Allocate macro itself. Adjust for
1355 different allocation ordering.
1356 (_cpp_new_macro): New.
1357 (_cpp_create_definition): Adjust for API changes.
1358 * traditional.c (push_replacement_text): Don't set traditional
1359 flag.
1360 (save_replacement_text): Likewise.
1361 (_cpp_create_trad_definition): Allocate macro itself, Adjust for
1362 different allocation ordering.
1363
c5d725c0
NS
1364 * cpp-id-data.h (uchar, UC): Move to internal.h
1365 (struct cpp_macro): Move to cpplib.h.
1366 * internal.h (uchar, UC): From cpp-id-data.h.
1367 * include/cpplib.h (struct cpp_macro): From cpp-id-data.h.
1368
3f6677f4
NS
13692018-08-16 Nathan Sidwell <nathan@acm.org>
1370
729a01f7
NS
1371 * internal.h (_cpp_save_parameter): Take parmno, not macro.
1372 (_cpp_unsave_parameters): Declare.
1373 * macro.c (_cpp_save_parameter): Take parm number, not macro.
1374 Return true on success.
1375 (_cpp_unsave_parameters): New.
1376 (parse_params): Take parm_no and variadic pointers, not macro.
1377 Reimplement parsing logic.
1378 (create_iso_definition): Adjust parse_params changes. Call
1379 _cpp_unsave_parameters here.
1380 (_cpp_create_definition): Don't unsave params here.
1381 * traditional.c (scan_parameters): Take n_param pointer, adjust.
1382 (_cpp_create_trad_definition): Ajust scan_parameters change. Call
1383 _cpp_unsave_parameters.
1384
3f6677f4
NS
1385 * include/cpplib.h (cpp_user_macro_p, cpp_builtin_macro_p)
1386 (cpp_macro_p): New inlines.
1387 * directives.c (do_pragma_poison): Use cpp_macro_p.
1388 (do_ifdef, do_ifndef): Likewise. Use _cpp_maybe_notify_macro_use.
1389 (cpp_pop_definition): Use cpp_macro_p. Move _cpp_free_definition
1390 earlier. Don't zap node directly.
1391 * expr.c (parse_defined): Use _cpp_maybe_notify_macro_use &
1392 cpp_macro_p.
1393 * files.c (should_stack_file): Use cpp_macro_p.
1394 * identifiers.c (cpp_defined): Likewise.
1395 * internal.h (_cpp_mark_macro): Use cpp_user_macro_p.
1396 (_cpp_notify_macro_use): Declare.
1397 (_cpp_maybe_notify_macro_use): New inline.
1398 * lex.c (is_macro): Use cpp_macro_p.
1399 * macro.c (_cpp_warn_if_unused_macro): Use cpp_user_macro_p.
1400 (enter_macro_context): Likewise.
1401 (_cpp_create_definition): Use cpp_builtin_macro_p,
1402 cpp_user_macro_p. Move _cpp_free_definition earlier.
1403 (_cpp_notify_macro_use): New, broken out of multiple call sites.
1404 * traditional.c (fun_like_macro_p): Use cpp_builtin_macro_p.
1405 (maybe_start_funlike, _cpp_scan_out_logical_line)
1406 (push_replacement_text): Likewise.
1407
96e6ae57
DM
14082018-08-15 David Malcolm <dmalcolm@redhat.com>
1409
1410 * include/line-map.h (struct location_range): Add "m_label" field.
1411 (class rich_location): Add description of labels to leading
1412 comment.
1413 (rich_location::rich_location): Add "label" param, defaulting to
1414 NULL.
1415 (rich_location::add_range): Likewise.
1416 (struct label_text): New struct.
1417 (class range_label): New abstract base class.
1418 * line-map.c (rich_location::rich_location): Add "label" param;
1419 use it.
1420 (rich_location::add_range): Likewise.
1421
f10a9135
NS
14222018-08-08 Nathan Sidwell <nathan@acm.org>
1423
1424 Make linemap::included_from a location
1425 libcpp/
1426 * include/line-map.h (struct line_map_ordinary): Replace
1427 included_from map index with included_at source_location.
1428 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Delete.
1429 (LAST_SOURCE_LINE_LOCATION): Delete.
1430 (LAST_SOURCE_LINE, LAST_SOURCE_COLUMN): Delete.
1431 (linemap_included_from): New.
1432 (linemap_included_from_linemap): Declare.
1433 (MAIN_FILE_P): Adjust.
1434 * line-map.c (linemap_included_from_linemap): New.
1435 (lonemap_check_files_exited): Use linemap_included_at.
1436 (linemap_add): Adjust inclusion setting.
1437 (linemap_dump, linemap_dump_location): Adjust.
1438 * directives.c (do_linemarker): Use linemap_included_at.
1439
e81c3c4d
NS
14402018-08-07 Nathan Sidwell <nathan@acm.org>
1441
1442 * line-map.c: (linemap_init): Set default allocator here.
1443 (new_linemap): Rather than here. Refactor allocation logic.
1444
181463c2
DM
14452018-07-20 David Malcolm <dmalcolm@redhat.com>
1446
1447 * include/line-map.h (rich_location::set_range): Remove redundant
1448 line_maps * parameter.
1449 * line-map.c (rich_location::set_range): Likewise.
1450
6f41f92b
BE
14512018-07-18 Bernd Edlinger <bernd.edlinger@hotmail.de>
1452
1453 PR 69558
1454 * macro.c (enter_macro_context): Change the location info for builtin
1455 macros and _Pragma from location of the closing parenthesis to location
1456 of the macro expansion point.
1457
0c86a39d
JJ
14582018-07-17 Jason Franklin <j_fra@fastmail.us>
1459 Jakub Jelinek <jakub@redhat.com>
1460
1461 * lex.c (_cpp_lex_direct): Use CPP_DL_NOTE instead of CPP_DL_PEDWARN,
1462 CPP_DL_WARNING or CPP_DL_ERROR for note that diagnostics for C++ style
1463 comments is reported only once per file and guard those calls on the
1464 preceding cpp_error returning true.
1465
42a98b43
NS
14662018-07-03 Nathan Sidwell <nathan@acm.org>
1467
1468 Reorg line_map data structures for better packing.
1469 * include/line-map.h (enum lc_reason): Add LC_HWM.
1470 (LINE_MAP_MAX_LOCATION): Define here.
1471 (struct line_map): Move reason field to line_map_ordinary. Adjust
1472 GTY tagging.
1473 (struct line_map_ordinary): Reorder fields for less padding.
1474 (struct line_map_macro): Likewise.
1475 (MAP_ORDINARY_P): New.
1476 (linemap_check_ordinary, linemap_check_macro): Adjust.
1477 * line-map.c (LINE_MAP_MAX_SOURCE_LOCATION): Delete.
1478 (new_linemap): Take start_location, not reason. Adjust.
1479 (linemap_add, linemap_enter_macro): Adjust.
1480 (linemap_line_start): Likewise.
1481 (linemap_macro_expansion_map_p): Use MAP_ORDINARY_P.
1482 (linemap_macro_loc_to_spelling_point): Likewise.
1483 (linemap_macro_loc_to_def_point): Likewise.
1484 (linemap_dump): Likewise.
1485
a6b29221
JM
14862018-05-23 Jason Merrill <jason@redhat.com>
1487
1488 * system.h: #include <new> earlier.
1489
b2ff7457
JM
14902018-05-17 Jason Merrill <jason@redhat.com>
1491
1492 * line-map.c (linemap_init): Use placement new.
1493 * system.h: #include <new>.
1494
082284da
DM
14952018-03-14 David Malcolm <dmalcolm@redhat.com>
1496
1497 * include/line-map.h (compare): New function on linenum_type.
1498
b44f8ad8
JW
14992018-02-28 Jonathan Wakely <jwakely@redhat.com>
1500
1501 PR preprocessor/84517
1502 * lex.c (is_macro_not_literal_suffix): New function.
1503 (lex_raw_string, lex_string): Use is_macro_not_literal_suffix to
1504 decide when to issue -Wliteral-suffix warnings.
1505
fe74f9b4
RB
15062018-02-16 Richard Biener <rguenther@suse.de>
1507
1508 PR bootstrap/82939
1509 * line-map.c (linemap_init): Avoid broken value-init when compiling
1510 with GCC 4.2.
1511
60887f8c
JM
15122018-02-15 Jason Merrill <jason@redhat.com>
1513 Jakub Jelinek <jakub@redhat.com>
1514
1515 PR preprocessor/83063 - __VA_OPT__ and ##
1516 PR preprocessor/83708
1517 * macro.c (vaopt_state): Reorder m_last_was_paste before m_state.
1518 (vaopt_state::vaopt_state): Adjust.
1519 (vaopt_state::update_flags): Add BEGIN and END.
1520 (vaopt_state::update): Return them.
1521 (copy_paste_flag): Factor out of replace_args.
1522 (last_token_is): New.
1523 (replace_args): Handle BEGIN and END. Avoid padding there.
1524 (tokens_buff_last_token_ptr): Return NULL if no tokens.
1525
1306a81d
JJ
15262018-01-31 Jakub Jelinek <jakub@redhat.com>
1527
1528 PR preprocessor/69869
1529 * traditional.c (skip_macro_block_comment): Return bool, true if
1530 the macro block comment is unterminated.
1531 (copy_comment): Use return value from skip_macro_block_comment instead
1532 of always false.
1533
53723269
JJ
15342018-01-27 Jakub Jelinek <jakub@redhat.com>
1535
1536 * include/cpplib.h (enum cpp_builtin_type): Change BT_LAST_USER from
1537 BT_FIRST_USER + 31 to BT_FIRST_USER + 63.
1538
7365279f
BK
15392018-01-18 Boris Kolpackov <boris@codesynthesis.com>
1540
92a285c1
ML
1541 PR other/70268
1542 * include/cpplib.h (cpp_callbacks::remap_filename): New callback.
1543 * macro.c (_cpp_builtin_macro_text): Call remap_filename for
1544 __FILE__ and __BASE_FILE__.
7365279f 1545
a3a821c9
KN
15462018-01-10 Kelvin Nilsen <kelvin@gcc.gnu.org>
1547
1548 * lex.c (search_line_fast): Remove illegal coercion of an
1549 unaligned pointer value to vector pointer type and replace with
1550 use of __builtin_vec_vsx_ld () built-in function, which operates
1551 on unaligned pointer values.
1552
85ec4feb
JJ
15532018-01-03 Jakub Jelinek <jakub@redhat.com>
1554
1555 Update copyright years.
1556
35c4515b
MW
15572017-12-20 Michael Weiser <michael.weiser@gmx.de>
1558
1559 PR preprocessor/83492
1560 * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]:
1561 Fix selection of big-endian shift parameters by using
1562 __ARM_BIG_ENDIAN.
1563
c65e18d3
BE
15642017-12-14 Bernd Edlinger <bernd.edlinger@hotmail.de>
1565
1566 * internal.h (maybe_print_line): Change signature.
7365279f 1567
a7b1ce04
JJ
15682017-12-05 Jakub Jelinek <jakub@redhat.com>
1569
1570 PR c++/79228
1571 * expr.c (interpret_float_suffix): Avoid memcmp.
1572 (interpret_int_suffix): Likewise. Don't check for if.
1573
f2b8b8ad
JM
15742017-12-01 Jason Merrill <jason@redhat.com>
1575
1576 PR c++/79228 - extensions hide C++14 complex literal operators
1577 * expr.c (interpret_float_suffix): Ignore 'i' in C++14 and up.
1578 (interpret_int_suffix): Likewise.
1579
6df8934f
DM
15802017-11-28 David Malcolm <dmalcolm@redhat.com>
1581
1582 PR c/82050
1583 * include/line-map.h (LINE_MAP_MAX_COLUMN_NUMBER): Move here.
1584 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): ...from here.
1585 (rich_location::maybe_add_fixit): Reject fix-it hints in which
1586 the start column exceeds the next column.
1587
34b81eb9
EG
15882017-11-20 Eric Gallager <egall@gwmail.gwu.edu>
1589
1590 PR preprocessor/81794
1591 * macro.c (check_trad_stringification): Have warning be controlled
1592 by -Wtraditional.
1593
01ada121
DM
15942017-11-20 David Malcolm <dmalcolm@redhat.com>
1595
1596 PR c++/72786
1597 * include/cpplib.h (cpp_macro_definition_location): New decl.
1598 * macro.c (cpp_macro_definition): New function.
1599
fb771b9d
TT
16002017-11-13 Tom Tromey <tom@tromey.com>
1601
1602 * pch.c (cpp_read_state): Set n__VA_OPT__.
1603 * macro.c (vaopt_state): New class.
1604 (_cpp_arguments_ok): Check va_opt flag.
1605 (replace_args, create_iso_definition): Use vaopt_state.
1606 * lex.c (lex_identifier_intern): Possibly issue errors for
1607 __VA_OPT__.
1608 (lex_identifier): Likewise.
1609 (maybe_va_opt_error): New function.
1610 * internal.h (struct lexer_state) <va_args_ok>: Update comment.
1611 (struct spec_nodes) <n__VA_OPT__>: New field.
1612 * init.c (struct lang_flags) <va_opt>: New field.
1613 (lang_defaults): Add entries for C++2A. Update all entries for
1614 va_opt.
1615 (cpp_set_lang): Initialize va_opt.
1616 * include/cpplib.h (struct cpp_options) <va_opt>: New field.
1617 * identifiers.c (_cpp_init_hashtable): Initialize n__VA_OPT__.
1618
846b84fb
DM
16192017-11-13 David Malcolm <dmalcolm@redhat.com>
1620
1621 * include/line-map.h (linenum_type): Move this typedef and the
1622 comment describing column numbering to near the top of the file.
1623
7d19c460
MK
16242017-11-06 Mukesh Kapoor <mukesh.kapoor@oracle.com>
1625
1626 PR c++/80955
1627 * lex.c (lex_string): When checking for a valid macro for the
1628 warning related to -Wliteral-suffix (CPP_W_LITERAL_SUFFIX),
1629 check that the macro name does not start with an underscore
1630 before calling is_macro().
1631
c830c7d5
TV
16322017-11-05 Tom de Vries <tom@codesourcery.com>
1633
1634 PR other/82784
1635 * lex.c (BUF_APPEND): Remove semicolon after
1636 "do {} while (0)".
1637
64a5912c
DM
16382017-10-31 David Malcolm <dmalcolm@redhat.com>
1639
1640 * directives.c (_cpp_handle_directive): Update for renaming of
1641 cpp_error_at_richloc to cpp_error_at.
1642 * errors.c (cpp_diagnostic_at_richloc): Rename to...
1643 (cpp_diagnostic_at): ...this, dropping the location_t-based
1644 implementation.
1645 (cpp_diagnostic): Update for removal of location_t-based
1646 cpp_diagnostic_at.
1647 (cpp_error_at): Likewise.
1648 (cpp_error_at_richloc): Rename to...
1649 (cpp_error_at): ...this, and update for renaming of
1650 cpp_diagnostic_at_richloc.
1651 * include/cpplib.h (cpp_error_at_richloc): Rename to...
1652 (cpp_error_at): ...this.
1653
c76dc9c3
JM
16542017-10-30 Joseph Myers <joseph@codesourcery.com>
1655
1656 * include/cpplib.h (enum c_lang): Add CLK_GNUC17 and CLK_STDC17.
1657 * init.c (lang_defaults): Add GNUC17 and STDC17 data.
1658 (cpp_init_builtins): Handle C17 value of __STDC_VERSION__.
1659
35b82d26
NS
16602017-10-10 Nathan Sidwell <nathan@acm.org>
1661
1662 PR preprocessor/82506
1663 * macro.c (cpp_quote_string): Escape raw LFs.
1664
026a79f7
AS
16652017-09-15 Andrew Sutton <andrew.n.sutton@gmail.com>
1666 Jakub Jelinek <jakub@redhat.com>
1667
1668 Add support for -std=c++2a.
1669 * include/cpplib.h (c_lang): Add CXX2A and GNUCXX2A.
1670 * init.c (lang_defaults): Add rows for CXX2A and GNUCXX2A.
1671 (cpp_init_builtins): Set __cplusplus to 201709L for C++2a.
1672
7b936140
JJ
16732017-09-15 Jakub Jelinek <jakub@redhat.com>
1674
1675 * include/cpplib.h (enum c_lang): Rename CLK_GNUCXX1Z
1676 to CLK_GNUCXX17 and CLK_CXX1Z to CLK_CXX17.
1677 * init.c (lang_defaults, cpp_init_builtins): Likewise.
1678 * expr.c (cpp_classify_number): Use C++17 instead of C++1z
1679 in diagnostics.
1680
738f7c2e
DM
16812017-07-07 David Malcolm <dmalcolm@redhat.com>
1682
1683 PR c++/79300
1684 * line-map.c (linemap_macro_loc_to_def_point): Preserve range
1685 information for macro expansions by delaying resolving ad-hoc
1686 locations until within the loop.
1687
c471c6ed
DM
16882017-07-06 David Malcolm <dmalcolm@redhat.com>
1689
1690 PR c++/79300
1691 * include/line-map.h (enum location_aspect): New enum.
1692 (linemap_client_expand_location_to_spelling_point): Add
1693 enum location_aspect param.
1694 * line-map.c (rich_location::get_expanded_location): Update for
1695 new param of linemap_client_expand_location_to_spelling_point.
1696 (rich_location::maybe_add_fixit): Likewise.
1697 (fixit_hint::affects_line_p): Likewise.
1698
6d522731
JJ
16992017-06-21 Jakub Jelinek <jakub@redhat.com>
1700
1701 * line-map.c (location_adhoc_data_update): Perform addition in
1702 uintptr_t type rather than char * type. Read *data using
1703 ptrdiff_t type instead of int64_t.
1704 (get_combined_adhoc_loc): Change offset type to ptrdiff_t from
1705 int64_t.
1706
c7a980b8
DM
17072017-06-20 David Malcolm <dmalcolm@redhat.com>
1708
1709 * include/line-map.h (class rich_location): Document that attempts
1710 to delete or replace a range *affecting* multiple lines will fail.
1711 * line-map.c (rich_location::maybe_add_fixit): Implement this
1712 restriction.
1713
b09649fd
DM
17142017-06-09 David Malcolm <dmalcolm@redhat.com>
1715
1716 * include/line-map.h
1717 (rich_location::fixits_cannot_be_auto_applied): New method.
1718 (rich_location::fixits_can_be_auto_applied_p): New accessor.
1719 (rich_location::m_fixits_cannot_be_auto_applied): New field.
1720 * line-map.c (rich_location::rich_location): Initialize new field.
1721
05945a1b
DM
17222017-06-05 David Malcolm <dmalcolm@redhat.com>
1723
1724 * include/cpplib.h (struct cpp_callbacks): Add "comment"
1725 callback.
1726 * lex.c (_cpp_lex_direct): Call the comment callback if non-NULL.
1727
ad53f123
DM
17282017-05-02 David Malcolm <dmalcolm@redhat.com>
1729
1730 * include/line-map.h (class rich_location): Update description of
1731 newline handling.
1732 (class fixit_hint): Likewise.
1733 (fixit_hint::ends_with_newline_p): New decl.
1734 * line-map.c (rich_location::maybe_add_fixit): Support newlines
1735 in fix-it hints that are insertions of single lines at the start
1736 of a line. Don't consolidate into such fix-it hints.
1737 (fixit_hint::ends_with_newline_p): New method.
1738
338035aa
DM
17392017-05-01 David Malcolm <dmalcolm@redhat.com>
1740
1741 * include/line-map.h (source_range::intersects_line_p): Delete.
1742 (rich_location::add_fixit): Delete.
1743 (rich_location::maybe_add_fixit): New method.
1744 (class fixit_hint): Reimplement in terms of...
1745 (class fixit_replace): ...this.
1746 (class fixit_insert): Delete.
1747 * line-map.c (linemap_position_for_loc_and_offset): Drop overzealous
1748 linemap_assert_fails.
1749 (source_range::intersects_line_p): Rename to...
1750 (fixit_hint::affects_line_p): New function.
1751 (rich_location::add_fixit_insert_before): Reimplement in terms of
1752 maybe_add_fixit, moving validation there.
1753 (rich_location::add_fixit_insert_after): Likewise.
1754 (column_before_p): Delete.
1755 (rich_location::add_fixit_replace): Reimplement in terms of
1756 maybe_add_fixit, moving validation there. Convert closed input range
1757 to half-open range.
1758 (rich_location::add_fixit): Delete.
1759 (rich_location::maybe_add_fixit): New function.
1760 (fixit_insert::fixit_insert): Delete.
1761 (fixit_insert::~fixit_insert): Delete.
1762 (fixit_insert::affects_line_p): Delete.
1763 (fixit_insert::maybe_append_replace): Delete.
1764 (fixit_replace::fixit_replace): Rename to...
1765 (fixit_hint::fixit_hint): ...this, rewriting as necessary.
1766 (fixit_replace::~fixit_replace): Delete.
1767 (fixit_replace::affects_line_p): Delete.
1768 (fixit_replace::maybe_append_replace): Rename to...
1769 (fixit_hint::maybe_append): ...this, rewriting as necessary.
1770
5764ee3c
JW
17712017-04-03 Jonathan Wakely <jwakely@redhat.com>
1772
1773 * include/line-map.h (LINEMAPS_MACRO_MAPS): Fix typo in comment.
1774 * lex.c (search_line_fast): Likewise.
1775 * pch.h (cpp_valid_state): Likewise.
1776
8c00ae24
AS
17772017-03-21 Andreas Schwab <schwab@suse.de>
1778
1779 * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]:
1780 Convert 64-bit value to boolean before passing to
1781 __builtin_expect.
1782
85e653c9
JM
17832017-03-16 Jason Merrill <jason@redhat.com>
1784
1785 * init.c (cpp_init_builtins): Update __cplusplus for C++17.
1786
e228c50f
GP
17872017-02-09 Gerald Pfeifer <gerald@pfeifer.com>
1788
1789 * Makefile.in (po/$(PACKAGE).pot): Adjust bug reporting URL.
1790
b9f4757f
DM
17912017-01-10 David Malcolm <dmalcolm@redhat.com>
1792
1793 PR c++/77949
1794 * line-map.c (linemap_position_for_column): When calling
1795 linemap_start_line, detect if a new linemap was created with
1796 0 column bits, and bail out early if this is the case.
1797 (linemap_position_for_loc_and_offset): Replace overzealous
1798 linemap_assert_fails with a simple conditional; use correct
1799 bit count.
1800
5ccf1d8d
DM
18012017-01-07 David Malcolm <dmalcolm@redhat.com>
1802
1803 PR c++/72803
1804 * line-map.c (linemap_line_start): When determining if the highest
1805 column given out so far will fit into a proposed change to the
1806 current map, use the effective number of column bits, rather than
1807 the total number of column + range bits.
1808
cbe34bb5
JJ
18092017-01-01 Jakub Jelinek <jakub@redhat.com>
1810
1811 Update copyright years.
1812
a3998c2f
DM
18132016-12-15 David Malcolm <dmalcolm@redhat.com>
1814
1815 PR preprocessor/78680
1816 PR preprocessor/78811
1817 * lex.c (_cpp_lex_direct): Only determine the end-location of
1818 the token and build a range for non-reserved start locations.
1819 Do not do it for EOF tokens.
1820
470a60b2
DM
18212016-12-12 David Malcolm <dmalcolm@redhat.com>
1822
1823 PR preprocessor/78680
1824 * lex.c (_cpp_lex_direct): Ensure line notes are processed before
1825 computing the end-point of the token.
1826
fb2675cb
PB
18272016-11-23 Paolo Bonzini <bonzini@gnu.org>
1828
1829 * include/cpplib.h (struct cpp_options): Add new member
1830 warn_expansion_to_defined.
1831 (CPP_W_EXPANSION_TO_DEFINED): New enum member.
1832 * expr.c (parse_defined): Warn for all uses of "defined"
1833 in macros, and tie warning to CPP_W_EXPANSION_TO_DEFINED.
1834 Make it a pedwarning instead of a warning.
1835 * system.h (HAVE_DESIGNATED_INITIALIZERS): Do not use
1836 "defined" in macros.
1837
b8f56412
DM
18382016-11-17 David Malcolm <dmalcolm@redhat.com>
1839
1840 * charset.c (cpp_interpret_string_1): Skip locations from
1841 loc_reader when advancing 'p' when handling raw strings.
1842
3549e181
JJ
18432016-11-16 Jakub Jelinek <jakub@redhat.com>
1844
1845 PR bootstrap/72823
1846 * configure.ac (ENABLE_ASSERT_CHECKING): Define if gcc configure
1847 would define that macro.
1848 * configure: Regenerated.
1849 * config.in: Regenerated.
1850
a6ac871c
RE
18512016-11-08 Richard Earnshaw <rearnsha@arm.com>
1852
1853 * lex.c (search_line_fast): New implementation for AArch64.
1854
f5ea989d
DM
18552016-10-25 David Malcolm <dmalcolm@redhat.com>
1856
1857 * files.c (destroy_cpp_file): Free file->path.
1858
2be1b796
DM
18592016-10-25 David Malcolm <dmalcolm@redhat.com>
1860
1861 * include/line-map.h (line_maps::~line_maps): New dtor.
1862 (location_adhoc_data_fini): Delete decl.
1863 * line-map.c (line_maps::~line_maps): New dtor.
1864 (location_adhoc_data_fini): Delete.
1865
58f30963
AP
18662016-10-21 Andris Pavenis <andris.pavenis@iki.fi>
1867
1868 PR preprocessor/71681
1869 * files.c (remap_filename): Fix handling -remap in subdirectories.
1870
70f6d5e1
JJ
18712016-10-12 Jakub Jelinek <jakub@redhat.com>
1872
1873 * include/cpplib.h (struct cpp_options): Add
1874 cpp_warn_implicit_fallthrough.
1875 * init.c (cpp_create_reader): Initialize it to 0.
1876 * lex.c (fallthrough_comment_p): Handle different
1877 cpp_warn_implicit_fallthrough levels. Whitespace fixes.
1878
7bad794a
JJ
18792016-10-08 Jakub Jelinek <jakub@redhat.com>
1880
ee19ef45
JJ
1881 * lex.c (fallthrough_comment_p): Accept Else, fallthrough.
1882
81b02905
JJ
1883 * lex.c (fallthrough_comment_p): Extend to handle more common FALLTHRU
1884 comment styles.
1885
7bad794a
JJ
1886 * lex.c (fallthrough_comment_p): Fix off-by-one size comparison
1887 errors, cleanup.
1888 (_cpp_lex_direct): Allow arbitrary comments in between
1889 fallthrough_comment_p comment and following token.
1890
67ef83c6
KN
18912016-10-04 Kelvin Nilsen <kelvin@gcc.gnu.org>
1892
1893 PR target/77847
1894 * lex.c (search_line_fast): Add a FALLTHROUGH comment to correct
1895 compiler error in the version of this function that is
1896 conditionally compiled when GCC_VERSION >= 4005 and both
1897 __ALTIVEC__ and __BIG_ENDIAN__ symbols are defined.
1898
81fea426
MP
18992016-09-26 Marek Polacek <polacek@redhat.com>
1900 Jakub Jelinek <jakub@redhat.com>
1901
1902 PR c/7652
1903 * include/cpplib.h (PREV_FALLTHROUGH): Define.
1904 * internal.h (CPP_FALLTHRU): Define.
1905 * lex.c (fallthrough_comment_p): New function.
1906 (_cpp_lex_direct): Set PREV_FALLTHROUGH on tokens succeeding a falls
1907 through comment.
1908
bbd6fcf3
DM
19092016-09-23 David Malcolm <dmalcolm@redhat.com>
1910
1911 PR preprocessor/77672
1912 * charset.c (cpp_interpret_string_1): Add a source_range for the
1913 NUL-terminator, using the location of the trailing quote of the
1914 final string.
1915
63cb3926
JM
19162016-09-21 Jason Merrill <jason@redhat.com>
1917
1918 * line-map.c (linemap_location_from_macro_definition_p): New.
1919 * line-map.h: Declare it.
1920
31316208
DM
19212016-09-15 David Malcolm <dmalcolm@redhat.com>
1922
1923 * include/line-map.h (class rich_location): Note that newlines
1924 aren't supported in fix-it text.
1925 * line-map.c (rich_location::add_fixit_insert_before): Reject
1926 attempts to add fix-its containing newlines.
1927 (rich_location::add_fixit_replace): Likewise.
1928
254830ba
DM
19292016-09-13 David Malcolm <dmalcolm@redhat.com>
1930
1931 * include/line-map.h (class rich_location): Add description of
1932 fix-it hints to leading comment.
1933 (rich_location::add_fixit_insert): Rename both overloaded methods
1934 to..
1935 (rich_location::add_fixit_insert_before): ...this, updating their
1936 comments.
1937 (rich_location::add_fixit_insert_after): Two new overloaded
1938 methods.
1939 (rich_location::stop_supporting_fixits): New method.
1940 * line-map.c (rich_location::add_fixit_insert): Rename both
1941 overloaded methods to..
1942 (rich_location::add_fixit_insert_before): ...this, updating their
1943 comments.
1944 (rich_location::add_fixit_insert_after): Two new methods.
1945 (rich_location::reject_impossible_fixit): Split out
1946 failure-handling into...
1947 (rich_location::stop_supporting_fixits): New method.
1948
c65236d6
DM
19492016-09-02 David Malcolm <dmalcolm@redhat.com>
1950
1951 * include/line-map.h (rich_location::seen_impossible_fixit_p): New
1952 accessor.
1953
3d4f9f87
DM
19542016-08-31 David Malcolm <dmalcolm@redhat.com>
1955
1956 * include/line-map.h (class fixit_remove): Remove stray decl.
1957 (fixit_hint::affects_line_p): Make const.
1958 (fixit_insert::affects_line_p): Likewise.
1959 (fixit_replace::affects_line_p): Likewise.
1960 * line-map.c (fixit_insert::affects_line_p): Likewise.
1961 (fixit_replace::affects_line_p): Likewise.
1962
b816477a
DM
19632016-08-30 David Malcolm <dmalcolm@redhat.com>
1964
1965 * include/line-map.h (class semi_embedded_vec): New class.
1966 (semi_embedded_vec<T, NUM_EMBEDDED>::semi_embedded_vec): New ctor.
1967 (semi_embedded_vec<T, NUM_EMBEDDED>::~semi_embedded_vec): New
1968 dtor.
1969 (semi_embedded_vec<T, NUM_EMBEDDED>::operator[]): New methods.
1970 (semi_embedded_vec<T, NUM_EMBEDDED>::push): New method.
1971 (semi_embedded_vec<T, NUM_EMBEDDED>::truncate): New method.
1972 (rich_location::get_num_locations): Reimplement in terms of
1973 m_ranges.
1974 (rich_location::get_range): Make non-inline.
1975 (rich_location::get_num_fixit_hints): Reimplement in terms of
1976 m_fixit_hints.
1977 (rich_location::add_fixit): New function.
1978 (rich_location::MAX_RANGES): Rename to...
1979 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this.
1980 (rich_location::MAX_FIXIT_HINTS): Rename to...
1981 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this, and make
1982 private.
1983 (rich_location::m_num_ranges): Eliminate in favor of...
1984 (rich_location::m_ranges): ...this, converting from a fixed-size
1985 array to a semi_embedded_vec.
1986 (rich_location::m_num_fixit_hints): Eliminate in favor of...
1987 (rich_location::m_fixit_hints): ...this, converting from a
1988 fixed-size array to a semi_embedded_vec.
1989 * line-map.c (rich_location::rich_location): Update for above
1990 changes.
1991 (rich_location::~rich_location): Likewise.
1992 (rich_location::get_loc): Likewise.
1993 (rich_location::get_range): New methods.
1994 (rich_location::add_range): Update for above changes.
1995 (rich_location::set_range): Likewise.
1996 (rich_location::add_fixit_insert): Likewise.
1997 (rich_location::add_fixit_replace): Likewise.
1998 (rich_location::get_last_fixit_hint): Likewise.
1999 (rich_location::reject_impossible_fixit): Likewise.
2000 (rich_location::add_fixit): New method.
2001
f9087798
DM
20022016-08-30 David Malcolm <dmalcolm@redhat.com>
2003
2004 * include/line-map.h (rich_location::add_fixit_insert): Add
2005 comments. Add overload omitting the source_location param.
2006 (rich_location::add_fixit_remove): Add comments. Add overloads
2007 omitting the range, and accepting a source_location.
2008 (rich_location::add_fixit_replace): Likewise.
2009 * line-map.c (rich_location::add_fixit_insert): Add comments. Add
2010 overload omitting the source_location param.
2011 (rich_location::add_fixit_remove): Add comments. Add overloads
2012 omitting the range, and accepting a source_location.
2013 (rich_location::add_fixit_replace): Likewise.
2014
2aa51413
DM
20152016-08-26 David Malcolm <dmalcolm@redhat.com>
2016
2017 * include/line-map.h (get_pure_location): New decl.
2018 * line-map.c (get_pure_location): Move here, from gcc/input.c, adding
2019 a line_maps * param.
2020 (rich_location::add_fixit_insert): Call get_pure_location on "where".
2021 (rich_location::add_fixit_replace): Call get_pure_location on the
2022 end-points.
2023
ee908516
DM
20242016-08-26 David Malcolm <dmalcolm@redhat.com>
2025
2026 * include/line-map.h (rich_location): Eliminate unimplemented
2027 constructor based on source_range.
2028 (rich_location::get_last_fixit_hint): New method.
2029 (rich_location::reject_impossible_fixit): New method.
2030 (rich_location): Add fields m_line_table and
2031 m_seen_impossible_fixit.
2032 (fixit_hint::maybe_append_replace): New pure virtual function.
2033 (fixit_insert::maybe_append_replace): New function.
2034 (fixit_replace::maybe_append_replace): New function.
2035 * line-map.c (rich_location::rich_location): Initialize
2036 m_line_table and m_seen_impossible_fixit.
2037 (rich_location::add_fixit_insert): Call
2038 reject_impossible_fixit and bail out if true.
2039 (column_before_p): New function.
2040 (rich_location::add_fixit_replace): Call reject_impossible_fixit
2041 and bail out if true. Attempt to consolidate with neighboring
2042 fixits.
2043 (rich_location::get_last_fixit_hint): New method.
2044 (rich_location::reject_impossible_fixit): New method.
2045 (fixit_insert::maybe_append_replace): New method.
2046 (fixit_replace::maybe_append_replace): New method.
2047
d672cded
DM
20482016-08-23 David Malcolm <dmalcolm@redhat.com>
2049
2050 * include/line-map.h (source_range::from_locations): New method.
2051
2ffe0809
DM
20522016-08-19 David Malcolm <dmalcolm@redhat.com>
2053
2054 * include/line-map.h (fixit_hint::kind): Delete REPLACE.
2055 (class fixit_remove): Delete.
2056 * line-map.c (rich_location::add_fixit_remove): Reimplement
2057 by calling add_fixit_replace with an empty string.
2058 (fixit_remove::fixit_remove): Delete.
2059 (fixit_remove::affects_line_p): Delete.
2060
c65699ef
JM
20612016-08-19 Joseph Myers <joseph@codesourcery.com>
2062
2063 PR c/32187
2064 * include/cpplib.h (CPP_N_FLOATN, CPP_N_FLOATNX)
2065 (CPP_N_WIDTH_FLOATN_NX, CPP_FLOATN_SHIFT, CPP_FLOATN_MAX): New
2066 macros.
2067 * expr.c (interpret_float_suffix): Handle fN, fNx, FN and FNx
2068 suffixes.
2069
fcf830ab
PK
20702016-08-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
2071
2072 * expr.c (eval_token): Append "evaluates to 0" to Wundef diagnostic.
2073
cb18fd07
DM
20742016-08-18 David Malcolm <dmalcolm@redhat.com>
2075
2076 * directives.c (directive_names): New array.
2077 (_cpp_handle_directive): Offer spelling suggestions for misspelled
2078 directives.
2079 * errors.c (cpp_diagnostic_at_richloc): New function.
2080 (cpp_error_at_richloc): New function.
2081 * include/cpplib.h (struct cpp_callbacks): Add field
2082 "get_suggestion".
2083 (cpp_error_at_richloc): New decl.
2084
9c62c873
MP
20852016-08-18 Marek Polacek <polacek@redhat.com>
2086
2087 PR c/7652
2088 * pch.c (write_macdef): Add CPP_FALLTHRU.
2089
191816a3
MP
20902016-08-12 Marek Polacek <polacek@redhat.com>
2091
2092 PR c/7652
2093 * lex.c (search_line_fast): Add FALLTHRU.
2094 (_cpp_lex_direct): Likewise.
2095 (cpp_token_val_index): Adjust fall through comment.
2096 * macro.c (parse_params): Add FALLTHRU.
2097 * pch.c (count_defs): Adjust fall through comment.
2098 (write_defs): Likewise.
2099
e7864d68
DM
21002016-08-06 David Malcolm <dmalcolm@redhat.com>
2101
2102 PR bootstrap/72823
2103 * charset.c (_cpp_valid_ucn): Replace overzealous assert with one
2104 that allows for char_range to be non-NULL when loc_reader is NULL.
2105
88fa5555
DM
21062016-08-05 David Malcolm <dmalcolm@redhat.com>
2107
2108 * charset.c (cpp_substring_ranges::cpp_substring_ranges): New
2109 constructor.
2110 (cpp_substring_ranges::~cpp_substring_ranges): New destructor.
2111 (cpp_substring_ranges::add_range): New method.
2112 (cpp_substring_ranges::add_n_ranges): New method.
2113 (_cpp_valid_ucn): Add "char_range" and "loc_reader" params; if
2114 they are non-NULL, read position information from *loc_reader
2115 and update char_range->m_finish accordingly.
2116 (convert_ucn): Add "char_range", "loc_reader", and "ranges"
2117 params. If loc_reader is non-NULL, read location information from
2118 it, and update *ranges accordingly, using char_range.
2119 Conditionalize the conversion into tbuf on tbuf being non-NULL.
2120 (convert_hex): Likewise, conditionalizing the call to
2121 emit_numeric_escape on tbuf.
2122 (convert_oct): Likewise.
2123 (convert_escape): Add params "loc_reader" and "ranges". If
2124 loc_reader is non-NULL, read location information from it, and
2125 update *ranges accordingly. Conditionalize the conversion into
2126 tbuf on tbuf being non-NULL.
2127 (cpp_interpret_string): Rename to...
2128 (cpp_interpret_string_1): ...this, adding params "loc_readers" and
2129 "out". Use "to" to conditionalize the initialization and usage of
2130 "tbuf", such as running the converter. If "loc_readers" is
2131 non-NULL, use the instances within it, reading location
2132 information from them, and passing them to convert_escape; likewise
2133 write to "out" if loc_readers is non-NULL. Check for leading
2134 quote and issue an error if it is not present. Update boundary
2135 check from "== limit" to ">= limit" to protect against erroneous
2136 location values to calls that are not parsing string literals.
2137 (cpp_interpret_string): Reimplement in terms to
2138 cpp_interpret_string_1.
2139 (noop_error_cb): New function.
2140 (cpp_interpret_string_ranges): New function.
2141 (cpp_string_location_reader::cpp_string_location_reader): New
2142 constructor.
2143 (cpp_string_location_reader::get_next): New method.
2144 * include/cpplib.h (class cpp_string_location_reader): New class.
2145 (class cpp_substring_ranges): New class.
2146 (cpp_interpret_string_ranges): New prototype.
2147 * internal.h (_cpp_valid_ucn): Add params "char_range" and
2148 "loc_reader".
2149 * lex.c (forms_identifier_p): Pass NULL for new params to
2150 _cpp_valid_ucn.
2151
8204be6c
AS
21522016-08-01 Andreas Schwab <schwab@suse.de>
2153
2154 * include/cpplib.h: Fix comment typo.
2155
a01fc549
DM
21562016-07-27 David Malcolm <dmalcolm@redhat.com>
2157
2158 * include/line-map.h (source_location): Fix line numbers in
2159 comment.
2160
741d3be5
DM
21612016-07-11 David Malcolm <dmalcolm@redhat.com>
2162
2163 * include/line-map.h (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES):
2164 Move here from line-map.c.
2165 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
2166 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): Move from
2167 here to line-map.h.
2168 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
2169
ac81cf0b
DM
21702016-06-22 David Malcolm <dmalcolm@redhat.com>
2171
2172 * directives.c (do_include_common): Pass on "location" to
2173 _cpp_stack_include.
2174 * errors.c (cpp_diagnostic): Reimplement in terms of...
2175 (cpp_diagnostic_at): New function.
2176 (cpp_error_at): New function.
2177 (cpp_errno_filename): Add "loc" param and use it by using
2178 cpp_error_at rather than cpp_error.
2179 * files.c (find_file_in_dir): Add "loc" param and pass it to
2180 open_file_failed.
2181 (_cpp_find_file): Add "loc" param. Use it to convert calls to
2182 cpp_error to cpp_error_at, and pass it to find_file_in_dir and
2183 open_file_failed.
2184 (read_file_guts): Add "loc" param. Use it to convert calls to
2185 cpp_error to cpp_error_at. Pass it to cpp_errno_filename.
2186 (read_file): Add "loc" param. Pass it to open_file_failed and
2187 read_file_guts.
2188 (should_stack_file): Add "loc" param. Pass it to read_file.
2189 (_cpp_stack_file): Add "loc" param. Pass it to should_stack_file.
2190 (_cpp_stack_include): Add "loc" param. Pass it to
2191 _cpp_find_file and _cpp_stack_file.
2192 (open_file_failed): Add "loc" param. Pass it to
2193 cpp_errno_filename.
2194 (_cpp_fake_include): Add 0 as a source_location in call to
2195 _cpp_find_file.
2196 (_cpp_compare_file_date): Likewise.
2197 (cpp_push_include): Likewise for call to _cpp_stack_include.
2198 (cpp_push_default_include): Likewise.
2199 (_cpp_save_file_entries): Likewise for call to open_file_failed.
2200 (_cpp_has_header): Likewise for call to _cpp_find_file.
2201 * include/cpplib.h (cpp_errno_filename): Add source_location
2202 param.
2203 (cpp_error_at): New declaration.
2204 * init.c (cpp_read_main_file): Add 0 as a source_location in calls
2205 to _cpp_find_file and _cpp_stack_file.
2206 * internal.h (_cpp_find_file): Add source_location param.
2207 (_cpp_stack_file): Likewise.
2208 (_cpp_stack_include): Likewise.
2209
a93eac6a
DM
22102016-06-22 David Malcolm <dmalcolm@redhat.com>
2211
2212 * include/line-map.h (fixit_hint::get_start_loc): New pure virtual
2213 function.
2214 (fixit_hint::maybe_get_end_loc): Likewise.
2215 (fixit_insert::get_start_loc): New function, implementing
2216 fixit_hint::get_start_loc.
2217 (fixit_insert::maybe_get_end_loc): New function, implementing
2218 fixit_hint::maybe_get_end_loc.
2219 (fixit_remove::get_start_loc): New function, implementing
2220 fixit_hint::get_start_loc.
2221 (fixit_remove::maybe_get_end_loc): New function, implementing
2222 fixit_hint::maybe_get_end_loc.
2223 (fixit_replace::get_start_loc): New function, implementing
2224 fixit_hint::get_start_loc.
2225 (fixit_replace::maybe_get_end_loc): New function, implementing
2226 fixit_hint::maybe_get_end_loc.
2227
fe55692c
JDA
22282016-06-21 John David Anglin <danglin@gcc.gnu.org>
2229
2230 * line-map.c (location_adhoc_data_update): Use int64_t instead of
2231 long long.
2232 (get_combined_adhoc_loc): Likewise.
2233
15c98b2e
ES
22342016-06-01 Eduard Sanou <dhole@openmailbox.org>
2235
2236 * include/cpplib.h (cpp_callbacks): Add get_source_date_epoch
2237 callback.
2238 * include/cpplib.h (cpp_init_source_date_epoch): Remove prototype.
2239 * init.c (cpp_init_source_date_epoch): Remove function.
2240 * init.c (cpp_create_reader): Initialize pfile->source_date_epoch.
2241 * internal.h (cpp_reader): Extend comment about source_date_epoch.
2242 * macro.c (_cpp_builtin_macro_text): Use get_source_date_epoch
2243 callback only once, read pfile->source_date_epoch on future passes.
2244 Check that get_source_date_epoch callback is not NULL.
2245
ceb17928
ML
22462016-05-20 Martin Liska <mliska@suse.cz>
2247
2248 * config.in: Regenerated.
2249 * configure: Likewise.
2250 * configure.ac: Handle --enable-valgrind-annotations.
2251 * lex.c (new_buff): Use ENABLE_VALGRIND_ANNOTATIONS instead
2252 of ENABLE_VALGRIND_CHECKING.
2253 (_cpp_free_buff): Likewise.
2254
174f6622
ES
22552016-04-28 Eduard Sanou <dhole@openmailbox.org>
2256 Matthias Klose <doko@debian.org>
2257
2258 * include/cpplib.h (cpp_init_source_date_epoch): Prototype.
2259 * init.c (cpp_init_source_date_epoch): New function.
2260 * internal.h: Added source_date_epoch variable to struct
2261 cpp_reader to store a reproducible date.
7365279f
BK
2262 * macro.c (_cpp_builtin_macro_text): Set pfile->date timestamp from
2263 pfile->source_date_epoch instead of localtime if source_date_epoch is
2264 set, to be used for __DATE__ and __TIME__ macros to help reproducible
174f6622
ES
2265 builds.
2266
12de2245
BS
22672016-04-13 Bernd Schmidt <bschmidt@redhat.com>
2268
2269 Patch from Roger Orr <rogero@howzatt.demon.co.uk>
2270 PR preprocessor/69650
2271 * directives.c (do_linemarker): Reread map after calling
2272 cpp_get_token.
2273
64824205
RH
22742016-04-06 Richard Henderson <rth@redhat.com>
2275
2276 PR preprocessor/61817
2277 PR preprocessor/69391
2278 * internal.h (_cpp_builtin_macro_text): Update decl.
2279 * macro.c (_cpp_builtin_macro_text): Accept location for __LINE__.
2280 (builtin_macro): Accept a second location for __LINE__.
2281 (enter_macro_context): Compute both virtual and real expansion
2282 locations for the macro.
2283
3caf0ca1
BS
22842016-03-25 Bernd Schmidt <bschmidt@redhat.com>
2285
2286 PR lto/69650
2287 * directives.c (do_linemarker): Test for file left but not entered
2288 here.
2289 * line-map.c (linemap_add): Not here.
2290
6b366948
JJ
22912016-03-21 Jakub Jelinek <jakub@redhat.com>
2292
2293 PR target/70296
2294 * include/cpplib.h (cpp_fun_like_macro_p): New prototype.
2295 * macro.c (cpp_fun_like_macro_p): New function.
2296
64567cfd
RH
22972016-03-15 Richard Henderson <rth@redhat.com>
2298
2299 * line-map.c (new_linemap): Make alloc_size a size_t.
2300
2aaeea19
JM
23012016-03-14 Jason Merrill <jason@redhat.com>
2302
2303 * expr.c (cpp_classify_number): Hex floats are new in C++1z.
2304 * init.c (lang_defaults): Likewise.
2305
b4f3232d
DM
23062016-03-09 David Malcolm <dmalcolm@redhat.com>
2307
2308 PR c/68473
2309 PR c++/70105
2310 * line-map.c (linemap_macro_map_loc_unwind_toward_spelling): Move
2311 decl...
2312 * include/line-map.h
2313 (linemap_macro_map_loc_unwind_toward_spelling): ...here,
2314 converting from static to extern.
2315
40499f81
DM
23162016-03-09 David Malcolm <dmalcolm@redhat.com>
2317
2318 PR c/68473
2319 PR c++/70105
2320 * include/line-map.h (source_range::debug): Delete.
2321 (struct location_range): Update comment. Replace
2322 expanded_location fields "m_start", "m_finish", and "m_caret" with
2323 a source_location field: "m_loc".
2324 (class rich_location): Reword comment.
2325 (rich_location::get_loc): Reimplement in terms of a new overloaded
2326 variant which takes an unsigned int.
2327 (rich_location::get_loc_addr): Delete.
2328 (rich_location::add_range): Drop params "start" and "finish" in
2329 favor of param "loc". Drop overloaded variants taking a
2330 source_range or location_range *.
2331 (rich_location::lazily_expand_location): Delete in favor of...
2332 (rich_location::get_expanded_location): New decl.
2333 (rich_location::m_loc): Delete field.
2334 (rich_location::m_column_override): New field.
2335 * line-map.c (rich_location::rich_location): Drop name of
2336 line_maps * param. Update initializations for deletion of field
2337 "m_loc" and addition of field "m_column_override". Reimplement
2338 body as a call to add_range. Delete overloaded variant taking a
2339 source_range.
2340 (rich_location::get_loc): New function.
2341 (rich_location::lazily_expand_location): Delete in favor of...
2342 (rich_location::get_expanded_location): New function.
2343 (rich_location::override_column): Reimplement.
2344 (rich_location::add_range): Drop params "start" and "finish" in
2345 favor of param "loc". Eliminate location expansion in favor of
2346 simply storing loc. Drop overloaded variants taking a
2347 source_range or location_range *.
2348 (rich_location::set_range): Eliminate location expansion.
2349
7168133a
DM
23502016-02-29 David Malcolm <dmalcolm@redhat.com>
2351
2352 PR preprocessor/69985
2353 (linemap_position_for_loc_and_offset): Rename param from "offset"
2354 to "column_offset". Right-shift the column_offset by m_range_bits
2355 of the pertinent ordinary map whenever offsetting a
2356 source_location. For clarity, offset the column by the column
2357 offset, rather than the other way around.
2358
196440f8
DM
23592016-02-23 David Malcolm <dmalcolm@redhat.com>
2360
2361 PR preprocessor/69126
2362 PR preprocessor/69543
2363 * line-map.c (linemap_compare_locations): At the function top,
2364 replace inlined bodies of get_location_from_adhoc_loc with calls
2365 to get_location_from_adhoc_loc. Add a pair of calls to
2366 get_location_from_adhoc_loc at the bottom of the function, to
2367 avoid meaningless comparisons of ad-hoc and non-ad-hoc locations.
2368
44714d8c
DM
23692016-02-08 David Malcolm <dmalcolm@redhat.com>
2370
2371 PR preprocessor/69664
2372 * errors.c (cpp_diagnostic_with_line): Only call
2373 rich_location::override_column if the column is non-zero.
2374 * line-map.c (rich_location::override_column): Update columns
2375 within m_ranges[0]. Add assertions to verify that doing so is
2376 sane.
2377
b5c1c988
JJ
23782016-02-05 Jakub Jelinek <jakub@redhat.com>
2379
2380 PR c++/69628
2381 * charset.c (cpp_interpret_charconst): Clear *PCHARS_SEEN
2382 and *UNSIGNEDP if bailing out early due to errors.
2383
e2eb5056
JJ
23842016-01-28 Jakub Jelinek <jakub@redhat.com>
2385
4bda5946
JJ
2386 PR pch/68176
2387 * files.c (_cpp_find_file): Set file->implicit_preinclude even if
2388 included from file->implicit_preinclude header.
2389
e2eb5056
JJ
2390 * directives.c (destringize_and_run): Adjust prototype.
2391
0afff540
DM
23922016-01-27 David Malcolm <dmalcolm@redhat.com>
2393
2394 PR preprocessor/69126
2395 * directives.c (destringize_and_run): Add expansion_loc param; use
2396 it when handling unexpanded pragmas to fixup the locations of the
2397 synthesized tokens.
2398 (_cpp_do__Pragma): Add expansion_loc param and use it when calling
2399 destringize_and_run.
2400 * internal.h (_cpp_do__Pragma): Add expansion_loc param.
2401 * macro.c (builtin_macro): Pass expansion location of _Pragma to
2402 _cpp_do__Pragma.
2403
c7df95d8
DM
24042016-01-14 David Malcolm <dmalcolm@redhat.com>
2405
2406 PR preprocessor/69177
2407 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): New
2408 constant.
2409 (LINE_MAP_MAX_LOCATION_WITH_COLS): Add note about unit tests
2410 to comment.
2411 (can_be_stored_compactly_p): Reduce threshold from
2412 LINE_MAP_MAX_LOCATION_WITH_COLS to
2413 LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES.
2414 (get_combined_adhoc_loc): Likewise.
2415 (get_range_from_loc): Likewise.
2416 (linemap_line_start): Ensure that a new ordinary map is created
2417 when transitioning from range-packing being enabled to disabled,
2418 at the LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES threshold. Set
2419 range_bits to 0 for new ordinary maps when beyond this limit.
2420 Prevent the "increase the column bits of a freshly created map"
2421 optimization if the range bits has reduced.
2422
53290e07
JJ
24232016-01-08 Jakub Jelinek <jakub@redhat.com>
2424
2425 PR c++/69145
2426 * files.c (cpp_included_before): If IS_ADHOC_LOC (location), lookup
2427 real location from the line_table.
2428
818ab71a
JJ
24292016-01-04 Jakub Jelinek <jakub@redhat.com>
2430
2431 Update copyright years.
2432
329590d7
DM
24332015-12-22 David Malcolm <dmalcolm@redhat.com>
2434
2435 * line-map.c (get_combined_adhoc_loc): Remove condition
2436 on locus < RESERVED_LOCATION_COUNT when considering
2437 whether a caret == start == finish location can be
2438 simply stored as the caret location.
2439
f79520bb
DM
24402015-12-07 David Malcolm <dmalcolm@redhat.com>
2441
2442 * include/line-map.h (rich_location::set_range): Add line_maps *
2443 param; convert param from source_range to source_location. Drop
2444 "overwrite_loc_p" param.
2445 * line-map.c (rich_location::set_range): Likewise, acting as if
2446 "overwrite_loc_p" were true, and getting range from the location.
2447
a87a86e1
DM
24482015-11-20 David Malcolm <dmalcolm@redhat.com>
2449
2450 PR 62314
2451 * include/line-map.h (source_range::intersects_line_p): New
2452 method.
2453 (rich_location::~rich_location): New.
2454 (rich_location::add_fixit_insert): New method.
2455 (rich_location::add_fixit_remove): New method.
2456 (rich_location::add_fixit_replace): New method.
2457 (rich_location::get_num_fixit_hints): New accessor.
2458 (rich_location::get_fixit_hint): New accessor.
2459 (rich_location::MAX_FIXIT_HINTS): New constant.
2460 (rich_location::m_num_fixit_hints): New field.
2461 (rich_location::m_fixit_hints): New field.
2462 (class fixit_hint): New class.
2463 (class fixit_insert): New class.
2464 (class fixit_remove): New class.
2465 (class fixit_replace): New class.
2466 * line-map.c (source_range::intersects_line_p): New method.
2467 (rich_location::rich_location): Add initialization of
2468 m_num_fixit_hints to both ctors.
2469 (rich_location::~rich_location): New.
2470 (rich_location::add_fixit_insert): New method.
2471 (rich_location::add_fixit_remove): New method.
2472 (rich_location::add_fixit_replace): New method.
2473 (fixit_insert::fixit_insert): New.
2474 (fixit_insert::~fixit_insert): New.
2475 (fixit_insert::affects_line_p): New.
2476 (fixit_remove::fixit_remove): New.
2477 (fixit_remove::affects_line_p): New.
2478 (fixit_replace::fixit_replace): New.
2479 (fixit_replace::~fixit_replace): New.
2480 (fixit_replace::affects_line_p): New.
2481
46ce03de
JJ
24822015-11-19 Jakub Jelinek <jakub@redhat.com>
2483
2484 PR preprocessor/60736
2485 * include/cpplib.h (cpp_errno_filename): New prototype.
2486 * errors.c (cpp_errno): Don't handle msgid "" specially, use
2487 _(msgid) instead of msgid as argument to cpp_error.
2488 (cpp_errno_filename): New function.
2489 * files.c (read_file_guts): Use cpp_errno_filename instead of
2490 cpp_errno.
2491 (open_file_failed): Likewise. Use file->name if file->path is NULL
2492 in diagnostics.
2493
ebedc9a3
DM
24942015-11-13 David Malcolm <dmalcolm@redhat.com>
2495
2496 * errors.c (cpp_diagnostic): Pass pfile->line_table to
2497 rich_location ctor.
2498 (cpp_diagnostic_with_line): Likewise.
2499 * include/cpplib.h (struct cpp_token): Update comment for src_loc
2500 to indicate that the range of the token is "baked into" the
2501 source_location.
2502 * include/line-map.h (source_location): Update the descriptive
2503 comment to reflect the packing scheme for short ranges, adding
2504 worked examples of location encoding.
2505 (struct line_map_ordinary): Drop field "column_bits" in favor
2506 of field "m_column_and_range_bits"; add field "m_range_bits".
2507 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
2508 (location_adhoc_data): Add source_range field.
2509 (struct line_maps): Add fields "default_range_bits",
2510 "num_optimized_ranges" and "num_unoptimized_ranges".
2511 (get_combined_adhoc_loc): Add source_range param.
2512 (get_range_from_loc): New declaration.
2513 (pure_location_p): New prototype.
2514 (COMBINE_LOCATION_DATA): Add source_range param.
2515 (SOURCE_LINE): Update for renaming of column_bits.
2516 (SOURCE_COLUMN): Likewise. Shift the column right by the map's
2517 range_bits.
2518 (LAST_SOURCE_LINE_LOCATION): Update for renaming of column_bits.
2519 (linemap_position_for_line_and_column): Add line_maps * params.
2520 (rich_location::rich_location): Likewise.
2521 * lex.c (_cpp_lex_direct): Capture the range of the token, baking
2522 it into token->src_loc via a call to COMBINE_LOCATION_DATA.
2523 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): Reduce from 1U << 17 to
2524 1U << 12.
2525 (location_adhoc_data_hash): Add the src_range into
2526 the hash value.
2527 (location_adhoc_data_eq): Require equality of the src_range
2528 values.
2529 (can_be_stored_compactly_p): New function.
2530 (get_combined_adhoc_loc): Add src_range param, and store it,
2531 via a bit-packing scheme for short ranges, otherwise within the
2532 lookaside table. Remove the requirement that data is non-NULL.
2533 (get_range_from_adhoc_loc): New function.
2534 (get_range_from_loc): New function.
2535 (pure_location_p): New function.
2536 (linemap_add): Ensure that start_location has zero for the
2537 range_bits, unless we're past LINE_MAP_MAX_LOCATION_WITH_COLS.
2538 Initialize range_bits to zero. Assert that the start_location
2539 is "pure".
2540 (linemap_line_start): Assert that the
2541 column_and_range_bits >= range_bits.
2542 Update determinination of whether we need to start a new map
2543 using the effective column bits, without the range bits.
2544 Use the set's default_range_bits in new maps, apart from
2545 those with column_bits == 0, which should also have 0 range_bits.
2546 Increase the column bits for new maps by the range bits.
2547 When adding lines to an existing map, use set->highest_line
2548 directly rather than offsetting highest by SOURCE_COLUMN.
2549 Add assertions to sanity-check the return value.
2550 (linemap_position_for_column): Offset to_column by range_bits.
2551 Update set->highest_location if necessary.
2552 (linemap_position_for_line_and_column): Add line_maps * param.
2553 Update the calculation to offset the column by range_bits, and
2554 conditionalize it on being <= LINE_MAP_MAX_LOCATION_WITH_COLS.
2555 Bound it by LINEMAPS_MACRO_LOWEST_LOCATION. Update
2556 set->highest_location if necessary.
2557 (linemap_position_for_loc_and_offset): Handle ad-hoc locations;
2558 pass "set" to linemap_position_for_line_and_column.
2559 (linemap_macro_map_loc_unwind_toward_spelling): Add line_maps
2560 param. Handle ad-hoc locations.
2561 (linemap_location_in_system_header_p): Pass on "set" to call to
2562 linemap_macro_map_loc_unwind_toward_spelling.
2563 (linemap_macro_loc_to_spelling_point): Retain ad-hoc locations.
2564 Pass on "set" to call to
2565 linemap_macro_map_loc_unwind_toward_spelling.
2566 (linemap_resolve_location): Retain ad-hoc locations. Pass on
2567 "set" to call to linemap_macro_map_loc_unwind_toward_spelling.
2568 (linemap_unwind_toward_expansion): Pass on "set" to call to
2569 linemap_macro_map_loc_unwind_toward_spelling.
2570 (linemap_expand_location): Extract the data pointer before
2571 extracting the location.
2572 (rich_location::rich_location): Add line_maps param; use it to
2573 extract the range from the source_location.
2574 * location-example.txt: Regenerate, showing new representation.
2575
8a645150
DM
25762015-11-06 David Malcolm <dmalcolm@redhat.com>
2577
2578 * errors.c (cpp_diagnostic): Update for change in signature
2579 of "error" callback.
2580 (cpp_diagnostic_with_line): Likewise, calling override_column
2581 on the rich_location.
2582 * include/cpplib.h (struct cpp_callbacks): Within "error"
2583 callback, convert param from source_location to rich_location *,
2584 and drop column_override param.
2585 * include/line-map.h (struct source_range): New struct.
2586 (struct location_range): New struct.
2587 (class rich_location): New class.
2588 (linemap_client_expand_location_to_spelling_point): New declaration.
2589 * line-map.c (rich_location::rich_location): New ctors.
2590 (rich_location::lazily_expand_location): New method.
2591 (rich_location::override_column): New method.
2592 (rich_location::add_range): New methods.
2593 (rich_location::set_range): New method.
2594
ee015909
DM
25952015-11-06 David Malcolm <dmalcolm@redhat.com>
2596
2597 * include/line-map.h (struct linemap_stats): Add fields
2598 "adhoc_table_size" and "adhoc_table_entries_used".
2599 * line-map.c (linemap_get_statistics): Populate above fields.
2600
a6c764d0
MM
26012015-11-04 Mikhail Maltsev <maltsevm@gmail.com>
2602
2603 * config.in: Regenerate.
2604 * configure: Regenerate.
2605 * configure.ac: Remove ENABLE_CHECKING.
2606
49445904
UB
26072015-11-03 Uros Bizjak <ubizjak@gmail.com>
2608
2609 * lex.c (search_line_sse42): Correctly advance the pointer to an
2610 aligned address.
2611
525ce910
DM
26122015-11-02 David Malcolm <dmalcolm@redhat.com>
2613
2614 * include/line-map.h (source_location): In the table in the
2615 descriptive comment, show UNKNOWN_LOCATION, BUILTINS_LOCATION,
2616 LINE_MAP_MAX_LOCATION_WITH_COLS, LINE_MAP_MAX_SOURCE_LOCATION.
2617 Add notes about ad-hoc values.
2618
7ec491c0
MM
26192015-10-21 Mikhail Maltsev <maltsevm@gmail.com>
2620
22d66382
MM
2621 * include/line-map.h: Use CHECKING_P instead of ENABLE_CHECKING.
2622 * init.c: Likewise.
2623 * macro.c (struct macro_arg_token_iter, set_arg_token,
2624 macro_arg_token_iter_init, macro_arg_token_iter_forward,
2625 macro_arg_token_iter_get_token, macro_arg_token_iter_get_location,
2626 alloc_expanded_arg_mem, _cpp_backup_tokens): Likewise.
2627
7ec491c0
MM
2628 * config.in: Regenerate.
2629 * configure: Regenerate.
2630 * configure.ac (CHECKING_P): Define.
2631 * system.h (fancy_abort): Declare.
2632 (abort): Define.
2633 (gcc_assert): Define. Use CHECKING_P.
2634
179b8d05
MM
26352015-10-13 Mikhail Maltsev <maltsevm@gmail.com>
2636
2637 * system.h (CHECKING_P, gcc_checking_assert): Define.
2638
87b470b3
MLI
26392015-09-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
2640
2641 PR c/66415
2642 * line-map.c (linemap_position_for_loc_and_offset): Handle the
2643 case of long lines encoded in multiple maps.
2644
85bc8baa
MP
26452015-09-07 Marek Polacek <polacek@redhat.com>
2646
2647 * system.h (INTTYPE_MINIMUM): Rewrite to avoid shift warning.
2648
bf5372e7
YS
26492015-08-06 Yaakov Selkowitz <yselkowi@redhat.com>
2650
2651 * configure: Regenerate.
2652
d17f7d59
TS
26532015-07-08 Thomas Schwinge <thomas@codesourcery.com>
2654
2655 * include/line-map.h (RESERVED_LOCATION_COUNT): Change type to
2656 source_location.
2657
fbb22910
PC
26582015-07-02 Paolo Carlini <paolo.carlini@oracle.com>
2659
d885793d 2660 PR preprocessor/53690
fbb22910
PC
2661 * charset.c (_cpp_valid_ucn): Add cppchar_t * parameter and change
2662 return type to bool. Fix encoding of \u0000 and \U00000000 in C++.
2663 (convert_ucn): Adjust call.
2664 * lex.c (forms_identifier_p): Likewise.
2665 * internal.h (_cpp_valid_ucn): Adjust declaration.
2666
fe95b036
ESR
26672015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
2668
2669 Implement N4197 - Adding u8 character literals
2670 * include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens;
2671 (struct cpp_options): Add utf8_char_literals.
2672 * init.c (struct lang_flags): Add utf8_char_literals;
2673 (struct lang_flags lang_defaults): Add column for utf8_char_literals.
fbb22910 2674 * macro.c (stringify_arg()): Treat CPP_UTF8CHAR token;
fe95b036
ESR
2675 * expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()):
2676 Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens;
2677 (cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token;
2678 (eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token.
2679 * lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens.
2680 * charset.c (converter_for_type(), cpp_interpret_charconst()):
2681 Treat CPP_UTF8CHAR token.
2682
dc6bcf52
UB
26832015-06-30 Uros Bizjak <ubizjak@gmail.com>
2684
2685 * lex.c (search_line_sse42) [__GCC_ASM_FLAG_OUTPUTS__]: New main
2686 loop using asm flag outputs.
2687
a1661b90
MP
26882015-06-08 Marek Polacek <polacek@redhat.com>
2689
2690 PR c/66415
2691 * line-map.c (linemap_position_for_loc_and_offset): Remove
2692 linemap_assert_fails; reverse conditions.
2693
815facd3
MLI
26942015-05-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
2695
2696 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER
2697 LINE_MAP_MAX_LOCATION_WITH_COLS,LINE_MAP_MAX_SOURCE_LOCATION):
2698 New constants.
2699 (linemap_line_start): Use them.
2700 (linemap_position_for_column): Use them.
2701
c819ed29
DM
27022015-05-20 David Malcolm <dmalcolm@redhat.com>
2703
2704 * include/line-map.h (MAP_START_LOCATION): Eliminate the non-const
2705 variant, and tweak comment for the const variant.
2706 (ORDINARY_MAP_STARTING_LINE_NUMBER): Drop the non-const variant.
2707 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
2708 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
2709 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
2710 (ORDINARY_MAP_FILE_NAME): Drop the non-const variant.
2711 (MACRO_MAP_MACRO): Likewise.
2712 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
2713 (MACRO_MAP_LOCATIONS): Likewise.
2714 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
2715 * line-map.c (linemap_add): Replace writes through macros with
2716 direct field accesses.
2717 (linemap_enter_macro): Likewise.
2718 (linemap_line_start): Likewise.
2719
0e50b624
DM
27202015-05-19 David Malcolm <dmalcolm@redhat.com>
2721
2722 * directives.c (do_line): Strengthen local "map" from
2723 const line_map * to const line_map_ordinary *.
2724 (do_linemarker): Likewise.
2725 (_cpp_do_file_change): Assert that we're not dealing with
2726 a macro map. Introduce local "ord_map" via a call to
2727 linemap_check_ordinary, guarded within the check for
2728 non-NULL. Use it for typesafety.
2729 * files.c (cpp_make_system_header): Strengthen local "map" from
2730 const line_map * to const line_map_ordinary *.
2731 * include/cpplib.h (struct cpp_callbacks): Likewise for second
2732 parameter of "file_change" callback.
2733 * include/line-map.h (struct line_map): Convert from a struct
2734 containing a union to a base class.
2735 (struct line_map_ordinary): Convert to a subclass of line_map.
2736 (struct line_map_macro): Likewise.
2737 (linemap_check_ordinary): Strengthen return type from line_map *
2738 to line_map_ordinary *, and add a const-variant.
2739 (linemap_check_macro): New pair of functions.
2740 (ORDINARY_MAP_STARTING_LINE_NUMBER): Strengthen param from
2741 const line_map * to const line_map_ordinary *, eliminating call
2742 to linemap_check_ordinary. Likewise for the non-const variant.
2743 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
2744 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
2745 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Likewise.
2746 (ORDINARY_MAP_FILE_NAME): Likewise.
2747 (MACRO_MAP_MACRO): Strengthen param from const line_map * to
2748 const line_map_macro *. Likewise for the non-const variant.
2749 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
2750 (MACRO_MAP_LOCATIONS): Likewise.
2751 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
2752 (struct maps_info): Replace with...
2753 (struct maps_info_ordinary):...this and...
2754 (struct maps_info_macro): ...this.
2755 (struct line_maps): Convert fields "info_ordinary" and
2756 "info_macro" to the above new structs.
2757 (LINEMAPS_MAP_INFO): Delete both functions.
2758 (LINEMAPS_MAPS): Likewise.
2759 (LINEMAPS_ALLOCATED): Rewrite both variants to avoid using
2760 LINEMAPS_MAP_INFO.
2761 (LINEMAPS_USED): Likewise.
2762 (LINEMAPS_CACHE): Likewise.
2763 (LINEMAPS_MAP_AT): Likewise.
2764 (LINEMAPS_ORDINARY_MAPS): Strengthen return type from line_map *
2765 to line_map_ordinary *.
2766 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
2767 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
2768 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
2769 (LINEMAPS_MACRO_MAPS): Strengthen return type from line_map * to
2770 line_map_macro *.
2771 (LINEMAPS_MACRO_MAP_AT): Likewise.
2772 (LINEMAPS_LAST_MACRO_MAP): Likewise.
2773 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
2774 (linemap_map_get_macro_name): Strengthen param from
2775 const line_map * to const line_map_macro *.
2776 (SOURCE_LINE): Strengthen first param from const line_map * to
2777 const line_map_ordinary *, removing call to
2778 linemap_check_ordinary.
2779 (SOURCE_COLUMN): Likewise.
2780 (LAST_SOURCE_LINE_LOCATION): Likewise.
2781 (LAST_SOURCE_LINE): Strengthen first param from const line_map *
2782 to const line_map_ordinary *.
2783 (LAST_SOURCE_COLUMN): Likewise.
2784 (INCLUDED_FROM): Strengthen return type from line_map * to
2785 line_map_ordinary *., and second param from const line_map *
2786 to const line_map_ordinary *, removing call to
2787 linemap_check_ordinary.
2788 (MAIN_FILE_P): Strengthen param from const line_map * to
2789 const line_map_ordinary *, removing call to
2790 linemap_check_ordinary.
2791 (linemap_position_for_line_and_column): Strengthen param from
2792 const line_map * to const line_map_ordinary *.
2793 (LINEMAP_FILE): Strengthen param from const line_map * to
2794 const line_map_ordinary *, removing call to
2795 linemap_check_ordinary.
2796 (LINEMAP_LINE): Likewise.
2797 (LINEMAP_SYSP): Likewise.
2798 (linemap_resolve_location): Strengthen final param from
2799 const line_map ** to const line_map_ordinary **.
2800 * internal.h (CPP_INCREMENT_LINE): Likewise for local "map".
2801 (linemap_enter_macro): Strengthen return type from
2802 const line_map * to const line_map_macro *.
2803 (linemap_add_macro_token): Likewise for first param.
2804 * line-map.c (linemap_check_files_exited): Strengthen local "map"
2805 from const line_map * to const line_map_ordinary *.
2806 (new_linemap): Introduce local "map_size" and use it when
2807 calculating how large the buffer should be. Rewrite based
2808 on change of info_macro and info_ordinary into distinct types.
2809 (linemap_add): Strengthen locals "map" and "from" from line_map *
2810 to line_map_ordinary *.
2811 (linemap_enter_macro): Strengthen return type from
2812 const line_map * to const line_map_macro *, and local "map" from
2813 line_map * to line_map_macro *.
2814 (linemap_add_macro_token): Strengthen param "map" from
2815 const line_map * to const line_map_macro *.
2816 (linemap_line_start): Strengthen local "map" from line_map * to
2817 line_map_ordinary *.
2818 (linemap_position_for_column): Likewise.
2819 (linemap_position_for_line_and_column): Strengthen first param
2820 from const line_map * to const line_map_ordinary *.
2821 (linemap_position_for_loc_and_offset): Strengthen local "map" from
2822 const line_map * to const line_map_ordinary *.
2823 (linemap_ordinary_map_lookup): Likewise for return type and locals
2824 "cached" and "result".
2825 (linemap_macro_map_lookup): Strengthen return type and locals
2826 "cached" and "result" from const line_map * to
2827 const line_map_macro *.
2828 (linemap_macro_map_loc_to_exp_point): Likewise for param "map".
2829 (linemap_macro_map_loc_to_def_point): Likewise.
2830 (linemap_macro_map_loc_unwind_toward_spelling): Likewise.
2831 (linemap_get_expansion_line): Strengthen local "map" from
2832 const line_map * to const line_map_ordinary *.
2833 (linemap_get_expansion_filename): Likewise.
2834 (linemap_map_get_macro_name): Strengthen param from
2835 const line_map * to const line_map_macro *.
2836 (linemap_location_in_system_header_p): Add call to
2837 linemap_check_ordinary in region guarded by
2838 !linemap_macro_expansion_map_p. Introduce local "macro_map" via
2839 linemap_check_macro in other region, using it in place of "map"
2840 for typesafety.
2841 (first_map_in_common_1): Add calls to linemap_check_macro.
2842 (trace_include): Strengthen param "map" from const line_map * to
2843 const line_map_ordinary *.
2844 (linemap_macro_loc_to_spelling_point): Strengthen final param from
2845 const line_map ** to const line_map_ordinary **. Replace a
2846 C-style cast with a const_cast, and add calls to
2847 linemap_check_macro and linemap_check_ordinary.
2848 (linemap_macro_loc_to_def_point): Likewise.
2849 (linemap_macro_loc_to_exp_point): Likewise.
2850 (linemap_resolve_location): Strengthen final param from
2851 const line_map ** to const line_map_ordinary **.
2852 (linemap_unwind_toward_expansion): Introduce local "macro_map" via
2853 a checked cast and use it in place of *map.
2854 (linemap_unwind_to_first_non_reserved_loc): Strengthen local
2855 "map1" from const line_map * to const line_map_ordinary *.
2856 (linemap_expand_location): Introduce local "ord_map" via a checked
2857 cast and use it in place of map.
2858 (linemap_dump): Make local "map" const. Strengthen local
2859 "includer_map" from line_map * to const line_map_ordinary *.
2860 Introduce locals "ord_map" and "macro_map" via checked casts and
2861 use them in place of "map" for typesafety.
2862 (linemap_dump_location): Strengthen local "map" from
2863 const line_map * to const line_map_ordinary *.
2864 (linemap_get_file_highest_location): Update for elimination of
2865 union.
2866 (linemap_get_statistics): Strengthen local "cur_map" from
2867 line_map * to const line_map_macro *. Update uses of sizeof to
2868 use the appropriate line_map subclasses.
2869 * macro.c (_cpp_warn_if_unused_macro): Add call to
2870 linemap_check_ordinary.
2871 (builtin_macro): Strengthen local "map" from const line_map * to
2872 const line_map_macro *.
2873 (enter_macro_context): Likewise.
2874 (replace_args): Likewise.
2875 (tokens_buff_put_token_to): Likewise for param "map".
2876 (tokens_buff_add_token): Likewise.
2877
ba4ad400
DM
28782015-05-13 David Malcolm <dmalcolm@redhat.com>
2879
2880 * include/line-map.h (source_location): Add a reference to
2881 location-example.txt to the descriptive comment.
2882 * location-example.txt: New file.
2883
0501dbd9
DM
28842015-05-13 David Malcolm <dmalcolm@redhat.com>
2885
2886 * include/line-map.h (MAX_SOURCE_LOCATION): Convert from a macro
2887 to a const source_location.
2888 (RESERVED_LOCATION_COUNT): Likewise.
2889 (linemap_check_ordinary): Convert from a macro to a pair of inline
2890 functions, for const/non-const arguments.
2891 (MAP_START_LOCATION): Likewise.
2892 (ORDINARY_MAP_STARTING_LINE_NUMBER): Likewise.
2893 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
2894 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
2895 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Convert from a macro to a
2896 pair of inline functions, for const/non-const arguments, where the
2897 latter is named...
2898 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): New function.
2899 (ORDINARY_MAP_FILE_NAME): Convert from a macro to a pair of inline
2900 functions, for const/non-const arguments.
2901 (MACRO_MAP_MACRO): Likewise.
2902 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
2903 (MACRO_MAP_LOCATIONS): Likewise.
2904 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
2905 (LINEMAPS_MAP_INFO): Likewise.
2906 (LINEMAPS_MAPS): Likewise.
2907 (LINEMAPS_ALLOCATED): Likewise.
2908 (LINEMAPS_USED): Likewise.
2909 (LINEMAPS_CACHE): Likewise.
2910 (LINEMAPS_ORDINARY_CACHE): Likewise.
2911 (LINEMAPS_MACRO_CACHE): Likewise.
2912 (LINEMAPS_MAP_AT): Convert from a macro to an inline function.
2913 (LINEMAPS_LAST_MAP): Likewise.
2914 (LINEMAPS_LAST_ALLOCATED_MAP): Likewise.
2915 (LINEMAPS_ORDINARY_MAPS): Likewise.
2916 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
2917 (LINEMAPS_ORDINARY_ALLOCATED): Likewise.
2918 (LINEMAPS_ORDINARY_USED): Likewise.
2919 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
2920 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
2921 (LINEMAPS_MACRO_MAPS): Likewise.
2922 (LINEMAPS_MACRO_MAP_AT): Likewise.
2923 (LINEMAPS_MACRO_ALLOCATED): Likewise.
2924 (LINEMAPS_MACRO_USED): Likewise.
2925 (LINEMAPS_MACRO_LOWEST_LOCATION): Likewise.
2926 (LINEMAPS_LAST_MACRO_MAP): Likewise.
2927 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
2928 (IS_ADHOC_LOC): Likewise.
2929 (COMBINE_LOCATION_DATA): Likewise.
2930 (SOURCE_LINE): Likewise.
2931 (SOURCE_COLUMN): Likewise.
2932 (LAST_SOURCE_LINE_LOCATION): Likewise.
2933 (LAST_SOURCE_LINE): Likewise.
2934 (LAST_SOURCE_COLUMN): Likewise.
2935 (LAST_SOURCE_LINE_LOCATION)
2936 (INCLUDED_FROM): Likewise.
2937 (MAIN_FILE_P): Likewise.
2938 (LINEMAP_FILE): Likewise.
2939 (LINEMAP_LINE): Likewise.
2940 (LINEMAP_SYSP): Likewise.
2941 (linemap_location_before_p): Likewise.
2942 * line-map.c (linemap_check_files_exited): Make local "map" const.
2943 (linemap_add): Use SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS.
2944 (linemap_line_start): Likewise.
2945
eb70f327
MH
29462015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
2947
2948 * aclocal.m4: Regenerated with automake-1.11.6.
2949
60c12095
DM
29502015-05-13 David Malcolm <dmalcolm@redhat.com>
2951
2952 * include/line-map.h (linemap_assert): Move up within the file to
2953 before all of the map accessor macros.
2954 (linemap_assert_fails): Likewise.
2955 (linemap_check_ordinary): Likewise.
2956 (linemap_macro_expansion_map_p): Likewise.
2957
c3388e62
DM
29582015-05-12 David Malcolm <dmalcolm@redhat.com>
2959
2960 * directives.c (do_line): Set seen_line_directive on line_table.
2961 (do_linemarker): Likewise.
2962 * include/line-map.h (struct line_maps): Add new field
2963 "seen_line_directive".
2964
fe191308
JM
29652015-05-08 Jason Merrill <jason@redhat.com>
2966
2967 * include/cpplib.h: Add CPP_W_CXX11_COMPAT.
2968 (struct cpp_options): Add cpp_warn_cxx11_compat.
2969 * init.c (cpp_create_reader): Initialize it.
2970 * lex.c (lex_string): Add -Wc++11-compat warning.
2971
21c0a521
DM
29722015-05-05 David Malcolm <dmalcolm@redhat.com>
2973
2974 * pch.c (cpp_valid_state): Fix indentation so that it reflects the
2975 block structure.
2976
c87b25e6
DM
29772015-05-05 David Malcolm <dmalcolm@redhat.com>
2978
2979 * include/line-map.h: Fix comment at the top of the file.
2980 (source_location): Rewrite and expand the comment for this
2981 typedef, adding an ascii-art table to clarify how source_location
2982 values are allocated.
2983 * line-map.c: Fix comment at the top of the file.
2984
ca708025
RB
29852015-04-09 Richard Biener <rguenther@suse.de>
2986
2987 PR pch/65550
2988 * files.c (pch_open_file): Allow main and pre-included files
2989 when trying to open a PCH.
2990
e4b33ee5
JJ
29912015-04-06 Jakub Jelinek <jakub@redhat.com>
2992
2993 PR preprocessor/61977
2994 * lex.c (cpp_peek_token): If peektok is CPP_EOF, back it up
2995 with all tokens peeked by the current function.
2996
b8cd77f4
JJ
29972015-04-02 Jakub Jelinek <jakub@redhat.com>
2998
2999 PR preprocessor/61977
3000 * lex.c (cpp_peek_token): Temporarily clear pfile->cb.line_change.
3001
fb136e35
JJ
30022015-03-23 Jakub Jelinek <jakub@redhat.com>
3003
3004 PR preprocessor/65238
3005 * internal.h (_cpp_scan_out_logical_line): Add third argument.
3006 * directives.c (prepare_directive_trad): Pass false to it.
3007 * traditional.c (_cpp_read_logical_line_trad,
3008 _cpp_create_trad_definition): Likewise.
3009 (struct fun_macro): Add paramc field.
3010 (fun_like_macro): New function.
3011 (maybe_start_funlike): Handle NODE_BUILTIN macros. Initialize
3012 macro->paramc field.
3013 (save_argument): Use macro->paramc instead of
3014 macro->node->value.macro->paramc.
3015 (push_replacement_text): Formatting fix.
3016 (recursive_macro): Use fun_like_macro helper.
3017 (_cpp_scan_out_logical_line): Likewise. Add BUILTIN_MACRO_ARG
3018 argument. Initialize fmacro.paramc field. Handle builtin
3019 function-like macros.
3020
a5858a3d
ESR
30212015-03-16 Edward Smith-Rowland <3dw4rd@verizon.net>
3022
3023 PR c++/64626
3024 * lex.c (lex_number): If a number ends with digit-seps (') skip back
3025 and let lex_string take them.
3026
44d95244
MT
30272015-03-02 Markus Trippelsdorf <markus@trippelsdorf.de>
3028
3029 PR target/65261
3030 * lex.c (search_line_fast): Silence ubsan errors.
3031
f8abc9ba
DS
30322015-02-03 <dodji@redhat.com>
3033
3034 PR preprocessor/64803
3035 * internal.h (cpp_reader::top_most_macro_node): New data member.
3036 * macro.c (enter_macro_context): Pass the location of the end of
3037 the top-most invocation of the function-like macro, or the
3038 location of the expansion point of the top-most object-like macro.
3039 (cpp_get_token_1): Store the top-most macro node in the new
3040 pfile->top_most_macro_node data member.
3041 (_cpp_pop_context): Clear the new cpp_reader::top_most_macro_node
3042 data member.
3043
95d0610c
SN
30442015-01-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
3045
3046 * lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON.
3047
10ef8f28
MP
30482015-01-23 Marek Polacek <polacek@redhat.com>
3049
3050 DR#412
3051 PR preprocessor/60570
3052 * directives.c (do_elif): Don't evaluate #elif conditionals
3053 when they don't need to be.
3054
6e6cb471
JJ
30552015-01-16 Jakub Jelinek <jakub@redhat.com>
3056
3057 * expr.c (cpp_classify_number): Add N_() around ?: string
3058 literals used in cpp_error_with_line call as format string.
3059
5624e564
JJ
30602015-01-05 Jakub Jelinek <jakub@redhat.com>
3061
3062 Update copyright years.
3063
1f8d3e84
JJ
30642014-12-19 Jakub Jelinek <jakub@redhat.com>
3065
3066 PR preprocessor/63831
3067 * directives.c (lex_macro_node): Remove __has_attribute__ handling.
3068 * internal.h (struct spec_node): Remove n__has_attribute__ field.
3069 (struct lexer_state): Remove in__has_attribute__ field.
3070 * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_ATTRIBUTE.
3071 * identifiers.c (_cpp_init_hashtable): Remove __has_attribute__
3072 handling.
3073 * init.c (builtin_array): Add __has_attribute and __has_cpp_attribute.
3074 (cpp_init_special_builtins): Don't initialize __has_attribute
3075 or __has_cpp_attribute if CLK_ASM or pfile->cb.has_attribute is NULL.
3076 * traditional.c (enum ls): Remove ls_has_attribute,
3077 ls_has_attribute_close.
3078 (_cpp_scan_out_logical_line): Remove __has_attribute__ handling.
3079 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_ATTRIBUTE.
3080 * pch.c (cpp_read_state): Remove __has_attribute__ handling.
3081 * expr.c (eval_token): Likewise.
3082 (parse_has_attribute): Removed.
3083
01ca36af
UB
30842014-12-11 Uros Bizjak <ubizjak@gmail.com>
3085
3086 * directives.c (cpp_define_formatted): Use xvasprintf.
3087
b93c0722
MLI
30882014-12-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
3089
3090 * line-map.c (linemap_position_for_loc_and_offset): Add new
3091 linemap_assert_fails.
3092
73bd8329
MLI
30932014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
3094
3095 * include/line-map.h (linemap_assert_fails): Declare.
3096 * line-map.c (linemap_position_for_loc_and_offset): Use it.
3097
9c320ab1
MLI
30982014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
3099
49445904
UB
3100 * line-map.c (linemap_add): Fix typo.
3101 (linemap_line_start): Fix whitespace.
9c320ab1 3102
81fee4a7
JM
31032014-11-29 John Schmerge <jbschmerge@gmail.com>
3104
3105 PR preprocessor/41698
3106 * charset.c (one_utf8_to_utf16): Do not produce surrogate pairs
3107 for 0xffff.
3108
43ba1c6c
JJ
31092014-11-25 Jakub Jelinek <jakub@redhat.com>
3110
3111 PR preprocessor/60436
3112 * line-map.c (linemap_line_start): If highest is above 0x60000000
3113 and we are still tracking columns or highest is above 0x70000000,
3114 force add_map.
3115
8a23b100
UB
31162014-11-20 Uros Bizjak <ubizjak@gmail.com>
3117
3118 PR target/63966
1b6b13f3
UB
3119 * lex.c [__i386__ || __x86_64__]: Compile special SSE functions
3120 only for (__GNUC__ >= 5 || !defined(__PIC__)).
8a23b100 3121
d82f1e13
MLI
31222014-11-13 Manuel López-Ibáñez <manu@gcc.gnu.org>
3123
3124 * include/line-map.h: Include EXPR, so that unused variable warnings
3125 do not occur.
3126
3aa34c1d
MLI
31272014-11-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
3128
3129 PR fortran/44054
3130 * include/line-map.h (linemap_position_for_loc_and_offset):
3131 Declare.
3132 * line-map.c (linemap_position_for_loc_and_offset): New.
3133
35485da9
DM
31342014-11-11 David Malcolm <dmalcolm@redhat.com>
3135
3136 * ChangeLog.jit: New.
3137
42fd12b1
ESR
31382014-11-10 Edward Smith-Rowland <3dw4rd@verizon.net>
3139
3140 * include/cpplib.h (cpp_callbacks): Add has_attribute.
3141 * internal.h (lexer_state): Add in__has_attribute__.
3142 * directives.c (lex_macro_node): Prevent use of __has_attribute__
3143 as a macro.
3144 * expr.c (parse_has_attribute): New function; (eval_token): Look for
3145 __has_attribute__ and route to parse_has_attribute.
3146 * identifiers.c (_cpp_init_hashtable): Initialize n__has_attribute__.
3147 * pch.c (cpp_read_state): Initialize n__has_attribute__.
3148 * traditional.c (enum ls): Add ls_has_attribute, ls_has_attribute_close;
3149 (_cpp_scan_out_logical_line): Attend to __has_attribute__.
3150
be5ffc59
JM
31512014-11-06 Joseph Myers <joseph@codesourcery.com>
3152
3153 * include/cpp-id-data.h (struct cpp_macro): Update comment
3154 regarding parameters.
3155 * include/cpplib.h (struct cpp_macro_arg, struct cpp_identifier):
3156 Add spelling fields.
3157 (struct cpp_token): Update comment on macro_arg.
3158 * internal.h (_cpp_save_parameter): Add extra argument.
3159 (_cpp_spell_ident_ucns): New declaration.
3160 * lex.c (lex_identifier): Add SPELLING argument. Set *SPELLING to
3161 original spelling of identifier.
3162 (_cpp_lex_direct): Update calls to lex_identifier.
3163 (_cpp_spell_ident_ucns): New function, factored out of
3164 cpp_spell_token.
3165 (cpp_spell_token): Adjust FORSTRING argument semantics to return
3166 original spelling of identifiers. Use _cpp_spell_ident_ucns in
3167 !FORSTRING case.
3168 (_cpp_equiv_tokens): Check spellings of identifiers and macro
3169 arguments are identical.
3170 * macro.c (macro_arg_saved_data): New structure.
3171 (paste_tokens): Use original spellings of identifiers from
3172 cpp_spell_token.
3173 (_cpp_save_parameter): Add argument SPELLING. Save both canonical
3174 node and its value.
3175 (parse_params): Update calls to _cpp_save_parameter.
3176 (lex_expansion_token): Save spelling of macro argument tokens.
3177 (_cpp_create_definition): Extract canonical node from saved data.
3178 (cpp_macro_definition): Use UCNs in spelling of macro name. Use
3179 original spellings of macro argument tokens and identifiers.
3180 * traditional.c (scan_parameters): Update call to
3181 _cpp_save_parameter.
3182
701cade1
JM
31832014-11-05 Joseph Myers <joseph@codesourcery.com>
3184
3185 PR preprocessor/9449
3186 * init.c (lang_defaults): Enable extended identifiers for C++ and
3187 C99-based standards.
3188
19a9ba64
AM
31892014-10-22 Alan Modra <amodra@gmail.com>
3190
3191 * symtab.c (ht_create): Use obstack_specify_allocation in place of
3192 _obstack_begin.
3193 * files.c (_cpp_init_files): Likewise.
3194 * init.c (cpp_create_reader): Likewise.
3195 * identifiers.c (_cpp_init_hashtable): Likewise.
3196
3aac0952
MLI
31972014-10-14 Manuel López-Ibáñez <manu@gcc.gnu.org>
3198
3199 * include/line-map.h (linemap_location_from_macro_expansion_p):
3200 const struct line_maps * argument.
3201 (linemap_position_for_line_and_column): const struct line_map *
3202 argument.
3203 * line-map.c (linemap_add_macro_token): Use correct argument name
3204 in comment.
3205 (linemap_position_for_line_and_column): const struct line_map *
3206 argument.
3207 (linemap_macro_map_loc_to_def_point): Fix comment. Make static.
3208 (linemap_location_from_macro_expansion_p): const struct line_maps *
3209 argument.
3210 (linemap_resolve_location): Fix argument names in comment.
3211
0ccaaab0
BS
32122014-10-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
3213
3214 * lex.c (search_line_fast): Add new version to be used for Power8
3215 and later targets when Altivec is enabled. Restrict the existing
3216 Altivec version to big-endian systems so that lvsr is not used on
3217 little endian, where it is deprecated. Remove LE-specific code
3218 from the now-BE-only version.
3219
dc257367
BE
32202014-10-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
3221 Jeff Law <law@redhat.com>
3222
3223 * charset.c (convert_no_conversion): Reallocate memory with 25%
3224 headroom.
3225
a15f7cb8
ESR
32262014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net>
3227
3228 Implement SD-6: SG10 Feature Test Recommendations
3229 * internal.h (lexer_state, spec_nodes): Add in__has_include__.
3230 * directives.c: Support __has_include__ builtin.
3231 * expr.c (parse_has_include): New function to parse __has_include__
3232 builtin; (eval_token()): Use it.
3233 * files.c (_cpp_has_header()): New funtion to look for header;
3234 (open_file_failed()): Not an error to not find a header file for
3235 __has_include__.
3236 * identifiers.c (_cpp_init_hashtable()): Add entry for __has_include__.
3237 * pch.c (cpp_read_state): Lookup __has_include__.
3238 * traditional.c (enum ls, _cpp_scan_out_logical_line()): Walk through
3239 __has_include__ statements.
3240
cc811a8a
BE
32412014-09-30 Bernd Edlinger <bernd.edlinger@hotmail.de>
3242
3243 PR preprocessor/58893
3244 * errors.c (cpp_diagnostic): Fix possible out of bounds access.
3245 * files.c (_cpp_stack_include): Initialize src_loc for IT_CMDLINE.
3246
083e891e
MP
32472014-09-24 Marek Polacek <polacek@redhat.com>
3248
3249 PR c/61405
3250 PR c/53874
3251 * include/cpplib.h (enum cpp_ttype): Define CPP_KEYWORD.
3252
d87fc699
JH
32532014-09-17 Jan Hubicka <hubicka@ucw.cz>
3254
3255 * charset.c (conversion): Rename to ...
3256 (cpp_conversion): ... this one; update.
3257 * files.c (file_hash_entry): Rename to ...
3258 (cpp_file_hash_entry): ... this one ; update.
3259
909eb89c
MP
32602014-09-17 Marek Polacek <polacek@redhat.com>
3261
3262 PR c/61854
3263 * init.c (struct lang_flags): Remove cplusplus_comments.
3264 (cpp_set_lang): Likewise.
3265 (post_options): Likewise.
3266 * lex.c (_cpp_lex_direct): Disallow C++ style comments in C90/C94.
3267
1ef33fd4
MLI
32682014-09-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
3269
3270 * include/cpplib.h (struct cpp_options): Declare warn_normalize as
3271 int instead of enum.
3272
2b71f4a4
MLI
32732014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
3274
3275 * macro.c (replace_args): Use cpp_pedwarning, cpp_warning and
3276 CPP_W flags.
3277 * include/cpplib.h: Add CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC.
3278 * init.c (cpp_create_reader): Do not init to -1 here.
3279 * expr.c (num_binary_op): Use cpp_pedwarning.
3280
81b5d104
MLI
32812014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
3282
3283 * directives.c (check_eol_1): New.
3284 (check_eol_endif_labels): New.
3285 (check_eol): Call check_eol_1.
3286 (do_else,do_endif): Call check_eol_endif_labels.
3287
b753b37b
MLI
32882014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
3289
3290 * macro.c (warn_of_redefinition): Suppress warnings for builtins
3291 that lack the NODE_WARN flag, unless Wbuiltin-macro-redefined.
3292 (_cpp_create_definition): Use Wbuiltin-macro-redefined for
3293 builtins that lack the NODE_WARN flag.
3294 * directives.c (do_undef): Likewise.
3295 * init.c (cpp_init_special_builtins): Do not change flags
3296 depending on Wbuiltin-macro-redefined.
3297
7c05e50c
ESR
32982014-08-28 Edward Smith-Rowland <3dw4rd@verizon.net>
3299
3300 PR cpp/23827 - standard C++ should not have hex float preprocessor
3301 tokens
3302 * libcpp/init.c (lang_flags): Change CXX98 flag for extended numbers
3303 from 1 to 0.
3304 * libcpp/expr.c (cpp_classify_number): Weite error message for improper
3305 use of hex floating literal.
3306
e4276ba5
ESR
33072014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
3308
3309 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z;
3310 Rename CLK_GNUCXX1Y, CLK_CXX1Y to CLK_GNUCXX14, CLK_CXX14;
3311 * init.c (struct lang_flags lang_defaults): Add column for trigraphs;
3312 Add rows for CLK_GNUCXX1Z, CLK_CXX1Z; (cpp_set_lang): Set trigraphs;
3313 (cpp_init_builtins): Set __cplusplus to 201402L for C++14;
3314 Set __cplusplus to 201500L for C++17.
3315 * expr.c (cpp_classify_number): Change C++1y to C++14 in binary
3316 constants error message.
3317
dd3ff077
MP
33182014-08-20 Marek Polacek <polacek@redhat.com>
3319
3320 * include/cpplib.h (cpp_options): Use signed char.
3321 * lex.c (_cpp_lex_direct): Don't warn in C++ mode.
3322
3f4f5c9a
MP
33232014-08-19 Marek Polacek <polacek@redhat.com>
3324
3325 * lex.c (_cpp_lex_direct): Fix a typo.
3326
177cce46
MP
33272014-08-19 Marek Polacek <polacek@redhat.com>
3328
3329 * charset.c (_cpp_valid_ucn): Warn only if -Wc90-c99-compat.
3330 * lex.c (_cpp_lex_direct): Likewise.
3331 * macro.c (replace_args): Likewise.
3332 (parse_params): Likewise.
3333 * include/cpplib.h (cpp_options): Change cpp_warn_c90_c99_compat
3334 to char.
3335
f3bede71
MP
33362014-08-10 Marek Polacek <polacek@redhat.com>
3337
3338 PR c/51849
3339 * lex.c (_cpp_lex_direct): Warn when -Wc90-c99-compat is in effect.
3340 * charset.c (_cpp_valid_ucn): Likewise.
3341 * include/cpplib.h (cpp_options): Add cpp_warn_c90_c99_compat.
3342 * macro.c (replace_args): Warn when -Wc90-c99-compat is in effect.
3343 (parse_params): Likewise.
3344
61eb99f6
MP
33452014-07-27 Marek Polacek <polacek@redhat.com>
3346
3347 PR c/61861
3348 * macro.c (builtin_macro): Add location parameter. Set
3349 location of builtin macro to the expansion point.
3350 (enter_macro_context): Pass location to builtin_macro.
3351
c468587a
DS
33522014-07-16 Dodji Seketeli <dodji@redhat.com>
3353
3354 Support location tracking for built-in macro tokens
3355 * include/line-map.h (line_maps::builtin_location): New data
3356 member.
3357 (line_map_init): Add a new parameter to initialize the new
3358 line_maps::builtin_location data member.
3359 * line-map.c (linemap_init): Initialize the
3360 line_maps::builtin_location data member.
3361 * macro.c (builtin_macro): Create a macro map and track the token
3362 resulting from the expansion of a built-in macro.
3363
3976796b
ESR
33642014-07-10 Edward Smith-Rowland <3dw4rd@verizon.net>
3365 Jonathan Wakely <jwakely@redhat.com>
3366
c786fca6 3367 PR preprocessor/61389
3976796b
ESR
3368 * macro.c (_cpp_arguments_ok, parse_params, create_iso_definition):
3369 Warning messages mention C++11 in c++ mode and C99 in c mode.
3370 * lex.c (lex_identifier_intern, lex_identifier): Ditto
3371
7aee8646
ESR
33722014-07-09 Edward Smith-Rowland <3dw4rd@verizon.net>
3373
3374 PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped
3375 by preprocessor
3376 * lex.c (lex_raw_string ()): Do not warn about invalid suffix
3377 if skipping. (lex_string ()): Ditto.
3378
98ba7482
ESR
33792014-06-04 Edward Smith-Rowland <3dw4rd@verizon.net>
3380
3381 PR c++/61038
3382 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
3383 Combine user-defined escape logic with the other string and char logic.
3384
edf6ddf6
RB
33852014-05-26 Richard Biener <rguenther@suse.de>
3386
3387 * configure.ac: Remove long long and __int64 type checks,
3388 add check for uint64_t and fail if that wasn't found.
3389 * include/cpplib.h (cpp_num_part): Use uint64_t.
3390 * config.in: Regenerate.
3391 * configure: Likewise.
3392
28939589
MP
33932014-05-21 Marek Polacek <polacek@redhat.com>
3394
3395 PR c/61212
3396 * files.c (find_file_in_dir): Add parens around &&.
3397
49039169
ESR
33982014-05-20 Edward Smith-Rowland <3dw4rd@verizon.net>
3399
28939589 3400 PR c++/61038
49039169
ESR
3401 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
3402 Check for user-defined literal strings and user-defined literal chars
3403 to escape necessary characters.
3404
54da09ee
RB
34052014-05-20 Richard Biener <rguenther@suse.de>
3406
3407 * configure.ac: Copy gcc logic of detecting a 64bit type.
3408 Remove HOST_WIDE_INT define.
3409 * include/cpplib.h: typedef cpp_num_part to a 64bit type,
3410 similar to how hwint.h does it.
3411 * config.in: Regenerate.
3412 * configure: Likewise.
3413
eac3e079
JY
34142014-05-09 Joey Ye <joey.ye@arm.com>
3415
3416 * files.c (find_file_in_dir): Always try to shorten for DOS
3417 non-system headers.
3418 * init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS.
3419
f543058d
RB
34202014-05-07 Richard Biener <rguenther@suse.de>
3421
3422 * configure.ac: Always set need_64bit_hwint to yes.
3423 * configure: Regenerated.
3424
d9f069ab
RO
34252014-04-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3426
3427 * lex.c: Remove Solaris 9 reference.
3428
341c653c
WL
34292014-02-24 Walter Lee <walt@tilera.com>
3430
3431 * configure.ac: Change "tilepro" triplet to "tilepro*".
3432 * configure: Regenerate.
3433
179652df
JJ
34342014-02-19 Jakub Jelinek <jakub@redhat.com>
3435
3436 PR preprocessor/58844
3437 * macro.c (enter_macro_context): Only push
3438 macro_real_token_count (macro) tokens rather than
3439 macro->count tokens, regardless of
3440 CPP_OPTION (pfile, track-macro-expansion).
3441
acf601ae
JJ
34422014-02-07 Jakub Jelinek <jakub@redhat.com>
3443
3444 PR preprocessor/56824
3445 * line-map.c (get_combined_adhoc_loc, linemap_get_expansion_line,
3446 linemap_get_expansion_filename, linemap_location_in_system_header_p,
3447 linemap_location_from_macro_expansion_p,
3448 linemap_macro_loc_to_spelling_point, linemap_macro_loc_to_def_point,
3449 linemap_macro_loc_to_exp_point, linemap_expand_location): Fix
3450 formatting.
3451 (linemap_compare_locations): Look through adhoc locations for both
3452 l0 and l1.
3453
7ecc3eb9
DS
34542014-01-23 Dodji Seketeli <dodji@redhat.com>
3455
3456 PR PR preprocessor/58580
3457 * include/line-map.h (linemap_get_file_highest_location): Declare
3458 new function.
3459 * line-map.c (linemap_get_file_highest_location): Define it.
3460
35c3d610
RS
34612014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
3462
3463 Update copyright years
3464
3a4efce7
JM
34652013-12-09 Joseph Myers <joseph@codesourcery.com>
3466
3467 PR preprocessor/55715
3468 * expr.c (num_binary_op): Implement subtraction directly rather
3469 than with negation and falling through into addition case.
3470
aadce585
BS
34712013-11-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
3472
3473 * lex.c (search_line_fast): Correct for little endian.
3474
d3f4ff8b
JM
34752013-11-15 Joseph Myers <joseph@codesourcery.com>
3476
3477 * ucnid.tab: Add C11 and C11NOSTART data.
3478 * makeucnid.c (digit): Rename enum value to N99.
3479 (C11, N11, all_languages): New enum values.
3480 (NUM_CODE_POINTS, MAX_CODE_POINT): New macros.
3481 (flags, decomp, combining_value): Use NUM_CODE_POINTS as array
3482 size.
3483 (decomp): Use unsigned int as element type.
3484 (all_decomp): New array.
3485 (read_ucnid): Handle C11 and C11NOSTART. Use MAX_CODE_POINT.
3486 (read_table): Use MAX_CODE_POINT. Store all decompositions in
3487 all_decomp.
3488 (read_derived): Use MAX_CODE_POINT.
3489 (write_table): Use NUM_CODE_POINTS. Print N99, C11 and N11
3490 flags. Print whole array variable declaration rather than just
3491 array contents.
3492 (char_id_valid, write_context_switch): New functions.
3493 (main): Call write_context_switch.
3494 * ucnid.h: Regenerate.
3495 * include/cpplib.h (struct cpp_options): Add c11_identifiers.
3496 * init.c (struct lang_flags): Add c11_identifiers.
3497 (cpp_set_lang): Set c11_identifiers option from selected language.
3498 * internal.h (struct normalize_state): Document "previous" as
3499 previous starter character.
3500 (NORMALIZE_STATE_UPDATE_IDNUM): Take character as argument.
3501 * charset.c (DIG): Rename enum value to N99.
3502 (C11, N11): New enum values.
3503 (struct ucnrange): Give name to struct. Use short for flags and
3504 unsigned int for end of range. Include ucnid.h for whole variable
3505 declaration.
3506 (ucn_valid_in_identifier): Allow for characters up to 0x10FFFF.
3507 Allow for C11 in determining valid characters and valid start
3508 characters. Use check_nfc for non-Hangul context-dependent
3509 checks. Only store starter characters in nst->previous.
3510 (_cpp_valid_ucn): Pass new argument to
3511 NORMALIZE_STATE_UPDATE_IDNUM.
3512 * lex.c (lex_identifier): Pass new argument to
3513 NORMALIZE_STATE_UPDATE_IDNUM. Call NORMALIZE_STATE_UPDATE_IDNUM
3514 after initial non-UCN part of identifier.
3515 (lex_number): Pass new argument to NORMALIZE_STATE_UPDATE_IDNUM.
3516
54848ff8
JM
35172013-11-15 Joseph Myers <joseph@codesourcery.com>
3518
3519 * ucnid.tab: Mark C99 digits as [C99DIG].
3520 * makeucnid.c (read_ucnid): Handle [C99DIG].
3521 (read_table): Don't check for digit characters.
3522 * ucnid.h: Regenerate.
3523
5157b91e
TB
35242013-11-06 Tobias Burnus <burnus@net-b.de>
3525
3526 * macro.c (_cpp_builtin_macro_text): Correct
3527 wording of two warnings.
3528
e8ff5196
TB
35292013-11-05 Tobias Burnus <burnus@net-b.de>
3530
3531 * include/cpplib.h (CPP_W_DATE_TIME): Added.
3532 (cpp_options): Add warn_date_time.
3533 * init.c (cpp_create_reader): Init it.
3534 * macro.c (_cpp_builtin_macro_text): Warn when
3535 __DATE__/__TIME__/__TIMESTAMP__ is used.
3536
7057e645
ESR
35372013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
3538
e8ff5196 3539 Implement C++14 digit separators.
7057e645
ESR
3540 * include/cpplib.h (cpp_options): Add digit_separators flag.
3541 * internal.h (DIGIT_SEP(c)): New macro.
3542 * expr.c (cpp_classify_number): Check improper placement of digit sep;
3543 (cpp_interpret_integer): Skip over digit separators.
3544 * init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add
3545 digit separator flags per language; (cpp_set_lang): Set
3546 digit_separators
3547 * lex.c (lex_number): Add digits separator to allowable characters for
3548 C++14.
3549
459260ec
DM
35502013-10-15 David Malcolm <dmalcolm@redhat.com>
3551
3552 * Makefile.in (PICFLAG): New.
3553 (ALL_CFLAGS): Add PICFLAG.
3554 (ALL_CXXFLAGS): Likewise.
3555 * configure.ac: Add --enable-host-shared, setting up new
3556 PICFLAG variable.
3557 * configure: Regenerate.
3558
fd6eea0c
RE
35592013-08-07 Richard Earnshaw <rearnsha@arm.com>
3560
3561 * configure.ac: Set need_64bit_hwint for all arm targets.
3562 * configure: Regenerated.
3563
8cf88735
JJ
35642013-07-20 Jakub Jelinek <jakub@redhat.com>
3565
3566 PR preprocessor/57620
3567 * lex.c (lex_raw_string): Undo phase1 and phase2 transformations
3568 between R" and final " rather than only in between R"del( and )del".
3569
87e356ba
JJ
35702013-07-10 Jakub Jelinek <jakub@redhat.com>
3571
d5e48350
JJ
3572 PR preprocessor/57824
3573 * lex.c (lex_raw_string): Allow reading new-lines if
3574 in_deferred_pragma or if parsing_args and there is still
3575 data in the current buffer.
3576
c26302d5
JJ
3577 * include/cpplib.h (cpp_token_val_index): Change parameter type to
3578 const cpp_token *.
3579 * lex.c (cpp_token_val_index): Likewise.
3580
87e356ba
JJ
3581 PR preprocessor/57757
3582 * lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING
3583 or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that
3584 starts if a-zA-Z_.
3585
c865f923
ESR
35862013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
3587
3588 * lex.c (lex_raw_string(), lex_string()): Constrain suffixes treated
3589 as concatenated literal and macro to just the patterns found in
3590 inttypes.h; (is_macro()): New.
3591
39953c79
DC
35922013-06-24 Dehao Chen <dehao@google.com>
3593
3594 * files.c (_cpp_stack_include): Fix the highest_location when header
3595 file is guarded by #ifndef and is included twice.
3596
01187df0
JJ
35972013-04-28 Jakub Jelinek <jakub@redhat.com>
3598
3599 N3472 binary constants
3600 * include/cpplib.h (struct cpp_options): Fix a typo in user_literals
3601 field comment. Add binary_constants field.
3602 * init.c (struct lang_flags): Add binary_constants field.
3603 (lang_defaults): Add bin_cst column to the table.
3604 (cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants).
3605 * expr.c (cpp_classify_number): Talk about C++11 instead of C++0x
3606 in diagnostics. Accept binary constants if
3607 CPP_OPTION (pfile, binary_constants) even when pedantic. Adjust
3608 pedwarn message.
3609
61949153
PC
36102013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
3611
3612 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y.
3613 * init.c (lang_defaults): Add defaults for the latter.
3614 (cpp_init_builtins): Define __cplusplus as 201300L for the latter.
3615 * lex.c (_cpp_lex_direct): Update.
3616
994a4cc0
SH
36172013-04-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
3618
3619 PR target/56771
3620 * configure.ac: Require 64-bit int for arm*-*-rtems*.
3621 * configure: Regenerate.
3622
28937f11
JJ
36232013-03-06 Jakub Jelinek <jakub@redhat.com>
3624
3625 PR middle-end/56461
3626 * internal.h (struct cpp_buffer): Add to_free field.
3627 (_cpp_pop_file_buffer): Add third argument.
3628 * files.c (_cpp_stack_file): Set buffer->to_free.
3629 (_cpp_pop_file_buffer): Add to_free argument. Free to_free
3630 if non-NULL, and if equal to file->buffer_start, also clear
3631 file->buffer{,_start,_valid}.
3632 * directives.c (_cpp_pop_buffer): Pass buffer->to_free
3633 to _cpp_pop_file_buffer.
3634
3b8af25b
JJ
36352013-03-01 Jakub Jelinek <jakub@redhat.com>
3636
3637 PR middle-end/56461
3638 * files.c (_cpp_save_file_entries): Free result at the end.
3639 * pch.c (cpp_string_free): New function.
3640 (cpp_save_state): Use it in htab_create call.
3641 (cpp_write_pch_deps): Free ss->defs. Destroy ss->definedhash.
3642
1a80db97
JJ
36432013-02-28 Jakub Jelinek <jakub@redhat.com>
3644
15fd8332
JJ
3645 * files.c (_cpp_find_file): If returning early, before storing
3646 something to *hash_slot and *hash_slot is NULL, call htab_clear_slot
3647 on it. Access *hash_slot using void * type rather than
3648 struct file_hash_entry * to avoid aliasing issues.
3649
1a80db97
JJ
3650 * configure.ac: Don't define ENABLE_CHECKING whenever
3651 --enable-checking is seen, instead use similar --enable-checking=yes
3652 vs. --enable-checking=release default as gcc/ subdir has and
3653 define ENABLE_CHECKING if ENABLE_CHECKING is defined in gcc/.
3654 Define ENABLE_VALGRIND_CHECKING if requested.
3655 * lex.c (new_buff): If ENABLE_VALGRIND_CHECKING, put _cpp_buff
3656 struct first in the allocated buffer and result->base after it.
3657 (_cpp_free_buff): If ENABLE_VALGRIND_CHECKING, free buff itself
3658 instead of buff->base.
3659 * config.in: Regenerated.
3660 * configure: Regenerated.
3661
561f7fc7
ESR
36622013-02-13 Ed Smith-Rowland <3dw4rd@verizon.net>
3663
3664 PR c++/55582
61949153 3665 * lex.c (lex_raw_string): Allow string literal with suffix
561f7fc7
ESR
3666 beginning with 's' to be parsed as a C++11 user-defined literal.
3667
500f3ed9
RS
36682013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
3669
3670 Update copyright years.
3671
1582c677
PC
36722013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
3673
3674 PR c++/54526 (again)
3675 * lex.c (_cpp_lex_direct): In C++11 mode, implement 2.5 p3, bullet 2.
3676
8ac16127
MG
36772013-01-03 Marc Glisse <marc.glisse@inria.fr>
3678
3679 PR bootstrap/50177
3680 * line-map.c (get_combined_adhoc_loc): Cast from extern "C" type.
3681 (new_linemap): Likewise.
3682 (linemap_enter_macro): Likewise.
3683
f41e5bd1
JJ
36842012-12-03 Jakub Jelinek <jakub@redhat.com>
3685
3686 PR bootstrap/55380
3687 PR other/54691
3688 * files.c (read_file_guts): Allocate extra 16 bytes instead of
3689 1 byte at the end of buf. Pass size + 16 instead of size
3690 to _cpp_convert_input.
3691 * charset.c (_cpp_convert_input): Reallocate if there aren't
3692 at least 16 bytes beyond to.len in the buffer. Clear 16 bytes
3693 at to.text + to.len.
3694
31962032
SE
36952012-11-21 Steve Ellcey <sellcey@mips.com>
3696
3697 PR pch/55399
3698 * files.c (pch_open_file): Fix check for implicit_preinclude.
3699
5dc99c46
SB
37002012-11-16 Simon Baldwin <simonb@google.com>
3701
3702 * include/cpplib.h (struct cpp_options): Add canonical_system_headers.
3703 * files.c (find_file_in_dir): Call maybe_shorter_path() only if
3704 canonical_system_headers is set.
3705 * init.c (cpp_create_reader): Initialize canonical_system_headers.
3706 * configure.ac: Add new --enable-canonical-system-headers.
3707 * configure: Regenerate.
3708 * config.in: Regenerate.
3709
a4a0016d
ESR
37102012-11-09 Ed Smith-Rowland <3dw4rd@verizon.net>
3711
3712 PR c++/54413
3713 * include/cpplib.h (cpp_interpret_float_suffix): Add cpp_reader* arg.
3714 (cpp_interpret_int_suffix): Add cpp_reader* arg.
3715 * init.c (cpp_create_reader): Iitialize new flags.
3716 * expr.c (interpret_float_suffix): Use new flags.
3717 (cpp_interpret_float_suffix): Add cpp_reader* arg.
3718 (interpret_int_suffix): Use new flags.
3719 (cpp_interpret_int_suffix): Add cpp_reader* arg.
3720 (cpp_classify_number): Adjust calls to interpret_x_suffix.
3721
04ce690f
IB
37222012-10-23 Ian Bolton <ian.bolton@arm.com>
3723 Jim MacArthur <jim.macarthur@arm.com>
3724 Marcus Shawcroft <marcus.shawcroft@arm.com>
3725 Nigel Stephens <nigel.stephens@arm.com>
3726 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
3727 Richard Earnshaw <rearnsha@arm.com>
3728 Sofiane Naci <sofiane.naci@arm.com>
3729 Stephen Thomas <stephen.thomas@arm.com>
3730 Tejas Belagod <tejas.belagod@arm.com>
3731 Yufeng Zhang <yufeng.zhang@arm.com>
3732
3733 * configure.ac: Enable AArch64.
3734 * configure: Regenerate.
3735
1efcb8c6
JM
37362012-10-23 Joseph Myers <joseph@codesourcery.com>
3737
3738 * files.c (struct _cpp_file): Add implicit_preinclude.
3739 (pch_open_file): Allow a previously opened implicitly included
3740 file.
3741 (_cpp_find_file): Add implicit_preinclude argument. Free file and
3742 do not call open_file_failed if implicit_preinclude. Store
3743 implicit_preinclude value.
3744 (_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date):
3745 Update calls to _cpp_find_file.
3746 (_cpp_stack_include): Handle IT_DEFAULT.
3747 (cpp_push_default_include): New.
3748 * include/cpplib.h (cpp_push_default_include): Declare.
3749 * init.c (cpp_read_main_file): Update call to _cpp_find_file.
3750 * internal.h (enum include_type): Add IT_DEFAULT.
3751 (_cpp_find_file): Update prototype.
3752
55e7f907
TB
37532012-10-15 Tobias Burnus <burnus@net-b.de>
3754
3755 * files.c (read_file_guts, _cpp_save_file_entries): Free memory
3756 before returning.
3757 * lex.c (warn_about_normalization): Ditto.
3758 * mkdeps.c (deps_save): Ditto.
3759 * pch.c (cpp_valid_state): Ditto.
3760
f591bd8f
FW
37612012-10-04 Florian Weimer <fweimer@redhat.com>
3762
3763 * directives.c (do_pragma_warning_or_error): New.
3764 (do_pragma_warning): New.
3765 (do_pragma_error): New.
3766 (_cpp_init_internal_pragmas): Register new pragmas.
3767
ec6e0399
DC
37682012-09-25 Dehao Chen <dehao@google.com>
3769
3770 PR middle-end/54704
3771 * line-map.c (location_adhoc_data_hash): Fix the hash function.
3772
52187008
DC
37732012-09-25 Dehao Chen <dehao@google.com>
3774
3775 PR middle-end/54645
3776 * include/line-map.h (location_adhoc_data): Move location_adhoc_data
3777 into GC.
3778 (location_adhoc_data_map): Likewise.
3779 (line_maps): Likewise.
3780 (rebuild_location_adhoc_htab): New Function.
3781 * line-map.c (+rebuild_location_adhoc_htab): new Funcion.
3782 (get_combined_adhoc_loc): Move location_adhoc_data into GC.
3783 (location_adhoc_data_fini): Likewise.
3784 (linemap_init): Likewise.
3785 (location_adhoc_data_init): Remove Function.
3786
5368224f
DC
37872012-09-19 Dehao Chen <dehao@google.com>
3788
3789 * include/line-map.h (MAX_SOURCE_LOCATION): New value.
3790 (location_adhoc_data_fini): New.
3791 (get_combined_adhoc_loc): New.
3792 (get_data_from_adhoc_loc): New.
3793 (get_location_from_adhoc_loc): New.
3794 (location_adhoc_data_map): New.
3795 (COMBINE_LOCATION_DATA): New.
3796 (IS_ADHOC_LOC): New.
3797 (expanded_location): New field.
3798 (line_maps): New field.
3799 * line-map.c (location_adhoc_data): New.
3800 (location_adhoc_data_hash): New.
3801 (location_adhoc_data_eq): New.
3802 (location_adhoc_data_update): New.
3803 (get_combined_adhoc_loc): New.
3804 (get_data_from_adhoc_loc): New.
3805 (get_location_from_adhoc_loc): New.
3806 (location_adhoc_data_init): New.
3807 (location_adhoc_data_fini): New.
3808 (linemap_init): Initialize location_adhoc_data.
3809 (linemap_lookup): Change to use new location.
3810 (linemap_ordinary_map_lookup): Likewise.
3811 (linemap_macro_map_lookup): Likewise.
3812 (linemap_macro_map_loc_to_def_point): Likewise.
3813 (linemap_macro_map_loc_unwind_toward_spel): Likewise.
3814 (linemap_get_expansion_line): Likewise.
3815 (linemap_get_expansion_filename): Likewise.
3816 (linemap_location_in_system_header_p): Likewise.
3817 (linemap_location_from_macro_expansion_p): Likewise.
3818 (linemap_macro_loc_to_spelling_point): Likewise.
3819 (linemap_macro_loc_to_def_point): Likewise.
3820 (linemap_macro_loc_to_exp_point): Likewise.
3821 (linemap_resolve_location): Likewise.
3822 (linemap_unwind_toward_expansion): Likewise.
3823 (linemap_unwind_to_first_non_reserved_loc): Likewise.
3824 (linemap_expand_location): Likewise.
3825 (linemap_dump_location): Likewise.
3826 (linemap_line_start): Likewise.
3827
f3d25c65
DS
38282012-05-25 Dodji Seketeli <dodji@redhat.com>
3829
3830 PR preprocessor/53469
3831 * directives.c (do_pragma): Use the virtual location for the
3832 pragma token, instead of its spelling location.
3833
0823efed
DN
38342012-08-14 Diego Novillo <dnovillo@google.com>
3835
3836 Merge from cxx-conversion branch. Configury.
3837
3838 * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
3839 * configure.ac: Likewise.
3840 * configure: Regenerate.
3841
38422012-08-14 Lawrence Crowl <crowl@google.com>
3843
3844 Merge from cxx-conversion branch. New C++ hash table.
3845
3846 * include/symtab.h (typedef struct ht hash_table): Change the typedef
3847 name to cpp_hash_table. Update all users of the typedef.
3848
c0fd3497
LB
38492012-07-30 Laurynas Biveinis <laurynas.biveinis@gmail.com>
3850
3851 * include/line-map.h (line_map_macro): Use the "atomic" GTY option
3852 for the macro_locations field.
3853
d35d1c0f
UB
38542011-06-19 Uros Bizjak <ubizjak@gmail.com>
3855
3856 * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
3857 __builtin_ia32_pcmpestri128 instead of asm.
3858
d86d2119
DA
38592012-06-04 Dimitrios Apostolou <jimis@gmx.net>
3860
3861 * line-map.c (linemap_enter_macro): Don't zero max_column_hint in
3862 every macro. This improves performance by reducing the number of
3863 reallocations when track-macro-expansion is on.
3864
7ca643e1
DS
38652012-06-04 Dodji Seketeli <dodji@redhat.com>
3866
3867 PR preprocessor/53463
3868 * line-map.c (linemap_location_in_system_header_p): For built-in
3869 macro tokens, check the first expansion point location that is not
3870 for a token coming from a built-in macro.
3871
7d9641cc
JM
38722012-05-29 Joseph Myers <joseph@codesourcery.com>
3873
3874 * directives.c: Fix typos.
3875 * include/line-map.h: Fix typos.
3876 * line-map.c: Fix typos.
3877 * macro.c: Fix typos.
3878
53a103d3
DS
38792012-05-25 Dodji Seketeli <dodji@redhat.com>
3880
3881 PR bootstrap/53459
3882 * lex.c (search_line_fast): Avoid unused local typedefs to simulate
3883 a static assertion.
3884
828a7f76
DS
38852012-05-29 Dodji Seketeli <dodji@redhat.com>
3886
3887 PR preprocessor/53229
3888 * internal.h (cpp_reader::set_invocation_location): Remove.
3889 (cpp_reader::about_to_expand_macro_p): New member flag.
3890 * directives.c (do_pragma): Remove Kludge as
3891 pfile->set_invocation_location is no more.
3892 * macro.c (cpp_get_token_1): Do away with the use of
3893 cpp_reader::set_invocation_location. Just collect the macro
3894 expansion point when we are about to expand the top-most macro.
3895 Do not override cpp_reader::about_to_expand_macro_p.
3896 This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding
3897 properly handle locations of expansion points.
3898 (cpp_get_token_with_location): Adjust, as
3899 cpp_reader::set_invocation_location is no more.
3900 (paste_tokens): Take a virtual location parameter for
3901 the LHS of the pasting operator. Use it in diagnostics. Update
3902 comments.
3903 (paste_all_tokens): Tighten the assert. Propagate the location of
3904 the expansion point when no virtual locations are available.
3905 Pass the virtual location to paste_tokens.
3906 (in_macro_expansion_p): New static function.
3907 (enter_macro_context): Set the cpp_reader::about_to_expand_macro_p
3908 flag until we really start expanding the macro.
3909
0b2c4be5
DS
39102012-05-16 Dodji Seketeli <dodji@redhat.com>
3911
3912 PR preprocessor/7263
3913 * include/cpplib.h (cpp_classify_number): Take a location
3914 parameter.
3915 * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic
3916 macros that take a location parameter.
3917 (cpp_classify_number): Take a (virtual) location parameter. Use
3918 it for diagnostics. Adjust comments.
3919 (eval_token): Take a location parameter. Pass it to
3920 cpp_classify_number and to diagnostic routines.
3921 (_cpp_parse_expr): Use virtual locations of tokens when parsing
3922 expressions. Pass a virtual location to eval_token and to
3923 diagnostic routines.
3924
638d2065
TG
39252012-05-10 Tristan Gingold <gingold@adacore.com>
3926
3927 * expr.c (interpret_float_suffix): Add a guard.
3928
3ad64f53
DS
39292012-05-02 Dodji Seketeli <dodji@redhat.com>
3930
3931 Properly initialize cpp_context in destringize_and_run
3932 * directives.c (destringize_and_run): Properly initialize the new
3933 context.
3934 * macro.c (_cpp_pop_context): Assert that we shouldn't try to pop
3935 the initial base context, which has the same life time as the
3936 current instance of cpp_file.
3937
b193dfa8
MLI
39382012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
3939 Dodji Seketeli <dodji@seketeli.org>
3940
3efc2959 3941 PR c++/52974
b193dfa8
MLI
3942 * libcpp/files.c (maybe_shorter_path): New.
3943 (find_file_in_dir): Use it.
3944
4e65a470
DS
39452012-04-30 Dodji Seketeli <dodji@redhat.com>
3946
51fce2d3
DS
3947 Switch -ftrack-macro-expansion=2 on by default.
3948 * init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
3949 by default. Add comments.
3950
c4ca1a09
DS
3951 Strip "<built-in>" loc from displayed expansion context
3952 * include/line-map.h (linemap_unwind_toward_expansion): Fix typo
3953 in comment.
3954 (linemap_unwind_to_first_non_reserved_loc): Declare new function.
3955 * line-map.c (linemap_unwind_to_first_non_reserved_loc): Define
3956 new function.
3957
3600218c
DS
3958 Fix expansion point loc for macro-like tokens
3959 * macro.c (macro_of_context): New static function.
3960 (_cpp_push_token_context, push_extended_tokens_context): If the
3961 macro argument is NULL, it means we are continuing the expansion
3962 of the current macro, if any. Update comments.
3963 (_cpp_pop_context): Re-enable expansion of the macro only when we
3964 are really out of the context of the current expansion.
3965
0ff2b8a0
DS
3966 Fix token pasting with -ftrack-macro-expansion
3967 * macro.c (paste_all_tokens): Put the token resulting from pasting
3968 into an extended token context with -ftrack-macro-location is in
3969 effect.
3970
4e65a470
DS
3971 Fix cpp_sys_macro_p with -ftrack-macro-expansion
3972 * macro.c (cpp_sys_macro_p): Support -ftrack-macro-expansion.
3973
112448b4
DS
39742012-04-29 Dodji Seketeli <dodji@redhat.com>
3975
3976 * lex.c (lex_raw_string): Change C++ style comments into C style
3977 comments.
19a9ba64 3978 (lex_string): Likewise.
112448b4 3979
7f5f5f98
OW
39802012-04-27 Ollie Wild <aaw@google.com>
3981
3982 * include/cpplib.h (struct cpp_options): Add new field,
3983 warn_literal_suffix.
3984 (CPP_W_LITERAL_SUFFIX): New enum.
3985 * init.c (cpp_create_reader): Default initialization of
3986 warn_literal_suffix.
3987 * lex.c (lex_raw_string): Treat user-defined literals which don't
3988 begin with '_' as separate tokens and produce a warning.
3989 (lex_string): Ditto.
3990
1d72e96f
MLI
39912012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
3992
3993 * line-map.c (linemap_resolve_location): Synchronize comments with
3994 those in line-map.h.
3995 * include/line-map.h (linemap_resolve_location): Fix spelling in
3996 comment.
3997
e75b54a2
RE
39982012-03-22 Richard Earnshaw <rearnsha@arm.com>
3999
4000 * lex.c (search_line_fast): Provide Neon-optimized version for ARM.
4001
7888f266
RO
40022012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4003
4004 * lex.c: Remove Solaris 8 reference.
4005
dd552284
WL
40062012-02-14 Walter Lee <walt@tilera.com>
4007
4008 * configure.ac: Require 64-bit hwint for tilegx and tilepro.
4009 * configure: Regenerate.
4010
2c5cbc31
RG
40112012-01-09 Richard Guenther <rguenther@suse.de>
4012
4013 * macro.c (_cpp_builtin_macro_text): Remove unused variable map.
4014
b492b686
GF
40152012-01-09 Gary Funck <gary@intrepid.com>
4016
4017 PR preprocessor/33919
4018 * files.c (_cpp_get_file_name): New. Implement file name
4019 access function.
4020 * internal.h (_cpp_get_file_name): New prototype.
4021 * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
4022 to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
4023
75291c57
OH
40242012-01-03 Olivier Hainque <hainque@adacore.com>
4025
4026 * system.h: Prior to #define, #undef fopen and freopen unconditionally.
4027
48b0b196
JM
40282011-12-20 Joseph Myers <joseph@codesourcery.com>
4029
4030 * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
4031 (CLK_STDC1X): Change to CLK_STDC11.
4032 * init.c (lang_defaults): Update comments.
4033 (cpp_init_builtins): Update language tests. Use 201112L for C11
4034 __STDC_VERSION__.
4035
4a5e00ca
AS
40362011-12-20 Andreas Schwab <schwab@linux-m68k.org>
4037
4038 * configure: Regenerate.
4039
095af58f
AS
40402011-12-19 Andreas Schwab <schwab@linux-m68k.org>
4041
4042 * configure: Regenerate.
4043
b0c084b7
JJ
40442011-12-07 Jakub Jelinek <jakub@redhat.com>
4045
4046 PR bootstrap/50237
4047 * internal.h (_cpp_init_lexer): New prototype.
4048 * init.c (init_library): Call it.
4049 * lex.c (init_vectorized_lexer): Remove constructor attribute,
4050 add inline keyword.
4051 (HAVE_init_vectorized_lexer): Define.
4052 (_cpp_init_lexer): New function.
4053
9b554be9
DS
40542011-12-03 Dodji Seketeli <dodji@redhat.com>
4055
4056 * macro.c (tokens_buff_remove_last_token)
4057 (tokens_buff_put_token_to): Add an 'inline' function specifier to
4058 the prototype.
4059
8dcf72a8
DN
40602011-11-22 Diego Novillo <dnovillo@google.com>
4061
4062 * include/line-map.h (linemap_dump): Declare.
4063 (line_table_dump): Declare.
4064 * line-map.c (linemap_dump): New.
4065 (line_table_dump): New.
4066
7e74ce3f
ESR
40672011-11-21 Ed Smith-Rowland <3dw4rd@verizon.net>
4068
4069 PR c++/50958
4070 * expr.c (cpp_userdef_char_remove_type): Fix typo.
4071
e9411247
MM
40722011-11-03 Michael Matz <matz@suse.de>
4073
4074 PR bootstrap/50857
4075 * configure.ac: Check for -fno-exceptions -fno-rtti.
4076 * configure: Regenerate.
4077 * Makefile.in (NOEXCEPTION_FLAGS): New flag.
4078 (ALL_CXXFLAGS): Use it.
4079
0c1dace3
PC
40802011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
4081
4082 * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
4083
25339f10
JM
40842011-11-02 Jason Merrill <jason@redhat.com>
4085
4086 PR c++/50810
4087 * configure.ac: Add -Wno-narrowing to warning options.
4088
97e3ad20
JM
40892011-10-31 Jason Merrill <jason@redhat.com>
4090
1fb80b0c
JM
4091 PR libstdc++/1773
4092 * init.c (cpp_init_builtins): Set __cplusplus for C++11.
4093
97e3ad20
JM
4094 PR c++/50920
4095 * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
4096 CLK_GNUCXX0X to CLK_GNUCXX11.
4097
3ce4f9e4
ESR
40982011-10-26 Ed Smith-Rowland <3dw4rd@verizon.net>
4099
4100 Implement C++11 user-defined literals.
4101 * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
4102 cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
4103 cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
4104 cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
4105 (cpp_classify_number): Classify unrecognized tokens as user-defined
4106 literals.
4107 * include/cpplib.h: Add new tokens for user-defined literals.
4108 * init.c: Add new preprocessor flag (cxx11).
4109 * lex.c: (lex_string, lex_raw_string): Handle user-defined literals
4110 including concatenation and promotion with suffixes.
4111
3bb0c8db
DS
41122011-10-24 Dodji Seketeli <dodji@redhat.com>
4113
4114 * line-map.c (linemap_macro_map_lookup): Fix logic.
4115
84756fd4
DS
41162011-10-24 Dodji Seketeli <dodji@redhat.com>
4117
4118 * include/line-map.h (linemap_expand_location): Take a line table
4119 parameter. Update comment.
4120 (linemap_resolve_location): Update comment.
4121 (linemap_expand_location_full): Remove.
4122 * line-map.c (linemap_resolve_location): Handle reserved
4123 locations; return a NULL map in those cases.
4124 (linemap_expand_location): If location is reserved, return a
4125 zeroed expanded location. Update comment. Take a line table to
4126 assert that the function takes non-virtual locations only.
4127 (linemap_expand_location_full): remove.
4128 (linemap_dump_location): Handle the fact that
4129 linemap_resolve_location can return NULL line maps when the
4130 location resolves to a reserved location.
4131
4132 * line-map.c (linemap_macro_map_lookup): Fix logic.
4133
ad2305ad
DS
41342011-10-22 Dodji Seketeli <dodji@redhat.com>
4135
4136 PR bootstrap/50778
4137 * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
4138 context to act upon.
4139 * lex.c (_cpp_remaining_tokens_num_in_context): Likewise. Update
4140 comment.
4141 (cpp_token_from_context_at): Likewise.
4142 (cpp_peek_token): Use the context to peek tokens from.
4143
cbbcf655
DS
41442011-10-20 Dodji Seketeli <dodji@redhat.com>
4145
4146 PR bootstrap/50801
4147 * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
4148 number of tokens.
4149
d17687f6
DS
41502011-10-18 Dodji Seketeli <dodji@redhat.com>
4151
4152 PR bootstrap/50760
4153 * include/line-map.h (struct linemap_stats): Change the type of
19a9ba64 4154 the members from size_t to long.
d17687f6 4155 * macro.c (macro_arg_token_iter_init): Unconditionally initialize
19a9ba64 4156 iter->location_ptr.
d17687f6 4157
411f92de
DS
41582011-10-17 Dodji Seketeli <dodji@redhat.com>
4159
4160 * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
19a9ba64
AM
4161 variable without using it if ENABLE_CHECKING is not defined. Mark
4162 the LOCATION parameter as being unused.
411f92de 4163
b9bd6f74
TT
41642011-10-15 Tom Tromey <tromey@redhat.com>
4165 Dodji Seketeli <dodji@redhat.com>
4166
4167 * include/line-map.h (struct line_maps::alloced_size_for_request):
4168 New member.
4169 * line-map.c (new_linemap): Use set->alloced_size_for_request to
4170 get the actual allocated size of line maps.
4171
64a1a422
TT
41722011-10-15 Tom Tromey <tromey@redhat.com>
4173 Dodji Seketeli <dodji@redhat.com>
4174
4175 * line-map.h (struct linemap_stats): Declare new struct.
4176 (linemap_get_statistics): Declare ...
4177 * line-map.c (linemap_get_statistics): ... new function.
4178 * macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
4179 Declare new counters.
4180 (enter_macro_context, replace_args): Update
4181 num_macro_tokens_counter.
4182 (cpp_get_token_1): Update num_expanded_macros_counter.
4183
847e697a
TT
41842011-10-15 Tom Tromey <tromey@redhat.com>
4185 Dodji Seketeli <dodji@redhat.com>
4186
4187 * include/cpplib.h (struct cpp_options)<debug>: New struct member.
4188 * include/line-map.h (linemap_dump_location): Declare ...
4189 * line-map.c (linemap_dump_location): ... new function.
4190
92582b75
TT
41912011-10-15 Tom Tromey <tromey@redhat.com>
4192 Dodji Seketeli <dodji@redhat.com>
4193
4194 * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
4195 New option.
4196 * internal.h (struct macro_context): New struct.
4197 (enum context_tokens_kind): New enum.
4198 (struct cpp_context)<tokens_kind>: New member of type enum
4199 context_tokens_kind.
4200 (struct cpp_context)<macro>: Remove this. Replace it with an enum
4201 of macro and macro_context.
4202 (struct cpp_context)<direct_p>: Remove.
4203 (_cpp_remaining_tokens_num_in_context): Declare new function.
4204 * directives.c (destringize_and_run): Adjust.
4205 * lex.c (_cpp_remaining_tokens_num_in_context)
4206 (_cpp_token_from_context_at): Define new functions
4207 (cpp_peek_token): Use them.
4208 * init.c (cpp_create_reader): Initialize the base context to zero.
4209 (_cpp_token_from_context_at): Define new static function.
4210 (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
4211 _cpp_token_from_context_at.
4212 * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
4213 members.
4214 (enum macro_arg_token_kind): New enum.
4215 (struct macro_arg_token_iter): New struct.
4216 (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
4217 (alloc_expanded_arg_mem, ensure_expanded_arg_room)
4218 (delete_macro_args, set_arg_token, get_arg_token_location)
4219 (arg_token_ptr_at, macro_arg_token_iter_init)
4220 (macro_arg_token_iter_get_token)
4221 (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
4222 (expanded_token_index, tokens_buff_new, tokens_buff_count)
4223 (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
4224 (tokens_buff_add_token, tokens_buff_remove_last_token)
4225 (reached_end_of_context, consume_next_token_from_context): New
4226 static functions.
4227 (cpp_get_token_1): New static function. Split and extended from
4228 cpp_get_token. Use reached_end_of_context and
4229 consume_next_token_from_context. Unify its return point. Move
4230 the location tweaking from cpp_get_token_with_location in here.
4231 (cpp_get_token): Use cpp_get_token_1
4232 (stringify_arg): Use the new arg_token_at.
4233 (paste_all_tokens): Support tokens coming from extended tokens
4234 contexts.
4235 (collect_args): Return the number of collected arguments, by
4236 parameter. Store virtual locations of tokens that constitute the
4237 collected args.
4238 (funlike_invocation_p): Return the number of collected arguments,
4239 by parameter.
4240 (enter_macro_context): Add a parameter for macro expansion point.
4241 Pass it to replace_args and to the "used" cpp callback. Get the
4242 number of function-like macro arguments from funlike_invocation_p,
4243 pass it to the new delete_macro_args to free the memory used by
4244 macro args. When -ftrack-macro-expansion is in effect, for macros
4245 that have no arguments, create a macro map for the macro expansion
4246 and use it to allocate proper virtual locations for tokens
4247 resulting from the expansion. Push an extended tokens context
4248 containing the tokens resulting from macro expansion and their
4249 virtual locations.
4250 (replace_args): Rename the different variables named 'count' into
4251 variables with more meaningful names. Create a macro map;
4252 allocate virtual locations of tokens resulting from this
4253 expansion. Use macro_arg_token_iter to iterate over tokens of a
4254 given macro. Handle the case of the argument of
4255 -ftrack-macro-expansion being < 2. Don't free macro arguments
4256 memory resulting from expand_arg here, as these are freed by the
4257 caller of replace_arg using delete_macro_args now. Push extended
4258 token context.
4259 (next_context, push_ptoken_context, _cpp_push_token_context)
4260 (_cpp_push_text_context): Properly initialize the context.
4261 (expand_arg): Use the new alloc_expanded_arg_mem,
4262 push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
4263 (_cpp_pop_context): Really free the memory held by the context.
4264 Handle freeing memory used by extended tokens contexts.
4265 (cpp_get_token_with_location): Use cpp_get_token_1.
4266 (cpp_sys_macro_p): Adjust.
4267 (_cpp_backup_tokens): Support the new kinds of token contexts.
4268 * traditional.c (recursive_macro): Adjust.
4269
46427374
TT
42702011-10-15 Tom Tromey <tromey@redhat>
4271 Dodji Seketeli <dodji@redhat.com>
4272
4273 * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
4274 member.
4275 (MAX_SOURCE_LOCATION): New constant.
4276 (struct line_map_ordinary, struct line_map_macro): New structs.
19a9ba64 4277 (struct line_map): Turn this into a union of the two above. Add
46427374
TT
4278 comments.
4279 (struct maps_info): New struct.
4280 (struct line_maps)<info_ordinary, info_macro>: Two new fields.
4281 These now carry the map information that was previously scattered
4282 in struct line_maps.
4283 (struct map_info::allocated): Fix comment.
4284 (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
4285 (ORDINARY_MAP_STARTING_LINE_NUMBER)
4286 (ORDINARY_MAP_INCLUDER_FILE_INDEX)
4287 (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
4288 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
4289 (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
4290 (MACRO_MAP_EXPANSION_POINT_LOCATION)
4291 (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
4292 (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
4293 (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
4294 (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
4295 (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
4296 (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
4297 (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
4298 (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
4299 (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
4300 (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
4301 (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
4302 information.
4303 (linemap_check_ordinary, linemap_assert)
4304 (linemap_location_before_p): New macros.
4305 (linemap_position_for_line_and_column)
4306 (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
4307 (linemap_macro_expansion_map_p)
4308 (linemap_macro_map_loc_to_def_point)
4309 (linemap_macro_map_loc_unwind_once)
4310 (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
4311 (linemap_get_source_line linemap_get_source_column)
4312 (linemap_map_get_macro_name, linemap_get_file_path)
4313 (linemap_location_in_system_header_p)
4314 (linemap_location_from_macro_expansion_p): Declare new functions.
4315 (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
4316 (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
4317 accessors act on ordinary maps only.
4318 (INCLUDED_FROM): Return NULL for main files; use the new
4319 accessors.
4320 (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
4321 (struct expanded_location): Move here from gcc/input.h
4322 (linemap_resolve_location, linemap_expand_location)
4323 (linemap_expand_location_full): Declare new functions.
4324 * line-map.c: Include cpplib.h, internal.h
4325 (linemap_enter_macro, linemap_add_macro_token)
4326 (linemap_get_expansion_line, linemap_get_expansion_filename): New
4327 functions that are private to libcpp.
4328 (linemap_assert): New macro.
4329 (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
4330 (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
4331 (linemap_macro_map_loc_unwind_toward_spelling)
4332 (linemap_macro_map_loc_to_exp_point)
4333 (first_map_in_common_1, first_map_in_common): New static
4334 functions.
4335 (new_linemap): Define new static functions. Extracted and
4336 enhanced from ...
4337 (linemap_add): ... here. Use linemap_assert in lieu of abort
4338 previously.
4339 (linemap_tracks_macro_expansion_locs_p)
4340 (linemap_add_macro_token, linemap_macro_expansion_map_p)
4341 (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
4342 (linemap_macro_map_loc_to_def_point)
4343 (linemap_macro_map_loc_unwind_once)
4344 (linemap_step_out_once, linemap_map_get_index)
4345 (linemap_get_source_line,linemap_get_source_column)
4346 (linemap_get_file_path, linemap_map_get_macro_name)
4347 (linemap_location_in_system_header_p)
4348 (linemap_location_originated_from_system_header_p)
4349 (linemap_location_from_macro_expansion_p)
4350 (linemap_tracks_macro_expansion_locs_p)
4351 (linemap_resolve_location, linemap_expand_location)
4352 (linemap_expand_location_full)
4353 (linemap_tracks_macro_expansion_locs_p)
4354 (linemap_position_for_line_and_column, linemap_compare_locations):
4355 Define new public functions.
4356 (linemap_init): Initialize ordinary and macro maps information in
4357 the map set.
4358 (linemap_check_files_exited): Use the new accessors.
4359 (linemap_free): Remove this dead code.
4360 (linemap_line_start): Assert this uses an ordinary map. Adjust to
4361 use the new ordinary map accessors and data structures. Don't
4362 overflow past the lowest possible macro token's location.
4363 (linemap_position_for_column): Assert the ordinary maps of the map
4364 set are really ordinary. Use ordinary map accessors.
4365 (linemap_lookup): Keep the same logic but generalize to allow
4366 lookup of both ordinary and macro maps. Do not crash when called
4367 with an empty line table.
4368 * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
4369 new API of line-map.h.
4370 * directives.c (start_directive, do_line, do_linemarker)
4371 (do_linemarker): Likewise.
4372 * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
4373 (make_cpp_dir, cpp_make_system_header): Likewise.
4374 * init.c (cpp_read_main_file): Likewise.
4375 * internal.h (CPP_INCREMENT_LINE): Likewise.
4376 (linemap_enter_macro, linemap_add_macro_token)
4377 (linemap_get_expansion_line, linemap_get_expansion_filename): New
4378 functions private to libcpp.
4379 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
4380 (skip_line_comment, skip_whitespace, lex_raw_string)
4381 (_cpp_lex_direct): Likewise.
4382 * macro.c (_cpp_builtin_macro_text): Likewise.
4383 (_cpp_aligned_alloc): Initialize the new name member of the macro.
4384 * traditional.c (copy_comment, _cpp_scan_out_logical_line):
4385 Likewise.
4386 * errors.c (cpp_diagnostic): Adjust to new linemap API.
4387
892a371f
DS
43882011-08-28 Dodji Seketeli <dodji@redhat.com>
4389
4390 * line-map.c (linemap_add): Assert that reason must not be
4391 LC_RENAME when called for the first time on a "main input file".
4392
e3dfef44
GC
43932011-08-22 Gabriel Charette <gchare@google.com>
4394
4395 * init.c (cpp_create_reader): Inititalize forced_token_location_p.
4396 * internal.h (struct cpp_reader): Add field forced_token_location_p.
4397 * lex.c (_cpp_lex_direct): Use forced_token_location_p.
4398 (cpp_force_token_locations): New.
4399 (cpp_stop_forcing_token_locations): New.
4400
32fe396e
RO
44012011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4402
4403 PR libstdc++/1773
4404 * init.c (cpp_init_builtins): Define __cplusplus 19971L.
4405
7c1ffff9
JM
44062011-08-18 Joseph Myers <joseph@codesourcery.com>
4407
4408 * include/cpplib.h (struct cpp_options): Fix typo.
4409
a48e3dd1
JM
44102011-08-18 Joseph Myers <joseph@codesourcery.com>
4411
4412 * include/cpplib.h (struct cpp_options): Add rliterals.
4413 * init.c (struct lang_flags, lang_defaults): Add rliterals.
4414 (cpp_set_lang): Set rliterals option.
4415 (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
4416 * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
4417
3f6ced10
GC
44182011-08-15 Gabriel Charette <gchare@google.com>
4419
4420 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
4421 Update all users to use linemap_position_for_column instead.
4422
0681d04c
GC
44232011-07-28 Gabriel Charette <gchare@google.com>
4424
4425 * include/line-map.h (struct line_maps):
4426 Remove unused field last_listed. Update all users.
4427
5e9627ca
L
44282011-07-28 H.J. Lu <hongjiu.lu@intel.com>
4429
4430 * configure.ac: Set need_64bit_hwint to yes for x86 targets.
4431 * configure: Regenerated.
4432
a024b70f
RO
44332011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4434
4435 * system.h [__cplusplus]: Wrap C function declarations in extern "C".
4436
5b6d595b
RO
44372011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4438 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4439
4440 PR bootstrap/49794
4441 * configure.ac: Test AM_ICONV with CXX.
4442 * configure: Regenerate.
4443 * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
4444
d0a9fbe1
DS
44452011-07-15 Dodji Seketeli <dodji@redhat.com>
4446
4447 * directives.c (struct if_stack): Use source_location as type
4448 here.
4449 * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
4450 indent, def_pragma, used_define, used_undef>: Properly use
4451 source_location as parameter type, rather than unsigned int.
4452
fbdd5d87
RO
44532011-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4454
4455 PR target/39150
4456 * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
4457 like i[34567]86-*-solaris2.1[0-9]*.
4458 * configure: Regenerate.
4459
8787a05a
JM
44602011-06-16 Jason Merrill <jason@redhat.com>
4461
4462 PR c++/45399
4463 * lex.c (lex_raw_string): Don't check for embedded NUL.
4464
38fbfaf6
DS
44652011-06-06 Dodji Seketeli <dodji@redhat.com>
4466
4467 PR preprocessor/48532
4468 * directives.c (do_pragma): Don't forget the invocation location
4469 when parsing the pragma name of a namespaced pragma directive.
4470
fc0993ac
JT
44712011-05-29 John Tytgat <John.Tytgat@aaug.net>
4472
4473 * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
4474
ef230b38
UB
44752011-05-22 Uros Bizjak <ubizjak@gmail.com>
4476
4477 PR target/49104
4478 * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
4479 is defined. Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
4480
e5b0dad8
JK
44812011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
4482
4483 * system.h (ENUM_BITFIELD): Remove.
4484
6cfae070
JJ
44852011-04-24 Jakub Jelinek <jakub@redhat.com>
4486
4487 PR preprocessor/48740
4488 * lex.c (lex_raw_string): When raw string ends with
4489 ??) followed by raw prefix and ", ensure it is preprocessed
4490 with ??) rather than ??].
4491
04695783
JM
44922011-04-20 Jim Meyering <meyering@redhat.com>
4493
4494 * files.c (destroy_cpp_file): Remove useless if-before-free.
4495 * init.c (cpp_destroy): Likewise.
4496 * macro.c (replace_args): Likewise.
4497 * pch.c (cpp_valid_state): Likewise.
4498
4489800d
KT
44992011-03-25 Kai Tietz <ktietz@redhat.com>
4500
4501 * files.c (file_hash_eq): Use filename_cmp
4502 instead of strcmp.
4503 (nonexistent_file_hash_eq): Likewise.
4504 (remap_filename): Likewise.
4505 Handle absolute DOS-path,
4506 (append_file_to_dir): Check for IS_DIR_SEPARATOR
4507 instead of slash.
4508 (read_name_map): Likewise.
4509 * linemap.c (linemap_add): Use filename_cmp
4510 instead of strcmp.
4511 * mkdeps.c (apply_vpath): Use filename_ncmp
4512 instead of strncmp.
4513 (deps_restore): Use filename_cmp instead of
4514 strcmp.
4515 * init.c (read_original_directory): Use
4516 IS_DIR_SEPARATOR instead of checking for slash.
4517
f3c33d9d
MM
45182011-03-21 Michael Meissner <meissner@linux.vnet.ibm.com>
4519
4520 PR preprocessor/48192
4521 * directives.c (do_ifdef): Do not consider conditional macros as
4522 being defined.
4523 (do_ifndef): Ditto.
4524 * expr.c (parse_defined): Ditto.
4525
01956319
RH
45262011-03-18 Richard Henderson <rth@redhat.com>
4527
4528 PR bootstrap/45381
4529 * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
4530
c5a62c6f 45312011-11-04 Eric Botcazou <ebotcazou@adacore.com>
19a9ba64 4532 Jakub Jelinek <jakub@redhat.com>
c5a62c6f
EB
4533
4534 PR preprocessor/39213
4535 * directives.c (end_directive): Call _cpp_remove_overlay for deferred
4536 pragmas as well in traditional mode.
4537
0e1a989c
ILT
45382010-11-17 Ian Lance Taylor <iant@google.com>
4539
4540 PR bootstrap/45538
4541 * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of
4542 AC_LANG based on ENABLE_BUILD_WITH_CXX.
4543
651a20b5
KT
45442010-11-16 Kai Tietz <kai.tietz@onevision.com>
4545
4546 PR preprocessor/17349
4547 * lex.c (save_comment): Handle in argument passing c++
4548 comments special.
4549
480767a9
ILT
45502010-11-02 Ian Lance Taylor <iant@google.com>
4551
4552 * configure.ac: Use AC_SYS_LARGEFILE.
4553 * configure: Rebuild.
4554 * config.in: Rebuild.
4555
078419c9 45562010-10-19 Basile Starynkevitch <basile@starynkevitch.net>
480767a9 4557
078419c9
BS
4558 * line-map.h (source_location): Remove obsolete comment
4559 mentioning location_s.
4560
d6874138
KT
45612010-09-29 Kai Tietz <kai.tietz@onevision.com>
4562
4563 PR preprocessor/45362
4564 * directives.c (cpp_pop_definition): Make static.
4565 (do_pragma_push_macro): Reworked to store text
4566 definition.
4567 (do_pragma_pop_macro): Add free text definition.
4568 (cpp_push_definition): Removed.
4569 * include/cpplib.h (cpp_push_definition): Removed.
4570 (cpp_pop_definition): Likewise.
4571 * internal.h (def_pragma_macro): Remove member 'value'
4572 and add new members 'definition', 'line',
4573 'syshdr', 'sued' and 'is_undef'.
4574 * pch.c (_cpp_restore_pushed_macros): Rework to work
4575 on text definition and store additional macro flags.
4576 (_cpp_save_pushed_macros): Likewise.
4577
e3339d0f
JM
45782010-09-29 Joseph Myers <joseph@codesourcery.com>
4579
4580 * include/cpplib.h (cpp_options): Rename warn_deprecated,
4581 warn_traditional, warn_long_long and pedantic.
4582 * directives.c (directive_diagnostics, _cpp_handle_directive):
4583 Update names of cpp_options members.
4584 * expr.c (cpp_classify_number, eval_token): Update names of
4585 cpp_options members.
4586 * init.c (cpp_create_reader, post_options): Update names of
4587 cpp_options members.
4588 * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
4589 cpp_options members.
4590 * macro.c (parse_params): Update names of cpp_options members.
4591
128465e6
ILT
45922010-09-15 Ian Lance Taylor <iant@google.com>
4593
4594 * init.c: Fix type name in comment.
4595
a69d2520
JJ
45962010-08-31 Jakub Jelinek <jakub@redhat.com>
4597
4598 PR preprocessor/45457
4599 * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
4600 needed.
4601 * directives.c (do_ifdef, do_ifndef): Likewise.
4602
707bcb7a
RO
46032010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4604
4605 * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
4606
6f173e52
RH
46072010-08-24 Richard Henderson <rth@redhat.com>
4608
4609 PR bootstrap/45376
4610 * configure.ac (HAVE_SSE4): New check.
4611 * configure, config.in: Rebuild.
4612 * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
4613
789d73cb
RO
46142010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4615
4616 * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
4617 etc. on Solaris 2/x86.
4618
246a2fcb
RH
46192010-08-21 Richard Henderson <rth@redhat.com>
4620 Andi Kleen <ak@linux.intel.com>
4621 David S. Miller <davem@davemloft.net>
4622
4623 * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
4624 (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
4625 (ptrdiff_t): Check via AC_CHECK_TYPE.
4626 * config.in, configure: Rebuild.
4627 * system.h: Include stdint.h, if available.
4628 * lex.c (WORDS_BIGENDIAN): Provide default.
4629 (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
4630 acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
4631 search_line_sse2, search_line_sse42, init_vectorized_lexer,
4632 search_line_fast): New.
4633 (_cpp_clean_line): Use search_line_fast. Restructure the fast
4634 loop to make it clear when we're leaving the loop. Stay in the
4635 fast loop for non-trigraph '?'.
4636
8e680db5
JJ
46372010-06-11 Jakub Jelinek <jakub@redhat.com>
4638
4639 * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
4640 callback.
4641 (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
4642 (cpp_macro_definition): Remove const qual from second argument.
4643 * macro.c (enter_macro_context): Call user_builtin_macro callback for
4644 NODE_BUILTIN !NODE_USED macros.
4645 (warn_of_redefinition): Likewise. Remove const qual from second
4646 argument.
4647 (cpp_macro_definition): Likewise.
4648 * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
4649 for NODE_BUILTIN !NODE_USED macros.
4650
1cb42611
JM
46512010-06-10 Joseph Myers <joseph@codesourcery.com>
4652
4653 * include/cpplib.h (struct cpp_options): Remove show_column.
4654 * init.c (cpp_create_reader, post_options): Don't set show_column.
4655
ff5dfc48
JR
46562010-06-09 Joern Rennecke <joern.rennecke@embecosm.com>
4657
4658 PR bootstrap/44432
4659 * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
4660 check that C++ compiler works.
4661 * configure: Regenerate.
4662
a9429e29
LB
46632010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
4664
4665 * include/symtab.h (ht_identifier_ptr): New.
4666
c3f247f4
RW
46672010-06-03 Joern Rennecke <joern.rennecke@embecosm.com>
4668 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4669
4670 PR bootstrap/42798
4671 * configure.ac: Check for declaration of 'basename(char *)'.
4672 * configure: Regenerate.
4673 * config.in: Regenerate.
4674
2778d766
JM
46752010-04-25 Joseph Myers <joseph@codesourcery.com>
4676
4677 * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
4678 * init.c (lang_defaults): Add entries for new language variants.
4679 (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
4680 variants.
4681
d8a12e84
MLI
46822010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
4683
4684 PR cpp/43195
4685 * files.c (report_missing_guard): Test for #pragma once.
4686
87cf0651
SB
46872010-04-07 Simon Baldwin <simonb@google.com>
4688
4689 * directives.c (do_diagnostic): Add warning reason argument,
4690 call appropriate error reporting function for code.
4691 (directive_diagnostics): Call specific warning functions with
4692 warning reason where appropriate.
4693 (do_error, do_warning, do_pragma_dependency): Add warning reason
4694 argument to do_diagnostic calls.
4695 * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
4696 _cpp_create_definition): Call specific warning functions with
4697 warning reason where appropriate.
4698 * Makefile.in: Add new diagnostic functions to gettext translations.
4699 * include/cpplib.h (struct cpp_callbacks): Add warning reason code
4700 to error callback.
4701 (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
4702 CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
4703 (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
4704 CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
4705 CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
4706 CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
4707 CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
4708 CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
4709 CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
4710 warning reason codes.
4711 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
4712 cpp_warning_with_line, cpp_pedwarning_with_line,
4713 cpp_warning_with_line_syshdr): New specific error reporting functions.
4714 * pch.c (cpp_valid_state): Call specific warning functions with
4715 warning reason where appropriate.
4716 * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
4717 diagnostic handlers.
4718 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
4719 cpp_warning_with_line, cpp_pedwarning_with_line,
4720 cpp_warning_with_line_syshdr): New specific error reporting functions.
4721 * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
4722 specific warning functions with warning reason where appropriate.
4723 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
4724 warn_about_normalization, lex_identifier_intern, lex_identifier,
4725 _cpp_lex_direct): Ditto.
4726 * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
4727 narrow_str_to_charconst): Ditto.
4728
d947ada0
JJ
47292010-04-06 Jakub Jelinek <jakub@redhat.com>
4730
4731 PR preprocessor/43642
4732 * lex.c (lex_raw_string): Change type of TYPE variable to
4733 unsigned char.
4734
4d9e8446
RW
47352010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4736
4737 * aclocal.m4: Regenerate.
4738
52150625
JM
47392010-03-29 Jason Merrill <jason@redhat.com>
4740
00a81b8b
JM
4741 More N3077 raw string changes
4742 * charset.c (cpp_interpret_string): Don't transform UCNs in raw
4743 strings.
4744 * lex.c (bufring_append): Split out from...
4745 (lex_raw_string): ...here. Undo trigraph and line splicing
4746 transformations. Do process line notes in multi-line literals.
4747 (_cpp_process_line_notes): Ignore notes that were already handled.
4748
52150625
JM
4749 Some raw string changes from N3077
4750 * charset.c (cpp_interpret_string): Change inner delimiters to ().
4751 * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter.
4752
709d7160
JJ
47532010-02-11 Jakub Jelinek <jakub@redhat.com>
4754
4755 * init.c (read_original_filename): Don't call read_original_directory
4756 if _cpp_handle_directive returns 0.
4757
dadab4fd
JM
47582010-01-01 Joseph Myers <joseph@codesourcery.com>
4759
4760 PR preprocessor/41947
4761 * expr.c (cpp_classify_number): Give error for hexadecimal
4762 floating-point constant with no digits before or after point.
4763
3de8a540
AC
47642009-11-20 Arnaud Charlet <charlet@adacore.com>
4765
4766 * macro.c (enter_macro_context): Call cb.used callback if defined.
4767 * directives.c (do_idef, do_ifndef): Ditto.
4768 * include/cpplib.h (struct cpp_callbacks): Add used callback.
4769
17e7cb85
KT
47702009-11-11 Kai Tietz <kai.tietz@onevision.com>
4771
4772 * directives.c (do_pragma_push_macro): New pragma handler.
4773 (do_pragma_pop_macro): Likewise.
4774 (_cpp_init_internal_pragmas): Add push_macro and
4775 pop_macro handler to internal pragmas.
4776 (lex_macro_node_from_str): Removed.
4777 (cpp_push_definition): Replace lex_macro_node_from_str
4778 by _cpp_lex_identifier.
4779 (cpp_pop_definition): Likewise.
4780 * internal.h (_cpp_lex_identifier): New prototype.
4781 (def_pragma_macro): New structure.
4782 (cpp_reader): New member pushed_macros.
4783 * lex.c (_cpp_lex_identifier): New function.
4784 (lex_identifier_intern): New function.
4785 * init.c (cpp_create_reader): Initialize pushed_macros
4786 member.
4787 (cpp_destroy): Free elements in pushed_macros member.
4788 * pch.c (_cpp_save_pushed_macros): New function.
4789 (_cpp_restore_pushed_macros): Likewise.
4790 (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
4791 (cpp_read_state): Use _cpp_restore_pushed_macros.
4792
2c6e3f55
JJ
47932009-10-19 Jakub Jelinek <jakub@redhat.com>
4794
4795 * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
4796 (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
4797 and char32_cset_desc.
4798 (converter_for_type): Handle CPP_UTF8STRING.
4799 (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
4800 * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
4801 (parse_include): Reject raw strings.
4802 * include/cpplib.h (CPP_UTF8STRING): New token type.
4803 * internal.h (struct cpp_reader): Add utf8_cset_desc field.
4804 * lex.c (lex_raw_string): New function.
4805 (lex_string): Handle u8 string literals, call lex_raw_string
4806 for raw string literals.
4807 (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
4808 sequences.
4809 * macro.c (stringify_arg): Handle CPP_UTF8STRING.
4810
96c169e1
JJ
48112009-10-14 Jakub Jelinek <jakub@redhat.com>
4812
4813 PR preprocessor/41543
4814 * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
4815 * line-map.c (linemap_init): Initialize highest_location and
4816 highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
4817
30c99a9e
JM
48182009-10-09 Jason Merrill <jason@redhat.com>
4819
4820 * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
4821
2214382c
NV
48222009-10-09 Neil Vachharajani <nvachhar@google.com>
4823
4824 * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
4825 sccs.
4826
e02222d2
LR
48272009-09-23 Loren J. Rittle <ljrittle@acm.org>
4828
4829 * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
4830 * configure: Rebuilt.
4831
9a8a2b7a
RG
48322009-09-22 Richard Guenther <rguenther@suse.de>
4833
4834 PR pch/38987
4835 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
4836
74dc6a11
CD
48372009-09-18 Chris Demetriou <cgd@google.com>
4838
4839 PR preprocessor/28435:
4840 * include/cpplib.h (struct cpp_options): Add new member
4841 deps.need_preprocessor_output.
4842 * files.c (open_file_failed): If preprocessor output is needed
4843 always report an error.
4844
933608b7
KT
48452009-09-13 Kai Tietz <kai.tietz@onevision.com>
4846
4847 * configure.ac: Set for i?86-w64-mingw*
4848 need_64bit_hwint to yes.
4849 * configure: Regenerated.
4850
86373e7e
JM
48512009-09-10 Jason Merrill <jason@redhat.com>
4852
4853 * directives.c (cpp_define): constify.
4854
fd2ab214
ILT
48552009-09-02 Ian Lance Taylor <iant@google.com>
4856
4857 * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
4858
df58e648
RW
48592009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4860
4861 * configure.ac (AC_PREREQ): Bump to 2.64.
4862
5213506e
RW
48632009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4864
4865 * aclocal.m4: Regenerate.
4866 * config.in: Regenerate.
4867 * configure: Regenerate.
4868
709a22df
TT
48692009-08-17 Tom Tromey <tromey@redhat.com>
4870
4871 PR preprocessor/41067:
4872 * charset.c (convert_escape): Add missing ":" to error text.
4873
0c539b47
DR
48742009-07-27 Douglas B Rupp <rupp@gnat.com>
4875
4876 * include/cpplib.h (INO_T_CPP): New macro.
4877 (struct cpp_dir): Use it.
4878
2b69c841
JQ
48792009-07-20 Jerry Quinn <jlquinn@optonline.net>
4880
4881 PR regression/40800
4882 * configure.ac: Use = instead of == for testing
4883 ENABLE_BUILD_WITH_CXX.
4884 * configure: Rebuild.
4885
f1bf410c
JQ
48862009-07-17 Jerry Quinn <jlquinn@optonline.net>
4887
4888 * directives.c (do_linemarker, do_line): Use CPP_STRING for
4889 ignored enum value.
4890 * files.c (find_file_in_dir): Add cast from void* to char*.
4891 * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
4892 * Makefile.in: (WARN_CFLAGS): Use general and C-specific
4893 warnings.
4894 (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
4895 ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
4896 COMPILER_FLAGS): New.
4897 (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
4898 (COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS
4899 instead of ALL_CFLAGS.
4900 * configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings
4901 from other warnings. Add -Wc++-compat to C-specific warnings.
4902 Check for --enable-build-with-cxx. Set and substitute
4903 ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES
4904 according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before
4905 AC_CHECK_HEADERS.
4906 * configure: Rebuild.
4907 * include/cpp-id-data.h: Remove extern "C".
4908 * include/line-map.h: Likewise.
4909 * include/mkdeps.h: Likewise.
4910 * include/symtab.h: Likewise.
4911 * internal.h: Likewise.
4912
a28fbdba
MLI
49132009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4914
4915 * directives.c (parse_include): Add location argument. Update all
4916 calls.
4917 (parse_answer): Likewise.
4918 (do_include_common): Error with exact location.
4919 (parse_assertion): Likewise.
4920
b506a5a2
MLI
49212009-06-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
4922
4923 * expr.c (num_div_op): Take explicit location.
4924
7d8847a4
ILT
49252009-06-17 Ian Lance Taylor <iant@google.com>
4926
4927 * include/cpplib.h (progname): Don't declare.
4928
3d8b2a98
ILT
49292009-06-12 Ian Lance Taylor <iant@google.com>
4930
4931 * include/cpplib.h (struct cpp_options): Add
4932 warn_cxx_operator_names field.
4933 (NODE_WARN_OPERATOR): Define.
4934 (struct cpp_hashnode): Increase flags field to 10 bits, decrease
4935 type to 6 bits.
4936 * init.c (mark_named_operators): Add flags parameter.
4937 (cpp_post_options): Pick flags value to pass to
4938 mark_named_operators.
4939 * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
4940 identifier is an operator name in C++.
4941
e74fe492
AH
49422009-06-01 Aldy Hernandez <aldyh@redhat.com>
4943
4944 * include/line-map.h (LAST_SOURCE_COLUMN): New.
4945
4851089f
ILT
49462009-06-01 Ian Lance Taylor <iant@google.com>
4947
4948 * include/cpp-id-data.h: Add extern "C".
4949 * include/line-map.h: Likewise.
4950 * include/mkdeps.h: Likewise.
4951 * include/symtab.h: Likewise.
4952 * internal.h: Likewise.
4953
7e5487a2
ILT
49542009-05-15 Ian Lance Taylor <iant@google.com>
4955
4956 * include/cpplib.h (enum cpp_builtin_type): Rename from enum
4957 builtin_type. Change all uses.
4958
00b0c19b
MLI
49592009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4960
4961 PR cpp/36674
4962 * directives (do_linemarker): Compensate for the increment in
4963 location that occurs when we reach the end of line.
4964 * files (_cpp_stack_include): Mention _cpp_find_file in the
4965 comment.
4966
9a0c6187
JM
49672009-05-10 Joseph Myers <joseph@codesourcery.com>
4968
4969 * include/cpplib.h (enum cpp_token_fld_kind): Add
4970 CPP_TOKEN_FLD_TOKEN_NO.
4971 (struct cpp_macro_arg, struct cpp_identifier): Define.
4972 (union cpp_token_u): Use struct cpp_identifier for identifiers.
4973 Use struct cpp_macro_arg for macro arguments. Add token_no for
4974 CPP_PASTE token numbers.
4975 * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
4976 do_pragma_poison, parse_assertion): Use val.node.node in place of
4977 val.node.
4978 * expr.c (parse_defined, eval_token): Use val.node.node in place
4979 of val.node.
4980 * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
4981 cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
4982 cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
4983 place of val.arg_no. Use val.node.node in place of val.node.
4984 * macro.c (replace_args, cpp_get_token, parse_params,
4985 lex_expansion_token, create_iso_definition, cpp_macro_definition):
4986 Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
4987 Use val.node.node in place of val.node.
4988
9e322bc1
JM
49892009-05-03 Joseph Myers <joseph@codesourcery.com>
4990
4991 * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
4992 UTF-8 sequences.
4993
f88d0772
JM
49942009-04-25 Joseph Myers <joseph@codesourcery.com>
4995
4996 PR preprocessor/39559
4997 * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
4998 constants larger than intmax_t in C99 mode.
4999
d1b38208
TG
50002009-04-21 Taras Glek <tglek@mozilla.com>
5001
5002 * include/cpp-id-data.h: Update GTY annotations to new syntax.
5003 * include/cpplib.h: Likewise.
5004 * include/line-map.h: Likewise.
5005 * include/symtab.h: Likewise.
5006
cfc93532
MLI
50072009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5008
5009 PR c++/14875
5010 * lex.c (cpp_type2name): Take a flags parameter. Call
5011 cpp_named_operator2name for named operators and cpp_digraph2name
5012 for digraphs.
5013 (cpp_digraph2name): New.
5014 (cpp_spell_token): Use it.
5015 (cpp_output_token): Likewise.
5016 * include/cpplib.h (cpp_type2name): Update declaration.
5017 * init.c (cpp_named_operator2name): New.
5018 * internal.h (cpp_named_operator2name): Declare.
5019
9c650d90
MLI
50202009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5021
5022 PR c++/13358
5023 * init.c (cpp_create_reader): Wlong_long is disabled by default.
5024 * expr.c (cpp_classify_number): Give different messages for C and
5025 C++ front-ends.
5026
aa508502
JM
50272009-04-19 Joseph Myers <joseph@codesourcery.com>
5028
5029 PR preprocessor/20078
5030 * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
5031 field.
5032 * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
5033 (struct cpp_token): Change flags to unsigned short.
5034 * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
5035 (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
5036 (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
5037 tokens.
5038 * macro.c (macro_real_token_count): New.
5039 (enter_macro_context, replace_args): Use macro_real_token_count.
5040 (create_iso_definition): Record whitespace surrounding and digraph
5041 spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
5042 Set extra_tokens and save CPP_PASTE tokens with arg_no set for
5043 multiple consecutive ## tokens.
5044 (_cpp_create_definition): Initialize extra_tokens.
5045 (cpp_macro_definition): Use macro_real_token_count.
5046
61cc8223
JM
50472009-04-18 Joseph Myers <joseph@codesourcery.com>
5048
5049 * directives.c (parse_include): Pass true to check_eol.
5050
c7f9c0b9
JM
50512009-04-18 Joseph Myers <joseph@codesourcery.com>
5052
5053 PR preprocessor/39646
5054 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
5055 * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
5056 * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
5057 place of LC_RENAME.
5058
a5cb563b
JM
50592009-04-18 Joseph Myers <joseph@codesourcery.com>
5060
5061 PR preprocessor/39647
5062 * directives.c (check_eol): Add parameter expand.
5063 (do_undef, parse_include, do_line, do_linemarker, do_ident,
5064 do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
5065 do_else, do_endif, do_assert, do_unassert): All callers changed.
5066 Pass true from do_line, false elsewhere.
5067
18f41a1b
JM
50682009-04-12 Joseph Myers <joseph@codesourcery.com>
5069
5070 PR preprocessor/31869
5071 * macro.c (stringify_arg): Handle NULL source token in padding
5072 token where previous padding token did not have source token with
5073 preceding whitespace.
5074
748086b7
JJ
50752009-04-09 Jakub Jelinek <jakub@redhat.com>
5076
5077 * Makefile.in: Change copyright header to refer to version
5078 3 of the GNU General Public License and to point readers at the
5079 COPYING3 file and the FSF's license web page.
5080 * charset.c: Likewise.
5081 * directives-only.c: Likewise.
5082 * directives.c: Likewise.
5083 * errors.c: Likewise.
5084 * expr.c: Likewise.
5085 * files.c: Likewise.
5086 * identifiers.c: Likewise.
5087 * include/cpp-id-data.h: Likewise.
5088 * include/cpplib.h: Likewise.
5089 * include/line-map.h: Likewise.
5090 * include/mkdeps.h: Likewise.
5091 * include/symtab.h: Likewise.
5092 * init.c: Likewise.
5093 * internal.h: Likewise.
5094 * lex.c: Likewise.
5095 * line-map.c: Likewise.
5096 * macro.c: Likewise.
5097 * makeucnid.c: Likewise.
5098 * mkdeps.c: Likewise.
5099 * pch.c: Likewise.
5100 * symtab.c: Likewise.
5101 * system.h: Likewise.
5102 * traditional.c: Likewise.
5103 * ucnid.tab: Likewise.
5104 * ucnid.h: Regenerate.
5105
eec49116
JJ
51062009-04-01 Janis Johnson <janis187@us.ibm.com>
5107
839a3b8a
JJ
5108 PR c/39027
5109 * include/cpplib.h (CPP_N_DEFAULT): Define.
5110 * expr.c (interpret_float_suffix): Recognize d or D for double,
5111 return new value for default.
5112 (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
5113
eec49116
JJ
5114 PR c/33466
5115 * expr.c (interpret_float_suffix): Reject invalid suffix that uses
5116 letters from decimal float and fixed-point suffixes.
5117
47580d22
JM
51182009-03-31 Joseph Myers <joseph@codesourcery.com>
5119
5120 PR preprocessor/15638
5121 * files.c (_cpp_find_file): Call open_file_failed after diagnosing
5122 invalid PCH.
5123 (open_file_failed): Make error for missing file fatal.
5124 * include/cpplib.h (CPP_DL_FATAL): Define.
5125
5a2df0fa
SV
51262009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net>
5127
5128 PR preprocessor/31932:
5129 * internal.h: Don't mention HAVE_ICONV_H.
5130 * configure, config.in: Rebuild.
5131 * configure.ac: Don't check for iconv.h.
5132
c1a8a3c6
TT
51332009-03-30 Tom Tromey <tromey@redhat.com>
5134
5135 PR preprocessor/39512:
5136 * line-map.c (linemap_init): Initialize 'reallocator' field.
5137
a37a7b8a
JJ
51382009-03-30 Jakub Jelinek <jakub@redhat.com>
5139
5140 PR target/39558
5141 * macro.c (cpp_get_token): If macro_to_expand returns NULL
5142 and used some tokens, add CPP_PADDING before next token.
5143
148e4216
JM
51442009-03-29 Joseph Myers <joseph@codesourcery.com>
5145
5146 PR preprocessor/34695
5147 * makedepend.c: Remove.
5148 * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
5149 (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
5150 * directives.c (cpp_errors): Remove.
5151 * errors.c (print_location, _cpp_begin_message, v_message):
5152 Remove.
5153 (cpp_error, cpp_error_with_line): Always use error callback.
5154 (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
5155 * include/cpplib.h (cpp_options): Remove pedantic_errors,
5156 inhibit_warnings, warn_system_headers, inhibit_errors,
5157 warnings_are_errors, client_diagnostic.
5158 (cpp_callbacks): Add extra arguments to error callback; make it
5159 return bool.
5160 (cpp_finish): Return void.
5161 (cpp_destroy): Remove inaccurate comment about return value.
5162 (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
5163 (CPP_DL_NOTE): Define.
5164 * include/line-map.h (linemap_print_containing_files): Remove.
5165 * init.c (cpp_finish): Do not check for or return number of
5166 errors.
5167 * internal.h (cpp_reader): Remove errors field.
5168 * line-map.c (linemap_print_containing_files): Remove.
5169 * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
5170 about previous definition. Only emit it if previous diagnostic
5171 was emitted.
5172
f1450211
JM
51732009-03-28 Joseph Myers <joseph@codesourcery.com>
5174
5175 * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
5176 mkinstalldirs.
5177
8f5929e1
JJ
51782009-03-18 Jakub Jelinek <jakub@redhat.com>
5179
5180 * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
5181
4bb09c26
JM
51822009-02-21 Joseph Myers <joseph@codesourcery.com>
5183
5184 * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
5185 header name.
5186 (_cpp_lex_direct): Handle this.
5187
68c9ab45
RG
51882009-02-15 Richard Guenther <rguenther@suse.de>
5189
5190 Revert last change.
5191
601b3e1a
RG
51922009-02-13 Richard Guenther <rguenther@suse.de>
5193
5194 * configure.ac: Enable LFS.
5195 * configure: Re-generate.
5196 * config.in: Likewise.
5197
fc0cd180
BE
51982009-01-05 Ben Elliston <bje@au.ibm.com>
5199
5200 * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
5201 (.po.pox): Likewise.
5202 (po/$(PACKAGE).pot): Likewise.
5203
db89a3be
AO
52042008-12-10 Alexandre Oliva <aoliva@redhat.com>
5205
5206 PR target/37033
5207 * pch.c (cpp_valid_state): Improve message for poisoned symbols.
5208 Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
5209
cc955282
JM
52102008-11-29 Joseph Myers <joseph@codesourcery.com>
5211
5212 * lex.c (cpp_token_len): Use 6 as default length.
5213
47960aaf
MLI
52142008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org>
5215
5216 * expr.c (struct op): Add location.
5217 (_cpp_parse_expr): Propagate locations throught the stack
5218 of expressions.
5219 (reduce): Likewise.
5220 (check_promotion): Use explicit location in errors.
5221
631d0d36
MG
52222008-10-05 Matthew Gingell <gingell@adacore.com>
5223 Arnaud Charlet <charlet@adacore.com>
5224
5225 * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
5226 (cpp_get_comments): New function.
5227 * internal.h (struct cpp_reader): Add comments field.
5228 * init.c (cpp_destroy): Free comments.
5229 * lex.c (store_comment, cpp_get_comments): New functions.
5230 (comments): New struct.
5231 (save_comment): Store comments in comments struct.
5232
c047ce93
SB
52332008-09-18 Simon Baldwin <simonb@google.com>
5234
5235 * include/cpplib.h (struct cpp_options): Add new boolean flag
5236 warn_builtin_macro_redefined.
5237 * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
5238 * (struct builtin_operator): Split out from previous struct builtin,
5239 enhance extra const correctness.
5240 * (struct builtin_macro): Split out from previous struct builtin, add
5241 new always_warn_if_redefined flag, enhance const correctness.
5242 * (mark_named_operators): Use struct builtin_operator.
5243 * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
5244 to builtins selectively.
5245 * macro.c (warn_of_redefinition): Return false if a builtin macro
5246 is not flagged with NODE_WARN.
5247
affa55c6
JJ
52482008-07-31 Jakub Jelinek <jakub@redhat.com>
5249
5250 PR preprocessor/36649
5251 * files.c (struct report_missing_guard_data): New type.
5252 (report_missing_guard): Put paths into an array instead of printing
5253 them right away. Return 1 rather than 0.
5254 (report_missing_guard_cmp): New function.
5255 (_cpp_report_missing_guards): Sort and print paths gathered by
5256 report_missing_guard callback.
5257
3b8f20a1
MLI
52582008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5259
5260 PR 28079
5261 * directives.c (strtolinenum): Handle overflow.
5262 (do_line): Give a warning if line number overflowed.
5263 (do_linemarker): Update call to strtolinenum.
5264
1bb64668
MLI
52652008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5266
5267 * include/line-map.h (linenum_type): New typedef.
5268 (struct line_map): Use it.
5269 (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
5270 (SOURCE_COLUMN): Likewise.
5271 * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
5272 source_location values in a variable of type linenum_type.
5273 * directives.c (struct if_stack): Use linenum_type.
5274 (strtoul_for_line): Rename as strtolinenum.
5275 (do_line): Use linenum_type.
5276 (do_linemarker): Use linenum_type and strtolinenum.
5277 (_cpp_do_file_change): Use linenum_t.
5278 * line-map.c (linemap_add): Likewise.
5279 (linemap_line_start): Likewise.
5280 * traditional.c (struct fun_macro): 'line' is a source_location.
5281 * errors.c (print_location): Use linenum_type.
5282 * directives-only.c (_cpp_preprocess_dir_only): Likewise.
5283 * internal.h (CPP_INCREMENT_LINE): Likewise.
5284 * lex.c (_cpp_skip_block_comment): Use source_location.
19a9ba64 5285
5950c3c9
BE
52862008-07-14 Ben Elliston <bje@au.ibm.com>
5287
5288 * include/cpplib.h (NODE_CONDITIONAL): New.
5289 (struct cpp_callbacks): New macro_to_expand field.
5290 (struct cpp_hashnode): Adjust size of flags and type fields.
5291 (cpp_peek_token): Prototype.
5292 * lex.c (cpp_peek_token): New function.
5293 (_cpp_temp_token): Protect pre-existing lookaheads.
5294 * macro.c (cpp_get_token): Expand any conditional macros.
5295 (_cpp_backup_tokens_direct): New.
5296 (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
5297 (warn_of_redefinition): Silently allow redefined conditional
5298 macros.
5299 (_cpp_create_definition): Remove the conditional flag when a user
5300 defines one of the conditional macros.
5301 * internal.h (_cpp_backup_tokens_direct): New prototype.
5302
e85edc9e
AH
53032008-06-13 Andrew Haley <aph@redhat.com>
5304
5305 PR preprocessor/33305
5306 * macro.c (replace_args): Print a warning for empty macro
5307 arguments in C89 and C++.
5308
18c04407
RW
53092008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5310
5311 * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
5312 * configure: Regenerate.
5313
2d09b640
RW
53142008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5315
5316 * Makefile.in (datarootdir): New variable.
5317
0b7c73cc
L
53182008-06-12 H.J. Lu <hongjiu.lu@intel.com>
5319
5320 PR preprocessor/36479
5321 * charset.c (cpp_interpret_string_notranslate): Also set
5322 narrow_cset_desc.width.
5323
cd985f66
JM
53242008-06-07 Joseph Myers <joseph@codesourcery.com>
5325
5326 * configure.ac (parisc*64*-*-*): Remove.
5327 * configure: Regenerate.
5328
d750887f
TT
53292008-05-30 Tom Tromey <tromey@redhat.com>
5330
5331 PR preprocessor/36320:
5332 * internal.h (_cpp_parse_expr): Update.
5333 * expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error
5334 messages.
5335 * directives.c (do_if): Update.
5336 (do_elif): Require expression if processing group.
5337
c100de59
DS
53382008-05-30 Danny Smith <dannysmith@users.sourceforge.net>
5339
5340 * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
5341
5d6342eb
TT
53422008-05-21 Tom Tromey <tromey@redhat.com>
5343
5344 PR preprocessor/27777:
5345 * lex.c (cpp_output_line_to_string): New function.
5346 * internal.h (_cpp_begin_message): Don't declare.
5347 * errors.c (_cpp_begin_message): Now static.
5348 * include/cpplib.h (cpp_output_line_to_string): Declare.
5349 * directives.c (do_diagnostic): Rewrote. Use
5350 cpp_output_line_to_string. Don't use _cpp_begin_message.
5351
dae4174e
TT
53522008-05-21 Tom Tromey <tromey@redhat.com>
5353
5354 * include/symtab.h (HT_ALLOCED): Remove.
5355 (ht_purge): Declare.
5356 * symtab.c (DELETED): New define.
5357 (ht_lookup): Update comment.
5358 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED
5359 code. Use subobject allocator for strings, if it exists.
5360 (ht_expand): Handle deleted entries.
5361 (ht_forall): Likewise.
5362 (ht_purge): New function.
5363 (ht_dump_statistics): Print deletion statistics.
5364
899015a0
TT
53652008-05-13 Tom Tromey <tromey@redhat.com>
5366
5367 PR preprocessor/22168:
5368 * include/cpplib.h (struct cpp_options) <objc>: Update
5369 documentation.
5370 * expr.c (eval_token): Warn for use of assertions.
5371 * directives.c (directive_diagnostics): Warn about extensions.
5372 (DEPRECATED): New define.
5373 (DIRECTIVE_TABLE): Use it.
5374
71c10038
TT
53752008-05-06 Tom Tromey <tromey@redhat.com>
5376
5377 PR preprocessor/35313, PR preprocessor/36088:
5378 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
5379 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
5380
2bd0fe3d
DM
53812008-05-04 David S. Miller <davem@davemloft.net>
5382
5383 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
5384 * configure: Regenerate.
5385
28f68625
DF
53862008-04-22 Daniel Franke <franke.daniel@gmail.com>
5387
5388 * include/cpplib.h (cpp_define_formatted): New.
5389 * directives.c (cpp_define_formatted): New.
5390
688e7a53
TT
53912008-04-21 Tom Tromey <tromey@redhat.com>
5392
5393 PR libcpp/33415:
5394 * charset.c (_cpp_convert_input): Add buffer_start argument.
5395 Ignore UTF-8 BOM if seen.
5396 * internal.h (_cpp_convert_input): Add argument.
5397 * files.c (struct _cpp_file) <buffer_start>: New field.
5398 (destroy_cpp_file): Free buffer_start, not buffer.
5399 (_cpp_pop_file_buffer): Likewise.
5400 (read_file_guts): Update.
5401
b6baa67d
KVH
54022008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
5403
5404 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
5405 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
5406 (struct cpp_options): Added uliterals.
5407 (cpp_interpret_string): Update prototype.
5408 (cpp_interpret_string_notranslate): Idem.
5409 * charset.c (init_iconv_desc): New width member in cset_converter.
5410 (cpp_init_iconv): Add support for char{16,32}_cset_desc.
5411 (convert_ucn): Idem.
5412 (emit_numeric_escape): Idem.
5413 (convert_hex): Idem.
5414 (convert_oct): Idem.
5415 (convert_escape): Idem.
5416 (converter_for_type): New function.
5417 (cpp_interpret_string): Use converter_for_type, support u and U prefix.
5418 (cpp_interpret_string_notranslate): Match changed prototype.
5419 (wide_str_to_charconst): Use converter_for_type.
5420 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
5421 * directives.c (linemarker_dir): Macro U changed to UC.
5422 (parse_include): Idem.
5423 (register_pragma_1): Idem.
5424 (restore_registered_pragmas): Idem.
5425 (get__Pragma_string): Support CPP_STRING{16,32}.
5426 * expr.c (eval_token): Support CPP_CHAR{16,32}.
5427 * init.c (struct lang_flags): Added uliterals.
5428 (lang_defaults): Idem.
5429 * internal.h (struct cset_converter) <width>: New field.
5430 (struct cpp_reader) <char16_cset_desc>: Idem.
5431 (struct cpp_reader) <char32_cset_desc>: Idem.
5432 * lex.c (digraph_spellings): Macro U changed to UC.
5433 (OP, TK): Idem.
5434 (lex_string): Add support for u'...', U'...', u"..." and U"...".
5435 (_cpp_lex_direct): Idem.
5436 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
5437 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
5438
deb984e6
PB
54392008-04-18 Paolo Bonzini <bonzini@gnu.org>
5440
5441 PR bootstrap/35457
5442 * aclocal.m4: Regenerate.
5443 * configure: Regenerate.
5444
bf048bea
TT
54452008-04-17 Tom Tromey <tromey@redhat.com>
5446
5447 PR libcpp/34866:
5448 * errors.c (cpp_error): Don't reference a token before the start
5449 of the current run.
5450
7f27b0f8
TT
54512008-04-16 Tom Tromey <tromey@redhat.com>
5452
5453 * Makefile.in (TAGS_SOURCES): New variable.
5454 (TAGS): New target.
5455
a1fcb9a1
KK
54562008-04-11 Kaz Kojima <kkojima@gcc.gnu.org>
5457
5458 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
5459 and shbe-*-*.
5460 * configure: Rebuilt.
5461
93d45d9e
JM
54622008-04-02 Joseph Myers <joseph@codesourcery.com>
5463
5464 * include/cpplib.h (struct cpp_callbacks): Add used_define,
5465 used_undef and before_define.
5466 (NODE_USED): Define.
5467 * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
5468 do_ifndef, cpp_pop_definition): Handle new flag and use new
5469 callbacks.
5470 * expr.c (parse_defined): Handle new flag and use new callbacks.
5471 * macro.c (enter_macro_context, _cpp_free_definition): Handle new
5472 flag and use new callbacks.
5473
d4c32e1d
JJ
54742008-04-01 Jakub Jelinek <jakub@redhat.com>
5475
5476 PR pch/13675
5477 * files.c (struct _cpp_file): Remove pch field.
5478 (pch_open_file): Don't set file->pch, just file->pchname.
5479 (should_stack_file): After pfile->cb.read_pch call
5480 free pchname and clear pchname, don't close file->fd.
5481 Test file->pchname instead of file->pch. Don't close fd after cb.
5482 (_cpp_stack_include): Test file->pchname instead of file->pch.
5483
161031e3
TT
54842008-03-28 Tom Tromey <tromey@redhat.com>
5485
5486 * Makefile.in (POSTCOMPILE): New variable.
5487 (.c.o): Use it.
5488
14ccf800
TT
54892008-03-13 Tom Tromey <tromey@redhat.com>
5490
5491 PR libcpp/35322:
5492 * directives.c (destringize_and_run): Set pfile->directive.
5493
830465c6
MM
54942008-03-06 Markus Milleder <markus.milleder@generali.at>
5495
5496 PR preprocessor/35458
5497 * mkdeps.c (munge): Quote '#' with a '\'.
5498
d482a073
RW
54992008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5500
5501 PR preprocessor/35379
5502 * mkdeps.c (deps_write): Ensure the first target always appears
5503 in the first column, without leading backslash newline. Avoid
5504 some more extra whitespace.
5505
185a6cc1
TS
55062008-02-25 Thiemo Seufer <ths@mips.com>
5507
d482a073 5508 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
185a6cc1 5509
2bf41bf0
TT
55102008-02-19 Tom Tromey <tromey@redhat.com>
5511
5512 * traditional.c (lex_identifier): Use CPP_HASHNODE.
5513 * lex.c (lex_identifier): Use CPP_HASHNODE.
5514 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
5515 do-while.
5516 * identifiers.c (alloc_node): Change return type.
5517 (_cpp_init_hashtable): Don't cast 'alloc_node'.
5518 (proxy_assertion_broken): New declaration.
5519 (cpp_forall_identifiers): Move comment.
5520 * line-map.c (linemap_add): Comment fix.
5521 (linemap_line_start): Indentation fix.
5522
765d600a
JJ
55232008-01-25 Jakub Jelinek <jakub@redhat.com>
5524
5525 PR preprocessor/34692
5526 * macro.c (collect_args): Add pragma_buff argument. Push
5527 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
5528 than into arguments. Reset prevent_expansion and parsing_args
5529 state at CPP_PRAGMA_EOL/CPP_EOF.
5530 (funlike_invocation_p): Add pragma_buff argument, pass it through
5531 to collect_args.
5532 (enter_macro_context): Add result argument. Adjust
5533 funlike_invocation_p caller. Emit all deferred pragma tokens
5534 gathered during collect_args before the expansion, add a padding
5535 token. Return 2 instead of 1 if any pragma tokens were prepended.
5536 (cpp_get_token): If enter_macro_context returns 2, don't return
5537 a padding token, instead cycle to grab CPP_PRAGMA token.
5538 * directives.c (_cpp_handle_directive): If was_parsing_args
5539 in deferred pragma, leave parsing_args and prevent_expansion as is.
5540
ec46053b
TT
55412008-01-22 Tom Tromey <tromey@redhat.com>
5542
765d600a 5543 PR c++/34859
ec46053b
TT
5544 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
5545 __STDC_CONSTANT_MACROS.
5546
681c6ab0
FF
55472008-01-07 Fred Fish <fnf@specifix.com>
5548
765d600a 5549 PR preprocessor/30363
681c6ab0 5550 * traditional.c (replace_args_and_push): Add local variable
19a9ba64 5551 cxtquote, calculate the replacement text size assuming a
681c6ab0
FF
5552 worst case of every input character quoted with backslash,
5553 and properly handle output quoting of quote characters in
5554 actual arguments used in function-like macros.
5555
33ae4837
TT
55562008-01-03 Tom Tromey <tromey@redhat.com>
5557
765d600a 5558 PR preprocessor/34602
33ae4837
TT
5559 * directives.c (do_line): Don't try to spell EOF token.
5560 (do_linemarker): Add comment.
5561
675575f5
DD
55622007-12-11 DJ Delorie <dj@redhat.com>
5563
5564 * charset.c (convert_using_iconv): Close out any shift states,
5565 returning to the initial state.
5566
97f6bd40
TT
55672007-12-06 Tom Tromey <tromey@redhat.com>
5568
765d600a 5569 PR c/29172
97f6bd40
TT
5570 * internal.h (struct cpp_reader) <file_hash_entries>: Changed
5571 type.
5572 <file_hash_entries_allocated, file_hash_entries_used>: Removed.
5573 * files.c (FILE_HASH_POOL_SIZE): New macro.
5574 (struct file_hash_entry_pool): New.
5575 (destroy_all_cpp_files): New function.
5576 (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
5577 (new_file_hash_entry): Update.
5578 (free_file_hash_entries): New function.
5579 (_cpp_cleanup_files): Call free_file_hash_entries and
5580 destroy_all_cpp_files.
5581 (cpp_clear_file_cache): New function.
5582 * include/cpplib.h (cpp_clear_file_cache): Declare.
5583
d56a25e1
TT
55842007-12-03 Tom Tromey <tromey@redhat.com>
5585
765d600a 5586 PR preprocessor/34288
d56a25e1
TT
5587 * configure.ac, config.in: Rebuilt.
5588 * configure.ac: Check for ssize_t.
5589
607f74e9
TT
55902007-11-30 Tom Tromey <tromey@redhat.com>
5591
765d600a 5592 PR preprocessor/32868
607f74e9
TT
5593 * macro.c (_cpp_create_definition): Special case
5594 __STDC_FORMAT_MACROS.
5595
b0f4807f
MM
55962007-11-16 Michael Matz <matz@suse.de>
5597
5598 * files.c (search_path_head): Fix check for absolute paths.
5599
f1e20710
TT
56002007-11-11 Tom Tromey <tromey@redhat.com>
5601
765d600a 5602 PR c++/17557
f1e20710
TT
5603 * include/cpplib.h (cpp_included_before): Declare.
5604 * files.c (struct file_hash_entry) <location>: New field.
5605 (_cpp_find_file): Initialize new field.
5606 (make_cpp_dir): Likewise.
5607 (cpp_included_before): New function.
5608
f373b44d
TT
56092007-11-01 Tom Tromey <tromey@redhat.com>
5610
765d600a 5611 PR preprocessor/30805
f373b44d
TT
5612 * macro.c (paste_tokens): Handle padding token.
5613 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
5614
5b9a40df
TT
56152007-10-31 Tom Tromey <tromey@redhat.com>
5616
765d600a 5617 PR preprocessor/30786
5b9a40df
TT
5618 * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
5619 * directives.c (_cpp_do__Pragma): Return error status.
5620 * internal.h (_cpp_do__Pragma): Update.
5621 * directives.c (get__Pragma_string): Back up if EOF seen.
5622
5ffeb913
TT
56232007-09-06 Tom Tromey <tromey@redhat.com>
5624
5625 * internal.h (struct cpp_reader) <invocation_location>: New
5626 field.
5627 (struct cpp_reader) <set_invocation_location>: Likewise.
5628 * init.c (cpp_set_line_map): New function.
5629 * line-map.c (linemap_add): Use linemap's allocator.
5630 * include/line-map.h (GTY): Define.
5631 (line_map_realloc): New typedef.
5632 (struct line_map): Mark with GTY.
5633 (struct line_maps): Likewise.
5634 (struct line_maps) <maps>: Likewise.
5635 (struct line_maps) <reallocator>: New field.
5636 * include/symtab.h (GTY): Conditionally define.
5637 * include/cpplib.h (cpp_set_line_map): Declare.
5638 (cpp_get_token_with_location): Declare.
5639 * macro.c (cpp_get_token): Set invocation_location on the reader.
5640 (cpp_get_token_with_location): New function.
5641
ac6b1c67
CF
56422007-08-30 Chao-ying Fu <fu@mips.com>
5643
5644 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
5645 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
5646 (cpp_classify_number): Support decimal fixed-point constants without
5647 exponents.
5648 Warn about fixed-point constants when -pedantic.
5649 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
5650 comments to support fixed-point values.
5651 (CPP_N_FRACT, CPP_N_ACCUM): Define.
5652
cda5e672
TT
56532007-08-18 Tom Tromey <tromey@redhat.com>
5654
765d600a 5655 PR preprocessor/32974
cda5e672
TT
5656 * directives.c (parse_include): Don't check for EOL when
5657 processing #pragma dependency.
5658
ccfc4c91
OW
56592007-07-30 Ollie Wild <aaw@google.com>
5660
5661 * directives-only.c: New file.
5662 * internal.h (struct _cpp_dir_only_callbacks): New.
5663 (_cpp_preprocess_dir_only): New function.
5664 * directives.c (_cpp_handle_directive): Check directives_only before
5665 disabling execution of indented directives.
5666 * files.c (_cpp_stack_file): Add directives_only check.
5667 * include/cpplib.h (struct cpp_options): Add directives_only.
5668 (cpp_init_special_builtins): New function.
5669 * init.c (cpp_init_special_builtins): New function.
5670 (cpp_init_builtins): Move builtin_array initialization to
5671 cpp_init_special_builtins.
5672 (post_options): Check directives_only before setting
5673 pfile->state.prevent_expansion = 1.
5674 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
5675 is expanded inside a directive while -fdirectives-only is enabled.
5676 * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
5677 (libcpp_a_SOURCES): Add directives-only.c.
5678
a206413a
UB
56792007-07-04 Uros Bizjak <ubizjak@gmail.com>
5680
5681 * traditional.c (_cpp_scan_out_logical_line): Initialize
5682 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
5683 fmacro.args to prevent 'may be used uninitialized' warning.
5684
c77cd3d1
UB
56852007-07-03 Uros Bizjak <ubizjak@gmail.com>
5686
5687 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
5688 Add new constants.
5689 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
5690 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
5691 for 'q' or 'Q' suffixes.
5692
66938a1d
DS
56932007-06-17 Danny Smith <dannysmith@users.sourceforge.net
5694
e1311401 5695 * files.c (open_file): Correct typo.
66938a1d 5696
71995ede
VP
56972007-06-16 Vladimir Prus <vladimir@codesourcery.com>
5698
e1311401 5699 * files.c (open_file): Prevent the call
71995ede
VP
5700 for stat from overwriting errno.
5701
84152c25
VP
57022007-06-09 Vladimir Prus <vladimir@codesourcery.com>
5703
e1311401 5704 * files.c (open_file): Account for the
19a9ba64
AM
5705 fact that on windows, opening a directory gives
5706 EACCES.
84152c25 5707
f7fd775f
JW
57082007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
5709
5710 PR preprocessor/23479
5711 * expr.c (cpp_classify_number): Implement 0b-prefixed binary
5712 integer constants.
5713 (append_digit): Likewise.
5714 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
5715 binary integer constants.
5716
ed0e74e0
DK
57172007-05-31 Dave Korn <dave.korn@artimi.com>
5718
5719 PR preprocessor/14331
5720 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
5721
a702045a
OW
57222007-05-24 Ollie Wild <aaw@google.com>
5723
5724 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
5725 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
5726 (cpp_write_pch_state): Save __COUNTER__ state.
5727 (cpp_valid_state): Check valid __COUNTER__ state.
5728 (cpp_read_state): Read new __COUNTER__ state.
5729 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
5730 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
5731 * internal.h (struct cpp_reader): Add counter member.
5732
126e073b
SM
57332007-05-23 Simon Martin <simartin@users.sourceforge.net>
5734
5735 PR preprocessor/20077
5736 * macro.c (create_iso_definition): Fixed the method to determine
5737 whether the token-pasting operator appears at the beginning or the end
5738 of a macro.
5739
0b4cafec
ILT
57402007-05-21 Ian Lance Taylor <iant@google.com>
5741
5742 * internal.h (struct cpp_reader): Add new fields:
5743 nonexistent_file_hash and nonexistent_file_ob.
5744 * files.c: Include "obstack.h".
5745 (find_file_in_dir): Before trying to open the file, look up the
5746 path name in the hash table of nonexistent files. After failing
5747 to open the file, add the path name to the hash table.
5748 (_cpp_find_file): Cache the results of looking up the file name
5749 starting with the quote and bracket chain heads, if we can.
5750 (nonexistent_file_hash_eq): New static function.
5751 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
5752 pfile->nonexistent_file_ob.
5753 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
5754 pfile->nonexistent_file_ob.
5755
30e04921
JJ
57562007-05-14 Janis Johnson <janis187@us.ibm.com>
5757
19a9ba64 5758 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
5a6bb57e 5759
30e04921
JJ
5760 PR c/31924
5761 * expr.c (interpret_float_suffix): Check for invalid suffix.
5762
22a8a52d
EC
57632007-05-02 Eric Christopher <echristo@apple.com>
5764
5765 * expr.c (num_div_op): Don't overflow if the result is
5766 zero.
5767
fca35e1b
TT
57682007-05-02 Tom Tromey <tromey@redhat.com>
5769
765d600a 5770 PR preprocessor/28709
fca35e1b
TT
5771 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
5772
4cd97075
MM
57732007-03-30 Michael Meissner <michael.meissner@amd.com>
5774
5775 * directives.c (lex_macro_node_from_str): Fix alloca call to be
5776 type correct.
5777
121de39f
RH
57782007-03-30 Richard Henderson <rth@redhat.com>
5779
5780 * directives.c (lex_macro_node_from_str): New.
5781 (cpp_push_definition, cpp_pop_definition): New.
5782 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
5783
4fcb360b
BM
57842007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
5785
5786 * Makefile.in: Add dummy install-pdf target.
5787
67e64439
TT
57882007-01-30 Tom Tromey <tromey@redhat.com>
5789
765d600a 5790 PR preprocessor/30468
67e64439
TT
5791 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
5792 './'.
5793
ee380365
TT
57942007-01-30 Tom Tromey <tromey@redhat.com>
5795
765d600a 5796 PR preprocessor/29966
ee380365
TT
5797 * macro.c (lex_expansion_token): Save and restore cpp_reader's
5798 cur_token.
5799 (_cpp_create_definition): Don't restore cur_token here.
5800 * lex.c (_cpp_lex_token): Added assertion.
5801
024abeb3
TT
58022007-01-27 Tom Tromey <tromey@redhat.com>
5803
5804 * configure: Rebuilt.
5805
ee1c2a10
TT
58062007-01-12 Tom Tromey <tromey@redhat.com>
5807
765d600a 5808 PR preprocessor/28227
ee1c2a10
TT
5809 * directives.c (lex_macro_node): Added 'is_def_or_undef'
5810 argument.
5811 (do_define): Update.
5812 (do_undef): Update.
5813 (do_ifdef): Update.
5814 (do_ifndef): Update.
5815
67214c16
PB
58162007-01-11 Paolo Bonzini <bonzini@gnu.org>
5817
5818 * configure: Regenerate.
5819
1aa6ca40
PB
58202007-01-11 Paolo Bonzini <bonzini@gnu.org>
5821
5822 * configure: Regenerate.
5823
705e2d28
TT
58242007-01-04 Tom Tromey <tromey@redhat.com>
5825
765d600a 5826 PR preprocessor/28165
705e2d28
TT
5827 * internal.h (cpp_in_primary_file): New function.
5828 * directives.c (do_include_next): Use cpp_in_primary_file.
5829 (do_pragma_once): Likewise.
5830 (do_pragma_system_header): Likewise.
5831
7af45bd4
ILT
58322006-12-29 Ian Lance Taylor <iant@google.com>
5833
5834 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
5835 look backward at the end of the line unless we saw a backslash.
5836
9d30f270
JJ
58372006-12-29 Jakub Jelinek <jakub@redhat.com>
5838
5839 PR preprocessor/29612
5840 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
5841 only when new_sysp is non-zero.
5842
30b0edc0
TT
58432006-12-28 Tom Tromey <tromey@redhat.com>
5844
765d600a 5845 PR preprocessor/30001
30b0edc0
TT
5846 * charset.c (_cpp_convert_input): Check that to.len is greater
5847 than zero.
5848
85d9c13c
TS
58492006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
5850
5851 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
83cc06b2 5852 * configure: Rebuilt.
85d9c13c 5853
dfafdaa6
DG
58542006-11-01 Douglas Gregor <doug.gregor@gmail.com>
5855
5856 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
5857 for experimental C++0x mode.
5858 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
5859 adopted the preprocessor changes introduced in C99.
5860
0f45f0f5
JM
58612006-10-29 Joseph Myers <joseph@codesourcery.com>
5862
5863 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
5864 depending on --enable-targets=all.
5865 * configure: Regenerate.
5866
de000d22
JJ
58672006-10-12 Jakub Jelinek <jakub@redhat.com>
5868
5869 PR preprocessor/28709
5870 * macro.c (paste_tokens): Do error reporting here, use BUF with the
5871 spelled LHS token as opposed to spelling it again.
5872 (paste_all_tokens): Don't report errors here, just break on failure.
5873
b5422ad7
BM
58742006-10-10 Brooks Moses <bmoses@stanford.edu>
5875
5876 * Makefile.in: Added empty "pdf" target.
5877
aaf50ff2
GK
58782006-09-22 Geoffrey Keating <geoffk@apple.com>
5879
5880 * configure.ac: Make need_64_bit_hwint case for x86-darwin
5881 match exactly the glob in gcc/config.gcc.
5882 * configure: Regenerate.
5883
c663e301
JM
58842006-09-13 Joseph S. Myers <joseph@codesourcery.com>
5885
5886 PR c/28768
5887 PR preprocessor/14634
5888 * lex.c (lex_string): Pedwarn for unterminated literals.
5889
f7288899
EC
58902006-09-08 Eric Christopher <echristo@apple.com>
5891
5892 * configure.ac: Add 64-bit HWI support for i?86-darwin.
5893
b52dbbf8
SE
58942006-08-14 Steve Ellcey <sje@cup.hp.com>
5895
5896 PR c++/28288
5897 PR c++/14556
5898 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
5899 (CPP_LAST_EQ): Change.
5900 (CPP_LAST_PUNCTUATOR): Change.
5901 * expr.c (cpp_operator): Remove MIN and MAX.
5902 (reduce): Remove CPP_MIN and CPP_MAX.
5903 (num_binary_op): Ditto.
5904 * lex.c (_cpp_lex_direct): Ditto.
5905 (cpp_avoid_paste): Remove ? as legal symbol after > or <.
5906
1c90c6f9
JJ
59072006-06-09 Jakub Jelinek <jakub@redhat.com>
5908
5909 PR preprocessor/27746
5910 * directives.c (do_pragma): Handle pragma with valid namespace
5911 and invalid name coming from macro expansion.
5912 * directives.c (destringize_and_run): Initialize next field in
5913 context.
5914
5915 PR c/27747
5916 PR c++/27748
5917 * directives.c (destringize_and_run): Set NO_EXPAND on the
5918 tokens.
5919
5920 * macro.c (_cpp_backup_tokens): Fix comment typo.
5921
5c3c3683
DJ
59222006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
5923
5924 * Makefile.in (CATALOGS): Add po/ prefix.
5925 * configure: Regenerated.
5926
b2bd74bc
CD
59272006-05-23 Carlos O'Donell <carlos@codesourcery.com>
5928
5929 * Makefile.in: Add install-html target. Add install-html to .PHONY
5930
be8ac3e2
GZ
59312006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
5932
5933 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
5934 * files.c (_cpp_get_file_stat): New function.
5935 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
5936 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
5937 * internal.h (_cpp_get_file_stat): Prototype.
5938 (struct cpp_buffer): Add timestamp.
5939
83900997
JJ
59402006-01-23 Jakub Jelinek <jakub@redhat.com>
5941
5942 PR preprocessor/25717
5943 * init.c (cpp_init_builtins): If __STDC__ will not change value
5944 between system headers and other sources, define it as a normal
5945 macro rather than a builtin.
5946 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
5947 cpp_in_system_header condition.
5948
59492006-01-05 Paolo Bonzini <bonzini@gnu.org>
9220c30c
PB
5950
5951 * Makefile.in: Use -MMD instead of -MD.
5952
bc4071dd
RH
59532006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
5954 Richard Henderson <rth@redhat.com>
5955
5956 Merge from gomp branch:
5957 * directives.c (struct pragma_entry): Add is_deferred. Add ident
5958 entry to value union.
5959 (end_directive): Don't eat the line if in_deferred_pragma.
5960 (run_directive): Remove pragma hacks.
5961 (insert_pragma_entry): Remove.
5962 (new_pragma_entry): New.
5963 (register_pragma_1): Split out of register_pragma. Only handle
5964 the lookup tree and return the new entry.
5965 (cpp_register_pragma): Fill in the pragma entry here.
5966 (cpp_register_deferred_pragma): New.
5967 (register_pragma_internal): New.
5968 (_cpp_init_internal_pragmas): Use register_pragma_internal.
5969 (do_pragma): Allow pragma expansion after namespace. For deferred
5970 pragmas, don't slurp the line into a string.
5971 (destringize_and_run): Save tokens for deferred pragmas.
5972 (cpp_handle_deferred_pragma): Remove.
5973 * macro.c (builtin_macro): Remove pragma token hack.
5974 (_cpp_push_token_context): Rename from push_token_context and export.
5975 * internal.h (struct lexer_state): Add pragma_allow_expansion.
5976 (_cpp_push_token_context): Declare.
5977 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
5978 a token. Update the line number correctly if so.
5979 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
5980 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
5981 * include/cpplib.h (PRAGMA_EOL): New.
5982 (CPP_TOKEN_FLD_PRAGMA): New.
5983 (struct cpp_token): Add val.pragma.
5984 (struct cpp_options): Remove defer_pragmas.
5985 (cpp_handle_deferred_pragma): Remove.
5986 (cpp_register_deferred_pragma): Declare.
5987
d09e893f
JJ
59882006-01-01 Jakub Jelinek <jakub@redhat.com>
5989
5990 PR c++/25294
5991 * directives.c (do_pragma): If pragma line ends with multi-line
5992 block comment, end the saved deferred pragma string before that
5993 comment. Handle embedded '\0' chars on the pragma line.
5994
ab84748a
VR
59952005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
5996
5997 PR c++/23333
5998 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
5999
ad6ed77e
JG
60002005-12-07 Jon Grimm <jgrimm2@us.ibm.com>
6001 Ben Elliston <bje@au.ibm.com>
6002
6003 * include/cpplib.h (CPP_N_DFLOAT): New.
6004 * expr.c (interpret_float_suffix): Identify df, dd, and dl
6005 suffixes as decimal floating point constants.
6006 (cpp_classify_number): Disallow hexadecimal DFP constants.
6007
ba096620 60082005-11-14 Gerald Pfeifer <gerald@pfeifer.com>
bc4071dd 6009 Ian Lance Taylor <ian@airs.com>
ba096620
GP
6010
6011 * include/cpplib.h (struct cpp_callbacks): Annotate error with
6012 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
6013
456b8ce5
UB
60142005-11-09 Per Bothner <per@bothner.com>
6015 Uros Bizjak <uros@kss-loka.si>
f7288899 6016
456b8ce5
UB
6017 PR c/24101
6018 * init.c (read_original_filename): Temporarily set
6019 state.in_directive before calling _cpp_lex_direct for
6020 CPP_HASH tokens.
6021
5571f74f
JW
60222005-11-03 James E Wilson <wilson@specifix.com>
6023
6024 PR preprocessor/24202
6025 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
6026
a63607ed
JM
60272005-11-04 Joseph S. Myers <joseph@codesourcery.com>
6028
6029 * include/cpplib.h (struct cpp_callbacks): Make error take
6030 va_list* parameter.
6031 * errors.c (cpp_error): Update call to callback.
6032
651ed942
AP
60332005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
6034
6035 PR preprocessor/22042
6036 * macro.c (_cpp_builtin_macro_text): Lower the needed max
6037 buffer size.
6038 (cpp_quote_string): Don't octalify non printable
6039 charactors.
6040
178b58b5
JM
60412005-11-03 Joseph S. Myers <joseph@codesourcery.com>
6042
6043 PR c++/17964
6044 * include/cpplib.h (struct cpp_options): Add client_diagnostic.
6045 (struct cpp_callbacks): Add error.
6046 * errors.c (cpp_error): If client_diagnostic, use error callback.
6047 * charset.c (convert_escape): Don't use %03o in diagnostic.
6048
3ee5ed11 60492005-10-21 James E Wilson <wilson@specifix.com>
6568f34b
JW
6050
6051 PR preprocessor/15220
6052 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all
6053 callers. Pass to open_file_failed.
6054 (open_file_failed): New parameter angle_brackets. Fix all callers.
6055 Use in print_dep assignment.
6056 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
6057 * internal.h (_cpp_find_file): Add new parm to declaration.
f7288899 6058
077fc835
KH
60592005-10-08 Kazu Hirata <kazu@codesourcery.com>
6060
6061 * configure.ac: Require 64-bit int for arm*-*-*eabi*.
6062 * configure: Regenerate.
6063
cbc43ae0
ILT
60642005-10-04 Ian Lance Taylor <ian@airs.com>
6065
6066 PR preprocessor/13726
6067 * directives.c (check_eol_return_comments): New static function.
6068 (parse_include): Add buf parameter. Change all callers.
6069 (do_include_common): If not discard comments, turn on
6070 save_comments. Pass collected comments to include callback.
6071 * include/cpplib.h (struct cpp_callbacks): Add new parameter to
6072 include callback: cpp_token list.
6073
af15a2fe
JM
60742005-09-20 Joseph S. Myers <joseph@codesourcery.com>
6075
6076 * include/cpplib.h (struct cpp_options): Add extended_identifiers.
6077 * init.c (struct lang_flags, lang_defaults): Add
6078 extended_identifiers.
6079 (cpp_set_lang): Use it.
6080 * lex.c (forms_identifier_p): Check extended_identifiers.
6081
f5eab47e
JJ
60822005-08-30 Jakub Jelinek <jakub@redhat.com>
6083
6084 PR preprocessor/20348
6085 PR preprocessor/20356
6086 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
6087 2004-06-05 changes.
6088
467129e6
KG
60892005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6090
6091 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
6092 -Wmissing-format-attribute.
6093
6094 * configure: Regenerate.
6095
200031d1
KC
60962005-06-29 Kelley Cook <kcook@gcc.gnu.org>
6097
6098 * all files: Update FSF address in copyright headers.
6099 * makeucnid.c (write_copyright): Update outputted FSF address.
6100
f610dd5f
ZW
61012005-06-13 Zack Weinberg <zack@codesourcery.com>
6102
6103 * configure.ac: Invoke ZW_CREATE_DEPDIR and
6104 ZW_PROG_COMPILER_DEPENDENCIES.
6105 * aclocal.m4, configure: Regenerate.
6106 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
6107 New variables.
6108 (distclean): Clean up $(DEPDIR) and its contents.
6109 (.c.o): Use $(COMPILE).
6110 Include $(DEPDIR)/*.Po for most object->header dependencies.
6111
c3f829c1
GDR
61122005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
6113
6114 * configure.ac: Check declarations for asprintf and vasprintf.
6115 * config.in: Regenerate.
6116 * configure: Likewise.
6117
6118 * charset.c (conversion_loop): Use XRESIZEVEC.
6119 (convert_no_conversion): Likewise.
6120 (convert_using_iconv): Likewise.
6121 (init_iconv_desc): Cast return value of alloca.
6122 (cpp_host_to_exec_charset): Use XNEWVEC.
6123 (emit_numeric_escape): Use XRESIZEVEC.
6124 (cpp_interpret_string): Use XNEWVEC.
6125 (cpp_interpret_string): Use XRESIZEVEC.
6126 (_cpp_interpret_identifier): Cast return value of alloca.
6127 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
6128 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
6129 (parse_include): Use XNEWVEC.
6130 (insert_pragma_entry): Rename local variable "new" to
f610dd5f 6131 "new_entry".
c3f829c1
GDR
6132 (save_registered_pragmas): Cast return value of xmemdup.
6133 (destringize_and_run): Same for alloca.
6134 (parse_assertion): Likewise.
6135 (do_assert): Cast allocated storage to proper type.
6136 (cpp_define): Likewise.
6137 (_cpp_define_builtin): Likewise.
6138 (cpp_undef): Likewise.
6139 (handle_assertion): Likewise.
6140 (cpp_push_buffer): Rename local variable "new" to "new_buffer".
6141 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
6142 (CPP_UMINUS): Likewise.
6143 (struct cpp_operator): Rename from struct operator.
6144 (_cpp_expand_op_stack): Use XRESIZEVEC.
6145 * files.c (pch_open_file): Use XNEWVEC.
6146 (pch_open_file): Use XRESIZEVEC.
6147 (read_file_guts): Use XNEWVEC and XRESIZEVEC.
6148 (dir_name_of_file): Use XNEWVEC.
6149 (make_cpp_file): Use XCNEW.
6150 (make_cpp_dir): Likewise.
6151 (allocate_file_hash_entries): USE XNEWVEC.
6152 (cpp_included): Cast return value of htab_find_with_hash.
6153 (append_file_to_dir): Use XNEWVEC.
6154 (read_filename_string): Likewise. Use XRESIZEVEC too.
6155 (read_name_map): Cast return value of alloca. Use XRESIZEVEC.
6156 (remap_filename): Use XNEWVEC.
6157 (struct pchf_entry): Move definition out of struct pchf_data.
6158 (_cpp_save_file_entries): Use XCNEWVAR.
6159 (_cpp_read_file_entries): Use XNEWVAR.
6160 * identifiers.c (alloc_node): Use XOBNEW.
6161 * init.c (cpp_create_reader): Use XCNEW.
6162 (cpp_init_builtins): Cast of b->value to enum builtin_type.
6163 (read_original_directory): Cast return value of alloca.
6164 * lex.c (add_line_note): Use XRESIZEVEC.
6165 (warn_about_normalization): Use XNEWVEC.
6166 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
6167 (new_buff): Use XNEWVEC.
6168 * line-map.c (linemap_add): Use XRESIZEVEC.
6169 * macro.c (builtin_macro): Cast return value of alloca.
6170 (paste_tokens): Likewise.
6171 (expand_arg): Use XNEWVEC and XRESIZEVEC.
6172 (_cpp_save_parameter): Use XRESIZEVEC.
6173 (create_iso_definition): Cast allocated storage to proper type.
6174 (_cpp_create_definition): Likewise.
6175 (cpp_macro_definition): Use XRESIZEVEC.
6176 * makedepend.c (add_clm): Use XNEW.
6177 (add_dir): Likewise.
6178 * mkdeps.c (munge): Use XNEWVEC.
6179 (deps_init): Use XCNEW.
6180 (deps_add_target): Use XRESIZEVEC.
6181 (deps_add_default_target): Cast return value of alloca.
6182 (deps_add_dep): Use XRESIZEVEC.
6183 (deps_add_vpath): Likewise. Use XNEWVEC too.
6184 (deps_restore): Likewise.
6185 * pch.c (save_idents): Use XNEW and XNEWVEC.
6186 (cpp_save_state): Use XNEW.
6187 (count_defs): Cast return value of htab_find.
6188 (write_defs): Likewise.
6189 (cpp_write_pch_deps): Use XNEWVEC.
6190 (collect_ht_nodes): Use XRESIZEVEC.
6191 (cpp_valid_state): Use XNEWVEC.
6192 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup.
6193 * symtab.c (ht_create): Use XCNEW.
6194 (ht_lookup_with_hash): Cast return value of obstack_copy0.
6195 (ht_expand): Use XCNEWVEC.
6196 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
6197 (bool): Do not define if __cplusplus.
6198
1ed17cd5
ZW
61992005-05-12 Zack Weinberg <zack@codesourcery.com>
6200
6201 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
6202 (do_sccs): Delete function definition, #define to do_ident.
6203 (do_ident): Don't hardwire directive name.
6204
5a8c20ce
RK
62052005-05-12 Ryota Kunisawa <kunisawa@access.co.jp>
6206
6207 PR bootstrap/21230
6208 * configure: Regenerate.
6209
473c5bc9
AP
62102005-04-27 Andris Pavenis <pavenis@latnet.lv>
6211
6212 * files.c: Include io.h for DJGPP to get prototype of setmode.
6213
c1fc5047
PB
62142005-04-19 Per Bothner <per@bothner.com>
6215
6216 PR preprocessor/20907
6217 * line-map.c (linemap_line_start): Fix bug when we need to increse
6218 column_bits but can re-use the current line_map.
6219
042630ad
KG
62202005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6221
6222 * system.h (fopen, fdopen, freopen): Define these to the unlocked
6223 libiberty functions.
6224
0d667716
KG
62252005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6226
6227 * configure.ac (libcpp_UNLOCKED_FUNCS): New.
6228 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
6229 * system.h (putchar, getc, getchar, clearerr, feof, fileno,
6230 fflush, fgetc, fgets, ferror, fread): Redefine to the associated
6231 _unlocked function.
6232 (fwrite_unlocked): Fix prototype.
1ed17cd5 6233
0d667716
KG
6234 * configure, config.in: Regenerate.
6235
cae064e7
JJ
62362005-04-05 Jakub Jelinek <jakub@redhat.com>
6237
6238 PR preprocessor/19475
6239 * macro.c (create_iso_definition): For < ISO C99, don't
6240 pedwarn if there is no whitespace between macro name and its
6241 replacement, but the replacement starts with a basic character
6242 set character.
6243
cbada204
AJ
62442005-03-28 Andreas Jaeger <aj@suse.de>
6245
6246 * lex.c (warn_about_normalization): Cast field width to int to
6247 avoid warning.
6248
f42eccdb
JM
62492005-03-19 Joseph S. Myers <joseph@codesourcery.com>
6250
6251 * configure.ac: Consistently use solaris2.1[0-9]* instead of
6252 solaris2.1[0-9].
6253 * configure: Regenerate.
6254
c79e602b
GK
62552005-03-15 Geoffrey Keating <geoffk@apple.com>
6256
6257 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
6258 UCN rather than printing an error.
6259
50668cf6
GK
62602005-03-14 Geoffrey Keating <geoffk@apple.com>
6261
6baba9bb
GK
6262 * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
6263
62642005-03-14 Geoffrey Keating <geoffk@apple.com>
1ed17cd5 6265
50668cf6
GK
6266 * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
6267 * charset.c: Update for new format of ucnid.h.
6268 (ucn_valid_in_identifier): Update for new format of ucnid.h.
6269 Add NST parameter, and update it; update callers.
6270 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort
6271 with cpp_error.
6272 (convert_ucn): Pass normalize_state to cpp_valid_ucn.
6273 * internal.h (struct normalize_state): New.
6274 (INITIAL_NORMALIZE_STATE): New.
6275 (NORMALIZE_STATE_RESULT): New.
6276 (NORMALIZE_STATE_UPDATE_IDNUM): New.
6277 (_cpp_valid_ucn): New.
6278 * lex.c (warn_about_normalization): New.
6279 (forms_identifier_p): Add normalize_state parameter, update callers.
6280 (lex_identifier): Add normalize_state parameter, update callers. Keep
6281 the state current.
6282 (lex_number): Likewise.
6283 (_cpp_lex_direct): Pass normalize_state to subroutines. Check
6284 it with warn_about_normalization.
6285 * makeucnid.c: New.
6286 * ucnid.h: Replace.
6287 * ucnid.pl: Remove.
6288 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove
6289 comments about obsolete version of C++.
6290 * include/cpplib.h (enum cpp_normalize_level): New.
6291 (struct cpp_options): Add warn_normalize field.
6292
47e20491
GK
62932005-03-11 Geoffrey Keating <geoffk@apple.com>
6294
6295 * directives.c (glue_header_name): Update call to cpp_spell_token.
6296 * internal.h (_cpp_interpret_identifier): New.
6297 * charset.c (_cpp_interpret_identifier): New.
6298 (_cpp_valid_ucn): Allow UCN version of '$'.
6299 * lex.c (lex_identifier): Add extra parameter to indicate if initial
6300 character was '$' or '\'. Support identifiers with UCNs.
6301 (forms_identifier_p): Allow UCNs.
6302 (_cpp_lex_direct): Pass extra parameter to lex_identifier.
6303 (utf8_to_ucn): New.
6304 (cpp_spell_token): Add FORSTRING parameter. Use it.
6305 (cpp_token_as_text): Update call to cpp_spell_token.
6306 (cpp_output_token): Write UCNs back out.
6307 (stringify_arg): Update call to cpp_spell_token.
6308 (paste_tokens): Likewise.
6309 (cpp_macro_definition): Likewise.
6310 * macro.c (stringify_arg): Likewise.
6311 (paste_tokens): Likewise.
6312 (cpp_macro_definition): Likewise.
6313 * include/cpplib.h: Add parameter to cpp_spell_token.
6314
73096711
JJ
63152005-03-04 Jakub Jelinek <jakub@redhat.com>
6316
6317 PR bootstrap/20282
6318 PR bootstrap/20305
6319 * macro.c (replace_args, cpp_get_token): Copy whole
6320 cpp_token_u instead of just cpp_string field from it.
6321
2203a881
DP
63222005-02-28 Devang Patel <dpatel@apple.com>
6323
6324 * directives.c (do_line): Save sysp early before line table is
6325 realloc'ed.
1ed17cd5 6326
c5ff069d
ZW
63272005-02-20 Zack Weinberg <zack@codesourcery.com>
6328
6329 PR 18785
6330 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
6331 (cpp_host_to_exec_charset): New function.
6332 * include/cpplib.h: Declare cpp_host_to_exec_charset.
6333
04c90eea
DP
63342005-02-19 Devang Patel <dpatel@apple.com>
6335
6336 * charset.c (_cpp_convert_input): Check '\r' before inserting
6337 '\n' at the end.
c5ff069d 6338
6da55c00
EC
63392005-02-15 Eric Christopher <echristo@redhat.com>
6340
6341 PR preprocessor/19077
6342 * macro.c (cpp_macro_definition): Move handling of whitespace
6343 to PREV_WHITE conditional. Remove overloading of len
6344 variable.
6345
31c3e631
KH
63462005-02-14 Kazu Hirata <kazu@cs.umass.edu>
6347
6348 * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
6349 traditional.c: Update copyright.
6350
be0f1e54
PB
63512005-02-14 Paolo Bonzini <bonzini@gnu.org>
6352
6353 PR bootstrap/19818
6354 * configure.ac: Check for declaration of basename and getopt.
6355 * config.in: Regenerate.
6356 * configure: Regenerate.
6357 * internal.h (ustrcspn): New.
6358 * macro.c (create_iso_definition): Fix allocation of memory.
6359 (padding_token): Add cast to remove const-ness.
6360 * pch.c (cpp_read_state): Use ustrcspn.
6361
ecddfb39
MS
63622005-02-08 Mike Stump <mrs@apple.com>
6363
6364 * files.c (pchf_adder): Remove.
6365 (struct pchf_adder_info): Likewise.
6366 (_cpp_save_file_entries): Write out all files so that #import works.
6367
9fcdd891
JM
63682005-01-23 Joseph S. Myers <joseph@codesourcery.com>
6369
6370 * configure: Regenerate.
6371
ecfd72e7
TS
63722005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
6373
6374 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
6375
6c25a4f7 6376 * include/cpplib.h: Also update copyright years.
c5ff069d 6377
942926ad
GK
63782005-01-03 Geoffrey Keating <geoffk@apple.com>
6379
6380 * files.c (_cpp_find_file): Add files found by search_path_exhausted
6381 to the list of all files.
6382
a2566ae9
GDR
63832005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
6384
6385 * internal.h: Update references to Cpp lib filenames.
6386 * directives.c: Likewise.
6387 * init.c: Likewise.
6388 * macro.c: Likewise.
6389 * traditional.c: Likewise.
6390
1b449375
EB
63912004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
6392
6393 PR preprocessor/15167
6394 * files.c (destroy_cpp_file): New function.
6395 (should_stack_file): Make a new file if the
6396 compared file is still stacked.
6397
28303828
NN
63982004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
6399
c5ff069d 6400 PR preprocessor/17610
28303828
NN
6401 * directives.c (do_include_common): Error out if an empty filename
6402 is given for #include (or #include_next or #import).
6403
c812785a
RS
64042004-11-27 Roger Sayle <roger@eyesopen.com>
6405 Zack Weinberg <zack@codesourcery.com>
6406
6407 * internal.h: Replace all uses of uchar with unsigned char.
6408 * include/cpp-id-data.h: Likewise. Guard typedef of uchar
6409 with !IN_GCC, so uchar is only defined whilst building libcpp.
6410
f91eaa01
KC
64112004-11-24 Kelley Cook <kcook@gcc.gnu.org>
6412
6413 * aclocal.m4: Regenerate.
6414
f78ce0c2
RS
64152004-11-24 Roger Sayle <roger@eyesopen.com>
6416
6417 PR preprocessor/15824
6418 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
6419 directly, instead of the non-existant "system.h" and "ansidecl.h".
6420 * configure: Regenerate.
6421
b5b3e36a 64222004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
c5ff069d 6423 Joseph Myers <joseph@codesourcery.com>
b5b3e36a
DJ
6424
6425 * internal.h (struct lexer_state): Add in_deferred_pragma.
6426 * directives.c (struct pragma_entry): Add allow_expansion.
6427 (insert_pragma_entry): Take allow_expansion flag.
6428 (register_pragma): Likewise.
6429 (cpp_register_pragma): Likewise.
6430 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
6431 (do_pragma): Honor allow_expansion.
6432 (cpp_handle_deferred_pragma): Set in_deferred_pragma.
6433 * include/cpplib.h (cpp_register_pragma): Update prototype.
6434
a8e68029 64352004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
c5ff069d 6436 Mark Mitchell <mark@codesourcery.com>
a8e68029
DJ
6437
6438 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
6439 need_64bit_hwint=yes.
6440 * configure: Regenerate.
6441
50f47ee0
JM
64422004-11-09 Joseph S. Myers <joseph@codesourcery.com>
6443
6444 * Makefile.in ($(PACKAGE).pot): New rule. Depend on
6445 po/$(PACKAGE).pot.
6446 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
6447 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
6448 Remove local srcdir path from generated file.
6449
968e08d6 64502004-11-04 Zack Weinberg <zack@codesourcery.com>
c5ff069d 6451 Gerald Pfeifer <gerald@pfeifer.com>
968e08d6
ZW
6452
6453 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
6454 as well.
6455
3da3d587
ZW
64562004-10-27 Zack Weinberg <zack@codesourcery.com>
6457
6458 PR 18075
6459 * directives.c (do_pragma): Do not defer pragmas which are unknown.
6460 (cpp_handle_deferred_pragma): Add cast to silence warning.
6461
ac24fc25
JM
64622004-10-14 Joseph S. Myers <jsm@polyomino.org.uk>
6463
6464 * errors.c (_cpp_begin_message): Print "error: " for errors.
6465
7731405b
AJ
64662004-10-10 Andreas Jaeger <aj@suse.de>
6467
6468 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
6469 * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
6470
646544e3
AP
64712004-10-08 Andrew Pinski <pinskia@physics.uc.edu>
6472
6473 * pch.c (cpp_write_pch_state): Remove variable z as it is not
6474 used.
6475 (cpp_read_state): Remove unused variables, m, d and mac_count.
6476
67a74146
PB
64772004-09-29 Per Bothner <per@bothner.com>
6478
6479 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore
6480 cb.line_change. Otherwise do_pragma will call the line_change
6481 call-back with a meaningless line number.
6482
018a4785
ZW
64832004-09-24 Zack Weinberg <zack@codesourcery.com>
6484
6485 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
6486 programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
6487 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
6488 * aclocal.m4, configure: Regenerate.
6489 * init.c: Include localedir.h.
6490 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
6491 (DEFS): Delete.
6492 (.c.o): Use $(ALL_CFLAGS).
6493 (localedir.h, localedir.hs): New rules.
6494 (clean): Use rm -rf to remove directories.
6495 (distclean): Also delete localedir.h and localedir.hs.
6496 (init.o): Update dependencies.
6497
88fa57d7
KC
64982004-09-22 Kelley Cook <kcook@gcc.gnu.org>
6499
6500 * Makefile.in (aclocal.m4): Update dependencies.
6501 * configure.ac (AC_CONFIG_MACRO_DIR): New.
6502 * aclocal.m4, configure: Regenerate.
6503
8f8e9aa5
ZW
65042004-09-17 Zack Weinberg <zack@codesourcery.com>
6505
a29f62d9
ZW
6506 * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
6507 (_cpp_convert_input, _cpp_default_encoding): Add comments.
6508 Some other comments in this file also tweaked.
6509
8f8e9aa5
ZW
6510 * directives.c (do_pragma): Save current buffer position
6511 before lexing the pragma keywords; don't call
6512 _cpp_backup_tokens in the defer_pragmas case.
6513
a2981930
PB
65142004-09-15 Per Bothner <per@bothner.com>
6515
6516 * include/line-map.h (line_map_start): Add parameter names so
6517 preceding comment makes sense.
6518 (linemap_add): Remove from comment mention of non-existing parameter.
6519
21b11495
ZW
65202004-09-09 Matt Austern <austern@apple.com>
6521 Zack Weinberg <zack@codesourcery.com>
6522
6523 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
6524 prefixes throughout. Add entry for PRAGMA. Remove
6525 unnecessary "= 0" from EQ.
6526 (enum cpp_ttype): Adjust OP and TK definitions to restore
6527 prefixes, via token-paste.
6528 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
6529 Change from #defines to additional cpp_ttype enumerators.
6530 (struct cpp_options): Add defer_pragmas.
6531 (cpp_handle_deferred_pragma): Prototype new interface.
6532
6533 * internal.h (struct cpp_reader): Add directive_result.
6534 * directives.c (struct pragma_entry): Add is_internal field;
6535 give boolean fields type bool.
6536 (start_directive): Initialize pfile->directive_result.type.
6537 (_cpp_do__Pragma): Likewise.
6538 (run_directive): Do not crash if pfile->buffer->prev is NULL.
6539 (insert_pragma_entry): Add 'internal' argument; set new->is_internal
6540 from it.
6541 (register_pragma): New static function, bulk of former
6542 cpp_register_pragma here; add 'internal' argument, pass along
6543 to insert_pragma_entry.
6544 (cpp_register_pragma): Now a wrapper around register_pragma which
6545 always passes false for 'internal' argument.
6546 (_cpp_init_internal_pragmas): Call register_pragma directly, passing
6547 true for 'internal'.
6548 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
6549 an internal pragma, save text till the end of the line as a CPP_PRAGMA
6550 token instead of executing the pragma.
6551 (cpp_handle_deferred_pragma): New interface.
6552 * lex.c (token_spellings): Adjust OP and TK definitions to
6553 match changes to cpplib.h.
6554 (_cpp_lex_token): Check for a directive-result token and
6555 return it if present.
6556 (cpp_token_val_index): Handle CPP_PRAGMA.
6557 * macro.c (cpp_builtin_macro_text): Correct comment.
6558 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
6559
0fd9e8dd
SB
65602004-09-06 Serge Belyshev <belyshev@lubercy.com>
6561
6562 PR preprocessor/14699
6563 * symtab.c (ht_dump_statistics): Change type of sum_of_squares
6564 from size_t to double.
6565
39b8ce7f
AS
65662004-08-28 Andreas Schwab <schwab@suse.de>
6567 Andreas Jaeger <aj@suse.de>
6568
6569 * configure.ac: Set PACKAGE correctly.
6570 * configure: Regenerated.
6571
5d1f4b27
PB
65722004-08-25 Paolo Bonzini <bonzini@gnu.org>
6573
6574 * Makefile.in: Add back top_builddir.
6575
078e3ffe
PB
65762004-08-25 Paolo Bonzini <bonzini@gnu.org>
6577
6578 * configure.ac: Replace Automake macro invocations
6579 with manual Autoconf checks and substitutions.
6580 * configure: Regenerate.
6581 * aclocal.m4: Regenerate.
6582 * config.in: Regenerate.
6583 * Makefile.am: Removed.
6584 * Makefile.in: Heavy simplification and reorganization.
6585
b3f8d95d
MM
65862004-08-09 Mark Mitchell <mark@codesourcery.com>
6587
6588 * configure.ac (arm*-*-eabi*): New target.
6589 (arm*-*-symbianelf*): Likewise.
6590 * configure: Regenerated.
6591
72bb2c39
BI
65922004-07-24 Bernardo Innocenti <bernie@develer.com>
6593
6594 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
6595 * directives.c: Use XNEW-family macros from libiberty.
6596 * lex.c: Likewise.
6597 * macro.c: Likewise.
6598 * cpplib.h (cpp_deps_style): Export enum with name.
6599
21b11495 66002004-07-23 Matthias Klose <doko@debian.org>
72bb2c39 6601
21b11495 6602 * init.c (init_library): Use PACKAGE for the text domain.
85eac2a0 6603
a23ee064
AP
66042004-07-16 Andris Pavenis <pavenis@latnet.lv>
6605
6606 PR preprocessor/16366
6607 * internal.h (struct cpp_reader): New field dir_hash.
6608 * files.c (make_cpp_dir): Use dir_hash, not file_hash.
6609 (_cpp_init_files, _cpp_cleanup_files): Update for new field.
6610
a09d4744
NB
66112004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
6612
6613 PR preprocessor/16192
6614 PR preprocessor/15913
6615 PR preprocessor/15572
6616 * expr.c (_cpp_parse_expr): Handle remaining cases where an
6617 expression is missing.
6618 * init.c (post_options): Traditional cpp doesn't do // comments.
6619
f58f7def
PB
66202004-06-30 Per Bothner <per@bothner.com>
6621
6622 * include/line-map.h (fileline): Remove old typedef.
6623 * internal.h (struct cpp_reader): Use source_location typedef instead.
6624
e83d8d43
ZW
66252004-06-26 Zack Weinberg <zack@codesourcery.com>
6626
6627 Partially revert patch of 2004-06-05.
6628 * files.c (search_cache): Remove pfile argument. Don't check
6629 for file that would be found by "" or <> search here...
6630 (_cpp_find_file): ...do it here, before calling find_file_in_dir.
6631 Do not apply directory-of-current-file correction to files
6632 found by this check. Rearrange code slightly.
6633
c0d578e6
GK
66342004-06-21 Geoffrey Keating <geoffk@apple.com>
6635
6636 * files.c (should_stack_file): Correct swapped parameters to call
6637 to cb.read_pch.
6638 * pch.c (cpp_valid_state): Handle -fpreprocessed.
6639
159d5224
PB
66402004-06-15 Paolo Bonzini <bonzini@gnu.org>
6641
6642 * Makefile.in: Regenerate with automake 1.8.5.
6643 * aclocal.m4: Likewise.
6644 * configure: Regenerate.
6645
2fac9c01
ZW
66462004-06-11 Zack Weinberg <zack@codesourcery.com>
6647
6648 * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
6649 * configure, config.in: Regenerate.
6650 * system.h: Unconditionally define bool as unsigned char,
6651 BOOL_BITFIELD as unsigned int.
6652 * .cvsignore: New file.
6653
d8044160
GK
66542004-06-09 Geoffrey Keating <geoffk@apple.com>
6655
6656 * traditional.c (push_replacement_text): Set macro->traditional.
6657 (save_replacement_text): Likewise.
6658 * pch.c (cpp_write_pch_state): Don't write list of defined macros.
6659 (struct save_macro_item): Delete.
6660 (struct save_macro_data): Use a character array not the previous
6661 structured format.
6662 (save_macros): Save macro as text not as internal structures.
6663 (cpp_prepare_state): Update for changes to save_macro_data.
6664 (cpp_read_state): Don't read macros defined in PCH. Restore
2cf22451 6665 -D macros as text.
d8044160
GK
6666 * macro.c (create_iso_definition): Honour alloc_subobject.
6667 Clear traditional flag.
6668 (_cpp_create_definition): Honour alloc_subobject.
6669 * lex.c (cpp_token_val_index): New.
6670 * internal.h: Include cpp-id-data.h.
6671 (uchar): Move definition to cpp-id-data.h.
6672 (U): Likewise.
6673 (cpp_macro): Likewise.
6674 * directives.c (struct answer): Move to cpp-id-data.h.
6675 (do_assert): Honour alloc_subobject.
2cf22451
ZW
6676
6677 * include/symtab.h (struct ht): Add field 'alloc_subobject'.
6678 * include/cpplib.h (struct cpp_string): Add GTY marker.
6679 (enum cpp_token_fld_kind): New.
6680 (struct cpp_token): Add GTY markers.
6681 (cpp_token_val_index): Prototype.
6682 (CPP_HASHNODE_VALUE_IDX): New.
6683 (struct cpp_hashnode): Don't skip fields of 'value' when marking.
6684 * include/cpp-id-data.h: New file.
d8044160 6685
0ca8e815
PB
66862004-06-09 Paolo Bonzini <bonzini@gnu.org>
6687
6688 * Makefile.am (all-local): New.
6689 * Makefile.in: Regenerate.
6690
b51fa00f
RS
66912004-06-06 Roger Sayle <roger@eyesopen.com>
6692
6693 * Makefile.am (LIBICONV): Declare.
6694 (makedepend_LDADD): Use LIBICONV.
6695 * Makefile.in: Regenerate.
6696
5e2f3f39
AP
66972004-06-05 Andrew Pinski <pinskia@physics.uc.edu>
6698
6699 * Makefile.am (LIBINTL): Declare
6700 (makedepend_LDADD): Use LIBINTL.
6701 * Makefile.in: Regenerate.
6702
c6e83800
ZW
67032004-06-05 Zack Weinberg <zack@codesourcery.com>
6704
6705 * Makefile.am: Add makedepend.
6706 * Makefile.in, aclocal.m4: Regenerate.
6707 * charset.c: Insert a space to avoid a warning.
6708 * directives.c: Include mkdeps.h.
6709 (_cpp_handle_directive): Reenable macro expander if appropriate.
6710 (undefine_macros): Inline body of _cpp_free_definition for speed.
6711 Do not call undef callback or _cpp_warn_if_unused_macro.
6712 (cpp_get_deps): New interface.
6713 * files.c (search_cache): Add pfile argument. Check for file
6714 that would be found by "" or <> search here...
6715 (_cpp_find_file): ...not here. Correct recorded start_dir of
6716 files found by directory-of-current-file search that would be
6717 found by "" or <> search.
6718 * init.c (cpp_add_dependency_target): Delete.
6719 * internal.h (struct lexer_state): Add discarding_output flag.
6720 * lex.c (lex_identifier): Compute hash function while scanning.
6721 * macro.c (cpp_scan_nooutput): Disable macro expansion outside
6722 directives.
6723 * makedepend.c: New file.
6724 * mkdeps.c (struct deps): Add vpath vector.
6725 (apply_vpath, deps_add_vpath): New function.
6726 (deps_free): Free vpath vector.
6727 (deps_add_dep, deps_add_target): Use apply_vpath.
6728 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
6729 (ht_lookup_with_hash): New function.
6730 * cpplib.h, mkdeps.h: Update prototypes.
6731 * symtab.h: Update prototypes.
6732 (HT_HASHSTEP, HT_FINISH): New macros.
6733
b453c95f
GK
67342004-05-29 Geoffrey Keating <geoffk@apple.com>
6735
6736 * symtab.c (ht_create): Set entries_owned.
6737 (ht_destroy): Honour entries_owned.
6738 (ht_expand): Likewise.
6739 (ht_load): New.
2cf22451
ZW
6740 * include/symtab.h (struct ht): New field 'entries_owned'
6741 (ht_load): New prototype.
b453c95f 6742
963e23c5
PB
67432004-05-26 Paolo Bonzini <bonzini@gnu.org>
6744
6745 PR bootstrap/15651
6746 * configure.ac: Fix m4 quoting when picking
6747 the size of HOST_WIDE_INT.
6748 * configure: Regenerate.
6749
0429bc77
PB
67502004-05-25 Paolo Bonzini <bonzini@gnu.org>
6751
6752 * Makefile.am: the correct directory for
6753 gettext include files is given by @INCINTL@.
6754 * Makefile.in: Regenerate.
6755
c86dd7db
PB
67562004-05-24 Paolo Bonzini <bonzini@gnu.org>
6757
6758 * system.h [!ENABLE_NLS]: dgettext takes two
6759 parameters.
6760
4f4e53dd
PB
67612004-05-23 Paolo Bonzini <bonzini@gnu.org>
6762
6763 Moved libcpp from the gcc subdirectory to the toplevel.
6764 * Makefile.am: New file.
6765 * Makefile.in: Regenerate.
6766 * configure.ac: New file.
6767 * configure: Regenerate.
6768 * config.in: Regenerate.
6769 * charset.c: Moved from gcc/cppcharset.c. Add note about
6770 brokenness of input charset detection. Adjust for change
6771 in name of cppucnid.h.
6772 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
6773 * expr.c: Moved from gcc/cppexp.c.
6774 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
6775 Remove #define of O_BINARY, it is in system.h.
6776 * identifiers.c: Moved from gcc/cpphash.c.
6777 * internal.h: Moved from gcc/cpphash.h. Change header
6778 guard name. All other files adjusted to match name change.
6779 * init.c: Moved from gcc/cppinit.c.
6780 (init_library) [ENABLE_NLS]: Call bindtextdomain.
6781 * lex.c: Moved from gcc/cpplex.c.
6782 * directives.c: Moved from gcc/cpplib.c.
6783 * macro.c: Moved from gcc/cppmacro.c.
6784 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
6785 * traditional.c: Moved from gcc/cpptrad.c.
6786 * ucnid.h: Moved from gcc/cppucnid.h. Change header
6787 guard name.
6788 * ucnid.pl: Moved from gcc/cppucnid.pl.
6789 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header
6790 guard name.
6791 * symtab.c: Moved from gcc/hashtable.c.
6792 * line-map.c: Moved from gcc. Do not include intl.h.
6793 * mkdeps.c: Moved from gcc.
6794 * system.h: New file.
2cf22451
ZW
6795 * include/cpplib.h: Moved from gcc. Change header guard name.
6796 * include/line-map.h: Moved from gcc. Change header guard name.
6797 * include/mkdeps.h: Moved from gcc. Change header guard name.
6798 * include/symtab.h: Moved from gcc/hashtable.h. Change header
6799 guard name.
818ab71a 6800\f
c48514be 6801Copyright (C) 2004-2021 Free Software Foundation, Inc.
818ab71a
JJ
6802
6803Copying and distribution of this file, with or without modification,
6804are permitted in any medium without royalty provided the copyright
6805notice and this notice are preserved.