]> git.ipfire.org Git - thirdparty/gcc.git/blame - libcpp/ChangeLog
Avoid valid Coverity warning for comparing array to zero.
[thirdparty/gcc.git] / libcpp / ChangeLog
CommitLineData
85d77ac4
GA
12021-08-25 Lewis Hyatt <lhyatt@gmail.com>
2
3 PR other/93067
4 * charset.c (init_iconv_desc): Adapt to permit PFILE argument to
5 be NULL.
6 (_cpp_convert_input): Likewise. Also move UTF-8 BOM logic to...
7 (cpp_check_utf8_bom): ...here. New function.
8 (cpp_input_conversion_is_trivial): New function.
9 * files.c (read_file_guts): Allow PFILE argument to be NULL. Add
10 INPUT_CHARSET argument as an alternate source of this information.
11 (read_file): Pass the new argument to read_file_guts.
12 (cpp_get_converted_source): New function.
13 * include/cpplib.h (struct cpp_converted_source): Declare.
14 (cpp_get_converted_source): Declare.
15 (cpp_input_conversion_is_trivial): Declare.
16 (cpp_check_utf8_bom): Declare.
17
2d14d64b
GA
182021-08-17 Jakub Jelinek <jakub@redhat.com>
19
20 * macro.c (vaopt_state): Add m_stringify member.
21 (vaopt_state::vaopt_state): Initialize it.
22 (vaopt_state::update): Overwrite it.
23 (vaopt_state::stringify): New method.
24 (stringify_arg): Replace arg argument with first, count arguments
25 and add va_opt argument. Use first instead of arg->first and
26 count instead of arg->count, for va_opt add paste_tokens handling.
27 (paste_tokens): Fix up len calculation. Don't spell rhs twice,
28 instead use %.*s to supply lhs and rhs spelling lengths. Don't call
29 _cpp_backup_tokens here.
30 (paste_all_tokens): Call it here instead.
31 (replace_args): Adjust stringify_arg caller. For vaopt_state::END
32 if stringify is true handle __VA_OPT__ stringification.
33 (create_iso_definition): Handle # __VA_OPT__ similarly to # macro_arg.
34
72be20e2
GA
352021-08-12 Jakub Jelinek <jakub@redhat.com>
36
37 PR preprocessor/101638
38 * macro.c (cpp_sys_macro_p): Return true instead of
39 crashing on builtin macros.
40
8ebf4fb5
GA
412021-08-05 Jakub Jelinek <jakub@redhat.com>
42
43 PR c++/100977
44 * ucnid.h: Regenerated using Unicode 13.0.0 files.
45
462021-08-05 Jakub Jelinek <jakub@redhat.com>
47
48 PR c++/100977
49 * makeucnid.c (write_table): Fix computation of last_combine.
50 * ucnid.h: Regenerated using Unicode 6.3.0 files.
51
9a61dfdb
GA
522021-06-16 Jason Merrill <jason@redhat.com>
53
54 PR c++/100796
55 PR preprocessor/96391
56 * line-map.c (linemap_compare_locations): Only use comparison with
57 LINE_MAP_MAX_LOCATION_WITH_COLS to avoid abort.
58
ea34e2ed
GA
592021-05-20 Christophe Lyon <christophe.lyon@linaro.org>
60 Torbjörn Svensson <torbjorn.svensson@st.com>
61
62 PR c/42579
63 * include/cpplib.h (cpp_builtin_type): Add BT_FILE_NAME entry.
64 * init.c (builtin_array): Likewise.
65 * macro.c (_cpp_builtin_macro_text): Add support for BT_FILE_NAME.
66
672021-05-20 Jakub Jelinek <jakub@redhat.com>
68
69 PR preprocessor/100646
70 * lex.c (cpp_directive_only_process): Treat end of file as termination
71 for !is_block comments.
72
0ff3a0f2
GA
732021-05-12 Jakub Jelinek <jakub@redhat.com>
74
75 PR preprocessor/100392
76 * lex.c (cpp_directive_only_process): If buffer doesn't end with '\n',
77 add buffer->rlimit[0] character to the printed range and
78 CPP_INCREMENT_LINE and increment line_count.
79
037e3661
GA
802021-05-11 Joseph Myers <joseph@codesourcery.com>
81
82 * include/cpplib.h (struct cpp_options): Add elifdef.
83 * init.c (struct lang_flags): Add elifdef.
84 (lang_defaults): Update to include elifdef initializers.
85 (cpp_set_lang): Set elifdef for pfile based on language.
86 * directives.c (STDC2X, ELIFDEF): New macros.
87 (EXTENSION): Increase value to 3.
88 (DIRECTIVE_TABLE): Add #elifdef and #elifndef.
89 (_cpp_handle_directive): Do not treat ELIFDEF directives as
90 directives for language versions without the #elifdef feature.
91 (do_elif): Handle #elifdef and #elifndef.
92 (do_elifdef, do_elifndef): New functions.
93
942021-05-11 Joseph Myers <joseph@codesourcery.com>
95
96 * lex.c (cpp_avoid_paste): Do not allow pasting CPP_NUMBER with
97 CPP_CHAR.
98
992021-05-11 Joseph Myers <joseph@codesourcery.com>
100
101 * init.c (lang_defaults): Enable digit separators for GNUC2X and
102 STDC2X.
103
62d87a32
GA
1042021-05-07 Jakub Jelinek <jakub@redhat.com>
105
106 PR c/100450
107 * lex.c (cpp_avoid_paste): Handle token1 CPP_PRAGMA like CPP_NAME.
108
cfe82a0c
GA
1092021-05-06 Joseph Myers <joseph@codesourcery.com>
110
111 PR c++/83873
112 PR preprocessor/97604
113 * lex.c (lex_number): Reject adjacent digit separators here. Do
114 not allow digit separators before '.' or an exponent with sign.
115 * expr.c (cpp_classify_number): Do not check for adjacent digit
116 separators here.
117
e690396d
GA
1182021-05-03 H.J. Lu <hjl.tools@gmail.com>
119
120 PR bootstrap/99703
121 * configure: Regenerated.
122
3c8e539d
GA
1232021-04-29 Joseph Myers <joseph@codesourcery.com>
124
125 PR preprocessor/82359
126 * directives.c (strtolinenum): Handle digit separators.
127
6e81e015
GA
1282021-04-19 Richard Biener <rguenther@suse.de>
129
130 PR preprocessor/100142
131 * line-map.c (linemap_position_for_loc_and_offset): Revert
132 unintended s/column_offset/column/ change.
133
6d0d35d5
GA
1342021-04-13 Nathan Sidwell <nathan@acm.org>
135
136 PR preprocessor/99446
137 * line-map.c (line-map.c): Do not advance to linemaps for
138 different files.
139
1402021-04-13 Eric Botcazou <ebotcazou@adacore.com>
141
142 * include/line-map.h (IS_MACRO_LOC): Delete.
143 * line-map.c (linemap_location_from_macro_expansion_p): Test
144 LINEMAPS_MACRO_LOWEST_LOCATION of the linemap.
145
d97a92dc
GA
1462021-03-02 David Malcolm <dmalcolm@redhat.com>
147
148 PR c/99323
149 * line-map.c (rich_location::maybe_add_fixit): Reject fix-it hints
150 at column 0.
151
4028d01a
GA
1522021-02-24 Nathan Sidwell <nathan@acm.org>
153
154 PR c++/98718
155 * include/line-map.h
156 * line-map.c
157
1582021-02-24 Nathan Sidwell <nathan@acm.org>
159
160 PR c++/99072
161 * init.c (read_original_filename): Expunge all evidence of the
162 original filename.
163
bf81237e
GA
1642021-02-18 Nathan Sidwell <nathan@acm.org>
165
166 PR c++/99023
167 * include/cpplib.h (cpp_find_header_unit): Rename to ...
168 (cpp_probe_header_unit): ... this.
169 * internal.h (_cp_find_header_unit): Declare.
170 * files.c (cpp_find_header_unit): Break apart to ..
171 (test_header_unit): ... this, and ...
172 (_cpp_find_header_unit): ... and, or and ...
173 (cpp_probe_header_unit): ... this.
174 * macro.c (cpp_get_token_1): Call _cpp_find_header_unit.
175
0e804ce3
GA
1762021-02-16 Nathan Sidwell <nathan@acm.org>
177
178 * files.c (_cpp_stack_file): Make buffers end in unread \n.
179
4b37c3ea
GA
1802021-02-10 David Malcolm <dmalcolm@redhat.com>
181
182 PR preprocessor/96391
183 * line-map.c (linemap_compare_locations): Require that
184 the location be <= LINE_MAP_MAX_LOCATION_WITH_COLS when
185 treating locations as coming from the same macro expansion.
186
a19dd5e6
GA
1872021-02-04 Jakub Jelinek <jakub@redhat.com>
188
189 * expr.c (cpp_classify_number): Use make_signed_t<size_t> instead of
190 make_signed<size_t>::type in the diagnostics.
191
9faaa807
GA
1922021-02-03 Jakub Jelinek <jakub@redhat.com>
193
194 PR preprocessor/98882
195 * lex.c (cpp_directive_only_process): Don't assert that rlimit[-1]
196 is a newline, instead assert that rlimit[0] is either newline or
197 carriage return. When seeing '\\' followed by '\r', check limit
198 before accessing pos[1].
199
2002021-02-03 Ed Smith-Rowland <3dw4rd@verizon.net>
201
202 * expr.c (interpret_int_suffix): Detect 'z' integer suffix.
203 (cpp_classify_number): Compat warning for use of 'z' suffix.
204 * include/cpplib.h (struct cpp_options): New flag.
205 (enum cpp_warning_reason): New flag.
206 (CPP_N_USERDEF): Comment C++0x -> C++11.
207 (CPP_N_SIZE_T): New flag for cpp_classify_number.
208 * init.c (cpp_set_lang): Initialize new flag.
209
aa69f0a8
GA
2102021-01-27 liuhongt <hongtao.liu@intel.com>
211
212 PR target/98833
213 * lex.c (search_line_sse2): Replace builtins with == operator.
214
e62bb7f0
GA
2152021-01-26 Paul Fee <paul.f.fee@gmail.com>
216
217 * include/cpplib.h (c_lang): Add CXX23 and GNUCXX23.
218 * init.c (lang_defaults): Add rows for CXX23 and GNUCXX23.
219 (cpp_init_builtins): Set __cplusplus to 202100L for C++23.
220
2f7f0d32
GA
2212021-01-15 Nathan Sidwell <nathan@acm.org>
222
223 PR preprocessor/95253
224 * mkdeps.c (munge): Do not escape ':'.
225
d52945ce
GA
2262020-12-14 Nathan Sidwell <nathan@acm.org>
227
228 * include/cpplib.h (struct cpp_macro): Add imported_p field.
229 (struct cpp_hashnode): Tweak deferred field documentation.
230 * macro.c (_cpp_new_macro): Clear new field.
231 (cpp_get_deferred_macro, get_deferred_or_lazy_macro): Assert
232 more.
233
35af8778
GA
2342020-12-10 Jason Merrill <jason@redhat.com>
235
236 * init.c (cpp_init_builtins): Update __cplusplus for C++20.
237
e0f5e792
GA
2382020-12-01 JeanHeyd Meneide <phdofthehouse@gmail.com>
239
240 * charset.c (init_iconv_desc): Initialize "to" and "from" fields.
241 * directives.c (cpp_get_narrow_charset_name): New function.
242 (cpp_get_wide_charset_name): Likewise.
243 * include/cpplib.h (cpp_get_narrow_charset_name): Prototype.
244 (cpp_get_wide_charset_name): Likewise.
245 * internal.h (cset_converter): Add "to" and "from" fields.
246
e87559d2
GA
2472020-11-27 Joseph Myers <joseph@codesourcery.com>
248
249 PR preprocessor/97602
250 * directives.c (strtolinenum): Check for overflow before it
251 occurs. Correct comment.
252
1e2c9a27
GA
2532020-11-24 Nathan Sidwell <nathan@acm.org>
254
255 * include/cpplib.h (struct cpp_hashnode): Add deferred field.
256 (cpp_set_deferred_macro): Define.
257 (cpp_get_deferred_macro): Declare.
258 (cpp_macro_definition): Reformat, add overload.
259 (cpp_macro_definition_location): Deal with deferred macro.
260 (cpp_alloc_token_string, cpp_compare_macro): Declare.
261 * internal.h (_cpp_notify_macro_use): Return bool
262 (_cpp_maybe_notify_macro_use): Likewise.
263 * directives.c (do_undef): Check macro is not undef before
264 warning.
265 (do_ifdef, do_ifndef): Deal with deferred macro.
266 * expr.c (parse_defined): Likewise.
267 * lex.c (cpp_allocate_token_string): Break out of ...
268 (create_literal): ... here. Call it.
269 (cpp_maybe_module_directive): Deal with deferred macro.
270 * macro.c (cpp_get_token_1): Deal with deferred macro.
271 (warn_of_redefinition): Deal with deferred macro.
272 (compare_macros): Rename to ...
273 (cpp_compare_macro): ... here. Make extern.
274 (cpp_get_deferred_macro): New.
275 (_cpp_notify_macro_use): Deal with deferred macro, return bool
276 indicating definedness.
277 (cpp_macro_definition): Deal with deferred macro.
278
d62586ee
GA
2792020-11-19 Nathan Sidwell <nathan@acm.org>
280
281 * include/cpplib.h (enum cpp_main_search): New.
282 (struct cpp_options): Add main_search field.
283 (cpp_main_loc): Declare.
284 (cpp_retrofit_as_include): Declare.
285 * internal.h (struct cpp_reader): Add main_loc field.
286 (_cpp_in_main_source_file): Not main if main is a header.
287 * init.c (cpp_read_main_file): Use main_search option to locate
288 main file. Set main_loc
289 * files.c (cpp_retrofit_as_include): New.
290
2912020-11-19 Nathan Sidwell <nathan@acm.org>
292
293 * internal.h (cpp_in_system_header): Rename to ...
294 (_cpp_in_system_header): ... here.
295 (cpp_in_primary_file): Rename to ...
296 (_cpp_in_main_source_file): ... here. Compare main_file equality
297 and check main_search value.
298 * lex.c (maybe_va_opt_error, _cpp_lex_direct): Adjust for rename.
299 * macro.c (_cpp_builtin_macro_text): Likewise.
300 (replace_args): Likewise.
301 * directives.c (do_include_next): Likewise.
302 (do_pragma_once, do_pragma_system_header): Likewise.
303 * files.c (struct _cpp_file): Delete main_file field.
304 (pch_open): Check pfile->main_file equality.
305 (make_cpp_file): Drop cpp_reader parm, don't set main_file.
306 (_cpp_find_file): Adjust.
307 (_cpp_stack_file): Check pfile->main_file equality.
308 (struct report_missing_guard_data): Add cpp_reader field.
309 (report_missing_guard): Check pfile->main_file equality.
310 (_cpp_report_missing_guards): Adjust.
311
25bb75f8
GA
3122020-11-18 Nathan Sidwell <nathan@acm.org>
313
314 * include/cpplib.h (struct cpp_options): Add module_directives
315 option.
316 (NODE_MODULE): New node flag.
317 (struct cpp_hashnode): Make rid-code a bitfield, increase bits in
318 flags and swap with type field.
319 * init.c (post_options): Create module-directive identifier nodes.
320 * internal.h (struct lexer_state): Add directive_file_token &
321 n_modules fields. Add module node enumerator.
322 * lex.c (cpp_maybe_module_directive): New.
323 (_cpp_lex_token): Call it.
324 (cpp_output_token): Add '"' around CPP_HEADER_NAME token.
325 (do_peek_ident, do_peek_module): New.
326 (cpp_directives_only): Detect module-directive lines.
327 * macro.c (cpp_get_token_1): Deal with directive_file_token
328 triggering.
329
3302020-11-18 Nathan Sidwell <nathan@acm.org>
331
332 * files.c (struct _cpp_file): Add header_unit field.
333 (_cpp_stack_file): Add header unit support.
334 (cpp_find_header_unit): New.
335 * include/cpplib.h (cpp_find_header_unit): Declare.
336
3372020-11-18 Nathan Sidwell <nathan@acm.org>
338
339 * include/cpplib.h (struct cpp_options): Add modules to
340 dep-options.
341 * include/mkdeps.h (deps_add_module_target): Declare.
342 (deps_add_module_dep): Declare.
343 * mkdeps.c (class mkdeps): Add modules, module_name, cmi_name,
344 is_header_unit fields. Adjust cdtors.
345 (deps_add_module_target, deps_add_module_dep): New.
346 (make_write): Write module dependencies, if enabled.
347
4dabb037
GA
3482020-11-17 Nathan Sidwell <nathan@acm.org>
349
350 * include/cpplib.h (struct cpp_callbacks): Add
351 user_deferred_macro & translate_include.
352
3532020-11-17 Nathan Sidwell <nathan@acm.org>
354
355 * include/line-map.h (enum lc_reason): Add LC_MODULE.
356 (MAP_MODULE_P): New.
357 (line_map_new_raw): Declare.
358 (linemap_enter_macro): Move declaration from internal.h
359 (linemap_module_loc, linemap_module_reparent)
360 (linemap_module_restore): Declare.
361 (linemap_lookup_macro_indec): Declare.
362 * internal.h (linemap_enter_macro): Moved to line-map.h.
363 * line-map.c (linemap_new_raw): New, broken out of ...
364 (new_linemap): ... here. Call it.
365 (LAST_SOURCE_LINE_LOCATION): New.
366 (liemap_module_loc, linemap_module_reparent)
367 (linemap_module_restore): New.
368 (linemap_lookup_macro_index): New, broken out of ...
369 (linemap_macro_map_lookup): ... here. Call it.
370 (linemap_dump): Add module dump.
371
3722020-11-17 Nathan Sidwell <nathan@acm.org>
373
374 PR preprocessor/97858
375 * mkdeps.c (munge): Drop varadic args, we only ever use one.
376
77f67db2
GA
3772020-11-13 Joseph Myers <joseph@codesourcery.com>
378
379 * expr.c (cpp_classify_number): Update diagnostic for binary
380 constants for C. Also diagnose binary constants for
381 -Wc11-c2x-compat.
382 * init.c (lang_defaults): Enable binary constants for GNUC2X and
383 STDC2X.
384
3852020-11-13 Piotr H. Dabrowski <phd@phd.re>
386
387 PR c++/91318
388 * include/cpplib.h: Added cpp_define_unused(), cpp_define_formatted_unused()
389 * directives.c: Likewise.
390
a5a11525
GA
3912020-11-12 Joseph Myers <joseph@codesourcery.com>
392
393 * include/cpplib.h (struct cpp_callbacks): Add bool argument to
394 has_attribute.
395 (enum cpp_builtin_type): Add BT_HAS_STD_ATTRIBUTE.
396 * init.c (builtin_array): Add __has_c_attribute.
397 (cpp_init_special_builtins): Handle BT_HAS_STD_ATTRIBUTE.
398 * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_STD_ATTRIBUTE.
399 Update call to has_attribute for BT_HAS_ATTRIBUTE.
400 * traditional.c (fun_like_macro): Handle BT_HAS_STD_ATTRIBUTE.
401
4022020-11-12 Nicholas Guriev <guriev-ns@ya.ru>
403
404 PR pch/86674
405 * files.c (_cpp_find_file): Use CPP_DL_NOTE not CPP_DL_ERROR in call to
406 cpp_error.
407
2da7ee05
GA
4082020-11-07 Lewis Hyatt <lhyatt@gmail.com>
409
410 * generated_cpp_wcwidth.h: Regenerated from Unicode 13.0.0 data.
411
44cab2d8
GA
4122020-11-06 Nathan Sidwell <nathan@acm.org>
413
414 * include/cpplib.h (enum class CPP_time_kind): New.
415 (cpp_get_date): Declare.
416 * internal.h (struct cpp_reader): Replace source_date_epoch with
417 time_stamp and time_stamp_kind.
418 * init.c (cpp_create_reader): Initialize them.
419 * macro.c (_cpp_builtin_macro_text): Use cpp_get_date.
420 (cpp_get_date): Broken out from _cpp_builtin_macro_text and
421 genericized.
422
fd2325ea
GA
4232020-11-03 Nathan Sidwell <nathan@acm.org>
424
425 * lex.c (cpp_peek_token): Do not peek past CPP_PRAGMA.
426 (_cpp_lex_direct): Handle EOF in pragma when setting need_line,
427 not when needing a line.
428
4292020-11-03 Nathan Sidwell <nathan@acm.org>
430
431 * lex.c (_cpp_clean_line): Fix DOS off-by-one error.
432
4332020-11-03 Nathan Sidwell <nathan@acm.org>
434
435 * init.c (cpp_read_main_file): Use cpp_get_deps result.
436
4372020-11-03 Nathan Sidwell <nathan@acm.org>
438
439 * include/mkdeps.h: Include cpplib.h
440 (deps_write): Adjust first parm type.
441 * mkdeps.c: Include internal.h
442 (make_write): Adjust first parm type. Check phony option
443 directly.
444 (deps_write): Adjust first parm type.
445 * init.c (cpp_read_main_file): Use get_deps.
446 * directives.c (cpp_get_deps): Check option before initializing.
447
88ce3d5f
GA
4482020-11-02 Nathan Sidwell <nathan@acm.org>
449
450 * internal.h (_cpp_notify_macro_use): Add location parm.
451 (_cpp_maybe_notify_macro_use): Likewise.
452 * directives.c (_cpp_do_file_change): Check we've not changed file
453 when optimizing a rewind.
454 (do_ifdef): Pass location to _cpp_maybe_notify_macro_use.
455 (do_ifndef): Likewise. Delete obsolete comment about powerpc.
456 * expr.c (parse_defined): Pass location to
457 _cpp_maybe_notify_macro_use.
458 * macro.c (enter_macro_context): Likewise.
459 (warn_of_redefinition): Break out helper function. Call it.
460 (compare_macros): New function broken out of warn_of_redefinition.
461 (_cpp_new_macro): Zero all fields.
462 (_cpp_notify_macro_use): Add location parameter.
463
e2e04288
GA
4642020-10-20 Nathan Sidwell <nathan@acm.org>
465
466 * lex.c (_cpp_lex_direct): Do not complete EOF processing when
467 parsing_args.
468 * macro.c (collect_args): Do not unwind fake EOF.
469 (funlike_invocation_p): Do not unwind fake EOF.
470 (cpp_context): Replace abort with gcc_assert.
471
970d683f
GA
4722020-10-19 Nathan Sidwell <nathan@acm.org>
473
474 * internal.h (struct cpp_reader): Rename 'eof' field to 'endarg'.
475 * init.c (cpp_create_reader): Adjust.
476 * macro.c (collect_args): Use endarg for separator. Always rewind
477 in the not-fn case.
478
da9df699
GA
4792020-10-08 Nathan Sidwell <nathan@acm.org>
480
481 * internal.h (enum include_type): Rename IT_MAIN_INJECT to
482 IT_PRE_MAIN.
483 * init.c (cpp_read_main_file): If there is no line marker, adjust
484 the initial line marker.
485 (read_original_filename): Return bool, peek the buffer directly
486 before trying to tokenize.
487 (read_original_directory): Likewise. Directly prod the string
488 literal.
489 * files.c (_cpp_stack_file): Adjust for IT_PRE_MAIN change.
490
91dd4a38
GA
4912020-09-26 Jakub Jelinek <jakub@redhat.com>
492
493 PR bootstrap/97163
494 * lex.c (search_line_fast): Only use _ARCH_PWR8 Altivec version
495 for GCC >= 4.5.
496
2aad20c0
GA
4972020-09-17 Patrick Palka <ppalka@redhat.com>
498
499 PR c/80076
500 * include/line-map.h (first_map_in_common): Declare.
501 * line-map.c (first_map_in_common): Remove static.
502
a995c40d
GA
5032020-09-07 Martin Storsjö <martin@martin.st>
504
505 * files.c (remap_filename): Make a strchr return value pointer
506 to const.
507
d48cca8f
GA
5082020-07-30 H.J. Lu <hjl.tools@gmail.com>
509
510 PR bootstrap/96202
511 * configure: Regenerated.
512
bea7a391
GA
5132020-07-29 Tiziano Müller <tiziano.mueller@chem.uzh.ch>
514
515 * init.c (builtin_array): Add xref comment.
516 * traditional.c (fun_like_macro): Add HAS_INCLUDE codes.
517
7ebb7d0c
GA
5182020-07-28 Jakub Jelinek <jakub@redhat.com>
519
520 PR preprocessor/96323
521 * lex.c (lex_raw_string): For c == '\n' don't continue after reporting
522 an prefix delimiter error.
523
5242020-07-28 Nathan Sidwell <nathan@acm.org>
525
526 * init.c (cpp_read_main_file): Always use the last map for
527 the return value.
528
0933f508
GA
5292020-07-20 Nathan Sidwell <nathan@acm.org>
530
531 * line-map.c (linemap_add): Simplify column overflow calculation.
532 Add comment about range and column bit init.
533 (linemap_ordinary_map_lookup): Refactor for RAII
534 (linemap_macro_map_lookup): Likewise.
535
8ca07a30
GA
5362020-07-14 Lewis Hyatt <lhyatt@gmail.com>
537
538 PR preprocessor/49973
539 PR other/86904
540 * include/cpplib.h (struct cpp_options): Removed support for -ftabstop,
541 which is now handled by diagnostic_context.
542 (class cpp_display_width_computation): New class.
543 (cpp_byte_column_to_display_column): Add optional tabstop argument.
544 (cpp_display_width): Likewise.
545 (cpp_display_column_to_byte_column): Likewise.
546 * charset.c
547 (cpp_display_width_computation::cpp_display_width_computation): New
548 function.
549 (cpp_display_width_computation::advance_display_cols): Likewise.
550 (compute_next_display_width): Removed and implemented this
551 functionality in a new function...
552 (cpp_display_width_computation::process_next_codepoint): ...here.
553 (cpp_byte_column_to_display_column): Added tabstop argument.
554 Reimplemented in terms of class cpp_display_width_computation.
555 (cpp_display_column_to_byte_column): Likewise.
556 * init.c (cpp_create_reader): Remove handling of -ftabstop, which is now
557 handled by diagnostic_context.
558
f60ee68d
GA
5592020-07-07 Nathan Sidwell <nathan@acm.org>
560
561 * directives.c (do_linemarker): Optimize rewinding to line zero.
562 * files.c (_cpp_stack_file): Start on line zero when about to inject
563 headers.
564 (cpp_push_include, cpp_push_default_include): Use highest_line as
565 the location.
566 * include/cpplib.h (cpp_read_main_file): Add injecting parm.
567 * init.c (cpp_read_main_file): Likewise, inform _cpp_stack_file.
568 * internal.h (enum include_type): Add IT_MAIN_INJECT.
569
885ef72f
GA
5702020-05-29 H.J. Lu <hjl.tools@gmail.com>
571
572 PR bootstrap/95413
573 * configure: Regenerated.
574
731c4ce0
DE
5752020-05-23 David Edelsohn <dje.gcc@gmail.com>
576
577 * Makefile.in (AR): Substitute @AR@.
578 * configure.ac (CHECK_PROG AR): New.
579 * configure: Regenerate.
580
4623a6f2
NS
5812020-05-20 Nathan Sidwell <nathan@acm.org>
582
583 * internal.h (typedef _cpp_file): Delete, unnecessary in C++.
584 (enum _cpp_find_file_kind): New.
585 (_cpp_find_file): Use it, not 3 bools.
586 * files.c (_cpp_find_file): Use _cpp_find_file_kind enum, not
587 bools.
588 (cpp_make_system_header): Break overly long line.
589 (_cpp_stack_include, _cpp_fake_include)
590 (_cpp_do_file_change, _cpp_compare_file_date, _cpp_has_header): Adjust.
591 * init.c (cpp_read_main): Adjust _cpp_find_file call.
592
a641d6d3
NS
5932020-05-18 Nathan Sidwell <nathan@acm.org>
594
7cf3f604
NS
595 * include/cpplib.h (cpp_get_otions, cpp_get_callbacks)
596 (cpp_get_deps): Mark as PURE.
597 * include/line-map.h (get_combined_adhoc_loc)
598 (get_location_from_adhoc_loc, get_pure_location): Reformat decls.
599 * internal.h (struct lexer_state): Clarify comment.
600 * system.h: Remove now-unneeded bool hackery.
601 * files.c (_cpp_find_file): Store LOC not highest_location.
602
ed63c387
NS
603 PR preprocessor/95149
604 * lex.c (struct lit_accum): New.
605 (bufring_append): Replace by lit_accum::append.
606 (lex_raw_string): Reimplement, using fragments of the old version.
607 (lex_string): Adjust lex_raw_string call.
608
a641d6d3
NS
609 PR preprocessor/95182
610 * macro.c (collect_args): Preserve EOFif we fell out of the main
611 file.
612 (cpp_get_token_1): Reformat a couple of short lines.
613
8d286dd1
L
6142020-05-14 H.J. Lu <hongjiu.lu@intel.com>
615
616 * configure: Regenerated.
617
b04445d4
JM
6182020-05-13 Jason Merrill <jason@redhat.com>
619
620 * include/cpplib.h (enum c_lang): Change CXX2A to CXX20.
621 * init.c, lex.c: Adjust.
622
2a0225e4
NS
6232020-05-12 Nathan Sidwell <nathan@acm.org>
624
625 EOF location is at end of file
626 PR preprocessor/95013
627 * lex.c (lex_raw_string): Process line notes before incrementing.
628 Correct incrementing condition. Adjust for new
629 _cpp_get_fresh_line EOF behaviour.
630 (_cpp_get_fresh_line): Do not pop buffer at EOF, increment line
631 instead.
632 (_cpp_lex_direct): Adjust for new _cpp_get_fresh_line behaviour.
633 (cpp_directive_only_process): Assert we got a fresh line.
634 * traditional.c (_cpp_read_logical_line_trad): Adjust for new
635 _cpp_get_fresh_line behaviour.
636
051da742
L
6372020-05-12 H.J. Lu <hongjiu.lu@intel.com>
638
639 * Makefile.in (CET_HOST_FLAGS): New.
640 (COMPILER): Add $(CET_HOST_FLAGS).
641 * configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and
642 AC_SUBST(CET_HOST_FLAGS). Clear CET_HOST_FLAGS if jit isn't
643 enabled.
644 * aclocal.m4: Regenerated.
645 * configure: Likewise.
646
b224c376
NS
6472020-05-08 Nathan Sidwell <nathan@acm.org>
648
649 Reimplement directives only processing, support raw literals.
650 * directives-only.c: Delete.
651 * Makefile.in (libcpp_a_OBJS, libcpp_a_SOURCES): Remove it.
652 * include/cpplib.h (enum CPP_DO_task): New enum.
653 (cpp_directive_only_preprocess): Declare.
654 * internal.h (_cpp_dir_only_callbacks): Delete.
655 (_cpp_preprocess_dir_only): Delete.
656 * lex.c (do_peek_backslask, do_peek_next, do_peek_prev): New.
657 (cpp_directives_only_process): New implementation.
658
e235031d
JJ
6592020-02-14 Jakub Jelinek <jakub@redhat.com>
660
661 Partially implement P1042R1: __VA_OPT__ wording clarifications
662 PR preprocessor/92319
663 * macro.c (expand_arg): Move declarations before vaopt_state
664 definition.
665 (class vaopt_state): Move enum update_type definition earlier. Remove
666 m_allowed member, add m_arg and m_update members.
667 (vaopt_state::vaopt_state): Change last argument from bool any_args
668 to macro_arg *arg, initialize m_arg and m_update instead of m_allowed.
669 (vaopt_state::update): When bumping m_state from 1 to 2 and m_update
670 is ERROR, determine if __VA_ARGS__ expansion has any non-CPP_PADDING
671 tokens and set m_update to INCLUDE if it has any, DROP otherwise.
672 Return m_update instead of m_allowed ? INCLUDE : DROP in m_state >= 2.
673 (replace_args, create_iso_definition): Adjust last argument to
674 vaopt_state ctor.
675
297aa668
MS
6762020-02-05 Martin Sebor <msebor@redhat.com>
677
678 * include/cpplib.h (cpp_builtin_type): Remove trailing comma to
679 avoid pedantic warnings in C++ 98 mode.
680
c04babd9
JJ
6812020-02-04 Jakub Jelinek <jakub@redhat.com>
682
f8d6e448
JJ
683 * macro.c (builtin_has_include): Diagnose __has_include* use outside
684 of preprocessing directives.
685
c04babd9
JJ
686 PR preprocessor/93545
687 * macro.c (cpp_get_token_no_padding): New function.
688 (builtin_has_include): Use it instead of cpp_get_token. Don't check
689 SEEN_EOL.
690
20fa702b
AB
6912020-02-01 Andrew Burgess <andrew.burgess@embecosm.com>
692
693 * configure: Regenerate.
694
3d056cbf
NS
6952020-01-28 Nathan Sidwell <nathan@acm.org>
696
697 PR preprocessor/93452
698 * internal.h (struct spec_nodes): Drop n__has_include{,_next}.
699 * directives.c (lex_macro_node): Don't check __has_include redef.
700 * expr.c (eval_token): Drop __has_include eval.
701 (parse_has_include): Move to ...
702 * macro.c (builtin_has_include): ... here.
703 (_cpp_builtin_macro_text): Eval __has_include{,_next}.
704 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_INCLUDE{,_NEXT}.
705 * init.c (builtin_array): Add them.
706 (cpp_init_builtins): Drop __has_include{,_next} init here ...
707 * pch.c (cpp_read_state): ... and here.
708 * traditional.c (enum ls): Drop has_include states ...
709 (_cpp_scan_out_logical_line): ... and here.
710
e7c26e04
AB
7112020-01-27 Andrew Burgess <andrew.burgess@embecosm.com>
712
713 * configure: Regenerate.
714
a1f6eff2
NS
7152020-01-24 Nathan Sidwell <nathan@acm.org>
716
717 * expr.c (parse_has_include): Remove bogus controlling macro code.
718
ad1a3914
NS
7192020-01-20 Nathan Sidwell <nathan@acm.org>
720
721 PR preprocessor/80005
722 * include/cpplib.h (BT_HAS_ATTRIBUTE): Fix comment.
723 * internal.h (struct lexer_state): Delete in__has_include field.
724 (struct spec_nodes): Rename n__has_include{,_next}__ fields.
725 (_cpp_defined_macro_p): New.
726 (_cpp_find_file): Add has_include parm.
727 * directives.c (lex_macro_node): Combine defined,
728 __has_inline{,_next} checking.
729 (do_ifdef, do_ifndef): Use _cpp_defined_macro_p.
730 (_cpp_init_directives): Refactor.
731 * expr.c (parse_defined): Use _cpp_defined_macro_p.
732 (eval_token): Adjust parse_has_include calls.
733 (parse_has_include): Add OP parameter. Reimplement.
734 * files.c (_cpp_find_file): Add HAS_INCLUDE parm. Use it to
735 inhibit error message.
736 (_cpp_stack_include): Adjust _cpp_find_file call.
737 (_cpp_fake_include, _cpp_compare_file_date): Likewise.
738 (open_file_failed): Remove in__has_include check.
739 (_cpp_has_header): Adjust _cpp_find_file call.
740 * identifiers.c (_cpp_init_hashtable): Don't init
741 __has_include{,_next} here ...
742 * init.c (cpp_init_builtins): ... init them here. Define as
743 macros.
744 (cpp_read_main_file): Adjust _cpp_find_file call.
745 * pch.c (cpp_read_state): Adjust __has_include{,_next} access.
746 * traditional.c (_cpp_scan_out_locgical_line): Likewise.
bf09d886
NS
747
748 PR preprocessor/93306
749 * expr.c (parse_has_include): Refactor. Check skip_eval before
750 looking.
751
4bc1899b
DM
7522020-01-10 David Malcolm <dmalcolm@redhat.com>
753
754 * include/line-map.h (class diagnostic_path): New forward decl.
755 (rich_location::get_path): New accessor.
756 (rich_location::set_path): New function.
757 (rich_location::m_path): New field.
758 * line-map.c (rich_location::rich_location): Initialize m_path.
759
8d9254fc
JJ
7602020-01-01 Jakub Jelinek <jakub@redhat.com>
761
762 Update copyright years.
763
6dd0c820
DM
7642019-12-18 David Malcolm <dmalcolm@redhat.com>
765
766 PR preprocessor/92982
767 * charset.c
768 (cpp_string_location_reader::cpp_string_location_reader): Delete
769 initialization of m_line_table.
770 * include/cpplib.h (cpp_string_location_reader::m_line_table):
771 Delete unused member.
772
937a778e
JJ
7732019-12-14 Jakub Jelinek <jakub@redhat.com>
774
775 PR preprocessor/92919
776 * charset.c (wide_str_to_charconst): If str contains just the
777 NUL terminator, punt quietly.
778
d68f5d45
DM
7792019-12-09 David Malcolm <dmalcolm@redhat.com>
780
781 * include/line-map.h (label_text::label_text): Make private.
782 (label_text::borrow): New.
783 (label_text::take): New.
784 (label_text::take_or_copy): New.
785
ee925640
LH
7862019-12-09 Lewis Hyatt <lhyatt@gmail.com>
787
788 PR preprocessor/49973
789 * generated_cpp_wcwidth.h: New file generated by
790 ../contrib/unicode/gen_wcwidth.py, supports new cpp_wcwidth function.
791 * charset.c (compute_next_display_width): New function to help
792 implement display columns.
793 (cpp_byte_column_to_display_column): Likewise.
794 (cpp_display_column_to_byte_column): Likewise.
795 (cpp_wcwidth): Likewise.
796 * include/cpplib.h (cpp_byte_column_to_display_column): Declare.
797 (cpp_display_column_to_byte_column): Declare.
798 (cpp_wcwidth): Declare.
799 (cpp_display_width): New function.
800
7c5890cc
JM
8012019-11-14 Joseph Myers <joseph@codesourcery.com>
802
803 * charset.c (narrow_str_to_charconst): Make CPP_UTF8CHAR constants
804 unsigned for C.
805 * init.c (lang_defaults): Set utf8_char_literals for GNUC2X and
806 STDC2X.
807
2c03d736
JJ
8082019-11-07 Jakub Jelinek <jakub@redhat.com>
809
810 PR c++/91370 - Implement P1041R4 and P1139R2 - Stronger Unicode reqs
811 * charset.c (narrow_str_to_charconst): Add TYPE argument. For
812 CPP_UTF8CHAR diagnose whenever number of chars is > 1, using
813 CPP_DL_ERROR instead of CPP_DL_WARNING.
814 (wide_str_to_charconst): For CPP_CHAR16 or CPP_CHAR32, use
815 CPP_DL_ERROR instead of CPP_DL_WARNING when multiple char16_t
816 or char32_t chars are needed.
817 (cpp_interpret_charconst): Adjust narrow_str_to_charconst caller.
818
b7689b96
JM
8192019-11-05 Tim van Deurzen <tim@kompiler.org>
820
821 * cpplib.h: Add spaceship operator for C++.
822 * lex.c: Implement conditional lexing of spaceship operator for C++20.
823
aa23e73b
JJ
8242019-10-31 Jakub Jelinek <jakub@redhat.com>
825
826 PR preprocessor/92296
827 * internal.h (struct def_pragma_macro): Add is_builtin bitfield.
828 (_cpp_restore_special_builtin): Declare.
829 * init.c (_cpp_restore_special_builtin): New function.
830 * directives.c (do_pragma_push_macro): For NT_BUILTIN_MACRO
831 set is_builtin and don't try to grab definition.
832 (cpp_pop_definition): Use _cpp_restore_special_builtin to restore
833 builtin macros.
834
9158f0ba
NS
8352019-10-15 Nathan Sidwell <nathan@acm.org>
836
837 * include/line-map.h (struct maps_info_ordinary): Make cache
838 mutable.
839 (struct maps_info_macro): Likewise.
840 (LINEMAPS_CACHE): Remove non-ref accessor. Constify ref accessor.
841 (LINEMAPS_ORDINARY_CACHE, LINEMAPS_MACRO_CACHE): Likewise.
842 (LINEMAPS_ORDINARY_MAP_AT, LINEMAPS_MACRO_MAP_AT): Use
843 LINEMAPS_USED and LINEMAPS_MAP_AT.
844 (linemap_lookup): Constify line_map arg.
845 linemap.c (linemap_ordinary_map_lookup, linemap_macro_map_lookup):
846 Constify line_map arg.
847
175a85b2
JM
8482019-10-11 Joseph Myers <joseph@codesourcery.com>
849
850 * include/cpplib.h (struct cpp_options): Add dfp_constants and
851 cpp_warn_c11_c2x_compat.
852 (enum cpp_warning_reason): Add CPP_W_C11_C2X_COMPAT.
853 * init.c (struct lang_flags): Add dfp_constants.
854 (lang_defaults): Set dfp_constants to 1 for GNUC2X and STDC2X and
855 0 for other languages.
856 (cpp_set_lang): Set dfp_constants from language.
857 (cpp_create_reader): Set cpp_warn_c11_c2x_compat to -1.
858 * expr.c (interpret_float_suffix): Mention DFP constants as C2X in
859 comment.
860 (cpp_classify_number): Do not diagnose DFP constants for languages
861 setting dfp_constants, unless cpp_warn_c11_c2x_compat.
862
924b9276
NS
8632019-10-04 Nathan Sidwell <nathan@acm.org>
864
865 PR preprocessor/91991
866 * line-map.c (linemap_line_start): Clear max_column_hint if we run
867 out of locations.
868
68710ac7
RB
8692019-10-02 Richard Biener <rguenther@suse.de>
870
871 * internal.h (enum include_type): Remove trailing comma.
872
93313b94
JM
8732019-10-02 Joseph Myers <joseph@codesourcery.com>
874
875 * include/cpplib.h (struct cpp_options): Add member scope.
876 * init.c (struct lang_flags, lang_defaults): Likewise.
877 (cpp_set_lang): Set scope member of pfile.
878 * lex.c (_cpp_lex_direct): Test CPP_OPTION (pfile, scope) not
879 CPP_OPTION (pfile, cplusplus) for creating CPP_SCOPE tokens.
880
0900e29c
EB
8812019-09-26 Eric Botcazou <ebotcazou@adacore.com>
882
883 * charset.c (UCS_LIMIT): New macro.
884 (ucn_valid_in_identifier): Use it instead of a hardcoded constant.
885 (_cpp_valid_ucn): Issue a pedantic warning for UCNs larger than
886 UCS_LIMIT outside of identifiers in C and in C++2a or later.
887
7d112d66
LH
8882019-09-19 Lewis Hyatt <lhyatt@gmail.com>
889
890 PR c/67224
891 * charset.c (_cpp_valid_utf8): New function to help lex UTF-8 tokens.
892 * internal.h (_cpp_valid_utf8): Declare.
893 * lex.c (forms_identifier_p): Use it to recognize UTF-8 identifiers.
894 (_cpp_lex_direct): Handle UTF-8 in identifiers and CPP_OTHER tokens.
895 Do all work in "default" case to avoid slowing down typical code paths.
896 Also handle $ and UCN in the default case for consistency.
897
400b8274
NS
8982019-08-30 Nathan Sidwell <nathan@acm.org>
899
900 New # semantics for popping to "" name.
901 libcpp/
902 * directives.c (do_linemarker): Popping to "" name means get the
903 name from the include stack..
904
056f95ec
NS
9052019-09-05 Nathan Sidwell <nathan@acm.org>
906
907 PR preprocessor/91639
908 * directives.c (do_include_common): Tell lexer we're a #include.
909 * files.c (_cpp_stack_file): Lexer will have always incremented.
910 * internal.h (struct cpp_context): Extend in_directive's
911 semantics.
912 * lex.c (_cpp_lex_direct): Increment line for final \n when lexing
913 for an ISO #include.
914 * line-map.c (linemap_line_start): Remember if we overflowed.
915
2f2aeda9
UW
9162019-09-03 Ulrich Weigand <uweigand@de.ibm.com>
917
918 * directives.c: Remove references to spu from comments.
919 * expr.c: Likewise.
920
b0d11f1e
NS
9212019-08-29 Nathan Sidwell <nathan@acm.org>
922
923 * internal.h (enum include_type): Add IT_MAIN, IT_DIRECTIVE_HWM,
924 IT_HEADER_HWM.
925 (_cpp_stack_file): Take include_type, not a bool.
926 * files.c (_cpp_find_file): Refactor to not hide an if inside a
927 for conditional.
928 (should_stack_file): Break apart to ...
929 (is_known_idempotent_file, has_unique_contents): ... these.
930 (_cpp_stack_file): Replace IMPORT boolean with include_type enum.
931 Refactor to use new predicates. Do linemap compensation here ...
932 (_cpp_stack_include): ... not here.
933 * init.c (cpp_read_main_file): Pass IT_MAIN to _cpp_stack_file.
934
a0be978a
NS
9352019-08-28 Nathan Sidwell <nathan@acm.org>
936
937 * directives-only.c (_cpp_preprocess_dir_only): Use false, not
938 zero for _cpp_handle_directive call.
939 * directives.c (_cpp_handle_directive): Indented is bool.
940 * files.c (struct _cpp_file): Make bools 1 bit bitfields.
941 * internal.h (enum include_type): Reformat and comment.
942 (struct cpp_buffer): Make flags 1 bit bitfields.
943 (_cpp_handle_directive): Indented is bool.
944
6c1dae73
MS
9452019-07-09 Martin Sebor <msebor@redhat.com>
946
947 * include/line-map.h: Change class-key from class to struct and vice
948 versa to match convention and avoid -Wclass-is-pod and -Wstruct-no-pod.
949 * mkdeps.c: Same.
950
8ba6ea87
ML
9512019-07-03 Martin Liska <mliska@suse.cz>
952
953 * line-map.c (linemap_get_expansion_filename): Remove
954 dead assignemts.
955 * mkdeps.c (make_write): Likewise.
956
1c6ffbab
QZ
9572019-07-02 qing zhao <qing.zhao@oracle.com>
958
959 PR preprocessor/90581
960 * directives.c (do_include_common): Replace CPP_STACK_MAX with
961 CPP_OPTION (pfile, max_include_depth).
962 * include/cpplib.h (struct cpp_options): Add new field
963 max_include_depth.
964 * init.c (cpp_create_reader): Initiate new field max_include_depth.
965 * internal.h: Delete CPP_STACK_MAX.
966
66d7749b
NS
9672019-06-26 Nathan Sidwell <nathan@acm.org>
968
969 PR preprocessor/90927
970 * mkdeps.c (mkdeps::vec::operator[]): Add non-const variant.
971 (deps_add_target): Deal with out of order unquoted targets.
972
3f23e487
AP
9732019-05-19 Andrew Pinski <apinski@marvell.com>
974
975 PR pch/81721
976 * lex.c (cpp_token_val_index <case SPELL_OPERATOR>): If tok->flags
977 has NAMED_OP set, then return CPP_TOKEN_FLD_NODE.
978
19eda56d
ML
9792019-05-14 Martin Liska <mliska@suse.cz>
980
981 PR preprocessor/90382
982 * line-map.c (first_map_in_common_1): Handle ADHOC
983 locations.
984
e6fc8353
ML
9852019-05-14 Martin Liska <mliska@suse.cz>
986
987 PR preprocessor/90382
988 * include/line-map.h (get_data_from_adhoc_loc): Add const to
989 the first argument.
990 (get_location_from_adhoc_loc): Likewise.
991 * line-map.c(get_data_from_adhoc_loc): Add const to
992 the first argument.
993 (get_location_from_adhoc_loc): Likewise.
994 (get_combined_adhoc_loc): Use get_location_from_adhoc_loc
995 (or get_data_from_adhoc_loc).
996 (get_range_from_adhoc_loc): Likewise.
997 (get_pure_location): Likewise.
998 (linemap_position_for_loc_and_offset): Likewise.
999 (linemap_lookup): Likewise.
1000 (linemap_ordinary_map_lookup): Likewise.
1001 (linemap_macro_map_lookup): Likewise.
1002 (linemap_get_expansion_line): Likewise.
1003 (linemap_get_expansion_filename): Likewise.
1004 (linemap_location_in_system_header_p): Likewise.
1005 (linemap_location_from_macro_expansion_p): Likewise.
1006 (linemap_macro_loc_to_exp_point): Likewise.
1007 (linemap_resolve_location): Likewise.
1008 (linemap_unwind_toward_expansion): Likewise.
1009 (linemap_unwind_to_first_non_reserved_loc): Likewise.
1010 (linemap_expand_location): Likewise.
1011 (linemap_dump_location): Likewise.
1012
d7b6aee8
NS
10132019-05-07 Nathan Sidwell <nathan@acm.org>
1014
61145d93
NS
1015 * files.c (_cpp_stack_file): Empty filenames aren't dependencies.
1016 * mkdeps.c (deps_add_dep): Assert not empty.
1017
d7b6aee8
NS
1018 * include/mkdeps.h (deps_write): Add PHONY arg.
1019 (deps_phony_targets): Delete.
1020 * init.c (cpp_finish): Just call deps_write.
1021 * mkdeps.c (struct mkdeps): Add local vector class. Reimplement
1022 vector handling.
1023 (munge): Munge to static buffer.
1024 (apply_vpath): Adjust vector handling.
1025 (deps_init, deps_free): Use new, delete.
1026 (deps_add_target): Do not munge here. Record quoting low water mark.
1027 (deps_add_dep): Do not munge here.
1028 (deps_add_vpath): Adjust vector handling.
1029 (make_write_name): New. Munge on demand here.
1030 (make_write_vec): New.
1031 (deps_phony_targets): Delete.
1032 (make_write): New.
1033 (deps_write): Forward to deps_Write.
1034 (deps_save, deps_restore): Adjust vector handling.
1035
b744fc85
NS
10362019-05-06 Nathan Sidwell <nathan@acm.org>
1037
1038 * include/mkdeps.h: Rename struct deps to struct mkdeps.
1039 * mkdeps.c: Likewise.
1040 * include/cpplib.h (cpp_get_deps): Rename return type..
1041 * directives.c (cpp_get_deps): Likewise.
1042 * internal.h (struct cpp_reader): Rename deps field type.
1043
0bf12a52
JW
10442019-04-03 Jonathan Wakely <jwakely@redhat.com>
1045
1046 * files.c (search_path_exhausted): Fix typo in comment.
1047
60448173
ML
10482019-02-26 Martin Liska <mliska@suse.cz>
1049
1050 * symtab.c (ht_dump_statistics): Make
1051 horizontal alignment for statistics.
1052
200a8e1a
DM
10532019-02-20 David Malcolm <dmalcolm@redhat.com>
1054
1055 PR c/89410
1056 * include/line-map.h (linenum_arith_t): New typedef.
1057 (compare): Use it.
1058
a5f87af7
ML
10592019-02-18 Martin Liska <mliska@suse.cz>
1060
1061 PR c++/89383
1062 * line-map.c (linemap_line_start): Use 1UL in order
1063 to not overflow.
1064
a4553534
DM
10652019-02-11 Martin Liska <mliska@suse.cz>
1066
1067 PR lto/88147
1068 * line-map.c (linemap_line_start): Don't reuse the existing line
1069 map if the line offset is sufficiently large to cause overflow
1070 when computing location_t values.
1071
18f5df94
JJ
10722019-01-26 Jakub Jelinek <jakub@redhat.com>
1073
1074 PR preprocessor/88974
1075 * directives.c (SEEN_EOL): Move macro to ...
1076 * internal.h (SEEN_EOL): ... here.
1077 * expr.c (parse_has_include): Don't cpp_get_token if SEEN_EOL ().
1078
a5544970
JJ
10792019-01-01 Jakub Jelinek <jakub@redhat.com>
1080
1081 Update copyright years.
1082
bc65bad2
MG
10832018-11-27 Mike Gulick <mgulick@mathworks.com>
1084
1085 PR preprocessor/83173
1086 * location-example.txt: Update example -fdump-internal-locations
1087 output.
1088
56c79e7f
MG
10892018-11-27 Mike Gulick <mgulick@mathworks.com>
1090
1091 PR preprocessor/83173
1092 * files.c (_cpp_stack_include): Check if
1093 line_table->highest_location is past current line before
1094 decrementing.
1095
620e594b
DM
10962018-11-13 David Malcolm <dmalcolm@redhat.com>
1097
1098 * charset.c: Replace "source_location" with "location_t".
1099 * directives-only.c: Likewise.
1100 * directives.c: Likewise.
1101 * errors.c: Likewise.
1102 * expr.c: Likewise.
1103 * files.c: Likewise.
1104 * include/cpplib.h: Likewise. Rename MAX_SOURCE_LOCATION to
1105 MAX_LOCATION_T.
1106 * include/line-map.h: Likewise.
1107 * init.c: Likewise.
1108 * internal.h: Likewise.
1109 * lex.c: Likewise.
1110 * line-map.c: Likewise.
1111 * location-example.txt: Likewise.
1112 * macro.c: Likewise.
1113 * pch.c: Likewise.
1114 * traditional.c: Likewise.
1115
e9f3803d
HAQ
11162018-11-07 Hafiz Abid Qadeer <abidh@codesourcery.com>
1117
1118 * configure: Regenerated.
1119
546f678c
ML
11202018-11-05 Martin Liska <mliska@suse.cz>
1121
1122 * symtab.c (ht_dump_statistics): Replace %zu with %lu format.
1123
037903cb
ML
11242018-11-05 Martin Liska <mliska@suse.cz>
1125
1126 * symtab.c (ht_dump_statistics): Fix format and
1127 pass missing argument.
1128
46aeb07f
ML
11292018-11-05 Martin Liska <mliska@suse.cz>
1130
1131 * symtab.c (ht_dump_statistics): Make dump conditional
1132 based on alloc_subobject.
1133
22e05272
JM
11342018-10-31 Joseph Myers <joseph@codesourcery.com>
1135
1136 PR bootstrap/82856
1137 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
1138 * aclocal.m4, config.in, configure: Regenerate.
1139
ff65e980
NS
11402018-10-31 Nathan Sidwell <nathan@acm.org>
1141
f3f6029d
NS
1142 * internal.h (struct cpp_reader): Rename forced_token_location_p
1143 to forced_token_location and drop its pointerness.
1144 * include/cpplib.h (cpp_force_token_locations): Take location, not
1145 pointer to one.
1146 * init.c (cpp_create_reader): Adjust.
1147 * lex.c (cpp_read_main_file):
1148
705b0c05
NS
1149 * directives.c (do_include_common): Commonize cleanup path.
1150 (_cpp_pop_buffer): Fix leak.
1151
87bacc2b
NS
1152 * include/line-map.h (IS_ORDINARY_LOC, IS_MACRO_LOC): New
1153 predicates.
1154 (IS_ADHOC_LOC): Move earlier.
1155 (MAP_ORDINARY_P): Use IS_ORDINARY_LOC.
1156 * line-map.c (linemap_location_from_macro_expansion_p): Use
1157 IS_MACRO_LOC.
1158
c9fb347e
NS
1159 * include/cpplib.h (cpp_macro_definition_location): Make inline.
1160 * macro.c (warn_of_redefinition): Fix comments, examine macro
1161 type, use C++ for.
1162 (cpp_macro_definition_location): Don't define here.
1163
43af5ef1
NS
1164 * include/cpplib.h (HT_NODE): Don't cast NODE.
1165 (NODE_LEN, NODE_NAME): Use HT_NODE.
1166
ff65e980
NS
1167 * directives.c (DIRECTIVE_TABLE): Drop historical frequency
1168 comments.
1169 * files.c (_cpp_stack_file): Fix indentation.
1170
9f936c86
JM
11712018-10-17 Joseph Myers <joseph@codesourcery.com>
1172
1173 * include/cpplib.h (enum c_lang): Add CLK_GNUC2X and CLK_STDC2X.
1174 * init.c (lang_defaults): Add GNUC2X and STDC2X entries.
1175 (cpp_init_builtins): Define __STDC_VERSION__ to 202000L for C2X.
1176
954ad112
DM
11772018-10-11 David Malcolm <dmalcolm@redhat.com>
1178
1179 * macro.c (_cpp_arguments_ok): If the argument count is wrong, add
1180 a note showing the definition of the macro.
1181
c1b48b29
NS
11822018-10-11 Nathan Sidwell <nathan@acm.org>
1183
1184 * include/line-map.h (LINEMAPS_MACRO_LOWEST_LOCATION): Fix
1185 off-by-one error.
1186 * line-map.c (linemap_enter_macro): Use RAII. Clear all of the
1187 macro_locations.
1188
c24300ba
DM
11892018-10-09 David Malcolm <dmalcolm@redhat.com>
1190
1191 * charset.c (noop_error_cb): Rename to...
1192 (noop_diagnostic_cb): ...this, converting params to enums.
1193 (cpp_interpret_string_ranges): Update for renaming and enums.
1194 * directives.c (check_eol_1): Convert reason to enum.
1195 (do_diagnostic): Convert code and reason to enum.
1196 (do_error): Use CPP_W_NONE rather than 0.
1197 (do_pragma_dependency): Likewise.
1198 * errors.c (cpp_diagnostic_at): Convert level and reason to enums.
1199 Update for renaming.
1200 (cpp_diagnostic): Convert level and reason to enums.
1201 (cpp_error): Convert level to enum.
1202 (cpp_warning): Convert reason to enums.
1203 (cpp_pedwarning): Likewise.
1204 (cpp_warning_syshdr): Likewise.
1205 (cpp_diagnostic_with_line): Convert level and reason to enums.
1206 Update for renaming.
1207 (cpp_error_with_line): Convert level to enum.
1208 (cpp_warning_with_line): Convert reason to enums.
1209 (cpp_pedwarning_with_line): Likewise.
1210 (cpp_warning_with_line_syshdr): Likewise.
1211 (cpp_error_at): Convert level to enum.
1212 (cpp_errno): Likewise.
1213 (cpp_errno_filename): Likewise.
1214 * include/cpplib.h (enum cpp_diagnostic_level): Name this enum,
1215 and move to before struct cpp_callbacks.
1216 (enum cpp_warning_reason): Likewise.
1217 (cpp_callbacks::diagnostic): Convert params from int to enums.
1218 (cpp_error): Convert int param to enum cpp_diagnostic_level.
1219 (cpp_warning): Convert int param to enum cpp_warning_reason.
1220 (cpp_pedwarning): Likewise.
1221 (cpp_warning_syshdr): Likewise.
1222 (cpp_errno): Convert int param to enum cpp_diagnostic_level.
1223 (cpp_errno_filename): Likewise.
1224 (cpp_error_with_line): Likewise.
1225 (cpp_warning_with_line): Convert int param to enum
1226 cpp_warning_reason.
1227 (cpp_pedwarning_with_line): Likewise.
1228 (cpp_warning_with_line_syshdr): Likewise.
1229 (cpp_error_at): Convert int param to enum cpp_diagnostic_level.
1230 * macro.c (create_iso_definition): Convert int to enum.
1231 (_cpp_create_definition): Likewise.
1232
9c4a4b3c
DM
12332018-09-17 David Malcolm <dmalcolm@redhat.com>
1234
1235 * include/line-map.h (range_label::get_text): Add param
1236 "range_idx".
1237
24c35f68
NS
12382018-08-30 Nathan Sidwell <nathan@acm.org>
1239
1240 * include/line-map.h (enum lc_reason): Comment each member
1241 separately.
1242 (struct line_maps): Fix reallocator comment.
1243
85204e23
DM
12442018-08-27 David Malcolm <dmalcolm@redhat.com>
1245
1246 PR 87091
1247 * include/line-map.h (enum range_display_kind): New enum.
1248 (struct location_range): Replace field "m_show_caret_p" with
1249 "m_range_display_kind", converting from bool to the new enum.
1250 (class rich_location): Add example of line insertion fix-it hint.
1251 (rich_location::add_range): Convert param "show_caret_p" from bool
1252 to enum range_display_kind and rename to "range_display_kind",
1253 giving it a default of SHOW_RANGE_WITHOUT_CARET.
1254 (rich_location::set_range): Likewise, albeit without a default.
1255 * line-map.c (rich_location::rich_location): Update for conversion
1256 of show_caret_p to tri-state enum.
1257 (rich_location::add_range): Likewise.
1258 (rich_location::set_range): Likewise.
1259
cf806c7d
L
12602018-08-24 H.J. Lu <hongjiu.lu@intel.com>
1261
1262 PR bootstrap/86872
1263 * line-map.c (pure_location_p): Return true if linemap_lookup
1264 returns NULL.
1265 (linemap_add): Set start_location to 0 if we run out of line map
1266 space.
1267
3fb558b1
NS
12682018-08-20 Nathan Sidwell <nathan@acm.org>
1269
a5a35247
NS
1270 * include/cpplib.h: Fixup some whitespace.
1271 (cpp_hashnode): Reduce type to 2 bit & flags to 8.
1272
a570d97f
NS
1273 * include/cpplib.h (NODE_BUILTIN, NODE_MACRO_ARG): Delete.
1274 Renumber others.
1275 (enum node_type): Replace NT_MACRO with NT_USER_MACRO,
1276 NT_BUILTIN_MACRO, NT_MACRO_ARG. Delete NT_ASSERTION.
1277 (NTV_MACRO, NTV_ANSWER, NTV_BUILTIN, NTV_ARGUMENT, NTV_NONE):
1278 Delete.
1279 (CPP_HASHNODE_VALUE_IDX): Delete.
1280 (union _cpp_hashnode_value): GTY tag from enum node_type directly.
1281 (struct cpp_hashnode): Adjust GTY desc for value field.
1282 (cpp_user_macro_p, cpp_builtin_macro_p, cpp_macro_p): Adjust.
1283 * directives.c (undefine_macros): Clear value.anwers, adjust flag
1284 clearing.
1285 (_cpp_test_assertion): No need to check NT_ASSERTION.
1286 (do_assert, do_unassert): Likewise.
1287 * init.c (cpp_init_special_builtins): Set type not flags.
1288 * macro.c (struct macro_arg_saved_data): Add type field.
1289 (cpp_get_token_1): Check type not NT_VOID.
1290 (_cpp_free_definition): Adjust flag clearing. Nullify
1291 value.answers.
1292 (_cpp_save_parameter, _cpp_unsave_parameters): Save and restore
1293 type.
1294 (lex_expansion_token): Check type not flags.
1295 (_cpp_create_definition): Set type to NT_USER_MACRO.
1296 (_cpp_notify_macro_use): Adjust type checking.
1297 * pch.c (write_macdef, count_defs, write_defs, cpp_valid_state)
1298 (save_macros): Adjust node type/flag handling.
1299 * traditional.c (_cpp_scan_out_logical_line): Check type not flags.
1300
7692e253
NS
1301 * directives.c (do_undef): Use cpp_macro_p & cpp_builtin_macro_p.
1302 * include/cpplib.h (enum cpp_macro_kind): Remove trailing comma.
1303 (cpp_fun_like_macro_p): Make inline, define.
1304 * macro.c (cpp_define_lazily): Use UCHAR_MAX.
1305 (cpp_fun_like_macro_p): Delete.
1306
abcd1775
NS
1307 * Makefile.in (TAGS_SOURCES): Remove cpp-id-data.h.
1308 * include/cpp-id-data.h: Delete.
1309 * internal.h: Include cpplib.h not cpp-id-data.h.
1310
3fb558b1
NS
1311 * include/cpp-id-data.h (struct answer): Delete.
1312 * include/cpplib.h (struct answer): Don't forward-declare.
1313 (enum cpp_macro_kind): Add cmk_assert.
1314 (struct cpp_macro): Union parms and next assert chain.
1315 (union _cpp_hashnode_value): 'answer' field is cpp_macro.
1316 * directives.c (parse_answer): Convert to use cpp_macro. Return
1317 true on success.
1318 (parse_assertion, find_answer, _cpp_test_assertion, cpp_do_assert)
1319 (cpp_do_unassert): Convert to use cpp_macro.
1320 * macro.c (warn_of_redefinition, _cpp_new_macro)
1321 (check_trad_stringification, cpp_macro_definition): Adjust macro
1322 parm access.
1323 * traditional.c (_cpp_replacement_text_len)
1324 (_cpp_copy_replacement_text, _cpp_create_trad_definition): Likewise.
1325
c5d725c0
NS
13262018-08-17 Nathan Sidwell <nathan@acm.org>
1327
800c0e98
NS
1328 * include/cpplib.h (struct cpp_callbacks): Replace
1329 user_builtin_macro with user_lazy_macro.
1330 (struct cpp_macro): add lazy field.
1331 (enum cpp_builtin_type): Remove BT_FIRST_USER, BT_LAST_USER.
1332 (cpp_define_lazily): Declare.
1333 * macro.c (enter_macro_context) Use _cpp_maybe_notify_macro_use.
1334 (warn_of_redefinition): Use cpp_builtin_macro_p, directly call
1335 user_lazy_macro hook.
1336 (_cpp_new_macro): Clear lazy field.
1337 (cpp_define_lazily): Define.
1338 (_cpp_notify_macro_use): Adjust lazy definition code.
1339 (cpp_macro_definition): No need to do lazy definition here.
1340 * pch.c (write_macdef, save_macros): Likewise.
1341
10f04917
NS
1342 * include/cpplib.h (enum cpp_macro_kind): New.
1343 (struct cpp_macro): Make body trailing array. Add kind field,
1344 delete traditional flag.
1345 * internal.h (_cpp_new_macro): Declare.
1346 (_cpp_reserve_room): New inline.
1347 (_cpp_commit_buf): Declare.
1348 (_cpp_create_trad_definition): Return new macro.
1349 * lex.c (_cpp_commit_buff): New.
1350 * macro.c (macro_real_token_count): Count backwards.
1351 (replace_args): Pointer equality not orderedness.
1352 (_cpp_save_parameter): Use _cpp_reserve_room.
1353 (alloc_expansion_token): Delete.
1354 (lex_expansion_token): Return macro pointer. Use _cpp_reserve_room.
1355 (create_iso_definition): Allocate macro itself. Adjust for
1356 different allocation ordering.
1357 (_cpp_new_macro): New.
1358 (_cpp_create_definition): Adjust for API changes.
1359 * traditional.c (push_replacement_text): Don't set traditional
1360 flag.
1361 (save_replacement_text): Likewise.
1362 (_cpp_create_trad_definition): Allocate macro itself, Adjust for
1363 different allocation ordering.
1364
c5d725c0
NS
1365 * cpp-id-data.h (uchar, UC): Move to internal.h
1366 (struct cpp_macro): Move to cpplib.h.
1367 * internal.h (uchar, UC): From cpp-id-data.h.
1368 * include/cpplib.h (struct cpp_macro): From cpp-id-data.h.
1369
3f6677f4
NS
13702018-08-16 Nathan Sidwell <nathan@acm.org>
1371
729a01f7
NS
1372 * internal.h (_cpp_save_parameter): Take parmno, not macro.
1373 (_cpp_unsave_parameters): Declare.
1374 * macro.c (_cpp_save_parameter): Take parm number, not macro.
1375 Return true on success.
1376 (_cpp_unsave_parameters): New.
1377 (parse_params): Take parm_no and variadic pointers, not macro.
1378 Reimplement parsing logic.
1379 (create_iso_definition): Adjust parse_params changes. Call
1380 _cpp_unsave_parameters here.
1381 (_cpp_create_definition): Don't unsave params here.
1382 * traditional.c (scan_parameters): Take n_param pointer, adjust.
1383 (_cpp_create_trad_definition): Ajust scan_parameters change. Call
1384 _cpp_unsave_parameters.
1385
3f6677f4
NS
1386 * include/cpplib.h (cpp_user_macro_p, cpp_builtin_macro_p)
1387 (cpp_macro_p): New inlines.
1388 * directives.c (do_pragma_poison): Use cpp_macro_p.
1389 (do_ifdef, do_ifndef): Likewise. Use _cpp_maybe_notify_macro_use.
1390 (cpp_pop_definition): Use cpp_macro_p. Move _cpp_free_definition
1391 earlier. Don't zap node directly.
1392 * expr.c (parse_defined): Use _cpp_maybe_notify_macro_use &
1393 cpp_macro_p.
1394 * files.c (should_stack_file): Use cpp_macro_p.
1395 * identifiers.c (cpp_defined): Likewise.
1396 * internal.h (_cpp_mark_macro): Use cpp_user_macro_p.
1397 (_cpp_notify_macro_use): Declare.
1398 (_cpp_maybe_notify_macro_use): New inline.
1399 * lex.c (is_macro): Use cpp_macro_p.
1400 * macro.c (_cpp_warn_if_unused_macro): Use cpp_user_macro_p.
1401 (enter_macro_context): Likewise.
1402 (_cpp_create_definition): Use cpp_builtin_macro_p,
1403 cpp_user_macro_p. Move _cpp_free_definition earlier.
1404 (_cpp_notify_macro_use): New, broken out of multiple call sites.
1405 * traditional.c (fun_like_macro_p): Use cpp_builtin_macro_p.
1406 (maybe_start_funlike, _cpp_scan_out_logical_line)
1407 (push_replacement_text): Likewise.
1408
96e6ae57
DM
14092018-08-15 David Malcolm <dmalcolm@redhat.com>
1410
1411 * include/line-map.h (struct location_range): Add "m_label" field.
1412 (class rich_location): Add description of labels to leading
1413 comment.
1414 (rich_location::rich_location): Add "label" param, defaulting to
1415 NULL.
1416 (rich_location::add_range): Likewise.
1417 (struct label_text): New struct.
1418 (class range_label): New abstract base class.
1419 * line-map.c (rich_location::rich_location): Add "label" param;
1420 use it.
1421 (rich_location::add_range): Likewise.
1422
f10a9135
NS
14232018-08-08 Nathan Sidwell <nathan@acm.org>
1424
1425 Make linemap::included_from a location
1426 libcpp/
1427 * include/line-map.h (struct line_map_ordinary): Replace
1428 included_from map index with included_at source_location.
1429 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Delete.
1430 (LAST_SOURCE_LINE_LOCATION): Delete.
1431 (LAST_SOURCE_LINE, LAST_SOURCE_COLUMN): Delete.
1432 (linemap_included_from): New.
1433 (linemap_included_from_linemap): Declare.
1434 (MAIN_FILE_P): Adjust.
1435 * line-map.c (linemap_included_from_linemap): New.
1436 (lonemap_check_files_exited): Use linemap_included_at.
1437 (linemap_add): Adjust inclusion setting.
1438 (linemap_dump, linemap_dump_location): Adjust.
1439 * directives.c (do_linemarker): Use linemap_included_at.
1440
e81c3c4d
NS
14412018-08-07 Nathan Sidwell <nathan@acm.org>
1442
1443 * line-map.c: (linemap_init): Set default allocator here.
1444 (new_linemap): Rather than here. Refactor allocation logic.
1445
181463c2
DM
14462018-07-20 David Malcolm <dmalcolm@redhat.com>
1447
1448 * include/line-map.h (rich_location::set_range): Remove redundant
1449 line_maps * parameter.
1450 * line-map.c (rich_location::set_range): Likewise.
1451
6f41f92b
BE
14522018-07-18 Bernd Edlinger <bernd.edlinger@hotmail.de>
1453
1454 PR 69558
1455 * macro.c (enter_macro_context): Change the location info for builtin
1456 macros and _Pragma from location of the closing parenthesis to location
1457 of the macro expansion point.
1458
0c86a39d
JJ
14592018-07-17 Jason Franklin <j_fra@fastmail.us>
1460 Jakub Jelinek <jakub@redhat.com>
1461
1462 * lex.c (_cpp_lex_direct): Use CPP_DL_NOTE instead of CPP_DL_PEDWARN,
1463 CPP_DL_WARNING or CPP_DL_ERROR for note that diagnostics for C++ style
1464 comments is reported only once per file and guard those calls on the
1465 preceding cpp_error returning true.
1466
42a98b43
NS
14672018-07-03 Nathan Sidwell <nathan@acm.org>
1468
1469 Reorg line_map data structures for better packing.
1470 * include/line-map.h (enum lc_reason): Add LC_HWM.
1471 (LINE_MAP_MAX_LOCATION): Define here.
1472 (struct line_map): Move reason field to line_map_ordinary. Adjust
1473 GTY tagging.
1474 (struct line_map_ordinary): Reorder fields for less padding.
1475 (struct line_map_macro): Likewise.
1476 (MAP_ORDINARY_P): New.
1477 (linemap_check_ordinary, linemap_check_macro): Adjust.
1478 * line-map.c (LINE_MAP_MAX_SOURCE_LOCATION): Delete.
1479 (new_linemap): Take start_location, not reason. Adjust.
1480 (linemap_add, linemap_enter_macro): Adjust.
1481 (linemap_line_start): Likewise.
1482 (linemap_macro_expansion_map_p): Use MAP_ORDINARY_P.
1483 (linemap_macro_loc_to_spelling_point): Likewise.
1484 (linemap_macro_loc_to_def_point): Likewise.
1485 (linemap_dump): Likewise.
1486
a6b29221
JM
14872018-05-23 Jason Merrill <jason@redhat.com>
1488
1489 * system.h: #include <new> earlier.
1490
b2ff7457
JM
14912018-05-17 Jason Merrill <jason@redhat.com>
1492
1493 * line-map.c (linemap_init): Use placement new.
1494 * system.h: #include <new>.
1495
082284da
DM
14962018-03-14 David Malcolm <dmalcolm@redhat.com>
1497
1498 * include/line-map.h (compare): New function on linenum_type.
1499
b44f8ad8
JW
15002018-02-28 Jonathan Wakely <jwakely@redhat.com>
1501
1502 PR preprocessor/84517
1503 * lex.c (is_macro_not_literal_suffix): New function.
1504 (lex_raw_string, lex_string): Use is_macro_not_literal_suffix to
1505 decide when to issue -Wliteral-suffix warnings.
1506
fe74f9b4
RB
15072018-02-16 Richard Biener <rguenther@suse.de>
1508
1509 PR bootstrap/82939
1510 * line-map.c (linemap_init): Avoid broken value-init when compiling
1511 with GCC 4.2.
1512
60887f8c
JM
15132018-02-15 Jason Merrill <jason@redhat.com>
1514 Jakub Jelinek <jakub@redhat.com>
1515
1516 PR preprocessor/83063 - __VA_OPT__ and ##
1517 PR preprocessor/83708
1518 * macro.c (vaopt_state): Reorder m_last_was_paste before m_state.
1519 (vaopt_state::vaopt_state): Adjust.
1520 (vaopt_state::update_flags): Add BEGIN and END.
1521 (vaopt_state::update): Return them.
1522 (copy_paste_flag): Factor out of replace_args.
1523 (last_token_is): New.
1524 (replace_args): Handle BEGIN and END. Avoid padding there.
1525 (tokens_buff_last_token_ptr): Return NULL if no tokens.
1526
1306a81d
JJ
15272018-01-31 Jakub Jelinek <jakub@redhat.com>
1528
1529 PR preprocessor/69869
1530 * traditional.c (skip_macro_block_comment): Return bool, true if
1531 the macro block comment is unterminated.
1532 (copy_comment): Use return value from skip_macro_block_comment instead
1533 of always false.
1534
53723269
JJ
15352018-01-27 Jakub Jelinek <jakub@redhat.com>
1536
1537 * include/cpplib.h (enum cpp_builtin_type): Change BT_LAST_USER from
1538 BT_FIRST_USER + 31 to BT_FIRST_USER + 63.
1539
7365279f
BK
15402018-01-18 Boris Kolpackov <boris@codesynthesis.com>
1541
92a285c1
ML
1542 PR other/70268
1543 * include/cpplib.h (cpp_callbacks::remap_filename): New callback.
1544 * macro.c (_cpp_builtin_macro_text): Call remap_filename for
1545 __FILE__ and __BASE_FILE__.
7365279f 1546
a3a821c9
KN
15472018-01-10 Kelvin Nilsen <kelvin@gcc.gnu.org>
1548
1549 * lex.c (search_line_fast): Remove illegal coercion of an
1550 unaligned pointer value to vector pointer type and replace with
1551 use of __builtin_vec_vsx_ld () built-in function, which operates
1552 on unaligned pointer values.
1553
85ec4feb
JJ
15542018-01-03 Jakub Jelinek <jakub@redhat.com>
1555
1556 Update copyright years.
1557
35c4515b
MW
15582017-12-20 Michael Weiser <michael.weiser@gmx.de>
1559
1560 PR preprocessor/83492
1561 * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]:
1562 Fix selection of big-endian shift parameters by using
1563 __ARM_BIG_ENDIAN.
1564
c65e18d3
BE
15652017-12-14 Bernd Edlinger <bernd.edlinger@hotmail.de>
1566
1567 * internal.h (maybe_print_line): Change signature.
7365279f 1568
a7b1ce04
JJ
15692017-12-05 Jakub Jelinek <jakub@redhat.com>
1570
1571 PR c++/79228
1572 * expr.c (interpret_float_suffix): Avoid memcmp.
1573 (interpret_int_suffix): Likewise. Don't check for if.
1574
f2b8b8ad
JM
15752017-12-01 Jason Merrill <jason@redhat.com>
1576
1577 PR c++/79228 - extensions hide C++14 complex literal operators
1578 * expr.c (interpret_float_suffix): Ignore 'i' in C++14 and up.
1579 (interpret_int_suffix): Likewise.
1580
6df8934f
DM
15812017-11-28 David Malcolm <dmalcolm@redhat.com>
1582
1583 PR c/82050
1584 * include/line-map.h (LINE_MAP_MAX_COLUMN_NUMBER): Move here.
1585 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): ...from here.
1586 (rich_location::maybe_add_fixit): Reject fix-it hints in which
1587 the start column exceeds the next column.
1588
34b81eb9
EG
15892017-11-20 Eric Gallager <egall@gwmail.gwu.edu>
1590
1591 PR preprocessor/81794
1592 * macro.c (check_trad_stringification): Have warning be controlled
1593 by -Wtraditional.
1594
01ada121
DM
15952017-11-20 David Malcolm <dmalcolm@redhat.com>
1596
1597 PR c++/72786
1598 * include/cpplib.h (cpp_macro_definition_location): New decl.
1599 * macro.c (cpp_macro_definition): New function.
1600
fb771b9d
TT
16012017-11-13 Tom Tromey <tom@tromey.com>
1602
1603 * pch.c (cpp_read_state): Set n__VA_OPT__.
1604 * macro.c (vaopt_state): New class.
1605 (_cpp_arguments_ok): Check va_opt flag.
1606 (replace_args, create_iso_definition): Use vaopt_state.
1607 * lex.c (lex_identifier_intern): Possibly issue errors for
1608 __VA_OPT__.
1609 (lex_identifier): Likewise.
1610 (maybe_va_opt_error): New function.
1611 * internal.h (struct lexer_state) <va_args_ok>: Update comment.
1612 (struct spec_nodes) <n__VA_OPT__>: New field.
1613 * init.c (struct lang_flags) <va_opt>: New field.
1614 (lang_defaults): Add entries for C++2A. Update all entries for
1615 va_opt.
1616 (cpp_set_lang): Initialize va_opt.
1617 * include/cpplib.h (struct cpp_options) <va_opt>: New field.
1618 * identifiers.c (_cpp_init_hashtable): Initialize n__VA_OPT__.
1619
846b84fb
DM
16202017-11-13 David Malcolm <dmalcolm@redhat.com>
1621
1622 * include/line-map.h (linenum_type): Move this typedef and the
1623 comment describing column numbering to near the top of the file.
1624
7d19c460
MK
16252017-11-06 Mukesh Kapoor <mukesh.kapoor@oracle.com>
1626
1627 PR c++/80955
1628 * lex.c (lex_string): When checking for a valid macro for the
1629 warning related to -Wliteral-suffix (CPP_W_LITERAL_SUFFIX),
1630 check that the macro name does not start with an underscore
1631 before calling is_macro().
1632
c830c7d5
TV
16332017-11-05 Tom de Vries <tom@codesourcery.com>
1634
1635 PR other/82784
1636 * lex.c (BUF_APPEND): Remove semicolon after
1637 "do {} while (0)".
1638
64a5912c
DM
16392017-10-31 David Malcolm <dmalcolm@redhat.com>
1640
1641 * directives.c (_cpp_handle_directive): Update for renaming of
1642 cpp_error_at_richloc to cpp_error_at.
1643 * errors.c (cpp_diagnostic_at_richloc): Rename to...
1644 (cpp_diagnostic_at): ...this, dropping the location_t-based
1645 implementation.
1646 (cpp_diagnostic): Update for removal of location_t-based
1647 cpp_diagnostic_at.
1648 (cpp_error_at): Likewise.
1649 (cpp_error_at_richloc): Rename to...
1650 (cpp_error_at): ...this, and update for renaming of
1651 cpp_diagnostic_at_richloc.
1652 * include/cpplib.h (cpp_error_at_richloc): Rename to...
1653 (cpp_error_at): ...this.
1654
c76dc9c3
JM
16552017-10-30 Joseph Myers <joseph@codesourcery.com>
1656
1657 * include/cpplib.h (enum c_lang): Add CLK_GNUC17 and CLK_STDC17.
1658 * init.c (lang_defaults): Add GNUC17 and STDC17 data.
1659 (cpp_init_builtins): Handle C17 value of __STDC_VERSION__.
1660
35b82d26
NS
16612017-10-10 Nathan Sidwell <nathan@acm.org>
1662
1663 PR preprocessor/82506
1664 * macro.c (cpp_quote_string): Escape raw LFs.
1665
026a79f7
AS
16662017-09-15 Andrew Sutton <andrew.n.sutton@gmail.com>
1667 Jakub Jelinek <jakub@redhat.com>
1668
1669 Add support for -std=c++2a.
1670 * include/cpplib.h (c_lang): Add CXX2A and GNUCXX2A.
1671 * init.c (lang_defaults): Add rows for CXX2A and GNUCXX2A.
1672 (cpp_init_builtins): Set __cplusplus to 201709L for C++2a.
1673
7b936140
JJ
16742017-09-15 Jakub Jelinek <jakub@redhat.com>
1675
1676 * include/cpplib.h (enum c_lang): Rename CLK_GNUCXX1Z
1677 to CLK_GNUCXX17 and CLK_CXX1Z to CLK_CXX17.
1678 * init.c (lang_defaults, cpp_init_builtins): Likewise.
1679 * expr.c (cpp_classify_number): Use C++17 instead of C++1z
1680 in diagnostics.
1681
738f7c2e
DM
16822017-07-07 David Malcolm <dmalcolm@redhat.com>
1683
1684 PR c++/79300
1685 * line-map.c (linemap_macro_loc_to_def_point): Preserve range
1686 information for macro expansions by delaying resolving ad-hoc
1687 locations until within the loop.
1688
c471c6ed
DM
16892017-07-06 David Malcolm <dmalcolm@redhat.com>
1690
1691 PR c++/79300
1692 * include/line-map.h (enum location_aspect): New enum.
1693 (linemap_client_expand_location_to_spelling_point): Add
1694 enum location_aspect param.
1695 * line-map.c (rich_location::get_expanded_location): Update for
1696 new param of linemap_client_expand_location_to_spelling_point.
1697 (rich_location::maybe_add_fixit): Likewise.
1698 (fixit_hint::affects_line_p): Likewise.
1699
6d522731
JJ
17002017-06-21 Jakub Jelinek <jakub@redhat.com>
1701
1702 * line-map.c (location_adhoc_data_update): Perform addition in
1703 uintptr_t type rather than char * type. Read *data using
1704 ptrdiff_t type instead of int64_t.
1705 (get_combined_adhoc_loc): Change offset type to ptrdiff_t from
1706 int64_t.
1707
c7a980b8
DM
17082017-06-20 David Malcolm <dmalcolm@redhat.com>
1709
1710 * include/line-map.h (class rich_location): Document that attempts
1711 to delete or replace a range *affecting* multiple lines will fail.
1712 * line-map.c (rich_location::maybe_add_fixit): Implement this
1713 restriction.
1714
b09649fd
DM
17152017-06-09 David Malcolm <dmalcolm@redhat.com>
1716
1717 * include/line-map.h
1718 (rich_location::fixits_cannot_be_auto_applied): New method.
1719 (rich_location::fixits_can_be_auto_applied_p): New accessor.
1720 (rich_location::m_fixits_cannot_be_auto_applied): New field.
1721 * line-map.c (rich_location::rich_location): Initialize new field.
1722
05945a1b
DM
17232017-06-05 David Malcolm <dmalcolm@redhat.com>
1724
1725 * include/cpplib.h (struct cpp_callbacks): Add "comment"
1726 callback.
1727 * lex.c (_cpp_lex_direct): Call the comment callback if non-NULL.
1728
ad53f123
DM
17292017-05-02 David Malcolm <dmalcolm@redhat.com>
1730
1731 * include/line-map.h (class rich_location): Update description of
1732 newline handling.
1733 (class fixit_hint): Likewise.
1734 (fixit_hint::ends_with_newline_p): New decl.
1735 * line-map.c (rich_location::maybe_add_fixit): Support newlines
1736 in fix-it hints that are insertions of single lines at the start
1737 of a line. Don't consolidate into such fix-it hints.
1738 (fixit_hint::ends_with_newline_p): New method.
1739
338035aa
DM
17402017-05-01 David Malcolm <dmalcolm@redhat.com>
1741
1742 * include/line-map.h (source_range::intersects_line_p): Delete.
1743 (rich_location::add_fixit): Delete.
1744 (rich_location::maybe_add_fixit): New method.
1745 (class fixit_hint): Reimplement in terms of...
1746 (class fixit_replace): ...this.
1747 (class fixit_insert): Delete.
1748 * line-map.c (linemap_position_for_loc_and_offset): Drop overzealous
1749 linemap_assert_fails.
1750 (source_range::intersects_line_p): Rename to...
1751 (fixit_hint::affects_line_p): New function.
1752 (rich_location::add_fixit_insert_before): Reimplement in terms of
1753 maybe_add_fixit, moving validation there.
1754 (rich_location::add_fixit_insert_after): Likewise.
1755 (column_before_p): Delete.
1756 (rich_location::add_fixit_replace): Reimplement in terms of
1757 maybe_add_fixit, moving validation there. Convert closed input range
1758 to half-open range.
1759 (rich_location::add_fixit): Delete.
1760 (rich_location::maybe_add_fixit): New function.
1761 (fixit_insert::fixit_insert): Delete.
1762 (fixit_insert::~fixit_insert): Delete.
1763 (fixit_insert::affects_line_p): Delete.
1764 (fixit_insert::maybe_append_replace): Delete.
1765 (fixit_replace::fixit_replace): Rename to...
1766 (fixit_hint::fixit_hint): ...this, rewriting as necessary.
1767 (fixit_replace::~fixit_replace): Delete.
1768 (fixit_replace::affects_line_p): Delete.
1769 (fixit_replace::maybe_append_replace): Rename to...
1770 (fixit_hint::maybe_append): ...this, rewriting as necessary.
1771
5764ee3c
JW
17722017-04-03 Jonathan Wakely <jwakely@redhat.com>
1773
1774 * include/line-map.h (LINEMAPS_MACRO_MAPS): Fix typo in comment.
1775 * lex.c (search_line_fast): Likewise.
1776 * pch.h (cpp_valid_state): Likewise.
1777
8c00ae24
AS
17782017-03-21 Andreas Schwab <schwab@suse.de>
1779
1780 * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]:
1781 Convert 64-bit value to boolean before passing to
1782 __builtin_expect.
1783
85e653c9
JM
17842017-03-16 Jason Merrill <jason@redhat.com>
1785
1786 * init.c (cpp_init_builtins): Update __cplusplus for C++17.
1787
e228c50f
GP
17882017-02-09 Gerald Pfeifer <gerald@pfeifer.com>
1789
1790 * Makefile.in (po/$(PACKAGE).pot): Adjust bug reporting URL.
1791
b9f4757f
DM
17922017-01-10 David Malcolm <dmalcolm@redhat.com>
1793
1794 PR c++/77949
1795 * line-map.c (linemap_position_for_column): When calling
1796 linemap_start_line, detect if a new linemap was created with
1797 0 column bits, and bail out early if this is the case.
1798 (linemap_position_for_loc_and_offset): Replace overzealous
1799 linemap_assert_fails with a simple conditional; use correct
1800 bit count.
1801
5ccf1d8d
DM
18022017-01-07 David Malcolm <dmalcolm@redhat.com>
1803
1804 PR c++/72803
1805 * line-map.c (linemap_line_start): When determining if the highest
1806 column given out so far will fit into a proposed change to the
1807 current map, use the effective number of column bits, rather than
1808 the total number of column + range bits.
1809
cbe34bb5
JJ
18102017-01-01 Jakub Jelinek <jakub@redhat.com>
1811
1812 Update copyright years.
1813
a3998c2f
DM
18142016-12-15 David Malcolm <dmalcolm@redhat.com>
1815
1816 PR preprocessor/78680
1817 PR preprocessor/78811
1818 * lex.c (_cpp_lex_direct): Only determine the end-location of
1819 the token and build a range for non-reserved start locations.
1820 Do not do it for EOF tokens.
1821
470a60b2
DM
18222016-12-12 David Malcolm <dmalcolm@redhat.com>
1823
1824 PR preprocessor/78680
1825 * lex.c (_cpp_lex_direct): Ensure line notes are processed before
1826 computing the end-point of the token.
1827
fb2675cb
PB
18282016-11-23 Paolo Bonzini <bonzini@gnu.org>
1829
1830 * include/cpplib.h (struct cpp_options): Add new member
1831 warn_expansion_to_defined.
1832 (CPP_W_EXPANSION_TO_DEFINED): New enum member.
1833 * expr.c (parse_defined): Warn for all uses of "defined"
1834 in macros, and tie warning to CPP_W_EXPANSION_TO_DEFINED.
1835 Make it a pedwarning instead of a warning.
1836 * system.h (HAVE_DESIGNATED_INITIALIZERS): Do not use
1837 "defined" in macros.
1838
b8f56412
DM
18392016-11-17 David Malcolm <dmalcolm@redhat.com>
1840
1841 * charset.c (cpp_interpret_string_1): Skip locations from
1842 loc_reader when advancing 'p' when handling raw strings.
1843
3549e181
JJ
18442016-11-16 Jakub Jelinek <jakub@redhat.com>
1845
1846 PR bootstrap/72823
1847 * configure.ac (ENABLE_ASSERT_CHECKING): Define if gcc configure
1848 would define that macro.
1849 * configure: Regenerated.
1850 * config.in: Regenerated.
1851
a6ac871c
RE
18522016-11-08 Richard Earnshaw <rearnsha@arm.com>
1853
1854 * lex.c (search_line_fast): New implementation for AArch64.
1855
f5ea989d
DM
18562016-10-25 David Malcolm <dmalcolm@redhat.com>
1857
1858 * files.c (destroy_cpp_file): Free file->path.
1859
2be1b796
DM
18602016-10-25 David Malcolm <dmalcolm@redhat.com>
1861
1862 * include/line-map.h (line_maps::~line_maps): New dtor.
1863 (location_adhoc_data_fini): Delete decl.
1864 * line-map.c (line_maps::~line_maps): New dtor.
1865 (location_adhoc_data_fini): Delete.
1866
58f30963
AP
18672016-10-21 Andris Pavenis <andris.pavenis@iki.fi>
1868
1869 PR preprocessor/71681
1870 * files.c (remap_filename): Fix handling -remap in subdirectories.
1871
70f6d5e1
JJ
18722016-10-12 Jakub Jelinek <jakub@redhat.com>
1873
1874 * include/cpplib.h (struct cpp_options): Add
1875 cpp_warn_implicit_fallthrough.
1876 * init.c (cpp_create_reader): Initialize it to 0.
1877 * lex.c (fallthrough_comment_p): Handle different
1878 cpp_warn_implicit_fallthrough levels. Whitespace fixes.
1879
7bad794a
JJ
18802016-10-08 Jakub Jelinek <jakub@redhat.com>
1881
ee19ef45
JJ
1882 * lex.c (fallthrough_comment_p): Accept Else, fallthrough.
1883
81b02905
JJ
1884 * lex.c (fallthrough_comment_p): Extend to handle more common FALLTHRU
1885 comment styles.
1886
7bad794a
JJ
1887 * lex.c (fallthrough_comment_p): Fix off-by-one size comparison
1888 errors, cleanup.
1889 (_cpp_lex_direct): Allow arbitrary comments in between
1890 fallthrough_comment_p comment and following token.
1891
67ef83c6
KN
18922016-10-04 Kelvin Nilsen <kelvin@gcc.gnu.org>
1893
1894 PR target/77847
1895 * lex.c (search_line_fast): Add a FALLTHROUGH comment to correct
1896 compiler error in the version of this function that is
1897 conditionally compiled when GCC_VERSION >= 4005 and both
1898 __ALTIVEC__ and __BIG_ENDIAN__ symbols are defined.
1899
81fea426
MP
19002016-09-26 Marek Polacek <polacek@redhat.com>
1901 Jakub Jelinek <jakub@redhat.com>
1902
1903 PR c/7652
1904 * include/cpplib.h (PREV_FALLTHROUGH): Define.
1905 * internal.h (CPP_FALLTHRU): Define.
1906 * lex.c (fallthrough_comment_p): New function.
1907 (_cpp_lex_direct): Set PREV_FALLTHROUGH on tokens succeeding a falls
1908 through comment.
1909
bbd6fcf3
DM
19102016-09-23 David Malcolm <dmalcolm@redhat.com>
1911
1912 PR preprocessor/77672
1913 * charset.c (cpp_interpret_string_1): Add a source_range for the
1914 NUL-terminator, using the location of the trailing quote of the
1915 final string.
1916
63cb3926
JM
19172016-09-21 Jason Merrill <jason@redhat.com>
1918
1919 * line-map.c (linemap_location_from_macro_definition_p): New.
1920 * line-map.h: Declare it.
1921
31316208
DM
19222016-09-15 David Malcolm <dmalcolm@redhat.com>
1923
1924 * include/line-map.h (class rich_location): Note that newlines
1925 aren't supported in fix-it text.
1926 * line-map.c (rich_location::add_fixit_insert_before): Reject
1927 attempts to add fix-its containing newlines.
1928 (rich_location::add_fixit_replace): Likewise.
1929
254830ba
DM
19302016-09-13 David Malcolm <dmalcolm@redhat.com>
1931
1932 * include/line-map.h (class rich_location): Add description of
1933 fix-it hints to leading comment.
1934 (rich_location::add_fixit_insert): Rename both overloaded methods
1935 to..
1936 (rich_location::add_fixit_insert_before): ...this, updating their
1937 comments.
1938 (rich_location::add_fixit_insert_after): Two new overloaded
1939 methods.
1940 (rich_location::stop_supporting_fixits): New method.
1941 * line-map.c (rich_location::add_fixit_insert): Rename both
1942 overloaded methods to..
1943 (rich_location::add_fixit_insert_before): ...this, updating their
1944 comments.
1945 (rich_location::add_fixit_insert_after): Two new methods.
1946 (rich_location::reject_impossible_fixit): Split out
1947 failure-handling into...
1948 (rich_location::stop_supporting_fixits): New method.
1949
c65236d6
DM
19502016-09-02 David Malcolm <dmalcolm@redhat.com>
1951
1952 * include/line-map.h (rich_location::seen_impossible_fixit_p): New
1953 accessor.
1954
3d4f9f87
DM
19552016-08-31 David Malcolm <dmalcolm@redhat.com>
1956
1957 * include/line-map.h (class fixit_remove): Remove stray decl.
1958 (fixit_hint::affects_line_p): Make const.
1959 (fixit_insert::affects_line_p): Likewise.
1960 (fixit_replace::affects_line_p): Likewise.
1961 * line-map.c (fixit_insert::affects_line_p): Likewise.
1962 (fixit_replace::affects_line_p): Likewise.
1963
b816477a
DM
19642016-08-30 David Malcolm <dmalcolm@redhat.com>
1965
1966 * include/line-map.h (class semi_embedded_vec): New class.
1967 (semi_embedded_vec<T, NUM_EMBEDDED>::semi_embedded_vec): New ctor.
1968 (semi_embedded_vec<T, NUM_EMBEDDED>::~semi_embedded_vec): New
1969 dtor.
1970 (semi_embedded_vec<T, NUM_EMBEDDED>::operator[]): New methods.
1971 (semi_embedded_vec<T, NUM_EMBEDDED>::push): New method.
1972 (semi_embedded_vec<T, NUM_EMBEDDED>::truncate): New method.
1973 (rich_location::get_num_locations): Reimplement in terms of
1974 m_ranges.
1975 (rich_location::get_range): Make non-inline.
1976 (rich_location::get_num_fixit_hints): Reimplement in terms of
1977 m_fixit_hints.
1978 (rich_location::add_fixit): New function.
1979 (rich_location::MAX_RANGES): Rename to...
1980 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this.
1981 (rich_location::MAX_FIXIT_HINTS): Rename to...
1982 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this, and make
1983 private.
1984 (rich_location::m_num_ranges): Eliminate in favor of...
1985 (rich_location::m_ranges): ...this, converting from a fixed-size
1986 array to a semi_embedded_vec.
1987 (rich_location::m_num_fixit_hints): Eliminate in favor of...
1988 (rich_location::m_fixit_hints): ...this, converting from a
1989 fixed-size array to a semi_embedded_vec.
1990 * line-map.c (rich_location::rich_location): Update for above
1991 changes.
1992 (rich_location::~rich_location): Likewise.
1993 (rich_location::get_loc): Likewise.
1994 (rich_location::get_range): New methods.
1995 (rich_location::add_range): Update for above changes.
1996 (rich_location::set_range): Likewise.
1997 (rich_location::add_fixit_insert): Likewise.
1998 (rich_location::add_fixit_replace): Likewise.
1999 (rich_location::get_last_fixit_hint): Likewise.
2000 (rich_location::reject_impossible_fixit): Likewise.
2001 (rich_location::add_fixit): New method.
2002
f9087798
DM
20032016-08-30 David Malcolm <dmalcolm@redhat.com>
2004
2005 * include/line-map.h (rich_location::add_fixit_insert): Add
2006 comments. Add overload omitting the source_location param.
2007 (rich_location::add_fixit_remove): Add comments. Add overloads
2008 omitting the range, and accepting a source_location.
2009 (rich_location::add_fixit_replace): Likewise.
2010 * line-map.c (rich_location::add_fixit_insert): Add comments. Add
2011 overload omitting the source_location param.
2012 (rich_location::add_fixit_remove): Add comments. Add overloads
2013 omitting the range, and accepting a source_location.
2014 (rich_location::add_fixit_replace): Likewise.
2015
2aa51413
DM
20162016-08-26 David Malcolm <dmalcolm@redhat.com>
2017
2018 * include/line-map.h (get_pure_location): New decl.
2019 * line-map.c (get_pure_location): Move here, from gcc/input.c, adding
2020 a line_maps * param.
2021 (rich_location::add_fixit_insert): Call get_pure_location on "where".
2022 (rich_location::add_fixit_replace): Call get_pure_location on the
2023 end-points.
2024
ee908516
DM
20252016-08-26 David Malcolm <dmalcolm@redhat.com>
2026
2027 * include/line-map.h (rich_location): Eliminate unimplemented
2028 constructor based on source_range.
2029 (rich_location::get_last_fixit_hint): New method.
2030 (rich_location::reject_impossible_fixit): New method.
2031 (rich_location): Add fields m_line_table and
2032 m_seen_impossible_fixit.
2033 (fixit_hint::maybe_append_replace): New pure virtual function.
2034 (fixit_insert::maybe_append_replace): New function.
2035 (fixit_replace::maybe_append_replace): New function.
2036 * line-map.c (rich_location::rich_location): Initialize
2037 m_line_table and m_seen_impossible_fixit.
2038 (rich_location::add_fixit_insert): Call
2039 reject_impossible_fixit and bail out if true.
2040 (column_before_p): New function.
2041 (rich_location::add_fixit_replace): Call reject_impossible_fixit
2042 and bail out if true. Attempt to consolidate with neighboring
2043 fixits.
2044 (rich_location::get_last_fixit_hint): New method.
2045 (rich_location::reject_impossible_fixit): New method.
2046 (fixit_insert::maybe_append_replace): New method.
2047 (fixit_replace::maybe_append_replace): New method.
2048
d672cded
DM
20492016-08-23 David Malcolm <dmalcolm@redhat.com>
2050
2051 * include/line-map.h (source_range::from_locations): New method.
2052
2ffe0809
DM
20532016-08-19 David Malcolm <dmalcolm@redhat.com>
2054
2055 * include/line-map.h (fixit_hint::kind): Delete REPLACE.
2056 (class fixit_remove): Delete.
2057 * line-map.c (rich_location::add_fixit_remove): Reimplement
2058 by calling add_fixit_replace with an empty string.
2059 (fixit_remove::fixit_remove): Delete.
2060 (fixit_remove::affects_line_p): Delete.
2061
c65699ef
JM
20622016-08-19 Joseph Myers <joseph@codesourcery.com>
2063
2064 PR c/32187
2065 * include/cpplib.h (CPP_N_FLOATN, CPP_N_FLOATNX)
2066 (CPP_N_WIDTH_FLOATN_NX, CPP_FLOATN_SHIFT, CPP_FLOATN_MAX): New
2067 macros.
2068 * expr.c (interpret_float_suffix): Handle fN, fNx, FN and FNx
2069 suffixes.
2070
fcf830ab
PK
20712016-08-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
2072
2073 * expr.c (eval_token): Append "evaluates to 0" to Wundef diagnostic.
2074
cb18fd07
DM
20752016-08-18 David Malcolm <dmalcolm@redhat.com>
2076
2077 * directives.c (directive_names): New array.
2078 (_cpp_handle_directive): Offer spelling suggestions for misspelled
2079 directives.
2080 * errors.c (cpp_diagnostic_at_richloc): New function.
2081 (cpp_error_at_richloc): New function.
2082 * include/cpplib.h (struct cpp_callbacks): Add field
2083 "get_suggestion".
2084 (cpp_error_at_richloc): New decl.
2085
9c62c873
MP
20862016-08-18 Marek Polacek <polacek@redhat.com>
2087
2088 PR c/7652
2089 * pch.c (write_macdef): Add CPP_FALLTHRU.
2090
191816a3
MP
20912016-08-12 Marek Polacek <polacek@redhat.com>
2092
2093 PR c/7652
2094 * lex.c (search_line_fast): Add FALLTHRU.
2095 (_cpp_lex_direct): Likewise.
2096 (cpp_token_val_index): Adjust fall through comment.
2097 * macro.c (parse_params): Add FALLTHRU.
2098 * pch.c (count_defs): Adjust fall through comment.
2099 (write_defs): Likewise.
2100
e7864d68
DM
21012016-08-06 David Malcolm <dmalcolm@redhat.com>
2102
2103 PR bootstrap/72823
2104 * charset.c (_cpp_valid_ucn): Replace overzealous assert with one
2105 that allows for char_range to be non-NULL when loc_reader is NULL.
2106
88fa5555
DM
21072016-08-05 David Malcolm <dmalcolm@redhat.com>
2108
2109 * charset.c (cpp_substring_ranges::cpp_substring_ranges): New
2110 constructor.
2111 (cpp_substring_ranges::~cpp_substring_ranges): New destructor.
2112 (cpp_substring_ranges::add_range): New method.
2113 (cpp_substring_ranges::add_n_ranges): New method.
2114 (_cpp_valid_ucn): Add "char_range" and "loc_reader" params; if
2115 they are non-NULL, read position information from *loc_reader
2116 and update char_range->m_finish accordingly.
2117 (convert_ucn): Add "char_range", "loc_reader", and "ranges"
2118 params. If loc_reader is non-NULL, read location information from
2119 it, and update *ranges accordingly, using char_range.
2120 Conditionalize the conversion into tbuf on tbuf being non-NULL.
2121 (convert_hex): Likewise, conditionalizing the call to
2122 emit_numeric_escape on tbuf.
2123 (convert_oct): Likewise.
2124 (convert_escape): Add params "loc_reader" and "ranges". If
2125 loc_reader is non-NULL, read location information from it, and
2126 update *ranges accordingly. Conditionalize the conversion into
2127 tbuf on tbuf being non-NULL.
2128 (cpp_interpret_string): Rename to...
2129 (cpp_interpret_string_1): ...this, adding params "loc_readers" and
2130 "out". Use "to" to conditionalize the initialization and usage of
2131 "tbuf", such as running the converter. If "loc_readers" is
2132 non-NULL, use the instances within it, reading location
2133 information from them, and passing them to convert_escape; likewise
2134 write to "out" if loc_readers is non-NULL. Check for leading
2135 quote and issue an error if it is not present. Update boundary
2136 check from "== limit" to ">= limit" to protect against erroneous
2137 location values to calls that are not parsing string literals.
2138 (cpp_interpret_string): Reimplement in terms to
2139 cpp_interpret_string_1.
2140 (noop_error_cb): New function.
2141 (cpp_interpret_string_ranges): New function.
2142 (cpp_string_location_reader::cpp_string_location_reader): New
2143 constructor.
2144 (cpp_string_location_reader::get_next): New method.
2145 * include/cpplib.h (class cpp_string_location_reader): New class.
2146 (class cpp_substring_ranges): New class.
2147 (cpp_interpret_string_ranges): New prototype.
2148 * internal.h (_cpp_valid_ucn): Add params "char_range" and
2149 "loc_reader".
2150 * lex.c (forms_identifier_p): Pass NULL for new params to
2151 _cpp_valid_ucn.
2152
8204be6c
AS
21532016-08-01 Andreas Schwab <schwab@suse.de>
2154
2155 * include/cpplib.h: Fix comment typo.
2156
a01fc549
DM
21572016-07-27 David Malcolm <dmalcolm@redhat.com>
2158
2159 * include/line-map.h (source_location): Fix line numbers in
2160 comment.
2161
741d3be5
DM
21622016-07-11 David Malcolm <dmalcolm@redhat.com>
2163
2164 * include/line-map.h (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES):
2165 Move here from line-map.c.
2166 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
2167 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): Move from
2168 here to line-map.h.
2169 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
2170
ac81cf0b
DM
21712016-06-22 David Malcolm <dmalcolm@redhat.com>
2172
2173 * directives.c (do_include_common): Pass on "location" to
2174 _cpp_stack_include.
2175 * errors.c (cpp_diagnostic): Reimplement in terms of...
2176 (cpp_diagnostic_at): New function.
2177 (cpp_error_at): New function.
2178 (cpp_errno_filename): Add "loc" param and use it by using
2179 cpp_error_at rather than cpp_error.
2180 * files.c (find_file_in_dir): Add "loc" param and pass it to
2181 open_file_failed.
2182 (_cpp_find_file): Add "loc" param. Use it to convert calls to
2183 cpp_error to cpp_error_at, and pass it to find_file_in_dir and
2184 open_file_failed.
2185 (read_file_guts): Add "loc" param. Use it to convert calls to
2186 cpp_error to cpp_error_at. Pass it to cpp_errno_filename.
2187 (read_file): Add "loc" param. Pass it to open_file_failed and
2188 read_file_guts.
2189 (should_stack_file): Add "loc" param. Pass it to read_file.
2190 (_cpp_stack_file): Add "loc" param. Pass it to should_stack_file.
2191 (_cpp_stack_include): Add "loc" param. Pass it to
2192 _cpp_find_file and _cpp_stack_file.
2193 (open_file_failed): Add "loc" param. Pass it to
2194 cpp_errno_filename.
2195 (_cpp_fake_include): Add 0 as a source_location in call to
2196 _cpp_find_file.
2197 (_cpp_compare_file_date): Likewise.
2198 (cpp_push_include): Likewise for call to _cpp_stack_include.
2199 (cpp_push_default_include): Likewise.
2200 (_cpp_save_file_entries): Likewise for call to open_file_failed.
2201 (_cpp_has_header): Likewise for call to _cpp_find_file.
2202 * include/cpplib.h (cpp_errno_filename): Add source_location
2203 param.
2204 (cpp_error_at): New declaration.
2205 * init.c (cpp_read_main_file): Add 0 as a source_location in calls
2206 to _cpp_find_file and _cpp_stack_file.
2207 * internal.h (_cpp_find_file): Add source_location param.
2208 (_cpp_stack_file): Likewise.
2209 (_cpp_stack_include): Likewise.
2210
a93eac6a
DM
22112016-06-22 David Malcolm <dmalcolm@redhat.com>
2212
2213 * include/line-map.h (fixit_hint::get_start_loc): New pure virtual
2214 function.
2215 (fixit_hint::maybe_get_end_loc): Likewise.
2216 (fixit_insert::get_start_loc): New function, implementing
2217 fixit_hint::get_start_loc.
2218 (fixit_insert::maybe_get_end_loc): New function, implementing
2219 fixit_hint::maybe_get_end_loc.
2220 (fixit_remove::get_start_loc): New function, implementing
2221 fixit_hint::get_start_loc.
2222 (fixit_remove::maybe_get_end_loc): New function, implementing
2223 fixit_hint::maybe_get_end_loc.
2224 (fixit_replace::get_start_loc): New function, implementing
2225 fixit_hint::get_start_loc.
2226 (fixit_replace::maybe_get_end_loc): New function, implementing
2227 fixit_hint::maybe_get_end_loc.
2228
fe55692c
JDA
22292016-06-21 John David Anglin <danglin@gcc.gnu.org>
2230
2231 * line-map.c (location_adhoc_data_update): Use int64_t instead of
2232 long long.
2233 (get_combined_adhoc_loc): Likewise.
2234
15c98b2e
ES
22352016-06-01 Eduard Sanou <dhole@openmailbox.org>
2236
2237 * include/cpplib.h (cpp_callbacks): Add get_source_date_epoch
2238 callback.
2239 * include/cpplib.h (cpp_init_source_date_epoch): Remove prototype.
2240 * init.c (cpp_init_source_date_epoch): Remove function.
2241 * init.c (cpp_create_reader): Initialize pfile->source_date_epoch.
2242 * internal.h (cpp_reader): Extend comment about source_date_epoch.
2243 * macro.c (_cpp_builtin_macro_text): Use get_source_date_epoch
2244 callback only once, read pfile->source_date_epoch on future passes.
2245 Check that get_source_date_epoch callback is not NULL.
2246
ceb17928
ML
22472016-05-20 Martin Liska <mliska@suse.cz>
2248
2249 * config.in: Regenerated.
2250 * configure: Likewise.
2251 * configure.ac: Handle --enable-valgrind-annotations.
2252 * lex.c (new_buff): Use ENABLE_VALGRIND_ANNOTATIONS instead
2253 of ENABLE_VALGRIND_CHECKING.
2254 (_cpp_free_buff): Likewise.
2255
174f6622
ES
22562016-04-28 Eduard Sanou <dhole@openmailbox.org>
2257 Matthias Klose <doko@debian.org>
2258
2259 * include/cpplib.h (cpp_init_source_date_epoch): Prototype.
2260 * init.c (cpp_init_source_date_epoch): New function.
2261 * internal.h: Added source_date_epoch variable to struct
2262 cpp_reader to store a reproducible date.
7365279f
BK
2263 * macro.c (_cpp_builtin_macro_text): Set pfile->date timestamp from
2264 pfile->source_date_epoch instead of localtime if source_date_epoch is
2265 set, to be used for __DATE__ and __TIME__ macros to help reproducible
174f6622
ES
2266 builds.
2267
12de2245
BS
22682016-04-13 Bernd Schmidt <bschmidt@redhat.com>
2269
2270 Patch from Roger Orr <rogero@howzatt.demon.co.uk>
2271 PR preprocessor/69650
2272 * directives.c (do_linemarker): Reread map after calling
2273 cpp_get_token.
2274
64824205
RH
22752016-04-06 Richard Henderson <rth@redhat.com>
2276
2277 PR preprocessor/61817
2278 PR preprocessor/69391
2279 * internal.h (_cpp_builtin_macro_text): Update decl.
2280 * macro.c (_cpp_builtin_macro_text): Accept location for __LINE__.
2281 (builtin_macro): Accept a second location for __LINE__.
2282 (enter_macro_context): Compute both virtual and real expansion
2283 locations for the macro.
2284
3caf0ca1
BS
22852016-03-25 Bernd Schmidt <bschmidt@redhat.com>
2286
2287 PR lto/69650
2288 * directives.c (do_linemarker): Test for file left but not entered
2289 here.
2290 * line-map.c (linemap_add): Not here.
2291
6b366948
JJ
22922016-03-21 Jakub Jelinek <jakub@redhat.com>
2293
2294 PR target/70296
2295 * include/cpplib.h (cpp_fun_like_macro_p): New prototype.
2296 * macro.c (cpp_fun_like_macro_p): New function.
2297
64567cfd
RH
22982016-03-15 Richard Henderson <rth@redhat.com>
2299
2300 * line-map.c (new_linemap): Make alloc_size a size_t.
2301
2aaeea19
JM
23022016-03-14 Jason Merrill <jason@redhat.com>
2303
2304 * expr.c (cpp_classify_number): Hex floats are new in C++1z.
2305 * init.c (lang_defaults): Likewise.
2306
b4f3232d
DM
23072016-03-09 David Malcolm <dmalcolm@redhat.com>
2308
2309 PR c/68473
2310 PR c++/70105
2311 * line-map.c (linemap_macro_map_loc_unwind_toward_spelling): Move
2312 decl...
2313 * include/line-map.h
2314 (linemap_macro_map_loc_unwind_toward_spelling): ...here,
2315 converting from static to extern.
2316
40499f81
DM
23172016-03-09 David Malcolm <dmalcolm@redhat.com>
2318
2319 PR c/68473
2320 PR c++/70105
2321 * include/line-map.h (source_range::debug): Delete.
2322 (struct location_range): Update comment. Replace
2323 expanded_location fields "m_start", "m_finish", and "m_caret" with
2324 a source_location field: "m_loc".
2325 (class rich_location): Reword comment.
2326 (rich_location::get_loc): Reimplement in terms of a new overloaded
2327 variant which takes an unsigned int.
2328 (rich_location::get_loc_addr): Delete.
2329 (rich_location::add_range): Drop params "start" and "finish" in
2330 favor of param "loc". Drop overloaded variants taking a
2331 source_range or location_range *.
2332 (rich_location::lazily_expand_location): Delete in favor of...
2333 (rich_location::get_expanded_location): New decl.
2334 (rich_location::m_loc): Delete field.
2335 (rich_location::m_column_override): New field.
2336 * line-map.c (rich_location::rich_location): Drop name of
2337 line_maps * param. Update initializations for deletion of field
2338 "m_loc" and addition of field "m_column_override". Reimplement
2339 body as a call to add_range. Delete overloaded variant taking a
2340 source_range.
2341 (rich_location::get_loc): New function.
2342 (rich_location::lazily_expand_location): Delete in favor of...
2343 (rich_location::get_expanded_location): New function.
2344 (rich_location::override_column): Reimplement.
2345 (rich_location::add_range): Drop params "start" and "finish" in
2346 favor of param "loc". Eliminate location expansion in favor of
2347 simply storing loc. Drop overloaded variants taking a
2348 source_range or location_range *.
2349 (rich_location::set_range): Eliminate location expansion.
2350
7168133a
DM
23512016-02-29 David Malcolm <dmalcolm@redhat.com>
2352
2353 PR preprocessor/69985
2354 (linemap_position_for_loc_and_offset): Rename param from "offset"
2355 to "column_offset". Right-shift the column_offset by m_range_bits
2356 of the pertinent ordinary map whenever offsetting a
2357 source_location. For clarity, offset the column by the column
2358 offset, rather than the other way around.
2359
196440f8
DM
23602016-02-23 David Malcolm <dmalcolm@redhat.com>
2361
2362 PR preprocessor/69126
2363 PR preprocessor/69543
2364 * line-map.c (linemap_compare_locations): At the function top,
2365 replace inlined bodies of get_location_from_adhoc_loc with calls
2366 to get_location_from_adhoc_loc. Add a pair of calls to
2367 get_location_from_adhoc_loc at the bottom of the function, to
2368 avoid meaningless comparisons of ad-hoc and non-ad-hoc locations.
2369
44714d8c
DM
23702016-02-08 David Malcolm <dmalcolm@redhat.com>
2371
2372 PR preprocessor/69664
2373 * errors.c (cpp_diagnostic_with_line): Only call
2374 rich_location::override_column if the column is non-zero.
2375 * line-map.c (rich_location::override_column): Update columns
2376 within m_ranges[0]. Add assertions to verify that doing so is
2377 sane.
2378
b5c1c988
JJ
23792016-02-05 Jakub Jelinek <jakub@redhat.com>
2380
2381 PR c++/69628
2382 * charset.c (cpp_interpret_charconst): Clear *PCHARS_SEEN
2383 and *UNSIGNEDP if bailing out early due to errors.
2384
e2eb5056
JJ
23852016-01-28 Jakub Jelinek <jakub@redhat.com>
2386
4bda5946
JJ
2387 PR pch/68176
2388 * files.c (_cpp_find_file): Set file->implicit_preinclude even if
2389 included from file->implicit_preinclude header.
2390
e2eb5056
JJ
2391 * directives.c (destringize_and_run): Adjust prototype.
2392
0afff540
DM
23932016-01-27 David Malcolm <dmalcolm@redhat.com>
2394
2395 PR preprocessor/69126
2396 * directives.c (destringize_and_run): Add expansion_loc param; use
2397 it when handling unexpanded pragmas to fixup the locations of the
2398 synthesized tokens.
2399 (_cpp_do__Pragma): Add expansion_loc param and use it when calling
2400 destringize_and_run.
2401 * internal.h (_cpp_do__Pragma): Add expansion_loc param.
2402 * macro.c (builtin_macro): Pass expansion location of _Pragma to
2403 _cpp_do__Pragma.
2404
c7df95d8
DM
24052016-01-14 David Malcolm <dmalcolm@redhat.com>
2406
2407 PR preprocessor/69177
2408 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): New
2409 constant.
2410 (LINE_MAP_MAX_LOCATION_WITH_COLS): Add note about unit tests
2411 to comment.
2412 (can_be_stored_compactly_p): Reduce threshold from
2413 LINE_MAP_MAX_LOCATION_WITH_COLS to
2414 LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES.
2415 (get_combined_adhoc_loc): Likewise.
2416 (get_range_from_loc): Likewise.
2417 (linemap_line_start): Ensure that a new ordinary map is created
2418 when transitioning from range-packing being enabled to disabled,
2419 at the LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES threshold. Set
2420 range_bits to 0 for new ordinary maps when beyond this limit.
2421 Prevent the "increase the column bits of a freshly created map"
2422 optimization if the range bits has reduced.
2423
53290e07
JJ
24242016-01-08 Jakub Jelinek <jakub@redhat.com>
2425
2426 PR c++/69145
2427 * files.c (cpp_included_before): If IS_ADHOC_LOC (location), lookup
2428 real location from the line_table.
2429
818ab71a
JJ
24302016-01-04 Jakub Jelinek <jakub@redhat.com>
2431
2432 Update copyright years.
2433
329590d7
DM
24342015-12-22 David Malcolm <dmalcolm@redhat.com>
2435
2436 * line-map.c (get_combined_adhoc_loc): Remove condition
2437 on locus < RESERVED_LOCATION_COUNT when considering
2438 whether a caret == start == finish location can be
2439 simply stored as the caret location.
2440
f79520bb
DM
24412015-12-07 David Malcolm <dmalcolm@redhat.com>
2442
2443 * include/line-map.h (rich_location::set_range): Add line_maps *
2444 param; convert param from source_range to source_location. Drop
2445 "overwrite_loc_p" param.
2446 * line-map.c (rich_location::set_range): Likewise, acting as if
2447 "overwrite_loc_p" were true, and getting range from the location.
2448
a87a86e1
DM
24492015-11-20 David Malcolm <dmalcolm@redhat.com>
2450
2451 PR 62314
2452 * include/line-map.h (source_range::intersects_line_p): New
2453 method.
2454 (rich_location::~rich_location): New.
2455 (rich_location::add_fixit_insert): New method.
2456 (rich_location::add_fixit_remove): New method.
2457 (rich_location::add_fixit_replace): New method.
2458 (rich_location::get_num_fixit_hints): New accessor.
2459 (rich_location::get_fixit_hint): New accessor.
2460 (rich_location::MAX_FIXIT_HINTS): New constant.
2461 (rich_location::m_num_fixit_hints): New field.
2462 (rich_location::m_fixit_hints): New field.
2463 (class fixit_hint): New class.
2464 (class fixit_insert): New class.
2465 (class fixit_remove): New class.
2466 (class fixit_replace): New class.
2467 * line-map.c (source_range::intersects_line_p): New method.
2468 (rich_location::rich_location): Add initialization of
2469 m_num_fixit_hints to both ctors.
2470 (rich_location::~rich_location): New.
2471 (rich_location::add_fixit_insert): New method.
2472 (rich_location::add_fixit_remove): New method.
2473 (rich_location::add_fixit_replace): New method.
2474 (fixit_insert::fixit_insert): New.
2475 (fixit_insert::~fixit_insert): New.
2476 (fixit_insert::affects_line_p): New.
2477 (fixit_remove::fixit_remove): New.
2478 (fixit_remove::affects_line_p): New.
2479 (fixit_replace::fixit_replace): New.
2480 (fixit_replace::~fixit_replace): New.
2481 (fixit_replace::affects_line_p): New.
2482
46ce03de
JJ
24832015-11-19 Jakub Jelinek <jakub@redhat.com>
2484
2485 PR preprocessor/60736
2486 * include/cpplib.h (cpp_errno_filename): New prototype.
2487 * errors.c (cpp_errno): Don't handle msgid "" specially, use
2488 _(msgid) instead of msgid as argument to cpp_error.
2489 (cpp_errno_filename): New function.
2490 * files.c (read_file_guts): Use cpp_errno_filename instead of
2491 cpp_errno.
2492 (open_file_failed): Likewise. Use file->name if file->path is NULL
2493 in diagnostics.
2494
ebedc9a3
DM
24952015-11-13 David Malcolm <dmalcolm@redhat.com>
2496
2497 * errors.c (cpp_diagnostic): Pass pfile->line_table to
2498 rich_location ctor.
2499 (cpp_diagnostic_with_line): Likewise.
2500 * include/cpplib.h (struct cpp_token): Update comment for src_loc
2501 to indicate that the range of the token is "baked into" the
2502 source_location.
2503 * include/line-map.h (source_location): Update the descriptive
2504 comment to reflect the packing scheme for short ranges, adding
2505 worked examples of location encoding.
2506 (struct line_map_ordinary): Drop field "column_bits" in favor
2507 of field "m_column_and_range_bits"; add field "m_range_bits".
2508 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
2509 (location_adhoc_data): Add source_range field.
2510 (struct line_maps): Add fields "default_range_bits",
2511 "num_optimized_ranges" and "num_unoptimized_ranges".
2512 (get_combined_adhoc_loc): Add source_range param.
2513 (get_range_from_loc): New declaration.
2514 (pure_location_p): New prototype.
2515 (COMBINE_LOCATION_DATA): Add source_range param.
2516 (SOURCE_LINE): Update for renaming of column_bits.
2517 (SOURCE_COLUMN): Likewise. Shift the column right by the map's
2518 range_bits.
2519 (LAST_SOURCE_LINE_LOCATION): Update for renaming of column_bits.
2520 (linemap_position_for_line_and_column): Add line_maps * params.
2521 (rich_location::rich_location): Likewise.
2522 * lex.c (_cpp_lex_direct): Capture the range of the token, baking
2523 it into token->src_loc via a call to COMBINE_LOCATION_DATA.
2524 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): Reduce from 1U << 17 to
2525 1U << 12.
2526 (location_adhoc_data_hash): Add the src_range into
2527 the hash value.
2528 (location_adhoc_data_eq): Require equality of the src_range
2529 values.
2530 (can_be_stored_compactly_p): New function.
2531 (get_combined_adhoc_loc): Add src_range param, and store it,
2532 via a bit-packing scheme for short ranges, otherwise within the
2533 lookaside table. Remove the requirement that data is non-NULL.
2534 (get_range_from_adhoc_loc): New function.
2535 (get_range_from_loc): New function.
2536 (pure_location_p): New function.
2537 (linemap_add): Ensure that start_location has zero for the
2538 range_bits, unless we're past LINE_MAP_MAX_LOCATION_WITH_COLS.
2539 Initialize range_bits to zero. Assert that the start_location
2540 is "pure".
2541 (linemap_line_start): Assert that the
2542 column_and_range_bits >= range_bits.
2543 Update determinination of whether we need to start a new map
2544 using the effective column bits, without the range bits.
2545 Use the set's default_range_bits in new maps, apart from
2546 those with column_bits == 0, which should also have 0 range_bits.
2547 Increase the column bits for new maps by the range bits.
2548 When adding lines to an existing map, use set->highest_line
2549 directly rather than offsetting highest by SOURCE_COLUMN.
2550 Add assertions to sanity-check the return value.
2551 (linemap_position_for_column): Offset to_column by range_bits.
2552 Update set->highest_location if necessary.
2553 (linemap_position_for_line_and_column): Add line_maps * param.
2554 Update the calculation to offset the column by range_bits, and
2555 conditionalize it on being <= LINE_MAP_MAX_LOCATION_WITH_COLS.
2556 Bound it by LINEMAPS_MACRO_LOWEST_LOCATION. Update
2557 set->highest_location if necessary.
2558 (linemap_position_for_loc_and_offset): Handle ad-hoc locations;
2559 pass "set" to linemap_position_for_line_and_column.
2560 (linemap_macro_map_loc_unwind_toward_spelling): Add line_maps
2561 param. Handle ad-hoc locations.
2562 (linemap_location_in_system_header_p): Pass on "set" to call to
2563 linemap_macro_map_loc_unwind_toward_spelling.
2564 (linemap_macro_loc_to_spelling_point): Retain ad-hoc locations.
2565 Pass on "set" to call to
2566 linemap_macro_map_loc_unwind_toward_spelling.
2567 (linemap_resolve_location): Retain ad-hoc locations. Pass on
2568 "set" to call to linemap_macro_map_loc_unwind_toward_spelling.
2569 (linemap_unwind_toward_expansion): Pass on "set" to call to
2570 linemap_macro_map_loc_unwind_toward_spelling.
2571 (linemap_expand_location): Extract the data pointer before
2572 extracting the location.
2573 (rich_location::rich_location): Add line_maps param; use it to
2574 extract the range from the source_location.
2575 * location-example.txt: Regenerate, showing new representation.
2576
8a645150
DM
25772015-11-06 David Malcolm <dmalcolm@redhat.com>
2578
2579 * errors.c (cpp_diagnostic): Update for change in signature
2580 of "error" callback.
2581 (cpp_diagnostic_with_line): Likewise, calling override_column
2582 on the rich_location.
2583 * include/cpplib.h (struct cpp_callbacks): Within "error"
2584 callback, convert param from source_location to rich_location *,
2585 and drop column_override param.
2586 * include/line-map.h (struct source_range): New struct.
2587 (struct location_range): New struct.
2588 (class rich_location): New class.
2589 (linemap_client_expand_location_to_spelling_point): New declaration.
2590 * line-map.c (rich_location::rich_location): New ctors.
2591 (rich_location::lazily_expand_location): New method.
2592 (rich_location::override_column): New method.
2593 (rich_location::add_range): New methods.
2594 (rich_location::set_range): New method.
2595
ee015909
DM
25962015-11-06 David Malcolm <dmalcolm@redhat.com>
2597
2598 * include/line-map.h (struct linemap_stats): Add fields
2599 "adhoc_table_size" and "adhoc_table_entries_used".
2600 * line-map.c (linemap_get_statistics): Populate above fields.
2601
a6c764d0
MM
26022015-11-04 Mikhail Maltsev <maltsevm@gmail.com>
2603
2604 * config.in: Regenerate.
2605 * configure: Regenerate.
2606 * configure.ac: Remove ENABLE_CHECKING.
2607
49445904
UB
26082015-11-03 Uros Bizjak <ubizjak@gmail.com>
2609
2610 * lex.c (search_line_sse42): Correctly advance the pointer to an
2611 aligned address.
2612
525ce910
DM
26132015-11-02 David Malcolm <dmalcolm@redhat.com>
2614
2615 * include/line-map.h (source_location): In the table in the
2616 descriptive comment, show UNKNOWN_LOCATION, BUILTINS_LOCATION,
2617 LINE_MAP_MAX_LOCATION_WITH_COLS, LINE_MAP_MAX_SOURCE_LOCATION.
2618 Add notes about ad-hoc values.
2619
7ec491c0
MM
26202015-10-21 Mikhail Maltsev <maltsevm@gmail.com>
2621
22d66382
MM
2622 * include/line-map.h: Use CHECKING_P instead of ENABLE_CHECKING.
2623 * init.c: Likewise.
2624 * macro.c (struct macro_arg_token_iter, set_arg_token,
2625 macro_arg_token_iter_init, macro_arg_token_iter_forward,
2626 macro_arg_token_iter_get_token, macro_arg_token_iter_get_location,
2627 alloc_expanded_arg_mem, _cpp_backup_tokens): Likewise.
2628
7ec491c0
MM
2629 * config.in: Regenerate.
2630 * configure: Regenerate.
2631 * configure.ac (CHECKING_P): Define.
2632 * system.h (fancy_abort): Declare.
2633 (abort): Define.
2634 (gcc_assert): Define. Use CHECKING_P.
2635
179b8d05
MM
26362015-10-13 Mikhail Maltsev <maltsevm@gmail.com>
2637
2638 * system.h (CHECKING_P, gcc_checking_assert): Define.
2639
87b470b3
MLI
26402015-09-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
2641
2642 PR c/66415
2643 * line-map.c (linemap_position_for_loc_and_offset): Handle the
2644 case of long lines encoded in multiple maps.
2645
85bc8baa
MP
26462015-09-07 Marek Polacek <polacek@redhat.com>
2647
2648 * system.h (INTTYPE_MINIMUM): Rewrite to avoid shift warning.
2649
bf5372e7
YS
26502015-08-06 Yaakov Selkowitz <yselkowi@redhat.com>
2651
2652 * configure: Regenerate.
2653
d17f7d59
TS
26542015-07-08 Thomas Schwinge <thomas@codesourcery.com>
2655
2656 * include/line-map.h (RESERVED_LOCATION_COUNT): Change type to
2657 source_location.
2658
fbb22910
PC
26592015-07-02 Paolo Carlini <paolo.carlini@oracle.com>
2660
d885793d 2661 PR preprocessor/53690
fbb22910
PC
2662 * charset.c (_cpp_valid_ucn): Add cppchar_t * parameter and change
2663 return type to bool. Fix encoding of \u0000 and \U00000000 in C++.
2664 (convert_ucn): Adjust call.
2665 * lex.c (forms_identifier_p): Likewise.
2666 * internal.h (_cpp_valid_ucn): Adjust declaration.
2667
fe95b036
ESR
26682015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
2669
2670 Implement N4197 - Adding u8 character literals
2671 * include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens;
2672 (struct cpp_options): Add utf8_char_literals.
2673 * init.c (struct lang_flags): Add utf8_char_literals;
2674 (struct lang_flags lang_defaults): Add column for utf8_char_literals.
fbb22910 2675 * macro.c (stringify_arg()): Treat CPP_UTF8CHAR token;
fe95b036
ESR
2676 * expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()):
2677 Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens;
2678 (cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token;
2679 (eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token.
2680 * lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens.
2681 * charset.c (converter_for_type(), cpp_interpret_charconst()):
2682 Treat CPP_UTF8CHAR token.
2683
dc6bcf52
UB
26842015-06-30 Uros Bizjak <ubizjak@gmail.com>
2685
2686 * lex.c (search_line_sse42) [__GCC_ASM_FLAG_OUTPUTS__]: New main
2687 loop using asm flag outputs.
2688
a1661b90
MP
26892015-06-08 Marek Polacek <polacek@redhat.com>
2690
2691 PR c/66415
2692 * line-map.c (linemap_position_for_loc_and_offset): Remove
2693 linemap_assert_fails; reverse conditions.
2694
815facd3
MLI
26952015-05-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
2696
2697 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER
2698 LINE_MAP_MAX_LOCATION_WITH_COLS,LINE_MAP_MAX_SOURCE_LOCATION):
2699 New constants.
2700 (linemap_line_start): Use them.
2701 (linemap_position_for_column): Use them.
2702
c819ed29
DM
27032015-05-20 David Malcolm <dmalcolm@redhat.com>
2704
2705 * include/line-map.h (MAP_START_LOCATION): Eliminate the non-const
2706 variant, and tweak comment for the const variant.
2707 (ORDINARY_MAP_STARTING_LINE_NUMBER): Drop the non-const variant.
2708 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
2709 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
2710 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
2711 (ORDINARY_MAP_FILE_NAME): Drop the non-const variant.
2712 (MACRO_MAP_MACRO): Likewise.
2713 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
2714 (MACRO_MAP_LOCATIONS): Likewise.
2715 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
2716 * line-map.c (linemap_add): Replace writes through macros with
2717 direct field accesses.
2718 (linemap_enter_macro): Likewise.
2719 (linemap_line_start): Likewise.
2720
0e50b624
DM
27212015-05-19 David Malcolm <dmalcolm@redhat.com>
2722
2723 * directives.c (do_line): Strengthen local "map" from
2724 const line_map * to const line_map_ordinary *.
2725 (do_linemarker): Likewise.
2726 (_cpp_do_file_change): Assert that we're not dealing with
2727 a macro map. Introduce local "ord_map" via a call to
2728 linemap_check_ordinary, guarded within the check for
2729 non-NULL. Use it for typesafety.
2730 * files.c (cpp_make_system_header): Strengthen local "map" from
2731 const line_map * to const line_map_ordinary *.
2732 * include/cpplib.h (struct cpp_callbacks): Likewise for second
2733 parameter of "file_change" callback.
2734 * include/line-map.h (struct line_map): Convert from a struct
2735 containing a union to a base class.
2736 (struct line_map_ordinary): Convert to a subclass of line_map.
2737 (struct line_map_macro): Likewise.
2738 (linemap_check_ordinary): Strengthen return type from line_map *
2739 to line_map_ordinary *, and add a const-variant.
2740 (linemap_check_macro): New pair of functions.
2741 (ORDINARY_MAP_STARTING_LINE_NUMBER): Strengthen param from
2742 const line_map * to const line_map_ordinary *, eliminating call
2743 to linemap_check_ordinary. Likewise for the non-const variant.
2744 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
2745 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
2746 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Likewise.
2747 (ORDINARY_MAP_FILE_NAME): Likewise.
2748 (MACRO_MAP_MACRO): Strengthen param from const line_map * to
2749 const line_map_macro *. Likewise for the non-const variant.
2750 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
2751 (MACRO_MAP_LOCATIONS): Likewise.
2752 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
2753 (struct maps_info): Replace with...
2754 (struct maps_info_ordinary):...this and...
2755 (struct maps_info_macro): ...this.
2756 (struct line_maps): Convert fields "info_ordinary" and
2757 "info_macro" to the above new structs.
2758 (LINEMAPS_MAP_INFO): Delete both functions.
2759 (LINEMAPS_MAPS): Likewise.
2760 (LINEMAPS_ALLOCATED): Rewrite both variants to avoid using
2761 LINEMAPS_MAP_INFO.
2762 (LINEMAPS_USED): Likewise.
2763 (LINEMAPS_CACHE): Likewise.
2764 (LINEMAPS_MAP_AT): Likewise.
2765 (LINEMAPS_ORDINARY_MAPS): Strengthen return type from line_map *
2766 to line_map_ordinary *.
2767 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
2768 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
2769 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
2770 (LINEMAPS_MACRO_MAPS): Strengthen return type from line_map * to
2771 line_map_macro *.
2772 (LINEMAPS_MACRO_MAP_AT): Likewise.
2773 (LINEMAPS_LAST_MACRO_MAP): Likewise.
2774 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
2775 (linemap_map_get_macro_name): Strengthen param from
2776 const line_map * to const line_map_macro *.
2777 (SOURCE_LINE): Strengthen first param from const line_map * to
2778 const line_map_ordinary *, removing call to
2779 linemap_check_ordinary.
2780 (SOURCE_COLUMN): Likewise.
2781 (LAST_SOURCE_LINE_LOCATION): Likewise.
2782 (LAST_SOURCE_LINE): Strengthen first param from const line_map *
2783 to const line_map_ordinary *.
2784 (LAST_SOURCE_COLUMN): Likewise.
2785 (INCLUDED_FROM): Strengthen return type from line_map * to
2786 line_map_ordinary *., and second param from const line_map *
2787 to const line_map_ordinary *, removing call to
2788 linemap_check_ordinary.
2789 (MAIN_FILE_P): Strengthen param from const line_map * to
2790 const line_map_ordinary *, removing call to
2791 linemap_check_ordinary.
2792 (linemap_position_for_line_and_column): Strengthen param from
2793 const line_map * to const line_map_ordinary *.
2794 (LINEMAP_FILE): Strengthen param from const line_map * to
2795 const line_map_ordinary *, removing call to
2796 linemap_check_ordinary.
2797 (LINEMAP_LINE): Likewise.
2798 (LINEMAP_SYSP): Likewise.
2799 (linemap_resolve_location): Strengthen final param from
2800 const line_map ** to const line_map_ordinary **.
2801 * internal.h (CPP_INCREMENT_LINE): Likewise for local "map".
2802 (linemap_enter_macro): Strengthen return type from
2803 const line_map * to const line_map_macro *.
2804 (linemap_add_macro_token): Likewise for first param.
2805 * line-map.c (linemap_check_files_exited): Strengthen local "map"
2806 from const line_map * to const line_map_ordinary *.
2807 (new_linemap): Introduce local "map_size" and use it when
2808 calculating how large the buffer should be. Rewrite based
2809 on change of info_macro and info_ordinary into distinct types.
2810 (linemap_add): Strengthen locals "map" and "from" from line_map *
2811 to line_map_ordinary *.
2812 (linemap_enter_macro): Strengthen return type from
2813 const line_map * to const line_map_macro *, and local "map" from
2814 line_map * to line_map_macro *.
2815 (linemap_add_macro_token): Strengthen param "map" from
2816 const line_map * to const line_map_macro *.
2817 (linemap_line_start): Strengthen local "map" from line_map * to
2818 line_map_ordinary *.
2819 (linemap_position_for_column): Likewise.
2820 (linemap_position_for_line_and_column): Strengthen first param
2821 from const line_map * to const line_map_ordinary *.
2822 (linemap_position_for_loc_and_offset): Strengthen local "map" from
2823 const line_map * to const line_map_ordinary *.
2824 (linemap_ordinary_map_lookup): Likewise for return type and locals
2825 "cached" and "result".
2826 (linemap_macro_map_lookup): Strengthen return type and locals
2827 "cached" and "result" from const line_map * to
2828 const line_map_macro *.
2829 (linemap_macro_map_loc_to_exp_point): Likewise for param "map".
2830 (linemap_macro_map_loc_to_def_point): Likewise.
2831 (linemap_macro_map_loc_unwind_toward_spelling): Likewise.
2832 (linemap_get_expansion_line): Strengthen local "map" from
2833 const line_map * to const line_map_ordinary *.
2834 (linemap_get_expansion_filename): Likewise.
2835 (linemap_map_get_macro_name): Strengthen param from
2836 const line_map * to const line_map_macro *.
2837 (linemap_location_in_system_header_p): Add call to
2838 linemap_check_ordinary in region guarded by
2839 !linemap_macro_expansion_map_p. Introduce local "macro_map" via
2840 linemap_check_macro in other region, using it in place of "map"
2841 for typesafety.
2842 (first_map_in_common_1): Add calls to linemap_check_macro.
2843 (trace_include): Strengthen param "map" from const line_map * to
2844 const line_map_ordinary *.
2845 (linemap_macro_loc_to_spelling_point): Strengthen final param from
2846 const line_map ** to const line_map_ordinary **. Replace a
2847 C-style cast with a const_cast, and add calls to
2848 linemap_check_macro and linemap_check_ordinary.
2849 (linemap_macro_loc_to_def_point): Likewise.
2850 (linemap_macro_loc_to_exp_point): Likewise.
2851 (linemap_resolve_location): Strengthen final param from
2852 const line_map ** to const line_map_ordinary **.
2853 (linemap_unwind_toward_expansion): Introduce local "macro_map" via
2854 a checked cast and use it in place of *map.
2855 (linemap_unwind_to_first_non_reserved_loc): Strengthen local
2856 "map1" from const line_map * to const line_map_ordinary *.
2857 (linemap_expand_location): Introduce local "ord_map" via a checked
2858 cast and use it in place of map.
2859 (linemap_dump): Make local "map" const. Strengthen local
2860 "includer_map" from line_map * to const line_map_ordinary *.
2861 Introduce locals "ord_map" and "macro_map" via checked casts and
2862 use them in place of "map" for typesafety.
2863 (linemap_dump_location): Strengthen local "map" from
2864 const line_map * to const line_map_ordinary *.
2865 (linemap_get_file_highest_location): Update for elimination of
2866 union.
2867 (linemap_get_statistics): Strengthen local "cur_map" from
2868 line_map * to const line_map_macro *. Update uses of sizeof to
2869 use the appropriate line_map subclasses.
2870 * macro.c (_cpp_warn_if_unused_macro): Add call to
2871 linemap_check_ordinary.
2872 (builtin_macro): Strengthen local "map" from const line_map * to
2873 const line_map_macro *.
2874 (enter_macro_context): Likewise.
2875 (replace_args): Likewise.
2876 (tokens_buff_put_token_to): Likewise for param "map".
2877 (tokens_buff_add_token): Likewise.
2878
ba4ad400
DM
28792015-05-13 David Malcolm <dmalcolm@redhat.com>
2880
2881 * include/line-map.h (source_location): Add a reference to
2882 location-example.txt to the descriptive comment.
2883 * location-example.txt: New file.
2884
0501dbd9
DM
28852015-05-13 David Malcolm <dmalcolm@redhat.com>
2886
2887 * include/line-map.h (MAX_SOURCE_LOCATION): Convert from a macro
2888 to a const source_location.
2889 (RESERVED_LOCATION_COUNT): Likewise.
2890 (linemap_check_ordinary): Convert from a macro to a pair of inline
2891 functions, for const/non-const arguments.
2892 (MAP_START_LOCATION): Likewise.
2893 (ORDINARY_MAP_STARTING_LINE_NUMBER): Likewise.
2894 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
2895 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
2896 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Convert from a macro to a
2897 pair of inline functions, for const/non-const arguments, where the
2898 latter is named...
2899 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): New function.
2900 (ORDINARY_MAP_FILE_NAME): Convert from a macro to a pair of inline
2901 functions, for const/non-const arguments.
2902 (MACRO_MAP_MACRO): Likewise.
2903 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
2904 (MACRO_MAP_LOCATIONS): Likewise.
2905 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
2906 (LINEMAPS_MAP_INFO): Likewise.
2907 (LINEMAPS_MAPS): Likewise.
2908 (LINEMAPS_ALLOCATED): Likewise.
2909 (LINEMAPS_USED): Likewise.
2910 (LINEMAPS_CACHE): Likewise.
2911 (LINEMAPS_ORDINARY_CACHE): Likewise.
2912 (LINEMAPS_MACRO_CACHE): Likewise.
2913 (LINEMAPS_MAP_AT): Convert from a macro to an inline function.
2914 (LINEMAPS_LAST_MAP): Likewise.
2915 (LINEMAPS_LAST_ALLOCATED_MAP): Likewise.
2916 (LINEMAPS_ORDINARY_MAPS): Likewise.
2917 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
2918 (LINEMAPS_ORDINARY_ALLOCATED): Likewise.
2919 (LINEMAPS_ORDINARY_USED): Likewise.
2920 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
2921 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
2922 (LINEMAPS_MACRO_MAPS): Likewise.
2923 (LINEMAPS_MACRO_MAP_AT): Likewise.
2924 (LINEMAPS_MACRO_ALLOCATED): Likewise.
2925 (LINEMAPS_MACRO_USED): Likewise.
2926 (LINEMAPS_MACRO_LOWEST_LOCATION): Likewise.
2927 (LINEMAPS_LAST_MACRO_MAP): Likewise.
2928 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
2929 (IS_ADHOC_LOC): Likewise.
2930 (COMBINE_LOCATION_DATA): Likewise.
2931 (SOURCE_LINE): Likewise.
2932 (SOURCE_COLUMN): Likewise.
2933 (LAST_SOURCE_LINE_LOCATION): Likewise.
2934 (LAST_SOURCE_LINE): Likewise.
2935 (LAST_SOURCE_COLUMN): Likewise.
2936 (LAST_SOURCE_LINE_LOCATION)
2937 (INCLUDED_FROM): Likewise.
2938 (MAIN_FILE_P): Likewise.
2939 (LINEMAP_FILE): Likewise.
2940 (LINEMAP_LINE): Likewise.
2941 (LINEMAP_SYSP): Likewise.
2942 (linemap_location_before_p): Likewise.
2943 * line-map.c (linemap_check_files_exited): Make local "map" const.
2944 (linemap_add): Use SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS.
2945 (linemap_line_start): Likewise.
2946
eb70f327
MH
29472015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
2948
2949 * aclocal.m4: Regenerated with automake-1.11.6.
2950
60c12095
DM
29512015-05-13 David Malcolm <dmalcolm@redhat.com>
2952
2953 * include/line-map.h (linemap_assert): Move up within the file to
2954 before all of the map accessor macros.
2955 (linemap_assert_fails): Likewise.
2956 (linemap_check_ordinary): Likewise.
2957 (linemap_macro_expansion_map_p): Likewise.
2958
c3388e62
DM
29592015-05-12 David Malcolm <dmalcolm@redhat.com>
2960
2961 * directives.c (do_line): Set seen_line_directive on line_table.
2962 (do_linemarker): Likewise.
2963 * include/line-map.h (struct line_maps): Add new field
2964 "seen_line_directive".
2965
fe191308
JM
29662015-05-08 Jason Merrill <jason@redhat.com>
2967
2968 * include/cpplib.h: Add CPP_W_CXX11_COMPAT.
2969 (struct cpp_options): Add cpp_warn_cxx11_compat.
2970 * init.c (cpp_create_reader): Initialize it.
2971 * lex.c (lex_string): Add -Wc++11-compat warning.
2972
21c0a521
DM
29732015-05-05 David Malcolm <dmalcolm@redhat.com>
2974
2975 * pch.c (cpp_valid_state): Fix indentation so that it reflects the
2976 block structure.
2977
c87b25e6
DM
29782015-05-05 David Malcolm <dmalcolm@redhat.com>
2979
2980 * include/line-map.h: Fix comment at the top of the file.
2981 (source_location): Rewrite and expand the comment for this
2982 typedef, adding an ascii-art table to clarify how source_location
2983 values are allocated.
2984 * line-map.c: Fix comment at the top of the file.
2985
ca708025
RB
29862015-04-09 Richard Biener <rguenther@suse.de>
2987
2988 PR pch/65550
2989 * files.c (pch_open_file): Allow main and pre-included files
2990 when trying to open a PCH.
2991
e4b33ee5
JJ
29922015-04-06 Jakub Jelinek <jakub@redhat.com>
2993
2994 PR preprocessor/61977
2995 * lex.c (cpp_peek_token): If peektok is CPP_EOF, back it up
2996 with all tokens peeked by the current function.
2997
b8cd77f4
JJ
29982015-04-02 Jakub Jelinek <jakub@redhat.com>
2999
3000 PR preprocessor/61977
3001 * lex.c (cpp_peek_token): Temporarily clear pfile->cb.line_change.
3002
fb136e35
JJ
30032015-03-23 Jakub Jelinek <jakub@redhat.com>
3004
3005 PR preprocessor/65238
3006 * internal.h (_cpp_scan_out_logical_line): Add third argument.
3007 * directives.c (prepare_directive_trad): Pass false to it.
3008 * traditional.c (_cpp_read_logical_line_trad,
3009 _cpp_create_trad_definition): Likewise.
3010 (struct fun_macro): Add paramc field.
3011 (fun_like_macro): New function.
3012 (maybe_start_funlike): Handle NODE_BUILTIN macros. Initialize
3013 macro->paramc field.
3014 (save_argument): Use macro->paramc instead of
3015 macro->node->value.macro->paramc.
3016 (push_replacement_text): Formatting fix.
3017 (recursive_macro): Use fun_like_macro helper.
3018 (_cpp_scan_out_logical_line): Likewise. Add BUILTIN_MACRO_ARG
3019 argument. Initialize fmacro.paramc field. Handle builtin
3020 function-like macros.
3021
a5858a3d
ESR
30222015-03-16 Edward Smith-Rowland <3dw4rd@verizon.net>
3023
3024 PR c++/64626
3025 * lex.c (lex_number): If a number ends with digit-seps (') skip back
3026 and let lex_string take them.
3027
44d95244
MT
30282015-03-02 Markus Trippelsdorf <markus@trippelsdorf.de>
3029
3030 PR target/65261
3031 * lex.c (search_line_fast): Silence ubsan errors.
3032
f8abc9ba
DS
30332015-02-03 <dodji@redhat.com>
3034
3035 PR preprocessor/64803
3036 * internal.h (cpp_reader::top_most_macro_node): New data member.
3037 * macro.c (enter_macro_context): Pass the location of the end of
3038 the top-most invocation of the function-like macro, or the
3039 location of the expansion point of the top-most object-like macro.
3040 (cpp_get_token_1): Store the top-most macro node in the new
3041 pfile->top_most_macro_node data member.
3042 (_cpp_pop_context): Clear the new cpp_reader::top_most_macro_node
3043 data member.
3044
95d0610c
SN
30452015-01-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
3046
3047 * lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON.
3048
10ef8f28
MP
30492015-01-23 Marek Polacek <polacek@redhat.com>
3050
3051 DR#412
3052 PR preprocessor/60570
3053 * directives.c (do_elif): Don't evaluate #elif conditionals
3054 when they don't need to be.
3055
6e6cb471
JJ
30562015-01-16 Jakub Jelinek <jakub@redhat.com>
3057
3058 * expr.c (cpp_classify_number): Add N_() around ?: string
3059 literals used in cpp_error_with_line call as format string.
3060
5624e564
JJ
30612015-01-05 Jakub Jelinek <jakub@redhat.com>
3062
3063 Update copyright years.
3064
1f8d3e84
JJ
30652014-12-19 Jakub Jelinek <jakub@redhat.com>
3066
3067 PR preprocessor/63831
3068 * directives.c (lex_macro_node): Remove __has_attribute__ handling.
3069 * internal.h (struct spec_node): Remove n__has_attribute__ field.
3070 (struct lexer_state): Remove in__has_attribute__ field.
3071 * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_ATTRIBUTE.
3072 * identifiers.c (_cpp_init_hashtable): Remove __has_attribute__
3073 handling.
3074 * init.c (builtin_array): Add __has_attribute and __has_cpp_attribute.
3075 (cpp_init_special_builtins): Don't initialize __has_attribute
3076 or __has_cpp_attribute if CLK_ASM or pfile->cb.has_attribute is NULL.
3077 * traditional.c (enum ls): Remove ls_has_attribute,
3078 ls_has_attribute_close.
3079 (_cpp_scan_out_logical_line): Remove __has_attribute__ handling.
3080 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_ATTRIBUTE.
3081 * pch.c (cpp_read_state): Remove __has_attribute__ handling.
3082 * expr.c (eval_token): Likewise.
3083 (parse_has_attribute): Removed.
3084
01ca36af
UB
30852014-12-11 Uros Bizjak <ubizjak@gmail.com>
3086
3087 * directives.c (cpp_define_formatted): Use xvasprintf.
3088
b93c0722
MLI
30892014-12-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
3090
3091 * line-map.c (linemap_position_for_loc_and_offset): Add new
3092 linemap_assert_fails.
3093
73bd8329
MLI
30942014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
3095
3096 * include/line-map.h (linemap_assert_fails): Declare.
3097 * line-map.c (linemap_position_for_loc_and_offset): Use it.
3098
9c320ab1
MLI
30992014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
3100
49445904
UB
3101 * line-map.c (linemap_add): Fix typo.
3102 (linemap_line_start): Fix whitespace.
9c320ab1 3103
81fee4a7
JM
31042014-11-29 John Schmerge <jbschmerge@gmail.com>
3105
3106 PR preprocessor/41698
3107 * charset.c (one_utf8_to_utf16): Do not produce surrogate pairs
3108 for 0xffff.
3109
43ba1c6c
JJ
31102014-11-25 Jakub Jelinek <jakub@redhat.com>
3111
3112 PR preprocessor/60436
3113 * line-map.c (linemap_line_start): If highest is above 0x60000000
3114 and we are still tracking columns or highest is above 0x70000000,
3115 force add_map.
3116
8a23b100
UB
31172014-11-20 Uros Bizjak <ubizjak@gmail.com>
3118
3119 PR target/63966
1b6b13f3
UB
3120 * lex.c [__i386__ || __x86_64__]: Compile special SSE functions
3121 only for (__GNUC__ >= 5 || !defined(__PIC__)).
8a23b100 3122
d82f1e13
MLI
31232014-11-13 Manuel López-Ibáñez <manu@gcc.gnu.org>
3124
3125 * include/line-map.h: Include EXPR, so that unused variable warnings
3126 do not occur.
3127
3aa34c1d
MLI
31282014-11-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
3129
3130 PR fortran/44054
3131 * include/line-map.h (linemap_position_for_loc_and_offset):
3132 Declare.
3133 * line-map.c (linemap_position_for_loc_and_offset): New.
3134
35485da9
DM
31352014-11-11 David Malcolm <dmalcolm@redhat.com>
3136
3137 * ChangeLog.jit: New.
3138
42fd12b1
ESR
31392014-11-10 Edward Smith-Rowland <3dw4rd@verizon.net>
3140
3141 * include/cpplib.h (cpp_callbacks): Add has_attribute.
3142 * internal.h (lexer_state): Add in__has_attribute__.
3143 * directives.c (lex_macro_node): Prevent use of __has_attribute__
3144 as a macro.
3145 * expr.c (parse_has_attribute): New function; (eval_token): Look for
3146 __has_attribute__ and route to parse_has_attribute.
3147 * identifiers.c (_cpp_init_hashtable): Initialize n__has_attribute__.
3148 * pch.c (cpp_read_state): Initialize n__has_attribute__.
3149 * traditional.c (enum ls): Add ls_has_attribute, ls_has_attribute_close;
3150 (_cpp_scan_out_logical_line): Attend to __has_attribute__.
3151
be5ffc59
JM
31522014-11-06 Joseph Myers <joseph@codesourcery.com>
3153
3154 * include/cpp-id-data.h (struct cpp_macro): Update comment
3155 regarding parameters.
3156 * include/cpplib.h (struct cpp_macro_arg, struct cpp_identifier):
3157 Add spelling fields.
3158 (struct cpp_token): Update comment on macro_arg.
3159 * internal.h (_cpp_save_parameter): Add extra argument.
3160 (_cpp_spell_ident_ucns): New declaration.
3161 * lex.c (lex_identifier): Add SPELLING argument. Set *SPELLING to
3162 original spelling of identifier.
3163 (_cpp_lex_direct): Update calls to lex_identifier.
3164 (_cpp_spell_ident_ucns): New function, factored out of
3165 cpp_spell_token.
3166 (cpp_spell_token): Adjust FORSTRING argument semantics to return
3167 original spelling of identifiers. Use _cpp_spell_ident_ucns in
3168 !FORSTRING case.
3169 (_cpp_equiv_tokens): Check spellings of identifiers and macro
3170 arguments are identical.
3171 * macro.c (macro_arg_saved_data): New structure.
3172 (paste_tokens): Use original spellings of identifiers from
3173 cpp_spell_token.
3174 (_cpp_save_parameter): Add argument SPELLING. Save both canonical
3175 node and its value.
3176 (parse_params): Update calls to _cpp_save_parameter.
3177 (lex_expansion_token): Save spelling of macro argument tokens.
3178 (_cpp_create_definition): Extract canonical node from saved data.
3179 (cpp_macro_definition): Use UCNs in spelling of macro name. Use
3180 original spellings of macro argument tokens and identifiers.
3181 * traditional.c (scan_parameters): Update call to
3182 _cpp_save_parameter.
3183
701cade1
JM
31842014-11-05 Joseph Myers <joseph@codesourcery.com>
3185
3186 PR preprocessor/9449
3187 * init.c (lang_defaults): Enable extended identifiers for C++ and
3188 C99-based standards.
3189
19a9ba64
AM
31902014-10-22 Alan Modra <amodra@gmail.com>
3191
3192 * symtab.c (ht_create): Use obstack_specify_allocation in place of
3193 _obstack_begin.
3194 * files.c (_cpp_init_files): Likewise.
3195 * init.c (cpp_create_reader): Likewise.
3196 * identifiers.c (_cpp_init_hashtable): Likewise.
3197
3aac0952
MLI
31982014-10-14 Manuel López-Ibáñez <manu@gcc.gnu.org>
3199
3200 * include/line-map.h (linemap_location_from_macro_expansion_p):
3201 const struct line_maps * argument.
3202 (linemap_position_for_line_and_column): const struct line_map *
3203 argument.
3204 * line-map.c (linemap_add_macro_token): Use correct argument name
3205 in comment.
3206 (linemap_position_for_line_and_column): const struct line_map *
3207 argument.
3208 (linemap_macro_map_loc_to_def_point): Fix comment. Make static.
3209 (linemap_location_from_macro_expansion_p): const struct line_maps *
3210 argument.
3211 (linemap_resolve_location): Fix argument names in comment.
3212
0ccaaab0
BS
32132014-10-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
3214
3215 * lex.c (search_line_fast): Add new version to be used for Power8
3216 and later targets when Altivec is enabled. Restrict the existing
3217 Altivec version to big-endian systems so that lvsr is not used on
3218 little endian, where it is deprecated. Remove LE-specific code
3219 from the now-BE-only version.
3220
dc257367
BE
32212014-10-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
3222 Jeff Law <law@redhat.com>
3223
3224 * charset.c (convert_no_conversion): Reallocate memory with 25%
3225 headroom.
3226
a15f7cb8
ESR
32272014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net>
3228
3229 Implement SD-6: SG10 Feature Test Recommendations
3230 * internal.h (lexer_state, spec_nodes): Add in__has_include__.
3231 * directives.c: Support __has_include__ builtin.
3232 * expr.c (parse_has_include): New function to parse __has_include__
3233 builtin; (eval_token()): Use it.
3234 * files.c (_cpp_has_header()): New funtion to look for header;
3235 (open_file_failed()): Not an error to not find a header file for
3236 __has_include__.
3237 * identifiers.c (_cpp_init_hashtable()): Add entry for __has_include__.
3238 * pch.c (cpp_read_state): Lookup __has_include__.
3239 * traditional.c (enum ls, _cpp_scan_out_logical_line()): Walk through
3240 __has_include__ statements.
3241
cc811a8a
BE
32422014-09-30 Bernd Edlinger <bernd.edlinger@hotmail.de>
3243
3244 PR preprocessor/58893
3245 * errors.c (cpp_diagnostic): Fix possible out of bounds access.
3246 * files.c (_cpp_stack_include): Initialize src_loc for IT_CMDLINE.
3247
083e891e
MP
32482014-09-24 Marek Polacek <polacek@redhat.com>
3249
3250 PR c/61405
3251 PR c/53874
3252 * include/cpplib.h (enum cpp_ttype): Define CPP_KEYWORD.
3253
d87fc699
JH
32542014-09-17 Jan Hubicka <hubicka@ucw.cz>
3255
3256 * charset.c (conversion): Rename to ...
3257 (cpp_conversion): ... this one; update.
3258 * files.c (file_hash_entry): Rename to ...
3259 (cpp_file_hash_entry): ... this one ; update.
3260
909eb89c
MP
32612014-09-17 Marek Polacek <polacek@redhat.com>
3262
3263 PR c/61854
3264 * init.c (struct lang_flags): Remove cplusplus_comments.
3265 (cpp_set_lang): Likewise.
3266 (post_options): Likewise.
3267 * lex.c (_cpp_lex_direct): Disallow C++ style comments in C90/C94.
3268
1ef33fd4
MLI
32692014-09-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
3270
3271 * include/cpplib.h (struct cpp_options): Declare warn_normalize as
3272 int instead of enum.
3273
2b71f4a4
MLI
32742014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
3275
3276 * macro.c (replace_args): Use cpp_pedwarning, cpp_warning and
3277 CPP_W flags.
3278 * include/cpplib.h: Add CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC.
3279 * init.c (cpp_create_reader): Do not init to -1 here.
3280 * expr.c (num_binary_op): Use cpp_pedwarning.
3281
81b5d104
MLI
32822014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
3283
3284 * directives.c (check_eol_1): New.
3285 (check_eol_endif_labels): New.
3286 (check_eol): Call check_eol_1.
3287 (do_else,do_endif): Call check_eol_endif_labels.
3288
b753b37b
MLI
32892014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
3290
3291 * macro.c (warn_of_redefinition): Suppress warnings for builtins
3292 that lack the NODE_WARN flag, unless Wbuiltin-macro-redefined.
3293 (_cpp_create_definition): Use Wbuiltin-macro-redefined for
3294 builtins that lack the NODE_WARN flag.
3295 * directives.c (do_undef): Likewise.
3296 * init.c (cpp_init_special_builtins): Do not change flags
3297 depending on Wbuiltin-macro-redefined.
3298
7c05e50c
ESR
32992014-08-28 Edward Smith-Rowland <3dw4rd@verizon.net>
3300
3301 PR cpp/23827 - standard C++ should not have hex float preprocessor
3302 tokens
3303 * libcpp/init.c (lang_flags): Change CXX98 flag for extended numbers
3304 from 1 to 0.
3305 * libcpp/expr.c (cpp_classify_number): Weite error message for improper
3306 use of hex floating literal.
3307
e4276ba5
ESR
33082014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
3309
3310 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z;
3311 Rename CLK_GNUCXX1Y, CLK_CXX1Y to CLK_GNUCXX14, CLK_CXX14;
3312 * init.c (struct lang_flags lang_defaults): Add column for trigraphs;
3313 Add rows for CLK_GNUCXX1Z, CLK_CXX1Z; (cpp_set_lang): Set trigraphs;
3314 (cpp_init_builtins): Set __cplusplus to 201402L for C++14;
3315 Set __cplusplus to 201500L for C++17.
3316 * expr.c (cpp_classify_number): Change C++1y to C++14 in binary
3317 constants error message.
3318
dd3ff077
MP
33192014-08-20 Marek Polacek <polacek@redhat.com>
3320
3321 * include/cpplib.h (cpp_options): Use signed char.
3322 * lex.c (_cpp_lex_direct): Don't warn in C++ mode.
3323
3f4f5c9a
MP
33242014-08-19 Marek Polacek <polacek@redhat.com>
3325
3326 * lex.c (_cpp_lex_direct): Fix a typo.
3327
177cce46
MP
33282014-08-19 Marek Polacek <polacek@redhat.com>
3329
3330 * charset.c (_cpp_valid_ucn): Warn only if -Wc90-c99-compat.
3331 * lex.c (_cpp_lex_direct): Likewise.
3332 * macro.c (replace_args): Likewise.
3333 (parse_params): Likewise.
3334 * include/cpplib.h (cpp_options): Change cpp_warn_c90_c99_compat
3335 to char.
3336
f3bede71
MP
33372014-08-10 Marek Polacek <polacek@redhat.com>
3338
3339 PR c/51849
3340 * lex.c (_cpp_lex_direct): Warn when -Wc90-c99-compat is in effect.
3341 * charset.c (_cpp_valid_ucn): Likewise.
3342 * include/cpplib.h (cpp_options): Add cpp_warn_c90_c99_compat.
3343 * macro.c (replace_args): Warn when -Wc90-c99-compat is in effect.
3344 (parse_params): Likewise.
3345
61eb99f6
MP
33462014-07-27 Marek Polacek <polacek@redhat.com>
3347
3348 PR c/61861
3349 * macro.c (builtin_macro): Add location parameter. Set
3350 location of builtin macro to the expansion point.
3351 (enter_macro_context): Pass location to builtin_macro.
3352
c468587a
DS
33532014-07-16 Dodji Seketeli <dodji@redhat.com>
3354
3355 Support location tracking for built-in macro tokens
3356 * include/line-map.h (line_maps::builtin_location): New data
3357 member.
3358 (line_map_init): Add a new parameter to initialize the new
3359 line_maps::builtin_location data member.
3360 * line-map.c (linemap_init): Initialize the
3361 line_maps::builtin_location data member.
3362 * macro.c (builtin_macro): Create a macro map and track the token
3363 resulting from the expansion of a built-in macro.
3364
3976796b
ESR
33652014-07-10 Edward Smith-Rowland <3dw4rd@verizon.net>
3366 Jonathan Wakely <jwakely@redhat.com>
3367
c786fca6 3368 PR preprocessor/61389
3976796b
ESR
3369 * macro.c (_cpp_arguments_ok, parse_params, create_iso_definition):
3370 Warning messages mention C++11 in c++ mode and C99 in c mode.
3371 * lex.c (lex_identifier_intern, lex_identifier): Ditto
3372
7aee8646
ESR
33732014-07-09 Edward Smith-Rowland <3dw4rd@verizon.net>
3374
3375 PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped
3376 by preprocessor
3377 * lex.c (lex_raw_string ()): Do not warn about invalid suffix
3378 if skipping. (lex_string ()): Ditto.
3379
98ba7482
ESR
33802014-06-04 Edward Smith-Rowland <3dw4rd@verizon.net>
3381
3382 PR c++/61038
3383 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
3384 Combine user-defined escape logic with the other string and char logic.
3385
edf6ddf6
RB
33862014-05-26 Richard Biener <rguenther@suse.de>
3387
3388 * configure.ac: Remove long long and __int64 type checks,
3389 add check for uint64_t and fail if that wasn't found.
3390 * include/cpplib.h (cpp_num_part): Use uint64_t.
3391 * config.in: Regenerate.
3392 * configure: Likewise.
3393
28939589
MP
33942014-05-21 Marek Polacek <polacek@redhat.com>
3395
3396 PR c/61212
3397 * files.c (find_file_in_dir): Add parens around &&.
3398
49039169
ESR
33992014-05-20 Edward Smith-Rowland <3dw4rd@verizon.net>
3400
28939589 3401 PR c++/61038
49039169
ESR
3402 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
3403 Check for user-defined literal strings and user-defined literal chars
3404 to escape necessary characters.
3405
54da09ee
RB
34062014-05-20 Richard Biener <rguenther@suse.de>
3407
3408 * configure.ac: Copy gcc logic of detecting a 64bit type.
3409 Remove HOST_WIDE_INT define.
3410 * include/cpplib.h: typedef cpp_num_part to a 64bit type,
3411 similar to how hwint.h does it.
3412 * config.in: Regenerate.
3413 * configure: Likewise.
3414
eac3e079
JY
34152014-05-09 Joey Ye <joey.ye@arm.com>
3416
3417 * files.c (find_file_in_dir): Always try to shorten for DOS
3418 non-system headers.
3419 * init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS.
3420
f543058d
RB
34212014-05-07 Richard Biener <rguenther@suse.de>
3422
3423 * configure.ac: Always set need_64bit_hwint to yes.
3424 * configure: Regenerated.
3425
d9f069ab
RO
34262014-04-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3427
3428 * lex.c: Remove Solaris 9 reference.
3429
341c653c
WL
34302014-02-24 Walter Lee <walt@tilera.com>
3431
3432 * configure.ac: Change "tilepro" triplet to "tilepro*".
3433 * configure: Regenerate.
3434
179652df
JJ
34352014-02-19 Jakub Jelinek <jakub@redhat.com>
3436
3437 PR preprocessor/58844
3438 * macro.c (enter_macro_context): Only push
3439 macro_real_token_count (macro) tokens rather than
3440 macro->count tokens, regardless of
3441 CPP_OPTION (pfile, track-macro-expansion).
3442
acf601ae
JJ
34432014-02-07 Jakub Jelinek <jakub@redhat.com>
3444
3445 PR preprocessor/56824
3446 * line-map.c (get_combined_adhoc_loc, linemap_get_expansion_line,
3447 linemap_get_expansion_filename, linemap_location_in_system_header_p,
3448 linemap_location_from_macro_expansion_p,
3449 linemap_macro_loc_to_spelling_point, linemap_macro_loc_to_def_point,
3450 linemap_macro_loc_to_exp_point, linemap_expand_location): Fix
3451 formatting.
3452 (linemap_compare_locations): Look through adhoc locations for both
3453 l0 and l1.
3454
7ecc3eb9
DS
34552014-01-23 Dodji Seketeli <dodji@redhat.com>
3456
3457 PR PR preprocessor/58580
3458 * include/line-map.h (linemap_get_file_highest_location): Declare
3459 new function.
3460 * line-map.c (linemap_get_file_highest_location): Define it.
3461
35c3d610
RS
34622014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
3463
3464 Update copyright years
3465
3a4efce7
JM
34662013-12-09 Joseph Myers <joseph@codesourcery.com>
3467
3468 PR preprocessor/55715
3469 * expr.c (num_binary_op): Implement subtraction directly rather
3470 than with negation and falling through into addition case.
3471
aadce585
BS
34722013-11-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
3473
3474 * lex.c (search_line_fast): Correct for little endian.
3475
d3f4ff8b
JM
34762013-11-15 Joseph Myers <joseph@codesourcery.com>
3477
3478 * ucnid.tab: Add C11 and C11NOSTART data.
3479 * makeucnid.c (digit): Rename enum value to N99.
3480 (C11, N11, all_languages): New enum values.
3481 (NUM_CODE_POINTS, MAX_CODE_POINT): New macros.
3482 (flags, decomp, combining_value): Use NUM_CODE_POINTS as array
3483 size.
3484 (decomp): Use unsigned int as element type.
3485 (all_decomp): New array.
3486 (read_ucnid): Handle C11 and C11NOSTART. Use MAX_CODE_POINT.
3487 (read_table): Use MAX_CODE_POINT. Store all decompositions in
3488 all_decomp.
3489 (read_derived): Use MAX_CODE_POINT.
3490 (write_table): Use NUM_CODE_POINTS. Print N99, C11 and N11
3491 flags. Print whole array variable declaration rather than just
3492 array contents.
3493 (char_id_valid, write_context_switch): New functions.
3494 (main): Call write_context_switch.
3495 * ucnid.h: Regenerate.
3496 * include/cpplib.h (struct cpp_options): Add c11_identifiers.
3497 * init.c (struct lang_flags): Add c11_identifiers.
3498 (cpp_set_lang): Set c11_identifiers option from selected language.
3499 * internal.h (struct normalize_state): Document "previous" as
3500 previous starter character.
3501 (NORMALIZE_STATE_UPDATE_IDNUM): Take character as argument.
3502 * charset.c (DIG): Rename enum value to N99.
3503 (C11, N11): New enum values.
3504 (struct ucnrange): Give name to struct. Use short for flags and
3505 unsigned int for end of range. Include ucnid.h for whole variable
3506 declaration.
3507 (ucn_valid_in_identifier): Allow for characters up to 0x10FFFF.
3508 Allow for C11 in determining valid characters and valid start
3509 characters. Use check_nfc for non-Hangul context-dependent
3510 checks. Only store starter characters in nst->previous.
3511 (_cpp_valid_ucn): Pass new argument to
3512 NORMALIZE_STATE_UPDATE_IDNUM.
3513 * lex.c (lex_identifier): Pass new argument to
3514 NORMALIZE_STATE_UPDATE_IDNUM. Call NORMALIZE_STATE_UPDATE_IDNUM
3515 after initial non-UCN part of identifier.
3516 (lex_number): Pass new argument to NORMALIZE_STATE_UPDATE_IDNUM.
3517
54848ff8
JM
35182013-11-15 Joseph Myers <joseph@codesourcery.com>
3519
3520 * ucnid.tab: Mark C99 digits as [C99DIG].
3521 * makeucnid.c (read_ucnid): Handle [C99DIG].
3522 (read_table): Don't check for digit characters.
3523 * ucnid.h: Regenerate.
3524
5157b91e
TB
35252013-11-06 Tobias Burnus <burnus@net-b.de>
3526
3527 * macro.c (_cpp_builtin_macro_text): Correct
3528 wording of two warnings.
3529
e8ff5196
TB
35302013-11-05 Tobias Burnus <burnus@net-b.de>
3531
3532 * include/cpplib.h (CPP_W_DATE_TIME): Added.
3533 (cpp_options): Add warn_date_time.
3534 * init.c (cpp_create_reader): Init it.
3535 * macro.c (_cpp_builtin_macro_text): Warn when
3536 __DATE__/__TIME__/__TIMESTAMP__ is used.
3537
7057e645
ESR
35382013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
3539
e8ff5196 3540 Implement C++14 digit separators.
7057e645
ESR
3541 * include/cpplib.h (cpp_options): Add digit_separators flag.
3542 * internal.h (DIGIT_SEP(c)): New macro.
3543 * expr.c (cpp_classify_number): Check improper placement of digit sep;
3544 (cpp_interpret_integer): Skip over digit separators.
3545 * init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add
3546 digit separator flags per language; (cpp_set_lang): Set
3547 digit_separators
3548 * lex.c (lex_number): Add digits separator to allowable characters for
3549 C++14.
3550
459260ec
DM
35512013-10-15 David Malcolm <dmalcolm@redhat.com>
3552
3553 * Makefile.in (PICFLAG): New.
3554 (ALL_CFLAGS): Add PICFLAG.
3555 (ALL_CXXFLAGS): Likewise.
3556 * configure.ac: Add --enable-host-shared, setting up new
3557 PICFLAG variable.
3558 * configure: Regenerate.
3559
fd6eea0c
RE
35602013-08-07 Richard Earnshaw <rearnsha@arm.com>
3561
3562 * configure.ac: Set need_64bit_hwint for all arm targets.
3563 * configure: Regenerated.
3564
8cf88735
JJ
35652013-07-20 Jakub Jelinek <jakub@redhat.com>
3566
3567 PR preprocessor/57620
3568 * lex.c (lex_raw_string): Undo phase1 and phase2 transformations
3569 between R" and final " rather than only in between R"del( and )del".
3570
87e356ba
JJ
35712013-07-10 Jakub Jelinek <jakub@redhat.com>
3572
d5e48350
JJ
3573 PR preprocessor/57824
3574 * lex.c (lex_raw_string): Allow reading new-lines if
3575 in_deferred_pragma or if parsing_args and there is still
3576 data in the current buffer.
3577
c26302d5
JJ
3578 * include/cpplib.h (cpp_token_val_index): Change parameter type to
3579 const cpp_token *.
3580 * lex.c (cpp_token_val_index): Likewise.
3581
87e356ba
JJ
3582 PR preprocessor/57757
3583 * lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING
3584 or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that
3585 starts if a-zA-Z_.
3586
c865f923
ESR
35872013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
3588
3589 * lex.c (lex_raw_string(), lex_string()): Constrain suffixes treated
3590 as concatenated literal and macro to just the patterns found in
3591 inttypes.h; (is_macro()): New.
3592
39953c79
DC
35932013-06-24 Dehao Chen <dehao@google.com>
3594
3595 * files.c (_cpp_stack_include): Fix the highest_location when header
3596 file is guarded by #ifndef and is included twice.
3597
01187df0
JJ
35982013-04-28 Jakub Jelinek <jakub@redhat.com>
3599
3600 N3472 binary constants
3601 * include/cpplib.h (struct cpp_options): Fix a typo in user_literals
3602 field comment. Add binary_constants field.
3603 * init.c (struct lang_flags): Add binary_constants field.
3604 (lang_defaults): Add bin_cst column to the table.
3605 (cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants).
3606 * expr.c (cpp_classify_number): Talk about C++11 instead of C++0x
3607 in diagnostics. Accept binary constants if
3608 CPP_OPTION (pfile, binary_constants) even when pedantic. Adjust
3609 pedwarn message.
3610
61949153
PC
36112013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
3612
3613 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y.
3614 * init.c (lang_defaults): Add defaults for the latter.
3615 (cpp_init_builtins): Define __cplusplus as 201300L for the latter.
3616 * lex.c (_cpp_lex_direct): Update.
3617
994a4cc0
SH
36182013-04-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
3619
3620 PR target/56771
3621 * configure.ac: Require 64-bit int for arm*-*-rtems*.
3622 * configure: Regenerate.
3623
28937f11
JJ
36242013-03-06 Jakub Jelinek <jakub@redhat.com>
3625
3626 PR middle-end/56461
3627 * internal.h (struct cpp_buffer): Add to_free field.
3628 (_cpp_pop_file_buffer): Add third argument.
3629 * files.c (_cpp_stack_file): Set buffer->to_free.
3630 (_cpp_pop_file_buffer): Add to_free argument. Free to_free
3631 if non-NULL, and if equal to file->buffer_start, also clear
3632 file->buffer{,_start,_valid}.
3633 * directives.c (_cpp_pop_buffer): Pass buffer->to_free
3634 to _cpp_pop_file_buffer.
3635
3b8af25b
JJ
36362013-03-01 Jakub Jelinek <jakub@redhat.com>
3637
3638 PR middle-end/56461
3639 * files.c (_cpp_save_file_entries): Free result at the end.
3640 * pch.c (cpp_string_free): New function.
3641 (cpp_save_state): Use it in htab_create call.
3642 (cpp_write_pch_deps): Free ss->defs. Destroy ss->definedhash.
3643
1a80db97
JJ
36442013-02-28 Jakub Jelinek <jakub@redhat.com>
3645
15fd8332
JJ
3646 * files.c (_cpp_find_file): If returning early, before storing
3647 something to *hash_slot and *hash_slot is NULL, call htab_clear_slot
3648 on it. Access *hash_slot using void * type rather than
3649 struct file_hash_entry * to avoid aliasing issues.
3650
1a80db97
JJ
3651 * configure.ac: Don't define ENABLE_CHECKING whenever
3652 --enable-checking is seen, instead use similar --enable-checking=yes
3653 vs. --enable-checking=release default as gcc/ subdir has and
3654 define ENABLE_CHECKING if ENABLE_CHECKING is defined in gcc/.
3655 Define ENABLE_VALGRIND_CHECKING if requested.
3656 * lex.c (new_buff): If ENABLE_VALGRIND_CHECKING, put _cpp_buff
3657 struct first in the allocated buffer and result->base after it.
3658 (_cpp_free_buff): If ENABLE_VALGRIND_CHECKING, free buff itself
3659 instead of buff->base.
3660 * config.in: Regenerated.
3661 * configure: Regenerated.
3662
561f7fc7
ESR
36632013-02-13 Ed Smith-Rowland <3dw4rd@verizon.net>
3664
3665 PR c++/55582
61949153 3666 * lex.c (lex_raw_string): Allow string literal with suffix
561f7fc7
ESR
3667 beginning with 's' to be parsed as a C++11 user-defined literal.
3668
500f3ed9
RS
36692013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
3670
3671 Update copyright years.
3672
1582c677
PC
36732013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
3674
3675 PR c++/54526 (again)
3676 * lex.c (_cpp_lex_direct): In C++11 mode, implement 2.5 p3, bullet 2.
3677
8ac16127
MG
36782013-01-03 Marc Glisse <marc.glisse@inria.fr>
3679
3680 PR bootstrap/50177
3681 * line-map.c (get_combined_adhoc_loc): Cast from extern "C" type.
3682 (new_linemap): Likewise.
3683 (linemap_enter_macro): Likewise.
3684
f41e5bd1
JJ
36852012-12-03 Jakub Jelinek <jakub@redhat.com>
3686
3687 PR bootstrap/55380
3688 PR other/54691
3689 * files.c (read_file_guts): Allocate extra 16 bytes instead of
3690 1 byte at the end of buf. Pass size + 16 instead of size
3691 to _cpp_convert_input.
3692 * charset.c (_cpp_convert_input): Reallocate if there aren't
3693 at least 16 bytes beyond to.len in the buffer. Clear 16 bytes
3694 at to.text + to.len.
3695
31962032
SE
36962012-11-21 Steve Ellcey <sellcey@mips.com>
3697
3698 PR pch/55399
3699 * files.c (pch_open_file): Fix check for implicit_preinclude.
3700
5dc99c46
SB
37012012-11-16 Simon Baldwin <simonb@google.com>
3702
3703 * include/cpplib.h (struct cpp_options): Add canonical_system_headers.
3704 * files.c (find_file_in_dir): Call maybe_shorter_path() only if
3705 canonical_system_headers is set.
3706 * init.c (cpp_create_reader): Initialize canonical_system_headers.
3707 * configure.ac: Add new --enable-canonical-system-headers.
3708 * configure: Regenerate.
3709 * config.in: Regenerate.
3710
a4a0016d
ESR
37112012-11-09 Ed Smith-Rowland <3dw4rd@verizon.net>
3712
3713 PR c++/54413
3714 * include/cpplib.h (cpp_interpret_float_suffix): Add cpp_reader* arg.
3715 (cpp_interpret_int_suffix): Add cpp_reader* arg.
3716 * init.c (cpp_create_reader): Iitialize new flags.
3717 * expr.c (interpret_float_suffix): Use new flags.
3718 (cpp_interpret_float_suffix): Add cpp_reader* arg.
3719 (interpret_int_suffix): Use new flags.
3720 (cpp_interpret_int_suffix): Add cpp_reader* arg.
3721 (cpp_classify_number): Adjust calls to interpret_x_suffix.
3722
04ce690f
IB
37232012-10-23 Ian Bolton <ian.bolton@arm.com>
3724 Jim MacArthur <jim.macarthur@arm.com>
3725 Marcus Shawcroft <marcus.shawcroft@arm.com>
3726 Nigel Stephens <nigel.stephens@arm.com>
3727 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
3728 Richard Earnshaw <rearnsha@arm.com>
3729 Sofiane Naci <sofiane.naci@arm.com>
3730 Stephen Thomas <stephen.thomas@arm.com>
3731 Tejas Belagod <tejas.belagod@arm.com>
3732 Yufeng Zhang <yufeng.zhang@arm.com>
3733
3734 * configure.ac: Enable AArch64.
3735 * configure: Regenerate.
3736
1efcb8c6
JM
37372012-10-23 Joseph Myers <joseph@codesourcery.com>
3738
3739 * files.c (struct _cpp_file): Add implicit_preinclude.
3740 (pch_open_file): Allow a previously opened implicitly included
3741 file.
3742 (_cpp_find_file): Add implicit_preinclude argument. Free file and
3743 do not call open_file_failed if implicit_preinclude. Store
3744 implicit_preinclude value.
3745 (_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date):
3746 Update calls to _cpp_find_file.
3747 (_cpp_stack_include): Handle IT_DEFAULT.
3748 (cpp_push_default_include): New.
3749 * include/cpplib.h (cpp_push_default_include): Declare.
3750 * init.c (cpp_read_main_file): Update call to _cpp_find_file.
3751 * internal.h (enum include_type): Add IT_DEFAULT.
3752 (_cpp_find_file): Update prototype.
3753
55e7f907
TB
37542012-10-15 Tobias Burnus <burnus@net-b.de>
3755
3756 * files.c (read_file_guts, _cpp_save_file_entries): Free memory
3757 before returning.
3758 * lex.c (warn_about_normalization): Ditto.
3759 * mkdeps.c (deps_save): Ditto.
3760 * pch.c (cpp_valid_state): Ditto.
3761
f591bd8f
FW
37622012-10-04 Florian Weimer <fweimer@redhat.com>
3763
3764 * directives.c (do_pragma_warning_or_error): New.
3765 (do_pragma_warning): New.
3766 (do_pragma_error): New.
3767 (_cpp_init_internal_pragmas): Register new pragmas.
3768
ec6e0399
DC
37692012-09-25 Dehao Chen <dehao@google.com>
3770
3771 PR middle-end/54704
3772 * line-map.c (location_adhoc_data_hash): Fix the hash function.
3773
52187008
DC
37742012-09-25 Dehao Chen <dehao@google.com>
3775
3776 PR middle-end/54645
3777 * include/line-map.h (location_adhoc_data): Move location_adhoc_data
3778 into GC.
3779 (location_adhoc_data_map): Likewise.
3780 (line_maps): Likewise.
3781 (rebuild_location_adhoc_htab): New Function.
3782 * line-map.c (+rebuild_location_adhoc_htab): new Funcion.
3783 (get_combined_adhoc_loc): Move location_adhoc_data into GC.
3784 (location_adhoc_data_fini): Likewise.
3785 (linemap_init): Likewise.
3786 (location_adhoc_data_init): Remove Function.
3787
5368224f
DC
37882012-09-19 Dehao Chen <dehao@google.com>
3789
3790 * include/line-map.h (MAX_SOURCE_LOCATION): New value.
3791 (location_adhoc_data_fini): New.
3792 (get_combined_adhoc_loc): New.
3793 (get_data_from_adhoc_loc): New.
3794 (get_location_from_adhoc_loc): New.
3795 (location_adhoc_data_map): New.
3796 (COMBINE_LOCATION_DATA): New.
3797 (IS_ADHOC_LOC): New.
3798 (expanded_location): New field.
3799 (line_maps): New field.
3800 * line-map.c (location_adhoc_data): New.
3801 (location_adhoc_data_hash): New.
3802 (location_adhoc_data_eq): New.
3803 (location_adhoc_data_update): New.
3804 (get_combined_adhoc_loc): New.
3805 (get_data_from_adhoc_loc): New.
3806 (get_location_from_adhoc_loc): New.
3807 (location_adhoc_data_init): New.
3808 (location_adhoc_data_fini): New.
3809 (linemap_init): Initialize location_adhoc_data.
3810 (linemap_lookup): Change to use new location.
3811 (linemap_ordinary_map_lookup): Likewise.
3812 (linemap_macro_map_lookup): Likewise.
3813 (linemap_macro_map_loc_to_def_point): Likewise.
3814 (linemap_macro_map_loc_unwind_toward_spel): Likewise.
3815 (linemap_get_expansion_line): Likewise.
3816 (linemap_get_expansion_filename): Likewise.
3817 (linemap_location_in_system_header_p): Likewise.
3818 (linemap_location_from_macro_expansion_p): Likewise.
3819 (linemap_macro_loc_to_spelling_point): Likewise.
3820 (linemap_macro_loc_to_def_point): Likewise.
3821 (linemap_macro_loc_to_exp_point): Likewise.
3822 (linemap_resolve_location): Likewise.
3823 (linemap_unwind_toward_expansion): Likewise.
3824 (linemap_unwind_to_first_non_reserved_loc): Likewise.
3825 (linemap_expand_location): Likewise.
3826 (linemap_dump_location): Likewise.
3827 (linemap_line_start): Likewise.
3828
f3d25c65
DS
38292012-05-25 Dodji Seketeli <dodji@redhat.com>
3830
3831 PR preprocessor/53469
3832 * directives.c (do_pragma): Use the virtual location for the
3833 pragma token, instead of its spelling location.
3834
0823efed
DN
38352012-08-14 Diego Novillo <dnovillo@google.com>
3836
3837 Merge from cxx-conversion branch. Configury.
3838
3839 * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
3840 * configure.ac: Likewise.
3841 * configure: Regenerate.
3842
38432012-08-14 Lawrence Crowl <crowl@google.com>
3844
3845 Merge from cxx-conversion branch. New C++ hash table.
3846
3847 * include/symtab.h (typedef struct ht hash_table): Change the typedef
3848 name to cpp_hash_table. Update all users of the typedef.
3849
c0fd3497
LB
38502012-07-30 Laurynas Biveinis <laurynas.biveinis@gmail.com>
3851
3852 * include/line-map.h (line_map_macro): Use the "atomic" GTY option
3853 for the macro_locations field.
3854
d35d1c0f
UB
38552011-06-19 Uros Bizjak <ubizjak@gmail.com>
3856
3857 * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
3858 __builtin_ia32_pcmpestri128 instead of asm.
3859
d86d2119
DA
38602012-06-04 Dimitrios Apostolou <jimis@gmx.net>
3861
3862 * line-map.c (linemap_enter_macro): Don't zero max_column_hint in
3863 every macro. This improves performance by reducing the number of
3864 reallocations when track-macro-expansion is on.
3865
7ca643e1
DS
38662012-06-04 Dodji Seketeli <dodji@redhat.com>
3867
3868 PR preprocessor/53463
3869 * line-map.c (linemap_location_in_system_header_p): For built-in
3870 macro tokens, check the first expansion point location that is not
3871 for a token coming from a built-in macro.
3872
7d9641cc
JM
38732012-05-29 Joseph Myers <joseph@codesourcery.com>
3874
3875 * directives.c: Fix typos.
3876 * include/line-map.h: Fix typos.
3877 * line-map.c: Fix typos.
3878 * macro.c: Fix typos.
3879
53a103d3
DS
38802012-05-25 Dodji Seketeli <dodji@redhat.com>
3881
3882 PR bootstrap/53459
3883 * lex.c (search_line_fast): Avoid unused local typedefs to simulate
3884 a static assertion.
3885
828a7f76
DS
38862012-05-29 Dodji Seketeli <dodji@redhat.com>
3887
3888 PR preprocessor/53229
3889 * internal.h (cpp_reader::set_invocation_location): Remove.
3890 (cpp_reader::about_to_expand_macro_p): New member flag.
3891 * directives.c (do_pragma): Remove Kludge as
3892 pfile->set_invocation_location is no more.
3893 * macro.c (cpp_get_token_1): Do away with the use of
3894 cpp_reader::set_invocation_location. Just collect the macro
3895 expansion point when we are about to expand the top-most macro.
3896 Do not override cpp_reader::about_to_expand_macro_p.
3897 This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding
3898 properly handle locations of expansion points.
3899 (cpp_get_token_with_location): Adjust, as
3900 cpp_reader::set_invocation_location is no more.
3901 (paste_tokens): Take a virtual location parameter for
3902 the LHS of the pasting operator. Use it in diagnostics. Update
3903 comments.
3904 (paste_all_tokens): Tighten the assert. Propagate the location of
3905 the expansion point when no virtual locations are available.
3906 Pass the virtual location to paste_tokens.
3907 (in_macro_expansion_p): New static function.
3908 (enter_macro_context): Set the cpp_reader::about_to_expand_macro_p
3909 flag until we really start expanding the macro.
3910
0b2c4be5
DS
39112012-05-16 Dodji Seketeli <dodji@redhat.com>
3912
3913 PR preprocessor/7263
3914 * include/cpplib.h (cpp_classify_number): Take a location
3915 parameter.
3916 * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic
3917 macros that take a location parameter.
3918 (cpp_classify_number): Take a (virtual) location parameter. Use
3919 it for diagnostics. Adjust comments.
3920 (eval_token): Take a location parameter. Pass it to
3921 cpp_classify_number and to diagnostic routines.
3922 (_cpp_parse_expr): Use virtual locations of tokens when parsing
3923 expressions. Pass a virtual location to eval_token and to
3924 diagnostic routines.
3925
638d2065
TG
39262012-05-10 Tristan Gingold <gingold@adacore.com>
3927
3928 * expr.c (interpret_float_suffix): Add a guard.
3929
3ad64f53
DS
39302012-05-02 Dodji Seketeli <dodji@redhat.com>
3931
3932 Properly initialize cpp_context in destringize_and_run
3933 * directives.c (destringize_and_run): Properly initialize the new
3934 context.
3935 * macro.c (_cpp_pop_context): Assert that we shouldn't try to pop
3936 the initial base context, which has the same life time as the
3937 current instance of cpp_file.
3938
b193dfa8
MLI
39392012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
3940 Dodji Seketeli <dodji@seketeli.org>
3941
3efc2959 3942 PR c++/52974
b193dfa8
MLI
3943 * libcpp/files.c (maybe_shorter_path): New.
3944 (find_file_in_dir): Use it.
3945
4e65a470
DS
39462012-04-30 Dodji Seketeli <dodji@redhat.com>
3947
51fce2d3
DS
3948 Switch -ftrack-macro-expansion=2 on by default.
3949 * init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
3950 by default. Add comments.
3951
c4ca1a09
DS
3952 Strip "<built-in>" loc from displayed expansion context
3953 * include/line-map.h (linemap_unwind_toward_expansion): Fix typo
3954 in comment.
3955 (linemap_unwind_to_first_non_reserved_loc): Declare new function.
3956 * line-map.c (linemap_unwind_to_first_non_reserved_loc): Define
3957 new function.
3958
3600218c
DS
3959 Fix expansion point loc for macro-like tokens
3960 * macro.c (macro_of_context): New static function.
3961 (_cpp_push_token_context, push_extended_tokens_context): If the
3962 macro argument is NULL, it means we are continuing the expansion
3963 of the current macro, if any. Update comments.
3964 (_cpp_pop_context): Re-enable expansion of the macro only when we
3965 are really out of the context of the current expansion.
3966
0ff2b8a0
DS
3967 Fix token pasting with -ftrack-macro-expansion
3968 * macro.c (paste_all_tokens): Put the token resulting from pasting
3969 into an extended token context with -ftrack-macro-location is in
3970 effect.
3971
4e65a470
DS
3972 Fix cpp_sys_macro_p with -ftrack-macro-expansion
3973 * macro.c (cpp_sys_macro_p): Support -ftrack-macro-expansion.
3974
112448b4
DS
39752012-04-29 Dodji Seketeli <dodji@redhat.com>
3976
3977 * lex.c (lex_raw_string): Change C++ style comments into C style
3978 comments.
19a9ba64 3979 (lex_string): Likewise.
112448b4 3980
7f5f5f98
OW
39812012-04-27 Ollie Wild <aaw@google.com>
3982
3983 * include/cpplib.h (struct cpp_options): Add new field,
3984 warn_literal_suffix.
3985 (CPP_W_LITERAL_SUFFIX): New enum.
3986 * init.c (cpp_create_reader): Default initialization of
3987 warn_literal_suffix.
3988 * lex.c (lex_raw_string): Treat user-defined literals which don't
3989 begin with '_' as separate tokens and produce a warning.
3990 (lex_string): Ditto.
3991
1d72e96f
MLI
39922012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
3993
3994 * line-map.c (linemap_resolve_location): Synchronize comments with
3995 those in line-map.h.
3996 * include/line-map.h (linemap_resolve_location): Fix spelling in
3997 comment.
3998
e75b54a2
RE
39992012-03-22 Richard Earnshaw <rearnsha@arm.com>
4000
4001 * lex.c (search_line_fast): Provide Neon-optimized version for ARM.
4002
7888f266
RO
40032012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4004
4005 * lex.c: Remove Solaris 8 reference.
4006
dd552284
WL
40072012-02-14 Walter Lee <walt@tilera.com>
4008
4009 * configure.ac: Require 64-bit hwint for tilegx and tilepro.
4010 * configure: Regenerate.
4011
2c5cbc31
RG
40122012-01-09 Richard Guenther <rguenther@suse.de>
4013
4014 * macro.c (_cpp_builtin_macro_text): Remove unused variable map.
4015
b492b686
GF
40162012-01-09 Gary Funck <gary@intrepid.com>
4017
4018 PR preprocessor/33919
4019 * files.c (_cpp_get_file_name): New. Implement file name
4020 access function.
4021 * internal.h (_cpp_get_file_name): New prototype.
4022 * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
4023 to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
4024
75291c57
OH
40252012-01-03 Olivier Hainque <hainque@adacore.com>
4026
4027 * system.h: Prior to #define, #undef fopen and freopen unconditionally.
4028
48b0b196
JM
40292011-12-20 Joseph Myers <joseph@codesourcery.com>
4030
4031 * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
4032 (CLK_STDC1X): Change to CLK_STDC11.
4033 * init.c (lang_defaults): Update comments.
4034 (cpp_init_builtins): Update language tests. Use 201112L for C11
4035 __STDC_VERSION__.
4036
4a5e00ca
AS
40372011-12-20 Andreas Schwab <schwab@linux-m68k.org>
4038
4039 * configure: Regenerate.
4040
095af58f
AS
40412011-12-19 Andreas Schwab <schwab@linux-m68k.org>
4042
4043 * configure: Regenerate.
4044
b0c084b7
JJ
40452011-12-07 Jakub Jelinek <jakub@redhat.com>
4046
4047 PR bootstrap/50237
4048 * internal.h (_cpp_init_lexer): New prototype.
4049 * init.c (init_library): Call it.
4050 * lex.c (init_vectorized_lexer): Remove constructor attribute,
4051 add inline keyword.
4052 (HAVE_init_vectorized_lexer): Define.
4053 (_cpp_init_lexer): New function.
4054
9b554be9
DS
40552011-12-03 Dodji Seketeli <dodji@redhat.com>
4056
4057 * macro.c (tokens_buff_remove_last_token)
4058 (tokens_buff_put_token_to): Add an 'inline' function specifier to
4059 the prototype.
4060
8dcf72a8
DN
40612011-11-22 Diego Novillo <dnovillo@google.com>
4062
4063 * include/line-map.h (linemap_dump): Declare.
4064 (line_table_dump): Declare.
4065 * line-map.c (linemap_dump): New.
4066 (line_table_dump): New.
4067
7e74ce3f
ESR
40682011-11-21 Ed Smith-Rowland <3dw4rd@verizon.net>
4069
4070 PR c++/50958
4071 * expr.c (cpp_userdef_char_remove_type): Fix typo.
4072
e9411247
MM
40732011-11-03 Michael Matz <matz@suse.de>
4074
4075 PR bootstrap/50857
4076 * configure.ac: Check for -fno-exceptions -fno-rtti.
4077 * configure: Regenerate.
4078 * Makefile.in (NOEXCEPTION_FLAGS): New flag.
4079 (ALL_CXXFLAGS): Use it.
4080
0c1dace3
PC
40812011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
4082
4083 * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
4084
25339f10
JM
40852011-11-02 Jason Merrill <jason@redhat.com>
4086
4087 PR c++/50810
4088 * configure.ac: Add -Wno-narrowing to warning options.
4089
97e3ad20
JM
40902011-10-31 Jason Merrill <jason@redhat.com>
4091
1fb80b0c
JM
4092 PR libstdc++/1773
4093 * init.c (cpp_init_builtins): Set __cplusplus for C++11.
4094
97e3ad20
JM
4095 PR c++/50920
4096 * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
4097 CLK_GNUCXX0X to CLK_GNUCXX11.
4098
3ce4f9e4
ESR
40992011-10-26 Ed Smith-Rowland <3dw4rd@verizon.net>
4100
4101 Implement C++11 user-defined literals.
4102 * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
4103 cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
4104 cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
4105 cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
4106 (cpp_classify_number): Classify unrecognized tokens as user-defined
4107 literals.
4108 * include/cpplib.h: Add new tokens for user-defined literals.
4109 * init.c: Add new preprocessor flag (cxx11).
4110 * lex.c: (lex_string, lex_raw_string): Handle user-defined literals
4111 including concatenation and promotion with suffixes.
4112
3bb0c8db
DS
41132011-10-24 Dodji Seketeli <dodji@redhat.com>
4114
4115 * line-map.c (linemap_macro_map_lookup): Fix logic.
4116
84756fd4
DS
41172011-10-24 Dodji Seketeli <dodji@redhat.com>
4118
4119 * include/line-map.h (linemap_expand_location): Take a line table
4120 parameter. Update comment.
4121 (linemap_resolve_location): Update comment.
4122 (linemap_expand_location_full): Remove.
4123 * line-map.c (linemap_resolve_location): Handle reserved
4124 locations; return a NULL map in those cases.
4125 (linemap_expand_location): If location is reserved, return a
4126 zeroed expanded location. Update comment. Take a line table to
4127 assert that the function takes non-virtual locations only.
4128 (linemap_expand_location_full): remove.
4129 (linemap_dump_location): Handle the fact that
4130 linemap_resolve_location can return NULL line maps when the
4131 location resolves to a reserved location.
4132
4133 * line-map.c (linemap_macro_map_lookup): Fix logic.
4134
ad2305ad
DS
41352011-10-22 Dodji Seketeli <dodji@redhat.com>
4136
4137 PR bootstrap/50778
4138 * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
4139 context to act upon.
4140 * lex.c (_cpp_remaining_tokens_num_in_context): Likewise. Update
4141 comment.
4142 (cpp_token_from_context_at): Likewise.
4143 (cpp_peek_token): Use the context to peek tokens from.
4144
cbbcf655
DS
41452011-10-20 Dodji Seketeli <dodji@redhat.com>
4146
4147 PR bootstrap/50801
4148 * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
4149 number of tokens.
4150
d17687f6
DS
41512011-10-18 Dodji Seketeli <dodji@redhat.com>
4152
4153 PR bootstrap/50760
4154 * include/line-map.h (struct linemap_stats): Change the type of
19a9ba64 4155 the members from size_t to long.
d17687f6 4156 * macro.c (macro_arg_token_iter_init): Unconditionally initialize
19a9ba64 4157 iter->location_ptr.
d17687f6 4158
411f92de
DS
41592011-10-17 Dodji Seketeli <dodji@redhat.com>
4160
4161 * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
19a9ba64
AM
4162 variable without using it if ENABLE_CHECKING is not defined. Mark
4163 the LOCATION parameter as being unused.
411f92de 4164
b9bd6f74
TT
41652011-10-15 Tom Tromey <tromey@redhat.com>
4166 Dodji Seketeli <dodji@redhat.com>
4167
4168 * include/line-map.h (struct line_maps::alloced_size_for_request):
4169 New member.
4170 * line-map.c (new_linemap): Use set->alloced_size_for_request to
4171 get the actual allocated size of line maps.
4172
64a1a422
TT
41732011-10-15 Tom Tromey <tromey@redhat.com>
4174 Dodji Seketeli <dodji@redhat.com>
4175
4176 * line-map.h (struct linemap_stats): Declare new struct.
4177 (linemap_get_statistics): Declare ...
4178 * line-map.c (linemap_get_statistics): ... new function.
4179 * macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
4180 Declare new counters.
4181 (enter_macro_context, replace_args): Update
4182 num_macro_tokens_counter.
4183 (cpp_get_token_1): Update num_expanded_macros_counter.
4184
847e697a
TT
41852011-10-15 Tom Tromey <tromey@redhat.com>
4186 Dodji Seketeli <dodji@redhat.com>
4187
4188 * include/cpplib.h (struct cpp_options)<debug>: New struct member.
4189 * include/line-map.h (linemap_dump_location): Declare ...
4190 * line-map.c (linemap_dump_location): ... new function.
4191
92582b75
TT
41922011-10-15 Tom Tromey <tromey@redhat.com>
4193 Dodji Seketeli <dodji@redhat.com>
4194
4195 * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
4196 New option.
4197 * internal.h (struct macro_context): New struct.
4198 (enum context_tokens_kind): New enum.
4199 (struct cpp_context)<tokens_kind>: New member of type enum
4200 context_tokens_kind.
4201 (struct cpp_context)<macro>: Remove this. Replace it with an enum
4202 of macro and macro_context.
4203 (struct cpp_context)<direct_p>: Remove.
4204 (_cpp_remaining_tokens_num_in_context): Declare new function.
4205 * directives.c (destringize_and_run): Adjust.
4206 * lex.c (_cpp_remaining_tokens_num_in_context)
4207 (_cpp_token_from_context_at): Define new functions
4208 (cpp_peek_token): Use them.
4209 * init.c (cpp_create_reader): Initialize the base context to zero.
4210 (_cpp_token_from_context_at): Define new static function.
4211 (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
4212 _cpp_token_from_context_at.
4213 * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
4214 members.
4215 (enum macro_arg_token_kind): New enum.
4216 (struct macro_arg_token_iter): New struct.
4217 (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
4218 (alloc_expanded_arg_mem, ensure_expanded_arg_room)
4219 (delete_macro_args, set_arg_token, get_arg_token_location)
4220 (arg_token_ptr_at, macro_arg_token_iter_init)
4221 (macro_arg_token_iter_get_token)
4222 (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
4223 (expanded_token_index, tokens_buff_new, tokens_buff_count)
4224 (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
4225 (tokens_buff_add_token, tokens_buff_remove_last_token)
4226 (reached_end_of_context, consume_next_token_from_context): New
4227 static functions.
4228 (cpp_get_token_1): New static function. Split and extended from
4229 cpp_get_token. Use reached_end_of_context and
4230 consume_next_token_from_context. Unify its return point. Move
4231 the location tweaking from cpp_get_token_with_location in here.
4232 (cpp_get_token): Use cpp_get_token_1
4233 (stringify_arg): Use the new arg_token_at.
4234 (paste_all_tokens): Support tokens coming from extended tokens
4235 contexts.
4236 (collect_args): Return the number of collected arguments, by
4237 parameter. Store virtual locations of tokens that constitute the
4238 collected args.
4239 (funlike_invocation_p): Return the number of collected arguments,
4240 by parameter.
4241 (enter_macro_context): Add a parameter for macro expansion point.
4242 Pass it to replace_args and to the "used" cpp callback. Get the
4243 number of function-like macro arguments from funlike_invocation_p,
4244 pass it to the new delete_macro_args to free the memory used by
4245 macro args. When -ftrack-macro-expansion is in effect, for macros
4246 that have no arguments, create a macro map for the macro expansion
4247 and use it to allocate proper virtual locations for tokens
4248 resulting from the expansion. Push an extended tokens context
4249 containing the tokens resulting from macro expansion and their
4250 virtual locations.
4251 (replace_args): Rename the different variables named 'count' into
4252 variables with more meaningful names. Create a macro map;
4253 allocate virtual locations of tokens resulting from this
4254 expansion. Use macro_arg_token_iter to iterate over tokens of a
4255 given macro. Handle the case of the argument of
4256 -ftrack-macro-expansion being < 2. Don't free macro arguments
4257 memory resulting from expand_arg here, as these are freed by the
4258 caller of replace_arg using delete_macro_args now. Push extended
4259 token context.
4260 (next_context, push_ptoken_context, _cpp_push_token_context)
4261 (_cpp_push_text_context): Properly initialize the context.
4262 (expand_arg): Use the new alloc_expanded_arg_mem,
4263 push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
4264 (_cpp_pop_context): Really free the memory held by the context.
4265 Handle freeing memory used by extended tokens contexts.
4266 (cpp_get_token_with_location): Use cpp_get_token_1.
4267 (cpp_sys_macro_p): Adjust.
4268 (_cpp_backup_tokens): Support the new kinds of token contexts.
4269 * traditional.c (recursive_macro): Adjust.
4270
46427374
TT
42712011-10-15 Tom Tromey <tromey@redhat>
4272 Dodji Seketeli <dodji@redhat.com>
4273
4274 * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
4275 member.
4276 (MAX_SOURCE_LOCATION): New constant.
4277 (struct line_map_ordinary, struct line_map_macro): New structs.
19a9ba64 4278 (struct line_map): Turn this into a union of the two above. Add
46427374
TT
4279 comments.
4280 (struct maps_info): New struct.
4281 (struct line_maps)<info_ordinary, info_macro>: Two new fields.
4282 These now carry the map information that was previously scattered
4283 in struct line_maps.
4284 (struct map_info::allocated): Fix comment.
4285 (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
4286 (ORDINARY_MAP_STARTING_LINE_NUMBER)
4287 (ORDINARY_MAP_INCLUDER_FILE_INDEX)
4288 (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
4289 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
4290 (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
4291 (MACRO_MAP_EXPANSION_POINT_LOCATION)
4292 (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
4293 (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
4294 (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
4295 (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
4296 (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
4297 (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
4298 (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
4299 (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
4300 (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
4301 (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
4302 (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
4303 information.
4304 (linemap_check_ordinary, linemap_assert)
4305 (linemap_location_before_p): New macros.
4306 (linemap_position_for_line_and_column)
4307 (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
4308 (linemap_macro_expansion_map_p)
4309 (linemap_macro_map_loc_to_def_point)
4310 (linemap_macro_map_loc_unwind_once)
4311 (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
4312 (linemap_get_source_line linemap_get_source_column)
4313 (linemap_map_get_macro_name, linemap_get_file_path)
4314 (linemap_location_in_system_header_p)
4315 (linemap_location_from_macro_expansion_p): Declare new functions.
4316 (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
4317 (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
4318 accessors act on ordinary maps only.
4319 (INCLUDED_FROM): Return NULL for main files; use the new
4320 accessors.
4321 (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
4322 (struct expanded_location): Move here from gcc/input.h
4323 (linemap_resolve_location, linemap_expand_location)
4324 (linemap_expand_location_full): Declare new functions.
4325 * line-map.c: Include cpplib.h, internal.h
4326 (linemap_enter_macro, linemap_add_macro_token)
4327 (linemap_get_expansion_line, linemap_get_expansion_filename): New
4328 functions that are private to libcpp.
4329 (linemap_assert): New macro.
4330 (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
4331 (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
4332 (linemap_macro_map_loc_unwind_toward_spelling)
4333 (linemap_macro_map_loc_to_exp_point)
4334 (first_map_in_common_1, first_map_in_common): New static
4335 functions.
4336 (new_linemap): Define new static functions. Extracted and
4337 enhanced from ...
4338 (linemap_add): ... here. Use linemap_assert in lieu of abort
4339 previously.
4340 (linemap_tracks_macro_expansion_locs_p)
4341 (linemap_add_macro_token, linemap_macro_expansion_map_p)
4342 (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
4343 (linemap_macro_map_loc_to_def_point)
4344 (linemap_macro_map_loc_unwind_once)
4345 (linemap_step_out_once, linemap_map_get_index)
4346 (linemap_get_source_line,linemap_get_source_column)
4347 (linemap_get_file_path, linemap_map_get_macro_name)
4348 (linemap_location_in_system_header_p)
4349 (linemap_location_originated_from_system_header_p)
4350 (linemap_location_from_macro_expansion_p)
4351 (linemap_tracks_macro_expansion_locs_p)
4352 (linemap_resolve_location, linemap_expand_location)
4353 (linemap_expand_location_full)
4354 (linemap_tracks_macro_expansion_locs_p)
4355 (linemap_position_for_line_and_column, linemap_compare_locations):
4356 Define new public functions.
4357 (linemap_init): Initialize ordinary and macro maps information in
4358 the map set.
4359 (linemap_check_files_exited): Use the new accessors.
4360 (linemap_free): Remove this dead code.
4361 (linemap_line_start): Assert this uses an ordinary map. Adjust to
4362 use the new ordinary map accessors and data structures. Don't
4363 overflow past the lowest possible macro token's location.
4364 (linemap_position_for_column): Assert the ordinary maps of the map
4365 set are really ordinary. Use ordinary map accessors.
4366 (linemap_lookup): Keep the same logic but generalize to allow
4367 lookup of both ordinary and macro maps. Do not crash when called
4368 with an empty line table.
4369 * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
4370 new API of line-map.h.
4371 * directives.c (start_directive, do_line, do_linemarker)
4372 (do_linemarker): Likewise.
4373 * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
4374 (make_cpp_dir, cpp_make_system_header): Likewise.
4375 * init.c (cpp_read_main_file): Likewise.
4376 * internal.h (CPP_INCREMENT_LINE): Likewise.
4377 (linemap_enter_macro, linemap_add_macro_token)
4378 (linemap_get_expansion_line, linemap_get_expansion_filename): New
4379 functions private to libcpp.
4380 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
4381 (skip_line_comment, skip_whitespace, lex_raw_string)
4382 (_cpp_lex_direct): Likewise.
4383 * macro.c (_cpp_builtin_macro_text): Likewise.
4384 (_cpp_aligned_alloc): Initialize the new name member of the macro.
4385 * traditional.c (copy_comment, _cpp_scan_out_logical_line):
4386 Likewise.
4387 * errors.c (cpp_diagnostic): Adjust to new linemap API.
4388
892a371f
DS
43892011-08-28 Dodji Seketeli <dodji@redhat.com>
4390
4391 * line-map.c (linemap_add): Assert that reason must not be
4392 LC_RENAME when called for the first time on a "main input file".
4393
e3dfef44
GC
43942011-08-22 Gabriel Charette <gchare@google.com>
4395
4396 * init.c (cpp_create_reader): Inititalize forced_token_location_p.
4397 * internal.h (struct cpp_reader): Add field forced_token_location_p.
4398 * lex.c (_cpp_lex_direct): Use forced_token_location_p.
4399 (cpp_force_token_locations): New.
4400 (cpp_stop_forcing_token_locations): New.
4401
32fe396e
RO
44022011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4403
4404 PR libstdc++/1773
4405 * init.c (cpp_init_builtins): Define __cplusplus 19971L.
4406
7c1ffff9
JM
44072011-08-18 Joseph Myers <joseph@codesourcery.com>
4408
4409 * include/cpplib.h (struct cpp_options): Fix typo.
4410
a48e3dd1
JM
44112011-08-18 Joseph Myers <joseph@codesourcery.com>
4412
4413 * include/cpplib.h (struct cpp_options): Add rliterals.
4414 * init.c (struct lang_flags, lang_defaults): Add rliterals.
4415 (cpp_set_lang): Set rliterals option.
4416 (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
4417 * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
4418
3f6ced10
GC
44192011-08-15 Gabriel Charette <gchare@google.com>
4420
4421 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
4422 Update all users to use linemap_position_for_column instead.
4423
0681d04c
GC
44242011-07-28 Gabriel Charette <gchare@google.com>
4425
4426 * include/line-map.h (struct line_maps):
4427 Remove unused field last_listed. Update all users.
4428
5e9627ca
L
44292011-07-28 H.J. Lu <hongjiu.lu@intel.com>
4430
4431 * configure.ac: Set need_64bit_hwint to yes for x86 targets.
4432 * configure: Regenerated.
4433
a024b70f
RO
44342011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4435
4436 * system.h [__cplusplus]: Wrap C function declarations in extern "C".
4437
5b6d595b
RO
44382011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4439 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4440
4441 PR bootstrap/49794
4442 * configure.ac: Test AM_ICONV with CXX.
4443 * configure: Regenerate.
4444 * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
4445
d0a9fbe1
DS
44462011-07-15 Dodji Seketeli <dodji@redhat.com>
4447
4448 * directives.c (struct if_stack): Use source_location as type
4449 here.
4450 * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
4451 indent, def_pragma, used_define, used_undef>: Properly use
4452 source_location as parameter type, rather than unsigned int.
4453
fbdd5d87
RO
44542011-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4455
4456 PR target/39150
4457 * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
4458 like i[34567]86-*-solaris2.1[0-9]*.
4459 * configure: Regenerate.
4460
8787a05a
JM
44612011-06-16 Jason Merrill <jason@redhat.com>
4462
4463 PR c++/45399
4464 * lex.c (lex_raw_string): Don't check for embedded NUL.
4465
38fbfaf6
DS
44662011-06-06 Dodji Seketeli <dodji@redhat.com>
4467
4468 PR preprocessor/48532
4469 * directives.c (do_pragma): Don't forget the invocation location
4470 when parsing the pragma name of a namespaced pragma directive.
4471
fc0993ac
JT
44722011-05-29 John Tytgat <John.Tytgat@aaug.net>
4473
4474 * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
4475
ef230b38
UB
44762011-05-22 Uros Bizjak <ubizjak@gmail.com>
4477
4478 PR target/49104
4479 * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
4480 is defined. Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
4481
e5b0dad8
JK
44822011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
4483
4484 * system.h (ENUM_BITFIELD): Remove.
4485
6cfae070
JJ
44862011-04-24 Jakub Jelinek <jakub@redhat.com>
4487
4488 PR preprocessor/48740
4489 * lex.c (lex_raw_string): When raw string ends with
4490 ??) followed by raw prefix and ", ensure it is preprocessed
4491 with ??) rather than ??].
4492
04695783
JM
44932011-04-20 Jim Meyering <meyering@redhat.com>
4494
4495 * files.c (destroy_cpp_file): Remove useless if-before-free.
4496 * init.c (cpp_destroy): Likewise.
4497 * macro.c (replace_args): Likewise.
4498 * pch.c (cpp_valid_state): Likewise.
4499
4489800d
KT
45002011-03-25 Kai Tietz <ktietz@redhat.com>
4501
4502 * files.c (file_hash_eq): Use filename_cmp
4503 instead of strcmp.
4504 (nonexistent_file_hash_eq): Likewise.
4505 (remap_filename): Likewise.
4506 Handle absolute DOS-path,
4507 (append_file_to_dir): Check for IS_DIR_SEPARATOR
4508 instead of slash.
4509 (read_name_map): Likewise.
4510 * linemap.c (linemap_add): Use filename_cmp
4511 instead of strcmp.
4512 * mkdeps.c (apply_vpath): Use filename_ncmp
4513 instead of strncmp.
4514 (deps_restore): Use filename_cmp instead of
4515 strcmp.
4516 * init.c (read_original_directory): Use
4517 IS_DIR_SEPARATOR instead of checking for slash.
4518
f3c33d9d
MM
45192011-03-21 Michael Meissner <meissner@linux.vnet.ibm.com>
4520
4521 PR preprocessor/48192
4522 * directives.c (do_ifdef): Do not consider conditional macros as
4523 being defined.
4524 (do_ifndef): Ditto.
4525 * expr.c (parse_defined): Ditto.
4526
01956319
RH
45272011-03-18 Richard Henderson <rth@redhat.com>
4528
4529 PR bootstrap/45381
4530 * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
4531
c5a62c6f 45322011-11-04 Eric Botcazou <ebotcazou@adacore.com>
19a9ba64 4533 Jakub Jelinek <jakub@redhat.com>
c5a62c6f
EB
4534
4535 PR preprocessor/39213
4536 * directives.c (end_directive): Call _cpp_remove_overlay for deferred
4537 pragmas as well in traditional mode.
4538
0e1a989c
ILT
45392010-11-17 Ian Lance Taylor <iant@google.com>
4540
4541 PR bootstrap/45538
4542 * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of
4543 AC_LANG based on ENABLE_BUILD_WITH_CXX.
4544
651a20b5
KT
45452010-11-16 Kai Tietz <kai.tietz@onevision.com>
4546
4547 PR preprocessor/17349
4548 * lex.c (save_comment): Handle in argument passing c++
4549 comments special.
4550
480767a9
ILT
45512010-11-02 Ian Lance Taylor <iant@google.com>
4552
4553 * configure.ac: Use AC_SYS_LARGEFILE.
4554 * configure: Rebuild.
4555 * config.in: Rebuild.
4556
078419c9 45572010-10-19 Basile Starynkevitch <basile@starynkevitch.net>
480767a9 4558
078419c9
BS
4559 * line-map.h (source_location): Remove obsolete comment
4560 mentioning location_s.
4561
d6874138
KT
45622010-09-29 Kai Tietz <kai.tietz@onevision.com>
4563
4564 PR preprocessor/45362
4565 * directives.c (cpp_pop_definition): Make static.
4566 (do_pragma_push_macro): Reworked to store text
4567 definition.
4568 (do_pragma_pop_macro): Add free text definition.
4569 (cpp_push_definition): Removed.
4570 * include/cpplib.h (cpp_push_definition): Removed.
4571 (cpp_pop_definition): Likewise.
4572 * internal.h (def_pragma_macro): Remove member 'value'
4573 and add new members 'definition', 'line',
4574 'syshdr', 'sued' and 'is_undef'.
4575 * pch.c (_cpp_restore_pushed_macros): Rework to work
4576 on text definition and store additional macro flags.
4577 (_cpp_save_pushed_macros): Likewise.
4578
e3339d0f
JM
45792010-09-29 Joseph Myers <joseph@codesourcery.com>
4580
4581 * include/cpplib.h (cpp_options): Rename warn_deprecated,
4582 warn_traditional, warn_long_long and pedantic.
4583 * directives.c (directive_diagnostics, _cpp_handle_directive):
4584 Update names of cpp_options members.
4585 * expr.c (cpp_classify_number, eval_token): Update names of
4586 cpp_options members.
4587 * init.c (cpp_create_reader, post_options): Update names of
4588 cpp_options members.
4589 * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
4590 cpp_options members.
4591 * macro.c (parse_params): Update names of cpp_options members.
4592
128465e6
ILT
45932010-09-15 Ian Lance Taylor <iant@google.com>
4594
4595 * init.c: Fix type name in comment.
4596
a69d2520
JJ
45972010-08-31 Jakub Jelinek <jakub@redhat.com>
4598
4599 PR preprocessor/45457
4600 * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
4601 needed.
4602 * directives.c (do_ifdef, do_ifndef): Likewise.
4603
707bcb7a
RO
46042010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4605
4606 * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
4607
6f173e52
RH
46082010-08-24 Richard Henderson <rth@redhat.com>
4609
4610 PR bootstrap/45376
4611 * configure.ac (HAVE_SSE4): New check.
4612 * configure, config.in: Rebuild.
4613 * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
4614
789d73cb
RO
46152010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4616
4617 * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
4618 etc. on Solaris 2/x86.
4619
246a2fcb
RH
46202010-08-21 Richard Henderson <rth@redhat.com>
4621 Andi Kleen <ak@linux.intel.com>
4622 David S. Miller <davem@davemloft.net>
4623
4624 * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
4625 (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
4626 (ptrdiff_t): Check via AC_CHECK_TYPE.
4627 * config.in, configure: Rebuild.
4628 * system.h: Include stdint.h, if available.
4629 * lex.c (WORDS_BIGENDIAN): Provide default.
4630 (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
4631 acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
4632 search_line_sse2, search_line_sse42, init_vectorized_lexer,
4633 search_line_fast): New.
4634 (_cpp_clean_line): Use search_line_fast. Restructure the fast
4635 loop to make it clear when we're leaving the loop. Stay in the
4636 fast loop for non-trigraph '?'.
4637
8e680db5
JJ
46382010-06-11 Jakub Jelinek <jakub@redhat.com>
4639
4640 * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
4641 callback.
4642 (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
4643 (cpp_macro_definition): Remove const qual from second argument.
4644 * macro.c (enter_macro_context): Call user_builtin_macro callback for
4645 NODE_BUILTIN !NODE_USED macros.
4646 (warn_of_redefinition): Likewise. Remove const qual from second
4647 argument.
4648 (cpp_macro_definition): Likewise.
4649 * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
4650 for NODE_BUILTIN !NODE_USED macros.
4651
1cb42611
JM
46522010-06-10 Joseph Myers <joseph@codesourcery.com>
4653
4654 * include/cpplib.h (struct cpp_options): Remove show_column.
4655 * init.c (cpp_create_reader, post_options): Don't set show_column.
4656
ff5dfc48
JR
46572010-06-09 Joern Rennecke <joern.rennecke@embecosm.com>
4658
4659 PR bootstrap/44432
4660 * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
4661 check that C++ compiler works.
4662 * configure: Regenerate.
4663
a9429e29
LB
46642010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
4665
4666 * include/symtab.h (ht_identifier_ptr): New.
4667
c3f247f4
RW
46682010-06-03 Joern Rennecke <joern.rennecke@embecosm.com>
4669 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4670
4671 PR bootstrap/42798
4672 * configure.ac: Check for declaration of 'basename(char *)'.
4673 * configure: Regenerate.
4674 * config.in: Regenerate.
4675
2778d766
JM
46762010-04-25 Joseph Myers <joseph@codesourcery.com>
4677
4678 * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
4679 * init.c (lang_defaults): Add entries for new language variants.
4680 (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
4681 variants.
4682
d8a12e84
MLI
46832010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
4684
4685 PR cpp/43195
4686 * files.c (report_missing_guard): Test for #pragma once.
4687
87cf0651
SB
46882010-04-07 Simon Baldwin <simonb@google.com>
4689
4690 * directives.c (do_diagnostic): Add warning reason argument,
4691 call appropriate error reporting function for code.
4692 (directive_diagnostics): Call specific warning functions with
4693 warning reason where appropriate.
4694 (do_error, do_warning, do_pragma_dependency): Add warning reason
4695 argument to do_diagnostic calls.
4696 * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
4697 _cpp_create_definition): Call specific warning functions with
4698 warning reason where appropriate.
4699 * Makefile.in: Add new diagnostic functions to gettext translations.
4700 * include/cpplib.h (struct cpp_callbacks): Add warning reason code
4701 to error callback.
4702 (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
4703 CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
4704 (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
4705 CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
4706 CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
4707 CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
4708 CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
4709 CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
4710 CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
4711 warning reason codes.
4712 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
4713 cpp_warning_with_line, cpp_pedwarning_with_line,
4714 cpp_warning_with_line_syshdr): New specific error reporting functions.
4715 * pch.c (cpp_valid_state): Call specific warning functions with
4716 warning reason where appropriate.
4717 * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
4718 diagnostic handlers.
4719 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
4720 cpp_warning_with_line, cpp_pedwarning_with_line,
4721 cpp_warning_with_line_syshdr): New specific error reporting functions.
4722 * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
4723 specific warning functions with warning reason where appropriate.
4724 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
4725 warn_about_normalization, lex_identifier_intern, lex_identifier,
4726 _cpp_lex_direct): Ditto.
4727 * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
4728 narrow_str_to_charconst): Ditto.
4729
d947ada0
JJ
47302010-04-06 Jakub Jelinek <jakub@redhat.com>
4731
4732 PR preprocessor/43642
4733 * lex.c (lex_raw_string): Change type of TYPE variable to
4734 unsigned char.
4735
4d9e8446
RW
47362010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4737
4738 * aclocal.m4: Regenerate.
4739
52150625
JM
47402010-03-29 Jason Merrill <jason@redhat.com>
4741
00a81b8b
JM
4742 More N3077 raw string changes
4743 * charset.c (cpp_interpret_string): Don't transform UCNs in raw
4744 strings.
4745 * lex.c (bufring_append): Split out from...
4746 (lex_raw_string): ...here. Undo trigraph and line splicing
4747 transformations. Do process line notes in multi-line literals.
4748 (_cpp_process_line_notes): Ignore notes that were already handled.
4749
52150625
JM
4750 Some raw string changes from N3077
4751 * charset.c (cpp_interpret_string): Change inner delimiters to ().
4752 * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter.
4753
709d7160
JJ
47542010-02-11 Jakub Jelinek <jakub@redhat.com>
4755
4756 * init.c (read_original_filename): Don't call read_original_directory
4757 if _cpp_handle_directive returns 0.
4758
dadab4fd
JM
47592010-01-01 Joseph Myers <joseph@codesourcery.com>
4760
4761 PR preprocessor/41947
4762 * expr.c (cpp_classify_number): Give error for hexadecimal
4763 floating-point constant with no digits before or after point.
4764
3de8a540
AC
47652009-11-20 Arnaud Charlet <charlet@adacore.com>
4766
4767 * macro.c (enter_macro_context): Call cb.used callback if defined.
4768 * directives.c (do_idef, do_ifndef): Ditto.
4769 * include/cpplib.h (struct cpp_callbacks): Add used callback.
4770
17e7cb85
KT
47712009-11-11 Kai Tietz <kai.tietz@onevision.com>
4772
4773 * directives.c (do_pragma_push_macro): New pragma handler.
4774 (do_pragma_pop_macro): Likewise.
4775 (_cpp_init_internal_pragmas): Add push_macro and
4776 pop_macro handler to internal pragmas.
4777 (lex_macro_node_from_str): Removed.
4778 (cpp_push_definition): Replace lex_macro_node_from_str
4779 by _cpp_lex_identifier.
4780 (cpp_pop_definition): Likewise.
4781 * internal.h (_cpp_lex_identifier): New prototype.
4782 (def_pragma_macro): New structure.
4783 (cpp_reader): New member pushed_macros.
4784 * lex.c (_cpp_lex_identifier): New function.
4785 (lex_identifier_intern): New function.
4786 * init.c (cpp_create_reader): Initialize pushed_macros
4787 member.
4788 (cpp_destroy): Free elements in pushed_macros member.
4789 * pch.c (_cpp_save_pushed_macros): New function.
4790 (_cpp_restore_pushed_macros): Likewise.
4791 (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
4792 (cpp_read_state): Use _cpp_restore_pushed_macros.
4793
2c6e3f55
JJ
47942009-10-19 Jakub Jelinek <jakub@redhat.com>
4795
4796 * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
4797 (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
4798 and char32_cset_desc.
4799 (converter_for_type): Handle CPP_UTF8STRING.
4800 (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
4801 * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
4802 (parse_include): Reject raw strings.
4803 * include/cpplib.h (CPP_UTF8STRING): New token type.
4804 * internal.h (struct cpp_reader): Add utf8_cset_desc field.
4805 * lex.c (lex_raw_string): New function.
4806 (lex_string): Handle u8 string literals, call lex_raw_string
4807 for raw string literals.
4808 (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
4809 sequences.
4810 * macro.c (stringify_arg): Handle CPP_UTF8STRING.
4811
96c169e1
JJ
48122009-10-14 Jakub Jelinek <jakub@redhat.com>
4813
4814 PR preprocessor/41543
4815 * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
4816 * line-map.c (linemap_init): Initialize highest_location and
4817 highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
4818
30c99a9e
JM
48192009-10-09 Jason Merrill <jason@redhat.com>
4820
4821 * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
4822
2214382c
NV
48232009-10-09 Neil Vachharajani <nvachhar@google.com>
4824
4825 * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
4826 sccs.
4827
e02222d2
LR
48282009-09-23 Loren J. Rittle <ljrittle@acm.org>
4829
4830 * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
4831 * configure: Rebuilt.
4832
9a8a2b7a
RG
48332009-09-22 Richard Guenther <rguenther@suse.de>
4834
4835 PR pch/38987
4836 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
4837
74dc6a11
CD
48382009-09-18 Chris Demetriou <cgd@google.com>
4839
4840 PR preprocessor/28435:
4841 * include/cpplib.h (struct cpp_options): Add new member
4842 deps.need_preprocessor_output.
4843 * files.c (open_file_failed): If preprocessor output is needed
4844 always report an error.
4845
933608b7
KT
48462009-09-13 Kai Tietz <kai.tietz@onevision.com>
4847
4848 * configure.ac: Set for i?86-w64-mingw*
4849 need_64bit_hwint to yes.
4850 * configure: Regenerated.
4851
86373e7e
JM
48522009-09-10 Jason Merrill <jason@redhat.com>
4853
4854 * directives.c (cpp_define): constify.
4855
fd2ab214
ILT
48562009-09-02 Ian Lance Taylor <iant@google.com>
4857
4858 * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
4859
df58e648
RW
48602009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4861
4862 * configure.ac (AC_PREREQ): Bump to 2.64.
4863
5213506e
RW
48642009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4865
4866 * aclocal.m4: Regenerate.
4867 * config.in: Regenerate.
4868 * configure: Regenerate.
4869
709a22df
TT
48702009-08-17 Tom Tromey <tromey@redhat.com>
4871
4872 PR preprocessor/41067:
4873 * charset.c (convert_escape): Add missing ":" to error text.
4874
0c539b47
DR
48752009-07-27 Douglas B Rupp <rupp@gnat.com>
4876
4877 * include/cpplib.h (INO_T_CPP): New macro.
4878 (struct cpp_dir): Use it.
4879
2b69c841
JQ
48802009-07-20 Jerry Quinn <jlquinn@optonline.net>
4881
4882 PR regression/40800
4883 * configure.ac: Use = instead of == for testing
4884 ENABLE_BUILD_WITH_CXX.
4885 * configure: Rebuild.
4886
f1bf410c
JQ
48872009-07-17 Jerry Quinn <jlquinn@optonline.net>
4888
4889 * directives.c (do_linemarker, do_line): Use CPP_STRING for
4890 ignored enum value.
4891 * files.c (find_file_in_dir): Add cast from void* to char*.
4892 * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
4893 * Makefile.in: (WARN_CFLAGS): Use general and C-specific
4894 warnings.
4895 (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
4896 ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
4897 COMPILER_FLAGS): New.
4898 (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
4899 (COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS
4900 instead of ALL_CFLAGS.
4901 * configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings
4902 from other warnings. Add -Wc++-compat to C-specific warnings.
4903 Check for --enable-build-with-cxx. Set and substitute
4904 ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES
4905 according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before
4906 AC_CHECK_HEADERS.
4907 * configure: Rebuild.
4908 * include/cpp-id-data.h: Remove extern "C".
4909 * include/line-map.h: Likewise.
4910 * include/mkdeps.h: Likewise.
4911 * include/symtab.h: Likewise.
4912 * internal.h: Likewise.
4913
a28fbdba
MLI
49142009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4915
4916 * directives.c (parse_include): Add location argument. Update all
4917 calls.
4918 (parse_answer): Likewise.
4919 (do_include_common): Error with exact location.
4920 (parse_assertion): Likewise.
4921
b506a5a2
MLI
49222009-06-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
4923
4924 * expr.c (num_div_op): Take explicit location.
4925
7d8847a4
ILT
49262009-06-17 Ian Lance Taylor <iant@google.com>
4927
4928 * include/cpplib.h (progname): Don't declare.
4929
3d8b2a98
ILT
49302009-06-12 Ian Lance Taylor <iant@google.com>
4931
4932 * include/cpplib.h (struct cpp_options): Add
4933 warn_cxx_operator_names field.
4934 (NODE_WARN_OPERATOR): Define.
4935 (struct cpp_hashnode): Increase flags field to 10 bits, decrease
4936 type to 6 bits.
4937 * init.c (mark_named_operators): Add flags parameter.
4938 (cpp_post_options): Pick flags value to pass to
4939 mark_named_operators.
4940 * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
4941 identifier is an operator name in C++.
4942
e74fe492
AH
49432009-06-01 Aldy Hernandez <aldyh@redhat.com>
4944
4945 * include/line-map.h (LAST_SOURCE_COLUMN): New.
4946
4851089f
ILT
49472009-06-01 Ian Lance Taylor <iant@google.com>
4948
4949 * include/cpp-id-data.h: Add extern "C".
4950 * include/line-map.h: Likewise.
4951 * include/mkdeps.h: Likewise.
4952 * include/symtab.h: Likewise.
4953 * internal.h: Likewise.
4954
7e5487a2
ILT
49552009-05-15 Ian Lance Taylor <iant@google.com>
4956
4957 * include/cpplib.h (enum cpp_builtin_type): Rename from enum
4958 builtin_type. Change all uses.
4959
00b0c19b
MLI
49602009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4961
4962 PR cpp/36674
4963 * directives (do_linemarker): Compensate for the increment in
4964 location that occurs when we reach the end of line.
4965 * files (_cpp_stack_include): Mention _cpp_find_file in the
4966 comment.
4967
9a0c6187
JM
49682009-05-10 Joseph Myers <joseph@codesourcery.com>
4969
4970 * include/cpplib.h (enum cpp_token_fld_kind): Add
4971 CPP_TOKEN_FLD_TOKEN_NO.
4972 (struct cpp_macro_arg, struct cpp_identifier): Define.
4973 (union cpp_token_u): Use struct cpp_identifier for identifiers.
4974 Use struct cpp_macro_arg for macro arguments. Add token_no for
4975 CPP_PASTE token numbers.
4976 * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
4977 do_pragma_poison, parse_assertion): Use val.node.node in place of
4978 val.node.
4979 * expr.c (parse_defined, eval_token): Use val.node.node in place
4980 of val.node.
4981 * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
4982 cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
4983 cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
4984 place of val.arg_no. Use val.node.node in place of val.node.
4985 * macro.c (replace_args, cpp_get_token, parse_params,
4986 lex_expansion_token, create_iso_definition, cpp_macro_definition):
4987 Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
4988 Use val.node.node in place of val.node.
4989
9e322bc1
JM
49902009-05-03 Joseph Myers <joseph@codesourcery.com>
4991
4992 * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
4993 UTF-8 sequences.
4994
f88d0772
JM
49952009-04-25 Joseph Myers <joseph@codesourcery.com>
4996
4997 PR preprocessor/39559
4998 * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
4999 constants larger than intmax_t in C99 mode.
5000
d1b38208
TG
50012009-04-21 Taras Glek <tglek@mozilla.com>
5002
5003 * include/cpp-id-data.h: Update GTY annotations to new syntax.
5004 * include/cpplib.h: Likewise.
5005 * include/line-map.h: Likewise.
5006 * include/symtab.h: Likewise.
5007
cfc93532
MLI
50082009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5009
5010 PR c++/14875
5011 * lex.c (cpp_type2name): Take a flags parameter. Call
5012 cpp_named_operator2name for named operators and cpp_digraph2name
5013 for digraphs.
5014 (cpp_digraph2name): New.
5015 (cpp_spell_token): Use it.
5016 (cpp_output_token): Likewise.
5017 * include/cpplib.h (cpp_type2name): Update declaration.
5018 * init.c (cpp_named_operator2name): New.
5019 * internal.h (cpp_named_operator2name): Declare.
5020
9c650d90
MLI
50212009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5022
5023 PR c++/13358
5024 * init.c (cpp_create_reader): Wlong_long is disabled by default.
5025 * expr.c (cpp_classify_number): Give different messages for C and
5026 C++ front-ends.
5027
aa508502
JM
50282009-04-19 Joseph Myers <joseph@codesourcery.com>
5029
5030 PR preprocessor/20078
5031 * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
5032 field.
5033 * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
5034 (struct cpp_token): Change flags to unsigned short.
5035 * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
5036 (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
5037 (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
5038 tokens.
5039 * macro.c (macro_real_token_count): New.
5040 (enter_macro_context, replace_args): Use macro_real_token_count.
5041 (create_iso_definition): Record whitespace surrounding and digraph
5042 spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
5043 Set extra_tokens and save CPP_PASTE tokens with arg_no set for
5044 multiple consecutive ## tokens.
5045 (_cpp_create_definition): Initialize extra_tokens.
5046 (cpp_macro_definition): Use macro_real_token_count.
5047
61cc8223
JM
50482009-04-18 Joseph Myers <joseph@codesourcery.com>
5049
5050 * directives.c (parse_include): Pass true to check_eol.
5051
c7f9c0b9
JM
50522009-04-18 Joseph Myers <joseph@codesourcery.com>
5053
5054 PR preprocessor/39646
5055 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
5056 * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
5057 * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
5058 place of LC_RENAME.
5059
a5cb563b
JM
50602009-04-18 Joseph Myers <joseph@codesourcery.com>
5061
5062 PR preprocessor/39647
5063 * directives.c (check_eol): Add parameter expand.
5064 (do_undef, parse_include, do_line, do_linemarker, do_ident,
5065 do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
5066 do_else, do_endif, do_assert, do_unassert): All callers changed.
5067 Pass true from do_line, false elsewhere.
5068
18f41a1b
JM
50692009-04-12 Joseph Myers <joseph@codesourcery.com>
5070
5071 PR preprocessor/31869
5072 * macro.c (stringify_arg): Handle NULL source token in padding
5073 token where previous padding token did not have source token with
5074 preceding whitespace.
5075
748086b7
JJ
50762009-04-09 Jakub Jelinek <jakub@redhat.com>
5077
5078 * Makefile.in: Change copyright header to refer to version
5079 3 of the GNU General Public License and to point readers at the
5080 COPYING3 file and the FSF's license web page.
5081 * charset.c: Likewise.
5082 * directives-only.c: Likewise.
5083 * directives.c: Likewise.
5084 * errors.c: Likewise.
5085 * expr.c: Likewise.
5086 * files.c: Likewise.
5087 * identifiers.c: Likewise.
5088 * include/cpp-id-data.h: Likewise.
5089 * include/cpplib.h: Likewise.
5090 * include/line-map.h: Likewise.
5091 * include/mkdeps.h: Likewise.
5092 * include/symtab.h: Likewise.
5093 * init.c: Likewise.
5094 * internal.h: Likewise.
5095 * lex.c: Likewise.
5096 * line-map.c: Likewise.
5097 * macro.c: Likewise.
5098 * makeucnid.c: Likewise.
5099 * mkdeps.c: Likewise.
5100 * pch.c: Likewise.
5101 * symtab.c: Likewise.
5102 * system.h: Likewise.
5103 * traditional.c: Likewise.
5104 * ucnid.tab: Likewise.
5105 * ucnid.h: Regenerate.
5106
eec49116
JJ
51072009-04-01 Janis Johnson <janis187@us.ibm.com>
5108
839a3b8a
JJ
5109 PR c/39027
5110 * include/cpplib.h (CPP_N_DEFAULT): Define.
5111 * expr.c (interpret_float_suffix): Recognize d or D for double,
5112 return new value for default.
5113 (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
5114
eec49116
JJ
5115 PR c/33466
5116 * expr.c (interpret_float_suffix): Reject invalid suffix that uses
5117 letters from decimal float and fixed-point suffixes.
5118
47580d22
JM
51192009-03-31 Joseph Myers <joseph@codesourcery.com>
5120
5121 PR preprocessor/15638
5122 * files.c (_cpp_find_file): Call open_file_failed after diagnosing
5123 invalid PCH.
5124 (open_file_failed): Make error for missing file fatal.
5125 * include/cpplib.h (CPP_DL_FATAL): Define.
5126
5a2df0fa
SV
51272009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net>
5128
5129 PR preprocessor/31932:
5130 * internal.h: Don't mention HAVE_ICONV_H.
5131 * configure, config.in: Rebuild.
5132 * configure.ac: Don't check for iconv.h.
5133
c1a8a3c6
TT
51342009-03-30 Tom Tromey <tromey@redhat.com>
5135
5136 PR preprocessor/39512:
5137 * line-map.c (linemap_init): Initialize 'reallocator' field.
5138
a37a7b8a
JJ
51392009-03-30 Jakub Jelinek <jakub@redhat.com>
5140
5141 PR target/39558
5142 * macro.c (cpp_get_token): If macro_to_expand returns NULL
5143 and used some tokens, add CPP_PADDING before next token.
5144
148e4216
JM
51452009-03-29 Joseph Myers <joseph@codesourcery.com>
5146
5147 PR preprocessor/34695
5148 * makedepend.c: Remove.
5149 * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
5150 (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
5151 * directives.c (cpp_errors): Remove.
5152 * errors.c (print_location, _cpp_begin_message, v_message):
5153 Remove.
5154 (cpp_error, cpp_error_with_line): Always use error callback.
5155 (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
5156 * include/cpplib.h (cpp_options): Remove pedantic_errors,
5157 inhibit_warnings, warn_system_headers, inhibit_errors,
5158 warnings_are_errors, client_diagnostic.
5159 (cpp_callbacks): Add extra arguments to error callback; make it
5160 return bool.
5161 (cpp_finish): Return void.
5162 (cpp_destroy): Remove inaccurate comment about return value.
5163 (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
5164 (CPP_DL_NOTE): Define.
5165 * include/line-map.h (linemap_print_containing_files): Remove.
5166 * init.c (cpp_finish): Do not check for or return number of
5167 errors.
5168 * internal.h (cpp_reader): Remove errors field.
5169 * line-map.c (linemap_print_containing_files): Remove.
5170 * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
5171 about previous definition. Only emit it if previous diagnostic
5172 was emitted.
5173
f1450211
JM
51742009-03-28 Joseph Myers <joseph@codesourcery.com>
5175
5176 * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
5177 mkinstalldirs.
5178
8f5929e1
JJ
51792009-03-18 Jakub Jelinek <jakub@redhat.com>
5180
5181 * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
5182
4bb09c26
JM
51832009-02-21 Joseph Myers <joseph@codesourcery.com>
5184
5185 * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
5186 header name.
5187 (_cpp_lex_direct): Handle this.
5188
68c9ab45
RG
51892009-02-15 Richard Guenther <rguenther@suse.de>
5190
5191 Revert last change.
5192
601b3e1a
RG
51932009-02-13 Richard Guenther <rguenther@suse.de>
5194
5195 * configure.ac: Enable LFS.
5196 * configure: Re-generate.
5197 * config.in: Likewise.
5198
fc0cd180
BE
51992009-01-05 Ben Elliston <bje@au.ibm.com>
5200
5201 * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
5202 (.po.pox): Likewise.
5203 (po/$(PACKAGE).pot): Likewise.
5204
db89a3be
AO
52052008-12-10 Alexandre Oliva <aoliva@redhat.com>
5206
5207 PR target/37033
5208 * pch.c (cpp_valid_state): Improve message for poisoned symbols.
5209 Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
5210
cc955282
JM
52112008-11-29 Joseph Myers <joseph@codesourcery.com>
5212
5213 * lex.c (cpp_token_len): Use 6 as default length.
5214
47960aaf
MLI
52152008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org>
5216
5217 * expr.c (struct op): Add location.
5218 (_cpp_parse_expr): Propagate locations throught the stack
5219 of expressions.
5220 (reduce): Likewise.
5221 (check_promotion): Use explicit location in errors.
5222
631d0d36
MG
52232008-10-05 Matthew Gingell <gingell@adacore.com>
5224 Arnaud Charlet <charlet@adacore.com>
5225
5226 * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
5227 (cpp_get_comments): New function.
5228 * internal.h (struct cpp_reader): Add comments field.
5229 * init.c (cpp_destroy): Free comments.
5230 * lex.c (store_comment, cpp_get_comments): New functions.
5231 (comments): New struct.
5232 (save_comment): Store comments in comments struct.
5233
c047ce93
SB
52342008-09-18 Simon Baldwin <simonb@google.com>
5235
5236 * include/cpplib.h (struct cpp_options): Add new boolean flag
5237 warn_builtin_macro_redefined.
5238 * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
5239 * (struct builtin_operator): Split out from previous struct builtin,
5240 enhance extra const correctness.
5241 * (struct builtin_macro): Split out from previous struct builtin, add
5242 new always_warn_if_redefined flag, enhance const correctness.
5243 * (mark_named_operators): Use struct builtin_operator.
5244 * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
5245 to builtins selectively.
5246 * macro.c (warn_of_redefinition): Return false if a builtin macro
5247 is not flagged with NODE_WARN.
5248
affa55c6
JJ
52492008-07-31 Jakub Jelinek <jakub@redhat.com>
5250
5251 PR preprocessor/36649
5252 * files.c (struct report_missing_guard_data): New type.
5253 (report_missing_guard): Put paths into an array instead of printing
5254 them right away. Return 1 rather than 0.
5255 (report_missing_guard_cmp): New function.
5256 (_cpp_report_missing_guards): Sort and print paths gathered by
5257 report_missing_guard callback.
5258
3b8f20a1
MLI
52592008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5260
5261 PR 28079
5262 * directives.c (strtolinenum): Handle overflow.
5263 (do_line): Give a warning if line number overflowed.
5264 (do_linemarker): Update call to strtolinenum.
5265
1bb64668
MLI
52662008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5267
5268 * include/line-map.h (linenum_type): New typedef.
5269 (struct line_map): Use it.
5270 (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
5271 (SOURCE_COLUMN): Likewise.
5272 * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
5273 source_location values in a variable of type linenum_type.
5274 * directives.c (struct if_stack): Use linenum_type.
5275 (strtoul_for_line): Rename as strtolinenum.
5276 (do_line): Use linenum_type.
5277 (do_linemarker): Use linenum_type and strtolinenum.
5278 (_cpp_do_file_change): Use linenum_t.
5279 * line-map.c (linemap_add): Likewise.
5280 (linemap_line_start): Likewise.
5281 * traditional.c (struct fun_macro): 'line' is a source_location.
5282 * errors.c (print_location): Use linenum_type.
5283 * directives-only.c (_cpp_preprocess_dir_only): Likewise.
5284 * internal.h (CPP_INCREMENT_LINE): Likewise.
5285 * lex.c (_cpp_skip_block_comment): Use source_location.
19a9ba64 5286
5950c3c9
BE
52872008-07-14 Ben Elliston <bje@au.ibm.com>
5288
5289 * include/cpplib.h (NODE_CONDITIONAL): New.
5290 (struct cpp_callbacks): New macro_to_expand field.
5291 (struct cpp_hashnode): Adjust size of flags and type fields.
5292 (cpp_peek_token): Prototype.
5293 * lex.c (cpp_peek_token): New function.
5294 (_cpp_temp_token): Protect pre-existing lookaheads.
5295 * macro.c (cpp_get_token): Expand any conditional macros.
5296 (_cpp_backup_tokens_direct): New.
5297 (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
5298 (warn_of_redefinition): Silently allow redefined conditional
5299 macros.
5300 (_cpp_create_definition): Remove the conditional flag when a user
5301 defines one of the conditional macros.
5302 * internal.h (_cpp_backup_tokens_direct): New prototype.
5303
e85edc9e
AH
53042008-06-13 Andrew Haley <aph@redhat.com>
5305
5306 PR preprocessor/33305
5307 * macro.c (replace_args): Print a warning for empty macro
5308 arguments in C89 and C++.
5309
18c04407
RW
53102008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5311
5312 * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
5313 * configure: Regenerate.
5314
2d09b640
RW
53152008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5316
5317 * Makefile.in (datarootdir): New variable.
5318
0b7c73cc
L
53192008-06-12 H.J. Lu <hongjiu.lu@intel.com>
5320
5321 PR preprocessor/36479
5322 * charset.c (cpp_interpret_string_notranslate): Also set
5323 narrow_cset_desc.width.
5324
cd985f66
JM
53252008-06-07 Joseph Myers <joseph@codesourcery.com>
5326
5327 * configure.ac (parisc*64*-*-*): Remove.
5328 * configure: Regenerate.
5329
d750887f
TT
53302008-05-30 Tom Tromey <tromey@redhat.com>
5331
5332 PR preprocessor/36320:
5333 * internal.h (_cpp_parse_expr): Update.
5334 * expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error
5335 messages.
5336 * directives.c (do_if): Update.
5337 (do_elif): Require expression if processing group.
5338
c100de59
DS
53392008-05-30 Danny Smith <dannysmith@users.sourceforge.net>
5340
5341 * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
5342
5d6342eb
TT
53432008-05-21 Tom Tromey <tromey@redhat.com>
5344
5345 PR preprocessor/27777:
5346 * lex.c (cpp_output_line_to_string): New function.
5347 * internal.h (_cpp_begin_message): Don't declare.
5348 * errors.c (_cpp_begin_message): Now static.
5349 * include/cpplib.h (cpp_output_line_to_string): Declare.
5350 * directives.c (do_diagnostic): Rewrote. Use
5351 cpp_output_line_to_string. Don't use _cpp_begin_message.
5352
dae4174e
TT
53532008-05-21 Tom Tromey <tromey@redhat.com>
5354
5355 * include/symtab.h (HT_ALLOCED): Remove.
5356 (ht_purge): Declare.
5357 * symtab.c (DELETED): New define.
5358 (ht_lookup): Update comment.
5359 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED
5360 code. Use subobject allocator for strings, if it exists.
5361 (ht_expand): Handle deleted entries.
5362 (ht_forall): Likewise.
5363 (ht_purge): New function.
5364 (ht_dump_statistics): Print deletion statistics.
5365
899015a0
TT
53662008-05-13 Tom Tromey <tromey@redhat.com>
5367
5368 PR preprocessor/22168:
5369 * include/cpplib.h (struct cpp_options) <objc>: Update
5370 documentation.
5371 * expr.c (eval_token): Warn for use of assertions.
5372 * directives.c (directive_diagnostics): Warn about extensions.
5373 (DEPRECATED): New define.
5374 (DIRECTIVE_TABLE): Use it.
5375
71c10038
TT
53762008-05-06 Tom Tromey <tromey@redhat.com>
5377
5378 PR preprocessor/35313, PR preprocessor/36088:
5379 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
5380 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
5381
2bd0fe3d
DM
53822008-05-04 David S. Miller <davem@davemloft.net>
5383
5384 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
5385 * configure: Regenerate.
5386
28f68625
DF
53872008-04-22 Daniel Franke <franke.daniel@gmail.com>
5388
5389 * include/cpplib.h (cpp_define_formatted): New.
5390 * directives.c (cpp_define_formatted): New.
5391
688e7a53
TT
53922008-04-21 Tom Tromey <tromey@redhat.com>
5393
5394 PR libcpp/33415:
5395 * charset.c (_cpp_convert_input): Add buffer_start argument.
5396 Ignore UTF-8 BOM if seen.
5397 * internal.h (_cpp_convert_input): Add argument.
5398 * files.c (struct _cpp_file) <buffer_start>: New field.
5399 (destroy_cpp_file): Free buffer_start, not buffer.
5400 (_cpp_pop_file_buffer): Likewise.
5401 (read_file_guts): Update.
5402
b6baa67d
KVH
54032008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
5404
5405 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
5406 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
5407 (struct cpp_options): Added uliterals.
5408 (cpp_interpret_string): Update prototype.
5409 (cpp_interpret_string_notranslate): Idem.
5410 * charset.c (init_iconv_desc): New width member in cset_converter.
5411 (cpp_init_iconv): Add support for char{16,32}_cset_desc.
5412 (convert_ucn): Idem.
5413 (emit_numeric_escape): Idem.
5414 (convert_hex): Idem.
5415 (convert_oct): Idem.
5416 (convert_escape): Idem.
5417 (converter_for_type): New function.
5418 (cpp_interpret_string): Use converter_for_type, support u and U prefix.
5419 (cpp_interpret_string_notranslate): Match changed prototype.
5420 (wide_str_to_charconst): Use converter_for_type.
5421 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
5422 * directives.c (linemarker_dir): Macro U changed to UC.
5423 (parse_include): Idem.
5424 (register_pragma_1): Idem.
5425 (restore_registered_pragmas): Idem.
5426 (get__Pragma_string): Support CPP_STRING{16,32}.
5427 * expr.c (eval_token): Support CPP_CHAR{16,32}.
5428 * init.c (struct lang_flags): Added uliterals.
5429 (lang_defaults): Idem.
5430 * internal.h (struct cset_converter) <width>: New field.
5431 (struct cpp_reader) <char16_cset_desc>: Idem.
5432 (struct cpp_reader) <char32_cset_desc>: Idem.
5433 * lex.c (digraph_spellings): Macro U changed to UC.
5434 (OP, TK): Idem.
5435 (lex_string): Add support for u'...', U'...', u"..." and U"...".
5436 (_cpp_lex_direct): Idem.
5437 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
5438 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
5439
deb984e6
PB
54402008-04-18 Paolo Bonzini <bonzini@gnu.org>
5441
5442 PR bootstrap/35457
5443 * aclocal.m4: Regenerate.
5444 * configure: Regenerate.
5445
bf048bea
TT
54462008-04-17 Tom Tromey <tromey@redhat.com>
5447
5448 PR libcpp/34866:
5449 * errors.c (cpp_error): Don't reference a token before the start
5450 of the current run.
5451
7f27b0f8
TT
54522008-04-16 Tom Tromey <tromey@redhat.com>
5453
5454 * Makefile.in (TAGS_SOURCES): New variable.
5455 (TAGS): New target.
5456
a1fcb9a1
KK
54572008-04-11 Kaz Kojima <kkojima@gcc.gnu.org>
5458
5459 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
5460 and shbe-*-*.
5461 * configure: Rebuilt.
5462
93d45d9e
JM
54632008-04-02 Joseph Myers <joseph@codesourcery.com>
5464
5465 * include/cpplib.h (struct cpp_callbacks): Add used_define,
5466 used_undef and before_define.
5467 (NODE_USED): Define.
5468 * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
5469 do_ifndef, cpp_pop_definition): Handle new flag and use new
5470 callbacks.
5471 * expr.c (parse_defined): Handle new flag and use new callbacks.
5472 * macro.c (enter_macro_context, _cpp_free_definition): Handle new
5473 flag and use new callbacks.
5474
d4c32e1d
JJ
54752008-04-01 Jakub Jelinek <jakub@redhat.com>
5476
5477 PR pch/13675
5478 * files.c (struct _cpp_file): Remove pch field.
5479 (pch_open_file): Don't set file->pch, just file->pchname.
5480 (should_stack_file): After pfile->cb.read_pch call
5481 free pchname and clear pchname, don't close file->fd.
5482 Test file->pchname instead of file->pch. Don't close fd after cb.
5483 (_cpp_stack_include): Test file->pchname instead of file->pch.
5484
161031e3
TT
54852008-03-28 Tom Tromey <tromey@redhat.com>
5486
5487 * Makefile.in (POSTCOMPILE): New variable.
5488 (.c.o): Use it.
5489
14ccf800
TT
54902008-03-13 Tom Tromey <tromey@redhat.com>
5491
5492 PR libcpp/35322:
5493 * directives.c (destringize_and_run): Set pfile->directive.
5494
830465c6
MM
54952008-03-06 Markus Milleder <markus.milleder@generali.at>
5496
5497 PR preprocessor/35458
5498 * mkdeps.c (munge): Quote '#' with a '\'.
5499
d482a073
RW
55002008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5501
5502 PR preprocessor/35379
5503 * mkdeps.c (deps_write): Ensure the first target always appears
5504 in the first column, without leading backslash newline. Avoid
5505 some more extra whitespace.
5506
185a6cc1
TS
55072008-02-25 Thiemo Seufer <ths@mips.com>
5508
d482a073 5509 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
185a6cc1 5510
2bf41bf0
TT
55112008-02-19 Tom Tromey <tromey@redhat.com>
5512
5513 * traditional.c (lex_identifier): Use CPP_HASHNODE.
5514 * lex.c (lex_identifier): Use CPP_HASHNODE.
5515 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
5516 do-while.
5517 * identifiers.c (alloc_node): Change return type.
5518 (_cpp_init_hashtable): Don't cast 'alloc_node'.
5519 (proxy_assertion_broken): New declaration.
5520 (cpp_forall_identifiers): Move comment.
5521 * line-map.c (linemap_add): Comment fix.
5522 (linemap_line_start): Indentation fix.
5523
765d600a
JJ
55242008-01-25 Jakub Jelinek <jakub@redhat.com>
5525
5526 PR preprocessor/34692
5527 * macro.c (collect_args): Add pragma_buff argument. Push
5528 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
5529 than into arguments. Reset prevent_expansion and parsing_args
5530 state at CPP_PRAGMA_EOL/CPP_EOF.
5531 (funlike_invocation_p): Add pragma_buff argument, pass it through
5532 to collect_args.
5533 (enter_macro_context): Add result argument. Adjust
5534 funlike_invocation_p caller. Emit all deferred pragma tokens
5535 gathered during collect_args before the expansion, add a padding
5536 token. Return 2 instead of 1 if any pragma tokens were prepended.
5537 (cpp_get_token): If enter_macro_context returns 2, don't return
5538 a padding token, instead cycle to grab CPP_PRAGMA token.
5539 * directives.c (_cpp_handle_directive): If was_parsing_args
5540 in deferred pragma, leave parsing_args and prevent_expansion as is.
5541
ec46053b
TT
55422008-01-22 Tom Tromey <tromey@redhat.com>
5543
765d600a 5544 PR c++/34859
ec46053b
TT
5545 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
5546 __STDC_CONSTANT_MACROS.
5547
681c6ab0
FF
55482008-01-07 Fred Fish <fnf@specifix.com>
5549
765d600a 5550 PR preprocessor/30363
681c6ab0 5551 * traditional.c (replace_args_and_push): Add local variable
19a9ba64 5552 cxtquote, calculate the replacement text size assuming a
681c6ab0
FF
5553 worst case of every input character quoted with backslash,
5554 and properly handle output quoting of quote characters in
5555 actual arguments used in function-like macros.
5556
33ae4837
TT
55572008-01-03 Tom Tromey <tromey@redhat.com>
5558
765d600a 5559 PR preprocessor/34602
33ae4837
TT
5560 * directives.c (do_line): Don't try to spell EOF token.
5561 (do_linemarker): Add comment.
5562
675575f5
DD
55632007-12-11 DJ Delorie <dj@redhat.com>
5564
5565 * charset.c (convert_using_iconv): Close out any shift states,
5566 returning to the initial state.
5567
97f6bd40
TT
55682007-12-06 Tom Tromey <tromey@redhat.com>
5569
765d600a 5570 PR c/29172
97f6bd40
TT
5571 * internal.h (struct cpp_reader) <file_hash_entries>: Changed
5572 type.
5573 <file_hash_entries_allocated, file_hash_entries_used>: Removed.
5574 * files.c (FILE_HASH_POOL_SIZE): New macro.
5575 (struct file_hash_entry_pool): New.
5576 (destroy_all_cpp_files): New function.
5577 (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
5578 (new_file_hash_entry): Update.
5579 (free_file_hash_entries): New function.
5580 (_cpp_cleanup_files): Call free_file_hash_entries and
5581 destroy_all_cpp_files.
5582 (cpp_clear_file_cache): New function.
5583 * include/cpplib.h (cpp_clear_file_cache): Declare.
5584
d56a25e1
TT
55852007-12-03 Tom Tromey <tromey@redhat.com>
5586
765d600a 5587 PR preprocessor/34288
d56a25e1
TT
5588 * configure.ac, config.in: Rebuilt.
5589 * configure.ac: Check for ssize_t.
5590
607f74e9
TT
55912007-11-30 Tom Tromey <tromey@redhat.com>
5592
765d600a 5593 PR preprocessor/32868
607f74e9
TT
5594 * macro.c (_cpp_create_definition): Special case
5595 __STDC_FORMAT_MACROS.
5596
b0f4807f
MM
55972007-11-16 Michael Matz <matz@suse.de>
5598
5599 * files.c (search_path_head): Fix check for absolute paths.
5600
f1e20710
TT
56012007-11-11 Tom Tromey <tromey@redhat.com>
5602
765d600a 5603 PR c++/17557
f1e20710
TT
5604 * include/cpplib.h (cpp_included_before): Declare.
5605 * files.c (struct file_hash_entry) <location>: New field.
5606 (_cpp_find_file): Initialize new field.
5607 (make_cpp_dir): Likewise.
5608 (cpp_included_before): New function.
5609
f373b44d
TT
56102007-11-01 Tom Tromey <tromey@redhat.com>
5611
765d600a 5612 PR preprocessor/30805
f373b44d
TT
5613 * macro.c (paste_tokens): Handle padding token.
5614 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
5615
5b9a40df
TT
56162007-10-31 Tom Tromey <tromey@redhat.com>
5617
765d600a 5618 PR preprocessor/30786
5b9a40df
TT
5619 * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
5620 * directives.c (_cpp_do__Pragma): Return error status.
5621 * internal.h (_cpp_do__Pragma): Update.
5622 * directives.c (get__Pragma_string): Back up if EOF seen.
5623
5ffeb913
TT
56242007-09-06 Tom Tromey <tromey@redhat.com>
5625
5626 * internal.h (struct cpp_reader) <invocation_location>: New
5627 field.
5628 (struct cpp_reader) <set_invocation_location>: Likewise.
5629 * init.c (cpp_set_line_map): New function.
5630 * line-map.c (linemap_add): Use linemap's allocator.
5631 * include/line-map.h (GTY): Define.
5632 (line_map_realloc): New typedef.
5633 (struct line_map): Mark with GTY.
5634 (struct line_maps): Likewise.
5635 (struct line_maps) <maps>: Likewise.
5636 (struct line_maps) <reallocator>: New field.
5637 * include/symtab.h (GTY): Conditionally define.
5638 * include/cpplib.h (cpp_set_line_map): Declare.
5639 (cpp_get_token_with_location): Declare.
5640 * macro.c (cpp_get_token): Set invocation_location on the reader.
5641 (cpp_get_token_with_location): New function.
5642
ac6b1c67
CF
56432007-08-30 Chao-ying Fu <fu@mips.com>
5644
5645 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
5646 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
5647 (cpp_classify_number): Support decimal fixed-point constants without
5648 exponents.
5649 Warn about fixed-point constants when -pedantic.
5650 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
5651 comments to support fixed-point values.
5652 (CPP_N_FRACT, CPP_N_ACCUM): Define.
5653
cda5e672
TT
56542007-08-18 Tom Tromey <tromey@redhat.com>
5655
765d600a 5656 PR preprocessor/32974
cda5e672
TT
5657 * directives.c (parse_include): Don't check for EOL when
5658 processing #pragma dependency.
5659
ccfc4c91
OW
56602007-07-30 Ollie Wild <aaw@google.com>
5661
5662 * directives-only.c: New file.
5663 * internal.h (struct _cpp_dir_only_callbacks): New.
5664 (_cpp_preprocess_dir_only): New function.
5665 * directives.c (_cpp_handle_directive): Check directives_only before
5666 disabling execution of indented directives.
5667 * files.c (_cpp_stack_file): Add directives_only check.
5668 * include/cpplib.h (struct cpp_options): Add directives_only.
5669 (cpp_init_special_builtins): New function.
5670 * init.c (cpp_init_special_builtins): New function.
5671 (cpp_init_builtins): Move builtin_array initialization to
5672 cpp_init_special_builtins.
5673 (post_options): Check directives_only before setting
5674 pfile->state.prevent_expansion = 1.
5675 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
5676 is expanded inside a directive while -fdirectives-only is enabled.
5677 * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
5678 (libcpp_a_SOURCES): Add directives-only.c.
5679
a206413a
UB
56802007-07-04 Uros Bizjak <ubizjak@gmail.com>
5681
5682 * traditional.c (_cpp_scan_out_logical_line): Initialize
5683 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
5684 fmacro.args to prevent 'may be used uninitialized' warning.
5685
c77cd3d1
UB
56862007-07-03 Uros Bizjak <ubizjak@gmail.com>
5687
5688 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
5689 Add new constants.
5690 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
5691 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
5692 for 'q' or 'Q' suffixes.
5693
66938a1d
DS
56942007-06-17 Danny Smith <dannysmith@users.sourceforge.net
5695
e1311401 5696 * files.c (open_file): Correct typo.
66938a1d 5697
71995ede
VP
56982007-06-16 Vladimir Prus <vladimir@codesourcery.com>
5699
e1311401 5700 * files.c (open_file): Prevent the call
71995ede
VP
5701 for stat from overwriting errno.
5702
84152c25
VP
57032007-06-09 Vladimir Prus <vladimir@codesourcery.com>
5704
e1311401 5705 * files.c (open_file): Account for the
19a9ba64
AM
5706 fact that on windows, opening a directory gives
5707 EACCES.
84152c25 5708
f7fd775f
JW
57092007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
5710
5711 PR preprocessor/23479
5712 * expr.c (cpp_classify_number): Implement 0b-prefixed binary
5713 integer constants.
5714 (append_digit): Likewise.
5715 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
5716 binary integer constants.
5717
ed0e74e0
DK
57182007-05-31 Dave Korn <dave.korn@artimi.com>
5719
5720 PR preprocessor/14331
5721 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
5722
a702045a
OW
57232007-05-24 Ollie Wild <aaw@google.com>
5724
5725 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
5726 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
5727 (cpp_write_pch_state): Save __COUNTER__ state.
5728 (cpp_valid_state): Check valid __COUNTER__ state.
5729 (cpp_read_state): Read new __COUNTER__ state.
5730 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
5731 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
5732 * internal.h (struct cpp_reader): Add counter member.
5733
126e073b
SM
57342007-05-23 Simon Martin <simartin@users.sourceforge.net>
5735
5736 PR preprocessor/20077
5737 * macro.c (create_iso_definition): Fixed the method to determine
5738 whether the token-pasting operator appears at the beginning or the end
5739 of a macro.
5740
0b4cafec
ILT
57412007-05-21 Ian Lance Taylor <iant@google.com>
5742
5743 * internal.h (struct cpp_reader): Add new fields:
5744 nonexistent_file_hash and nonexistent_file_ob.
5745 * files.c: Include "obstack.h".
5746 (find_file_in_dir): Before trying to open the file, look up the
5747 path name in the hash table of nonexistent files. After failing
5748 to open the file, add the path name to the hash table.
5749 (_cpp_find_file): Cache the results of looking up the file name
5750 starting with the quote and bracket chain heads, if we can.
5751 (nonexistent_file_hash_eq): New static function.
5752 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
5753 pfile->nonexistent_file_ob.
5754 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
5755 pfile->nonexistent_file_ob.
5756
30e04921
JJ
57572007-05-14 Janis Johnson <janis187@us.ibm.com>
5758
19a9ba64 5759 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
5a6bb57e 5760
30e04921
JJ
5761 PR c/31924
5762 * expr.c (interpret_float_suffix): Check for invalid suffix.
5763
22a8a52d
EC
57642007-05-02 Eric Christopher <echristo@apple.com>
5765
5766 * expr.c (num_div_op): Don't overflow if the result is
5767 zero.
5768
fca35e1b
TT
57692007-05-02 Tom Tromey <tromey@redhat.com>
5770
765d600a 5771 PR preprocessor/28709
fca35e1b
TT
5772 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
5773
4cd97075
MM
57742007-03-30 Michael Meissner <michael.meissner@amd.com>
5775
5776 * directives.c (lex_macro_node_from_str): Fix alloca call to be
5777 type correct.
5778
121de39f
RH
57792007-03-30 Richard Henderson <rth@redhat.com>
5780
5781 * directives.c (lex_macro_node_from_str): New.
5782 (cpp_push_definition, cpp_pop_definition): New.
5783 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
5784
4fcb360b
BM
57852007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
5786
5787 * Makefile.in: Add dummy install-pdf target.
5788
67e64439
TT
57892007-01-30 Tom Tromey <tromey@redhat.com>
5790
765d600a 5791 PR preprocessor/30468
67e64439
TT
5792 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
5793 './'.
5794
ee380365
TT
57952007-01-30 Tom Tromey <tromey@redhat.com>
5796
765d600a 5797 PR preprocessor/29966
ee380365
TT
5798 * macro.c (lex_expansion_token): Save and restore cpp_reader's
5799 cur_token.
5800 (_cpp_create_definition): Don't restore cur_token here.
5801 * lex.c (_cpp_lex_token): Added assertion.
5802
024abeb3
TT
58032007-01-27 Tom Tromey <tromey@redhat.com>
5804
5805 * configure: Rebuilt.
5806
ee1c2a10
TT
58072007-01-12 Tom Tromey <tromey@redhat.com>
5808
765d600a 5809 PR preprocessor/28227
ee1c2a10
TT
5810 * directives.c (lex_macro_node): Added 'is_def_or_undef'
5811 argument.
5812 (do_define): Update.
5813 (do_undef): Update.
5814 (do_ifdef): Update.
5815 (do_ifndef): Update.
5816
67214c16
PB
58172007-01-11 Paolo Bonzini <bonzini@gnu.org>
5818
5819 * configure: Regenerate.
5820
1aa6ca40
PB
58212007-01-11 Paolo Bonzini <bonzini@gnu.org>
5822
5823 * configure: Regenerate.
5824
705e2d28
TT
58252007-01-04 Tom Tromey <tromey@redhat.com>
5826
765d600a 5827 PR preprocessor/28165
705e2d28
TT
5828 * internal.h (cpp_in_primary_file): New function.
5829 * directives.c (do_include_next): Use cpp_in_primary_file.
5830 (do_pragma_once): Likewise.
5831 (do_pragma_system_header): Likewise.
5832
7af45bd4
ILT
58332006-12-29 Ian Lance Taylor <iant@google.com>
5834
5835 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
5836 look backward at the end of the line unless we saw a backslash.
5837
9d30f270
JJ
58382006-12-29 Jakub Jelinek <jakub@redhat.com>
5839
5840 PR preprocessor/29612
5841 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
5842 only when new_sysp is non-zero.
5843
30b0edc0
TT
58442006-12-28 Tom Tromey <tromey@redhat.com>
5845
765d600a 5846 PR preprocessor/30001
30b0edc0
TT
5847 * charset.c (_cpp_convert_input): Check that to.len is greater
5848 than zero.
5849
85d9c13c
TS
58502006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
5851
5852 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
83cc06b2 5853 * configure: Rebuilt.
85d9c13c 5854
dfafdaa6
DG
58552006-11-01 Douglas Gregor <doug.gregor@gmail.com>
5856
5857 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
5858 for experimental C++0x mode.
5859 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
5860 adopted the preprocessor changes introduced in C99.
5861
0f45f0f5
JM
58622006-10-29 Joseph Myers <joseph@codesourcery.com>
5863
5864 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
5865 depending on --enable-targets=all.
5866 * configure: Regenerate.
5867
de000d22
JJ
58682006-10-12 Jakub Jelinek <jakub@redhat.com>
5869
5870 PR preprocessor/28709
5871 * macro.c (paste_tokens): Do error reporting here, use BUF with the
5872 spelled LHS token as opposed to spelling it again.
5873 (paste_all_tokens): Don't report errors here, just break on failure.
5874
b5422ad7
BM
58752006-10-10 Brooks Moses <bmoses@stanford.edu>
5876
5877 * Makefile.in: Added empty "pdf" target.
5878
aaf50ff2
GK
58792006-09-22 Geoffrey Keating <geoffk@apple.com>
5880
5881 * configure.ac: Make need_64_bit_hwint case for x86-darwin
5882 match exactly the glob in gcc/config.gcc.
5883 * configure: Regenerate.
5884
c663e301
JM
58852006-09-13 Joseph S. Myers <joseph@codesourcery.com>
5886
5887 PR c/28768
5888 PR preprocessor/14634
5889 * lex.c (lex_string): Pedwarn for unterminated literals.
5890
f7288899
EC
58912006-09-08 Eric Christopher <echristo@apple.com>
5892
5893 * configure.ac: Add 64-bit HWI support for i?86-darwin.
5894
b52dbbf8
SE
58952006-08-14 Steve Ellcey <sje@cup.hp.com>
5896
5897 PR c++/28288
5898 PR c++/14556
5899 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
5900 (CPP_LAST_EQ): Change.
5901 (CPP_LAST_PUNCTUATOR): Change.
5902 * expr.c (cpp_operator): Remove MIN and MAX.
5903 (reduce): Remove CPP_MIN and CPP_MAX.
5904 (num_binary_op): Ditto.
5905 * lex.c (_cpp_lex_direct): Ditto.
5906 (cpp_avoid_paste): Remove ? as legal symbol after > or <.
5907
1c90c6f9
JJ
59082006-06-09 Jakub Jelinek <jakub@redhat.com>
5909
5910 PR preprocessor/27746
5911 * directives.c (do_pragma): Handle pragma with valid namespace
5912 and invalid name coming from macro expansion.
5913 * directives.c (destringize_and_run): Initialize next field in
5914 context.
5915
5916 PR c/27747
5917 PR c++/27748
5918 * directives.c (destringize_and_run): Set NO_EXPAND on the
5919 tokens.
5920
5921 * macro.c (_cpp_backup_tokens): Fix comment typo.
5922
5c3c3683
DJ
59232006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
5924
5925 * Makefile.in (CATALOGS): Add po/ prefix.
5926 * configure: Regenerated.
5927
b2bd74bc
CD
59282006-05-23 Carlos O'Donell <carlos@codesourcery.com>
5929
5930 * Makefile.in: Add install-html target. Add install-html to .PHONY
5931
be8ac3e2
GZ
59322006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
5933
5934 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
5935 * files.c (_cpp_get_file_stat): New function.
5936 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
5937 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
5938 * internal.h (_cpp_get_file_stat): Prototype.
5939 (struct cpp_buffer): Add timestamp.
5940
83900997
JJ
59412006-01-23 Jakub Jelinek <jakub@redhat.com>
5942
5943 PR preprocessor/25717
5944 * init.c (cpp_init_builtins): If __STDC__ will not change value
5945 between system headers and other sources, define it as a normal
5946 macro rather than a builtin.
5947 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
5948 cpp_in_system_header condition.
5949
59502006-01-05 Paolo Bonzini <bonzini@gnu.org>
9220c30c
PB
5951
5952 * Makefile.in: Use -MMD instead of -MD.
5953
bc4071dd
RH
59542006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
5955 Richard Henderson <rth@redhat.com>
5956
5957 Merge from gomp branch:
5958 * directives.c (struct pragma_entry): Add is_deferred. Add ident
5959 entry to value union.
5960 (end_directive): Don't eat the line if in_deferred_pragma.
5961 (run_directive): Remove pragma hacks.
5962 (insert_pragma_entry): Remove.
5963 (new_pragma_entry): New.
5964 (register_pragma_1): Split out of register_pragma. Only handle
5965 the lookup tree and return the new entry.
5966 (cpp_register_pragma): Fill in the pragma entry here.
5967 (cpp_register_deferred_pragma): New.
5968 (register_pragma_internal): New.
5969 (_cpp_init_internal_pragmas): Use register_pragma_internal.
5970 (do_pragma): Allow pragma expansion after namespace. For deferred
5971 pragmas, don't slurp the line into a string.
5972 (destringize_and_run): Save tokens for deferred pragmas.
5973 (cpp_handle_deferred_pragma): Remove.
5974 * macro.c (builtin_macro): Remove pragma token hack.
5975 (_cpp_push_token_context): Rename from push_token_context and export.
5976 * internal.h (struct lexer_state): Add pragma_allow_expansion.
5977 (_cpp_push_token_context): Declare.
5978 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
5979 a token. Update the line number correctly if so.
5980 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
5981 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
5982 * include/cpplib.h (PRAGMA_EOL): New.
5983 (CPP_TOKEN_FLD_PRAGMA): New.
5984 (struct cpp_token): Add val.pragma.
5985 (struct cpp_options): Remove defer_pragmas.
5986 (cpp_handle_deferred_pragma): Remove.
5987 (cpp_register_deferred_pragma): Declare.
5988
d09e893f
JJ
59892006-01-01 Jakub Jelinek <jakub@redhat.com>
5990
5991 PR c++/25294
5992 * directives.c (do_pragma): If pragma line ends with multi-line
5993 block comment, end the saved deferred pragma string before that
5994 comment. Handle embedded '\0' chars on the pragma line.
5995
ab84748a
VR
59962005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
5997
5998 PR c++/23333
5999 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
6000
ad6ed77e
JG
60012005-12-07 Jon Grimm <jgrimm2@us.ibm.com>
6002 Ben Elliston <bje@au.ibm.com>
6003
6004 * include/cpplib.h (CPP_N_DFLOAT): New.
6005 * expr.c (interpret_float_suffix): Identify df, dd, and dl
6006 suffixes as decimal floating point constants.
6007 (cpp_classify_number): Disallow hexadecimal DFP constants.
6008
ba096620 60092005-11-14 Gerald Pfeifer <gerald@pfeifer.com>
bc4071dd 6010 Ian Lance Taylor <ian@airs.com>
ba096620
GP
6011
6012 * include/cpplib.h (struct cpp_callbacks): Annotate error with
6013 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
6014
456b8ce5
UB
60152005-11-09 Per Bothner <per@bothner.com>
6016 Uros Bizjak <uros@kss-loka.si>
f7288899 6017
456b8ce5
UB
6018 PR c/24101
6019 * init.c (read_original_filename): Temporarily set
6020 state.in_directive before calling _cpp_lex_direct for
6021 CPP_HASH tokens.
6022
5571f74f
JW
60232005-11-03 James E Wilson <wilson@specifix.com>
6024
6025 PR preprocessor/24202
6026 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
6027
a63607ed
JM
60282005-11-04 Joseph S. Myers <joseph@codesourcery.com>
6029
6030 * include/cpplib.h (struct cpp_callbacks): Make error take
6031 va_list* parameter.
6032 * errors.c (cpp_error): Update call to callback.
6033
651ed942
AP
60342005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
6035
6036 PR preprocessor/22042
6037 * macro.c (_cpp_builtin_macro_text): Lower the needed max
6038 buffer size.
6039 (cpp_quote_string): Don't octalify non printable
6040 charactors.
6041
178b58b5
JM
60422005-11-03 Joseph S. Myers <joseph@codesourcery.com>
6043
6044 PR c++/17964
6045 * include/cpplib.h (struct cpp_options): Add client_diagnostic.
6046 (struct cpp_callbacks): Add error.
6047 * errors.c (cpp_error): If client_diagnostic, use error callback.
6048 * charset.c (convert_escape): Don't use %03o in diagnostic.
6049
3ee5ed11 60502005-10-21 James E Wilson <wilson@specifix.com>
6568f34b
JW
6051
6052 PR preprocessor/15220
6053 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all
6054 callers. Pass to open_file_failed.
6055 (open_file_failed): New parameter angle_brackets. Fix all callers.
6056 Use in print_dep assignment.
6057 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
6058 * internal.h (_cpp_find_file): Add new parm to declaration.
f7288899 6059
077fc835
KH
60602005-10-08 Kazu Hirata <kazu@codesourcery.com>
6061
6062 * configure.ac: Require 64-bit int for arm*-*-*eabi*.
6063 * configure: Regenerate.
6064
cbc43ae0
ILT
60652005-10-04 Ian Lance Taylor <ian@airs.com>
6066
6067 PR preprocessor/13726
6068 * directives.c (check_eol_return_comments): New static function.
6069 (parse_include): Add buf parameter. Change all callers.
6070 (do_include_common): If not discard comments, turn on
6071 save_comments. Pass collected comments to include callback.
6072 * include/cpplib.h (struct cpp_callbacks): Add new parameter to
6073 include callback: cpp_token list.
6074
af15a2fe
JM
60752005-09-20 Joseph S. Myers <joseph@codesourcery.com>
6076
6077 * include/cpplib.h (struct cpp_options): Add extended_identifiers.
6078 * init.c (struct lang_flags, lang_defaults): Add
6079 extended_identifiers.
6080 (cpp_set_lang): Use it.
6081 * lex.c (forms_identifier_p): Check extended_identifiers.
6082
f5eab47e
JJ
60832005-08-30 Jakub Jelinek <jakub@redhat.com>
6084
6085 PR preprocessor/20348
6086 PR preprocessor/20356
6087 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
6088 2004-06-05 changes.
6089
467129e6
KG
60902005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6091
6092 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
6093 -Wmissing-format-attribute.
6094
6095 * configure: Regenerate.
6096
200031d1
KC
60972005-06-29 Kelley Cook <kcook@gcc.gnu.org>
6098
6099 * all files: Update FSF address in copyright headers.
6100 * makeucnid.c (write_copyright): Update outputted FSF address.
6101
f610dd5f
ZW
61022005-06-13 Zack Weinberg <zack@codesourcery.com>
6103
6104 * configure.ac: Invoke ZW_CREATE_DEPDIR and
6105 ZW_PROG_COMPILER_DEPENDENCIES.
6106 * aclocal.m4, configure: Regenerate.
6107 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
6108 New variables.
6109 (distclean): Clean up $(DEPDIR) and its contents.
6110 (.c.o): Use $(COMPILE).
6111 Include $(DEPDIR)/*.Po for most object->header dependencies.
6112
c3f829c1
GDR
61132005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
6114
6115 * configure.ac: Check declarations for asprintf and vasprintf.
6116 * config.in: Regenerate.
6117 * configure: Likewise.
6118
6119 * charset.c (conversion_loop): Use XRESIZEVEC.
6120 (convert_no_conversion): Likewise.
6121 (convert_using_iconv): Likewise.
6122 (init_iconv_desc): Cast return value of alloca.
6123 (cpp_host_to_exec_charset): Use XNEWVEC.
6124 (emit_numeric_escape): Use XRESIZEVEC.
6125 (cpp_interpret_string): Use XNEWVEC.
6126 (cpp_interpret_string): Use XRESIZEVEC.
6127 (_cpp_interpret_identifier): Cast return value of alloca.
6128 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
6129 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
6130 (parse_include): Use XNEWVEC.
6131 (insert_pragma_entry): Rename local variable "new" to
f610dd5f 6132 "new_entry".
c3f829c1
GDR
6133 (save_registered_pragmas): Cast return value of xmemdup.
6134 (destringize_and_run): Same for alloca.
6135 (parse_assertion): Likewise.
6136 (do_assert): Cast allocated storage to proper type.
6137 (cpp_define): Likewise.
6138 (_cpp_define_builtin): Likewise.
6139 (cpp_undef): Likewise.
6140 (handle_assertion): Likewise.
6141 (cpp_push_buffer): Rename local variable "new" to "new_buffer".
6142 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
6143 (CPP_UMINUS): Likewise.
6144 (struct cpp_operator): Rename from struct operator.
6145 (_cpp_expand_op_stack): Use XRESIZEVEC.
6146 * files.c (pch_open_file): Use XNEWVEC.
6147 (pch_open_file): Use XRESIZEVEC.
6148 (read_file_guts): Use XNEWVEC and XRESIZEVEC.
6149 (dir_name_of_file): Use XNEWVEC.
6150 (make_cpp_file): Use XCNEW.
6151 (make_cpp_dir): Likewise.
6152 (allocate_file_hash_entries): USE XNEWVEC.
6153 (cpp_included): Cast return value of htab_find_with_hash.
6154 (append_file_to_dir): Use XNEWVEC.
6155 (read_filename_string): Likewise. Use XRESIZEVEC too.
6156 (read_name_map): Cast return value of alloca. Use XRESIZEVEC.
6157 (remap_filename): Use XNEWVEC.
6158 (struct pchf_entry): Move definition out of struct pchf_data.
6159 (_cpp_save_file_entries): Use XCNEWVAR.
6160 (_cpp_read_file_entries): Use XNEWVAR.
6161 * identifiers.c (alloc_node): Use XOBNEW.
6162 * init.c (cpp_create_reader): Use XCNEW.
6163 (cpp_init_builtins): Cast of b->value to enum builtin_type.
6164 (read_original_directory): Cast return value of alloca.
6165 * lex.c (add_line_note): Use XRESIZEVEC.
6166 (warn_about_normalization): Use XNEWVEC.
6167 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
6168 (new_buff): Use XNEWVEC.
6169 * line-map.c (linemap_add): Use XRESIZEVEC.
6170 * macro.c (builtin_macro): Cast return value of alloca.
6171 (paste_tokens): Likewise.
6172 (expand_arg): Use XNEWVEC and XRESIZEVEC.
6173 (_cpp_save_parameter): Use XRESIZEVEC.
6174 (create_iso_definition): Cast allocated storage to proper type.
6175 (_cpp_create_definition): Likewise.
6176 (cpp_macro_definition): Use XRESIZEVEC.
6177 * makedepend.c (add_clm): Use XNEW.
6178 (add_dir): Likewise.
6179 * mkdeps.c (munge): Use XNEWVEC.
6180 (deps_init): Use XCNEW.
6181 (deps_add_target): Use XRESIZEVEC.
6182 (deps_add_default_target): Cast return value of alloca.
6183 (deps_add_dep): Use XRESIZEVEC.
6184 (deps_add_vpath): Likewise. Use XNEWVEC too.
6185 (deps_restore): Likewise.
6186 * pch.c (save_idents): Use XNEW and XNEWVEC.
6187 (cpp_save_state): Use XNEW.
6188 (count_defs): Cast return value of htab_find.
6189 (write_defs): Likewise.
6190 (cpp_write_pch_deps): Use XNEWVEC.
6191 (collect_ht_nodes): Use XRESIZEVEC.
6192 (cpp_valid_state): Use XNEWVEC.
6193 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup.
6194 * symtab.c (ht_create): Use XCNEW.
6195 (ht_lookup_with_hash): Cast return value of obstack_copy0.
6196 (ht_expand): Use XCNEWVEC.
6197 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
6198 (bool): Do not define if __cplusplus.
6199
1ed17cd5
ZW
62002005-05-12 Zack Weinberg <zack@codesourcery.com>
6201
6202 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
6203 (do_sccs): Delete function definition, #define to do_ident.
6204 (do_ident): Don't hardwire directive name.
6205
5a8c20ce
RK
62062005-05-12 Ryota Kunisawa <kunisawa@access.co.jp>
6207
6208 PR bootstrap/21230
6209 * configure: Regenerate.
6210
473c5bc9
AP
62112005-04-27 Andris Pavenis <pavenis@latnet.lv>
6212
6213 * files.c: Include io.h for DJGPP to get prototype of setmode.
6214
c1fc5047
PB
62152005-04-19 Per Bothner <per@bothner.com>
6216
6217 PR preprocessor/20907
6218 * line-map.c (linemap_line_start): Fix bug when we need to increse
6219 column_bits but can re-use the current line_map.
6220
042630ad
KG
62212005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6222
6223 * system.h (fopen, fdopen, freopen): Define these to the unlocked
6224 libiberty functions.
6225
0d667716
KG
62262005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6227
6228 * configure.ac (libcpp_UNLOCKED_FUNCS): New.
6229 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
6230 * system.h (putchar, getc, getchar, clearerr, feof, fileno,
6231 fflush, fgetc, fgets, ferror, fread): Redefine to the associated
6232 _unlocked function.
6233 (fwrite_unlocked): Fix prototype.
1ed17cd5 6234
0d667716
KG
6235 * configure, config.in: Regenerate.
6236
cae064e7
JJ
62372005-04-05 Jakub Jelinek <jakub@redhat.com>
6238
6239 PR preprocessor/19475
6240 * macro.c (create_iso_definition): For < ISO C99, don't
6241 pedwarn if there is no whitespace between macro name and its
6242 replacement, but the replacement starts with a basic character
6243 set character.
6244
cbada204
AJ
62452005-03-28 Andreas Jaeger <aj@suse.de>
6246
6247 * lex.c (warn_about_normalization): Cast field width to int to
6248 avoid warning.
6249
f42eccdb
JM
62502005-03-19 Joseph S. Myers <joseph@codesourcery.com>
6251
6252 * configure.ac: Consistently use solaris2.1[0-9]* instead of
6253 solaris2.1[0-9].
6254 * configure: Regenerate.
6255
c79e602b
GK
62562005-03-15 Geoffrey Keating <geoffk@apple.com>
6257
6258 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
6259 UCN rather than printing an error.
6260
50668cf6
GK
62612005-03-14 Geoffrey Keating <geoffk@apple.com>
6262
6baba9bb
GK
6263 * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
6264
62652005-03-14 Geoffrey Keating <geoffk@apple.com>
1ed17cd5 6266
50668cf6
GK
6267 * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
6268 * charset.c: Update for new format of ucnid.h.
6269 (ucn_valid_in_identifier): Update for new format of ucnid.h.
6270 Add NST parameter, and update it; update callers.
6271 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort
6272 with cpp_error.
6273 (convert_ucn): Pass normalize_state to cpp_valid_ucn.
6274 * internal.h (struct normalize_state): New.
6275 (INITIAL_NORMALIZE_STATE): New.
6276 (NORMALIZE_STATE_RESULT): New.
6277 (NORMALIZE_STATE_UPDATE_IDNUM): New.
6278 (_cpp_valid_ucn): New.
6279 * lex.c (warn_about_normalization): New.
6280 (forms_identifier_p): Add normalize_state parameter, update callers.
6281 (lex_identifier): Add normalize_state parameter, update callers. Keep
6282 the state current.
6283 (lex_number): Likewise.
6284 (_cpp_lex_direct): Pass normalize_state to subroutines. Check
6285 it with warn_about_normalization.
6286 * makeucnid.c: New.
6287 * ucnid.h: Replace.
6288 * ucnid.pl: Remove.
6289 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove
6290 comments about obsolete version of C++.
6291 * include/cpplib.h (enum cpp_normalize_level): New.
6292 (struct cpp_options): Add warn_normalize field.
6293
47e20491
GK
62942005-03-11 Geoffrey Keating <geoffk@apple.com>
6295
6296 * directives.c (glue_header_name): Update call to cpp_spell_token.
6297 * internal.h (_cpp_interpret_identifier): New.
6298 * charset.c (_cpp_interpret_identifier): New.
6299 (_cpp_valid_ucn): Allow UCN version of '$'.
6300 * lex.c (lex_identifier): Add extra parameter to indicate if initial
6301 character was '$' or '\'. Support identifiers with UCNs.
6302 (forms_identifier_p): Allow UCNs.
6303 (_cpp_lex_direct): Pass extra parameter to lex_identifier.
6304 (utf8_to_ucn): New.
6305 (cpp_spell_token): Add FORSTRING parameter. Use it.
6306 (cpp_token_as_text): Update call to cpp_spell_token.
6307 (cpp_output_token): Write UCNs back out.
6308 (stringify_arg): Update call to cpp_spell_token.
6309 (paste_tokens): Likewise.
6310 (cpp_macro_definition): Likewise.
6311 * macro.c (stringify_arg): Likewise.
6312 (paste_tokens): Likewise.
6313 (cpp_macro_definition): Likewise.
6314 * include/cpplib.h: Add parameter to cpp_spell_token.
6315
73096711
JJ
63162005-03-04 Jakub Jelinek <jakub@redhat.com>
6317
6318 PR bootstrap/20282
6319 PR bootstrap/20305
6320 * macro.c (replace_args, cpp_get_token): Copy whole
6321 cpp_token_u instead of just cpp_string field from it.
6322
2203a881
DP
63232005-02-28 Devang Patel <dpatel@apple.com>
6324
6325 * directives.c (do_line): Save sysp early before line table is
6326 realloc'ed.
1ed17cd5 6327
c5ff069d
ZW
63282005-02-20 Zack Weinberg <zack@codesourcery.com>
6329
6330 PR 18785
6331 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
6332 (cpp_host_to_exec_charset): New function.
6333 * include/cpplib.h: Declare cpp_host_to_exec_charset.
6334
04c90eea
DP
63352005-02-19 Devang Patel <dpatel@apple.com>
6336
6337 * charset.c (_cpp_convert_input): Check '\r' before inserting
6338 '\n' at the end.
c5ff069d 6339
6da55c00
EC
63402005-02-15 Eric Christopher <echristo@redhat.com>
6341
6342 PR preprocessor/19077
6343 * macro.c (cpp_macro_definition): Move handling of whitespace
6344 to PREV_WHITE conditional. Remove overloading of len
6345 variable.
6346
31c3e631
KH
63472005-02-14 Kazu Hirata <kazu@cs.umass.edu>
6348
6349 * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
6350 traditional.c: Update copyright.
6351
be0f1e54
PB
63522005-02-14 Paolo Bonzini <bonzini@gnu.org>
6353
6354 PR bootstrap/19818
6355 * configure.ac: Check for declaration of basename and getopt.
6356 * config.in: Regenerate.
6357 * configure: Regenerate.
6358 * internal.h (ustrcspn): New.
6359 * macro.c (create_iso_definition): Fix allocation of memory.
6360 (padding_token): Add cast to remove const-ness.
6361 * pch.c (cpp_read_state): Use ustrcspn.
6362
ecddfb39
MS
63632005-02-08 Mike Stump <mrs@apple.com>
6364
6365 * files.c (pchf_adder): Remove.
6366 (struct pchf_adder_info): Likewise.
6367 (_cpp_save_file_entries): Write out all files so that #import works.
6368
9fcdd891
JM
63692005-01-23 Joseph S. Myers <joseph@codesourcery.com>
6370
6371 * configure: Regenerate.
6372
ecfd72e7
TS
63732005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
6374
6375 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
6376
6c25a4f7 6377 * include/cpplib.h: Also update copyright years.
c5ff069d 6378
942926ad
GK
63792005-01-03 Geoffrey Keating <geoffk@apple.com>
6380
6381 * files.c (_cpp_find_file): Add files found by search_path_exhausted
6382 to the list of all files.
6383
a2566ae9
GDR
63842005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
6385
6386 * internal.h: Update references to Cpp lib filenames.
6387 * directives.c: Likewise.
6388 * init.c: Likewise.
6389 * macro.c: Likewise.
6390 * traditional.c: Likewise.
6391
1b449375
EB
63922004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
6393
6394 PR preprocessor/15167
6395 * files.c (destroy_cpp_file): New function.
6396 (should_stack_file): Make a new file if the
6397 compared file is still stacked.
6398
28303828
NN
63992004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
6400
c5ff069d 6401 PR preprocessor/17610
28303828
NN
6402 * directives.c (do_include_common): Error out if an empty filename
6403 is given for #include (or #include_next or #import).
6404
c812785a
RS
64052004-11-27 Roger Sayle <roger@eyesopen.com>
6406 Zack Weinberg <zack@codesourcery.com>
6407
6408 * internal.h: Replace all uses of uchar with unsigned char.
6409 * include/cpp-id-data.h: Likewise. Guard typedef of uchar
6410 with !IN_GCC, so uchar is only defined whilst building libcpp.
6411
f91eaa01
KC
64122004-11-24 Kelley Cook <kcook@gcc.gnu.org>
6413
6414 * aclocal.m4: Regenerate.
6415
f78ce0c2
RS
64162004-11-24 Roger Sayle <roger@eyesopen.com>
6417
6418 PR preprocessor/15824
6419 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
6420 directly, instead of the non-existant "system.h" and "ansidecl.h".
6421 * configure: Regenerate.
6422
b5b3e36a 64232004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
c5ff069d 6424 Joseph Myers <joseph@codesourcery.com>
b5b3e36a
DJ
6425
6426 * internal.h (struct lexer_state): Add in_deferred_pragma.
6427 * directives.c (struct pragma_entry): Add allow_expansion.
6428 (insert_pragma_entry): Take allow_expansion flag.
6429 (register_pragma): Likewise.
6430 (cpp_register_pragma): Likewise.
6431 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
6432 (do_pragma): Honor allow_expansion.
6433 (cpp_handle_deferred_pragma): Set in_deferred_pragma.
6434 * include/cpplib.h (cpp_register_pragma): Update prototype.
6435
a8e68029 64362004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
c5ff069d 6437 Mark Mitchell <mark@codesourcery.com>
a8e68029
DJ
6438
6439 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
6440 need_64bit_hwint=yes.
6441 * configure: Regenerate.
6442
50f47ee0
JM
64432004-11-09 Joseph S. Myers <joseph@codesourcery.com>
6444
6445 * Makefile.in ($(PACKAGE).pot): New rule. Depend on
6446 po/$(PACKAGE).pot.
6447 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
6448 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
6449 Remove local srcdir path from generated file.
6450
968e08d6 64512004-11-04 Zack Weinberg <zack@codesourcery.com>
c5ff069d 6452 Gerald Pfeifer <gerald@pfeifer.com>
968e08d6
ZW
6453
6454 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
6455 as well.
6456
3da3d587
ZW
64572004-10-27 Zack Weinberg <zack@codesourcery.com>
6458
6459 PR 18075
6460 * directives.c (do_pragma): Do not defer pragmas which are unknown.
6461 (cpp_handle_deferred_pragma): Add cast to silence warning.
6462
ac24fc25
JM
64632004-10-14 Joseph S. Myers <jsm@polyomino.org.uk>
6464
6465 * errors.c (_cpp_begin_message): Print "error: " for errors.
6466
7731405b
AJ
64672004-10-10 Andreas Jaeger <aj@suse.de>
6468
6469 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
6470 * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
6471
646544e3
AP
64722004-10-08 Andrew Pinski <pinskia@physics.uc.edu>
6473
6474 * pch.c (cpp_write_pch_state): Remove variable z as it is not
6475 used.
6476 (cpp_read_state): Remove unused variables, m, d and mac_count.
6477
67a74146
PB
64782004-09-29 Per Bothner <per@bothner.com>
6479
6480 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore
6481 cb.line_change. Otherwise do_pragma will call the line_change
6482 call-back with a meaningless line number.
6483
018a4785
ZW
64842004-09-24 Zack Weinberg <zack@codesourcery.com>
6485
6486 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
6487 programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
6488 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
6489 * aclocal.m4, configure: Regenerate.
6490 * init.c: Include localedir.h.
6491 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
6492 (DEFS): Delete.
6493 (.c.o): Use $(ALL_CFLAGS).
6494 (localedir.h, localedir.hs): New rules.
6495 (clean): Use rm -rf to remove directories.
6496 (distclean): Also delete localedir.h and localedir.hs.
6497 (init.o): Update dependencies.
6498
88fa57d7
KC
64992004-09-22 Kelley Cook <kcook@gcc.gnu.org>
6500
6501 * Makefile.in (aclocal.m4): Update dependencies.
6502 * configure.ac (AC_CONFIG_MACRO_DIR): New.
6503 * aclocal.m4, configure: Regenerate.
6504
8f8e9aa5
ZW
65052004-09-17 Zack Weinberg <zack@codesourcery.com>
6506
a29f62d9
ZW
6507 * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
6508 (_cpp_convert_input, _cpp_default_encoding): Add comments.
6509 Some other comments in this file also tweaked.
6510
8f8e9aa5
ZW
6511 * directives.c (do_pragma): Save current buffer position
6512 before lexing the pragma keywords; don't call
6513 _cpp_backup_tokens in the defer_pragmas case.
6514
a2981930
PB
65152004-09-15 Per Bothner <per@bothner.com>
6516
6517 * include/line-map.h (line_map_start): Add parameter names so
6518 preceding comment makes sense.
6519 (linemap_add): Remove from comment mention of non-existing parameter.
6520
21b11495
ZW
65212004-09-09 Matt Austern <austern@apple.com>
6522 Zack Weinberg <zack@codesourcery.com>
6523
6524 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
6525 prefixes throughout. Add entry for PRAGMA. Remove
6526 unnecessary "= 0" from EQ.
6527 (enum cpp_ttype): Adjust OP and TK definitions to restore
6528 prefixes, via token-paste.
6529 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
6530 Change from #defines to additional cpp_ttype enumerators.
6531 (struct cpp_options): Add defer_pragmas.
6532 (cpp_handle_deferred_pragma): Prototype new interface.
6533
6534 * internal.h (struct cpp_reader): Add directive_result.
6535 * directives.c (struct pragma_entry): Add is_internal field;
6536 give boolean fields type bool.
6537 (start_directive): Initialize pfile->directive_result.type.
6538 (_cpp_do__Pragma): Likewise.
6539 (run_directive): Do not crash if pfile->buffer->prev is NULL.
6540 (insert_pragma_entry): Add 'internal' argument; set new->is_internal
6541 from it.
6542 (register_pragma): New static function, bulk of former
6543 cpp_register_pragma here; add 'internal' argument, pass along
6544 to insert_pragma_entry.
6545 (cpp_register_pragma): Now a wrapper around register_pragma which
6546 always passes false for 'internal' argument.
6547 (_cpp_init_internal_pragmas): Call register_pragma directly, passing
6548 true for 'internal'.
6549 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
6550 an internal pragma, save text till the end of the line as a CPP_PRAGMA
6551 token instead of executing the pragma.
6552 (cpp_handle_deferred_pragma): New interface.
6553 * lex.c (token_spellings): Adjust OP and TK definitions to
6554 match changes to cpplib.h.
6555 (_cpp_lex_token): Check for a directive-result token and
6556 return it if present.
6557 (cpp_token_val_index): Handle CPP_PRAGMA.
6558 * macro.c (cpp_builtin_macro_text): Correct comment.
6559 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
6560
0fd9e8dd
SB
65612004-09-06 Serge Belyshev <belyshev@lubercy.com>
6562
6563 PR preprocessor/14699
6564 * symtab.c (ht_dump_statistics): Change type of sum_of_squares
6565 from size_t to double.
6566
39b8ce7f
AS
65672004-08-28 Andreas Schwab <schwab@suse.de>
6568 Andreas Jaeger <aj@suse.de>
6569
6570 * configure.ac: Set PACKAGE correctly.
6571 * configure: Regenerated.
6572
5d1f4b27
PB
65732004-08-25 Paolo Bonzini <bonzini@gnu.org>
6574
6575 * Makefile.in: Add back top_builddir.
6576
078e3ffe
PB
65772004-08-25 Paolo Bonzini <bonzini@gnu.org>
6578
6579 * configure.ac: Replace Automake macro invocations
6580 with manual Autoconf checks and substitutions.
6581 * configure: Regenerate.
6582 * aclocal.m4: Regenerate.
6583 * config.in: Regenerate.
6584 * Makefile.am: Removed.
6585 * Makefile.in: Heavy simplification and reorganization.
6586
b3f8d95d
MM
65872004-08-09 Mark Mitchell <mark@codesourcery.com>
6588
6589 * configure.ac (arm*-*-eabi*): New target.
6590 (arm*-*-symbianelf*): Likewise.
6591 * configure: Regenerated.
6592
72bb2c39
BI
65932004-07-24 Bernardo Innocenti <bernie@develer.com>
6594
6595 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
6596 * directives.c: Use XNEW-family macros from libiberty.
6597 * lex.c: Likewise.
6598 * macro.c: Likewise.
6599 * cpplib.h (cpp_deps_style): Export enum with name.
6600
21b11495 66012004-07-23 Matthias Klose <doko@debian.org>
72bb2c39 6602
21b11495 6603 * init.c (init_library): Use PACKAGE for the text domain.
85eac2a0 6604
a23ee064
AP
66052004-07-16 Andris Pavenis <pavenis@latnet.lv>
6606
6607 PR preprocessor/16366
6608 * internal.h (struct cpp_reader): New field dir_hash.
6609 * files.c (make_cpp_dir): Use dir_hash, not file_hash.
6610 (_cpp_init_files, _cpp_cleanup_files): Update for new field.
6611
a09d4744
NB
66122004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
6613
6614 PR preprocessor/16192
6615 PR preprocessor/15913
6616 PR preprocessor/15572
6617 * expr.c (_cpp_parse_expr): Handle remaining cases where an
6618 expression is missing.
6619 * init.c (post_options): Traditional cpp doesn't do // comments.
6620
f58f7def
PB
66212004-06-30 Per Bothner <per@bothner.com>
6622
6623 * include/line-map.h (fileline): Remove old typedef.
6624 * internal.h (struct cpp_reader): Use source_location typedef instead.
6625
e83d8d43
ZW
66262004-06-26 Zack Weinberg <zack@codesourcery.com>
6627
6628 Partially revert patch of 2004-06-05.
6629 * files.c (search_cache): Remove pfile argument. Don't check
6630 for file that would be found by "" or <> search here...
6631 (_cpp_find_file): ...do it here, before calling find_file_in_dir.
6632 Do not apply directory-of-current-file correction to files
6633 found by this check. Rearrange code slightly.
6634
c0d578e6
GK
66352004-06-21 Geoffrey Keating <geoffk@apple.com>
6636
6637 * files.c (should_stack_file): Correct swapped parameters to call
6638 to cb.read_pch.
6639 * pch.c (cpp_valid_state): Handle -fpreprocessed.
6640
159d5224
PB
66412004-06-15 Paolo Bonzini <bonzini@gnu.org>
6642
6643 * Makefile.in: Regenerate with automake 1.8.5.
6644 * aclocal.m4: Likewise.
6645 * configure: Regenerate.
6646
2fac9c01
ZW
66472004-06-11 Zack Weinberg <zack@codesourcery.com>
6648
6649 * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
6650 * configure, config.in: Regenerate.
6651 * system.h: Unconditionally define bool as unsigned char,
6652 BOOL_BITFIELD as unsigned int.
6653 * .cvsignore: New file.
6654
d8044160
GK
66552004-06-09 Geoffrey Keating <geoffk@apple.com>
6656
6657 * traditional.c (push_replacement_text): Set macro->traditional.
6658 (save_replacement_text): Likewise.
6659 * pch.c (cpp_write_pch_state): Don't write list of defined macros.
6660 (struct save_macro_item): Delete.
6661 (struct save_macro_data): Use a character array not the previous
6662 structured format.
6663 (save_macros): Save macro as text not as internal structures.
6664 (cpp_prepare_state): Update for changes to save_macro_data.
6665 (cpp_read_state): Don't read macros defined in PCH. Restore
2cf22451 6666 -D macros as text.
d8044160
GK
6667 * macro.c (create_iso_definition): Honour alloc_subobject.
6668 Clear traditional flag.
6669 (_cpp_create_definition): Honour alloc_subobject.
6670 * lex.c (cpp_token_val_index): New.
6671 * internal.h: Include cpp-id-data.h.
6672 (uchar): Move definition to cpp-id-data.h.
6673 (U): Likewise.
6674 (cpp_macro): Likewise.
6675 * directives.c (struct answer): Move to cpp-id-data.h.
6676 (do_assert): Honour alloc_subobject.
2cf22451
ZW
6677
6678 * include/symtab.h (struct ht): Add field 'alloc_subobject'.
6679 * include/cpplib.h (struct cpp_string): Add GTY marker.
6680 (enum cpp_token_fld_kind): New.
6681 (struct cpp_token): Add GTY markers.
6682 (cpp_token_val_index): Prototype.
6683 (CPP_HASHNODE_VALUE_IDX): New.
6684 (struct cpp_hashnode): Don't skip fields of 'value' when marking.
6685 * include/cpp-id-data.h: New file.
d8044160 6686
0ca8e815
PB
66872004-06-09 Paolo Bonzini <bonzini@gnu.org>
6688
6689 * Makefile.am (all-local): New.
6690 * Makefile.in: Regenerate.
6691
b51fa00f
RS
66922004-06-06 Roger Sayle <roger@eyesopen.com>
6693
6694 * Makefile.am (LIBICONV): Declare.
6695 (makedepend_LDADD): Use LIBICONV.
6696 * Makefile.in: Regenerate.
6697
5e2f3f39
AP
66982004-06-05 Andrew Pinski <pinskia@physics.uc.edu>
6699
6700 * Makefile.am (LIBINTL): Declare
6701 (makedepend_LDADD): Use LIBINTL.
6702 * Makefile.in: Regenerate.
6703
c6e83800
ZW
67042004-06-05 Zack Weinberg <zack@codesourcery.com>
6705
6706 * Makefile.am: Add makedepend.
6707 * Makefile.in, aclocal.m4: Regenerate.
6708 * charset.c: Insert a space to avoid a warning.
6709 * directives.c: Include mkdeps.h.
6710 (_cpp_handle_directive): Reenable macro expander if appropriate.
6711 (undefine_macros): Inline body of _cpp_free_definition for speed.
6712 Do not call undef callback or _cpp_warn_if_unused_macro.
6713 (cpp_get_deps): New interface.
6714 * files.c (search_cache): Add pfile argument. Check for file
6715 that would be found by "" or <> search here...
6716 (_cpp_find_file): ...not here. Correct recorded start_dir of
6717 files found by directory-of-current-file search that would be
6718 found by "" or <> search.
6719 * init.c (cpp_add_dependency_target): Delete.
6720 * internal.h (struct lexer_state): Add discarding_output flag.
6721 * lex.c (lex_identifier): Compute hash function while scanning.
6722 * macro.c (cpp_scan_nooutput): Disable macro expansion outside
6723 directives.
6724 * makedepend.c: New file.
6725 * mkdeps.c (struct deps): Add vpath vector.
6726 (apply_vpath, deps_add_vpath): New function.
6727 (deps_free): Free vpath vector.
6728 (deps_add_dep, deps_add_target): Use apply_vpath.
6729 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
6730 (ht_lookup_with_hash): New function.
6731 * cpplib.h, mkdeps.h: Update prototypes.
6732 * symtab.h: Update prototypes.
6733 (HT_HASHSTEP, HT_FINISH): New macros.
6734
b453c95f
GK
67352004-05-29 Geoffrey Keating <geoffk@apple.com>
6736
6737 * symtab.c (ht_create): Set entries_owned.
6738 (ht_destroy): Honour entries_owned.
6739 (ht_expand): Likewise.
6740 (ht_load): New.
2cf22451
ZW
6741 * include/symtab.h (struct ht): New field 'entries_owned'
6742 (ht_load): New prototype.
b453c95f 6743
963e23c5
PB
67442004-05-26 Paolo Bonzini <bonzini@gnu.org>
6745
6746 PR bootstrap/15651
6747 * configure.ac: Fix m4 quoting when picking
6748 the size of HOST_WIDE_INT.
6749 * configure: Regenerate.
6750
0429bc77
PB
67512004-05-25 Paolo Bonzini <bonzini@gnu.org>
6752
6753 * Makefile.am: the correct directory for
6754 gettext include files is given by @INCINTL@.
6755 * Makefile.in: Regenerate.
6756
c86dd7db
PB
67572004-05-24 Paolo Bonzini <bonzini@gnu.org>
6758
6759 * system.h [!ENABLE_NLS]: dgettext takes two
6760 parameters.
6761
4f4e53dd
PB
67622004-05-23 Paolo Bonzini <bonzini@gnu.org>
6763
6764 Moved libcpp from the gcc subdirectory to the toplevel.
6765 * Makefile.am: New file.
6766 * Makefile.in: Regenerate.
6767 * configure.ac: New file.
6768 * configure: Regenerate.
6769 * config.in: Regenerate.
6770 * charset.c: Moved from gcc/cppcharset.c. Add note about
6771 brokenness of input charset detection. Adjust for change
6772 in name of cppucnid.h.
6773 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
6774 * expr.c: Moved from gcc/cppexp.c.
6775 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
6776 Remove #define of O_BINARY, it is in system.h.
6777 * identifiers.c: Moved from gcc/cpphash.c.
6778 * internal.h: Moved from gcc/cpphash.h. Change header
6779 guard name. All other files adjusted to match name change.
6780 * init.c: Moved from gcc/cppinit.c.
6781 (init_library) [ENABLE_NLS]: Call bindtextdomain.
6782 * lex.c: Moved from gcc/cpplex.c.
6783 * directives.c: Moved from gcc/cpplib.c.
6784 * macro.c: Moved from gcc/cppmacro.c.
6785 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
6786 * traditional.c: Moved from gcc/cpptrad.c.
6787 * ucnid.h: Moved from gcc/cppucnid.h. Change header
6788 guard name.
6789 * ucnid.pl: Moved from gcc/cppucnid.pl.
6790 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header
6791 guard name.
6792 * symtab.c: Moved from gcc/hashtable.c.
6793 * line-map.c: Moved from gcc. Do not include intl.h.
6794 * mkdeps.c: Moved from gcc.
6795 * system.h: New file.
2cf22451
ZW
6796 * include/cpplib.h: Moved from gcc. Change header guard name.
6797 * include/line-map.h: Moved from gcc. Change header guard name.
6798 * include/mkdeps.h: Moved from gcc. Change header guard name.
6799 * include/symtab.h: Moved from gcc/hashtable.h. Change header
6800 guard name.
818ab71a 6801\f
c48514be 6802Copyright (C) 2004-2021 Free Software Foundation, Inc.
818ab71a
JJ
6803
6804Copying and distribution of this file, with or without modification,
6805are permitted in any medium without royalty provided the copyright
6806notice and this notice are preserved.