]> git.ipfire.org Git - thirdparty/gcc.git/blame - libcpp/ChangeLog
c++: spec_hasher and TYPENAME_TYPE resolution [PR95223]
[thirdparty/gcc.git] / libcpp / ChangeLog
CommitLineData
a641d6d3
NS
12020-05-18 Nathan Sidwell <nathan@acm.org>
2
7cf3f604
NS
3 * include/cpplib.h (cpp_get_otions, cpp_get_callbacks)
4 (cpp_get_deps): Mark as PURE.
5 * include/line-map.h (get_combined_adhoc_loc)
6 (get_location_from_adhoc_loc, get_pure_location): Reformat decls.
7 * internal.h (struct lexer_state): Clarify comment.
8 * system.h: Remove now-unneeded bool hackery.
9 * files.c (_cpp_find_file): Store LOC not highest_location.
10
ed63c387
NS
11 PR preprocessor/95149
12 * lex.c (struct lit_accum): New.
13 (bufring_append): Replace by lit_accum::append.
14 (lex_raw_string): Reimplement, using fragments of the old version.
15 (lex_string): Adjust lex_raw_string call.
16
a641d6d3
NS
17 PR preprocessor/95182
18 * macro.c (collect_args): Preserve EOFif we fell out of the main
19 file.
20 (cpp_get_token_1): Reformat a couple of short lines.
21
8d286dd1
L
222020-05-14 H.J. Lu <hongjiu.lu@intel.com>
23
24 * configure: Regenerated.
25
b04445d4
JM
262020-05-13 Jason Merrill <jason@redhat.com>
27
28 * include/cpplib.h (enum c_lang): Change CXX2A to CXX20.
29 * init.c, lex.c: Adjust.
30
2a0225e4
NS
312020-05-12 Nathan Sidwell <nathan@acm.org>
32
33 EOF location is at end of file
34 PR preprocessor/95013
35 * lex.c (lex_raw_string): Process line notes before incrementing.
36 Correct incrementing condition. Adjust for new
37 _cpp_get_fresh_line EOF behaviour.
38 (_cpp_get_fresh_line): Do not pop buffer at EOF, increment line
39 instead.
40 (_cpp_lex_direct): Adjust for new _cpp_get_fresh_line behaviour.
41 (cpp_directive_only_process): Assert we got a fresh line.
42 * traditional.c (_cpp_read_logical_line_trad): Adjust for new
43 _cpp_get_fresh_line behaviour.
44
051da742
L
452020-05-12 H.J. Lu <hongjiu.lu@intel.com>
46
47 * Makefile.in (CET_HOST_FLAGS): New.
48 (COMPILER): Add $(CET_HOST_FLAGS).
49 * configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and
50 AC_SUBST(CET_HOST_FLAGS). Clear CET_HOST_FLAGS if jit isn't
51 enabled.
52 * aclocal.m4: Regenerated.
53 * configure: Likewise.
54
b224c376
NS
552020-05-08 Nathan Sidwell <nathan@acm.org>
56
57 Reimplement directives only processing, support raw literals.
58 * directives-only.c: Delete.
59 * Makefile.in (libcpp_a_OBJS, libcpp_a_SOURCES): Remove it.
60 * include/cpplib.h (enum CPP_DO_task): New enum.
61 (cpp_directive_only_preprocess): Declare.
62 * internal.h (_cpp_dir_only_callbacks): Delete.
63 (_cpp_preprocess_dir_only): Delete.
64 * lex.c (do_peek_backslask, do_peek_next, do_peek_prev): New.
65 (cpp_directives_only_process): New implementation.
66
e235031d
JJ
672020-02-14 Jakub Jelinek <jakub@redhat.com>
68
69 Partially implement P1042R1: __VA_OPT__ wording clarifications
70 PR preprocessor/92319
71 * macro.c (expand_arg): Move declarations before vaopt_state
72 definition.
73 (class vaopt_state): Move enum update_type definition earlier. Remove
74 m_allowed member, add m_arg and m_update members.
75 (vaopt_state::vaopt_state): Change last argument from bool any_args
76 to macro_arg *arg, initialize m_arg and m_update instead of m_allowed.
77 (vaopt_state::update): When bumping m_state from 1 to 2 and m_update
78 is ERROR, determine if __VA_ARGS__ expansion has any non-CPP_PADDING
79 tokens and set m_update to INCLUDE if it has any, DROP otherwise.
80 Return m_update instead of m_allowed ? INCLUDE : DROP in m_state >= 2.
81 (replace_args, create_iso_definition): Adjust last argument to
82 vaopt_state ctor.
83
297aa668
MS
842020-02-05 Martin Sebor <msebor@redhat.com>
85
86 * include/cpplib.h (cpp_builtin_type): Remove trailing comma to
87 avoid pedantic warnings in C++ 98 mode.
88
c04babd9
JJ
892020-02-04 Jakub Jelinek <jakub@redhat.com>
90
f8d6e448
JJ
91 * macro.c (builtin_has_include): Diagnose __has_include* use outside
92 of preprocessing directives.
93
c04babd9
JJ
94 PR preprocessor/93545
95 * macro.c (cpp_get_token_no_padding): New function.
96 (builtin_has_include): Use it instead of cpp_get_token. Don't check
97 SEEN_EOL.
98
20fa702b
AB
992020-02-01 Andrew Burgess <andrew.burgess@embecosm.com>
100
101 * configure: Regenerate.
102
3d056cbf
NS
1032020-01-28 Nathan Sidwell <nathan@acm.org>
104
105 PR preprocessor/93452
106 * internal.h (struct spec_nodes): Drop n__has_include{,_next}.
107 * directives.c (lex_macro_node): Don't check __has_include redef.
108 * expr.c (eval_token): Drop __has_include eval.
109 (parse_has_include): Move to ...
110 * macro.c (builtin_has_include): ... here.
111 (_cpp_builtin_macro_text): Eval __has_include{,_next}.
112 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_INCLUDE{,_NEXT}.
113 * init.c (builtin_array): Add them.
114 (cpp_init_builtins): Drop __has_include{,_next} init here ...
115 * pch.c (cpp_read_state): ... and here.
116 * traditional.c (enum ls): Drop has_include states ...
117 (_cpp_scan_out_logical_line): ... and here.
118
e7c26e04
AB
1192020-01-27 Andrew Burgess <andrew.burgess@embecosm.com>
120
121 * configure: Regenerate.
122
a1f6eff2
NS
1232020-01-24 Nathan Sidwell <nathan@acm.org>
124
125 * expr.c (parse_has_include): Remove bogus controlling macro code.
126
ad1a3914
NS
1272020-01-20 Nathan Sidwell <nathan@acm.org>
128
129 PR preprocessor/80005
130 * include/cpplib.h (BT_HAS_ATTRIBUTE): Fix comment.
131 * internal.h (struct lexer_state): Delete in__has_include field.
132 (struct spec_nodes): Rename n__has_include{,_next}__ fields.
133 (_cpp_defined_macro_p): New.
134 (_cpp_find_file): Add has_include parm.
135 * directives.c (lex_macro_node): Combine defined,
136 __has_inline{,_next} checking.
137 (do_ifdef, do_ifndef): Use _cpp_defined_macro_p.
138 (_cpp_init_directives): Refactor.
139 * expr.c (parse_defined): Use _cpp_defined_macro_p.
140 (eval_token): Adjust parse_has_include calls.
141 (parse_has_include): Add OP parameter. Reimplement.
142 * files.c (_cpp_find_file): Add HAS_INCLUDE parm. Use it to
143 inhibit error message.
144 (_cpp_stack_include): Adjust _cpp_find_file call.
145 (_cpp_fake_include, _cpp_compare_file_date): Likewise.
146 (open_file_failed): Remove in__has_include check.
147 (_cpp_has_header): Adjust _cpp_find_file call.
148 * identifiers.c (_cpp_init_hashtable): Don't init
149 __has_include{,_next} here ...
150 * init.c (cpp_init_builtins): ... init them here. Define as
151 macros.
152 (cpp_read_main_file): Adjust _cpp_find_file call.
153 * pch.c (cpp_read_state): Adjust __has_include{,_next} access.
154 * traditional.c (_cpp_scan_out_locgical_line): Likewise.
bf09d886
NS
155
156 PR preprocessor/93306
157 * expr.c (parse_has_include): Refactor. Check skip_eval before
158 looking.
159
4bc1899b
DM
1602020-01-10 David Malcolm <dmalcolm@redhat.com>
161
162 * include/line-map.h (class diagnostic_path): New forward decl.
163 (rich_location::get_path): New accessor.
164 (rich_location::set_path): New function.
165 (rich_location::m_path): New field.
166 * line-map.c (rich_location::rich_location): Initialize m_path.
167
8d9254fc
JJ
1682020-01-01 Jakub Jelinek <jakub@redhat.com>
169
170 Update copyright years.
171
6dd0c820
DM
1722019-12-18 David Malcolm <dmalcolm@redhat.com>
173
174 PR preprocessor/92982
175 * charset.c
176 (cpp_string_location_reader::cpp_string_location_reader): Delete
177 initialization of m_line_table.
178 * include/cpplib.h (cpp_string_location_reader::m_line_table):
179 Delete unused member.
180
937a778e
JJ
1812019-12-14 Jakub Jelinek <jakub@redhat.com>
182
183 PR preprocessor/92919
184 * charset.c (wide_str_to_charconst): If str contains just the
185 NUL terminator, punt quietly.
186
d68f5d45
DM
1872019-12-09 David Malcolm <dmalcolm@redhat.com>
188
189 * include/line-map.h (label_text::label_text): Make private.
190 (label_text::borrow): New.
191 (label_text::take): New.
192 (label_text::take_or_copy): New.
193
ee925640
LH
1942019-12-09 Lewis Hyatt <lhyatt@gmail.com>
195
196 PR preprocessor/49973
197 * generated_cpp_wcwidth.h: New file generated by
198 ../contrib/unicode/gen_wcwidth.py, supports new cpp_wcwidth function.
199 * charset.c (compute_next_display_width): New function to help
200 implement display columns.
201 (cpp_byte_column_to_display_column): Likewise.
202 (cpp_display_column_to_byte_column): Likewise.
203 (cpp_wcwidth): Likewise.
204 * include/cpplib.h (cpp_byte_column_to_display_column): Declare.
205 (cpp_display_column_to_byte_column): Declare.
206 (cpp_wcwidth): Declare.
207 (cpp_display_width): New function.
208
7c5890cc
JM
2092019-11-14 Joseph Myers <joseph@codesourcery.com>
210
211 * charset.c (narrow_str_to_charconst): Make CPP_UTF8CHAR constants
212 unsigned for C.
213 * init.c (lang_defaults): Set utf8_char_literals for GNUC2X and
214 STDC2X.
215
2c03d736
JJ
2162019-11-07 Jakub Jelinek <jakub@redhat.com>
217
218 PR c++/91370 - Implement P1041R4 and P1139R2 - Stronger Unicode reqs
219 * charset.c (narrow_str_to_charconst): Add TYPE argument. For
220 CPP_UTF8CHAR diagnose whenever number of chars is > 1, using
221 CPP_DL_ERROR instead of CPP_DL_WARNING.
222 (wide_str_to_charconst): For CPP_CHAR16 or CPP_CHAR32, use
223 CPP_DL_ERROR instead of CPP_DL_WARNING when multiple char16_t
224 or char32_t chars are needed.
225 (cpp_interpret_charconst): Adjust narrow_str_to_charconst caller.
226
b7689b96
JM
2272019-11-05 Tim van Deurzen <tim@kompiler.org>
228
229 * cpplib.h: Add spaceship operator for C++.
230 * lex.c: Implement conditional lexing of spaceship operator for C++20.
231
aa23e73b
JJ
2322019-10-31 Jakub Jelinek <jakub@redhat.com>
233
234 PR preprocessor/92296
235 * internal.h (struct def_pragma_macro): Add is_builtin bitfield.
236 (_cpp_restore_special_builtin): Declare.
237 * init.c (_cpp_restore_special_builtin): New function.
238 * directives.c (do_pragma_push_macro): For NT_BUILTIN_MACRO
239 set is_builtin and don't try to grab definition.
240 (cpp_pop_definition): Use _cpp_restore_special_builtin to restore
241 builtin macros.
242
9158f0ba
NS
2432019-10-15 Nathan Sidwell <nathan@acm.org>
244
245 * include/line-map.h (struct maps_info_ordinary): Make cache
246 mutable.
247 (struct maps_info_macro): Likewise.
248 (LINEMAPS_CACHE): Remove non-ref accessor. Constify ref accessor.
249 (LINEMAPS_ORDINARY_CACHE, LINEMAPS_MACRO_CACHE): Likewise.
250 (LINEMAPS_ORDINARY_MAP_AT, LINEMAPS_MACRO_MAP_AT): Use
251 LINEMAPS_USED and LINEMAPS_MAP_AT.
252 (linemap_lookup): Constify line_map arg.
253 linemap.c (linemap_ordinary_map_lookup, linemap_macro_map_lookup):
254 Constify line_map arg.
255
175a85b2
JM
2562019-10-11 Joseph Myers <joseph@codesourcery.com>
257
258 * include/cpplib.h (struct cpp_options): Add dfp_constants and
259 cpp_warn_c11_c2x_compat.
260 (enum cpp_warning_reason): Add CPP_W_C11_C2X_COMPAT.
261 * init.c (struct lang_flags): Add dfp_constants.
262 (lang_defaults): Set dfp_constants to 1 for GNUC2X and STDC2X and
263 0 for other languages.
264 (cpp_set_lang): Set dfp_constants from language.
265 (cpp_create_reader): Set cpp_warn_c11_c2x_compat to -1.
266 * expr.c (interpret_float_suffix): Mention DFP constants as C2X in
267 comment.
268 (cpp_classify_number): Do not diagnose DFP constants for languages
269 setting dfp_constants, unless cpp_warn_c11_c2x_compat.
270
924b9276
NS
2712019-10-04 Nathan Sidwell <nathan@acm.org>
272
273 PR preprocessor/91991
274 * line-map.c (linemap_line_start): Clear max_column_hint if we run
275 out of locations.
276
68710ac7
RB
2772019-10-02 Richard Biener <rguenther@suse.de>
278
279 * internal.h (enum include_type): Remove trailing comma.
280
93313b94
JM
2812019-10-02 Joseph Myers <joseph@codesourcery.com>
282
283 * include/cpplib.h (struct cpp_options): Add member scope.
284 * init.c (struct lang_flags, lang_defaults): Likewise.
285 (cpp_set_lang): Set scope member of pfile.
286 * lex.c (_cpp_lex_direct): Test CPP_OPTION (pfile, scope) not
287 CPP_OPTION (pfile, cplusplus) for creating CPP_SCOPE tokens.
288
0900e29c
EB
2892019-09-26 Eric Botcazou <ebotcazou@adacore.com>
290
291 * charset.c (UCS_LIMIT): New macro.
292 (ucn_valid_in_identifier): Use it instead of a hardcoded constant.
293 (_cpp_valid_ucn): Issue a pedantic warning for UCNs larger than
294 UCS_LIMIT outside of identifiers in C and in C++2a or later.
295
7d112d66
LH
2962019-09-19 Lewis Hyatt <lhyatt@gmail.com>
297
298 PR c/67224
299 * charset.c (_cpp_valid_utf8): New function to help lex UTF-8 tokens.
300 * internal.h (_cpp_valid_utf8): Declare.
301 * lex.c (forms_identifier_p): Use it to recognize UTF-8 identifiers.
302 (_cpp_lex_direct): Handle UTF-8 in identifiers and CPP_OTHER tokens.
303 Do all work in "default" case to avoid slowing down typical code paths.
304 Also handle $ and UCN in the default case for consistency.
305
400b8274
NS
3062019-08-30 Nathan Sidwell <nathan@acm.org>
307
308 New # semantics for popping to "" name.
309 libcpp/
310 * directives.c (do_linemarker): Popping to "" name means get the
311 name from the include stack..
312
056f95ec
NS
3132019-09-05 Nathan Sidwell <nathan@acm.org>
314
315 PR preprocessor/91639
316 * directives.c (do_include_common): Tell lexer we're a #include.
317 * files.c (_cpp_stack_file): Lexer will have always incremented.
318 * internal.h (struct cpp_context): Extend in_directive's
319 semantics.
320 * lex.c (_cpp_lex_direct): Increment line for final \n when lexing
321 for an ISO #include.
322 * line-map.c (linemap_line_start): Remember if we overflowed.
323
2f2aeda9
UW
3242019-09-03 Ulrich Weigand <uweigand@de.ibm.com>
325
326 * directives.c: Remove references to spu from comments.
327 * expr.c: Likewise.
328
b0d11f1e
NS
3292019-08-29 Nathan Sidwell <nathan@acm.org>
330
331 * internal.h (enum include_type): Add IT_MAIN, IT_DIRECTIVE_HWM,
332 IT_HEADER_HWM.
333 (_cpp_stack_file): Take include_type, not a bool.
334 * files.c (_cpp_find_file): Refactor to not hide an if inside a
335 for conditional.
336 (should_stack_file): Break apart to ...
337 (is_known_idempotent_file, has_unique_contents): ... these.
338 (_cpp_stack_file): Replace IMPORT boolean with include_type enum.
339 Refactor to use new predicates. Do linemap compensation here ...
340 (_cpp_stack_include): ... not here.
341 * init.c (cpp_read_main_file): Pass IT_MAIN to _cpp_stack_file.
342
a0be978a
NS
3432019-08-28 Nathan Sidwell <nathan@acm.org>
344
345 * directives-only.c (_cpp_preprocess_dir_only): Use false, not
346 zero for _cpp_handle_directive call.
347 * directives.c (_cpp_handle_directive): Indented is bool.
348 * files.c (struct _cpp_file): Make bools 1 bit bitfields.
349 * internal.h (enum include_type): Reformat and comment.
350 (struct cpp_buffer): Make flags 1 bit bitfields.
351 (_cpp_handle_directive): Indented is bool.
352
6c1dae73
MS
3532019-07-09 Martin Sebor <msebor@redhat.com>
354
355 * include/line-map.h: Change class-key from class to struct and vice
356 versa to match convention and avoid -Wclass-is-pod and -Wstruct-no-pod.
357 * mkdeps.c: Same.
358
8ba6ea87
ML
3592019-07-03 Martin Liska <mliska@suse.cz>
360
361 * line-map.c (linemap_get_expansion_filename): Remove
362 dead assignemts.
363 * mkdeps.c (make_write): Likewise.
364
1c6ffbab
QZ
3652019-07-02 qing zhao <qing.zhao@oracle.com>
366
367 PR preprocessor/90581
368 * directives.c (do_include_common): Replace CPP_STACK_MAX with
369 CPP_OPTION (pfile, max_include_depth).
370 * include/cpplib.h (struct cpp_options): Add new field
371 max_include_depth.
372 * init.c (cpp_create_reader): Initiate new field max_include_depth.
373 * internal.h: Delete CPP_STACK_MAX.
374
66d7749b
NS
3752019-06-26 Nathan Sidwell <nathan@acm.org>
376
377 PR preprocessor/90927
378 * mkdeps.c (mkdeps::vec::operator[]): Add non-const variant.
379 (deps_add_target): Deal with out of order unquoted targets.
380
3f23e487
AP
3812019-05-19 Andrew Pinski <apinski@marvell.com>
382
383 PR pch/81721
384 * lex.c (cpp_token_val_index <case SPELL_OPERATOR>): If tok->flags
385 has NAMED_OP set, then return CPP_TOKEN_FLD_NODE.
386
19eda56d
ML
3872019-05-14 Martin Liska <mliska@suse.cz>
388
389 PR preprocessor/90382
390 * line-map.c (first_map_in_common_1): Handle ADHOC
391 locations.
392
e6fc8353
ML
3932019-05-14 Martin Liska <mliska@suse.cz>
394
395 PR preprocessor/90382
396 * include/line-map.h (get_data_from_adhoc_loc): Add const to
397 the first argument.
398 (get_location_from_adhoc_loc): Likewise.
399 * line-map.c(get_data_from_adhoc_loc): Add const to
400 the first argument.
401 (get_location_from_adhoc_loc): Likewise.
402 (get_combined_adhoc_loc): Use get_location_from_adhoc_loc
403 (or get_data_from_adhoc_loc).
404 (get_range_from_adhoc_loc): Likewise.
405 (get_pure_location): Likewise.
406 (linemap_position_for_loc_and_offset): Likewise.
407 (linemap_lookup): Likewise.
408 (linemap_ordinary_map_lookup): Likewise.
409 (linemap_macro_map_lookup): Likewise.
410 (linemap_get_expansion_line): Likewise.
411 (linemap_get_expansion_filename): Likewise.
412 (linemap_location_in_system_header_p): Likewise.
413 (linemap_location_from_macro_expansion_p): Likewise.
414 (linemap_macro_loc_to_exp_point): Likewise.
415 (linemap_resolve_location): Likewise.
416 (linemap_unwind_toward_expansion): Likewise.
417 (linemap_unwind_to_first_non_reserved_loc): Likewise.
418 (linemap_expand_location): Likewise.
419 (linemap_dump_location): Likewise.
420
d7b6aee8
NS
4212019-05-07 Nathan Sidwell <nathan@acm.org>
422
61145d93
NS
423 * files.c (_cpp_stack_file): Empty filenames aren't dependencies.
424 * mkdeps.c (deps_add_dep): Assert not empty.
425
d7b6aee8
NS
426 * include/mkdeps.h (deps_write): Add PHONY arg.
427 (deps_phony_targets): Delete.
428 * init.c (cpp_finish): Just call deps_write.
429 * mkdeps.c (struct mkdeps): Add local vector class. Reimplement
430 vector handling.
431 (munge): Munge to static buffer.
432 (apply_vpath): Adjust vector handling.
433 (deps_init, deps_free): Use new, delete.
434 (deps_add_target): Do not munge here. Record quoting low water mark.
435 (deps_add_dep): Do not munge here.
436 (deps_add_vpath): Adjust vector handling.
437 (make_write_name): New. Munge on demand here.
438 (make_write_vec): New.
439 (deps_phony_targets): Delete.
440 (make_write): New.
441 (deps_write): Forward to deps_Write.
442 (deps_save, deps_restore): Adjust vector handling.
443
b744fc85
NS
4442019-05-06 Nathan Sidwell <nathan@acm.org>
445
446 * include/mkdeps.h: Rename struct deps to struct mkdeps.
447 * mkdeps.c: Likewise.
448 * include/cpplib.h (cpp_get_deps): Rename return type..
449 * directives.c (cpp_get_deps): Likewise.
450 * internal.h (struct cpp_reader): Rename deps field type.
451
0bf12a52
JW
4522019-04-03 Jonathan Wakely <jwakely@redhat.com>
453
454 * files.c (search_path_exhausted): Fix typo in comment.
455
60448173
ML
4562019-02-26 Martin Liska <mliska@suse.cz>
457
458 * symtab.c (ht_dump_statistics): Make
459 horizontal alignment for statistics.
460
200a8e1a
DM
4612019-02-20 David Malcolm <dmalcolm@redhat.com>
462
463 PR c/89410
464 * include/line-map.h (linenum_arith_t): New typedef.
465 (compare): Use it.
466
a5f87af7
ML
4672019-02-18 Martin Liska <mliska@suse.cz>
468
469 PR c++/89383
470 * line-map.c (linemap_line_start): Use 1UL in order
471 to not overflow.
472
a4553534
DM
4732019-02-11 Martin Liska <mliska@suse.cz>
474
475 PR lto/88147
476 * line-map.c (linemap_line_start): Don't reuse the existing line
477 map if the line offset is sufficiently large to cause overflow
478 when computing location_t values.
479
18f5df94
JJ
4802019-01-26 Jakub Jelinek <jakub@redhat.com>
481
482 PR preprocessor/88974
483 * directives.c (SEEN_EOL): Move macro to ...
484 * internal.h (SEEN_EOL): ... here.
485 * expr.c (parse_has_include): Don't cpp_get_token if SEEN_EOL ().
486
a5544970
JJ
4872019-01-01 Jakub Jelinek <jakub@redhat.com>
488
489 Update copyright years.
490
bc65bad2
MG
4912018-11-27 Mike Gulick <mgulick@mathworks.com>
492
493 PR preprocessor/83173
494 * location-example.txt: Update example -fdump-internal-locations
495 output.
496
56c79e7f
MG
4972018-11-27 Mike Gulick <mgulick@mathworks.com>
498
499 PR preprocessor/83173
500 * files.c (_cpp_stack_include): Check if
501 line_table->highest_location is past current line before
502 decrementing.
503
620e594b
DM
5042018-11-13 David Malcolm <dmalcolm@redhat.com>
505
506 * charset.c: Replace "source_location" with "location_t".
507 * directives-only.c: Likewise.
508 * directives.c: Likewise.
509 * errors.c: Likewise.
510 * expr.c: Likewise.
511 * files.c: Likewise.
512 * include/cpplib.h: Likewise. Rename MAX_SOURCE_LOCATION to
513 MAX_LOCATION_T.
514 * include/line-map.h: Likewise.
515 * init.c: Likewise.
516 * internal.h: Likewise.
517 * lex.c: Likewise.
518 * line-map.c: Likewise.
519 * location-example.txt: Likewise.
520 * macro.c: Likewise.
521 * pch.c: Likewise.
522 * traditional.c: Likewise.
523
e9f3803d
HAQ
5242018-11-07 Hafiz Abid Qadeer <abidh@codesourcery.com>
525
526 * configure: Regenerated.
527
546f678c
ML
5282018-11-05 Martin Liska <mliska@suse.cz>
529
530 * symtab.c (ht_dump_statistics): Replace %zu with %lu format.
531
037903cb
ML
5322018-11-05 Martin Liska <mliska@suse.cz>
533
534 * symtab.c (ht_dump_statistics): Fix format and
535 pass missing argument.
536
46aeb07f
ML
5372018-11-05 Martin Liska <mliska@suse.cz>
538
539 * symtab.c (ht_dump_statistics): Make dump conditional
540 based on alloc_subobject.
541
22e05272
JM
5422018-10-31 Joseph Myers <joseph@codesourcery.com>
543
544 PR bootstrap/82856
545 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
546 * aclocal.m4, config.in, configure: Regenerate.
547
ff65e980
NS
5482018-10-31 Nathan Sidwell <nathan@acm.org>
549
f3f6029d
NS
550 * internal.h (struct cpp_reader): Rename forced_token_location_p
551 to forced_token_location and drop its pointerness.
552 * include/cpplib.h (cpp_force_token_locations): Take location, not
553 pointer to one.
554 * init.c (cpp_create_reader): Adjust.
555 * lex.c (cpp_read_main_file):
556
705b0c05
NS
557 * directives.c (do_include_common): Commonize cleanup path.
558 (_cpp_pop_buffer): Fix leak.
559
87bacc2b
NS
560 * include/line-map.h (IS_ORDINARY_LOC, IS_MACRO_LOC): New
561 predicates.
562 (IS_ADHOC_LOC): Move earlier.
563 (MAP_ORDINARY_P): Use IS_ORDINARY_LOC.
564 * line-map.c (linemap_location_from_macro_expansion_p): Use
565 IS_MACRO_LOC.
566
c9fb347e
NS
567 * include/cpplib.h (cpp_macro_definition_location): Make inline.
568 * macro.c (warn_of_redefinition): Fix comments, examine macro
569 type, use C++ for.
570 (cpp_macro_definition_location): Don't define here.
571
43af5ef1
NS
572 * include/cpplib.h (HT_NODE): Don't cast NODE.
573 (NODE_LEN, NODE_NAME): Use HT_NODE.
574
ff65e980
NS
575 * directives.c (DIRECTIVE_TABLE): Drop historical frequency
576 comments.
577 * files.c (_cpp_stack_file): Fix indentation.
578
9f936c86
JM
5792018-10-17 Joseph Myers <joseph@codesourcery.com>
580
581 * include/cpplib.h (enum c_lang): Add CLK_GNUC2X and CLK_STDC2X.
582 * init.c (lang_defaults): Add GNUC2X and STDC2X entries.
583 (cpp_init_builtins): Define __STDC_VERSION__ to 202000L for C2X.
584
954ad112
DM
5852018-10-11 David Malcolm <dmalcolm@redhat.com>
586
587 * macro.c (_cpp_arguments_ok): If the argument count is wrong, add
588 a note showing the definition of the macro.
589
c1b48b29
NS
5902018-10-11 Nathan Sidwell <nathan@acm.org>
591
592 * include/line-map.h (LINEMAPS_MACRO_LOWEST_LOCATION): Fix
593 off-by-one error.
594 * line-map.c (linemap_enter_macro): Use RAII. Clear all of the
595 macro_locations.
596
c24300ba
DM
5972018-10-09 David Malcolm <dmalcolm@redhat.com>
598
599 * charset.c (noop_error_cb): Rename to...
600 (noop_diagnostic_cb): ...this, converting params to enums.
601 (cpp_interpret_string_ranges): Update for renaming and enums.
602 * directives.c (check_eol_1): Convert reason to enum.
603 (do_diagnostic): Convert code and reason to enum.
604 (do_error): Use CPP_W_NONE rather than 0.
605 (do_pragma_dependency): Likewise.
606 * errors.c (cpp_diagnostic_at): Convert level and reason to enums.
607 Update for renaming.
608 (cpp_diagnostic): Convert level and reason to enums.
609 (cpp_error): Convert level to enum.
610 (cpp_warning): Convert reason to enums.
611 (cpp_pedwarning): Likewise.
612 (cpp_warning_syshdr): Likewise.
613 (cpp_diagnostic_with_line): Convert level and reason to enums.
614 Update for renaming.
615 (cpp_error_with_line): Convert level to enum.
616 (cpp_warning_with_line): Convert reason to enums.
617 (cpp_pedwarning_with_line): Likewise.
618 (cpp_warning_with_line_syshdr): Likewise.
619 (cpp_error_at): Convert level to enum.
620 (cpp_errno): Likewise.
621 (cpp_errno_filename): Likewise.
622 * include/cpplib.h (enum cpp_diagnostic_level): Name this enum,
623 and move to before struct cpp_callbacks.
624 (enum cpp_warning_reason): Likewise.
625 (cpp_callbacks::diagnostic): Convert params from int to enums.
626 (cpp_error): Convert int param to enum cpp_diagnostic_level.
627 (cpp_warning): Convert int param to enum cpp_warning_reason.
628 (cpp_pedwarning): Likewise.
629 (cpp_warning_syshdr): Likewise.
630 (cpp_errno): Convert int param to enum cpp_diagnostic_level.
631 (cpp_errno_filename): Likewise.
632 (cpp_error_with_line): Likewise.
633 (cpp_warning_with_line): Convert int param to enum
634 cpp_warning_reason.
635 (cpp_pedwarning_with_line): Likewise.
636 (cpp_warning_with_line_syshdr): Likewise.
637 (cpp_error_at): Convert int param to enum cpp_diagnostic_level.
638 * macro.c (create_iso_definition): Convert int to enum.
639 (_cpp_create_definition): Likewise.
640
9c4a4b3c
DM
6412018-09-17 David Malcolm <dmalcolm@redhat.com>
642
643 * include/line-map.h (range_label::get_text): Add param
644 "range_idx".
645
24c35f68
NS
6462018-08-30 Nathan Sidwell <nathan@acm.org>
647
648 * include/line-map.h (enum lc_reason): Comment each member
649 separately.
650 (struct line_maps): Fix reallocator comment.
651
85204e23
DM
6522018-08-27 David Malcolm <dmalcolm@redhat.com>
653
654 PR 87091
655 * include/line-map.h (enum range_display_kind): New enum.
656 (struct location_range): Replace field "m_show_caret_p" with
657 "m_range_display_kind", converting from bool to the new enum.
658 (class rich_location): Add example of line insertion fix-it hint.
659 (rich_location::add_range): Convert param "show_caret_p" from bool
660 to enum range_display_kind and rename to "range_display_kind",
661 giving it a default of SHOW_RANGE_WITHOUT_CARET.
662 (rich_location::set_range): Likewise, albeit without a default.
663 * line-map.c (rich_location::rich_location): Update for conversion
664 of show_caret_p to tri-state enum.
665 (rich_location::add_range): Likewise.
666 (rich_location::set_range): Likewise.
667
cf806c7d
L
6682018-08-24 H.J. Lu <hongjiu.lu@intel.com>
669
670 PR bootstrap/86872
671 * line-map.c (pure_location_p): Return true if linemap_lookup
672 returns NULL.
673 (linemap_add): Set start_location to 0 if we run out of line map
674 space.
675
3fb558b1
NS
6762018-08-20 Nathan Sidwell <nathan@acm.org>
677
a5a35247
NS
678 * include/cpplib.h: Fixup some whitespace.
679 (cpp_hashnode): Reduce type to 2 bit & flags to 8.
680
a570d97f
NS
681 * include/cpplib.h (NODE_BUILTIN, NODE_MACRO_ARG): Delete.
682 Renumber others.
683 (enum node_type): Replace NT_MACRO with NT_USER_MACRO,
684 NT_BUILTIN_MACRO, NT_MACRO_ARG. Delete NT_ASSERTION.
685 (NTV_MACRO, NTV_ANSWER, NTV_BUILTIN, NTV_ARGUMENT, NTV_NONE):
686 Delete.
687 (CPP_HASHNODE_VALUE_IDX): Delete.
688 (union _cpp_hashnode_value): GTY tag from enum node_type directly.
689 (struct cpp_hashnode): Adjust GTY desc for value field.
690 (cpp_user_macro_p, cpp_builtin_macro_p, cpp_macro_p): Adjust.
691 * directives.c (undefine_macros): Clear value.anwers, adjust flag
692 clearing.
693 (_cpp_test_assertion): No need to check NT_ASSERTION.
694 (do_assert, do_unassert): Likewise.
695 * init.c (cpp_init_special_builtins): Set type not flags.
696 * macro.c (struct macro_arg_saved_data): Add type field.
697 (cpp_get_token_1): Check type not NT_VOID.
698 (_cpp_free_definition): Adjust flag clearing. Nullify
699 value.answers.
700 (_cpp_save_parameter, _cpp_unsave_parameters): Save and restore
701 type.
702 (lex_expansion_token): Check type not flags.
703 (_cpp_create_definition): Set type to NT_USER_MACRO.
704 (_cpp_notify_macro_use): Adjust type checking.
705 * pch.c (write_macdef, count_defs, write_defs, cpp_valid_state)
706 (save_macros): Adjust node type/flag handling.
707 * traditional.c (_cpp_scan_out_logical_line): Check type not flags.
708
7692e253
NS
709 * directives.c (do_undef): Use cpp_macro_p & cpp_builtin_macro_p.
710 * include/cpplib.h (enum cpp_macro_kind): Remove trailing comma.
711 (cpp_fun_like_macro_p): Make inline, define.
712 * macro.c (cpp_define_lazily): Use UCHAR_MAX.
713 (cpp_fun_like_macro_p): Delete.
714
abcd1775
NS
715 * Makefile.in (TAGS_SOURCES): Remove cpp-id-data.h.
716 * include/cpp-id-data.h: Delete.
717 * internal.h: Include cpplib.h not cpp-id-data.h.
718
3fb558b1
NS
719 * include/cpp-id-data.h (struct answer): Delete.
720 * include/cpplib.h (struct answer): Don't forward-declare.
721 (enum cpp_macro_kind): Add cmk_assert.
722 (struct cpp_macro): Union parms and next assert chain.
723 (union _cpp_hashnode_value): 'answer' field is cpp_macro.
724 * directives.c (parse_answer): Convert to use cpp_macro. Return
725 true on success.
726 (parse_assertion, find_answer, _cpp_test_assertion, cpp_do_assert)
727 (cpp_do_unassert): Convert to use cpp_macro.
728 * macro.c (warn_of_redefinition, _cpp_new_macro)
729 (check_trad_stringification, cpp_macro_definition): Adjust macro
730 parm access.
731 * traditional.c (_cpp_replacement_text_len)
732 (_cpp_copy_replacement_text, _cpp_create_trad_definition): Likewise.
733
c5d725c0
NS
7342018-08-17 Nathan Sidwell <nathan@acm.org>
735
800c0e98
NS
736 * include/cpplib.h (struct cpp_callbacks): Replace
737 user_builtin_macro with user_lazy_macro.
738 (struct cpp_macro): add lazy field.
739 (enum cpp_builtin_type): Remove BT_FIRST_USER, BT_LAST_USER.
740 (cpp_define_lazily): Declare.
741 * macro.c (enter_macro_context) Use _cpp_maybe_notify_macro_use.
742 (warn_of_redefinition): Use cpp_builtin_macro_p, directly call
743 user_lazy_macro hook.
744 (_cpp_new_macro): Clear lazy field.
745 (cpp_define_lazily): Define.
746 (_cpp_notify_macro_use): Adjust lazy definition code.
747 (cpp_macro_definition): No need to do lazy definition here.
748 * pch.c (write_macdef, save_macros): Likewise.
749
10f04917
NS
750 * include/cpplib.h (enum cpp_macro_kind): New.
751 (struct cpp_macro): Make body trailing array. Add kind field,
752 delete traditional flag.
753 * internal.h (_cpp_new_macro): Declare.
754 (_cpp_reserve_room): New inline.
755 (_cpp_commit_buf): Declare.
756 (_cpp_create_trad_definition): Return new macro.
757 * lex.c (_cpp_commit_buff): New.
758 * macro.c (macro_real_token_count): Count backwards.
759 (replace_args): Pointer equality not orderedness.
760 (_cpp_save_parameter): Use _cpp_reserve_room.
761 (alloc_expansion_token): Delete.
762 (lex_expansion_token): Return macro pointer. Use _cpp_reserve_room.
763 (create_iso_definition): Allocate macro itself. Adjust for
764 different allocation ordering.
765 (_cpp_new_macro): New.
766 (_cpp_create_definition): Adjust for API changes.
767 * traditional.c (push_replacement_text): Don't set traditional
768 flag.
769 (save_replacement_text): Likewise.
770 (_cpp_create_trad_definition): Allocate macro itself, Adjust for
771 different allocation ordering.
772
c5d725c0
NS
773 * cpp-id-data.h (uchar, UC): Move to internal.h
774 (struct cpp_macro): Move to cpplib.h.
775 * internal.h (uchar, UC): From cpp-id-data.h.
776 * include/cpplib.h (struct cpp_macro): From cpp-id-data.h.
777
3f6677f4
NS
7782018-08-16 Nathan Sidwell <nathan@acm.org>
779
729a01f7
NS
780 * internal.h (_cpp_save_parameter): Take parmno, not macro.
781 (_cpp_unsave_parameters): Declare.
782 * macro.c (_cpp_save_parameter): Take parm number, not macro.
783 Return true on success.
784 (_cpp_unsave_parameters): New.
785 (parse_params): Take parm_no and variadic pointers, not macro.
786 Reimplement parsing logic.
787 (create_iso_definition): Adjust parse_params changes. Call
788 _cpp_unsave_parameters here.
789 (_cpp_create_definition): Don't unsave params here.
790 * traditional.c (scan_parameters): Take n_param pointer, adjust.
791 (_cpp_create_trad_definition): Ajust scan_parameters change. Call
792 _cpp_unsave_parameters.
793
3f6677f4
NS
794 * include/cpplib.h (cpp_user_macro_p, cpp_builtin_macro_p)
795 (cpp_macro_p): New inlines.
796 * directives.c (do_pragma_poison): Use cpp_macro_p.
797 (do_ifdef, do_ifndef): Likewise. Use _cpp_maybe_notify_macro_use.
798 (cpp_pop_definition): Use cpp_macro_p. Move _cpp_free_definition
799 earlier. Don't zap node directly.
800 * expr.c (parse_defined): Use _cpp_maybe_notify_macro_use &
801 cpp_macro_p.
802 * files.c (should_stack_file): Use cpp_macro_p.
803 * identifiers.c (cpp_defined): Likewise.
804 * internal.h (_cpp_mark_macro): Use cpp_user_macro_p.
805 (_cpp_notify_macro_use): Declare.
806 (_cpp_maybe_notify_macro_use): New inline.
807 * lex.c (is_macro): Use cpp_macro_p.
808 * macro.c (_cpp_warn_if_unused_macro): Use cpp_user_macro_p.
809 (enter_macro_context): Likewise.
810 (_cpp_create_definition): Use cpp_builtin_macro_p,
811 cpp_user_macro_p. Move _cpp_free_definition earlier.
812 (_cpp_notify_macro_use): New, broken out of multiple call sites.
813 * traditional.c (fun_like_macro_p): Use cpp_builtin_macro_p.
814 (maybe_start_funlike, _cpp_scan_out_logical_line)
815 (push_replacement_text): Likewise.
816
96e6ae57
DM
8172018-08-15 David Malcolm <dmalcolm@redhat.com>
818
819 * include/line-map.h (struct location_range): Add "m_label" field.
820 (class rich_location): Add description of labels to leading
821 comment.
822 (rich_location::rich_location): Add "label" param, defaulting to
823 NULL.
824 (rich_location::add_range): Likewise.
825 (struct label_text): New struct.
826 (class range_label): New abstract base class.
827 * line-map.c (rich_location::rich_location): Add "label" param;
828 use it.
829 (rich_location::add_range): Likewise.
830
f10a9135
NS
8312018-08-08 Nathan Sidwell <nathan@acm.org>
832
833 Make linemap::included_from a location
834 libcpp/
835 * include/line-map.h (struct line_map_ordinary): Replace
836 included_from map index with included_at source_location.
837 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Delete.
838 (LAST_SOURCE_LINE_LOCATION): Delete.
839 (LAST_SOURCE_LINE, LAST_SOURCE_COLUMN): Delete.
840 (linemap_included_from): New.
841 (linemap_included_from_linemap): Declare.
842 (MAIN_FILE_P): Adjust.
843 * line-map.c (linemap_included_from_linemap): New.
844 (lonemap_check_files_exited): Use linemap_included_at.
845 (linemap_add): Adjust inclusion setting.
846 (linemap_dump, linemap_dump_location): Adjust.
847 * directives.c (do_linemarker): Use linemap_included_at.
848
e81c3c4d
NS
8492018-08-07 Nathan Sidwell <nathan@acm.org>
850
851 * line-map.c: (linemap_init): Set default allocator here.
852 (new_linemap): Rather than here. Refactor allocation logic.
853
181463c2
DM
8542018-07-20 David Malcolm <dmalcolm@redhat.com>
855
856 * include/line-map.h (rich_location::set_range): Remove redundant
857 line_maps * parameter.
858 * line-map.c (rich_location::set_range): Likewise.
859
6f41f92b
BE
8602018-07-18 Bernd Edlinger <bernd.edlinger@hotmail.de>
861
862 PR 69558
863 * macro.c (enter_macro_context): Change the location info for builtin
864 macros and _Pragma from location of the closing parenthesis to location
865 of the macro expansion point.
866
0c86a39d
JJ
8672018-07-17 Jason Franklin <j_fra@fastmail.us>
868 Jakub Jelinek <jakub@redhat.com>
869
870 * lex.c (_cpp_lex_direct): Use CPP_DL_NOTE instead of CPP_DL_PEDWARN,
871 CPP_DL_WARNING or CPP_DL_ERROR for note that diagnostics for C++ style
872 comments is reported only once per file and guard those calls on the
873 preceding cpp_error returning true.
874
42a98b43
NS
8752018-07-03 Nathan Sidwell <nathan@acm.org>
876
877 Reorg line_map data structures for better packing.
878 * include/line-map.h (enum lc_reason): Add LC_HWM.
879 (LINE_MAP_MAX_LOCATION): Define here.
880 (struct line_map): Move reason field to line_map_ordinary. Adjust
881 GTY tagging.
882 (struct line_map_ordinary): Reorder fields for less padding.
883 (struct line_map_macro): Likewise.
884 (MAP_ORDINARY_P): New.
885 (linemap_check_ordinary, linemap_check_macro): Adjust.
886 * line-map.c (LINE_MAP_MAX_SOURCE_LOCATION): Delete.
887 (new_linemap): Take start_location, not reason. Adjust.
888 (linemap_add, linemap_enter_macro): Adjust.
889 (linemap_line_start): Likewise.
890 (linemap_macro_expansion_map_p): Use MAP_ORDINARY_P.
891 (linemap_macro_loc_to_spelling_point): Likewise.
892 (linemap_macro_loc_to_def_point): Likewise.
893 (linemap_dump): Likewise.
894
a6b29221
JM
8952018-05-23 Jason Merrill <jason@redhat.com>
896
897 * system.h: #include <new> earlier.
898
b2ff7457
JM
8992018-05-17 Jason Merrill <jason@redhat.com>
900
901 * line-map.c (linemap_init): Use placement new.
902 * system.h: #include <new>.
903
082284da
DM
9042018-03-14 David Malcolm <dmalcolm@redhat.com>
905
906 * include/line-map.h (compare): New function on linenum_type.
907
b44f8ad8
JW
9082018-02-28 Jonathan Wakely <jwakely@redhat.com>
909
910 PR preprocessor/84517
911 * lex.c (is_macro_not_literal_suffix): New function.
912 (lex_raw_string, lex_string): Use is_macro_not_literal_suffix to
913 decide when to issue -Wliteral-suffix warnings.
914
fe74f9b4
RB
9152018-02-16 Richard Biener <rguenther@suse.de>
916
917 PR bootstrap/82939
918 * line-map.c (linemap_init): Avoid broken value-init when compiling
919 with GCC 4.2.
920
60887f8c
JM
9212018-02-15 Jason Merrill <jason@redhat.com>
922 Jakub Jelinek <jakub@redhat.com>
923
924 PR preprocessor/83063 - __VA_OPT__ and ##
925 PR preprocessor/83708
926 * macro.c (vaopt_state): Reorder m_last_was_paste before m_state.
927 (vaopt_state::vaopt_state): Adjust.
928 (vaopt_state::update_flags): Add BEGIN and END.
929 (vaopt_state::update): Return them.
930 (copy_paste_flag): Factor out of replace_args.
931 (last_token_is): New.
932 (replace_args): Handle BEGIN and END. Avoid padding there.
933 (tokens_buff_last_token_ptr): Return NULL if no tokens.
934
1306a81d
JJ
9352018-01-31 Jakub Jelinek <jakub@redhat.com>
936
937 PR preprocessor/69869
938 * traditional.c (skip_macro_block_comment): Return bool, true if
939 the macro block comment is unterminated.
940 (copy_comment): Use return value from skip_macro_block_comment instead
941 of always false.
942
53723269
JJ
9432018-01-27 Jakub Jelinek <jakub@redhat.com>
944
945 * include/cpplib.h (enum cpp_builtin_type): Change BT_LAST_USER from
946 BT_FIRST_USER + 31 to BT_FIRST_USER + 63.
947
7365279f
BK
9482018-01-18 Boris Kolpackov <boris@codesynthesis.com>
949
92a285c1
ML
950 PR other/70268
951 * include/cpplib.h (cpp_callbacks::remap_filename): New callback.
952 * macro.c (_cpp_builtin_macro_text): Call remap_filename for
953 __FILE__ and __BASE_FILE__.
7365279f 954
a3a821c9
KN
9552018-01-10 Kelvin Nilsen <kelvin@gcc.gnu.org>
956
957 * lex.c (search_line_fast): Remove illegal coercion of an
958 unaligned pointer value to vector pointer type and replace with
959 use of __builtin_vec_vsx_ld () built-in function, which operates
960 on unaligned pointer values.
961
85ec4feb
JJ
9622018-01-03 Jakub Jelinek <jakub@redhat.com>
963
964 Update copyright years.
965
35c4515b
MW
9662017-12-20 Michael Weiser <michael.weiser@gmx.de>
967
968 PR preprocessor/83492
969 * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]:
970 Fix selection of big-endian shift parameters by using
971 __ARM_BIG_ENDIAN.
972
c65e18d3
BE
9732017-12-14 Bernd Edlinger <bernd.edlinger@hotmail.de>
974
975 * internal.h (maybe_print_line): Change signature.
7365279f 976
a7b1ce04
JJ
9772017-12-05 Jakub Jelinek <jakub@redhat.com>
978
979 PR c++/79228
980 * expr.c (interpret_float_suffix): Avoid memcmp.
981 (interpret_int_suffix): Likewise. Don't check for if.
982
f2b8b8ad
JM
9832017-12-01 Jason Merrill <jason@redhat.com>
984
985 PR c++/79228 - extensions hide C++14 complex literal operators
986 * expr.c (interpret_float_suffix): Ignore 'i' in C++14 and up.
987 (interpret_int_suffix): Likewise.
988
6df8934f
DM
9892017-11-28 David Malcolm <dmalcolm@redhat.com>
990
991 PR c/82050
992 * include/line-map.h (LINE_MAP_MAX_COLUMN_NUMBER): Move here.
993 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): ...from here.
994 (rich_location::maybe_add_fixit): Reject fix-it hints in which
995 the start column exceeds the next column.
996
34b81eb9
EG
9972017-11-20 Eric Gallager <egall@gwmail.gwu.edu>
998
999 PR preprocessor/81794
1000 * macro.c (check_trad_stringification): Have warning be controlled
1001 by -Wtraditional.
1002
01ada121
DM
10032017-11-20 David Malcolm <dmalcolm@redhat.com>
1004
1005 PR c++/72786
1006 * include/cpplib.h (cpp_macro_definition_location): New decl.
1007 * macro.c (cpp_macro_definition): New function.
1008
fb771b9d
TT
10092017-11-13 Tom Tromey <tom@tromey.com>
1010
1011 * pch.c (cpp_read_state): Set n__VA_OPT__.
1012 * macro.c (vaopt_state): New class.
1013 (_cpp_arguments_ok): Check va_opt flag.
1014 (replace_args, create_iso_definition): Use vaopt_state.
1015 * lex.c (lex_identifier_intern): Possibly issue errors for
1016 __VA_OPT__.
1017 (lex_identifier): Likewise.
1018 (maybe_va_opt_error): New function.
1019 * internal.h (struct lexer_state) <va_args_ok>: Update comment.
1020 (struct spec_nodes) <n__VA_OPT__>: New field.
1021 * init.c (struct lang_flags) <va_opt>: New field.
1022 (lang_defaults): Add entries for C++2A. Update all entries for
1023 va_opt.
1024 (cpp_set_lang): Initialize va_opt.
1025 * include/cpplib.h (struct cpp_options) <va_opt>: New field.
1026 * identifiers.c (_cpp_init_hashtable): Initialize n__VA_OPT__.
1027
846b84fb
DM
10282017-11-13 David Malcolm <dmalcolm@redhat.com>
1029
1030 * include/line-map.h (linenum_type): Move this typedef and the
1031 comment describing column numbering to near the top of the file.
1032
7d19c460
MK
10332017-11-06 Mukesh Kapoor <mukesh.kapoor@oracle.com>
1034
1035 PR c++/80955
1036 * lex.c (lex_string): When checking for a valid macro for the
1037 warning related to -Wliteral-suffix (CPP_W_LITERAL_SUFFIX),
1038 check that the macro name does not start with an underscore
1039 before calling is_macro().
1040
c830c7d5
TV
10412017-11-05 Tom de Vries <tom@codesourcery.com>
1042
1043 PR other/82784
1044 * lex.c (BUF_APPEND): Remove semicolon after
1045 "do {} while (0)".
1046
64a5912c
DM
10472017-10-31 David Malcolm <dmalcolm@redhat.com>
1048
1049 * directives.c (_cpp_handle_directive): Update for renaming of
1050 cpp_error_at_richloc to cpp_error_at.
1051 * errors.c (cpp_diagnostic_at_richloc): Rename to...
1052 (cpp_diagnostic_at): ...this, dropping the location_t-based
1053 implementation.
1054 (cpp_diagnostic): Update for removal of location_t-based
1055 cpp_diagnostic_at.
1056 (cpp_error_at): Likewise.
1057 (cpp_error_at_richloc): Rename to...
1058 (cpp_error_at): ...this, and update for renaming of
1059 cpp_diagnostic_at_richloc.
1060 * include/cpplib.h (cpp_error_at_richloc): Rename to...
1061 (cpp_error_at): ...this.
1062
c76dc9c3
JM
10632017-10-30 Joseph Myers <joseph@codesourcery.com>
1064
1065 * include/cpplib.h (enum c_lang): Add CLK_GNUC17 and CLK_STDC17.
1066 * init.c (lang_defaults): Add GNUC17 and STDC17 data.
1067 (cpp_init_builtins): Handle C17 value of __STDC_VERSION__.
1068
35b82d26
NS
10692017-10-10 Nathan Sidwell <nathan@acm.org>
1070
1071 PR preprocessor/82506
1072 * macro.c (cpp_quote_string): Escape raw LFs.
1073
026a79f7
AS
10742017-09-15 Andrew Sutton <andrew.n.sutton@gmail.com>
1075 Jakub Jelinek <jakub@redhat.com>
1076
1077 Add support for -std=c++2a.
1078 * include/cpplib.h (c_lang): Add CXX2A and GNUCXX2A.
1079 * init.c (lang_defaults): Add rows for CXX2A and GNUCXX2A.
1080 (cpp_init_builtins): Set __cplusplus to 201709L for C++2a.
1081
7b936140
JJ
10822017-09-15 Jakub Jelinek <jakub@redhat.com>
1083
1084 * include/cpplib.h (enum c_lang): Rename CLK_GNUCXX1Z
1085 to CLK_GNUCXX17 and CLK_CXX1Z to CLK_CXX17.
1086 * init.c (lang_defaults, cpp_init_builtins): Likewise.
1087 * expr.c (cpp_classify_number): Use C++17 instead of C++1z
1088 in diagnostics.
1089
738f7c2e
DM
10902017-07-07 David Malcolm <dmalcolm@redhat.com>
1091
1092 PR c++/79300
1093 * line-map.c (linemap_macro_loc_to_def_point): Preserve range
1094 information for macro expansions by delaying resolving ad-hoc
1095 locations until within the loop.
1096
c471c6ed
DM
10972017-07-06 David Malcolm <dmalcolm@redhat.com>
1098
1099 PR c++/79300
1100 * include/line-map.h (enum location_aspect): New enum.
1101 (linemap_client_expand_location_to_spelling_point): Add
1102 enum location_aspect param.
1103 * line-map.c (rich_location::get_expanded_location): Update for
1104 new param of linemap_client_expand_location_to_spelling_point.
1105 (rich_location::maybe_add_fixit): Likewise.
1106 (fixit_hint::affects_line_p): Likewise.
1107
6d522731
JJ
11082017-06-21 Jakub Jelinek <jakub@redhat.com>
1109
1110 * line-map.c (location_adhoc_data_update): Perform addition in
1111 uintptr_t type rather than char * type. Read *data using
1112 ptrdiff_t type instead of int64_t.
1113 (get_combined_adhoc_loc): Change offset type to ptrdiff_t from
1114 int64_t.
1115
c7a980b8
DM
11162017-06-20 David Malcolm <dmalcolm@redhat.com>
1117
1118 * include/line-map.h (class rich_location): Document that attempts
1119 to delete or replace a range *affecting* multiple lines will fail.
1120 * line-map.c (rich_location::maybe_add_fixit): Implement this
1121 restriction.
1122
b09649fd
DM
11232017-06-09 David Malcolm <dmalcolm@redhat.com>
1124
1125 * include/line-map.h
1126 (rich_location::fixits_cannot_be_auto_applied): New method.
1127 (rich_location::fixits_can_be_auto_applied_p): New accessor.
1128 (rich_location::m_fixits_cannot_be_auto_applied): New field.
1129 * line-map.c (rich_location::rich_location): Initialize new field.
1130
05945a1b
DM
11312017-06-05 David Malcolm <dmalcolm@redhat.com>
1132
1133 * include/cpplib.h (struct cpp_callbacks): Add "comment"
1134 callback.
1135 * lex.c (_cpp_lex_direct): Call the comment callback if non-NULL.
1136
ad53f123
DM
11372017-05-02 David Malcolm <dmalcolm@redhat.com>
1138
1139 * include/line-map.h (class rich_location): Update description of
1140 newline handling.
1141 (class fixit_hint): Likewise.
1142 (fixit_hint::ends_with_newline_p): New decl.
1143 * line-map.c (rich_location::maybe_add_fixit): Support newlines
1144 in fix-it hints that are insertions of single lines at the start
1145 of a line. Don't consolidate into such fix-it hints.
1146 (fixit_hint::ends_with_newline_p): New method.
1147
338035aa
DM
11482017-05-01 David Malcolm <dmalcolm@redhat.com>
1149
1150 * include/line-map.h (source_range::intersects_line_p): Delete.
1151 (rich_location::add_fixit): Delete.
1152 (rich_location::maybe_add_fixit): New method.
1153 (class fixit_hint): Reimplement in terms of...
1154 (class fixit_replace): ...this.
1155 (class fixit_insert): Delete.
1156 * line-map.c (linemap_position_for_loc_and_offset): Drop overzealous
1157 linemap_assert_fails.
1158 (source_range::intersects_line_p): Rename to...
1159 (fixit_hint::affects_line_p): New function.
1160 (rich_location::add_fixit_insert_before): Reimplement in terms of
1161 maybe_add_fixit, moving validation there.
1162 (rich_location::add_fixit_insert_after): Likewise.
1163 (column_before_p): Delete.
1164 (rich_location::add_fixit_replace): Reimplement in terms of
1165 maybe_add_fixit, moving validation there. Convert closed input range
1166 to half-open range.
1167 (rich_location::add_fixit): Delete.
1168 (rich_location::maybe_add_fixit): New function.
1169 (fixit_insert::fixit_insert): Delete.
1170 (fixit_insert::~fixit_insert): Delete.
1171 (fixit_insert::affects_line_p): Delete.
1172 (fixit_insert::maybe_append_replace): Delete.
1173 (fixit_replace::fixit_replace): Rename to...
1174 (fixit_hint::fixit_hint): ...this, rewriting as necessary.
1175 (fixit_replace::~fixit_replace): Delete.
1176 (fixit_replace::affects_line_p): Delete.
1177 (fixit_replace::maybe_append_replace): Rename to...
1178 (fixit_hint::maybe_append): ...this, rewriting as necessary.
1179
5764ee3c
JW
11802017-04-03 Jonathan Wakely <jwakely@redhat.com>
1181
1182 * include/line-map.h (LINEMAPS_MACRO_MAPS): Fix typo in comment.
1183 * lex.c (search_line_fast): Likewise.
1184 * pch.h (cpp_valid_state): Likewise.
1185
8c00ae24
AS
11862017-03-21 Andreas Schwab <schwab@suse.de>
1187
1188 * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]:
1189 Convert 64-bit value to boolean before passing to
1190 __builtin_expect.
1191
85e653c9
JM
11922017-03-16 Jason Merrill <jason@redhat.com>
1193
1194 * init.c (cpp_init_builtins): Update __cplusplus for C++17.
1195
e228c50f
GP
11962017-02-09 Gerald Pfeifer <gerald@pfeifer.com>
1197
1198 * Makefile.in (po/$(PACKAGE).pot): Adjust bug reporting URL.
1199
b9f4757f
DM
12002017-01-10 David Malcolm <dmalcolm@redhat.com>
1201
1202 PR c++/77949
1203 * line-map.c (linemap_position_for_column): When calling
1204 linemap_start_line, detect if a new linemap was created with
1205 0 column bits, and bail out early if this is the case.
1206 (linemap_position_for_loc_and_offset): Replace overzealous
1207 linemap_assert_fails with a simple conditional; use correct
1208 bit count.
1209
5ccf1d8d
DM
12102017-01-07 David Malcolm <dmalcolm@redhat.com>
1211
1212 PR c++/72803
1213 * line-map.c (linemap_line_start): When determining if the highest
1214 column given out so far will fit into a proposed change to the
1215 current map, use the effective number of column bits, rather than
1216 the total number of column + range bits.
1217
cbe34bb5
JJ
12182017-01-01 Jakub Jelinek <jakub@redhat.com>
1219
1220 Update copyright years.
1221
a3998c2f
DM
12222016-12-15 David Malcolm <dmalcolm@redhat.com>
1223
1224 PR preprocessor/78680
1225 PR preprocessor/78811
1226 * lex.c (_cpp_lex_direct): Only determine the end-location of
1227 the token and build a range for non-reserved start locations.
1228 Do not do it for EOF tokens.
1229
470a60b2
DM
12302016-12-12 David Malcolm <dmalcolm@redhat.com>
1231
1232 PR preprocessor/78680
1233 * lex.c (_cpp_lex_direct): Ensure line notes are processed before
1234 computing the end-point of the token.
1235
fb2675cb
PB
12362016-11-23 Paolo Bonzini <bonzini@gnu.org>
1237
1238 * include/cpplib.h (struct cpp_options): Add new member
1239 warn_expansion_to_defined.
1240 (CPP_W_EXPANSION_TO_DEFINED): New enum member.
1241 * expr.c (parse_defined): Warn for all uses of "defined"
1242 in macros, and tie warning to CPP_W_EXPANSION_TO_DEFINED.
1243 Make it a pedwarning instead of a warning.
1244 * system.h (HAVE_DESIGNATED_INITIALIZERS): Do not use
1245 "defined" in macros.
1246
b8f56412
DM
12472016-11-17 David Malcolm <dmalcolm@redhat.com>
1248
1249 * charset.c (cpp_interpret_string_1): Skip locations from
1250 loc_reader when advancing 'p' when handling raw strings.
1251
3549e181
JJ
12522016-11-16 Jakub Jelinek <jakub@redhat.com>
1253
1254 PR bootstrap/72823
1255 * configure.ac (ENABLE_ASSERT_CHECKING): Define if gcc configure
1256 would define that macro.
1257 * configure: Regenerated.
1258 * config.in: Regenerated.
1259
a6ac871c
RE
12602016-11-08 Richard Earnshaw <rearnsha@arm.com>
1261
1262 * lex.c (search_line_fast): New implementation for AArch64.
1263
f5ea989d
DM
12642016-10-25 David Malcolm <dmalcolm@redhat.com>
1265
1266 * files.c (destroy_cpp_file): Free file->path.
1267
2be1b796
DM
12682016-10-25 David Malcolm <dmalcolm@redhat.com>
1269
1270 * include/line-map.h (line_maps::~line_maps): New dtor.
1271 (location_adhoc_data_fini): Delete decl.
1272 * line-map.c (line_maps::~line_maps): New dtor.
1273 (location_adhoc_data_fini): Delete.
1274
58f30963
AP
12752016-10-21 Andris Pavenis <andris.pavenis@iki.fi>
1276
1277 PR preprocessor/71681
1278 * files.c (remap_filename): Fix handling -remap in subdirectories.
1279
70f6d5e1
JJ
12802016-10-12 Jakub Jelinek <jakub@redhat.com>
1281
1282 * include/cpplib.h (struct cpp_options): Add
1283 cpp_warn_implicit_fallthrough.
1284 * init.c (cpp_create_reader): Initialize it to 0.
1285 * lex.c (fallthrough_comment_p): Handle different
1286 cpp_warn_implicit_fallthrough levels. Whitespace fixes.
1287
7bad794a
JJ
12882016-10-08 Jakub Jelinek <jakub@redhat.com>
1289
ee19ef45
JJ
1290 * lex.c (fallthrough_comment_p): Accept Else, fallthrough.
1291
81b02905
JJ
1292 * lex.c (fallthrough_comment_p): Extend to handle more common FALLTHRU
1293 comment styles.
1294
7bad794a
JJ
1295 * lex.c (fallthrough_comment_p): Fix off-by-one size comparison
1296 errors, cleanup.
1297 (_cpp_lex_direct): Allow arbitrary comments in between
1298 fallthrough_comment_p comment and following token.
1299
67ef83c6
KN
13002016-10-04 Kelvin Nilsen <kelvin@gcc.gnu.org>
1301
1302 PR target/77847
1303 * lex.c (search_line_fast): Add a FALLTHROUGH comment to correct
1304 compiler error in the version of this function that is
1305 conditionally compiled when GCC_VERSION >= 4005 and both
1306 __ALTIVEC__ and __BIG_ENDIAN__ symbols are defined.
1307
81fea426
MP
13082016-09-26 Marek Polacek <polacek@redhat.com>
1309 Jakub Jelinek <jakub@redhat.com>
1310
1311 PR c/7652
1312 * include/cpplib.h (PREV_FALLTHROUGH): Define.
1313 * internal.h (CPP_FALLTHRU): Define.
1314 * lex.c (fallthrough_comment_p): New function.
1315 (_cpp_lex_direct): Set PREV_FALLTHROUGH on tokens succeeding a falls
1316 through comment.
1317
bbd6fcf3
DM
13182016-09-23 David Malcolm <dmalcolm@redhat.com>
1319
1320 PR preprocessor/77672
1321 * charset.c (cpp_interpret_string_1): Add a source_range for the
1322 NUL-terminator, using the location of the trailing quote of the
1323 final string.
1324
63cb3926
JM
13252016-09-21 Jason Merrill <jason@redhat.com>
1326
1327 * line-map.c (linemap_location_from_macro_definition_p): New.
1328 * line-map.h: Declare it.
1329
31316208
DM
13302016-09-15 David Malcolm <dmalcolm@redhat.com>
1331
1332 * include/line-map.h (class rich_location): Note that newlines
1333 aren't supported in fix-it text.
1334 * line-map.c (rich_location::add_fixit_insert_before): Reject
1335 attempts to add fix-its containing newlines.
1336 (rich_location::add_fixit_replace): Likewise.
1337
254830ba
DM
13382016-09-13 David Malcolm <dmalcolm@redhat.com>
1339
1340 * include/line-map.h (class rich_location): Add description of
1341 fix-it hints to leading comment.
1342 (rich_location::add_fixit_insert): Rename both overloaded methods
1343 to..
1344 (rich_location::add_fixit_insert_before): ...this, updating their
1345 comments.
1346 (rich_location::add_fixit_insert_after): Two new overloaded
1347 methods.
1348 (rich_location::stop_supporting_fixits): New method.
1349 * line-map.c (rich_location::add_fixit_insert): Rename both
1350 overloaded methods to..
1351 (rich_location::add_fixit_insert_before): ...this, updating their
1352 comments.
1353 (rich_location::add_fixit_insert_after): Two new methods.
1354 (rich_location::reject_impossible_fixit): Split out
1355 failure-handling into...
1356 (rich_location::stop_supporting_fixits): New method.
1357
c65236d6
DM
13582016-09-02 David Malcolm <dmalcolm@redhat.com>
1359
1360 * include/line-map.h (rich_location::seen_impossible_fixit_p): New
1361 accessor.
1362
3d4f9f87
DM
13632016-08-31 David Malcolm <dmalcolm@redhat.com>
1364
1365 * include/line-map.h (class fixit_remove): Remove stray decl.
1366 (fixit_hint::affects_line_p): Make const.
1367 (fixit_insert::affects_line_p): Likewise.
1368 (fixit_replace::affects_line_p): Likewise.
1369 * line-map.c (fixit_insert::affects_line_p): Likewise.
1370 (fixit_replace::affects_line_p): Likewise.
1371
b816477a
DM
13722016-08-30 David Malcolm <dmalcolm@redhat.com>
1373
1374 * include/line-map.h (class semi_embedded_vec): New class.
1375 (semi_embedded_vec<T, NUM_EMBEDDED>::semi_embedded_vec): New ctor.
1376 (semi_embedded_vec<T, NUM_EMBEDDED>::~semi_embedded_vec): New
1377 dtor.
1378 (semi_embedded_vec<T, NUM_EMBEDDED>::operator[]): New methods.
1379 (semi_embedded_vec<T, NUM_EMBEDDED>::push): New method.
1380 (semi_embedded_vec<T, NUM_EMBEDDED>::truncate): New method.
1381 (rich_location::get_num_locations): Reimplement in terms of
1382 m_ranges.
1383 (rich_location::get_range): Make non-inline.
1384 (rich_location::get_num_fixit_hints): Reimplement in terms of
1385 m_fixit_hints.
1386 (rich_location::add_fixit): New function.
1387 (rich_location::MAX_RANGES): Rename to...
1388 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this.
1389 (rich_location::MAX_FIXIT_HINTS): Rename to...
1390 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this, and make
1391 private.
1392 (rich_location::m_num_ranges): Eliminate in favor of...
1393 (rich_location::m_ranges): ...this, converting from a fixed-size
1394 array to a semi_embedded_vec.
1395 (rich_location::m_num_fixit_hints): Eliminate in favor of...
1396 (rich_location::m_fixit_hints): ...this, converting from a
1397 fixed-size array to a semi_embedded_vec.
1398 * line-map.c (rich_location::rich_location): Update for above
1399 changes.
1400 (rich_location::~rich_location): Likewise.
1401 (rich_location::get_loc): Likewise.
1402 (rich_location::get_range): New methods.
1403 (rich_location::add_range): Update for above changes.
1404 (rich_location::set_range): Likewise.
1405 (rich_location::add_fixit_insert): Likewise.
1406 (rich_location::add_fixit_replace): Likewise.
1407 (rich_location::get_last_fixit_hint): Likewise.
1408 (rich_location::reject_impossible_fixit): Likewise.
1409 (rich_location::add_fixit): New method.
1410
f9087798
DM
14112016-08-30 David Malcolm <dmalcolm@redhat.com>
1412
1413 * include/line-map.h (rich_location::add_fixit_insert): Add
1414 comments. Add overload omitting the source_location param.
1415 (rich_location::add_fixit_remove): Add comments. Add overloads
1416 omitting the range, and accepting a source_location.
1417 (rich_location::add_fixit_replace): Likewise.
1418 * line-map.c (rich_location::add_fixit_insert): Add comments. Add
1419 overload omitting the source_location param.
1420 (rich_location::add_fixit_remove): Add comments. Add overloads
1421 omitting the range, and accepting a source_location.
1422 (rich_location::add_fixit_replace): Likewise.
1423
2aa51413
DM
14242016-08-26 David Malcolm <dmalcolm@redhat.com>
1425
1426 * include/line-map.h (get_pure_location): New decl.
1427 * line-map.c (get_pure_location): Move here, from gcc/input.c, adding
1428 a line_maps * param.
1429 (rich_location::add_fixit_insert): Call get_pure_location on "where".
1430 (rich_location::add_fixit_replace): Call get_pure_location on the
1431 end-points.
1432
ee908516
DM
14332016-08-26 David Malcolm <dmalcolm@redhat.com>
1434
1435 * include/line-map.h (rich_location): Eliminate unimplemented
1436 constructor based on source_range.
1437 (rich_location::get_last_fixit_hint): New method.
1438 (rich_location::reject_impossible_fixit): New method.
1439 (rich_location): Add fields m_line_table and
1440 m_seen_impossible_fixit.
1441 (fixit_hint::maybe_append_replace): New pure virtual function.
1442 (fixit_insert::maybe_append_replace): New function.
1443 (fixit_replace::maybe_append_replace): New function.
1444 * line-map.c (rich_location::rich_location): Initialize
1445 m_line_table and m_seen_impossible_fixit.
1446 (rich_location::add_fixit_insert): Call
1447 reject_impossible_fixit and bail out if true.
1448 (column_before_p): New function.
1449 (rich_location::add_fixit_replace): Call reject_impossible_fixit
1450 and bail out if true. Attempt to consolidate with neighboring
1451 fixits.
1452 (rich_location::get_last_fixit_hint): New method.
1453 (rich_location::reject_impossible_fixit): New method.
1454 (fixit_insert::maybe_append_replace): New method.
1455 (fixit_replace::maybe_append_replace): New method.
1456
d672cded
DM
14572016-08-23 David Malcolm <dmalcolm@redhat.com>
1458
1459 * include/line-map.h (source_range::from_locations): New method.
1460
2ffe0809
DM
14612016-08-19 David Malcolm <dmalcolm@redhat.com>
1462
1463 * include/line-map.h (fixit_hint::kind): Delete REPLACE.
1464 (class fixit_remove): Delete.
1465 * line-map.c (rich_location::add_fixit_remove): Reimplement
1466 by calling add_fixit_replace with an empty string.
1467 (fixit_remove::fixit_remove): Delete.
1468 (fixit_remove::affects_line_p): Delete.
1469
c65699ef
JM
14702016-08-19 Joseph Myers <joseph@codesourcery.com>
1471
1472 PR c/32187
1473 * include/cpplib.h (CPP_N_FLOATN, CPP_N_FLOATNX)
1474 (CPP_N_WIDTH_FLOATN_NX, CPP_FLOATN_SHIFT, CPP_FLOATN_MAX): New
1475 macros.
1476 * expr.c (interpret_float_suffix): Handle fN, fNx, FN and FNx
1477 suffixes.
1478
fcf830ab
PK
14792016-08-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
1480
1481 * expr.c (eval_token): Append "evaluates to 0" to Wundef diagnostic.
1482
cb18fd07
DM
14832016-08-18 David Malcolm <dmalcolm@redhat.com>
1484
1485 * directives.c (directive_names): New array.
1486 (_cpp_handle_directive): Offer spelling suggestions for misspelled
1487 directives.
1488 * errors.c (cpp_diagnostic_at_richloc): New function.
1489 (cpp_error_at_richloc): New function.
1490 * include/cpplib.h (struct cpp_callbacks): Add field
1491 "get_suggestion".
1492 (cpp_error_at_richloc): New decl.
1493
9c62c873
MP
14942016-08-18 Marek Polacek <polacek@redhat.com>
1495
1496 PR c/7652
1497 * pch.c (write_macdef): Add CPP_FALLTHRU.
1498
191816a3
MP
14992016-08-12 Marek Polacek <polacek@redhat.com>
1500
1501 PR c/7652
1502 * lex.c (search_line_fast): Add FALLTHRU.
1503 (_cpp_lex_direct): Likewise.
1504 (cpp_token_val_index): Adjust fall through comment.
1505 * macro.c (parse_params): Add FALLTHRU.
1506 * pch.c (count_defs): Adjust fall through comment.
1507 (write_defs): Likewise.
1508
e7864d68
DM
15092016-08-06 David Malcolm <dmalcolm@redhat.com>
1510
1511 PR bootstrap/72823
1512 * charset.c (_cpp_valid_ucn): Replace overzealous assert with one
1513 that allows for char_range to be non-NULL when loc_reader is NULL.
1514
88fa5555
DM
15152016-08-05 David Malcolm <dmalcolm@redhat.com>
1516
1517 * charset.c (cpp_substring_ranges::cpp_substring_ranges): New
1518 constructor.
1519 (cpp_substring_ranges::~cpp_substring_ranges): New destructor.
1520 (cpp_substring_ranges::add_range): New method.
1521 (cpp_substring_ranges::add_n_ranges): New method.
1522 (_cpp_valid_ucn): Add "char_range" and "loc_reader" params; if
1523 they are non-NULL, read position information from *loc_reader
1524 and update char_range->m_finish accordingly.
1525 (convert_ucn): Add "char_range", "loc_reader", and "ranges"
1526 params. If loc_reader is non-NULL, read location information from
1527 it, and update *ranges accordingly, using char_range.
1528 Conditionalize the conversion into tbuf on tbuf being non-NULL.
1529 (convert_hex): Likewise, conditionalizing the call to
1530 emit_numeric_escape on tbuf.
1531 (convert_oct): Likewise.
1532 (convert_escape): Add params "loc_reader" and "ranges". If
1533 loc_reader is non-NULL, read location information from it, and
1534 update *ranges accordingly. Conditionalize the conversion into
1535 tbuf on tbuf being non-NULL.
1536 (cpp_interpret_string): Rename to...
1537 (cpp_interpret_string_1): ...this, adding params "loc_readers" and
1538 "out". Use "to" to conditionalize the initialization and usage of
1539 "tbuf", such as running the converter. If "loc_readers" is
1540 non-NULL, use the instances within it, reading location
1541 information from them, and passing them to convert_escape; likewise
1542 write to "out" if loc_readers is non-NULL. Check for leading
1543 quote and issue an error if it is not present. Update boundary
1544 check from "== limit" to ">= limit" to protect against erroneous
1545 location values to calls that are not parsing string literals.
1546 (cpp_interpret_string): Reimplement in terms to
1547 cpp_interpret_string_1.
1548 (noop_error_cb): New function.
1549 (cpp_interpret_string_ranges): New function.
1550 (cpp_string_location_reader::cpp_string_location_reader): New
1551 constructor.
1552 (cpp_string_location_reader::get_next): New method.
1553 * include/cpplib.h (class cpp_string_location_reader): New class.
1554 (class cpp_substring_ranges): New class.
1555 (cpp_interpret_string_ranges): New prototype.
1556 * internal.h (_cpp_valid_ucn): Add params "char_range" and
1557 "loc_reader".
1558 * lex.c (forms_identifier_p): Pass NULL for new params to
1559 _cpp_valid_ucn.
1560
8204be6c
AS
15612016-08-01 Andreas Schwab <schwab@suse.de>
1562
1563 * include/cpplib.h: Fix comment typo.
1564
a01fc549
DM
15652016-07-27 David Malcolm <dmalcolm@redhat.com>
1566
1567 * include/line-map.h (source_location): Fix line numbers in
1568 comment.
1569
741d3be5
DM
15702016-07-11 David Malcolm <dmalcolm@redhat.com>
1571
1572 * include/line-map.h (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES):
1573 Move here from line-map.c.
1574 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
1575 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): Move from
1576 here to line-map.h.
1577 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
1578
ac81cf0b
DM
15792016-06-22 David Malcolm <dmalcolm@redhat.com>
1580
1581 * directives.c (do_include_common): Pass on "location" to
1582 _cpp_stack_include.
1583 * errors.c (cpp_diagnostic): Reimplement in terms of...
1584 (cpp_diagnostic_at): New function.
1585 (cpp_error_at): New function.
1586 (cpp_errno_filename): Add "loc" param and use it by using
1587 cpp_error_at rather than cpp_error.
1588 * files.c (find_file_in_dir): Add "loc" param and pass it to
1589 open_file_failed.
1590 (_cpp_find_file): Add "loc" param. Use it to convert calls to
1591 cpp_error to cpp_error_at, and pass it to find_file_in_dir and
1592 open_file_failed.
1593 (read_file_guts): Add "loc" param. Use it to convert calls to
1594 cpp_error to cpp_error_at. Pass it to cpp_errno_filename.
1595 (read_file): Add "loc" param. Pass it to open_file_failed and
1596 read_file_guts.
1597 (should_stack_file): Add "loc" param. Pass it to read_file.
1598 (_cpp_stack_file): Add "loc" param. Pass it to should_stack_file.
1599 (_cpp_stack_include): Add "loc" param. Pass it to
1600 _cpp_find_file and _cpp_stack_file.
1601 (open_file_failed): Add "loc" param. Pass it to
1602 cpp_errno_filename.
1603 (_cpp_fake_include): Add 0 as a source_location in call to
1604 _cpp_find_file.
1605 (_cpp_compare_file_date): Likewise.
1606 (cpp_push_include): Likewise for call to _cpp_stack_include.
1607 (cpp_push_default_include): Likewise.
1608 (_cpp_save_file_entries): Likewise for call to open_file_failed.
1609 (_cpp_has_header): Likewise for call to _cpp_find_file.
1610 * include/cpplib.h (cpp_errno_filename): Add source_location
1611 param.
1612 (cpp_error_at): New declaration.
1613 * init.c (cpp_read_main_file): Add 0 as a source_location in calls
1614 to _cpp_find_file and _cpp_stack_file.
1615 * internal.h (_cpp_find_file): Add source_location param.
1616 (_cpp_stack_file): Likewise.
1617 (_cpp_stack_include): Likewise.
1618
a93eac6a
DM
16192016-06-22 David Malcolm <dmalcolm@redhat.com>
1620
1621 * include/line-map.h (fixit_hint::get_start_loc): New pure virtual
1622 function.
1623 (fixit_hint::maybe_get_end_loc): Likewise.
1624 (fixit_insert::get_start_loc): New function, implementing
1625 fixit_hint::get_start_loc.
1626 (fixit_insert::maybe_get_end_loc): New function, implementing
1627 fixit_hint::maybe_get_end_loc.
1628 (fixit_remove::get_start_loc): New function, implementing
1629 fixit_hint::get_start_loc.
1630 (fixit_remove::maybe_get_end_loc): New function, implementing
1631 fixit_hint::maybe_get_end_loc.
1632 (fixit_replace::get_start_loc): New function, implementing
1633 fixit_hint::get_start_loc.
1634 (fixit_replace::maybe_get_end_loc): New function, implementing
1635 fixit_hint::maybe_get_end_loc.
1636
fe55692c
JDA
16372016-06-21 John David Anglin <danglin@gcc.gnu.org>
1638
1639 * line-map.c (location_adhoc_data_update): Use int64_t instead of
1640 long long.
1641 (get_combined_adhoc_loc): Likewise.
1642
15c98b2e
ES
16432016-06-01 Eduard Sanou <dhole@openmailbox.org>
1644
1645 * include/cpplib.h (cpp_callbacks): Add get_source_date_epoch
1646 callback.
1647 * include/cpplib.h (cpp_init_source_date_epoch): Remove prototype.
1648 * init.c (cpp_init_source_date_epoch): Remove function.
1649 * init.c (cpp_create_reader): Initialize pfile->source_date_epoch.
1650 * internal.h (cpp_reader): Extend comment about source_date_epoch.
1651 * macro.c (_cpp_builtin_macro_text): Use get_source_date_epoch
1652 callback only once, read pfile->source_date_epoch on future passes.
1653 Check that get_source_date_epoch callback is not NULL.
1654
ceb17928
ML
16552016-05-20 Martin Liska <mliska@suse.cz>
1656
1657 * config.in: Regenerated.
1658 * configure: Likewise.
1659 * configure.ac: Handle --enable-valgrind-annotations.
1660 * lex.c (new_buff): Use ENABLE_VALGRIND_ANNOTATIONS instead
1661 of ENABLE_VALGRIND_CHECKING.
1662 (_cpp_free_buff): Likewise.
1663
174f6622
ES
16642016-04-28 Eduard Sanou <dhole@openmailbox.org>
1665 Matthias Klose <doko@debian.org>
1666
1667 * include/cpplib.h (cpp_init_source_date_epoch): Prototype.
1668 * init.c (cpp_init_source_date_epoch): New function.
1669 * internal.h: Added source_date_epoch variable to struct
1670 cpp_reader to store a reproducible date.
7365279f
BK
1671 * macro.c (_cpp_builtin_macro_text): Set pfile->date timestamp from
1672 pfile->source_date_epoch instead of localtime if source_date_epoch is
1673 set, to be used for __DATE__ and __TIME__ macros to help reproducible
174f6622
ES
1674 builds.
1675
12de2245
BS
16762016-04-13 Bernd Schmidt <bschmidt@redhat.com>
1677
1678 Patch from Roger Orr <rogero@howzatt.demon.co.uk>
1679 PR preprocessor/69650
1680 * directives.c (do_linemarker): Reread map after calling
1681 cpp_get_token.
1682
64824205
RH
16832016-04-06 Richard Henderson <rth@redhat.com>
1684
1685 PR preprocessor/61817
1686 PR preprocessor/69391
1687 * internal.h (_cpp_builtin_macro_text): Update decl.
1688 * macro.c (_cpp_builtin_macro_text): Accept location for __LINE__.
1689 (builtin_macro): Accept a second location for __LINE__.
1690 (enter_macro_context): Compute both virtual and real expansion
1691 locations for the macro.
1692
3caf0ca1
BS
16932016-03-25 Bernd Schmidt <bschmidt@redhat.com>
1694
1695 PR lto/69650
1696 * directives.c (do_linemarker): Test for file left but not entered
1697 here.
1698 * line-map.c (linemap_add): Not here.
1699
6b366948
JJ
17002016-03-21 Jakub Jelinek <jakub@redhat.com>
1701
1702 PR target/70296
1703 * include/cpplib.h (cpp_fun_like_macro_p): New prototype.
1704 * macro.c (cpp_fun_like_macro_p): New function.
1705
64567cfd
RH
17062016-03-15 Richard Henderson <rth@redhat.com>
1707
1708 * line-map.c (new_linemap): Make alloc_size a size_t.
1709
2aaeea19
JM
17102016-03-14 Jason Merrill <jason@redhat.com>
1711
1712 * expr.c (cpp_classify_number): Hex floats are new in C++1z.
1713 * init.c (lang_defaults): Likewise.
1714
b4f3232d
DM
17152016-03-09 David Malcolm <dmalcolm@redhat.com>
1716
1717 PR c/68473
1718 PR c++/70105
1719 * line-map.c (linemap_macro_map_loc_unwind_toward_spelling): Move
1720 decl...
1721 * include/line-map.h
1722 (linemap_macro_map_loc_unwind_toward_spelling): ...here,
1723 converting from static to extern.
1724
40499f81
DM
17252016-03-09 David Malcolm <dmalcolm@redhat.com>
1726
1727 PR c/68473
1728 PR c++/70105
1729 * include/line-map.h (source_range::debug): Delete.
1730 (struct location_range): Update comment. Replace
1731 expanded_location fields "m_start", "m_finish", and "m_caret" with
1732 a source_location field: "m_loc".
1733 (class rich_location): Reword comment.
1734 (rich_location::get_loc): Reimplement in terms of a new overloaded
1735 variant which takes an unsigned int.
1736 (rich_location::get_loc_addr): Delete.
1737 (rich_location::add_range): Drop params "start" and "finish" in
1738 favor of param "loc". Drop overloaded variants taking a
1739 source_range or location_range *.
1740 (rich_location::lazily_expand_location): Delete in favor of...
1741 (rich_location::get_expanded_location): New decl.
1742 (rich_location::m_loc): Delete field.
1743 (rich_location::m_column_override): New field.
1744 * line-map.c (rich_location::rich_location): Drop name of
1745 line_maps * param. Update initializations for deletion of field
1746 "m_loc" and addition of field "m_column_override". Reimplement
1747 body as a call to add_range. Delete overloaded variant taking a
1748 source_range.
1749 (rich_location::get_loc): New function.
1750 (rich_location::lazily_expand_location): Delete in favor of...
1751 (rich_location::get_expanded_location): New function.
1752 (rich_location::override_column): Reimplement.
1753 (rich_location::add_range): Drop params "start" and "finish" in
1754 favor of param "loc". Eliminate location expansion in favor of
1755 simply storing loc. Drop overloaded variants taking a
1756 source_range or location_range *.
1757 (rich_location::set_range): Eliminate location expansion.
1758
7168133a
DM
17592016-02-29 David Malcolm <dmalcolm@redhat.com>
1760
1761 PR preprocessor/69985
1762 (linemap_position_for_loc_and_offset): Rename param from "offset"
1763 to "column_offset". Right-shift the column_offset by m_range_bits
1764 of the pertinent ordinary map whenever offsetting a
1765 source_location. For clarity, offset the column by the column
1766 offset, rather than the other way around.
1767
196440f8
DM
17682016-02-23 David Malcolm <dmalcolm@redhat.com>
1769
1770 PR preprocessor/69126
1771 PR preprocessor/69543
1772 * line-map.c (linemap_compare_locations): At the function top,
1773 replace inlined bodies of get_location_from_adhoc_loc with calls
1774 to get_location_from_adhoc_loc. Add a pair of calls to
1775 get_location_from_adhoc_loc at the bottom of the function, to
1776 avoid meaningless comparisons of ad-hoc and non-ad-hoc locations.
1777
44714d8c
DM
17782016-02-08 David Malcolm <dmalcolm@redhat.com>
1779
1780 PR preprocessor/69664
1781 * errors.c (cpp_diagnostic_with_line): Only call
1782 rich_location::override_column if the column is non-zero.
1783 * line-map.c (rich_location::override_column): Update columns
1784 within m_ranges[0]. Add assertions to verify that doing so is
1785 sane.
1786
b5c1c988
JJ
17872016-02-05 Jakub Jelinek <jakub@redhat.com>
1788
1789 PR c++/69628
1790 * charset.c (cpp_interpret_charconst): Clear *PCHARS_SEEN
1791 and *UNSIGNEDP if bailing out early due to errors.
1792
e2eb5056
JJ
17932016-01-28 Jakub Jelinek <jakub@redhat.com>
1794
4bda5946
JJ
1795 PR pch/68176
1796 * files.c (_cpp_find_file): Set file->implicit_preinclude even if
1797 included from file->implicit_preinclude header.
1798
e2eb5056
JJ
1799 * directives.c (destringize_and_run): Adjust prototype.
1800
0afff540
DM
18012016-01-27 David Malcolm <dmalcolm@redhat.com>
1802
1803 PR preprocessor/69126
1804 * directives.c (destringize_and_run): Add expansion_loc param; use
1805 it when handling unexpanded pragmas to fixup the locations of the
1806 synthesized tokens.
1807 (_cpp_do__Pragma): Add expansion_loc param and use it when calling
1808 destringize_and_run.
1809 * internal.h (_cpp_do__Pragma): Add expansion_loc param.
1810 * macro.c (builtin_macro): Pass expansion location of _Pragma to
1811 _cpp_do__Pragma.
1812
c7df95d8
DM
18132016-01-14 David Malcolm <dmalcolm@redhat.com>
1814
1815 PR preprocessor/69177
1816 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): New
1817 constant.
1818 (LINE_MAP_MAX_LOCATION_WITH_COLS): Add note about unit tests
1819 to comment.
1820 (can_be_stored_compactly_p): Reduce threshold from
1821 LINE_MAP_MAX_LOCATION_WITH_COLS to
1822 LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES.
1823 (get_combined_adhoc_loc): Likewise.
1824 (get_range_from_loc): Likewise.
1825 (linemap_line_start): Ensure that a new ordinary map is created
1826 when transitioning from range-packing being enabled to disabled,
1827 at the LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES threshold. Set
1828 range_bits to 0 for new ordinary maps when beyond this limit.
1829 Prevent the "increase the column bits of a freshly created map"
1830 optimization if the range bits has reduced.
1831
53290e07
JJ
18322016-01-08 Jakub Jelinek <jakub@redhat.com>
1833
1834 PR c++/69145
1835 * files.c (cpp_included_before): If IS_ADHOC_LOC (location), lookup
1836 real location from the line_table.
1837
818ab71a
JJ
18382016-01-04 Jakub Jelinek <jakub@redhat.com>
1839
1840 Update copyright years.
1841
329590d7
DM
18422015-12-22 David Malcolm <dmalcolm@redhat.com>
1843
1844 * line-map.c (get_combined_adhoc_loc): Remove condition
1845 on locus < RESERVED_LOCATION_COUNT when considering
1846 whether a caret == start == finish location can be
1847 simply stored as the caret location.
1848
f79520bb
DM
18492015-12-07 David Malcolm <dmalcolm@redhat.com>
1850
1851 * include/line-map.h (rich_location::set_range): Add line_maps *
1852 param; convert param from source_range to source_location. Drop
1853 "overwrite_loc_p" param.
1854 * line-map.c (rich_location::set_range): Likewise, acting as if
1855 "overwrite_loc_p" were true, and getting range from the location.
1856
a87a86e1
DM
18572015-11-20 David Malcolm <dmalcolm@redhat.com>
1858
1859 PR 62314
1860 * include/line-map.h (source_range::intersects_line_p): New
1861 method.
1862 (rich_location::~rich_location): New.
1863 (rich_location::add_fixit_insert): New method.
1864 (rich_location::add_fixit_remove): New method.
1865 (rich_location::add_fixit_replace): New method.
1866 (rich_location::get_num_fixit_hints): New accessor.
1867 (rich_location::get_fixit_hint): New accessor.
1868 (rich_location::MAX_FIXIT_HINTS): New constant.
1869 (rich_location::m_num_fixit_hints): New field.
1870 (rich_location::m_fixit_hints): New field.
1871 (class fixit_hint): New class.
1872 (class fixit_insert): New class.
1873 (class fixit_remove): New class.
1874 (class fixit_replace): New class.
1875 * line-map.c (source_range::intersects_line_p): New method.
1876 (rich_location::rich_location): Add initialization of
1877 m_num_fixit_hints to both ctors.
1878 (rich_location::~rich_location): New.
1879 (rich_location::add_fixit_insert): New method.
1880 (rich_location::add_fixit_remove): New method.
1881 (rich_location::add_fixit_replace): New method.
1882 (fixit_insert::fixit_insert): New.
1883 (fixit_insert::~fixit_insert): New.
1884 (fixit_insert::affects_line_p): New.
1885 (fixit_remove::fixit_remove): New.
1886 (fixit_remove::affects_line_p): New.
1887 (fixit_replace::fixit_replace): New.
1888 (fixit_replace::~fixit_replace): New.
1889 (fixit_replace::affects_line_p): New.
1890
46ce03de
JJ
18912015-11-19 Jakub Jelinek <jakub@redhat.com>
1892
1893 PR preprocessor/60736
1894 * include/cpplib.h (cpp_errno_filename): New prototype.
1895 * errors.c (cpp_errno): Don't handle msgid "" specially, use
1896 _(msgid) instead of msgid as argument to cpp_error.
1897 (cpp_errno_filename): New function.
1898 * files.c (read_file_guts): Use cpp_errno_filename instead of
1899 cpp_errno.
1900 (open_file_failed): Likewise. Use file->name if file->path is NULL
1901 in diagnostics.
1902
ebedc9a3
DM
19032015-11-13 David Malcolm <dmalcolm@redhat.com>
1904
1905 * errors.c (cpp_diagnostic): Pass pfile->line_table to
1906 rich_location ctor.
1907 (cpp_diagnostic_with_line): Likewise.
1908 * include/cpplib.h (struct cpp_token): Update comment for src_loc
1909 to indicate that the range of the token is "baked into" the
1910 source_location.
1911 * include/line-map.h (source_location): Update the descriptive
1912 comment to reflect the packing scheme for short ranges, adding
1913 worked examples of location encoding.
1914 (struct line_map_ordinary): Drop field "column_bits" in favor
1915 of field "m_column_and_range_bits"; add field "m_range_bits".
1916 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
1917 (location_adhoc_data): Add source_range field.
1918 (struct line_maps): Add fields "default_range_bits",
1919 "num_optimized_ranges" and "num_unoptimized_ranges".
1920 (get_combined_adhoc_loc): Add source_range param.
1921 (get_range_from_loc): New declaration.
1922 (pure_location_p): New prototype.
1923 (COMBINE_LOCATION_DATA): Add source_range param.
1924 (SOURCE_LINE): Update for renaming of column_bits.
1925 (SOURCE_COLUMN): Likewise. Shift the column right by the map's
1926 range_bits.
1927 (LAST_SOURCE_LINE_LOCATION): Update for renaming of column_bits.
1928 (linemap_position_for_line_and_column): Add line_maps * params.
1929 (rich_location::rich_location): Likewise.
1930 * lex.c (_cpp_lex_direct): Capture the range of the token, baking
1931 it into token->src_loc via a call to COMBINE_LOCATION_DATA.
1932 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): Reduce from 1U << 17 to
1933 1U << 12.
1934 (location_adhoc_data_hash): Add the src_range into
1935 the hash value.
1936 (location_adhoc_data_eq): Require equality of the src_range
1937 values.
1938 (can_be_stored_compactly_p): New function.
1939 (get_combined_adhoc_loc): Add src_range param, and store it,
1940 via a bit-packing scheme for short ranges, otherwise within the
1941 lookaside table. Remove the requirement that data is non-NULL.
1942 (get_range_from_adhoc_loc): New function.
1943 (get_range_from_loc): New function.
1944 (pure_location_p): New function.
1945 (linemap_add): Ensure that start_location has zero for the
1946 range_bits, unless we're past LINE_MAP_MAX_LOCATION_WITH_COLS.
1947 Initialize range_bits to zero. Assert that the start_location
1948 is "pure".
1949 (linemap_line_start): Assert that the
1950 column_and_range_bits >= range_bits.
1951 Update determinination of whether we need to start a new map
1952 using the effective column bits, without the range bits.
1953 Use the set's default_range_bits in new maps, apart from
1954 those with column_bits == 0, which should also have 0 range_bits.
1955 Increase the column bits for new maps by the range bits.
1956 When adding lines to an existing map, use set->highest_line
1957 directly rather than offsetting highest by SOURCE_COLUMN.
1958 Add assertions to sanity-check the return value.
1959 (linemap_position_for_column): Offset to_column by range_bits.
1960 Update set->highest_location if necessary.
1961 (linemap_position_for_line_and_column): Add line_maps * param.
1962 Update the calculation to offset the column by range_bits, and
1963 conditionalize it on being <= LINE_MAP_MAX_LOCATION_WITH_COLS.
1964 Bound it by LINEMAPS_MACRO_LOWEST_LOCATION. Update
1965 set->highest_location if necessary.
1966 (linemap_position_for_loc_and_offset): Handle ad-hoc locations;
1967 pass "set" to linemap_position_for_line_and_column.
1968 (linemap_macro_map_loc_unwind_toward_spelling): Add line_maps
1969 param. Handle ad-hoc locations.
1970 (linemap_location_in_system_header_p): Pass on "set" to call to
1971 linemap_macro_map_loc_unwind_toward_spelling.
1972 (linemap_macro_loc_to_spelling_point): Retain ad-hoc locations.
1973 Pass on "set" to call to
1974 linemap_macro_map_loc_unwind_toward_spelling.
1975 (linemap_resolve_location): Retain ad-hoc locations. Pass on
1976 "set" to call to linemap_macro_map_loc_unwind_toward_spelling.
1977 (linemap_unwind_toward_expansion): Pass on "set" to call to
1978 linemap_macro_map_loc_unwind_toward_spelling.
1979 (linemap_expand_location): Extract the data pointer before
1980 extracting the location.
1981 (rich_location::rich_location): Add line_maps param; use it to
1982 extract the range from the source_location.
1983 * location-example.txt: Regenerate, showing new representation.
1984
8a645150
DM
19852015-11-06 David Malcolm <dmalcolm@redhat.com>
1986
1987 * errors.c (cpp_diagnostic): Update for change in signature
1988 of "error" callback.
1989 (cpp_diagnostic_with_line): Likewise, calling override_column
1990 on the rich_location.
1991 * include/cpplib.h (struct cpp_callbacks): Within "error"
1992 callback, convert param from source_location to rich_location *,
1993 and drop column_override param.
1994 * include/line-map.h (struct source_range): New struct.
1995 (struct location_range): New struct.
1996 (class rich_location): New class.
1997 (linemap_client_expand_location_to_spelling_point): New declaration.
1998 * line-map.c (rich_location::rich_location): New ctors.
1999 (rich_location::lazily_expand_location): New method.
2000 (rich_location::override_column): New method.
2001 (rich_location::add_range): New methods.
2002 (rich_location::set_range): New method.
2003
ee015909
DM
20042015-11-06 David Malcolm <dmalcolm@redhat.com>
2005
2006 * include/line-map.h (struct linemap_stats): Add fields
2007 "adhoc_table_size" and "adhoc_table_entries_used".
2008 * line-map.c (linemap_get_statistics): Populate above fields.
2009
a6c764d0
MM
20102015-11-04 Mikhail Maltsev <maltsevm@gmail.com>
2011
2012 * config.in: Regenerate.
2013 * configure: Regenerate.
2014 * configure.ac: Remove ENABLE_CHECKING.
2015
49445904
UB
20162015-11-03 Uros Bizjak <ubizjak@gmail.com>
2017
2018 * lex.c (search_line_sse42): Correctly advance the pointer to an
2019 aligned address.
2020
525ce910
DM
20212015-11-02 David Malcolm <dmalcolm@redhat.com>
2022
2023 * include/line-map.h (source_location): In the table in the
2024 descriptive comment, show UNKNOWN_LOCATION, BUILTINS_LOCATION,
2025 LINE_MAP_MAX_LOCATION_WITH_COLS, LINE_MAP_MAX_SOURCE_LOCATION.
2026 Add notes about ad-hoc values.
2027
7ec491c0
MM
20282015-10-21 Mikhail Maltsev <maltsevm@gmail.com>
2029
22d66382
MM
2030 * include/line-map.h: Use CHECKING_P instead of ENABLE_CHECKING.
2031 * init.c: Likewise.
2032 * macro.c (struct macro_arg_token_iter, set_arg_token,
2033 macro_arg_token_iter_init, macro_arg_token_iter_forward,
2034 macro_arg_token_iter_get_token, macro_arg_token_iter_get_location,
2035 alloc_expanded_arg_mem, _cpp_backup_tokens): Likewise.
2036
7ec491c0
MM
2037 * config.in: Regenerate.
2038 * configure: Regenerate.
2039 * configure.ac (CHECKING_P): Define.
2040 * system.h (fancy_abort): Declare.
2041 (abort): Define.
2042 (gcc_assert): Define. Use CHECKING_P.
2043
179b8d05
MM
20442015-10-13 Mikhail Maltsev <maltsevm@gmail.com>
2045
2046 * system.h (CHECKING_P, gcc_checking_assert): Define.
2047
87b470b3
MLI
20482015-09-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
2049
2050 PR c/66415
2051 * line-map.c (linemap_position_for_loc_and_offset): Handle the
2052 case of long lines encoded in multiple maps.
2053
85bc8baa
MP
20542015-09-07 Marek Polacek <polacek@redhat.com>
2055
2056 * system.h (INTTYPE_MINIMUM): Rewrite to avoid shift warning.
2057
bf5372e7
YS
20582015-08-06 Yaakov Selkowitz <yselkowi@redhat.com>
2059
2060 * configure: Regenerate.
2061
d17f7d59
TS
20622015-07-08 Thomas Schwinge <thomas@codesourcery.com>
2063
2064 * include/line-map.h (RESERVED_LOCATION_COUNT): Change type to
2065 source_location.
2066
fbb22910
PC
20672015-07-02 Paolo Carlini <paolo.carlini@oracle.com>
2068
d885793d 2069 PR preprocessor/53690
fbb22910
PC
2070 * charset.c (_cpp_valid_ucn): Add cppchar_t * parameter and change
2071 return type to bool. Fix encoding of \u0000 and \U00000000 in C++.
2072 (convert_ucn): Adjust call.
2073 * lex.c (forms_identifier_p): Likewise.
2074 * internal.h (_cpp_valid_ucn): Adjust declaration.
2075
fe95b036
ESR
20762015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
2077
2078 Implement N4197 - Adding u8 character literals
2079 * include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens;
2080 (struct cpp_options): Add utf8_char_literals.
2081 * init.c (struct lang_flags): Add utf8_char_literals;
2082 (struct lang_flags lang_defaults): Add column for utf8_char_literals.
fbb22910 2083 * macro.c (stringify_arg()): Treat CPP_UTF8CHAR token;
fe95b036
ESR
2084 * expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()):
2085 Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens;
2086 (cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token;
2087 (eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token.
2088 * lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens.
2089 * charset.c (converter_for_type(), cpp_interpret_charconst()):
2090 Treat CPP_UTF8CHAR token.
2091
dc6bcf52
UB
20922015-06-30 Uros Bizjak <ubizjak@gmail.com>
2093
2094 * lex.c (search_line_sse42) [__GCC_ASM_FLAG_OUTPUTS__]: New main
2095 loop using asm flag outputs.
2096
a1661b90
MP
20972015-06-08 Marek Polacek <polacek@redhat.com>
2098
2099 PR c/66415
2100 * line-map.c (linemap_position_for_loc_and_offset): Remove
2101 linemap_assert_fails; reverse conditions.
2102
815facd3
MLI
21032015-05-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
2104
2105 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER
2106 LINE_MAP_MAX_LOCATION_WITH_COLS,LINE_MAP_MAX_SOURCE_LOCATION):
2107 New constants.
2108 (linemap_line_start): Use them.
2109 (linemap_position_for_column): Use them.
2110
c819ed29
DM
21112015-05-20 David Malcolm <dmalcolm@redhat.com>
2112
2113 * include/line-map.h (MAP_START_LOCATION): Eliminate the non-const
2114 variant, and tweak comment for the const variant.
2115 (ORDINARY_MAP_STARTING_LINE_NUMBER): Drop the non-const variant.
2116 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
2117 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
2118 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
2119 (ORDINARY_MAP_FILE_NAME): Drop the non-const variant.
2120 (MACRO_MAP_MACRO): Likewise.
2121 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
2122 (MACRO_MAP_LOCATIONS): Likewise.
2123 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
2124 * line-map.c (linemap_add): Replace writes through macros with
2125 direct field accesses.
2126 (linemap_enter_macro): Likewise.
2127 (linemap_line_start): Likewise.
2128
0e50b624
DM
21292015-05-19 David Malcolm <dmalcolm@redhat.com>
2130
2131 * directives.c (do_line): Strengthen local "map" from
2132 const line_map * to const line_map_ordinary *.
2133 (do_linemarker): Likewise.
2134 (_cpp_do_file_change): Assert that we're not dealing with
2135 a macro map. Introduce local "ord_map" via a call to
2136 linemap_check_ordinary, guarded within the check for
2137 non-NULL. Use it for typesafety.
2138 * files.c (cpp_make_system_header): Strengthen local "map" from
2139 const line_map * to const line_map_ordinary *.
2140 * include/cpplib.h (struct cpp_callbacks): Likewise for second
2141 parameter of "file_change" callback.
2142 * include/line-map.h (struct line_map): Convert from a struct
2143 containing a union to a base class.
2144 (struct line_map_ordinary): Convert to a subclass of line_map.
2145 (struct line_map_macro): Likewise.
2146 (linemap_check_ordinary): Strengthen return type from line_map *
2147 to line_map_ordinary *, and add a const-variant.
2148 (linemap_check_macro): New pair of functions.
2149 (ORDINARY_MAP_STARTING_LINE_NUMBER): Strengthen param from
2150 const line_map * to const line_map_ordinary *, eliminating call
2151 to linemap_check_ordinary. Likewise for the non-const variant.
2152 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
2153 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
2154 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Likewise.
2155 (ORDINARY_MAP_FILE_NAME): Likewise.
2156 (MACRO_MAP_MACRO): Strengthen param from const line_map * to
2157 const line_map_macro *. Likewise for the non-const variant.
2158 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
2159 (MACRO_MAP_LOCATIONS): Likewise.
2160 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
2161 (struct maps_info): Replace with...
2162 (struct maps_info_ordinary):...this and...
2163 (struct maps_info_macro): ...this.
2164 (struct line_maps): Convert fields "info_ordinary" and
2165 "info_macro" to the above new structs.
2166 (LINEMAPS_MAP_INFO): Delete both functions.
2167 (LINEMAPS_MAPS): Likewise.
2168 (LINEMAPS_ALLOCATED): Rewrite both variants to avoid using
2169 LINEMAPS_MAP_INFO.
2170 (LINEMAPS_USED): Likewise.
2171 (LINEMAPS_CACHE): Likewise.
2172 (LINEMAPS_MAP_AT): Likewise.
2173 (LINEMAPS_ORDINARY_MAPS): Strengthen return type from line_map *
2174 to line_map_ordinary *.
2175 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
2176 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
2177 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
2178 (LINEMAPS_MACRO_MAPS): Strengthen return type from line_map * to
2179 line_map_macro *.
2180 (LINEMAPS_MACRO_MAP_AT): Likewise.
2181 (LINEMAPS_LAST_MACRO_MAP): Likewise.
2182 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
2183 (linemap_map_get_macro_name): Strengthen param from
2184 const line_map * to const line_map_macro *.
2185 (SOURCE_LINE): Strengthen first param from const line_map * to
2186 const line_map_ordinary *, removing call to
2187 linemap_check_ordinary.
2188 (SOURCE_COLUMN): Likewise.
2189 (LAST_SOURCE_LINE_LOCATION): Likewise.
2190 (LAST_SOURCE_LINE): Strengthen first param from const line_map *
2191 to const line_map_ordinary *.
2192 (LAST_SOURCE_COLUMN): Likewise.
2193 (INCLUDED_FROM): Strengthen return type from line_map * to
2194 line_map_ordinary *., and second param from const line_map *
2195 to const line_map_ordinary *, removing call to
2196 linemap_check_ordinary.
2197 (MAIN_FILE_P): Strengthen param from const line_map * to
2198 const line_map_ordinary *, removing call to
2199 linemap_check_ordinary.
2200 (linemap_position_for_line_and_column): Strengthen param from
2201 const line_map * to const line_map_ordinary *.
2202 (LINEMAP_FILE): Strengthen param from const line_map * to
2203 const line_map_ordinary *, removing call to
2204 linemap_check_ordinary.
2205 (LINEMAP_LINE): Likewise.
2206 (LINEMAP_SYSP): Likewise.
2207 (linemap_resolve_location): Strengthen final param from
2208 const line_map ** to const line_map_ordinary **.
2209 * internal.h (CPP_INCREMENT_LINE): Likewise for local "map".
2210 (linemap_enter_macro): Strengthen return type from
2211 const line_map * to const line_map_macro *.
2212 (linemap_add_macro_token): Likewise for first param.
2213 * line-map.c (linemap_check_files_exited): Strengthen local "map"
2214 from const line_map * to const line_map_ordinary *.
2215 (new_linemap): Introduce local "map_size" and use it when
2216 calculating how large the buffer should be. Rewrite based
2217 on change of info_macro and info_ordinary into distinct types.
2218 (linemap_add): Strengthen locals "map" and "from" from line_map *
2219 to line_map_ordinary *.
2220 (linemap_enter_macro): Strengthen return type from
2221 const line_map * to const line_map_macro *, and local "map" from
2222 line_map * to line_map_macro *.
2223 (linemap_add_macro_token): Strengthen param "map" from
2224 const line_map * to const line_map_macro *.
2225 (linemap_line_start): Strengthen local "map" from line_map * to
2226 line_map_ordinary *.
2227 (linemap_position_for_column): Likewise.
2228 (linemap_position_for_line_and_column): Strengthen first param
2229 from const line_map * to const line_map_ordinary *.
2230 (linemap_position_for_loc_and_offset): Strengthen local "map" from
2231 const line_map * to const line_map_ordinary *.
2232 (linemap_ordinary_map_lookup): Likewise for return type and locals
2233 "cached" and "result".
2234 (linemap_macro_map_lookup): Strengthen return type and locals
2235 "cached" and "result" from const line_map * to
2236 const line_map_macro *.
2237 (linemap_macro_map_loc_to_exp_point): Likewise for param "map".
2238 (linemap_macro_map_loc_to_def_point): Likewise.
2239 (linemap_macro_map_loc_unwind_toward_spelling): Likewise.
2240 (linemap_get_expansion_line): Strengthen local "map" from
2241 const line_map * to const line_map_ordinary *.
2242 (linemap_get_expansion_filename): Likewise.
2243 (linemap_map_get_macro_name): Strengthen param from
2244 const line_map * to const line_map_macro *.
2245 (linemap_location_in_system_header_p): Add call to
2246 linemap_check_ordinary in region guarded by
2247 !linemap_macro_expansion_map_p. Introduce local "macro_map" via
2248 linemap_check_macro in other region, using it in place of "map"
2249 for typesafety.
2250 (first_map_in_common_1): Add calls to linemap_check_macro.
2251 (trace_include): Strengthen param "map" from const line_map * to
2252 const line_map_ordinary *.
2253 (linemap_macro_loc_to_spelling_point): Strengthen final param from
2254 const line_map ** to const line_map_ordinary **. Replace a
2255 C-style cast with a const_cast, and add calls to
2256 linemap_check_macro and linemap_check_ordinary.
2257 (linemap_macro_loc_to_def_point): Likewise.
2258 (linemap_macro_loc_to_exp_point): Likewise.
2259 (linemap_resolve_location): Strengthen final param from
2260 const line_map ** to const line_map_ordinary **.
2261 (linemap_unwind_toward_expansion): Introduce local "macro_map" via
2262 a checked cast and use it in place of *map.
2263 (linemap_unwind_to_first_non_reserved_loc): Strengthen local
2264 "map1" from const line_map * to const line_map_ordinary *.
2265 (linemap_expand_location): Introduce local "ord_map" via a checked
2266 cast and use it in place of map.
2267 (linemap_dump): Make local "map" const. Strengthen local
2268 "includer_map" from line_map * to const line_map_ordinary *.
2269 Introduce locals "ord_map" and "macro_map" via checked casts and
2270 use them in place of "map" for typesafety.
2271 (linemap_dump_location): Strengthen local "map" from
2272 const line_map * to const line_map_ordinary *.
2273 (linemap_get_file_highest_location): Update for elimination of
2274 union.
2275 (linemap_get_statistics): Strengthen local "cur_map" from
2276 line_map * to const line_map_macro *. Update uses of sizeof to
2277 use the appropriate line_map subclasses.
2278 * macro.c (_cpp_warn_if_unused_macro): Add call to
2279 linemap_check_ordinary.
2280 (builtin_macro): Strengthen local "map" from const line_map * to
2281 const line_map_macro *.
2282 (enter_macro_context): Likewise.
2283 (replace_args): Likewise.
2284 (tokens_buff_put_token_to): Likewise for param "map".
2285 (tokens_buff_add_token): Likewise.
2286
ba4ad400
DM
22872015-05-13 David Malcolm <dmalcolm@redhat.com>
2288
2289 * include/line-map.h (source_location): Add a reference to
2290 location-example.txt to the descriptive comment.
2291 * location-example.txt: New file.
2292
0501dbd9
DM
22932015-05-13 David Malcolm <dmalcolm@redhat.com>
2294
2295 * include/line-map.h (MAX_SOURCE_LOCATION): Convert from a macro
2296 to a const source_location.
2297 (RESERVED_LOCATION_COUNT): Likewise.
2298 (linemap_check_ordinary): Convert from a macro to a pair of inline
2299 functions, for const/non-const arguments.
2300 (MAP_START_LOCATION): Likewise.
2301 (ORDINARY_MAP_STARTING_LINE_NUMBER): Likewise.
2302 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
2303 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
2304 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Convert from a macro to a
2305 pair of inline functions, for const/non-const arguments, where the
2306 latter is named...
2307 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): New function.
2308 (ORDINARY_MAP_FILE_NAME): Convert from a macro to a pair of inline
2309 functions, for const/non-const arguments.
2310 (MACRO_MAP_MACRO): Likewise.
2311 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
2312 (MACRO_MAP_LOCATIONS): Likewise.
2313 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
2314 (LINEMAPS_MAP_INFO): Likewise.
2315 (LINEMAPS_MAPS): Likewise.
2316 (LINEMAPS_ALLOCATED): Likewise.
2317 (LINEMAPS_USED): Likewise.
2318 (LINEMAPS_CACHE): Likewise.
2319 (LINEMAPS_ORDINARY_CACHE): Likewise.
2320 (LINEMAPS_MACRO_CACHE): Likewise.
2321 (LINEMAPS_MAP_AT): Convert from a macro to an inline function.
2322 (LINEMAPS_LAST_MAP): Likewise.
2323 (LINEMAPS_LAST_ALLOCATED_MAP): Likewise.
2324 (LINEMAPS_ORDINARY_MAPS): Likewise.
2325 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
2326 (LINEMAPS_ORDINARY_ALLOCATED): Likewise.
2327 (LINEMAPS_ORDINARY_USED): Likewise.
2328 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
2329 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
2330 (LINEMAPS_MACRO_MAPS): Likewise.
2331 (LINEMAPS_MACRO_MAP_AT): Likewise.
2332 (LINEMAPS_MACRO_ALLOCATED): Likewise.
2333 (LINEMAPS_MACRO_USED): Likewise.
2334 (LINEMAPS_MACRO_LOWEST_LOCATION): Likewise.
2335 (LINEMAPS_LAST_MACRO_MAP): Likewise.
2336 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
2337 (IS_ADHOC_LOC): Likewise.
2338 (COMBINE_LOCATION_DATA): Likewise.
2339 (SOURCE_LINE): Likewise.
2340 (SOURCE_COLUMN): Likewise.
2341 (LAST_SOURCE_LINE_LOCATION): Likewise.
2342 (LAST_SOURCE_LINE): Likewise.
2343 (LAST_SOURCE_COLUMN): Likewise.
2344 (LAST_SOURCE_LINE_LOCATION)
2345 (INCLUDED_FROM): Likewise.
2346 (MAIN_FILE_P): Likewise.
2347 (LINEMAP_FILE): Likewise.
2348 (LINEMAP_LINE): Likewise.
2349 (LINEMAP_SYSP): Likewise.
2350 (linemap_location_before_p): Likewise.
2351 * line-map.c (linemap_check_files_exited): Make local "map" const.
2352 (linemap_add): Use SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS.
2353 (linemap_line_start): Likewise.
2354
eb70f327
MH
23552015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
2356
2357 * aclocal.m4: Regenerated with automake-1.11.6.
2358
60c12095
DM
23592015-05-13 David Malcolm <dmalcolm@redhat.com>
2360
2361 * include/line-map.h (linemap_assert): Move up within the file to
2362 before all of the map accessor macros.
2363 (linemap_assert_fails): Likewise.
2364 (linemap_check_ordinary): Likewise.
2365 (linemap_macro_expansion_map_p): Likewise.
2366
c3388e62
DM
23672015-05-12 David Malcolm <dmalcolm@redhat.com>
2368
2369 * directives.c (do_line): Set seen_line_directive on line_table.
2370 (do_linemarker): Likewise.
2371 * include/line-map.h (struct line_maps): Add new field
2372 "seen_line_directive".
2373
fe191308
JM
23742015-05-08 Jason Merrill <jason@redhat.com>
2375
2376 * include/cpplib.h: Add CPP_W_CXX11_COMPAT.
2377 (struct cpp_options): Add cpp_warn_cxx11_compat.
2378 * init.c (cpp_create_reader): Initialize it.
2379 * lex.c (lex_string): Add -Wc++11-compat warning.
2380
21c0a521
DM
23812015-05-05 David Malcolm <dmalcolm@redhat.com>
2382
2383 * pch.c (cpp_valid_state): Fix indentation so that it reflects the
2384 block structure.
2385
c87b25e6
DM
23862015-05-05 David Malcolm <dmalcolm@redhat.com>
2387
2388 * include/line-map.h: Fix comment at the top of the file.
2389 (source_location): Rewrite and expand the comment for this
2390 typedef, adding an ascii-art table to clarify how source_location
2391 values are allocated.
2392 * line-map.c: Fix comment at the top of the file.
2393
ca708025
RB
23942015-04-09 Richard Biener <rguenther@suse.de>
2395
2396 PR pch/65550
2397 * files.c (pch_open_file): Allow main and pre-included files
2398 when trying to open a PCH.
2399
e4b33ee5
JJ
24002015-04-06 Jakub Jelinek <jakub@redhat.com>
2401
2402 PR preprocessor/61977
2403 * lex.c (cpp_peek_token): If peektok is CPP_EOF, back it up
2404 with all tokens peeked by the current function.
2405
b8cd77f4
JJ
24062015-04-02 Jakub Jelinek <jakub@redhat.com>
2407
2408 PR preprocessor/61977
2409 * lex.c (cpp_peek_token): Temporarily clear pfile->cb.line_change.
2410
fb136e35
JJ
24112015-03-23 Jakub Jelinek <jakub@redhat.com>
2412
2413 PR preprocessor/65238
2414 * internal.h (_cpp_scan_out_logical_line): Add third argument.
2415 * directives.c (prepare_directive_trad): Pass false to it.
2416 * traditional.c (_cpp_read_logical_line_trad,
2417 _cpp_create_trad_definition): Likewise.
2418 (struct fun_macro): Add paramc field.
2419 (fun_like_macro): New function.
2420 (maybe_start_funlike): Handle NODE_BUILTIN macros. Initialize
2421 macro->paramc field.
2422 (save_argument): Use macro->paramc instead of
2423 macro->node->value.macro->paramc.
2424 (push_replacement_text): Formatting fix.
2425 (recursive_macro): Use fun_like_macro helper.
2426 (_cpp_scan_out_logical_line): Likewise. Add BUILTIN_MACRO_ARG
2427 argument. Initialize fmacro.paramc field. Handle builtin
2428 function-like macros.
2429
a5858a3d
ESR
24302015-03-16 Edward Smith-Rowland <3dw4rd@verizon.net>
2431
2432 PR c++/64626
2433 * lex.c (lex_number): If a number ends with digit-seps (') skip back
2434 and let lex_string take them.
2435
44d95244
MT
24362015-03-02 Markus Trippelsdorf <markus@trippelsdorf.de>
2437
2438 PR target/65261
2439 * lex.c (search_line_fast): Silence ubsan errors.
2440
f8abc9ba
DS
24412015-02-03 <dodji@redhat.com>
2442
2443 PR preprocessor/64803
2444 * internal.h (cpp_reader::top_most_macro_node): New data member.
2445 * macro.c (enter_macro_context): Pass the location of the end of
2446 the top-most invocation of the function-like macro, or the
2447 location of the expansion point of the top-most object-like macro.
2448 (cpp_get_token_1): Store the top-most macro node in the new
2449 pfile->top_most_macro_node data member.
2450 (_cpp_pop_context): Clear the new cpp_reader::top_most_macro_node
2451 data member.
2452
95d0610c
SN
24532015-01-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
2454
2455 * lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON.
2456
10ef8f28
MP
24572015-01-23 Marek Polacek <polacek@redhat.com>
2458
2459 DR#412
2460 PR preprocessor/60570
2461 * directives.c (do_elif): Don't evaluate #elif conditionals
2462 when they don't need to be.
2463
6e6cb471
JJ
24642015-01-16 Jakub Jelinek <jakub@redhat.com>
2465
2466 * expr.c (cpp_classify_number): Add N_() around ?: string
2467 literals used in cpp_error_with_line call as format string.
2468
5624e564
JJ
24692015-01-05 Jakub Jelinek <jakub@redhat.com>
2470
2471 Update copyright years.
2472
1f8d3e84
JJ
24732014-12-19 Jakub Jelinek <jakub@redhat.com>
2474
2475 PR preprocessor/63831
2476 * directives.c (lex_macro_node): Remove __has_attribute__ handling.
2477 * internal.h (struct spec_node): Remove n__has_attribute__ field.
2478 (struct lexer_state): Remove in__has_attribute__ field.
2479 * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_ATTRIBUTE.
2480 * identifiers.c (_cpp_init_hashtable): Remove __has_attribute__
2481 handling.
2482 * init.c (builtin_array): Add __has_attribute and __has_cpp_attribute.
2483 (cpp_init_special_builtins): Don't initialize __has_attribute
2484 or __has_cpp_attribute if CLK_ASM or pfile->cb.has_attribute is NULL.
2485 * traditional.c (enum ls): Remove ls_has_attribute,
2486 ls_has_attribute_close.
2487 (_cpp_scan_out_logical_line): Remove __has_attribute__ handling.
2488 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_ATTRIBUTE.
2489 * pch.c (cpp_read_state): Remove __has_attribute__ handling.
2490 * expr.c (eval_token): Likewise.
2491 (parse_has_attribute): Removed.
2492
01ca36af
UB
24932014-12-11 Uros Bizjak <ubizjak@gmail.com>
2494
2495 * directives.c (cpp_define_formatted): Use xvasprintf.
2496
b93c0722
MLI
24972014-12-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
2498
2499 * line-map.c (linemap_position_for_loc_and_offset): Add new
2500 linemap_assert_fails.
2501
73bd8329
MLI
25022014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
2503
2504 * include/line-map.h (linemap_assert_fails): Declare.
2505 * line-map.c (linemap_position_for_loc_and_offset): Use it.
2506
9c320ab1
MLI
25072014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
2508
49445904
UB
2509 * line-map.c (linemap_add): Fix typo.
2510 (linemap_line_start): Fix whitespace.
9c320ab1 2511
81fee4a7
JM
25122014-11-29 John Schmerge <jbschmerge@gmail.com>
2513
2514 PR preprocessor/41698
2515 * charset.c (one_utf8_to_utf16): Do not produce surrogate pairs
2516 for 0xffff.
2517
43ba1c6c
JJ
25182014-11-25 Jakub Jelinek <jakub@redhat.com>
2519
2520 PR preprocessor/60436
2521 * line-map.c (linemap_line_start): If highest is above 0x60000000
2522 and we are still tracking columns or highest is above 0x70000000,
2523 force add_map.
2524
8a23b100
UB
25252014-11-20 Uros Bizjak <ubizjak@gmail.com>
2526
2527 PR target/63966
1b6b13f3
UB
2528 * lex.c [__i386__ || __x86_64__]: Compile special SSE functions
2529 only for (__GNUC__ >= 5 || !defined(__PIC__)).
8a23b100 2530
d82f1e13
MLI
25312014-11-13 Manuel López-Ibáñez <manu@gcc.gnu.org>
2532
2533 * include/line-map.h: Include EXPR, so that unused variable warnings
2534 do not occur.
2535
3aa34c1d
MLI
25362014-11-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
2537
2538 PR fortran/44054
2539 * include/line-map.h (linemap_position_for_loc_and_offset):
2540 Declare.
2541 * line-map.c (linemap_position_for_loc_and_offset): New.
2542
35485da9
DM
25432014-11-11 David Malcolm <dmalcolm@redhat.com>
2544
2545 * ChangeLog.jit: New.
2546
42fd12b1
ESR
25472014-11-10 Edward Smith-Rowland <3dw4rd@verizon.net>
2548
2549 * include/cpplib.h (cpp_callbacks): Add has_attribute.
2550 * internal.h (lexer_state): Add in__has_attribute__.
2551 * directives.c (lex_macro_node): Prevent use of __has_attribute__
2552 as a macro.
2553 * expr.c (parse_has_attribute): New function; (eval_token): Look for
2554 __has_attribute__ and route to parse_has_attribute.
2555 * identifiers.c (_cpp_init_hashtable): Initialize n__has_attribute__.
2556 * pch.c (cpp_read_state): Initialize n__has_attribute__.
2557 * traditional.c (enum ls): Add ls_has_attribute, ls_has_attribute_close;
2558 (_cpp_scan_out_logical_line): Attend to __has_attribute__.
2559
be5ffc59
JM
25602014-11-06 Joseph Myers <joseph@codesourcery.com>
2561
2562 * include/cpp-id-data.h (struct cpp_macro): Update comment
2563 regarding parameters.
2564 * include/cpplib.h (struct cpp_macro_arg, struct cpp_identifier):
2565 Add spelling fields.
2566 (struct cpp_token): Update comment on macro_arg.
2567 * internal.h (_cpp_save_parameter): Add extra argument.
2568 (_cpp_spell_ident_ucns): New declaration.
2569 * lex.c (lex_identifier): Add SPELLING argument. Set *SPELLING to
2570 original spelling of identifier.
2571 (_cpp_lex_direct): Update calls to lex_identifier.
2572 (_cpp_spell_ident_ucns): New function, factored out of
2573 cpp_spell_token.
2574 (cpp_spell_token): Adjust FORSTRING argument semantics to return
2575 original spelling of identifiers. Use _cpp_spell_ident_ucns in
2576 !FORSTRING case.
2577 (_cpp_equiv_tokens): Check spellings of identifiers and macro
2578 arguments are identical.
2579 * macro.c (macro_arg_saved_data): New structure.
2580 (paste_tokens): Use original spellings of identifiers from
2581 cpp_spell_token.
2582 (_cpp_save_parameter): Add argument SPELLING. Save both canonical
2583 node and its value.
2584 (parse_params): Update calls to _cpp_save_parameter.
2585 (lex_expansion_token): Save spelling of macro argument tokens.
2586 (_cpp_create_definition): Extract canonical node from saved data.
2587 (cpp_macro_definition): Use UCNs in spelling of macro name. Use
2588 original spellings of macro argument tokens and identifiers.
2589 * traditional.c (scan_parameters): Update call to
2590 _cpp_save_parameter.
2591
701cade1
JM
25922014-11-05 Joseph Myers <joseph@codesourcery.com>
2593
2594 PR preprocessor/9449
2595 * init.c (lang_defaults): Enable extended identifiers for C++ and
2596 C99-based standards.
2597
19a9ba64
AM
25982014-10-22 Alan Modra <amodra@gmail.com>
2599
2600 * symtab.c (ht_create): Use obstack_specify_allocation in place of
2601 _obstack_begin.
2602 * files.c (_cpp_init_files): Likewise.
2603 * init.c (cpp_create_reader): Likewise.
2604 * identifiers.c (_cpp_init_hashtable): Likewise.
2605
3aac0952
MLI
26062014-10-14 Manuel López-Ibáñez <manu@gcc.gnu.org>
2607
2608 * include/line-map.h (linemap_location_from_macro_expansion_p):
2609 const struct line_maps * argument.
2610 (linemap_position_for_line_and_column): const struct line_map *
2611 argument.
2612 * line-map.c (linemap_add_macro_token): Use correct argument name
2613 in comment.
2614 (linemap_position_for_line_and_column): const struct line_map *
2615 argument.
2616 (linemap_macro_map_loc_to_def_point): Fix comment. Make static.
2617 (linemap_location_from_macro_expansion_p): const struct line_maps *
2618 argument.
2619 (linemap_resolve_location): Fix argument names in comment.
2620
0ccaaab0
BS
26212014-10-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
2622
2623 * lex.c (search_line_fast): Add new version to be used for Power8
2624 and later targets when Altivec is enabled. Restrict the existing
2625 Altivec version to big-endian systems so that lvsr is not used on
2626 little endian, where it is deprecated. Remove LE-specific code
2627 from the now-BE-only version.
2628
dc257367
BE
26292014-10-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
2630 Jeff Law <law@redhat.com>
2631
2632 * charset.c (convert_no_conversion): Reallocate memory with 25%
2633 headroom.
2634
a15f7cb8
ESR
26352014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net>
2636
2637 Implement SD-6: SG10 Feature Test Recommendations
2638 * internal.h (lexer_state, spec_nodes): Add in__has_include__.
2639 * directives.c: Support __has_include__ builtin.
2640 * expr.c (parse_has_include): New function to parse __has_include__
2641 builtin; (eval_token()): Use it.
2642 * files.c (_cpp_has_header()): New funtion to look for header;
2643 (open_file_failed()): Not an error to not find a header file for
2644 __has_include__.
2645 * identifiers.c (_cpp_init_hashtable()): Add entry for __has_include__.
2646 * pch.c (cpp_read_state): Lookup __has_include__.
2647 * traditional.c (enum ls, _cpp_scan_out_logical_line()): Walk through
2648 __has_include__ statements.
2649
cc811a8a
BE
26502014-09-30 Bernd Edlinger <bernd.edlinger@hotmail.de>
2651
2652 PR preprocessor/58893
2653 * errors.c (cpp_diagnostic): Fix possible out of bounds access.
2654 * files.c (_cpp_stack_include): Initialize src_loc for IT_CMDLINE.
2655
083e891e
MP
26562014-09-24 Marek Polacek <polacek@redhat.com>
2657
2658 PR c/61405
2659 PR c/53874
2660 * include/cpplib.h (enum cpp_ttype): Define CPP_KEYWORD.
2661
d87fc699
JH
26622014-09-17 Jan Hubicka <hubicka@ucw.cz>
2663
2664 * charset.c (conversion): Rename to ...
2665 (cpp_conversion): ... this one; update.
2666 * files.c (file_hash_entry): Rename to ...
2667 (cpp_file_hash_entry): ... this one ; update.
2668
909eb89c
MP
26692014-09-17 Marek Polacek <polacek@redhat.com>
2670
2671 PR c/61854
2672 * init.c (struct lang_flags): Remove cplusplus_comments.
2673 (cpp_set_lang): Likewise.
2674 (post_options): Likewise.
2675 * lex.c (_cpp_lex_direct): Disallow C++ style comments in C90/C94.
2676
1ef33fd4
MLI
26772014-09-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
2678
2679 * include/cpplib.h (struct cpp_options): Declare warn_normalize as
2680 int instead of enum.
2681
2b71f4a4
MLI
26822014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
2683
2684 * macro.c (replace_args): Use cpp_pedwarning, cpp_warning and
2685 CPP_W flags.
2686 * include/cpplib.h: Add CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC.
2687 * init.c (cpp_create_reader): Do not init to -1 here.
2688 * expr.c (num_binary_op): Use cpp_pedwarning.
2689
81b5d104
MLI
26902014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
2691
2692 * directives.c (check_eol_1): New.
2693 (check_eol_endif_labels): New.
2694 (check_eol): Call check_eol_1.
2695 (do_else,do_endif): Call check_eol_endif_labels.
2696
b753b37b
MLI
26972014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
2698
2699 * macro.c (warn_of_redefinition): Suppress warnings for builtins
2700 that lack the NODE_WARN flag, unless Wbuiltin-macro-redefined.
2701 (_cpp_create_definition): Use Wbuiltin-macro-redefined for
2702 builtins that lack the NODE_WARN flag.
2703 * directives.c (do_undef): Likewise.
2704 * init.c (cpp_init_special_builtins): Do not change flags
2705 depending on Wbuiltin-macro-redefined.
2706
7c05e50c
ESR
27072014-08-28 Edward Smith-Rowland <3dw4rd@verizon.net>
2708
2709 PR cpp/23827 - standard C++ should not have hex float preprocessor
2710 tokens
2711 * libcpp/init.c (lang_flags): Change CXX98 flag for extended numbers
2712 from 1 to 0.
2713 * libcpp/expr.c (cpp_classify_number): Weite error message for improper
2714 use of hex floating literal.
2715
e4276ba5
ESR
27162014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
2717
2718 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z;
2719 Rename CLK_GNUCXX1Y, CLK_CXX1Y to CLK_GNUCXX14, CLK_CXX14;
2720 * init.c (struct lang_flags lang_defaults): Add column for trigraphs;
2721 Add rows for CLK_GNUCXX1Z, CLK_CXX1Z; (cpp_set_lang): Set trigraphs;
2722 (cpp_init_builtins): Set __cplusplus to 201402L for C++14;
2723 Set __cplusplus to 201500L for C++17.
2724 * expr.c (cpp_classify_number): Change C++1y to C++14 in binary
2725 constants error message.
2726
dd3ff077
MP
27272014-08-20 Marek Polacek <polacek@redhat.com>
2728
2729 * include/cpplib.h (cpp_options): Use signed char.
2730 * lex.c (_cpp_lex_direct): Don't warn in C++ mode.
2731
3f4f5c9a
MP
27322014-08-19 Marek Polacek <polacek@redhat.com>
2733
2734 * lex.c (_cpp_lex_direct): Fix a typo.
2735
177cce46
MP
27362014-08-19 Marek Polacek <polacek@redhat.com>
2737
2738 * charset.c (_cpp_valid_ucn): Warn only if -Wc90-c99-compat.
2739 * lex.c (_cpp_lex_direct): Likewise.
2740 * macro.c (replace_args): Likewise.
2741 (parse_params): Likewise.
2742 * include/cpplib.h (cpp_options): Change cpp_warn_c90_c99_compat
2743 to char.
2744
f3bede71
MP
27452014-08-10 Marek Polacek <polacek@redhat.com>
2746
2747 PR c/51849
2748 * lex.c (_cpp_lex_direct): Warn when -Wc90-c99-compat is in effect.
2749 * charset.c (_cpp_valid_ucn): Likewise.
2750 * include/cpplib.h (cpp_options): Add cpp_warn_c90_c99_compat.
2751 * macro.c (replace_args): Warn when -Wc90-c99-compat is in effect.
2752 (parse_params): Likewise.
2753
61eb99f6
MP
27542014-07-27 Marek Polacek <polacek@redhat.com>
2755
2756 PR c/61861
2757 * macro.c (builtin_macro): Add location parameter. Set
2758 location of builtin macro to the expansion point.
2759 (enter_macro_context): Pass location to builtin_macro.
2760
c468587a
DS
27612014-07-16 Dodji Seketeli <dodji@redhat.com>
2762
2763 Support location tracking for built-in macro tokens
2764 * include/line-map.h (line_maps::builtin_location): New data
2765 member.
2766 (line_map_init): Add a new parameter to initialize the new
2767 line_maps::builtin_location data member.
2768 * line-map.c (linemap_init): Initialize the
2769 line_maps::builtin_location data member.
2770 * macro.c (builtin_macro): Create a macro map and track the token
2771 resulting from the expansion of a built-in macro.
2772
3976796b
ESR
27732014-07-10 Edward Smith-Rowland <3dw4rd@verizon.net>
2774 Jonathan Wakely <jwakely@redhat.com>
2775
c786fca6 2776 PR preprocessor/61389
3976796b
ESR
2777 * macro.c (_cpp_arguments_ok, parse_params, create_iso_definition):
2778 Warning messages mention C++11 in c++ mode and C99 in c mode.
2779 * lex.c (lex_identifier_intern, lex_identifier): Ditto
2780
7aee8646
ESR
27812014-07-09 Edward Smith-Rowland <3dw4rd@verizon.net>
2782
2783 PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped
2784 by preprocessor
2785 * lex.c (lex_raw_string ()): Do not warn about invalid suffix
2786 if skipping. (lex_string ()): Ditto.
2787
98ba7482
ESR
27882014-06-04 Edward Smith-Rowland <3dw4rd@verizon.net>
2789
2790 PR c++/61038
2791 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
2792 Combine user-defined escape logic with the other string and char logic.
2793
edf6ddf6
RB
27942014-05-26 Richard Biener <rguenther@suse.de>
2795
2796 * configure.ac: Remove long long and __int64 type checks,
2797 add check for uint64_t and fail if that wasn't found.
2798 * include/cpplib.h (cpp_num_part): Use uint64_t.
2799 * config.in: Regenerate.
2800 * configure: Likewise.
2801
28939589
MP
28022014-05-21 Marek Polacek <polacek@redhat.com>
2803
2804 PR c/61212
2805 * files.c (find_file_in_dir): Add parens around &&.
2806
49039169
ESR
28072014-05-20 Edward Smith-Rowland <3dw4rd@verizon.net>
2808
28939589 2809 PR c++/61038
49039169
ESR
2810 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
2811 Check for user-defined literal strings and user-defined literal chars
2812 to escape necessary characters.
2813
54da09ee
RB
28142014-05-20 Richard Biener <rguenther@suse.de>
2815
2816 * configure.ac: Copy gcc logic of detecting a 64bit type.
2817 Remove HOST_WIDE_INT define.
2818 * include/cpplib.h: typedef cpp_num_part to a 64bit type,
2819 similar to how hwint.h does it.
2820 * config.in: Regenerate.
2821 * configure: Likewise.
2822
eac3e079
JY
28232014-05-09 Joey Ye <joey.ye@arm.com>
2824
2825 * files.c (find_file_in_dir): Always try to shorten for DOS
2826 non-system headers.
2827 * init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS.
2828
f543058d
RB
28292014-05-07 Richard Biener <rguenther@suse.de>
2830
2831 * configure.ac: Always set need_64bit_hwint to yes.
2832 * configure: Regenerated.
2833
d9f069ab
RO
28342014-04-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2835
2836 * lex.c: Remove Solaris 9 reference.
2837
341c653c
WL
28382014-02-24 Walter Lee <walt@tilera.com>
2839
2840 * configure.ac: Change "tilepro" triplet to "tilepro*".
2841 * configure: Regenerate.
2842
179652df
JJ
28432014-02-19 Jakub Jelinek <jakub@redhat.com>
2844
2845 PR preprocessor/58844
2846 * macro.c (enter_macro_context): Only push
2847 macro_real_token_count (macro) tokens rather than
2848 macro->count tokens, regardless of
2849 CPP_OPTION (pfile, track-macro-expansion).
2850
acf601ae
JJ
28512014-02-07 Jakub Jelinek <jakub@redhat.com>
2852
2853 PR preprocessor/56824
2854 * line-map.c (get_combined_adhoc_loc, linemap_get_expansion_line,
2855 linemap_get_expansion_filename, linemap_location_in_system_header_p,
2856 linemap_location_from_macro_expansion_p,
2857 linemap_macro_loc_to_spelling_point, linemap_macro_loc_to_def_point,
2858 linemap_macro_loc_to_exp_point, linemap_expand_location): Fix
2859 formatting.
2860 (linemap_compare_locations): Look through adhoc locations for both
2861 l0 and l1.
2862
7ecc3eb9
DS
28632014-01-23 Dodji Seketeli <dodji@redhat.com>
2864
2865 PR PR preprocessor/58580
2866 * include/line-map.h (linemap_get_file_highest_location): Declare
2867 new function.
2868 * line-map.c (linemap_get_file_highest_location): Define it.
2869
35c3d610
RS
28702014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
2871
2872 Update copyright years
2873
3a4efce7
JM
28742013-12-09 Joseph Myers <joseph@codesourcery.com>
2875
2876 PR preprocessor/55715
2877 * expr.c (num_binary_op): Implement subtraction directly rather
2878 than with negation and falling through into addition case.
2879
aadce585
BS
28802013-11-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
2881
2882 * lex.c (search_line_fast): Correct for little endian.
2883
d3f4ff8b
JM
28842013-11-15 Joseph Myers <joseph@codesourcery.com>
2885
2886 * ucnid.tab: Add C11 and C11NOSTART data.
2887 * makeucnid.c (digit): Rename enum value to N99.
2888 (C11, N11, all_languages): New enum values.
2889 (NUM_CODE_POINTS, MAX_CODE_POINT): New macros.
2890 (flags, decomp, combining_value): Use NUM_CODE_POINTS as array
2891 size.
2892 (decomp): Use unsigned int as element type.
2893 (all_decomp): New array.
2894 (read_ucnid): Handle C11 and C11NOSTART. Use MAX_CODE_POINT.
2895 (read_table): Use MAX_CODE_POINT. Store all decompositions in
2896 all_decomp.
2897 (read_derived): Use MAX_CODE_POINT.
2898 (write_table): Use NUM_CODE_POINTS. Print N99, C11 and N11
2899 flags. Print whole array variable declaration rather than just
2900 array contents.
2901 (char_id_valid, write_context_switch): New functions.
2902 (main): Call write_context_switch.
2903 * ucnid.h: Regenerate.
2904 * include/cpplib.h (struct cpp_options): Add c11_identifiers.
2905 * init.c (struct lang_flags): Add c11_identifiers.
2906 (cpp_set_lang): Set c11_identifiers option from selected language.
2907 * internal.h (struct normalize_state): Document "previous" as
2908 previous starter character.
2909 (NORMALIZE_STATE_UPDATE_IDNUM): Take character as argument.
2910 * charset.c (DIG): Rename enum value to N99.
2911 (C11, N11): New enum values.
2912 (struct ucnrange): Give name to struct. Use short for flags and
2913 unsigned int for end of range. Include ucnid.h for whole variable
2914 declaration.
2915 (ucn_valid_in_identifier): Allow for characters up to 0x10FFFF.
2916 Allow for C11 in determining valid characters and valid start
2917 characters. Use check_nfc for non-Hangul context-dependent
2918 checks. Only store starter characters in nst->previous.
2919 (_cpp_valid_ucn): Pass new argument to
2920 NORMALIZE_STATE_UPDATE_IDNUM.
2921 * lex.c (lex_identifier): Pass new argument to
2922 NORMALIZE_STATE_UPDATE_IDNUM. Call NORMALIZE_STATE_UPDATE_IDNUM
2923 after initial non-UCN part of identifier.
2924 (lex_number): Pass new argument to NORMALIZE_STATE_UPDATE_IDNUM.
2925
54848ff8
JM
29262013-11-15 Joseph Myers <joseph@codesourcery.com>
2927
2928 * ucnid.tab: Mark C99 digits as [C99DIG].
2929 * makeucnid.c (read_ucnid): Handle [C99DIG].
2930 (read_table): Don't check for digit characters.
2931 * ucnid.h: Regenerate.
2932
5157b91e
TB
29332013-11-06 Tobias Burnus <burnus@net-b.de>
2934
2935 * macro.c (_cpp_builtin_macro_text): Correct
2936 wording of two warnings.
2937
e8ff5196
TB
29382013-11-05 Tobias Burnus <burnus@net-b.de>
2939
2940 * include/cpplib.h (CPP_W_DATE_TIME): Added.
2941 (cpp_options): Add warn_date_time.
2942 * init.c (cpp_create_reader): Init it.
2943 * macro.c (_cpp_builtin_macro_text): Warn when
2944 __DATE__/__TIME__/__TIMESTAMP__ is used.
2945
7057e645
ESR
29462013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
2947
e8ff5196 2948 Implement C++14 digit separators.
7057e645
ESR
2949 * include/cpplib.h (cpp_options): Add digit_separators flag.
2950 * internal.h (DIGIT_SEP(c)): New macro.
2951 * expr.c (cpp_classify_number): Check improper placement of digit sep;
2952 (cpp_interpret_integer): Skip over digit separators.
2953 * init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add
2954 digit separator flags per language; (cpp_set_lang): Set
2955 digit_separators
2956 * lex.c (lex_number): Add digits separator to allowable characters for
2957 C++14.
2958
459260ec
DM
29592013-10-15 David Malcolm <dmalcolm@redhat.com>
2960
2961 * Makefile.in (PICFLAG): New.
2962 (ALL_CFLAGS): Add PICFLAG.
2963 (ALL_CXXFLAGS): Likewise.
2964 * configure.ac: Add --enable-host-shared, setting up new
2965 PICFLAG variable.
2966 * configure: Regenerate.
2967
fd6eea0c
RE
29682013-08-07 Richard Earnshaw <rearnsha@arm.com>
2969
2970 * configure.ac: Set need_64bit_hwint for all arm targets.
2971 * configure: Regenerated.
2972
8cf88735
JJ
29732013-07-20 Jakub Jelinek <jakub@redhat.com>
2974
2975 PR preprocessor/57620
2976 * lex.c (lex_raw_string): Undo phase1 and phase2 transformations
2977 between R" and final " rather than only in between R"del( and )del".
2978
87e356ba
JJ
29792013-07-10 Jakub Jelinek <jakub@redhat.com>
2980
d5e48350
JJ
2981 PR preprocessor/57824
2982 * lex.c (lex_raw_string): Allow reading new-lines if
2983 in_deferred_pragma or if parsing_args and there is still
2984 data in the current buffer.
2985
c26302d5
JJ
2986 * include/cpplib.h (cpp_token_val_index): Change parameter type to
2987 const cpp_token *.
2988 * lex.c (cpp_token_val_index): Likewise.
2989
87e356ba
JJ
2990 PR preprocessor/57757
2991 * lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING
2992 or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that
2993 starts if a-zA-Z_.
2994
c865f923
ESR
29952013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
2996
2997 * lex.c (lex_raw_string(), lex_string()): Constrain suffixes treated
2998 as concatenated literal and macro to just the patterns found in
2999 inttypes.h; (is_macro()): New.
3000
39953c79
DC
30012013-06-24 Dehao Chen <dehao@google.com>
3002
3003 * files.c (_cpp_stack_include): Fix the highest_location when header
3004 file is guarded by #ifndef and is included twice.
3005
01187df0
JJ
30062013-04-28 Jakub Jelinek <jakub@redhat.com>
3007
3008 N3472 binary constants
3009 * include/cpplib.h (struct cpp_options): Fix a typo in user_literals
3010 field comment. Add binary_constants field.
3011 * init.c (struct lang_flags): Add binary_constants field.
3012 (lang_defaults): Add bin_cst column to the table.
3013 (cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants).
3014 * expr.c (cpp_classify_number): Talk about C++11 instead of C++0x
3015 in diagnostics. Accept binary constants if
3016 CPP_OPTION (pfile, binary_constants) even when pedantic. Adjust
3017 pedwarn message.
3018
61949153
PC
30192013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
3020
3021 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y.
3022 * init.c (lang_defaults): Add defaults for the latter.
3023 (cpp_init_builtins): Define __cplusplus as 201300L for the latter.
3024 * lex.c (_cpp_lex_direct): Update.
3025
994a4cc0
SH
30262013-04-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
3027
3028 PR target/56771
3029 * configure.ac: Require 64-bit int for arm*-*-rtems*.
3030 * configure: Regenerate.
3031
28937f11
JJ
30322013-03-06 Jakub Jelinek <jakub@redhat.com>
3033
3034 PR middle-end/56461
3035 * internal.h (struct cpp_buffer): Add to_free field.
3036 (_cpp_pop_file_buffer): Add third argument.
3037 * files.c (_cpp_stack_file): Set buffer->to_free.
3038 (_cpp_pop_file_buffer): Add to_free argument. Free to_free
3039 if non-NULL, and if equal to file->buffer_start, also clear
3040 file->buffer{,_start,_valid}.
3041 * directives.c (_cpp_pop_buffer): Pass buffer->to_free
3042 to _cpp_pop_file_buffer.
3043
3b8af25b
JJ
30442013-03-01 Jakub Jelinek <jakub@redhat.com>
3045
3046 PR middle-end/56461
3047 * files.c (_cpp_save_file_entries): Free result at the end.
3048 * pch.c (cpp_string_free): New function.
3049 (cpp_save_state): Use it in htab_create call.
3050 (cpp_write_pch_deps): Free ss->defs. Destroy ss->definedhash.
3051
1a80db97
JJ
30522013-02-28 Jakub Jelinek <jakub@redhat.com>
3053
15fd8332
JJ
3054 * files.c (_cpp_find_file): If returning early, before storing
3055 something to *hash_slot and *hash_slot is NULL, call htab_clear_slot
3056 on it. Access *hash_slot using void * type rather than
3057 struct file_hash_entry * to avoid aliasing issues.
3058
1a80db97
JJ
3059 * configure.ac: Don't define ENABLE_CHECKING whenever
3060 --enable-checking is seen, instead use similar --enable-checking=yes
3061 vs. --enable-checking=release default as gcc/ subdir has and
3062 define ENABLE_CHECKING if ENABLE_CHECKING is defined in gcc/.
3063 Define ENABLE_VALGRIND_CHECKING if requested.
3064 * lex.c (new_buff): If ENABLE_VALGRIND_CHECKING, put _cpp_buff
3065 struct first in the allocated buffer and result->base after it.
3066 (_cpp_free_buff): If ENABLE_VALGRIND_CHECKING, free buff itself
3067 instead of buff->base.
3068 * config.in: Regenerated.
3069 * configure: Regenerated.
3070
561f7fc7
ESR
30712013-02-13 Ed Smith-Rowland <3dw4rd@verizon.net>
3072
3073 PR c++/55582
61949153 3074 * lex.c (lex_raw_string): Allow string literal with suffix
561f7fc7
ESR
3075 beginning with 's' to be parsed as a C++11 user-defined literal.
3076
500f3ed9
RS
30772013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
3078
3079 Update copyright years.
3080
1582c677
PC
30812013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
3082
3083 PR c++/54526 (again)
3084 * lex.c (_cpp_lex_direct): In C++11 mode, implement 2.5 p3, bullet 2.
3085
8ac16127
MG
30862013-01-03 Marc Glisse <marc.glisse@inria.fr>
3087
3088 PR bootstrap/50177
3089 * line-map.c (get_combined_adhoc_loc): Cast from extern "C" type.
3090 (new_linemap): Likewise.
3091 (linemap_enter_macro): Likewise.
3092
f41e5bd1
JJ
30932012-12-03 Jakub Jelinek <jakub@redhat.com>
3094
3095 PR bootstrap/55380
3096 PR other/54691
3097 * files.c (read_file_guts): Allocate extra 16 bytes instead of
3098 1 byte at the end of buf. Pass size + 16 instead of size
3099 to _cpp_convert_input.
3100 * charset.c (_cpp_convert_input): Reallocate if there aren't
3101 at least 16 bytes beyond to.len in the buffer. Clear 16 bytes
3102 at to.text + to.len.
3103
31962032
SE
31042012-11-21 Steve Ellcey <sellcey@mips.com>
3105
3106 PR pch/55399
3107 * files.c (pch_open_file): Fix check for implicit_preinclude.
3108
5dc99c46
SB
31092012-11-16 Simon Baldwin <simonb@google.com>
3110
3111 * include/cpplib.h (struct cpp_options): Add canonical_system_headers.
3112 * files.c (find_file_in_dir): Call maybe_shorter_path() only if
3113 canonical_system_headers is set.
3114 * init.c (cpp_create_reader): Initialize canonical_system_headers.
3115 * configure.ac: Add new --enable-canonical-system-headers.
3116 * configure: Regenerate.
3117 * config.in: Regenerate.
3118
a4a0016d
ESR
31192012-11-09 Ed Smith-Rowland <3dw4rd@verizon.net>
3120
3121 PR c++/54413
3122 * include/cpplib.h (cpp_interpret_float_suffix): Add cpp_reader* arg.
3123 (cpp_interpret_int_suffix): Add cpp_reader* arg.
3124 * init.c (cpp_create_reader): Iitialize new flags.
3125 * expr.c (interpret_float_suffix): Use new flags.
3126 (cpp_interpret_float_suffix): Add cpp_reader* arg.
3127 (interpret_int_suffix): Use new flags.
3128 (cpp_interpret_int_suffix): Add cpp_reader* arg.
3129 (cpp_classify_number): Adjust calls to interpret_x_suffix.
3130
04ce690f
IB
31312012-10-23 Ian Bolton <ian.bolton@arm.com>
3132 Jim MacArthur <jim.macarthur@arm.com>
3133 Marcus Shawcroft <marcus.shawcroft@arm.com>
3134 Nigel Stephens <nigel.stephens@arm.com>
3135 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
3136 Richard Earnshaw <rearnsha@arm.com>
3137 Sofiane Naci <sofiane.naci@arm.com>
3138 Stephen Thomas <stephen.thomas@arm.com>
3139 Tejas Belagod <tejas.belagod@arm.com>
3140 Yufeng Zhang <yufeng.zhang@arm.com>
3141
3142 * configure.ac: Enable AArch64.
3143 * configure: Regenerate.
3144
1efcb8c6
JM
31452012-10-23 Joseph Myers <joseph@codesourcery.com>
3146
3147 * files.c (struct _cpp_file): Add implicit_preinclude.
3148 (pch_open_file): Allow a previously opened implicitly included
3149 file.
3150 (_cpp_find_file): Add implicit_preinclude argument. Free file and
3151 do not call open_file_failed if implicit_preinclude. Store
3152 implicit_preinclude value.
3153 (_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date):
3154 Update calls to _cpp_find_file.
3155 (_cpp_stack_include): Handle IT_DEFAULT.
3156 (cpp_push_default_include): New.
3157 * include/cpplib.h (cpp_push_default_include): Declare.
3158 * init.c (cpp_read_main_file): Update call to _cpp_find_file.
3159 * internal.h (enum include_type): Add IT_DEFAULT.
3160 (_cpp_find_file): Update prototype.
3161
55e7f907
TB
31622012-10-15 Tobias Burnus <burnus@net-b.de>
3163
3164 * files.c (read_file_guts, _cpp_save_file_entries): Free memory
3165 before returning.
3166 * lex.c (warn_about_normalization): Ditto.
3167 * mkdeps.c (deps_save): Ditto.
3168 * pch.c (cpp_valid_state): Ditto.
3169
f591bd8f
FW
31702012-10-04 Florian Weimer <fweimer@redhat.com>
3171
3172 * directives.c (do_pragma_warning_or_error): New.
3173 (do_pragma_warning): New.
3174 (do_pragma_error): New.
3175 (_cpp_init_internal_pragmas): Register new pragmas.
3176
ec6e0399
DC
31772012-09-25 Dehao Chen <dehao@google.com>
3178
3179 PR middle-end/54704
3180 * line-map.c (location_adhoc_data_hash): Fix the hash function.
3181
52187008
DC
31822012-09-25 Dehao Chen <dehao@google.com>
3183
3184 PR middle-end/54645
3185 * include/line-map.h (location_adhoc_data): Move location_adhoc_data
3186 into GC.
3187 (location_adhoc_data_map): Likewise.
3188 (line_maps): Likewise.
3189 (rebuild_location_adhoc_htab): New Function.
3190 * line-map.c (+rebuild_location_adhoc_htab): new Funcion.
3191 (get_combined_adhoc_loc): Move location_adhoc_data into GC.
3192 (location_adhoc_data_fini): Likewise.
3193 (linemap_init): Likewise.
3194 (location_adhoc_data_init): Remove Function.
3195
5368224f
DC
31962012-09-19 Dehao Chen <dehao@google.com>
3197
3198 * include/line-map.h (MAX_SOURCE_LOCATION): New value.
3199 (location_adhoc_data_fini): New.
3200 (get_combined_adhoc_loc): New.
3201 (get_data_from_adhoc_loc): New.
3202 (get_location_from_adhoc_loc): New.
3203 (location_adhoc_data_map): New.
3204 (COMBINE_LOCATION_DATA): New.
3205 (IS_ADHOC_LOC): New.
3206 (expanded_location): New field.
3207 (line_maps): New field.
3208 * line-map.c (location_adhoc_data): New.
3209 (location_adhoc_data_hash): New.
3210 (location_adhoc_data_eq): New.
3211 (location_adhoc_data_update): New.
3212 (get_combined_adhoc_loc): New.
3213 (get_data_from_adhoc_loc): New.
3214 (get_location_from_adhoc_loc): New.
3215 (location_adhoc_data_init): New.
3216 (location_adhoc_data_fini): New.
3217 (linemap_init): Initialize location_adhoc_data.
3218 (linemap_lookup): Change to use new location.
3219 (linemap_ordinary_map_lookup): Likewise.
3220 (linemap_macro_map_lookup): Likewise.
3221 (linemap_macro_map_loc_to_def_point): Likewise.
3222 (linemap_macro_map_loc_unwind_toward_spel): Likewise.
3223 (linemap_get_expansion_line): Likewise.
3224 (linemap_get_expansion_filename): Likewise.
3225 (linemap_location_in_system_header_p): Likewise.
3226 (linemap_location_from_macro_expansion_p): Likewise.
3227 (linemap_macro_loc_to_spelling_point): Likewise.
3228 (linemap_macro_loc_to_def_point): Likewise.
3229 (linemap_macro_loc_to_exp_point): Likewise.
3230 (linemap_resolve_location): Likewise.
3231 (linemap_unwind_toward_expansion): Likewise.
3232 (linemap_unwind_to_first_non_reserved_loc): Likewise.
3233 (linemap_expand_location): Likewise.
3234 (linemap_dump_location): Likewise.
3235 (linemap_line_start): Likewise.
3236
f3d25c65
DS
32372012-05-25 Dodji Seketeli <dodji@redhat.com>
3238
3239 PR preprocessor/53469
3240 * directives.c (do_pragma): Use the virtual location for the
3241 pragma token, instead of its spelling location.
3242
0823efed
DN
32432012-08-14 Diego Novillo <dnovillo@google.com>
3244
3245 Merge from cxx-conversion branch. Configury.
3246
3247 * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
3248 * configure.ac: Likewise.
3249 * configure: Regenerate.
3250
32512012-08-14 Lawrence Crowl <crowl@google.com>
3252
3253 Merge from cxx-conversion branch. New C++ hash table.
3254
3255 * include/symtab.h (typedef struct ht hash_table): Change the typedef
3256 name to cpp_hash_table. Update all users of the typedef.
3257
c0fd3497
LB
32582012-07-30 Laurynas Biveinis <laurynas.biveinis@gmail.com>
3259
3260 * include/line-map.h (line_map_macro): Use the "atomic" GTY option
3261 for the macro_locations field.
3262
d35d1c0f
UB
32632011-06-19 Uros Bizjak <ubizjak@gmail.com>
3264
3265 * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
3266 __builtin_ia32_pcmpestri128 instead of asm.
3267
d86d2119
DA
32682012-06-04 Dimitrios Apostolou <jimis@gmx.net>
3269
3270 * line-map.c (linemap_enter_macro): Don't zero max_column_hint in
3271 every macro. This improves performance by reducing the number of
3272 reallocations when track-macro-expansion is on.
3273
7ca643e1
DS
32742012-06-04 Dodji Seketeli <dodji@redhat.com>
3275
3276 PR preprocessor/53463
3277 * line-map.c (linemap_location_in_system_header_p): For built-in
3278 macro tokens, check the first expansion point location that is not
3279 for a token coming from a built-in macro.
3280
7d9641cc
JM
32812012-05-29 Joseph Myers <joseph@codesourcery.com>
3282
3283 * directives.c: Fix typos.
3284 * include/line-map.h: Fix typos.
3285 * line-map.c: Fix typos.
3286 * macro.c: Fix typos.
3287
53a103d3
DS
32882012-05-25 Dodji Seketeli <dodji@redhat.com>
3289
3290 PR bootstrap/53459
3291 * lex.c (search_line_fast): Avoid unused local typedefs to simulate
3292 a static assertion.
3293
828a7f76
DS
32942012-05-29 Dodji Seketeli <dodji@redhat.com>
3295
3296 PR preprocessor/53229
3297 * internal.h (cpp_reader::set_invocation_location): Remove.
3298 (cpp_reader::about_to_expand_macro_p): New member flag.
3299 * directives.c (do_pragma): Remove Kludge as
3300 pfile->set_invocation_location is no more.
3301 * macro.c (cpp_get_token_1): Do away with the use of
3302 cpp_reader::set_invocation_location. Just collect the macro
3303 expansion point when we are about to expand the top-most macro.
3304 Do not override cpp_reader::about_to_expand_macro_p.
3305 This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding
3306 properly handle locations of expansion points.
3307 (cpp_get_token_with_location): Adjust, as
3308 cpp_reader::set_invocation_location is no more.
3309 (paste_tokens): Take a virtual location parameter for
3310 the LHS of the pasting operator. Use it in diagnostics. Update
3311 comments.
3312 (paste_all_tokens): Tighten the assert. Propagate the location of
3313 the expansion point when no virtual locations are available.
3314 Pass the virtual location to paste_tokens.
3315 (in_macro_expansion_p): New static function.
3316 (enter_macro_context): Set the cpp_reader::about_to_expand_macro_p
3317 flag until we really start expanding the macro.
3318
0b2c4be5
DS
33192012-05-16 Dodji Seketeli <dodji@redhat.com>
3320
3321 PR preprocessor/7263
3322 * include/cpplib.h (cpp_classify_number): Take a location
3323 parameter.
3324 * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic
3325 macros that take a location parameter.
3326 (cpp_classify_number): Take a (virtual) location parameter. Use
3327 it for diagnostics. Adjust comments.
3328 (eval_token): Take a location parameter. Pass it to
3329 cpp_classify_number and to diagnostic routines.
3330 (_cpp_parse_expr): Use virtual locations of tokens when parsing
3331 expressions. Pass a virtual location to eval_token and to
3332 diagnostic routines.
3333
638d2065
TG
33342012-05-10 Tristan Gingold <gingold@adacore.com>
3335
3336 * expr.c (interpret_float_suffix): Add a guard.
3337
3ad64f53
DS
33382012-05-02 Dodji Seketeli <dodji@redhat.com>
3339
3340 Properly initialize cpp_context in destringize_and_run
3341 * directives.c (destringize_and_run): Properly initialize the new
3342 context.
3343 * macro.c (_cpp_pop_context): Assert that we shouldn't try to pop
3344 the initial base context, which has the same life time as the
3345 current instance of cpp_file.
3346
b193dfa8
MLI
33472012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
3348 Dodji Seketeli <dodji@seketeli.org>
3349
3efc2959 3350 PR c++/52974
b193dfa8
MLI
3351 * libcpp/files.c (maybe_shorter_path): New.
3352 (find_file_in_dir): Use it.
3353
4e65a470
DS
33542012-04-30 Dodji Seketeli <dodji@redhat.com>
3355
51fce2d3
DS
3356 Switch -ftrack-macro-expansion=2 on by default.
3357 * init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
3358 by default. Add comments.
3359
c4ca1a09
DS
3360 Strip "<built-in>" loc from displayed expansion context
3361 * include/line-map.h (linemap_unwind_toward_expansion): Fix typo
3362 in comment.
3363 (linemap_unwind_to_first_non_reserved_loc): Declare new function.
3364 * line-map.c (linemap_unwind_to_first_non_reserved_loc): Define
3365 new function.
3366
3600218c
DS
3367 Fix expansion point loc for macro-like tokens
3368 * macro.c (macro_of_context): New static function.
3369 (_cpp_push_token_context, push_extended_tokens_context): If the
3370 macro argument is NULL, it means we are continuing the expansion
3371 of the current macro, if any. Update comments.
3372 (_cpp_pop_context): Re-enable expansion of the macro only when we
3373 are really out of the context of the current expansion.
3374
0ff2b8a0
DS
3375 Fix token pasting with -ftrack-macro-expansion
3376 * macro.c (paste_all_tokens): Put the token resulting from pasting
3377 into an extended token context with -ftrack-macro-location is in
3378 effect.
3379
4e65a470
DS
3380 Fix cpp_sys_macro_p with -ftrack-macro-expansion
3381 * macro.c (cpp_sys_macro_p): Support -ftrack-macro-expansion.
3382
112448b4
DS
33832012-04-29 Dodji Seketeli <dodji@redhat.com>
3384
3385 * lex.c (lex_raw_string): Change C++ style comments into C style
3386 comments.
19a9ba64 3387 (lex_string): Likewise.
112448b4 3388
7f5f5f98
OW
33892012-04-27 Ollie Wild <aaw@google.com>
3390
3391 * include/cpplib.h (struct cpp_options): Add new field,
3392 warn_literal_suffix.
3393 (CPP_W_LITERAL_SUFFIX): New enum.
3394 * init.c (cpp_create_reader): Default initialization of
3395 warn_literal_suffix.
3396 * lex.c (lex_raw_string): Treat user-defined literals which don't
3397 begin with '_' as separate tokens and produce a warning.
3398 (lex_string): Ditto.
3399
1d72e96f
MLI
34002012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
3401
3402 * line-map.c (linemap_resolve_location): Synchronize comments with
3403 those in line-map.h.
3404 * include/line-map.h (linemap_resolve_location): Fix spelling in
3405 comment.
3406
e75b54a2
RE
34072012-03-22 Richard Earnshaw <rearnsha@arm.com>
3408
3409 * lex.c (search_line_fast): Provide Neon-optimized version for ARM.
3410
7888f266
RO
34112012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3412
3413 * lex.c: Remove Solaris 8 reference.
3414
dd552284
WL
34152012-02-14 Walter Lee <walt@tilera.com>
3416
3417 * configure.ac: Require 64-bit hwint for tilegx and tilepro.
3418 * configure: Regenerate.
3419
2c5cbc31
RG
34202012-01-09 Richard Guenther <rguenther@suse.de>
3421
3422 * macro.c (_cpp_builtin_macro_text): Remove unused variable map.
3423
b492b686
GF
34242012-01-09 Gary Funck <gary@intrepid.com>
3425
3426 PR preprocessor/33919
3427 * files.c (_cpp_get_file_name): New. Implement file name
3428 access function.
3429 * internal.h (_cpp_get_file_name): New prototype.
3430 * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
3431 to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
3432
75291c57
OH
34332012-01-03 Olivier Hainque <hainque@adacore.com>
3434
3435 * system.h: Prior to #define, #undef fopen and freopen unconditionally.
3436
48b0b196
JM
34372011-12-20 Joseph Myers <joseph@codesourcery.com>
3438
3439 * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
3440 (CLK_STDC1X): Change to CLK_STDC11.
3441 * init.c (lang_defaults): Update comments.
3442 (cpp_init_builtins): Update language tests. Use 201112L for C11
3443 __STDC_VERSION__.
3444
4a5e00ca
AS
34452011-12-20 Andreas Schwab <schwab@linux-m68k.org>
3446
3447 * configure: Regenerate.
3448
095af58f
AS
34492011-12-19 Andreas Schwab <schwab@linux-m68k.org>
3450
3451 * configure: Regenerate.
3452
b0c084b7
JJ
34532011-12-07 Jakub Jelinek <jakub@redhat.com>
3454
3455 PR bootstrap/50237
3456 * internal.h (_cpp_init_lexer): New prototype.
3457 * init.c (init_library): Call it.
3458 * lex.c (init_vectorized_lexer): Remove constructor attribute,
3459 add inline keyword.
3460 (HAVE_init_vectorized_lexer): Define.
3461 (_cpp_init_lexer): New function.
3462
9b554be9
DS
34632011-12-03 Dodji Seketeli <dodji@redhat.com>
3464
3465 * macro.c (tokens_buff_remove_last_token)
3466 (tokens_buff_put_token_to): Add an 'inline' function specifier to
3467 the prototype.
3468
8dcf72a8
DN
34692011-11-22 Diego Novillo <dnovillo@google.com>
3470
3471 * include/line-map.h (linemap_dump): Declare.
3472 (line_table_dump): Declare.
3473 * line-map.c (linemap_dump): New.
3474 (line_table_dump): New.
3475
7e74ce3f
ESR
34762011-11-21 Ed Smith-Rowland <3dw4rd@verizon.net>
3477
3478 PR c++/50958
3479 * expr.c (cpp_userdef_char_remove_type): Fix typo.
3480
e9411247
MM
34812011-11-03 Michael Matz <matz@suse.de>
3482
3483 PR bootstrap/50857
3484 * configure.ac: Check for -fno-exceptions -fno-rtti.
3485 * configure: Regenerate.
3486 * Makefile.in (NOEXCEPTION_FLAGS): New flag.
3487 (ALL_CXXFLAGS): Use it.
3488
0c1dace3
PC
34892011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
3490
3491 * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
3492
25339f10
JM
34932011-11-02 Jason Merrill <jason@redhat.com>
3494
3495 PR c++/50810
3496 * configure.ac: Add -Wno-narrowing to warning options.
3497
97e3ad20
JM
34982011-10-31 Jason Merrill <jason@redhat.com>
3499
1fb80b0c
JM
3500 PR libstdc++/1773
3501 * init.c (cpp_init_builtins): Set __cplusplus for C++11.
3502
97e3ad20
JM
3503 PR c++/50920
3504 * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
3505 CLK_GNUCXX0X to CLK_GNUCXX11.
3506
3ce4f9e4
ESR
35072011-10-26 Ed Smith-Rowland <3dw4rd@verizon.net>
3508
3509 Implement C++11 user-defined literals.
3510 * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
3511 cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
3512 cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
3513 cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
3514 (cpp_classify_number): Classify unrecognized tokens as user-defined
3515 literals.
3516 * include/cpplib.h: Add new tokens for user-defined literals.
3517 * init.c: Add new preprocessor flag (cxx11).
3518 * lex.c: (lex_string, lex_raw_string): Handle user-defined literals
3519 including concatenation and promotion with suffixes.
3520
3bb0c8db
DS
35212011-10-24 Dodji Seketeli <dodji@redhat.com>
3522
3523 * line-map.c (linemap_macro_map_lookup): Fix logic.
3524
84756fd4
DS
35252011-10-24 Dodji Seketeli <dodji@redhat.com>
3526
3527 * include/line-map.h (linemap_expand_location): Take a line table
3528 parameter. Update comment.
3529 (linemap_resolve_location): Update comment.
3530 (linemap_expand_location_full): Remove.
3531 * line-map.c (linemap_resolve_location): Handle reserved
3532 locations; return a NULL map in those cases.
3533 (linemap_expand_location): If location is reserved, return a
3534 zeroed expanded location. Update comment. Take a line table to
3535 assert that the function takes non-virtual locations only.
3536 (linemap_expand_location_full): remove.
3537 (linemap_dump_location): Handle the fact that
3538 linemap_resolve_location can return NULL line maps when the
3539 location resolves to a reserved location.
3540
3541 * line-map.c (linemap_macro_map_lookup): Fix logic.
3542
ad2305ad
DS
35432011-10-22 Dodji Seketeli <dodji@redhat.com>
3544
3545 PR bootstrap/50778
3546 * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
3547 context to act upon.
3548 * lex.c (_cpp_remaining_tokens_num_in_context): Likewise. Update
3549 comment.
3550 (cpp_token_from_context_at): Likewise.
3551 (cpp_peek_token): Use the context to peek tokens from.
3552
cbbcf655
DS
35532011-10-20 Dodji Seketeli <dodji@redhat.com>
3554
3555 PR bootstrap/50801
3556 * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
3557 number of tokens.
3558
d17687f6
DS
35592011-10-18 Dodji Seketeli <dodji@redhat.com>
3560
3561 PR bootstrap/50760
3562 * include/line-map.h (struct linemap_stats): Change the type of
19a9ba64 3563 the members from size_t to long.
d17687f6 3564 * macro.c (macro_arg_token_iter_init): Unconditionally initialize
19a9ba64 3565 iter->location_ptr.
d17687f6 3566
411f92de
DS
35672011-10-17 Dodji Seketeli <dodji@redhat.com>
3568
3569 * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
19a9ba64
AM
3570 variable without using it if ENABLE_CHECKING is not defined. Mark
3571 the LOCATION parameter as being unused.
411f92de 3572
b9bd6f74
TT
35732011-10-15 Tom Tromey <tromey@redhat.com>
3574 Dodji Seketeli <dodji@redhat.com>
3575
3576 * include/line-map.h (struct line_maps::alloced_size_for_request):
3577 New member.
3578 * line-map.c (new_linemap): Use set->alloced_size_for_request to
3579 get the actual allocated size of line maps.
3580
64a1a422
TT
35812011-10-15 Tom Tromey <tromey@redhat.com>
3582 Dodji Seketeli <dodji@redhat.com>
3583
3584 * line-map.h (struct linemap_stats): Declare new struct.
3585 (linemap_get_statistics): Declare ...
3586 * line-map.c (linemap_get_statistics): ... new function.
3587 * macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
3588 Declare new counters.
3589 (enter_macro_context, replace_args): Update
3590 num_macro_tokens_counter.
3591 (cpp_get_token_1): Update num_expanded_macros_counter.
3592
847e697a
TT
35932011-10-15 Tom Tromey <tromey@redhat.com>
3594 Dodji Seketeli <dodji@redhat.com>
3595
3596 * include/cpplib.h (struct cpp_options)<debug>: New struct member.
3597 * include/line-map.h (linemap_dump_location): Declare ...
3598 * line-map.c (linemap_dump_location): ... new function.
3599
92582b75
TT
36002011-10-15 Tom Tromey <tromey@redhat.com>
3601 Dodji Seketeli <dodji@redhat.com>
3602
3603 * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
3604 New option.
3605 * internal.h (struct macro_context): New struct.
3606 (enum context_tokens_kind): New enum.
3607 (struct cpp_context)<tokens_kind>: New member of type enum
3608 context_tokens_kind.
3609 (struct cpp_context)<macro>: Remove this. Replace it with an enum
3610 of macro and macro_context.
3611 (struct cpp_context)<direct_p>: Remove.
3612 (_cpp_remaining_tokens_num_in_context): Declare new function.
3613 * directives.c (destringize_and_run): Adjust.
3614 * lex.c (_cpp_remaining_tokens_num_in_context)
3615 (_cpp_token_from_context_at): Define new functions
3616 (cpp_peek_token): Use them.
3617 * init.c (cpp_create_reader): Initialize the base context to zero.
3618 (_cpp_token_from_context_at): Define new static function.
3619 (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
3620 _cpp_token_from_context_at.
3621 * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
3622 members.
3623 (enum macro_arg_token_kind): New enum.
3624 (struct macro_arg_token_iter): New struct.
3625 (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
3626 (alloc_expanded_arg_mem, ensure_expanded_arg_room)
3627 (delete_macro_args, set_arg_token, get_arg_token_location)
3628 (arg_token_ptr_at, macro_arg_token_iter_init)
3629 (macro_arg_token_iter_get_token)
3630 (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
3631 (expanded_token_index, tokens_buff_new, tokens_buff_count)
3632 (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
3633 (tokens_buff_add_token, tokens_buff_remove_last_token)
3634 (reached_end_of_context, consume_next_token_from_context): New
3635 static functions.
3636 (cpp_get_token_1): New static function. Split and extended from
3637 cpp_get_token. Use reached_end_of_context and
3638 consume_next_token_from_context. Unify its return point. Move
3639 the location tweaking from cpp_get_token_with_location in here.
3640 (cpp_get_token): Use cpp_get_token_1
3641 (stringify_arg): Use the new arg_token_at.
3642 (paste_all_tokens): Support tokens coming from extended tokens
3643 contexts.
3644 (collect_args): Return the number of collected arguments, by
3645 parameter. Store virtual locations of tokens that constitute the
3646 collected args.
3647 (funlike_invocation_p): Return the number of collected arguments,
3648 by parameter.
3649 (enter_macro_context): Add a parameter for macro expansion point.
3650 Pass it to replace_args and to the "used" cpp callback. Get the
3651 number of function-like macro arguments from funlike_invocation_p,
3652 pass it to the new delete_macro_args to free the memory used by
3653 macro args. When -ftrack-macro-expansion is in effect, for macros
3654 that have no arguments, create a macro map for the macro expansion
3655 and use it to allocate proper virtual locations for tokens
3656 resulting from the expansion. Push an extended tokens context
3657 containing the tokens resulting from macro expansion and their
3658 virtual locations.
3659 (replace_args): Rename the different variables named 'count' into
3660 variables with more meaningful names. Create a macro map;
3661 allocate virtual locations of tokens resulting from this
3662 expansion. Use macro_arg_token_iter to iterate over tokens of a
3663 given macro. Handle the case of the argument of
3664 -ftrack-macro-expansion being < 2. Don't free macro arguments
3665 memory resulting from expand_arg here, as these are freed by the
3666 caller of replace_arg using delete_macro_args now. Push extended
3667 token context.
3668 (next_context, push_ptoken_context, _cpp_push_token_context)
3669 (_cpp_push_text_context): Properly initialize the context.
3670 (expand_arg): Use the new alloc_expanded_arg_mem,
3671 push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
3672 (_cpp_pop_context): Really free the memory held by the context.
3673 Handle freeing memory used by extended tokens contexts.
3674 (cpp_get_token_with_location): Use cpp_get_token_1.
3675 (cpp_sys_macro_p): Adjust.
3676 (_cpp_backup_tokens): Support the new kinds of token contexts.
3677 * traditional.c (recursive_macro): Adjust.
3678
46427374
TT
36792011-10-15 Tom Tromey <tromey@redhat>
3680 Dodji Seketeli <dodji@redhat.com>
3681
3682 * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
3683 member.
3684 (MAX_SOURCE_LOCATION): New constant.
3685 (struct line_map_ordinary, struct line_map_macro): New structs.
19a9ba64 3686 (struct line_map): Turn this into a union of the two above. Add
46427374
TT
3687 comments.
3688 (struct maps_info): New struct.
3689 (struct line_maps)<info_ordinary, info_macro>: Two new fields.
3690 These now carry the map information that was previously scattered
3691 in struct line_maps.
3692 (struct map_info::allocated): Fix comment.
3693 (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
3694 (ORDINARY_MAP_STARTING_LINE_NUMBER)
3695 (ORDINARY_MAP_INCLUDER_FILE_INDEX)
3696 (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
3697 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
3698 (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
3699 (MACRO_MAP_EXPANSION_POINT_LOCATION)
3700 (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
3701 (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
3702 (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
3703 (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
3704 (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
3705 (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
3706 (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
3707 (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
3708 (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
3709 (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
3710 (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
3711 information.
3712 (linemap_check_ordinary, linemap_assert)
3713 (linemap_location_before_p): New macros.
3714 (linemap_position_for_line_and_column)
3715 (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
3716 (linemap_macro_expansion_map_p)
3717 (linemap_macro_map_loc_to_def_point)
3718 (linemap_macro_map_loc_unwind_once)
3719 (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
3720 (linemap_get_source_line linemap_get_source_column)
3721 (linemap_map_get_macro_name, linemap_get_file_path)
3722 (linemap_location_in_system_header_p)
3723 (linemap_location_from_macro_expansion_p): Declare new functions.
3724 (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
3725 (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
3726 accessors act on ordinary maps only.
3727 (INCLUDED_FROM): Return NULL for main files; use the new
3728 accessors.
3729 (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
3730 (struct expanded_location): Move here from gcc/input.h
3731 (linemap_resolve_location, linemap_expand_location)
3732 (linemap_expand_location_full): Declare new functions.
3733 * line-map.c: Include cpplib.h, internal.h
3734 (linemap_enter_macro, linemap_add_macro_token)
3735 (linemap_get_expansion_line, linemap_get_expansion_filename): New
3736 functions that are private to libcpp.
3737 (linemap_assert): New macro.
3738 (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
3739 (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
3740 (linemap_macro_map_loc_unwind_toward_spelling)
3741 (linemap_macro_map_loc_to_exp_point)
3742 (first_map_in_common_1, first_map_in_common): New static
3743 functions.
3744 (new_linemap): Define new static functions. Extracted and
3745 enhanced from ...
3746 (linemap_add): ... here. Use linemap_assert in lieu of abort
3747 previously.
3748 (linemap_tracks_macro_expansion_locs_p)
3749 (linemap_add_macro_token, linemap_macro_expansion_map_p)
3750 (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
3751 (linemap_macro_map_loc_to_def_point)
3752 (linemap_macro_map_loc_unwind_once)
3753 (linemap_step_out_once, linemap_map_get_index)
3754 (linemap_get_source_line,linemap_get_source_column)
3755 (linemap_get_file_path, linemap_map_get_macro_name)
3756 (linemap_location_in_system_header_p)
3757 (linemap_location_originated_from_system_header_p)
3758 (linemap_location_from_macro_expansion_p)
3759 (linemap_tracks_macro_expansion_locs_p)
3760 (linemap_resolve_location, linemap_expand_location)
3761 (linemap_expand_location_full)
3762 (linemap_tracks_macro_expansion_locs_p)
3763 (linemap_position_for_line_and_column, linemap_compare_locations):
3764 Define new public functions.
3765 (linemap_init): Initialize ordinary and macro maps information in
3766 the map set.
3767 (linemap_check_files_exited): Use the new accessors.
3768 (linemap_free): Remove this dead code.
3769 (linemap_line_start): Assert this uses an ordinary map. Adjust to
3770 use the new ordinary map accessors and data structures. Don't
3771 overflow past the lowest possible macro token's location.
3772 (linemap_position_for_column): Assert the ordinary maps of the map
3773 set are really ordinary. Use ordinary map accessors.
3774 (linemap_lookup): Keep the same logic but generalize to allow
3775 lookup of both ordinary and macro maps. Do not crash when called
3776 with an empty line table.
3777 * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
3778 new API of line-map.h.
3779 * directives.c (start_directive, do_line, do_linemarker)
3780 (do_linemarker): Likewise.
3781 * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
3782 (make_cpp_dir, cpp_make_system_header): Likewise.
3783 * init.c (cpp_read_main_file): Likewise.
3784 * internal.h (CPP_INCREMENT_LINE): Likewise.
3785 (linemap_enter_macro, linemap_add_macro_token)
3786 (linemap_get_expansion_line, linemap_get_expansion_filename): New
3787 functions private to libcpp.
3788 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
3789 (skip_line_comment, skip_whitespace, lex_raw_string)
3790 (_cpp_lex_direct): Likewise.
3791 * macro.c (_cpp_builtin_macro_text): Likewise.
3792 (_cpp_aligned_alloc): Initialize the new name member of the macro.
3793 * traditional.c (copy_comment, _cpp_scan_out_logical_line):
3794 Likewise.
3795 * errors.c (cpp_diagnostic): Adjust to new linemap API.
3796
892a371f
DS
37972011-08-28 Dodji Seketeli <dodji@redhat.com>
3798
3799 * line-map.c (linemap_add): Assert that reason must not be
3800 LC_RENAME when called for the first time on a "main input file".
3801
e3dfef44
GC
38022011-08-22 Gabriel Charette <gchare@google.com>
3803
3804 * init.c (cpp_create_reader): Inititalize forced_token_location_p.
3805 * internal.h (struct cpp_reader): Add field forced_token_location_p.
3806 * lex.c (_cpp_lex_direct): Use forced_token_location_p.
3807 (cpp_force_token_locations): New.
3808 (cpp_stop_forcing_token_locations): New.
3809
32fe396e
RO
38102011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3811
3812 PR libstdc++/1773
3813 * init.c (cpp_init_builtins): Define __cplusplus 19971L.
3814
7c1ffff9
JM
38152011-08-18 Joseph Myers <joseph@codesourcery.com>
3816
3817 * include/cpplib.h (struct cpp_options): Fix typo.
3818
a48e3dd1
JM
38192011-08-18 Joseph Myers <joseph@codesourcery.com>
3820
3821 * include/cpplib.h (struct cpp_options): Add rliterals.
3822 * init.c (struct lang_flags, lang_defaults): Add rliterals.
3823 (cpp_set_lang): Set rliterals option.
3824 (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
3825 * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
3826
3f6ced10
GC
38272011-08-15 Gabriel Charette <gchare@google.com>
3828
3829 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
3830 Update all users to use linemap_position_for_column instead.
3831
0681d04c
GC
38322011-07-28 Gabriel Charette <gchare@google.com>
3833
3834 * include/line-map.h (struct line_maps):
3835 Remove unused field last_listed. Update all users.
3836
5e9627ca
L
38372011-07-28 H.J. Lu <hongjiu.lu@intel.com>
3838
3839 * configure.ac: Set need_64bit_hwint to yes for x86 targets.
3840 * configure: Regenerated.
3841
a024b70f
RO
38422011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3843
3844 * system.h [__cplusplus]: Wrap C function declarations in extern "C".
3845
5b6d595b
RO
38462011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3847 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3848
3849 PR bootstrap/49794
3850 * configure.ac: Test AM_ICONV with CXX.
3851 * configure: Regenerate.
3852 * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
3853
d0a9fbe1
DS
38542011-07-15 Dodji Seketeli <dodji@redhat.com>
3855
3856 * directives.c (struct if_stack): Use source_location as type
3857 here.
3858 * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
3859 indent, def_pragma, used_define, used_undef>: Properly use
3860 source_location as parameter type, rather than unsigned int.
3861
fbdd5d87
RO
38622011-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3863
3864 PR target/39150
3865 * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
3866 like i[34567]86-*-solaris2.1[0-9]*.
3867 * configure: Regenerate.
3868
8787a05a
JM
38692011-06-16 Jason Merrill <jason@redhat.com>
3870
3871 PR c++/45399
3872 * lex.c (lex_raw_string): Don't check for embedded NUL.
3873
38fbfaf6
DS
38742011-06-06 Dodji Seketeli <dodji@redhat.com>
3875
3876 PR preprocessor/48532
3877 * directives.c (do_pragma): Don't forget the invocation location
3878 when parsing the pragma name of a namespaced pragma directive.
3879
fc0993ac
JT
38802011-05-29 John Tytgat <John.Tytgat@aaug.net>
3881
3882 * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
3883
ef230b38
UB
38842011-05-22 Uros Bizjak <ubizjak@gmail.com>
3885
3886 PR target/49104
3887 * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
3888 is defined. Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
3889
e5b0dad8
JK
38902011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
3891
3892 * system.h (ENUM_BITFIELD): Remove.
3893
6cfae070
JJ
38942011-04-24 Jakub Jelinek <jakub@redhat.com>
3895
3896 PR preprocessor/48740
3897 * lex.c (lex_raw_string): When raw string ends with
3898 ??) followed by raw prefix and ", ensure it is preprocessed
3899 with ??) rather than ??].
3900
04695783
JM
39012011-04-20 Jim Meyering <meyering@redhat.com>
3902
3903 * files.c (destroy_cpp_file): Remove useless if-before-free.
3904 * init.c (cpp_destroy): Likewise.
3905 * macro.c (replace_args): Likewise.
3906 * pch.c (cpp_valid_state): Likewise.
3907
4489800d
KT
39082011-03-25 Kai Tietz <ktietz@redhat.com>
3909
3910 * files.c (file_hash_eq): Use filename_cmp
3911 instead of strcmp.
3912 (nonexistent_file_hash_eq): Likewise.
3913 (remap_filename): Likewise.
3914 Handle absolute DOS-path,
3915 (append_file_to_dir): Check for IS_DIR_SEPARATOR
3916 instead of slash.
3917 (read_name_map): Likewise.
3918 * linemap.c (linemap_add): Use filename_cmp
3919 instead of strcmp.
3920 * mkdeps.c (apply_vpath): Use filename_ncmp
3921 instead of strncmp.
3922 (deps_restore): Use filename_cmp instead of
3923 strcmp.
3924 * init.c (read_original_directory): Use
3925 IS_DIR_SEPARATOR instead of checking for slash.
3926
f3c33d9d
MM
39272011-03-21 Michael Meissner <meissner@linux.vnet.ibm.com>
3928
3929 PR preprocessor/48192
3930 * directives.c (do_ifdef): Do not consider conditional macros as
3931 being defined.
3932 (do_ifndef): Ditto.
3933 * expr.c (parse_defined): Ditto.
3934
01956319
RH
39352011-03-18 Richard Henderson <rth@redhat.com>
3936
3937 PR bootstrap/45381
3938 * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
3939
c5a62c6f 39402011-11-04 Eric Botcazou <ebotcazou@adacore.com>
19a9ba64 3941 Jakub Jelinek <jakub@redhat.com>
c5a62c6f
EB
3942
3943 PR preprocessor/39213
3944 * directives.c (end_directive): Call _cpp_remove_overlay for deferred
3945 pragmas as well in traditional mode.
3946
0e1a989c
ILT
39472010-11-17 Ian Lance Taylor <iant@google.com>
3948
3949 PR bootstrap/45538
3950 * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of
3951 AC_LANG based on ENABLE_BUILD_WITH_CXX.
3952
651a20b5
KT
39532010-11-16 Kai Tietz <kai.tietz@onevision.com>
3954
3955 PR preprocessor/17349
3956 * lex.c (save_comment): Handle in argument passing c++
3957 comments special.
3958
480767a9
ILT
39592010-11-02 Ian Lance Taylor <iant@google.com>
3960
3961 * configure.ac: Use AC_SYS_LARGEFILE.
3962 * configure: Rebuild.
3963 * config.in: Rebuild.
3964
078419c9 39652010-10-19 Basile Starynkevitch <basile@starynkevitch.net>
480767a9 3966
078419c9
BS
3967 * line-map.h (source_location): Remove obsolete comment
3968 mentioning location_s.
3969
d6874138
KT
39702010-09-29 Kai Tietz <kai.tietz@onevision.com>
3971
3972 PR preprocessor/45362
3973 * directives.c (cpp_pop_definition): Make static.
3974 (do_pragma_push_macro): Reworked to store text
3975 definition.
3976 (do_pragma_pop_macro): Add free text definition.
3977 (cpp_push_definition): Removed.
3978 * include/cpplib.h (cpp_push_definition): Removed.
3979 (cpp_pop_definition): Likewise.
3980 * internal.h (def_pragma_macro): Remove member 'value'
3981 and add new members 'definition', 'line',
3982 'syshdr', 'sued' and 'is_undef'.
3983 * pch.c (_cpp_restore_pushed_macros): Rework to work
3984 on text definition and store additional macro flags.
3985 (_cpp_save_pushed_macros): Likewise.
3986
e3339d0f
JM
39872010-09-29 Joseph Myers <joseph@codesourcery.com>
3988
3989 * include/cpplib.h (cpp_options): Rename warn_deprecated,
3990 warn_traditional, warn_long_long and pedantic.
3991 * directives.c (directive_diagnostics, _cpp_handle_directive):
3992 Update names of cpp_options members.
3993 * expr.c (cpp_classify_number, eval_token): Update names of
3994 cpp_options members.
3995 * init.c (cpp_create_reader, post_options): Update names of
3996 cpp_options members.
3997 * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
3998 cpp_options members.
3999 * macro.c (parse_params): Update names of cpp_options members.
4000
128465e6
ILT
40012010-09-15 Ian Lance Taylor <iant@google.com>
4002
4003 * init.c: Fix type name in comment.
4004
a69d2520
JJ
40052010-08-31 Jakub Jelinek <jakub@redhat.com>
4006
4007 PR preprocessor/45457
4008 * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
4009 needed.
4010 * directives.c (do_ifdef, do_ifndef): Likewise.
4011
707bcb7a
RO
40122010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4013
4014 * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
4015
6f173e52
RH
40162010-08-24 Richard Henderson <rth@redhat.com>
4017
4018 PR bootstrap/45376
4019 * configure.ac (HAVE_SSE4): New check.
4020 * configure, config.in: Rebuild.
4021 * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
4022
789d73cb
RO
40232010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4024
4025 * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
4026 etc. on Solaris 2/x86.
4027
246a2fcb
RH
40282010-08-21 Richard Henderson <rth@redhat.com>
4029 Andi Kleen <ak@linux.intel.com>
4030 David S. Miller <davem@davemloft.net>
4031
4032 * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
4033 (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
4034 (ptrdiff_t): Check via AC_CHECK_TYPE.
4035 * config.in, configure: Rebuild.
4036 * system.h: Include stdint.h, if available.
4037 * lex.c (WORDS_BIGENDIAN): Provide default.
4038 (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
4039 acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
4040 search_line_sse2, search_line_sse42, init_vectorized_lexer,
4041 search_line_fast): New.
4042 (_cpp_clean_line): Use search_line_fast. Restructure the fast
4043 loop to make it clear when we're leaving the loop. Stay in the
4044 fast loop for non-trigraph '?'.
4045
8e680db5
JJ
40462010-06-11 Jakub Jelinek <jakub@redhat.com>
4047
4048 * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
4049 callback.
4050 (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
4051 (cpp_macro_definition): Remove const qual from second argument.
4052 * macro.c (enter_macro_context): Call user_builtin_macro callback for
4053 NODE_BUILTIN !NODE_USED macros.
4054 (warn_of_redefinition): Likewise. Remove const qual from second
4055 argument.
4056 (cpp_macro_definition): Likewise.
4057 * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
4058 for NODE_BUILTIN !NODE_USED macros.
4059
1cb42611
JM
40602010-06-10 Joseph Myers <joseph@codesourcery.com>
4061
4062 * include/cpplib.h (struct cpp_options): Remove show_column.
4063 * init.c (cpp_create_reader, post_options): Don't set show_column.
4064
ff5dfc48
JR
40652010-06-09 Joern Rennecke <joern.rennecke@embecosm.com>
4066
4067 PR bootstrap/44432
4068 * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
4069 check that C++ compiler works.
4070 * configure: Regenerate.
4071
a9429e29
LB
40722010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
4073
4074 * include/symtab.h (ht_identifier_ptr): New.
4075
c3f247f4
RW
40762010-06-03 Joern Rennecke <joern.rennecke@embecosm.com>
4077 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4078
4079 PR bootstrap/42798
4080 * configure.ac: Check for declaration of 'basename(char *)'.
4081 * configure: Regenerate.
4082 * config.in: Regenerate.
4083
2778d766
JM
40842010-04-25 Joseph Myers <joseph@codesourcery.com>
4085
4086 * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
4087 * init.c (lang_defaults): Add entries for new language variants.
4088 (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
4089 variants.
4090
d8a12e84
MLI
40912010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
4092
4093 PR cpp/43195
4094 * files.c (report_missing_guard): Test for #pragma once.
4095
87cf0651
SB
40962010-04-07 Simon Baldwin <simonb@google.com>
4097
4098 * directives.c (do_diagnostic): Add warning reason argument,
4099 call appropriate error reporting function for code.
4100 (directive_diagnostics): Call specific warning functions with
4101 warning reason where appropriate.
4102 (do_error, do_warning, do_pragma_dependency): Add warning reason
4103 argument to do_diagnostic calls.
4104 * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
4105 _cpp_create_definition): Call specific warning functions with
4106 warning reason where appropriate.
4107 * Makefile.in: Add new diagnostic functions to gettext translations.
4108 * include/cpplib.h (struct cpp_callbacks): Add warning reason code
4109 to error callback.
4110 (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
4111 CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
4112 (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
4113 CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
4114 CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
4115 CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
4116 CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
4117 CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
4118 CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
4119 warning reason codes.
4120 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
4121 cpp_warning_with_line, cpp_pedwarning_with_line,
4122 cpp_warning_with_line_syshdr): New specific error reporting functions.
4123 * pch.c (cpp_valid_state): Call specific warning functions with
4124 warning reason where appropriate.
4125 * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
4126 diagnostic handlers.
4127 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
4128 cpp_warning_with_line, cpp_pedwarning_with_line,
4129 cpp_warning_with_line_syshdr): New specific error reporting functions.
4130 * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
4131 specific warning functions with warning reason where appropriate.
4132 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
4133 warn_about_normalization, lex_identifier_intern, lex_identifier,
4134 _cpp_lex_direct): Ditto.
4135 * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
4136 narrow_str_to_charconst): Ditto.
4137
d947ada0
JJ
41382010-04-06 Jakub Jelinek <jakub@redhat.com>
4139
4140 PR preprocessor/43642
4141 * lex.c (lex_raw_string): Change type of TYPE variable to
4142 unsigned char.
4143
4d9e8446
RW
41442010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4145
4146 * aclocal.m4: Regenerate.
4147
52150625
JM
41482010-03-29 Jason Merrill <jason@redhat.com>
4149
00a81b8b
JM
4150 More N3077 raw string changes
4151 * charset.c (cpp_interpret_string): Don't transform UCNs in raw
4152 strings.
4153 * lex.c (bufring_append): Split out from...
4154 (lex_raw_string): ...here. Undo trigraph and line splicing
4155 transformations. Do process line notes in multi-line literals.
4156 (_cpp_process_line_notes): Ignore notes that were already handled.
4157
52150625
JM
4158 Some raw string changes from N3077
4159 * charset.c (cpp_interpret_string): Change inner delimiters to ().
4160 * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter.
4161
709d7160
JJ
41622010-02-11 Jakub Jelinek <jakub@redhat.com>
4163
4164 * init.c (read_original_filename): Don't call read_original_directory
4165 if _cpp_handle_directive returns 0.
4166
dadab4fd
JM
41672010-01-01 Joseph Myers <joseph@codesourcery.com>
4168
4169 PR preprocessor/41947
4170 * expr.c (cpp_classify_number): Give error for hexadecimal
4171 floating-point constant with no digits before or after point.
4172
3de8a540
AC
41732009-11-20 Arnaud Charlet <charlet@adacore.com>
4174
4175 * macro.c (enter_macro_context): Call cb.used callback if defined.
4176 * directives.c (do_idef, do_ifndef): Ditto.
4177 * include/cpplib.h (struct cpp_callbacks): Add used callback.
4178
17e7cb85
KT
41792009-11-11 Kai Tietz <kai.tietz@onevision.com>
4180
4181 * directives.c (do_pragma_push_macro): New pragma handler.
4182 (do_pragma_pop_macro): Likewise.
4183 (_cpp_init_internal_pragmas): Add push_macro and
4184 pop_macro handler to internal pragmas.
4185 (lex_macro_node_from_str): Removed.
4186 (cpp_push_definition): Replace lex_macro_node_from_str
4187 by _cpp_lex_identifier.
4188 (cpp_pop_definition): Likewise.
4189 * internal.h (_cpp_lex_identifier): New prototype.
4190 (def_pragma_macro): New structure.
4191 (cpp_reader): New member pushed_macros.
4192 * lex.c (_cpp_lex_identifier): New function.
4193 (lex_identifier_intern): New function.
4194 * init.c (cpp_create_reader): Initialize pushed_macros
4195 member.
4196 (cpp_destroy): Free elements in pushed_macros member.
4197 * pch.c (_cpp_save_pushed_macros): New function.
4198 (_cpp_restore_pushed_macros): Likewise.
4199 (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
4200 (cpp_read_state): Use _cpp_restore_pushed_macros.
4201
2c6e3f55
JJ
42022009-10-19 Jakub Jelinek <jakub@redhat.com>
4203
4204 * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
4205 (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
4206 and char32_cset_desc.
4207 (converter_for_type): Handle CPP_UTF8STRING.
4208 (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
4209 * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
4210 (parse_include): Reject raw strings.
4211 * include/cpplib.h (CPP_UTF8STRING): New token type.
4212 * internal.h (struct cpp_reader): Add utf8_cset_desc field.
4213 * lex.c (lex_raw_string): New function.
4214 (lex_string): Handle u8 string literals, call lex_raw_string
4215 for raw string literals.
4216 (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
4217 sequences.
4218 * macro.c (stringify_arg): Handle CPP_UTF8STRING.
4219
96c169e1
JJ
42202009-10-14 Jakub Jelinek <jakub@redhat.com>
4221
4222 PR preprocessor/41543
4223 * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
4224 * line-map.c (linemap_init): Initialize highest_location and
4225 highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
4226
30c99a9e
JM
42272009-10-09 Jason Merrill <jason@redhat.com>
4228
4229 * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
4230
2214382c
NV
42312009-10-09 Neil Vachharajani <nvachhar@google.com>
4232
4233 * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
4234 sccs.
4235
e02222d2
LR
42362009-09-23 Loren J. Rittle <ljrittle@acm.org>
4237
4238 * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
4239 * configure: Rebuilt.
4240
9a8a2b7a
RG
42412009-09-22 Richard Guenther <rguenther@suse.de>
4242
4243 PR pch/38987
4244 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
4245
74dc6a11
CD
42462009-09-18 Chris Demetriou <cgd@google.com>
4247
4248 PR preprocessor/28435:
4249 * include/cpplib.h (struct cpp_options): Add new member
4250 deps.need_preprocessor_output.
4251 * files.c (open_file_failed): If preprocessor output is needed
4252 always report an error.
4253
933608b7
KT
42542009-09-13 Kai Tietz <kai.tietz@onevision.com>
4255
4256 * configure.ac: Set for i?86-w64-mingw*
4257 need_64bit_hwint to yes.
4258 * configure: Regenerated.
4259
86373e7e
JM
42602009-09-10 Jason Merrill <jason@redhat.com>
4261
4262 * directives.c (cpp_define): constify.
4263
fd2ab214
ILT
42642009-09-02 Ian Lance Taylor <iant@google.com>
4265
4266 * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
4267
df58e648
RW
42682009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4269
4270 * configure.ac (AC_PREREQ): Bump to 2.64.
4271
5213506e
RW
42722009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4273
4274 * aclocal.m4: Regenerate.
4275 * config.in: Regenerate.
4276 * configure: Regenerate.
4277
709a22df
TT
42782009-08-17 Tom Tromey <tromey@redhat.com>
4279
4280 PR preprocessor/41067:
4281 * charset.c (convert_escape): Add missing ":" to error text.
4282
0c539b47
DR
42832009-07-27 Douglas B Rupp <rupp@gnat.com>
4284
4285 * include/cpplib.h (INO_T_CPP): New macro.
4286 (struct cpp_dir): Use it.
4287
2b69c841
JQ
42882009-07-20 Jerry Quinn <jlquinn@optonline.net>
4289
4290 PR regression/40800
4291 * configure.ac: Use = instead of == for testing
4292 ENABLE_BUILD_WITH_CXX.
4293 * configure: Rebuild.
4294
f1bf410c
JQ
42952009-07-17 Jerry Quinn <jlquinn@optonline.net>
4296
4297 * directives.c (do_linemarker, do_line): Use CPP_STRING for
4298 ignored enum value.
4299 * files.c (find_file_in_dir): Add cast from void* to char*.
4300 * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
4301 * Makefile.in: (WARN_CFLAGS): Use general and C-specific
4302 warnings.
4303 (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
4304 ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
4305 COMPILER_FLAGS): New.
4306 (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
4307 (COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS
4308 instead of ALL_CFLAGS.
4309 * configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings
4310 from other warnings. Add -Wc++-compat to C-specific warnings.
4311 Check for --enable-build-with-cxx. Set and substitute
4312 ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES
4313 according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before
4314 AC_CHECK_HEADERS.
4315 * configure: Rebuild.
4316 * include/cpp-id-data.h: Remove extern "C".
4317 * include/line-map.h: Likewise.
4318 * include/mkdeps.h: Likewise.
4319 * include/symtab.h: Likewise.
4320 * internal.h: Likewise.
4321
a28fbdba
MLI
43222009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4323
4324 * directives.c (parse_include): Add location argument. Update all
4325 calls.
4326 (parse_answer): Likewise.
4327 (do_include_common): Error with exact location.
4328 (parse_assertion): Likewise.
4329
b506a5a2
MLI
43302009-06-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
4331
4332 * expr.c (num_div_op): Take explicit location.
4333
7d8847a4
ILT
43342009-06-17 Ian Lance Taylor <iant@google.com>
4335
4336 * include/cpplib.h (progname): Don't declare.
4337
3d8b2a98
ILT
43382009-06-12 Ian Lance Taylor <iant@google.com>
4339
4340 * include/cpplib.h (struct cpp_options): Add
4341 warn_cxx_operator_names field.
4342 (NODE_WARN_OPERATOR): Define.
4343 (struct cpp_hashnode): Increase flags field to 10 bits, decrease
4344 type to 6 bits.
4345 * init.c (mark_named_operators): Add flags parameter.
4346 (cpp_post_options): Pick flags value to pass to
4347 mark_named_operators.
4348 * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
4349 identifier is an operator name in C++.
4350
e74fe492
AH
43512009-06-01 Aldy Hernandez <aldyh@redhat.com>
4352
4353 * include/line-map.h (LAST_SOURCE_COLUMN): New.
4354
4851089f
ILT
43552009-06-01 Ian Lance Taylor <iant@google.com>
4356
4357 * include/cpp-id-data.h: Add extern "C".
4358 * include/line-map.h: Likewise.
4359 * include/mkdeps.h: Likewise.
4360 * include/symtab.h: Likewise.
4361 * internal.h: Likewise.
4362
7e5487a2
ILT
43632009-05-15 Ian Lance Taylor <iant@google.com>
4364
4365 * include/cpplib.h (enum cpp_builtin_type): Rename from enum
4366 builtin_type. Change all uses.
4367
00b0c19b
MLI
43682009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4369
4370 PR cpp/36674
4371 * directives (do_linemarker): Compensate for the increment in
4372 location that occurs when we reach the end of line.
4373 * files (_cpp_stack_include): Mention _cpp_find_file in the
4374 comment.
4375
9a0c6187
JM
43762009-05-10 Joseph Myers <joseph@codesourcery.com>
4377
4378 * include/cpplib.h (enum cpp_token_fld_kind): Add
4379 CPP_TOKEN_FLD_TOKEN_NO.
4380 (struct cpp_macro_arg, struct cpp_identifier): Define.
4381 (union cpp_token_u): Use struct cpp_identifier for identifiers.
4382 Use struct cpp_macro_arg for macro arguments. Add token_no for
4383 CPP_PASTE token numbers.
4384 * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
4385 do_pragma_poison, parse_assertion): Use val.node.node in place of
4386 val.node.
4387 * expr.c (parse_defined, eval_token): Use val.node.node in place
4388 of val.node.
4389 * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
4390 cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
4391 cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
4392 place of val.arg_no. Use val.node.node in place of val.node.
4393 * macro.c (replace_args, cpp_get_token, parse_params,
4394 lex_expansion_token, create_iso_definition, cpp_macro_definition):
4395 Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
4396 Use val.node.node in place of val.node.
4397
9e322bc1
JM
43982009-05-03 Joseph Myers <joseph@codesourcery.com>
4399
4400 * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
4401 UTF-8 sequences.
4402
f88d0772
JM
44032009-04-25 Joseph Myers <joseph@codesourcery.com>
4404
4405 PR preprocessor/39559
4406 * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
4407 constants larger than intmax_t in C99 mode.
4408
d1b38208
TG
44092009-04-21 Taras Glek <tglek@mozilla.com>
4410
4411 * include/cpp-id-data.h: Update GTY annotations to new syntax.
4412 * include/cpplib.h: Likewise.
4413 * include/line-map.h: Likewise.
4414 * include/symtab.h: Likewise.
4415
cfc93532
MLI
44162009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4417
4418 PR c++/14875
4419 * lex.c (cpp_type2name): Take a flags parameter. Call
4420 cpp_named_operator2name for named operators and cpp_digraph2name
4421 for digraphs.
4422 (cpp_digraph2name): New.
4423 (cpp_spell_token): Use it.
4424 (cpp_output_token): Likewise.
4425 * include/cpplib.h (cpp_type2name): Update declaration.
4426 * init.c (cpp_named_operator2name): New.
4427 * internal.h (cpp_named_operator2name): Declare.
4428
9c650d90
MLI
44292009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4430
4431 PR c++/13358
4432 * init.c (cpp_create_reader): Wlong_long is disabled by default.
4433 * expr.c (cpp_classify_number): Give different messages for C and
4434 C++ front-ends.
4435
aa508502
JM
44362009-04-19 Joseph Myers <joseph@codesourcery.com>
4437
4438 PR preprocessor/20078
4439 * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
4440 field.
4441 * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
4442 (struct cpp_token): Change flags to unsigned short.
4443 * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
4444 (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
4445 (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
4446 tokens.
4447 * macro.c (macro_real_token_count): New.
4448 (enter_macro_context, replace_args): Use macro_real_token_count.
4449 (create_iso_definition): Record whitespace surrounding and digraph
4450 spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
4451 Set extra_tokens and save CPP_PASTE tokens with arg_no set for
4452 multiple consecutive ## tokens.
4453 (_cpp_create_definition): Initialize extra_tokens.
4454 (cpp_macro_definition): Use macro_real_token_count.
4455
61cc8223
JM
44562009-04-18 Joseph Myers <joseph@codesourcery.com>
4457
4458 * directives.c (parse_include): Pass true to check_eol.
4459
c7f9c0b9
JM
44602009-04-18 Joseph Myers <joseph@codesourcery.com>
4461
4462 PR preprocessor/39646
4463 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
4464 * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
4465 * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
4466 place of LC_RENAME.
4467
a5cb563b
JM
44682009-04-18 Joseph Myers <joseph@codesourcery.com>
4469
4470 PR preprocessor/39647
4471 * directives.c (check_eol): Add parameter expand.
4472 (do_undef, parse_include, do_line, do_linemarker, do_ident,
4473 do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
4474 do_else, do_endif, do_assert, do_unassert): All callers changed.
4475 Pass true from do_line, false elsewhere.
4476
18f41a1b
JM
44772009-04-12 Joseph Myers <joseph@codesourcery.com>
4478
4479 PR preprocessor/31869
4480 * macro.c (stringify_arg): Handle NULL source token in padding
4481 token where previous padding token did not have source token with
4482 preceding whitespace.
4483
748086b7
JJ
44842009-04-09 Jakub Jelinek <jakub@redhat.com>
4485
4486 * Makefile.in: Change copyright header to refer to version
4487 3 of the GNU General Public License and to point readers at the
4488 COPYING3 file and the FSF's license web page.
4489 * charset.c: Likewise.
4490 * directives-only.c: Likewise.
4491 * directives.c: Likewise.
4492 * errors.c: Likewise.
4493 * expr.c: Likewise.
4494 * files.c: Likewise.
4495 * identifiers.c: Likewise.
4496 * include/cpp-id-data.h: Likewise.
4497 * include/cpplib.h: Likewise.
4498 * include/line-map.h: Likewise.
4499 * include/mkdeps.h: Likewise.
4500 * include/symtab.h: Likewise.
4501 * init.c: Likewise.
4502 * internal.h: Likewise.
4503 * lex.c: Likewise.
4504 * line-map.c: Likewise.
4505 * macro.c: Likewise.
4506 * makeucnid.c: Likewise.
4507 * mkdeps.c: Likewise.
4508 * pch.c: Likewise.
4509 * symtab.c: Likewise.
4510 * system.h: Likewise.
4511 * traditional.c: Likewise.
4512 * ucnid.tab: Likewise.
4513 * ucnid.h: Regenerate.
4514
eec49116
JJ
45152009-04-01 Janis Johnson <janis187@us.ibm.com>
4516
839a3b8a
JJ
4517 PR c/39027
4518 * include/cpplib.h (CPP_N_DEFAULT): Define.
4519 * expr.c (interpret_float_suffix): Recognize d or D for double,
4520 return new value for default.
4521 (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
4522
eec49116
JJ
4523 PR c/33466
4524 * expr.c (interpret_float_suffix): Reject invalid suffix that uses
4525 letters from decimal float and fixed-point suffixes.
4526
47580d22
JM
45272009-03-31 Joseph Myers <joseph@codesourcery.com>
4528
4529 PR preprocessor/15638
4530 * files.c (_cpp_find_file): Call open_file_failed after diagnosing
4531 invalid PCH.
4532 (open_file_failed): Make error for missing file fatal.
4533 * include/cpplib.h (CPP_DL_FATAL): Define.
4534
5a2df0fa
SV
45352009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net>
4536
4537 PR preprocessor/31932:
4538 * internal.h: Don't mention HAVE_ICONV_H.
4539 * configure, config.in: Rebuild.
4540 * configure.ac: Don't check for iconv.h.
4541
c1a8a3c6
TT
45422009-03-30 Tom Tromey <tromey@redhat.com>
4543
4544 PR preprocessor/39512:
4545 * line-map.c (linemap_init): Initialize 'reallocator' field.
4546
a37a7b8a
JJ
45472009-03-30 Jakub Jelinek <jakub@redhat.com>
4548
4549 PR target/39558
4550 * macro.c (cpp_get_token): If macro_to_expand returns NULL
4551 and used some tokens, add CPP_PADDING before next token.
4552
148e4216
JM
45532009-03-29 Joseph Myers <joseph@codesourcery.com>
4554
4555 PR preprocessor/34695
4556 * makedepend.c: Remove.
4557 * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
4558 (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
4559 * directives.c (cpp_errors): Remove.
4560 * errors.c (print_location, _cpp_begin_message, v_message):
4561 Remove.
4562 (cpp_error, cpp_error_with_line): Always use error callback.
4563 (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
4564 * include/cpplib.h (cpp_options): Remove pedantic_errors,
4565 inhibit_warnings, warn_system_headers, inhibit_errors,
4566 warnings_are_errors, client_diagnostic.
4567 (cpp_callbacks): Add extra arguments to error callback; make it
4568 return bool.
4569 (cpp_finish): Return void.
4570 (cpp_destroy): Remove inaccurate comment about return value.
4571 (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
4572 (CPP_DL_NOTE): Define.
4573 * include/line-map.h (linemap_print_containing_files): Remove.
4574 * init.c (cpp_finish): Do not check for or return number of
4575 errors.
4576 * internal.h (cpp_reader): Remove errors field.
4577 * line-map.c (linemap_print_containing_files): Remove.
4578 * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
4579 about previous definition. Only emit it if previous diagnostic
4580 was emitted.
4581
f1450211
JM
45822009-03-28 Joseph Myers <joseph@codesourcery.com>
4583
4584 * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
4585 mkinstalldirs.
4586
8f5929e1
JJ
45872009-03-18 Jakub Jelinek <jakub@redhat.com>
4588
4589 * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
4590
4bb09c26
JM
45912009-02-21 Joseph Myers <joseph@codesourcery.com>
4592
4593 * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
4594 header name.
4595 (_cpp_lex_direct): Handle this.
4596
68c9ab45
RG
45972009-02-15 Richard Guenther <rguenther@suse.de>
4598
4599 Revert last change.
4600
601b3e1a
RG
46012009-02-13 Richard Guenther <rguenther@suse.de>
4602
4603 * configure.ac: Enable LFS.
4604 * configure: Re-generate.
4605 * config.in: Likewise.
4606
fc0cd180
BE
46072009-01-05 Ben Elliston <bje@au.ibm.com>
4608
4609 * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
4610 (.po.pox): Likewise.
4611 (po/$(PACKAGE).pot): Likewise.
4612
db89a3be
AO
46132008-12-10 Alexandre Oliva <aoliva@redhat.com>
4614
4615 PR target/37033
4616 * pch.c (cpp_valid_state): Improve message for poisoned symbols.
4617 Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
4618
cc955282
JM
46192008-11-29 Joseph Myers <joseph@codesourcery.com>
4620
4621 * lex.c (cpp_token_len): Use 6 as default length.
4622
47960aaf
MLI
46232008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org>
4624
4625 * expr.c (struct op): Add location.
4626 (_cpp_parse_expr): Propagate locations throught the stack
4627 of expressions.
4628 (reduce): Likewise.
4629 (check_promotion): Use explicit location in errors.
4630
631d0d36
MG
46312008-10-05 Matthew Gingell <gingell@adacore.com>
4632 Arnaud Charlet <charlet@adacore.com>
4633
4634 * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
4635 (cpp_get_comments): New function.
4636 * internal.h (struct cpp_reader): Add comments field.
4637 * init.c (cpp_destroy): Free comments.
4638 * lex.c (store_comment, cpp_get_comments): New functions.
4639 (comments): New struct.
4640 (save_comment): Store comments in comments struct.
4641
c047ce93
SB
46422008-09-18 Simon Baldwin <simonb@google.com>
4643
4644 * include/cpplib.h (struct cpp_options): Add new boolean flag
4645 warn_builtin_macro_redefined.
4646 * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
4647 * (struct builtin_operator): Split out from previous struct builtin,
4648 enhance extra const correctness.
4649 * (struct builtin_macro): Split out from previous struct builtin, add
4650 new always_warn_if_redefined flag, enhance const correctness.
4651 * (mark_named_operators): Use struct builtin_operator.
4652 * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
4653 to builtins selectively.
4654 * macro.c (warn_of_redefinition): Return false if a builtin macro
4655 is not flagged with NODE_WARN.
4656
affa55c6
JJ
46572008-07-31 Jakub Jelinek <jakub@redhat.com>
4658
4659 PR preprocessor/36649
4660 * files.c (struct report_missing_guard_data): New type.
4661 (report_missing_guard): Put paths into an array instead of printing
4662 them right away. Return 1 rather than 0.
4663 (report_missing_guard_cmp): New function.
4664 (_cpp_report_missing_guards): Sort and print paths gathered by
4665 report_missing_guard callback.
4666
3b8f20a1
MLI
46672008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4668
4669 PR 28079
4670 * directives.c (strtolinenum): Handle overflow.
4671 (do_line): Give a warning if line number overflowed.
4672 (do_linemarker): Update call to strtolinenum.
4673
1bb64668
MLI
46742008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4675
4676 * include/line-map.h (linenum_type): New typedef.
4677 (struct line_map): Use it.
4678 (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
4679 (SOURCE_COLUMN): Likewise.
4680 * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
4681 source_location values in a variable of type linenum_type.
4682 * directives.c (struct if_stack): Use linenum_type.
4683 (strtoul_for_line): Rename as strtolinenum.
4684 (do_line): Use linenum_type.
4685 (do_linemarker): Use linenum_type and strtolinenum.
4686 (_cpp_do_file_change): Use linenum_t.
4687 * line-map.c (linemap_add): Likewise.
4688 (linemap_line_start): Likewise.
4689 * traditional.c (struct fun_macro): 'line' is a source_location.
4690 * errors.c (print_location): Use linenum_type.
4691 * directives-only.c (_cpp_preprocess_dir_only): Likewise.
4692 * internal.h (CPP_INCREMENT_LINE): Likewise.
4693 * lex.c (_cpp_skip_block_comment): Use source_location.
19a9ba64 4694
5950c3c9
BE
46952008-07-14 Ben Elliston <bje@au.ibm.com>
4696
4697 * include/cpplib.h (NODE_CONDITIONAL): New.
4698 (struct cpp_callbacks): New macro_to_expand field.
4699 (struct cpp_hashnode): Adjust size of flags and type fields.
4700 (cpp_peek_token): Prototype.
4701 * lex.c (cpp_peek_token): New function.
4702 (_cpp_temp_token): Protect pre-existing lookaheads.
4703 * macro.c (cpp_get_token): Expand any conditional macros.
4704 (_cpp_backup_tokens_direct): New.
4705 (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
4706 (warn_of_redefinition): Silently allow redefined conditional
4707 macros.
4708 (_cpp_create_definition): Remove the conditional flag when a user
4709 defines one of the conditional macros.
4710 * internal.h (_cpp_backup_tokens_direct): New prototype.
4711
e85edc9e
AH
47122008-06-13 Andrew Haley <aph@redhat.com>
4713
4714 PR preprocessor/33305
4715 * macro.c (replace_args): Print a warning for empty macro
4716 arguments in C89 and C++.
4717
18c04407
RW
47182008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4719
4720 * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
4721 * configure: Regenerate.
4722
2d09b640
RW
47232008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4724
4725 * Makefile.in (datarootdir): New variable.
4726
0b7c73cc
L
47272008-06-12 H.J. Lu <hongjiu.lu@intel.com>
4728
4729 PR preprocessor/36479
4730 * charset.c (cpp_interpret_string_notranslate): Also set
4731 narrow_cset_desc.width.
4732
cd985f66
JM
47332008-06-07 Joseph Myers <joseph@codesourcery.com>
4734
4735 * configure.ac (parisc*64*-*-*): Remove.
4736 * configure: Regenerate.
4737
d750887f
TT
47382008-05-30 Tom Tromey <tromey@redhat.com>
4739
4740 PR preprocessor/36320:
4741 * internal.h (_cpp_parse_expr): Update.
4742 * expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error
4743 messages.
4744 * directives.c (do_if): Update.
4745 (do_elif): Require expression if processing group.
4746
c100de59
DS
47472008-05-30 Danny Smith <dannysmith@users.sourceforge.net>
4748
4749 * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
4750
5d6342eb
TT
47512008-05-21 Tom Tromey <tromey@redhat.com>
4752
4753 PR preprocessor/27777:
4754 * lex.c (cpp_output_line_to_string): New function.
4755 * internal.h (_cpp_begin_message): Don't declare.
4756 * errors.c (_cpp_begin_message): Now static.
4757 * include/cpplib.h (cpp_output_line_to_string): Declare.
4758 * directives.c (do_diagnostic): Rewrote. Use
4759 cpp_output_line_to_string. Don't use _cpp_begin_message.
4760
dae4174e
TT
47612008-05-21 Tom Tromey <tromey@redhat.com>
4762
4763 * include/symtab.h (HT_ALLOCED): Remove.
4764 (ht_purge): Declare.
4765 * symtab.c (DELETED): New define.
4766 (ht_lookup): Update comment.
4767 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED
4768 code. Use subobject allocator for strings, if it exists.
4769 (ht_expand): Handle deleted entries.
4770 (ht_forall): Likewise.
4771 (ht_purge): New function.
4772 (ht_dump_statistics): Print deletion statistics.
4773
899015a0
TT
47742008-05-13 Tom Tromey <tromey@redhat.com>
4775
4776 PR preprocessor/22168:
4777 * include/cpplib.h (struct cpp_options) <objc>: Update
4778 documentation.
4779 * expr.c (eval_token): Warn for use of assertions.
4780 * directives.c (directive_diagnostics): Warn about extensions.
4781 (DEPRECATED): New define.
4782 (DIRECTIVE_TABLE): Use it.
4783
71c10038
TT
47842008-05-06 Tom Tromey <tromey@redhat.com>
4785
4786 PR preprocessor/35313, PR preprocessor/36088:
4787 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
4788 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
4789
2bd0fe3d
DM
47902008-05-04 David S. Miller <davem@davemloft.net>
4791
4792 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
4793 * configure: Regenerate.
4794
28f68625
DF
47952008-04-22 Daniel Franke <franke.daniel@gmail.com>
4796
4797 * include/cpplib.h (cpp_define_formatted): New.
4798 * directives.c (cpp_define_formatted): New.
4799
688e7a53
TT
48002008-04-21 Tom Tromey <tromey@redhat.com>
4801
4802 PR libcpp/33415:
4803 * charset.c (_cpp_convert_input): Add buffer_start argument.
4804 Ignore UTF-8 BOM if seen.
4805 * internal.h (_cpp_convert_input): Add argument.
4806 * files.c (struct _cpp_file) <buffer_start>: New field.
4807 (destroy_cpp_file): Free buffer_start, not buffer.
4808 (_cpp_pop_file_buffer): Likewise.
4809 (read_file_guts): Update.
4810
b6baa67d
KVH
48112008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
4812
4813 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
4814 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
4815 (struct cpp_options): Added uliterals.
4816 (cpp_interpret_string): Update prototype.
4817 (cpp_interpret_string_notranslate): Idem.
4818 * charset.c (init_iconv_desc): New width member in cset_converter.
4819 (cpp_init_iconv): Add support for char{16,32}_cset_desc.
4820 (convert_ucn): Idem.
4821 (emit_numeric_escape): Idem.
4822 (convert_hex): Idem.
4823 (convert_oct): Idem.
4824 (convert_escape): Idem.
4825 (converter_for_type): New function.
4826 (cpp_interpret_string): Use converter_for_type, support u and U prefix.
4827 (cpp_interpret_string_notranslate): Match changed prototype.
4828 (wide_str_to_charconst): Use converter_for_type.
4829 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
4830 * directives.c (linemarker_dir): Macro U changed to UC.
4831 (parse_include): Idem.
4832 (register_pragma_1): Idem.
4833 (restore_registered_pragmas): Idem.
4834 (get__Pragma_string): Support CPP_STRING{16,32}.
4835 * expr.c (eval_token): Support CPP_CHAR{16,32}.
4836 * init.c (struct lang_flags): Added uliterals.
4837 (lang_defaults): Idem.
4838 * internal.h (struct cset_converter) <width>: New field.
4839 (struct cpp_reader) <char16_cset_desc>: Idem.
4840 (struct cpp_reader) <char32_cset_desc>: Idem.
4841 * lex.c (digraph_spellings): Macro U changed to UC.
4842 (OP, TK): Idem.
4843 (lex_string): Add support for u'...', U'...', u"..." and U"...".
4844 (_cpp_lex_direct): Idem.
4845 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
4846 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
4847
deb984e6
PB
48482008-04-18 Paolo Bonzini <bonzini@gnu.org>
4849
4850 PR bootstrap/35457
4851 * aclocal.m4: Regenerate.
4852 * configure: Regenerate.
4853
bf048bea
TT
48542008-04-17 Tom Tromey <tromey@redhat.com>
4855
4856 PR libcpp/34866:
4857 * errors.c (cpp_error): Don't reference a token before the start
4858 of the current run.
4859
7f27b0f8
TT
48602008-04-16 Tom Tromey <tromey@redhat.com>
4861
4862 * Makefile.in (TAGS_SOURCES): New variable.
4863 (TAGS): New target.
4864
a1fcb9a1
KK
48652008-04-11 Kaz Kojima <kkojima@gcc.gnu.org>
4866
4867 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
4868 and shbe-*-*.
4869 * configure: Rebuilt.
4870
93d45d9e
JM
48712008-04-02 Joseph Myers <joseph@codesourcery.com>
4872
4873 * include/cpplib.h (struct cpp_callbacks): Add used_define,
4874 used_undef and before_define.
4875 (NODE_USED): Define.
4876 * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
4877 do_ifndef, cpp_pop_definition): Handle new flag and use new
4878 callbacks.
4879 * expr.c (parse_defined): Handle new flag and use new callbacks.
4880 * macro.c (enter_macro_context, _cpp_free_definition): Handle new
4881 flag and use new callbacks.
4882
d4c32e1d
JJ
48832008-04-01 Jakub Jelinek <jakub@redhat.com>
4884
4885 PR pch/13675
4886 * files.c (struct _cpp_file): Remove pch field.
4887 (pch_open_file): Don't set file->pch, just file->pchname.
4888 (should_stack_file): After pfile->cb.read_pch call
4889 free pchname and clear pchname, don't close file->fd.
4890 Test file->pchname instead of file->pch. Don't close fd after cb.
4891 (_cpp_stack_include): Test file->pchname instead of file->pch.
4892
161031e3
TT
48932008-03-28 Tom Tromey <tromey@redhat.com>
4894
4895 * Makefile.in (POSTCOMPILE): New variable.
4896 (.c.o): Use it.
4897
14ccf800
TT
48982008-03-13 Tom Tromey <tromey@redhat.com>
4899
4900 PR libcpp/35322:
4901 * directives.c (destringize_and_run): Set pfile->directive.
4902
830465c6
MM
49032008-03-06 Markus Milleder <markus.milleder@generali.at>
4904
4905 PR preprocessor/35458
4906 * mkdeps.c (munge): Quote '#' with a '\'.
4907
d482a073
RW
49082008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4909
4910 PR preprocessor/35379
4911 * mkdeps.c (deps_write): Ensure the first target always appears
4912 in the first column, without leading backslash newline. Avoid
4913 some more extra whitespace.
4914
185a6cc1
TS
49152008-02-25 Thiemo Seufer <ths@mips.com>
4916
d482a073 4917 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
185a6cc1 4918
2bf41bf0
TT
49192008-02-19 Tom Tromey <tromey@redhat.com>
4920
4921 * traditional.c (lex_identifier): Use CPP_HASHNODE.
4922 * lex.c (lex_identifier): Use CPP_HASHNODE.
4923 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
4924 do-while.
4925 * identifiers.c (alloc_node): Change return type.
4926 (_cpp_init_hashtable): Don't cast 'alloc_node'.
4927 (proxy_assertion_broken): New declaration.
4928 (cpp_forall_identifiers): Move comment.
4929 * line-map.c (linemap_add): Comment fix.
4930 (linemap_line_start): Indentation fix.
4931
765d600a
JJ
49322008-01-25 Jakub Jelinek <jakub@redhat.com>
4933
4934 PR preprocessor/34692
4935 * macro.c (collect_args): Add pragma_buff argument. Push
4936 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
4937 than into arguments. Reset prevent_expansion and parsing_args
4938 state at CPP_PRAGMA_EOL/CPP_EOF.
4939 (funlike_invocation_p): Add pragma_buff argument, pass it through
4940 to collect_args.
4941 (enter_macro_context): Add result argument. Adjust
4942 funlike_invocation_p caller. Emit all deferred pragma tokens
4943 gathered during collect_args before the expansion, add a padding
4944 token. Return 2 instead of 1 if any pragma tokens were prepended.
4945 (cpp_get_token): If enter_macro_context returns 2, don't return
4946 a padding token, instead cycle to grab CPP_PRAGMA token.
4947 * directives.c (_cpp_handle_directive): If was_parsing_args
4948 in deferred pragma, leave parsing_args and prevent_expansion as is.
4949
ec46053b
TT
49502008-01-22 Tom Tromey <tromey@redhat.com>
4951
765d600a 4952 PR c++/34859
ec46053b
TT
4953 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
4954 __STDC_CONSTANT_MACROS.
4955
681c6ab0
FF
49562008-01-07 Fred Fish <fnf@specifix.com>
4957
765d600a 4958 PR preprocessor/30363
681c6ab0 4959 * traditional.c (replace_args_and_push): Add local variable
19a9ba64 4960 cxtquote, calculate the replacement text size assuming a
681c6ab0
FF
4961 worst case of every input character quoted with backslash,
4962 and properly handle output quoting of quote characters in
4963 actual arguments used in function-like macros.
4964
33ae4837
TT
49652008-01-03 Tom Tromey <tromey@redhat.com>
4966
765d600a 4967 PR preprocessor/34602
33ae4837
TT
4968 * directives.c (do_line): Don't try to spell EOF token.
4969 (do_linemarker): Add comment.
4970
675575f5
DD
49712007-12-11 DJ Delorie <dj@redhat.com>
4972
4973 * charset.c (convert_using_iconv): Close out any shift states,
4974 returning to the initial state.
4975
97f6bd40
TT
49762007-12-06 Tom Tromey <tromey@redhat.com>
4977
765d600a 4978 PR c/29172
97f6bd40
TT
4979 * internal.h (struct cpp_reader) <file_hash_entries>: Changed
4980 type.
4981 <file_hash_entries_allocated, file_hash_entries_used>: Removed.
4982 * files.c (FILE_HASH_POOL_SIZE): New macro.
4983 (struct file_hash_entry_pool): New.
4984 (destroy_all_cpp_files): New function.
4985 (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
4986 (new_file_hash_entry): Update.
4987 (free_file_hash_entries): New function.
4988 (_cpp_cleanup_files): Call free_file_hash_entries and
4989 destroy_all_cpp_files.
4990 (cpp_clear_file_cache): New function.
4991 * include/cpplib.h (cpp_clear_file_cache): Declare.
4992
d56a25e1
TT
49932007-12-03 Tom Tromey <tromey@redhat.com>
4994
765d600a 4995 PR preprocessor/34288
d56a25e1
TT
4996 * configure.ac, config.in: Rebuilt.
4997 * configure.ac: Check for ssize_t.
4998
607f74e9
TT
49992007-11-30 Tom Tromey <tromey@redhat.com>
5000
765d600a 5001 PR preprocessor/32868
607f74e9
TT
5002 * macro.c (_cpp_create_definition): Special case
5003 __STDC_FORMAT_MACROS.
5004
b0f4807f
MM
50052007-11-16 Michael Matz <matz@suse.de>
5006
5007 * files.c (search_path_head): Fix check for absolute paths.
5008
f1e20710
TT
50092007-11-11 Tom Tromey <tromey@redhat.com>
5010
765d600a 5011 PR c++/17557
f1e20710
TT
5012 * include/cpplib.h (cpp_included_before): Declare.
5013 * files.c (struct file_hash_entry) <location>: New field.
5014 (_cpp_find_file): Initialize new field.
5015 (make_cpp_dir): Likewise.
5016 (cpp_included_before): New function.
5017
f373b44d
TT
50182007-11-01 Tom Tromey <tromey@redhat.com>
5019
765d600a 5020 PR preprocessor/30805
f373b44d
TT
5021 * macro.c (paste_tokens): Handle padding token.
5022 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
5023
5b9a40df
TT
50242007-10-31 Tom Tromey <tromey@redhat.com>
5025
765d600a 5026 PR preprocessor/30786
5b9a40df
TT
5027 * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
5028 * directives.c (_cpp_do__Pragma): Return error status.
5029 * internal.h (_cpp_do__Pragma): Update.
5030 * directives.c (get__Pragma_string): Back up if EOF seen.
5031
5ffeb913
TT
50322007-09-06 Tom Tromey <tromey@redhat.com>
5033
5034 * internal.h (struct cpp_reader) <invocation_location>: New
5035 field.
5036 (struct cpp_reader) <set_invocation_location>: Likewise.
5037 * init.c (cpp_set_line_map): New function.
5038 * line-map.c (linemap_add): Use linemap's allocator.
5039 * include/line-map.h (GTY): Define.
5040 (line_map_realloc): New typedef.
5041 (struct line_map): Mark with GTY.
5042 (struct line_maps): Likewise.
5043 (struct line_maps) <maps>: Likewise.
5044 (struct line_maps) <reallocator>: New field.
5045 * include/symtab.h (GTY): Conditionally define.
5046 * include/cpplib.h (cpp_set_line_map): Declare.
5047 (cpp_get_token_with_location): Declare.
5048 * macro.c (cpp_get_token): Set invocation_location on the reader.
5049 (cpp_get_token_with_location): New function.
5050
ac6b1c67
CF
50512007-08-30 Chao-ying Fu <fu@mips.com>
5052
5053 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
5054 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
5055 (cpp_classify_number): Support decimal fixed-point constants without
5056 exponents.
5057 Warn about fixed-point constants when -pedantic.
5058 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
5059 comments to support fixed-point values.
5060 (CPP_N_FRACT, CPP_N_ACCUM): Define.
5061
cda5e672
TT
50622007-08-18 Tom Tromey <tromey@redhat.com>
5063
765d600a 5064 PR preprocessor/32974
cda5e672
TT
5065 * directives.c (parse_include): Don't check for EOL when
5066 processing #pragma dependency.
5067
ccfc4c91
OW
50682007-07-30 Ollie Wild <aaw@google.com>
5069
5070 * directives-only.c: New file.
5071 * internal.h (struct _cpp_dir_only_callbacks): New.
5072 (_cpp_preprocess_dir_only): New function.
5073 * directives.c (_cpp_handle_directive): Check directives_only before
5074 disabling execution of indented directives.
5075 * files.c (_cpp_stack_file): Add directives_only check.
5076 * include/cpplib.h (struct cpp_options): Add directives_only.
5077 (cpp_init_special_builtins): New function.
5078 * init.c (cpp_init_special_builtins): New function.
5079 (cpp_init_builtins): Move builtin_array initialization to
5080 cpp_init_special_builtins.
5081 (post_options): Check directives_only before setting
5082 pfile->state.prevent_expansion = 1.
5083 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
5084 is expanded inside a directive while -fdirectives-only is enabled.
5085 * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
5086 (libcpp_a_SOURCES): Add directives-only.c.
5087
a206413a
UB
50882007-07-04 Uros Bizjak <ubizjak@gmail.com>
5089
5090 * traditional.c (_cpp_scan_out_logical_line): Initialize
5091 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
5092 fmacro.args to prevent 'may be used uninitialized' warning.
5093
c77cd3d1
UB
50942007-07-03 Uros Bizjak <ubizjak@gmail.com>
5095
5096 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
5097 Add new constants.
5098 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
5099 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
5100 for 'q' or 'Q' suffixes.
5101
66938a1d
DS
51022007-06-17 Danny Smith <dannysmith@users.sourceforge.net
5103
e1311401 5104 * files.c (open_file): Correct typo.
66938a1d 5105
71995ede
VP
51062007-06-16 Vladimir Prus <vladimir@codesourcery.com>
5107
e1311401 5108 * files.c (open_file): Prevent the call
71995ede
VP
5109 for stat from overwriting errno.
5110
84152c25
VP
51112007-06-09 Vladimir Prus <vladimir@codesourcery.com>
5112
e1311401 5113 * files.c (open_file): Account for the
19a9ba64
AM
5114 fact that on windows, opening a directory gives
5115 EACCES.
84152c25 5116
f7fd775f
JW
51172007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
5118
5119 PR preprocessor/23479
5120 * expr.c (cpp_classify_number): Implement 0b-prefixed binary
5121 integer constants.
5122 (append_digit): Likewise.
5123 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
5124 binary integer constants.
5125
ed0e74e0
DK
51262007-05-31 Dave Korn <dave.korn@artimi.com>
5127
5128 PR preprocessor/14331
5129 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
5130
a702045a
OW
51312007-05-24 Ollie Wild <aaw@google.com>
5132
5133 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
5134 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
5135 (cpp_write_pch_state): Save __COUNTER__ state.
5136 (cpp_valid_state): Check valid __COUNTER__ state.
5137 (cpp_read_state): Read new __COUNTER__ state.
5138 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
5139 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
5140 * internal.h (struct cpp_reader): Add counter member.
5141
126e073b
SM
51422007-05-23 Simon Martin <simartin@users.sourceforge.net>
5143
5144 PR preprocessor/20077
5145 * macro.c (create_iso_definition): Fixed the method to determine
5146 whether the token-pasting operator appears at the beginning or the end
5147 of a macro.
5148
0b4cafec
ILT
51492007-05-21 Ian Lance Taylor <iant@google.com>
5150
5151 * internal.h (struct cpp_reader): Add new fields:
5152 nonexistent_file_hash and nonexistent_file_ob.
5153 * files.c: Include "obstack.h".
5154 (find_file_in_dir): Before trying to open the file, look up the
5155 path name in the hash table of nonexistent files. After failing
5156 to open the file, add the path name to the hash table.
5157 (_cpp_find_file): Cache the results of looking up the file name
5158 starting with the quote and bracket chain heads, if we can.
5159 (nonexistent_file_hash_eq): New static function.
5160 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
5161 pfile->nonexistent_file_ob.
5162 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
5163 pfile->nonexistent_file_ob.
5164
30e04921
JJ
51652007-05-14 Janis Johnson <janis187@us.ibm.com>
5166
19a9ba64 5167 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
5a6bb57e 5168
30e04921
JJ
5169 PR c/31924
5170 * expr.c (interpret_float_suffix): Check for invalid suffix.
5171
22a8a52d
EC
51722007-05-02 Eric Christopher <echristo@apple.com>
5173
5174 * expr.c (num_div_op): Don't overflow if the result is
5175 zero.
5176
fca35e1b
TT
51772007-05-02 Tom Tromey <tromey@redhat.com>
5178
765d600a 5179 PR preprocessor/28709
fca35e1b
TT
5180 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
5181
4cd97075
MM
51822007-03-30 Michael Meissner <michael.meissner@amd.com>
5183
5184 * directives.c (lex_macro_node_from_str): Fix alloca call to be
5185 type correct.
5186
121de39f
RH
51872007-03-30 Richard Henderson <rth@redhat.com>
5188
5189 * directives.c (lex_macro_node_from_str): New.
5190 (cpp_push_definition, cpp_pop_definition): New.
5191 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
5192
4fcb360b
BM
51932007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
5194
5195 * Makefile.in: Add dummy install-pdf target.
5196
67e64439
TT
51972007-01-30 Tom Tromey <tromey@redhat.com>
5198
765d600a 5199 PR preprocessor/30468
67e64439
TT
5200 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
5201 './'.
5202
ee380365
TT
52032007-01-30 Tom Tromey <tromey@redhat.com>
5204
765d600a 5205 PR preprocessor/29966
ee380365
TT
5206 * macro.c (lex_expansion_token): Save and restore cpp_reader's
5207 cur_token.
5208 (_cpp_create_definition): Don't restore cur_token here.
5209 * lex.c (_cpp_lex_token): Added assertion.
5210
024abeb3
TT
52112007-01-27 Tom Tromey <tromey@redhat.com>
5212
5213 * configure: Rebuilt.
5214
ee1c2a10
TT
52152007-01-12 Tom Tromey <tromey@redhat.com>
5216
765d600a 5217 PR preprocessor/28227
ee1c2a10
TT
5218 * directives.c (lex_macro_node): Added 'is_def_or_undef'
5219 argument.
5220 (do_define): Update.
5221 (do_undef): Update.
5222 (do_ifdef): Update.
5223 (do_ifndef): Update.
5224
67214c16
PB
52252007-01-11 Paolo Bonzini <bonzini@gnu.org>
5226
5227 * configure: Regenerate.
5228
1aa6ca40
PB
52292007-01-11 Paolo Bonzini <bonzini@gnu.org>
5230
5231 * configure: Regenerate.
5232
705e2d28
TT
52332007-01-04 Tom Tromey <tromey@redhat.com>
5234
765d600a 5235 PR preprocessor/28165
705e2d28
TT
5236 * internal.h (cpp_in_primary_file): New function.
5237 * directives.c (do_include_next): Use cpp_in_primary_file.
5238 (do_pragma_once): Likewise.
5239 (do_pragma_system_header): Likewise.
5240
7af45bd4
ILT
52412006-12-29 Ian Lance Taylor <iant@google.com>
5242
5243 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
5244 look backward at the end of the line unless we saw a backslash.
5245
9d30f270
JJ
52462006-12-29 Jakub Jelinek <jakub@redhat.com>
5247
5248 PR preprocessor/29612
5249 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
5250 only when new_sysp is non-zero.
5251
30b0edc0
TT
52522006-12-28 Tom Tromey <tromey@redhat.com>
5253
765d600a 5254 PR preprocessor/30001
30b0edc0
TT
5255 * charset.c (_cpp_convert_input): Check that to.len is greater
5256 than zero.
5257
85d9c13c
TS
52582006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
5259
5260 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
83cc06b2 5261 * configure: Rebuilt.
85d9c13c 5262
dfafdaa6
DG
52632006-11-01 Douglas Gregor <doug.gregor@gmail.com>
5264
5265 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
5266 for experimental C++0x mode.
5267 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
5268 adopted the preprocessor changes introduced in C99.
5269
0f45f0f5
JM
52702006-10-29 Joseph Myers <joseph@codesourcery.com>
5271
5272 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
5273 depending on --enable-targets=all.
5274 * configure: Regenerate.
5275
de000d22
JJ
52762006-10-12 Jakub Jelinek <jakub@redhat.com>
5277
5278 PR preprocessor/28709
5279 * macro.c (paste_tokens): Do error reporting here, use BUF with the
5280 spelled LHS token as opposed to spelling it again.
5281 (paste_all_tokens): Don't report errors here, just break on failure.
5282
b5422ad7
BM
52832006-10-10 Brooks Moses <bmoses@stanford.edu>
5284
5285 * Makefile.in: Added empty "pdf" target.
5286
aaf50ff2
GK
52872006-09-22 Geoffrey Keating <geoffk@apple.com>
5288
5289 * configure.ac: Make need_64_bit_hwint case for x86-darwin
5290 match exactly the glob in gcc/config.gcc.
5291 * configure: Regenerate.
5292
c663e301
JM
52932006-09-13 Joseph S. Myers <joseph@codesourcery.com>
5294
5295 PR c/28768
5296 PR preprocessor/14634
5297 * lex.c (lex_string): Pedwarn for unterminated literals.
5298
f7288899
EC
52992006-09-08 Eric Christopher <echristo@apple.com>
5300
5301 * configure.ac: Add 64-bit HWI support for i?86-darwin.
5302
b52dbbf8
SE
53032006-08-14 Steve Ellcey <sje@cup.hp.com>
5304
5305 PR c++/28288
5306 PR c++/14556
5307 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
5308 (CPP_LAST_EQ): Change.
5309 (CPP_LAST_PUNCTUATOR): Change.
5310 * expr.c (cpp_operator): Remove MIN and MAX.
5311 (reduce): Remove CPP_MIN and CPP_MAX.
5312 (num_binary_op): Ditto.
5313 * lex.c (_cpp_lex_direct): Ditto.
5314 (cpp_avoid_paste): Remove ? as legal symbol after > or <.
5315
1c90c6f9
JJ
53162006-06-09 Jakub Jelinek <jakub@redhat.com>
5317
5318 PR preprocessor/27746
5319 * directives.c (do_pragma): Handle pragma with valid namespace
5320 and invalid name coming from macro expansion.
5321 * directives.c (destringize_and_run): Initialize next field in
5322 context.
5323
5324 PR c/27747
5325 PR c++/27748
5326 * directives.c (destringize_and_run): Set NO_EXPAND on the
5327 tokens.
5328
5329 * macro.c (_cpp_backup_tokens): Fix comment typo.
5330
5c3c3683
DJ
53312006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
5332
5333 * Makefile.in (CATALOGS): Add po/ prefix.
5334 * configure: Regenerated.
5335
b2bd74bc
CD
53362006-05-23 Carlos O'Donell <carlos@codesourcery.com>
5337
5338 * Makefile.in: Add install-html target. Add install-html to .PHONY
5339
be8ac3e2
GZ
53402006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
5341
5342 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
5343 * files.c (_cpp_get_file_stat): New function.
5344 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
5345 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
5346 * internal.h (_cpp_get_file_stat): Prototype.
5347 (struct cpp_buffer): Add timestamp.
5348
83900997
JJ
53492006-01-23 Jakub Jelinek <jakub@redhat.com>
5350
5351 PR preprocessor/25717
5352 * init.c (cpp_init_builtins): If __STDC__ will not change value
5353 between system headers and other sources, define it as a normal
5354 macro rather than a builtin.
5355 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
5356 cpp_in_system_header condition.
5357
53582006-01-05 Paolo Bonzini <bonzini@gnu.org>
9220c30c
PB
5359
5360 * Makefile.in: Use -MMD instead of -MD.
5361
bc4071dd
RH
53622006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
5363 Richard Henderson <rth@redhat.com>
5364
5365 Merge from gomp branch:
5366 * directives.c (struct pragma_entry): Add is_deferred. Add ident
5367 entry to value union.
5368 (end_directive): Don't eat the line if in_deferred_pragma.
5369 (run_directive): Remove pragma hacks.
5370 (insert_pragma_entry): Remove.
5371 (new_pragma_entry): New.
5372 (register_pragma_1): Split out of register_pragma. Only handle
5373 the lookup tree and return the new entry.
5374 (cpp_register_pragma): Fill in the pragma entry here.
5375 (cpp_register_deferred_pragma): New.
5376 (register_pragma_internal): New.
5377 (_cpp_init_internal_pragmas): Use register_pragma_internal.
5378 (do_pragma): Allow pragma expansion after namespace. For deferred
5379 pragmas, don't slurp the line into a string.
5380 (destringize_and_run): Save tokens for deferred pragmas.
5381 (cpp_handle_deferred_pragma): Remove.
5382 * macro.c (builtin_macro): Remove pragma token hack.
5383 (_cpp_push_token_context): Rename from push_token_context and export.
5384 * internal.h (struct lexer_state): Add pragma_allow_expansion.
5385 (_cpp_push_token_context): Declare.
5386 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
5387 a token. Update the line number correctly if so.
5388 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
5389 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
5390 * include/cpplib.h (PRAGMA_EOL): New.
5391 (CPP_TOKEN_FLD_PRAGMA): New.
5392 (struct cpp_token): Add val.pragma.
5393 (struct cpp_options): Remove defer_pragmas.
5394 (cpp_handle_deferred_pragma): Remove.
5395 (cpp_register_deferred_pragma): Declare.
5396
d09e893f
JJ
53972006-01-01 Jakub Jelinek <jakub@redhat.com>
5398
5399 PR c++/25294
5400 * directives.c (do_pragma): If pragma line ends with multi-line
5401 block comment, end the saved deferred pragma string before that
5402 comment. Handle embedded '\0' chars on the pragma line.
5403
ab84748a
VR
54042005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
5405
5406 PR c++/23333
5407 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
5408
ad6ed77e
JG
54092005-12-07 Jon Grimm <jgrimm2@us.ibm.com>
5410 Ben Elliston <bje@au.ibm.com>
5411
5412 * include/cpplib.h (CPP_N_DFLOAT): New.
5413 * expr.c (interpret_float_suffix): Identify df, dd, and dl
5414 suffixes as decimal floating point constants.
5415 (cpp_classify_number): Disallow hexadecimal DFP constants.
5416
ba096620 54172005-11-14 Gerald Pfeifer <gerald@pfeifer.com>
bc4071dd 5418 Ian Lance Taylor <ian@airs.com>
ba096620
GP
5419
5420 * include/cpplib.h (struct cpp_callbacks): Annotate error with
5421 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
5422
456b8ce5
UB
54232005-11-09 Per Bothner <per@bothner.com>
5424 Uros Bizjak <uros@kss-loka.si>
f7288899 5425
456b8ce5
UB
5426 PR c/24101
5427 * init.c (read_original_filename): Temporarily set
5428 state.in_directive before calling _cpp_lex_direct for
5429 CPP_HASH tokens.
5430
5571f74f
JW
54312005-11-03 James E Wilson <wilson@specifix.com>
5432
5433 PR preprocessor/24202
5434 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
5435
a63607ed
JM
54362005-11-04 Joseph S. Myers <joseph@codesourcery.com>
5437
5438 * include/cpplib.h (struct cpp_callbacks): Make error take
5439 va_list* parameter.
5440 * errors.c (cpp_error): Update call to callback.
5441
651ed942
AP
54422005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
5443
5444 PR preprocessor/22042
5445 * macro.c (_cpp_builtin_macro_text): Lower the needed max
5446 buffer size.
5447 (cpp_quote_string): Don't octalify non printable
5448 charactors.
5449
178b58b5
JM
54502005-11-03 Joseph S. Myers <joseph@codesourcery.com>
5451
5452 PR c++/17964
5453 * include/cpplib.h (struct cpp_options): Add client_diagnostic.
5454 (struct cpp_callbacks): Add error.
5455 * errors.c (cpp_error): If client_diagnostic, use error callback.
5456 * charset.c (convert_escape): Don't use %03o in diagnostic.
5457
3ee5ed11 54582005-10-21 James E Wilson <wilson@specifix.com>
6568f34b
JW
5459
5460 PR preprocessor/15220
5461 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all
5462 callers. Pass to open_file_failed.
5463 (open_file_failed): New parameter angle_brackets. Fix all callers.
5464 Use in print_dep assignment.
5465 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
5466 * internal.h (_cpp_find_file): Add new parm to declaration.
f7288899 5467
077fc835
KH
54682005-10-08 Kazu Hirata <kazu@codesourcery.com>
5469
5470 * configure.ac: Require 64-bit int for arm*-*-*eabi*.
5471 * configure: Regenerate.
5472
cbc43ae0
ILT
54732005-10-04 Ian Lance Taylor <ian@airs.com>
5474
5475 PR preprocessor/13726
5476 * directives.c (check_eol_return_comments): New static function.
5477 (parse_include): Add buf parameter. Change all callers.
5478 (do_include_common): If not discard comments, turn on
5479 save_comments. Pass collected comments to include callback.
5480 * include/cpplib.h (struct cpp_callbacks): Add new parameter to
5481 include callback: cpp_token list.
5482
af15a2fe
JM
54832005-09-20 Joseph S. Myers <joseph@codesourcery.com>
5484
5485 * include/cpplib.h (struct cpp_options): Add extended_identifiers.
5486 * init.c (struct lang_flags, lang_defaults): Add
5487 extended_identifiers.
5488 (cpp_set_lang): Use it.
5489 * lex.c (forms_identifier_p): Check extended_identifiers.
5490
f5eab47e
JJ
54912005-08-30 Jakub Jelinek <jakub@redhat.com>
5492
5493 PR preprocessor/20348
5494 PR preprocessor/20356
5495 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
5496 2004-06-05 changes.
5497
467129e6
KG
54982005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5499
5500 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
5501 -Wmissing-format-attribute.
5502
5503 * configure: Regenerate.
5504
200031d1
KC
55052005-06-29 Kelley Cook <kcook@gcc.gnu.org>
5506
5507 * all files: Update FSF address in copyright headers.
5508 * makeucnid.c (write_copyright): Update outputted FSF address.
5509
f610dd5f
ZW
55102005-06-13 Zack Weinberg <zack@codesourcery.com>
5511
5512 * configure.ac: Invoke ZW_CREATE_DEPDIR and
5513 ZW_PROG_COMPILER_DEPENDENCIES.
5514 * aclocal.m4, configure: Regenerate.
5515 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
5516 New variables.
5517 (distclean): Clean up $(DEPDIR) and its contents.
5518 (.c.o): Use $(COMPILE).
5519 Include $(DEPDIR)/*.Po for most object->header dependencies.
5520
c3f829c1
GDR
55212005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
5522
5523 * configure.ac: Check declarations for asprintf and vasprintf.
5524 * config.in: Regenerate.
5525 * configure: Likewise.
5526
5527 * charset.c (conversion_loop): Use XRESIZEVEC.
5528 (convert_no_conversion): Likewise.
5529 (convert_using_iconv): Likewise.
5530 (init_iconv_desc): Cast return value of alloca.
5531 (cpp_host_to_exec_charset): Use XNEWVEC.
5532 (emit_numeric_escape): Use XRESIZEVEC.
5533 (cpp_interpret_string): Use XNEWVEC.
5534 (cpp_interpret_string): Use XRESIZEVEC.
5535 (_cpp_interpret_identifier): Cast return value of alloca.
5536 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
5537 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
5538 (parse_include): Use XNEWVEC.
5539 (insert_pragma_entry): Rename local variable "new" to
f610dd5f 5540 "new_entry".
c3f829c1
GDR
5541 (save_registered_pragmas): Cast return value of xmemdup.
5542 (destringize_and_run): Same for alloca.
5543 (parse_assertion): Likewise.
5544 (do_assert): Cast allocated storage to proper type.
5545 (cpp_define): Likewise.
5546 (_cpp_define_builtin): Likewise.
5547 (cpp_undef): Likewise.
5548 (handle_assertion): Likewise.
5549 (cpp_push_buffer): Rename local variable "new" to "new_buffer".
5550 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
5551 (CPP_UMINUS): Likewise.
5552 (struct cpp_operator): Rename from struct operator.
5553 (_cpp_expand_op_stack): Use XRESIZEVEC.
5554 * files.c (pch_open_file): Use XNEWVEC.
5555 (pch_open_file): Use XRESIZEVEC.
5556 (read_file_guts): Use XNEWVEC and XRESIZEVEC.
5557 (dir_name_of_file): Use XNEWVEC.
5558 (make_cpp_file): Use XCNEW.
5559 (make_cpp_dir): Likewise.
5560 (allocate_file_hash_entries): USE XNEWVEC.
5561 (cpp_included): Cast return value of htab_find_with_hash.
5562 (append_file_to_dir): Use XNEWVEC.
5563 (read_filename_string): Likewise. Use XRESIZEVEC too.
5564 (read_name_map): Cast return value of alloca. Use XRESIZEVEC.
5565 (remap_filename): Use XNEWVEC.
5566 (struct pchf_entry): Move definition out of struct pchf_data.
5567 (_cpp_save_file_entries): Use XCNEWVAR.
5568 (_cpp_read_file_entries): Use XNEWVAR.
5569 * identifiers.c (alloc_node): Use XOBNEW.
5570 * init.c (cpp_create_reader): Use XCNEW.
5571 (cpp_init_builtins): Cast of b->value to enum builtin_type.
5572 (read_original_directory): Cast return value of alloca.
5573 * lex.c (add_line_note): Use XRESIZEVEC.
5574 (warn_about_normalization): Use XNEWVEC.
5575 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
5576 (new_buff): Use XNEWVEC.
5577 * line-map.c (linemap_add): Use XRESIZEVEC.
5578 * macro.c (builtin_macro): Cast return value of alloca.
5579 (paste_tokens): Likewise.
5580 (expand_arg): Use XNEWVEC and XRESIZEVEC.
5581 (_cpp_save_parameter): Use XRESIZEVEC.
5582 (create_iso_definition): Cast allocated storage to proper type.
5583 (_cpp_create_definition): Likewise.
5584 (cpp_macro_definition): Use XRESIZEVEC.
5585 * makedepend.c (add_clm): Use XNEW.
5586 (add_dir): Likewise.
5587 * mkdeps.c (munge): Use XNEWVEC.
5588 (deps_init): Use XCNEW.
5589 (deps_add_target): Use XRESIZEVEC.
5590 (deps_add_default_target): Cast return value of alloca.
5591 (deps_add_dep): Use XRESIZEVEC.
5592 (deps_add_vpath): Likewise. Use XNEWVEC too.
5593 (deps_restore): Likewise.
5594 * pch.c (save_idents): Use XNEW and XNEWVEC.
5595 (cpp_save_state): Use XNEW.
5596 (count_defs): Cast return value of htab_find.
5597 (write_defs): Likewise.
5598 (cpp_write_pch_deps): Use XNEWVEC.
5599 (collect_ht_nodes): Use XRESIZEVEC.
5600 (cpp_valid_state): Use XNEWVEC.
5601 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup.
5602 * symtab.c (ht_create): Use XCNEW.
5603 (ht_lookup_with_hash): Cast return value of obstack_copy0.
5604 (ht_expand): Use XCNEWVEC.
5605 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
5606 (bool): Do not define if __cplusplus.
5607
1ed17cd5
ZW
56082005-05-12 Zack Weinberg <zack@codesourcery.com>
5609
5610 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
5611 (do_sccs): Delete function definition, #define to do_ident.
5612 (do_ident): Don't hardwire directive name.
5613
5a8c20ce
RK
56142005-05-12 Ryota Kunisawa <kunisawa@access.co.jp>
5615
5616 PR bootstrap/21230
5617 * configure: Regenerate.
5618
473c5bc9
AP
56192005-04-27 Andris Pavenis <pavenis@latnet.lv>
5620
5621 * files.c: Include io.h for DJGPP to get prototype of setmode.
5622
c1fc5047
PB
56232005-04-19 Per Bothner <per@bothner.com>
5624
5625 PR preprocessor/20907
5626 * line-map.c (linemap_line_start): Fix bug when we need to increse
5627 column_bits but can re-use the current line_map.
5628
042630ad
KG
56292005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5630
5631 * system.h (fopen, fdopen, freopen): Define these to the unlocked
5632 libiberty functions.
5633
0d667716
KG
56342005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5635
5636 * configure.ac (libcpp_UNLOCKED_FUNCS): New.
5637 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
5638 * system.h (putchar, getc, getchar, clearerr, feof, fileno,
5639 fflush, fgetc, fgets, ferror, fread): Redefine to the associated
5640 _unlocked function.
5641 (fwrite_unlocked): Fix prototype.
1ed17cd5 5642
0d667716
KG
5643 * configure, config.in: Regenerate.
5644
cae064e7
JJ
56452005-04-05 Jakub Jelinek <jakub@redhat.com>
5646
5647 PR preprocessor/19475
5648 * macro.c (create_iso_definition): For < ISO C99, don't
5649 pedwarn if there is no whitespace between macro name and its
5650 replacement, but the replacement starts with a basic character
5651 set character.
5652
cbada204
AJ
56532005-03-28 Andreas Jaeger <aj@suse.de>
5654
5655 * lex.c (warn_about_normalization): Cast field width to int to
5656 avoid warning.
5657
f42eccdb
JM
56582005-03-19 Joseph S. Myers <joseph@codesourcery.com>
5659
5660 * configure.ac: Consistently use solaris2.1[0-9]* instead of
5661 solaris2.1[0-9].
5662 * configure: Regenerate.
5663
c79e602b
GK
56642005-03-15 Geoffrey Keating <geoffk@apple.com>
5665
5666 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
5667 UCN rather than printing an error.
5668
50668cf6
GK
56692005-03-14 Geoffrey Keating <geoffk@apple.com>
5670
6baba9bb
GK
5671 * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
5672
56732005-03-14 Geoffrey Keating <geoffk@apple.com>
1ed17cd5 5674
50668cf6
GK
5675 * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
5676 * charset.c: Update for new format of ucnid.h.
5677 (ucn_valid_in_identifier): Update for new format of ucnid.h.
5678 Add NST parameter, and update it; update callers.
5679 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort
5680 with cpp_error.
5681 (convert_ucn): Pass normalize_state to cpp_valid_ucn.
5682 * internal.h (struct normalize_state): New.
5683 (INITIAL_NORMALIZE_STATE): New.
5684 (NORMALIZE_STATE_RESULT): New.
5685 (NORMALIZE_STATE_UPDATE_IDNUM): New.
5686 (_cpp_valid_ucn): New.
5687 * lex.c (warn_about_normalization): New.
5688 (forms_identifier_p): Add normalize_state parameter, update callers.
5689 (lex_identifier): Add normalize_state parameter, update callers. Keep
5690 the state current.
5691 (lex_number): Likewise.
5692 (_cpp_lex_direct): Pass normalize_state to subroutines. Check
5693 it with warn_about_normalization.
5694 * makeucnid.c: New.
5695 * ucnid.h: Replace.
5696 * ucnid.pl: Remove.
5697 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove
5698 comments about obsolete version of C++.
5699 * include/cpplib.h (enum cpp_normalize_level): New.
5700 (struct cpp_options): Add warn_normalize field.
5701
47e20491
GK
57022005-03-11 Geoffrey Keating <geoffk@apple.com>
5703
5704 * directives.c (glue_header_name): Update call to cpp_spell_token.
5705 * internal.h (_cpp_interpret_identifier): New.
5706 * charset.c (_cpp_interpret_identifier): New.
5707 (_cpp_valid_ucn): Allow UCN version of '$'.
5708 * lex.c (lex_identifier): Add extra parameter to indicate if initial
5709 character was '$' or '\'. Support identifiers with UCNs.
5710 (forms_identifier_p): Allow UCNs.
5711 (_cpp_lex_direct): Pass extra parameter to lex_identifier.
5712 (utf8_to_ucn): New.
5713 (cpp_spell_token): Add FORSTRING parameter. Use it.
5714 (cpp_token_as_text): Update call to cpp_spell_token.
5715 (cpp_output_token): Write UCNs back out.
5716 (stringify_arg): Update call to cpp_spell_token.
5717 (paste_tokens): Likewise.
5718 (cpp_macro_definition): Likewise.
5719 * macro.c (stringify_arg): Likewise.
5720 (paste_tokens): Likewise.
5721 (cpp_macro_definition): Likewise.
5722 * include/cpplib.h: Add parameter to cpp_spell_token.
5723
73096711
JJ
57242005-03-04 Jakub Jelinek <jakub@redhat.com>
5725
5726 PR bootstrap/20282
5727 PR bootstrap/20305
5728 * macro.c (replace_args, cpp_get_token): Copy whole
5729 cpp_token_u instead of just cpp_string field from it.
5730
2203a881
DP
57312005-02-28 Devang Patel <dpatel@apple.com>
5732
5733 * directives.c (do_line): Save sysp early before line table is
5734 realloc'ed.
1ed17cd5 5735
c5ff069d
ZW
57362005-02-20 Zack Weinberg <zack@codesourcery.com>
5737
5738 PR 18785
5739 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
5740 (cpp_host_to_exec_charset): New function.
5741 * include/cpplib.h: Declare cpp_host_to_exec_charset.
5742
04c90eea
DP
57432005-02-19 Devang Patel <dpatel@apple.com>
5744
5745 * charset.c (_cpp_convert_input): Check '\r' before inserting
5746 '\n' at the end.
c5ff069d 5747
6da55c00
EC
57482005-02-15 Eric Christopher <echristo@redhat.com>
5749
5750 PR preprocessor/19077
5751 * macro.c (cpp_macro_definition): Move handling of whitespace
5752 to PREV_WHITE conditional. Remove overloading of len
5753 variable.
5754
31c3e631
KH
57552005-02-14 Kazu Hirata <kazu@cs.umass.edu>
5756
5757 * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
5758 traditional.c: Update copyright.
5759
be0f1e54
PB
57602005-02-14 Paolo Bonzini <bonzini@gnu.org>
5761
5762 PR bootstrap/19818
5763 * configure.ac: Check for declaration of basename and getopt.
5764 * config.in: Regenerate.
5765 * configure: Regenerate.
5766 * internal.h (ustrcspn): New.
5767 * macro.c (create_iso_definition): Fix allocation of memory.
5768 (padding_token): Add cast to remove const-ness.
5769 * pch.c (cpp_read_state): Use ustrcspn.
5770
ecddfb39
MS
57712005-02-08 Mike Stump <mrs@apple.com>
5772
5773 * files.c (pchf_adder): Remove.
5774 (struct pchf_adder_info): Likewise.
5775 (_cpp_save_file_entries): Write out all files so that #import works.
5776
9fcdd891
JM
57772005-01-23 Joseph S. Myers <joseph@codesourcery.com>
5778
5779 * configure: Regenerate.
5780
ecfd72e7
TS
57812005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
5782
5783 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
5784
6c25a4f7 5785 * include/cpplib.h: Also update copyright years.
c5ff069d 5786
942926ad
GK
57872005-01-03 Geoffrey Keating <geoffk@apple.com>
5788
5789 * files.c (_cpp_find_file): Add files found by search_path_exhausted
5790 to the list of all files.
5791
a2566ae9
GDR
57922005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
5793
5794 * internal.h: Update references to Cpp lib filenames.
5795 * directives.c: Likewise.
5796 * init.c: Likewise.
5797 * macro.c: Likewise.
5798 * traditional.c: Likewise.
5799
1b449375
EB
58002004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
5801
5802 PR preprocessor/15167
5803 * files.c (destroy_cpp_file): New function.
5804 (should_stack_file): Make a new file if the
5805 compared file is still stacked.
5806
28303828
NN
58072004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
5808
c5ff069d 5809 PR preprocessor/17610
28303828
NN
5810 * directives.c (do_include_common): Error out if an empty filename
5811 is given for #include (or #include_next or #import).
5812
c812785a
RS
58132004-11-27 Roger Sayle <roger@eyesopen.com>
5814 Zack Weinberg <zack@codesourcery.com>
5815
5816 * internal.h: Replace all uses of uchar with unsigned char.
5817 * include/cpp-id-data.h: Likewise. Guard typedef of uchar
5818 with !IN_GCC, so uchar is only defined whilst building libcpp.
5819
f91eaa01
KC
58202004-11-24 Kelley Cook <kcook@gcc.gnu.org>
5821
5822 * aclocal.m4: Regenerate.
5823
f78ce0c2
RS
58242004-11-24 Roger Sayle <roger@eyesopen.com>
5825
5826 PR preprocessor/15824
5827 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
5828 directly, instead of the non-existant "system.h" and "ansidecl.h".
5829 * configure: Regenerate.
5830
b5b3e36a 58312004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
c5ff069d 5832 Joseph Myers <joseph@codesourcery.com>
b5b3e36a
DJ
5833
5834 * internal.h (struct lexer_state): Add in_deferred_pragma.
5835 * directives.c (struct pragma_entry): Add allow_expansion.
5836 (insert_pragma_entry): Take allow_expansion flag.
5837 (register_pragma): Likewise.
5838 (cpp_register_pragma): Likewise.
5839 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
5840 (do_pragma): Honor allow_expansion.
5841 (cpp_handle_deferred_pragma): Set in_deferred_pragma.
5842 * include/cpplib.h (cpp_register_pragma): Update prototype.
5843
a8e68029 58442004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
c5ff069d 5845 Mark Mitchell <mark@codesourcery.com>
a8e68029
DJ
5846
5847 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
5848 need_64bit_hwint=yes.
5849 * configure: Regenerate.
5850
50f47ee0
JM
58512004-11-09 Joseph S. Myers <joseph@codesourcery.com>
5852
5853 * Makefile.in ($(PACKAGE).pot): New rule. Depend on
5854 po/$(PACKAGE).pot.
5855 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
5856 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
5857 Remove local srcdir path from generated file.
5858
968e08d6 58592004-11-04 Zack Weinberg <zack@codesourcery.com>
c5ff069d 5860 Gerald Pfeifer <gerald@pfeifer.com>
968e08d6
ZW
5861
5862 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
5863 as well.
5864
3da3d587
ZW
58652004-10-27 Zack Weinberg <zack@codesourcery.com>
5866
5867 PR 18075
5868 * directives.c (do_pragma): Do not defer pragmas which are unknown.
5869 (cpp_handle_deferred_pragma): Add cast to silence warning.
5870
ac24fc25
JM
58712004-10-14 Joseph S. Myers <jsm@polyomino.org.uk>
5872
5873 * errors.c (_cpp_begin_message): Print "error: " for errors.
5874
7731405b
AJ
58752004-10-10 Andreas Jaeger <aj@suse.de>
5876
5877 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
5878 * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
5879
646544e3
AP
58802004-10-08 Andrew Pinski <pinskia@physics.uc.edu>
5881
5882 * pch.c (cpp_write_pch_state): Remove variable z as it is not
5883 used.
5884 (cpp_read_state): Remove unused variables, m, d and mac_count.
5885
67a74146
PB
58862004-09-29 Per Bothner <per@bothner.com>
5887
5888 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore
5889 cb.line_change. Otherwise do_pragma will call the line_change
5890 call-back with a meaningless line number.
5891
018a4785
ZW
58922004-09-24 Zack Weinberg <zack@codesourcery.com>
5893
5894 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
5895 programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
5896 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
5897 * aclocal.m4, configure: Regenerate.
5898 * init.c: Include localedir.h.
5899 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
5900 (DEFS): Delete.
5901 (.c.o): Use $(ALL_CFLAGS).
5902 (localedir.h, localedir.hs): New rules.
5903 (clean): Use rm -rf to remove directories.
5904 (distclean): Also delete localedir.h and localedir.hs.
5905 (init.o): Update dependencies.
5906
88fa57d7
KC
59072004-09-22 Kelley Cook <kcook@gcc.gnu.org>
5908
5909 * Makefile.in (aclocal.m4): Update dependencies.
5910 * configure.ac (AC_CONFIG_MACRO_DIR): New.
5911 * aclocal.m4, configure: Regenerate.
5912
8f8e9aa5
ZW
59132004-09-17 Zack Weinberg <zack@codesourcery.com>
5914
a29f62d9
ZW
5915 * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
5916 (_cpp_convert_input, _cpp_default_encoding): Add comments.
5917 Some other comments in this file also tweaked.
5918
8f8e9aa5
ZW
5919 * directives.c (do_pragma): Save current buffer position
5920 before lexing the pragma keywords; don't call
5921 _cpp_backup_tokens in the defer_pragmas case.
5922
a2981930
PB
59232004-09-15 Per Bothner <per@bothner.com>
5924
5925 * include/line-map.h (line_map_start): Add parameter names so
5926 preceding comment makes sense.
5927 (linemap_add): Remove from comment mention of non-existing parameter.
5928
21b11495
ZW
59292004-09-09 Matt Austern <austern@apple.com>
5930 Zack Weinberg <zack@codesourcery.com>
5931
5932 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
5933 prefixes throughout. Add entry for PRAGMA. Remove
5934 unnecessary "= 0" from EQ.
5935 (enum cpp_ttype): Adjust OP and TK definitions to restore
5936 prefixes, via token-paste.
5937 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
5938 Change from #defines to additional cpp_ttype enumerators.
5939 (struct cpp_options): Add defer_pragmas.
5940 (cpp_handle_deferred_pragma): Prototype new interface.
5941
5942 * internal.h (struct cpp_reader): Add directive_result.
5943 * directives.c (struct pragma_entry): Add is_internal field;
5944 give boolean fields type bool.
5945 (start_directive): Initialize pfile->directive_result.type.
5946 (_cpp_do__Pragma): Likewise.
5947 (run_directive): Do not crash if pfile->buffer->prev is NULL.
5948 (insert_pragma_entry): Add 'internal' argument; set new->is_internal
5949 from it.
5950 (register_pragma): New static function, bulk of former
5951 cpp_register_pragma here; add 'internal' argument, pass along
5952 to insert_pragma_entry.
5953 (cpp_register_pragma): Now a wrapper around register_pragma which
5954 always passes false for 'internal' argument.
5955 (_cpp_init_internal_pragmas): Call register_pragma directly, passing
5956 true for 'internal'.
5957 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
5958 an internal pragma, save text till the end of the line as a CPP_PRAGMA
5959 token instead of executing the pragma.
5960 (cpp_handle_deferred_pragma): New interface.
5961 * lex.c (token_spellings): Adjust OP and TK definitions to
5962 match changes to cpplib.h.
5963 (_cpp_lex_token): Check for a directive-result token and
5964 return it if present.
5965 (cpp_token_val_index): Handle CPP_PRAGMA.
5966 * macro.c (cpp_builtin_macro_text): Correct comment.
5967 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
5968
0fd9e8dd
SB
59692004-09-06 Serge Belyshev <belyshev@lubercy.com>
5970
5971 PR preprocessor/14699
5972 * symtab.c (ht_dump_statistics): Change type of sum_of_squares
5973 from size_t to double.
5974
39b8ce7f
AS
59752004-08-28 Andreas Schwab <schwab@suse.de>
5976 Andreas Jaeger <aj@suse.de>
5977
5978 * configure.ac: Set PACKAGE correctly.
5979 * configure: Regenerated.
5980
5d1f4b27
PB
59812004-08-25 Paolo Bonzini <bonzini@gnu.org>
5982
5983 * Makefile.in: Add back top_builddir.
5984
078e3ffe
PB
59852004-08-25 Paolo Bonzini <bonzini@gnu.org>
5986
5987 * configure.ac: Replace Automake macro invocations
5988 with manual Autoconf checks and substitutions.
5989 * configure: Regenerate.
5990 * aclocal.m4: Regenerate.
5991 * config.in: Regenerate.
5992 * Makefile.am: Removed.
5993 * Makefile.in: Heavy simplification and reorganization.
5994
b3f8d95d
MM
59952004-08-09 Mark Mitchell <mark@codesourcery.com>
5996
5997 * configure.ac (arm*-*-eabi*): New target.
5998 (arm*-*-symbianelf*): Likewise.
5999 * configure: Regenerated.
6000
72bb2c39
BI
60012004-07-24 Bernardo Innocenti <bernie@develer.com>
6002
6003 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
6004 * directives.c: Use XNEW-family macros from libiberty.
6005 * lex.c: Likewise.
6006 * macro.c: Likewise.
6007 * cpplib.h (cpp_deps_style): Export enum with name.
6008
21b11495 60092004-07-23 Matthias Klose <doko@debian.org>
72bb2c39 6010
21b11495 6011 * init.c (init_library): Use PACKAGE for the text domain.
85eac2a0 6012
a23ee064
AP
60132004-07-16 Andris Pavenis <pavenis@latnet.lv>
6014
6015 PR preprocessor/16366
6016 * internal.h (struct cpp_reader): New field dir_hash.
6017 * files.c (make_cpp_dir): Use dir_hash, not file_hash.
6018 (_cpp_init_files, _cpp_cleanup_files): Update for new field.
6019
a09d4744
NB
60202004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
6021
6022 PR preprocessor/16192
6023 PR preprocessor/15913
6024 PR preprocessor/15572
6025 * expr.c (_cpp_parse_expr): Handle remaining cases where an
6026 expression is missing.
6027 * init.c (post_options): Traditional cpp doesn't do // comments.
6028
f58f7def
PB
60292004-06-30 Per Bothner <per@bothner.com>
6030
6031 * include/line-map.h (fileline): Remove old typedef.
6032 * internal.h (struct cpp_reader): Use source_location typedef instead.
6033
e83d8d43
ZW
60342004-06-26 Zack Weinberg <zack@codesourcery.com>
6035
6036 Partially revert patch of 2004-06-05.
6037 * files.c (search_cache): Remove pfile argument. Don't check
6038 for file that would be found by "" or <> search here...
6039 (_cpp_find_file): ...do it here, before calling find_file_in_dir.
6040 Do not apply directory-of-current-file correction to files
6041 found by this check. Rearrange code slightly.
6042
c0d578e6
GK
60432004-06-21 Geoffrey Keating <geoffk@apple.com>
6044
6045 * files.c (should_stack_file): Correct swapped parameters to call
6046 to cb.read_pch.
6047 * pch.c (cpp_valid_state): Handle -fpreprocessed.
6048
159d5224
PB
60492004-06-15 Paolo Bonzini <bonzini@gnu.org>
6050
6051 * Makefile.in: Regenerate with automake 1.8.5.
6052 * aclocal.m4: Likewise.
6053 * configure: Regenerate.
6054
2fac9c01
ZW
60552004-06-11 Zack Weinberg <zack@codesourcery.com>
6056
6057 * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
6058 * configure, config.in: Regenerate.
6059 * system.h: Unconditionally define bool as unsigned char,
6060 BOOL_BITFIELD as unsigned int.
6061 * .cvsignore: New file.
6062
d8044160
GK
60632004-06-09 Geoffrey Keating <geoffk@apple.com>
6064
6065 * traditional.c (push_replacement_text): Set macro->traditional.
6066 (save_replacement_text): Likewise.
6067 * pch.c (cpp_write_pch_state): Don't write list of defined macros.
6068 (struct save_macro_item): Delete.
6069 (struct save_macro_data): Use a character array not the previous
6070 structured format.
6071 (save_macros): Save macro as text not as internal structures.
6072 (cpp_prepare_state): Update for changes to save_macro_data.
6073 (cpp_read_state): Don't read macros defined in PCH. Restore
2cf22451 6074 -D macros as text.
d8044160
GK
6075 * macro.c (create_iso_definition): Honour alloc_subobject.
6076 Clear traditional flag.
6077 (_cpp_create_definition): Honour alloc_subobject.
6078 * lex.c (cpp_token_val_index): New.
6079 * internal.h: Include cpp-id-data.h.
6080 (uchar): Move definition to cpp-id-data.h.
6081 (U): Likewise.
6082 (cpp_macro): Likewise.
6083 * directives.c (struct answer): Move to cpp-id-data.h.
6084 (do_assert): Honour alloc_subobject.
2cf22451
ZW
6085
6086 * include/symtab.h (struct ht): Add field 'alloc_subobject'.
6087 * include/cpplib.h (struct cpp_string): Add GTY marker.
6088 (enum cpp_token_fld_kind): New.
6089 (struct cpp_token): Add GTY markers.
6090 (cpp_token_val_index): Prototype.
6091 (CPP_HASHNODE_VALUE_IDX): New.
6092 (struct cpp_hashnode): Don't skip fields of 'value' when marking.
6093 * include/cpp-id-data.h: New file.
d8044160 6094
0ca8e815
PB
60952004-06-09 Paolo Bonzini <bonzini@gnu.org>
6096
6097 * Makefile.am (all-local): New.
6098 * Makefile.in: Regenerate.
6099
b51fa00f
RS
61002004-06-06 Roger Sayle <roger@eyesopen.com>
6101
6102 * Makefile.am (LIBICONV): Declare.
6103 (makedepend_LDADD): Use LIBICONV.
6104 * Makefile.in: Regenerate.
6105
5e2f3f39
AP
61062004-06-05 Andrew Pinski <pinskia@physics.uc.edu>
6107
6108 * Makefile.am (LIBINTL): Declare
6109 (makedepend_LDADD): Use LIBINTL.
6110 * Makefile.in: Regenerate.
6111
c6e83800
ZW
61122004-06-05 Zack Weinberg <zack@codesourcery.com>
6113
6114 * Makefile.am: Add makedepend.
6115 * Makefile.in, aclocal.m4: Regenerate.
6116 * charset.c: Insert a space to avoid a warning.
6117 * directives.c: Include mkdeps.h.
6118 (_cpp_handle_directive): Reenable macro expander if appropriate.
6119 (undefine_macros): Inline body of _cpp_free_definition for speed.
6120 Do not call undef callback or _cpp_warn_if_unused_macro.
6121 (cpp_get_deps): New interface.
6122 * files.c (search_cache): Add pfile argument. Check for file
6123 that would be found by "" or <> search here...
6124 (_cpp_find_file): ...not here. Correct recorded start_dir of
6125 files found by directory-of-current-file search that would be
6126 found by "" or <> search.
6127 * init.c (cpp_add_dependency_target): Delete.
6128 * internal.h (struct lexer_state): Add discarding_output flag.
6129 * lex.c (lex_identifier): Compute hash function while scanning.
6130 * macro.c (cpp_scan_nooutput): Disable macro expansion outside
6131 directives.
6132 * makedepend.c: New file.
6133 * mkdeps.c (struct deps): Add vpath vector.
6134 (apply_vpath, deps_add_vpath): New function.
6135 (deps_free): Free vpath vector.
6136 (deps_add_dep, deps_add_target): Use apply_vpath.
6137 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
6138 (ht_lookup_with_hash): New function.
6139 * cpplib.h, mkdeps.h: Update prototypes.
6140 * symtab.h: Update prototypes.
6141 (HT_HASHSTEP, HT_FINISH): New macros.
6142
b453c95f
GK
61432004-05-29 Geoffrey Keating <geoffk@apple.com>
6144
6145 * symtab.c (ht_create): Set entries_owned.
6146 (ht_destroy): Honour entries_owned.
6147 (ht_expand): Likewise.
6148 (ht_load): New.
2cf22451
ZW
6149 * include/symtab.h (struct ht): New field 'entries_owned'
6150 (ht_load): New prototype.
b453c95f 6151
963e23c5
PB
61522004-05-26 Paolo Bonzini <bonzini@gnu.org>
6153
6154 PR bootstrap/15651
6155 * configure.ac: Fix m4 quoting when picking
6156 the size of HOST_WIDE_INT.
6157 * configure: Regenerate.
6158
0429bc77
PB
61592004-05-25 Paolo Bonzini <bonzini@gnu.org>
6160
6161 * Makefile.am: the correct directory for
6162 gettext include files is given by @INCINTL@.
6163 * Makefile.in: Regenerate.
6164
c86dd7db
PB
61652004-05-24 Paolo Bonzini <bonzini@gnu.org>
6166
6167 * system.h [!ENABLE_NLS]: dgettext takes two
6168 parameters.
6169
4f4e53dd
PB
61702004-05-23 Paolo Bonzini <bonzini@gnu.org>
6171
6172 Moved libcpp from the gcc subdirectory to the toplevel.
6173 * Makefile.am: New file.
6174 * Makefile.in: Regenerate.
6175 * configure.ac: New file.
6176 * configure: Regenerate.
6177 * config.in: Regenerate.
6178 * charset.c: Moved from gcc/cppcharset.c. Add note about
6179 brokenness of input charset detection. Adjust for change
6180 in name of cppucnid.h.
6181 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
6182 * expr.c: Moved from gcc/cppexp.c.
6183 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
6184 Remove #define of O_BINARY, it is in system.h.
6185 * identifiers.c: Moved from gcc/cpphash.c.
6186 * internal.h: Moved from gcc/cpphash.h. Change header
6187 guard name. All other files adjusted to match name change.
6188 * init.c: Moved from gcc/cppinit.c.
6189 (init_library) [ENABLE_NLS]: Call bindtextdomain.
6190 * lex.c: Moved from gcc/cpplex.c.
6191 * directives.c: Moved from gcc/cpplib.c.
6192 * macro.c: Moved from gcc/cppmacro.c.
6193 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
6194 * traditional.c: Moved from gcc/cpptrad.c.
6195 * ucnid.h: Moved from gcc/cppucnid.h. Change header
6196 guard name.
6197 * ucnid.pl: Moved from gcc/cppucnid.pl.
6198 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header
6199 guard name.
6200 * symtab.c: Moved from gcc/hashtable.c.
6201 * line-map.c: Moved from gcc. Do not include intl.h.
6202 * mkdeps.c: Moved from gcc.
6203 * system.h: New file.
2cf22451
ZW
6204 * include/cpplib.h: Moved from gcc. Change header guard name.
6205 * include/line-map.h: Moved from gcc. Change header guard name.
6206 * include/mkdeps.h: Moved from gcc. Change header guard name.
6207 * include/symtab.h: Moved from gcc/hashtable.h. Change header
6208 guard name.
818ab71a 6209\f
8d9254fc 6210Copyright (C) 2004-2020 Free Software Foundation, Inc.
818ab71a
JJ
6211
6212Copying and distribution of this file, with or without modification,
6213are permitted in any medium without royalty provided the copyright
6214notice and this notice are preserved.