2016-10-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / libcpp / ChangeLog
blob96b9047501bfe8c98dafd73a0f74f6942470a3a9
1 2016-10-04  Kelvin Nilsen  <kelvin@gcc.gnu.org>
3         PR target/77847
4         * lex.c (search_line_fast): Add a FALLTHROUGH comment to correct
5         compiler error in the version of this function that is
6         conditionally compiled when GCC_VERSION >= 4005 and both
7         __ALTIVEC__ and __BIG_ENDIAN__ symbols are defined.
9 2016-09-26  Marek Polacek  <polacek@redhat.com>
10             Jakub Jelinek  <jakub@redhat.com>
12         PR c/7652
13         * include/cpplib.h (PREV_FALLTHROUGH): Define.
14         * internal.h (CPP_FALLTHRU): Define.
15         * lex.c (fallthrough_comment_p): New function.
16         (_cpp_lex_direct): Set PREV_FALLTHROUGH on tokens succeeding a falls
17         through comment.
19 2016-09-23  David Malcolm  <dmalcolm@redhat.com>
21         PR preprocessor/77672
22         * charset.c (cpp_interpret_string_1): Add a source_range for the
23         NUL-terminator, using the location of the trailing quote of the
24         final string.
26 2016-09-21  Jason Merrill  <jason@redhat.com>
28         * line-map.c (linemap_location_from_macro_definition_p): New.
29         * line-map.h: Declare it.
31 2016-09-15  David Malcolm  <dmalcolm@redhat.com>
33         * include/line-map.h (class rich_location): Note that newlines
34         aren't supported in fix-it text.
35         * line-map.c (rich_location::add_fixit_insert_before): Reject
36         attempts to add fix-its containing newlines.
37         (rich_location::add_fixit_replace): Likewise.
39 2016-09-13  David Malcolm  <dmalcolm@redhat.com>
41         * include/line-map.h (class rich_location): Add description of
42         fix-it hints to leading comment.
43         (rich_location::add_fixit_insert): Rename both overloaded methods
44         to..
45         (rich_location::add_fixit_insert_before): ...this, updating their
46         comments.
47         (rich_location::add_fixit_insert_after): Two new overloaded
48         methods.
49         (rich_location::stop_supporting_fixits): New method.
50         * line-map.c (rich_location::add_fixit_insert): Rename both
51         overloaded methods to..
52         (rich_location::add_fixit_insert_before): ...this, updating their
53         comments.
54         (rich_location::add_fixit_insert_after): Two new methods.
55         (rich_location::reject_impossible_fixit): Split out
56         failure-handling into...
57         (rich_location::stop_supporting_fixits): New method.
59 2016-09-02  David Malcolm  <dmalcolm@redhat.com>
61         * include/line-map.h (rich_location::seen_impossible_fixit_p): New
62         accessor.
64 2016-08-31  David Malcolm  <dmalcolm@redhat.com>
66         * include/line-map.h (class fixit_remove): Remove stray decl.
67         (fixit_hint::affects_line_p): Make const.
68         (fixit_insert::affects_line_p): Likewise.
69         (fixit_replace::affects_line_p): Likewise.
70         * line-map.c (fixit_insert::affects_line_p): Likewise.
71         (fixit_replace::affects_line_p): Likewise.
73 2016-08-30  David Malcolm  <dmalcolm@redhat.com>
75         * include/line-map.h (class semi_embedded_vec): New class.
76         (semi_embedded_vec<T, NUM_EMBEDDED>::semi_embedded_vec): New ctor.
77         (semi_embedded_vec<T, NUM_EMBEDDED>::~semi_embedded_vec): New
78         dtor.
79         (semi_embedded_vec<T, NUM_EMBEDDED>::operator[]): New methods.
80         (semi_embedded_vec<T, NUM_EMBEDDED>::push): New method.
81         (semi_embedded_vec<T, NUM_EMBEDDED>::truncate): New method.
82         (rich_location::get_num_locations): Reimplement in terms of
83         m_ranges.
84         (rich_location::get_range): Make non-inline.
85         (rich_location::get_num_fixit_hints): Reimplement in terms of
86         m_fixit_hints.
87         (rich_location::add_fixit): New function.
88         (rich_location::MAX_RANGES): Rename to...
89         (rich_location::STATICALLY_ALLOCATED_RANGES): ...this.
90         (rich_location::MAX_FIXIT_HINTS): Rename to...
91         (rich_location::STATICALLY_ALLOCATED_RANGES): ...this, and make
92         private.
93         (rich_location::m_num_ranges): Eliminate in favor of...
94         (rich_location::m_ranges): ...this, converting from a fixed-size
95         array to a semi_embedded_vec.
96         (rich_location::m_num_fixit_hints): Eliminate in favor of...
97         (rich_location::m_fixit_hints): ...this, converting from a
98         fixed-size array to a semi_embedded_vec.
99         * line-map.c (rich_location::rich_location): Update for above
100         changes.
101         (rich_location::~rich_location): Likewise.
102         (rich_location::get_loc): Likewise.
103         (rich_location::get_range): New methods.
104         (rich_location::add_range): Update for above changes.
105         (rich_location::set_range): Likewise.
106         (rich_location::add_fixit_insert): Likewise.
107         (rich_location::add_fixit_replace): Likewise.
108         (rich_location::get_last_fixit_hint): Likewise.
109         (rich_location::reject_impossible_fixit): Likewise.
110         (rich_location::add_fixit): New method.
112 2016-08-30  David Malcolm  <dmalcolm@redhat.com>
114         * include/line-map.h (rich_location::add_fixit_insert): Add
115         comments.  Add overload omitting the source_location param.
116         (rich_location::add_fixit_remove): Add comments.  Add overloads
117         omitting the range, and accepting a source_location.
118         (rich_location::add_fixit_replace): Likewise.
119         * line-map.c (rich_location::add_fixit_insert): Add comments.  Add
120         overload omitting the source_location param.
121         (rich_location::add_fixit_remove): Add comments.  Add overloads
122         omitting the range, and accepting a source_location.
123         (rich_location::add_fixit_replace): Likewise.
125 2016-08-26  David Malcolm  <dmalcolm@redhat.com>
127         * include/line-map.h (get_pure_location): New decl.
128         * line-map.c (get_pure_location): Move here, from gcc/input.c, adding
129         a line_maps * param.
130         (rich_location::add_fixit_insert): Call get_pure_location on "where".
131         (rich_location::add_fixit_replace): Call get_pure_location on the
132         end-points.
134 2016-08-26  David Malcolm  <dmalcolm@redhat.com>
136         * include/line-map.h (rich_location): Eliminate unimplemented
137         constructor based on source_range.
138         (rich_location::get_last_fixit_hint): New method.
139         (rich_location::reject_impossible_fixit): New method.
140         (rich_location): Add fields m_line_table and
141         m_seen_impossible_fixit.
142         (fixit_hint::maybe_append_replace): New pure virtual function.
143         (fixit_insert::maybe_append_replace): New function.
144         (fixit_replace::maybe_append_replace): New function.
145         * line-map.c (rich_location::rich_location): Initialize
146         m_line_table and m_seen_impossible_fixit.
147         (rich_location::add_fixit_insert): Call
148         reject_impossible_fixit and bail out if true.
149         (column_before_p): New function.
150         (rich_location::add_fixit_replace): Call reject_impossible_fixit
151         and bail out if true.  Attempt to consolidate with neighboring
152         fixits.
153         (rich_location::get_last_fixit_hint): New method.
154         (rich_location::reject_impossible_fixit): New method.
155         (fixit_insert::maybe_append_replace): New method.
156         (fixit_replace::maybe_append_replace): New method.
158 2016-08-23  David Malcolm  <dmalcolm@redhat.com>
160         * include/line-map.h (source_range::from_locations): New method.
162 2016-08-19  David Malcolm  <dmalcolm@redhat.com>
164         * include/line-map.h (fixit_hint::kind): Delete REPLACE.
165         (class fixit_remove): Delete.
166         * line-map.c (rich_location::add_fixit_remove): Reimplement
167         by calling add_fixit_replace with an empty string.
168         (fixit_remove::fixit_remove): Delete.
169         (fixit_remove::affects_line_p): Delete.
171 2016-08-19  Joseph Myers  <joseph@codesourcery.com>
173         PR c/32187
174         * include/cpplib.h (CPP_N_FLOATN, CPP_N_FLOATNX)
175         (CPP_N_WIDTH_FLOATN_NX, CPP_FLOATN_SHIFT, CPP_FLOATN_MAX): New
176         macros.
177         * expr.c (interpret_float_suffix): Handle fN, fNx, FN and FNx
178         suffixes.
180 2016-08-19  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
182         * expr.c (eval_token): Append "evaluates to 0" to Wundef diagnostic.
184 2016-08-18  David Malcolm  <dmalcolm@redhat.com>
186         * directives.c (directive_names): New array.
187         (_cpp_handle_directive): Offer spelling suggestions for misspelled
188         directives.
189         * errors.c (cpp_diagnostic_at_richloc): New function.
190         (cpp_error_at_richloc): New function.
191         * include/cpplib.h (struct cpp_callbacks): Add field
192         "get_suggestion".
193         (cpp_error_at_richloc): New decl.
195 2016-08-18  Marek Polacek  <polacek@redhat.com>
197         PR c/7652
198         * pch.c (write_macdef): Add CPP_FALLTHRU.
200 2016-08-12  Marek Polacek  <polacek@redhat.com>
202         PR c/7652
203         * lex.c (search_line_fast): Add FALLTHRU.
204         (_cpp_lex_direct): Likewise.
205         (cpp_token_val_index): Adjust fall through comment.
206         * macro.c (parse_params): Add FALLTHRU.
207         * pch.c (count_defs): Adjust fall through comment.
208         (write_defs): Likewise.
210 2016-08-06  David Malcolm  <dmalcolm@redhat.com>
212         PR bootstrap/72823
213         * charset.c (_cpp_valid_ucn): Replace overzealous assert with one
214         that allows for char_range to be non-NULL when loc_reader is NULL.
216 2016-08-05  David Malcolm  <dmalcolm@redhat.com>
218         * charset.c (cpp_substring_ranges::cpp_substring_ranges): New
219         constructor.
220         (cpp_substring_ranges::~cpp_substring_ranges): New destructor.
221         (cpp_substring_ranges::add_range): New method.
222         (cpp_substring_ranges::add_n_ranges): New method.
223         (_cpp_valid_ucn): Add "char_range" and "loc_reader" params; if
224         they are non-NULL, read position information from *loc_reader
225         and update char_range->m_finish accordingly.
226         (convert_ucn): Add "char_range", "loc_reader", and "ranges"
227         params.  If loc_reader is non-NULL, read location information from
228         it, and update *ranges accordingly, using char_range.
229         Conditionalize the conversion into tbuf on tbuf being non-NULL.
230         (convert_hex): Likewise, conditionalizing the call to
231         emit_numeric_escape on tbuf.
232         (convert_oct): Likewise.
233         (convert_escape): Add params "loc_reader" and "ranges".  If
234         loc_reader is non-NULL, read location information from it, and
235         update *ranges accordingly.  Conditionalize the conversion into
236         tbuf on tbuf being non-NULL.
237         (cpp_interpret_string): Rename to...
238         (cpp_interpret_string_1): ...this, adding params "loc_readers" and
239         "out".  Use "to" to conditionalize the initialization and usage of
240         "tbuf", such as running the converter.  If "loc_readers" is
241         non-NULL, use the instances within it, reading location
242         information from them, and passing them to convert_escape; likewise
243         write to "out" if loc_readers is non-NULL.  Check for leading
244         quote and issue an error if it is not present.  Update boundary
245         check from "== limit" to ">= limit" to protect against erroneous
246         location values to calls that are not parsing string literals.
247         (cpp_interpret_string): Reimplement in terms to
248         cpp_interpret_string_1.
249         (noop_error_cb): New function.
250         (cpp_interpret_string_ranges): New function.
251         (cpp_string_location_reader::cpp_string_location_reader): New
252         constructor.
253         (cpp_string_location_reader::get_next): New method.
254         * include/cpplib.h (class cpp_string_location_reader): New class.
255         (class cpp_substring_ranges): New class.
256         (cpp_interpret_string_ranges): New prototype.
257         * internal.h (_cpp_valid_ucn): Add params "char_range" and
258         "loc_reader".
259         * lex.c (forms_identifier_p): Pass NULL for new params to
260         _cpp_valid_ucn.
262 2016-08-01  Andreas Schwab  <schwab@suse.de>
264         * include/cpplib.h: Fix comment typo.
266 2016-07-27  David Malcolm  <dmalcolm@redhat.com>
268         * include/line-map.h (source_location): Fix line numbers in
269         comment.
271 2016-07-11  David Malcolm  <dmalcolm@redhat.com>
273         * include/line-map.h (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES):
274         Move here from line-map.c.
275         (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
276         * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): Move from
277         here to line-map.h.
278         (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
280 2016-06-22  David Malcolm  <dmalcolm@redhat.com>
282         * directives.c (do_include_common): Pass on "location" to
283         _cpp_stack_include.
284         * errors.c (cpp_diagnostic): Reimplement in terms of...
285         (cpp_diagnostic_at): New function.
286         (cpp_error_at): New function.
287         (cpp_errno_filename): Add "loc" param and use it by using
288         cpp_error_at rather than cpp_error.
289         * files.c (find_file_in_dir): Add "loc" param and pass it to
290         open_file_failed.
291         (_cpp_find_file): Add "loc" param.  Use it to convert calls to
292         cpp_error to cpp_error_at, and pass it to find_file_in_dir and
293         open_file_failed.
294         (read_file_guts): Add "loc" param.  Use it to convert calls to
295         cpp_error to cpp_error_at.  Pass it to cpp_errno_filename.
296         (read_file): Add "loc" param.  Pass it to open_file_failed and
297         read_file_guts.
298         (should_stack_file): Add "loc" param.  Pass it to read_file.
299         (_cpp_stack_file): Add "loc" param.  Pass it to should_stack_file.
300         (_cpp_stack_include): Add "loc" param.  Pass it to
301         _cpp_find_file and _cpp_stack_file.
302         (open_file_failed): Add "loc" param.  Pass it to
303         cpp_errno_filename.
304         (_cpp_fake_include): Add 0 as a source_location in call to
305         _cpp_find_file.
306         (_cpp_compare_file_date): Likewise.
307         (cpp_push_include): Likewise for call to _cpp_stack_include.
308         (cpp_push_default_include): Likewise.
309         (_cpp_save_file_entries): Likewise for call to open_file_failed.
310         (_cpp_has_header): Likewise for call to _cpp_find_file.
311         * include/cpplib.h (cpp_errno_filename): Add source_location
312         param.
313         (cpp_error_at): New declaration.
314         * init.c (cpp_read_main_file): Add 0 as a source_location in calls
315         to _cpp_find_file and _cpp_stack_file.
316         * internal.h (_cpp_find_file): Add source_location param.
317         (_cpp_stack_file): Likewise.
318         (_cpp_stack_include): Likewise.
320 2016-06-22  David Malcolm  <dmalcolm@redhat.com>
322         * include/line-map.h (fixit_hint::get_start_loc): New pure virtual
323         function.
324         (fixit_hint::maybe_get_end_loc): Likewise.
325         (fixit_insert::get_start_loc): New function, implementing
326         fixit_hint::get_start_loc.
327         (fixit_insert::maybe_get_end_loc): New function, implementing
328         fixit_hint::maybe_get_end_loc.
329         (fixit_remove::get_start_loc): New function, implementing
330         fixit_hint::get_start_loc.
331         (fixit_remove::maybe_get_end_loc): New function, implementing
332         fixit_hint::maybe_get_end_loc.
333         (fixit_replace::get_start_loc): New function, implementing
334         fixit_hint::get_start_loc.
335         (fixit_replace::maybe_get_end_loc): New function, implementing
336         fixit_hint::maybe_get_end_loc.
338 2016-06-21  John David Anglin  <danglin@gcc.gnu.org>
340         * line-map.c (location_adhoc_data_update): Use int64_t instead of
341         long long.
342         (get_combined_adhoc_loc): Likewise.
344 2016-06-01  Eduard Sanou  <dhole@openmailbox.org>
346         * include/cpplib.h (cpp_callbacks): Add get_source_date_epoch
347         callback.
348         * include/cpplib.h (cpp_init_source_date_epoch): Remove prototype.
349         * init.c (cpp_init_source_date_epoch): Remove function.
350         * init.c (cpp_create_reader): Initialize pfile->source_date_epoch.
351         * internal.h (cpp_reader): Extend comment about source_date_epoch.
352         * macro.c (_cpp_builtin_macro_text): Use get_source_date_epoch
353         callback only once, read pfile->source_date_epoch on future passes.
354         Check that get_source_date_epoch callback is not NULL.
356 2016-05-20  Martin Liska  <mliska@suse.cz>
358         * config.in: Regenerated.
359         * configure: Likewise.
360         * configure.ac: Handle --enable-valgrind-annotations.
361         * lex.c (new_buff): Use ENABLE_VALGRIND_ANNOTATIONS instead
362         of ENABLE_VALGRIND_CHECKING.
363         (_cpp_free_buff): Likewise.
365 2016-04-28  Eduard Sanou  <dhole@openmailbox.org>
366             Matthias Klose  <doko@debian.org>
368         * include/cpplib.h (cpp_init_source_date_epoch): Prototype.
369         * init.c (cpp_init_source_date_epoch): New function.
370         * internal.h: Added source_date_epoch variable to struct
371         cpp_reader to store a reproducible date.
372         * macro.c (_cpp_builtin_macro_text): Set pfile->date timestamp from 
373         pfile->source_date_epoch instead of localtime if source_date_epoch is 
374         set, to be used for __DATE__ and __TIME__ macros to help reproducible 
375         builds.
377 2016-04-13  Bernd Schmidt  <bschmidt@redhat.com>
379         Patch from Roger Orr <rogero@howzatt.demon.co.uk>
380         PR preprocessor/69650
381         * directives.c (do_linemarker): Reread map after calling
382         cpp_get_token.
384 2016-04-06  Richard Henderson  <rth@redhat.com>
386         PR preprocessor/61817
387         PR preprocessor/69391
388         * internal.h (_cpp_builtin_macro_text): Update decl.
389         * macro.c (_cpp_builtin_macro_text): Accept location for __LINE__.
390         (builtin_macro): Accept a second location for __LINE__.
391         (enter_macro_context): Compute both virtual and real expansion
392         locations for the macro.
394 2016-03-25  Bernd Schmidt  <bschmidt@redhat.com>
396         PR lto/69650
397         * directives.c (do_linemarker): Test for file left but not entered
398         here.
399         * line-map.c (linemap_add): Not here.
401 2016-03-21  Jakub Jelinek  <jakub@redhat.com>
403         PR target/70296
404         * include/cpplib.h (cpp_fun_like_macro_p): New prototype.
405         * macro.c (cpp_fun_like_macro_p): New function.
407 2016-03-15  Richard Henderson  <rth@redhat.com>
409         * line-map.c (new_linemap): Make alloc_size a size_t.
411 2016-03-14  Jason Merrill  <jason@redhat.com>
413         * expr.c (cpp_classify_number): Hex floats are new in C++1z.
414         * init.c (lang_defaults): Likewise.
416 2016-03-09  David Malcolm  <dmalcolm@redhat.com>
418         PR c/68473
419         PR c++/70105
420         * line-map.c (linemap_macro_map_loc_unwind_toward_spelling): Move
421         decl...
422         * include/line-map.h
423         (linemap_macro_map_loc_unwind_toward_spelling): ...here,
424         converting from static to extern.
426 2016-03-09  David Malcolm  <dmalcolm@redhat.com>
428         PR c/68473
429         PR c++/70105
430         * include/line-map.h (source_range::debug): Delete.
431         (struct location_range): Update comment.  Replace
432         expanded_location fields "m_start", "m_finish", and "m_caret" with
433         a source_location field: "m_loc".
434         (class rich_location): Reword comment.
435         (rich_location::get_loc): Reimplement in terms of a new overloaded
436         variant which takes an unsigned int.
437         (rich_location::get_loc_addr): Delete.
438         (rich_location::add_range): Drop params "start" and "finish" in
439         favor of param "loc".  Drop overloaded variants taking a
440         source_range or location_range *.
441         (rich_location::lazily_expand_location): Delete in favor of...
442         (rich_location::get_expanded_location): New decl.
443         (rich_location::m_loc): Delete field.
444         (rich_location::m_column_override): New field.
445         * line-map.c (rich_location::rich_location):  Drop name of
446         line_maps * param.  Update initializations for deletion of field
447         "m_loc" and addition of field "m_column_override".  Reimplement
448         body as a call to add_range.  Delete overloaded variant taking a
449         source_range.
450         (rich_location::get_loc): New function.
451         (rich_location::lazily_expand_location): Delete in favor of...
452         (rich_location::get_expanded_location): New function.
453         (rich_location::override_column): Reimplement.
454         (rich_location::add_range): Drop params "start" and "finish" in
455         favor of param "loc".  Eliminate location expansion in favor of
456         simply storing loc.  Drop overloaded variants taking a
457         source_range or location_range *.
458         (rich_location::set_range): Eliminate location expansion.
460 2016-02-29  David Malcolm  <dmalcolm@redhat.com>
462         PR preprocessor/69985
463         (linemap_position_for_loc_and_offset): Rename param from "offset"
464         to "column_offset".  Right-shift the column_offset by m_range_bits
465         of the pertinent ordinary map whenever offsetting a
466         source_location.  For clarity, offset the column by the column
467         offset, rather than the other way around.
469 2016-02-23  David Malcolm  <dmalcolm@redhat.com>
471         PR preprocessor/69126
472         PR preprocessor/69543
473         * line-map.c (linemap_compare_locations): At the function top,
474         replace inlined bodies of get_location_from_adhoc_loc with calls
475         to get_location_from_adhoc_loc.  Add a pair of calls to
476         get_location_from_adhoc_loc at the bottom of the function, to
477         avoid meaningless comparisons of ad-hoc and non-ad-hoc locations.
479 2016-02-08  David Malcolm  <dmalcolm@redhat.com>
481         PR preprocessor/69664
482         * errors.c (cpp_diagnostic_with_line): Only call
483         rich_location::override_column if the column is non-zero.
484         * line-map.c (rich_location::override_column): Update columns
485         within m_ranges[0].  Add assertions to verify that doing so is
486         sane.
488 2016-02-05  Jakub Jelinek  <jakub@redhat.com>
490         PR c++/69628
491         * charset.c (cpp_interpret_charconst): Clear *PCHARS_SEEN
492         and *UNSIGNEDP if bailing out early due to errors.
494 2016-01-28  Jakub Jelinek  <jakub@redhat.com>
496         PR pch/68176
497         * files.c (_cpp_find_file): Set file->implicit_preinclude even if
498         included from file->implicit_preinclude header.
500         * directives.c (destringize_and_run): Adjust prototype.
502 2016-01-27  David Malcolm  <dmalcolm@redhat.com>
504         PR preprocessor/69126
505         * directives.c (destringize_and_run): Add expansion_loc param; use
506         it when handling unexpanded pragmas to fixup the locations of the
507         synthesized tokens.
508         (_cpp_do__Pragma): Add expansion_loc param and use it when calling
509         destringize_and_run.
510         * internal.h (_cpp_do__Pragma): Add expansion_loc param.
511         * macro.c (builtin_macro): Pass expansion location of _Pragma to
512         _cpp_do__Pragma.
514 2016-01-14  David Malcolm  <dmalcolm@redhat.com>
516         PR preprocessor/69177
517         * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): New
518         constant.
519         (LINE_MAP_MAX_LOCATION_WITH_COLS): Add note about unit tests
520         to comment.
521         (can_be_stored_compactly_p): Reduce threshold from
522         LINE_MAP_MAX_LOCATION_WITH_COLS to
523         LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES.
524         (get_combined_adhoc_loc): Likewise.
525         (get_range_from_loc): Likewise.
526         (linemap_line_start): Ensure that a new ordinary map is created
527         when transitioning from range-packing being enabled to disabled,
528         at the LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES threshold.  Set
529         range_bits to 0 for new ordinary maps when beyond this limit.
530         Prevent the "increase the column bits of a freshly created map"
531         optimization if the range bits has reduced.
533 2016-01-08  Jakub Jelinek  <jakub@redhat.com>
535         PR c++/69145
536         * files.c (cpp_included_before): If IS_ADHOC_LOC (location), lookup
537         real location from the line_table.
539 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
541         Update copyright years.
543 2015-12-22  David Malcolm  <dmalcolm@redhat.com>
545         * line-map.c (get_combined_adhoc_loc): Remove condition
546         on locus < RESERVED_LOCATION_COUNT when considering
547         whether a caret == start == finish location can be
548         simply stored as the caret location.
550 2015-12-07  David Malcolm  <dmalcolm@redhat.com>
552         * include/line-map.h (rich_location::set_range): Add line_maps *
553         param; convert param from source_range to source_location.  Drop
554         "overwrite_loc_p" param.
555         * line-map.c (rich_location::set_range): Likewise, acting as if
556         "overwrite_loc_p" were true, and getting range from the location.
558 2015-11-20  David Malcolm  <dmalcolm@redhat.com>
560         PR 62314
561         * include/line-map.h (source_range::intersects_line_p): New
562         method.
563         (rich_location::~rich_location): New.
564         (rich_location::add_fixit_insert): New method.
565         (rich_location::add_fixit_remove): New method.
566         (rich_location::add_fixit_replace): New method.
567         (rich_location::get_num_fixit_hints): New accessor.
568         (rich_location::get_fixit_hint): New accessor.
569         (rich_location::MAX_FIXIT_HINTS): New constant.
570         (rich_location::m_num_fixit_hints): New field.
571         (rich_location::m_fixit_hints): New field.
572         (class fixit_hint): New class.
573         (class fixit_insert): New class.
574         (class fixit_remove): New class.
575         (class fixit_replace): New class.
576         * line-map.c (source_range::intersects_line_p): New method.
577         (rich_location::rich_location): Add initialization of
578         m_num_fixit_hints to both ctors.
579         (rich_location::~rich_location): New.
580         (rich_location::add_fixit_insert): New method.
581         (rich_location::add_fixit_remove): New method.
582         (rich_location::add_fixit_replace): New method.
583         (fixit_insert::fixit_insert): New.
584         (fixit_insert::~fixit_insert): New.
585         (fixit_insert::affects_line_p): New.
586         (fixit_remove::fixit_remove): New.
587         (fixit_remove::affects_line_p): New.
588         (fixit_replace::fixit_replace): New.
589         (fixit_replace::~fixit_replace): New.
590         (fixit_replace::affects_line_p): New.
592 2015-11-19  Jakub Jelinek  <jakub@redhat.com>
594         PR preprocessor/60736
595         * include/cpplib.h (cpp_errno_filename): New prototype.
596         * errors.c (cpp_errno): Don't handle msgid "" specially, use
597         _(msgid) instead of msgid as argument to cpp_error.
598         (cpp_errno_filename): New function.
599         * files.c (read_file_guts): Use cpp_errno_filename instead of
600         cpp_errno.
601         (open_file_failed): Likewise.  Use file->name if file->path is NULL
602         in diagnostics.
604 2015-11-13  David Malcolm  <dmalcolm@redhat.com>
606         * errors.c (cpp_diagnostic): Pass pfile->line_table to
607         rich_location ctor.
608         (cpp_diagnostic_with_line): Likewise.
609         * include/cpplib.h (struct cpp_token): Update comment for src_loc
610         to indicate that the range of the token is "baked into" the
611         source_location.
612         * include/line-map.h (source_location): Update the descriptive
613         comment to reflect the packing scheme for short ranges, adding
614         worked examples of location encoding.
615         (struct line_map_ordinary): Drop field "column_bits" in favor
616         of field "m_column_and_range_bits"; add field "m_range_bits".
617         (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
618         (location_adhoc_data): Add source_range field.
619         (struct line_maps): Add fields "default_range_bits",
620         "num_optimized_ranges" and "num_unoptimized_ranges".
621         (get_combined_adhoc_loc): Add source_range param.
622         (get_range_from_loc): New declaration.
623         (pure_location_p): New prototype.
624         (COMBINE_LOCATION_DATA):  Add source_range param.
625         (SOURCE_LINE): Update for renaming of column_bits.
626         (SOURCE_COLUMN): Likewise.  Shift the column right by the map's
627         range_bits.
628         (LAST_SOURCE_LINE_LOCATION): Update for renaming of column_bits.
629         (linemap_position_for_line_and_column): Add line_maps * params.
630         (rich_location::rich_location): Likewise.
631         * lex.c (_cpp_lex_direct): Capture the range of the token, baking
632         it into token->src_loc via a call to COMBINE_LOCATION_DATA.
633         * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): Reduce from 1U << 17 to
634         1U << 12.
635         (location_adhoc_data_hash): Add the src_range into
636         the hash value.
637         (location_adhoc_data_eq): Require equality of the src_range
638         values.
639         (can_be_stored_compactly_p): New function.
640         (get_combined_adhoc_loc): Add src_range param, and store it,
641         via a bit-packing scheme for short ranges, otherwise within the
642         lookaside table.  Remove the requirement that data is non-NULL.
643         (get_range_from_adhoc_loc): New function.
644         (get_range_from_loc): New function.
645         (pure_location_p): New function.
646         (linemap_add): Ensure that start_location has zero for the
647         range_bits, unless we're past LINE_MAP_MAX_LOCATION_WITH_COLS.
648         Initialize range_bits to zero.  Assert that the start_location
649         is "pure".
650         (linemap_line_start): Assert that the
651         column_and_range_bits >= range_bits.
652         Update determinination of whether we need to start a new map
653         using the effective column bits, without the range bits.
654         Use the set's default_range_bits in new maps, apart from
655         those with column_bits == 0, which should also have 0 range_bits.
656         Increase the column bits for new maps by the range bits.
657         When adding lines to an existing map, use set->highest_line
658         directly rather than offsetting highest by SOURCE_COLUMN.
659         Add assertions to sanity-check the return value.
660         (linemap_position_for_column): Offset to_column by range_bits.
661         Update set->highest_location if necessary.
662         (linemap_position_for_line_and_column): Add line_maps * param.
663         Update the calculation to offset the column by range_bits, and
664         conditionalize it on being <= LINE_MAP_MAX_LOCATION_WITH_COLS.
665         Bound it by LINEMAPS_MACRO_LOWEST_LOCATION.  Update
666         set->highest_location if necessary.
667         (linemap_position_for_loc_and_offset): Handle ad-hoc locations;
668         pass "set" to linemap_position_for_line_and_column.
669         (linemap_macro_map_loc_unwind_toward_spelling): Add line_maps
670         param.  Handle ad-hoc locations.
671         (linemap_location_in_system_header_p): Pass on "set" to call to
672         linemap_macro_map_loc_unwind_toward_spelling.
673         (linemap_macro_loc_to_spelling_point): Retain ad-hoc locations.
674         Pass on "set" to call to
675         linemap_macro_map_loc_unwind_toward_spelling.
676         (linemap_resolve_location): Retain ad-hoc locations.  Pass on
677         "set" to call to linemap_macro_map_loc_unwind_toward_spelling.
678         (linemap_unwind_toward_expansion):  Pass on "set" to call to
679         linemap_macro_map_loc_unwind_toward_spelling.
680         (linemap_expand_location): Extract the data pointer before
681         extracting the location.
682         (rich_location::rich_location): Add line_maps param; use it to
683         extract the range from the source_location.
684         * location-example.txt: Regenerate, showing new representation.
686 2015-11-06  David Malcolm  <dmalcolm@redhat.com>
688         * errors.c (cpp_diagnostic): Update for change in signature
689         of "error" callback.
690         (cpp_diagnostic_with_line): Likewise, calling override_column
691         on the rich_location.
692         * include/cpplib.h (struct cpp_callbacks): Within "error"
693         callback, convert param from source_location to rich_location *,
694         and drop column_override param.
695         * include/line-map.h (struct source_range): New struct.
696         (struct location_range): New struct.
697         (class rich_location): New class.
698         (linemap_client_expand_location_to_spelling_point): New declaration.
699         * line-map.c (rich_location::rich_location): New ctors.
700         (rich_location::lazily_expand_location): New method.
701         (rich_location::override_column): New method.
702         (rich_location::add_range): New methods.
703         (rich_location::set_range): New method.
705 2015-11-06  David Malcolm  <dmalcolm@redhat.com>
707         * include/line-map.h (struct linemap_stats): Add fields
708         "adhoc_table_size" and "adhoc_table_entries_used".
709         * line-map.c (linemap_get_statistics): Populate above fields.
711 2015-11-04  Mikhail Maltsev  <maltsevm@gmail.com>
713         * config.in: Regenerate.
714         * configure: Regenerate.
715         * configure.ac: Remove ENABLE_CHECKING.
717 2015-11-03  Uros Bizjak  <ubizjak@gmail.com>
719         * lex.c (search_line_sse42): Correctly advance the pointer to an
720         aligned address.
722 2015-11-02  David Malcolm  <dmalcolm@redhat.com>
724         * include/line-map.h (source_location): In the table in the
725         descriptive comment, show UNKNOWN_LOCATION, BUILTINS_LOCATION,
726         LINE_MAP_MAX_LOCATION_WITH_COLS, LINE_MAP_MAX_SOURCE_LOCATION.
727         Add notes about ad-hoc values.
729 2015-10-21  Mikhail Maltsev  <maltsevm@gmail.com>
731         * include/line-map.h: Use CHECKING_P instead of ENABLE_CHECKING.
732         * init.c: Likewise.
733         * macro.c (struct macro_arg_token_iter, set_arg_token,
734         macro_arg_token_iter_init, macro_arg_token_iter_forward,
735         macro_arg_token_iter_get_token, macro_arg_token_iter_get_location,
736         alloc_expanded_arg_mem, _cpp_backup_tokens): Likewise.
738         * config.in: Regenerate.
739         * configure: Regenerate.
740         * configure.ac (CHECKING_P): Define.
741         * system.h (fancy_abort): Declare.
742         (abort): Define.
743         (gcc_assert): Define. Use CHECKING_P.
745 2015-10-13  Mikhail Maltsev  <maltsevm@gmail.com>
747         * system.h (CHECKING_P, gcc_checking_assert): Define.
749 2015-09-21  Manuel López-Ibáñez  <manu@gcc.gnu.org>
751         PR c/66415
752         * line-map.c (linemap_position_for_loc_and_offset): Handle the
753         case of long lines encoded in multiple maps.
755 2015-09-07  Marek Polacek  <polacek@redhat.com>
757         * system.h (INTTYPE_MINIMUM): Rewrite to avoid shift warning.
759 2015-08-06  Yaakov Selkowitz  <yselkowi@redhat.com>
761         * configure: Regenerate.
763 2015-07-08  Thomas Schwinge  <thomas@codesourcery.com>
765         * include/line-map.h (RESERVED_LOCATION_COUNT): Change type to
766         source_location.
768 2015-07-02  Paolo Carlini  <paolo.carlini@oracle.com>
770         PR preprocessor/53690
771         * charset.c (_cpp_valid_ucn): Add cppchar_t * parameter and change
772         return type to bool.  Fix encoding of \u0000 and \U00000000 in C++.
773         (convert_ucn): Adjust call.
774         * lex.c (forms_identifier_p): Likewise.
775         * internal.h (_cpp_valid_ucn): Adjust declaration.
777 2015-06-30  Edward Smith-Rowland  <3dw4rd@verizon.net>
779         Implement N4197 - Adding u8 character literals
780         * include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens;
781         (struct cpp_options): Add utf8_char_literals.
782         * init.c (struct lang_flags): Add utf8_char_literals;
783         (struct lang_flags lang_defaults): Add column for utf8_char_literals.
784         * macro.c (stringify_arg()): Treat CPP_UTF8CHAR token;
785         * expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()):
786         Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens;
787         (cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token;
788         (eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token.
789         * lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens.
790         * charset.c (converter_for_type(), cpp_interpret_charconst()):
791         Treat CPP_UTF8CHAR token.
793 2015-06-30  Uros Bizjak  <ubizjak@gmail.com>
795         * lex.c (search_line_sse42) [__GCC_ASM_FLAG_OUTPUTS__]: New main
796         loop using asm flag outputs.
798 2015-06-08  Marek Polacek  <polacek@redhat.com>
800         PR c/66415
801         * line-map.c (linemap_position_for_loc_and_offset): Remove
802         linemap_assert_fails; reverse conditions.
804 2015-05-26  Manuel López-Ibáñez  <manu@gcc.gnu.org>
806         * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER
807         LINE_MAP_MAX_LOCATION_WITH_COLS,LINE_MAP_MAX_SOURCE_LOCATION):
808         New constants.
809         (linemap_line_start): Use them.
810         (linemap_position_for_column): Use them.
812 2015-05-20  David Malcolm  <dmalcolm@redhat.com>
814         * include/line-map.h (MAP_START_LOCATION): Eliminate the non-const
815         variant, and tweak comment for the const variant.
816         (ORDINARY_MAP_STARTING_LINE_NUMBER): Drop the non-const variant.
817         (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
818         (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
819         (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
820         (ORDINARY_MAP_FILE_NAME): Drop the non-const variant.
821         (MACRO_MAP_MACRO): Likewise.
822         (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
823         (MACRO_MAP_LOCATIONS): Likewise.
824         (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
825         * line-map.c (linemap_add): Replace writes through macros with
826         direct field accesses.
827         (linemap_enter_macro): Likewise.
828         (linemap_line_start): Likewise.
830 2015-05-19  David Malcolm  <dmalcolm@redhat.com>
832         * directives.c (do_line): Strengthen local "map" from
833         const line_map * to const line_map_ordinary *.
834         (do_linemarker): Likewise.
835         (_cpp_do_file_change): Assert that we're not dealing with
836         a macro map.  Introduce local "ord_map" via a call to
837         linemap_check_ordinary, guarded within the check for
838         non-NULL.  Use it for typesafety.
839         * files.c (cpp_make_system_header): Strengthen local "map" from
840         const line_map * to const line_map_ordinary *.
841         * include/cpplib.h (struct cpp_callbacks): Likewise for second
842         parameter of "file_change" callback.
843         * include/line-map.h (struct line_map): Convert from a struct
844         containing a union to a base class.
845         (struct line_map_ordinary): Convert to a subclass of line_map.
846         (struct line_map_macro): Likewise.
847         (linemap_check_ordinary): Strengthen return type from line_map *
848         to line_map_ordinary *, and add a const-variant.
849         (linemap_check_macro): New pair of functions.
850         (ORDINARY_MAP_STARTING_LINE_NUMBER): Strengthen param from
851         const line_map * to const line_map_ordinary *, eliminating call
852         to linemap_check_ordinary.  Likewise for the non-const variant.
853         (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
854         (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
855         (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Likewise.
856         (ORDINARY_MAP_FILE_NAME): Likewise.
857         (MACRO_MAP_MACRO): Strengthen param from const line_map * to
858         const line_map_macro *.  Likewise for the non-const variant.
859         (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
860         (MACRO_MAP_LOCATIONS): Likewise.
861         (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
862         (struct maps_info): Replace with...
863         (struct maps_info_ordinary):...this and...
864         (struct maps_info_macro): ...this.
865         (struct line_maps): Convert fields "info_ordinary" and
866         "info_macro" to the above new structs.
867         (LINEMAPS_MAP_INFO): Delete both functions.
868         (LINEMAPS_MAPS): Likewise.
869         (LINEMAPS_ALLOCATED): Rewrite both variants to avoid using
870         LINEMAPS_MAP_INFO.
871         (LINEMAPS_USED): Likewise.
872         (LINEMAPS_CACHE): Likewise.
873         (LINEMAPS_MAP_AT): Likewise.
874         (LINEMAPS_ORDINARY_MAPS): Strengthen return type from line_map *
875         to line_map_ordinary *.
876         (LINEMAPS_ORDINARY_MAP_AT): Likewise.
877         (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
878         (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
879         (LINEMAPS_MACRO_MAPS): Strengthen return type from line_map * to
880         line_map_macro *.
881         (LINEMAPS_MACRO_MAP_AT): Likewise.
882         (LINEMAPS_LAST_MACRO_MAP): Likewise.
883         (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
884         (linemap_map_get_macro_name): Strengthen param from
885         const line_map * to const line_map_macro *.
886         (SOURCE_LINE): Strengthen first param from const line_map * to
887         const line_map_ordinary *, removing call to
888         linemap_check_ordinary.
889         (SOURCE_COLUMN): Likewise.
890         (LAST_SOURCE_LINE_LOCATION): Likewise.
891         (LAST_SOURCE_LINE): Strengthen first param from const line_map *
892         to const line_map_ordinary *.
893         (LAST_SOURCE_COLUMN): Likewise.
894         (INCLUDED_FROM): Strengthen return type from line_map * to
895         line_map_ordinary *., and second param from const line_map *
896         to const line_map_ordinary *, removing call to
897         linemap_check_ordinary.
898         (MAIN_FILE_P): Strengthen param from const line_map * to
899         const line_map_ordinary *, removing call to
900         linemap_check_ordinary.
901         (linemap_position_for_line_and_column): Strengthen param from
902         const line_map * to const line_map_ordinary *.
903         (LINEMAP_FILE): Strengthen param from const line_map * to
904         const line_map_ordinary *, removing call to
905         linemap_check_ordinary.
906         (LINEMAP_LINE): Likewise.
907         (LINEMAP_SYSP): Likewise.
908         (linemap_resolve_location): Strengthen final param from
909         const line_map ** to const line_map_ordinary **.
910         * internal.h (CPP_INCREMENT_LINE): Likewise for local "map".
911         (linemap_enter_macro): Strengthen return type from
912         const line_map * to const line_map_macro *.
913         (linemap_add_macro_token): Likewise for first param.
914         * line-map.c (linemap_check_files_exited): Strengthen local "map"
915         from const line_map * to const line_map_ordinary *.
916         (new_linemap): Introduce local "map_size" and use it when
917         calculating how large the buffer should be.  Rewrite based
918         on change of info_macro and info_ordinary into distinct types.
919         (linemap_add): Strengthen locals "map" and "from" from line_map *
920         to line_map_ordinary *.
921         (linemap_enter_macro): Strengthen return type from
922         const line_map * to const line_map_macro *, and local "map" from
923         line_map * to line_map_macro *.
924         (linemap_add_macro_token): Strengthen param "map" from
925         const line_map * to const line_map_macro *.
926         (linemap_line_start): Strengthen local "map" from line_map * to
927         line_map_ordinary *.
928         (linemap_position_for_column): Likewise.
929         (linemap_position_for_line_and_column): Strengthen first param
930         from const line_map * to const line_map_ordinary *.
931         (linemap_position_for_loc_and_offset): Strengthen local "map" from
932         const line_map * to const line_map_ordinary *.
933         (linemap_ordinary_map_lookup): Likewise for return type and locals
934         "cached" and "result".
935         (linemap_macro_map_lookup): Strengthen return type and locals
936         "cached" and "result" from const line_map * to
937         const line_map_macro *.
938         (linemap_macro_map_loc_to_exp_point): Likewise for param "map".
939         (linemap_macro_map_loc_to_def_point): Likewise.
940         (linemap_macro_map_loc_unwind_toward_spelling): Likewise.
941         (linemap_get_expansion_line): Strengthen local "map" from
942         const line_map * to const line_map_ordinary *.
943         (linemap_get_expansion_filename): Likewise.
944         (linemap_map_get_macro_name): Strengthen param from
945         const line_map * to const line_map_macro *.
946         (linemap_location_in_system_header_p): Add call to
947         linemap_check_ordinary in region guarded by
948         !linemap_macro_expansion_map_p.  Introduce local "macro_map" via
949         linemap_check_macro in other region, using it in place of "map"
950         for typesafety.
951         (first_map_in_common_1): Add calls to linemap_check_macro.
952         (trace_include): Strengthen param "map" from const line_map * to
953         const line_map_ordinary *.
954         (linemap_macro_loc_to_spelling_point): Strengthen final param from
955         const line_map ** to const line_map_ordinary **.  Replace a
956         C-style cast with a const_cast, and add calls to
957         linemap_check_macro and linemap_check_ordinary.
958         (linemap_macro_loc_to_def_point): Likewise.
959         (linemap_macro_loc_to_exp_point): Likewise.
960         (linemap_resolve_location): Strengthen final param from
961         const line_map ** to const line_map_ordinary **.
962         (linemap_unwind_toward_expansion): Introduce local "macro_map" via
963         a checked cast and use it in place of *map.
964         (linemap_unwind_to_first_non_reserved_loc): Strengthen local
965         "map1" from const line_map * to const line_map_ordinary *.
966         (linemap_expand_location): Introduce local "ord_map" via a checked
967         cast and use it in place of map.
968         (linemap_dump): Make local "map" const.  Strengthen local
969         "includer_map" from line_map * to const line_map_ordinary *.
970         Introduce locals "ord_map" and "macro_map" via checked casts and
971         use them in place of "map" for typesafety.
972         (linemap_dump_location): Strengthen local "map" from
973         const line_map * to const line_map_ordinary *.
974         (linemap_get_file_highest_location): Update for elimination of
975         union.
976         (linemap_get_statistics): Strengthen local "cur_map" from
977         line_map * to const line_map_macro *.  Update uses of sizeof to
978         use the appropriate line_map subclasses.
979         * macro.c (_cpp_warn_if_unused_macro): Add call to
980         linemap_check_ordinary.
981         (builtin_macro): Strengthen local "map" from const line_map * to
982         const line_map_macro *.
983         (enter_macro_context): Likewise.
984         (replace_args): Likewise.
985         (tokens_buff_put_token_to): Likewise for param "map".
986         (tokens_buff_add_token): Likewise.
988 2015-05-13  David Malcolm  <dmalcolm@redhat.com>
990         * include/line-map.h (source_location): Add a reference to
991         location-example.txt to the descriptive comment.
992         * location-example.txt: New file.
994 2015-05-13  David Malcolm  <dmalcolm@redhat.com>
996         * include/line-map.h (MAX_SOURCE_LOCATION): Convert from a macro
997         to a const source_location.
998         (RESERVED_LOCATION_COUNT): Likewise.
999         (linemap_check_ordinary): Convert from a macro to a pair of inline
1000         functions, for const/non-const arguments.
1001         (MAP_START_LOCATION): Likewise.
1002         (ORDINARY_MAP_STARTING_LINE_NUMBER): Likewise.
1003         (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
1004         (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
1005         (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Convert from a macro to a
1006         pair of inline functions, for const/non-const arguments, where the
1007         latter is named...
1008         (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): New function.
1009         (ORDINARY_MAP_FILE_NAME): Convert from a macro to a pair of inline
1010         functions, for const/non-const arguments.
1011         (MACRO_MAP_MACRO): Likewise.
1012         (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
1013         (MACRO_MAP_LOCATIONS): Likewise.
1014         (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
1015         (LINEMAPS_MAP_INFO): Likewise.
1016         (LINEMAPS_MAPS): Likewise.
1017         (LINEMAPS_ALLOCATED): Likewise.
1018         (LINEMAPS_USED): Likewise.
1019         (LINEMAPS_CACHE): Likewise.
1020         (LINEMAPS_ORDINARY_CACHE): Likewise.
1021         (LINEMAPS_MACRO_CACHE): Likewise.
1022         (LINEMAPS_MAP_AT): Convert from a macro to an inline function.
1023         (LINEMAPS_LAST_MAP): Likewise.
1024         (LINEMAPS_LAST_ALLOCATED_MAP): Likewise.
1025         (LINEMAPS_ORDINARY_MAPS): Likewise.
1026         (LINEMAPS_ORDINARY_MAP_AT): Likewise.
1027         (LINEMAPS_ORDINARY_ALLOCATED): Likewise.
1028         (LINEMAPS_ORDINARY_USED): Likewise.
1029         (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
1030         (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
1031         (LINEMAPS_MACRO_MAPS): Likewise.
1032         (LINEMAPS_MACRO_MAP_AT): Likewise.
1033         (LINEMAPS_MACRO_ALLOCATED): Likewise.
1034         (LINEMAPS_MACRO_USED): Likewise.
1035         (LINEMAPS_MACRO_LOWEST_LOCATION): Likewise.
1036         (LINEMAPS_LAST_MACRO_MAP): Likewise.
1037         (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
1038         (IS_ADHOC_LOC): Likewise.
1039         (COMBINE_LOCATION_DATA): Likewise.
1040         (SOURCE_LINE): Likewise.
1041         (SOURCE_COLUMN): Likewise.
1042         (LAST_SOURCE_LINE_LOCATION): Likewise.
1043         (LAST_SOURCE_LINE): Likewise.
1044         (LAST_SOURCE_COLUMN): Likewise.
1045         (LAST_SOURCE_LINE_LOCATION)
1046         (INCLUDED_FROM): Likewise.
1047         (MAIN_FILE_P): Likewise.
1048         (LINEMAP_FILE): Likewise.
1049         (LINEMAP_LINE): Likewise.
1050         (LINEMAP_SYSP): Likewise.
1051         (linemap_location_before_p): Likewise.
1052         * line-map.c (linemap_check_files_exited): Make local "map" const.
1053         (linemap_add): Use SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS.
1054         (linemap_line_start): Likewise.
1056 2015-05-13  Michael Haubenwallner  <michael.haubenwallner@ssi-schaefer.com>
1058         * aclocal.m4: Regenerated with automake-1.11.6.
1060 2015-05-13  David Malcolm  <dmalcolm@redhat.com>
1062         * include/line-map.h (linemap_assert): Move up within the file to
1063         before all of the map accessor macros.
1064         (linemap_assert_fails): Likewise.
1065         (linemap_check_ordinary): Likewise.
1066         (linemap_macro_expansion_map_p): Likewise.
1068 2015-05-12  David Malcolm  <dmalcolm@redhat.com>
1070         * directives.c (do_line): Set seen_line_directive on line_table.
1071         (do_linemarker): Likewise.
1072         * include/line-map.h (struct line_maps): Add new field
1073         "seen_line_directive".
1075 2015-05-08  Jason Merrill  <jason@redhat.com>
1077         * include/cpplib.h: Add CPP_W_CXX11_COMPAT.
1078         (struct cpp_options): Add cpp_warn_cxx11_compat.
1079         * init.c (cpp_create_reader): Initialize it.
1080         * lex.c (lex_string): Add -Wc++11-compat warning.
1082 2015-05-05  David Malcolm  <dmalcolm@redhat.com>
1084         * pch.c (cpp_valid_state): Fix indentation so that it reflects the
1085         block structure.
1087 2015-05-05  David Malcolm  <dmalcolm@redhat.com>
1089         * include/line-map.h: Fix comment at the top of the file.
1090         (source_location): Rewrite and expand the comment for this
1091         typedef, adding an ascii-art table to clarify how source_location
1092         values are allocated.
1093         * line-map.c: Fix comment at the top of the file.
1095 2015-04-09  Richard Biener  <rguenther@suse.de>
1097         PR pch/65550
1098         * files.c (pch_open_file): Allow main and pre-included files
1099         when trying to open a PCH.
1101 2015-04-06  Jakub Jelinek  <jakub@redhat.com>
1103         PR preprocessor/61977
1104         * lex.c (cpp_peek_token): If peektok is CPP_EOF, back it up
1105         with all tokens peeked by the current function.
1107 2015-04-02  Jakub Jelinek  <jakub@redhat.com>
1109         PR preprocessor/61977
1110         * lex.c (cpp_peek_token): Temporarily clear pfile->cb.line_change.
1112 2015-03-23  Jakub Jelinek  <jakub@redhat.com>
1114         PR preprocessor/65238
1115         * internal.h (_cpp_scan_out_logical_line): Add third argument.
1116         * directives.c (prepare_directive_trad): Pass false to it.
1117         * traditional.c (_cpp_read_logical_line_trad,
1118         _cpp_create_trad_definition): Likewise.
1119         (struct fun_macro): Add paramc field.
1120         (fun_like_macro): New function.
1121         (maybe_start_funlike): Handle NODE_BUILTIN macros.  Initialize
1122         macro->paramc field.
1123         (save_argument): Use macro->paramc instead of
1124         macro->node->value.macro->paramc.
1125         (push_replacement_text): Formatting fix.
1126         (recursive_macro): Use fun_like_macro helper.
1127         (_cpp_scan_out_logical_line): Likewise.  Add BUILTIN_MACRO_ARG
1128         argument.  Initialize fmacro.paramc field.  Handle builtin
1129         function-like macros.
1131 2015-03-16  Edward Smith-Rowland  <3dw4rd@verizon.net>
1133         PR c++/64626
1134         * lex.c (lex_number): If a number ends with digit-seps (') skip back
1135         and let lex_string take them.
1137 2015-03-02  Markus Trippelsdorf  <markus@trippelsdorf.de>
1139         PR target/65261
1140         * lex.c (search_line_fast): Silence ubsan errors.
1142 2015-02-03    <dodji@redhat.com>
1144         PR preprocessor/64803
1145         * internal.h (cpp_reader::top_most_macro_node): New data member.
1146         * macro.c (enter_macro_context): Pass the location of the end of
1147         the top-most invocation of the function-like macro, or the
1148         location of the expansion point of the top-most object-like macro.
1149         (cpp_get_token_1): Store the top-most macro node in the new
1150         pfile->top_most_macro_node data member.
1151         (_cpp_pop_context): Clear the new cpp_reader::top_most_macro_node
1152         data member.
1154 2015-01-30  Szabolcs Nagy  <szabolcs.nagy@arm.com>
1156         * lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON.
1158 2015-01-23  Marek Polacek  <polacek@redhat.com>
1160         DR#412
1161         PR preprocessor/60570
1162         * directives.c (do_elif): Don't evaluate #elif conditionals
1163         when they don't need to be.
1165 2015-01-16  Jakub Jelinek  <jakub@redhat.com>
1167         * expr.c (cpp_classify_number): Add N_() around ?: string
1168         literals used in cpp_error_with_line call as format string.
1170 2015-01-05  Jakub Jelinek  <jakub@redhat.com>
1172         Update copyright years.
1174 2014-12-19  Jakub Jelinek  <jakub@redhat.com>
1176         PR preprocessor/63831
1177         * directives.c (lex_macro_node): Remove __has_attribute__ handling.
1178         * internal.h (struct spec_node): Remove n__has_attribute__ field.
1179         (struct lexer_state): Remove in__has_attribute__ field.
1180         * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_ATTRIBUTE.
1181         * identifiers.c (_cpp_init_hashtable): Remove __has_attribute__
1182         handling.
1183         * init.c (builtin_array): Add __has_attribute and __has_cpp_attribute.
1184         (cpp_init_special_builtins): Don't initialize __has_attribute
1185         or __has_cpp_attribute if CLK_ASM or pfile->cb.has_attribute is NULL.
1186         * traditional.c (enum ls): Remove ls_has_attribute,
1187         ls_has_attribute_close.
1188         (_cpp_scan_out_logical_line): Remove __has_attribute__ handling.
1189         * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_ATTRIBUTE.
1190         * pch.c (cpp_read_state): Remove __has_attribute__ handling.
1191         * expr.c (eval_token): Likewise.
1192         (parse_has_attribute): Removed.
1194 2014-12-11  Uros Bizjak  <ubizjak@gmail.com>
1196         * directives.c (cpp_define_formatted): Use xvasprintf.
1198 2014-12-05  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1200         * line-map.c (linemap_position_for_loc_and_offset): Add new
1201         linemap_assert_fails.
1203 2014-12-02  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1205         * include/line-map.h (linemap_assert_fails): Declare.
1206         * line-map.c (linemap_position_for_loc_and_offset): Use it.
1208 2014-12-02  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1210         * line-map.c (linemap_add): Fix typo.
1211         (linemap_line_start): Fix whitespace.
1213 2014-11-29  John Schmerge  <jbschmerge@gmail.com>
1215         PR preprocessor/41698
1216         * charset.c (one_utf8_to_utf16): Do not produce surrogate pairs
1217         for 0xffff.
1219 2014-11-25  Jakub Jelinek  <jakub@redhat.com>
1221         PR preprocessor/60436
1222         * line-map.c (linemap_line_start): If highest is above 0x60000000
1223         and we are still tracking columns or highest is above 0x70000000,
1224         force add_map.
1226 2014-11-20  Uros Bizjak  <ubizjak@gmail.com>
1228         PR target/63966
1229         * lex.c [__i386__ || __x86_64__]: Compile special SSE functions
1230         only for (__GNUC__ >= 5 || !defined(__PIC__)).
1232 2014-11-13  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1234         * include/line-map.h: Include EXPR, so that unused variable warnings
1235         do not occur.
1237 2014-11-11  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1239         PR fortran/44054
1240         * include/line-map.h (linemap_position_for_loc_and_offset):
1241         Declare.
1242         * line-map.c (linemap_position_for_loc_and_offset): New.
1244 2014-11-11  David Malcolm  <dmalcolm@redhat.com>
1246         * ChangeLog.jit: New.
1248 2014-11-10  Edward Smith-Rowland  <3dw4rd@verizon.net>
1250         * include/cpplib.h (cpp_callbacks): Add has_attribute.
1251         * internal.h (lexer_state): Add in__has_attribute__.
1252         * directives.c (lex_macro_node): Prevent use of __has_attribute__
1253         as a macro.
1254         * expr.c (parse_has_attribute): New function; (eval_token): Look for
1255         __has_attribute__ and route to parse_has_attribute.
1256         * identifiers.c (_cpp_init_hashtable): Initialize n__has_attribute__.
1257         * pch.c (cpp_read_state): Initialize n__has_attribute__.
1258         * traditional.c (enum ls): Add ls_has_attribute, ls_has_attribute_close;
1259         (_cpp_scan_out_logical_line): Attend to __has_attribute__.
1261 2014-11-06  Joseph Myers  <joseph@codesourcery.com>
1263         * include/cpp-id-data.h (struct cpp_macro): Update comment
1264         regarding parameters.
1265         * include/cpplib.h (struct cpp_macro_arg, struct cpp_identifier):
1266         Add spelling fields.
1267         (struct cpp_token): Update comment on macro_arg.
1268         * internal.h (_cpp_save_parameter): Add extra argument.
1269         (_cpp_spell_ident_ucns): New declaration.
1270         * lex.c (lex_identifier): Add SPELLING argument.  Set *SPELLING to
1271         original spelling of identifier.
1272         (_cpp_lex_direct): Update calls to lex_identifier.
1273         (_cpp_spell_ident_ucns): New function, factored out of
1274         cpp_spell_token.
1275         (cpp_spell_token): Adjust FORSTRING argument semantics to return
1276         original spelling of identifiers.  Use _cpp_spell_ident_ucns in
1277         !FORSTRING case.
1278         (_cpp_equiv_tokens): Check spellings of identifiers and macro
1279         arguments are identical.
1280         * macro.c (macro_arg_saved_data): New structure.
1281         (paste_tokens): Use original spellings of identifiers from
1282         cpp_spell_token.
1283         (_cpp_save_parameter): Add argument SPELLING.  Save both canonical
1284         node and its value.
1285         (parse_params): Update calls to _cpp_save_parameter.
1286         (lex_expansion_token): Save spelling of macro argument tokens.
1287         (_cpp_create_definition): Extract canonical node from saved data.
1288         (cpp_macro_definition): Use UCNs in spelling of macro name.  Use
1289         original spellings of macro argument tokens and identifiers.
1290         * traditional.c (scan_parameters): Update call to
1291         _cpp_save_parameter.
1293 2014-11-05  Joseph Myers  <joseph@codesourcery.com>
1295         PR preprocessor/9449
1296         * init.c (lang_defaults): Enable extended identifiers for C++ and
1297         C99-based standards.
1299 2014-10-22  Alan Modra  <amodra@gmail.com>
1301         * symtab.c (ht_create): Use obstack_specify_allocation in place of
1302         _obstack_begin.
1303         * files.c (_cpp_init_files): Likewise.
1304         * init.c (cpp_create_reader): Likewise.
1305         * identifiers.c (_cpp_init_hashtable): Likewise.
1307 2014-10-14  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1309         * include/line-map.h (linemap_location_from_macro_expansion_p):
1310         const struct line_maps * argument.
1311         (linemap_position_for_line_and_column): const struct line_map *
1312         argument.
1313         * line-map.c (linemap_add_macro_token): Use correct argument name
1314         in comment.
1315         (linemap_position_for_line_and_column): const struct line_map *
1316         argument.
1317         (linemap_macro_map_loc_to_def_point): Fix comment. Make static.
1318         (linemap_location_from_macro_expansion_p): const struct line_maps *
1319         argument.
1320         (linemap_resolve_location): Fix argument names in comment.
1322 2014-10-03  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
1324         * lex.c (search_line_fast): Add new version to be used for Power8
1325         and later targets when Altivec is enabled.  Restrict the existing
1326         Altivec version to big-endian systems so that lvsr is not used on
1327         little endian, where it is deprecated.  Remove LE-specific code
1328         from the now-BE-only version.
1330 2014-10-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>
1331             Jeff Law  <law@redhat.com>
1333         * charset.c (convert_no_conversion): Reallocate memory with 25%
1334         headroom.
1336 2014-10-01  Edward Smith-Rowland  <3dw4rd@verizon.net>
1338         Implement SD-6: SG10 Feature Test Recommendations
1339         * internal.h (lexer_state, spec_nodes): Add in__has_include__.
1340         * directives.c: Support __has_include__ builtin.
1341         * expr.c (parse_has_include): New function to parse __has_include__
1342         builtin; (eval_token()): Use it.
1343         * files.c (_cpp_has_header()): New funtion to look for header;
1344         (open_file_failed()): Not an error to not find a header file for
1345         __has_include__.
1346         * identifiers.c (_cpp_init_hashtable()): Add entry for __has_include__.
1347         * pch.c (cpp_read_state): Lookup __has_include__.
1348         * traditional.c (enum ls, _cpp_scan_out_logical_line()): Walk through
1349         __has_include__ statements.
1351 2014-09-30  Bernd Edlinger  <bernd.edlinger@hotmail.de>
1353         PR preprocessor/58893
1354         * errors.c (cpp_diagnostic): Fix possible out of bounds access.
1355         * files.c (_cpp_stack_include): Initialize src_loc for IT_CMDLINE.
1357 2014-09-24  Marek Polacek  <polacek@redhat.com>
1359         PR c/61405
1360         PR c/53874
1361         * include/cpplib.h (enum cpp_ttype): Define CPP_KEYWORD.
1363 2014-09-17  Jan Hubicka  <hubicka@ucw.cz>
1365         * charset.c (conversion): Rename to ...
1366         (cpp_conversion): ... this one; update.
1367         * files.c (file_hash_entry): Rename to ...
1368         (cpp_file_hash_entry): ... this one ; update.
1370 2014-09-17  Marek Polacek  <polacek@redhat.com>
1372         PR c/61854
1373         * init.c (struct lang_flags): Remove cplusplus_comments.
1374         (cpp_set_lang): Likewise.
1375         (post_options): Likewise.
1376         * lex.c (_cpp_lex_direct): Disallow C++ style comments in C90/C94.
1378 2014-09-09  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1380         * include/cpplib.h (struct cpp_options): Declare warn_normalize as
1381         int instead of enum.
1383 2014-09-04  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1385         * macro.c (replace_args): Use cpp_pedwarning, cpp_warning and
1386         CPP_W flags.
1387         * include/cpplib.h: Add CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC.
1388         * init.c (cpp_create_reader): Do not init to -1 here.
1389         * expr.c (num_binary_op): Use cpp_pedwarning.
1391 2014-08-29  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1393         * directives.c (check_eol_1): New.
1394         (check_eol_endif_labels): New.
1395         (check_eol): Call check_eol_1.
1396         (do_else,do_endif): Call check_eol_endif_labels.
1398 2014-08-29  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1400         * macro.c (warn_of_redefinition): Suppress warnings for builtins
1401         that lack the NODE_WARN flag, unless Wbuiltin-macro-redefined.
1402         (_cpp_create_definition): Use Wbuiltin-macro-redefined for
1403         builtins that lack the NODE_WARN flag.
1404         * directives.c (do_undef): Likewise.
1405         * init.c (cpp_init_special_builtins): Do not change flags
1406         depending on Wbuiltin-macro-redefined.
1408 2014-08-28  Edward Smith-Rowland  <3dw4rd@verizon.net>
1410         PR cpp/23827 - standard C++ should not have hex float preprocessor
1411         tokens
1412         * libcpp/init.c (lang_flags): Change CXX98 flag for extended numbers
1413         from 1 to 0.
1414         * libcpp/expr.c (cpp_classify_number): Weite error message for improper
1415         use of hex floating literal.
1417 2014-08-23  Edward Smith-Rowland  <3dw4rd@verizon.net>
1419         * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z;
1420         Rename CLK_GNUCXX1Y, CLK_CXX1Y to CLK_GNUCXX14, CLK_CXX14;
1421         * init.c (struct lang_flags lang_defaults): Add column for trigraphs;
1422         Add rows for CLK_GNUCXX1Z, CLK_CXX1Z; (cpp_set_lang): Set trigraphs;
1423         (cpp_init_builtins): Set __cplusplus to 201402L for C++14;
1424         Set __cplusplus to 201500L for C++17.
1425         * expr.c (cpp_classify_number): Change C++1y to C++14 in binary
1426         constants error message.
1428 2014-08-20  Marek Polacek  <polacek@redhat.com>
1430         * include/cpplib.h (cpp_options): Use signed char.
1431         * lex.c (_cpp_lex_direct): Don't warn in C++ mode.
1433 2014-08-19  Marek Polacek  <polacek@redhat.com>
1435         * lex.c (_cpp_lex_direct): Fix a typo.
1437 2014-08-19  Marek Polacek  <polacek@redhat.com>
1439         * charset.c (_cpp_valid_ucn): Warn only if -Wc90-c99-compat.
1440         * lex.c (_cpp_lex_direct): Likewise.
1441         * macro.c (replace_args): Likewise.
1442         (parse_params): Likewise.
1443         * include/cpplib.h (cpp_options): Change cpp_warn_c90_c99_compat
1444         to char.
1446 2014-08-10 Marek Polacek  <polacek@redhat.com>
1448         PR c/51849
1449         * lex.c (_cpp_lex_direct): Warn when -Wc90-c99-compat is in effect.
1450         * charset.c (_cpp_valid_ucn): Likewise.
1451         * include/cpplib.h (cpp_options): Add cpp_warn_c90_c99_compat.
1452         * macro.c (replace_args): Warn when -Wc90-c99-compat is in effect.
1453         (parse_params): Likewise.
1455 2014-07-27  Marek Polacek  <polacek@redhat.com>
1457         PR c/61861
1458         * macro.c (builtin_macro): Add location parameter.  Set
1459         location of builtin macro to the expansion point.
1460         (enter_macro_context): Pass location to builtin_macro.
1462 2014-07-16  Dodji Seketeli  <dodji@redhat.com>
1464         Support location tracking for built-in macro tokens
1465         * include/line-map.h (line_maps::builtin_location): New data
1466         member.
1467         (line_map_init): Add a new parameter to initialize the new
1468         line_maps::builtin_location data member.
1469         * line-map.c (linemap_init): Initialize the
1470         line_maps::builtin_location data member.
1471         * macro.c (builtin_macro): Create a macro map and track the token
1472         resulting from the expansion of a built-in macro.
1474 2014-07-10  Edward Smith-Rowland  <3dw4rd@verizon.net>
1475             Jonathan Wakely  <jwakely@redhat.com>
1477         PR preprocessor/61389
1478         * macro.c (_cpp_arguments_ok, parse_params, create_iso_definition):
1479         Warning messages mention C++11 in c++ mode and C99 in c mode.
1480         * lex.c (lex_identifier_intern, lex_identifier): Ditto
1482 2014-07-09  Edward Smith-Rowland  <3dw4rd@verizon.net>
1484         PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped
1485         by preprocessor
1486         * lex.c (lex_raw_string ()): Do not warn about invalid suffix
1487         if skipping. (lex_string ()): Ditto.
1489 2014-06-04  Edward Smith-Rowland  <3dw4rd@verizon.net>
1491         PR c++/61038
1492         * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
1493         Combine user-defined escape logic with the other string and char logic.
1495 2014-05-26  Richard Biener  <rguenther@suse.de>
1497         * configure.ac: Remove long long and __int64 type checks,
1498         add check for uint64_t and fail if that wasn't found.
1499         * include/cpplib.h (cpp_num_part): Use uint64_t.
1500         * config.in: Regenerate.
1501         * configure: Likewise.
1503 2014-05-21  Marek Polacek  <polacek@redhat.com>
1505         PR c/61212
1506         * files.c (find_file_in_dir): Add parens around &&.
1508 2014-05-20  Edward Smith-Rowland  <3dw4rd@verizon.net>
1510         PR c++/61038
1511         * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
1512         Check for user-defined literal strings and user-defined literal chars
1513         to escape necessary characters.
1515 2014-05-20  Richard Biener  <rguenther@suse.de>
1517         * configure.ac: Copy gcc logic of detecting a 64bit type.
1518         Remove HOST_WIDE_INT define.
1519         * include/cpplib.h: typedef cpp_num_part to a 64bit type,
1520         similar to how hwint.h does it.
1521         * config.in: Regenerate.
1522         * configure: Likewise.
1524 2014-05-09  Joey Ye  <joey.ye@arm.com>
1526         * files.c (find_file_in_dir): Always try to shorten for DOS
1527         non-system headers.
1528         * init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS.
1530 2014-05-07  Richard Biener  <rguenther@suse.de>
1532         * configure.ac: Always set need_64bit_hwint to yes.
1533         * configure: Regenerated.
1535 2014-04-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1537         * lex.c: Remove Solaris 9 reference.
1539 2014-02-24  Walter Lee  <walt@tilera.com>
1541         * configure.ac: Change "tilepro" triplet to "tilepro*".
1542         * configure: Regenerate.
1544 2014-02-19  Jakub Jelinek  <jakub@redhat.com>
1546         PR preprocessor/58844
1547         * macro.c (enter_macro_context): Only push
1548         macro_real_token_count (macro) tokens rather than
1549         macro->count tokens, regardless of
1550         CPP_OPTION (pfile, track-macro-expansion).
1552 2014-02-07  Jakub Jelinek  <jakub@redhat.com>
1554         PR preprocessor/56824
1555         * line-map.c (get_combined_adhoc_loc, linemap_get_expansion_line,
1556         linemap_get_expansion_filename, linemap_location_in_system_header_p,
1557         linemap_location_from_macro_expansion_p,
1558         linemap_macro_loc_to_spelling_point, linemap_macro_loc_to_def_point,
1559         linemap_macro_loc_to_exp_point, linemap_expand_location): Fix
1560         formatting.
1561         (linemap_compare_locations): Look through adhoc locations for both
1562         l0 and l1.
1564 2014-01-23  Dodji Seketeli  <dodji@redhat.com>
1566         PR PR preprocessor/58580
1567         * include/line-map.h (linemap_get_file_highest_location): Declare
1568         new function.
1569         * line-map.c (linemap_get_file_highest_location): Define it.
1571 2014-01-02  Richard Sandiford  <rdsandiford@googlemail.com>
1573         Update copyright years
1575 2013-12-09  Joseph Myers  <joseph@codesourcery.com>
1577         PR preprocessor/55715
1578         * expr.c (num_binary_op): Implement subtraction directly rather
1579         than with negation and falling through into addition case.
1581 2013-11-18  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
1583         * lex.c (search_line_fast): Correct for little endian.
1585 2013-11-15  Joseph Myers  <joseph@codesourcery.com>
1587         * ucnid.tab: Add C11 and C11NOSTART data.
1588         * makeucnid.c (digit): Rename enum value to N99.
1589         (C11, N11, all_languages): New enum values.
1590         (NUM_CODE_POINTS, MAX_CODE_POINT): New macros.
1591         (flags, decomp, combining_value): Use NUM_CODE_POINTS as array
1592         size.
1593         (decomp): Use unsigned int as element type.
1594         (all_decomp): New array.
1595         (read_ucnid): Handle C11 and C11NOSTART.  Use MAX_CODE_POINT.
1596         (read_table): Use MAX_CODE_POINT.  Store all decompositions in
1597         all_decomp.
1598         (read_derived): Use MAX_CODE_POINT.
1599         (write_table): Use NUM_CODE_POINTS.  Print N99, C11 and N11
1600         flags.  Print whole array variable declaration rather than just
1601         array contents.
1602         (char_id_valid, write_context_switch): New functions.
1603         (main): Call write_context_switch.
1604         * ucnid.h: Regenerate.
1605         * include/cpplib.h (struct cpp_options): Add c11_identifiers.
1606         * init.c (struct lang_flags): Add c11_identifiers.
1607         (cpp_set_lang): Set c11_identifiers option from selected language.
1608         * internal.h (struct normalize_state): Document "previous" as
1609         previous starter character.
1610         (NORMALIZE_STATE_UPDATE_IDNUM): Take character as argument.
1611         * charset.c (DIG): Rename enum value to N99.
1612         (C11, N11): New enum values.
1613         (struct ucnrange): Give name to struct.  Use short for flags and
1614         unsigned int for end of range.  Include ucnid.h for whole variable
1615         declaration.
1616         (ucn_valid_in_identifier): Allow for characters up to 0x10FFFF.
1617         Allow for C11 in determining valid characters and valid start
1618         characters.  Use check_nfc for non-Hangul context-dependent
1619         checks.  Only store starter characters in nst->previous.
1620         (_cpp_valid_ucn): Pass new argument to
1621         NORMALIZE_STATE_UPDATE_IDNUM.
1622         * lex.c (lex_identifier): Pass new argument to
1623         NORMALIZE_STATE_UPDATE_IDNUM.  Call NORMALIZE_STATE_UPDATE_IDNUM
1624         after initial non-UCN part of identifier.
1625         (lex_number): Pass new argument to NORMALIZE_STATE_UPDATE_IDNUM.
1627 2013-11-15  Joseph Myers  <joseph@codesourcery.com>
1629         * ucnid.tab: Mark C99 digits as [C99DIG].
1630         * makeucnid.c (read_ucnid): Handle [C99DIG].
1631         (read_table): Don't check for digit characters.
1632         * ucnid.h: Regenerate.
1634 2013-11-06  Tobias Burnus  <burnus@net-b.de>
1636         * macro.c (_cpp_builtin_macro_text): Correct
1637         wording of two warnings.
1639 2013-11-05  Tobias Burnus  <burnus@net-b.de>
1641         * include/cpplib.h (CPP_W_DATE_TIME): Added.
1642         (cpp_options): Add warn_date_time.
1643         * init.c (cpp_create_reader): Init it.
1644         * macro.c (_cpp_builtin_macro_text): Warn when
1645         __DATE__/__TIME__/__TIMESTAMP__ is used.
1647 2013-10-31  Edward Smith-Rowland  <3dw4rd@verizon.net>
1649         Implement C++14 digit separators.
1650         * include/cpplib.h (cpp_options): Add digit_separators flag.
1651         * internal.h (DIGIT_SEP(c)): New macro.
1652         * expr.c (cpp_classify_number): Check improper placement of digit sep;
1653         (cpp_interpret_integer): Skip over digit separators.
1654         * init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add
1655         digit separator flags per language; (cpp_set_lang): Set
1656         digit_separators
1657         * lex.c (lex_number): Add digits separator to allowable characters for
1658         C++14.
1660 2013-10-15  David Malcolm  <dmalcolm@redhat.com>
1662         * Makefile.in (PICFLAG): New.
1663         (ALL_CFLAGS): Add PICFLAG.
1664         (ALL_CXXFLAGS): Likewise.
1665         * configure.ac: Add --enable-host-shared, setting up new
1666         PICFLAG variable.
1667         * configure: Regenerate.
1669 2013-08-07  Richard Earnshaw  <rearnsha@arm.com>
1671         * configure.ac: Set need_64bit_hwint for all arm targets.
1672         * configure: Regenerated.
1674 2013-07-20  Jakub Jelinek  <jakub@redhat.com>
1676         PR preprocessor/57620
1677         * lex.c (lex_raw_string): Undo phase1 and phase2 transformations
1678         between R" and final " rather than only in between R"del( and )del".
1680 2013-07-10  Jakub Jelinek  <jakub@redhat.com>
1682         PR preprocessor/57824
1683         * lex.c (lex_raw_string): Allow reading new-lines if
1684         in_deferred_pragma or if parsing_args and there is still
1685         data in the current buffer.
1687         * include/cpplib.h (cpp_token_val_index): Change parameter type to
1688         const cpp_token *.
1689         * lex.c (cpp_token_val_index): Likewise.
1691         PR preprocessor/57757
1692         * lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING
1693         or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that
1694         starts if a-zA-Z_.
1696 2013-06-28  Ed Smith-Rowland  <3dw4rd@verizon.net>
1698         * lex.c (lex_raw_string(), lex_string()): Constrain suffixes treated
1699         as concatenated literal and macro to just the patterns found in
1700         inttypes.h; (is_macro()): New.
1702 2013-06-24  Dehao Chen  <dehao@google.com>
1704         * files.c (_cpp_stack_include): Fix the highest_location when header
1705         file is guarded by #ifndef and is included twice.
1707 2013-04-28  Jakub Jelinek  <jakub@redhat.com>
1709         N3472 binary constants
1710         * include/cpplib.h (struct cpp_options): Fix a typo in user_literals
1711         field comment.  Add binary_constants field.
1712         * init.c (struct lang_flags): Add binary_constants field.
1713         (lang_defaults): Add bin_cst column to the table.
1714         (cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants).
1715         * expr.c (cpp_classify_number): Talk about C++11 instead of C++0x
1716         in diagnostics.  Accept binary constants if
1717         CPP_OPTION (pfile, binary_constants) even when pedantic.  Adjust
1718         pedwarn message.
1720 2013-04-24  Paolo Carlini  <paolo.carlini@oracle.com>
1722         * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y.
1723         * init.c (lang_defaults): Add defaults for the latter.
1724         (cpp_init_builtins): Define __cplusplus as 201300L for the latter.
1725         * lex.c (_cpp_lex_direct): Update.
1727 2013-04-03  Sebastian Huber  <sebastian.huber@embedded-brains.de>
1729         PR target/56771
1730         * configure.ac: Require 64-bit int for arm*-*-rtems*.
1731         * configure: Regenerate.
1733 2013-03-06  Jakub Jelinek  <jakub@redhat.com>
1735         PR middle-end/56461
1736         * internal.h (struct cpp_buffer): Add to_free field.
1737         (_cpp_pop_file_buffer): Add third argument.
1738         * files.c (_cpp_stack_file): Set buffer->to_free.
1739         (_cpp_pop_file_buffer): Add to_free argument.  Free to_free
1740         if non-NULL, and if equal to file->buffer_start, also clear
1741         file->buffer{,_start,_valid}.
1742         * directives.c (_cpp_pop_buffer): Pass buffer->to_free
1743         to _cpp_pop_file_buffer.
1745 2013-03-01  Jakub Jelinek  <jakub@redhat.com>
1747         PR middle-end/56461
1748         * files.c (_cpp_save_file_entries): Free result at the end.
1749         * pch.c (cpp_string_free): New function.
1750         (cpp_save_state): Use it in htab_create call.
1751         (cpp_write_pch_deps): Free ss->defs.  Destroy ss->definedhash.
1753 2013-02-28  Jakub Jelinek  <jakub@redhat.com>
1755         * files.c (_cpp_find_file): If returning early, before storing
1756         something to *hash_slot and *hash_slot is NULL, call htab_clear_slot
1757         on it.  Access *hash_slot using void * type rather than
1758         struct file_hash_entry * to avoid aliasing issues.
1760         * configure.ac: Don't define ENABLE_CHECKING whenever
1761         --enable-checking is seen, instead use similar --enable-checking=yes
1762         vs. --enable-checking=release default as gcc/ subdir has and
1763         define ENABLE_CHECKING if ENABLE_CHECKING is defined in gcc/.
1764         Define ENABLE_VALGRIND_CHECKING if requested.
1765         * lex.c (new_buff): If ENABLE_VALGRIND_CHECKING, put _cpp_buff
1766         struct first in the allocated buffer and result->base after it.
1767         (_cpp_free_buff): If ENABLE_VALGRIND_CHECKING, free buff itself
1768         instead of buff->base.
1769         * config.in: Regenerated.
1770         * configure: Regenerated.
1772 2013-02-13  Ed Smith-Rowland  <3dw4rd@verizon.net>
1774         PR c++/55582
1775         * lex.c (lex_raw_string): Allow string literal with suffix
1776         beginning with 's' to be parsed as a C++11 user-defined literal.
1778 2013-01-14  Richard Sandiford  <rdsandiford@googlemail.com>
1780         Update copyright years.
1782 2013-01-04  Paolo Carlini  <paolo.carlini@oracle.com>
1784         PR c++/54526 (again)
1785         * lex.c (_cpp_lex_direct): In C++11 mode, implement 2.5 p3, bullet 2.
1787 2013-01-03  Marc Glisse  <marc.glisse@inria.fr>
1789         PR bootstrap/50177
1790         * line-map.c (get_combined_adhoc_loc): Cast from extern "C" type.
1791         (new_linemap): Likewise.
1792         (linemap_enter_macro): Likewise.
1794 2012-12-03  Jakub Jelinek  <jakub@redhat.com>
1796         PR bootstrap/55380
1797         PR other/54691
1798         * files.c (read_file_guts): Allocate extra 16 bytes instead of
1799         1 byte at the end of buf.  Pass size + 16 instead of size
1800         to _cpp_convert_input.
1801         * charset.c (_cpp_convert_input): Reallocate if there aren't
1802         at least 16 bytes beyond to.len in the buffer.  Clear 16 bytes
1803         at to.text + to.len.
1805 2012-11-21  Steve Ellcey  <sellcey@mips.com>
1807         PR pch/55399
1808         * files.c (pch_open_file): Fix check for implicit_preinclude.
1810 2012-11-16  Simon Baldwin  <simonb@google.com>
1812         * include/cpplib.h (struct cpp_options): Add canonical_system_headers.
1813         * files.c (find_file_in_dir): Call maybe_shorter_path() only if
1814         canonical_system_headers is set.
1815         * init.c (cpp_create_reader): Initialize canonical_system_headers.
1816         * configure.ac: Add new --enable-canonical-system-headers.
1817         * configure: Regenerate.
1818         * config.in: Regenerate.
1820 2012-11-09  Ed Smith-Rowland  <3dw4rd@verizon.net>
1822         PR c++/54413
1823         * include/cpplib.h (cpp_interpret_float_suffix): Add cpp_reader* arg.
1824         (cpp_interpret_int_suffix): Add cpp_reader* arg.
1825         * init.c (cpp_create_reader): Iitialize new flags.
1826         * expr.c (interpret_float_suffix): Use new flags.
1827         (cpp_interpret_float_suffix): Add cpp_reader* arg.
1828         (interpret_int_suffix): Use new flags.
1829         (cpp_interpret_int_suffix): Add cpp_reader* arg.
1830         (cpp_classify_number): Adjust calls to interpret_x_suffix.
1832 2012-10-23  Ian Bolton  <ian.bolton@arm.com>
1833             Jim MacArthur  <jim.macarthur@arm.com>
1834             Marcus Shawcroft  <marcus.shawcroft@arm.com>
1835             Nigel Stephens  <nigel.stephens@arm.com>
1836             Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
1837             Richard Earnshaw  <rearnsha@arm.com>
1838             Sofiane Naci  <sofiane.naci@arm.com>
1839             Stephen Thomas  <stephen.thomas@arm.com>
1840             Tejas Belagod  <tejas.belagod@arm.com>
1841             Yufeng Zhang  <yufeng.zhang@arm.com>
1843         * configure.ac: Enable AArch64.
1844         * configure: Regenerate.
1846 2012-10-23  Joseph Myers  <joseph@codesourcery.com>
1848         * files.c (struct _cpp_file): Add implicit_preinclude.
1849         (pch_open_file): Allow a previously opened implicitly included
1850         file.
1851         (_cpp_find_file): Add implicit_preinclude argument.  Free file and
1852         do not call open_file_failed if implicit_preinclude.  Store
1853         implicit_preinclude value.
1854         (_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date):
1855         Update calls to _cpp_find_file.
1856         (_cpp_stack_include): Handle IT_DEFAULT.
1857         (cpp_push_default_include): New.
1858         * include/cpplib.h (cpp_push_default_include): Declare.
1859         * init.c (cpp_read_main_file): Update call to _cpp_find_file.
1860         * internal.h (enum include_type): Add IT_DEFAULT.
1861         (_cpp_find_file): Update prototype.
1863 2012-10-15  Tobias Burnus  <burnus@net-b.de>
1865         * files.c (read_file_guts, _cpp_save_file_entries): Free memory
1866         before returning.
1867         * lex.c (warn_about_normalization): Ditto.
1868         * mkdeps.c (deps_save): Ditto.
1869         * pch.c (cpp_valid_state): Ditto.
1871 2012-10-04  Florian Weimer  <fweimer@redhat.com>
1873         * directives.c (do_pragma_warning_or_error): New.
1874         (do_pragma_warning): New.
1875         (do_pragma_error): New.
1876         (_cpp_init_internal_pragmas): Register new pragmas.
1878 2012-09-25  Dehao Chen  <dehao@google.com>
1880         PR middle-end/54704
1881         * line-map.c (location_adhoc_data_hash): Fix the hash function.
1883 2012-09-25  Dehao Chen  <dehao@google.com>
1885         PR middle-end/54645
1886         * include/line-map.h (location_adhoc_data): Move location_adhoc_data
1887         into GC.
1888         (location_adhoc_data_map): Likewise.
1889         (line_maps): Likewise.
1890         (rebuild_location_adhoc_htab): New Function.
1891         * line-map.c (+rebuild_location_adhoc_htab): new Funcion.
1892         (get_combined_adhoc_loc): Move location_adhoc_data into GC.
1893         (location_adhoc_data_fini): Likewise.
1894         (linemap_init): Likewise.
1895         (location_adhoc_data_init): Remove Function.
1897 2012-09-19  Dehao Chen  <dehao@google.com>
1899         * include/line-map.h (MAX_SOURCE_LOCATION): New value.
1900         (location_adhoc_data_fini): New.
1901         (get_combined_adhoc_loc): New.
1902         (get_data_from_adhoc_loc): New.
1903         (get_location_from_adhoc_loc): New.
1904         (location_adhoc_data_map): New.
1905         (COMBINE_LOCATION_DATA): New.
1906         (IS_ADHOC_LOC): New.
1907         (expanded_location): New field.
1908         (line_maps): New field.
1909         * line-map.c (location_adhoc_data): New.
1910         (location_adhoc_data_hash): New.
1911         (location_adhoc_data_eq): New.
1912         (location_adhoc_data_update): New.
1913         (get_combined_adhoc_loc): New.
1914         (get_data_from_adhoc_loc): New.
1915         (get_location_from_adhoc_loc): New.
1916         (location_adhoc_data_init): New.
1917         (location_adhoc_data_fini): New.
1918         (linemap_init): Initialize location_adhoc_data.
1919         (linemap_lookup): Change to use new location.
1920         (linemap_ordinary_map_lookup): Likewise.
1921         (linemap_macro_map_lookup): Likewise.
1922         (linemap_macro_map_loc_to_def_point): Likewise.
1923         (linemap_macro_map_loc_unwind_toward_spel): Likewise.
1924         (linemap_get_expansion_line): Likewise.
1925         (linemap_get_expansion_filename): Likewise.
1926         (linemap_location_in_system_header_p): Likewise.
1927         (linemap_location_from_macro_expansion_p): Likewise.
1928         (linemap_macro_loc_to_spelling_point): Likewise.
1929         (linemap_macro_loc_to_def_point): Likewise.
1930         (linemap_macro_loc_to_exp_point): Likewise.
1931         (linemap_resolve_location): Likewise.
1932         (linemap_unwind_toward_expansion): Likewise.
1933         (linemap_unwind_to_first_non_reserved_loc): Likewise.
1934         (linemap_expand_location): Likewise.
1935         (linemap_dump_location): Likewise.
1936         (linemap_line_start): Likewise.
1938 2012-05-25  Dodji Seketeli  <dodji@redhat.com>
1940         PR preprocessor/53469
1941         * directives.c (do_pragma): Use the virtual location for the
1942         pragma token, instead of its spelling location.
1944 2012-08-14   Diego Novillo  <dnovillo@google.com>
1946         Merge from cxx-conversion branch.  Configury.
1948         * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
1949         * configure.ac: Likewise.
1950         * configure: Regenerate.
1952 2012-08-14   Lawrence Crowl  <crowl@google.com>
1954         Merge from cxx-conversion branch.  New C++ hash table.
1956         * include/symtab.h (typedef struct ht hash_table): Change the typedef
1957         name to cpp_hash_table.  Update all users of the typedef.
1959 2012-07-30  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
1961         * include/line-map.h (line_map_macro): Use the "atomic" GTY option
1962         for the macro_locations field.
1964 2011-06-19  Uros Bizjak  <ubizjak@gmail.com>
1966         * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
1967         __builtin_ia32_pcmpestri128 instead of asm.
1969 2012-06-04  Dimitrios Apostolou <jimis@gmx.net>
1971         * line-map.c (linemap_enter_macro): Don't zero max_column_hint in
1972         every macro. This improves performance by reducing the number of
1973         reallocations when track-macro-expansion is on.
1975 2012-06-04  Dodji Seketeli  <dodji@redhat.com>
1977         PR preprocessor/53463
1978         * line-map.c (linemap_location_in_system_header_p): For built-in
1979         macro tokens, check the first expansion point location that is not
1980         for a token coming from a built-in macro.
1982 2012-05-29  Joseph Myers  <joseph@codesourcery.com>
1984         * directives.c: Fix typos.
1985         * include/line-map.h: Fix typos.
1986         * line-map.c: Fix typos.
1987         * macro.c: Fix typos.
1989 2012-05-25  Dodji Seketeli  <dodji@redhat.com>
1991         PR bootstrap/53459
1992         * lex.c (search_line_fast): Avoid unused local typedefs to simulate
1993         a static assertion.
1995 2012-05-29  Dodji Seketeli  <dodji@redhat.com>
1997         PR preprocessor/53229
1998         * internal.h (cpp_reader::set_invocation_location): Remove.
1999         (cpp_reader::about_to_expand_macro_p): New member flag.
2000         * directives.c (do_pragma):  Remove Kludge as
2001         pfile->set_invocation_location is no more.
2002         * macro.c (cpp_get_token_1): Do away with the use of
2003         cpp_reader::set_invocation_location.  Just collect the macro
2004         expansion point when we are about to expand the top-most macro.
2005         Do not override cpp_reader::about_to_expand_macro_p.
2006         This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding
2007         properly handle locations of expansion points.
2008         (cpp_get_token_with_location): Adjust, as
2009         cpp_reader::set_invocation_location is no more.
2010         (paste_tokens): Take a virtual location parameter for
2011         the LHS of the pasting operator.  Use it in diagnostics.  Update
2012         comments.
2013         (paste_all_tokens): Tighten the assert.  Propagate the location of
2014         the expansion point when no virtual locations are available.
2015         Pass the virtual location to paste_tokens.
2016         (in_macro_expansion_p): New static function.
2017         (enter_macro_context): Set the cpp_reader::about_to_expand_macro_p
2018         flag until we really start expanding the macro.
2020 2012-05-16  Dodji Seketeli  <dodji@redhat.com>
2022         PR preprocessor/7263
2023         * include/cpplib.h (cpp_classify_number): Take a location
2024         parameter.
2025         * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic
2026         macros that take a location parameter.
2027         (cpp_classify_number): Take a (virtual) location parameter.  Use
2028         it for diagnostics.  Adjust comments.
2029         (eval_token): Take a location parameter.  Pass it to
2030         cpp_classify_number and to diagnostic routines.
2031         (_cpp_parse_expr): Use virtual locations of tokens when parsing
2032         expressions.  Pass a virtual location to eval_token and to
2033         diagnostic routines.
2035 2012-05-10  Tristan Gingold  <gingold@adacore.com>
2037         * expr.c (interpret_float_suffix): Add a guard.
2039 2012-05-02  Dodji Seketeli  <dodji@redhat.com>
2041         Properly initialize cpp_context in destringize_and_run
2042         * directives.c (destringize_and_run): Properly initialize the new
2043         context.
2044         * macro.c (_cpp_pop_context): Assert that we shouldn't try to pop
2045         the initial base context, which has the same life time as the
2046         current instance of cpp_file.
2048 2012-04-30  Manuel López-Ibáñez  <manu@gcc.gnu.org>
2049             Dodji Seketeli  <dodji@seketeli.org>
2051         PR c++/52974
2052         * libcpp/files.c (maybe_shorter_path): New.
2053         (find_file_in_dir): Use it.
2055 2012-04-30  Dodji Seketeli  <dodji@redhat.com>
2057         Switch -ftrack-macro-expansion=2 on by default.
2058         * init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
2059         by default.  Add comments.
2061         Strip "<built-in>" loc from displayed expansion context
2062         * include/line-map.h (linemap_unwind_toward_expansion): Fix typo
2063         in comment.
2064         (linemap_unwind_to_first_non_reserved_loc): Declare new function.
2065         * line-map.c (linemap_unwind_to_first_non_reserved_loc): Define
2066         new function.
2068         Fix expansion point loc for macro-like tokens
2069         * macro.c (macro_of_context): New static function.
2070         (_cpp_push_token_context, push_extended_tokens_context): If the
2071         macro argument is NULL, it means we are continuing the expansion
2072         of the current macro, if any.  Update comments.
2073         (_cpp_pop_context): Re-enable expansion of the macro only when we
2074         are really out of the context of the current expansion.
2076         Fix token pasting with -ftrack-macro-expansion
2077         * macro.c (paste_all_tokens): Put the token resulting from pasting
2078         into an extended token context with -ftrack-macro-location is in
2079         effect.
2081         Fix cpp_sys_macro_p with -ftrack-macro-expansion
2082         * macro.c (cpp_sys_macro_p):  Support -ftrack-macro-expansion.
2084 2012-04-29  Dodji Seketeli  <dodji@redhat.com>
2086         * lex.c (lex_raw_string): Change C++ style comments into C style
2087         comments.
2088         (lex_string): Likewise.
2090 2012-04-27   Ollie Wild  <aaw@google.com>
2092         * include/cpplib.h (struct cpp_options): Add new field,
2093         warn_literal_suffix.
2094         (CPP_W_LITERAL_SUFFIX): New enum.
2095         * init.c (cpp_create_reader): Default initialization of
2096         warn_literal_suffix.
2097         * lex.c (lex_raw_string): Treat user-defined literals which don't
2098         begin with '_' as separate tokens and produce a warning.
2099         (lex_string): Ditto.
2101 2012-04-26  Manuel López-Ibáñez  <manu@gcc.gnu.org>
2103         * line-map.c (linemap_resolve_location): Synchronize comments with
2104         those in line-map.h.
2105         * include/line-map.h (linemap_resolve_location): Fix spelling in
2106         comment.
2108 2012-03-22  Richard Earnshaw  <rearnsha@arm.com>
2110         * lex.c (search_line_fast): Provide Neon-optimized version for ARM.
2112 2012-03-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
2114         * lex.c: Remove Solaris 8 reference.
2116 2012-02-14  Walter Lee  <walt@tilera.com>
2118         * configure.ac: Require 64-bit hwint for tilegx and tilepro.
2119         * configure: Regenerate.
2121 2012-01-09  Richard Guenther  <rguenther@suse.de>
2123         * macro.c (_cpp_builtin_macro_text): Remove unused variable map.
2125 2012-01-09  Gary Funck  <gary@intrepid.com>
2127         PR preprocessor/33919
2128         * files.c (_cpp_get_file_name): New. Implement file name
2129         access function.
2130         * internal.h (_cpp_get_file_name): New prototype.
2131         * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
2132         to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
2134 2012-01-03  Olivier Hainque  <hainque@adacore.com>
2136         * system.h: Prior to #define, #undef fopen and freopen unconditionally.
2138 2011-12-20  Joseph Myers  <joseph@codesourcery.com>
2140         * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
2141         (CLK_STDC1X): Change to CLK_STDC11.
2142         * init.c (lang_defaults): Update comments.
2143         (cpp_init_builtins): Update language tests.  Use 201112L for C11
2144         __STDC_VERSION__.
2146 2011-12-20  Andreas Schwab  <schwab@linux-m68k.org>
2148         * configure: Regenerate.
2150 2011-12-19  Andreas Schwab  <schwab@linux-m68k.org>
2152         * configure: Regenerate.
2154 2011-12-07  Jakub Jelinek  <jakub@redhat.com>
2156         PR bootstrap/50237
2157         * internal.h (_cpp_init_lexer): New prototype.
2158         * init.c (init_library): Call it.
2159         * lex.c (init_vectorized_lexer): Remove constructor attribute,
2160         add inline keyword.
2161         (HAVE_init_vectorized_lexer): Define.
2162         (_cpp_init_lexer): New function.
2164 2011-12-03  Dodji Seketeli  <dodji@redhat.com>
2166         * macro.c (tokens_buff_remove_last_token)
2167         (tokens_buff_put_token_to): Add an 'inline' function specifier to
2168         the prototype.
2170 2011-11-22   Diego Novillo  <dnovillo@google.com>
2172         * include/line-map.h (linemap_dump): Declare.
2173         (line_table_dump): Declare.
2174         * line-map.c (linemap_dump): New.
2175         (line_table_dump): New.
2177 2011-11-21  Ed Smith-Rowland  <3dw4rd@verizon.net>
2179         PR c++/50958
2180         * expr.c (cpp_userdef_char_remove_type): Fix typo.
2182 2011-11-03  Michael Matz  <matz@suse.de>
2184         PR bootstrap/50857
2185         * configure.ac: Check for -fno-exceptions -fno-rtti.
2186         * configure: Regenerate.
2187         * Makefile.in (NOEXCEPTION_FLAGS): New flag.
2188         (ALL_CXXFLAGS): Use it.
2190 2011-11-02  Paolo Carlini  <paolo.carlini@oracle.com>
2192         * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
2194 2011-11-02  Jason Merrill  <jason@redhat.com>
2196         PR c++/50810
2197         * configure.ac: Add -Wno-narrowing to warning options.
2199 2011-10-31  Jason Merrill  <jason@redhat.com>
2201         PR libstdc++/1773
2202         * init.c (cpp_init_builtins): Set __cplusplus for C++11.
2204         PR c++/50920
2205         * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
2206         CLK_GNUCXX0X to CLK_GNUCXX11.
2208 2011-10-26  Ed Smith-Rowland  <3dw4rd@verizon.net>
2210         Implement C++11 user-defined literals.
2211         * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
2212         cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
2213         cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
2214         cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
2215         (cpp_classify_number): Classify unrecognized tokens as user-defined
2216         literals.
2217         * include/cpplib.h: Add new tokens for user-defined literals.
2218         * init.c: Add new preprocessor flag (cxx11).
2219         * lex.c: (lex_string, lex_raw_string): Handle user-defined literals
2220         including concatenation and promotion with suffixes.
2222 2011-10-24  Dodji Seketeli  <dodji@redhat.com>
2224         * line-map.c (linemap_macro_map_lookup): Fix logic.
2226 2011-10-24  Dodji Seketeli  <dodji@redhat.com>
2228         * include/line-map.h (linemap_expand_location): Take a line table
2229         parameter.  Update comment.
2230         (linemap_resolve_location): Update comment.
2231         (linemap_expand_location_full): Remove.
2232         * line-map.c (linemap_resolve_location):  Handle reserved
2233         locations; return a NULL map in those cases.
2234         (linemap_expand_location): If location is reserved, return a
2235         zeroed expanded location.  Update comment.  Take a line table to
2236         assert that the function takes non-virtual locations only.
2237         (linemap_expand_location_full): remove.
2238         (linemap_dump_location): Handle the fact that
2239         linemap_resolve_location can return NULL line maps when the
2240         location resolves to a reserved location.
2242         * line-map.c (linemap_macro_map_lookup): Fix logic.
2244 2011-10-22  Dodji Seketeli  <dodji@redhat.com>
2246         PR bootstrap/50778
2247         * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
2248         context to act upon.
2249         * lex.c (_cpp_remaining_tokens_num_in_context): Likewise.  Update
2250         comment.
2251         (cpp_token_from_context_at): Likewise.
2252         (cpp_peek_token): Use the context to peek tokens from.
2254 2011-10-20  Dodji Seketeli  <dodji@redhat.com>
2256         PR bootstrap/50801
2257         * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
2258         number of tokens.
2260 2011-10-18  Dodji Seketeli  <dodji@redhat.com>
2262         PR bootstrap/50760
2263         * include/line-map.h (struct linemap_stats): Change the type of
2264         the members from size_t to long.
2265         * macro.c (macro_arg_token_iter_init): Unconditionally initialize
2266         iter->location_ptr.
2268 2011-10-17  Dodji Seketeli  <dodji@redhat.com>
2270         * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
2271         variable without using it if ENABLE_CHECKING is not defined.  Mark
2272         the LOCATION parameter as being unused.
2274 2011-10-15  Tom Tromey  <tromey@redhat.com>
2275             Dodji Seketeli  <dodji@redhat.com>
2277         * include/line-map.h (struct line_maps::alloced_size_for_request):
2278         New member.
2279         * line-map.c (new_linemap): Use set->alloced_size_for_request to
2280         get the actual allocated size of line maps.
2282 2011-10-15  Tom Tromey  <tromey@redhat.com>
2283             Dodji Seketeli  <dodji@redhat.com>
2285         * line-map.h (struct linemap_stats): Declare new struct.
2286         (linemap_get_statistics): Declare ...
2287         * line-map.c (linemap_get_statistics):  ... new function.
2288         * macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
2289         Declare new counters.
2290         (enter_macro_context, replace_args): Update
2291         num_macro_tokens_counter.
2292         (cpp_get_token_1): Update num_expanded_macros_counter.
2294 2011-10-15  Tom Tromey  <tromey@redhat.com>
2295             Dodji Seketeli  <dodji@redhat.com>
2297         * include/cpplib.h (struct cpp_options)<debug>: New struct member.
2298         * include/line-map.h (linemap_dump_location): Declare ...
2299         * line-map.c (linemap_dump_location): ... new function.
2301 2011-10-15  Tom Tromey  <tromey@redhat.com>
2302             Dodji Seketeli  <dodji@redhat.com>
2304         * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
2305         New option.
2306         * internal.h (struct macro_context): New struct.
2307         (enum context_tokens_kind): New enum.
2308         (struct cpp_context)<tokens_kind>: New member of type enum
2309         context_tokens_kind.
2310         (struct cpp_context)<macro>: Remove this.  Replace it with an enum
2311         of macro and  macro_context.
2312         (struct cpp_context)<direct_p>: Remove.
2313         (_cpp_remaining_tokens_num_in_context): Declare new function.
2314         * directives.c (destringize_and_run): Adjust.
2315         * lex.c (_cpp_remaining_tokens_num_in_context)
2316         (_cpp_token_from_context_at): Define new functions
2317         (cpp_peek_token): Use them.
2318         * init.c (cpp_create_reader): Initialize the base context to zero.
2319         (_cpp_token_from_context_at): Define new static function.
2320         (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
2321         _cpp_token_from_context_at.
2322         * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
2323         members.
2324         (enum macro_arg_token_kind): New enum.
2325         (struct macro_arg_token_iter): New struct.
2326         (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
2327         (alloc_expanded_arg_mem, ensure_expanded_arg_room)
2328         (delete_macro_args, set_arg_token, get_arg_token_location)
2329         (arg_token_ptr_at, macro_arg_token_iter_init)
2330         (macro_arg_token_iter_get_token)
2331         (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
2332         (expanded_token_index, tokens_buff_new, tokens_buff_count)
2333         (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
2334         (tokens_buff_add_token, tokens_buff_remove_last_token)
2335         (reached_end_of_context, consume_next_token_from_context): New
2336         static functions.
2337         (cpp_get_token_1): New static function. Split and extended from
2338         cpp_get_token.  Use reached_end_of_context and
2339         consume_next_token_from_context.  Unify its return point.  Move
2340         the location tweaking from cpp_get_token_with_location in here.
2341         (cpp_get_token): Use cpp_get_token_1
2342         (stringify_arg): Use the new arg_token_at.
2343         (paste_all_tokens): Support tokens coming from extended tokens
2344         contexts.
2345         (collect_args): Return the number of collected arguments, by
2346         parameter.  Store virtual locations of tokens that constitute the
2347         collected args.
2348         (funlike_invocation_p): Return the number of collected arguments,
2349         by parameter.
2350         (enter_macro_context): Add a parameter for macro expansion point.
2351         Pass it to replace_args and to the "used" cpp callback.  Get the
2352         number of function-like macro arguments from funlike_invocation_p,
2353         pass it to the new delete_macro_args to free the memory used by
2354         macro args.  When -ftrack-macro-expansion is in effect, for macros
2355         that have no arguments, create a macro map for the macro expansion
2356         and use it to allocate proper virtual locations for tokens
2357         resulting from the expansion.  Push an extended tokens context
2358         containing the tokens resulting from macro expansion and their
2359         virtual locations.
2360         (replace_args): Rename the different variables named 'count' into
2361         variables with more meaningful names.  Create a macro map;
2362         allocate virtual locations of tokens resulting from this
2363         expansion.  Use macro_arg_token_iter to iterate over tokens of a
2364         given macro.  Handle the case of the argument of
2365         -ftrack-macro-expansion being < 2.  Don't free macro arguments
2366         memory resulting from expand_arg here, as these are freed by the
2367         caller of replace_arg using delete_macro_args now.  Push extended
2368         token context.
2369         (next_context, push_ptoken_context, _cpp_push_token_context)
2370         (_cpp_push_text_context): Properly initialize the context.
2371         (expand_arg): Use the new alloc_expanded_arg_mem,
2372         push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
2373         (_cpp_pop_context): Really free the memory held by the context.
2374         Handle freeing memory used by extended tokens contexts.
2375         (cpp_get_token_with_location): Use cpp_get_token_1.
2376         (cpp_sys_macro_p): Adjust.
2377         (_cpp_backup_tokens): Support the new kinds of token contexts.
2378         * traditional.c (recursive_macro): Adjust.
2380 2011-10-15  Tom Tromey  <tromey@redhat>
2381             Dodji Seketeli  <dodji@redhat.com>
2383         * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
2384         member.
2385         (MAX_SOURCE_LOCATION): New constant.
2386         (struct line_map_ordinary, struct line_map_macro): New structs.
2387         (struct line_map): Turn this into a union of the two above.  Add
2388         comments.
2389         (struct maps_info): New struct.
2390         (struct line_maps)<info_ordinary, info_macro>: Two new fields.
2391         These now carry the map information that was previously scattered
2392         in struct line_maps.
2393         (struct map_info::allocated): Fix comment.
2394         (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
2395         (ORDINARY_MAP_STARTING_LINE_NUMBER)
2396         (ORDINARY_MAP_INCLUDER_FILE_INDEX)
2397         (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
2398         (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
2399         (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
2400         (MACRO_MAP_EXPANSION_POINT_LOCATION)
2401         (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
2402         (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
2403         (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
2404         (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
2405         (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
2406         (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
2407         (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
2408         (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
2409         (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
2410         (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
2411         (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
2412         information.
2413         (linemap_check_ordinary, linemap_assert)
2414         (linemap_location_before_p): New macros.
2415         (linemap_position_for_line_and_column)
2416         (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
2417         (linemap_macro_expansion_map_p)
2418         (linemap_macro_map_loc_to_def_point)
2419         (linemap_macro_map_loc_unwind_once)
2420         (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
2421         (linemap_get_source_line linemap_get_source_column)
2422         (linemap_map_get_macro_name, linemap_get_file_path)
2423         (linemap_location_in_system_header_p)
2424         (linemap_location_from_macro_expansion_p): Declare new functions.
2425         (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
2426         (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
2427         accessors act on ordinary maps only.
2428         (INCLUDED_FROM): Return NULL for main files; use the new
2429         accessors.
2430         (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
2431         (struct expanded_location): Move here from gcc/input.h
2432         (linemap_resolve_location, linemap_expand_location)
2433         (linemap_expand_location_full): Declare new functions.
2434         * line-map.c: Include cpplib.h, internal.h
2435         (linemap_enter_macro, linemap_add_macro_token)
2436         (linemap_get_expansion_line, linemap_get_expansion_filename): New
2437         functions that are private to libcpp.
2438         (linemap_assert): New macro.
2439         (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
2440         (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
2441         (linemap_macro_map_loc_unwind_toward_spelling)
2442         (linemap_macro_map_loc_to_exp_point)
2443         (first_map_in_common_1, first_map_in_common): New static
2444         functions.
2445         (new_linemap): Define new static functions.  Extracted and
2446         enhanced from ...
2447         (linemap_add): ... here.  Use linemap_assert in lieu of abort
2448         previously.
2449         (linemap_tracks_macro_expansion_locs_p)
2450         (linemap_add_macro_token, linemap_macro_expansion_map_p)
2451         (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
2452         (linemap_macro_map_loc_to_def_point)
2453         (linemap_macro_map_loc_unwind_once)
2454         (linemap_step_out_once, linemap_map_get_index)
2455         (linemap_get_source_line,linemap_get_source_column)
2456         (linemap_get_file_path, linemap_map_get_macro_name)
2457         (linemap_location_in_system_header_p)
2458         (linemap_location_originated_from_system_header_p)
2459         (linemap_location_from_macro_expansion_p)
2460         (linemap_tracks_macro_expansion_locs_p)
2461         (linemap_resolve_location, linemap_expand_location)
2462         (linemap_expand_location_full)
2463         (linemap_tracks_macro_expansion_locs_p)
2464         (linemap_position_for_line_and_column, linemap_compare_locations):
2465         Define new public functions.
2466         (linemap_init): Initialize ordinary and macro maps information in
2467         the map set.
2468         (linemap_check_files_exited): Use the new accessors.
2469         (linemap_free): Remove this dead code.
2470         (linemap_line_start): Assert this uses an ordinary map.  Adjust to
2471         use the new ordinary map accessors and data structures.  Don't
2472         overflow past the lowest possible macro token's location.
2473         (linemap_position_for_column): Assert the ordinary maps of the map
2474         set are really ordinary.  Use ordinary map accessors.
2475         (linemap_lookup): Keep the same logic but generalize to allow
2476         lookup of both ordinary and macro maps.  Do not crash when called
2477         with an empty line table.
2478         * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
2479         new API of line-map.h.
2480         * directives.c (start_directive, do_line, do_linemarker)
2481         (do_linemarker): Likewise.
2482         * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
2483         (make_cpp_dir, cpp_make_system_header): Likewise.
2484         * init.c (cpp_read_main_file): Likewise.
2485         * internal.h (CPP_INCREMENT_LINE): Likewise.
2486         (linemap_enter_macro, linemap_add_macro_token)
2487         (linemap_get_expansion_line, linemap_get_expansion_filename): New
2488         functions private to libcpp.
2489         * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
2490         (skip_line_comment, skip_whitespace, lex_raw_string)
2491         (_cpp_lex_direct): Likewise.
2492         * macro.c (_cpp_builtin_macro_text): Likewise.
2493         (_cpp_aligned_alloc): Initialize the new name member of the macro.
2494         * traditional.c (copy_comment, _cpp_scan_out_logical_line):
2495         Likewise.
2496         * errors.c (cpp_diagnostic): Adjust to new linemap API.
2498 2011-08-28  Dodji Seketeli  <dodji@redhat.com>
2500         * line-map.c (linemap_add): Assert that reason must not be
2501         LC_RENAME when called for the first time on a "main input file".
2503 2011-08-22  Gabriel Charette  <gchare@google.com>
2505         * init.c (cpp_create_reader): Inititalize forced_token_location_p.
2506         * internal.h (struct cpp_reader): Add field forced_token_location_p.
2507         * lex.c (_cpp_lex_direct): Use forced_token_location_p.
2508         (cpp_force_token_locations): New.
2509         (cpp_stop_forcing_token_locations): New.
2511 2011-08-18  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
2513         PR libstdc++/1773
2514         * init.c (cpp_init_builtins): Define __cplusplus 19971L.
2516 2011-08-18  Joseph Myers  <joseph@codesourcery.com>
2518         * include/cpplib.h (struct cpp_options): Fix typo.
2520 2011-08-18  Joseph Myers  <joseph@codesourcery.com>
2522         * include/cpplib.h (struct cpp_options): Add rliterals.
2523         * init.c  (struct lang_flags, lang_defaults): Add rliterals.
2524         (cpp_set_lang): Set rliterals option.
2525         (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
2526         * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
2528 2011-08-15  Gabriel Charette  <gchare@google.com>
2530         * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
2531         Update all users to use linemap_position_for_column instead.
2533 2011-07-28  Gabriel Charette  <gchare@google.com>
2535         * include/line-map.h (struct line_maps):
2536         Remove unused field last_listed. Update all users.
2538 2011-07-28  H.J. Lu  <hongjiu.lu@intel.com>
2540         * configure.ac: Set need_64bit_hwint to yes for x86 targets.
2541         * configure: Regenerated.
2543 2011-07-25  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
2545         * system.h [__cplusplus]: Wrap C function declarations in extern "C".
2547 2011-07-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
2548             Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2550         PR bootstrap/49794
2551         * configure.ac: Test AM_ICONV with CXX.
2552         * configure: Regenerate.
2553         * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
2555 2011-07-15  Dodji Seketeli  <dodji@redhat.com>
2557         * directives.c (struct if_stack): Use source_location as type
2558         here.
2559         * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
2560         indent, def_pragma, used_define, used_undef>: Properly use
2561         source_location as parameter type, rather than unsigned int.
2563 2011-07-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
2565         PR target/39150
2566         * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
2567         like i[34567]86-*-solaris2.1[0-9]*.
2568         * configure: Regenerate.
2570 2011-06-16  Jason Merrill  <jason@redhat.com>
2572         PR c++/45399
2573         * lex.c (lex_raw_string): Don't check for embedded NUL.
2575 2011-06-06  Dodji Seketeli  <dodji@redhat.com>
2577         PR preprocessor/48532
2578         * directives.c (do_pragma): Don't forget the invocation location
2579         when parsing the pragma name of a namespaced pragma directive.
2581 2011-05-29  John Tytgat  <John.Tytgat@aaug.net>
2583         * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
2585 2011-05-22  Uros Bizjak  <ubizjak@gmail.com>
2587         PR target/49104
2588         * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
2589         is defined.  Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
2591 2011-04-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
2593         * system.h (ENUM_BITFIELD): Remove.
2595 2011-04-24  Jakub Jelinek  <jakub@redhat.com>
2597         PR preprocessor/48740
2598         * lex.c (lex_raw_string): When raw string ends with
2599         ??) followed by raw prefix and ", ensure it is preprocessed
2600         with ??) rather than ??].
2602 2011-04-20  Jim Meyering  <meyering@redhat.com>
2604         * files.c (destroy_cpp_file): Remove useless if-before-free.
2605         * init.c (cpp_destroy): Likewise.
2606         * macro.c (replace_args): Likewise.
2607         * pch.c (cpp_valid_state): Likewise.
2609 2011-03-25  Kai Tietz  <ktietz@redhat.com>
2611         * files.c (file_hash_eq): Use filename_cmp
2612         instead of strcmp.
2613         (nonexistent_file_hash_eq): Likewise.
2614         (remap_filename): Likewise.
2615         Handle absolute DOS-path,
2616         (append_file_to_dir): Check for IS_DIR_SEPARATOR
2617         instead of slash.
2618         (read_name_map): Likewise.
2619         * linemap.c (linemap_add): Use filename_cmp
2620         instead of strcmp.
2621         * mkdeps.c (apply_vpath): Use filename_ncmp
2622         instead of strncmp.
2623         (deps_restore): Use filename_cmp instead of
2624         strcmp.
2625         * init.c (read_original_directory): Use
2626         IS_DIR_SEPARATOR instead of checking for slash.
2628 2011-03-21  Michael Meissner  <meissner@linux.vnet.ibm.com>
2630         PR preprocessor/48192
2631         * directives.c (do_ifdef): Do not consider conditional macros as
2632         being defined.
2633         (do_ifndef): Ditto.
2634         * expr.c (parse_defined): Ditto.
2636 2011-03-18  Richard Henderson  <rth@redhat.com>
2638         PR bootstrap/45381
2639         * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
2641 2011-11-04  Eric Botcazou  <ebotcazou@adacore.com>
2642             Jakub Jelinek  <jakub@redhat.com>
2644         PR preprocessor/39213
2645         * directives.c (end_directive): Call _cpp_remove_overlay for deferred
2646         pragmas as well in traditional mode.
2648 2010-11-17  Ian Lance Taylor  <iant@google.com>
2650         PR bootstrap/45538
2651         * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS.  Remove switch of
2652         AC_LANG based on ENABLE_BUILD_WITH_CXX.
2654 2010-11-16  Kai Tietz  <kai.tietz@onevision.com>
2656         PR preprocessor/17349
2657         * lex.c (save_comment): Handle in argument passing c++
2658         comments special.
2660 2010-11-02  Ian Lance Taylor  <iant@google.com>
2662         * configure.ac: Use AC_SYS_LARGEFILE.
2663         * configure: Rebuild.
2664         * config.in: Rebuild.
2666 2010-10-19  Basile Starynkevitch  <basile@starynkevitch.net>
2668         * line-map.h (source_location): Remove obsolete comment
2669         mentioning location_s.
2671 2010-09-29  Kai Tietz  <kai.tietz@onevision.com>
2673         PR preprocessor/45362
2674         * directives.c (cpp_pop_definition): Make static.
2675         (do_pragma_push_macro): Reworked to store text
2676         definition.
2677         (do_pragma_pop_macro): Add free text definition.
2678         (cpp_push_definition): Removed.
2679         * include/cpplib.h (cpp_push_definition): Removed.
2680         (cpp_pop_definition): Likewise.
2681         * internal.h (def_pragma_macro): Remove member 'value'
2682         and add new members 'definition', 'line',
2683         'syshdr', 'sued' and 'is_undef'.
2684         * pch.c (_cpp_restore_pushed_macros): Rework to work
2685         on text definition and store additional macro flags.
2686         (_cpp_save_pushed_macros): Likewise.
2688 2010-09-29  Joseph Myers  <joseph@codesourcery.com>
2690         * include/cpplib.h (cpp_options): Rename warn_deprecated,
2691         warn_traditional, warn_long_long and pedantic.
2692         * directives.c (directive_diagnostics, _cpp_handle_directive):
2693         Update names of cpp_options members.
2694         * expr.c (cpp_classify_number, eval_token): Update names of
2695         cpp_options members.
2696         * init.c (cpp_create_reader, post_options): Update names of
2697         cpp_options members.
2698         * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
2699         cpp_options members.
2700         * macro.c (parse_params): Update names of cpp_options members.
2702 2010-09-15  Ian Lance Taylor  <iant@google.com>
2704         * init.c: Fix type name in comment.
2706 2010-08-31  Jakub Jelinek  <jakub@redhat.com>
2708         PR preprocessor/45457
2709         * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
2710         needed.
2711         * directives.c (do_ifdef, do_ifndef): Likewise.
2713 2010-08-26  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
2715         * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
2717 2010-08-24  Richard Henderson  <rth@redhat.com>
2719         PR bootstrap/45376
2720         * configure.ac (HAVE_SSE4): New check.
2721         * configure, config.in: Rebuild.
2722         * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
2724 2010-08-24  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
2726         * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
2727         etc. on Solaris 2/x86.
2729 2010-08-21  Richard Henderson  <rth@redhat.com>
2730             Andi Kleen <ak@linux.intel.com>
2731             David S. Miller  <davem@davemloft.net>
2733         * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
2734         (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
2735         (ptrdiff_t): Check via AC_CHECK_TYPE.
2736         * config.in, configure: Rebuild.
2737         * system.h: Include stdint.h, if available.
2738         * lex.c (WORDS_BIGENDIAN): Provide default.
2739         (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
2740         acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
2741         search_line_sse2, search_line_sse42, init_vectorized_lexer,
2742         search_line_fast): New.
2743         (_cpp_clean_line): Use search_line_fast.  Restructure the fast
2744         loop to make it clear when we're leaving the loop.  Stay in the
2745         fast loop for non-trigraph '?'.
2747 2010-06-11  Jakub Jelinek  <jakub@redhat.com>
2749         * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
2750         callback.
2751         (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
2752         (cpp_macro_definition): Remove const qual from second argument.
2753         * macro.c (enter_macro_context): Call user_builtin_macro callback for
2754         NODE_BUILTIN !NODE_USED macros.
2755         (warn_of_redefinition): Likewise.  Remove const qual from second
2756         argument.
2757         (cpp_macro_definition): Likewise.
2758         * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
2759         for NODE_BUILTIN !NODE_USED macros.
2761 2010-06-10  Joseph Myers  <joseph@codesourcery.com>
2763         * include/cpplib.h (struct cpp_options): Remove show_column.
2764         * init.c (cpp_create_reader, post_options): Don't set show_column.
2766 2010-06-09  Joern Rennecke  <joern.rennecke@embecosm.com>
2768         PR bootstrap/44432
2769         * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
2770         check that C++ compiler works.
2771         * configure: Regenerate.
2773 2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
2775         * include/symtab.h (ht_identifier_ptr): New.
2777 2010-06-03  Joern Rennecke <joern.rennecke@embecosm.com>
2778             Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2780         PR bootstrap/42798
2781         * configure.ac: Check for declaration of 'basename(char *)'.
2782         * configure: Regenerate.
2783         * config.in: Regenerate.
2785 2010-04-25  Joseph Myers  <joseph@codesourcery.com>
2787         * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
2788         * init.c (lang_defaults): Add entries for new language variants.
2789         (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
2790         variants.
2792 2010-04-09  Manuel López-Ibáñez <manu@gcc.gnu.org>
2794         PR cpp/43195
2795         * files.c (report_missing_guard): Test for #pragma once.
2797 2010-04-07  Simon Baldwin  <simonb@google.com>
2799         * directives.c (do_diagnostic): Add warning reason argument,
2800         call appropriate error reporting function for code.
2801         (directive_diagnostics): Call specific warning functions with
2802         warning reason where appropriate.
2803         (do_error, do_warning, do_pragma_dependency): Add warning reason
2804         argument to do_diagnostic calls.
2805         * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
2806         _cpp_create_definition): Call specific warning functions with
2807         warning reason where appropriate.
2808         * Makefile.in: Add new diagnostic functions to gettext translations.
2809         * include/cpplib.h (struct cpp_callbacks): Add warning reason code
2810         to error callback.
2811         (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
2812         CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
2813         (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
2814         CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
2815         CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
2816         CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
2817         CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
2818         CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
2819         CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
2820         warning reason codes.
2821         (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
2822         cpp_warning_with_line, cpp_pedwarning_with_line,
2823         cpp_warning_with_line_syshdr): New specific error reporting functions.
2824         * pch.c (cpp_valid_state): Call specific warning functions with
2825         warning reason where appropriate.
2826         * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
2827         diagnostic handlers.
2828         (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
2829         cpp_warning_with_line, cpp_pedwarning_with_line,
2830         cpp_warning_with_line_syshdr): New specific error reporting functions.
2831         * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
2832         specific warning functions with warning reason where appropriate.
2833         * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
2834         warn_about_normalization, lex_identifier_intern, lex_identifier,
2835         _cpp_lex_direct): Ditto.
2836         * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
2837         narrow_str_to_charconst): Ditto.
2839 2010-04-06  Jakub Jelinek  <jakub@redhat.com>
2841         PR preprocessor/43642
2842         * lex.c (lex_raw_string): Change type of TYPE variable to
2843         unsigned char.
2845 2010-04-02  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2847         * aclocal.m4: Regenerate.
2849 2010-03-29  Jason Merrill  <jason@redhat.com>
2851         More N3077 raw string changes
2852         * charset.c (cpp_interpret_string): Don't transform UCNs in raw
2853         strings.
2854         * lex.c (bufring_append): Split out from...
2855         (lex_raw_string): ...here.  Undo trigraph and line splicing
2856         transformations.  Do process line notes in multi-line literals.
2857         (_cpp_process_line_notes): Ignore notes that were already handled.
2859         Some raw string changes from N3077
2860         * charset.c (cpp_interpret_string): Change inner delimiters to ().
2861         * lex.c (lex_raw_string): Likewise.  Also disallow '\' in delimiter.
2863 2010-02-11  Jakub Jelinek  <jakub@redhat.com>
2865         * init.c (read_original_filename): Don't call read_original_directory
2866         if _cpp_handle_directive returns 0.
2868 2010-01-01  Joseph Myers  <joseph@codesourcery.com>
2870         PR preprocessor/41947
2871         * expr.c (cpp_classify_number): Give error for hexadecimal
2872         floating-point constant with no digits before or after point.
2874 2009-11-20  Arnaud Charlet  <charlet@adacore.com>
2876         * macro.c (enter_macro_context): Call cb.used callback if defined.
2877         * directives.c (do_idef, do_ifndef): Ditto.
2878         * include/cpplib.h (struct cpp_callbacks): Add used callback.
2880 2009-11-11  Kai Tietz  <kai.tietz@onevision.com>
2882         * directives.c (do_pragma_push_macro): New pragma handler.
2883         (do_pragma_pop_macro): Likewise.
2884         (_cpp_init_internal_pragmas): Add push_macro and
2885         pop_macro handler to internal pragmas.
2886         (lex_macro_node_from_str): Removed.
2887         (cpp_push_definition): Replace lex_macro_node_from_str
2888         by _cpp_lex_identifier.
2889         (cpp_pop_definition): Likewise.
2890         * internal.h (_cpp_lex_identifier): New prototype.
2891         (def_pragma_macro): New structure.
2892         (cpp_reader): New member pushed_macros.
2893         * lex.c (_cpp_lex_identifier): New function.
2894         (lex_identifier_intern): New function.
2895         * init.c (cpp_create_reader): Initialize pushed_macros
2896         member.
2897         (cpp_destroy): Free elements in pushed_macros member.
2898         * pch.c (_cpp_save_pushed_macros): New function.
2899         (_cpp_restore_pushed_macros): Likewise.
2900         (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
2901         (cpp_read_state): Use _cpp_restore_pushed_macros.
2903 2009-10-19  Jakub Jelinek  <jakub@redhat.com>
2905         * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
2906         (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
2907         and char32_cset_desc.
2908         (converter_for_type): Handle CPP_UTF8STRING.
2909         (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
2910         * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
2911         (parse_include): Reject raw strings.
2912         * include/cpplib.h (CPP_UTF8STRING): New token type.
2913         * internal.h (struct cpp_reader): Add utf8_cset_desc field.
2914         * lex.c (lex_raw_string): New function.
2915         (lex_string): Handle u8 string literals, call lex_raw_string
2916         for raw string literals.
2917         (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
2918         sequences.
2919         * macro.c (stringify_arg): Handle CPP_UTF8STRING.
2921 2009-10-14  Jakub Jelinek  <jakub@redhat.com>
2923         PR preprocessor/41543
2924         * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
2925         * line-map.c (linemap_init): Initialize highest_location and
2926         highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
2928 2009-10-09  Jason Merrill  <jason@redhat.com>
2930         * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
2932 2009-10-09  Neil Vachharajani <nvachhar@google.com>
2934         * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
2935         sccs.
2937 2009-09-23  Loren J. Rittle  <ljrittle@acm.org>
2939         * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
2940         * configure: Rebuilt.
2942 2009-09-22  Richard Guenther  <rguenther@suse.de>
2944         PR pch/38987
2945         * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
2947 2009-09-18  Chris Demetriou  <cgd@google.com>
2949         PR preprocessor/28435:
2950         * include/cpplib.h (struct cpp_options): Add new member
2951         deps.need_preprocessor_output.
2952         * files.c (open_file_failed): If preprocessor output is needed
2953         always report an error.
2955 2009-09-13  Kai Tietz  <kai.tietz@onevision.com>
2957         * configure.ac: Set for i?86-w64-mingw*
2958         need_64bit_hwint to yes.
2959         * configure: Regenerated.
2961 2009-09-10  Jason Merrill  <jason@redhat.com>
2963         * directives.c (cpp_define): constify.
2965 2009-09-02  Ian Lance Taylor  <iant@google.com>
2967         * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
2969 2009-08-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2971         * configure.ac (AC_PREREQ): Bump to 2.64.
2973 2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2975         * aclocal.m4: Regenerate.
2976         * config.in: Regenerate.
2977         * configure: Regenerate.
2979 2009-08-17  Tom Tromey  <tromey@redhat.com>
2981         PR preprocessor/41067:
2982         * charset.c (convert_escape): Add missing ":" to error text.
2984 2009-07-27  Douglas B Rupp  <rupp@gnat.com>
2986         * include/cpplib.h (INO_T_CPP): New macro.
2987         (struct cpp_dir): Use it.
2989 2009-07-20  Jerry Quinn  <jlquinn@optonline.net>
2991         PR regression/40800
2992         * configure.ac: Use = instead of == for testing
2993         ENABLE_BUILD_WITH_CXX.
2994         * configure: Rebuild.
2996 2009-07-17  Jerry Quinn  <jlquinn@optonline.net>
2998         * directives.c (do_linemarker, do_line): Use CPP_STRING for
2999         ignored enum value.
3000         * files.c (find_file_in_dir): Add cast from void* to char*.
3001         * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
3002         * Makefile.in: (WARN_CFLAGS): Use general and C-specific
3003         warnings.
3004         (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
3005         ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
3006         COMPILER_FLAGS): New.
3007         (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
3008         (COMPILE.base): Use COMPILER instead of CC.  Use COMPILER_FLAGS
3009         instead of ALL_CFLAGS.
3010         * configure.ac: Invoke AC_PROG_CXX.  Separate C-specific warnings
3011         from other warnings.  Add -Wc++-compat to C-specific warnings.
3012         Check for --enable-build-with-cxx.  Set and substitute
3013         ENABLE_BUILD_WITH_CXX.  Invoke ZW_PROG_COMPILER_DEPENDENCIES
3014         according to ENABLE_BUILD_WITH_CXX.  Invoke AC_LANG before
3015         AC_CHECK_HEADERS.
3016         * configure: Rebuild.
3017         * include/cpp-id-data.h: Remove extern "C".
3018         * include/line-map.h: Likewise.
3019         * include/mkdeps.h: Likewise.
3020         * include/symtab.h: Likewise.
3021         * internal.h: Likewise.
3023 2009-06-23  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3025         * directives.c (parse_include): Add location argument. Update all
3026         calls.
3027         (parse_answer): Likewise.
3028         (do_include_common): Error with exact location.
3029         (parse_assertion): Likewise.
3031 2009-06-18  Manuel López-Ibáñez  <manu@gcc.gnu.org>
3033         * expr.c (num_div_op): Take explicit location.
3035 2009-06-17  Ian Lance Taylor  <iant@google.com>
3037         * include/cpplib.h (progname): Don't declare.
3039 2009-06-12  Ian Lance Taylor  <iant@google.com>
3041         * include/cpplib.h (struct cpp_options): Add
3042         warn_cxx_operator_names field.
3043         (NODE_WARN_OPERATOR): Define.
3044         (struct cpp_hashnode): Increase flags field to 10 bits, decrease
3045         type to 6 bits.
3046         * init.c (mark_named_operators): Add flags parameter.
3047         (cpp_post_options): Pick flags value to pass to
3048         mark_named_operators.
3049         * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
3050         identifier is an operator name in C++.
3052 2009-06-01  Aldy Hernandez  <aldyh@redhat.com>
3054         * include/line-map.h (LAST_SOURCE_COLUMN): New.
3056 2009-06-01  Ian Lance Taylor  <iant@google.com>
3058         * include/cpp-id-data.h: Add extern "C".
3059         * include/line-map.h: Likewise.
3060         * include/mkdeps.h: Likewise.
3061         * include/symtab.h: Likewise.
3062         * internal.h: Likewise.
3064 2009-05-15  Ian Lance Taylor  <iant@google.com>
3066         * include/cpplib.h (enum cpp_builtin_type): Rename from enum
3067         builtin_type.  Change all uses.
3069 2009-05-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3071         PR cpp/36674
3072         * directives (do_linemarker): Compensate for the increment in
3073         location that occurs when we reach the end of line.
3074         * files (_cpp_stack_include): Mention _cpp_find_file in the
3075         comment.
3077 2009-05-10  Joseph Myers  <joseph@codesourcery.com>
3079         * include/cpplib.h (enum cpp_token_fld_kind): Add
3080         CPP_TOKEN_FLD_TOKEN_NO.
3081         (struct cpp_macro_arg, struct cpp_identifier): Define.
3082         (union cpp_token_u): Use struct cpp_identifier for identifiers.
3083         Use struct cpp_macro_arg for macro arguments.  Add token_no for
3084         CPP_PASTE token numbers.
3085         * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
3086         do_pragma_poison, parse_assertion): Use val.node.node in place of
3087         val.node.
3088         * expr.c (parse_defined, eval_token): Use val.node.node in place
3089         of val.node.
3090         * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
3091         cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
3092         cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
3093         place of val.arg_no.  Use val.node.node in place of val.node.
3094         * macro.c (replace_args, cpp_get_token, parse_params,
3095         lex_expansion_token, create_iso_definition, cpp_macro_definition):
3096         Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
3097         Use val.node.node in place of val.node.
3099 2009-05-03  Joseph Myers  <joseph@codesourcery.com>
3101         * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
3102         UTF-8 sequences.
3104 2009-04-25  Joseph Myers  <joseph@codesourcery.com>
3106         PR preprocessor/39559
3107         * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
3108         constants larger than intmax_t in C99 mode.
3110 2009-04-21  Taras Glek <tglek@mozilla.com>
3112         * include/cpp-id-data.h: Update GTY annotations to new syntax.
3113         * include/cpplib.h: Likewise.
3114         * include/line-map.h: Likewise.
3115         * include/symtab.h: Likewise.
3117 2009-04-22  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3119         PR c++/14875
3120         * lex.c (cpp_type2name): Take a flags parameter. Call
3121         cpp_named_operator2name for named operators and cpp_digraph2name
3122         for digraphs.
3123         (cpp_digraph2name): New.
3124         (cpp_spell_token): Use it.
3125         (cpp_output_token): Likewise.
3126         * include/cpplib.h (cpp_type2name): Update declaration.
3127         * init.c (cpp_named_operator2name): New.
3128         * internal.h (cpp_named_operator2name): Declare.
3130 2009-04-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3132         PR c++/13358
3133         * init.c (cpp_create_reader): Wlong_long is disabled by default.
3134         * expr.c (cpp_classify_number): Give different messages for C and
3135         C++ front-ends.
3137 2009-04-19  Joseph Myers  <joseph@codesourcery.com>
3139         PR preprocessor/20078
3140         * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
3141         field.
3142         * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
3143         (struct cpp_token): Change flags to unsigned short.
3144         * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
3145         (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
3146         (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
3147         tokens.
3148         * macro.c (macro_real_token_count): New.
3149         (enter_macro_context, replace_args): Use macro_real_token_count.
3150         (create_iso_definition): Record whitespace surrounding and digraph
3151         spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
3152         Set extra_tokens and save CPP_PASTE tokens with arg_no set for
3153         multiple consecutive ## tokens.
3154         (_cpp_create_definition): Initialize extra_tokens.
3155         (cpp_macro_definition): Use macro_real_token_count.
3157 2009-04-18  Joseph Myers  <joseph@codesourcery.com>
3159         * directives.c (parse_include): Pass true to check_eol.
3161 2009-04-18  Joseph Myers  <joseph@codesourcery.com>
3163         PR preprocessor/39646
3164         * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
3165         * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
3166         * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
3167         place of LC_RENAME.
3169 2009-04-18  Joseph Myers  <joseph@codesourcery.com>
3171         PR preprocessor/39647
3172         * directives.c (check_eol): Add parameter expand.
3173         (do_undef, parse_include, do_line, do_linemarker, do_ident,
3174         do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
3175         do_else, do_endif, do_assert, do_unassert): All callers changed.
3176         Pass true from do_line, false elsewhere.
3178 2009-04-12  Joseph Myers  <joseph@codesourcery.com>
3180         PR preprocessor/31869
3181         * macro.c (stringify_arg): Handle NULL source token in padding
3182         token where previous padding token did not have source token with
3183         preceding whitespace.
3185 2009-04-09  Jakub Jelinek  <jakub@redhat.com>
3187         * Makefile.in: Change copyright header to refer to version
3188         3 of the GNU General Public License and to point readers at the
3189         COPYING3 file and the FSF's license web page.
3190         * charset.c: Likewise.
3191         * directives-only.c: Likewise.
3192         * directives.c: Likewise.
3193         * errors.c: Likewise.
3194         * expr.c: Likewise.
3195         * files.c: Likewise.
3196         * identifiers.c: Likewise.
3197         * include/cpp-id-data.h: Likewise.
3198         * include/cpplib.h: Likewise.
3199         * include/line-map.h: Likewise.
3200         * include/mkdeps.h: Likewise.
3201         * include/symtab.h: Likewise.
3202         * init.c: Likewise.
3203         * internal.h: Likewise.
3204         * lex.c: Likewise.
3205         * line-map.c: Likewise.
3206         * macro.c: Likewise.
3207         * makeucnid.c: Likewise.
3208         * mkdeps.c: Likewise.
3209         * pch.c: Likewise.
3210         * symtab.c: Likewise.
3211         * system.h: Likewise.
3212         * traditional.c: Likewise.
3213         * ucnid.tab: Likewise.
3214         * ucnid.h: Regenerate.
3216 2009-04-01  Janis Johnson  <janis187@us.ibm.com>
3218         PR c/39027
3219         * include/cpplib.h (CPP_N_DEFAULT): Define.
3220         * expr.c (interpret_float_suffix): Recognize d or D for double,
3221         return new value for default.
3222         (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
3224         PR c/33466
3225         * expr.c (interpret_float_suffix): Reject invalid suffix that uses
3226         letters from decimal float and fixed-point suffixes.
3228 2009-03-31  Joseph Myers  <joseph@codesourcery.com>
3230         PR preprocessor/15638
3231         * files.c (_cpp_find_file): Call open_file_failed after diagnosing
3232         invalid PCH.
3233         (open_file_failed): Make error for missing file fatal.
3234         * include/cpplib.h (CPP_DL_FATAL): Define.
3236 2009-03-30  Sergiy Vyshnevetskiy  <serg@vostok.net>
3238         PR preprocessor/31932:
3239         * internal.h: Don't mention HAVE_ICONV_H.
3240         * configure, config.in: Rebuild.
3241         * configure.ac: Don't check for iconv.h.
3243 2009-03-30  Tom Tromey  <tromey@redhat.com>
3245         PR preprocessor/39512:
3246         * line-map.c (linemap_init): Initialize 'reallocator' field.
3248 2009-03-30  Jakub Jelinek  <jakub@redhat.com>
3250         PR target/39558
3251         * macro.c (cpp_get_token): If macro_to_expand returns NULL
3252         and used some tokens, add CPP_PADDING before next token.
3254 2009-03-29  Joseph Myers  <joseph@codesourcery.com>
3256         PR preprocessor/34695
3257         * makedepend.c: Remove.
3258         * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
3259         (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
3260         * directives.c (cpp_errors): Remove.
3261         * errors.c (print_location, _cpp_begin_message, v_message):
3262         Remove.
3263         (cpp_error, cpp_error_with_line): Always use error callback.
3264         (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
3265         * include/cpplib.h (cpp_options): Remove pedantic_errors,
3266         inhibit_warnings, warn_system_headers, inhibit_errors,
3267         warnings_are_errors, client_diagnostic.
3268         (cpp_callbacks): Add extra arguments to error callback; make it
3269         return bool.
3270         (cpp_finish): Return void.
3271         (cpp_destroy): Remove inaccurate comment about return value.
3272         (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
3273         (CPP_DL_NOTE): Define.
3274         * include/line-map.h (linemap_print_containing_files): Remove.
3275         * init.c (cpp_finish): Do not check for or return number of
3276         errors.
3277         * internal.h (cpp_reader): Remove errors field.
3278         * line-map.c (linemap_print_containing_files): Remove.
3279         * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
3280         about previous definition.  Only emit it if previous diagnostic
3281         was emitted.
3283 2009-03-28  Joseph Myers  <joseph@codesourcery.com>
3285         * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
3286         mkinstalldirs.
3288 2009-03-18  Jakub Jelinek  <jakub@redhat.com>
3290         * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
3292 2009-02-21  Joseph Myers  <joseph@codesourcery.com>
3294         * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
3295         header name.
3296         (_cpp_lex_direct): Handle this.
3298 2009-02-15  Richard Guenther  <rguenther@suse.de>
3300         Revert last change.
3302 2009-02-13  Richard Guenther  <rguenther@suse.de>
3304         * configure.ac: Enable LFS.
3305         * configure: Re-generate.
3306         * config.in: Likewise.
3308 2009-01-05  Ben Elliston  <bje@au.ibm.com>
3310         * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
3311         (.po.pox): Likewise.
3312         (po/$(PACKAGE).pot): Likewise.
3314 2008-12-10  Alexandre Oliva  <aoliva@redhat.com>
3316         PR target/37033
3317         * pch.c (cpp_valid_state): Improve message for poisoned symbols.
3318         Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
3320 2008-11-29  Joseph Myers  <joseph@codesourcery.com>
3322         * lex.c (cpp_token_len): Use 6 as default length.
3324 2008-10-31  Manuel López-Ibáñez  <manu@gcc.gnu.org>
3326         * expr.c (struct op): Add location.
3327         (_cpp_parse_expr): Propagate locations throught the stack
3328         of expressions.
3329         (reduce): Likewise.
3330         (check_promotion): Use explicit location in errors.
3332 2008-10-05  Matthew Gingell  <gingell@adacore.com>
3333             Arnaud Charlet  <charlet@adacore.com>
3335         * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
3336         (cpp_get_comments): New function.
3337         * internal.h (struct cpp_reader): Add comments field.
3338         * init.c (cpp_destroy): Free comments.
3339         * lex.c (store_comment, cpp_get_comments): New functions.
3340         (comments): New struct.
3341         (save_comment): Store comments in comments struct.
3343 2008-09-18  Simon Baldwin  <simonb@google.com>
3345         * include/cpplib.h (struct cpp_options): Add new boolean flag
3346         warn_builtin_macro_redefined.
3347         * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
3348         * (struct builtin_operator): Split out from previous struct builtin,
3349         enhance extra const correctness.
3350         * (struct builtin_macro): Split out from previous struct builtin, add
3351         new always_warn_if_redefined flag, enhance const correctness.
3352         * (mark_named_operators): Use struct builtin_operator.
3353         * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
3354         to builtins selectively.
3355         * macro.c (warn_of_redefinition): Return false if a builtin macro
3356         is not flagged with NODE_WARN.
3358 2008-07-31  Jakub Jelinek  <jakub@redhat.com>
3360         PR preprocessor/36649
3361         * files.c (struct report_missing_guard_data): New type.
3362         (report_missing_guard): Put paths into an array instead of printing
3363         them right away.  Return 1 rather than 0.
3364         (report_missing_guard_cmp): New function.
3365         (_cpp_report_missing_guards): Sort and print paths gathered by
3366         report_missing_guard callback.
3368 2008-07-22  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3370         PR 28079
3371         * directives.c (strtolinenum): Handle overflow.
3372         (do_line): Give a warning if line number overflowed.
3373         (do_linemarker): Update call to strtolinenum.
3375 2008-07-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3377         * include/line-map.h (linenum_type): New typedef.
3378         (struct line_map): Use it.
3379         (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
3380         (SOURCE_COLUMN): Likewise.
3381         * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
3382         source_location values in a variable of type linenum_type.
3383         * directives.c (struct if_stack): Use linenum_type.
3384         (strtoul_for_line): Rename as strtolinenum.
3385         (do_line): Use linenum_type.
3386         (do_linemarker): Use linenum_type and strtolinenum.
3387         (_cpp_do_file_change): Use linenum_t.
3388         * line-map.c (linemap_add): Likewise.
3389         (linemap_line_start): Likewise.
3390         * traditional.c (struct fun_macro): 'line' is a source_location.
3391         * errors.c (print_location): Use linenum_type.
3392         * directives-only.c (_cpp_preprocess_dir_only): Likewise.
3393         * internal.h (CPP_INCREMENT_LINE): Likewise.
3394         * lex.c (_cpp_skip_block_comment): Use source_location.
3396 2008-07-14  Ben Elliston  <bje@au.ibm.com>
3398         * include/cpplib.h (NODE_CONDITIONAL): New.
3399         (struct cpp_callbacks): New macro_to_expand field.
3400         (struct cpp_hashnode): Adjust size of flags and type fields.
3401         (cpp_peek_token): Prototype.
3402         * lex.c (cpp_peek_token): New function.
3403         (_cpp_temp_token): Protect pre-existing lookaheads.
3404         * macro.c (cpp_get_token): Expand any conditional macros.
3405         (_cpp_backup_tokens_direct): New.
3406         (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
3407         (warn_of_redefinition): Silently allow redefined conditional
3408         macros.
3409         (_cpp_create_definition): Remove the conditional flag when a user
3410         defines one of the conditional macros.
3411         * internal.h (_cpp_backup_tokens_direct): New prototype.
3413 2008-06-13  Andrew Haley  <aph@redhat.com>
3415         PR preprocessor/33305
3416         * macro.c (replace_args): Print a warning for empty macro
3417         arguments in C89 and C++.
3419 2008-06-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3421         * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
3422         * configure: Regenerate.
3424 2008-06-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3426         * Makefile.in (datarootdir): New variable.
3428 2008-06-12  H.J. Lu  <hongjiu.lu@intel.com>
3430         PR preprocessor/36479
3431         * charset.c (cpp_interpret_string_notranslate): Also set
3432         narrow_cset_desc.width.
3434 2008-06-07  Joseph Myers  <joseph@codesourcery.com>
3436         * configure.ac (parisc*64*-*-*): Remove.
3437         * configure: Regenerate.
3439 2008-05-30  Tom Tromey  <tromey@redhat.com>
3441         PR preprocessor/36320:
3442         * internal.h (_cpp_parse_expr): Update.
3443         * expr.c (_cpp_parse_expr): Add 'is_if' argument.  Update error
3444         messages.
3445         * directives.c (do_if): Update.
3446         (do_elif): Require expression if processing group.
3448 2008-05-30  Danny Smith  <dannysmith@users.sourceforge.net>
3450         * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
3452 2008-05-21  Tom Tromey  <tromey@redhat.com>
3454         PR preprocessor/27777:
3455         * lex.c (cpp_output_line_to_string): New function.
3456         * internal.h (_cpp_begin_message): Don't declare.
3457         * errors.c (_cpp_begin_message): Now static.
3458         * include/cpplib.h (cpp_output_line_to_string): Declare.
3459         * directives.c (do_diagnostic): Rewrote.  Use
3460         cpp_output_line_to_string.  Don't use _cpp_begin_message.
3462 2008-05-21  Tom Tromey  <tromey@redhat.com>
3464         * include/symtab.h (HT_ALLOCED): Remove.
3465         (ht_purge): Declare.
3466         * symtab.c (DELETED): New define.
3467         (ht_lookup): Update comment.
3468         (ht_lookup_with_hash): Handle deleted entries.  Remove HT_ALLOCED
3469         code.  Use subobject allocator for strings, if it exists.
3470         (ht_expand): Handle deleted entries.
3471         (ht_forall): Likewise.
3472         (ht_purge): New function.
3473         (ht_dump_statistics): Print deletion statistics.
3475 2008-05-13  Tom Tromey  <tromey@redhat.com>
3477         PR preprocessor/22168:
3478         * include/cpplib.h (struct cpp_options) <objc>: Update
3479         documentation.
3480         * expr.c (eval_token): Warn for use of assertions.
3481         * directives.c (directive_diagnostics): Warn about extensions.
3482         (DEPRECATED): New define.
3483         (DIRECTIVE_TABLE): Use it.
3485 2008-05-06  Tom Tromey  <tromey@redhat.com>
3487         PR preprocessor/35313, PR preprocessor/36088:
3488         * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
3489         (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
3491 2008-05-04  David S. Miller  <davem@davemloft.net>
3493         * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
3494         * configure: Regenerate.
3496 2008-04-22  Daniel Franke  <franke.daniel@gmail.com>
3498         * include/cpplib.h (cpp_define_formatted): New.
3499         * directives.c (cpp_define_formatted): New.
3501 2008-04-21  Tom Tromey  <tromey@redhat.com>
3503         PR libcpp/33415:
3504         * charset.c (_cpp_convert_input): Add buffer_start argument.
3505         Ignore UTF-8 BOM if seen.
3506         * internal.h (_cpp_convert_input): Add argument.
3507         * files.c (struct _cpp_file) <buffer_start>: New field.
3508         (destroy_cpp_file): Free buffer_start, not buffer.
3509         (_cpp_pop_file_buffer): Likewise.
3510         (read_file_guts): Update.
3512 2008-04-18  Kris Van Hees <kris.van.hees@oracle.com>
3514         * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
3515         * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
3516         (struct cpp_options): Added uliterals.
3517         (cpp_interpret_string): Update prototype.
3518         (cpp_interpret_string_notranslate): Idem.
3519         * charset.c (init_iconv_desc): New width member in cset_converter.
3520         (cpp_init_iconv): Add support for char{16,32}_cset_desc.
3521         (convert_ucn): Idem.
3522         (emit_numeric_escape): Idem.
3523         (convert_hex): Idem.
3524         (convert_oct): Idem.
3525         (convert_escape): Idem.
3526         (converter_for_type): New function.
3527         (cpp_interpret_string): Use converter_for_type, support u and U prefix.
3528         (cpp_interpret_string_notranslate): Match changed prototype.
3529         (wide_str_to_charconst): Use converter_for_type.
3530         (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
3531         * directives.c (linemarker_dir): Macro U changed to UC.
3532         (parse_include): Idem.
3533         (register_pragma_1): Idem.
3534         (restore_registered_pragmas): Idem.
3535         (get__Pragma_string): Support CPP_STRING{16,32}.
3536         * expr.c (eval_token): Support CPP_CHAR{16,32}.
3537         * init.c (struct lang_flags): Added uliterals.
3538         (lang_defaults): Idem.
3539         * internal.h (struct cset_converter) <width>: New field.
3540         (struct cpp_reader) <char16_cset_desc>: Idem.
3541         (struct cpp_reader) <char32_cset_desc>: Idem.
3542         * lex.c (digraph_spellings): Macro U changed to UC.
3543         (OP, TK): Idem.
3544         (lex_string): Add support for u'...', U'...', u"..." and U"...".
3545         (_cpp_lex_direct): Idem.
3546         * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
3547         (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
3549 2008-04-18  Paolo Bonzini  <bonzini@gnu.org>
3551         PR bootstrap/35457
3552         * aclocal.m4: Regenerate.
3553         * configure: Regenerate.
3555 2008-04-17  Tom Tromey  <tromey@redhat.com>
3557         PR libcpp/34866:
3558         * errors.c (cpp_error): Don't reference a token before the start
3559         of the current run.
3561 2008-04-16  Tom Tromey  <tromey@redhat.com>
3563         * Makefile.in (TAGS_SOURCES): New variable.
3564         (TAGS): New target.
3566 2008-04-11  Kaz Kojima  <kkojima@gcc.gnu.org>
3568         * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
3569         and shbe-*-*.
3570         * configure: Rebuilt.
3572 2008-04-02  Joseph Myers  <joseph@codesourcery.com>
3574         * include/cpplib.h (struct cpp_callbacks): Add used_define,
3575         used_undef and before_define.
3576         (NODE_USED): Define.
3577         * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
3578         do_ifndef, cpp_pop_definition): Handle new flag and use new
3579         callbacks.
3580         * expr.c (parse_defined): Handle new flag and use new callbacks.
3581         * macro.c (enter_macro_context, _cpp_free_definition): Handle new
3582         flag and use new callbacks.
3584 2008-04-01  Jakub Jelinek  <jakub@redhat.com>
3586         PR pch/13675
3587         * files.c (struct _cpp_file): Remove pch field.
3588         (pch_open_file): Don't set file->pch, just file->pchname.
3589         (should_stack_file): After pfile->cb.read_pch call
3590         free pchname and clear pchname, don't close file->fd.
3591         Test file->pchname instead of file->pch.  Don't close fd after cb.
3592         (_cpp_stack_include): Test file->pchname instead of file->pch.
3594 2008-03-28  Tom Tromey  <tromey@redhat.com>
3596         * Makefile.in (POSTCOMPILE): New variable.
3597         (.c.o): Use it.
3599 2008-03-13  Tom Tromey  <tromey@redhat.com>
3601         PR libcpp/35322:
3602         * directives.c (destringize_and_run): Set pfile->directive.
3604 2008-03-06  Markus Milleder  <markus.milleder@generali.at>
3606         PR preprocessor/35458
3607         * mkdeps.c (munge): Quote '#' with a '\'.
3609 2008-02-27  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3611         PR preprocessor/35379
3612         * mkdeps.c (deps_write): Ensure the first target always appears
3613         in the first column, without leading backslash newline.  Avoid
3614         some more extra whitespace.
3616 2008-02-25  Thiemo Seufer <ths@mips.com>
3618         * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
3620 2008-02-19  Tom Tromey  <tromey@redhat.com>
3622         * traditional.c (lex_identifier): Use CPP_HASHNODE.
3623         * lex.c (lex_identifier): Use CPP_HASHNODE.
3624         * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
3625         do-while.
3626         * identifiers.c (alloc_node): Change return type.
3627         (_cpp_init_hashtable): Don't cast 'alloc_node'.
3628         (proxy_assertion_broken): New declaration.
3629         (cpp_forall_identifiers): Move comment.
3630         * line-map.c (linemap_add): Comment fix.
3631         (linemap_line_start): Indentation fix.
3633 2008-01-25  Jakub Jelinek  <jakub@redhat.com>
3635         PR preprocessor/34692
3636         * macro.c (collect_args): Add pragma_buff argument.  Push
3637         CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
3638         than into arguments.  Reset prevent_expansion and parsing_args
3639         state at CPP_PRAGMA_EOL/CPP_EOF.
3640         (funlike_invocation_p): Add pragma_buff argument, pass it through
3641         to collect_args.
3642         (enter_macro_context): Add result argument.  Adjust
3643         funlike_invocation_p caller.  Emit all deferred pragma tokens
3644         gathered during collect_args before the expansion, add a padding
3645         token.  Return 2 instead of 1 if any pragma tokens were prepended.
3646         (cpp_get_token): If enter_macro_context returns 2, don't return
3647         a padding token, instead cycle to grab CPP_PRAGMA token.
3648         * directives.c (_cpp_handle_directive): If was_parsing_args
3649         in deferred pragma, leave parsing_args and prevent_expansion as is.
3651 2008-01-22  Tom Tromey  <tromey@redhat.com>
3653         PR c++/34859
3654         * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
3655         __STDC_CONSTANT_MACROS.
3657 2008-01-07  Fred Fish  <fnf@specifix.com>
3659         PR preprocessor/30363
3660         * traditional.c (replace_args_and_push): Add local variable
3661         cxtquote, calculate the replacement text size assuming a
3662         worst case of every input character quoted with backslash,
3663         and properly handle output quoting of quote characters in
3664         actual arguments used in function-like macros.
3666 2008-01-03  Tom Tromey  <tromey@redhat.com>
3668         PR preprocessor/34602
3669         * directives.c (do_line): Don't try to spell EOF token.
3670         (do_linemarker): Add comment.
3672 2007-12-11  DJ Delorie  <dj@redhat.com>
3674         * charset.c (convert_using_iconv): Close out any shift states,
3675         returning to the initial state.
3677 2007-12-06  Tom Tromey  <tromey@redhat.com>
3679         PR c/29172
3680         * internal.h (struct cpp_reader) <file_hash_entries>: Changed
3681         type.
3682         <file_hash_entries_allocated, file_hash_entries_used>: Removed.
3683         * files.c (FILE_HASH_POOL_SIZE): New macro.
3684         (struct file_hash_entry_pool): New.
3685         (destroy_all_cpp_files): New function.
3686         (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
3687         (new_file_hash_entry): Update.
3688         (free_file_hash_entries): New function.
3689         (_cpp_cleanup_files): Call free_file_hash_entries and
3690         destroy_all_cpp_files.
3691         (cpp_clear_file_cache): New function.
3692         * include/cpplib.h (cpp_clear_file_cache): Declare.
3694 2007-12-03  Tom Tromey  <tromey@redhat.com>
3696         PR preprocessor/34288
3697         * configure.ac, config.in: Rebuilt.
3698         * configure.ac: Check for ssize_t.
3700 2007-11-30  Tom Tromey  <tromey@redhat.com>
3702         PR preprocessor/32868
3703         * macro.c (_cpp_create_definition): Special case
3704         __STDC_FORMAT_MACROS.
3706 2007-11-16  Michael Matz  <matz@suse.de>
3708         * files.c (search_path_head): Fix check for absolute paths.
3710 2007-11-11  Tom Tromey  <tromey@redhat.com>
3712         PR c++/17557
3713         * include/cpplib.h (cpp_included_before): Declare.
3714         * files.c (struct file_hash_entry) <location>: New field.
3715         (_cpp_find_file): Initialize new field.
3716         (make_cpp_dir): Likewise.
3717         (cpp_included_before): New function.
3719 2007-11-01  Tom Tromey  <tromey@redhat.com>
3721         PR preprocessor/30805
3722         * macro.c (paste_tokens): Handle padding token.
3723         (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
3725 2007-10-31  Tom Tromey  <tromey@redhat.com>
3727         PR preprocessor/30786
3728         * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
3729         * directives.c (_cpp_do__Pragma): Return error status.
3730         * internal.h (_cpp_do__Pragma): Update.
3731         * directives.c (get__Pragma_string): Back up if EOF seen.
3733 2007-09-06  Tom Tromey  <tromey@redhat.com>
3735         * internal.h (struct cpp_reader) <invocation_location>: New
3736         field.
3737         (struct cpp_reader) <set_invocation_location>: Likewise.
3738         * init.c (cpp_set_line_map): New function.
3739         * line-map.c (linemap_add): Use linemap's allocator.
3740         * include/line-map.h (GTY): Define.
3741         (line_map_realloc): New typedef.
3742         (struct line_map): Mark with GTY.
3743         (struct line_maps): Likewise.
3744         (struct line_maps) <maps>: Likewise.
3745         (struct line_maps) <reallocator>: New field.
3746         * include/symtab.h (GTY): Conditionally define.
3747         * include/cpplib.h (cpp_set_line_map): Declare.
3748         (cpp_get_token_with_location): Declare.
3749         * macro.c (cpp_get_token): Set invocation_location on the reader.
3750         (cpp_get_token_with_location): New function.
3752 2007-08-30  Chao-ying Fu  <fu@mips.com>
3754         * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
3755         ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
3756         (cpp_classify_number): Support decimal fixed-point constants without
3757         exponents.
3758         Warn about fixed-point constants when -pedantic.
3759         * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
3760         comments to support fixed-point values.
3761         (CPP_N_FRACT, CPP_N_ACCUM): Define.
3763 2007-08-18  Tom Tromey  <tromey@redhat.com>
3765         PR preprocessor/32974
3766         * directives.c (parse_include): Don't check for EOL when
3767         processing #pragma dependency.
3769 2007-07-30  Ollie Wild  <aaw@google.com>
3771         * directives-only.c: New file.
3772         * internal.h (struct _cpp_dir_only_callbacks): New.
3773         (_cpp_preprocess_dir_only): New function.
3774         * directives.c (_cpp_handle_directive): Check directives_only before
3775         disabling execution of indented directives.
3776         * files.c (_cpp_stack_file): Add directives_only check.
3777         * include/cpplib.h (struct cpp_options): Add directives_only.
3778         (cpp_init_special_builtins): New function.
3779         * init.c (cpp_init_special_builtins): New function.
3780         (cpp_init_builtins): Move builtin_array initialization to
3781         cpp_init_special_builtins.
3782         (post_options): Check directives_only before setting
3783         pfile->state.prevent_expansion = 1.
3784         * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
3785         is expanded inside a directive while -fdirectives-only is enabled.
3786         * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
3787         (libcpp_a_SOURCES): Add directives-only.c.
3789 2007-07-04  Uros Bizjak  <ubizjak@gmail.com>
3791         * traditional.c (_cpp_scan_out_logical_line): Initialize
3792         fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
3793         fmacro.args to prevent 'may be used uninitialized' warning.
3795 2007-07-03  Uros Bizjak  <ubizjak@gmail.com>
3797         * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
3798         Add new constants.
3799         * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
3800         suffixes.  Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
3801         for 'q' or 'Q' suffixes.
3803 2007-06-17  Danny Smith  <dannysmith@users.sourceforge.net
3805         * files.c (open_file): Correct typo.
3807 2007-06-16  Vladimir Prus  <vladimir@codesourcery.com>
3809         * files.c (open_file): Prevent the call
3810         for stat from overwriting errno.
3812 2007-06-09  Vladimir Prus  <vladimir@codesourcery.com>
3814         * files.c (open_file): Account for the
3815         fact that on windows, opening a directory gives
3816         EACCES.
3818 2007-06-05  Joerg Wunsch  <j.gnu@uriah.heep.sax.de>
3820         PR preprocessor/23479
3821         * expr.c (cpp_classify_number): Implement 0b-prefixed binary
3822         integer constants.
3823         (append_digit): Likewise.
3824         * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
3825         binary integer constants.
3827 2007-05-31  Dave Korn  <dave.korn@artimi.com>
3829         PR preprocessor/14331
3830         * lex.c (_cpp_get_fresh_line):  Don't warn if no newline at EOF.
3832 2007-05-24  Ollie Wild  <aaw@google.com>
3834         * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
3835         * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
3836         (cpp_write_pch_state): Save __COUNTER__ state.
3837         (cpp_valid_state): Check valid __COUNTER__ state.
3838         (cpp_read_state): Read new __COUNTER__ state.
3839         * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
3840         * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
3841         * internal.h (struct cpp_reader): Add counter member.
3843 2007-05-23  Simon Martin  <simartin@users.sourceforge.net>
3845         PR preprocessor/20077
3846         * macro.c (create_iso_definition): Fixed the method to determine
3847         whether the token-pasting operator appears at the beginning or the end
3848         of a macro.
3850 2007-05-21  Ian Lance Taylor  <iant@google.com>
3852         * internal.h (struct cpp_reader): Add new fields:
3853         nonexistent_file_hash and nonexistent_file_ob.
3854         * files.c: Include "obstack.h".
3855         (find_file_in_dir): Before trying to open the file, look up the
3856         path name in the hash table of nonexistent files.  After failing
3857         to open the file, add the path name to the hash table.
3858         (_cpp_find_file): Cache the results of looking up the file name
3859         starting with the quote and bracket chain heads, if we can.
3860         (nonexistent_file_hash_eq): New static function.
3861         (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
3862         pfile->nonexistent_file_ob.
3863         (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
3864         pfile->nonexistent_file_ob.
3866 2007-05-14  Janis Johnson  <janis187@us.ibm.com>
3868         * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
3870         PR c/31924
3871         * expr.c (interpret_float_suffix): Check for invalid suffix.
3873 2007-05-02  Eric Christopher  <echristo@apple.com>
3875         * expr.c (num_div_op): Don't overflow if the result is
3876         zero.
3878 2007-05-02  Tom Tromey  <tromey@redhat.com>
3880         PR preprocessor/28709
3881         * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
3883 2007-03-30  Michael Meissner  <michael.meissner@amd.com>
3885         * directives.c (lex_macro_node_from_str): Fix alloca call to be
3886         type correct.
3888 2007-03-30  Richard Henderson  <rth@redhat.com>
3890         * directives.c (lex_macro_node_from_str): New.
3891         (cpp_push_definition, cpp_pop_definition): New.
3892         * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
3894 2007-03-01  Brooks Moses  <brooks.moses@codesourcery.com>
3896         * Makefile.in: Add dummy install-pdf target.
3898 2007-01-30  Tom Tromey  <tromey@redhat.com>
3900         PR preprocessor/30468
3901         * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
3902         './'.
3904 2007-01-30  Tom Tromey  <tromey@redhat.com>
3906         PR preprocessor/29966
3907         * macro.c (lex_expansion_token): Save and restore cpp_reader's
3908         cur_token.
3909         (_cpp_create_definition): Don't restore cur_token here.
3910         * lex.c (_cpp_lex_token): Added assertion.
3912 2007-01-27  Tom Tromey  <tromey@redhat.com>
3914         * configure: Rebuilt.
3916 2007-01-12  Tom Tromey  <tromey@redhat.com>
3918         PR preprocessor/28227
3919         * directives.c (lex_macro_node): Added 'is_def_or_undef'
3920         argument.
3921         (do_define): Update.
3922         (do_undef): Update.
3923         (do_ifdef): Update.
3924         (do_ifndef): Update.
3926 2007-01-11  Paolo Bonzini  <bonzini@gnu.org>
3928         * configure: Regenerate.
3930 2007-01-11  Paolo Bonzini  <bonzini@gnu.org>
3932         * configure: Regenerate.
3934 2007-01-04  Tom Tromey  <tromey@redhat.com>
3936         PR preprocessor/28165
3937         * internal.h (cpp_in_primary_file): New function.
3938         * directives.c (do_include_next): Use cpp_in_primary_file.
3939         (do_pragma_once): Likewise.
3940         (do_pragma_system_header): Likewise.
3942 2006-12-29  Ian Lance Taylor  <iant@google.com>
3944         * lex.c (_cpp_clean_line): Add uses of __builtin_expect.  Don't
3945         look backward at the end of the line unless we saw a backslash.
3947 2006-12-29  Jakub Jelinek  <jakub@redhat.com>
3949         PR preprocessor/29612
3950         * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
3951         only when new_sysp is non-zero.
3953 2006-12-28  Tom Tromey  <tromey@redhat.com>
3955         PR preprocessor/30001
3956         * charset.c (_cpp_convert_input): Check that to.len is greater
3957         than zero.
3959 2006-11-20  Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
3961         * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
3962         * configure: Rebuilt.
3964 2006-11-01      Douglas Gregor <doug.gregor@gmail.com>
3966         * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
3967         for experimental C++0x mode.
3968         * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
3969         adopted the preprocessor changes introduced in C99.
3971 2006-10-29  Joseph Myers  <joseph@codesourcery.com>
3973         * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
3974         depending on --enable-targets=all.
3975         * configure: Regenerate.
3977 2006-10-12  Jakub Jelinek  <jakub@redhat.com>
3979         PR preprocessor/28709
3980         * macro.c (paste_tokens): Do error reporting here, use BUF with the
3981         spelled LHS token as opposed to spelling it again.
3982         (paste_all_tokens): Don't report errors here, just break on failure.
3984 2006-10-10  Brooks Moses  <bmoses@stanford.edu>
3986         * Makefile.in: Added empty "pdf" target.
3988 2006-09-22  Geoffrey Keating  <geoffk@apple.com>
3990         * configure.ac: Make need_64_bit_hwint case for x86-darwin
3991         match exactly the glob in gcc/config.gcc.
3992         * configure: Regenerate.
3994 2006-09-13  Joseph S. Myers  <joseph@codesourcery.com>
3996         PR c/28768
3997         PR preprocessor/14634
3998         * lex.c (lex_string): Pedwarn for unterminated literals.
4000 2006-09-08  Eric Christopher  <echristo@apple.com>
4002         * configure.ac: Add 64-bit HWI support for i?86-darwin.
4004 2006-08-14  Steve Ellcey  <sje@cup.hp.com>
4006         PR c++/28288
4007         PR c++/14556
4008         * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
4009         (CPP_LAST_EQ): Change.
4010         (CPP_LAST_PUNCTUATOR): Change.
4011         * expr.c (cpp_operator): Remove MIN and MAX.
4012         (reduce): Remove CPP_MIN and CPP_MAX.
4013         (num_binary_op): Ditto.
4014         * lex.c (_cpp_lex_direct): Ditto.
4015         (cpp_avoid_paste): Remove ? as legal symbol after > or <.
4017 2006-06-09  Jakub Jelinek  <jakub@redhat.com>
4019         PR preprocessor/27746
4020         * directives.c (do_pragma): Handle pragma with valid namespace
4021         and invalid name coming from macro expansion.
4022         * directives.c (destringize_and_run): Initialize next field in
4023         context.
4025         PR c/27747
4026         PR c++/27748
4027         * directives.c (destringize_and_run): Set NO_EXPAND on the
4028         tokens.
4030         * macro.c (_cpp_backup_tokens): Fix comment typo.
4032 2006-05-31  Daniel Jacobowitz  <dan@codesourcery.com>
4034         * Makefile.in (CATALOGS): Add po/ prefix.
4035         * configure: Regenerated.
4037 2006-05-23  Carlos O'Donell  <carlos@codesourcery.com>
4039         * Makefile.in: Add install-html target. Add install-html to .PHONY
4041 2006-02-17  Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
4043         * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
4044         * files.c (_cpp_get_file_stat): New function.
4045         * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
4046         * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
4047         * internal.h (_cpp_get_file_stat): Prototype.
4048         (struct cpp_buffer): Add timestamp.
4050 2006-01-23  Jakub Jelinek  <jakub@redhat.com>
4052         PR preprocessor/25717
4053         * init.c (cpp_init_builtins): If __STDC__ will not change value
4054         between system headers and other sources, define it as a normal
4055         macro rather than a builtin.
4056         * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
4057         cpp_in_system_header condition.
4059 2006-01-05  Paolo Bonzini  <bonzini@gnu.org>
4061         * Makefile.in: Use -MMD instead of -MD.
4063 2006-01-04  Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
4064             Richard Henderson  <rth@redhat.com>
4066         Merge from gomp branch:
4067         * directives.c (struct pragma_entry): Add is_deferred.  Add ident
4068         entry to value union.
4069         (end_directive): Don't eat the line if in_deferred_pragma.
4070         (run_directive): Remove pragma hacks.
4071         (insert_pragma_entry): Remove.
4072         (new_pragma_entry): New.
4073         (register_pragma_1): Split out of register_pragma.  Only handle
4074         the lookup tree and return the new entry.
4075         (cpp_register_pragma): Fill in the pragma entry here.
4076         (cpp_register_deferred_pragma): New.
4077         (register_pragma_internal): New.
4078         (_cpp_init_internal_pragmas): Use register_pragma_internal.
4079         (do_pragma): Allow pragma expansion after namespace.  For deferred
4080         pragmas, don't slurp the line into a string.
4081         (destringize_and_run): Save tokens for deferred pragmas.
4082         (cpp_handle_deferred_pragma): Remove.
4083         * macro.c (builtin_macro): Remove pragma token hack.
4084         (_cpp_push_token_context): Rename from push_token_context and export.
4085         * internal.h (struct lexer_state): Add pragma_allow_expansion.
4086         (_cpp_push_token_context): Declare.
4087         * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
4088         a token.  Update the line number correctly if so.
4089         (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
4090         (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
4091         * include/cpplib.h (PRAGMA_EOL): New.
4092         (CPP_TOKEN_FLD_PRAGMA): New.
4093         (struct cpp_token): Add val.pragma.
4094         (struct cpp_options): Remove defer_pragmas.
4095         (cpp_handle_deferred_pragma): Remove.
4096         (cpp_register_deferred_pragma): Declare.
4098 2006-01-01  Jakub Jelinek  <jakub@redhat.com>
4100         PR c++/25294
4101         * directives.c (do_pragma): If pragma line ends with multi-line
4102         block comment, end the saved deferred pragma string before that
4103         comment.  Handle embedded '\0' chars on the pragma line.
4105 2005-12-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
4107         PR c++/23333
4108         * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
4110 2005-12-07  Jon Grimm  <jgrimm2@us.ibm.com>
4111             Ben Elliston  <bje@au.ibm.com>
4113         * include/cpplib.h (CPP_N_DFLOAT): New.
4114         * expr.c (interpret_float_suffix): Identify df, dd, and dl
4115         suffixes as decimal floating point constants.
4116         (cpp_classify_number): Disallow hexadecimal DFP constants.
4118 2005-11-14  Gerald Pfeifer  <gerald@pfeifer.com>
4119             Ian Lance Taylor  <ian@airs.com>
4121         * include/cpplib.h (struct cpp_callbacks): Annotate error with
4122         ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
4124 2005-11-09  Per Bothner  <per@bothner.com>
4125             Uros Bizjak  <uros@kss-loka.si>
4127         PR c/24101
4128         * init.c (read_original_filename): Temporarily set
4129         state.in_directive before calling _cpp_lex_direct for
4130         CPP_HASH tokens.
4132 2005-11-03  James E Wilson  <wilson@specifix.com>
4134         PR preprocessor/24202
4135         * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
4137 2005-11-04  Joseph S. Myers  <joseph@codesourcery.com>
4139         * include/cpplib.h (struct cpp_callbacks): Make error take
4140         va_list* parameter.
4141         * errors.c (cpp_error): Update call to callback.
4143 2005-11-03  Andrew Pinski  <pinskia@physics.uc.edu>
4145         PR preprocessor/22042
4146         * macro.c (_cpp_builtin_macro_text): Lower the needed max
4147         buffer size.
4148         (cpp_quote_string): Don't octalify non printable
4149         charactors.
4151 2005-11-03  Joseph S. Myers  <joseph@codesourcery.com>
4153         PR c++/17964
4154         * include/cpplib.h (struct cpp_options): Add client_diagnostic.
4155         (struct cpp_callbacks): Add error.
4156         * errors.c (cpp_error): If client_diagnostic, use error callback.
4157         * charset.c (convert_escape): Don't use %03o in diagnostic.
4159 2005-10-21  James E Wilson  <wilson@specifix.com>
4161         PR preprocessor/15220
4162         * files.c (_cpp_find_file): New parameter angle_brackets.  Fix all
4163         callers.  Pass to open_file_failed.
4164         (open_file_failed): New parameter angle_brackets.  Fix all callers.
4165         Use in print_dep assignment.
4166         * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
4167         * internal.h (_cpp_find_file): Add new parm to declaration.
4169 2005-10-08  Kazu Hirata  <kazu@codesourcery.com>
4171         * configure.ac: Require 64-bit int for arm*-*-*eabi*.
4172         * configure: Regenerate.
4174 2005-10-04  Ian Lance Taylor  <ian@airs.com>
4176         PR preprocessor/13726
4177         * directives.c (check_eol_return_comments): New static function.
4178         (parse_include): Add buf parameter.  Change all callers.
4179         (do_include_common): If not discard comments, turn on
4180         save_comments.  Pass collected comments to include callback.
4181         * include/cpplib.h (struct cpp_callbacks): Add new parameter to
4182         include callback: cpp_token list.
4184 2005-09-20  Joseph S. Myers  <joseph@codesourcery.com>
4186         * include/cpplib.h (struct cpp_options): Add extended_identifiers.
4187         * init.c (struct lang_flags, lang_defaults): Add
4188         extended_identifiers.
4189         (cpp_set_lang): Use it.
4190         * lex.c (forms_identifier_p): Check extended_identifiers.
4192 2005-08-30  Jakub Jelinek  <jakub@redhat.com>
4194         PR preprocessor/20348
4195         PR preprocessor/20356
4196         * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
4197         2004-06-05 changes.
4199 2005-07-23  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4201         * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
4202         -Wmissing-format-attribute.
4204         * configure: Regenerate.
4206 2005-06-29  Kelley Cook  <kcook@gcc.gnu.org>
4208         * all files: Update FSF address in copyright headers.
4209         * makeucnid.c (write_copyright): Update outputted FSF address.
4211 2005-06-13  Zack Weinberg  <zack@codesourcery.com>
4213         * configure.ac: Invoke ZW_CREATE_DEPDIR and
4214         ZW_PROG_COMPILER_DEPENDENCIES.
4215         * aclocal.m4, configure: Regenerate.
4216         * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
4217         New variables.
4218         (distclean): Clean up $(DEPDIR) and its contents.
4219         (.c.o): Use $(COMPILE).
4220         Include $(DEPDIR)/*.Po for most object->header dependencies.
4222 2005-05-28  Gabriel Dos Reis  <gdr@integrable-solutions.net>
4224         * configure.ac: Check declarations for asprintf and vasprintf.
4225         * config.in: Regenerate.
4226         * configure: Likewise.
4228         * charset.c (conversion_loop): Use XRESIZEVEC.
4229         (convert_no_conversion): Likewise.
4230         (convert_using_iconv): Likewise.
4231         (init_iconv_desc): Cast return value of alloca.
4232         (cpp_host_to_exec_charset): Use XNEWVEC.
4233         (emit_numeric_escape): Use XRESIZEVEC.
4234         (cpp_interpret_string): Use XNEWVEC.
4235         (cpp_interpret_string): Use XRESIZEVEC.
4236         (_cpp_interpret_identifier): Cast return value of alloca.
4237         (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
4238         * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
4239         (parse_include): Use XNEWVEC.
4240         (insert_pragma_entry): Rename local variable "new" to
4241         "new_entry".
4242         (save_registered_pragmas): Cast return value of xmemdup.
4243         (destringize_and_run): Same for alloca.
4244         (parse_assertion): Likewise.
4245         (do_assert): Cast allocated storage to proper type.
4246         (cpp_define): Likewise.
4247         (_cpp_define_builtin): Likewise.
4248         (cpp_undef): Likewise.
4249         (handle_assertion): Likewise.
4250         (cpp_push_buffer): Rename local variable "new" to "new_buffer".
4251         * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
4252         (CPP_UMINUS): Likewise.
4253         (struct cpp_operator): Rename from struct operator.
4254         (_cpp_expand_op_stack): Use XRESIZEVEC.
4255         * files.c (pch_open_file): Use XNEWVEC.
4256         (pch_open_file): Use XRESIZEVEC.
4257         (read_file_guts): Use XNEWVEC and XRESIZEVEC.
4258         (dir_name_of_file): Use XNEWVEC.
4259         (make_cpp_file): Use XCNEW.
4260         (make_cpp_dir): Likewise.
4261         (allocate_file_hash_entries): USE XNEWVEC.
4262         (cpp_included): Cast return value of htab_find_with_hash.
4263         (append_file_to_dir): Use XNEWVEC.
4264         (read_filename_string): Likewise. Use XRESIZEVEC too.
4265         (read_name_map): Cast return value of alloca.  Use XRESIZEVEC.
4266         (remap_filename): Use XNEWVEC.
4267         (struct pchf_entry): Move definition out of struct pchf_data.
4268         (_cpp_save_file_entries): Use XCNEWVAR.
4269         (_cpp_read_file_entries): Use XNEWVAR.
4270         * identifiers.c (alloc_node): Use XOBNEW.
4271         * init.c (cpp_create_reader): Use XCNEW.
4272         (cpp_init_builtins): Cast of b->value to enum builtin_type.
4273         (read_original_directory): Cast return value of alloca.
4274         * lex.c (add_line_note): Use XRESIZEVEC.
4275         (warn_about_normalization): Use XNEWVEC.
4276         (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
4277         (new_buff): Use XNEWVEC.
4278         * line-map.c (linemap_add): Use XRESIZEVEC.
4279         * macro.c (builtin_macro): Cast return value of alloca.
4280         (paste_tokens): Likewise.
4281         (expand_arg): Use XNEWVEC and XRESIZEVEC.
4282         (_cpp_save_parameter): Use XRESIZEVEC.
4283         (create_iso_definition): Cast allocated storage to proper type.
4284         (_cpp_create_definition): Likewise.
4285         (cpp_macro_definition): Use XRESIZEVEC.
4286         * makedepend.c (add_clm): Use XNEW.
4287         (add_dir): Likewise.
4288         * mkdeps.c (munge): Use XNEWVEC.
4289         (deps_init): Use XCNEW.
4290         (deps_add_target): Use XRESIZEVEC.
4291         (deps_add_default_target): Cast return value of alloca.
4292         (deps_add_dep): Use XRESIZEVEC.
4293         (deps_add_vpath): Likewise.  Use XNEWVEC too.
4294         (deps_restore): Likewise.
4295         * pch.c (save_idents): Use XNEW and XNEWVEC.
4296         (cpp_save_state): Use XNEW.
4297         (count_defs): Cast return value of htab_find.
4298         (write_defs): Likewise.
4299         (cpp_write_pch_deps): Use XNEWVEC.
4300         (collect_ht_nodes): Use XRESIZEVEC.
4301         (cpp_valid_state): Use XNEWVEC.
4302         (save_macros): Use XRESIZEVEC.  Cast return value of xmemdup.
4303         * symtab.c (ht_create): Use XCNEW.
4304         (ht_lookup_with_hash): Cast return value of obstack_copy0.
4305         (ht_expand): Use XCNEWVEC.
4306         * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
4307         (bool): Do not define if __cplusplus.
4309 2005-05-12  Zack Weinberg  <zack@codesourcery.com>
4311         * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
4312         (do_sccs): Delete function definition, #define to do_ident.
4313         (do_ident): Don't hardwire directive name.
4315 2005-05-12  Ryota Kunisawa  <kunisawa@access.co.jp>
4317         PR bootstrap/21230
4318         * configure: Regenerate.
4320 2005-04-27  Andris Pavenis  <pavenis@latnet.lv>
4322         * files.c: Include io.h for DJGPP to get prototype of setmode.
4324 2005-04-19  Per Bothner  <per@bothner.com>
4326         PR preprocessor/20907
4327         * line-map.c (linemap_line_start): Fix bug when we need to increse
4328         column_bits but can re-use the current line_map.
4330 2005-04-19  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4332         * system.h (fopen, fdopen, freopen): Define these to the unlocked
4333         libiberty functions.
4335 2005-04-11  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4337         * configure.ac (libcpp_UNLOCKED_FUNCS): New.
4338         (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
4339         * system.h (putchar, getc, getchar, clearerr, feof, fileno,
4340         fflush, fgetc, fgets, ferror, fread): Redefine to the associated
4341         _unlocked function.
4342         (fwrite_unlocked): Fix prototype.
4344         * configure, config.in: Regenerate.
4346 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
4348         PR preprocessor/19475
4349         * macro.c (create_iso_definition): For < ISO C99, don't
4350         pedwarn if there is no whitespace between macro name and its
4351         replacement, but the replacement starts with a basic character
4352         set character.
4354 2005-03-28  Andreas Jaeger  <aj@suse.de>
4356         * lex.c (warn_about_normalization): Cast field width to int to
4357         avoid warning.
4359 2005-03-19  Joseph S. Myers  <joseph@codesourcery.com>
4361         * configure.ac: Consistently use solaris2.1[0-9]* instead of
4362         solaris2.1[0-9].
4363         * configure: Regenerate.
4365 2005-03-15  Geoffrey Keating  <geoffk@apple.com>
4367         * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
4368         UCN rather than printing an error.
4370 2005-03-14  Geoffrey Keating  <geoffk@apple.com>
4372         * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
4374 2005-03-14  Geoffrey Keating  <geoffk@apple.com>
4376         * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
4377         * charset.c: Update for new format of ucnid.h.
4378         (ucn_valid_in_identifier): Update for new format of ucnid.h.
4379         Add NST parameter, and update it; update callers.
4380         (cpp_valid_ucn): Add NST parameter, update callers.  Replace abort
4381         with cpp_error.
4382         (convert_ucn): Pass normalize_state to cpp_valid_ucn.
4383         * internal.h (struct normalize_state): New.
4384         (INITIAL_NORMALIZE_STATE): New.
4385         (NORMALIZE_STATE_RESULT): New.
4386         (NORMALIZE_STATE_UPDATE_IDNUM): New.
4387         (_cpp_valid_ucn): New.
4388         * lex.c (warn_about_normalization): New.
4389         (forms_identifier_p): Add normalize_state parameter, update callers.
4390         (lex_identifier): Add normalize_state parameter, update callers.  Keep
4391         the state current.
4392         (lex_number): Likewise.
4393         (_cpp_lex_direct): Pass normalize_state to subroutines.  Check
4394         it with warn_about_normalization.
4395         * makeucnid.c: New.
4396         * ucnid.h: Replace.
4397         * ucnid.pl: Remove.
4398         * ucnid.tab: Make appropriate for input to makeucnid.c.  Remove
4399         comments about obsolete version of C++.
4400         * include/cpplib.h (enum cpp_normalize_level): New.
4401         (struct cpp_options): Add warn_normalize field.
4403 2005-03-11  Geoffrey Keating  <geoffk@apple.com>
4405         * directives.c (glue_header_name): Update call to cpp_spell_token.
4406         * internal.h (_cpp_interpret_identifier): New.
4407         * charset.c (_cpp_interpret_identifier): New.
4408         (_cpp_valid_ucn): Allow UCN version of '$'.
4409         * lex.c (lex_identifier): Add extra parameter to indicate if initial
4410         character was '$' or '\'.  Support identifiers with UCNs.
4411         (forms_identifier_p): Allow UCNs.
4412         (_cpp_lex_direct): Pass extra parameter to lex_identifier.
4413         (utf8_to_ucn): New.
4414         (cpp_spell_token): Add FORSTRING parameter.  Use it.
4415         (cpp_token_as_text): Update call to cpp_spell_token.
4416         (cpp_output_token): Write UCNs back out.
4417         (stringify_arg): Update call to cpp_spell_token.
4418         (paste_tokens): Likewise.
4419         (cpp_macro_definition): Likewise.
4420         * macro.c (stringify_arg): Likewise.
4421         (paste_tokens): Likewise.
4422         (cpp_macro_definition): Likewise.
4423         * include/cpplib.h: Add parameter to cpp_spell_token.
4425 2005-03-04  Jakub Jelinek  <jakub@redhat.com>
4427         PR bootstrap/20282
4428         PR bootstrap/20305
4429         * macro.c (replace_args, cpp_get_token): Copy whole
4430         cpp_token_u instead of just cpp_string field from it.
4432 2005-02-28  Devang Patel  <dpatel@apple.com>
4434         * directives.c (do_line): Save sysp early before line table is
4435         realloc'ed.
4437 2005-02-20  Zack Weinberg  <zack@codesourcery.com>
4439         PR 18785
4440         * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
4441         (cpp_host_to_exec_charset): New function.
4442         * include/cpplib.h: Declare cpp_host_to_exec_charset.
4444 2005-02-19  Devang Patel  <dpatel@apple.com>
4446         * charset.c (_cpp_convert_input): Check '\r' before inserting
4447         '\n' at the end.
4449 2005-02-15  Eric Christopher  <echristo@redhat.com>
4451         PR preprocessor/19077
4452         * macro.c (cpp_macro_definition): Move handling of whitespace
4453         to PREV_WHITE conditional. Remove overloading of len
4454         variable.
4456 2005-02-14  Kazu Hirata  <kazu@cs.umass.edu>
4458         * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
4459         traditional.c: Update copyright.
4461 2005-02-14  Paolo Bonzini  <bonzini@gnu.org>
4463         PR bootstrap/19818
4464         * configure.ac: Check for declaration of basename and getopt.
4465         * config.in: Regenerate.
4466         * configure: Regenerate.
4467         * internal.h (ustrcspn): New.
4468         * macro.c (create_iso_definition): Fix allocation of memory.
4469         (padding_token): Add cast to remove const-ness.
4470         * pch.c (cpp_read_state): Use ustrcspn.
4472 2005-02-08  Mike Stump  <mrs@apple.com>
4474         * files.c (pchf_adder): Remove.
4475         (struct pchf_adder_info): Likewise.
4476         (_cpp_save_file_entries): Write out all files so that #import works.
4478 2005-01-23  Joseph S. Myers  <joseph@codesourcery.com>
4480         * configure: Regenerate.
4482 2005-01-11  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
4484         * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
4486         * include/cpplib.h: Also update copyright years.
4488 2005-01-03  Geoffrey Keating  <geoffk@apple.com>
4490         * files.c (_cpp_find_file): Add files found by search_path_exhausted
4491         to the list of all files.
4493 2005-01-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
4495         * internal.h: Update references to Cpp lib filenames.
4496         * directives.c: Likewise.
4497         * init.c: Likewise.
4498         * macro.c: Likewise.
4499         * traditional.c: Likewise.
4501 2004-12-15  Eric Botcazou  <ebotcazou@libertysurf.fr>
4503         PR preprocessor/15167
4504         * files.c (destroy_cpp_file): New function.
4505         (should_stack_file): Make a new file if the
4506         compared file is still stacked.
4508 2004-11-28  Nathanael Nerode  <neroden@gcc.gnu.org>
4510         PR preprocessor/17610
4511         * directives.c (do_include_common): Error out if an empty filename
4512         is given for #include (or #include_next or #import).
4514 2004-11-27  Roger Sayle  <roger@eyesopen.com>
4515             Zack Weinberg  <zack@codesourcery.com>
4517         * internal.h: Replace all uses of uchar with unsigned char.
4518         * include/cpp-id-data.h: Likewise.  Guard typedef of uchar
4519         with !IN_GCC, so uchar is only defined whilst building libcpp.
4521 2004-11-24  Kelley Cook  <kcook@gcc.gnu.org>
4523         * aclocal.m4: Regenerate.
4525 2004-11-24  Roger Sayle  <roger@eyesopen.com>
4527         PR preprocessor/15824
4528         * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
4529         directly, instead of the non-existant "system.h" and "ansidecl.h".
4530         * configure: Regenerate.
4532 2004-11-23  Daniel Jacobowitz  <dan@codesourcery.com>
4533             Joseph Myers  <joseph@codesourcery.com>
4535         * internal.h (struct lexer_state): Add in_deferred_pragma.
4536         * directives.c (struct pragma_entry): Add allow_expansion.
4537         (insert_pragma_entry): Take allow_expansion flag.
4538         (register_pragma): Likewise.
4539         (cpp_register_pragma): Likewise.
4540         (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
4541         (do_pragma): Honor allow_expansion.
4542         (cpp_handle_deferred_pragma): Set in_deferred_pragma.
4543         * include/cpplib.h (cpp_register_pragma): Update prototype.
4545 2004-11-18  Daniel Jacobowitz  <dan@codesourcery.com>
4546             Mark Mitchell  <mark@codesourcery.com>
4548         * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
4549         need_64bit_hwint=yes.
4550         * configure: Regenerate.
4552 2004-11-09  Joseph S. Myers  <joseph@codesourcery.com>
4554         * Makefile.in ($(PACKAGE).pot): New rule.  Depend on
4555         po/$(PACKAGE).pot.
4556         (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
4557         arguments.  Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
4558         Remove local srcdir path from generated file.
4560 2004-11-04  Zack Weinberg  <zack@codesourcery.com>
4561             Gerald Pfeifer  <gerald@pfeifer.com>
4563         * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
4564         as well.
4566 2004-10-27  Zack Weinberg  <zack@codesourcery.com>
4568         PR 18075
4569         * directives.c (do_pragma): Do not defer pragmas which are unknown.
4570         (cpp_handle_deferred_pragma): Add cast to silence warning.
4572 2004-10-14  Joseph S. Myers  <jsm@polyomino.org.uk>
4574         * errors.c (_cpp_begin_message): Print "error: " for errors.
4576 2004-10-10  Andreas Jaeger  <aj@suse.de>
4578         * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
4579         * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
4581 2004-10-08  Andrew Pinski  <pinskia@physics.uc.edu>
4583         * pch.c (cpp_write_pch_state): Remove variable z as it is not
4584         used.
4585         (cpp_read_state): Remove unused variables, m, d and mac_count.
4587 2004-09-29  Per Bothner  <per@bothner.com>
4589         * directives.c (cpp_handle_deferred_pragma):  Save, clear and restore
4590         cb.line_change.  Otherwise do_pragma will call the line_change
4591         call-back with a meaningless line number.
4593 2004-09-24  Zack Weinberg  <zack@codesourcery.com>
4595         * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
4596         programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
4597         ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
4598         * aclocal.m4, configure: Regenerate.
4599         * init.c: Include localedir.h.
4600         * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
4601         (DEFS): Delete.
4602         (.c.o): Use $(ALL_CFLAGS).
4603         (localedir.h, localedir.hs): New rules.
4604         (clean): Use rm -rf to remove directories.
4605         (distclean): Also delete localedir.h and localedir.hs.
4606         (init.o): Update dependencies.
4608 2004-09-22  Kelley Cook  <kcook@gcc.gnu.org>
4610         * Makefile.in (aclocal.m4): Update dependencies.
4611         * configure.ac (AC_CONFIG_MACRO_DIR): New.
4612         * aclocal.m4, configure: Regenerate.
4614 2004-09-17  Zack Weinberg  <zack@codesourcery.com>
4616         * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
4617         (_cpp_convert_input, _cpp_default_encoding): Add comments.
4618         Some other comments in this file also tweaked.
4620         * directives.c (do_pragma): Save current buffer position
4621         before lexing the pragma keywords; don't call
4622         _cpp_backup_tokens in the defer_pragmas case.
4624 2004-09-15  Per Bothner  <per@bothner.com>
4626         * include/line-map.h (line_map_start):  Add parameter names so
4627         preceding comment makes sense.
4628         (linemap_add):  Remove from comment mention of non-existing parameter.
4630 2004-09-09  Matt Austern  <austern@apple.com>
4631             Zack Weinberg  <zack@codesourcery.com>
4633         * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
4634         prefixes throughout.  Add entry for PRAGMA.  Remove
4635         unnecessary "= 0" from EQ.
4636         (enum cpp_ttype): Adjust OP and TK definitions to restore
4637         prefixes, via token-paste.
4638         (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
4639         Change from #defines to additional cpp_ttype enumerators.
4640         (struct cpp_options): Add defer_pragmas.
4641         (cpp_handle_deferred_pragma): Prototype new interface.
4643         * internal.h (struct cpp_reader): Add directive_result.
4644         * directives.c (struct pragma_entry): Add is_internal field;
4645         give boolean fields type bool.
4646         (start_directive): Initialize pfile->directive_result.type.
4647         (_cpp_do__Pragma): Likewise.
4648         (run_directive): Do not crash if pfile->buffer->prev is NULL.
4649         (insert_pragma_entry): Add 'internal' argument; set new->is_internal
4650         from it.
4651         (register_pragma): New static function, bulk of former
4652         cpp_register_pragma here; add 'internal' argument, pass along
4653         to insert_pragma_entry.
4654         (cpp_register_pragma): Now a wrapper around register_pragma which
4655         always passes false for 'internal' argument.
4656         (_cpp_init_internal_pragmas): Call register_pragma directly, passing
4657         true for 'internal'.
4658         (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
4659         an internal pragma, save text till the end of the line as a CPP_PRAGMA
4660         token instead of executing the pragma.
4661         (cpp_handle_deferred_pragma): New interface.
4662         * lex.c (token_spellings): Adjust OP and TK definitions to
4663         match changes to cpplib.h.
4664         (_cpp_lex_token): Check for a directive-result token and
4665         return it if present.
4666         (cpp_token_val_index): Handle CPP_PRAGMA.
4667         * macro.c (cpp_builtin_macro_text): Correct comment.
4668         (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
4670 2004-09-06  Serge Belyshev  <belyshev@lubercy.com>
4672         PR preprocessor/14699
4673         * symtab.c (ht_dump_statistics): Change type of sum_of_squares
4674         from size_t to double.
4676 2004-08-28  Andreas Schwab  <schwab@suse.de>
4677             Andreas Jaeger <aj@suse.de>
4679         * configure.ac: Set PACKAGE correctly.
4680         * configure: Regenerated.
4682 2004-08-25  Paolo Bonzini  <bonzini@gnu.org>
4684         * Makefile.in: Add back top_builddir.
4686 2004-08-25  Paolo Bonzini  <bonzini@gnu.org>
4688         * configure.ac: Replace Automake macro invocations
4689         with manual Autoconf checks and substitutions.
4690         * configure: Regenerate.
4691         * aclocal.m4: Regenerate.
4692         * config.in: Regenerate.
4693         * Makefile.am: Removed.
4694         * Makefile.in: Heavy simplification and reorganization.
4696 2004-08-09  Mark Mitchell  <mark@codesourcery.com>
4698         * configure.ac (arm*-*-eabi*): New target.
4699         (arm*-*-symbianelf*): Likewise.
4700         * configure: Regenerated.
4702 2004-07-24  Bernardo Innocenti  <bernie@develer.com>
4704         * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
4705         * directives.c: Use XNEW-family macros from libiberty.
4706         * lex.c: Likewise.
4707         * macro.c: Likewise.
4708         * cpplib.h (cpp_deps_style): Export enum with name.
4710 2004-07-23  Matthias Klose  <doko@debian.org>
4712         * init.c (init_library): Use PACKAGE for the text domain.
4714 2004-07-16  Andris Pavenis  <pavenis@latnet.lv>
4716         PR preprocessor/16366
4717         * internal.h (struct cpp_reader): New field dir_hash.
4718         * files.c (make_cpp_dir): Use dir_hash, not file_hash.
4719         (_cpp_init_files, _cpp_cleanup_files): Update for new field.
4721 2004-07-04  Neil Booth  <neil@duron.akihabara.co.uk>
4723         PR preprocessor/16192
4724         PR preprocessor/15913
4725         PR preprocessor/15572
4726         * expr.c (_cpp_parse_expr): Handle remaining cases where an
4727         expression is missing.
4728         * init.c (post_options): Traditional cpp doesn't do // comments.
4730 2004-06-30  Per Bothner  <per@bothner.com>
4732         * include/line-map.h (fileline):  Remove old typedef.
4733         * internal.h (struct cpp_reader):  Use source_location typedef instead.
4735 2004-06-26  Zack Weinberg  <zack@codesourcery.com>
4737         Partially revert patch of 2004-06-05.
4738         * files.c (search_cache): Remove pfile argument.  Don't check
4739         for file that would be found by "" or <> search here...
4740         (_cpp_find_file): ...do it here, before calling find_file_in_dir.
4741         Do not apply directory-of-current-file correction to files
4742         found by this check.  Rearrange code slightly.
4744 2004-06-21  Geoffrey Keating  <geoffk@apple.com>
4746         * files.c (should_stack_file): Correct swapped parameters to call
4747         to cb.read_pch.
4748         * pch.c (cpp_valid_state): Handle -fpreprocessed.
4750 2004-06-15  Paolo Bonzini  <bonzini@gnu.org>
4752         * Makefile.in: Regenerate with automake 1.8.5.
4753         * aclocal.m4: Likewise.
4754         * configure: Regenerate.
4756 2004-06-11  Zack Weinberg  <zack@codesourcery.com>
4758         * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
4759         * configure, config.in: Regenerate.
4760         * system.h: Unconditionally define bool as unsigned char,
4761         BOOL_BITFIELD as unsigned int.
4762         * .cvsignore: New file.
4764 2004-06-09  Geoffrey Keating  <geoffk@apple.com>
4766         * traditional.c (push_replacement_text): Set macro->traditional.
4767         (save_replacement_text): Likewise.
4768         * pch.c (cpp_write_pch_state): Don't write list of defined macros.
4769         (struct save_macro_item): Delete.
4770         (struct save_macro_data): Use a character array not the previous
4771         structured format.
4772         (save_macros): Save macro as text not as internal structures.
4773         (cpp_prepare_state): Update for changes to save_macro_data.
4774         (cpp_read_state): Don't read macros defined in PCH.  Restore
4775         -D macros as text.
4776         * macro.c (create_iso_definition): Honour alloc_subobject.
4777         Clear traditional flag.
4778         (_cpp_create_definition): Honour alloc_subobject.
4779         * lex.c (cpp_token_val_index): New.
4780         * internal.h: Include cpp-id-data.h.
4781         (uchar): Move definition to cpp-id-data.h.
4782         (U): Likewise.
4783         (cpp_macro): Likewise.
4784         * directives.c (struct answer): Move to cpp-id-data.h.
4785         (do_assert): Honour alloc_subobject.
4787         * include/symtab.h (struct ht): Add field 'alloc_subobject'.
4788         * include/cpplib.h (struct cpp_string): Add GTY marker.
4789         (enum cpp_token_fld_kind): New.
4790         (struct cpp_token): Add GTY markers.
4791         (cpp_token_val_index): Prototype.
4792         (CPP_HASHNODE_VALUE_IDX): New.
4793         (struct cpp_hashnode): Don't skip fields of 'value' when marking.
4794         * include/cpp-id-data.h: New file.
4796 2004-06-09  Paolo Bonzini  <bonzini@gnu.org>
4798         * Makefile.am (all-local): New.
4799         * Makefile.in: Regenerate.
4801 2004-06-06  Roger Sayle  <roger@eyesopen.com>
4803         * Makefile.am (LIBICONV): Declare.
4804         (makedepend_LDADD): Use LIBICONV.
4805         * Makefile.in: Regenerate.
4807 2004-06-05  Andrew Pinski  <pinskia@physics.uc.edu>
4809         * Makefile.am (LIBINTL): Declare
4810         (makedepend_LDADD): Use LIBINTL.
4811         * Makefile.in: Regenerate.
4813 2004-06-05  Zack Weinberg  <zack@codesourcery.com>
4815         * Makefile.am: Add makedepend.
4816         * Makefile.in, aclocal.m4: Regenerate.
4817         * charset.c: Insert a space to avoid a warning.
4818         * directives.c: Include mkdeps.h.
4819         (_cpp_handle_directive): Reenable macro expander if appropriate.
4820         (undefine_macros): Inline body of _cpp_free_definition for speed.
4821         Do not call undef callback or _cpp_warn_if_unused_macro.
4822         (cpp_get_deps): New interface.
4823         * files.c (search_cache): Add pfile argument.  Check for file
4824         that would be found by "" or <> search here...
4825         (_cpp_find_file): ...not here.  Correct recorded start_dir of
4826         files found by directory-of-current-file search that would be
4827         found by "" or <> search.
4828         * init.c (cpp_add_dependency_target): Delete.
4829         * internal.h (struct lexer_state): Add discarding_output flag.
4830         * lex.c (lex_identifier): Compute hash function while scanning.
4831         * macro.c (cpp_scan_nooutput): Disable macro expansion outside
4832         directives.
4833         * makedepend.c: New file.
4834         * mkdeps.c (struct deps): Add vpath vector.
4835         (apply_vpath, deps_add_vpath): New function.
4836         (deps_free): Free vpath vector.
4837         (deps_add_dep, deps_add_target): Use apply_vpath.
4838         * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
4839         (ht_lookup_with_hash): New function.
4840         * cpplib.h, mkdeps.h: Update prototypes.
4841         * symtab.h: Update prototypes.
4842         (HT_HASHSTEP, HT_FINISH): New macros.
4844 2004-05-29  Geoffrey Keating  <geoffk@apple.com>
4846         * symtab.c (ht_create): Set entries_owned.
4847         (ht_destroy): Honour entries_owned.
4848         (ht_expand): Likewise.
4849         (ht_load): New.
4850         * include/symtab.h (struct ht): New field 'entries_owned'
4851         (ht_load): New prototype.
4853 2004-05-26  Paolo Bonzini  <bonzini@gnu.org>
4855         PR bootstrap/15651
4856         * configure.ac: Fix m4 quoting when picking
4857         the size of HOST_WIDE_INT.
4858         * configure: Regenerate.
4860 2004-05-25  Paolo Bonzini  <bonzini@gnu.org>
4862         * Makefile.am: the correct directory for
4863         gettext include files is given by @INCINTL@.
4864         * Makefile.in: Regenerate.
4866 2004-05-24  Paolo Bonzini  <bonzini@gnu.org>
4868         * system.h [!ENABLE_NLS]: dgettext takes two
4869         parameters.
4871 2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
4873         Moved libcpp from the gcc subdirectory to the toplevel.
4874         * Makefile.am: New file.
4875         * Makefile.in: Regenerate.
4876         * configure.ac: New file.
4877         * configure: Regenerate.
4878         * config.in: Regenerate.
4879         * charset.c: Moved from gcc/cppcharset.c.  Add note about
4880         brokenness of input charset detection.  Adjust for change
4881         in name of cppucnid.h.
4882         * errors.c: Moved from gcc/cpperror.c.  Do not include intl.h.
4883         * expr.c: Moved from gcc/cppexp.c.
4884         * files.c: Moved from gcc/cppfiles.c.  Do not include intl.h.
4885         Remove #define of O_BINARY, it is in system.h.
4886         * identifiers.c: Moved from gcc/cpphash.c.
4887         * internal.h: Moved from gcc/cpphash.h.  Change header
4888         guard name.  All other files adjusted to match name change.
4889         * init.c: Moved from gcc/cppinit.c.
4890         (init_library) [ENABLE_NLS]: Call bindtextdomain.
4891         * lex.c: Moved from gcc/cpplex.c.
4892         * directives.c: Moved from gcc/cpplib.c.
4893         * macro.c: Moved from gcc/cppmacro.c.
4894         * pch.c: Moved from gcc/cpppch.c.  Do not include intl.h.
4895         * traditional.c: Moved from gcc/cpptrad.c.
4896         * ucnid.h: Moved from gcc/cppucnid.h.  Change header
4897         guard name.
4898         * ucnid.pl: Moved from gcc/cppucnid.pl.
4899         * ucnid.tab: Moved from gcc/cppucnid.tab.  Change header
4900         guard name.
4901         * symtab.c: Moved from gcc/hashtable.c.
4902         * line-map.c: Moved from gcc.  Do not include intl.h.
4903         * mkdeps.c: Moved from gcc.
4904         * system.h: New file.
4905         * include/cpplib.h: Moved from gcc.  Change header guard name.
4906         * include/line-map.h: Moved from gcc.  Change header guard name.
4907         * include/mkdeps.h: Moved from gcc.  Change header guard name.
4908         * include/symtab.h: Moved from gcc/hashtable.h.  Change header
4909         guard name.
4911 Copyright (C) 2004-2016 Free Software Foundation, Inc.
4913 Copying and distribution of this file, with or without modification,
4914 are permitted in any medium without royalty provided the copyright
4915 notice and this notice are preserved.