[PATCH, PR83492] Fix selection of aarch64 big-endian shift parameters based on __AARC...
[official-gcc.git] / libcpp / ChangeLog
blob2224b9ea315cdc4ec8152e395cd54f74153574f3
1 2017-12-20  Michael Weiser  <michael.weiser@gmx.de>
3         PR preprocessor/83492
4         * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]:
5         Fix selection of big-endian shift parameters by using
6         __ARM_BIG_ENDIAN.
8 2017-12-14  Bernd Edlinger  <bernd.edlinger@hotmail.de>
10         * internal.h (maybe_print_line): Change signature.
11         
12 2017-12-05  Jakub Jelinek  <jakub@redhat.com>
14         PR c++/79228
15         * expr.c (interpret_float_suffix): Avoid memcmp.
16         (interpret_int_suffix): Likewise.  Don't check for if.
18 2017-12-01  Jason Merrill  <jason@redhat.com>
20         PR c++/79228 - extensions hide C++14 complex literal operators
21         * expr.c (interpret_float_suffix): Ignore 'i' in C++14 and up.
22         (interpret_int_suffix): Likewise.
24 2017-11-28  David Malcolm  <dmalcolm@redhat.com>
26         PR c/82050
27         * include/line-map.h (LINE_MAP_MAX_COLUMN_NUMBER): Move here.
28         * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): ...from here.
29         (rich_location::maybe_add_fixit): Reject fix-it hints in which
30         the start column exceeds the next column.
32 2017-11-20  Eric Gallager  <egall@gwmail.gwu.edu>
34         PR preprocessor/81794
35         * macro.c (check_trad_stringification): Have warning be controlled
36         by -Wtraditional.
38 2017-11-20  David Malcolm  <dmalcolm@redhat.com>
40         PR c++/72786
41         * include/cpplib.h (cpp_macro_definition_location): New decl.
42         * macro.c (cpp_macro_definition): New function.
44 2017-11-13  Tom Tromey  <tom@tromey.com>
46         * pch.c (cpp_read_state): Set n__VA_OPT__.
47         * macro.c (vaopt_state): New class.
48         (_cpp_arguments_ok): Check va_opt flag.
49         (replace_args, create_iso_definition): Use vaopt_state.
50         * lex.c (lex_identifier_intern): Possibly issue errors for
51         __VA_OPT__.
52         (lex_identifier): Likewise.
53         (maybe_va_opt_error): New function.
54         * internal.h (struct lexer_state) <va_args_ok>: Update comment.
55         (struct spec_nodes) <n__VA_OPT__>: New field.
56         * init.c (struct lang_flags) <va_opt>: New field.
57         (lang_defaults): Add entries for C++2A.  Update all entries for
58         va_opt.
59         (cpp_set_lang): Initialize va_opt.
60         * include/cpplib.h (struct cpp_options) <va_opt>: New field.
61         * identifiers.c (_cpp_init_hashtable): Initialize n__VA_OPT__.
63 2017-11-13  David Malcolm  <dmalcolm@redhat.com>
65         * include/line-map.h (linenum_type): Move this typedef and the
66         comment describing column numbering to near the top of the file.
68 2017-11-06  Mukesh Kapoor  <mukesh.kapoor@oracle.com>
70         PR c++/80955
71         * lex.c (lex_string): When checking for a valid macro for the
72         warning related to -Wliteral-suffix (CPP_W_LITERAL_SUFFIX),
73         check that the macro name does not start with an underscore
74         before calling is_macro().
76 2017-11-05  Tom de Vries  <tom@codesourcery.com>
78         PR other/82784
79         * lex.c (BUF_APPEND): Remove semicolon after
80         "do {} while (0)".
82 2017-10-31  David Malcolm  <dmalcolm@redhat.com>
84         * directives.c (_cpp_handle_directive): Update for renaming of
85         cpp_error_at_richloc to cpp_error_at.
86         * errors.c (cpp_diagnostic_at_richloc): Rename to...
87         (cpp_diagnostic_at): ...this, dropping the location_t-based
88         implementation.
89         (cpp_diagnostic): Update for removal of location_t-based
90         cpp_diagnostic_at.
91         (cpp_error_at): Likewise.
92         (cpp_error_at_richloc): Rename to...
93         (cpp_error_at): ...this, and update for renaming of
94         cpp_diagnostic_at_richloc.
95         * include/cpplib.h (cpp_error_at_richloc): Rename to...
96         (cpp_error_at): ...this.
98 2017-10-30  Joseph Myers  <joseph@codesourcery.com>
100         * include/cpplib.h (enum c_lang): Add CLK_GNUC17 and CLK_STDC17.
101         * init.c (lang_defaults): Add GNUC17 and STDC17 data.
102         (cpp_init_builtins): Handle C17 value of __STDC_VERSION__.
104 2017-10-10  Nathan Sidwell  <nathan@acm.org>
106         PR preprocessor/82506
107         * macro.c (cpp_quote_string): Escape raw LFs.
109 2017-09-15  Andrew Sutton  <andrew.n.sutton@gmail.com>
110             Jakub Jelinek  <jakub@redhat.com>
112         Add support for -std=c++2a.
113         * include/cpplib.h (c_lang): Add CXX2A and GNUCXX2A.
114         * init.c (lang_defaults): Add rows for CXX2A and GNUCXX2A.
115         (cpp_init_builtins): Set __cplusplus to 201709L for C++2a.
117 2017-09-15  Jakub Jelinek  <jakub@redhat.com>
119         * include/cpplib.h (enum c_lang): Rename CLK_GNUCXX1Z
120         to CLK_GNUCXX17 and CLK_CXX1Z to CLK_CXX17.
121         * init.c (lang_defaults, cpp_init_builtins): Likewise.
122         * expr.c (cpp_classify_number): Use C++17 instead of C++1z
123         in diagnostics.
125 2017-07-07  David Malcolm  <dmalcolm@redhat.com>
127         PR c++/79300
128         * line-map.c (linemap_macro_loc_to_def_point): Preserve range
129         information for macro expansions by delaying resolving ad-hoc
130         locations until within the loop.
132 2017-07-06  David Malcolm  <dmalcolm@redhat.com>
134         PR c++/79300
135         * include/line-map.h (enum location_aspect): New enum.
136         (linemap_client_expand_location_to_spelling_point): Add
137         enum location_aspect param.
138         * line-map.c (rich_location::get_expanded_location): Update for
139         new param of linemap_client_expand_location_to_spelling_point.
140         (rich_location::maybe_add_fixit): Likewise.
141         (fixit_hint::affects_line_p): Likewise.
143 2017-06-21  Jakub Jelinek  <jakub@redhat.com>
145         * line-map.c (location_adhoc_data_update): Perform addition in
146         uintptr_t type rather than char * type.  Read *data using
147         ptrdiff_t type instead of int64_t.
148         (get_combined_adhoc_loc): Change offset type to ptrdiff_t from
149         int64_t.
151 2017-06-20  David Malcolm  <dmalcolm@redhat.com>
153         * include/line-map.h (class rich_location): Document that attempts
154         to delete or replace a range *affecting* multiple lines will fail.
155         * line-map.c (rich_location::maybe_add_fixit): Implement this
156         restriction.
158 2017-06-09  David Malcolm  <dmalcolm@redhat.com>
160         * include/line-map.h
161         (rich_location::fixits_cannot_be_auto_applied): New method.
162         (rich_location::fixits_can_be_auto_applied_p): New accessor.
163         (rich_location::m_fixits_cannot_be_auto_applied): New field.
164         * line-map.c (rich_location::rich_location): Initialize new field.
166 2017-06-05  David Malcolm  <dmalcolm@redhat.com>
168         * include/cpplib.h (struct cpp_callbacks): Add "comment"
169         callback.
170         * lex.c (_cpp_lex_direct): Call the comment callback if non-NULL.
172 2017-05-02  David Malcolm  <dmalcolm@redhat.com>
174         * include/line-map.h (class rich_location): Update description of
175         newline handling.
176         (class fixit_hint): Likewise.
177         (fixit_hint::ends_with_newline_p): New decl.
178         * line-map.c (rich_location::maybe_add_fixit): Support newlines
179         in fix-it hints that are insertions of single lines at the start
180         of a line.  Don't consolidate into such fix-it hints.
181         (fixit_hint::ends_with_newline_p): New method.
183 2017-05-01  David Malcolm  <dmalcolm@redhat.com>
185         * include/line-map.h (source_range::intersects_line_p): Delete.
186         (rich_location::add_fixit): Delete.
187         (rich_location::maybe_add_fixit): New method.
188         (class fixit_hint): Reimplement in terms of...
189         (class fixit_replace): ...this.
190         (class fixit_insert): Delete.
191         * line-map.c (linemap_position_for_loc_and_offset): Drop overzealous
192         linemap_assert_fails.
193         (source_range::intersects_line_p): Rename to...
194         (fixit_hint::affects_line_p): New function.
195         (rich_location::add_fixit_insert_before): Reimplement in terms of
196         maybe_add_fixit, moving validation there.
197         (rich_location::add_fixit_insert_after): Likewise.
198         (column_before_p): Delete.
199         (rich_location::add_fixit_replace): Reimplement in terms of
200         maybe_add_fixit, moving validation there.  Convert closed input range
201         to half-open range.
202         (rich_location::add_fixit): Delete.
203         (rich_location::maybe_add_fixit): New function.
204         (fixit_insert::fixit_insert): Delete.
205         (fixit_insert::~fixit_insert): Delete.
206         (fixit_insert::affects_line_p): Delete.
207         (fixit_insert::maybe_append_replace): Delete.
208         (fixit_replace::fixit_replace): Rename to...
209         (fixit_hint::fixit_hint): ...this, rewriting as necessary.
210         (fixit_replace::~fixit_replace): Delete.
211         (fixit_replace::affects_line_p): Delete.
212         (fixit_replace::maybe_append_replace): Rename to...
213         (fixit_hint::maybe_append): ...this, rewriting as necessary.
215 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
217         * include/line-map.h (LINEMAPS_MACRO_MAPS): Fix typo in comment.
218         * lex.c (search_line_fast): Likewise.
219         * pch.h (cpp_valid_state): Likewise.
221 2017-03-21  Andreas Schwab  <schwab@suse.de>
223         * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]:
224         Convert 64-bit value to boolean before passing to
225         __builtin_expect.
227 2017-03-16  Jason Merrill  <jason@redhat.com>
229         * init.c (cpp_init_builtins): Update __cplusplus for C++17.
231 2017-02-09  Gerald Pfeifer  <gerald@pfeifer.com>
233         * Makefile.in (po/$(PACKAGE).pot): Adjust bug reporting URL.
235 2017-01-10  David Malcolm  <dmalcolm@redhat.com>
237         PR c++/77949
238         * line-map.c (linemap_position_for_column): When calling
239         linemap_start_line, detect if a new linemap was created with
240         0 column bits, and bail out early if this is the case.
241         (linemap_position_for_loc_and_offset): Replace overzealous
242         linemap_assert_fails with a simple conditional; use correct
243         bit count.
245 2017-01-07  David Malcolm  <dmalcolm@redhat.com>
247         PR c++/72803
248         * line-map.c (linemap_line_start): When determining if the highest
249         column given out so far will fit into a proposed change to the
250         current map, use the effective number of column bits, rather than
251         the total number of column + range bits.
253 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
255         Update copyright years.
257 2016-12-15  David Malcolm  <dmalcolm@redhat.com>
259         PR preprocessor/78680
260         PR preprocessor/78811
261         * lex.c (_cpp_lex_direct): Only determine the end-location of
262         the token and build a range for non-reserved start locations.
263         Do not do it for EOF tokens.
265 2016-12-12  David Malcolm  <dmalcolm@redhat.com>
267         PR preprocessor/78680
268         * lex.c (_cpp_lex_direct): Ensure line notes are processed before
269         computing the end-point of the token.
271 2016-11-23  Paolo Bonzini  <bonzini@gnu.org>
273         * include/cpplib.h (struct cpp_options): Add new member
274         warn_expansion_to_defined.
275         (CPP_W_EXPANSION_TO_DEFINED): New enum member.
276         * expr.c (parse_defined): Warn for all uses of "defined"
277         in macros, and tie warning to CPP_W_EXPANSION_TO_DEFINED.
278         Make it a pedwarning instead of a warning.
279         * system.h (HAVE_DESIGNATED_INITIALIZERS): Do not use
280         "defined" in macros.
282 2016-11-17  David Malcolm  <dmalcolm@redhat.com>
284         * charset.c (cpp_interpret_string_1): Skip locations from
285         loc_reader when advancing 'p' when handling raw strings.
287 2016-11-16  Jakub Jelinek  <jakub@redhat.com>
289         PR bootstrap/72823
290         * configure.ac (ENABLE_ASSERT_CHECKING): Define if gcc configure
291         would define that macro.
292         * configure: Regenerated.
293         * config.in: Regenerated.
295 2016-11-08  Richard Earnshaw  <rearnsha@arm.com>
297         * lex.c (search_line_fast): New implementation for AArch64.
299 2016-10-25  David Malcolm  <dmalcolm@redhat.com>
301         * files.c (destroy_cpp_file): Free file->path.
303 2016-10-25  David Malcolm  <dmalcolm@redhat.com>
305         * include/line-map.h (line_maps::~line_maps): New dtor.
306         (location_adhoc_data_fini): Delete decl.
307         * line-map.c (line_maps::~line_maps): New dtor.
308         (location_adhoc_data_fini): Delete.
310 2016-10-21  Andris Pavenis  <andris.pavenis@iki.fi>
312         PR preprocessor/71681
313         * files.c (remap_filename): Fix handling -remap in subdirectories.
315 2016-10-12  Jakub Jelinek  <jakub@redhat.com>
317         * include/cpplib.h (struct cpp_options): Add
318         cpp_warn_implicit_fallthrough.
319         * init.c (cpp_create_reader): Initialize it to 0.
320         * lex.c (fallthrough_comment_p): Handle different
321         cpp_warn_implicit_fallthrough levels.  Whitespace fixes.
323 2016-10-08  Jakub Jelinek  <jakub@redhat.com>
325         * lex.c (fallthrough_comment_p): Accept Else, fallthrough.
327         * lex.c (fallthrough_comment_p): Extend to handle more common FALLTHRU
328         comment styles.
330         * lex.c (fallthrough_comment_p): Fix off-by-one size comparison
331         errors, cleanup.
332         (_cpp_lex_direct): Allow arbitrary comments in between
333         fallthrough_comment_p comment and following token.
335 2016-10-04  Kelvin Nilsen  <kelvin@gcc.gnu.org>
337         PR target/77847
338         * lex.c (search_line_fast): Add a FALLTHROUGH comment to correct
339         compiler error in the version of this function that is
340         conditionally compiled when GCC_VERSION >= 4005 and both
341         __ALTIVEC__ and __BIG_ENDIAN__ symbols are defined.
343 2016-09-26  Marek Polacek  <polacek@redhat.com>
344             Jakub Jelinek  <jakub@redhat.com>
346         PR c/7652
347         * include/cpplib.h (PREV_FALLTHROUGH): Define.
348         * internal.h (CPP_FALLTHRU): Define.
349         * lex.c (fallthrough_comment_p): New function.
350         (_cpp_lex_direct): Set PREV_FALLTHROUGH on tokens succeeding a falls
351         through comment.
353 2016-09-23  David Malcolm  <dmalcolm@redhat.com>
355         PR preprocessor/77672
356         * charset.c (cpp_interpret_string_1): Add a source_range for the
357         NUL-terminator, using the location of the trailing quote of the
358         final string.
360 2016-09-21  Jason Merrill  <jason@redhat.com>
362         * line-map.c (linemap_location_from_macro_definition_p): New.
363         * line-map.h: Declare it.
365 2016-09-15  David Malcolm  <dmalcolm@redhat.com>
367         * include/line-map.h (class rich_location): Note that newlines
368         aren't supported in fix-it text.
369         * line-map.c (rich_location::add_fixit_insert_before): Reject
370         attempts to add fix-its containing newlines.
371         (rich_location::add_fixit_replace): Likewise.
373 2016-09-13  David Malcolm  <dmalcolm@redhat.com>
375         * include/line-map.h (class rich_location): Add description of
376         fix-it hints to leading comment.
377         (rich_location::add_fixit_insert): Rename both overloaded methods
378         to..
379         (rich_location::add_fixit_insert_before): ...this, updating their
380         comments.
381         (rich_location::add_fixit_insert_after): Two new overloaded
382         methods.
383         (rich_location::stop_supporting_fixits): New method.
384         * line-map.c (rich_location::add_fixit_insert): Rename both
385         overloaded methods to..
386         (rich_location::add_fixit_insert_before): ...this, updating their
387         comments.
388         (rich_location::add_fixit_insert_after): Two new methods.
389         (rich_location::reject_impossible_fixit): Split out
390         failure-handling into...
391         (rich_location::stop_supporting_fixits): New method.
393 2016-09-02  David Malcolm  <dmalcolm@redhat.com>
395         * include/line-map.h (rich_location::seen_impossible_fixit_p): New
396         accessor.
398 2016-08-31  David Malcolm  <dmalcolm@redhat.com>
400         * include/line-map.h (class fixit_remove): Remove stray decl.
401         (fixit_hint::affects_line_p): Make const.
402         (fixit_insert::affects_line_p): Likewise.
403         (fixit_replace::affects_line_p): Likewise.
404         * line-map.c (fixit_insert::affects_line_p): Likewise.
405         (fixit_replace::affects_line_p): Likewise.
407 2016-08-30  David Malcolm  <dmalcolm@redhat.com>
409         * include/line-map.h (class semi_embedded_vec): New class.
410         (semi_embedded_vec<T, NUM_EMBEDDED>::semi_embedded_vec): New ctor.
411         (semi_embedded_vec<T, NUM_EMBEDDED>::~semi_embedded_vec): New
412         dtor.
413         (semi_embedded_vec<T, NUM_EMBEDDED>::operator[]): New methods.
414         (semi_embedded_vec<T, NUM_EMBEDDED>::push): New method.
415         (semi_embedded_vec<T, NUM_EMBEDDED>::truncate): New method.
416         (rich_location::get_num_locations): Reimplement in terms of
417         m_ranges.
418         (rich_location::get_range): Make non-inline.
419         (rich_location::get_num_fixit_hints): Reimplement in terms of
420         m_fixit_hints.
421         (rich_location::add_fixit): New function.
422         (rich_location::MAX_RANGES): Rename to...
423         (rich_location::STATICALLY_ALLOCATED_RANGES): ...this.
424         (rich_location::MAX_FIXIT_HINTS): Rename to...
425         (rich_location::STATICALLY_ALLOCATED_RANGES): ...this, and make
426         private.
427         (rich_location::m_num_ranges): Eliminate in favor of...
428         (rich_location::m_ranges): ...this, converting from a fixed-size
429         array to a semi_embedded_vec.
430         (rich_location::m_num_fixit_hints): Eliminate in favor of...
431         (rich_location::m_fixit_hints): ...this, converting from a
432         fixed-size array to a semi_embedded_vec.
433         * line-map.c (rich_location::rich_location): Update for above
434         changes.
435         (rich_location::~rich_location): Likewise.
436         (rich_location::get_loc): Likewise.
437         (rich_location::get_range): New methods.
438         (rich_location::add_range): Update for above changes.
439         (rich_location::set_range): Likewise.
440         (rich_location::add_fixit_insert): Likewise.
441         (rich_location::add_fixit_replace): Likewise.
442         (rich_location::get_last_fixit_hint): Likewise.
443         (rich_location::reject_impossible_fixit): Likewise.
444         (rich_location::add_fixit): New method.
446 2016-08-30  David Malcolm  <dmalcolm@redhat.com>
448         * include/line-map.h (rich_location::add_fixit_insert): Add
449         comments.  Add overload omitting the source_location param.
450         (rich_location::add_fixit_remove): Add comments.  Add overloads
451         omitting the range, and accepting a source_location.
452         (rich_location::add_fixit_replace): Likewise.
453         * line-map.c (rich_location::add_fixit_insert): Add comments.  Add
454         overload omitting the source_location param.
455         (rich_location::add_fixit_remove): Add comments.  Add overloads
456         omitting the range, and accepting a source_location.
457         (rich_location::add_fixit_replace): Likewise.
459 2016-08-26  David Malcolm  <dmalcolm@redhat.com>
461         * include/line-map.h (get_pure_location): New decl.
462         * line-map.c (get_pure_location): Move here, from gcc/input.c, adding
463         a line_maps * param.
464         (rich_location::add_fixit_insert): Call get_pure_location on "where".
465         (rich_location::add_fixit_replace): Call get_pure_location on the
466         end-points.
468 2016-08-26  David Malcolm  <dmalcolm@redhat.com>
470         * include/line-map.h (rich_location): Eliminate unimplemented
471         constructor based on source_range.
472         (rich_location::get_last_fixit_hint): New method.
473         (rich_location::reject_impossible_fixit): New method.
474         (rich_location): Add fields m_line_table and
475         m_seen_impossible_fixit.
476         (fixit_hint::maybe_append_replace): New pure virtual function.
477         (fixit_insert::maybe_append_replace): New function.
478         (fixit_replace::maybe_append_replace): New function.
479         * line-map.c (rich_location::rich_location): Initialize
480         m_line_table and m_seen_impossible_fixit.
481         (rich_location::add_fixit_insert): Call
482         reject_impossible_fixit and bail out if true.
483         (column_before_p): New function.
484         (rich_location::add_fixit_replace): Call reject_impossible_fixit
485         and bail out if true.  Attempt to consolidate with neighboring
486         fixits.
487         (rich_location::get_last_fixit_hint): New method.
488         (rich_location::reject_impossible_fixit): New method.
489         (fixit_insert::maybe_append_replace): New method.
490         (fixit_replace::maybe_append_replace): New method.
492 2016-08-23  David Malcolm  <dmalcolm@redhat.com>
494         * include/line-map.h (source_range::from_locations): New method.
496 2016-08-19  David Malcolm  <dmalcolm@redhat.com>
498         * include/line-map.h (fixit_hint::kind): Delete REPLACE.
499         (class fixit_remove): Delete.
500         * line-map.c (rich_location::add_fixit_remove): Reimplement
501         by calling add_fixit_replace with an empty string.
502         (fixit_remove::fixit_remove): Delete.
503         (fixit_remove::affects_line_p): Delete.
505 2016-08-19  Joseph Myers  <joseph@codesourcery.com>
507         PR c/32187
508         * include/cpplib.h (CPP_N_FLOATN, CPP_N_FLOATNX)
509         (CPP_N_WIDTH_FLOATN_NX, CPP_FLOATN_SHIFT, CPP_FLOATN_MAX): New
510         macros.
511         * expr.c (interpret_float_suffix): Handle fN, fNx, FN and FNx
512         suffixes.
514 2016-08-19  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
516         * expr.c (eval_token): Append "evaluates to 0" to Wundef diagnostic.
518 2016-08-18  David Malcolm  <dmalcolm@redhat.com>
520         * directives.c (directive_names): New array.
521         (_cpp_handle_directive): Offer spelling suggestions for misspelled
522         directives.
523         * errors.c (cpp_diagnostic_at_richloc): New function.
524         (cpp_error_at_richloc): New function.
525         * include/cpplib.h (struct cpp_callbacks): Add field
526         "get_suggestion".
527         (cpp_error_at_richloc): New decl.
529 2016-08-18  Marek Polacek  <polacek@redhat.com>
531         PR c/7652
532         * pch.c (write_macdef): Add CPP_FALLTHRU.
534 2016-08-12  Marek Polacek  <polacek@redhat.com>
536         PR c/7652
537         * lex.c (search_line_fast): Add FALLTHRU.
538         (_cpp_lex_direct): Likewise.
539         (cpp_token_val_index): Adjust fall through comment.
540         * macro.c (parse_params): Add FALLTHRU.
541         * pch.c (count_defs): Adjust fall through comment.
542         (write_defs): Likewise.
544 2016-08-06  David Malcolm  <dmalcolm@redhat.com>
546         PR bootstrap/72823
547         * charset.c (_cpp_valid_ucn): Replace overzealous assert with one
548         that allows for char_range to be non-NULL when loc_reader is NULL.
550 2016-08-05  David Malcolm  <dmalcolm@redhat.com>
552         * charset.c (cpp_substring_ranges::cpp_substring_ranges): New
553         constructor.
554         (cpp_substring_ranges::~cpp_substring_ranges): New destructor.
555         (cpp_substring_ranges::add_range): New method.
556         (cpp_substring_ranges::add_n_ranges): New method.
557         (_cpp_valid_ucn): Add "char_range" and "loc_reader" params; if
558         they are non-NULL, read position information from *loc_reader
559         and update char_range->m_finish accordingly.
560         (convert_ucn): Add "char_range", "loc_reader", and "ranges"
561         params.  If loc_reader is non-NULL, read location information from
562         it, and update *ranges accordingly, using char_range.
563         Conditionalize the conversion into tbuf on tbuf being non-NULL.
564         (convert_hex): Likewise, conditionalizing the call to
565         emit_numeric_escape on tbuf.
566         (convert_oct): Likewise.
567         (convert_escape): Add params "loc_reader" and "ranges".  If
568         loc_reader is non-NULL, read location information from it, and
569         update *ranges accordingly.  Conditionalize the conversion into
570         tbuf on tbuf being non-NULL.
571         (cpp_interpret_string): Rename to...
572         (cpp_interpret_string_1): ...this, adding params "loc_readers" and
573         "out".  Use "to" to conditionalize the initialization and usage of
574         "tbuf", such as running the converter.  If "loc_readers" is
575         non-NULL, use the instances within it, reading location
576         information from them, and passing them to convert_escape; likewise
577         write to "out" if loc_readers is non-NULL.  Check for leading
578         quote and issue an error if it is not present.  Update boundary
579         check from "== limit" to ">= limit" to protect against erroneous
580         location values to calls that are not parsing string literals.
581         (cpp_interpret_string): Reimplement in terms to
582         cpp_interpret_string_1.
583         (noop_error_cb): New function.
584         (cpp_interpret_string_ranges): New function.
585         (cpp_string_location_reader::cpp_string_location_reader): New
586         constructor.
587         (cpp_string_location_reader::get_next): New method.
588         * include/cpplib.h (class cpp_string_location_reader): New class.
589         (class cpp_substring_ranges): New class.
590         (cpp_interpret_string_ranges): New prototype.
591         * internal.h (_cpp_valid_ucn): Add params "char_range" and
592         "loc_reader".
593         * lex.c (forms_identifier_p): Pass NULL for new params to
594         _cpp_valid_ucn.
596 2016-08-01  Andreas Schwab  <schwab@suse.de>
598         * include/cpplib.h: Fix comment typo.
600 2016-07-27  David Malcolm  <dmalcolm@redhat.com>
602         * include/line-map.h (source_location): Fix line numbers in
603         comment.
605 2016-07-11  David Malcolm  <dmalcolm@redhat.com>
607         * include/line-map.h (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES):
608         Move here from line-map.c.
609         (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
610         * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): Move from
611         here to line-map.h.
612         (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
614 2016-06-22  David Malcolm  <dmalcolm@redhat.com>
616         * directives.c (do_include_common): Pass on "location" to
617         _cpp_stack_include.
618         * errors.c (cpp_diagnostic): Reimplement in terms of...
619         (cpp_diagnostic_at): New function.
620         (cpp_error_at): New function.
621         (cpp_errno_filename): Add "loc" param and use it by using
622         cpp_error_at rather than cpp_error.
623         * files.c (find_file_in_dir): Add "loc" param and pass it to
624         open_file_failed.
625         (_cpp_find_file): Add "loc" param.  Use it to convert calls to
626         cpp_error to cpp_error_at, and pass it to find_file_in_dir and
627         open_file_failed.
628         (read_file_guts): Add "loc" param.  Use it to convert calls to
629         cpp_error to cpp_error_at.  Pass it to cpp_errno_filename.
630         (read_file): Add "loc" param.  Pass it to open_file_failed and
631         read_file_guts.
632         (should_stack_file): Add "loc" param.  Pass it to read_file.
633         (_cpp_stack_file): Add "loc" param.  Pass it to should_stack_file.
634         (_cpp_stack_include): Add "loc" param.  Pass it to
635         _cpp_find_file and _cpp_stack_file.
636         (open_file_failed): Add "loc" param.  Pass it to
637         cpp_errno_filename.
638         (_cpp_fake_include): Add 0 as a source_location in call to
639         _cpp_find_file.
640         (_cpp_compare_file_date): Likewise.
641         (cpp_push_include): Likewise for call to _cpp_stack_include.
642         (cpp_push_default_include): Likewise.
643         (_cpp_save_file_entries): Likewise for call to open_file_failed.
644         (_cpp_has_header): Likewise for call to _cpp_find_file.
645         * include/cpplib.h (cpp_errno_filename): Add source_location
646         param.
647         (cpp_error_at): New declaration.
648         * init.c (cpp_read_main_file): Add 0 as a source_location in calls
649         to _cpp_find_file and _cpp_stack_file.
650         * internal.h (_cpp_find_file): Add source_location param.
651         (_cpp_stack_file): Likewise.
652         (_cpp_stack_include): Likewise.
654 2016-06-22  David Malcolm  <dmalcolm@redhat.com>
656         * include/line-map.h (fixit_hint::get_start_loc): New pure virtual
657         function.
658         (fixit_hint::maybe_get_end_loc): Likewise.
659         (fixit_insert::get_start_loc): New function, implementing
660         fixit_hint::get_start_loc.
661         (fixit_insert::maybe_get_end_loc): New function, implementing
662         fixit_hint::maybe_get_end_loc.
663         (fixit_remove::get_start_loc): New function, implementing
664         fixit_hint::get_start_loc.
665         (fixit_remove::maybe_get_end_loc): New function, implementing
666         fixit_hint::maybe_get_end_loc.
667         (fixit_replace::get_start_loc): New function, implementing
668         fixit_hint::get_start_loc.
669         (fixit_replace::maybe_get_end_loc): New function, implementing
670         fixit_hint::maybe_get_end_loc.
672 2016-06-21  John David Anglin  <danglin@gcc.gnu.org>
674         * line-map.c (location_adhoc_data_update): Use int64_t instead of
675         long long.
676         (get_combined_adhoc_loc): Likewise.
678 2016-06-01  Eduard Sanou  <dhole@openmailbox.org>
680         * include/cpplib.h (cpp_callbacks): Add get_source_date_epoch
681         callback.
682         * include/cpplib.h (cpp_init_source_date_epoch): Remove prototype.
683         * init.c (cpp_init_source_date_epoch): Remove function.
684         * init.c (cpp_create_reader): Initialize pfile->source_date_epoch.
685         * internal.h (cpp_reader): Extend comment about source_date_epoch.
686         * macro.c (_cpp_builtin_macro_text): Use get_source_date_epoch
687         callback only once, read pfile->source_date_epoch on future passes.
688         Check that get_source_date_epoch callback is not NULL.
690 2016-05-20  Martin Liska  <mliska@suse.cz>
692         * config.in: Regenerated.
693         * configure: Likewise.
694         * configure.ac: Handle --enable-valgrind-annotations.
695         * lex.c (new_buff): Use ENABLE_VALGRIND_ANNOTATIONS instead
696         of ENABLE_VALGRIND_CHECKING.
697         (_cpp_free_buff): Likewise.
699 2016-04-28  Eduard Sanou  <dhole@openmailbox.org>
700             Matthias Klose  <doko@debian.org>
702         * include/cpplib.h (cpp_init_source_date_epoch): Prototype.
703         * init.c (cpp_init_source_date_epoch): New function.
704         * internal.h: Added source_date_epoch variable to struct
705         cpp_reader to store a reproducible date.
706         * macro.c (_cpp_builtin_macro_text): Set pfile->date timestamp from 
707         pfile->source_date_epoch instead of localtime if source_date_epoch is 
708         set, to be used for __DATE__ and __TIME__ macros to help reproducible 
709         builds.
711 2016-04-13  Bernd Schmidt  <bschmidt@redhat.com>
713         Patch from Roger Orr <rogero@howzatt.demon.co.uk>
714         PR preprocessor/69650
715         * directives.c (do_linemarker): Reread map after calling
716         cpp_get_token.
718 2016-04-06  Richard Henderson  <rth@redhat.com>
720         PR preprocessor/61817
721         PR preprocessor/69391
722         * internal.h (_cpp_builtin_macro_text): Update decl.
723         * macro.c (_cpp_builtin_macro_text): Accept location for __LINE__.
724         (builtin_macro): Accept a second location for __LINE__.
725         (enter_macro_context): Compute both virtual and real expansion
726         locations for the macro.
728 2016-03-25  Bernd Schmidt  <bschmidt@redhat.com>
730         PR lto/69650
731         * directives.c (do_linemarker): Test for file left but not entered
732         here.
733         * line-map.c (linemap_add): Not here.
735 2016-03-21  Jakub Jelinek  <jakub@redhat.com>
737         PR target/70296
738         * include/cpplib.h (cpp_fun_like_macro_p): New prototype.
739         * macro.c (cpp_fun_like_macro_p): New function.
741 2016-03-15  Richard Henderson  <rth@redhat.com>
743         * line-map.c (new_linemap): Make alloc_size a size_t.
745 2016-03-14  Jason Merrill  <jason@redhat.com>
747         * expr.c (cpp_classify_number): Hex floats are new in C++1z.
748         * init.c (lang_defaults): Likewise.
750 2016-03-09  David Malcolm  <dmalcolm@redhat.com>
752         PR c/68473
753         PR c++/70105
754         * line-map.c (linemap_macro_map_loc_unwind_toward_spelling): Move
755         decl...
756         * include/line-map.h
757         (linemap_macro_map_loc_unwind_toward_spelling): ...here,
758         converting from static to extern.
760 2016-03-09  David Malcolm  <dmalcolm@redhat.com>
762         PR c/68473
763         PR c++/70105
764         * include/line-map.h (source_range::debug): Delete.
765         (struct location_range): Update comment.  Replace
766         expanded_location fields "m_start", "m_finish", and "m_caret" with
767         a source_location field: "m_loc".
768         (class rich_location): Reword comment.
769         (rich_location::get_loc): Reimplement in terms of a new overloaded
770         variant which takes an unsigned int.
771         (rich_location::get_loc_addr): Delete.
772         (rich_location::add_range): Drop params "start" and "finish" in
773         favor of param "loc".  Drop overloaded variants taking a
774         source_range or location_range *.
775         (rich_location::lazily_expand_location): Delete in favor of...
776         (rich_location::get_expanded_location): New decl.
777         (rich_location::m_loc): Delete field.
778         (rich_location::m_column_override): New field.
779         * line-map.c (rich_location::rich_location):  Drop name of
780         line_maps * param.  Update initializations for deletion of field
781         "m_loc" and addition of field "m_column_override".  Reimplement
782         body as a call to add_range.  Delete overloaded variant taking a
783         source_range.
784         (rich_location::get_loc): New function.
785         (rich_location::lazily_expand_location): Delete in favor of...
786         (rich_location::get_expanded_location): New function.
787         (rich_location::override_column): Reimplement.
788         (rich_location::add_range): Drop params "start" and "finish" in
789         favor of param "loc".  Eliminate location expansion in favor of
790         simply storing loc.  Drop overloaded variants taking a
791         source_range or location_range *.
792         (rich_location::set_range): Eliminate location expansion.
794 2016-02-29  David Malcolm  <dmalcolm@redhat.com>
796         PR preprocessor/69985
797         (linemap_position_for_loc_and_offset): Rename param from "offset"
798         to "column_offset".  Right-shift the column_offset by m_range_bits
799         of the pertinent ordinary map whenever offsetting a
800         source_location.  For clarity, offset the column by the column
801         offset, rather than the other way around.
803 2016-02-23  David Malcolm  <dmalcolm@redhat.com>
805         PR preprocessor/69126
806         PR preprocessor/69543
807         * line-map.c (linemap_compare_locations): At the function top,
808         replace inlined bodies of get_location_from_adhoc_loc with calls
809         to get_location_from_adhoc_loc.  Add a pair of calls to
810         get_location_from_adhoc_loc at the bottom of the function, to
811         avoid meaningless comparisons of ad-hoc and non-ad-hoc locations.
813 2016-02-08  David Malcolm  <dmalcolm@redhat.com>
815         PR preprocessor/69664
816         * errors.c (cpp_diagnostic_with_line): Only call
817         rich_location::override_column if the column is non-zero.
818         * line-map.c (rich_location::override_column): Update columns
819         within m_ranges[0].  Add assertions to verify that doing so is
820         sane.
822 2016-02-05  Jakub Jelinek  <jakub@redhat.com>
824         PR c++/69628
825         * charset.c (cpp_interpret_charconst): Clear *PCHARS_SEEN
826         and *UNSIGNEDP if bailing out early due to errors.
828 2016-01-28  Jakub Jelinek  <jakub@redhat.com>
830         PR pch/68176
831         * files.c (_cpp_find_file): Set file->implicit_preinclude even if
832         included from file->implicit_preinclude header.
834         * directives.c (destringize_and_run): Adjust prototype.
836 2016-01-27  David Malcolm  <dmalcolm@redhat.com>
838         PR preprocessor/69126
839         * directives.c (destringize_and_run): Add expansion_loc param; use
840         it when handling unexpanded pragmas to fixup the locations of the
841         synthesized tokens.
842         (_cpp_do__Pragma): Add expansion_loc param and use it when calling
843         destringize_and_run.
844         * internal.h (_cpp_do__Pragma): Add expansion_loc param.
845         * macro.c (builtin_macro): Pass expansion location of _Pragma to
846         _cpp_do__Pragma.
848 2016-01-14  David Malcolm  <dmalcolm@redhat.com>
850         PR preprocessor/69177
851         * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): New
852         constant.
853         (LINE_MAP_MAX_LOCATION_WITH_COLS): Add note about unit tests
854         to comment.
855         (can_be_stored_compactly_p): Reduce threshold from
856         LINE_MAP_MAX_LOCATION_WITH_COLS to
857         LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES.
858         (get_combined_adhoc_loc): Likewise.
859         (get_range_from_loc): Likewise.
860         (linemap_line_start): Ensure that a new ordinary map is created
861         when transitioning from range-packing being enabled to disabled,
862         at the LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES threshold.  Set
863         range_bits to 0 for new ordinary maps when beyond this limit.
864         Prevent the "increase the column bits of a freshly created map"
865         optimization if the range bits has reduced.
867 2016-01-08  Jakub Jelinek  <jakub@redhat.com>
869         PR c++/69145
870         * files.c (cpp_included_before): If IS_ADHOC_LOC (location), lookup
871         real location from the line_table.
873 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
875         Update copyright years.
877 2015-12-22  David Malcolm  <dmalcolm@redhat.com>
879         * line-map.c (get_combined_adhoc_loc): Remove condition
880         on locus < RESERVED_LOCATION_COUNT when considering
881         whether a caret == start == finish location can be
882         simply stored as the caret location.
884 2015-12-07  David Malcolm  <dmalcolm@redhat.com>
886         * include/line-map.h (rich_location::set_range): Add line_maps *
887         param; convert param from source_range to source_location.  Drop
888         "overwrite_loc_p" param.
889         * line-map.c (rich_location::set_range): Likewise, acting as if
890         "overwrite_loc_p" were true, and getting range from the location.
892 2015-11-20  David Malcolm  <dmalcolm@redhat.com>
894         PR 62314
895         * include/line-map.h (source_range::intersects_line_p): New
896         method.
897         (rich_location::~rich_location): New.
898         (rich_location::add_fixit_insert): New method.
899         (rich_location::add_fixit_remove): New method.
900         (rich_location::add_fixit_replace): New method.
901         (rich_location::get_num_fixit_hints): New accessor.
902         (rich_location::get_fixit_hint): New accessor.
903         (rich_location::MAX_FIXIT_HINTS): New constant.
904         (rich_location::m_num_fixit_hints): New field.
905         (rich_location::m_fixit_hints): New field.
906         (class fixit_hint): New class.
907         (class fixit_insert): New class.
908         (class fixit_remove): New class.
909         (class fixit_replace): New class.
910         * line-map.c (source_range::intersects_line_p): New method.
911         (rich_location::rich_location): Add initialization of
912         m_num_fixit_hints to both ctors.
913         (rich_location::~rich_location): New.
914         (rich_location::add_fixit_insert): New method.
915         (rich_location::add_fixit_remove): New method.
916         (rich_location::add_fixit_replace): New method.
917         (fixit_insert::fixit_insert): New.
918         (fixit_insert::~fixit_insert): New.
919         (fixit_insert::affects_line_p): New.
920         (fixit_remove::fixit_remove): New.
921         (fixit_remove::affects_line_p): New.
922         (fixit_replace::fixit_replace): New.
923         (fixit_replace::~fixit_replace): New.
924         (fixit_replace::affects_line_p): New.
926 2015-11-19  Jakub Jelinek  <jakub@redhat.com>
928         PR preprocessor/60736
929         * include/cpplib.h (cpp_errno_filename): New prototype.
930         * errors.c (cpp_errno): Don't handle msgid "" specially, use
931         _(msgid) instead of msgid as argument to cpp_error.
932         (cpp_errno_filename): New function.
933         * files.c (read_file_guts): Use cpp_errno_filename instead of
934         cpp_errno.
935         (open_file_failed): Likewise.  Use file->name if file->path is NULL
936         in diagnostics.
938 2015-11-13  David Malcolm  <dmalcolm@redhat.com>
940         * errors.c (cpp_diagnostic): Pass pfile->line_table to
941         rich_location ctor.
942         (cpp_diagnostic_with_line): Likewise.
943         * include/cpplib.h (struct cpp_token): Update comment for src_loc
944         to indicate that the range of the token is "baked into" the
945         source_location.
946         * include/line-map.h (source_location): Update the descriptive
947         comment to reflect the packing scheme for short ranges, adding
948         worked examples of location encoding.
949         (struct line_map_ordinary): Drop field "column_bits" in favor
950         of field "m_column_and_range_bits"; add field "m_range_bits".
951         (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
952         (location_adhoc_data): Add source_range field.
953         (struct line_maps): Add fields "default_range_bits",
954         "num_optimized_ranges" and "num_unoptimized_ranges".
955         (get_combined_adhoc_loc): Add source_range param.
956         (get_range_from_loc): New declaration.
957         (pure_location_p): New prototype.
958         (COMBINE_LOCATION_DATA):  Add source_range param.
959         (SOURCE_LINE): Update for renaming of column_bits.
960         (SOURCE_COLUMN): Likewise.  Shift the column right by the map's
961         range_bits.
962         (LAST_SOURCE_LINE_LOCATION): Update for renaming of column_bits.
963         (linemap_position_for_line_and_column): Add line_maps * params.
964         (rich_location::rich_location): Likewise.
965         * lex.c (_cpp_lex_direct): Capture the range of the token, baking
966         it into token->src_loc via a call to COMBINE_LOCATION_DATA.
967         * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): Reduce from 1U << 17 to
968         1U << 12.
969         (location_adhoc_data_hash): Add the src_range into
970         the hash value.
971         (location_adhoc_data_eq): Require equality of the src_range
972         values.
973         (can_be_stored_compactly_p): New function.
974         (get_combined_adhoc_loc): Add src_range param, and store it,
975         via a bit-packing scheme for short ranges, otherwise within the
976         lookaside table.  Remove the requirement that data is non-NULL.
977         (get_range_from_adhoc_loc): New function.
978         (get_range_from_loc): New function.
979         (pure_location_p): New function.
980         (linemap_add): Ensure that start_location has zero for the
981         range_bits, unless we're past LINE_MAP_MAX_LOCATION_WITH_COLS.
982         Initialize range_bits to zero.  Assert that the start_location
983         is "pure".
984         (linemap_line_start): Assert that the
985         column_and_range_bits >= range_bits.
986         Update determinination of whether we need to start a new map
987         using the effective column bits, without the range bits.
988         Use the set's default_range_bits in new maps, apart from
989         those with column_bits == 0, which should also have 0 range_bits.
990         Increase the column bits for new maps by the range bits.
991         When adding lines to an existing map, use set->highest_line
992         directly rather than offsetting highest by SOURCE_COLUMN.
993         Add assertions to sanity-check the return value.
994         (linemap_position_for_column): Offset to_column by range_bits.
995         Update set->highest_location if necessary.
996         (linemap_position_for_line_and_column): Add line_maps * param.
997         Update the calculation to offset the column by range_bits, and
998         conditionalize it on being <= LINE_MAP_MAX_LOCATION_WITH_COLS.
999         Bound it by LINEMAPS_MACRO_LOWEST_LOCATION.  Update
1000         set->highest_location if necessary.
1001         (linemap_position_for_loc_and_offset): Handle ad-hoc locations;
1002         pass "set" to linemap_position_for_line_and_column.
1003         (linemap_macro_map_loc_unwind_toward_spelling): Add line_maps
1004         param.  Handle ad-hoc locations.
1005         (linemap_location_in_system_header_p): Pass on "set" to call to
1006         linemap_macro_map_loc_unwind_toward_spelling.
1007         (linemap_macro_loc_to_spelling_point): Retain ad-hoc locations.
1008         Pass on "set" to call to
1009         linemap_macro_map_loc_unwind_toward_spelling.
1010         (linemap_resolve_location): Retain ad-hoc locations.  Pass on
1011         "set" to call to linemap_macro_map_loc_unwind_toward_spelling.
1012         (linemap_unwind_toward_expansion):  Pass on "set" to call to
1013         linemap_macro_map_loc_unwind_toward_spelling.
1014         (linemap_expand_location): Extract the data pointer before
1015         extracting the location.
1016         (rich_location::rich_location): Add line_maps param; use it to
1017         extract the range from the source_location.
1018         * location-example.txt: Regenerate, showing new representation.
1020 2015-11-06  David Malcolm  <dmalcolm@redhat.com>
1022         * errors.c (cpp_diagnostic): Update for change in signature
1023         of "error" callback.
1024         (cpp_diagnostic_with_line): Likewise, calling override_column
1025         on the rich_location.
1026         * include/cpplib.h (struct cpp_callbacks): Within "error"
1027         callback, convert param from source_location to rich_location *,
1028         and drop column_override param.
1029         * include/line-map.h (struct source_range): New struct.
1030         (struct location_range): New struct.
1031         (class rich_location): New class.
1032         (linemap_client_expand_location_to_spelling_point): New declaration.
1033         * line-map.c (rich_location::rich_location): New ctors.
1034         (rich_location::lazily_expand_location): New method.
1035         (rich_location::override_column): New method.
1036         (rich_location::add_range): New methods.
1037         (rich_location::set_range): New method.
1039 2015-11-06  David Malcolm  <dmalcolm@redhat.com>
1041         * include/line-map.h (struct linemap_stats): Add fields
1042         "adhoc_table_size" and "adhoc_table_entries_used".
1043         * line-map.c (linemap_get_statistics): Populate above fields.
1045 2015-11-04  Mikhail Maltsev  <maltsevm@gmail.com>
1047         * config.in: Regenerate.
1048         * configure: Regenerate.
1049         * configure.ac: Remove ENABLE_CHECKING.
1051 2015-11-03  Uros Bizjak  <ubizjak@gmail.com>
1053         * lex.c (search_line_sse42): Correctly advance the pointer to an
1054         aligned address.
1056 2015-11-02  David Malcolm  <dmalcolm@redhat.com>
1058         * include/line-map.h (source_location): In the table in the
1059         descriptive comment, show UNKNOWN_LOCATION, BUILTINS_LOCATION,
1060         LINE_MAP_MAX_LOCATION_WITH_COLS, LINE_MAP_MAX_SOURCE_LOCATION.
1061         Add notes about ad-hoc values.
1063 2015-10-21  Mikhail Maltsev  <maltsevm@gmail.com>
1065         * include/line-map.h: Use CHECKING_P instead of ENABLE_CHECKING.
1066         * init.c: Likewise.
1067         * macro.c (struct macro_arg_token_iter, set_arg_token,
1068         macro_arg_token_iter_init, macro_arg_token_iter_forward,
1069         macro_arg_token_iter_get_token, macro_arg_token_iter_get_location,
1070         alloc_expanded_arg_mem, _cpp_backup_tokens): Likewise.
1072         * config.in: Regenerate.
1073         * configure: Regenerate.
1074         * configure.ac (CHECKING_P): Define.
1075         * system.h (fancy_abort): Declare.
1076         (abort): Define.
1077         (gcc_assert): Define. Use CHECKING_P.
1079 2015-10-13  Mikhail Maltsev  <maltsevm@gmail.com>
1081         * system.h (CHECKING_P, gcc_checking_assert): Define.
1083 2015-09-21  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1085         PR c/66415
1086         * line-map.c (linemap_position_for_loc_and_offset): Handle the
1087         case of long lines encoded in multiple maps.
1089 2015-09-07  Marek Polacek  <polacek@redhat.com>
1091         * system.h (INTTYPE_MINIMUM): Rewrite to avoid shift warning.
1093 2015-08-06  Yaakov Selkowitz  <yselkowi@redhat.com>
1095         * configure: Regenerate.
1097 2015-07-08  Thomas Schwinge  <thomas@codesourcery.com>
1099         * include/line-map.h (RESERVED_LOCATION_COUNT): Change type to
1100         source_location.
1102 2015-07-02  Paolo Carlini  <paolo.carlini@oracle.com>
1104         PR preprocessor/53690
1105         * charset.c (_cpp_valid_ucn): Add cppchar_t * parameter and change
1106         return type to bool.  Fix encoding of \u0000 and \U00000000 in C++.
1107         (convert_ucn): Adjust call.
1108         * lex.c (forms_identifier_p): Likewise.
1109         * internal.h (_cpp_valid_ucn): Adjust declaration.
1111 2015-06-30  Edward Smith-Rowland  <3dw4rd@verizon.net>
1113         Implement N4197 - Adding u8 character literals
1114         * include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens;
1115         (struct cpp_options): Add utf8_char_literals.
1116         * init.c (struct lang_flags): Add utf8_char_literals;
1117         (struct lang_flags lang_defaults): Add column for utf8_char_literals.
1118         * macro.c (stringify_arg()): Treat CPP_UTF8CHAR token;
1119         * expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()):
1120         Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens;
1121         (cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token;
1122         (eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token.
1123         * lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens.
1124         * charset.c (converter_for_type(), cpp_interpret_charconst()):
1125         Treat CPP_UTF8CHAR token.
1127 2015-06-30  Uros Bizjak  <ubizjak@gmail.com>
1129         * lex.c (search_line_sse42) [__GCC_ASM_FLAG_OUTPUTS__]: New main
1130         loop using asm flag outputs.
1132 2015-06-08  Marek Polacek  <polacek@redhat.com>
1134         PR c/66415
1135         * line-map.c (linemap_position_for_loc_and_offset): Remove
1136         linemap_assert_fails; reverse conditions.
1138 2015-05-26  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1140         * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER
1141         LINE_MAP_MAX_LOCATION_WITH_COLS,LINE_MAP_MAX_SOURCE_LOCATION):
1142         New constants.
1143         (linemap_line_start): Use them.
1144         (linemap_position_for_column): Use them.
1146 2015-05-20  David Malcolm  <dmalcolm@redhat.com>
1148         * include/line-map.h (MAP_START_LOCATION): Eliminate the non-const
1149         variant, and tweak comment for the const variant.
1150         (ORDINARY_MAP_STARTING_LINE_NUMBER): Drop the non-const variant.
1151         (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
1152         (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
1153         (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
1154         (ORDINARY_MAP_FILE_NAME): Drop the non-const variant.
1155         (MACRO_MAP_MACRO): Likewise.
1156         (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
1157         (MACRO_MAP_LOCATIONS): Likewise.
1158         (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
1159         * line-map.c (linemap_add): Replace writes through macros with
1160         direct field accesses.
1161         (linemap_enter_macro): Likewise.
1162         (linemap_line_start): Likewise.
1164 2015-05-19  David Malcolm  <dmalcolm@redhat.com>
1166         * directives.c (do_line): Strengthen local "map" from
1167         const line_map * to const line_map_ordinary *.
1168         (do_linemarker): Likewise.
1169         (_cpp_do_file_change): Assert that we're not dealing with
1170         a macro map.  Introduce local "ord_map" via a call to
1171         linemap_check_ordinary, guarded within the check for
1172         non-NULL.  Use it for typesafety.
1173         * files.c (cpp_make_system_header): Strengthen local "map" from
1174         const line_map * to const line_map_ordinary *.
1175         * include/cpplib.h (struct cpp_callbacks): Likewise for second
1176         parameter of "file_change" callback.
1177         * include/line-map.h (struct line_map): Convert from a struct
1178         containing a union to a base class.
1179         (struct line_map_ordinary): Convert to a subclass of line_map.
1180         (struct line_map_macro): Likewise.
1181         (linemap_check_ordinary): Strengthen return type from line_map *
1182         to line_map_ordinary *, and add a const-variant.
1183         (linemap_check_macro): New pair of functions.
1184         (ORDINARY_MAP_STARTING_LINE_NUMBER): Strengthen param from
1185         const line_map * to const line_map_ordinary *, eliminating call
1186         to linemap_check_ordinary.  Likewise for the non-const variant.
1187         (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
1188         (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
1189         (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Likewise.
1190         (ORDINARY_MAP_FILE_NAME): Likewise.
1191         (MACRO_MAP_MACRO): Strengthen param from const line_map * to
1192         const line_map_macro *.  Likewise for the non-const variant.
1193         (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
1194         (MACRO_MAP_LOCATIONS): Likewise.
1195         (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
1196         (struct maps_info): Replace with...
1197         (struct maps_info_ordinary):...this and...
1198         (struct maps_info_macro): ...this.
1199         (struct line_maps): Convert fields "info_ordinary" and
1200         "info_macro" to the above new structs.
1201         (LINEMAPS_MAP_INFO): Delete both functions.
1202         (LINEMAPS_MAPS): Likewise.
1203         (LINEMAPS_ALLOCATED): Rewrite both variants to avoid using
1204         LINEMAPS_MAP_INFO.
1205         (LINEMAPS_USED): Likewise.
1206         (LINEMAPS_CACHE): Likewise.
1207         (LINEMAPS_MAP_AT): Likewise.
1208         (LINEMAPS_ORDINARY_MAPS): Strengthen return type from line_map *
1209         to line_map_ordinary *.
1210         (LINEMAPS_ORDINARY_MAP_AT): Likewise.
1211         (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
1212         (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
1213         (LINEMAPS_MACRO_MAPS): Strengthen return type from line_map * to
1214         line_map_macro *.
1215         (LINEMAPS_MACRO_MAP_AT): Likewise.
1216         (LINEMAPS_LAST_MACRO_MAP): Likewise.
1217         (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
1218         (linemap_map_get_macro_name): Strengthen param from
1219         const line_map * to const line_map_macro *.
1220         (SOURCE_LINE): Strengthen first param from const line_map * to
1221         const line_map_ordinary *, removing call to
1222         linemap_check_ordinary.
1223         (SOURCE_COLUMN): Likewise.
1224         (LAST_SOURCE_LINE_LOCATION): Likewise.
1225         (LAST_SOURCE_LINE): Strengthen first param from const line_map *
1226         to const line_map_ordinary *.
1227         (LAST_SOURCE_COLUMN): Likewise.
1228         (INCLUDED_FROM): Strengthen return type from line_map * to
1229         line_map_ordinary *., and second param from const line_map *
1230         to const line_map_ordinary *, removing call to
1231         linemap_check_ordinary.
1232         (MAIN_FILE_P): Strengthen param from const line_map * to
1233         const line_map_ordinary *, removing call to
1234         linemap_check_ordinary.
1235         (linemap_position_for_line_and_column): Strengthen param from
1236         const line_map * to const line_map_ordinary *.
1237         (LINEMAP_FILE): Strengthen param from const line_map * to
1238         const line_map_ordinary *, removing call to
1239         linemap_check_ordinary.
1240         (LINEMAP_LINE): Likewise.
1241         (LINEMAP_SYSP): Likewise.
1242         (linemap_resolve_location): Strengthen final param from
1243         const line_map ** to const line_map_ordinary **.
1244         * internal.h (CPP_INCREMENT_LINE): Likewise for local "map".
1245         (linemap_enter_macro): Strengthen return type from
1246         const line_map * to const line_map_macro *.
1247         (linemap_add_macro_token): Likewise for first param.
1248         * line-map.c (linemap_check_files_exited): Strengthen local "map"
1249         from const line_map * to const line_map_ordinary *.
1250         (new_linemap): Introduce local "map_size" and use it when
1251         calculating how large the buffer should be.  Rewrite based
1252         on change of info_macro and info_ordinary into distinct types.
1253         (linemap_add): Strengthen locals "map" and "from" from line_map *
1254         to line_map_ordinary *.
1255         (linemap_enter_macro): Strengthen return type from
1256         const line_map * to const line_map_macro *, and local "map" from
1257         line_map * to line_map_macro *.
1258         (linemap_add_macro_token): Strengthen param "map" from
1259         const line_map * to const line_map_macro *.
1260         (linemap_line_start): Strengthen local "map" from line_map * to
1261         line_map_ordinary *.
1262         (linemap_position_for_column): Likewise.
1263         (linemap_position_for_line_and_column): Strengthen first param
1264         from const line_map * to const line_map_ordinary *.
1265         (linemap_position_for_loc_and_offset): Strengthen local "map" from
1266         const line_map * to const line_map_ordinary *.
1267         (linemap_ordinary_map_lookup): Likewise for return type and locals
1268         "cached" and "result".
1269         (linemap_macro_map_lookup): Strengthen return type and locals
1270         "cached" and "result" from const line_map * to
1271         const line_map_macro *.
1272         (linemap_macro_map_loc_to_exp_point): Likewise for param "map".
1273         (linemap_macro_map_loc_to_def_point): Likewise.
1274         (linemap_macro_map_loc_unwind_toward_spelling): Likewise.
1275         (linemap_get_expansion_line): Strengthen local "map" from
1276         const line_map * to const line_map_ordinary *.
1277         (linemap_get_expansion_filename): Likewise.
1278         (linemap_map_get_macro_name): Strengthen param from
1279         const line_map * to const line_map_macro *.
1280         (linemap_location_in_system_header_p): Add call to
1281         linemap_check_ordinary in region guarded by
1282         !linemap_macro_expansion_map_p.  Introduce local "macro_map" via
1283         linemap_check_macro in other region, using it in place of "map"
1284         for typesafety.
1285         (first_map_in_common_1): Add calls to linemap_check_macro.
1286         (trace_include): Strengthen param "map" from const line_map * to
1287         const line_map_ordinary *.
1288         (linemap_macro_loc_to_spelling_point): Strengthen final param from
1289         const line_map ** to const line_map_ordinary **.  Replace a
1290         C-style cast with a const_cast, and add calls to
1291         linemap_check_macro and linemap_check_ordinary.
1292         (linemap_macro_loc_to_def_point): Likewise.
1293         (linemap_macro_loc_to_exp_point): Likewise.
1294         (linemap_resolve_location): Strengthen final param from
1295         const line_map ** to const line_map_ordinary **.
1296         (linemap_unwind_toward_expansion): Introduce local "macro_map" via
1297         a checked cast and use it in place of *map.
1298         (linemap_unwind_to_first_non_reserved_loc): Strengthen local
1299         "map1" from const line_map * to const line_map_ordinary *.
1300         (linemap_expand_location): Introduce local "ord_map" via a checked
1301         cast and use it in place of map.
1302         (linemap_dump): Make local "map" const.  Strengthen local
1303         "includer_map" from line_map * to const line_map_ordinary *.
1304         Introduce locals "ord_map" and "macro_map" via checked casts and
1305         use them in place of "map" for typesafety.
1306         (linemap_dump_location): Strengthen local "map" from
1307         const line_map * to const line_map_ordinary *.
1308         (linemap_get_file_highest_location): Update for elimination of
1309         union.
1310         (linemap_get_statistics): Strengthen local "cur_map" from
1311         line_map * to const line_map_macro *.  Update uses of sizeof to
1312         use the appropriate line_map subclasses.
1313         * macro.c (_cpp_warn_if_unused_macro): Add call to
1314         linemap_check_ordinary.
1315         (builtin_macro): Strengthen local "map" from const line_map * to
1316         const line_map_macro *.
1317         (enter_macro_context): Likewise.
1318         (replace_args): Likewise.
1319         (tokens_buff_put_token_to): Likewise for param "map".
1320         (tokens_buff_add_token): Likewise.
1322 2015-05-13  David Malcolm  <dmalcolm@redhat.com>
1324         * include/line-map.h (source_location): Add a reference to
1325         location-example.txt to the descriptive comment.
1326         * location-example.txt: New file.
1328 2015-05-13  David Malcolm  <dmalcolm@redhat.com>
1330         * include/line-map.h (MAX_SOURCE_LOCATION): Convert from a macro
1331         to a const source_location.
1332         (RESERVED_LOCATION_COUNT): Likewise.
1333         (linemap_check_ordinary): Convert from a macro to a pair of inline
1334         functions, for const/non-const arguments.
1335         (MAP_START_LOCATION): Likewise.
1336         (ORDINARY_MAP_STARTING_LINE_NUMBER): Likewise.
1337         (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
1338         (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
1339         (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Convert from a macro to a
1340         pair of inline functions, for const/non-const arguments, where the
1341         latter is named...
1342         (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): New function.
1343         (ORDINARY_MAP_FILE_NAME): Convert from a macro to a pair of inline
1344         functions, for const/non-const arguments.
1345         (MACRO_MAP_MACRO): Likewise.
1346         (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
1347         (MACRO_MAP_LOCATIONS): Likewise.
1348         (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
1349         (LINEMAPS_MAP_INFO): Likewise.
1350         (LINEMAPS_MAPS): Likewise.
1351         (LINEMAPS_ALLOCATED): Likewise.
1352         (LINEMAPS_USED): Likewise.
1353         (LINEMAPS_CACHE): Likewise.
1354         (LINEMAPS_ORDINARY_CACHE): Likewise.
1355         (LINEMAPS_MACRO_CACHE): Likewise.
1356         (LINEMAPS_MAP_AT): Convert from a macro to an inline function.
1357         (LINEMAPS_LAST_MAP): Likewise.
1358         (LINEMAPS_LAST_ALLOCATED_MAP): Likewise.
1359         (LINEMAPS_ORDINARY_MAPS): Likewise.
1360         (LINEMAPS_ORDINARY_MAP_AT): Likewise.
1361         (LINEMAPS_ORDINARY_ALLOCATED): Likewise.
1362         (LINEMAPS_ORDINARY_USED): Likewise.
1363         (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
1364         (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
1365         (LINEMAPS_MACRO_MAPS): Likewise.
1366         (LINEMAPS_MACRO_MAP_AT): Likewise.
1367         (LINEMAPS_MACRO_ALLOCATED): Likewise.
1368         (LINEMAPS_MACRO_USED): Likewise.
1369         (LINEMAPS_MACRO_LOWEST_LOCATION): Likewise.
1370         (LINEMAPS_LAST_MACRO_MAP): Likewise.
1371         (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
1372         (IS_ADHOC_LOC): Likewise.
1373         (COMBINE_LOCATION_DATA): Likewise.
1374         (SOURCE_LINE): Likewise.
1375         (SOURCE_COLUMN): Likewise.
1376         (LAST_SOURCE_LINE_LOCATION): Likewise.
1377         (LAST_SOURCE_LINE): Likewise.
1378         (LAST_SOURCE_COLUMN): Likewise.
1379         (LAST_SOURCE_LINE_LOCATION)
1380         (INCLUDED_FROM): Likewise.
1381         (MAIN_FILE_P): Likewise.
1382         (LINEMAP_FILE): Likewise.
1383         (LINEMAP_LINE): Likewise.
1384         (LINEMAP_SYSP): Likewise.
1385         (linemap_location_before_p): Likewise.
1386         * line-map.c (linemap_check_files_exited): Make local "map" const.
1387         (linemap_add): Use SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS.
1388         (linemap_line_start): Likewise.
1390 2015-05-13  Michael Haubenwallner  <michael.haubenwallner@ssi-schaefer.com>
1392         * aclocal.m4: Regenerated with automake-1.11.6.
1394 2015-05-13  David Malcolm  <dmalcolm@redhat.com>
1396         * include/line-map.h (linemap_assert): Move up within the file to
1397         before all of the map accessor macros.
1398         (linemap_assert_fails): Likewise.
1399         (linemap_check_ordinary): Likewise.
1400         (linemap_macro_expansion_map_p): Likewise.
1402 2015-05-12  David Malcolm  <dmalcolm@redhat.com>
1404         * directives.c (do_line): Set seen_line_directive on line_table.
1405         (do_linemarker): Likewise.
1406         * include/line-map.h (struct line_maps): Add new field
1407         "seen_line_directive".
1409 2015-05-08  Jason Merrill  <jason@redhat.com>
1411         * include/cpplib.h: Add CPP_W_CXX11_COMPAT.
1412         (struct cpp_options): Add cpp_warn_cxx11_compat.
1413         * init.c (cpp_create_reader): Initialize it.
1414         * lex.c (lex_string): Add -Wc++11-compat warning.
1416 2015-05-05  David Malcolm  <dmalcolm@redhat.com>
1418         * pch.c (cpp_valid_state): Fix indentation so that it reflects the
1419         block structure.
1421 2015-05-05  David Malcolm  <dmalcolm@redhat.com>
1423         * include/line-map.h: Fix comment at the top of the file.
1424         (source_location): Rewrite and expand the comment for this
1425         typedef, adding an ascii-art table to clarify how source_location
1426         values are allocated.
1427         * line-map.c: Fix comment at the top of the file.
1429 2015-04-09  Richard Biener  <rguenther@suse.de>
1431         PR pch/65550
1432         * files.c (pch_open_file): Allow main and pre-included files
1433         when trying to open a PCH.
1435 2015-04-06  Jakub Jelinek  <jakub@redhat.com>
1437         PR preprocessor/61977
1438         * lex.c (cpp_peek_token): If peektok is CPP_EOF, back it up
1439         with all tokens peeked by the current function.
1441 2015-04-02  Jakub Jelinek  <jakub@redhat.com>
1443         PR preprocessor/61977
1444         * lex.c (cpp_peek_token): Temporarily clear pfile->cb.line_change.
1446 2015-03-23  Jakub Jelinek  <jakub@redhat.com>
1448         PR preprocessor/65238
1449         * internal.h (_cpp_scan_out_logical_line): Add third argument.
1450         * directives.c (prepare_directive_trad): Pass false to it.
1451         * traditional.c (_cpp_read_logical_line_trad,
1452         _cpp_create_trad_definition): Likewise.
1453         (struct fun_macro): Add paramc field.
1454         (fun_like_macro): New function.
1455         (maybe_start_funlike): Handle NODE_BUILTIN macros.  Initialize
1456         macro->paramc field.
1457         (save_argument): Use macro->paramc instead of
1458         macro->node->value.macro->paramc.
1459         (push_replacement_text): Formatting fix.
1460         (recursive_macro): Use fun_like_macro helper.
1461         (_cpp_scan_out_logical_line): Likewise.  Add BUILTIN_MACRO_ARG
1462         argument.  Initialize fmacro.paramc field.  Handle builtin
1463         function-like macros.
1465 2015-03-16  Edward Smith-Rowland  <3dw4rd@verizon.net>
1467         PR c++/64626
1468         * lex.c (lex_number): If a number ends with digit-seps (') skip back
1469         and let lex_string take them.
1471 2015-03-02  Markus Trippelsdorf  <markus@trippelsdorf.de>
1473         PR target/65261
1474         * lex.c (search_line_fast): Silence ubsan errors.
1476 2015-02-03    <dodji@redhat.com>
1478         PR preprocessor/64803
1479         * internal.h (cpp_reader::top_most_macro_node): New data member.
1480         * macro.c (enter_macro_context): Pass the location of the end of
1481         the top-most invocation of the function-like macro, or the
1482         location of the expansion point of the top-most object-like macro.
1483         (cpp_get_token_1): Store the top-most macro node in the new
1484         pfile->top_most_macro_node data member.
1485         (_cpp_pop_context): Clear the new cpp_reader::top_most_macro_node
1486         data member.
1488 2015-01-30  Szabolcs Nagy  <szabolcs.nagy@arm.com>
1490         * lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON.
1492 2015-01-23  Marek Polacek  <polacek@redhat.com>
1494         DR#412
1495         PR preprocessor/60570
1496         * directives.c (do_elif): Don't evaluate #elif conditionals
1497         when they don't need to be.
1499 2015-01-16  Jakub Jelinek  <jakub@redhat.com>
1501         * expr.c (cpp_classify_number): Add N_() around ?: string
1502         literals used in cpp_error_with_line call as format string.
1504 2015-01-05  Jakub Jelinek  <jakub@redhat.com>
1506         Update copyright years.
1508 2014-12-19  Jakub Jelinek  <jakub@redhat.com>
1510         PR preprocessor/63831
1511         * directives.c (lex_macro_node): Remove __has_attribute__ handling.
1512         * internal.h (struct spec_node): Remove n__has_attribute__ field.
1513         (struct lexer_state): Remove in__has_attribute__ field.
1514         * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_ATTRIBUTE.
1515         * identifiers.c (_cpp_init_hashtable): Remove __has_attribute__
1516         handling.
1517         * init.c (builtin_array): Add __has_attribute and __has_cpp_attribute.
1518         (cpp_init_special_builtins): Don't initialize __has_attribute
1519         or __has_cpp_attribute if CLK_ASM or pfile->cb.has_attribute is NULL.
1520         * traditional.c (enum ls): Remove ls_has_attribute,
1521         ls_has_attribute_close.
1522         (_cpp_scan_out_logical_line): Remove __has_attribute__ handling.
1523         * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_ATTRIBUTE.
1524         * pch.c (cpp_read_state): Remove __has_attribute__ handling.
1525         * expr.c (eval_token): Likewise.
1526         (parse_has_attribute): Removed.
1528 2014-12-11  Uros Bizjak  <ubizjak@gmail.com>
1530         * directives.c (cpp_define_formatted): Use xvasprintf.
1532 2014-12-05  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1534         * line-map.c (linemap_position_for_loc_and_offset): Add new
1535         linemap_assert_fails.
1537 2014-12-02  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1539         * include/line-map.h (linemap_assert_fails): Declare.
1540         * line-map.c (linemap_position_for_loc_and_offset): Use it.
1542 2014-12-02  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1544         * line-map.c (linemap_add): Fix typo.
1545         (linemap_line_start): Fix whitespace.
1547 2014-11-29  John Schmerge  <jbschmerge@gmail.com>
1549         PR preprocessor/41698
1550         * charset.c (one_utf8_to_utf16): Do not produce surrogate pairs
1551         for 0xffff.
1553 2014-11-25  Jakub Jelinek  <jakub@redhat.com>
1555         PR preprocessor/60436
1556         * line-map.c (linemap_line_start): If highest is above 0x60000000
1557         and we are still tracking columns or highest is above 0x70000000,
1558         force add_map.
1560 2014-11-20  Uros Bizjak  <ubizjak@gmail.com>
1562         PR target/63966
1563         * lex.c [__i386__ || __x86_64__]: Compile special SSE functions
1564         only for (__GNUC__ >= 5 || !defined(__PIC__)).
1566 2014-11-13  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1568         * include/line-map.h: Include EXPR, so that unused variable warnings
1569         do not occur.
1571 2014-11-11  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1573         PR fortran/44054
1574         * include/line-map.h (linemap_position_for_loc_and_offset):
1575         Declare.
1576         * line-map.c (linemap_position_for_loc_and_offset): New.
1578 2014-11-11  David Malcolm  <dmalcolm@redhat.com>
1580         * ChangeLog.jit: New.
1582 2014-11-10  Edward Smith-Rowland  <3dw4rd@verizon.net>
1584         * include/cpplib.h (cpp_callbacks): Add has_attribute.
1585         * internal.h (lexer_state): Add in__has_attribute__.
1586         * directives.c (lex_macro_node): Prevent use of __has_attribute__
1587         as a macro.
1588         * expr.c (parse_has_attribute): New function; (eval_token): Look for
1589         __has_attribute__ and route to parse_has_attribute.
1590         * identifiers.c (_cpp_init_hashtable): Initialize n__has_attribute__.
1591         * pch.c (cpp_read_state): Initialize n__has_attribute__.
1592         * traditional.c (enum ls): Add ls_has_attribute, ls_has_attribute_close;
1593         (_cpp_scan_out_logical_line): Attend to __has_attribute__.
1595 2014-11-06  Joseph Myers  <joseph@codesourcery.com>
1597         * include/cpp-id-data.h (struct cpp_macro): Update comment
1598         regarding parameters.
1599         * include/cpplib.h (struct cpp_macro_arg, struct cpp_identifier):
1600         Add spelling fields.
1601         (struct cpp_token): Update comment on macro_arg.
1602         * internal.h (_cpp_save_parameter): Add extra argument.
1603         (_cpp_spell_ident_ucns): New declaration.
1604         * lex.c (lex_identifier): Add SPELLING argument.  Set *SPELLING to
1605         original spelling of identifier.
1606         (_cpp_lex_direct): Update calls to lex_identifier.
1607         (_cpp_spell_ident_ucns): New function, factored out of
1608         cpp_spell_token.
1609         (cpp_spell_token): Adjust FORSTRING argument semantics to return
1610         original spelling of identifiers.  Use _cpp_spell_ident_ucns in
1611         !FORSTRING case.
1612         (_cpp_equiv_tokens): Check spellings of identifiers and macro
1613         arguments are identical.
1614         * macro.c (macro_arg_saved_data): New structure.
1615         (paste_tokens): Use original spellings of identifiers from
1616         cpp_spell_token.
1617         (_cpp_save_parameter): Add argument SPELLING.  Save both canonical
1618         node and its value.
1619         (parse_params): Update calls to _cpp_save_parameter.
1620         (lex_expansion_token): Save spelling of macro argument tokens.
1621         (_cpp_create_definition): Extract canonical node from saved data.
1622         (cpp_macro_definition): Use UCNs in spelling of macro name.  Use
1623         original spellings of macro argument tokens and identifiers.
1624         * traditional.c (scan_parameters): Update call to
1625         _cpp_save_parameter.
1627 2014-11-05  Joseph Myers  <joseph@codesourcery.com>
1629         PR preprocessor/9449
1630         * init.c (lang_defaults): Enable extended identifiers for C++ and
1631         C99-based standards.
1633 2014-10-22  Alan Modra  <amodra@gmail.com>
1635         * symtab.c (ht_create): Use obstack_specify_allocation in place of
1636         _obstack_begin.
1637         * files.c (_cpp_init_files): Likewise.
1638         * init.c (cpp_create_reader): Likewise.
1639         * identifiers.c (_cpp_init_hashtable): Likewise.
1641 2014-10-14  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1643         * include/line-map.h (linemap_location_from_macro_expansion_p):
1644         const struct line_maps * argument.
1645         (linemap_position_for_line_and_column): const struct line_map *
1646         argument.
1647         * line-map.c (linemap_add_macro_token): Use correct argument name
1648         in comment.
1649         (linemap_position_for_line_and_column): const struct line_map *
1650         argument.
1651         (linemap_macro_map_loc_to_def_point): Fix comment. Make static.
1652         (linemap_location_from_macro_expansion_p): const struct line_maps *
1653         argument.
1654         (linemap_resolve_location): Fix argument names in comment.
1656 2014-10-03  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
1658         * lex.c (search_line_fast): Add new version to be used for Power8
1659         and later targets when Altivec is enabled.  Restrict the existing
1660         Altivec version to big-endian systems so that lvsr is not used on
1661         little endian, where it is deprecated.  Remove LE-specific code
1662         from the now-BE-only version.
1664 2014-10-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>
1665             Jeff Law  <law@redhat.com>
1667         * charset.c (convert_no_conversion): Reallocate memory with 25%
1668         headroom.
1670 2014-10-01  Edward Smith-Rowland  <3dw4rd@verizon.net>
1672         Implement SD-6: SG10 Feature Test Recommendations
1673         * internal.h (lexer_state, spec_nodes): Add in__has_include__.
1674         * directives.c: Support __has_include__ builtin.
1675         * expr.c (parse_has_include): New function to parse __has_include__
1676         builtin; (eval_token()): Use it.
1677         * files.c (_cpp_has_header()): New funtion to look for header;
1678         (open_file_failed()): Not an error to not find a header file for
1679         __has_include__.
1680         * identifiers.c (_cpp_init_hashtable()): Add entry for __has_include__.
1681         * pch.c (cpp_read_state): Lookup __has_include__.
1682         * traditional.c (enum ls, _cpp_scan_out_logical_line()): Walk through
1683         __has_include__ statements.
1685 2014-09-30  Bernd Edlinger  <bernd.edlinger@hotmail.de>
1687         PR preprocessor/58893
1688         * errors.c (cpp_diagnostic): Fix possible out of bounds access.
1689         * files.c (_cpp_stack_include): Initialize src_loc for IT_CMDLINE.
1691 2014-09-24  Marek Polacek  <polacek@redhat.com>
1693         PR c/61405
1694         PR c/53874
1695         * include/cpplib.h (enum cpp_ttype): Define CPP_KEYWORD.
1697 2014-09-17  Jan Hubicka  <hubicka@ucw.cz>
1699         * charset.c (conversion): Rename to ...
1700         (cpp_conversion): ... this one; update.
1701         * files.c (file_hash_entry): Rename to ...
1702         (cpp_file_hash_entry): ... this one ; update.
1704 2014-09-17  Marek Polacek  <polacek@redhat.com>
1706         PR c/61854
1707         * init.c (struct lang_flags): Remove cplusplus_comments.
1708         (cpp_set_lang): Likewise.
1709         (post_options): Likewise.
1710         * lex.c (_cpp_lex_direct): Disallow C++ style comments in C90/C94.
1712 2014-09-09  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1714         * include/cpplib.h (struct cpp_options): Declare warn_normalize as
1715         int instead of enum.
1717 2014-09-04  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1719         * macro.c (replace_args): Use cpp_pedwarning, cpp_warning and
1720         CPP_W flags.
1721         * include/cpplib.h: Add CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC.
1722         * init.c (cpp_create_reader): Do not init to -1 here.
1723         * expr.c (num_binary_op): Use cpp_pedwarning.
1725 2014-08-29  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1727         * directives.c (check_eol_1): New.
1728         (check_eol_endif_labels): New.
1729         (check_eol): Call check_eol_1.
1730         (do_else,do_endif): Call check_eol_endif_labels.
1732 2014-08-29  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1734         * macro.c (warn_of_redefinition): Suppress warnings for builtins
1735         that lack the NODE_WARN flag, unless Wbuiltin-macro-redefined.
1736         (_cpp_create_definition): Use Wbuiltin-macro-redefined for
1737         builtins that lack the NODE_WARN flag.
1738         * directives.c (do_undef): Likewise.
1739         * init.c (cpp_init_special_builtins): Do not change flags
1740         depending on Wbuiltin-macro-redefined.
1742 2014-08-28  Edward Smith-Rowland  <3dw4rd@verizon.net>
1744         PR cpp/23827 - standard C++ should not have hex float preprocessor
1745         tokens
1746         * libcpp/init.c (lang_flags): Change CXX98 flag for extended numbers
1747         from 1 to 0.
1748         * libcpp/expr.c (cpp_classify_number): Weite error message for improper
1749         use of hex floating literal.
1751 2014-08-23  Edward Smith-Rowland  <3dw4rd@verizon.net>
1753         * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z;
1754         Rename CLK_GNUCXX1Y, CLK_CXX1Y to CLK_GNUCXX14, CLK_CXX14;
1755         * init.c (struct lang_flags lang_defaults): Add column for trigraphs;
1756         Add rows for CLK_GNUCXX1Z, CLK_CXX1Z; (cpp_set_lang): Set trigraphs;
1757         (cpp_init_builtins): Set __cplusplus to 201402L for C++14;
1758         Set __cplusplus to 201500L for C++17.
1759         * expr.c (cpp_classify_number): Change C++1y to C++14 in binary
1760         constants error message.
1762 2014-08-20  Marek Polacek  <polacek@redhat.com>
1764         * include/cpplib.h (cpp_options): Use signed char.
1765         * lex.c (_cpp_lex_direct): Don't warn in C++ mode.
1767 2014-08-19  Marek Polacek  <polacek@redhat.com>
1769         * lex.c (_cpp_lex_direct): Fix a typo.
1771 2014-08-19  Marek Polacek  <polacek@redhat.com>
1773         * charset.c (_cpp_valid_ucn): Warn only if -Wc90-c99-compat.
1774         * lex.c (_cpp_lex_direct): Likewise.
1775         * macro.c (replace_args): Likewise.
1776         (parse_params): Likewise.
1777         * include/cpplib.h (cpp_options): Change cpp_warn_c90_c99_compat
1778         to char.
1780 2014-08-10 Marek Polacek  <polacek@redhat.com>
1782         PR c/51849
1783         * lex.c (_cpp_lex_direct): Warn when -Wc90-c99-compat is in effect.
1784         * charset.c (_cpp_valid_ucn): Likewise.
1785         * include/cpplib.h (cpp_options): Add cpp_warn_c90_c99_compat.
1786         * macro.c (replace_args): Warn when -Wc90-c99-compat is in effect.
1787         (parse_params): Likewise.
1789 2014-07-27  Marek Polacek  <polacek@redhat.com>
1791         PR c/61861
1792         * macro.c (builtin_macro): Add location parameter.  Set
1793         location of builtin macro to the expansion point.
1794         (enter_macro_context): Pass location to builtin_macro.
1796 2014-07-16  Dodji Seketeli  <dodji@redhat.com>
1798         Support location tracking for built-in macro tokens
1799         * include/line-map.h (line_maps::builtin_location): New data
1800         member.
1801         (line_map_init): Add a new parameter to initialize the new
1802         line_maps::builtin_location data member.
1803         * line-map.c (linemap_init): Initialize the
1804         line_maps::builtin_location data member.
1805         * macro.c (builtin_macro): Create a macro map and track the token
1806         resulting from the expansion of a built-in macro.
1808 2014-07-10  Edward Smith-Rowland  <3dw4rd@verizon.net>
1809             Jonathan Wakely  <jwakely@redhat.com>
1811         PR preprocessor/61389
1812         * macro.c (_cpp_arguments_ok, parse_params, create_iso_definition):
1813         Warning messages mention C++11 in c++ mode and C99 in c mode.
1814         * lex.c (lex_identifier_intern, lex_identifier): Ditto
1816 2014-07-09  Edward Smith-Rowland  <3dw4rd@verizon.net>
1818         PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped
1819         by preprocessor
1820         * lex.c (lex_raw_string ()): Do not warn about invalid suffix
1821         if skipping. (lex_string ()): Ditto.
1823 2014-06-04  Edward Smith-Rowland  <3dw4rd@verizon.net>
1825         PR c++/61038
1826         * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
1827         Combine user-defined escape logic with the other string and char logic.
1829 2014-05-26  Richard Biener  <rguenther@suse.de>
1831         * configure.ac: Remove long long and __int64 type checks,
1832         add check for uint64_t and fail if that wasn't found.
1833         * include/cpplib.h (cpp_num_part): Use uint64_t.
1834         * config.in: Regenerate.
1835         * configure: Likewise.
1837 2014-05-21  Marek Polacek  <polacek@redhat.com>
1839         PR c/61212
1840         * files.c (find_file_in_dir): Add parens around &&.
1842 2014-05-20  Edward Smith-Rowland  <3dw4rd@verizon.net>
1844         PR c++/61038
1845         * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
1846         Check for user-defined literal strings and user-defined literal chars
1847         to escape necessary characters.
1849 2014-05-20  Richard Biener  <rguenther@suse.de>
1851         * configure.ac: Copy gcc logic of detecting a 64bit type.
1852         Remove HOST_WIDE_INT define.
1853         * include/cpplib.h: typedef cpp_num_part to a 64bit type,
1854         similar to how hwint.h does it.
1855         * config.in: Regenerate.
1856         * configure: Likewise.
1858 2014-05-09  Joey Ye  <joey.ye@arm.com>
1860         * files.c (find_file_in_dir): Always try to shorten for DOS
1861         non-system headers.
1862         * init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS.
1864 2014-05-07  Richard Biener  <rguenther@suse.de>
1866         * configure.ac: Always set need_64bit_hwint to yes.
1867         * configure: Regenerated.
1869 2014-04-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1871         * lex.c: Remove Solaris 9 reference.
1873 2014-02-24  Walter Lee  <walt@tilera.com>
1875         * configure.ac: Change "tilepro" triplet to "tilepro*".
1876         * configure: Regenerate.
1878 2014-02-19  Jakub Jelinek  <jakub@redhat.com>
1880         PR preprocessor/58844
1881         * macro.c (enter_macro_context): Only push
1882         macro_real_token_count (macro) tokens rather than
1883         macro->count tokens, regardless of
1884         CPP_OPTION (pfile, track-macro-expansion).
1886 2014-02-07  Jakub Jelinek  <jakub@redhat.com>
1888         PR preprocessor/56824
1889         * line-map.c (get_combined_adhoc_loc, linemap_get_expansion_line,
1890         linemap_get_expansion_filename, linemap_location_in_system_header_p,
1891         linemap_location_from_macro_expansion_p,
1892         linemap_macro_loc_to_spelling_point, linemap_macro_loc_to_def_point,
1893         linemap_macro_loc_to_exp_point, linemap_expand_location): Fix
1894         formatting.
1895         (linemap_compare_locations): Look through adhoc locations for both
1896         l0 and l1.
1898 2014-01-23  Dodji Seketeli  <dodji@redhat.com>
1900         PR PR preprocessor/58580
1901         * include/line-map.h (linemap_get_file_highest_location): Declare
1902         new function.
1903         * line-map.c (linemap_get_file_highest_location): Define it.
1905 2014-01-02  Richard Sandiford  <rdsandiford@googlemail.com>
1907         Update copyright years
1909 2013-12-09  Joseph Myers  <joseph@codesourcery.com>
1911         PR preprocessor/55715
1912         * expr.c (num_binary_op): Implement subtraction directly rather
1913         than with negation and falling through into addition case.
1915 2013-11-18  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
1917         * lex.c (search_line_fast): Correct for little endian.
1919 2013-11-15  Joseph Myers  <joseph@codesourcery.com>
1921         * ucnid.tab: Add C11 and C11NOSTART data.
1922         * makeucnid.c (digit): Rename enum value to N99.
1923         (C11, N11, all_languages): New enum values.
1924         (NUM_CODE_POINTS, MAX_CODE_POINT): New macros.
1925         (flags, decomp, combining_value): Use NUM_CODE_POINTS as array
1926         size.
1927         (decomp): Use unsigned int as element type.
1928         (all_decomp): New array.
1929         (read_ucnid): Handle C11 and C11NOSTART.  Use MAX_CODE_POINT.
1930         (read_table): Use MAX_CODE_POINT.  Store all decompositions in
1931         all_decomp.
1932         (read_derived): Use MAX_CODE_POINT.
1933         (write_table): Use NUM_CODE_POINTS.  Print N99, C11 and N11
1934         flags.  Print whole array variable declaration rather than just
1935         array contents.
1936         (char_id_valid, write_context_switch): New functions.
1937         (main): Call write_context_switch.
1938         * ucnid.h: Regenerate.
1939         * include/cpplib.h (struct cpp_options): Add c11_identifiers.
1940         * init.c (struct lang_flags): Add c11_identifiers.
1941         (cpp_set_lang): Set c11_identifiers option from selected language.
1942         * internal.h (struct normalize_state): Document "previous" as
1943         previous starter character.
1944         (NORMALIZE_STATE_UPDATE_IDNUM): Take character as argument.
1945         * charset.c (DIG): Rename enum value to N99.
1946         (C11, N11): New enum values.
1947         (struct ucnrange): Give name to struct.  Use short for flags and
1948         unsigned int for end of range.  Include ucnid.h for whole variable
1949         declaration.
1950         (ucn_valid_in_identifier): Allow for characters up to 0x10FFFF.
1951         Allow for C11 in determining valid characters and valid start
1952         characters.  Use check_nfc for non-Hangul context-dependent
1953         checks.  Only store starter characters in nst->previous.
1954         (_cpp_valid_ucn): Pass new argument to
1955         NORMALIZE_STATE_UPDATE_IDNUM.
1956         * lex.c (lex_identifier): Pass new argument to
1957         NORMALIZE_STATE_UPDATE_IDNUM.  Call NORMALIZE_STATE_UPDATE_IDNUM
1958         after initial non-UCN part of identifier.
1959         (lex_number): Pass new argument to NORMALIZE_STATE_UPDATE_IDNUM.
1961 2013-11-15  Joseph Myers  <joseph@codesourcery.com>
1963         * ucnid.tab: Mark C99 digits as [C99DIG].
1964         * makeucnid.c (read_ucnid): Handle [C99DIG].
1965         (read_table): Don't check for digit characters.
1966         * ucnid.h: Regenerate.
1968 2013-11-06  Tobias Burnus  <burnus@net-b.de>
1970         * macro.c (_cpp_builtin_macro_text): Correct
1971         wording of two warnings.
1973 2013-11-05  Tobias Burnus  <burnus@net-b.de>
1975         * include/cpplib.h (CPP_W_DATE_TIME): Added.
1976         (cpp_options): Add warn_date_time.
1977         * init.c (cpp_create_reader): Init it.
1978         * macro.c (_cpp_builtin_macro_text): Warn when
1979         __DATE__/__TIME__/__TIMESTAMP__ is used.
1981 2013-10-31  Edward Smith-Rowland  <3dw4rd@verizon.net>
1983         Implement C++14 digit separators.
1984         * include/cpplib.h (cpp_options): Add digit_separators flag.
1985         * internal.h (DIGIT_SEP(c)): New macro.
1986         * expr.c (cpp_classify_number): Check improper placement of digit sep;
1987         (cpp_interpret_integer): Skip over digit separators.
1988         * init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add
1989         digit separator flags per language; (cpp_set_lang): Set
1990         digit_separators
1991         * lex.c (lex_number): Add digits separator to allowable characters for
1992         C++14.
1994 2013-10-15  David Malcolm  <dmalcolm@redhat.com>
1996         * Makefile.in (PICFLAG): New.
1997         (ALL_CFLAGS): Add PICFLAG.
1998         (ALL_CXXFLAGS): Likewise.
1999         * configure.ac: Add --enable-host-shared, setting up new
2000         PICFLAG variable.
2001         * configure: Regenerate.
2003 2013-08-07  Richard Earnshaw  <rearnsha@arm.com>
2005         * configure.ac: Set need_64bit_hwint for all arm targets.
2006         * configure: Regenerated.
2008 2013-07-20  Jakub Jelinek  <jakub@redhat.com>
2010         PR preprocessor/57620
2011         * lex.c (lex_raw_string): Undo phase1 and phase2 transformations
2012         between R" and final " rather than only in between R"del( and )del".
2014 2013-07-10  Jakub Jelinek  <jakub@redhat.com>
2016         PR preprocessor/57824
2017         * lex.c (lex_raw_string): Allow reading new-lines if
2018         in_deferred_pragma or if parsing_args and there is still
2019         data in the current buffer.
2021         * include/cpplib.h (cpp_token_val_index): Change parameter type to
2022         const cpp_token *.
2023         * lex.c (cpp_token_val_index): Likewise.
2025         PR preprocessor/57757
2026         * lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING
2027         or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that
2028         starts if a-zA-Z_.
2030 2013-06-28  Ed Smith-Rowland  <3dw4rd@verizon.net>
2032         * lex.c (lex_raw_string(), lex_string()): Constrain suffixes treated
2033         as concatenated literal and macro to just the patterns found in
2034         inttypes.h; (is_macro()): New.
2036 2013-06-24  Dehao Chen  <dehao@google.com>
2038         * files.c (_cpp_stack_include): Fix the highest_location when header
2039         file is guarded by #ifndef and is included twice.
2041 2013-04-28  Jakub Jelinek  <jakub@redhat.com>
2043         N3472 binary constants
2044         * include/cpplib.h (struct cpp_options): Fix a typo in user_literals
2045         field comment.  Add binary_constants field.
2046         * init.c (struct lang_flags): Add binary_constants field.
2047         (lang_defaults): Add bin_cst column to the table.
2048         (cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants).
2049         * expr.c (cpp_classify_number): Talk about C++11 instead of C++0x
2050         in diagnostics.  Accept binary constants if
2051         CPP_OPTION (pfile, binary_constants) even when pedantic.  Adjust
2052         pedwarn message.
2054 2013-04-24  Paolo Carlini  <paolo.carlini@oracle.com>
2056         * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y.
2057         * init.c (lang_defaults): Add defaults for the latter.
2058         (cpp_init_builtins): Define __cplusplus as 201300L for the latter.
2059         * lex.c (_cpp_lex_direct): Update.
2061 2013-04-03  Sebastian Huber  <sebastian.huber@embedded-brains.de>
2063         PR target/56771
2064         * configure.ac: Require 64-bit int for arm*-*-rtems*.
2065         * configure: Regenerate.
2067 2013-03-06  Jakub Jelinek  <jakub@redhat.com>
2069         PR middle-end/56461
2070         * internal.h (struct cpp_buffer): Add to_free field.
2071         (_cpp_pop_file_buffer): Add third argument.
2072         * files.c (_cpp_stack_file): Set buffer->to_free.
2073         (_cpp_pop_file_buffer): Add to_free argument.  Free to_free
2074         if non-NULL, and if equal to file->buffer_start, also clear
2075         file->buffer{,_start,_valid}.
2076         * directives.c (_cpp_pop_buffer): Pass buffer->to_free
2077         to _cpp_pop_file_buffer.
2079 2013-03-01  Jakub Jelinek  <jakub@redhat.com>
2081         PR middle-end/56461
2082         * files.c (_cpp_save_file_entries): Free result at the end.
2083         * pch.c (cpp_string_free): New function.
2084         (cpp_save_state): Use it in htab_create call.
2085         (cpp_write_pch_deps): Free ss->defs.  Destroy ss->definedhash.
2087 2013-02-28  Jakub Jelinek  <jakub@redhat.com>
2089         * files.c (_cpp_find_file): If returning early, before storing
2090         something to *hash_slot and *hash_slot is NULL, call htab_clear_slot
2091         on it.  Access *hash_slot using void * type rather than
2092         struct file_hash_entry * to avoid aliasing issues.
2094         * configure.ac: Don't define ENABLE_CHECKING whenever
2095         --enable-checking is seen, instead use similar --enable-checking=yes
2096         vs. --enable-checking=release default as gcc/ subdir has and
2097         define ENABLE_CHECKING if ENABLE_CHECKING is defined in gcc/.
2098         Define ENABLE_VALGRIND_CHECKING if requested.
2099         * lex.c (new_buff): If ENABLE_VALGRIND_CHECKING, put _cpp_buff
2100         struct first in the allocated buffer and result->base after it.
2101         (_cpp_free_buff): If ENABLE_VALGRIND_CHECKING, free buff itself
2102         instead of buff->base.
2103         * config.in: Regenerated.
2104         * configure: Regenerated.
2106 2013-02-13  Ed Smith-Rowland  <3dw4rd@verizon.net>
2108         PR c++/55582
2109         * lex.c (lex_raw_string): Allow string literal with suffix
2110         beginning with 's' to be parsed as a C++11 user-defined literal.
2112 2013-01-14  Richard Sandiford  <rdsandiford@googlemail.com>
2114         Update copyright years.
2116 2013-01-04  Paolo Carlini  <paolo.carlini@oracle.com>
2118         PR c++/54526 (again)
2119         * lex.c (_cpp_lex_direct): In C++11 mode, implement 2.5 p3, bullet 2.
2121 2013-01-03  Marc Glisse  <marc.glisse@inria.fr>
2123         PR bootstrap/50177
2124         * line-map.c (get_combined_adhoc_loc): Cast from extern "C" type.
2125         (new_linemap): Likewise.
2126         (linemap_enter_macro): Likewise.
2128 2012-12-03  Jakub Jelinek  <jakub@redhat.com>
2130         PR bootstrap/55380
2131         PR other/54691
2132         * files.c (read_file_guts): Allocate extra 16 bytes instead of
2133         1 byte at the end of buf.  Pass size + 16 instead of size
2134         to _cpp_convert_input.
2135         * charset.c (_cpp_convert_input): Reallocate if there aren't
2136         at least 16 bytes beyond to.len in the buffer.  Clear 16 bytes
2137         at to.text + to.len.
2139 2012-11-21  Steve Ellcey  <sellcey@mips.com>
2141         PR pch/55399
2142         * files.c (pch_open_file): Fix check for implicit_preinclude.
2144 2012-11-16  Simon Baldwin  <simonb@google.com>
2146         * include/cpplib.h (struct cpp_options): Add canonical_system_headers.
2147         * files.c (find_file_in_dir): Call maybe_shorter_path() only if
2148         canonical_system_headers is set.
2149         * init.c (cpp_create_reader): Initialize canonical_system_headers.
2150         * configure.ac: Add new --enable-canonical-system-headers.
2151         * configure: Regenerate.
2152         * config.in: Regenerate.
2154 2012-11-09  Ed Smith-Rowland  <3dw4rd@verizon.net>
2156         PR c++/54413
2157         * include/cpplib.h (cpp_interpret_float_suffix): Add cpp_reader* arg.
2158         (cpp_interpret_int_suffix): Add cpp_reader* arg.
2159         * init.c (cpp_create_reader): Iitialize new flags.
2160         * expr.c (interpret_float_suffix): Use new flags.
2161         (cpp_interpret_float_suffix): Add cpp_reader* arg.
2162         (interpret_int_suffix): Use new flags.
2163         (cpp_interpret_int_suffix): Add cpp_reader* arg.
2164         (cpp_classify_number): Adjust calls to interpret_x_suffix.
2166 2012-10-23  Ian Bolton  <ian.bolton@arm.com>
2167             Jim MacArthur  <jim.macarthur@arm.com>
2168             Marcus Shawcroft  <marcus.shawcroft@arm.com>
2169             Nigel Stephens  <nigel.stephens@arm.com>
2170             Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
2171             Richard Earnshaw  <rearnsha@arm.com>
2172             Sofiane Naci  <sofiane.naci@arm.com>
2173             Stephen Thomas  <stephen.thomas@arm.com>
2174             Tejas Belagod  <tejas.belagod@arm.com>
2175             Yufeng Zhang  <yufeng.zhang@arm.com>
2177         * configure.ac: Enable AArch64.
2178         * configure: Regenerate.
2180 2012-10-23  Joseph Myers  <joseph@codesourcery.com>
2182         * files.c (struct _cpp_file): Add implicit_preinclude.
2183         (pch_open_file): Allow a previously opened implicitly included
2184         file.
2185         (_cpp_find_file): Add implicit_preinclude argument.  Free file and
2186         do not call open_file_failed if implicit_preinclude.  Store
2187         implicit_preinclude value.
2188         (_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date):
2189         Update calls to _cpp_find_file.
2190         (_cpp_stack_include): Handle IT_DEFAULT.
2191         (cpp_push_default_include): New.
2192         * include/cpplib.h (cpp_push_default_include): Declare.
2193         * init.c (cpp_read_main_file): Update call to _cpp_find_file.
2194         * internal.h (enum include_type): Add IT_DEFAULT.
2195         (_cpp_find_file): Update prototype.
2197 2012-10-15  Tobias Burnus  <burnus@net-b.de>
2199         * files.c (read_file_guts, _cpp_save_file_entries): Free memory
2200         before returning.
2201         * lex.c (warn_about_normalization): Ditto.
2202         * mkdeps.c (deps_save): Ditto.
2203         * pch.c (cpp_valid_state): Ditto.
2205 2012-10-04  Florian Weimer  <fweimer@redhat.com>
2207         * directives.c (do_pragma_warning_or_error): New.
2208         (do_pragma_warning): New.
2209         (do_pragma_error): New.
2210         (_cpp_init_internal_pragmas): Register new pragmas.
2212 2012-09-25  Dehao Chen  <dehao@google.com>
2214         PR middle-end/54704
2215         * line-map.c (location_adhoc_data_hash): Fix the hash function.
2217 2012-09-25  Dehao Chen  <dehao@google.com>
2219         PR middle-end/54645
2220         * include/line-map.h (location_adhoc_data): Move location_adhoc_data
2221         into GC.
2222         (location_adhoc_data_map): Likewise.
2223         (line_maps): Likewise.
2224         (rebuild_location_adhoc_htab): New Function.
2225         * line-map.c (+rebuild_location_adhoc_htab): new Funcion.
2226         (get_combined_adhoc_loc): Move location_adhoc_data into GC.
2227         (location_adhoc_data_fini): Likewise.
2228         (linemap_init): Likewise.
2229         (location_adhoc_data_init): Remove Function.
2231 2012-09-19  Dehao Chen  <dehao@google.com>
2233         * include/line-map.h (MAX_SOURCE_LOCATION): New value.
2234         (location_adhoc_data_fini): New.
2235         (get_combined_adhoc_loc): New.
2236         (get_data_from_adhoc_loc): New.
2237         (get_location_from_adhoc_loc): New.
2238         (location_adhoc_data_map): New.
2239         (COMBINE_LOCATION_DATA): New.
2240         (IS_ADHOC_LOC): New.
2241         (expanded_location): New field.
2242         (line_maps): New field.
2243         * line-map.c (location_adhoc_data): New.
2244         (location_adhoc_data_hash): New.
2245         (location_adhoc_data_eq): New.
2246         (location_adhoc_data_update): New.
2247         (get_combined_adhoc_loc): New.
2248         (get_data_from_adhoc_loc): New.
2249         (get_location_from_adhoc_loc): New.
2250         (location_adhoc_data_init): New.
2251         (location_adhoc_data_fini): New.
2252         (linemap_init): Initialize location_adhoc_data.
2253         (linemap_lookup): Change to use new location.
2254         (linemap_ordinary_map_lookup): Likewise.
2255         (linemap_macro_map_lookup): Likewise.
2256         (linemap_macro_map_loc_to_def_point): Likewise.
2257         (linemap_macro_map_loc_unwind_toward_spel): Likewise.
2258         (linemap_get_expansion_line): Likewise.
2259         (linemap_get_expansion_filename): Likewise.
2260         (linemap_location_in_system_header_p): Likewise.
2261         (linemap_location_from_macro_expansion_p): Likewise.
2262         (linemap_macro_loc_to_spelling_point): Likewise.
2263         (linemap_macro_loc_to_def_point): Likewise.
2264         (linemap_macro_loc_to_exp_point): Likewise.
2265         (linemap_resolve_location): Likewise.
2266         (linemap_unwind_toward_expansion): Likewise.
2267         (linemap_unwind_to_first_non_reserved_loc): Likewise.
2268         (linemap_expand_location): Likewise.
2269         (linemap_dump_location): Likewise.
2270         (linemap_line_start): Likewise.
2272 2012-05-25  Dodji Seketeli  <dodji@redhat.com>
2274         PR preprocessor/53469
2275         * directives.c (do_pragma): Use the virtual location for the
2276         pragma token, instead of its spelling location.
2278 2012-08-14   Diego Novillo  <dnovillo@google.com>
2280         Merge from cxx-conversion branch.  Configury.
2282         * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
2283         * configure.ac: Likewise.
2284         * configure: Regenerate.
2286 2012-08-14   Lawrence Crowl  <crowl@google.com>
2288         Merge from cxx-conversion branch.  New C++ hash table.
2290         * include/symtab.h (typedef struct ht hash_table): Change the typedef
2291         name to cpp_hash_table.  Update all users of the typedef.
2293 2012-07-30  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
2295         * include/line-map.h (line_map_macro): Use the "atomic" GTY option
2296         for the macro_locations field.
2298 2011-06-19  Uros Bizjak  <ubizjak@gmail.com>
2300         * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
2301         __builtin_ia32_pcmpestri128 instead of asm.
2303 2012-06-04  Dimitrios Apostolou <jimis@gmx.net>
2305         * line-map.c (linemap_enter_macro): Don't zero max_column_hint in
2306         every macro. This improves performance by reducing the number of
2307         reallocations when track-macro-expansion is on.
2309 2012-06-04  Dodji Seketeli  <dodji@redhat.com>
2311         PR preprocessor/53463
2312         * line-map.c (linemap_location_in_system_header_p): For built-in
2313         macro tokens, check the first expansion point location that is not
2314         for a token coming from a built-in macro.
2316 2012-05-29  Joseph Myers  <joseph@codesourcery.com>
2318         * directives.c: Fix typos.
2319         * include/line-map.h: Fix typos.
2320         * line-map.c: Fix typos.
2321         * macro.c: Fix typos.
2323 2012-05-25  Dodji Seketeli  <dodji@redhat.com>
2325         PR bootstrap/53459
2326         * lex.c (search_line_fast): Avoid unused local typedefs to simulate
2327         a static assertion.
2329 2012-05-29  Dodji Seketeli  <dodji@redhat.com>
2331         PR preprocessor/53229
2332         * internal.h (cpp_reader::set_invocation_location): Remove.
2333         (cpp_reader::about_to_expand_macro_p): New member flag.
2334         * directives.c (do_pragma):  Remove Kludge as
2335         pfile->set_invocation_location is no more.
2336         * macro.c (cpp_get_token_1): Do away with the use of
2337         cpp_reader::set_invocation_location.  Just collect the macro
2338         expansion point when we are about to expand the top-most macro.
2339         Do not override cpp_reader::about_to_expand_macro_p.
2340         This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding
2341         properly handle locations of expansion points.
2342         (cpp_get_token_with_location): Adjust, as
2343         cpp_reader::set_invocation_location is no more.
2344         (paste_tokens): Take a virtual location parameter for
2345         the LHS of the pasting operator.  Use it in diagnostics.  Update
2346         comments.
2347         (paste_all_tokens): Tighten the assert.  Propagate the location of
2348         the expansion point when no virtual locations are available.
2349         Pass the virtual location to paste_tokens.
2350         (in_macro_expansion_p): New static function.
2351         (enter_macro_context): Set the cpp_reader::about_to_expand_macro_p
2352         flag until we really start expanding the macro.
2354 2012-05-16  Dodji Seketeli  <dodji@redhat.com>
2356         PR preprocessor/7263
2357         * include/cpplib.h (cpp_classify_number): Take a location
2358         parameter.
2359         * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic
2360         macros that take a location parameter.
2361         (cpp_classify_number): Take a (virtual) location parameter.  Use
2362         it for diagnostics.  Adjust comments.
2363         (eval_token): Take a location parameter.  Pass it to
2364         cpp_classify_number and to diagnostic routines.
2365         (_cpp_parse_expr): Use virtual locations of tokens when parsing
2366         expressions.  Pass a virtual location to eval_token and to
2367         diagnostic routines.
2369 2012-05-10  Tristan Gingold  <gingold@adacore.com>
2371         * expr.c (interpret_float_suffix): Add a guard.
2373 2012-05-02  Dodji Seketeli  <dodji@redhat.com>
2375         Properly initialize cpp_context in destringize_and_run
2376         * directives.c (destringize_and_run): Properly initialize the new
2377         context.
2378         * macro.c (_cpp_pop_context): Assert that we shouldn't try to pop
2379         the initial base context, which has the same life time as the
2380         current instance of cpp_file.
2382 2012-04-30  Manuel López-Ibáñez  <manu@gcc.gnu.org>
2383             Dodji Seketeli  <dodji@seketeli.org>
2385         PR c++/52974
2386         * libcpp/files.c (maybe_shorter_path): New.
2387         (find_file_in_dir): Use it.
2389 2012-04-30  Dodji Seketeli  <dodji@redhat.com>
2391         Switch -ftrack-macro-expansion=2 on by default.
2392         * init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
2393         by default.  Add comments.
2395         Strip "<built-in>" loc from displayed expansion context
2396         * include/line-map.h (linemap_unwind_toward_expansion): Fix typo
2397         in comment.
2398         (linemap_unwind_to_first_non_reserved_loc): Declare new function.
2399         * line-map.c (linemap_unwind_to_first_non_reserved_loc): Define
2400         new function.
2402         Fix expansion point loc for macro-like tokens
2403         * macro.c (macro_of_context): New static function.
2404         (_cpp_push_token_context, push_extended_tokens_context): If the
2405         macro argument is NULL, it means we are continuing the expansion
2406         of the current macro, if any.  Update comments.
2407         (_cpp_pop_context): Re-enable expansion of the macro only when we
2408         are really out of the context of the current expansion.
2410         Fix token pasting with -ftrack-macro-expansion
2411         * macro.c (paste_all_tokens): Put the token resulting from pasting
2412         into an extended token context with -ftrack-macro-location is in
2413         effect.
2415         Fix cpp_sys_macro_p with -ftrack-macro-expansion
2416         * macro.c (cpp_sys_macro_p):  Support -ftrack-macro-expansion.
2418 2012-04-29  Dodji Seketeli  <dodji@redhat.com>
2420         * lex.c (lex_raw_string): Change C++ style comments into C style
2421         comments.
2422         (lex_string): Likewise.
2424 2012-04-27   Ollie Wild  <aaw@google.com>
2426         * include/cpplib.h (struct cpp_options): Add new field,
2427         warn_literal_suffix.
2428         (CPP_W_LITERAL_SUFFIX): New enum.
2429         * init.c (cpp_create_reader): Default initialization of
2430         warn_literal_suffix.
2431         * lex.c (lex_raw_string): Treat user-defined literals which don't
2432         begin with '_' as separate tokens and produce a warning.
2433         (lex_string): Ditto.
2435 2012-04-26  Manuel López-Ibáñez  <manu@gcc.gnu.org>
2437         * line-map.c (linemap_resolve_location): Synchronize comments with
2438         those in line-map.h.
2439         * include/line-map.h (linemap_resolve_location): Fix spelling in
2440         comment.
2442 2012-03-22  Richard Earnshaw  <rearnsha@arm.com>
2444         * lex.c (search_line_fast): Provide Neon-optimized version for ARM.
2446 2012-03-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
2448         * lex.c: Remove Solaris 8 reference.
2450 2012-02-14  Walter Lee  <walt@tilera.com>
2452         * configure.ac: Require 64-bit hwint for tilegx and tilepro.
2453         * configure: Regenerate.
2455 2012-01-09  Richard Guenther  <rguenther@suse.de>
2457         * macro.c (_cpp_builtin_macro_text): Remove unused variable map.
2459 2012-01-09  Gary Funck  <gary@intrepid.com>
2461         PR preprocessor/33919
2462         * files.c (_cpp_get_file_name): New. Implement file name
2463         access function.
2464         * internal.h (_cpp_get_file_name): New prototype.
2465         * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
2466         to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
2468 2012-01-03  Olivier Hainque  <hainque@adacore.com>
2470         * system.h: Prior to #define, #undef fopen and freopen unconditionally.
2472 2011-12-20  Joseph Myers  <joseph@codesourcery.com>
2474         * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
2475         (CLK_STDC1X): Change to CLK_STDC11.
2476         * init.c (lang_defaults): Update comments.
2477         (cpp_init_builtins): Update language tests.  Use 201112L for C11
2478         __STDC_VERSION__.
2480 2011-12-20  Andreas Schwab  <schwab@linux-m68k.org>
2482         * configure: Regenerate.
2484 2011-12-19  Andreas Schwab  <schwab@linux-m68k.org>
2486         * configure: Regenerate.
2488 2011-12-07  Jakub Jelinek  <jakub@redhat.com>
2490         PR bootstrap/50237
2491         * internal.h (_cpp_init_lexer): New prototype.
2492         * init.c (init_library): Call it.
2493         * lex.c (init_vectorized_lexer): Remove constructor attribute,
2494         add inline keyword.
2495         (HAVE_init_vectorized_lexer): Define.
2496         (_cpp_init_lexer): New function.
2498 2011-12-03  Dodji Seketeli  <dodji@redhat.com>
2500         * macro.c (tokens_buff_remove_last_token)
2501         (tokens_buff_put_token_to): Add an 'inline' function specifier to
2502         the prototype.
2504 2011-11-22   Diego Novillo  <dnovillo@google.com>
2506         * include/line-map.h (linemap_dump): Declare.
2507         (line_table_dump): Declare.
2508         * line-map.c (linemap_dump): New.
2509         (line_table_dump): New.
2511 2011-11-21  Ed Smith-Rowland  <3dw4rd@verizon.net>
2513         PR c++/50958
2514         * expr.c (cpp_userdef_char_remove_type): Fix typo.
2516 2011-11-03  Michael Matz  <matz@suse.de>
2518         PR bootstrap/50857
2519         * configure.ac: Check for -fno-exceptions -fno-rtti.
2520         * configure: Regenerate.
2521         * Makefile.in (NOEXCEPTION_FLAGS): New flag.
2522         (ALL_CXXFLAGS): Use it.
2524 2011-11-02  Paolo Carlini  <paolo.carlini@oracle.com>
2526         * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
2528 2011-11-02  Jason Merrill  <jason@redhat.com>
2530         PR c++/50810
2531         * configure.ac: Add -Wno-narrowing to warning options.
2533 2011-10-31  Jason Merrill  <jason@redhat.com>
2535         PR libstdc++/1773
2536         * init.c (cpp_init_builtins): Set __cplusplus for C++11.
2538         PR c++/50920
2539         * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
2540         CLK_GNUCXX0X to CLK_GNUCXX11.
2542 2011-10-26  Ed Smith-Rowland  <3dw4rd@verizon.net>
2544         Implement C++11 user-defined literals.
2545         * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
2546         cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
2547         cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
2548         cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
2549         (cpp_classify_number): Classify unrecognized tokens as user-defined
2550         literals.
2551         * include/cpplib.h: Add new tokens for user-defined literals.
2552         * init.c: Add new preprocessor flag (cxx11).
2553         * lex.c: (lex_string, lex_raw_string): Handle user-defined literals
2554         including concatenation and promotion with suffixes.
2556 2011-10-24  Dodji Seketeli  <dodji@redhat.com>
2558         * line-map.c (linemap_macro_map_lookup): Fix logic.
2560 2011-10-24  Dodji Seketeli  <dodji@redhat.com>
2562         * include/line-map.h (linemap_expand_location): Take a line table
2563         parameter.  Update comment.
2564         (linemap_resolve_location): Update comment.
2565         (linemap_expand_location_full): Remove.
2566         * line-map.c (linemap_resolve_location):  Handle reserved
2567         locations; return a NULL map in those cases.
2568         (linemap_expand_location): If location is reserved, return a
2569         zeroed expanded location.  Update comment.  Take a line table to
2570         assert that the function takes non-virtual locations only.
2571         (linemap_expand_location_full): remove.
2572         (linemap_dump_location): Handle the fact that
2573         linemap_resolve_location can return NULL line maps when the
2574         location resolves to a reserved location.
2576         * line-map.c (linemap_macro_map_lookup): Fix logic.
2578 2011-10-22  Dodji Seketeli  <dodji@redhat.com>
2580         PR bootstrap/50778
2581         * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
2582         context to act upon.
2583         * lex.c (_cpp_remaining_tokens_num_in_context): Likewise.  Update
2584         comment.
2585         (cpp_token_from_context_at): Likewise.
2586         (cpp_peek_token): Use the context to peek tokens from.
2588 2011-10-20  Dodji Seketeli  <dodji@redhat.com>
2590         PR bootstrap/50801
2591         * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
2592         number of tokens.
2594 2011-10-18  Dodji Seketeli  <dodji@redhat.com>
2596         PR bootstrap/50760
2597         * include/line-map.h (struct linemap_stats): Change the type of
2598         the members from size_t to long.
2599         * macro.c (macro_arg_token_iter_init): Unconditionally initialize
2600         iter->location_ptr.
2602 2011-10-17  Dodji Seketeli  <dodji@redhat.com>
2604         * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
2605         variable without using it if ENABLE_CHECKING is not defined.  Mark
2606         the LOCATION parameter as being unused.
2608 2011-10-15  Tom Tromey  <tromey@redhat.com>
2609             Dodji Seketeli  <dodji@redhat.com>
2611         * include/line-map.h (struct line_maps::alloced_size_for_request):
2612         New member.
2613         * line-map.c (new_linemap): Use set->alloced_size_for_request to
2614         get the actual allocated size of line maps.
2616 2011-10-15  Tom Tromey  <tromey@redhat.com>
2617             Dodji Seketeli  <dodji@redhat.com>
2619         * line-map.h (struct linemap_stats): Declare new struct.
2620         (linemap_get_statistics): Declare ...
2621         * line-map.c (linemap_get_statistics):  ... new function.
2622         * macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
2623         Declare new counters.
2624         (enter_macro_context, replace_args): Update
2625         num_macro_tokens_counter.
2626         (cpp_get_token_1): Update num_expanded_macros_counter.
2628 2011-10-15  Tom Tromey  <tromey@redhat.com>
2629             Dodji Seketeli  <dodji@redhat.com>
2631         * include/cpplib.h (struct cpp_options)<debug>: New struct member.
2632         * include/line-map.h (linemap_dump_location): Declare ...
2633         * line-map.c (linemap_dump_location): ... new function.
2635 2011-10-15  Tom Tromey  <tromey@redhat.com>
2636             Dodji Seketeli  <dodji@redhat.com>
2638         * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
2639         New option.
2640         * internal.h (struct macro_context): New struct.
2641         (enum context_tokens_kind): New enum.
2642         (struct cpp_context)<tokens_kind>: New member of type enum
2643         context_tokens_kind.
2644         (struct cpp_context)<macro>: Remove this.  Replace it with an enum
2645         of macro and  macro_context.
2646         (struct cpp_context)<direct_p>: Remove.
2647         (_cpp_remaining_tokens_num_in_context): Declare new function.
2648         * directives.c (destringize_and_run): Adjust.
2649         * lex.c (_cpp_remaining_tokens_num_in_context)
2650         (_cpp_token_from_context_at): Define new functions
2651         (cpp_peek_token): Use them.
2652         * init.c (cpp_create_reader): Initialize the base context to zero.
2653         (_cpp_token_from_context_at): Define new static function.
2654         (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
2655         _cpp_token_from_context_at.
2656         * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
2657         members.
2658         (enum macro_arg_token_kind): New enum.
2659         (struct macro_arg_token_iter): New struct.
2660         (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
2661         (alloc_expanded_arg_mem, ensure_expanded_arg_room)
2662         (delete_macro_args, set_arg_token, get_arg_token_location)
2663         (arg_token_ptr_at, macro_arg_token_iter_init)
2664         (macro_arg_token_iter_get_token)
2665         (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
2666         (expanded_token_index, tokens_buff_new, tokens_buff_count)
2667         (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
2668         (tokens_buff_add_token, tokens_buff_remove_last_token)
2669         (reached_end_of_context, consume_next_token_from_context): New
2670         static functions.
2671         (cpp_get_token_1): New static function. Split and extended from
2672         cpp_get_token.  Use reached_end_of_context and
2673         consume_next_token_from_context.  Unify its return point.  Move
2674         the location tweaking from cpp_get_token_with_location in here.
2675         (cpp_get_token): Use cpp_get_token_1
2676         (stringify_arg): Use the new arg_token_at.
2677         (paste_all_tokens): Support tokens coming from extended tokens
2678         contexts.
2679         (collect_args): Return the number of collected arguments, by
2680         parameter.  Store virtual locations of tokens that constitute the
2681         collected args.
2682         (funlike_invocation_p): Return the number of collected arguments,
2683         by parameter.
2684         (enter_macro_context): Add a parameter for macro expansion point.
2685         Pass it to replace_args and to the "used" cpp callback.  Get the
2686         number of function-like macro arguments from funlike_invocation_p,
2687         pass it to the new delete_macro_args to free the memory used by
2688         macro args.  When -ftrack-macro-expansion is in effect, for macros
2689         that have no arguments, create a macro map for the macro expansion
2690         and use it to allocate proper virtual locations for tokens
2691         resulting from the expansion.  Push an extended tokens context
2692         containing the tokens resulting from macro expansion and their
2693         virtual locations.
2694         (replace_args): Rename the different variables named 'count' into
2695         variables with more meaningful names.  Create a macro map;
2696         allocate virtual locations of tokens resulting from this
2697         expansion.  Use macro_arg_token_iter to iterate over tokens of a
2698         given macro.  Handle the case of the argument of
2699         -ftrack-macro-expansion being < 2.  Don't free macro arguments
2700         memory resulting from expand_arg here, as these are freed by the
2701         caller of replace_arg using delete_macro_args now.  Push extended
2702         token context.
2703         (next_context, push_ptoken_context, _cpp_push_token_context)
2704         (_cpp_push_text_context): Properly initialize the context.
2705         (expand_arg): Use the new alloc_expanded_arg_mem,
2706         push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
2707         (_cpp_pop_context): Really free the memory held by the context.
2708         Handle freeing memory used by extended tokens contexts.
2709         (cpp_get_token_with_location): Use cpp_get_token_1.
2710         (cpp_sys_macro_p): Adjust.
2711         (_cpp_backup_tokens): Support the new kinds of token contexts.
2712         * traditional.c (recursive_macro): Adjust.
2714 2011-10-15  Tom Tromey  <tromey@redhat>
2715             Dodji Seketeli  <dodji@redhat.com>
2717         * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
2718         member.
2719         (MAX_SOURCE_LOCATION): New constant.
2720         (struct line_map_ordinary, struct line_map_macro): New structs.
2721         (struct line_map): Turn this into a union of the two above.  Add
2722         comments.
2723         (struct maps_info): New struct.
2724         (struct line_maps)<info_ordinary, info_macro>: Two new fields.
2725         These now carry the map information that was previously scattered
2726         in struct line_maps.
2727         (struct map_info::allocated): Fix comment.
2728         (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
2729         (ORDINARY_MAP_STARTING_LINE_NUMBER)
2730         (ORDINARY_MAP_INCLUDER_FILE_INDEX)
2731         (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
2732         (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
2733         (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
2734         (MACRO_MAP_EXPANSION_POINT_LOCATION)
2735         (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
2736         (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
2737         (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
2738         (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
2739         (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
2740         (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
2741         (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
2742         (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
2743         (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
2744         (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
2745         (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
2746         information.
2747         (linemap_check_ordinary, linemap_assert)
2748         (linemap_location_before_p): New macros.
2749         (linemap_position_for_line_and_column)
2750         (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
2751         (linemap_macro_expansion_map_p)
2752         (linemap_macro_map_loc_to_def_point)
2753         (linemap_macro_map_loc_unwind_once)
2754         (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
2755         (linemap_get_source_line linemap_get_source_column)
2756         (linemap_map_get_macro_name, linemap_get_file_path)
2757         (linemap_location_in_system_header_p)
2758         (linemap_location_from_macro_expansion_p): Declare new functions.
2759         (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
2760         (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
2761         accessors act on ordinary maps only.
2762         (INCLUDED_FROM): Return NULL for main files; use the new
2763         accessors.
2764         (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
2765         (struct expanded_location): Move here from gcc/input.h
2766         (linemap_resolve_location, linemap_expand_location)
2767         (linemap_expand_location_full): Declare new functions.
2768         * line-map.c: Include cpplib.h, internal.h
2769         (linemap_enter_macro, linemap_add_macro_token)
2770         (linemap_get_expansion_line, linemap_get_expansion_filename): New
2771         functions that are private to libcpp.
2772         (linemap_assert): New macro.
2773         (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
2774         (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
2775         (linemap_macro_map_loc_unwind_toward_spelling)
2776         (linemap_macro_map_loc_to_exp_point)
2777         (first_map_in_common_1, first_map_in_common): New static
2778         functions.
2779         (new_linemap): Define new static functions.  Extracted and
2780         enhanced from ...
2781         (linemap_add): ... here.  Use linemap_assert in lieu of abort
2782         previously.
2783         (linemap_tracks_macro_expansion_locs_p)
2784         (linemap_add_macro_token, linemap_macro_expansion_map_p)
2785         (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
2786         (linemap_macro_map_loc_to_def_point)
2787         (linemap_macro_map_loc_unwind_once)
2788         (linemap_step_out_once, linemap_map_get_index)
2789         (linemap_get_source_line,linemap_get_source_column)
2790         (linemap_get_file_path, linemap_map_get_macro_name)
2791         (linemap_location_in_system_header_p)
2792         (linemap_location_originated_from_system_header_p)
2793         (linemap_location_from_macro_expansion_p)
2794         (linemap_tracks_macro_expansion_locs_p)
2795         (linemap_resolve_location, linemap_expand_location)
2796         (linemap_expand_location_full)
2797         (linemap_tracks_macro_expansion_locs_p)
2798         (linemap_position_for_line_and_column, linemap_compare_locations):
2799         Define new public functions.
2800         (linemap_init): Initialize ordinary and macro maps information in
2801         the map set.
2802         (linemap_check_files_exited): Use the new accessors.
2803         (linemap_free): Remove this dead code.
2804         (linemap_line_start): Assert this uses an ordinary map.  Adjust to
2805         use the new ordinary map accessors and data structures.  Don't
2806         overflow past the lowest possible macro token's location.
2807         (linemap_position_for_column): Assert the ordinary maps of the map
2808         set are really ordinary.  Use ordinary map accessors.
2809         (linemap_lookup): Keep the same logic but generalize to allow
2810         lookup of both ordinary and macro maps.  Do not crash when called
2811         with an empty line table.
2812         * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
2813         new API of line-map.h.
2814         * directives.c (start_directive, do_line, do_linemarker)
2815         (do_linemarker): Likewise.
2816         * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
2817         (make_cpp_dir, cpp_make_system_header): Likewise.
2818         * init.c (cpp_read_main_file): Likewise.
2819         * internal.h (CPP_INCREMENT_LINE): Likewise.
2820         (linemap_enter_macro, linemap_add_macro_token)
2821         (linemap_get_expansion_line, linemap_get_expansion_filename): New
2822         functions private to libcpp.
2823         * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
2824         (skip_line_comment, skip_whitespace, lex_raw_string)
2825         (_cpp_lex_direct): Likewise.
2826         * macro.c (_cpp_builtin_macro_text): Likewise.
2827         (_cpp_aligned_alloc): Initialize the new name member of the macro.
2828         * traditional.c (copy_comment, _cpp_scan_out_logical_line):
2829         Likewise.
2830         * errors.c (cpp_diagnostic): Adjust to new linemap API.
2832 2011-08-28  Dodji Seketeli  <dodji@redhat.com>
2834         * line-map.c (linemap_add): Assert that reason must not be
2835         LC_RENAME when called for the first time on a "main input file".
2837 2011-08-22  Gabriel Charette  <gchare@google.com>
2839         * init.c (cpp_create_reader): Inititalize forced_token_location_p.
2840         * internal.h (struct cpp_reader): Add field forced_token_location_p.
2841         * lex.c (_cpp_lex_direct): Use forced_token_location_p.
2842         (cpp_force_token_locations): New.
2843         (cpp_stop_forcing_token_locations): New.
2845 2011-08-18  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
2847         PR libstdc++/1773
2848         * init.c (cpp_init_builtins): Define __cplusplus 19971L.
2850 2011-08-18  Joseph Myers  <joseph@codesourcery.com>
2852         * include/cpplib.h (struct cpp_options): Fix typo.
2854 2011-08-18  Joseph Myers  <joseph@codesourcery.com>
2856         * include/cpplib.h (struct cpp_options): Add rliterals.
2857         * init.c  (struct lang_flags, lang_defaults): Add rliterals.
2858         (cpp_set_lang): Set rliterals option.
2859         (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
2860         * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
2862 2011-08-15  Gabriel Charette  <gchare@google.com>
2864         * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
2865         Update all users to use linemap_position_for_column instead.
2867 2011-07-28  Gabriel Charette  <gchare@google.com>
2869         * include/line-map.h (struct line_maps):
2870         Remove unused field last_listed. Update all users.
2872 2011-07-28  H.J. Lu  <hongjiu.lu@intel.com>
2874         * configure.ac: Set need_64bit_hwint to yes for x86 targets.
2875         * configure: Regenerated.
2877 2011-07-25  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
2879         * system.h [__cplusplus]: Wrap C function declarations in extern "C".
2881 2011-07-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
2882             Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2884         PR bootstrap/49794
2885         * configure.ac: Test AM_ICONV with CXX.
2886         * configure: Regenerate.
2887         * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
2889 2011-07-15  Dodji Seketeli  <dodji@redhat.com>
2891         * directives.c (struct if_stack): Use source_location as type
2892         here.
2893         * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
2894         indent, def_pragma, used_define, used_undef>: Properly use
2895         source_location as parameter type, rather than unsigned int.
2897 2011-07-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
2899         PR target/39150
2900         * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
2901         like i[34567]86-*-solaris2.1[0-9]*.
2902         * configure: Regenerate.
2904 2011-06-16  Jason Merrill  <jason@redhat.com>
2906         PR c++/45399
2907         * lex.c (lex_raw_string): Don't check for embedded NUL.
2909 2011-06-06  Dodji Seketeli  <dodji@redhat.com>
2911         PR preprocessor/48532
2912         * directives.c (do_pragma): Don't forget the invocation location
2913         when parsing the pragma name of a namespaced pragma directive.
2915 2011-05-29  John Tytgat  <John.Tytgat@aaug.net>
2917         * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
2919 2011-05-22  Uros Bizjak  <ubizjak@gmail.com>
2921         PR target/49104
2922         * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
2923         is defined.  Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
2925 2011-04-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
2927         * system.h (ENUM_BITFIELD): Remove.
2929 2011-04-24  Jakub Jelinek  <jakub@redhat.com>
2931         PR preprocessor/48740
2932         * lex.c (lex_raw_string): When raw string ends with
2933         ??) followed by raw prefix and ", ensure it is preprocessed
2934         with ??) rather than ??].
2936 2011-04-20  Jim Meyering  <meyering@redhat.com>
2938         * files.c (destroy_cpp_file): Remove useless if-before-free.
2939         * init.c (cpp_destroy): Likewise.
2940         * macro.c (replace_args): Likewise.
2941         * pch.c (cpp_valid_state): Likewise.
2943 2011-03-25  Kai Tietz  <ktietz@redhat.com>
2945         * files.c (file_hash_eq): Use filename_cmp
2946         instead of strcmp.
2947         (nonexistent_file_hash_eq): Likewise.
2948         (remap_filename): Likewise.
2949         Handle absolute DOS-path,
2950         (append_file_to_dir): Check for IS_DIR_SEPARATOR
2951         instead of slash.
2952         (read_name_map): Likewise.
2953         * linemap.c (linemap_add): Use filename_cmp
2954         instead of strcmp.
2955         * mkdeps.c (apply_vpath): Use filename_ncmp
2956         instead of strncmp.
2957         (deps_restore): Use filename_cmp instead of
2958         strcmp.
2959         * init.c (read_original_directory): Use
2960         IS_DIR_SEPARATOR instead of checking for slash.
2962 2011-03-21  Michael Meissner  <meissner@linux.vnet.ibm.com>
2964         PR preprocessor/48192
2965         * directives.c (do_ifdef): Do not consider conditional macros as
2966         being defined.
2967         (do_ifndef): Ditto.
2968         * expr.c (parse_defined): Ditto.
2970 2011-03-18  Richard Henderson  <rth@redhat.com>
2972         PR bootstrap/45381
2973         * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
2975 2011-11-04  Eric Botcazou  <ebotcazou@adacore.com>
2976             Jakub Jelinek  <jakub@redhat.com>
2978         PR preprocessor/39213
2979         * directives.c (end_directive): Call _cpp_remove_overlay for deferred
2980         pragmas as well in traditional mode.
2982 2010-11-17  Ian Lance Taylor  <iant@google.com>
2984         PR bootstrap/45538
2985         * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS.  Remove switch of
2986         AC_LANG based on ENABLE_BUILD_WITH_CXX.
2988 2010-11-16  Kai Tietz  <kai.tietz@onevision.com>
2990         PR preprocessor/17349
2991         * lex.c (save_comment): Handle in argument passing c++
2992         comments special.
2994 2010-11-02  Ian Lance Taylor  <iant@google.com>
2996         * configure.ac: Use AC_SYS_LARGEFILE.
2997         * configure: Rebuild.
2998         * config.in: Rebuild.
3000 2010-10-19  Basile Starynkevitch  <basile@starynkevitch.net>
3002         * line-map.h (source_location): Remove obsolete comment
3003         mentioning location_s.
3005 2010-09-29  Kai Tietz  <kai.tietz@onevision.com>
3007         PR preprocessor/45362
3008         * directives.c (cpp_pop_definition): Make static.
3009         (do_pragma_push_macro): Reworked to store text
3010         definition.
3011         (do_pragma_pop_macro): Add free text definition.
3012         (cpp_push_definition): Removed.
3013         * include/cpplib.h (cpp_push_definition): Removed.
3014         (cpp_pop_definition): Likewise.
3015         * internal.h (def_pragma_macro): Remove member 'value'
3016         and add new members 'definition', 'line',
3017         'syshdr', 'sued' and 'is_undef'.
3018         * pch.c (_cpp_restore_pushed_macros): Rework to work
3019         on text definition and store additional macro flags.
3020         (_cpp_save_pushed_macros): Likewise.
3022 2010-09-29  Joseph Myers  <joseph@codesourcery.com>
3024         * include/cpplib.h (cpp_options): Rename warn_deprecated,
3025         warn_traditional, warn_long_long and pedantic.
3026         * directives.c (directive_diagnostics, _cpp_handle_directive):
3027         Update names of cpp_options members.
3028         * expr.c (cpp_classify_number, eval_token): Update names of
3029         cpp_options members.
3030         * init.c (cpp_create_reader, post_options): Update names of
3031         cpp_options members.
3032         * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
3033         cpp_options members.
3034         * macro.c (parse_params): Update names of cpp_options members.
3036 2010-09-15  Ian Lance Taylor  <iant@google.com>
3038         * init.c: Fix type name in comment.
3040 2010-08-31  Jakub Jelinek  <jakub@redhat.com>
3042         PR preprocessor/45457
3043         * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
3044         needed.
3045         * directives.c (do_ifdef, do_ifndef): Likewise.
3047 2010-08-26  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
3049         * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
3051 2010-08-24  Richard Henderson  <rth@redhat.com>
3053         PR bootstrap/45376
3054         * configure.ac (HAVE_SSE4): New check.
3055         * configure, config.in: Rebuild.
3056         * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
3058 2010-08-24  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
3060         * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
3061         etc. on Solaris 2/x86.
3063 2010-08-21  Richard Henderson  <rth@redhat.com>
3064             Andi Kleen <ak@linux.intel.com>
3065             David S. Miller  <davem@davemloft.net>
3067         * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
3068         (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
3069         (ptrdiff_t): Check via AC_CHECK_TYPE.
3070         * config.in, configure: Rebuild.
3071         * system.h: Include stdint.h, if available.
3072         * lex.c (WORDS_BIGENDIAN): Provide default.
3073         (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
3074         acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
3075         search_line_sse2, search_line_sse42, init_vectorized_lexer,
3076         search_line_fast): New.
3077         (_cpp_clean_line): Use search_line_fast.  Restructure the fast
3078         loop to make it clear when we're leaving the loop.  Stay in the
3079         fast loop for non-trigraph '?'.
3081 2010-06-11  Jakub Jelinek  <jakub@redhat.com>
3083         * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
3084         callback.
3085         (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
3086         (cpp_macro_definition): Remove const qual from second argument.
3087         * macro.c (enter_macro_context): Call user_builtin_macro callback for
3088         NODE_BUILTIN !NODE_USED macros.
3089         (warn_of_redefinition): Likewise.  Remove const qual from second
3090         argument.
3091         (cpp_macro_definition): Likewise.
3092         * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
3093         for NODE_BUILTIN !NODE_USED macros.
3095 2010-06-10  Joseph Myers  <joseph@codesourcery.com>
3097         * include/cpplib.h (struct cpp_options): Remove show_column.
3098         * init.c (cpp_create_reader, post_options): Don't set show_column.
3100 2010-06-09  Joern Rennecke  <joern.rennecke@embecosm.com>
3102         PR bootstrap/44432
3103         * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
3104         check that C++ compiler works.
3105         * configure: Regenerate.
3107 2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
3109         * include/symtab.h (ht_identifier_ptr): New.
3111 2010-06-03  Joern Rennecke <joern.rennecke@embecosm.com>
3112             Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3114         PR bootstrap/42798
3115         * configure.ac: Check for declaration of 'basename(char *)'.
3116         * configure: Regenerate.
3117         * config.in: Regenerate.
3119 2010-04-25  Joseph Myers  <joseph@codesourcery.com>
3121         * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
3122         * init.c (lang_defaults): Add entries for new language variants.
3123         (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
3124         variants.
3126 2010-04-09  Manuel López-Ibáñez <manu@gcc.gnu.org>
3128         PR cpp/43195
3129         * files.c (report_missing_guard): Test for #pragma once.
3131 2010-04-07  Simon Baldwin  <simonb@google.com>
3133         * directives.c (do_diagnostic): Add warning reason argument,
3134         call appropriate error reporting function for code.
3135         (directive_diagnostics): Call specific warning functions with
3136         warning reason where appropriate.
3137         (do_error, do_warning, do_pragma_dependency): Add warning reason
3138         argument to do_diagnostic calls.
3139         * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
3140         _cpp_create_definition): Call specific warning functions with
3141         warning reason where appropriate.
3142         * Makefile.in: Add new diagnostic functions to gettext translations.
3143         * include/cpplib.h (struct cpp_callbacks): Add warning reason code
3144         to error callback.
3145         (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
3146         CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
3147         (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
3148         CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
3149         CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
3150         CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
3151         CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
3152         CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
3153         CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
3154         warning reason codes.
3155         (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
3156         cpp_warning_with_line, cpp_pedwarning_with_line,
3157         cpp_warning_with_line_syshdr): New specific error reporting functions.
3158         * pch.c (cpp_valid_state): Call specific warning functions with
3159         warning reason where appropriate.
3160         * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
3161         diagnostic handlers.
3162         (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
3163         cpp_warning_with_line, cpp_pedwarning_with_line,
3164         cpp_warning_with_line_syshdr): New specific error reporting functions.
3165         * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
3166         specific warning functions with warning reason where appropriate.
3167         * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
3168         warn_about_normalization, lex_identifier_intern, lex_identifier,
3169         _cpp_lex_direct): Ditto.
3170         * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
3171         narrow_str_to_charconst): Ditto.
3173 2010-04-06  Jakub Jelinek  <jakub@redhat.com>
3175         PR preprocessor/43642
3176         * lex.c (lex_raw_string): Change type of TYPE variable to
3177         unsigned char.
3179 2010-04-02  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3181         * aclocal.m4: Regenerate.
3183 2010-03-29  Jason Merrill  <jason@redhat.com>
3185         More N3077 raw string changes
3186         * charset.c (cpp_interpret_string): Don't transform UCNs in raw
3187         strings.
3188         * lex.c (bufring_append): Split out from...
3189         (lex_raw_string): ...here.  Undo trigraph and line splicing
3190         transformations.  Do process line notes in multi-line literals.
3191         (_cpp_process_line_notes): Ignore notes that were already handled.
3193         Some raw string changes from N3077
3194         * charset.c (cpp_interpret_string): Change inner delimiters to ().
3195         * lex.c (lex_raw_string): Likewise.  Also disallow '\' in delimiter.
3197 2010-02-11  Jakub Jelinek  <jakub@redhat.com>
3199         * init.c (read_original_filename): Don't call read_original_directory
3200         if _cpp_handle_directive returns 0.
3202 2010-01-01  Joseph Myers  <joseph@codesourcery.com>
3204         PR preprocessor/41947
3205         * expr.c (cpp_classify_number): Give error for hexadecimal
3206         floating-point constant with no digits before or after point.
3208 2009-11-20  Arnaud Charlet  <charlet@adacore.com>
3210         * macro.c (enter_macro_context): Call cb.used callback if defined.
3211         * directives.c (do_idef, do_ifndef): Ditto.
3212         * include/cpplib.h (struct cpp_callbacks): Add used callback.
3214 2009-11-11  Kai Tietz  <kai.tietz@onevision.com>
3216         * directives.c (do_pragma_push_macro): New pragma handler.
3217         (do_pragma_pop_macro): Likewise.
3218         (_cpp_init_internal_pragmas): Add push_macro and
3219         pop_macro handler to internal pragmas.
3220         (lex_macro_node_from_str): Removed.
3221         (cpp_push_definition): Replace lex_macro_node_from_str
3222         by _cpp_lex_identifier.
3223         (cpp_pop_definition): Likewise.
3224         * internal.h (_cpp_lex_identifier): New prototype.
3225         (def_pragma_macro): New structure.
3226         (cpp_reader): New member pushed_macros.
3227         * lex.c (_cpp_lex_identifier): New function.
3228         (lex_identifier_intern): New function.
3229         * init.c (cpp_create_reader): Initialize pushed_macros
3230         member.
3231         (cpp_destroy): Free elements in pushed_macros member.
3232         * pch.c (_cpp_save_pushed_macros): New function.
3233         (_cpp_restore_pushed_macros): Likewise.
3234         (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
3235         (cpp_read_state): Use _cpp_restore_pushed_macros.
3237 2009-10-19  Jakub Jelinek  <jakub@redhat.com>
3239         * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
3240         (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
3241         and char32_cset_desc.
3242         (converter_for_type): Handle CPP_UTF8STRING.
3243         (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
3244         * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
3245         (parse_include): Reject raw strings.
3246         * include/cpplib.h (CPP_UTF8STRING): New token type.
3247         * internal.h (struct cpp_reader): Add utf8_cset_desc field.
3248         * lex.c (lex_raw_string): New function.
3249         (lex_string): Handle u8 string literals, call lex_raw_string
3250         for raw string literals.
3251         (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
3252         sequences.
3253         * macro.c (stringify_arg): Handle CPP_UTF8STRING.
3255 2009-10-14  Jakub Jelinek  <jakub@redhat.com>
3257         PR preprocessor/41543
3258         * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
3259         * line-map.c (linemap_init): Initialize highest_location and
3260         highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
3262 2009-10-09  Jason Merrill  <jason@redhat.com>
3264         * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
3266 2009-10-09  Neil Vachharajani <nvachhar@google.com>
3268         * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
3269         sccs.
3271 2009-09-23  Loren J. Rittle  <ljrittle@acm.org>
3273         * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
3274         * configure: Rebuilt.
3276 2009-09-22  Richard Guenther  <rguenther@suse.de>
3278         PR pch/38987
3279         * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
3281 2009-09-18  Chris Demetriou  <cgd@google.com>
3283         PR preprocessor/28435:
3284         * include/cpplib.h (struct cpp_options): Add new member
3285         deps.need_preprocessor_output.
3286         * files.c (open_file_failed): If preprocessor output is needed
3287         always report an error.
3289 2009-09-13  Kai Tietz  <kai.tietz@onevision.com>
3291         * configure.ac: Set for i?86-w64-mingw*
3292         need_64bit_hwint to yes.
3293         * configure: Regenerated.
3295 2009-09-10  Jason Merrill  <jason@redhat.com>
3297         * directives.c (cpp_define): constify.
3299 2009-09-02  Ian Lance Taylor  <iant@google.com>
3301         * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
3303 2009-08-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3305         * configure.ac (AC_PREREQ): Bump to 2.64.
3307 2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3309         * aclocal.m4: Regenerate.
3310         * config.in: Regenerate.
3311         * configure: Regenerate.
3313 2009-08-17  Tom Tromey  <tromey@redhat.com>
3315         PR preprocessor/41067:
3316         * charset.c (convert_escape): Add missing ":" to error text.
3318 2009-07-27  Douglas B Rupp  <rupp@gnat.com>
3320         * include/cpplib.h (INO_T_CPP): New macro.
3321         (struct cpp_dir): Use it.
3323 2009-07-20  Jerry Quinn  <jlquinn@optonline.net>
3325         PR regression/40800
3326         * configure.ac: Use = instead of == for testing
3327         ENABLE_BUILD_WITH_CXX.
3328         * configure: Rebuild.
3330 2009-07-17  Jerry Quinn  <jlquinn@optonline.net>
3332         * directives.c (do_linemarker, do_line): Use CPP_STRING for
3333         ignored enum value.
3334         * files.c (find_file_in_dir): Add cast from void* to char*.
3335         * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
3336         * Makefile.in: (WARN_CFLAGS): Use general and C-specific
3337         warnings.
3338         (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
3339         ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
3340         COMPILER_FLAGS): New.
3341         (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
3342         (COMPILE.base): Use COMPILER instead of CC.  Use COMPILER_FLAGS
3343         instead of ALL_CFLAGS.
3344         * configure.ac: Invoke AC_PROG_CXX.  Separate C-specific warnings
3345         from other warnings.  Add -Wc++-compat to C-specific warnings.
3346         Check for --enable-build-with-cxx.  Set and substitute
3347         ENABLE_BUILD_WITH_CXX.  Invoke ZW_PROG_COMPILER_DEPENDENCIES
3348         according to ENABLE_BUILD_WITH_CXX.  Invoke AC_LANG before
3349         AC_CHECK_HEADERS.
3350         * configure: Rebuild.
3351         * include/cpp-id-data.h: Remove extern "C".
3352         * include/line-map.h: Likewise.
3353         * include/mkdeps.h: Likewise.
3354         * include/symtab.h: Likewise.
3355         * internal.h: Likewise.
3357 2009-06-23  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3359         * directives.c (parse_include): Add location argument. Update all
3360         calls.
3361         (parse_answer): Likewise.
3362         (do_include_common): Error with exact location.
3363         (parse_assertion): Likewise.
3365 2009-06-18  Manuel López-Ibáñez  <manu@gcc.gnu.org>
3367         * expr.c (num_div_op): Take explicit location.
3369 2009-06-17  Ian Lance Taylor  <iant@google.com>
3371         * include/cpplib.h (progname): Don't declare.
3373 2009-06-12  Ian Lance Taylor  <iant@google.com>
3375         * include/cpplib.h (struct cpp_options): Add
3376         warn_cxx_operator_names field.
3377         (NODE_WARN_OPERATOR): Define.
3378         (struct cpp_hashnode): Increase flags field to 10 bits, decrease
3379         type to 6 bits.
3380         * init.c (mark_named_operators): Add flags parameter.
3381         (cpp_post_options): Pick flags value to pass to
3382         mark_named_operators.
3383         * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
3384         identifier is an operator name in C++.
3386 2009-06-01  Aldy Hernandez  <aldyh@redhat.com>
3388         * include/line-map.h (LAST_SOURCE_COLUMN): New.
3390 2009-06-01  Ian Lance Taylor  <iant@google.com>
3392         * include/cpp-id-data.h: Add extern "C".
3393         * include/line-map.h: Likewise.
3394         * include/mkdeps.h: Likewise.
3395         * include/symtab.h: Likewise.
3396         * internal.h: Likewise.
3398 2009-05-15  Ian Lance Taylor  <iant@google.com>
3400         * include/cpplib.h (enum cpp_builtin_type): Rename from enum
3401         builtin_type.  Change all uses.
3403 2009-05-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3405         PR cpp/36674
3406         * directives (do_linemarker): Compensate for the increment in
3407         location that occurs when we reach the end of line.
3408         * files (_cpp_stack_include): Mention _cpp_find_file in the
3409         comment.
3411 2009-05-10  Joseph Myers  <joseph@codesourcery.com>
3413         * include/cpplib.h (enum cpp_token_fld_kind): Add
3414         CPP_TOKEN_FLD_TOKEN_NO.
3415         (struct cpp_macro_arg, struct cpp_identifier): Define.
3416         (union cpp_token_u): Use struct cpp_identifier for identifiers.
3417         Use struct cpp_macro_arg for macro arguments.  Add token_no for
3418         CPP_PASTE token numbers.
3419         * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
3420         do_pragma_poison, parse_assertion): Use val.node.node in place of
3421         val.node.
3422         * expr.c (parse_defined, eval_token): Use val.node.node in place
3423         of val.node.
3424         * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
3425         cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
3426         cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
3427         place of val.arg_no.  Use val.node.node in place of val.node.
3428         * macro.c (replace_args, cpp_get_token, parse_params,
3429         lex_expansion_token, create_iso_definition, cpp_macro_definition):
3430         Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
3431         Use val.node.node in place of val.node.
3433 2009-05-03  Joseph Myers  <joseph@codesourcery.com>
3435         * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
3436         UTF-8 sequences.
3438 2009-04-25  Joseph Myers  <joseph@codesourcery.com>
3440         PR preprocessor/39559
3441         * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
3442         constants larger than intmax_t in C99 mode.
3444 2009-04-21  Taras Glek <tglek@mozilla.com>
3446         * include/cpp-id-data.h: Update GTY annotations to new syntax.
3447         * include/cpplib.h: Likewise.
3448         * include/line-map.h: Likewise.
3449         * include/symtab.h: Likewise.
3451 2009-04-22  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3453         PR c++/14875
3454         * lex.c (cpp_type2name): Take a flags parameter. Call
3455         cpp_named_operator2name for named operators and cpp_digraph2name
3456         for digraphs.
3457         (cpp_digraph2name): New.
3458         (cpp_spell_token): Use it.
3459         (cpp_output_token): Likewise.
3460         * include/cpplib.h (cpp_type2name): Update declaration.
3461         * init.c (cpp_named_operator2name): New.
3462         * internal.h (cpp_named_operator2name): Declare.
3464 2009-04-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3466         PR c++/13358
3467         * init.c (cpp_create_reader): Wlong_long is disabled by default.
3468         * expr.c (cpp_classify_number): Give different messages for C and
3469         C++ front-ends.
3471 2009-04-19  Joseph Myers  <joseph@codesourcery.com>
3473         PR preprocessor/20078
3474         * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
3475         field.
3476         * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
3477         (struct cpp_token): Change flags to unsigned short.
3478         * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
3479         (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
3480         (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
3481         tokens.
3482         * macro.c (macro_real_token_count): New.
3483         (enter_macro_context, replace_args): Use macro_real_token_count.
3484         (create_iso_definition): Record whitespace surrounding and digraph
3485         spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
3486         Set extra_tokens and save CPP_PASTE tokens with arg_no set for
3487         multiple consecutive ## tokens.
3488         (_cpp_create_definition): Initialize extra_tokens.
3489         (cpp_macro_definition): Use macro_real_token_count.
3491 2009-04-18  Joseph Myers  <joseph@codesourcery.com>
3493         * directives.c (parse_include): Pass true to check_eol.
3495 2009-04-18  Joseph Myers  <joseph@codesourcery.com>
3497         PR preprocessor/39646
3498         * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
3499         * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
3500         * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
3501         place of LC_RENAME.
3503 2009-04-18  Joseph Myers  <joseph@codesourcery.com>
3505         PR preprocessor/39647
3506         * directives.c (check_eol): Add parameter expand.
3507         (do_undef, parse_include, do_line, do_linemarker, do_ident,
3508         do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
3509         do_else, do_endif, do_assert, do_unassert): All callers changed.
3510         Pass true from do_line, false elsewhere.
3512 2009-04-12  Joseph Myers  <joseph@codesourcery.com>
3514         PR preprocessor/31869
3515         * macro.c (stringify_arg): Handle NULL source token in padding
3516         token where previous padding token did not have source token with
3517         preceding whitespace.
3519 2009-04-09  Jakub Jelinek  <jakub@redhat.com>
3521         * Makefile.in: Change copyright header to refer to version
3522         3 of the GNU General Public License and to point readers at the
3523         COPYING3 file and the FSF's license web page.
3524         * charset.c: Likewise.
3525         * directives-only.c: Likewise.
3526         * directives.c: Likewise.
3527         * errors.c: Likewise.
3528         * expr.c: Likewise.
3529         * files.c: Likewise.
3530         * identifiers.c: Likewise.
3531         * include/cpp-id-data.h: Likewise.
3532         * include/cpplib.h: Likewise.
3533         * include/line-map.h: Likewise.
3534         * include/mkdeps.h: Likewise.
3535         * include/symtab.h: Likewise.
3536         * init.c: Likewise.
3537         * internal.h: Likewise.
3538         * lex.c: Likewise.
3539         * line-map.c: Likewise.
3540         * macro.c: Likewise.
3541         * makeucnid.c: Likewise.
3542         * mkdeps.c: Likewise.
3543         * pch.c: Likewise.
3544         * symtab.c: Likewise.
3545         * system.h: Likewise.
3546         * traditional.c: Likewise.
3547         * ucnid.tab: Likewise.
3548         * ucnid.h: Regenerate.
3550 2009-04-01  Janis Johnson  <janis187@us.ibm.com>
3552         PR c/39027
3553         * include/cpplib.h (CPP_N_DEFAULT): Define.
3554         * expr.c (interpret_float_suffix): Recognize d or D for double,
3555         return new value for default.
3556         (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
3558         PR c/33466
3559         * expr.c (interpret_float_suffix): Reject invalid suffix that uses
3560         letters from decimal float and fixed-point suffixes.
3562 2009-03-31  Joseph Myers  <joseph@codesourcery.com>
3564         PR preprocessor/15638
3565         * files.c (_cpp_find_file): Call open_file_failed after diagnosing
3566         invalid PCH.
3567         (open_file_failed): Make error for missing file fatal.
3568         * include/cpplib.h (CPP_DL_FATAL): Define.
3570 2009-03-30  Sergiy Vyshnevetskiy  <serg@vostok.net>
3572         PR preprocessor/31932:
3573         * internal.h: Don't mention HAVE_ICONV_H.
3574         * configure, config.in: Rebuild.
3575         * configure.ac: Don't check for iconv.h.
3577 2009-03-30  Tom Tromey  <tromey@redhat.com>
3579         PR preprocessor/39512:
3580         * line-map.c (linemap_init): Initialize 'reallocator' field.
3582 2009-03-30  Jakub Jelinek  <jakub@redhat.com>
3584         PR target/39558
3585         * macro.c (cpp_get_token): If macro_to_expand returns NULL
3586         and used some tokens, add CPP_PADDING before next token.
3588 2009-03-29  Joseph Myers  <joseph@codesourcery.com>
3590         PR preprocessor/34695
3591         * makedepend.c: Remove.
3592         * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
3593         (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
3594         * directives.c (cpp_errors): Remove.
3595         * errors.c (print_location, _cpp_begin_message, v_message):
3596         Remove.
3597         (cpp_error, cpp_error_with_line): Always use error callback.
3598         (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
3599         * include/cpplib.h (cpp_options): Remove pedantic_errors,
3600         inhibit_warnings, warn_system_headers, inhibit_errors,
3601         warnings_are_errors, client_diagnostic.
3602         (cpp_callbacks): Add extra arguments to error callback; make it
3603         return bool.
3604         (cpp_finish): Return void.
3605         (cpp_destroy): Remove inaccurate comment about return value.
3606         (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
3607         (CPP_DL_NOTE): Define.
3608         * include/line-map.h (linemap_print_containing_files): Remove.
3609         * init.c (cpp_finish): Do not check for or return number of
3610         errors.
3611         * internal.h (cpp_reader): Remove errors field.
3612         * line-map.c (linemap_print_containing_files): Remove.
3613         * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
3614         about previous definition.  Only emit it if previous diagnostic
3615         was emitted.
3617 2009-03-28  Joseph Myers  <joseph@codesourcery.com>
3619         * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
3620         mkinstalldirs.
3622 2009-03-18  Jakub Jelinek  <jakub@redhat.com>
3624         * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
3626 2009-02-21  Joseph Myers  <joseph@codesourcery.com>
3628         * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
3629         header name.
3630         (_cpp_lex_direct): Handle this.
3632 2009-02-15  Richard Guenther  <rguenther@suse.de>
3634         Revert last change.
3636 2009-02-13  Richard Guenther  <rguenther@suse.de>
3638         * configure.ac: Enable LFS.
3639         * configure: Re-generate.
3640         * config.in: Likewise.
3642 2009-01-05  Ben Elliston  <bje@au.ibm.com>
3644         * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
3645         (.po.pox): Likewise.
3646         (po/$(PACKAGE).pot): Likewise.
3648 2008-12-10  Alexandre Oliva  <aoliva@redhat.com>
3650         PR target/37033
3651         * pch.c (cpp_valid_state): Improve message for poisoned symbols.
3652         Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
3654 2008-11-29  Joseph Myers  <joseph@codesourcery.com>
3656         * lex.c (cpp_token_len): Use 6 as default length.
3658 2008-10-31  Manuel López-Ibáñez  <manu@gcc.gnu.org>
3660         * expr.c (struct op): Add location.
3661         (_cpp_parse_expr): Propagate locations throught the stack
3662         of expressions.
3663         (reduce): Likewise.
3664         (check_promotion): Use explicit location in errors.
3666 2008-10-05  Matthew Gingell  <gingell@adacore.com>
3667             Arnaud Charlet  <charlet@adacore.com>
3669         * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
3670         (cpp_get_comments): New function.
3671         * internal.h (struct cpp_reader): Add comments field.
3672         * init.c (cpp_destroy): Free comments.
3673         * lex.c (store_comment, cpp_get_comments): New functions.
3674         (comments): New struct.
3675         (save_comment): Store comments in comments struct.
3677 2008-09-18  Simon Baldwin  <simonb@google.com>
3679         * include/cpplib.h (struct cpp_options): Add new boolean flag
3680         warn_builtin_macro_redefined.
3681         * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
3682         * (struct builtin_operator): Split out from previous struct builtin,
3683         enhance extra const correctness.
3684         * (struct builtin_macro): Split out from previous struct builtin, add
3685         new always_warn_if_redefined flag, enhance const correctness.
3686         * (mark_named_operators): Use struct builtin_operator.
3687         * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
3688         to builtins selectively.
3689         * macro.c (warn_of_redefinition): Return false if a builtin macro
3690         is not flagged with NODE_WARN.
3692 2008-07-31  Jakub Jelinek  <jakub@redhat.com>
3694         PR preprocessor/36649
3695         * files.c (struct report_missing_guard_data): New type.
3696         (report_missing_guard): Put paths into an array instead of printing
3697         them right away.  Return 1 rather than 0.
3698         (report_missing_guard_cmp): New function.
3699         (_cpp_report_missing_guards): Sort and print paths gathered by
3700         report_missing_guard callback.
3702 2008-07-22  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3704         PR 28079
3705         * directives.c (strtolinenum): Handle overflow.
3706         (do_line): Give a warning if line number overflowed.
3707         (do_linemarker): Update call to strtolinenum.
3709 2008-07-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3711         * include/line-map.h (linenum_type): New typedef.
3712         (struct line_map): Use it.
3713         (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
3714         (SOURCE_COLUMN): Likewise.
3715         * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
3716         source_location values in a variable of type linenum_type.
3717         * directives.c (struct if_stack): Use linenum_type.
3718         (strtoul_for_line): Rename as strtolinenum.
3719         (do_line): Use linenum_type.
3720         (do_linemarker): Use linenum_type and strtolinenum.
3721         (_cpp_do_file_change): Use linenum_t.
3722         * line-map.c (linemap_add): Likewise.
3723         (linemap_line_start): Likewise.
3724         * traditional.c (struct fun_macro): 'line' is a source_location.
3725         * errors.c (print_location): Use linenum_type.
3726         * directives-only.c (_cpp_preprocess_dir_only): Likewise.
3727         * internal.h (CPP_INCREMENT_LINE): Likewise.
3728         * lex.c (_cpp_skip_block_comment): Use source_location.
3730 2008-07-14  Ben Elliston  <bje@au.ibm.com>
3732         * include/cpplib.h (NODE_CONDITIONAL): New.
3733         (struct cpp_callbacks): New macro_to_expand field.
3734         (struct cpp_hashnode): Adjust size of flags and type fields.
3735         (cpp_peek_token): Prototype.
3736         * lex.c (cpp_peek_token): New function.
3737         (_cpp_temp_token): Protect pre-existing lookaheads.
3738         * macro.c (cpp_get_token): Expand any conditional macros.
3739         (_cpp_backup_tokens_direct): New.
3740         (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
3741         (warn_of_redefinition): Silently allow redefined conditional
3742         macros.
3743         (_cpp_create_definition): Remove the conditional flag when a user
3744         defines one of the conditional macros.
3745         * internal.h (_cpp_backup_tokens_direct): New prototype.
3747 2008-06-13  Andrew Haley  <aph@redhat.com>
3749         PR preprocessor/33305
3750         * macro.c (replace_args): Print a warning for empty macro
3751         arguments in C89 and C++.
3753 2008-06-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3755         * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
3756         * configure: Regenerate.
3758 2008-06-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3760         * Makefile.in (datarootdir): New variable.
3762 2008-06-12  H.J. Lu  <hongjiu.lu@intel.com>
3764         PR preprocessor/36479
3765         * charset.c (cpp_interpret_string_notranslate): Also set
3766         narrow_cset_desc.width.
3768 2008-06-07  Joseph Myers  <joseph@codesourcery.com>
3770         * configure.ac (parisc*64*-*-*): Remove.
3771         * configure: Regenerate.
3773 2008-05-30  Tom Tromey  <tromey@redhat.com>
3775         PR preprocessor/36320:
3776         * internal.h (_cpp_parse_expr): Update.
3777         * expr.c (_cpp_parse_expr): Add 'is_if' argument.  Update error
3778         messages.
3779         * directives.c (do_if): Update.
3780         (do_elif): Require expression if processing group.
3782 2008-05-30  Danny Smith  <dannysmith@users.sourceforge.net>
3784         * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
3786 2008-05-21  Tom Tromey  <tromey@redhat.com>
3788         PR preprocessor/27777:
3789         * lex.c (cpp_output_line_to_string): New function.
3790         * internal.h (_cpp_begin_message): Don't declare.
3791         * errors.c (_cpp_begin_message): Now static.
3792         * include/cpplib.h (cpp_output_line_to_string): Declare.
3793         * directives.c (do_diagnostic): Rewrote.  Use
3794         cpp_output_line_to_string.  Don't use _cpp_begin_message.
3796 2008-05-21  Tom Tromey  <tromey@redhat.com>
3798         * include/symtab.h (HT_ALLOCED): Remove.
3799         (ht_purge): Declare.
3800         * symtab.c (DELETED): New define.
3801         (ht_lookup): Update comment.
3802         (ht_lookup_with_hash): Handle deleted entries.  Remove HT_ALLOCED
3803         code.  Use subobject allocator for strings, if it exists.
3804         (ht_expand): Handle deleted entries.
3805         (ht_forall): Likewise.
3806         (ht_purge): New function.
3807         (ht_dump_statistics): Print deletion statistics.
3809 2008-05-13  Tom Tromey  <tromey@redhat.com>
3811         PR preprocessor/22168:
3812         * include/cpplib.h (struct cpp_options) <objc>: Update
3813         documentation.
3814         * expr.c (eval_token): Warn for use of assertions.
3815         * directives.c (directive_diagnostics): Warn about extensions.
3816         (DEPRECATED): New define.
3817         (DIRECTIVE_TABLE): Use it.
3819 2008-05-06  Tom Tromey  <tromey@redhat.com>
3821         PR preprocessor/35313, PR preprocessor/36088:
3822         * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
3823         (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
3825 2008-05-04  David S. Miller  <davem@davemloft.net>
3827         * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
3828         * configure: Regenerate.
3830 2008-04-22  Daniel Franke  <franke.daniel@gmail.com>
3832         * include/cpplib.h (cpp_define_formatted): New.
3833         * directives.c (cpp_define_formatted): New.
3835 2008-04-21  Tom Tromey  <tromey@redhat.com>
3837         PR libcpp/33415:
3838         * charset.c (_cpp_convert_input): Add buffer_start argument.
3839         Ignore UTF-8 BOM if seen.
3840         * internal.h (_cpp_convert_input): Add argument.
3841         * files.c (struct _cpp_file) <buffer_start>: New field.
3842         (destroy_cpp_file): Free buffer_start, not buffer.
3843         (_cpp_pop_file_buffer): Likewise.
3844         (read_file_guts): Update.
3846 2008-04-18  Kris Van Hees <kris.van.hees@oracle.com>
3848         * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
3849         * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
3850         (struct cpp_options): Added uliterals.
3851         (cpp_interpret_string): Update prototype.
3852         (cpp_interpret_string_notranslate): Idem.
3853         * charset.c (init_iconv_desc): New width member in cset_converter.
3854         (cpp_init_iconv): Add support for char{16,32}_cset_desc.
3855         (convert_ucn): Idem.
3856         (emit_numeric_escape): Idem.
3857         (convert_hex): Idem.
3858         (convert_oct): Idem.
3859         (convert_escape): Idem.
3860         (converter_for_type): New function.
3861         (cpp_interpret_string): Use converter_for_type, support u and U prefix.
3862         (cpp_interpret_string_notranslate): Match changed prototype.
3863         (wide_str_to_charconst): Use converter_for_type.
3864         (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
3865         * directives.c (linemarker_dir): Macro U changed to UC.
3866         (parse_include): Idem.
3867         (register_pragma_1): Idem.
3868         (restore_registered_pragmas): Idem.
3869         (get__Pragma_string): Support CPP_STRING{16,32}.
3870         * expr.c (eval_token): Support CPP_CHAR{16,32}.
3871         * init.c (struct lang_flags): Added uliterals.
3872         (lang_defaults): Idem.
3873         * internal.h (struct cset_converter) <width>: New field.
3874         (struct cpp_reader) <char16_cset_desc>: Idem.
3875         (struct cpp_reader) <char32_cset_desc>: Idem.
3876         * lex.c (digraph_spellings): Macro U changed to UC.
3877         (OP, TK): Idem.
3878         (lex_string): Add support for u'...', U'...', u"..." and U"...".
3879         (_cpp_lex_direct): Idem.
3880         * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
3881         (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
3883 2008-04-18  Paolo Bonzini  <bonzini@gnu.org>
3885         PR bootstrap/35457
3886         * aclocal.m4: Regenerate.
3887         * configure: Regenerate.
3889 2008-04-17  Tom Tromey  <tromey@redhat.com>
3891         PR libcpp/34866:
3892         * errors.c (cpp_error): Don't reference a token before the start
3893         of the current run.
3895 2008-04-16  Tom Tromey  <tromey@redhat.com>
3897         * Makefile.in (TAGS_SOURCES): New variable.
3898         (TAGS): New target.
3900 2008-04-11  Kaz Kojima  <kkojima@gcc.gnu.org>
3902         * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
3903         and shbe-*-*.
3904         * configure: Rebuilt.
3906 2008-04-02  Joseph Myers  <joseph@codesourcery.com>
3908         * include/cpplib.h (struct cpp_callbacks): Add used_define,
3909         used_undef and before_define.
3910         (NODE_USED): Define.
3911         * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
3912         do_ifndef, cpp_pop_definition): Handle new flag and use new
3913         callbacks.
3914         * expr.c (parse_defined): Handle new flag and use new callbacks.
3915         * macro.c (enter_macro_context, _cpp_free_definition): Handle new
3916         flag and use new callbacks.
3918 2008-04-01  Jakub Jelinek  <jakub@redhat.com>
3920         PR pch/13675
3921         * files.c (struct _cpp_file): Remove pch field.
3922         (pch_open_file): Don't set file->pch, just file->pchname.
3923         (should_stack_file): After pfile->cb.read_pch call
3924         free pchname and clear pchname, don't close file->fd.
3925         Test file->pchname instead of file->pch.  Don't close fd after cb.
3926         (_cpp_stack_include): Test file->pchname instead of file->pch.
3928 2008-03-28  Tom Tromey  <tromey@redhat.com>
3930         * Makefile.in (POSTCOMPILE): New variable.
3931         (.c.o): Use it.
3933 2008-03-13  Tom Tromey  <tromey@redhat.com>
3935         PR libcpp/35322:
3936         * directives.c (destringize_and_run): Set pfile->directive.
3938 2008-03-06  Markus Milleder  <markus.milleder@generali.at>
3940         PR preprocessor/35458
3941         * mkdeps.c (munge): Quote '#' with a '\'.
3943 2008-02-27  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3945         PR preprocessor/35379
3946         * mkdeps.c (deps_write): Ensure the first target always appears
3947         in the first column, without leading backslash newline.  Avoid
3948         some more extra whitespace.
3950 2008-02-25  Thiemo Seufer <ths@mips.com>
3952         * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
3954 2008-02-19  Tom Tromey  <tromey@redhat.com>
3956         * traditional.c (lex_identifier): Use CPP_HASHNODE.
3957         * lex.c (lex_identifier): Use CPP_HASHNODE.
3958         * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
3959         do-while.
3960         * identifiers.c (alloc_node): Change return type.
3961         (_cpp_init_hashtable): Don't cast 'alloc_node'.
3962         (proxy_assertion_broken): New declaration.
3963         (cpp_forall_identifiers): Move comment.
3964         * line-map.c (linemap_add): Comment fix.
3965         (linemap_line_start): Indentation fix.
3967 2008-01-25  Jakub Jelinek  <jakub@redhat.com>
3969         PR preprocessor/34692
3970         * macro.c (collect_args): Add pragma_buff argument.  Push
3971         CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
3972         than into arguments.  Reset prevent_expansion and parsing_args
3973         state at CPP_PRAGMA_EOL/CPP_EOF.
3974         (funlike_invocation_p): Add pragma_buff argument, pass it through
3975         to collect_args.
3976         (enter_macro_context): Add result argument.  Adjust
3977         funlike_invocation_p caller.  Emit all deferred pragma tokens
3978         gathered during collect_args before the expansion, add a padding
3979         token.  Return 2 instead of 1 if any pragma tokens were prepended.
3980         (cpp_get_token): If enter_macro_context returns 2, don't return
3981         a padding token, instead cycle to grab CPP_PRAGMA token.
3982         * directives.c (_cpp_handle_directive): If was_parsing_args
3983         in deferred pragma, leave parsing_args and prevent_expansion as is.
3985 2008-01-22  Tom Tromey  <tromey@redhat.com>
3987         PR c++/34859
3988         * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
3989         __STDC_CONSTANT_MACROS.
3991 2008-01-07  Fred Fish  <fnf@specifix.com>
3993         PR preprocessor/30363
3994         * traditional.c (replace_args_and_push): Add local variable
3995         cxtquote, calculate the replacement text size assuming a
3996         worst case of every input character quoted with backslash,
3997         and properly handle output quoting of quote characters in
3998         actual arguments used in function-like macros.
4000 2008-01-03  Tom Tromey  <tromey@redhat.com>
4002         PR preprocessor/34602
4003         * directives.c (do_line): Don't try to spell EOF token.
4004         (do_linemarker): Add comment.
4006 2007-12-11  DJ Delorie  <dj@redhat.com>
4008         * charset.c (convert_using_iconv): Close out any shift states,
4009         returning to the initial state.
4011 2007-12-06  Tom Tromey  <tromey@redhat.com>
4013         PR c/29172
4014         * internal.h (struct cpp_reader) <file_hash_entries>: Changed
4015         type.
4016         <file_hash_entries_allocated, file_hash_entries_used>: Removed.
4017         * files.c (FILE_HASH_POOL_SIZE): New macro.
4018         (struct file_hash_entry_pool): New.
4019         (destroy_all_cpp_files): New function.
4020         (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
4021         (new_file_hash_entry): Update.
4022         (free_file_hash_entries): New function.
4023         (_cpp_cleanup_files): Call free_file_hash_entries and
4024         destroy_all_cpp_files.
4025         (cpp_clear_file_cache): New function.
4026         * include/cpplib.h (cpp_clear_file_cache): Declare.
4028 2007-12-03  Tom Tromey  <tromey@redhat.com>
4030         PR preprocessor/34288
4031         * configure.ac, config.in: Rebuilt.
4032         * configure.ac: Check for ssize_t.
4034 2007-11-30  Tom Tromey  <tromey@redhat.com>
4036         PR preprocessor/32868
4037         * macro.c (_cpp_create_definition): Special case
4038         __STDC_FORMAT_MACROS.
4040 2007-11-16  Michael Matz  <matz@suse.de>
4042         * files.c (search_path_head): Fix check for absolute paths.
4044 2007-11-11  Tom Tromey  <tromey@redhat.com>
4046         PR c++/17557
4047         * include/cpplib.h (cpp_included_before): Declare.
4048         * files.c (struct file_hash_entry) <location>: New field.
4049         (_cpp_find_file): Initialize new field.
4050         (make_cpp_dir): Likewise.
4051         (cpp_included_before): New function.
4053 2007-11-01  Tom Tromey  <tromey@redhat.com>
4055         PR preprocessor/30805
4056         * macro.c (paste_tokens): Handle padding token.
4057         (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
4059 2007-10-31  Tom Tromey  <tromey@redhat.com>
4061         PR preprocessor/30786
4062         * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
4063         * directives.c (_cpp_do__Pragma): Return error status.
4064         * internal.h (_cpp_do__Pragma): Update.
4065         * directives.c (get__Pragma_string): Back up if EOF seen.
4067 2007-09-06  Tom Tromey  <tromey@redhat.com>
4069         * internal.h (struct cpp_reader) <invocation_location>: New
4070         field.
4071         (struct cpp_reader) <set_invocation_location>: Likewise.
4072         * init.c (cpp_set_line_map): New function.
4073         * line-map.c (linemap_add): Use linemap's allocator.
4074         * include/line-map.h (GTY): Define.
4075         (line_map_realloc): New typedef.
4076         (struct line_map): Mark with GTY.
4077         (struct line_maps): Likewise.
4078         (struct line_maps) <maps>: Likewise.
4079         (struct line_maps) <reallocator>: New field.
4080         * include/symtab.h (GTY): Conditionally define.
4081         * include/cpplib.h (cpp_set_line_map): Declare.
4082         (cpp_get_token_with_location): Declare.
4083         * macro.c (cpp_get_token): Set invocation_location on the reader.
4084         (cpp_get_token_with_location): New function.
4086 2007-08-30  Chao-ying Fu  <fu@mips.com>
4088         * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
4089         ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
4090         (cpp_classify_number): Support decimal fixed-point constants without
4091         exponents.
4092         Warn about fixed-point constants when -pedantic.
4093         * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
4094         comments to support fixed-point values.
4095         (CPP_N_FRACT, CPP_N_ACCUM): Define.
4097 2007-08-18  Tom Tromey  <tromey@redhat.com>
4099         PR preprocessor/32974
4100         * directives.c (parse_include): Don't check for EOL when
4101         processing #pragma dependency.
4103 2007-07-30  Ollie Wild  <aaw@google.com>
4105         * directives-only.c: New file.
4106         * internal.h (struct _cpp_dir_only_callbacks): New.
4107         (_cpp_preprocess_dir_only): New function.
4108         * directives.c (_cpp_handle_directive): Check directives_only before
4109         disabling execution of indented directives.
4110         * files.c (_cpp_stack_file): Add directives_only check.
4111         * include/cpplib.h (struct cpp_options): Add directives_only.
4112         (cpp_init_special_builtins): New function.
4113         * init.c (cpp_init_special_builtins): New function.
4114         (cpp_init_builtins): Move builtin_array initialization to
4115         cpp_init_special_builtins.
4116         (post_options): Check directives_only before setting
4117         pfile->state.prevent_expansion = 1.
4118         * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
4119         is expanded inside a directive while -fdirectives-only is enabled.
4120         * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
4121         (libcpp_a_SOURCES): Add directives-only.c.
4123 2007-07-04  Uros Bizjak  <ubizjak@gmail.com>
4125         * traditional.c (_cpp_scan_out_logical_line): Initialize
4126         fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
4127         fmacro.args to prevent 'may be used uninitialized' warning.
4129 2007-07-03  Uros Bizjak  <ubizjak@gmail.com>
4131         * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
4132         Add new constants.
4133         * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
4134         suffixes.  Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
4135         for 'q' or 'Q' suffixes.
4137 2007-06-17  Danny Smith  <dannysmith@users.sourceforge.net
4139         * files.c (open_file): Correct typo.
4141 2007-06-16  Vladimir Prus  <vladimir@codesourcery.com>
4143         * files.c (open_file): Prevent the call
4144         for stat from overwriting errno.
4146 2007-06-09  Vladimir Prus  <vladimir@codesourcery.com>
4148         * files.c (open_file): Account for the
4149         fact that on windows, opening a directory gives
4150         EACCES.
4152 2007-06-05  Joerg Wunsch  <j.gnu@uriah.heep.sax.de>
4154         PR preprocessor/23479
4155         * expr.c (cpp_classify_number): Implement 0b-prefixed binary
4156         integer constants.
4157         (append_digit): Likewise.
4158         * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
4159         binary integer constants.
4161 2007-05-31  Dave Korn  <dave.korn@artimi.com>
4163         PR preprocessor/14331
4164         * lex.c (_cpp_get_fresh_line):  Don't warn if no newline at EOF.
4166 2007-05-24  Ollie Wild  <aaw@google.com>
4168         * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
4169         * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
4170         (cpp_write_pch_state): Save __COUNTER__ state.
4171         (cpp_valid_state): Check valid __COUNTER__ state.
4172         (cpp_read_state): Read new __COUNTER__ state.
4173         * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
4174         * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
4175         * internal.h (struct cpp_reader): Add counter member.
4177 2007-05-23  Simon Martin  <simartin@users.sourceforge.net>
4179         PR preprocessor/20077
4180         * macro.c (create_iso_definition): Fixed the method to determine
4181         whether the token-pasting operator appears at the beginning or the end
4182         of a macro.
4184 2007-05-21  Ian Lance Taylor  <iant@google.com>
4186         * internal.h (struct cpp_reader): Add new fields:
4187         nonexistent_file_hash and nonexistent_file_ob.
4188         * files.c: Include "obstack.h".
4189         (find_file_in_dir): Before trying to open the file, look up the
4190         path name in the hash table of nonexistent files.  After failing
4191         to open the file, add the path name to the hash table.
4192         (_cpp_find_file): Cache the results of looking up the file name
4193         starting with the quote and bracket chain heads, if we can.
4194         (nonexistent_file_hash_eq): New static function.
4195         (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
4196         pfile->nonexistent_file_ob.
4197         (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
4198         pfile->nonexistent_file_ob.
4200 2007-05-14  Janis Johnson  <janis187@us.ibm.com>
4202         * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
4204         PR c/31924
4205         * expr.c (interpret_float_suffix): Check for invalid suffix.
4207 2007-05-02  Eric Christopher  <echristo@apple.com>
4209         * expr.c (num_div_op): Don't overflow if the result is
4210         zero.
4212 2007-05-02  Tom Tromey  <tromey@redhat.com>
4214         PR preprocessor/28709
4215         * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
4217 2007-03-30  Michael Meissner  <michael.meissner@amd.com>
4219         * directives.c (lex_macro_node_from_str): Fix alloca call to be
4220         type correct.
4222 2007-03-30  Richard Henderson  <rth@redhat.com>
4224         * directives.c (lex_macro_node_from_str): New.
4225         (cpp_push_definition, cpp_pop_definition): New.
4226         * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
4228 2007-03-01  Brooks Moses  <brooks.moses@codesourcery.com>
4230         * Makefile.in: Add dummy install-pdf target.
4232 2007-01-30  Tom Tromey  <tromey@redhat.com>
4234         PR preprocessor/30468
4235         * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
4236         './'.
4238 2007-01-30  Tom Tromey  <tromey@redhat.com>
4240         PR preprocessor/29966
4241         * macro.c (lex_expansion_token): Save and restore cpp_reader's
4242         cur_token.
4243         (_cpp_create_definition): Don't restore cur_token here.
4244         * lex.c (_cpp_lex_token): Added assertion.
4246 2007-01-27  Tom Tromey  <tromey@redhat.com>
4248         * configure: Rebuilt.
4250 2007-01-12  Tom Tromey  <tromey@redhat.com>
4252         PR preprocessor/28227
4253         * directives.c (lex_macro_node): Added 'is_def_or_undef'
4254         argument.
4255         (do_define): Update.
4256         (do_undef): Update.
4257         (do_ifdef): Update.
4258         (do_ifndef): Update.
4260 2007-01-11  Paolo Bonzini  <bonzini@gnu.org>
4262         * configure: Regenerate.
4264 2007-01-11  Paolo Bonzini  <bonzini@gnu.org>
4266         * configure: Regenerate.
4268 2007-01-04  Tom Tromey  <tromey@redhat.com>
4270         PR preprocessor/28165
4271         * internal.h (cpp_in_primary_file): New function.
4272         * directives.c (do_include_next): Use cpp_in_primary_file.
4273         (do_pragma_once): Likewise.
4274         (do_pragma_system_header): Likewise.
4276 2006-12-29  Ian Lance Taylor  <iant@google.com>
4278         * lex.c (_cpp_clean_line): Add uses of __builtin_expect.  Don't
4279         look backward at the end of the line unless we saw a backslash.
4281 2006-12-29  Jakub Jelinek  <jakub@redhat.com>
4283         PR preprocessor/29612
4284         * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
4285         only when new_sysp is non-zero.
4287 2006-12-28  Tom Tromey  <tromey@redhat.com>
4289         PR preprocessor/30001
4290         * charset.c (_cpp_convert_input): Check that to.len is greater
4291         than zero.
4293 2006-11-20  Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
4295         * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
4296         * configure: Rebuilt.
4298 2006-11-01      Douglas Gregor <doug.gregor@gmail.com>
4300         * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
4301         for experimental C++0x mode.
4302         * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
4303         adopted the preprocessor changes introduced in C99.
4305 2006-10-29  Joseph Myers  <joseph@codesourcery.com>
4307         * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
4308         depending on --enable-targets=all.
4309         * configure: Regenerate.
4311 2006-10-12  Jakub Jelinek  <jakub@redhat.com>
4313         PR preprocessor/28709
4314         * macro.c (paste_tokens): Do error reporting here, use BUF with the
4315         spelled LHS token as opposed to spelling it again.
4316         (paste_all_tokens): Don't report errors here, just break on failure.
4318 2006-10-10  Brooks Moses  <bmoses@stanford.edu>
4320         * Makefile.in: Added empty "pdf" target.
4322 2006-09-22  Geoffrey Keating  <geoffk@apple.com>
4324         * configure.ac: Make need_64_bit_hwint case for x86-darwin
4325         match exactly the glob in gcc/config.gcc.
4326         * configure: Regenerate.
4328 2006-09-13  Joseph S. Myers  <joseph@codesourcery.com>
4330         PR c/28768
4331         PR preprocessor/14634
4332         * lex.c (lex_string): Pedwarn for unterminated literals.
4334 2006-09-08  Eric Christopher  <echristo@apple.com>
4336         * configure.ac: Add 64-bit HWI support for i?86-darwin.
4338 2006-08-14  Steve Ellcey  <sje@cup.hp.com>
4340         PR c++/28288
4341         PR c++/14556
4342         * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
4343         (CPP_LAST_EQ): Change.
4344         (CPP_LAST_PUNCTUATOR): Change.
4345         * expr.c (cpp_operator): Remove MIN and MAX.
4346         (reduce): Remove CPP_MIN and CPP_MAX.
4347         (num_binary_op): Ditto.
4348         * lex.c (_cpp_lex_direct): Ditto.
4349         (cpp_avoid_paste): Remove ? as legal symbol after > or <.
4351 2006-06-09  Jakub Jelinek  <jakub@redhat.com>
4353         PR preprocessor/27746
4354         * directives.c (do_pragma): Handle pragma with valid namespace
4355         and invalid name coming from macro expansion.
4356         * directives.c (destringize_and_run): Initialize next field in
4357         context.
4359         PR c/27747
4360         PR c++/27748
4361         * directives.c (destringize_and_run): Set NO_EXPAND on the
4362         tokens.
4364         * macro.c (_cpp_backup_tokens): Fix comment typo.
4366 2006-05-31  Daniel Jacobowitz  <dan@codesourcery.com>
4368         * Makefile.in (CATALOGS): Add po/ prefix.
4369         * configure: Regenerated.
4371 2006-05-23  Carlos O'Donell  <carlos@codesourcery.com>
4373         * Makefile.in: Add install-html target. Add install-html to .PHONY
4375 2006-02-17  Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
4377         * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
4378         * files.c (_cpp_get_file_stat): New function.
4379         * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
4380         * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
4381         * internal.h (_cpp_get_file_stat): Prototype.
4382         (struct cpp_buffer): Add timestamp.
4384 2006-01-23  Jakub Jelinek  <jakub@redhat.com>
4386         PR preprocessor/25717
4387         * init.c (cpp_init_builtins): If __STDC__ will not change value
4388         between system headers and other sources, define it as a normal
4389         macro rather than a builtin.
4390         * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
4391         cpp_in_system_header condition.
4393 2006-01-05  Paolo Bonzini  <bonzini@gnu.org>
4395         * Makefile.in: Use -MMD instead of -MD.
4397 2006-01-04  Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
4398             Richard Henderson  <rth@redhat.com>
4400         Merge from gomp branch:
4401         * directives.c (struct pragma_entry): Add is_deferred.  Add ident
4402         entry to value union.
4403         (end_directive): Don't eat the line if in_deferred_pragma.
4404         (run_directive): Remove pragma hacks.
4405         (insert_pragma_entry): Remove.
4406         (new_pragma_entry): New.
4407         (register_pragma_1): Split out of register_pragma.  Only handle
4408         the lookup tree and return the new entry.
4409         (cpp_register_pragma): Fill in the pragma entry here.
4410         (cpp_register_deferred_pragma): New.
4411         (register_pragma_internal): New.
4412         (_cpp_init_internal_pragmas): Use register_pragma_internal.
4413         (do_pragma): Allow pragma expansion after namespace.  For deferred
4414         pragmas, don't slurp the line into a string.
4415         (destringize_and_run): Save tokens for deferred pragmas.
4416         (cpp_handle_deferred_pragma): Remove.
4417         * macro.c (builtin_macro): Remove pragma token hack.
4418         (_cpp_push_token_context): Rename from push_token_context and export.
4419         * internal.h (struct lexer_state): Add pragma_allow_expansion.
4420         (_cpp_push_token_context): Declare.
4421         * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
4422         a token.  Update the line number correctly if so.
4423         (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
4424         (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
4425         * include/cpplib.h (PRAGMA_EOL): New.
4426         (CPP_TOKEN_FLD_PRAGMA): New.
4427         (struct cpp_token): Add val.pragma.
4428         (struct cpp_options): Remove defer_pragmas.
4429         (cpp_handle_deferred_pragma): Remove.
4430         (cpp_register_deferred_pragma): Declare.
4432 2006-01-01  Jakub Jelinek  <jakub@redhat.com>
4434         PR c++/25294
4435         * directives.c (do_pragma): If pragma line ends with multi-line
4436         block comment, end the saved deferred pragma string before that
4437         comment.  Handle embedded '\0' chars on the pragma line.
4439 2005-12-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
4441         PR c++/23333
4442         * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
4444 2005-12-07  Jon Grimm  <jgrimm2@us.ibm.com>
4445             Ben Elliston  <bje@au.ibm.com>
4447         * include/cpplib.h (CPP_N_DFLOAT): New.
4448         * expr.c (interpret_float_suffix): Identify df, dd, and dl
4449         suffixes as decimal floating point constants.
4450         (cpp_classify_number): Disallow hexadecimal DFP constants.
4452 2005-11-14  Gerald Pfeifer  <gerald@pfeifer.com>
4453             Ian Lance Taylor  <ian@airs.com>
4455         * include/cpplib.h (struct cpp_callbacks): Annotate error with
4456         ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
4458 2005-11-09  Per Bothner  <per@bothner.com>
4459             Uros Bizjak  <uros@kss-loka.si>
4461         PR c/24101
4462         * init.c (read_original_filename): Temporarily set
4463         state.in_directive before calling _cpp_lex_direct for
4464         CPP_HASH tokens.
4466 2005-11-03  James E Wilson  <wilson@specifix.com>
4468         PR preprocessor/24202
4469         * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
4471 2005-11-04  Joseph S. Myers  <joseph@codesourcery.com>
4473         * include/cpplib.h (struct cpp_callbacks): Make error take
4474         va_list* parameter.
4475         * errors.c (cpp_error): Update call to callback.
4477 2005-11-03  Andrew Pinski  <pinskia@physics.uc.edu>
4479         PR preprocessor/22042
4480         * macro.c (_cpp_builtin_macro_text): Lower the needed max
4481         buffer size.
4482         (cpp_quote_string): Don't octalify non printable
4483         charactors.
4485 2005-11-03  Joseph S. Myers  <joseph@codesourcery.com>
4487         PR c++/17964
4488         * include/cpplib.h (struct cpp_options): Add client_diagnostic.
4489         (struct cpp_callbacks): Add error.
4490         * errors.c (cpp_error): If client_diagnostic, use error callback.
4491         * charset.c (convert_escape): Don't use %03o in diagnostic.
4493 2005-10-21  James E Wilson  <wilson@specifix.com>
4495         PR preprocessor/15220
4496         * files.c (_cpp_find_file): New parameter angle_brackets.  Fix all
4497         callers.  Pass to open_file_failed.
4498         (open_file_failed): New parameter angle_brackets.  Fix all callers.
4499         Use in print_dep assignment.
4500         * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
4501         * internal.h (_cpp_find_file): Add new parm to declaration.
4503 2005-10-08  Kazu Hirata  <kazu@codesourcery.com>
4505         * configure.ac: Require 64-bit int for arm*-*-*eabi*.
4506         * configure: Regenerate.
4508 2005-10-04  Ian Lance Taylor  <ian@airs.com>
4510         PR preprocessor/13726
4511         * directives.c (check_eol_return_comments): New static function.
4512         (parse_include): Add buf parameter.  Change all callers.
4513         (do_include_common): If not discard comments, turn on
4514         save_comments.  Pass collected comments to include callback.
4515         * include/cpplib.h (struct cpp_callbacks): Add new parameter to
4516         include callback: cpp_token list.
4518 2005-09-20  Joseph S. Myers  <joseph@codesourcery.com>
4520         * include/cpplib.h (struct cpp_options): Add extended_identifiers.
4521         * init.c (struct lang_flags, lang_defaults): Add
4522         extended_identifiers.
4523         (cpp_set_lang): Use it.
4524         * lex.c (forms_identifier_p): Check extended_identifiers.
4526 2005-08-30  Jakub Jelinek  <jakub@redhat.com>
4528         PR preprocessor/20348
4529         PR preprocessor/20356
4530         * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
4531         2004-06-05 changes.
4533 2005-07-23  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4535         * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
4536         -Wmissing-format-attribute.
4538         * configure: Regenerate.
4540 2005-06-29  Kelley Cook  <kcook@gcc.gnu.org>
4542         * all files: Update FSF address in copyright headers.
4543         * makeucnid.c (write_copyright): Update outputted FSF address.
4545 2005-06-13  Zack Weinberg  <zack@codesourcery.com>
4547         * configure.ac: Invoke ZW_CREATE_DEPDIR and
4548         ZW_PROG_COMPILER_DEPENDENCIES.
4549         * aclocal.m4, configure: Regenerate.
4550         * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
4551         New variables.
4552         (distclean): Clean up $(DEPDIR) and its contents.
4553         (.c.o): Use $(COMPILE).
4554         Include $(DEPDIR)/*.Po for most object->header dependencies.
4556 2005-05-28  Gabriel Dos Reis  <gdr@integrable-solutions.net>
4558         * configure.ac: Check declarations for asprintf and vasprintf.
4559         * config.in: Regenerate.
4560         * configure: Likewise.
4562         * charset.c (conversion_loop): Use XRESIZEVEC.
4563         (convert_no_conversion): Likewise.
4564         (convert_using_iconv): Likewise.
4565         (init_iconv_desc): Cast return value of alloca.
4566         (cpp_host_to_exec_charset): Use XNEWVEC.
4567         (emit_numeric_escape): Use XRESIZEVEC.
4568         (cpp_interpret_string): Use XNEWVEC.
4569         (cpp_interpret_string): Use XRESIZEVEC.
4570         (_cpp_interpret_identifier): Cast return value of alloca.
4571         (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
4572         * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
4573         (parse_include): Use XNEWVEC.
4574         (insert_pragma_entry): Rename local variable "new" to
4575         "new_entry".
4576         (save_registered_pragmas): Cast return value of xmemdup.
4577         (destringize_and_run): Same for alloca.
4578         (parse_assertion): Likewise.
4579         (do_assert): Cast allocated storage to proper type.
4580         (cpp_define): Likewise.
4581         (_cpp_define_builtin): Likewise.
4582         (cpp_undef): Likewise.
4583         (handle_assertion): Likewise.
4584         (cpp_push_buffer): Rename local variable "new" to "new_buffer".
4585         * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
4586         (CPP_UMINUS): Likewise.
4587         (struct cpp_operator): Rename from struct operator.
4588         (_cpp_expand_op_stack): Use XRESIZEVEC.
4589         * files.c (pch_open_file): Use XNEWVEC.
4590         (pch_open_file): Use XRESIZEVEC.
4591         (read_file_guts): Use XNEWVEC and XRESIZEVEC.
4592         (dir_name_of_file): Use XNEWVEC.
4593         (make_cpp_file): Use XCNEW.
4594         (make_cpp_dir): Likewise.
4595         (allocate_file_hash_entries): USE XNEWVEC.
4596         (cpp_included): Cast return value of htab_find_with_hash.
4597         (append_file_to_dir): Use XNEWVEC.
4598         (read_filename_string): Likewise. Use XRESIZEVEC too.
4599         (read_name_map): Cast return value of alloca.  Use XRESIZEVEC.
4600         (remap_filename): Use XNEWVEC.
4601         (struct pchf_entry): Move definition out of struct pchf_data.
4602         (_cpp_save_file_entries): Use XCNEWVAR.
4603         (_cpp_read_file_entries): Use XNEWVAR.
4604         * identifiers.c (alloc_node): Use XOBNEW.
4605         * init.c (cpp_create_reader): Use XCNEW.
4606         (cpp_init_builtins): Cast of b->value to enum builtin_type.
4607         (read_original_directory): Cast return value of alloca.
4608         * lex.c (add_line_note): Use XRESIZEVEC.
4609         (warn_about_normalization): Use XNEWVEC.
4610         (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
4611         (new_buff): Use XNEWVEC.
4612         * line-map.c (linemap_add): Use XRESIZEVEC.
4613         * macro.c (builtin_macro): Cast return value of alloca.
4614         (paste_tokens): Likewise.
4615         (expand_arg): Use XNEWVEC and XRESIZEVEC.
4616         (_cpp_save_parameter): Use XRESIZEVEC.
4617         (create_iso_definition): Cast allocated storage to proper type.
4618         (_cpp_create_definition): Likewise.
4619         (cpp_macro_definition): Use XRESIZEVEC.
4620         * makedepend.c (add_clm): Use XNEW.
4621         (add_dir): Likewise.
4622         * mkdeps.c (munge): Use XNEWVEC.
4623         (deps_init): Use XCNEW.
4624         (deps_add_target): Use XRESIZEVEC.
4625         (deps_add_default_target): Cast return value of alloca.
4626         (deps_add_dep): Use XRESIZEVEC.
4627         (deps_add_vpath): Likewise.  Use XNEWVEC too.
4628         (deps_restore): Likewise.
4629         * pch.c (save_idents): Use XNEW and XNEWVEC.
4630         (cpp_save_state): Use XNEW.
4631         (count_defs): Cast return value of htab_find.
4632         (write_defs): Likewise.
4633         (cpp_write_pch_deps): Use XNEWVEC.
4634         (collect_ht_nodes): Use XRESIZEVEC.
4635         (cpp_valid_state): Use XNEWVEC.
4636         (save_macros): Use XRESIZEVEC.  Cast return value of xmemdup.
4637         * symtab.c (ht_create): Use XCNEW.
4638         (ht_lookup_with_hash): Cast return value of obstack_copy0.
4639         (ht_expand): Use XCNEWVEC.
4640         * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
4641         (bool): Do not define if __cplusplus.
4643 2005-05-12  Zack Weinberg  <zack@codesourcery.com>
4645         * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
4646         (do_sccs): Delete function definition, #define to do_ident.
4647         (do_ident): Don't hardwire directive name.
4649 2005-05-12  Ryota Kunisawa  <kunisawa@access.co.jp>
4651         PR bootstrap/21230
4652         * configure: Regenerate.
4654 2005-04-27  Andris Pavenis  <pavenis@latnet.lv>
4656         * files.c: Include io.h for DJGPP to get prototype of setmode.
4658 2005-04-19  Per Bothner  <per@bothner.com>
4660         PR preprocessor/20907
4661         * line-map.c (linemap_line_start): Fix bug when we need to increse
4662         column_bits but can re-use the current line_map.
4664 2005-04-19  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4666         * system.h (fopen, fdopen, freopen): Define these to the unlocked
4667         libiberty functions.
4669 2005-04-11  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4671         * configure.ac (libcpp_UNLOCKED_FUNCS): New.
4672         (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
4673         * system.h (putchar, getc, getchar, clearerr, feof, fileno,
4674         fflush, fgetc, fgets, ferror, fread): Redefine to the associated
4675         _unlocked function.
4676         (fwrite_unlocked): Fix prototype.
4678         * configure, config.in: Regenerate.
4680 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
4682         PR preprocessor/19475
4683         * macro.c (create_iso_definition): For < ISO C99, don't
4684         pedwarn if there is no whitespace between macro name and its
4685         replacement, but the replacement starts with a basic character
4686         set character.
4688 2005-03-28  Andreas Jaeger  <aj@suse.de>
4690         * lex.c (warn_about_normalization): Cast field width to int to
4691         avoid warning.
4693 2005-03-19  Joseph S. Myers  <joseph@codesourcery.com>
4695         * configure.ac: Consistently use solaris2.1[0-9]* instead of
4696         solaris2.1[0-9].
4697         * configure: Regenerate.
4699 2005-03-15  Geoffrey Keating  <geoffk@apple.com>
4701         * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
4702         UCN rather than printing an error.
4704 2005-03-14  Geoffrey Keating  <geoffk@apple.com>
4706         * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
4708 2005-03-14  Geoffrey Keating  <geoffk@apple.com>
4710         * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
4711         * charset.c: Update for new format of ucnid.h.
4712         (ucn_valid_in_identifier): Update for new format of ucnid.h.
4713         Add NST parameter, and update it; update callers.
4714         (cpp_valid_ucn): Add NST parameter, update callers.  Replace abort
4715         with cpp_error.
4716         (convert_ucn): Pass normalize_state to cpp_valid_ucn.
4717         * internal.h (struct normalize_state): New.
4718         (INITIAL_NORMALIZE_STATE): New.
4719         (NORMALIZE_STATE_RESULT): New.
4720         (NORMALIZE_STATE_UPDATE_IDNUM): New.
4721         (_cpp_valid_ucn): New.
4722         * lex.c (warn_about_normalization): New.
4723         (forms_identifier_p): Add normalize_state parameter, update callers.
4724         (lex_identifier): Add normalize_state parameter, update callers.  Keep
4725         the state current.
4726         (lex_number): Likewise.
4727         (_cpp_lex_direct): Pass normalize_state to subroutines.  Check
4728         it with warn_about_normalization.
4729         * makeucnid.c: New.
4730         * ucnid.h: Replace.
4731         * ucnid.pl: Remove.
4732         * ucnid.tab: Make appropriate for input to makeucnid.c.  Remove
4733         comments about obsolete version of C++.
4734         * include/cpplib.h (enum cpp_normalize_level): New.
4735         (struct cpp_options): Add warn_normalize field.
4737 2005-03-11  Geoffrey Keating  <geoffk@apple.com>
4739         * directives.c (glue_header_name): Update call to cpp_spell_token.
4740         * internal.h (_cpp_interpret_identifier): New.
4741         * charset.c (_cpp_interpret_identifier): New.
4742         (_cpp_valid_ucn): Allow UCN version of '$'.
4743         * lex.c (lex_identifier): Add extra parameter to indicate if initial
4744         character was '$' or '\'.  Support identifiers with UCNs.
4745         (forms_identifier_p): Allow UCNs.
4746         (_cpp_lex_direct): Pass extra parameter to lex_identifier.
4747         (utf8_to_ucn): New.
4748         (cpp_spell_token): Add FORSTRING parameter.  Use it.
4749         (cpp_token_as_text): Update call to cpp_spell_token.
4750         (cpp_output_token): Write UCNs back out.
4751         (stringify_arg): Update call to cpp_spell_token.
4752         (paste_tokens): Likewise.
4753         (cpp_macro_definition): Likewise.
4754         * macro.c (stringify_arg): Likewise.
4755         (paste_tokens): Likewise.
4756         (cpp_macro_definition): Likewise.
4757         * include/cpplib.h: Add parameter to cpp_spell_token.
4759 2005-03-04  Jakub Jelinek  <jakub@redhat.com>
4761         PR bootstrap/20282
4762         PR bootstrap/20305
4763         * macro.c (replace_args, cpp_get_token): Copy whole
4764         cpp_token_u instead of just cpp_string field from it.
4766 2005-02-28  Devang Patel  <dpatel@apple.com>
4768         * directives.c (do_line): Save sysp early before line table is
4769         realloc'ed.
4771 2005-02-20  Zack Weinberg  <zack@codesourcery.com>
4773         PR 18785
4774         * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
4775         (cpp_host_to_exec_charset): New function.
4776         * include/cpplib.h: Declare cpp_host_to_exec_charset.
4778 2005-02-19  Devang Patel  <dpatel@apple.com>
4780         * charset.c (_cpp_convert_input): Check '\r' before inserting
4781         '\n' at the end.
4783 2005-02-15  Eric Christopher  <echristo@redhat.com>
4785         PR preprocessor/19077
4786         * macro.c (cpp_macro_definition): Move handling of whitespace
4787         to PREV_WHITE conditional. Remove overloading of len
4788         variable.
4790 2005-02-14  Kazu Hirata  <kazu@cs.umass.edu>
4792         * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
4793         traditional.c: Update copyright.
4795 2005-02-14  Paolo Bonzini  <bonzini@gnu.org>
4797         PR bootstrap/19818
4798         * configure.ac: Check for declaration of basename and getopt.
4799         * config.in: Regenerate.
4800         * configure: Regenerate.
4801         * internal.h (ustrcspn): New.
4802         * macro.c (create_iso_definition): Fix allocation of memory.
4803         (padding_token): Add cast to remove const-ness.
4804         * pch.c (cpp_read_state): Use ustrcspn.
4806 2005-02-08  Mike Stump  <mrs@apple.com>
4808         * files.c (pchf_adder): Remove.
4809         (struct pchf_adder_info): Likewise.
4810         (_cpp_save_file_entries): Write out all files so that #import works.
4812 2005-01-23  Joseph S. Myers  <joseph@codesourcery.com>
4814         * configure: Regenerate.
4816 2005-01-11  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
4818         * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
4820         * include/cpplib.h: Also update copyright years.
4822 2005-01-03  Geoffrey Keating  <geoffk@apple.com>
4824         * files.c (_cpp_find_file): Add files found by search_path_exhausted
4825         to the list of all files.
4827 2005-01-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
4829         * internal.h: Update references to Cpp lib filenames.
4830         * directives.c: Likewise.
4831         * init.c: Likewise.
4832         * macro.c: Likewise.
4833         * traditional.c: Likewise.
4835 2004-12-15  Eric Botcazou  <ebotcazou@libertysurf.fr>
4837         PR preprocessor/15167
4838         * files.c (destroy_cpp_file): New function.
4839         (should_stack_file): Make a new file if the
4840         compared file is still stacked.
4842 2004-11-28  Nathanael Nerode  <neroden@gcc.gnu.org>
4844         PR preprocessor/17610
4845         * directives.c (do_include_common): Error out if an empty filename
4846         is given for #include (or #include_next or #import).
4848 2004-11-27  Roger Sayle  <roger@eyesopen.com>
4849             Zack Weinberg  <zack@codesourcery.com>
4851         * internal.h: Replace all uses of uchar with unsigned char.
4852         * include/cpp-id-data.h: Likewise.  Guard typedef of uchar
4853         with !IN_GCC, so uchar is only defined whilst building libcpp.
4855 2004-11-24  Kelley Cook  <kcook@gcc.gnu.org>
4857         * aclocal.m4: Regenerate.
4859 2004-11-24  Roger Sayle  <roger@eyesopen.com>
4861         PR preprocessor/15824
4862         * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
4863         directly, instead of the non-existant "system.h" and "ansidecl.h".
4864         * configure: Regenerate.
4866 2004-11-23  Daniel Jacobowitz  <dan@codesourcery.com>
4867             Joseph Myers  <joseph@codesourcery.com>
4869         * internal.h (struct lexer_state): Add in_deferred_pragma.
4870         * directives.c (struct pragma_entry): Add allow_expansion.
4871         (insert_pragma_entry): Take allow_expansion flag.
4872         (register_pragma): Likewise.
4873         (cpp_register_pragma): Likewise.
4874         (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
4875         (do_pragma): Honor allow_expansion.
4876         (cpp_handle_deferred_pragma): Set in_deferred_pragma.
4877         * include/cpplib.h (cpp_register_pragma): Update prototype.
4879 2004-11-18  Daniel Jacobowitz  <dan@codesourcery.com>
4880             Mark Mitchell  <mark@codesourcery.com>
4882         * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
4883         need_64bit_hwint=yes.
4884         * configure: Regenerate.
4886 2004-11-09  Joseph S. Myers  <joseph@codesourcery.com>
4888         * Makefile.in ($(PACKAGE).pot): New rule.  Depend on
4889         po/$(PACKAGE).pot.
4890         (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
4891         arguments.  Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
4892         Remove local srcdir path from generated file.
4894 2004-11-04  Zack Weinberg  <zack@codesourcery.com>
4895             Gerald Pfeifer  <gerald@pfeifer.com>
4897         * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
4898         as well.
4900 2004-10-27  Zack Weinberg  <zack@codesourcery.com>
4902         PR 18075
4903         * directives.c (do_pragma): Do not defer pragmas which are unknown.
4904         (cpp_handle_deferred_pragma): Add cast to silence warning.
4906 2004-10-14  Joseph S. Myers  <jsm@polyomino.org.uk>
4908         * errors.c (_cpp_begin_message): Print "error: " for errors.
4910 2004-10-10  Andreas Jaeger  <aj@suse.de>
4912         * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
4913         * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
4915 2004-10-08  Andrew Pinski  <pinskia@physics.uc.edu>
4917         * pch.c (cpp_write_pch_state): Remove variable z as it is not
4918         used.
4919         (cpp_read_state): Remove unused variables, m, d and mac_count.
4921 2004-09-29  Per Bothner  <per@bothner.com>
4923         * directives.c (cpp_handle_deferred_pragma):  Save, clear and restore
4924         cb.line_change.  Otherwise do_pragma will call the line_change
4925         call-back with a meaningless line number.
4927 2004-09-24  Zack Weinberg  <zack@codesourcery.com>
4929         * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
4930         programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
4931         ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
4932         * aclocal.m4, configure: Regenerate.
4933         * init.c: Include localedir.h.
4934         * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
4935         (DEFS): Delete.
4936         (.c.o): Use $(ALL_CFLAGS).
4937         (localedir.h, localedir.hs): New rules.
4938         (clean): Use rm -rf to remove directories.
4939         (distclean): Also delete localedir.h and localedir.hs.
4940         (init.o): Update dependencies.
4942 2004-09-22  Kelley Cook  <kcook@gcc.gnu.org>
4944         * Makefile.in (aclocal.m4): Update dependencies.
4945         * configure.ac (AC_CONFIG_MACRO_DIR): New.
4946         * aclocal.m4, configure: Regenerate.
4948 2004-09-17  Zack Weinberg  <zack@codesourcery.com>
4950         * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
4951         (_cpp_convert_input, _cpp_default_encoding): Add comments.
4952         Some other comments in this file also tweaked.
4954         * directives.c (do_pragma): Save current buffer position
4955         before lexing the pragma keywords; don't call
4956         _cpp_backup_tokens in the defer_pragmas case.
4958 2004-09-15  Per Bothner  <per@bothner.com>
4960         * include/line-map.h (line_map_start):  Add parameter names so
4961         preceding comment makes sense.
4962         (linemap_add):  Remove from comment mention of non-existing parameter.
4964 2004-09-09  Matt Austern  <austern@apple.com>
4965             Zack Weinberg  <zack@codesourcery.com>
4967         * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
4968         prefixes throughout.  Add entry for PRAGMA.  Remove
4969         unnecessary "= 0" from EQ.
4970         (enum cpp_ttype): Adjust OP and TK definitions to restore
4971         prefixes, via token-paste.
4972         (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
4973         Change from #defines to additional cpp_ttype enumerators.
4974         (struct cpp_options): Add defer_pragmas.
4975         (cpp_handle_deferred_pragma): Prototype new interface.
4977         * internal.h (struct cpp_reader): Add directive_result.
4978         * directives.c (struct pragma_entry): Add is_internal field;
4979         give boolean fields type bool.
4980         (start_directive): Initialize pfile->directive_result.type.
4981         (_cpp_do__Pragma): Likewise.
4982         (run_directive): Do not crash if pfile->buffer->prev is NULL.
4983         (insert_pragma_entry): Add 'internal' argument; set new->is_internal
4984         from it.
4985         (register_pragma): New static function, bulk of former
4986         cpp_register_pragma here; add 'internal' argument, pass along
4987         to insert_pragma_entry.
4988         (cpp_register_pragma): Now a wrapper around register_pragma which
4989         always passes false for 'internal' argument.
4990         (_cpp_init_internal_pragmas): Call register_pragma directly, passing
4991         true for 'internal'.
4992         (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
4993         an internal pragma, save text till the end of the line as a CPP_PRAGMA
4994         token instead of executing the pragma.
4995         (cpp_handle_deferred_pragma): New interface.
4996         * lex.c (token_spellings): Adjust OP and TK definitions to
4997         match changes to cpplib.h.
4998         (_cpp_lex_token): Check for a directive-result token and
4999         return it if present.
5000         (cpp_token_val_index): Handle CPP_PRAGMA.
5001         * macro.c (cpp_builtin_macro_text): Correct comment.
5002         (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
5004 2004-09-06  Serge Belyshev  <belyshev@lubercy.com>
5006         PR preprocessor/14699
5007         * symtab.c (ht_dump_statistics): Change type of sum_of_squares
5008         from size_t to double.
5010 2004-08-28  Andreas Schwab  <schwab@suse.de>
5011             Andreas Jaeger <aj@suse.de>
5013         * configure.ac: Set PACKAGE correctly.
5014         * configure: Regenerated.
5016 2004-08-25  Paolo Bonzini  <bonzini@gnu.org>
5018         * Makefile.in: Add back top_builddir.
5020 2004-08-25  Paolo Bonzini  <bonzini@gnu.org>
5022         * configure.ac: Replace Automake macro invocations
5023         with manual Autoconf checks and substitutions.
5024         * configure: Regenerate.
5025         * aclocal.m4: Regenerate.
5026         * config.in: Regenerate.
5027         * Makefile.am: Removed.
5028         * Makefile.in: Heavy simplification and reorganization.
5030 2004-08-09  Mark Mitchell  <mark@codesourcery.com>
5032         * configure.ac (arm*-*-eabi*): New target.
5033         (arm*-*-symbianelf*): Likewise.
5034         * configure: Regenerated.
5036 2004-07-24  Bernardo Innocenti  <bernie@develer.com>
5038         * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
5039         * directives.c: Use XNEW-family macros from libiberty.
5040         * lex.c: Likewise.
5041         * macro.c: Likewise.
5042         * cpplib.h (cpp_deps_style): Export enum with name.
5044 2004-07-23  Matthias Klose  <doko@debian.org>
5046         * init.c (init_library): Use PACKAGE for the text domain.
5048 2004-07-16  Andris Pavenis  <pavenis@latnet.lv>
5050         PR preprocessor/16366
5051         * internal.h (struct cpp_reader): New field dir_hash.
5052         * files.c (make_cpp_dir): Use dir_hash, not file_hash.
5053         (_cpp_init_files, _cpp_cleanup_files): Update for new field.
5055 2004-07-04  Neil Booth  <neil@duron.akihabara.co.uk>
5057         PR preprocessor/16192
5058         PR preprocessor/15913
5059         PR preprocessor/15572
5060         * expr.c (_cpp_parse_expr): Handle remaining cases where an
5061         expression is missing.
5062         * init.c (post_options): Traditional cpp doesn't do // comments.
5064 2004-06-30  Per Bothner  <per@bothner.com>
5066         * include/line-map.h (fileline):  Remove old typedef.
5067         * internal.h (struct cpp_reader):  Use source_location typedef instead.
5069 2004-06-26  Zack Weinberg  <zack@codesourcery.com>
5071         Partially revert patch of 2004-06-05.
5072         * files.c (search_cache): Remove pfile argument.  Don't check
5073         for file that would be found by "" or <> search here...
5074         (_cpp_find_file): ...do it here, before calling find_file_in_dir.
5075         Do not apply directory-of-current-file correction to files
5076         found by this check.  Rearrange code slightly.
5078 2004-06-21  Geoffrey Keating  <geoffk@apple.com>
5080         * files.c (should_stack_file): Correct swapped parameters to call
5081         to cb.read_pch.
5082         * pch.c (cpp_valid_state): Handle -fpreprocessed.
5084 2004-06-15  Paolo Bonzini  <bonzini@gnu.org>
5086         * Makefile.in: Regenerate with automake 1.8.5.
5087         * aclocal.m4: Likewise.
5088         * configure: Regenerate.
5090 2004-06-11  Zack Weinberg  <zack@codesourcery.com>
5092         * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
5093         * configure, config.in: Regenerate.
5094         * system.h: Unconditionally define bool as unsigned char,
5095         BOOL_BITFIELD as unsigned int.
5096         * .cvsignore: New file.
5098 2004-06-09  Geoffrey Keating  <geoffk@apple.com>
5100         * traditional.c (push_replacement_text): Set macro->traditional.
5101         (save_replacement_text): Likewise.
5102         * pch.c (cpp_write_pch_state): Don't write list of defined macros.
5103         (struct save_macro_item): Delete.
5104         (struct save_macro_data): Use a character array not the previous
5105         structured format.
5106         (save_macros): Save macro as text not as internal structures.
5107         (cpp_prepare_state): Update for changes to save_macro_data.
5108         (cpp_read_state): Don't read macros defined in PCH.  Restore
5109         -D macros as text.
5110         * macro.c (create_iso_definition): Honour alloc_subobject.
5111         Clear traditional flag.
5112         (_cpp_create_definition): Honour alloc_subobject.
5113         * lex.c (cpp_token_val_index): New.
5114         * internal.h: Include cpp-id-data.h.
5115         (uchar): Move definition to cpp-id-data.h.
5116         (U): Likewise.
5117         (cpp_macro): Likewise.
5118         * directives.c (struct answer): Move to cpp-id-data.h.
5119         (do_assert): Honour alloc_subobject.
5121         * include/symtab.h (struct ht): Add field 'alloc_subobject'.
5122         * include/cpplib.h (struct cpp_string): Add GTY marker.
5123         (enum cpp_token_fld_kind): New.
5124         (struct cpp_token): Add GTY markers.
5125         (cpp_token_val_index): Prototype.
5126         (CPP_HASHNODE_VALUE_IDX): New.
5127         (struct cpp_hashnode): Don't skip fields of 'value' when marking.
5128         * include/cpp-id-data.h: New file.
5130 2004-06-09  Paolo Bonzini  <bonzini@gnu.org>
5132         * Makefile.am (all-local): New.
5133         * Makefile.in: Regenerate.
5135 2004-06-06  Roger Sayle  <roger@eyesopen.com>
5137         * Makefile.am (LIBICONV): Declare.
5138         (makedepend_LDADD): Use LIBICONV.
5139         * Makefile.in: Regenerate.
5141 2004-06-05  Andrew Pinski  <pinskia@physics.uc.edu>
5143         * Makefile.am (LIBINTL): Declare
5144         (makedepend_LDADD): Use LIBINTL.
5145         * Makefile.in: Regenerate.
5147 2004-06-05  Zack Weinberg  <zack@codesourcery.com>
5149         * Makefile.am: Add makedepend.
5150         * Makefile.in, aclocal.m4: Regenerate.
5151         * charset.c: Insert a space to avoid a warning.
5152         * directives.c: Include mkdeps.h.
5153         (_cpp_handle_directive): Reenable macro expander if appropriate.
5154         (undefine_macros): Inline body of _cpp_free_definition for speed.
5155         Do not call undef callback or _cpp_warn_if_unused_macro.
5156         (cpp_get_deps): New interface.
5157         * files.c (search_cache): Add pfile argument.  Check for file
5158         that would be found by "" or <> search here...
5159         (_cpp_find_file): ...not here.  Correct recorded start_dir of
5160         files found by directory-of-current-file search that would be
5161         found by "" or <> search.
5162         * init.c (cpp_add_dependency_target): Delete.
5163         * internal.h (struct lexer_state): Add discarding_output flag.
5164         * lex.c (lex_identifier): Compute hash function while scanning.
5165         * macro.c (cpp_scan_nooutput): Disable macro expansion outside
5166         directives.
5167         * makedepend.c: New file.
5168         * mkdeps.c (struct deps): Add vpath vector.
5169         (apply_vpath, deps_add_vpath): New function.
5170         (deps_free): Free vpath vector.
5171         (deps_add_dep, deps_add_target): Use apply_vpath.
5172         * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
5173         (ht_lookup_with_hash): New function.
5174         * cpplib.h, mkdeps.h: Update prototypes.
5175         * symtab.h: Update prototypes.
5176         (HT_HASHSTEP, HT_FINISH): New macros.
5178 2004-05-29  Geoffrey Keating  <geoffk@apple.com>
5180         * symtab.c (ht_create): Set entries_owned.
5181         (ht_destroy): Honour entries_owned.
5182         (ht_expand): Likewise.
5183         (ht_load): New.
5184         * include/symtab.h (struct ht): New field 'entries_owned'
5185         (ht_load): New prototype.
5187 2004-05-26  Paolo Bonzini  <bonzini@gnu.org>
5189         PR bootstrap/15651
5190         * configure.ac: Fix m4 quoting when picking
5191         the size of HOST_WIDE_INT.
5192         * configure: Regenerate.
5194 2004-05-25  Paolo Bonzini  <bonzini@gnu.org>
5196         * Makefile.am: the correct directory for
5197         gettext include files is given by @INCINTL@.
5198         * Makefile.in: Regenerate.
5200 2004-05-24  Paolo Bonzini  <bonzini@gnu.org>
5202         * system.h [!ENABLE_NLS]: dgettext takes two
5203         parameters.
5205 2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
5207         Moved libcpp from the gcc subdirectory to the toplevel.
5208         * Makefile.am: New file.
5209         * Makefile.in: Regenerate.
5210         * configure.ac: New file.
5211         * configure: Regenerate.
5212         * config.in: Regenerate.
5213         * charset.c: Moved from gcc/cppcharset.c.  Add note about
5214         brokenness of input charset detection.  Adjust for change
5215         in name of cppucnid.h.
5216         * errors.c: Moved from gcc/cpperror.c.  Do not include intl.h.
5217         * expr.c: Moved from gcc/cppexp.c.
5218         * files.c: Moved from gcc/cppfiles.c.  Do not include intl.h.
5219         Remove #define of O_BINARY, it is in system.h.
5220         * identifiers.c: Moved from gcc/cpphash.c.
5221         * internal.h: Moved from gcc/cpphash.h.  Change header
5222         guard name.  All other files adjusted to match name change.
5223         * init.c: Moved from gcc/cppinit.c.
5224         (init_library) [ENABLE_NLS]: Call bindtextdomain.
5225         * lex.c: Moved from gcc/cpplex.c.
5226         * directives.c: Moved from gcc/cpplib.c.
5227         * macro.c: Moved from gcc/cppmacro.c.
5228         * pch.c: Moved from gcc/cpppch.c.  Do not include intl.h.
5229         * traditional.c: Moved from gcc/cpptrad.c.
5230         * ucnid.h: Moved from gcc/cppucnid.h.  Change header
5231         guard name.
5232         * ucnid.pl: Moved from gcc/cppucnid.pl.
5233         * ucnid.tab: Moved from gcc/cppucnid.tab.  Change header
5234         guard name.
5235         * symtab.c: Moved from gcc/hashtable.c.
5236         * line-map.c: Moved from gcc.  Do not include intl.h.
5237         * mkdeps.c: Moved from gcc.
5238         * system.h: New file.
5239         * include/cpplib.h: Moved from gcc.  Change header guard name.
5240         * include/line-map.h: Moved from gcc.  Change header guard name.
5241         * include/mkdeps.h: Moved from gcc.  Change header guard name.
5242         * include/symtab.h: Moved from gcc/hashtable.h.  Change header
5243         guard name.
5245 Copyright (C) 2004-2017 Free Software Foundation, Inc.
5247 Copying and distribution of this file, with or without modification,
5248 are permitted in any medium without royalty provided the copyright
5249 notice and this notice are preserved.