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