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