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