]> git.ipfire.org Git - thirdparty/gcc.git/blame - libcpp/ChangeLog
re PR tree-optimization/72810 (error: type mismatch for case label in switch statement)
[thirdparty/gcc.git] / libcpp / ChangeLog
CommitLineData
8204be6c
AS
12016-08-01 Andreas Schwab <schwab@suse.de>
2
3 * include/cpplib.h: Fix comment typo.
4
a01fc549
DM
52016-07-27 David Malcolm <dmalcolm@redhat.com>
6
7 * include/line-map.h (source_location): Fix line numbers in
8 comment.
9
741d3be5
DM
102016-07-11 David Malcolm <dmalcolm@redhat.com>
11
12 * include/line-map.h (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES):
13 Move here from line-map.c.
14 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
15 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): Move from
16 here to line-map.h.
17 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
18
ac81cf0b
DM
192016-06-22 David Malcolm <dmalcolm@redhat.com>
20
21 * directives.c (do_include_common): Pass on "location" to
22 _cpp_stack_include.
23 * errors.c (cpp_diagnostic): Reimplement in terms of...
24 (cpp_diagnostic_at): New function.
25 (cpp_error_at): New function.
26 (cpp_errno_filename): Add "loc" param and use it by using
27 cpp_error_at rather than cpp_error.
28 * files.c (find_file_in_dir): Add "loc" param and pass it to
29 open_file_failed.
30 (_cpp_find_file): Add "loc" param. Use it to convert calls to
31 cpp_error to cpp_error_at, and pass it to find_file_in_dir and
32 open_file_failed.
33 (read_file_guts): Add "loc" param. Use it to convert calls to
34 cpp_error to cpp_error_at. Pass it to cpp_errno_filename.
35 (read_file): Add "loc" param. Pass it to open_file_failed and
36 read_file_guts.
37 (should_stack_file): Add "loc" param. Pass it to read_file.
38 (_cpp_stack_file): Add "loc" param. Pass it to should_stack_file.
39 (_cpp_stack_include): Add "loc" param. Pass it to
40 _cpp_find_file and _cpp_stack_file.
41 (open_file_failed): Add "loc" param. Pass it to
42 cpp_errno_filename.
43 (_cpp_fake_include): Add 0 as a source_location in call to
44 _cpp_find_file.
45 (_cpp_compare_file_date): Likewise.
46 (cpp_push_include): Likewise for call to _cpp_stack_include.
47 (cpp_push_default_include): Likewise.
48 (_cpp_save_file_entries): Likewise for call to open_file_failed.
49 (_cpp_has_header): Likewise for call to _cpp_find_file.
50 * include/cpplib.h (cpp_errno_filename): Add source_location
51 param.
52 (cpp_error_at): New declaration.
53 * init.c (cpp_read_main_file): Add 0 as a source_location in calls
54 to _cpp_find_file and _cpp_stack_file.
55 * internal.h (_cpp_find_file): Add source_location param.
56 (_cpp_stack_file): Likewise.
57 (_cpp_stack_include): Likewise.
58
a93eac6a
DM
592016-06-22 David Malcolm <dmalcolm@redhat.com>
60
61 * include/line-map.h (fixit_hint::get_start_loc): New pure virtual
62 function.
63 (fixit_hint::maybe_get_end_loc): Likewise.
64 (fixit_insert::get_start_loc): New function, implementing
65 fixit_hint::get_start_loc.
66 (fixit_insert::maybe_get_end_loc): New function, implementing
67 fixit_hint::maybe_get_end_loc.
68 (fixit_remove::get_start_loc): New function, implementing
69 fixit_hint::get_start_loc.
70 (fixit_remove::maybe_get_end_loc): New function, implementing
71 fixit_hint::maybe_get_end_loc.
72 (fixit_replace::get_start_loc): New function, implementing
73 fixit_hint::get_start_loc.
74 (fixit_replace::maybe_get_end_loc): New function, implementing
75 fixit_hint::maybe_get_end_loc.
76
fe55692c
JDA
772016-06-21 John David Anglin <danglin@gcc.gnu.org>
78
79 * line-map.c (location_adhoc_data_update): Use int64_t instead of
80 long long.
81 (get_combined_adhoc_loc): Likewise.
82
15c98b2e
ES
832016-06-01 Eduard Sanou <dhole@openmailbox.org>
84
85 * include/cpplib.h (cpp_callbacks): Add get_source_date_epoch
86 callback.
87 * include/cpplib.h (cpp_init_source_date_epoch): Remove prototype.
88 * init.c (cpp_init_source_date_epoch): Remove function.
89 * init.c (cpp_create_reader): Initialize pfile->source_date_epoch.
90 * internal.h (cpp_reader): Extend comment about source_date_epoch.
91 * macro.c (_cpp_builtin_macro_text): Use get_source_date_epoch
92 callback only once, read pfile->source_date_epoch on future passes.
93 Check that get_source_date_epoch callback is not NULL.
94
ceb17928
ML
952016-05-20 Martin Liska <mliska@suse.cz>
96
97 * config.in: Regenerated.
98 * configure: Likewise.
99 * configure.ac: Handle --enable-valgrind-annotations.
100 * lex.c (new_buff): Use ENABLE_VALGRIND_ANNOTATIONS instead
101 of ENABLE_VALGRIND_CHECKING.
102 (_cpp_free_buff): Likewise.
103
174f6622
ES
1042016-04-28 Eduard Sanou <dhole@openmailbox.org>
105 Matthias Klose <doko@debian.org>
106
107 * include/cpplib.h (cpp_init_source_date_epoch): Prototype.
108 * init.c (cpp_init_source_date_epoch): New function.
109 * internal.h: Added source_date_epoch variable to struct
110 cpp_reader to store a reproducible date.
111 * macro.c (_cpp_builtin_macro_text): Set pfile->date timestamp from
112 pfile->source_date_epoch instead of localtime if source_date_epoch is
113 set, to be used for __DATE__ and __TIME__ macros to help reproducible
114 builds.
115
12de2245
BS
1162016-04-13 Bernd Schmidt <bschmidt@redhat.com>
117
118 Patch from Roger Orr <rogero@howzatt.demon.co.uk>
119 PR preprocessor/69650
120 * directives.c (do_linemarker): Reread map after calling
121 cpp_get_token.
122
64824205
RH
1232016-04-06 Richard Henderson <rth@redhat.com>
124
125 PR preprocessor/61817
126 PR preprocessor/69391
127 * internal.h (_cpp_builtin_macro_text): Update decl.
128 * macro.c (_cpp_builtin_macro_text): Accept location for __LINE__.
129 (builtin_macro): Accept a second location for __LINE__.
130 (enter_macro_context): Compute both virtual and real expansion
131 locations for the macro.
132
3caf0ca1
BS
1332016-03-25 Bernd Schmidt <bschmidt@redhat.com>
134
135 PR lto/69650
136 * directives.c (do_linemarker): Test for file left but not entered
137 here.
138 * line-map.c (linemap_add): Not here.
139
6b366948
JJ
1402016-03-21 Jakub Jelinek <jakub@redhat.com>
141
142 PR target/70296
143 * include/cpplib.h (cpp_fun_like_macro_p): New prototype.
144 * macro.c (cpp_fun_like_macro_p): New function.
145
64567cfd
RH
1462016-03-15 Richard Henderson <rth@redhat.com>
147
148 * line-map.c (new_linemap): Make alloc_size a size_t.
149
2aaeea19
JM
1502016-03-14 Jason Merrill <jason@redhat.com>
151
152 * expr.c (cpp_classify_number): Hex floats are new in C++1z.
153 * init.c (lang_defaults): Likewise.
154
b4f3232d
DM
1552016-03-09 David Malcolm <dmalcolm@redhat.com>
156
157 PR c/68473
158 PR c++/70105
159 * line-map.c (linemap_macro_map_loc_unwind_toward_spelling): Move
160 decl...
161 * include/line-map.h
162 (linemap_macro_map_loc_unwind_toward_spelling): ...here,
163 converting from static to extern.
164
40499f81
DM
1652016-03-09 David Malcolm <dmalcolm@redhat.com>
166
167 PR c/68473
168 PR c++/70105
169 * include/line-map.h (source_range::debug): Delete.
170 (struct location_range): Update comment. Replace
171 expanded_location fields "m_start", "m_finish", and "m_caret" with
172 a source_location field: "m_loc".
173 (class rich_location): Reword comment.
174 (rich_location::get_loc): Reimplement in terms of a new overloaded
175 variant which takes an unsigned int.
176 (rich_location::get_loc_addr): Delete.
177 (rich_location::add_range): Drop params "start" and "finish" in
178 favor of param "loc". Drop overloaded variants taking a
179 source_range or location_range *.
180 (rich_location::lazily_expand_location): Delete in favor of...
181 (rich_location::get_expanded_location): New decl.
182 (rich_location::m_loc): Delete field.
183 (rich_location::m_column_override): New field.
184 * line-map.c (rich_location::rich_location): Drop name of
185 line_maps * param. Update initializations for deletion of field
186 "m_loc" and addition of field "m_column_override". Reimplement
187 body as a call to add_range. Delete overloaded variant taking a
188 source_range.
189 (rich_location::get_loc): New function.
190 (rich_location::lazily_expand_location): Delete in favor of...
191 (rich_location::get_expanded_location): New function.
192 (rich_location::override_column): Reimplement.
193 (rich_location::add_range): Drop params "start" and "finish" in
194 favor of param "loc". Eliminate location expansion in favor of
195 simply storing loc. Drop overloaded variants taking a
196 source_range or location_range *.
197 (rich_location::set_range): Eliminate location expansion.
198
7168133a
DM
1992016-02-29 David Malcolm <dmalcolm@redhat.com>
200
201 PR preprocessor/69985
202 (linemap_position_for_loc_and_offset): Rename param from "offset"
203 to "column_offset". Right-shift the column_offset by m_range_bits
204 of the pertinent ordinary map whenever offsetting a
205 source_location. For clarity, offset the column by the column
206 offset, rather than the other way around.
207
196440f8
DM
2082016-02-23 David Malcolm <dmalcolm@redhat.com>
209
210 PR preprocessor/69126
211 PR preprocessor/69543
212 * line-map.c (linemap_compare_locations): At the function top,
213 replace inlined bodies of get_location_from_adhoc_loc with calls
214 to get_location_from_adhoc_loc. Add a pair of calls to
215 get_location_from_adhoc_loc at the bottom of the function, to
216 avoid meaningless comparisons of ad-hoc and non-ad-hoc locations.
217
44714d8c
DM
2182016-02-08 David Malcolm <dmalcolm@redhat.com>
219
220 PR preprocessor/69664
221 * errors.c (cpp_diagnostic_with_line): Only call
222 rich_location::override_column if the column is non-zero.
223 * line-map.c (rich_location::override_column): Update columns
224 within m_ranges[0]. Add assertions to verify that doing so is
225 sane.
226
b5c1c988
JJ
2272016-02-05 Jakub Jelinek <jakub@redhat.com>
228
229 PR c++/69628
230 * charset.c (cpp_interpret_charconst): Clear *PCHARS_SEEN
231 and *UNSIGNEDP if bailing out early due to errors.
232
e2eb5056
JJ
2332016-01-28 Jakub Jelinek <jakub@redhat.com>
234
4bda5946
JJ
235 PR pch/68176
236 * files.c (_cpp_find_file): Set file->implicit_preinclude even if
237 included from file->implicit_preinclude header.
238
e2eb5056
JJ
239 * directives.c (destringize_and_run): Adjust prototype.
240
0afff540
DM
2412016-01-27 David Malcolm <dmalcolm@redhat.com>
242
243 PR preprocessor/69126
244 * directives.c (destringize_and_run): Add expansion_loc param; use
245 it when handling unexpanded pragmas to fixup the locations of the
246 synthesized tokens.
247 (_cpp_do__Pragma): Add expansion_loc param and use it when calling
248 destringize_and_run.
249 * internal.h (_cpp_do__Pragma): Add expansion_loc param.
250 * macro.c (builtin_macro): Pass expansion location of _Pragma to
251 _cpp_do__Pragma.
252
c7df95d8
DM
2532016-01-14 David Malcolm <dmalcolm@redhat.com>
254
255 PR preprocessor/69177
256 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): New
257 constant.
258 (LINE_MAP_MAX_LOCATION_WITH_COLS): Add note about unit tests
259 to comment.
260 (can_be_stored_compactly_p): Reduce threshold from
261 LINE_MAP_MAX_LOCATION_WITH_COLS to
262 LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES.
263 (get_combined_adhoc_loc): Likewise.
264 (get_range_from_loc): Likewise.
265 (linemap_line_start): Ensure that a new ordinary map is created
266 when transitioning from range-packing being enabled to disabled,
267 at the LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES threshold. Set
268 range_bits to 0 for new ordinary maps when beyond this limit.
269 Prevent the "increase the column bits of a freshly created map"
270 optimization if the range bits has reduced.
271
53290e07
JJ
2722016-01-08 Jakub Jelinek <jakub@redhat.com>
273
274 PR c++/69145
275 * files.c (cpp_included_before): If IS_ADHOC_LOC (location), lookup
276 real location from the line_table.
277
818ab71a
JJ
2782016-01-04 Jakub Jelinek <jakub@redhat.com>
279
280 Update copyright years.
281
329590d7
DM
2822015-12-22 David Malcolm <dmalcolm@redhat.com>
283
284 * line-map.c (get_combined_adhoc_loc): Remove condition
285 on locus < RESERVED_LOCATION_COUNT when considering
286 whether a caret == start == finish location can be
287 simply stored as the caret location.
288
f79520bb
DM
2892015-12-07 David Malcolm <dmalcolm@redhat.com>
290
291 * include/line-map.h (rich_location::set_range): Add line_maps *
292 param; convert param from source_range to source_location. Drop
293 "overwrite_loc_p" param.
294 * line-map.c (rich_location::set_range): Likewise, acting as if
295 "overwrite_loc_p" were true, and getting range from the location.
296
a87a86e1
DM
2972015-11-20 David Malcolm <dmalcolm@redhat.com>
298
299 PR 62314
300 * include/line-map.h (source_range::intersects_line_p): New
301 method.
302 (rich_location::~rich_location): New.
303 (rich_location::add_fixit_insert): New method.
304 (rich_location::add_fixit_remove): New method.
305 (rich_location::add_fixit_replace): New method.
306 (rich_location::get_num_fixit_hints): New accessor.
307 (rich_location::get_fixit_hint): New accessor.
308 (rich_location::MAX_FIXIT_HINTS): New constant.
309 (rich_location::m_num_fixit_hints): New field.
310 (rich_location::m_fixit_hints): New field.
311 (class fixit_hint): New class.
312 (class fixit_insert): New class.
313 (class fixit_remove): New class.
314 (class fixit_replace): New class.
315 * line-map.c (source_range::intersects_line_p): New method.
316 (rich_location::rich_location): Add initialization of
317 m_num_fixit_hints to both ctors.
318 (rich_location::~rich_location): New.
319 (rich_location::add_fixit_insert): New method.
320 (rich_location::add_fixit_remove): New method.
321 (rich_location::add_fixit_replace): New method.
322 (fixit_insert::fixit_insert): New.
323 (fixit_insert::~fixit_insert): New.
324 (fixit_insert::affects_line_p): New.
325 (fixit_remove::fixit_remove): New.
326 (fixit_remove::affects_line_p): New.
327 (fixit_replace::fixit_replace): New.
328 (fixit_replace::~fixit_replace): New.
329 (fixit_replace::affects_line_p): New.
330
46ce03de
JJ
3312015-11-19 Jakub Jelinek <jakub@redhat.com>
332
333 PR preprocessor/60736
334 * include/cpplib.h (cpp_errno_filename): New prototype.
335 * errors.c (cpp_errno): Don't handle msgid "" specially, use
336 _(msgid) instead of msgid as argument to cpp_error.
337 (cpp_errno_filename): New function.
338 * files.c (read_file_guts): Use cpp_errno_filename instead of
339 cpp_errno.
340 (open_file_failed): Likewise. Use file->name if file->path is NULL
341 in diagnostics.
342
ebedc9a3
DM
3432015-11-13 David Malcolm <dmalcolm@redhat.com>
344
345 * errors.c (cpp_diagnostic): Pass pfile->line_table to
346 rich_location ctor.
347 (cpp_diagnostic_with_line): Likewise.
348 * include/cpplib.h (struct cpp_token): Update comment for src_loc
349 to indicate that the range of the token is "baked into" the
350 source_location.
351 * include/line-map.h (source_location): Update the descriptive
352 comment to reflect the packing scheme for short ranges, adding
353 worked examples of location encoding.
354 (struct line_map_ordinary): Drop field "column_bits" in favor
355 of field "m_column_and_range_bits"; add field "m_range_bits".
356 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
357 (location_adhoc_data): Add source_range field.
358 (struct line_maps): Add fields "default_range_bits",
359 "num_optimized_ranges" and "num_unoptimized_ranges".
360 (get_combined_adhoc_loc): Add source_range param.
361 (get_range_from_loc): New declaration.
362 (pure_location_p): New prototype.
363 (COMBINE_LOCATION_DATA): Add source_range param.
364 (SOURCE_LINE): Update for renaming of column_bits.
365 (SOURCE_COLUMN): Likewise. Shift the column right by the map's
366 range_bits.
367 (LAST_SOURCE_LINE_LOCATION): Update for renaming of column_bits.
368 (linemap_position_for_line_and_column): Add line_maps * params.
369 (rich_location::rich_location): Likewise.
370 * lex.c (_cpp_lex_direct): Capture the range of the token, baking
371 it into token->src_loc via a call to COMBINE_LOCATION_DATA.
372 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): Reduce from 1U << 17 to
373 1U << 12.
374 (location_adhoc_data_hash): Add the src_range into
375 the hash value.
376 (location_adhoc_data_eq): Require equality of the src_range
377 values.
378 (can_be_stored_compactly_p): New function.
379 (get_combined_adhoc_loc): Add src_range param, and store it,
380 via a bit-packing scheme for short ranges, otherwise within the
381 lookaside table. Remove the requirement that data is non-NULL.
382 (get_range_from_adhoc_loc): New function.
383 (get_range_from_loc): New function.
384 (pure_location_p): New function.
385 (linemap_add): Ensure that start_location has zero for the
386 range_bits, unless we're past LINE_MAP_MAX_LOCATION_WITH_COLS.
387 Initialize range_bits to zero. Assert that the start_location
388 is "pure".
389 (linemap_line_start): Assert that the
390 column_and_range_bits >= range_bits.
391 Update determinination of whether we need to start a new map
392 using the effective column bits, without the range bits.
393 Use the set's default_range_bits in new maps, apart from
394 those with column_bits == 0, which should also have 0 range_bits.
395 Increase the column bits for new maps by the range bits.
396 When adding lines to an existing map, use set->highest_line
397 directly rather than offsetting highest by SOURCE_COLUMN.
398 Add assertions to sanity-check the return value.
399 (linemap_position_for_column): Offset to_column by range_bits.
400 Update set->highest_location if necessary.
401 (linemap_position_for_line_and_column): Add line_maps * param.
402 Update the calculation to offset the column by range_bits, and
403 conditionalize it on being <= LINE_MAP_MAX_LOCATION_WITH_COLS.
404 Bound it by LINEMAPS_MACRO_LOWEST_LOCATION. Update
405 set->highest_location if necessary.
406 (linemap_position_for_loc_and_offset): Handle ad-hoc locations;
407 pass "set" to linemap_position_for_line_and_column.
408 (linemap_macro_map_loc_unwind_toward_spelling): Add line_maps
409 param. Handle ad-hoc locations.
410 (linemap_location_in_system_header_p): Pass on "set" to call to
411 linemap_macro_map_loc_unwind_toward_spelling.
412 (linemap_macro_loc_to_spelling_point): Retain ad-hoc locations.
413 Pass on "set" to call to
414 linemap_macro_map_loc_unwind_toward_spelling.
415 (linemap_resolve_location): Retain ad-hoc locations. Pass on
416 "set" to call to linemap_macro_map_loc_unwind_toward_spelling.
417 (linemap_unwind_toward_expansion): Pass on "set" to call to
418 linemap_macro_map_loc_unwind_toward_spelling.
419 (linemap_expand_location): Extract the data pointer before
420 extracting the location.
421 (rich_location::rich_location): Add line_maps param; use it to
422 extract the range from the source_location.
423 * location-example.txt: Regenerate, showing new representation.
424
8a645150
DM
4252015-11-06 David Malcolm <dmalcolm@redhat.com>
426
427 * errors.c (cpp_diagnostic): Update for change in signature
428 of "error" callback.
429 (cpp_diagnostic_with_line): Likewise, calling override_column
430 on the rich_location.
431 * include/cpplib.h (struct cpp_callbacks): Within "error"
432 callback, convert param from source_location to rich_location *,
433 and drop column_override param.
434 * include/line-map.h (struct source_range): New struct.
435 (struct location_range): New struct.
436 (class rich_location): New class.
437 (linemap_client_expand_location_to_spelling_point): New declaration.
438 * line-map.c (rich_location::rich_location): New ctors.
439 (rich_location::lazily_expand_location): New method.
440 (rich_location::override_column): New method.
441 (rich_location::add_range): New methods.
442 (rich_location::set_range): New method.
443
ee015909
DM
4442015-11-06 David Malcolm <dmalcolm@redhat.com>
445
446 * include/line-map.h (struct linemap_stats): Add fields
447 "adhoc_table_size" and "adhoc_table_entries_used".
448 * line-map.c (linemap_get_statistics): Populate above fields.
449
a6c764d0
MM
4502015-11-04 Mikhail Maltsev <maltsevm@gmail.com>
451
452 * config.in: Regenerate.
453 * configure: Regenerate.
454 * configure.ac: Remove ENABLE_CHECKING.
455
49445904
UB
4562015-11-03 Uros Bizjak <ubizjak@gmail.com>
457
458 * lex.c (search_line_sse42): Correctly advance the pointer to an
459 aligned address.
460
525ce910
DM
4612015-11-02 David Malcolm <dmalcolm@redhat.com>
462
463 * include/line-map.h (source_location): In the table in the
464 descriptive comment, show UNKNOWN_LOCATION, BUILTINS_LOCATION,
465 LINE_MAP_MAX_LOCATION_WITH_COLS, LINE_MAP_MAX_SOURCE_LOCATION.
466 Add notes about ad-hoc values.
467
7ec491c0
MM
4682015-10-21 Mikhail Maltsev <maltsevm@gmail.com>
469
22d66382
MM
470 * include/line-map.h: Use CHECKING_P instead of ENABLE_CHECKING.
471 * init.c: Likewise.
472 * macro.c (struct macro_arg_token_iter, set_arg_token,
473 macro_arg_token_iter_init, macro_arg_token_iter_forward,
474 macro_arg_token_iter_get_token, macro_arg_token_iter_get_location,
475 alloc_expanded_arg_mem, _cpp_backup_tokens): Likewise.
476
7ec491c0
MM
477 * config.in: Regenerate.
478 * configure: Regenerate.
479 * configure.ac (CHECKING_P): Define.
480 * system.h (fancy_abort): Declare.
481 (abort): Define.
482 (gcc_assert): Define. Use CHECKING_P.
483
179b8d05
MM
4842015-10-13 Mikhail Maltsev <maltsevm@gmail.com>
485
486 * system.h (CHECKING_P, gcc_checking_assert): Define.
487
87b470b3
MLI
4882015-09-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
489
490 PR c/66415
491 * line-map.c (linemap_position_for_loc_and_offset): Handle the
492 case of long lines encoded in multiple maps.
493
85bc8baa
MP
4942015-09-07 Marek Polacek <polacek@redhat.com>
495
496 * system.h (INTTYPE_MINIMUM): Rewrite to avoid shift warning.
497
bf5372e7
YS
4982015-08-06 Yaakov Selkowitz <yselkowi@redhat.com>
499
500 * configure: Regenerate.
501
d17f7d59
TS
5022015-07-08 Thomas Schwinge <thomas@codesourcery.com>
503
504 * include/line-map.h (RESERVED_LOCATION_COUNT): Change type to
505 source_location.
506
fbb22910
PC
5072015-07-02 Paolo Carlini <paolo.carlini@oracle.com>
508
d885793d 509 PR preprocessor/53690
fbb22910
PC
510 * charset.c (_cpp_valid_ucn): Add cppchar_t * parameter and change
511 return type to bool. Fix encoding of \u0000 and \U00000000 in C++.
512 (convert_ucn): Adjust call.
513 * lex.c (forms_identifier_p): Likewise.
514 * internal.h (_cpp_valid_ucn): Adjust declaration.
515
fe95b036
ESR
5162015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
517
518 Implement N4197 - Adding u8 character literals
519 * include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens;
520 (struct cpp_options): Add utf8_char_literals.
521 * init.c (struct lang_flags): Add utf8_char_literals;
522 (struct lang_flags lang_defaults): Add column for utf8_char_literals.
fbb22910 523 * macro.c (stringify_arg()): Treat CPP_UTF8CHAR token;
fe95b036
ESR
524 * expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()):
525 Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens;
526 (cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token;
527 (eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token.
528 * lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens.
529 * charset.c (converter_for_type(), cpp_interpret_charconst()):
530 Treat CPP_UTF8CHAR token.
531
dc6bcf52
UB
5322015-06-30 Uros Bizjak <ubizjak@gmail.com>
533
534 * lex.c (search_line_sse42) [__GCC_ASM_FLAG_OUTPUTS__]: New main
535 loop using asm flag outputs.
536
a1661b90
MP
5372015-06-08 Marek Polacek <polacek@redhat.com>
538
539 PR c/66415
540 * line-map.c (linemap_position_for_loc_and_offset): Remove
541 linemap_assert_fails; reverse conditions.
542
815facd3
MLI
5432015-05-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
544
545 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER
546 LINE_MAP_MAX_LOCATION_WITH_COLS,LINE_MAP_MAX_SOURCE_LOCATION):
547 New constants.
548 (linemap_line_start): Use them.
549 (linemap_position_for_column): Use them.
550
c819ed29
DM
5512015-05-20 David Malcolm <dmalcolm@redhat.com>
552
553 * include/line-map.h (MAP_START_LOCATION): Eliminate the non-const
554 variant, and tweak comment for the const variant.
555 (ORDINARY_MAP_STARTING_LINE_NUMBER): Drop the non-const variant.
556 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
557 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
558 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
559 (ORDINARY_MAP_FILE_NAME): Drop the non-const variant.
560 (MACRO_MAP_MACRO): Likewise.
561 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
562 (MACRO_MAP_LOCATIONS): Likewise.
563 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
564 * line-map.c (linemap_add): Replace writes through macros with
565 direct field accesses.
566 (linemap_enter_macro): Likewise.
567 (linemap_line_start): Likewise.
568
0e50b624
DM
5692015-05-19 David Malcolm <dmalcolm@redhat.com>
570
571 * directives.c (do_line): Strengthen local "map" from
572 const line_map * to const line_map_ordinary *.
573 (do_linemarker): Likewise.
574 (_cpp_do_file_change): Assert that we're not dealing with
575 a macro map. Introduce local "ord_map" via a call to
576 linemap_check_ordinary, guarded within the check for
577 non-NULL. Use it for typesafety.
578 * files.c (cpp_make_system_header): Strengthen local "map" from
579 const line_map * to const line_map_ordinary *.
580 * include/cpplib.h (struct cpp_callbacks): Likewise for second
581 parameter of "file_change" callback.
582 * include/line-map.h (struct line_map): Convert from a struct
583 containing a union to a base class.
584 (struct line_map_ordinary): Convert to a subclass of line_map.
585 (struct line_map_macro): Likewise.
586 (linemap_check_ordinary): Strengthen return type from line_map *
587 to line_map_ordinary *, and add a const-variant.
588 (linemap_check_macro): New pair of functions.
589 (ORDINARY_MAP_STARTING_LINE_NUMBER): Strengthen param from
590 const line_map * to const line_map_ordinary *, eliminating call
591 to linemap_check_ordinary. Likewise for the non-const variant.
592 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
593 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
594 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Likewise.
595 (ORDINARY_MAP_FILE_NAME): Likewise.
596 (MACRO_MAP_MACRO): Strengthen param from const line_map * to
597 const line_map_macro *. Likewise for the non-const variant.
598 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
599 (MACRO_MAP_LOCATIONS): Likewise.
600 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
601 (struct maps_info): Replace with...
602 (struct maps_info_ordinary):...this and...
603 (struct maps_info_macro): ...this.
604 (struct line_maps): Convert fields "info_ordinary" and
605 "info_macro" to the above new structs.
606 (LINEMAPS_MAP_INFO): Delete both functions.
607 (LINEMAPS_MAPS): Likewise.
608 (LINEMAPS_ALLOCATED): Rewrite both variants to avoid using
609 LINEMAPS_MAP_INFO.
610 (LINEMAPS_USED): Likewise.
611 (LINEMAPS_CACHE): Likewise.
612 (LINEMAPS_MAP_AT): Likewise.
613 (LINEMAPS_ORDINARY_MAPS): Strengthen return type from line_map *
614 to line_map_ordinary *.
615 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
616 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
617 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
618 (LINEMAPS_MACRO_MAPS): Strengthen return type from line_map * to
619 line_map_macro *.
620 (LINEMAPS_MACRO_MAP_AT): Likewise.
621 (LINEMAPS_LAST_MACRO_MAP): Likewise.
622 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
623 (linemap_map_get_macro_name): Strengthen param from
624 const line_map * to const line_map_macro *.
625 (SOURCE_LINE): Strengthen first param from const line_map * to
626 const line_map_ordinary *, removing call to
627 linemap_check_ordinary.
628 (SOURCE_COLUMN): Likewise.
629 (LAST_SOURCE_LINE_LOCATION): Likewise.
630 (LAST_SOURCE_LINE): Strengthen first param from const line_map *
631 to const line_map_ordinary *.
632 (LAST_SOURCE_COLUMN): Likewise.
633 (INCLUDED_FROM): Strengthen return type from line_map * to
634 line_map_ordinary *., and second param from const line_map *
635 to const line_map_ordinary *, removing call to
636 linemap_check_ordinary.
637 (MAIN_FILE_P): Strengthen param from const line_map * to
638 const line_map_ordinary *, removing call to
639 linemap_check_ordinary.
640 (linemap_position_for_line_and_column): Strengthen param from
641 const line_map * to const line_map_ordinary *.
642 (LINEMAP_FILE): Strengthen param from const line_map * to
643 const line_map_ordinary *, removing call to
644 linemap_check_ordinary.
645 (LINEMAP_LINE): Likewise.
646 (LINEMAP_SYSP): Likewise.
647 (linemap_resolve_location): Strengthen final param from
648 const line_map ** to const line_map_ordinary **.
649 * internal.h (CPP_INCREMENT_LINE): Likewise for local "map".
650 (linemap_enter_macro): Strengthen return type from
651 const line_map * to const line_map_macro *.
652 (linemap_add_macro_token): Likewise for first param.
653 * line-map.c (linemap_check_files_exited): Strengthen local "map"
654 from const line_map * to const line_map_ordinary *.
655 (new_linemap): Introduce local "map_size" and use it when
656 calculating how large the buffer should be. Rewrite based
657 on change of info_macro and info_ordinary into distinct types.
658 (linemap_add): Strengthen locals "map" and "from" from line_map *
659 to line_map_ordinary *.
660 (linemap_enter_macro): Strengthen return type from
661 const line_map * to const line_map_macro *, and local "map" from
662 line_map * to line_map_macro *.
663 (linemap_add_macro_token): Strengthen param "map" from
664 const line_map * to const line_map_macro *.
665 (linemap_line_start): Strengthen local "map" from line_map * to
666 line_map_ordinary *.
667 (linemap_position_for_column): Likewise.
668 (linemap_position_for_line_and_column): Strengthen first param
669 from const line_map * to const line_map_ordinary *.
670 (linemap_position_for_loc_and_offset): Strengthen local "map" from
671 const line_map * to const line_map_ordinary *.
672 (linemap_ordinary_map_lookup): Likewise for return type and locals
673 "cached" and "result".
674 (linemap_macro_map_lookup): Strengthen return type and locals
675 "cached" and "result" from const line_map * to
676 const line_map_macro *.
677 (linemap_macro_map_loc_to_exp_point): Likewise for param "map".
678 (linemap_macro_map_loc_to_def_point): Likewise.
679 (linemap_macro_map_loc_unwind_toward_spelling): Likewise.
680 (linemap_get_expansion_line): Strengthen local "map" from
681 const line_map * to const line_map_ordinary *.
682 (linemap_get_expansion_filename): Likewise.
683 (linemap_map_get_macro_name): Strengthen param from
684 const line_map * to const line_map_macro *.
685 (linemap_location_in_system_header_p): Add call to
686 linemap_check_ordinary in region guarded by
687 !linemap_macro_expansion_map_p. Introduce local "macro_map" via
688 linemap_check_macro in other region, using it in place of "map"
689 for typesafety.
690 (first_map_in_common_1): Add calls to linemap_check_macro.
691 (trace_include): Strengthen param "map" from const line_map * to
692 const line_map_ordinary *.
693 (linemap_macro_loc_to_spelling_point): Strengthen final param from
694 const line_map ** to const line_map_ordinary **. Replace a
695 C-style cast with a const_cast, and add calls to
696 linemap_check_macro and linemap_check_ordinary.
697 (linemap_macro_loc_to_def_point): Likewise.
698 (linemap_macro_loc_to_exp_point): Likewise.
699 (linemap_resolve_location): Strengthen final param from
700 const line_map ** to const line_map_ordinary **.
701 (linemap_unwind_toward_expansion): Introduce local "macro_map" via
702 a checked cast and use it in place of *map.
703 (linemap_unwind_to_first_non_reserved_loc): Strengthen local
704 "map1" from const line_map * to const line_map_ordinary *.
705 (linemap_expand_location): Introduce local "ord_map" via a checked
706 cast and use it in place of map.
707 (linemap_dump): Make local "map" const. Strengthen local
708 "includer_map" from line_map * to const line_map_ordinary *.
709 Introduce locals "ord_map" and "macro_map" via checked casts and
710 use them in place of "map" for typesafety.
711 (linemap_dump_location): Strengthen local "map" from
712 const line_map * to const line_map_ordinary *.
713 (linemap_get_file_highest_location): Update for elimination of
714 union.
715 (linemap_get_statistics): Strengthen local "cur_map" from
716 line_map * to const line_map_macro *. Update uses of sizeof to
717 use the appropriate line_map subclasses.
718 * macro.c (_cpp_warn_if_unused_macro): Add call to
719 linemap_check_ordinary.
720 (builtin_macro): Strengthen local "map" from const line_map * to
721 const line_map_macro *.
722 (enter_macro_context): Likewise.
723 (replace_args): Likewise.
724 (tokens_buff_put_token_to): Likewise for param "map".
725 (tokens_buff_add_token): Likewise.
726
ba4ad400
DM
7272015-05-13 David Malcolm <dmalcolm@redhat.com>
728
729 * include/line-map.h (source_location): Add a reference to
730 location-example.txt to the descriptive comment.
731 * location-example.txt: New file.
732
0501dbd9
DM
7332015-05-13 David Malcolm <dmalcolm@redhat.com>
734
735 * include/line-map.h (MAX_SOURCE_LOCATION): Convert from a macro
736 to a const source_location.
737 (RESERVED_LOCATION_COUNT): Likewise.
738 (linemap_check_ordinary): Convert from a macro to a pair of inline
739 functions, for const/non-const arguments.
740 (MAP_START_LOCATION): Likewise.
741 (ORDINARY_MAP_STARTING_LINE_NUMBER): Likewise.
742 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
743 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
744 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Convert from a macro to a
745 pair of inline functions, for const/non-const arguments, where the
746 latter is named...
747 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): New function.
748 (ORDINARY_MAP_FILE_NAME): Convert from a macro to a pair of inline
749 functions, for const/non-const arguments.
750 (MACRO_MAP_MACRO): Likewise.
751 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
752 (MACRO_MAP_LOCATIONS): Likewise.
753 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
754 (LINEMAPS_MAP_INFO): Likewise.
755 (LINEMAPS_MAPS): Likewise.
756 (LINEMAPS_ALLOCATED): Likewise.
757 (LINEMAPS_USED): Likewise.
758 (LINEMAPS_CACHE): Likewise.
759 (LINEMAPS_ORDINARY_CACHE): Likewise.
760 (LINEMAPS_MACRO_CACHE): Likewise.
761 (LINEMAPS_MAP_AT): Convert from a macro to an inline function.
762 (LINEMAPS_LAST_MAP): Likewise.
763 (LINEMAPS_LAST_ALLOCATED_MAP): Likewise.
764 (LINEMAPS_ORDINARY_MAPS): Likewise.
765 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
766 (LINEMAPS_ORDINARY_ALLOCATED): Likewise.
767 (LINEMAPS_ORDINARY_USED): Likewise.
768 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
769 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
770 (LINEMAPS_MACRO_MAPS): Likewise.
771 (LINEMAPS_MACRO_MAP_AT): Likewise.
772 (LINEMAPS_MACRO_ALLOCATED): Likewise.
773 (LINEMAPS_MACRO_USED): Likewise.
774 (LINEMAPS_MACRO_LOWEST_LOCATION): Likewise.
775 (LINEMAPS_LAST_MACRO_MAP): Likewise.
776 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
777 (IS_ADHOC_LOC): Likewise.
778 (COMBINE_LOCATION_DATA): Likewise.
779 (SOURCE_LINE): Likewise.
780 (SOURCE_COLUMN): Likewise.
781 (LAST_SOURCE_LINE_LOCATION): Likewise.
782 (LAST_SOURCE_LINE): Likewise.
783 (LAST_SOURCE_COLUMN): Likewise.
784 (LAST_SOURCE_LINE_LOCATION)
785 (INCLUDED_FROM): Likewise.
786 (MAIN_FILE_P): Likewise.
787 (LINEMAP_FILE): Likewise.
788 (LINEMAP_LINE): Likewise.
789 (LINEMAP_SYSP): Likewise.
790 (linemap_location_before_p): Likewise.
791 * line-map.c (linemap_check_files_exited): Make local "map" const.
792 (linemap_add): Use SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS.
793 (linemap_line_start): Likewise.
794
eb70f327
MH
7952015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
796
797 * aclocal.m4: Regenerated with automake-1.11.6.
798
60c12095
DM
7992015-05-13 David Malcolm <dmalcolm@redhat.com>
800
801 * include/line-map.h (linemap_assert): Move up within the file to
802 before all of the map accessor macros.
803 (linemap_assert_fails): Likewise.
804 (linemap_check_ordinary): Likewise.
805 (linemap_macro_expansion_map_p): Likewise.
806
c3388e62
DM
8072015-05-12 David Malcolm <dmalcolm@redhat.com>
808
809 * directives.c (do_line): Set seen_line_directive on line_table.
810 (do_linemarker): Likewise.
811 * include/line-map.h (struct line_maps): Add new field
812 "seen_line_directive".
813
fe191308
JM
8142015-05-08 Jason Merrill <jason@redhat.com>
815
816 * include/cpplib.h: Add CPP_W_CXX11_COMPAT.
817 (struct cpp_options): Add cpp_warn_cxx11_compat.
818 * init.c (cpp_create_reader): Initialize it.
819 * lex.c (lex_string): Add -Wc++11-compat warning.
820
21c0a521
DM
8212015-05-05 David Malcolm <dmalcolm@redhat.com>
822
823 * pch.c (cpp_valid_state): Fix indentation so that it reflects the
824 block structure.
825
c87b25e6
DM
8262015-05-05 David Malcolm <dmalcolm@redhat.com>
827
828 * include/line-map.h: Fix comment at the top of the file.
829 (source_location): Rewrite and expand the comment for this
830 typedef, adding an ascii-art table to clarify how source_location
831 values are allocated.
832 * line-map.c: Fix comment at the top of the file.
833
ca708025
RB
8342015-04-09 Richard Biener <rguenther@suse.de>
835
836 PR pch/65550
837 * files.c (pch_open_file): Allow main and pre-included files
838 when trying to open a PCH.
839
e4b33ee5
JJ
8402015-04-06 Jakub Jelinek <jakub@redhat.com>
841
842 PR preprocessor/61977
843 * lex.c (cpp_peek_token): If peektok is CPP_EOF, back it up
844 with all tokens peeked by the current function.
845
b8cd77f4
JJ
8462015-04-02 Jakub Jelinek <jakub@redhat.com>
847
848 PR preprocessor/61977
849 * lex.c (cpp_peek_token): Temporarily clear pfile->cb.line_change.
850
fb136e35
JJ
8512015-03-23 Jakub Jelinek <jakub@redhat.com>
852
853 PR preprocessor/65238
854 * internal.h (_cpp_scan_out_logical_line): Add third argument.
855 * directives.c (prepare_directive_trad): Pass false to it.
856 * traditional.c (_cpp_read_logical_line_trad,
857 _cpp_create_trad_definition): Likewise.
858 (struct fun_macro): Add paramc field.
859 (fun_like_macro): New function.
860 (maybe_start_funlike): Handle NODE_BUILTIN macros. Initialize
861 macro->paramc field.
862 (save_argument): Use macro->paramc instead of
863 macro->node->value.macro->paramc.
864 (push_replacement_text): Formatting fix.
865 (recursive_macro): Use fun_like_macro helper.
866 (_cpp_scan_out_logical_line): Likewise. Add BUILTIN_MACRO_ARG
867 argument. Initialize fmacro.paramc field. Handle builtin
868 function-like macros.
869
a5858a3d
ESR
8702015-03-16 Edward Smith-Rowland <3dw4rd@verizon.net>
871
872 PR c++/64626
873 * lex.c (lex_number): If a number ends with digit-seps (') skip back
874 and let lex_string take them.
875
44d95244
MT
8762015-03-02 Markus Trippelsdorf <markus@trippelsdorf.de>
877
878 PR target/65261
879 * lex.c (search_line_fast): Silence ubsan errors.
880
f8abc9ba
DS
8812015-02-03 <dodji@redhat.com>
882
883 PR preprocessor/64803
884 * internal.h (cpp_reader::top_most_macro_node): New data member.
885 * macro.c (enter_macro_context): Pass the location of the end of
886 the top-most invocation of the function-like macro, or the
887 location of the expansion point of the top-most object-like macro.
888 (cpp_get_token_1): Store the top-most macro node in the new
889 pfile->top_most_macro_node data member.
890 (_cpp_pop_context): Clear the new cpp_reader::top_most_macro_node
891 data member.
892
95d0610c
SN
8932015-01-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
894
895 * lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON.
896
10ef8f28
MP
8972015-01-23 Marek Polacek <polacek@redhat.com>
898
899 DR#412
900 PR preprocessor/60570
901 * directives.c (do_elif): Don't evaluate #elif conditionals
902 when they don't need to be.
903
6e6cb471
JJ
9042015-01-16 Jakub Jelinek <jakub@redhat.com>
905
906 * expr.c (cpp_classify_number): Add N_() around ?: string
907 literals used in cpp_error_with_line call as format string.
908
5624e564
JJ
9092015-01-05 Jakub Jelinek <jakub@redhat.com>
910
911 Update copyright years.
912
1f8d3e84
JJ
9132014-12-19 Jakub Jelinek <jakub@redhat.com>
914
915 PR preprocessor/63831
916 * directives.c (lex_macro_node): Remove __has_attribute__ handling.
917 * internal.h (struct spec_node): Remove n__has_attribute__ field.
918 (struct lexer_state): Remove in__has_attribute__ field.
919 * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_ATTRIBUTE.
920 * identifiers.c (_cpp_init_hashtable): Remove __has_attribute__
921 handling.
922 * init.c (builtin_array): Add __has_attribute and __has_cpp_attribute.
923 (cpp_init_special_builtins): Don't initialize __has_attribute
924 or __has_cpp_attribute if CLK_ASM or pfile->cb.has_attribute is NULL.
925 * traditional.c (enum ls): Remove ls_has_attribute,
926 ls_has_attribute_close.
927 (_cpp_scan_out_logical_line): Remove __has_attribute__ handling.
928 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_ATTRIBUTE.
929 * pch.c (cpp_read_state): Remove __has_attribute__ handling.
930 * expr.c (eval_token): Likewise.
931 (parse_has_attribute): Removed.
932
01ca36af
UB
9332014-12-11 Uros Bizjak <ubizjak@gmail.com>
934
935 * directives.c (cpp_define_formatted): Use xvasprintf.
936
b93c0722
MLI
9372014-12-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
938
939 * line-map.c (linemap_position_for_loc_and_offset): Add new
940 linemap_assert_fails.
941
73bd8329
MLI
9422014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
943
944 * include/line-map.h (linemap_assert_fails): Declare.
945 * line-map.c (linemap_position_for_loc_and_offset): Use it.
946
9c320ab1
MLI
9472014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
948
49445904
UB
949 * line-map.c (linemap_add): Fix typo.
950 (linemap_line_start): Fix whitespace.
9c320ab1 951
81fee4a7
JM
9522014-11-29 John Schmerge <jbschmerge@gmail.com>
953
954 PR preprocessor/41698
955 * charset.c (one_utf8_to_utf16): Do not produce surrogate pairs
956 for 0xffff.
957
43ba1c6c
JJ
9582014-11-25 Jakub Jelinek <jakub@redhat.com>
959
960 PR preprocessor/60436
961 * line-map.c (linemap_line_start): If highest is above 0x60000000
962 and we are still tracking columns or highest is above 0x70000000,
963 force add_map.
964
8a23b100
UB
9652014-11-20 Uros Bizjak <ubizjak@gmail.com>
966
967 PR target/63966
1b6b13f3
UB
968 * lex.c [__i386__ || __x86_64__]: Compile special SSE functions
969 only for (__GNUC__ >= 5 || !defined(__PIC__)).
8a23b100 970
d82f1e13
MLI
9712014-11-13 Manuel López-Ibáñez <manu@gcc.gnu.org>
972
973 * include/line-map.h: Include EXPR, so that unused variable warnings
974 do not occur.
975
3aa34c1d
MLI
9762014-11-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
977
978 PR fortran/44054
979 * include/line-map.h (linemap_position_for_loc_and_offset):
980 Declare.
981 * line-map.c (linemap_position_for_loc_and_offset): New.
982
35485da9
DM
9832014-11-11 David Malcolm <dmalcolm@redhat.com>
984
985 * ChangeLog.jit: New.
986
42fd12b1
ESR
9872014-11-10 Edward Smith-Rowland <3dw4rd@verizon.net>
988
989 * include/cpplib.h (cpp_callbacks): Add has_attribute.
990 * internal.h (lexer_state): Add in__has_attribute__.
991 * directives.c (lex_macro_node): Prevent use of __has_attribute__
992 as a macro.
993 * expr.c (parse_has_attribute): New function; (eval_token): Look for
994 __has_attribute__ and route to parse_has_attribute.
995 * identifiers.c (_cpp_init_hashtable): Initialize n__has_attribute__.
996 * pch.c (cpp_read_state): Initialize n__has_attribute__.
997 * traditional.c (enum ls): Add ls_has_attribute, ls_has_attribute_close;
998 (_cpp_scan_out_logical_line): Attend to __has_attribute__.
999
be5ffc59
JM
10002014-11-06 Joseph Myers <joseph@codesourcery.com>
1001
1002 * include/cpp-id-data.h (struct cpp_macro): Update comment
1003 regarding parameters.
1004 * include/cpplib.h (struct cpp_macro_arg, struct cpp_identifier):
1005 Add spelling fields.
1006 (struct cpp_token): Update comment on macro_arg.
1007 * internal.h (_cpp_save_parameter): Add extra argument.
1008 (_cpp_spell_ident_ucns): New declaration.
1009 * lex.c (lex_identifier): Add SPELLING argument. Set *SPELLING to
1010 original spelling of identifier.
1011 (_cpp_lex_direct): Update calls to lex_identifier.
1012 (_cpp_spell_ident_ucns): New function, factored out of
1013 cpp_spell_token.
1014 (cpp_spell_token): Adjust FORSTRING argument semantics to return
1015 original spelling of identifiers. Use _cpp_spell_ident_ucns in
1016 !FORSTRING case.
1017 (_cpp_equiv_tokens): Check spellings of identifiers and macro
1018 arguments are identical.
1019 * macro.c (macro_arg_saved_data): New structure.
1020 (paste_tokens): Use original spellings of identifiers from
1021 cpp_spell_token.
1022 (_cpp_save_parameter): Add argument SPELLING. Save both canonical
1023 node and its value.
1024 (parse_params): Update calls to _cpp_save_parameter.
1025 (lex_expansion_token): Save spelling of macro argument tokens.
1026 (_cpp_create_definition): Extract canonical node from saved data.
1027 (cpp_macro_definition): Use UCNs in spelling of macro name. Use
1028 original spellings of macro argument tokens and identifiers.
1029 * traditional.c (scan_parameters): Update call to
1030 _cpp_save_parameter.
1031
701cade1
JM
10322014-11-05 Joseph Myers <joseph@codesourcery.com>
1033
1034 PR preprocessor/9449
1035 * init.c (lang_defaults): Enable extended identifiers for C++ and
1036 C99-based standards.
1037
19a9ba64
AM
10382014-10-22 Alan Modra <amodra@gmail.com>
1039
1040 * symtab.c (ht_create): Use obstack_specify_allocation in place of
1041 _obstack_begin.
1042 * files.c (_cpp_init_files): Likewise.
1043 * init.c (cpp_create_reader): Likewise.
1044 * identifiers.c (_cpp_init_hashtable): Likewise.
1045
3aac0952
MLI
10462014-10-14 Manuel López-Ibáñez <manu@gcc.gnu.org>
1047
1048 * include/line-map.h (linemap_location_from_macro_expansion_p):
1049 const struct line_maps * argument.
1050 (linemap_position_for_line_and_column): const struct line_map *
1051 argument.
1052 * line-map.c (linemap_add_macro_token): Use correct argument name
1053 in comment.
1054 (linemap_position_for_line_and_column): const struct line_map *
1055 argument.
1056 (linemap_macro_map_loc_to_def_point): Fix comment. Make static.
1057 (linemap_location_from_macro_expansion_p): const struct line_maps *
1058 argument.
1059 (linemap_resolve_location): Fix argument names in comment.
1060
0ccaaab0
BS
10612014-10-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
1062
1063 * lex.c (search_line_fast): Add new version to be used for Power8
1064 and later targets when Altivec is enabled. Restrict the existing
1065 Altivec version to big-endian systems so that lvsr is not used on
1066 little endian, where it is deprecated. Remove LE-specific code
1067 from the now-BE-only version.
1068
dc257367
BE
10692014-10-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
1070 Jeff Law <law@redhat.com>
1071
1072 * charset.c (convert_no_conversion): Reallocate memory with 25%
1073 headroom.
1074
a15f7cb8
ESR
10752014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net>
1076
1077 Implement SD-6: SG10 Feature Test Recommendations
1078 * internal.h (lexer_state, spec_nodes): Add in__has_include__.
1079 * directives.c: Support __has_include__ builtin.
1080 * expr.c (parse_has_include): New function to parse __has_include__
1081 builtin; (eval_token()): Use it.
1082 * files.c (_cpp_has_header()): New funtion to look for header;
1083 (open_file_failed()): Not an error to not find a header file for
1084 __has_include__.
1085 * identifiers.c (_cpp_init_hashtable()): Add entry for __has_include__.
1086 * pch.c (cpp_read_state): Lookup __has_include__.
1087 * traditional.c (enum ls, _cpp_scan_out_logical_line()): Walk through
1088 __has_include__ statements.
1089
cc811a8a
BE
10902014-09-30 Bernd Edlinger <bernd.edlinger@hotmail.de>
1091
1092 PR preprocessor/58893
1093 * errors.c (cpp_diagnostic): Fix possible out of bounds access.
1094 * files.c (_cpp_stack_include): Initialize src_loc for IT_CMDLINE.
1095
083e891e
MP
10962014-09-24 Marek Polacek <polacek@redhat.com>
1097
1098 PR c/61405
1099 PR c/53874
1100 * include/cpplib.h (enum cpp_ttype): Define CPP_KEYWORD.
1101
d87fc699
JH
11022014-09-17 Jan Hubicka <hubicka@ucw.cz>
1103
1104 * charset.c (conversion): Rename to ...
1105 (cpp_conversion): ... this one; update.
1106 * files.c (file_hash_entry): Rename to ...
1107 (cpp_file_hash_entry): ... this one ; update.
1108
909eb89c
MP
11092014-09-17 Marek Polacek <polacek@redhat.com>
1110
1111 PR c/61854
1112 * init.c (struct lang_flags): Remove cplusplus_comments.
1113 (cpp_set_lang): Likewise.
1114 (post_options): Likewise.
1115 * lex.c (_cpp_lex_direct): Disallow C++ style comments in C90/C94.
1116
1ef33fd4
MLI
11172014-09-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
1118
1119 * include/cpplib.h (struct cpp_options): Declare warn_normalize as
1120 int instead of enum.
1121
2b71f4a4
MLI
11222014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
1123
1124 * macro.c (replace_args): Use cpp_pedwarning, cpp_warning and
1125 CPP_W flags.
1126 * include/cpplib.h: Add CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC.
1127 * init.c (cpp_create_reader): Do not init to -1 here.
1128 * expr.c (num_binary_op): Use cpp_pedwarning.
1129
81b5d104
MLI
11302014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
1131
1132 * directives.c (check_eol_1): New.
1133 (check_eol_endif_labels): New.
1134 (check_eol): Call check_eol_1.
1135 (do_else,do_endif): Call check_eol_endif_labels.
1136
b753b37b
MLI
11372014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
1138
1139 * macro.c (warn_of_redefinition): Suppress warnings for builtins
1140 that lack the NODE_WARN flag, unless Wbuiltin-macro-redefined.
1141 (_cpp_create_definition): Use Wbuiltin-macro-redefined for
1142 builtins that lack the NODE_WARN flag.
1143 * directives.c (do_undef): Likewise.
1144 * init.c (cpp_init_special_builtins): Do not change flags
1145 depending on Wbuiltin-macro-redefined.
1146
7c05e50c
ESR
11472014-08-28 Edward Smith-Rowland <3dw4rd@verizon.net>
1148
1149 PR cpp/23827 - standard C++ should not have hex float preprocessor
1150 tokens
1151 * libcpp/init.c (lang_flags): Change CXX98 flag for extended numbers
1152 from 1 to 0.
1153 * libcpp/expr.c (cpp_classify_number): Weite error message for improper
1154 use of hex floating literal.
1155
e4276ba5
ESR
11562014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
1157
1158 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z;
1159 Rename CLK_GNUCXX1Y, CLK_CXX1Y to CLK_GNUCXX14, CLK_CXX14;
1160 * init.c (struct lang_flags lang_defaults): Add column for trigraphs;
1161 Add rows for CLK_GNUCXX1Z, CLK_CXX1Z; (cpp_set_lang): Set trigraphs;
1162 (cpp_init_builtins): Set __cplusplus to 201402L for C++14;
1163 Set __cplusplus to 201500L for C++17.
1164 * expr.c (cpp_classify_number): Change C++1y to C++14 in binary
1165 constants error message.
1166
dd3ff077
MP
11672014-08-20 Marek Polacek <polacek@redhat.com>
1168
1169 * include/cpplib.h (cpp_options): Use signed char.
1170 * lex.c (_cpp_lex_direct): Don't warn in C++ mode.
1171
3f4f5c9a
MP
11722014-08-19 Marek Polacek <polacek@redhat.com>
1173
1174 * lex.c (_cpp_lex_direct): Fix a typo.
1175
177cce46
MP
11762014-08-19 Marek Polacek <polacek@redhat.com>
1177
1178 * charset.c (_cpp_valid_ucn): Warn only if -Wc90-c99-compat.
1179 * lex.c (_cpp_lex_direct): Likewise.
1180 * macro.c (replace_args): Likewise.
1181 (parse_params): Likewise.
1182 * include/cpplib.h (cpp_options): Change cpp_warn_c90_c99_compat
1183 to char.
1184
f3bede71
MP
11852014-08-10 Marek Polacek <polacek@redhat.com>
1186
1187 PR c/51849
1188 * lex.c (_cpp_lex_direct): Warn when -Wc90-c99-compat is in effect.
1189 * charset.c (_cpp_valid_ucn): Likewise.
1190 * include/cpplib.h (cpp_options): Add cpp_warn_c90_c99_compat.
1191 * macro.c (replace_args): Warn when -Wc90-c99-compat is in effect.
1192 (parse_params): Likewise.
1193
61eb99f6
MP
11942014-07-27 Marek Polacek <polacek@redhat.com>
1195
1196 PR c/61861
1197 * macro.c (builtin_macro): Add location parameter. Set
1198 location of builtin macro to the expansion point.
1199 (enter_macro_context): Pass location to builtin_macro.
1200
c468587a
DS
12012014-07-16 Dodji Seketeli <dodji@redhat.com>
1202
1203 Support location tracking for built-in macro tokens
1204 * include/line-map.h (line_maps::builtin_location): New data
1205 member.
1206 (line_map_init): Add a new parameter to initialize the new
1207 line_maps::builtin_location data member.
1208 * line-map.c (linemap_init): Initialize the
1209 line_maps::builtin_location data member.
1210 * macro.c (builtin_macro): Create a macro map and track the token
1211 resulting from the expansion of a built-in macro.
1212
3976796b
ESR
12132014-07-10 Edward Smith-Rowland <3dw4rd@verizon.net>
1214 Jonathan Wakely <jwakely@redhat.com>
1215
c786fca6 1216 PR preprocessor/61389
3976796b
ESR
1217 * macro.c (_cpp_arguments_ok, parse_params, create_iso_definition):
1218 Warning messages mention C++11 in c++ mode and C99 in c mode.
1219 * lex.c (lex_identifier_intern, lex_identifier): Ditto
1220
7aee8646
ESR
12212014-07-09 Edward Smith-Rowland <3dw4rd@verizon.net>
1222
1223 PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped
1224 by preprocessor
1225 * lex.c (lex_raw_string ()): Do not warn about invalid suffix
1226 if skipping. (lex_string ()): Ditto.
1227
98ba7482
ESR
12282014-06-04 Edward Smith-Rowland <3dw4rd@verizon.net>
1229
1230 PR c++/61038
1231 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
1232 Combine user-defined escape logic with the other string and char logic.
1233
edf6ddf6
RB
12342014-05-26 Richard Biener <rguenther@suse.de>
1235
1236 * configure.ac: Remove long long and __int64 type checks,
1237 add check for uint64_t and fail if that wasn't found.
1238 * include/cpplib.h (cpp_num_part): Use uint64_t.
1239 * config.in: Regenerate.
1240 * configure: Likewise.
1241
28939589
MP
12422014-05-21 Marek Polacek <polacek@redhat.com>
1243
1244 PR c/61212
1245 * files.c (find_file_in_dir): Add parens around &&.
1246
49039169
ESR
12472014-05-20 Edward Smith-Rowland <3dw4rd@verizon.net>
1248
28939589 1249 PR c++/61038
49039169
ESR
1250 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
1251 Check for user-defined literal strings and user-defined literal chars
1252 to escape necessary characters.
1253
54da09ee
RB
12542014-05-20 Richard Biener <rguenther@suse.de>
1255
1256 * configure.ac: Copy gcc logic of detecting a 64bit type.
1257 Remove HOST_WIDE_INT define.
1258 * include/cpplib.h: typedef cpp_num_part to a 64bit type,
1259 similar to how hwint.h does it.
1260 * config.in: Regenerate.
1261 * configure: Likewise.
1262
eac3e079
JY
12632014-05-09 Joey Ye <joey.ye@arm.com>
1264
1265 * files.c (find_file_in_dir): Always try to shorten for DOS
1266 non-system headers.
1267 * init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS.
1268
f543058d
RB
12692014-05-07 Richard Biener <rguenther@suse.de>
1270
1271 * configure.ac: Always set need_64bit_hwint to yes.
1272 * configure: Regenerated.
1273
d9f069ab
RO
12742014-04-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1275
1276 * lex.c: Remove Solaris 9 reference.
1277
341c653c
WL
12782014-02-24 Walter Lee <walt@tilera.com>
1279
1280 * configure.ac: Change "tilepro" triplet to "tilepro*".
1281 * configure: Regenerate.
1282
179652df
JJ
12832014-02-19 Jakub Jelinek <jakub@redhat.com>
1284
1285 PR preprocessor/58844
1286 * macro.c (enter_macro_context): Only push
1287 macro_real_token_count (macro) tokens rather than
1288 macro->count tokens, regardless of
1289 CPP_OPTION (pfile, track-macro-expansion).
1290
acf601ae
JJ
12912014-02-07 Jakub Jelinek <jakub@redhat.com>
1292
1293 PR preprocessor/56824
1294 * line-map.c (get_combined_adhoc_loc, linemap_get_expansion_line,
1295 linemap_get_expansion_filename, linemap_location_in_system_header_p,
1296 linemap_location_from_macro_expansion_p,
1297 linemap_macro_loc_to_spelling_point, linemap_macro_loc_to_def_point,
1298 linemap_macro_loc_to_exp_point, linemap_expand_location): Fix
1299 formatting.
1300 (linemap_compare_locations): Look through adhoc locations for both
1301 l0 and l1.
1302
7ecc3eb9
DS
13032014-01-23 Dodji Seketeli <dodji@redhat.com>
1304
1305 PR PR preprocessor/58580
1306 * include/line-map.h (linemap_get_file_highest_location): Declare
1307 new function.
1308 * line-map.c (linemap_get_file_highest_location): Define it.
1309
35c3d610
RS
13102014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
1311
1312 Update copyright years
1313
3a4efce7
JM
13142013-12-09 Joseph Myers <joseph@codesourcery.com>
1315
1316 PR preprocessor/55715
1317 * expr.c (num_binary_op): Implement subtraction directly rather
1318 than with negation and falling through into addition case.
1319
aadce585
BS
13202013-11-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
1321
1322 * lex.c (search_line_fast): Correct for little endian.
1323
d3f4ff8b
JM
13242013-11-15 Joseph Myers <joseph@codesourcery.com>
1325
1326 * ucnid.tab: Add C11 and C11NOSTART data.
1327 * makeucnid.c (digit): Rename enum value to N99.
1328 (C11, N11, all_languages): New enum values.
1329 (NUM_CODE_POINTS, MAX_CODE_POINT): New macros.
1330 (flags, decomp, combining_value): Use NUM_CODE_POINTS as array
1331 size.
1332 (decomp): Use unsigned int as element type.
1333 (all_decomp): New array.
1334 (read_ucnid): Handle C11 and C11NOSTART. Use MAX_CODE_POINT.
1335 (read_table): Use MAX_CODE_POINT. Store all decompositions in
1336 all_decomp.
1337 (read_derived): Use MAX_CODE_POINT.
1338 (write_table): Use NUM_CODE_POINTS. Print N99, C11 and N11
1339 flags. Print whole array variable declaration rather than just
1340 array contents.
1341 (char_id_valid, write_context_switch): New functions.
1342 (main): Call write_context_switch.
1343 * ucnid.h: Regenerate.
1344 * include/cpplib.h (struct cpp_options): Add c11_identifiers.
1345 * init.c (struct lang_flags): Add c11_identifiers.
1346 (cpp_set_lang): Set c11_identifiers option from selected language.
1347 * internal.h (struct normalize_state): Document "previous" as
1348 previous starter character.
1349 (NORMALIZE_STATE_UPDATE_IDNUM): Take character as argument.
1350 * charset.c (DIG): Rename enum value to N99.
1351 (C11, N11): New enum values.
1352 (struct ucnrange): Give name to struct. Use short for flags and
1353 unsigned int for end of range. Include ucnid.h for whole variable
1354 declaration.
1355 (ucn_valid_in_identifier): Allow for characters up to 0x10FFFF.
1356 Allow for C11 in determining valid characters and valid start
1357 characters. Use check_nfc for non-Hangul context-dependent
1358 checks. Only store starter characters in nst->previous.
1359 (_cpp_valid_ucn): Pass new argument to
1360 NORMALIZE_STATE_UPDATE_IDNUM.
1361 * lex.c (lex_identifier): Pass new argument to
1362 NORMALIZE_STATE_UPDATE_IDNUM. Call NORMALIZE_STATE_UPDATE_IDNUM
1363 after initial non-UCN part of identifier.
1364 (lex_number): Pass new argument to NORMALIZE_STATE_UPDATE_IDNUM.
1365
54848ff8
JM
13662013-11-15 Joseph Myers <joseph@codesourcery.com>
1367
1368 * ucnid.tab: Mark C99 digits as [C99DIG].
1369 * makeucnid.c (read_ucnid): Handle [C99DIG].
1370 (read_table): Don't check for digit characters.
1371 * ucnid.h: Regenerate.
1372
5157b91e
TB
13732013-11-06 Tobias Burnus <burnus@net-b.de>
1374
1375 * macro.c (_cpp_builtin_macro_text): Correct
1376 wording of two warnings.
1377
e8ff5196
TB
13782013-11-05 Tobias Burnus <burnus@net-b.de>
1379
1380 * include/cpplib.h (CPP_W_DATE_TIME): Added.
1381 (cpp_options): Add warn_date_time.
1382 * init.c (cpp_create_reader): Init it.
1383 * macro.c (_cpp_builtin_macro_text): Warn when
1384 __DATE__/__TIME__/__TIMESTAMP__ is used.
1385
7057e645
ESR
13862013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
1387
e8ff5196 1388 Implement C++14 digit separators.
7057e645
ESR
1389 * include/cpplib.h (cpp_options): Add digit_separators flag.
1390 * internal.h (DIGIT_SEP(c)): New macro.
1391 * expr.c (cpp_classify_number): Check improper placement of digit sep;
1392 (cpp_interpret_integer): Skip over digit separators.
1393 * init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add
1394 digit separator flags per language; (cpp_set_lang): Set
1395 digit_separators
1396 * lex.c (lex_number): Add digits separator to allowable characters for
1397 C++14.
1398
459260ec
DM
13992013-10-15 David Malcolm <dmalcolm@redhat.com>
1400
1401 * Makefile.in (PICFLAG): New.
1402 (ALL_CFLAGS): Add PICFLAG.
1403 (ALL_CXXFLAGS): Likewise.
1404 * configure.ac: Add --enable-host-shared, setting up new
1405 PICFLAG variable.
1406 * configure: Regenerate.
1407
fd6eea0c
RE
14082013-08-07 Richard Earnshaw <rearnsha@arm.com>
1409
1410 * configure.ac: Set need_64bit_hwint for all arm targets.
1411 * configure: Regenerated.
1412
8cf88735
JJ
14132013-07-20 Jakub Jelinek <jakub@redhat.com>
1414
1415 PR preprocessor/57620
1416 * lex.c (lex_raw_string): Undo phase1 and phase2 transformations
1417 between R" and final " rather than only in between R"del( and )del".
1418
87e356ba
JJ
14192013-07-10 Jakub Jelinek <jakub@redhat.com>
1420
d5e48350
JJ
1421 PR preprocessor/57824
1422 * lex.c (lex_raw_string): Allow reading new-lines if
1423 in_deferred_pragma or if parsing_args and there is still
1424 data in the current buffer.
1425
c26302d5
JJ
1426 * include/cpplib.h (cpp_token_val_index): Change parameter type to
1427 const cpp_token *.
1428 * lex.c (cpp_token_val_index): Likewise.
1429
87e356ba
JJ
1430 PR preprocessor/57757
1431 * lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING
1432 or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that
1433 starts if a-zA-Z_.
1434
c865f923
ESR
14352013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
1436
1437 * lex.c (lex_raw_string(), lex_string()): Constrain suffixes treated
1438 as concatenated literal and macro to just the patterns found in
1439 inttypes.h; (is_macro()): New.
1440
39953c79
DC
14412013-06-24 Dehao Chen <dehao@google.com>
1442
1443 * files.c (_cpp_stack_include): Fix the highest_location when header
1444 file is guarded by #ifndef and is included twice.
1445
01187df0
JJ
14462013-04-28 Jakub Jelinek <jakub@redhat.com>
1447
1448 N3472 binary constants
1449 * include/cpplib.h (struct cpp_options): Fix a typo in user_literals
1450 field comment. Add binary_constants field.
1451 * init.c (struct lang_flags): Add binary_constants field.
1452 (lang_defaults): Add bin_cst column to the table.
1453 (cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants).
1454 * expr.c (cpp_classify_number): Talk about C++11 instead of C++0x
1455 in diagnostics. Accept binary constants if
1456 CPP_OPTION (pfile, binary_constants) even when pedantic. Adjust
1457 pedwarn message.
1458
61949153
PC
14592013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
1460
1461 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y.
1462 * init.c (lang_defaults): Add defaults for the latter.
1463 (cpp_init_builtins): Define __cplusplus as 201300L for the latter.
1464 * lex.c (_cpp_lex_direct): Update.
1465
994a4cc0
SH
14662013-04-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
1467
1468 PR target/56771
1469 * configure.ac: Require 64-bit int for arm*-*-rtems*.
1470 * configure: Regenerate.
1471
28937f11
JJ
14722013-03-06 Jakub Jelinek <jakub@redhat.com>
1473
1474 PR middle-end/56461
1475 * internal.h (struct cpp_buffer): Add to_free field.
1476 (_cpp_pop_file_buffer): Add third argument.
1477 * files.c (_cpp_stack_file): Set buffer->to_free.
1478 (_cpp_pop_file_buffer): Add to_free argument. Free to_free
1479 if non-NULL, and if equal to file->buffer_start, also clear
1480 file->buffer{,_start,_valid}.
1481 * directives.c (_cpp_pop_buffer): Pass buffer->to_free
1482 to _cpp_pop_file_buffer.
1483
3b8af25b
JJ
14842013-03-01 Jakub Jelinek <jakub@redhat.com>
1485
1486 PR middle-end/56461
1487 * files.c (_cpp_save_file_entries): Free result at the end.
1488 * pch.c (cpp_string_free): New function.
1489 (cpp_save_state): Use it in htab_create call.
1490 (cpp_write_pch_deps): Free ss->defs. Destroy ss->definedhash.
1491
1a80db97
JJ
14922013-02-28 Jakub Jelinek <jakub@redhat.com>
1493
15fd8332
JJ
1494 * files.c (_cpp_find_file): If returning early, before storing
1495 something to *hash_slot and *hash_slot is NULL, call htab_clear_slot
1496 on it. Access *hash_slot using void * type rather than
1497 struct file_hash_entry * to avoid aliasing issues.
1498
1a80db97
JJ
1499 * configure.ac: Don't define ENABLE_CHECKING whenever
1500 --enable-checking is seen, instead use similar --enable-checking=yes
1501 vs. --enable-checking=release default as gcc/ subdir has and
1502 define ENABLE_CHECKING if ENABLE_CHECKING is defined in gcc/.
1503 Define ENABLE_VALGRIND_CHECKING if requested.
1504 * lex.c (new_buff): If ENABLE_VALGRIND_CHECKING, put _cpp_buff
1505 struct first in the allocated buffer and result->base after it.
1506 (_cpp_free_buff): If ENABLE_VALGRIND_CHECKING, free buff itself
1507 instead of buff->base.
1508 * config.in: Regenerated.
1509 * configure: Regenerated.
1510
561f7fc7
ESR
15112013-02-13 Ed Smith-Rowland <3dw4rd@verizon.net>
1512
1513 PR c++/55582
61949153 1514 * lex.c (lex_raw_string): Allow string literal with suffix
561f7fc7
ESR
1515 beginning with 's' to be parsed as a C++11 user-defined literal.
1516
500f3ed9
RS
15172013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
1518
1519 Update copyright years.
1520
1582c677
PC
15212013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
1522
1523 PR c++/54526 (again)
1524 * lex.c (_cpp_lex_direct): In C++11 mode, implement 2.5 p3, bullet 2.
1525
8ac16127
MG
15262013-01-03 Marc Glisse <marc.glisse@inria.fr>
1527
1528 PR bootstrap/50177
1529 * line-map.c (get_combined_adhoc_loc): Cast from extern "C" type.
1530 (new_linemap): Likewise.
1531 (linemap_enter_macro): Likewise.
1532
f41e5bd1
JJ
15332012-12-03 Jakub Jelinek <jakub@redhat.com>
1534
1535 PR bootstrap/55380
1536 PR other/54691
1537 * files.c (read_file_guts): Allocate extra 16 bytes instead of
1538 1 byte at the end of buf. Pass size + 16 instead of size
1539 to _cpp_convert_input.
1540 * charset.c (_cpp_convert_input): Reallocate if there aren't
1541 at least 16 bytes beyond to.len in the buffer. Clear 16 bytes
1542 at to.text + to.len.
1543
31962032
SE
15442012-11-21 Steve Ellcey <sellcey@mips.com>
1545
1546 PR pch/55399
1547 * files.c (pch_open_file): Fix check for implicit_preinclude.
1548
5dc99c46
SB
15492012-11-16 Simon Baldwin <simonb@google.com>
1550
1551 * include/cpplib.h (struct cpp_options): Add canonical_system_headers.
1552 * files.c (find_file_in_dir): Call maybe_shorter_path() only if
1553 canonical_system_headers is set.
1554 * init.c (cpp_create_reader): Initialize canonical_system_headers.
1555 * configure.ac: Add new --enable-canonical-system-headers.
1556 * configure: Regenerate.
1557 * config.in: Regenerate.
1558
a4a0016d
ESR
15592012-11-09 Ed Smith-Rowland <3dw4rd@verizon.net>
1560
1561 PR c++/54413
1562 * include/cpplib.h (cpp_interpret_float_suffix): Add cpp_reader* arg.
1563 (cpp_interpret_int_suffix): Add cpp_reader* arg.
1564 * init.c (cpp_create_reader): Iitialize new flags.
1565 * expr.c (interpret_float_suffix): Use new flags.
1566 (cpp_interpret_float_suffix): Add cpp_reader* arg.
1567 (interpret_int_suffix): Use new flags.
1568 (cpp_interpret_int_suffix): Add cpp_reader* arg.
1569 (cpp_classify_number): Adjust calls to interpret_x_suffix.
1570
04ce690f
IB
15712012-10-23 Ian Bolton <ian.bolton@arm.com>
1572 Jim MacArthur <jim.macarthur@arm.com>
1573 Marcus Shawcroft <marcus.shawcroft@arm.com>
1574 Nigel Stephens <nigel.stephens@arm.com>
1575 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
1576 Richard Earnshaw <rearnsha@arm.com>
1577 Sofiane Naci <sofiane.naci@arm.com>
1578 Stephen Thomas <stephen.thomas@arm.com>
1579 Tejas Belagod <tejas.belagod@arm.com>
1580 Yufeng Zhang <yufeng.zhang@arm.com>
1581
1582 * configure.ac: Enable AArch64.
1583 * configure: Regenerate.
1584
1efcb8c6
JM
15852012-10-23 Joseph Myers <joseph@codesourcery.com>
1586
1587 * files.c (struct _cpp_file): Add implicit_preinclude.
1588 (pch_open_file): Allow a previously opened implicitly included
1589 file.
1590 (_cpp_find_file): Add implicit_preinclude argument. Free file and
1591 do not call open_file_failed if implicit_preinclude. Store
1592 implicit_preinclude value.
1593 (_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date):
1594 Update calls to _cpp_find_file.
1595 (_cpp_stack_include): Handle IT_DEFAULT.
1596 (cpp_push_default_include): New.
1597 * include/cpplib.h (cpp_push_default_include): Declare.
1598 * init.c (cpp_read_main_file): Update call to _cpp_find_file.
1599 * internal.h (enum include_type): Add IT_DEFAULT.
1600 (_cpp_find_file): Update prototype.
1601
55e7f907
TB
16022012-10-15 Tobias Burnus <burnus@net-b.de>
1603
1604 * files.c (read_file_guts, _cpp_save_file_entries): Free memory
1605 before returning.
1606 * lex.c (warn_about_normalization): Ditto.
1607 * mkdeps.c (deps_save): Ditto.
1608 * pch.c (cpp_valid_state): Ditto.
1609
f591bd8f
FW
16102012-10-04 Florian Weimer <fweimer@redhat.com>
1611
1612 * directives.c (do_pragma_warning_or_error): New.
1613 (do_pragma_warning): New.
1614 (do_pragma_error): New.
1615 (_cpp_init_internal_pragmas): Register new pragmas.
1616
ec6e0399
DC
16172012-09-25 Dehao Chen <dehao@google.com>
1618
1619 PR middle-end/54704
1620 * line-map.c (location_adhoc_data_hash): Fix the hash function.
1621
52187008
DC
16222012-09-25 Dehao Chen <dehao@google.com>
1623
1624 PR middle-end/54645
1625 * include/line-map.h (location_adhoc_data): Move location_adhoc_data
1626 into GC.
1627 (location_adhoc_data_map): Likewise.
1628 (line_maps): Likewise.
1629 (rebuild_location_adhoc_htab): New Function.
1630 * line-map.c (+rebuild_location_adhoc_htab): new Funcion.
1631 (get_combined_adhoc_loc): Move location_adhoc_data into GC.
1632 (location_adhoc_data_fini): Likewise.
1633 (linemap_init): Likewise.
1634 (location_adhoc_data_init): Remove Function.
1635
5368224f
DC
16362012-09-19 Dehao Chen <dehao@google.com>
1637
1638 * include/line-map.h (MAX_SOURCE_LOCATION): New value.
1639 (location_adhoc_data_fini): New.
1640 (get_combined_adhoc_loc): New.
1641 (get_data_from_adhoc_loc): New.
1642 (get_location_from_adhoc_loc): New.
1643 (location_adhoc_data_map): New.
1644 (COMBINE_LOCATION_DATA): New.
1645 (IS_ADHOC_LOC): New.
1646 (expanded_location): New field.
1647 (line_maps): New field.
1648 * line-map.c (location_adhoc_data): New.
1649 (location_adhoc_data_hash): New.
1650 (location_adhoc_data_eq): New.
1651 (location_adhoc_data_update): New.
1652 (get_combined_adhoc_loc): New.
1653 (get_data_from_adhoc_loc): New.
1654 (get_location_from_adhoc_loc): New.
1655 (location_adhoc_data_init): New.
1656 (location_adhoc_data_fini): New.
1657 (linemap_init): Initialize location_adhoc_data.
1658 (linemap_lookup): Change to use new location.
1659 (linemap_ordinary_map_lookup): Likewise.
1660 (linemap_macro_map_lookup): Likewise.
1661 (linemap_macro_map_loc_to_def_point): Likewise.
1662 (linemap_macro_map_loc_unwind_toward_spel): Likewise.
1663 (linemap_get_expansion_line): Likewise.
1664 (linemap_get_expansion_filename): Likewise.
1665 (linemap_location_in_system_header_p): Likewise.
1666 (linemap_location_from_macro_expansion_p): Likewise.
1667 (linemap_macro_loc_to_spelling_point): Likewise.
1668 (linemap_macro_loc_to_def_point): Likewise.
1669 (linemap_macro_loc_to_exp_point): Likewise.
1670 (linemap_resolve_location): Likewise.
1671 (linemap_unwind_toward_expansion): Likewise.
1672 (linemap_unwind_to_first_non_reserved_loc): Likewise.
1673 (linemap_expand_location): Likewise.
1674 (linemap_dump_location): Likewise.
1675 (linemap_line_start): Likewise.
1676
f3d25c65
DS
16772012-05-25 Dodji Seketeli <dodji@redhat.com>
1678
1679 PR preprocessor/53469
1680 * directives.c (do_pragma): Use the virtual location for the
1681 pragma token, instead of its spelling location.
1682
0823efed
DN
16832012-08-14 Diego Novillo <dnovillo@google.com>
1684
1685 Merge from cxx-conversion branch. Configury.
1686
1687 * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
1688 * configure.ac: Likewise.
1689 * configure: Regenerate.
1690
16912012-08-14 Lawrence Crowl <crowl@google.com>
1692
1693 Merge from cxx-conversion branch. New C++ hash table.
1694
1695 * include/symtab.h (typedef struct ht hash_table): Change the typedef
1696 name to cpp_hash_table. Update all users of the typedef.
1697
c0fd3497
LB
16982012-07-30 Laurynas Biveinis <laurynas.biveinis@gmail.com>
1699
1700 * include/line-map.h (line_map_macro): Use the "atomic" GTY option
1701 for the macro_locations field.
1702
d35d1c0f
UB
17032011-06-19 Uros Bizjak <ubizjak@gmail.com>
1704
1705 * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
1706 __builtin_ia32_pcmpestri128 instead of asm.
1707
d86d2119
DA
17082012-06-04 Dimitrios Apostolou <jimis@gmx.net>
1709
1710 * line-map.c (linemap_enter_macro): Don't zero max_column_hint in
1711 every macro. This improves performance by reducing the number of
1712 reallocations when track-macro-expansion is on.
1713
7ca643e1
DS
17142012-06-04 Dodji Seketeli <dodji@redhat.com>
1715
1716 PR preprocessor/53463
1717 * line-map.c (linemap_location_in_system_header_p): For built-in
1718 macro tokens, check the first expansion point location that is not
1719 for a token coming from a built-in macro.
1720
7d9641cc
JM
17212012-05-29 Joseph Myers <joseph@codesourcery.com>
1722
1723 * directives.c: Fix typos.
1724 * include/line-map.h: Fix typos.
1725 * line-map.c: Fix typos.
1726 * macro.c: Fix typos.
1727
53a103d3
DS
17282012-05-25 Dodji Seketeli <dodji@redhat.com>
1729
1730 PR bootstrap/53459
1731 * lex.c (search_line_fast): Avoid unused local typedefs to simulate
1732 a static assertion.
1733
828a7f76
DS
17342012-05-29 Dodji Seketeli <dodji@redhat.com>
1735
1736 PR preprocessor/53229
1737 * internal.h (cpp_reader::set_invocation_location): Remove.
1738 (cpp_reader::about_to_expand_macro_p): New member flag.
1739 * directives.c (do_pragma): Remove Kludge as
1740 pfile->set_invocation_location is no more.
1741 * macro.c (cpp_get_token_1): Do away with the use of
1742 cpp_reader::set_invocation_location. Just collect the macro
1743 expansion point when we are about to expand the top-most macro.
1744 Do not override cpp_reader::about_to_expand_macro_p.
1745 This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding
1746 properly handle locations of expansion points.
1747 (cpp_get_token_with_location): Adjust, as
1748 cpp_reader::set_invocation_location is no more.
1749 (paste_tokens): Take a virtual location parameter for
1750 the LHS of the pasting operator. Use it in diagnostics. Update
1751 comments.
1752 (paste_all_tokens): Tighten the assert. Propagate the location of
1753 the expansion point when no virtual locations are available.
1754 Pass the virtual location to paste_tokens.
1755 (in_macro_expansion_p): New static function.
1756 (enter_macro_context): Set the cpp_reader::about_to_expand_macro_p
1757 flag until we really start expanding the macro.
1758
0b2c4be5
DS
17592012-05-16 Dodji Seketeli <dodji@redhat.com>
1760
1761 PR preprocessor/7263
1762 * include/cpplib.h (cpp_classify_number): Take a location
1763 parameter.
1764 * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic
1765 macros that take a location parameter.
1766 (cpp_classify_number): Take a (virtual) location parameter. Use
1767 it for diagnostics. Adjust comments.
1768 (eval_token): Take a location parameter. Pass it to
1769 cpp_classify_number and to diagnostic routines.
1770 (_cpp_parse_expr): Use virtual locations of tokens when parsing
1771 expressions. Pass a virtual location to eval_token and to
1772 diagnostic routines.
1773
638d2065
TG
17742012-05-10 Tristan Gingold <gingold@adacore.com>
1775
1776 * expr.c (interpret_float_suffix): Add a guard.
1777
3ad64f53
DS
17782012-05-02 Dodji Seketeli <dodji@redhat.com>
1779
1780 Properly initialize cpp_context in destringize_and_run
1781 * directives.c (destringize_and_run): Properly initialize the new
1782 context.
1783 * macro.c (_cpp_pop_context): Assert that we shouldn't try to pop
1784 the initial base context, which has the same life time as the
1785 current instance of cpp_file.
1786
b193dfa8
MLI
17872012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
1788 Dodji Seketeli <dodji@seketeli.org>
1789
3efc2959 1790 PR c++/52974
b193dfa8
MLI
1791 * libcpp/files.c (maybe_shorter_path): New.
1792 (find_file_in_dir): Use it.
1793
4e65a470
DS
17942012-04-30 Dodji Seketeli <dodji@redhat.com>
1795
51fce2d3
DS
1796 Switch -ftrack-macro-expansion=2 on by default.
1797 * init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
1798 by default. Add comments.
1799
c4ca1a09
DS
1800 Strip "<built-in>" loc from displayed expansion context
1801 * include/line-map.h (linemap_unwind_toward_expansion): Fix typo
1802 in comment.
1803 (linemap_unwind_to_first_non_reserved_loc): Declare new function.
1804 * line-map.c (linemap_unwind_to_first_non_reserved_loc): Define
1805 new function.
1806
3600218c
DS
1807 Fix expansion point loc for macro-like tokens
1808 * macro.c (macro_of_context): New static function.
1809 (_cpp_push_token_context, push_extended_tokens_context): If the
1810 macro argument is NULL, it means we are continuing the expansion
1811 of the current macro, if any. Update comments.
1812 (_cpp_pop_context): Re-enable expansion of the macro only when we
1813 are really out of the context of the current expansion.
1814
0ff2b8a0
DS
1815 Fix token pasting with -ftrack-macro-expansion
1816 * macro.c (paste_all_tokens): Put the token resulting from pasting
1817 into an extended token context with -ftrack-macro-location is in
1818 effect.
1819
4e65a470
DS
1820 Fix cpp_sys_macro_p with -ftrack-macro-expansion
1821 * macro.c (cpp_sys_macro_p): Support -ftrack-macro-expansion.
1822
112448b4
DS
18232012-04-29 Dodji Seketeli <dodji@redhat.com>
1824
1825 * lex.c (lex_raw_string): Change C++ style comments into C style
1826 comments.
19a9ba64 1827 (lex_string): Likewise.
112448b4 1828
7f5f5f98
OW
18292012-04-27 Ollie Wild <aaw@google.com>
1830
1831 * include/cpplib.h (struct cpp_options): Add new field,
1832 warn_literal_suffix.
1833 (CPP_W_LITERAL_SUFFIX): New enum.
1834 * init.c (cpp_create_reader): Default initialization of
1835 warn_literal_suffix.
1836 * lex.c (lex_raw_string): Treat user-defined literals which don't
1837 begin with '_' as separate tokens and produce a warning.
1838 (lex_string): Ditto.
1839
1d72e96f
MLI
18402012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
1841
1842 * line-map.c (linemap_resolve_location): Synchronize comments with
1843 those in line-map.h.
1844 * include/line-map.h (linemap_resolve_location): Fix spelling in
1845 comment.
1846
e75b54a2
RE
18472012-03-22 Richard Earnshaw <rearnsha@arm.com>
1848
1849 * lex.c (search_line_fast): Provide Neon-optimized version for ARM.
1850
7888f266
RO
18512012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1852
1853 * lex.c: Remove Solaris 8 reference.
1854
dd552284
WL
18552012-02-14 Walter Lee <walt@tilera.com>
1856
1857 * configure.ac: Require 64-bit hwint for tilegx and tilepro.
1858 * configure: Regenerate.
1859
2c5cbc31
RG
18602012-01-09 Richard Guenther <rguenther@suse.de>
1861
1862 * macro.c (_cpp_builtin_macro_text): Remove unused variable map.
1863
b492b686
GF
18642012-01-09 Gary Funck <gary@intrepid.com>
1865
1866 PR preprocessor/33919
1867 * files.c (_cpp_get_file_name): New. Implement file name
1868 access function.
1869 * internal.h (_cpp_get_file_name): New prototype.
1870 * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
1871 to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
1872
75291c57
OH
18732012-01-03 Olivier Hainque <hainque@adacore.com>
1874
1875 * system.h: Prior to #define, #undef fopen and freopen unconditionally.
1876
48b0b196
JM
18772011-12-20 Joseph Myers <joseph@codesourcery.com>
1878
1879 * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
1880 (CLK_STDC1X): Change to CLK_STDC11.
1881 * init.c (lang_defaults): Update comments.
1882 (cpp_init_builtins): Update language tests. Use 201112L for C11
1883 __STDC_VERSION__.
1884
4a5e00ca
AS
18852011-12-20 Andreas Schwab <schwab@linux-m68k.org>
1886
1887 * configure: Regenerate.
1888
095af58f
AS
18892011-12-19 Andreas Schwab <schwab@linux-m68k.org>
1890
1891 * configure: Regenerate.
1892
b0c084b7
JJ
18932011-12-07 Jakub Jelinek <jakub@redhat.com>
1894
1895 PR bootstrap/50237
1896 * internal.h (_cpp_init_lexer): New prototype.
1897 * init.c (init_library): Call it.
1898 * lex.c (init_vectorized_lexer): Remove constructor attribute,
1899 add inline keyword.
1900 (HAVE_init_vectorized_lexer): Define.
1901 (_cpp_init_lexer): New function.
1902
9b554be9
DS
19032011-12-03 Dodji Seketeli <dodji@redhat.com>
1904
1905 * macro.c (tokens_buff_remove_last_token)
1906 (tokens_buff_put_token_to): Add an 'inline' function specifier to
1907 the prototype.
1908
8dcf72a8
DN
19092011-11-22 Diego Novillo <dnovillo@google.com>
1910
1911 * include/line-map.h (linemap_dump): Declare.
1912 (line_table_dump): Declare.
1913 * line-map.c (linemap_dump): New.
1914 (line_table_dump): New.
1915
7e74ce3f
ESR
19162011-11-21 Ed Smith-Rowland <3dw4rd@verizon.net>
1917
1918 PR c++/50958
1919 * expr.c (cpp_userdef_char_remove_type): Fix typo.
1920
e9411247
MM
19212011-11-03 Michael Matz <matz@suse.de>
1922
1923 PR bootstrap/50857
1924 * configure.ac: Check for -fno-exceptions -fno-rtti.
1925 * configure: Regenerate.
1926 * Makefile.in (NOEXCEPTION_FLAGS): New flag.
1927 (ALL_CXXFLAGS): Use it.
1928
0c1dace3
PC
19292011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
1930
1931 * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
1932
25339f10
JM
19332011-11-02 Jason Merrill <jason@redhat.com>
1934
1935 PR c++/50810
1936 * configure.ac: Add -Wno-narrowing to warning options.
1937
97e3ad20
JM
19382011-10-31 Jason Merrill <jason@redhat.com>
1939
1fb80b0c
JM
1940 PR libstdc++/1773
1941 * init.c (cpp_init_builtins): Set __cplusplus for C++11.
1942
97e3ad20
JM
1943 PR c++/50920
1944 * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
1945 CLK_GNUCXX0X to CLK_GNUCXX11.
1946
3ce4f9e4
ESR
19472011-10-26 Ed Smith-Rowland <3dw4rd@verizon.net>
1948
1949 Implement C++11 user-defined literals.
1950 * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
1951 cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
1952 cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
1953 cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
1954 (cpp_classify_number): Classify unrecognized tokens as user-defined
1955 literals.
1956 * include/cpplib.h: Add new tokens for user-defined literals.
1957 * init.c: Add new preprocessor flag (cxx11).
1958 * lex.c: (lex_string, lex_raw_string): Handle user-defined literals
1959 including concatenation and promotion with suffixes.
1960
3bb0c8db
DS
19612011-10-24 Dodji Seketeli <dodji@redhat.com>
1962
1963 * line-map.c (linemap_macro_map_lookup): Fix logic.
1964
84756fd4
DS
19652011-10-24 Dodji Seketeli <dodji@redhat.com>
1966
1967 * include/line-map.h (linemap_expand_location): Take a line table
1968 parameter. Update comment.
1969 (linemap_resolve_location): Update comment.
1970 (linemap_expand_location_full): Remove.
1971 * line-map.c (linemap_resolve_location): Handle reserved
1972 locations; return a NULL map in those cases.
1973 (linemap_expand_location): If location is reserved, return a
1974 zeroed expanded location. Update comment. Take a line table to
1975 assert that the function takes non-virtual locations only.
1976 (linemap_expand_location_full): remove.
1977 (linemap_dump_location): Handle the fact that
1978 linemap_resolve_location can return NULL line maps when the
1979 location resolves to a reserved location.
1980
1981 * line-map.c (linemap_macro_map_lookup): Fix logic.
1982
ad2305ad
DS
19832011-10-22 Dodji Seketeli <dodji@redhat.com>
1984
1985 PR bootstrap/50778
1986 * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
1987 context to act upon.
1988 * lex.c (_cpp_remaining_tokens_num_in_context): Likewise. Update
1989 comment.
1990 (cpp_token_from_context_at): Likewise.
1991 (cpp_peek_token): Use the context to peek tokens from.
1992
cbbcf655
DS
19932011-10-20 Dodji Seketeli <dodji@redhat.com>
1994
1995 PR bootstrap/50801
1996 * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
1997 number of tokens.
1998
d17687f6
DS
19992011-10-18 Dodji Seketeli <dodji@redhat.com>
2000
2001 PR bootstrap/50760
2002 * include/line-map.h (struct linemap_stats): Change the type of
19a9ba64 2003 the members from size_t to long.
d17687f6 2004 * macro.c (macro_arg_token_iter_init): Unconditionally initialize
19a9ba64 2005 iter->location_ptr.
d17687f6 2006
411f92de
DS
20072011-10-17 Dodji Seketeli <dodji@redhat.com>
2008
2009 * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
19a9ba64
AM
2010 variable without using it if ENABLE_CHECKING is not defined. Mark
2011 the LOCATION parameter as being unused.
411f92de 2012
b9bd6f74
TT
20132011-10-15 Tom Tromey <tromey@redhat.com>
2014 Dodji Seketeli <dodji@redhat.com>
2015
2016 * include/line-map.h (struct line_maps::alloced_size_for_request):
2017 New member.
2018 * line-map.c (new_linemap): Use set->alloced_size_for_request to
2019 get the actual allocated size of line maps.
2020
64a1a422
TT
20212011-10-15 Tom Tromey <tromey@redhat.com>
2022 Dodji Seketeli <dodji@redhat.com>
2023
2024 * line-map.h (struct linemap_stats): Declare new struct.
2025 (linemap_get_statistics): Declare ...
2026 * line-map.c (linemap_get_statistics): ... new function.
2027 * macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
2028 Declare new counters.
2029 (enter_macro_context, replace_args): Update
2030 num_macro_tokens_counter.
2031 (cpp_get_token_1): Update num_expanded_macros_counter.
2032
847e697a
TT
20332011-10-15 Tom Tromey <tromey@redhat.com>
2034 Dodji Seketeli <dodji@redhat.com>
2035
2036 * include/cpplib.h (struct cpp_options)<debug>: New struct member.
2037 * include/line-map.h (linemap_dump_location): Declare ...
2038 * line-map.c (linemap_dump_location): ... new function.
2039
92582b75
TT
20402011-10-15 Tom Tromey <tromey@redhat.com>
2041 Dodji Seketeli <dodji@redhat.com>
2042
2043 * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
2044 New option.
2045 * internal.h (struct macro_context): New struct.
2046 (enum context_tokens_kind): New enum.
2047 (struct cpp_context)<tokens_kind>: New member of type enum
2048 context_tokens_kind.
2049 (struct cpp_context)<macro>: Remove this. Replace it with an enum
2050 of macro and macro_context.
2051 (struct cpp_context)<direct_p>: Remove.
2052 (_cpp_remaining_tokens_num_in_context): Declare new function.
2053 * directives.c (destringize_and_run): Adjust.
2054 * lex.c (_cpp_remaining_tokens_num_in_context)
2055 (_cpp_token_from_context_at): Define new functions
2056 (cpp_peek_token): Use them.
2057 * init.c (cpp_create_reader): Initialize the base context to zero.
2058 (_cpp_token_from_context_at): Define new static function.
2059 (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
2060 _cpp_token_from_context_at.
2061 * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
2062 members.
2063 (enum macro_arg_token_kind): New enum.
2064 (struct macro_arg_token_iter): New struct.
2065 (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
2066 (alloc_expanded_arg_mem, ensure_expanded_arg_room)
2067 (delete_macro_args, set_arg_token, get_arg_token_location)
2068 (arg_token_ptr_at, macro_arg_token_iter_init)
2069 (macro_arg_token_iter_get_token)
2070 (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
2071 (expanded_token_index, tokens_buff_new, tokens_buff_count)
2072 (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
2073 (tokens_buff_add_token, tokens_buff_remove_last_token)
2074 (reached_end_of_context, consume_next_token_from_context): New
2075 static functions.
2076 (cpp_get_token_1): New static function. Split and extended from
2077 cpp_get_token. Use reached_end_of_context and
2078 consume_next_token_from_context. Unify its return point. Move
2079 the location tweaking from cpp_get_token_with_location in here.
2080 (cpp_get_token): Use cpp_get_token_1
2081 (stringify_arg): Use the new arg_token_at.
2082 (paste_all_tokens): Support tokens coming from extended tokens
2083 contexts.
2084 (collect_args): Return the number of collected arguments, by
2085 parameter. Store virtual locations of tokens that constitute the
2086 collected args.
2087 (funlike_invocation_p): Return the number of collected arguments,
2088 by parameter.
2089 (enter_macro_context): Add a parameter for macro expansion point.
2090 Pass it to replace_args and to the "used" cpp callback. Get the
2091 number of function-like macro arguments from funlike_invocation_p,
2092 pass it to the new delete_macro_args to free the memory used by
2093 macro args. When -ftrack-macro-expansion is in effect, for macros
2094 that have no arguments, create a macro map for the macro expansion
2095 and use it to allocate proper virtual locations for tokens
2096 resulting from the expansion. Push an extended tokens context
2097 containing the tokens resulting from macro expansion and their
2098 virtual locations.
2099 (replace_args): Rename the different variables named 'count' into
2100 variables with more meaningful names. Create a macro map;
2101 allocate virtual locations of tokens resulting from this
2102 expansion. Use macro_arg_token_iter to iterate over tokens of a
2103 given macro. Handle the case of the argument of
2104 -ftrack-macro-expansion being < 2. Don't free macro arguments
2105 memory resulting from expand_arg here, as these are freed by the
2106 caller of replace_arg using delete_macro_args now. Push extended
2107 token context.
2108 (next_context, push_ptoken_context, _cpp_push_token_context)
2109 (_cpp_push_text_context): Properly initialize the context.
2110 (expand_arg): Use the new alloc_expanded_arg_mem,
2111 push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
2112 (_cpp_pop_context): Really free the memory held by the context.
2113 Handle freeing memory used by extended tokens contexts.
2114 (cpp_get_token_with_location): Use cpp_get_token_1.
2115 (cpp_sys_macro_p): Adjust.
2116 (_cpp_backup_tokens): Support the new kinds of token contexts.
2117 * traditional.c (recursive_macro): Adjust.
2118
46427374
TT
21192011-10-15 Tom Tromey <tromey@redhat>
2120 Dodji Seketeli <dodji@redhat.com>
2121
2122 * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
2123 member.
2124 (MAX_SOURCE_LOCATION): New constant.
2125 (struct line_map_ordinary, struct line_map_macro): New structs.
19a9ba64 2126 (struct line_map): Turn this into a union of the two above. Add
46427374
TT
2127 comments.
2128 (struct maps_info): New struct.
2129 (struct line_maps)<info_ordinary, info_macro>: Two new fields.
2130 These now carry the map information that was previously scattered
2131 in struct line_maps.
2132 (struct map_info::allocated): Fix comment.
2133 (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
2134 (ORDINARY_MAP_STARTING_LINE_NUMBER)
2135 (ORDINARY_MAP_INCLUDER_FILE_INDEX)
2136 (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
2137 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
2138 (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
2139 (MACRO_MAP_EXPANSION_POINT_LOCATION)
2140 (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
2141 (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
2142 (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
2143 (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
2144 (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
2145 (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
2146 (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
2147 (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
2148 (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
2149 (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
2150 (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
2151 information.
2152 (linemap_check_ordinary, linemap_assert)
2153 (linemap_location_before_p): New macros.
2154 (linemap_position_for_line_and_column)
2155 (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
2156 (linemap_macro_expansion_map_p)
2157 (linemap_macro_map_loc_to_def_point)
2158 (linemap_macro_map_loc_unwind_once)
2159 (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
2160 (linemap_get_source_line linemap_get_source_column)
2161 (linemap_map_get_macro_name, linemap_get_file_path)
2162 (linemap_location_in_system_header_p)
2163 (linemap_location_from_macro_expansion_p): Declare new functions.
2164 (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
2165 (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
2166 accessors act on ordinary maps only.
2167 (INCLUDED_FROM): Return NULL for main files; use the new
2168 accessors.
2169 (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
2170 (struct expanded_location): Move here from gcc/input.h
2171 (linemap_resolve_location, linemap_expand_location)
2172 (linemap_expand_location_full): Declare new functions.
2173 * line-map.c: Include cpplib.h, internal.h
2174 (linemap_enter_macro, linemap_add_macro_token)
2175 (linemap_get_expansion_line, linemap_get_expansion_filename): New
2176 functions that are private to libcpp.
2177 (linemap_assert): New macro.
2178 (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
2179 (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
2180 (linemap_macro_map_loc_unwind_toward_spelling)
2181 (linemap_macro_map_loc_to_exp_point)
2182 (first_map_in_common_1, first_map_in_common): New static
2183 functions.
2184 (new_linemap): Define new static functions. Extracted and
2185 enhanced from ...
2186 (linemap_add): ... here. Use linemap_assert in lieu of abort
2187 previously.
2188 (linemap_tracks_macro_expansion_locs_p)
2189 (linemap_add_macro_token, linemap_macro_expansion_map_p)
2190 (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
2191 (linemap_macro_map_loc_to_def_point)
2192 (linemap_macro_map_loc_unwind_once)
2193 (linemap_step_out_once, linemap_map_get_index)
2194 (linemap_get_source_line,linemap_get_source_column)
2195 (linemap_get_file_path, linemap_map_get_macro_name)
2196 (linemap_location_in_system_header_p)
2197 (linemap_location_originated_from_system_header_p)
2198 (linemap_location_from_macro_expansion_p)
2199 (linemap_tracks_macro_expansion_locs_p)
2200 (linemap_resolve_location, linemap_expand_location)
2201 (linemap_expand_location_full)
2202 (linemap_tracks_macro_expansion_locs_p)
2203 (linemap_position_for_line_and_column, linemap_compare_locations):
2204 Define new public functions.
2205 (linemap_init): Initialize ordinary and macro maps information in
2206 the map set.
2207 (linemap_check_files_exited): Use the new accessors.
2208 (linemap_free): Remove this dead code.
2209 (linemap_line_start): Assert this uses an ordinary map. Adjust to
2210 use the new ordinary map accessors and data structures. Don't
2211 overflow past the lowest possible macro token's location.
2212 (linemap_position_for_column): Assert the ordinary maps of the map
2213 set are really ordinary. Use ordinary map accessors.
2214 (linemap_lookup): Keep the same logic but generalize to allow
2215 lookup of both ordinary and macro maps. Do not crash when called
2216 with an empty line table.
2217 * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
2218 new API of line-map.h.
2219 * directives.c (start_directive, do_line, do_linemarker)
2220 (do_linemarker): Likewise.
2221 * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
2222 (make_cpp_dir, cpp_make_system_header): Likewise.
2223 * init.c (cpp_read_main_file): Likewise.
2224 * internal.h (CPP_INCREMENT_LINE): Likewise.
2225 (linemap_enter_macro, linemap_add_macro_token)
2226 (linemap_get_expansion_line, linemap_get_expansion_filename): New
2227 functions private to libcpp.
2228 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
2229 (skip_line_comment, skip_whitespace, lex_raw_string)
2230 (_cpp_lex_direct): Likewise.
2231 * macro.c (_cpp_builtin_macro_text): Likewise.
2232 (_cpp_aligned_alloc): Initialize the new name member of the macro.
2233 * traditional.c (copy_comment, _cpp_scan_out_logical_line):
2234 Likewise.
2235 * errors.c (cpp_diagnostic): Adjust to new linemap API.
2236
892a371f
DS
22372011-08-28 Dodji Seketeli <dodji@redhat.com>
2238
2239 * line-map.c (linemap_add): Assert that reason must not be
2240 LC_RENAME when called for the first time on a "main input file".
2241
e3dfef44
GC
22422011-08-22 Gabriel Charette <gchare@google.com>
2243
2244 * init.c (cpp_create_reader): Inititalize forced_token_location_p.
2245 * internal.h (struct cpp_reader): Add field forced_token_location_p.
2246 * lex.c (_cpp_lex_direct): Use forced_token_location_p.
2247 (cpp_force_token_locations): New.
2248 (cpp_stop_forcing_token_locations): New.
2249
32fe396e
RO
22502011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2251
2252 PR libstdc++/1773
2253 * init.c (cpp_init_builtins): Define __cplusplus 19971L.
2254
7c1ffff9
JM
22552011-08-18 Joseph Myers <joseph@codesourcery.com>
2256
2257 * include/cpplib.h (struct cpp_options): Fix typo.
2258
a48e3dd1
JM
22592011-08-18 Joseph Myers <joseph@codesourcery.com>
2260
2261 * include/cpplib.h (struct cpp_options): Add rliterals.
2262 * init.c (struct lang_flags, lang_defaults): Add rliterals.
2263 (cpp_set_lang): Set rliterals option.
2264 (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
2265 * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
2266
3f6ced10
GC
22672011-08-15 Gabriel Charette <gchare@google.com>
2268
2269 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
2270 Update all users to use linemap_position_for_column instead.
2271
0681d04c
GC
22722011-07-28 Gabriel Charette <gchare@google.com>
2273
2274 * include/line-map.h (struct line_maps):
2275 Remove unused field last_listed. Update all users.
2276
5e9627ca
L
22772011-07-28 H.J. Lu <hongjiu.lu@intel.com>
2278
2279 * configure.ac: Set need_64bit_hwint to yes for x86 targets.
2280 * configure: Regenerated.
2281
a024b70f
RO
22822011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2283
2284 * system.h [__cplusplus]: Wrap C function declarations in extern "C".
2285
5b6d595b
RO
22862011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2287 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2288
2289 PR bootstrap/49794
2290 * configure.ac: Test AM_ICONV with CXX.
2291 * configure: Regenerate.
2292 * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
2293
d0a9fbe1
DS
22942011-07-15 Dodji Seketeli <dodji@redhat.com>
2295
2296 * directives.c (struct if_stack): Use source_location as type
2297 here.
2298 * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
2299 indent, def_pragma, used_define, used_undef>: Properly use
2300 source_location as parameter type, rather than unsigned int.
2301
fbdd5d87
RO
23022011-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2303
2304 PR target/39150
2305 * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
2306 like i[34567]86-*-solaris2.1[0-9]*.
2307 * configure: Regenerate.
2308
8787a05a
JM
23092011-06-16 Jason Merrill <jason@redhat.com>
2310
2311 PR c++/45399
2312 * lex.c (lex_raw_string): Don't check for embedded NUL.
2313
38fbfaf6
DS
23142011-06-06 Dodji Seketeli <dodji@redhat.com>
2315
2316 PR preprocessor/48532
2317 * directives.c (do_pragma): Don't forget the invocation location
2318 when parsing the pragma name of a namespaced pragma directive.
2319
fc0993ac
JT
23202011-05-29 John Tytgat <John.Tytgat@aaug.net>
2321
2322 * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
2323
ef230b38
UB
23242011-05-22 Uros Bizjak <ubizjak@gmail.com>
2325
2326 PR target/49104
2327 * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
2328 is defined. Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
2329
e5b0dad8
JK
23302011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
2331
2332 * system.h (ENUM_BITFIELD): Remove.
2333
6cfae070
JJ
23342011-04-24 Jakub Jelinek <jakub@redhat.com>
2335
2336 PR preprocessor/48740
2337 * lex.c (lex_raw_string): When raw string ends with
2338 ??) followed by raw prefix and ", ensure it is preprocessed
2339 with ??) rather than ??].
2340
04695783
JM
23412011-04-20 Jim Meyering <meyering@redhat.com>
2342
2343 * files.c (destroy_cpp_file): Remove useless if-before-free.
2344 * init.c (cpp_destroy): Likewise.
2345 * macro.c (replace_args): Likewise.
2346 * pch.c (cpp_valid_state): Likewise.
2347
4489800d
KT
23482011-03-25 Kai Tietz <ktietz@redhat.com>
2349
2350 * files.c (file_hash_eq): Use filename_cmp
2351 instead of strcmp.
2352 (nonexistent_file_hash_eq): Likewise.
2353 (remap_filename): Likewise.
2354 Handle absolute DOS-path,
2355 (append_file_to_dir): Check for IS_DIR_SEPARATOR
2356 instead of slash.
2357 (read_name_map): Likewise.
2358 * linemap.c (linemap_add): Use filename_cmp
2359 instead of strcmp.
2360 * mkdeps.c (apply_vpath): Use filename_ncmp
2361 instead of strncmp.
2362 (deps_restore): Use filename_cmp instead of
2363 strcmp.
2364 * init.c (read_original_directory): Use
2365 IS_DIR_SEPARATOR instead of checking for slash.
2366
f3c33d9d
MM
23672011-03-21 Michael Meissner <meissner@linux.vnet.ibm.com>
2368
2369 PR preprocessor/48192
2370 * directives.c (do_ifdef): Do not consider conditional macros as
2371 being defined.
2372 (do_ifndef): Ditto.
2373 * expr.c (parse_defined): Ditto.
2374
01956319
RH
23752011-03-18 Richard Henderson <rth@redhat.com>
2376
2377 PR bootstrap/45381
2378 * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
2379
c5a62c6f 23802011-11-04 Eric Botcazou <ebotcazou@adacore.com>
19a9ba64 2381 Jakub Jelinek <jakub@redhat.com>
c5a62c6f
EB
2382
2383 PR preprocessor/39213
2384 * directives.c (end_directive): Call _cpp_remove_overlay for deferred
2385 pragmas as well in traditional mode.
2386
0e1a989c
ILT
23872010-11-17 Ian Lance Taylor <iant@google.com>
2388
2389 PR bootstrap/45538
2390 * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of
2391 AC_LANG based on ENABLE_BUILD_WITH_CXX.
2392
651a20b5
KT
23932010-11-16 Kai Tietz <kai.tietz@onevision.com>
2394
2395 PR preprocessor/17349
2396 * lex.c (save_comment): Handle in argument passing c++
2397 comments special.
2398
480767a9
ILT
23992010-11-02 Ian Lance Taylor <iant@google.com>
2400
2401 * configure.ac: Use AC_SYS_LARGEFILE.
2402 * configure: Rebuild.
2403 * config.in: Rebuild.
2404
078419c9 24052010-10-19 Basile Starynkevitch <basile@starynkevitch.net>
480767a9 2406
078419c9
BS
2407 * line-map.h (source_location): Remove obsolete comment
2408 mentioning location_s.
2409
d6874138
KT
24102010-09-29 Kai Tietz <kai.tietz@onevision.com>
2411
2412 PR preprocessor/45362
2413 * directives.c (cpp_pop_definition): Make static.
2414 (do_pragma_push_macro): Reworked to store text
2415 definition.
2416 (do_pragma_pop_macro): Add free text definition.
2417 (cpp_push_definition): Removed.
2418 * include/cpplib.h (cpp_push_definition): Removed.
2419 (cpp_pop_definition): Likewise.
2420 * internal.h (def_pragma_macro): Remove member 'value'
2421 and add new members 'definition', 'line',
2422 'syshdr', 'sued' and 'is_undef'.
2423 * pch.c (_cpp_restore_pushed_macros): Rework to work
2424 on text definition and store additional macro flags.
2425 (_cpp_save_pushed_macros): Likewise.
2426
e3339d0f
JM
24272010-09-29 Joseph Myers <joseph@codesourcery.com>
2428
2429 * include/cpplib.h (cpp_options): Rename warn_deprecated,
2430 warn_traditional, warn_long_long and pedantic.
2431 * directives.c (directive_diagnostics, _cpp_handle_directive):
2432 Update names of cpp_options members.
2433 * expr.c (cpp_classify_number, eval_token): Update names of
2434 cpp_options members.
2435 * init.c (cpp_create_reader, post_options): Update names of
2436 cpp_options members.
2437 * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
2438 cpp_options members.
2439 * macro.c (parse_params): Update names of cpp_options members.
2440
128465e6
ILT
24412010-09-15 Ian Lance Taylor <iant@google.com>
2442
2443 * init.c: Fix type name in comment.
2444
a69d2520
JJ
24452010-08-31 Jakub Jelinek <jakub@redhat.com>
2446
2447 PR preprocessor/45457
2448 * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
2449 needed.
2450 * directives.c (do_ifdef, do_ifndef): Likewise.
2451
707bcb7a
RO
24522010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2453
2454 * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
2455
6f173e52
RH
24562010-08-24 Richard Henderson <rth@redhat.com>
2457
2458 PR bootstrap/45376
2459 * configure.ac (HAVE_SSE4): New check.
2460 * configure, config.in: Rebuild.
2461 * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
2462
789d73cb
RO
24632010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2464
2465 * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
2466 etc. on Solaris 2/x86.
2467
246a2fcb
RH
24682010-08-21 Richard Henderson <rth@redhat.com>
2469 Andi Kleen <ak@linux.intel.com>
2470 David S. Miller <davem@davemloft.net>
2471
2472 * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
2473 (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
2474 (ptrdiff_t): Check via AC_CHECK_TYPE.
2475 * config.in, configure: Rebuild.
2476 * system.h: Include stdint.h, if available.
2477 * lex.c (WORDS_BIGENDIAN): Provide default.
2478 (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
2479 acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
2480 search_line_sse2, search_line_sse42, init_vectorized_lexer,
2481 search_line_fast): New.
2482 (_cpp_clean_line): Use search_line_fast. Restructure the fast
2483 loop to make it clear when we're leaving the loop. Stay in the
2484 fast loop for non-trigraph '?'.
2485
8e680db5
JJ
24862010-06-11 Jakub Jelinek <jakub@redhat.com>
2487
2488 * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
2489 callback.
2490 (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
2491 (cpp_macro_definition): Remove const qual from second argument.
2492 * macro.c (enter_macro_context): Call user_builtin_macro callback for
2493 NODE_BUILTIN !NODE_USED macros.
2494 (warn_of_redefinition): Likewise. Remove const qual from second
2495 argument.
2496 (cpp_macro_definition): Likewise.
2497 * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
2498 for NODE_BUILTIN !NODE_USED macros.
2499
1cb42611
JM
25002010-06-10 Joseph Myers <joseph@codesourcery.com>
2501
2502 * include/cpplib.h (struct cpp_options): Remove show_column.
2503 * init.c (cpp_create_reader, post_options): Don't set show_column.
2504
ff5dfc48
JR
25052010-06-09 Joern Rennecke <joern.rennecke@embecosm.com>
2506
2507 PR bootstrap/44432
2508 * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
2509 check that C++ compiler works.
2510 * configure: Regenerate.
2511
a9429e29
LB
25122010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
2513
2514 * include/symtab.h (ht_identifier_ptr): New.
2515
c3f247f4
RW
25162010-06-03 Joern Rennecke <joern.rennecke@embecosm.com>
2517 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2518
2519 PR bootstrap/42798
2520 * configure.ac: Check for declaration of 'basename(char *)'.
2521 * configure: Regenerate.
2522 * config.in: Regenerate.
2523
2778d766
JM
25242010-04-25 Joseph Myers <joseph@codesourcery.com>
2525
2526 * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
2527 * init.c (lang_defaults): Add entries for new language variants.
2528 (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
2529 variants.
2530
d8a12e84
MLI
25312010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
2532
2533 PR cpp/43195
2534 * files.c (report_missing_guard): Test for #pragma once.
2535
87cf0651
SB
25362010-04-07 Simon Baldwin <simonb@google.com>
2537
2538 * directives.c (do_diagnostic): Add warning reason argument,
2539 call appropriate error reporting function for code.
2540 (directive_diagnostics): Call specific warning functions with
2541 warning reason where appropriate.
2542 (do_error, do_warning, do_pragma_dependency): Add warning reason
2543 argument to do_diagnostic calls.
2544 * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
2545 _cpp_create_definition): Call specific warning functions with
2546 warning reason where appropriate.
2547 * Makefile.in: Add new diagnostic functions to gettext translations.
2548 * include/cpplib.h (struct cpp_callbacks): Add warning reason code
2549 to error callback.
2550 (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
2551 CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
2552 (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
2553 CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
2554 CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
2555 CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
2556 CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
2557 CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
2558 CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
2559 warning reason codes.
2560 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
2561 cpp_warning_with_line, cpp_pedwarning_with_line,
2562 cpp_warning_with_line_syshdr): New specific error reporting functions.
2563 * pch.c (cpp_valid_state): Call specific warning functions with
2564 warning reason where appropriate.
2565 * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
2566 diagnostic handlers.
2567 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
2568 cpp_warning_with_line, cpp_pedwarning_with_line,
2569 cpp_warning_with_line_syshdr): New specific error reporting functions.
2570 * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
2571 specific warning functions with warning reason where appropriate.
2572 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
2573 warn_about_normalization, lex_identifier_intern, lex_identifier,
2574 _cpp_lex_direct): Ditto.
2575 * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
2576 narrow_str_to_charconst): Ditto.
2577
d947ada0
JJ
25782010-04-06 Jakub Jelinek <jakub@redhat.com>
2579
2580 PR preprocessor/43642
2581 * lex.c (lex_raw_string): Change type of TYPE variable to
2582 unsigned char.
2583
4d9e8446
RW
25842010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2585
2586 * aclocal.m4: Regenerate.
2587
52150625
JM
25882010-03-29 Jason Merrill <jason@redhat.com>
2589
00a81b8b
JM
2590 More N3077 raw string changes
2591 * charset.c (cpp_interpret_string): Don't transform UCNs in raw
2592 strings.
2593 * lex.c (bufring_append): Split out from...
2594 (lex_raw_string): ...here. Undo trigraph and line splicing
2595 transformations. Do process line notes in multi-line literals.
2596 (_cpp_process_line_notes): Ignore notes that were already handled.
2597
52150625
JM
2598 Some raw string changes from N3077
2599 * charset.c (cpp_interpret_string): Change inner delimiters to ().
2600 * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter.
2601
709d7160
JJ
26022010-02-11 Jakub Jelinek <jakub@redhat.com>
2603
2604 * init.c (read_original_filename): Don't call read_original_directory
2605 if _cpp_handle_directive returns 0.
2606
dadab4fd
JM
26072010-01-01 Joseph Myers <joseph@codesourcery.com>
2608
2609 PR preprocessor/41947
2610 * expr.c (cpp_classify_number): Give error for hexadecimal
2611 floating-point constant with no digits before or after point.
2612
3de8a540
AC
26132009-11-20 Arnaud Charlet <charlet@adacore.com>
2614
2615 * macro.c (enter_macro_context): Call cb.used callback if defined.
2616 * directives.c (do_idef, do_ifndef): Ditto.
2617 * include/cpplib.h (struct cpp_callbacks): Add used callback.
2618
17e7cb85
KT
26192009-11-11 Kai Tietz <kai.tietz@onevision.com>
2620
2621 * directives.c (do_pragma_push_macro): New pragma handler.
2622 (do_pragma_pop_macro): Likewise.
2623 (_cpp_init_internal_pragmas): Add push_macro and
2624 pop_macro handler to internal pragmas.
2625 (lex_macro_node_from_str): Removed.
2626 (cpp_push_definition): Replace lex_macro_node_from_str
2627 by _cpp_lex_identifier.
2628 (cpp_pop_definition): Likewise.
2629 * internal.h (_cpp_lex_identifier): New prototype.
2630 (def_pragma_macro): New structure.
2631 (cpp_reader): New member pushed_macros.
2632 * lex.c (_cpp_lex_identifier): New function.
2633 (lex_identifier_intern): New function.
2634 * init.c (cpp_create_reader): Initialize pushed_macros
2635 member.
2636 (cpp_destroy): Free elements in pushed_macros member.
2637 * pch.c (_cpp_save_pushed_macros): New function.
2638 (_cpp_restore_pushed_macros): Likewise.
2639 (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
2640 (cpp_read_state): Use _cpp_restore_pushed_macros.
2641
2c6e3f55
JJ
26422009-10-19 Jakub Jelinek <jakub@redhat.com>
2643
2644 * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
2645 (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
2646 and char32_cset_desc.
2647 (converter_for_type): Handle CPP_UTF8STRING.
2648 (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
2649 * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
2650 (parse_include): Reject raw strings.
2651 * include/cpplib.h (CPP_UTF8STRING): New token type.
2652 * internal.h (struct cpp_reader): Add utf8_cset_desc field.
2653 * lex.c (lex_raw_string): New function.
2654 (lex_string): Handle u8 string literals, call lex_raw_string
2655 for raw string literals.
2656 (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
2657 sequences.
2658 * macro.c (stringify_arg): Handle CPP_UTF8STRING.
2659
96c169e1
JJ
26602009-10-14 Jakub Jelinek <jakub@redhat.com>
2661
2662 PR preprocessor/41543
2663 * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
2664 * line-map.c (linemap_init): Initialize highest_location and
2665 highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
2666
30c99a9e
JM
26672009-10-09 Jason Merrill <jason@redhat.com>
2668
2669 * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
2670
2214382c
NV
26712009-10-09 Neil Vachharajani <nvachhar@google.com>
2672
2673 * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
2674 sccs.
2675
e02222d2
LR
26762009-09-23 Loren J. Rittle <ljrittle@acm.org>
2677
2678 * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
2679 * configure: Rebuilt.
2680
9a8a2b7a
RG
26812009-09-22 Richard Guenther <rguenther@suse.de>
2682
2683 PR pch/38987
2684 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
2685
74dc6a11
CD
26862009-09-18 Chris Demetriou <cgd@google.com>
2687
2688 PR preprocessor/28435:
2689 * include/cpplib.h (struct cpp_options): Add new member
2690 deps.need_preprocessor_output.
2691 * files.c (open_file_failed): If preprocessor output is needed
2692 always report an error.
2693
933608b7
KT
26942009-09-13 Kai Tietz <kai.tietz@onevision.com>
2695
2696 * configure.ac: Set for i?86-w64-mingw*
2697 need_64bit_hwint to yes.
2698 * configure: Regenerated.
2699
86373e7e
JM
27002009-09-10 Jason Merrill <jason@redhat.com>
2701
2702 * directives.c (cpp_define): constify.
2703
fd2ab214
ILT
27042009-09-02 Ian Lance Taylor <iant@google.com>
2705
2706 * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
2707
df58e648
RW
27082009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2709
2710 * configure.ac (AC_PREREQ): Bump to 2.64.
2711
5213506e
RW
27122009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2713
2714 * aclocal.m4: Regenerate.
2715 * config.in: Regenerate.
2716 * configure: Regenerate.
2717
709a22df
TT
27182009-08-17 Tom Tromey <tromey@redhat.com>
2719
2720 PR preprocessor/41067:
2721 * charset.c (convert_escape): Add missing ":" to error text.
2722
0c539b47
DR
27232009-07-27 Douglas B Rupp <rupp@gnat.com>
2724
2725 * include/cpplib.h (INO_T_CPP): New macro.
2726 (struct cpp_dir): Use it.
2727
2b69c841
JQ
27282009-07-20 Jerry Quinn <jlquinn@optonline.net>
2729
2730 PR regression/40800
2731 * configure.ac: Use = instead of == for testing
2732 ENABLE_BUILD_WITH_CXX.
2733 * configure: Rebuild.
2734
f1bf410c
JQ
27352009-07-17 Jerry Quinn <jlquinn@optonline.net>
2736
2737 * directives.c (do_linemarker, do_line): Use CPP_STRING for
2738 ignored enum value.
2739 * files.c (find_file_in_dir): Add cast from void* to char*.
2740 * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
2741 * Makefile.in: (WARN_CFLAGS): Use general and C-specific
2742 warnings.
2743 (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
2744 ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
2745 COMPILER_FLAGS): New.
2746 (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
2747 (COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS
2748 instead of ALL_CFLAGS.
2749 * configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings
2750 from other warnings. Add -Wc++-compat to C-specific warnings.
2751 Check for --enable-build-with-cxx. Set and substitute
2752 ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES
2753 according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before
2754 AC_CHECK_HEADERS.
2755 * configure: Rebuild.
2756 * include/cpp-id-data.h: Remove extern "C".
2757 * include/line-map.h: Likewise.
2758 * include/mkdeps.h: Likewise.
2759 * include/symtab.h: Likewise.
2760 * internal.h: Likewise.
2761
a28fbdba
MLI
27622009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2763
2764 * directives.c (parse_include): Add location argument. Update all
2765 calls.
2766 (parse_answer): Likewise.
2767 (do_include_common): Error with exact location.
2768 (parse_assertion): Likewise.
2769
b506a5a2
MLI
27702009-06-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
2771
2772 * expr.c (num_div_op): Take explicit location.
2773
7d8847a4
ILT
27742009-06-17 Ian Lance Taylor <iant@google.com>
2775
2776 * include/cpplib.h (progname): Don't declare.
2777
3d8b2a98
ILT
27782009-06-12 Ian Lance Taylor <iant@google.com>
2779
2780 * include/cpplib.h (struct cpp_options): Add
2781 warn_cxx_operator_names field.
2782 (NODE_WARN_OPERATOR): Define.
2783 (struct cpp_hashnode): Increase flags field to 10 bits, decrease
2784 type to 6 bits.
2785 * init.c (mark_named_operators): Add flags parameter.
2786 (cpp_post_options): Pick flags value to pass to
2787 mark_named_operators.
2788 * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
2789 identifier is an operator name in C++.
2790
e74fe492
AH
27912009-06-01 Aldy Hernandez <aldyh@redhat.com>
2792
2793 * include/line-map.h (LAST_SOURCE_COLUMN): New.
2794
4851089f
ILT
27952009-06-01 Ian Lance Taylor <iant@google.com>
2796
2797 * include/cpp-id-data.h: Add extern "C".
2798 * include/line-map.h: Likewise.
2799 * include/mkdeps.h: Likewise.
2800 * include/symtab.h: Likewise.
2801 * internal.h: Likewise.
2802
7e5487a2
ILT
28032009-05-15 Ian Lance Taylor <iant@google.com>
2804
2805 * include/cpplib.h (enum cpp_builtin_type): Rename from enum
2806 builtin_type. Change all uses.
2807
00b0c19b
MLI
28082009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2809
2810 PR cpp/36674
2811 * directives (do_linemarker): Compensate for the increment in
2812 location that occurs when we reach the end of line.
2813 * files (_cpp_stack_include): Mention _cpp_find_file in the
2814 comment.
2815
9a0c6187
JM
28162009-05-10 Joseph Myers <joseph@codesourcery.com>
2817
2818 * include/cpplib.h (enum cpp_token_fld_kind): Add
2819 CPP_TOKEN_FLD_TOKEN_NO.
2820 (struct cpp_macro_arg, struct cpp_identifier): Define.
2821 (union cpp_token_u): Use struct cpp_identifier for identifiers.
2822 Use struct cpp_macro_arg for macro arguments. Add token_no for
2823 CPP_PASTE token numbers.
2824 * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
2825 do_pragma_poison, parse_assertion): Use val.node.node in place of
2826 val.node.
2827 * expr.c (parse_defined, eval_token): Use val.node.node in place
2828 of val.node.
2829 * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
2830 cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
2831 cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
2832 place of val.arg_no. Use val.node.node in place of val.node.
2833 * macro.c (replace_args, cpp_get_token, parse_params,
2834 lex_expansion_token, create_iso_definition, cpp_macro_definition):
2835 Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
2836 Use val.node.node in place of val.node.
2837
9e322bc1
JM
28382009-05-03 Joseph Myers <joseph@codesourcery.com>
2839
2840 * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
2841 UTF-8 sequences.
2842
f88d0772
JM
28432009-04-25 Joseph Myers <joseph@codesourcery.com>
2844
2845 PR preprocessor/39559
2846 * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
2847 constants larger than intmax_t in C99 mode.
2848
d1b38208
TG
28492009-04-21 Taras Glek <tglek@mozilla.com>
2850
2851 * include/cpp-id-data.h: Update GTY annotations to new syntax.
2852 * include/cpplib.h: Likewise.
2853 * include/line-map.h: Likewise.
2854 * include/symtab.h: Likewise.
2855
cfc93532
MLI
28562009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2857
2858 PR c++/14875
2859 * lex.c (cpp_type2name): Take a flags parameter. Call
2860 cpp_named_operator2name for named operators and cpp_digraph2name
2861 for digraphs.
2862 (cpp_digraph2name): New.
2863 (cpp_spell_token): Use it.
2864 (cpp_output_token): Likewise.
2865 * include/cpplib.h (cpp_type2name): Update declaration.
2866 * init.c (cpp_named_operator2name): New.
2867 * internal.h (cpp_named_operator2name): Declare.
2868
9c650d90
MLI
28692009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2870
2871 PR c++/13358
2872 * init.c (cpp_create_reader): Wlong_long is disabled by default.
2873 * expr.c (cpp_classify_number): Give different messages for C and
2874 C++ front-ends.
2875
aa508502
JM
28762009-04-19 Joseph Myers <joseph@codesourcery.com>
2877
2878 PR preprocessor/20078
2879 * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
2880 field.
2881 * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
2882 (struct cpp_token): Change flags to unsigned short.
2883 * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
2884 (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
2885 (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
2886 tokens.
2887 * macro.c (macro_real_token_count): New.
2888 (enter_macro_context, replace_args): Use macro_real_token_count.
2889 (create_iso_definition): Record whitespace surrounding and digraph
2890 spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
2891 Set extra_tokens and save CPP_PASTE tokens with arg_no set for
2892 multiple consecutive ## tokens.
2893 (_cpp_create_definition): Initialize extra_tokens.
2894 (cpp_macro_definition): Use macro_real_token_count.
2895
61cc8223
JM
28962009-04-18 Joseph Myers <joseph@codesourcery.com>
2897
2898 * directives.c (parse_include): Pass true to check_eol.
2899
c7f9c0b9
JM
29002009-04-18 Joseph Myers <joseph@codesourcery.com>
2901
2902 PR preprocessor/39646
2903 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
2904 * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
2905 * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
2906 place of LC_RENAME.
2907
a5cb563b
JM
29082009-04-18 Joseph Myers <joseph@codesourcery.com>
2909
2910 PR preprocessor/39647
2911 * directives.c (check_eol): Add parameter expand.
2912 (do_undef, parse_include, do_line, do_linemarker, do_ident,
2913 do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
2914 do_else, do_endif, do_assert, do_unassert): All callers changed.
2915 Pass true from do_line, false elsewhere.
2916
18f41a1b
JM
29172009-04-12 Joseph Myers <joseph@codesourcery.com>
2918
2919 PR preprocessor/31869
2920 * macro.c (stringify_arg): Handle NULL source token in padding
2921 token where previous padding token did not have source token with
2922 preceding whitespace.
2923
748086b7
JJ
29242009-04-09 Jakub Jelinek <jakub@redhat.com>
2925
2926 * Makefile.in: Change copyright header to refer to version
2927 3 of the GNU General Public License and to point readers at the
2928 COPYING3 file and the FSF's license web page.
2929 * charset.c: Likewise.
2930 * directives-only.c: Likewise.
2931 * directives.c: Likewise.
2932 * errors.c: Likewise.
2933 * expr.c: Likewise.
2934 * files.c: Likewise.
2935 * identifiers.c: Likewise.
2936 * include/cpp-id-data.h: Likewise.
2937 * include/cpplib.h: Likewise.
2938 * include/line-map.h: Likewise.
2939 * include/mkdeps.h: Likewise.
2940 * include/symtab.h: Likewise.
2941 * init.c: Likewise.
2942 * internal.h: Likewise.
2943 * lex.c: Likewise.
2944 * line-map.c: Likewise.
2945 * macro.c: Likewise.
2946 * makeucnid.c: Likewise.
2947 * mkdeps.c: Likewise.
2948 * pch.c: Likewise.
2949 * symtab.c: Likewise.
2950 * system.h: Likewise.
2951 * traditional.c: Likewise.
2952 * ucnid.tab: Likewise.
2953 * ucnid.h: Regenerate.
2954
eec49116
JJ
29552009-04-01 Janis Johnson <janis187@us.ibm.com>
2956
839a3b8a
JJ
2957 PR c/39027
2958 * include/cpplib.h (CPP_N_DEFAULT): Define.
2959 * expr.c (interpret_float_suffix): Recognize d or D for double,
2960 return new value for default.
2961 (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
2962
eec49116
JJ
2963 PR c/33466
2964 * expr.c (interpret_float_suffix): Reject invalid suffix that uses
2965 letters from decimal float and fixed-point suffixes.
2966
47580d22
JM
29672009-03-31 Joseph Myers <joseph@codesourcery.com>
2968
2969 PR preprocessor/15638
2970 * files.c (_cpp_find_file): Call open_file_failed after diagnosing
2971 invalid PCH.
2972 (open_file_failed): Make error for missing file fatal.
2973 * include/cpplib.h (CPP_DL_FATAL): Define.
2974
5a2df0fa
SV
29752009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net>
2976
2977 PR preprocessor/31932:
2978 * internal.h: Don't mention HAVE_ICONV_H.
2979 * configure, config.in: Rebuild.
2980 * configure.ac: Don't check for iconv.h.
2981
c1a8a3c6
TT
29822009-03-30 Tom Tromey <tromey@redhat.com>
2983
2984 PR preprocessor/39512:
2985 * line-map.c (linemap_init): Initialize 'reallocator' field.
2986
a37a7b8a
JJ
29872009-03-30 Jakub Jelinek <jakub@redhat.com>
2988
2989 PR target/39558
2990 * macro.c (cpp_get_token): If macro_to_expand returns NULL
2991 and used some tokens, add CPP_PADDING before next token.
2992
148e4216
JM
29932009-03-29 Joseph Myers <joseph@codesourcery.com>
2994
2995 PR preprocessor/34695
2996 * makedepend.c: Remove.
2997 * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
2998 (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
2999 * directives.c (cpp_errors): Remove.
3000 * errors.c (print_location, _cpp_begin_message, v_message):
3001 Remove.
3002 (cpp_error, cpp_error_with_line): Always use error callback.
3003 (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
3004 * include/cpplib.h (cpp_options): Remove pedantic_errors,
3005 inhibit_warnings, warn_system_headers, inhibit_errors,
3006 warnings_are_errors, client_diagnostic.
3007 (cpp_callbacks): Add extra arguments to error callback; make it
3008 return bool.
3009 (cpp_finish): Return void.
3010 (cpp_destroy): Remove inaccurate comment about return value.
3011 (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
3012 (CPP_DL_NOTE): Define.
3013 * include/line-map.h (linemap_print_containing_files): Remove.
3014 * init.c (cpp_finish): Do not check for or return number of
3015 errors.
3016 * internal.h (cpp_reader): Remove errors field.
3017 * line-map.c (linemap_print_containing_files): Remove.
3018 * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
3019 about previous definition. Only emit it if previous diagnostic
3020 was emitted.
3021
f1450211
JM
30222009-03-28 Joseph Myers <joseph@codesourcery.com>
3023
3024 * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
3025 mkinstalldirs.
3026
8f5929e1
JJ
30272009-03-18 Jakub Jelinek <jakub@redhat.com>
3028
3029 * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
3030
4bb09c26
JM
30312009-02-21 Joseph Myers <joseph@codesourcery.com>
3032
3033 * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
3034 header name.
3035 (_cpp_lex_direct): Handle this.
3036
68c9ab45
RG
30372009-02-15 Richard Guenther <rguenther@suse.de>
3038
3039 Revert last change.
3040
601b3e1a
RG
30412009-02-13 Richard Guenther <rguenther@suse.de>
3042
3043 * configure.ac: Enable LFS.
3044 * configure: Re-generate.
3045 * config.in: Likewise.
3046
fc0cd180
BE
30472009-01-05 Ben Elliston <bje@au.ibm.com>
3048
3049 * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
3050 (.po.pox): Likewise.
3051 (po/$(PACKAGE).pot): Likewise.
3052
db89a3be
AO
30532008-12-10 Alexandre Oliva <aoliva@redhat.com>
3054
3055 PR target/37033
3056 * pch.c (cpp_valid_state): Improve message for poisoned symbols.
3057 Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
3058
cc955282
JM
30592008-11-29 Joseph Myers <joseph@codesourcery.com>
3060
3061 * lex.c (cpp_token_len): Use 6 as default length.
3062
47960aaf
MLI
30632008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org>
3064
3065 * expr.c (struct op): Add location.
3066 (_cpp_parse_expr): Propagate locations throught the stack
3067 of expressions.
3068 (reduce): Likewise.
3069 (check_promotion): Use explicit location in errors.
3070
631d0d36
MG
30712008-10-05 Matthew Gingell <gingell@adacore.com>
3072 Arnaud Charlet <charlet@adacore.com>
3073
3074 * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
3075 (cpp_get_comments): New function.
3076 * internal.h (struct cpp_reader): Add comments field.
3077 * init.c (cpp_destroy): Free comments.
3078 * lex.c (store_comment, cpp_get_comments): New functions.
3079 (comments): New struct.
3080 (save_comment): Store comments in comments struct.
3081
c047ce93
SB
30822008-09-18 Simon Baldwin <simonb@google.com>
3083
3084 * include/cpplib.h (struct cpp_options): Add new boolean flag
3085 warn_builtin_macro_redefined.
3086 * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
3087 * (struct builtin_operator): Split out from previous struct builtin,
3088 enhance extra const correctness.
3089 * (struct builtin_macro): Split out from previous struct builtin, add
3090 new always_warn_if_redefined flag, enhance const correctness.
3091 * (mark_named_operators): Use struct builtin_operator.
3092 * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
3093 to builtins selectively.
3094 * macro.c (warn_of_redefinition): Return false if a builtin macro
3095 is not flagged with NODE_WARN.
3096
affa55c6
JJ
30972008-07-31 Jakub Jelinek <jakub@redhat.com>
3098
3099 PR preprocessor/36649
3100 * files.c (struct report_missing_guard_data): New type.
3101 (report_missing_guard): Put paths into an array instead of printing
3102 them right away. Return 1 rather than 0.
3103 (report_missing_guard_cmp): New function.
3104 (_cpp_report_missing_guards): Sort and print paths gathered by
3105 report_missing_guard callback.
3106
3b8f20a1
MLI
31072008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3108
3109 PR 28079
3110 * directives.c (strtolinenum): Handle overflow.
3111 (do_line): Give a warning if line number overflowed.
3112 (do_linemarker): Update call to strtolinenum.
3113
1bb64668
MLI
31142008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3115
3116 * include/line-map.h (linenum_type): New typedef.
3117 (struct line_map): Use it.
3118 (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
3119 (SOURCE_COLUMN): Likewise.
3120 * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
3121 source_location values in a variable of type linenum_type.
3122 * directives.c (struct if_stack): Use linenum_type.
3123 (strtoul_for_line): Rename as strtolinenum.
3124 (do_line): Use linenum_type.
3125 (do_linemarker): Use linenum_type and strtolinenum.
3126 (_cpp_do_file_change): Use linenum_t.
3127 * line-map.c (linemap_add): Likewise.
3128 (linemap_line_start): Likewise.
3129 * traditional.c (struct fun_macro): 'line' is a source_location.
3130 * errors.c (print_location): Use linenum_type.
3131 * directives-only.c (_cpp_preprocess_dir_only): Likewise.
3132 * internal.h (CPP_INCREMENT_LINE): Likewise.
3133 * lex.c (_cpp_skip_block_comment): Use source_location.
19a9ba64 3134
5950c3c9
BE
31352008-07-14 Ben Elliston <bje@au.ibm.com>
3136
3137 * include/cpplib.h (NODE_CONDITIONAL): New.
3138 (struct cpp_callbacks): New macro_to_expand field.
3139 (struct cpp_hashnode): Adjust size of flags and type fields.
3140 (cpp_peek_token): Prototype.
3141 * lex.c (cpp_peek_token): New function.
3142 (_cpp_temp_token): Protect pre-existing lookaheads.
3143 * macro.c (cpp_get_token): Expand any conditional macros.
3144 (_cpp_backup_tokens_direct): New.
3145 (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
3146 (warn_of_redefinition): Silently allow redefined conditional
3147 macros.
3148 (_cpp_create_definition): Remove the conditional flag when a user
3149 defines one of the conditional macros.
3150 * internal.h (_cpp_backup_tokens_direct): New prototype.
3151
e85edc9e
AH
31522008-06-13 Andrew Haley <aph@redhat.com>
3153
3154 PR preprocessor/33305
3155 * macro.c (replace_args): Print a warning for empty macro
3156 arguments in C89 and C++.
3157
18c04407
RW
31582008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3159
3160 * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
3161 * configure: Regenerate.
3162
2d09b640
RW
31632008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3164
3165 * Makefile.in (datarootdir): New variable.
3166
0b7c73cc
L
31672008-06-12 H.J. Lu <hongjiu.lu@intel.com>
3168
3169 PR preprocessor/36479
3170 * charset.c (cpp_interpret_string_notranslate): Also set
3171 narrow_cset_desc.width.
3172
cd985f66
JM
31732008-06-07 Joseph Myers <joseph@codesourcery.com>
3174
3175 * configure.ac (parisc*64*-*-*): Remove.
3176 * configure: Regenerate.
3177
d750887f
TT
31782008-05-30 Tom Tromey <tromey@redhat.com>
3179
3180 PR preprocessor/36320:
3181 * internal.h (_cpp_parse_expr): Update.
3182 * expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error
3183 messages.
3184 * directives.c (do_if): Update.
3185 (do_elif): Require expression if processing group.
3186
c100de59
DS
31872008-05-30 Danny Smith <dannysmith@users.sourceforge.net>
3188
3189 * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
3190
5d6342eb
TT
31912008-05-21 Tom Tromey <tromey@redhat.com>
3192
3193 PR preprocessor/27777:
3194 * lex.c (cpp_output_line_to_string): New function.
3195 * internal.h (_cpp_begin_message): Don't declare.
3196 * errors.c (_cpp_begin_message): Now static.
3197 * include/cpplib.h (cpp_output_line_to_string): Declare.
3198 * directives.c (do_diagnostic): Rewrote. Use
3199 cpp_output_line_to_string. Don't use _cpp_begin_message.
3200
dae4174e
TT
32012008-05-21 Tom Tromey <tromey@redhat.com>
3202
3203 * include/symtab.h (HT_ALLOCED): Remove.
3204 (ht_purge): Declare.
3205 * symtab.c (DELETED): New define.
3206 (ht_lookup): Update comment.
3207 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED
3208 code. Use subobject allocator for strings, if it exists.
3209 (ht_expand): Handle deleted entries.
3210 (ht_forall): Likewise.
3211 (ht_purge): New function.
3212 (ht_dump_statistics): Print deletion statistics.
3213
899015a0
TT
32142008-05-13 Tom Tromey <tromey@redhat.com>
3215
3216 PR preprocessor/22168:
3217 * include/cpplib.h (struct cpp_options) <objc>: Update
3218 documentation.
3219 * expr.c (eval_token): Warn for use of assertions.
3220 * directives.c (directive_diagnostics): Warn about extensions.
3221 (DEPRECATED): New define.
3222 (DIRECTIVE_TABLE): Use it.
3223
71c10038
TT
32242008-05-06 Tom Tromey <tromey@redhat.com>
3225
3226 PR preprocessor/35313, PR preprocessor/36088:
3227 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
3228 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
3229
2bd0fe3d
DM
32302008-05-04 David S. Miller <davem@davemloft.net>
3231
3232 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
3233 * configure: Regenerate.
3234
28f68625
DF
32352008-04-22 Daniel Franke <franke.daniel@gmail.com>
3236
3237 * include/cpplib.h (cpp_define_formatted): New.
3238 * directives.c (cpp_define_formatted): New.
3239
688e7a53
TT
32402008-04-21 Tom Tromey <tromey@redhat.com>
3241
3242 PR libcpp/33415:
3243 * charset.c (_cpp_convert_input): Add buffer_start argument.
3244 Ignore UTF-8 BOM if seen.
3245 * internal.h (_cpp_convert_input): Add argument.
3246 * files.c (struct _cpp_file) <buffer_start>: New field.
3247 (destroy_cpp_file): Free buffer_start, not buffer.
3248 (_cpp_pop_file_buffer): Likewise.
3249 (read_file_guts): Update.
3250
b6baa67d
KVH
32512008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
3252
3253 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
3254 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
3255 (struct cpp_options): Added uliterals.
3256 (cpp_interpret_string): Update prototype.
3257 (cpp_interpret_string_notranslate): Idem.
3258 * charset.c (init_iconv_desc): New width member in cset_converter.
3259 (cpp_init_iconv): Add support for char{16,32}_cset_desc.
3260 (convert_ucn): Idem.
3261 (emit_numeric_escape): Idem.
3262 (convert_hex): Idem.
3263 (convert_oct): Idem.
3264 (convert_escape): Idem.
3265 (converter_for_type): New function.
3266 (cpp_interpret_string): Use converter_for_type, support u and U prefix.
3267 (cpp_interpret_string_notranslate): Match changed prototype.
3268 (wide_str_to_charconst): Use converter_for_type.
3269 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
3270 * directives.c (linemarker_dir): Macro U changed to UC.
3271 (parse_include): Idem.
3272 (register_pragma_1): Idem.
3273 (restore_registered_pragmas): Idem.
3274 (get__Pragma_string): Support CPP_STRING{16,32}.
3275 * expr.c (eval_token): Support CPP_CHAR{16,32}.
3276 * init.c (struct lang_flags): Added uliterals.
3277 (lang_defaults): Idem.
3278 * internal.h (struct cset_converter) <width>: New field.
3279 (struct cpp_reader) <char16_cset_desc>: Idem.
3280 (struct cpp_reader) <char32_cset_desc>: Idem.
3281 * lex.c (digraph_spellings): Macro U changed to UC.
3282 (OP, TK): Idem.
3283 (lex_string): Add support for u'...', U'...', u"..." and U"...".
3284 (_cpp_lex_direct): Idem.
3285 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
3286 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
3287
deb984e6
PB
32882008-04-18 Paolo Bonzini <bonzini@gnu.org>
3289
3290 PR bootstrap/35457
3291 * aclocal.m4: Regenerate.
3292 * configure: Regenerate.
3293
bf048bea
TT
32942008-04-17 Tom Tromey <tromey@redhat.com>
3295
3296 PR libcpp/34866:
3297 * errors.c (cpp_error): Don't reference a token before the start
3298 of the current run.
3299
7f27b0f8
TT
33002008-04-16 Tom Tromey <tromey@redhat.com>
3301
3302 * Makefile.in (TAGS_SOURCES): New variable.
3303 (TAGS): New target.
3304
a1fcb9a1
KK
33052008-04-11 Kaz Kojima <kkojima@gcc.gnu.org>
3306
3307 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
3308 and shbe-*-*.
3309 * configure: Rebuilt.
3310
93d45d9e
JM
33112008-04-02 Joseph Myers <joseph@codesourcery.com>
3312
3313 * include/cpplib.h (struct cpp_callbacks): Add used_define,
3314 used_undef and before_define.
3315 (NODE_USED): Define.
3316 * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
3317 do_ifndef, cpp_pop_definition): Handle new flag and use new
3318 callbacks.
3319 * expr.c (parse_defined): Handle new flag and use new callbacks.
3320 * macro.c (enter_macro_context, _cpp_free_definition): Handle new
3321 flag and use new callbacks.
3322
d4c32e1d
JJ
33232008-04-01 Jakub Jelinek <jakub@redhat.com>
3324
3325 PR pch/13675
3326 * files.c (struct _cpp_file): Remove pch field.
3327 (pch_open_file): Don't set file->pch, just file->pchname.
3328 (should_stack_file): After pfile->cb.read_pch call
3329 free pchname and clear pchname, don't close file->fd.
3330 Test file->pchname instead of file->pch. Don't close fd after cb.
3331 (_cpp_stack_include): Test file->pchname instead of file->pch.
3332
161031e3
TT
33332008-03-28 Tom Tromey <tromey@redhat.com>
3334
3335 * Makefile.in (POSTCOMPILE): New variable.
3336 (.c.o): Use it.
3337
14ccf800
TT
33382008-03-13 Tom Tromey <tromey@redhat.com>
3339
3340 PR libcpp/35322:
3341 * directives.c (destringize_and_run): Set pfile->directive.
3342
830465c6
MM
33432008-03-06 Markus Milleder <markus.milleder@generali.at>
3344
3345 PR preprocessor/35458
3346 * mkdeps.c (munge): Quote '#' with a '\'.
3347
d482a073
RW
33482008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3349
3350 PR preprocessor/35379
3351 * mkdeps.c (deps_write): Ensure the first target always appears
3352 in the first column, without leading backslash newline. Avoid
3353 some more extra whitespace.
3354
185a6cc1
TS
33552008-02-25 Thiemo Seufer <ths@mips.com>
3356
d482a073 3357 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
185a6cc1 3358
2bf41bf0
TT
33592008-02-19 Tom Tromey <tromey@redhat.com>
3360
3361 * traditional.c (lex_identifier): Use CPP_HASHNODE.
3362 * lex.c (lex_identifier): Use CPP_HASHNODE.
3363 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
3364 do-while.
3365 * identifiers.c (alloc_node): Change return type.
3366 (_cpp_init_hashtable): Don't cast 'alloc_node'.
3367 (proxy_assertion_broken): New declaration.
3368 (cpp_forall_identifiers): Move comment.
3369 * line-map.c (linemap_add): Comment fix.
3370 (linemap_line_start): Indentation fix.
3371
765d600a
JJ
33722008-01-25 Jakub Jelinek <jakub@redhat.com>
3373
3374 PR preprocessor/34692
3375 * macro.c (collect_args): Add pragma_buff argument. Push
3376 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
3377 than into arguments. Reset prevent_expansion and parsing_args
3378 state at CPP_PRAGMA_EOL/CPP_EOF.
3379 (funlike_invocation_p): Add pragma_buff argument, pass it through
3380 to collect_args.
3381 (enter_macro_context): Add result argument. Adjust
3382 funlike_invocation_p caller. Emit all deferred pragma tokens
3383 gathered during collect_args before the expansion, add a padding
3384 token. Return 2 instead of 1 if any pragma tokens were prepended.
3385 (cpp_get_token): If enter_macro_context returns 2, don't return
3386 a padding token, instead cycle to grab CPP_PRAGMA token.
3387 * directives.c (_cpp_handle_directive): If was_parsing_args
3388 in deferred pragma, leave parsing_args and prevent_expansion as is.
3389
ec46053b
TT
33902008-01-22 Tom Tromey <tromey@redhat.com>
3391
765d600a 3392 PR c++/34859
ec46053b
TT
3393 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
3394 __STDC_CONSTANT_MACROS.
3395
681c6ab0
FF
33962008-01-07 Fred Fish <fnf@specifix.com>
3397
765d600a 3398 PR preprocessor/30363
681c6ab0 3399 * traditional.c (replace_args_and_push): Add local variable
19a9ba64 3400 cxtquote, calculate the replacement text size assuming a
681c6ab0
FF
3401 worst case of every input character quoted with backslash,
3402 and properly handle output quoting of quote characters in
3403 actual arguments used in function-like macros.
3404
33ae4837
TT
34052008-01-03 Tom Tromey <tromey@redhat.com>
3406
765d600a 3407 PR preprocessor/34602
33ae4837
TT
3408 * directives.c (do_line): Don't try to spell EOF token.
3409 (do_linemarker): Add comment.
3410
675575f5
DD
34112007-12-11 DJ Delorie <dj@redhat.com>
3412
3413 * charset.c (convert_using_iconv): Close out any shift states,
3414 returning to the initial state.
3415
97f6bd40
TT
34162007-12-06 Tom Tromey <tromey@redhat.com>
3417
765d600a 3418 PR c/29172
97f6bd40
TT
3419 * internal.h (struct cpp_reader) <file_hash_entries>: Changed
3420 type.
3421 <file_hash_entries_allocated, file_hash_entries_used>: Removed.
3422 * files.c (FILE_HASH_POOL_SIZE): New macro.
3423 (struct file_hash_entry_pool): New.
3424 (destroy_all_cpp_files): New function.
3425 (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
3426 (new_file_hash_entry): Update.
3427 (free_file_hash_entries): New function.
3428 (_cpp_cleanup_files): Call free_file_hash_entries and
3429 destroy_all_cpp_files.
3430 (cpp_clear_file_cache): New function.
3431 * include/cpplib.h (cpp_clear_file_cache): Declare.
3432
d56a25e1
TT
34332007-12-03 Tom Tromey <tromey@redhat.com>
3434
765d600a 3435 PR preprocessor/34288
d56a25e1
TT
3436 * configure.ac, config.in: Rebuilt.
3437 * configure.ac: Check for ssize_t.
3438
607f74e9
TT
34392007-11-30 Tom Tromey <tromey@redhat.com>
3440
765d600a 3441 PR preprocessor/32868
607f74e9
TT
3442 * macro.c (_cpp_create_definition): Special case
3443 __STDC_FORMAT_MACROS.
3444
b0f4807f
MM
34452007-11-16 Michael Matz <matz@suse.de>
3446
3447 * files.c (search_path_head): Fix check for absolute paths.
3448
f1e20710
TT
34492007-11-11 Tom Tromey <tromey@redhat.com>
3450
765d600a 3451 PR c++/17557
f1e20710
TT
3452 * include/cpplib.h (cpp_included_before): Declare.
3453 * files.c (struct file_hash_entry) <location>: New field.
3454 (_cpp_find_file): Initialize new field.
3455 (make_cpp_dir): Likewise.
3456 (cpp_included_before): New function.
3457
f373b44d
TT
34582007-11-01 Tom Tromey <tromey@redhat.com>
3459
765d600a 3460 PR preprocessor/30805
f373b44d
TT
3461 * macro.c (paste_tokens): Handle padding token.
3462 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
3463
5b9a40df
TT
34642007-10-31 Tom Tromey <tromey@redhat.com>
3465
765d600a 3466 PR preprocessor/30786
5b9a40df
TT
3467 * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
3468 * directives.c (_cpp_do__Pragma): Return error status.
3469 * internal.h (_cpp_do__Pragma): Update.
3470 * directives.c (get__Pragma_string): Back up if EOF seen.
3471
5ffeb913
TT
34722007-09-06 Tom Tromey <tromey@redhat.com>
3473
3474 * internal.h (struct cpp_reader) <invocation_location>: New
3475 field.
3476 (struct cpp_reader) <set_invocation_location>: Likewise.
3477 * init.c (cpp_set_line_map): New function.
3478 * line-map.c (linemap_add): Use linemap's allocator.
3479 * include/line-map.h (GTY): Define.
3480 (line_map_realloc): New typedef.
3481 (struct line_map): Mark with GTY.
3482 (struct line_maps): Likewise.
3483 (struct line_maps) <maps>: Likewise.
3484 (struct line_maps) <reallocator>: New field.
3485 * include/symtab.h (GTY): Conditionally define.
3486 * include/cpplib.h (cpp_set_line_map): Declare.
3487 (cpp_get_token_with_location): Declare.
3488 * macro.c (cpp_get_token): Set invocation_location on the reader.
3489 (cpp_get_token_with_location): New function.
3490
ac6b1c67
CF
34912007-08-30 Chao-ying Fu <fu@mips.com>
3492
3493 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
3494 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
3495 (cpp_classify_number): Support decimal fixed-point constants without
3496 exponents.
3497 Warn about fixed-point constants when -pedantic.
3498 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
3499 comments to support fixed-point values.
3500 (CPP_N_FRACT, CPP_N_ACCUM): Define.
3501
cda5e672
TT
35022007-08-18 Tom Tromey <tromey@redhat.com>
3503
765d600a 3504 PR preprocessor/32974
cda5e672
TT
3505 * directives.c (parse_include): Don't check for EOL when
3506 processing #pragma dependency.
3507
ccfc4c91
OW
35082007-07-30 Ollie Wild <aaw@google.com>
3509
3510 * directives-only.c: New file.
3511 * internal.h (struct _cpp_dir_only_callbacks): New.
3512 (_cpp_preprocess_dir_only): New function.
3513 * directives.c (_cpp_handle_directive): Check directives_only before
3514 disabling execution of indented directives.
3515 * files.c (_cpp_stack_file): Add directives_only check.
3516 * include/cpplib.h (struct cpp_options): Add directives_only.
3517 (cpp_init_special_builtins): New function.
3518 * init.c (cpp_init_special_builtins): New function.
3519 (cpp_init_builtins): Move builtin_array initialization to
3520 cpp_init_special_builtins.
3521 (post_options): Check directives_only before setting
3522 pfile->state.prevent_expansion = 1.
3523 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
3524 is expanded inside a directive while -fdirectives-only is enabled.
3525 * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
3526 (libcpp_a_SOURCES): Add directives-only.c.
3527
a206413a
UB
35282007-07-04 Uros Bizjak <ubizjak@gmail.com>
3529
3530 * traditional.c (_cpp_scan_out_logical_line): Initialize
3531 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
3532 fmacro.args to prevent 'may be used uninitialized' warning.
3533
c77cd3d1
UB
35342007-07-03 Uros Bizjak <ubizjak@gmail.com>
3535
3536 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
3537 Add new constants.
3538 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
3539 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
3540 for 'q' or 'Q' suffixes.
3541
66938a1d
DS
35422007-06-17 Danny Smith <dannysmith@users.sourceforge.net
3543
e1311401 3544 * files.c (open_file): Correct typo.
66938a1d 3545
71995ede
VP
35462007-06-16 Vladimir Prus <vladimir@codesourcery.com>
3547
e1311401 3548 * files.c (open_file): Prevent the call
71995ede
VP
3549 for stat from overwriting errno.
3550
84152c25
VP
35512007-06-09 Vladimir Prus <vladimir@codesourcery.com>
3552
e1311401 3553 * files.c (open_file): Account for the
19a9ba64
AM
3554 fact that on windows, opening a directory gives
3555 EACCES.
84152c25 3556
f7fd775f
JW
35572007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
3558
3559 PR preprocessor/23479
3560 * expr.c (cpp_classify_number): Implement 0b-prefixed binary
3561 integer constants.
3562 (append_digit): Likewise.
3563 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
3564 binary integer constants.
3565
ed0e74e0
DK
35662007-05-31 Dave Korn <dave.korn@artimi.com>
3567
3568 PR preprocessor/14331
3569 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
3570
a702045a
OW
35712007-05-24 Ollie Wild <aaw@google.com>
3572
3573 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
3574 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
3575 (cpp_write_pch_state): Save __COUNTER__ state.
3576 (cpp_valid_state): Check valid __COUNTER__ state.
3577 (cpp_read_state): Read new __COUNTER__ state.
3578 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
3579 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
3580 * internal.h (struct cpp_reader): Add counter member.
3581
126e073b
SM
35822007-05-23 Simon Martin <simartin@users.sourceforge.net>
3583
3584 PR preprocessor/20077
3585 * macro.c (create_iso_definition): Fixed the method to determine
3586 whether the token-pasting operator appears at the beginning or the end
3587 of a macro.
3588
0b4cafec
ILT
35892007-05-21 Ian Lance Taylor <iant@google.com>
3590
3591 * internal.h (struct cpp_reader): Add new fields:
3592 nonexistent_file_hash and nonexistent_file_ob.
3593 * files.c: Include "obstack.h".
3594 (find_file_in_dir): Before trying to open the file, look up the
3595 path name in the hash table of nonexistent files. After failing
3596 to open the file, add the path name to the hash table.
3597 (_cpp_find_file): Cache the results of looking up the file name
3598 starting with the quote and bracket chain heads, if we can.
3599 (nonexistent_file_hash_eq): New static function.
3600 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
3601 pfile->nonexistent_file_ob.
3602 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
3603 pfile->nonexistent_file_ob.
3604
30e04921
JJ
36052007-05-14 Janis Johnson <janis187@us.ibm.com>
3606
19a9ba64 3607 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
5a6bb57e 3608
30e04921
JJ
3609 PR c/31924
3610 * expr.c (interpret_float_suffix): Check for invalid suffix.
3611
22a8a52d
EC
36122007-05-02 Eric Christopher <echristo@apple.com>
3613
3614 * expr.c (num_div_op): Don't overflow if the result is
3615 zero.
3616
fca35e1b
TT
36172007-05-02 Tom Tromey <tromey@redhat.com>
3618
765d600a 3619 PR preprocessor/28709
fca35e1b
TT
3620 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
3621
4cd97075
MM
36222007-03-30 Michael Meissner <michael.meissner@amd.com>
3623
3624 * directives.c (lex_macro_node_from_str): Fix alloca call to be
3625 type correct.
3626
121de39f
RH
36272007-03-30 Richard Henderson <rth@redhat.com>
3628
3629 * directives.c (lex_macro_node_from_str): New.
3630 (cpp_push_definition, cpp_pop_definition): New.
3631 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
3632
4fcb360b
BM
36332007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
3634
3635 * Makefile.in: Add dummy install-pdf target.
3636
67e64439
TT
36372007-01-30 Tom Tromey <tromey@redhat.com>
3638
765d600a 3639 PR preprocessor/30468
67e64439
TT
3640 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
3641 './'.
3642
ee380365
TT
36432007-01-30 Tom Tromey <tromey@redhat.com>
3644
765d600a 3645 PR preprocessor/29966
ee380365
TT
3646 * macro.c (lex_expansion_token): Save and restore cpp_reader's
3647 cur_token.
3648 (_cpp_create_definition): Don't restore cur_token here.
3649 * lex.c (_cpp_lex_token): Added assertion.
3650
024abeb3
TT
36512007-01-27 Tom Tromey <tromey@redhat.com>
3652
3653 * configure: Rebuilt.
3654
ee1c2a10
TT
36552007-01-12 Tom Tromey <tromey@redhat.com>
3656
765d600a 3657 PR preprocessor/28227
ee1c2a10
TT
3658 * directives.c (lex_macro_node): Added 'is_def_or_undef'
3659 argument.
3660 (do_define): Update.
3661 (do_undef): Update.
3662 (do_ifdef): Update.
3663 (do_ifndef): Update.
3664
67214c16
PB
36652007-01-11 Paolo Bonzini <bonzini@gnu.org>
3666
3667 * configure: Regenerate.
3668
1aa6ca40
PB
36692007-01-11 Paolo Bonzini <bonzini@gnu.org>
3670
3671 * configure: Regenerate.
3672
705e2d28
TT
36732007-01-04 Tom Tromey <tromey@redhat.com>
3674
765d600a 3675 PR preprocessor/28165
705e2d28
TT
3676 * internal.h (cpp_in_primary_file): New function.
3677 * directives.c (do_include_next): Use cpp_in_primary_file.
3678 (do_pragma_once): Likewise.
3679 (do_pragma_system_header): Likewise.
3680
7af45bd4
ILT
36812006-12-29 Ian Lance Taylor <iant@google.com>
3682
3683 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
3684 look backward at the end of the line unless we saw a backslash.
3685
9d30f270
JJ
36862006-12-29 Jakub Jelinek <jakub@redhat.com>
3687
3688 PR preprocessor/29612
3689 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
3690 only when new_sysp is non-zero.
3691
30b0edc0
TT
36922006-12-28 Tom Tromey <tromey@redhat.com>
3693
765d600a 3694 PR preprocessor/30001
30b0edc0
TT
3695 * charset.c (_cpp_convert_input): Check that to.len is greater
3696 than zero.
3697
85d9c13c
TS
36982006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
3699
3700 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
83cc06b2 3701 * configure: Rebuilt.
85d9c13c 3702
dfafdaa6
DG
37032006-11-01 Douglas Gregor <doug.gregor@gmail.com>
3704
3705 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
3706 for experimental C++0x mode.
3707 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
3708 adopted the preprocessor changes introduced in C99.
3709
0f45f0f5
JM
37102006-10-29 Joseph Myers <joseph@codesourcery.com>
3711
3712 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
3713 depending on --enable-targets=all.
3714 * configure: Regenerate.
3715
de000d22
JJ
37162006-10-12 Jakub Jelinek <jakub@redhat.com>
3717
3718 PR preprocessor/28709
3719 * macro.c (paste_tokens): Do error reporting here, use BUF with the
3720 spelled LHS token as opposed to spelling it again.
3721 (paste_all_tokens): Don't report errors here, just break on failure.
3722
b5422ad7
BM
37232006-10-10 Brooks Moses <bmoses@stanford.edu>
3724
3725 * Makefile.in: Added empty "pdf" target.
3726
aaf50ff2
GK
37272006-09-22 Geoffrey Keating <geoffk@apple.com>
3728
3729 * configure.ac: Make need_64_bit_hwint case for x86-darwin
3730 match exactly the glob in gcc/config.gcc.
3731 * configure: Regenerate.
3732
c663e301
JM
37332006-09-13 Joseph S. Myers <joseph@codesourcery.com>
3734
3735 PR c/28768
3736 PR preprocessor/14634
3737 * lex.c (lex_string): Pedwarn for unterminated literals.
3738
f7288899
EC
37392006-09-08 Eric Christopher <echristo@apple.com>
3740
3741 * configure.ac: Add 64-bit HWI support for i?86-darwin.
3742
b52dbbf8
SE
37432006-08-14 Steve Ellcey <sje@cup.hp.com>
3744
3745 PR c++/28288
3746 PR c++/14556
3747 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
3748 (CPP_LAST_EQ): Change.
3749 (CPP_LAST_PUNCTUATOR): Change.
3750 * expr.c (cpp_operator): Remove MIN and MAX.
3751 (reduce): Remove CPP_MIN and CPP_MAX.
3752 (num_binary_op): Ditto.
3753 * lex.c (_cpp_lex_direct): Ditto.
3754 (cpp_avoid_paste): Remove ? as legal symbol after > or <.
3755
1c90c6f9
JJ
37562006-06-09 Jakub Jelinek <jakub@redhat.com>
3757
3758 PR preprocessor/27746
3759 * directives.c (do_pragma): Handle pragma with valid namespace
3760 and invalid name coming from macro expansion.
3761 * directives.c (destringize_and_run): Initialize next field in
3762 context.
3763
3764 PR c/27747
3765 PR c++/27748
3766 * directives.c (destringize_and_run): Set NO_EXPAND on the
3767 tokens.
3768
3769 * macro.c (_cpp_backup_tokens): Fix comment typo.
3770
5c3c3683
DJ
37712006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
3772
3773 * Makefile.in (CATALOGS): Add po/ prefix.
3774 * configure: Regenerated.
3775
b2bd74bc
CD
37762006-05-23 Carlos O'Donell <carlos@codesourcery.com>
3777
3778 * Makefile.in: Add install-html target. Add install-html to .PHONY
3779
be8ac3e2
GZ
37802006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
3781
3782 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
3783 * files.c (_cpp_get_file_stat): New function.
3784 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
3785 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
3786 * internal.h (_cpp_get_file_stat): Prototype.
3787 (struct cpp_buffer): Add timestamp.
3788
83900997
JJ
37892006-01-23 Jakub Jelinek <jakub@redhat.com>
3790
3791 PR preprocessor/25717
3792 * init.c (cpp_init_builtins): If __STDC__ will not change value
3793 between system headers and other sources, define it as a normal
3794 macro rather than a builtin.
3795 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
3796 cpp_in_system_header condition.
3797
37982006-01-05 Paolo Bonzini <bonzini@gnu.org>
9220c30c
PB
3799
3800 * Makefile.in: Use -MMD instead of -MD.
3801
bc4071dd
RH
38022006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
3803 Richard Henderson <rth@redhat.com>
3804
3805 Merge from gomp branch:
3806 * directives.c (struct pragma_entry): Add is_deferred. Add ident
3807 entry to value union.
3808 (end_directive): Don't eat the line if in_deferred_pragma.
3809 (run_directive): Remove pragma hacks.
3810 (insert_pragma_entry): Remove.
3811 (new_pragma_entry): New.
3812 (register_pragma_1): Split out of register_pragma. Only handle
3813 the lookup tree and return the new entry.
3814 (cpp_register_pragma): Fill in the pragma entry here.
3815 (cpp_register_deferred_pragma): New.
3816 (register_pragma_internal): New.
3817 (_cpp_init_internal_pragmas): Use register_pragma_internal.
3818 (do_pragma): Allow pragma expansion after namespace. For deferred
3819 pragmas, don't slurp the line into a string.
3820 (destringize_and_run): Save tokens for deferred pragmas.
3821 (cpp_handle_deferred_pragma): Remove.
3822 * macro.c (builtin_macro): Remove pragma token hack.
3823 (_cpp_push_token_context): Rename from push_token_context and export.
3824 * internal.h (struct lexer_state): Add pragma_allow_expansion.
3825 (_cpp_push_token_context): Declare.
3826 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
3827 a token. Update the line number correctly if so.
3828 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
3829 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
3830 * include/cpplib.h (PRAGMA_EOL): New.
3831 (CPP_TOKEN_FLD_PRAGMA): New.
3832 (struct cpp_token): Add val.pragma.
3833 (struct cpp_options): Remove defer_pragmas.
3834 (cpp_handle_deferred_pragma): Remove.
3835 (cpp_register_deferred_pragma): Declare.
3836
d09e893f
JJ
38372006-01-01 Jakub Jelinek <jakub@redhat.com>
3838
3839 PR c++/25294
3840 * directives.c (do_pragma): If pragma line ends with multi-line
3841 block comment, end the saved deferred pragma string before that
3842 comment. Handle embedded '\0' chars on the pragma line.
3843
ab84748a
VR
38442005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
3845
3846 PR c++/23333
3847 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
3848
ad6ed77e
JG
38492005-12-07 Jon Grimm <jgrimm2@us.ibm.com>
3850 Ben Elliston <bje@au.ibm.com>
3851
3852 * include/cpplib.h (CPP_N_DFLOAT): New.
3853 * expr.c (interpret_float_suffix): Identify df, dd, and dl
3854 suffixes as decimal floating point constants.
3855 (cpp_classify_number): Disallow hexadecimal DFP constants.
3856
ba096620 38572005-11-14 Gerald Pfeifer <gerald@pfeifer.com>
bc4071dd 3858 Ian Lance Taylor <ian@airs.com>
ba096620
GP
3859
3860 * include/cpplib.h (struct cpp_callbacks): Annotate error with
3861 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
3862
456b8ce5
UB
38632005-11-09 Per Bothner <per@bothner.com>
3864 Uros Bizjak <uros@kss-loka.si>
f7288899 3865
456b8ce5
UB
3866 PR c/24101
3867 * init.c (read_original_filename): Temporarily set
3868 state.in_directive before calling _cpp_lex_direct for
3869 CPP_HASH tokens.
3870
5571f74f
JW
38712005-11-03 James E Wilson <wilson@specifix.com>
3872
3873 PR preprocessor/24202
3874 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
3875
a63607ed
JM
38762005-11-04 Joseph S. Myers <joseph@codesourcery.com>
3877
3878 * include/cpplib.h (struct cpp_callbacks): Make error take
3879 va_list* parameter.
3880 * errors.c (cpp_error): Update call to callback.
3881
651ed942
AP
38822005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
3883
3884 PR preprocessor/22042
3885 * macro.c (_cpp_builtin_macro_text): Lower the needed max
3886 buffer size.
3887 (cpp_quote_string): Don't octalify non printable
3888 charactors.
3889
178b58b5
JM
38902005-11-03 Joseph S. Myers <joseph@codesourcery.com>
3891
3892 PR c++/17964
3893 * include/cpplib.h (struct cpp_options): Add client_diagnostic.
3894 (struct cpp_callbacks): Add error.
3895 * errors.c (cpp_error): If client_diagnostic, use error callback.
3896 * charset.c (convert_escape): Don't use %03o in diagnostic.
3897
3ee5ed11 38982005-10-21 James E Wilson <wilson@specifix.com>
6568f34b
JW
3899
3900 PR preprocessor/15220
3901 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all
3902 callers. Pass to open_file_failed.
3903 (open_file_failed): New parameter angle_brackets. Fix all callers.
3904 Use in print_dep assignment.
3905 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
3906 * internal.h (_cpp_find_file): Add new parm to declaration.
f7288899 3907
077fc835
KH
39082005-10-08 Kazu Hirata <kazu@codesourcery.com>
3909
3910 * configure.ac: Require 64-bit int for arm*-*-*eabi*.
3911 * configure: Regenerate.
3912
cbc43ae0
ILT
39132005-10-04 Ian Lance Taylor <ian@airs.com>
3914
3915 PR preprocessor/13726
3916 * directives.c (check_eol_return_comments): New static function.
3917 (parse_include): Add buf parameter. Change all callers.
3918 (do_include_common): If not discard comments, turn on
3919 save_comments. Pass collected comments to include callback.
3920 * include/cpplib.h (struct cpp_callbacks): Add new parameter to
3921 include callback: cpp_token list.
3922
af15a2fe
JM
39232005-09-20 Joseph S. Myers <joseph@codesourcery.com>
3924
3925 * include/cpplib.h (struct cpp_options): Add extended_identifiers.
3926 * init.c (struct lang_flags, lang_defaults): Add
3927 extended_identifiers.
3928 (cpp_set_lang): Use it.
3929 * lex.c (forms_identifier_p): Check extended_identifiers.
3930
f5eab47e
JJ
39312005-08-30 Jakub Jelinek <jakub@redhat.com>
3932
3933 PR preprocessor/20348
3934 PR preprocessor/20356
3935 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
3936 2004-06-05 changes.
3937
467129e6
KG
39382005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3939
3940 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
3941 -Wmissing-format-attribute.
3942
3943 * configure: Regenerate.
3944
200031d1
KC
39452005-06-29 Kelley Cook <kcook@gcc.gnu.org>
3946
3947 * all files: Update FSF address in copyright headers.
3948 * makeucnid.c (write_copyright): Update outputted FSF address.
3949
f610dd5f
ZW
39502005-06-13 Zack Weinberg <zack@codesourcery.com>
3951
3952 * configure.ac: Invoke ZW_CREATE_DEPDIR and
3953 ZW_PROG_COMPILER_DEPENDENCIES.
3954 * aclocal.m4, configure: Regenerate.
3955 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
3956 New variables.
3957 (distclean): Clean up $(DEPDIR) and its contents.
3958 (.c.o): Use $(COMPILE).
3959 Include $(DEPDIR)/*.Po for most object->header dependencies.
3960
c3f829c1
GDR
39612005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
3962
3963 * configure.ac: Check declarations for asprintf and vasprintf.
3964 * config.in: Regenerate.
3965 * configure: Likewise.
3966
3967 * charset.c (conversion_loop): Use XRESIZEVEC.
3968 (convert_no_conversion): Likewise.
3969 (convert_using_iconv): Likewise.
3970 (init_iconv_desc): Cast return value of alloca.
3971 (cpp_host_to_exec_charset): Use XNEWVEC.
3972 (emit_numeric_escape): Use XRESIZEVEC.
3973 (cpp_interpret_string): Use XNEWVEC.
3974 (cpp_interpret_string): Use XRESIZEVEC.
3975 (_cpp_interpret_identifier): Cast return value of alloca.
3976 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
3977 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
3978 (parse_include): Use XNEWVEC.
3979 (insert_pragma_entry): Rename local variable "new" to
f610dd5f 3980 "new_entry".
c3f829c1
GDR
3981 (save_registered_pragmas): Cast return value of xmemdup.
3982 (destringize_and_run): Same for alloca.
3983 (parse_assertion): Likewise.
3984 (do_assert): Cast allocated storage to proper type.
3985 (cpp_define): Likewise.
3986 (_cpp_define_builtin): Likewise.
3987 (cpp_undef): Likewise.
3988 (handle_assertion): Likewise.
3989 (cpp_push_buffer): Rename local variable "new" to "new_buffer".
3990 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
3991 (CPP_UMINUS): Likewise.
3992 (struct cpp_operator): Rename from struct operator.
3993 (_cpp_expand_op_stack): Use XRESIZEVEC.
3994 * files.c (pch_open_file): Use XNEWVEC.
3995 (pch_open_file): Use XRESIZEVEC.
3996 (read_file_guts): Use XNEWVEC and XRESIZEVEC.
3997 (dir_name_of_file): Use XNEWVEC.
3998 (make_cpp_file): Use XCNEW.
3999 (make_cpp_dir): Likewise.
4000 (allocate_file_hash_entries): USE XNEWVEC.
4001 (cpp_included): Cast return value of htab_find_with_hash.
4002 (append_file_to_dir): Use XNEWVEC.
4003 (read_filename_string): Likewise. Use XRESIZEVEC too.
4004 (read_name_map): Cast return value of alloca. Use XRESIZEVEC.
4005 (remap_filename): Use XNEWVEC.
4006 (struct pchf_entry): Move definition out of struct pchf_data.
4007 (_cpp_save_file_entries): Use XCNEWVAR.
4008 (_cpp_read_file_entries): Use XNEWVAR.
4009 * identifiers.c (alloc_node): Use XOBNEW.
4010 * init.c (cpp_create_reader): Use XCNEW.
4011 (cpp_init_builtins): Cast of b->value to enum builtin_type.
4012 (read_original_directory): Cast return value of alloca.
4013 * lex.c (add_line_note): Use XRESIZEVEC.
4014 (warn_about_normalization): Use XNEWVEC.
4015 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
4016 (new_buff): Use XNEWVEC.
4017 * line-map.c (linemap_add): Use XRESIZEVEC.
4018 * macro.c (builtin_macro): Cast return value of alloca.
4019 (paste_tokens): Likewise.
4020 (expand_arg): Use XNEWVEC and XRESIZEVEC.
4021 (_cpp_save_parameter): Use XRESIZEVEC.
4022 (create_iso_definition): Cast allocated storage to proper type.
4023 (_cpp_create_definition): Likewise.
4024 (cpp_macro_definition): Use XRESIZEVEC.
4025 * makedepend.c (add_clm): Use XNEW.
4026 (add_dir): Likewise.
4027 * mkdeps.c (munge): Use XNEWVEC.
4028 (deps_init): Use XCNEW.
4029 (deps_add_target): Use XRESIZEVEC.
4030 (deps_add_default_target): Cast return value of alloca.
4031 (deps_add_dep): Use XRESIZEVEC.
4032 (deps_add_vpath): Likewise. Use XNEWVEC too.
4033 (deps_restore): Likewise.
4034 * pch.c (save_idents): Use XNEW and XNEWVEC.
4035 (cpp_save_state): Use XNEW.
4036 (count_defs): Cast return value of htab_find.
4037 (write_defs): Likewise.
4038 (cpp_write_pch_deps): Use XNEWVEC.
4039 (collect_ht_nodes): Use XRESIZEVEC.
4040 (cpp_valid_state): Use XNEWVEC.
4041 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup.
4042 * symtab.c (ht_create): Use XCNEW.
4043 (ht_lookup_with_hash): Cast return value of obstack_copy0.
4044 (ht_expand): Use XCNEWVEC.
4045 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
4046 (bool): Do not define if __cplusplus.
4047
1ed17cd5
ZW
40482005-05-12 Zack Weinberg <zack@codesourcery.com>
4049
4050 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
4051 (do_sccs): Delete function definition, #define to do_ident.
4052 (do_ident): Don't hardwire directive name.
4053
5a8c20ce
RK
40542005-05-12 Ryota Kunisawa <kunisawa@access.co.jp>
4055
4056 PR bootstrap/21230
4057 * configure: Regenerate.
4058
473c5bc9
AP
40592005-04-27 Andris Pavenis <pavenis@latnet.lv>
4060
4061 * files.c: Include io.h for DJGPP to get prototype of setmode.
4062
c1fc5047
PB
40632005-04-19 Per Bothner <per@bothner.com>
4064
4065 PR preprocessor/20907
4066 * line-map.c (linemap_line_start): Fix bug when we need to increse
4067 column_bits but can re-use the current line_map.
4068
042630ad
KG
40692005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4070
4071 * system.h (fopen, fdopen, freopen): Define these to the unlocked
4072 libiberty functions.
4073
0d667716
KG
40742005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4075
4076 * configure.ac (libcpp_UNLOCKED_FUNCS): New.
4077 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
4078 * system.h (putchar, getc, getchar, clearerr, feof, fileno,
4079 fflush, fgetc, fgets, ferror, fread): Redefine to the associated
4080 _unlocked function.
4081 (fwrite_unlocked): Fix prototype.
1ed17cd5 4082
0d667716
KG
4083 * configure, config.in: Regenerate.
4084
cae064e7
JJ
40852005-04-05 Jakub Jelinek <jakub@redhat.com>
4086
4087 PR preprocessor/19475
4088 * macro.c (create_iso_definition): For < ISO C99, don't
4089 pedwarn if there is no whitespace between macro name and its
4090 replacement, but the replacement starts with a basic character
4091 set character.
4092
cbada204
AJ
40932005-03-28 Andreas Jaeger <aj@suse.de>
4094
4095 * lex.c (warn_about_normalization): Cast field width to int to
4096 avoid warning.
4097
f42eccdb
JM
40982005-03-19 Joseph S. Myers <joseph@codesourcery.com>
4099
4100 * configure.ac: Consistently use solaris2.1[0-9]* instead of
4101 solaris2.1[0-9].
4102 * configure: Regenerate.
4103
c79e602b
GK
41042005-03-15 Geoffrey Keating <geoffk@apple.com>
4105
4106 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
4107 UCN rather than printing an error.
4108
50668cf6
GK
41092005-03-14 Geoffrey Keating <geoffk@apple.com>
4110
6baba9bb
GK
4111 * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
4112
41132005-03-14 Geoffrey Keating <geoffk@apple.com>
1ed17cd5 4114
50668cf6
GK
4115 * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
4116 * charset.c: Update for new format of ucnid.h.
4117 (ucn_valid_in_identifier): Update for new format of ucnid.h.
4118 Add NST parameter, and update it; update callers.
4119 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort
4120 with cpp_error.
4121 (convert_ucn): Pass normalize_state to cpp_valid_ucn.
4122 * internal.h (struct normalize_state): New.
4123 (INITIAL_NORMALIZE_STATE): New.
4124 (NORMALIZE_STATE_RESULT): New.
4125 (NORMALIZE_STATE_UPDATE_IDNUM): New.
4126 (_cpp_valid_ucn): New.
4127 * lex.c (warn_about_normalization): New.
4128 (forms_identifier_p): Add normalize_state parameter, update callers.
4129 (lex_identifier): Add normalize_state parameter, update callers. Keep
4130 the state current.
4131 (lex_number): Likewise.
4132 (_cpp_lex_direct): Pass normalize_state to subroutines. Check
4133 it with warn_about_normalization.
4134 * makeucnid.c: New.
4135 * ucnid.h: Replace.
4136 * ucnid.pl: Remove.
4137 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove
4138 comments about obsolete version of C++.
4139 * include/cpplib.h (enum cpp_normalize_level): New.
4140 (struct cpp_options): Add warn_normalize field.
4141
47e20491
GK
41422005-03-11 Geoffrey Keating <geoffk@apple.com>
4143
4144 * directives.c (glue_header_name): Update call to cpp_spell_token.
4145 * internal.h (_cpp_interpret_identifier): New.
4146 * charset.c (_cpp_interpret_identifier): New.
4147 (_cpp_valid_ucn): Allow UCN version of '$'.
4148 * lex.c (lex_identifier): Add extra parameter to indicate if initial
4149 character was '$' or '\'. Support identifiers with UCNs.
4150 (forms_identifier_p): Allow UCNs.
4151 (_cpp_lex_direct): Pass extra parameter to lex_identifier.
4152 (utf8_to_ucn): New.
4153 (cpp_spell_token): Add FORSTRING parameter. Use it.
4154 (cpp_token_as_text): Update call to cpp_spell_token.
4155 (cpp_output_token): Write UCNs back out.
4156 (stringify_arg): Update call to cpp_spell_token.
4157 (paste_tokens): Likewise.
4158 (cpp_macro_definition): Likewise.
4159 * macro.c (stringify_arg): Likewise.
4160 (paste_tokens): Likewise.
4161 (cpp_macro_definition): Likewise.
4162 * include/cpplib.h: Add parameter to cpp_spell_token.
4163
73096711
JJ
41642005-03-04 Jakub Jelinek <jakub@redhat.com>
4165
4166 PR bootstrap/20282
4167 PR bootstrap/20305
4168 * macro.c (replace_args, cpp_get_token): Copy whole
4169 cpp_token_u instead of just cpp_string field from it.
4170
2203a881
DP
41712005-02-28 Devang Patel <dpatel@apple.com>
4172
4173 * directives.c (do_line): Save sysp early before line table is
4174 realloc'ed.
1ed17cd5 4175
c5ff069d
ZW
41762005-02-20 Zack Weinberg <zack@codesourcery.com>
4177
4178 PR 18785
4179 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
4180 (cpp_host_to_exec_charset): New function.
4181 * include/cpplib.h: Declare cpp_host_to_exec_charset.
4182
04c90eea
DP
41832005-02-19 Devang Patel <dpatel@apple.com>
4184
4185 * charset.c (_cpp_convert_input): Check '\r' before inserting
4186 '\n' at the end.
c5ff069d 4187
6da55c00
EC
41882005-02-15 Eric Christopher <echristo@redhat.com>
4189
4190 PR preprocessor/19077
4191 * macro.c (cpp_macro_definition): Move handling of whitespace
4192 to PREV_WHITE conditional. Remove overloading of len
4193 variable.
4194
31c3e631
KH
41952005-02-14 Kazu Hirata <kazu@cs.umass.edu>
4196
4197 * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
4198 traditional.c: Update copyright.
4199
be0f1e54
PB
42002005-02-14 Paolo Bonzini <bonzini@gnu.org>
4201
4202 PR bootstrap/19818
4203 * configure.ac: Check for declaration of basename and getopt.
4204 * config.in: Regenerate.
4205 * configure: Regenerate.
4206 * internal.h (ustrcspn): New.
4207 * macro.c (create_iso_definition): Fix allocation of memory.
4208 (padding_token): Add cast to remove const-ness.
4209 * pch.c (cpp_read_state): Use ustrcspn.
4210
ecddfb39
MS
42112005-02-08 Mike Stump <mrs@apple.com>
4212
4213 * files.c (pchf_adder): Remove.
4214 (struct pchf_adder_info): Likewise.
4215 (_cpp_save_file_entries): Write out all files so that #import works.
4216
9fcdd891
JM
42172005-01-23 Joseph S. Myers <joseph@codesourcery.com>
4218
4219 * configure: Regenerate.
4220
ecfd72e7
TS
42212005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
4222
4223 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
4224
6c25a4f7 4225 * include/cpplib.h: Also update copyright years.
c5ff069d 4226
942926ad
GK
42272005-01-03 Geoffrey Keating <geoffk@apple.com>
4228
4229 * files.c (_cpp_find_file): Add files found by search_path_exhausted
4230 to the list of all files.
4231
a2566ae9
GDR
42322005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
4233
4234 * internal.h: Update references to Cpp lib filenames.
4235 * directives.c: Likewise.
4236 * init.c: Likewise.
4237 * macro.c: Likewise.
4238 * traditional.c: Likewise.
4239
1b449375
EB
42402004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
4241
4242 PR preprocessor/15167
4243 * files.c (destroy_cpp_file): New function.
4244 (should_stack_file): Make a new file if the
4245 compared file is still stacked.
4246
28303828
NN
42472004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
4248
c5ff069d 4249 PR preprocessor/17610
28303828
NN
4250 * directives.c (do_include_common): Error out if an empty filename
4251 is given for #include (or #include_next or #import).
4252
c812785a
RS
42532004-11-27 Roger Sayle <roger@eyesopen.com>
4254 Zack Weinberg <zack@codesourcery.com>
4255
4256 * internal.h: Replace all uses of uchar with unsigned char.
4257 * include/cpp-id-data.h: Likewise. Guard typedef of uchar
4258 with !IN_GCC, so uchar is only defined whilst building libcpp.
4259
f91eaa01
KC
42602004-11-24 Kelley Cook <kcook@gcc.gnu.org>
4261
4262 * aclocal.m4: Regenerate.
4263
f78ce0c2
RS
42642004-11-24 Roger Sayle <roger@eyesopen.com>
4265
4266 PR preprocessor/15824
4267 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
4268 directly, instead of the non-existant "system.h" and "ansidecl.h".
4269 * configure: Regenerate.
4270
b5b3e36a 42712004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
c5ff069d 4272 Joseph Myers <joseph@codesourcery.com>
b5b3e36a
DJ
4273
4274 * internal.h (struct lexer_state): Add in_deferred_pragma.
4275 * directives.c (struct pragma_entry): Add allow_expansion.
4276 (insert_pragma_entry): Take allow_expansion flag.
4277 (register_pragma): Likewise.
4278 (cpp_register_pragma): Likewise.
4279 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
4280 (do_pragma): Honor allow_expansion.
4281 (cpp_handle_deferred_pragma): Set in_deferred_pragma.
4282 * include/cpplib.h (cpp_register_pragma): Update prototype.
4283
a8e68029 42842004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
c5ff069d 4285 Mark Mitchell <mark@codesourcery.com>
a8e68029
DJ
4286
4287 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
4288 need_64bit_hwint=yes.
4289 * configure: Regenerate.
4290
50f47ee0
JM
42912004-11-09 Joseph S. Myers <joseph@codesourcery.com>
4292
4293 * Makefile.in ($(PACKAGE).pot): New rule. Depend on
4294 po/$(PACKAGE).pot.
4295 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
4296 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
4297 Remove local srcdir path from generated file.
4298
968e08d6 42992004-11-04 Zack Weinberg <zack@codesourcery.com>
c5ff069d 4300 Gerald Pfeifer <gerald@pfeifer.com>
968e08d6
ZW
4301
4302 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
4303 as well.
4304
3da3d587
ZW
43052004-10-27 Zack Weinberg <zack@codesourcery.com>
4306
4307 PR 18075
4308 * directives.c (do_pragma): Do not defer pragmas which are unknown.
4309 (cpp_handle_deferred_pragma): Add cast to silence warning.
4310
ac24fc25
JM
43112004-10-14 Joseph S. Myers <jsm@polyomino.org.uk>
4312
4313 * errors.c (_cpp_begin_message): Print "error: " for errors.
4314
7731405b
AJ
43152004-10-10 Andreas Jaeger <aj@suse.de>
4316
4317 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
4318 * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
4319
646544e3
AP
43202004-10-08 Andrew Pinski <pinskia@physics.uc.edu>
4321
4322 * pch.c (cpp_write_pch_state): Remove variable z as it is not
4323 used.
4324 (cpp_read_state): Remove unused variables, m, d and mac_count.
4325
67a74146
PB
43262004-09-29 Per Bothner <per@bothner.com>
4327
4328 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore
4329 cb.line_change. Otherwise do_pragma will call the line_change
4330 call-back with a meaningless line number.
4331
018a4785
ZW
43322004-09-24 Zack Weinberg <zack@codesourcery.com>
4333
4334 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
4335 programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
4336 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
4337 * aclocal.m4, configure: Regenerate.
4338 * init.c: Include localedir.h.
4339 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
4340 (DEFS): Delete.
4341 (.c.o): Use $(ALL_CFLAGS).
4342 (localedir.h, localedir.hs): New rules.
4343 (clean): Use rm -rf to remove directories.
4344 (distclean): Also delete localedir.h and localedir.hs.
4345 (init.o): Update dependencies.
4346
88fa57d7
KC
43472004-09-22 Kelley Cook <kcook@gcc.gnu.org>
4348
4349 * Makefile.in (aclocal.m4): Update dependencies.
4350 * configure.ac (AC_CONFIG_MACRO_DIR): New.
4351 * aclocal.m4, configure: Regenerate.
4352
8f8e9aa5
ZW
43532004-09-17 Zack Weinberg <zack@codesourcery.com>
4354
a29f62d9
ZW
4355 * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
4356 (_cpp_convert_input, _cpp_default_encoding): Add comments.
4357 Some other comments in this file also tweaked.
4358
8f8e9aa5
ZW
4359 * directives.c (do_pragma): Save current buffer position
4360 before lexing the pragma keywords; don't call
4361 _cpp_backup_tokens in the defer_pragmas case.
4362
a2981930
PB
43632004-09-15 Per Bothner <per@bothner.com>
4364
4365 * include/line-map.h (line_map_start): Add parameter names so
4366 preceding comment makes sense.
4367 (linemap_add): Remove from comment mention of non-existing parameter.
4368
21b11495
ZW
43692004-09-09 Matt Austern <austern@apple.com>
4370 Zack Weinberg <zack@codesourcery.com>
4371
4372 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
4373 prefixes throughout. Add entry for PRAGMA. Remove
4374 unnecessary "= 0" from EQ.
4375 (enum cpp_ttype): Adjust OP and TK definitions to restore
4376 prefixes, via token-paste.
4377 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
4378 Change from #defines to additional cpp_ttype enumerators.
4379 (struct cpp_options): Add defer_pragmas.
4380 (cpp_handle_deferred_pragma): Prototype new interface.
4381
4382 * internal.h (struct cpp_reader): Add directive_result.
4383 * directives.c (struct pragma_entry): Add is_internal field;
4384 give boolean fields type bool.
4385 (start_directive): Initialize pfile->directive_result.type.
4386 (_cpp_do__Pragma): Likewise.
4387 (run_directive): Do not crash if pfile->buffer->prev is NULL.
4388 (insert_pragma_entry): Add 'internal' argument; set new->is_internal
4389 from it.
4390 (register_pragma): New static function, bulk of former
4391 cpp_register_pragma here; add 'internal' argument, pass along
4392 to insert_pragma_entry.
4393 (cpp_register_pragma): Now a wrapper around register_pragma which
4394 always passes false for 'internal' argument.
4395 (_cpp_init_internal_pragmas): Call register_pragma directly, passing
4396 true for 'internal'.
4397 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
4398 an internal pragma, save text till the end of the line as a CPP_PRAGMA
4399 token instead of executing the pragma.
4400 (cpp_handle_deferred_pragma): New interface.
4401 * lex.c (token_spellings): Adjust OP and TK definitions to
4402 match changes to cpplib.h.
4403 (_cpp_lex_token): Check for a directive-result token and
4404 return it if present.
4405 (cpp_token_val_index): Handle CPP_PRAGMA.
4406 * macro.c (cpp_builtin_macro_text): Correct comment.
4407 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
4408
0fd9e8dd
SB
44092004-09-06 Serge Belyshev <belyshev@lubercy.com>
4410
4411 PR preprocessor/14699
4412 * symtab.c (ht_dump_statistics): Change type of sum_of_squares
4413 from size_t to double.
4414
39b8ce7f
AS
44152004-08-28 Andreas Schwab <schwab@suse.de>
4416 Andreas Jaeger <aj@suse.de>
4417
4418 * configure.ac: Set PACKAGE correctly.
4419 * configure: Regenerated.
4420
5d1f4b27
PB
44212004-08-25 Paolo Bonzini <bonzini@gnu.org>
4422
4423 * Makefile.in: Add back top_builddir.
4424
078e3ffe
PB
44252004-08-25 Paolo Bonzini <bonzini@gnu.org>
4426
4427 * configure.ac: Replace Automake macro invocations
4428 with manual Autoconf checks and substitutions.
4429 * configure: Regenerate.
4430 * aclocal.m4: Regenerate.
4431 * config.in: Regenerate.
4432 * Makefile.am: Removed.
4433 * Makefile.in: Heavy simplification and reorganization.
4434
b3f8d95d
MM
44352004-08-09 Mark Mitchell <mark@codesourcery.com>
4436
4437 * configure.ac (arm*-*-eabi*): New target.
4438 (arm*-*-symbianelf*): Likewise.
4439 * configure: Regenerated.
4440
72bb2c39
BI
44412004-07-24 Bernardo Innocenti <bernie@develer.com>
4442
4443 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
4444 * directives.c: Use XNEW-family macros from libiberty.
4445 * lex.c: Likewise.
4446 * macro.c: Likewise.
4447 * cpplib.h (cpp_deps_style): Export enum with name.
4448
21b11495 44492004-07-23 Matthias Klose <doko@debian.org>
72bb2c39 4450
21b11495 4451 * init.c (init_library): Use PACKAGE for the text domain.
85eac2a0 4452
a23ee064
AP
44532004-07-16 Andris Pavenis <pavenis@latnet.lv>
4454
4455 PR preprocessor/16366
4456 * internal.h (struct cpp_reader): New field dir_hash.
4457 * files.c (make_cpp_dir): Use dir_hash, not file_hash.
4458 (_cpp_init_files, _cpp_cleanup_files): Update for new field.
4459
a09d4744
NB
44602004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
4461
4462 PR preprocessor/16192
4463 PR preprocessor/15913
4464 PR preprocessor/15572
4465 * expr.c (_cpp_parse_expr): Handle remaining cases where an
4466 expression is missing.
4467 * init.c (post_options): Traditional cpp doesn't do // comments.
4468
f58f7def
PB
44692004-06-30 Per Bothner <per@bothner.com>
4470
4471 * include/line-map.h (fileline): Remove old typedef.
4472 * internal.h (struct cpp_reader): Use source_location typedef instead.
4473
e83d8d43
ZW
44742004-06-26 Zack Weinberg <zack@codesourcery.com>
4475
4476 Partially revert patch of 2004-06-05.
4477 * files.c (search_cache): Remove pfile argument. Don't check
4478 for file that would be found by "" or <> search here...
4479 (_cpp_find_file): ...do it here, before calling find_file_in_dir.
4480 Do not apply directory-of-current-file correction to files
4481 found by this check. Rearrange code slightly.
4482
c0d578e6
GK
44832004-06-21 Geoffrey Keating <geoffk@apple.com>
4484
4485 * files.c (should_stack_file): Correct swapped parameters to call
4486 to cb.read_pch.
4487 * pch.c (cpp_valid_state): Handle -fpreprocessed.
4488
159d5224
PB
44892004-06-15 Paolo Bonzini <bonzini@gnu.org>
4490
4491 * Makefile.in: Regenerate with automake 1.8.5.
4492 * aclocal.m4: Likewise.
4493 * configure: Regenerate.
4494
2fac9c01
ZW
44952004-06-11 Zack Weinberg <zack@codesourcery.com>
4496
4497 * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
4498 * configure, config.in: Regenerate.
4499 * system.h: Unconditionally define bool as unsigned char,
4500 BOOL_BITFIELD as unsigned int.
4501 * .cvsignore: New file.
4502
d8044160
GK
45032004-06-09 Geoffrey Keating <geoffk@apple.com>
4504
4505 * traditional.c (push_replacement_text): Set macro->traditional.
4506 (save_replacement_text): Likewise.
4507 * pch.c (cpp_write_pch_state): Don't write list of defined macros.
4508 (struct save_macro_item): Delete.
4509 (struct save_macro_data): Use a character array not the previous
4510 structured format.
4511 (save_macros): Save macro as text not as internal structures.
4512 (cpp_prepare_state): Update for changes to save_macro_data.
4513 (cpp_read_state): Don't read macros defined in PCH. Restore
2cf22451 4514 -D macros as text.
d8044160
GK
4515 * macro.c (create_iso_definition): Honour alloc_subobject.
4516 Clear traditional flag.
4517 (_cpp_create_definition): Honour alloc_subobject.
4518 * lex.c (cpp_token_val_index): New.
4519 * internal.h: Include cpp-id-data.h.
4520 (uchar): Move definition to cpp-id-data.h.
4521 (U): Likewise.
4522 (cpp_macro): Likewise.
4523 * directives.c (struct answer): Move to cpp-id-data.h.
4524 (do_assert): Honour alloc_subobject.
2cf22451
ZW
4525
4526 * include/symtab.h (struct ht): Add field 'alloc_subobject'.
4527 * include/cpplib.h (struct cpp_string): Add GTY marker.
4528 (enum cpp_token_fld_kind): New.
4529 (struct cpp_token): Add GTY markers.
4530 (cpp_token_val_index): Prototype.
4531 (CPP_HASHNODE_VALUE_IDX): New.
4532 (struct cpp_hashnode): Don't skip fields of 'value' when marking.
4533 * include/cpp-id-data.h: New file.
d8044160 4534
0ca8e815
PB
45352004-06-09 Paolo Bonzini <bonzini@gnu.org>
4536
4537 * Makefile.am (all-local): New.
4538 * Makefile.in: Regenerate.
4539
b51fa00f
RS
45402004-06-06 Roger Sayle <roger@eyesopen.com>
4541
4542 * Makefile.am (LIBICONV): Declare.
4543 (makedepend_LDADD): Use LIBICONV.
4544 * Makefile.in: Regenerate.
4545
5e2f3f39
AP
45462004-06-05 Andrew Pinski <pinskia@physics.uc.edu>
4547
4548 * Makefile.am (LIBINTL): Declare
4549 (makedepend_LDADD): Use LIBINTL.
4550 * Makefile.in: Regenerate.
4551
c6e83800
ZW
45522004-06-05 Zack Weinberg <zack@codesourcery.com>
4553
4554 * Makefile.am: Add makedepend.
4555 * Makefile.in, aclocal.m4: Regenerate.
4556 * charset.c: Insert a space to avoid a warning.
4557 * directives.c: Include mkdeps.h.
4558 (_cpp_handle_directive): Reenable macro expander if appropriate.
4559 (undefine_macros): Inline body of _cpp_free_definition for speed.
4560 Do not call undef callback or _cpp_warn_if_unused_macro.
4561 (cpp_get_deps): New interface.
4562 * files.c (search_cache): Add pfile argument. Check for file
4563 that would be found by "" or <> search here...
4564 (_cpp_find_file): ...not here. Correct recorded start_dir of
4565 files found by directory-of-current-file search that would be
4566 found by "" or <> search.
4567 * init.c (cpp_add_dependency_target): Delete.
4568 * internal.h (struct lexer_state): Add discarding_output flag.
4569 * lex.c (lex_identifier): Compute hash function while scanning.
4570 * macro.c (cpp_scan_nooutput): Disable macro expansion outside
4571 directives.
4572 * makedepend.c: New file.
4573 * mkdeps.c (struct deps): Add vpath vector.
4574 (apply_vpath, deps_add_vpath): New function.
4575 (deps_free): Free vpath vector.
4576 (deps_add_dep, deps_add_target): Use apply_vpath.
4577 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
4578 (ht_lookup_with_hash): New function.
4579 * cpplib.h, mkdeps.h: Update prototypes.
4580 * symtab.h: Update prototypes.
4581 (HT_HASHSTEP, HT_FINISH): New macros.
4582
b453c95f
GK
45832004-05-29 Geoffrey Keating <geoffk@apple.com>
4584
4585 * symtab.c (ht_create): Set entries_owned.
4586 (ht_destroy): Honour entries_owned.
4587 (ht_expand): Likewise.
4588 (ht_load): New.
2cf22451
ZW
4589 * include/symtab.h (struct ht): New field 'entries_owned'
4590 (ht_load): New prototype.
b453c95f 4591
963e23c5
PB
45922004-05-26 Paolo Bonzini <bonzini@gnu.org>
4593
4594 PR bootstrap/15651
4595 * configure.ac: Fix m4 quoting when picking
4596 the size of HOST_WIDE_INT.
4597 * configure: Regenerate.
4598
0429bc77
PB
45992004-05-25 Paolo Bonzini <bonzini@gnu.org>
4600
4601 * Makefile.am: the correct directory for
4602 gettext include files is given by @INCINTL@.
4603 * Makefile.in: Regenerate.
4604
c86dd7db
PB
46052004-05-24 Paolo Bonzini <bonzini@gnu.org>
4606
4607 * system.h [!ENABLE_NLS]: dgettext takes two
4608 parameters.
4609
4f4e53dd
PB
46102004-05-23 Paolo Bonzini <bonzini@gnu.org>
4611
4612 Moved libcpp from the gcc subdirectory to the toplevel.
4613 * Makefile.am: New file.
4614 * Makefile.in: Regenerate.
4615 * configure.ac: New file.
4616 * configure: Regenerate.
4617 * config.in: Regenerate.
4618 * charset.c: Moved from gcc/cppcharset.c. Add note about
4619 brokenness of input charset detection. Adjust for change
4620 in name of cppucnid.h.
4621 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
4622 * expr.c: Moved from gcc/cppexp.c.
4623 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
4624 Remove #define of O_BINARY, it is in system.h.
4625 * identifiers.c: Moved from gcc/cpphash.c.
4626 * internal.h: Moved from gcc/cpphash.h. Change header
4627 guard name. All other files adjusted to match name change.
4628 * init.c: Moved from gcc/cppinit.c.
4629 (init_library) [ENABLE_NLS]: Call bindtextdomain.
4630 * lex.c: Moved from gcc/cpplex.c.
4631 * directives.c: Moved from gcc/cpplib.c.
4632 * macro.c: Moved from gcc/cppmacro.c.
4633 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
4634 * traditional.c: Moved from gcc/cpptrad.c.
4635 * ucnid.h: Moved from gcc/cppucnid.h. Change header
4636 guard name.
4637 * ucnid.pl: Moved from gcc/cppucnid.pl.
4638 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header
4639 guard name.
4640 * symtab.c: Moved from gcc/hashtable.c.
4641 * line-map.c: Moved from gcc. Do not include intl.h.
4642 * mkdeps.c: Moved from gcc.
4643 * system.h: New file.
2cf22451
ZW
4644 * include/cpplib.h: Moved from gcc. Change header guard name.
4645 * include/line-map.h: Moved from gcc. Change header guard name.
4646 * include/mkdeps.h: Moved from gcc. Change header guard name.
4647 * include/symtab.h: Moved from gcc/hashtable.h. Change header
4648 guard name.
818ab71a
JJ
4649\f
4650Copyright (C) 2004-2016 Free Software Foundation, Inc.
4651
4652Copying and distribution of this file, with or without modification,
4653are permitted in any medium without royalty provided the copyright
4654notice and this notice are preserved.