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