Merge trunk version 195164 into gupc branch.
[official-gcc.git] / libcpp / ChangeLog
blobaa6a02d91f9cc59640913d8a0fbb3f364e989c18
1 2013-01-14  Richard Sandiford  <rdsandiford@googlemail.com>
3         Update copyright years.
5 2013-01-04  Paolo Carlini  <paolo.carlini@oracle.com>
7         PR c++/54526 (again)
8         * lex.c (_cpp_lex_direct): In C++11 mode, implement 2.5 p3, bullet 2.
10 2013-01-03  Marc Glisse  <marc.glisse@inria.fr>
12         PR bootstrap/50177
13         * line-map.c (get_combined_adhoc_loc): Cast from extern "C" type.
14         (new_linemap): Likewise.
15         (linemap_enter_macro): Likewise.
17 2012-12-03  Jakub Jelinek  <jakub@redhat.com>
19         PR bootstrap/55380
20         PR other/54691
21         * files.c (read_file_guts): Allocate extra 16 bytes instead of
22         1 byte at the end of buf.  Pass size + 16 instead of size
23         to _cpp_convert_input.
24         * charset.c (_cpp_convert_input): Reallocate if there aren't
25         at least 16 bytes beyond to.len in the buffer.  Clear 16 bytes
26         at to.text + to.len.
28 2012-11-21  Steve Ellcey  <sellcey@mips.com>
30         PR pch/55399
31         * files.c (pch_open_file): Fix check for implicit_preinclude.
33 2012-11-16  Simon Baldwin  <simonb@google.com>
35         * include/cpplib.h (struct cpp_options): Add canonical_system_headers.
36         * files.c (find_file_in_dir): Call maybe_shorter_path() only if
37         canonical_system_headers is set.
38         * init.c (cpp_create_reader): Initialize canonical_system_headers.
39         * configure.ac: Add new --enable-canonical-system-headers.
40         * configure: Regenerate.
41         * config.in: Regenerate.
43 2012-11-09  Ed Smith-Rowland  <3dw4rd@verizon.net>
45         PR c++/54413
46         * include/cpplib.h (cpp_interpret_float_suffix): Add cpp_reader* arg.
47         (cpp_interpret_int_suffix): Add cpp_reader* arg.
48         * init.c (cpp_create_reader): Iitialize new flags.
49         * expr.c (interpret_float_suffix): Use new flags.
50         (cpp_interpret_float_suffix): Add cpp_reader* arg.
51         (interpret_int_suffix): Use new flags.
52         (cpp_interpret_int_suffix): Add cpp_reader* arg.
53         (cpp_classify_number): Adjust calls to interpret_x_suffix.
55 2012-10-23  Ian Bolton  <ian.bolton@arm.com>
56             Jim MacArthur  <jim.macarthur@arm.com>
57             Marcus Shawcroft  <marcus.shawcroft@arm.com>
58             Nigel Stephens  <nigel.stephens@arm.com>
59             Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
60             Richard Earnshaw  <rearnsha@arm.com>
61             Sofiane Naci  <sofiane.naci@arm.com>
62             Stephen Thomas  <stephen.thomas@arm.com>
63             Tejas Belagod  <tejas.belagod@arm.com>
64             Yufeng Zhang  <yufeng.zhang@arm.com>
66         * configure.ac: Enable AArch64.
67         * configure: Regenerate.
69 2012-10-23  Joseph Myers  <joseph@codesourcery.com>
71         * files.c (struct _cpp_file): Add implicit_preinclude.
72         (pch_open_file): Allow a previously opened implicitly included
73         file.
74         (_cpp_find_file): Add implicit_preinclude argument.  Free file and
75         do not call open_file_failed if implicit_preinclude.  Store
76         implicit_preinclude value.
77         (_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date):
78         Update calls to _cpp_find_file.
79         (_cpp_stack_include): Handle IT_DEFAULT.
80         (cpp_push_default_include): New.
81         * include/cpplib.h (cpp_push_default_include): Declare.
82         * init.c (cpp_read_main_file): Update call to _cpp_find_file.
83         * internal.h (enum include_type): Add IT_DEFAULT.
84         (_cpp_find_file): Update prototype.
86 2012-10-15  Tobias Burnus  <burnus@net-b.de>
88         * files.c (read_file_guts, _cpp_save_file_entries): Free memory
89         before returning.
90         * lex.c (warn_about_normalization): Ditto.
91         * mkdeps.c (deps_save): Ditto.
92         * pch.c (cpp_valid_state): Ditto.
94 2012-10-04  Florian Weimer  <fweimer@redhat.com>
96         * directives.c (do_pragma_warning_or_error): New.
97         (do_pragma_warning): New.
98         (do_pragma_error): New.
99         (_cpp_init_internal_pragmas): Register new pragmas.
101 2012-09-25  Dehao Chen  <dehao@google.com>
103         PR middle-end/54704
104         * line-map.c (location_adhoc_data_hash): Fix the hash function.
106 2012-09-25  Dehao Chen  <dehao@google.com>
108         PR middle-end/54645
109         * include/line-map.h (location_adhoc_data): Move location_adhoc_data
110         into GC.
111         (location_adhoc_data_map): Likewise.
112         (line_maps): Likewise.
113         (rebuild_location_adhoc_htab): New Function.
114         * line-map.c (+rebuild_location_adhoc_htab): new Funcion.
115         (get_combined_adhoc_loc): Move location_adhoc_data into GC.
116         (location_adhoc_data_fini): Likewise.
117         (linemap_init): Likewise.
118         (location_adhoc_data_init): Remove Function.
120 2012-09-19  Dehao Chen  <dehao@google.com>
122         * include/line-map.h (MAX_SOURCE_LOCATION): New value.
123         (location_adhoc_data_fini): New.
124         (get_combined_adhoc_loc): New.
125         (get_data_from_adhoc_loc): New.
126         (get_location_from_adhoc_loc): New.
127         (location_adhoc_data_map): New.
128         (COMBINE_LOCATION_DATA): New.
129         (IS_ADHOC_LOC): New.
130         (expanded_location): New field.
131         (line_maps): New field.
132         * line-map.c (location_adhoc_data): New.
133         (location_adhoc_data_hash): New.
134         (location_adhoc_data_eq): New.
135         (location_adhoc_data_update): New.
136         (get_combined_adhoc_loc): New.
137         (get_data_from_adhoc_loc): New.
138         (get_location_from_adhoc_loc): New.
139         (location_adhoc_data_init): New.
140         (location_adhoc_data_fini): New.
141         (linemap_init): Initialize location_adhoc_data.
142         (linemap_lookup): Change to use new location.
143         (linemap_ordinary_map_lookup): Likewise.
144         (linemap_macro_map_lookup): Likewise.
145         (linemap_macro_map_loc_to_def_point): Likewise.
146         (linemap_macro_map_loc_unwind_toward_spel): Likewise.
147         (linemap_get_expansion_line): Likewise.
148         (linemap_get_expansion_filename): Likewise.
149         (linemap_location_in_system_header_p): Likewise.
150         (linemap_location_from_macro_expansion_p): Likewise.
151         (linemap_macro_loc_to_spelling_point): Likewise.
152         (linemap_macro_loc_to_def_point): Likewise.
153         (linemap_macro_loc_to_exp_point): Likewise.
154         (linemap_resolve_location): Likewise.
155         (linemap_unwind_toward_expansion): Likewise.
156         (linemap_unwind_to_first_non_reserved_loc): Likewise.
157         (linemap_expand_location): Likewise.
158         (linemap_dump_location): Likewise.
159         (linemap_line_start): Likewise.
161 2012-05-25  Dodji Seketeli  <dodji@redhat.com>
163         PR preprocessor/53469
164         * directives.c (do_pragma): Use the virtual location for the
165         pragma token, instead of its spelling location.
167 2012-08-14   Diego Novillo  <dnovillo@google.com>
169         Merge from cxx-conversion branch.  Configury.
171         * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
172         * configure.ac: Likewise.
173         * configure: Regenerate.
175 2012-08-14   Lawrence Crowl  <crowl@google.com>
177         Merge from cxx-conversion branch.  New C++ hash table.
179         * include/symtab.h (typedef struct ht hash_table): Change the typedef
180         name to cpp_hash_table.  Update all users of the typedef.
182 2012-07-30  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
184         * include/line-map.h (line_map_macro): Use the "atomic" GTY option
185         for the macro_locations field.
187 2011-06-19  Uros Bizjak  <ubizjak@gmail.com>
189         * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
190         __builtin_ia32_pcmpestri128 instead of asm.
192 2012-06-04  Dimitrios Apostolou <jimis@gmx.net>
194         * line-map.c (linemap_enter_macro): Don't zero max_column_hint in
195         every macro. This improves performance by reducing the number of
196         reallocations when track-macro-expansion is on.
198 2012-06-04  Dodji Seketeli  <dodji@redhat.com>
200         PR preprocessor/53463
201         * line-map.c (linemap_location_in_system_header_p): For built-in
202         macro tokens, check the first expansion point location that is not
203         for a token coming from a built-in macro.
205 2012-05-29  Joseph Myers  <joseph@codesourcery.com>
207         * directives.c: Fix typos.
208         * include/line-map.h: Fix typos.
209         * line-map.c: Fix typos.
210         * macro.c: Fix typos.
212 2012-05-25  Dodji Seketeli  <dodji@redhat.com>
214         PR bootstrap/53459
215         * lex.c (search_line_fast): Avoid unused local typedefs to simulate
216         a static assertion.
218 2012-05-29  Dodji Seketeli  <dodji@redhat.com>
220         PR preprocessor/53229
221         * internal.h (cpp_reader::set_invocation_location): Remove.
222         (cpp_reader::about_to_expand_macro_p): New member flag.
223         * directives.c (do_pragma):  Remove Kludge as
224         pfile->set_invocation_location is no more.
225         * macro.c (cpp_get_token_1): Do away with the use of
226         cpp_reader::set_invocation_location.  Just collect the macro
227         expansion point when we are about to expand the top-most macro.
228         Do not override cpp_reader::about_to_expand_macro_p.
229         This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding
230         properly handle locations of expansion points.
231         (cpp_get_token_with_location): Adjust, as
232         cpp_reader::set_invocation_location is no more.
233         (paste_tokens): Take a virtual location parameter for
234         the LHS of the pasting operator.  Use it in diagnostics.  Update
235         comments.
236         (paste_all_tokens): Tighten the assert.  Propagate the location of
237         the expansion point when no virtual locations are available.
238         Pass the virtual location to paste_tokens.
239         (in_macro_expansion_p): New static function.
240         (enter_macro_context): Set the cpp_reader::about_to_expand_macro_p
241         flag until we really start expanding the macro.
243 2012-05-16  Dodji Seketeli  <dodji@redhat.com>
245         PR preprocessor/7263
246         * include/cpplib.h (cpp_classify_number): Take a location
247         parameter.
248         * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic
249         macros that take a location parameter.
250         (cpp_classify_number): Take a (virtual) location parameter.  Use
251         it for diagnostics.  Adjust comments.
252         (eval_token): Take a location parameter.  Pass it to
253         cpp_classify_number and to diagnostic routines.
254         (_cpp_parse_expr): Use virtual locations of tokens when parsing
255         expressions.  Pass a virtual location to eval_token and to
256         diagnostic routines.
258 2012-05-10  Tristan Gingold  <gingold@adacore.com>
260         * expr.c (interpret_float_suffix): Add a guard.
262 2012-05-02  Dodji Seketeli  <dodji@redhat.com>
264         Properly initialize cpp_context in destringize_and_run
265         * directives.c (destringize_and_run): Properly initialize the new
266         context.
267         * macro.c (_cpp_pop_context): Assert that we shouldn't try to pop
268         the initial base context, which has the same life time as the
269         current instance of cpp_file.
271 2012-04-30  Manuel López-Ibáñez  <manu@gcc.gnu.org>
272             Dodji Seketeli  <dodji@seketeli.org>
274         PR c++/52974
275         * libcpp/files.c (maybe_shorter_path): New.
276         (find_file_in_dir): Use it.
278 2012-04-30  Dodji Seketeli  <dodji@redhat.com>
280         Switch -ftrack-macro-expansion=2 on by default.
281         * init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
282         by default.  Add comments.
284         Strip "<built-in>" loc from displayed expansion context
285         * include/line-map.h (linemap_unwind_toward_expansion): Fix typo
286         in comment.
287         (linemap_unwind_to_first_non_reserved_loc): Declare new function.
288         * line-map.c (linemap_unwind_to_first_non_reserved_loc): Define
289         new function.
291         Fix expansion point loc for macro-like tokens
292         * macro.c (macro_of_context): New static function.
293         (_cpp_push_token_context, push_extended_tokens_context): If the
294         macro argument is NULL, it means we are continuing the expansion
295         of the current macro, if any.  Update comments.
296         (_cpp_pop_context): Re-enable expansion of the macro only when we
297         are really out of the context of the current expansion.
299         Fix token pasting with -ftrack-macro-expansion
300         * macro.c (paste_all_tokens): Put the token resulting from pasting
301         into an extended token context with -ftrack-macro-location is in
302         effect.
304         Fix cpp_sys_macro_p with -ftrack-macro-expansion
305         * macro.c (cpp_sys_macro_p):  Support -ftrack-macro-expansion.
307 2012-04-29  Dodji Seketeli  <dodji@redhat.com>
309         * lex.c (lex_raw_string): Change C++ style comments into C style
310         comments.
311         (lex_string): Likewise.
313 2012-04-27   Ollie Wild  <aaw@google.com>
315         * include/cpplib.h (struct cpp_options): Add new field,
316         warn_literal_suffix.
317         (CPP_W_LITERAL_SUFFIX): New enum.
318         * init.c (cpp_create_reader): Default initialization of
319         warn_literal_suffix.
320         * lex.c (lex_raw_string): Treat user-defined literals which don't
321         begin with '_' as separate tokens and produce a warning.
322         (lex_string): Ditto.
324 2012-04-26  Manuel López-Ibáñez  <manu@gcc.gnu.org>
326         * line-map.c (linemap_resolve_location): Synchronize comments with
327         those in line-map.h.
328         * include/line-map.h (linemap_resolve_location): Fix spelling in
329         comment.
331 2012-03-22  Richard Earnshaw  <rearnsha@arm.com>
333         * lex.c (search_line_fast): Provide Neon-optimized version for ARM.
335 2012-03-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
337         * lex.c: Remove Solaris 8 reference.
339 2012-02-14  Walter Lee  <walt@tilera.com>
341         * configure.ac: Require 64-bit hwint for tilegx and tilepro.
342         * configure: Regenerate.
344 2012-01-09  Richard Guenther  <rguenther@suse.de>
346         * macro.c (_cpp_builtin_macro_text): Remove unused variable map.
348 2012-01-09  Gary Funck  <gary@intrepid.com>
350         PR preprocessor/33919
351         * files.c (_cpp_get_file_name): New. Implement file name
352         access function.
353         * internal.h (_cpp_get_file_name): New prototype.
354         * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
355         to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
357 2012-01-03  Olivier Hainque  <hainque@adacore.com>
359         * system.h: Prior to #define, #undef fopen and freopen unconditionally.
361 2011-12-20  Joseph Myers  <joseph@codesourcery.com>
363         * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
364         (CLK_STDC1X): Change to CLK_STDC11.
365         * init.c (lang_defaults): Update comments.
366         (cpp_init_builtins): Update language tests.  Use 201112L for C11
367         __STDC_VERSION__.
369 2011-12-20  Andreas Schwab  <schwab@linux-m68k.org>
371         * configure: Regenerate.
373 2011-12-19  Andreas Schwab  <schwab@linux-m68k.org>
375         * configure: Regenerate.
377 2011-12-07  Jakub Jelinek  <jakub@redhat.com>
379         PR bootstrap/50237
380         * internal.h (_cpp_init_lexer): New prototype.
381         * init.c (init_library): Call it.
382         * lex.c (init_vectorized_lexer): Remove constructor attribute,
383         add inline keyword.
384         (HAVE_init_vectorized_lexer): Define.
385         (_cpp_init_lexer): New function.
387 2011-12-03  Dodji Seketeli  <dodji@redhat.com>
389         * macro.c (tokens_buff_remove_last_token)
390         (tokens_buff_put_token_to): Add an 'inline' function specifier to
391         the prototype.
393 2011-11-22   Diego Novillo  <dnovillo@google.com>
395         * include/line-map.h (linemap_dump): Declare.
396         (line_table_dump): Declare.
397         * line-map.c (linemap_dump): New.
398         (line_table_dump): New.
400 2011-11-21  Ed Smith-Rowland  <3dw4rd@verizon.net>
402         PR c++/50958
403         * expr.c (cpp_userdef_char_remove_type): Fix typo.
405 2011-11-03  Michael Matz  <matz@suse.de>
407         PR bootstrap/50857
408         * configure.ac: Check for -fno-exceptions -fno-rtti.
409         * configure: Regenerate.
410         * Makefile.in (NOEXCEPTION_FLAGS): New flag.
411         (ALL_CXXFLAGS): Use it.
413 2011-11-02  Paolo Carlini  <paolo.carlini@oracle.com>
415         * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
417 2011-11-02  Jason Merrill  <jason@redhat.com>
419         PR c++/50810
420         * configure.ac: Add -Wno-narrowing to warning options.
422 2011-10-31  Jason Merrill  <jason@redhat.com>
424         PR libstdc++/1773
425         * init.c (cpp_init_builtins): Set __cplusplus for C++11.
427         PR c++/50920
428         * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
429         CLK_GNUCXX0X to CLK_GNUCXX11.
431 2011-10-26  Ed Smith-Rowland  <3dw4rd@verizon.net>
433         Implement C++11 user-defined literals.
434         * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
435         cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
436         cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
437         cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
438         (cpp_classify_number): Classify unrecognized tokens as user-defined
439         literals.
440         * include/cpplib.h: Add new tokens for user-defined literals.
441         * init.c: Add new preprocessor flag (cxx11).
442         * lex.c: (lex_string, lex_raw_string): Handle user-defined literals
443         including concatenation and promotion with suffixes.
445 2011-10-24  Dodji Seketeli  <dodji@redhat.com>
447         * line-map.c (linemap_macro_map_lookup): Fix logic.
449 2011-10-24  Dodji Seketeli  <dodji@redhat.com>
451         * include/line-map.h (linemap_expand_location): Take a line table
452         parameter.  Update comment.
453         (linemap_resolve_location): Update comment.
454         (linemap_expand_location_full): Remove.
455         * line-map.c (linemap_resolve_location):  Handle reserved
456         locations; return a NULL map in those cases.
457         (linemap_expand_location): If location is reserved, return a
458         zeroed expanded location.  Update comment.  Take a line table to
459         assert that the function takes non-virtual locations only.
460         (linemap_expand_location_full): remove.
461         (linemap_dump_location): Handle the fact that
462         linemap_resolve_location can return NULL line maps when the
463         location resolves to a reserved location.
465         * line-map.c (linemap_macro_map_lookup): Fix logic.
467 2011-10-22  Dodji Seketeli  <dodji@redhat.com>
469         PR bootstrap/50778
470         * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
471         context to act upon.
472         * lex.c (_cpp_remaining_tokens_num_in_context): Likewise.  Update
473         comment.
474         (cpp_token_from_context_at): Likewise.
475         (cpp_peek_token): Use the context to peek tokens from.
477 2011-10-20  Dodji Seketeli  <dodji@redhat.com>
479         PR bootstrap/50801
480         * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
481         number of tokens.
483 2011-10-18  Dodji Seketeli  <dodji@redhat.com>
485         PR bootstrap/50760
486         * include/line-map.h (struct linemap_stats): Change the type of
487         the members from size_t to long.
488         * macro.c (macro_arg_token_iter_init): Unconditionally initialize
489         iter->location_ptr.
491 2011-10-17  Dodji Seketeli  <dodji@redhat.com>
493         * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
494         variable without using it if ENABLE_CHECKING is not defined.  Mark
495         the LOCATION parameter as being unused.
497 2011-10-15  Tom Tromey  <tromey@redhat.com>
498             Dodji Seketeli  <dodji@redhat.com>
500         * include/line-map.h (struct line_maps::alloced_size_for_request):
501         New member.
502         * line-map.c (new_linemap): Use set->alloced_size_for_request to
503         get the actual allocated size of line maps.
505 2011-10-15  Tom Tromey  <tromey@redhat.com>
506             Dodji Seketeli  <dodji@redhat.com>
508         * line-map.h (struct linemap_stats): Declare new struct.
509         (linemap_get_statistics): Declare ...
510         * line-map.c (linemap_get_statistics):  ... new function.
511         * macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
512         Declare new counters.
513         (enter_macro_context, replace_args): Update
514         num_macro_tokens_counter.
515         (cpp_get_token_1): Update num_expanded_macros_counter.
517 2011-10-15  Tom Tromey  <tromey@redhat.com>
518             Dodji Seketeli  <dodji@redhat.com>
520         * include/cpplib.h (struct cpp_options)<debug>: New struct member.
521         * include/line-map.h (linemap_dump_location): Declare ...
522         * line-map.c (linemap_dump_location): ... new function.
524 2011-10-15  Tom Tromey  <tromey@redhat.com>
525             Dodji Seketeli  <dodji@redhat.com>
527         * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
528         New option.
529         * internal.h (struct macro_context): New struct.
530         (enum context_tokens_kind): New enum.
531         (struct cpp_context)<tokens_kind>: New member of type enum
532         context_tokens_kind.
533         (struct cpp_context)<macro>: Remove this.  Replace it with an enum
534         of macro and  macro_context.
535         (struct cpp_context)<direct_p>: Remove.
536         (_cpp_remaining_tokens_num_in_context): Declare new function.
537         * directives.c (destringize_and_run): Adjust.
538         * lex.c (_cpp_remaining_tokens_num_in_context)
539         (_cpp_token_from_context_at): Define new functions
540         (cpp_peek_token): Use them.
541         * init.c (cpp_create_reader): Initialize the base context to zero.
542         (_cpp_token_from_context_at): Define new static function.
543         (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
544         _cpp_token_from_context_at.
545         * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
546         members.
547         (enum macro_arg_token_kind): New enum.
548         (struct macro_arg_token_iter): New struct.
549         (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
550         (alloc_expanded_arg_mem, ensure_expanded_arg_room)
551         (delete_macro_args, set_arg_token, get_arg_token_location)
552         (arg_token_ptr_at, macro_arg_token_iter_init)
553         (macro_arg_token_iter_get_token)
554         (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
555         (expanded_token_index, tokens_buff_new, tokens_buff_count)
556         (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
557         (tokens_buff_add_token, tokens_buff_remove_last_token)
558         (reached_end_of_context, consume_next_token_from_context): New
559         static functions.
560         (cpp_get_token_1): New static function. Split and extended from
561         cpp_get_token.  Use reached_end_of_context and
562         consume_next_token_from_context.  Unify its return point.  Move
563         the location tweaking from cpp_get_token_with_location in here.
564         (cpp_get_token): Use cpp_get_token_1
565         (stringify_arg): Use the new arg_token_at.
566         (paste_all_tokens): Support tokens coming from extended tokens
567         contexts.
568         (collect_args): Return the number of collected arguments, by
569         parameter.  Store virtual locations of tokens that constitute the
570         collected args.
571         (funlike_invocation_p): Return the number of collected arguments,
572         by parameter.
573         (enter_macro_context): Add a parameter for macro expansion point.
574         Pass it to replace_args and to the "used" cpp callback.  Get the
575         number of function-like macro arguments from funlike_invocation_p,
576         pass it to the new delete_macro_args to free the memory used by
577         macro args.  When -ftrack-macro-expansion is in effect, for macros
578         that have no arguments, create a macro map for the macro expansion
579         and use it to allocate proper virtual locations for tokens
580         resulting from the expansion.  Push an extended tokens context
581         containing the tokens resulting from macro expansion and their
582         virtual locations.
583         (replace_args): Rename the different variables named 'count' into
584         variables with more meaningful names.  Create a macro map;
585         allocate virtual locations of tokens resulting from this
586         expansion.  Use macro_arg_token_iter to iterate over tokens of a
587         given macro.  Handle the case of the argument of
588         -ftrack-macro-expansion being < 2.  Don't free macro arguments
589         memory resulting from expand_arg here, as these are freed by the
590         caller of replace_arg using delete_macro_args now.  Push extended
591         token context.
592         (next_context, push_ptoken_context, _cpp_push_token_context)
593         (_cpp_push_text_context): Properly initialize the context.
594         (expand_arg): Use the new alloc_expanded_arg_mem,
595         push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
596         (_cpp_pop_context): Really free the memory held by the context.
597         Handle freeing memory used by extended tokens contexts.
598         (cpp_get_token_with_location): Use cpp_get_token_1.
599         (cpp_sys_macro_p): Adjust.
600         (_cpp_backup_tokens): Support the new kinds of token contexts.
601         * traditional.c (recursive_macro): Adjust.
603 2011-10-15  Tom Tromey  <tromey@redhat>
604             Dodji Seketeli  <dodji@redhat.com>
606         * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
607         member.
608         (MAX_SOURCE_LOCATION): New constant.
609         (struct line_map_ordinary, struct line_map_macro): New structs.
610         (struct line_map): Turn this into a union of the two above.  Add
611         comments.
612         (struct maps_info): New struct.
613         (struct line_maps)<info_ordinary, info_macro>: Two new fields.
614         These now carry the map information that was previously scattered
615         in struct line_maps.
616         (struct map_info::allocated): Fix comment.
617         (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
618         (ORDINARY_MAP_STARTING_LINE_NUMBER)
619         (ORDINARY_MAP_INCLUDER_FILE_INDEX)
620         (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
621         (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
622         (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
623         (MACRO_MAP_EXPANSION_POINT_LOCATION)
624         (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
625         (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
626         (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
627         (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
628         (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
629         (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
630         (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
631         (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
632         (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
633         (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
634         (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
635         information.
636         (linemap_check_ordinary, linemap_assert)
637         (linemap_location_before_p): New macros.
638         (linemap_position_for_line_and_column)
639         (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
640         (linemap_macro_expansion_map_p)
641         (linemap_macro_map_loc_to_def_point)
642         (linemap_macro_map_loc_unwind_once)
643         (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
644         (linemap_get_source_line linemap_get_source_column)
645         (linemap_map_get_macro_name, linemap_get_file_path)
646         (linemap_location_in_system_header_p)
647         (linemap_location_from_macro_expansion_p): Declare new functions.
648         (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
649         (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
650         accessors act on ordinary maps only.
651         (INCLUDED_FROM): Return NULL for main files; use the new
652         accessors.
653         (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
654         (struct expanded_location): Move here from gcc/input.h
655         (linemap_resolve_location, linemap_expand_location)
656         (linemap_expand_location_full): Declare new functions.
657         * line-map.c: Include cpplib.h, internal.h
658         (linemap_enter_macro, linemap_add_macro_token)
659         (linemap_get_expansion_line, linemap_get_expansion_filename): New
660         functions that are private to libcpp.
661         (linemap_assert): New macro.
662         (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
663         (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
664         (linemap_macro_map_loc_unwind_toward_spelling)
665         (linemap_macro_map_loc_to_exp_point)
666         (first_map_in_common_1, first_map_in_common): New static
667         functions.
668         (new_linemap): Define new static functions.  Extracted and
669         enhanced from ...
670         (linemap_add): ... here.  Use linemap_assert in lieu of abort
671         previously.
672         (linemap_tracks_macro_expansion_locs_p)
673         (linemap_add_macro_token, linemap_macro_expansion_map_p)
674         (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
675         (linemap_macro_map_loc_to_def_point)
676         (linemap_macro_map_loc_unwind_once)
677         (linemap_step_out_once, linemap_map_get_index)
678         (linemap_get_source_line,linemap_get_source_column)
679         (linemap_get_file_path, linemap_map_get_macro_name)
680         (linemap_location_in_system_header_p)
681         (linemap_location_originated_from_system_header_p)
682         (linemap_location_from_macro_expansion_p)
683         (linemap_tracks_macro_expansion_locs_p)
684         (linemap_resolve_location, linemap_expand_location)
685         (linemap_expand_location_full)
686         (linemap_tracks_macro_expansion_locs_p)
687         (linemap_position_for_line_and_column, linemap_compare_locations):
688         Define new public functions.
689         (linemap_init): Initialize ordinary and macro maps information in
690         the map set.
691         (linemap_check_files_exited): Use the new accessors.
692         (linemap_free): Remove this dead code.
693         (linemap_line_start): Assert this uses an ordinary map.  Adjust to
694         use the new ordinary map accessors and data structures.  Don't
695         overflow past the lowest possible macro token's location.
696         (linemap_position_for_column): Assert the ordinary maps of the map
697         set are really ordinary.  Use ordinary map accessors.
698         (linemap_lookup): Keep the same logic but generalize to allow
699         lookup of both ordinary and macro maps.  Do not crash when called
700         with an empty line table.
701         * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
702         new API of line-map.h.
703         * directives.c (start_directive, do_line, do_linemarker)
704         (do_linemarker): Likewise.
705         * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
706         (make_cpp_dir, cpp_make_system_header): Likewise.
707         * init.c (cpp_read_main_file): Likewise.
708         * internal.h (CPP_INCREMENT_LINE): Likewise.
709         (linemap_enter_macro, linemap_add_macro_token)
710         (linemap_get_expansion_line, linemap_get_expansion_filename): New
711         functions private to libcpp.
712         * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
713         (skip_line_comment, skip_whitespace, lex_raw_string)
714         (_cpp_lex_direct): Likewise.
715         * macro.c (_cpp_builtin_macro_text): Likewise.
716         (_cpp_aligned_alloc): Initialize the new name member of the macro.
717         * traditional.c (copy_comment, _cpp_scan_out_logical_line):
718         Likewise.
719         * errors.c (cpp_diagnostic): Adjust to new linemap API.
721 2011-08-28  Dodji Seketeli  <dodji@redhat.com>
723         * line-map.c (linemap_add): Assert that reason must not be
724         LC_RENAME when called for the first time on a "main input file".
726 2011-08-22  Gabriel Charette  <gchare@google.com>
728         * init.c (cpp_create_reader): Inititalize forced_token_location_p.
729         * internal.h (struct cpp_reader): Add field forced_token_location_p.
730         * lex.c (_cpp_lex_direct): Use forced_token_location_p.
731         (cpp_force_token_locations): New.
732         (cpp_stop_forcing_token_locations): New.
734 2011-08-18  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
736         PR libstdc++/1773
737         * init.c (cpp_init_builtins): Define __cplusplus 19971L.
739 2011-08-18  Joseph Myers  <joseph@codesourcery.com>
741         * include/cpplib.h (struct cpp_options): Fix typo.
743 2011-08-18  Joseph Myers  <joseph@codesourcery.com>
745         * include/cpplib.h (struct cpp_options): Add rliterals.
746         * init.c  (struct lang_flags, lang_defaults): Add rliterals.
747         (cpp_set_lang): Set rliterals option.
748         (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
749         * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
751 2011-08-15  Gabriel Charette  <gchare@google.com>
753         * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
754         Update all users to use linemap_position_for_column instead.
756 2011-07-28  Gabriel Charette  <gchare@google.com>
758         * include/line-map.h (struct line_maps):
759         Remove unused field last_listed. Update all users.
761 2011-07-28  H.J. Lu  <hongjiu.lu@intel.com>
763         * configure.ac: Set need_64bit_hwint to yes for x86 targets.
764         * configure: Regenerated.
766 2011-07-25  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
768         * system.h [__cplusplus]: Wrap C function declarations in extern "C".
770 2011-07-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
771             Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
773         PR bootstrap/49794
774         * configure.ac: Test AM_ICONV with CXX.
775         * configure: Regenerate.
776         * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
778 2011-07-15  Dodji Seketeli  <dodji@redhat.com>
780         * directives.c (struct if_stack): Use source_location as type
781         here.
782         * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
783         indent, def_pragma, used_define, used_undef>: Properly use
784         source_location as parameter type, rather than unsigned int.
786 2011-07-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
788         PR target/39150
789         * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
790         like i[34567]86-*-solaris2.1[0-9]*.
791         * configure: Regenerate.
793 2011-06-16  Jason Merrill  <jason@redhat.com>
795         PR c++/45399
796         * lex.c (lex_raw_string): Don't check for embedded NUL.
798 2011-06-06  Dodji Seketeli  <dodji@redhat.com>
800         PR preprocessor/48532
801         * directives.c (do_pragma): Don't forget the invocation location
802         when parsing the pragma name of a namespaced pragma directive.
804 2011-05-29  John Tytgat  <John.Tytgat@aaug.net>
806         * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
808 2011-05-22  Uros Bizjak  <ubizjak@gmail.com>
810         PR target/49104
811         * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
812         is defined.  Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
814 2011-04-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
816         * system.h (ENUM_BITFIELD): Remove.
818 2011-04-24  Jakub Jelinek  <jakub@redhat.com>
820         PR preprocessor/48740
821         * lex.c (lex_raw_string): When raw string ends with
822         ??) followed by raw prefix and ", ensure it is preprocessed
823         with ??) rather than ??].
825 2011-04-20  Jim Meyering  <meyering@redhat.com>
827         * files.c (destroy_cpp_file): Remove useless if-before-free.
828         * init.c (cpp_destroy): Likewise.
829         * macro.c (replace_args): Likewise.
830         * pch.c (cpp_valid_state): Likewise.
832 2011-03-25  Kai Tietz  <ktietz@redhat.com>
834         * files.c (file_hash_eq): Use filename_cmp
835         instead of strcmp.
836         (nonexistent_file_hash_eq): Likewise.
837         (remap_filename): Likewise.
838         Handle absolute DOS-path,
839         (append_file_to_dir): Check for IS_DIR_SEPARATOR
840         instead of slash.
841         (read_name_map): Likewise.
842         * linemap.c (linemap_add): Use filename_cmp
843         instead of strcmp.
844         * mkdeps.c (apply_vpath): Use filename_ncmp
845         instead of strncmp.
846         (deps_restore): Use filename_cmp instead of
847         strcmp.
848         * init.c (read_original_directory): Use
849         IS_DIR_SEPARATOR instead of checking for slash.
851 2011-03-21  Michael Meissner  <meissner@linux.vnet.ibm.com>
853         PR preprocessor/48192
854         * directives.c (do_ifdef): Do not consider conditional macros as
855         being defined.
856         (do_ifndef): Ditto.
857         * expr.c (parse_defined): Ditto.
859 2011-03-18  Richard Henderson  <rth@redhat.com>
861         PR bootstrap/45381
862         * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
864 2011-11-04  Eric Botcazou  <ebotcazou@adacore.com>
865             Jakub Jelinek  <jakub@redhat.com>
867         PR preprocessor/39213
868         * directives.c (end_directive): Call _cpp_remove_overlay for deferred
869         pragmas as well in traditional mode.
871 2010-11-17  Ian Lance Taylor  <iant@google.com>
873         PR bootstrap/45538
874         * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS.  Remove switch of
875         AC_LANG based on ENABLE_BUILD_WITH_CXX.
877 2010-11-16  Kai Tietz  <kai.tietz@onevision.com>
879         PR preprocessor/17349
880         * lex.c (save_comment): Handle in argument passing c++
881         comments special.
883 2010-11-02  Ian Lance Taylor  <iant@google.com>
885         * configure.ac: Use AC_SYS_LARGEFILE.
886         * configure: Rebuild.
887         * config.in: Rebuild.
889 2010-10-19  Basile Starynkevitch  <basile@starynkevitch.net>
891         * line-map.h (source_location): Remove obsolete comment
892         mentioning location_s.
894 2010-09-29  Kai Tietz  <kai.tietz@onevision.com>
896         PR preprocessor/45362
897         * directives.c (cpp_pop_definition): Make static.
898         (do_pragma_push_macro): Reworked to store text
899         definition.
900         (do_pragma_pop_macro): Add free text definition.
901         (cpp_push_definition): Removed.
902         * include/cpplib.h (cpp_push_definition): Removed.
903         (cpp_pop_definition): Likewise.
904         * internal.h (def_pragma_macro): Remove member 'value'
905         and add new members 'definition', 'line',
906         'syshdr', 'sued' and 'is_undef'.
907         * pch.c (_cpp_restore_pushed_macros): Rework to work
908         on text definition and store additional macro flags.
909         (_cpp_save_pushed_macros): Likewise.
911 2010-09-29  Joseph Myers  <joseph@codesourcery.com>
913         * include/cpplib.h (cpp_options): Rename warn_deprecated,
914         warn_traditional, warn_long_long and pedantic.
915         * directives.c (directive_diagnostics, _cpp_handle_directive):
916         Update names of cpp_options members.
917         * expr.c (cpp_classify_number, eval_token): Update names of
918         cpp_options members.
919         * init.c (cpp_create_reader, post_options): Update names of
920         cpp_options members.
921         * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
922         cpp_options members.
923         * macro.c (parse_params): Update names of cpp_options members.
925 2010-09-15  Ian Lance Taylor  <iant@google.com>
927         * init.c: Fix type name in comment.
929 2010-08-31  Jakub Jelinek  <jakub@redhat.com>
931         PR preprocessor/45457
932         * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
933         needed.
934         * directives.c (do_ifdef, do_ifndef): Likewise.
936 2010-08-26  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
938         * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
940 2010-08-24  Richard Henderson  <rth@redhat.com>
942         PR bootstrap/45376
943         * configure.ac (HAVE_SSE4): New check.
944         * configure, config.in: Rebuild.
945         * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
947 2010-08-24  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
949         * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
950         etc. on Solaris 2/x86.
952 2010-08-21  Richard Henderson  <rth@redhat.com>
953             Andi Kleen <ak@linux.intel.com>
954             David S. Miller  <davem@davemloft.net>
956         * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
957         (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
958         (ptrdiff_t): Check via AC_CHECK_TYPE.
959         * config.in, configure: Rebuild.
960         * system.h: Include stdint.h, if available.
961         * lex.c (WORDS_BIGENDIAN): Provide default.
962         (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
963         acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
964         search_line_sse2, search_line_sse42, init_vectorized_lexer,
965         search_line_fast): New.
966         (_cpp_clean_line): Use search_line_fast.  Restructure the fast
967         loop to make it clear when we're leaving the loop.  Stay in the
968         fast loop for non-trigraph '?'.
970 2010-06-11  Jakub Jelinek  <jakub@redhat.com>
972         * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
973         callback.
974         (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
975         (cpp_macro_definition): Remove const qual from second argument.
976         * macro.c (enter_macro_context): Call user_builtin_macro callback for
977         NODE_BUILTIN !NODE_USED macros.
978         (warn_of_redefinition): Likewise.  Remove const qual from second
979         argument.
980         (cpp_macro_definition): Likewise.
981         * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
982         for NODE_BUILTIN !NODE_USED macros.
984 2010-06-10  Joseph Myers  <joseph@codesourcery.com>
986         * include/cpplib.h (struct cpp_options): Remove show_column.
987         * init.c (cpp_create_reader, post_options): Don't set show_column.
989 2010-06-09  Joern Rennecke  <joern.rennecke@embecosm.com>
991         PR bootstrap/44432
992         * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
993         check that C++ compiler works.
994         * configure: Regenerate.
996 2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
998         * include/symtab.h (ht_identifier_ptr): New.
1000 2010-06-03  Joern Rennecke <joern.rennecke@embecosm.com>
1001             Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1003         PR bootstrap/42798
1004         * configure.ac: Check for declaration of 'basename(char *)'.
1005         * configure: Regenerate.
1006         * config.in: Regenerate.
1008 2010-04-25  Joseph Myers  <joseph@codesourcery.com>
1010         * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
1011         * init.c (lang_defaults): Add entries for new language variants.
1012         (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
1013         variants.
1015 2010-04-09  Manuel López-Ibáñez <manu@gcc.gnu.org>
1017         PR cpp/43195
1018         * files.c (report_missing_guard): Test for #pragma once.
1020 2010-04-07  Simon Baldwin  <simonb@google.com>
1022         * directives.c (do_diagnostic): Add warning reason argument,
1023         call appropriate error reporting function for code.
1024         (directive_diagnostics): Call specific warning functions with
1025         warning reason where appropriate.
1026         (do_error, do_warning, do_pragma_dependency): Add warning reason
1027         argument to do_diagnostic calls.
1028         * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
1029         _cpp_create_definition): Call specific warning functions with
1030         warning reason where appropriate.
1031         * Makefile.in: Add new diagnostic functions to gettext translations.
1032         * include/cpplib.h (struct cpp_callbacks): Add warning reason code
1033         to error callback.
1034         (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
1035         CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
1036         (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
1037         CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
1038         CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
1039         CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
1040         CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
1041         CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
1042         CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
1043         warning reason codes.
1044         (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
1045         cpp_warning_with_line, cpp_pedwarning_with_line,
1046         cpp_warning_with_line_syshdr): New specific error reporting functions.
1047         * pch.c (cpp_valid_state): Call specific warning functions with
1048         warning reason where appropriate.
1049         * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
1050         diagnostic handlers.
1051         (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
1052         cpp_warning_with_line, cpp_pedwarning_with_line,
1053         cpp_warning_with_line_syshdr): New specific error reporting functions.
1054         * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
1055         specific warning functions with warning reason where appropriate.
1056         * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
1057         warn_about_normalization, lex_identifier_intern, lex_identifier,
1058         _cpp_lex_direct): Ditto.
1059         * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
1060         narrow_str_to_charconst): Ditto.
1062 2010-04-06  Jakub Jelinek  <jakub@redhat.com>
1064         PR preprocessor/43642
1065         * lex.c (lex_raw_string): Change type of TYPE variable to
1066         unsigned char.
1068 2010-04-02  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1070         * aclocal.m4: Regenerate.
1072 2010-03-29  Jason Merrill  <jason@redhat.com>
1074         More N3077 raw string changes
1075         * charset.c (cpp_interpret_string): Don't transform UCNs in raw
1076         strings.
1077         * lex.c (bufring_append): Split out from...
1078         (lex_raw_string): ...here.  Undo trigraph and line splicing
1079         transformations.  Do process line notes in multi-line literals.
1080         (_cpp_process_line_notes): Ignore notes that were already handled.
1082         Some raw string changes from N3077
1083         * charset.c (cpp_interpret_string): Change inner delimiters to ().
1084         * lex.c (lex_raw_string): Likewise.  Also disallow '\' in delimiter.
1086 2010-02-11  Jakub Jelinek  <jakub@redhat.com>
1088         * init.c (read_original_filename): Don't call read_original_directory
1089         if _cpp_handle_directive returns 0.
1091 2010-01-01  Joseph Myers  <joseph@codesourcery.com>
1093         PR preprocessor/41947
1094         * expr.c (cpp_classify_number): Give error for hexadecimal
1095         floating-point constant with no digits before or after point.
1097 2009-11-20  Arnaud Charlet  <charlet@adacore.com>
1099         * macro.c (enter_macro_context): Call cb.used callback if defined.
1100         * directives.c (do_idef, do_ifndef): Ditto.
1101         * include/cpplib.h (struct cpp_callbacks): Add used callback.
1103 2009-11-11  Kai Tietz  <kai.tietz@onevision.com>
1105         * directives.c (do_pragma_push_macro): New pragma handler.
1106         (do_pragma_pop_macro): Likewise.
1107         (_cpp_init_internal_pragmas): Add push_macro and
1108         pop_macro handler to internal pragmas.
1109         (lex_macro_node_from_str): Removed.
1110         (cpp_push_definition): Replace lex_macro_node_from_str
1111         by _cpp_lex_identifier.
1112         (cpp_pop_definition): Likewise.
1113         * internal.h (_cpp_lex_identifier): New prototype.
1114         (def_pragma_macro): New structure.
1115         (cpp_reader): New member pushed_macros.
1116         * lex.c (_cpp_lex_identifier): New function.
1117         (lex_identifier_intern): New function.
1118         * init.c (cpp_create_reader): Initialize pushed_macros
1119         member.
1120         (cpp_destroy): Free elements in pushed_macros member.
1121         * pch.c (_cpp_save_pushed_macros): New function.
1122         (_cpp_restore_pushed_macros): Likewise.
1123         (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
1124         (cpp_read_state): Use _cpp_restore_pushed_macros.
1126 2009-10-19  Jakub Jelinek  <jakub@redhat.com>
1128         * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
1129         (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
1130         and char32_cset_desc.
1131         (converter_for_type): Handle CPP_UTF8STRING.
1132         (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
1133         * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
1134         (parse_include): Reject raw strings.
1135         * include/cpplib.h (CPP_UTF8STRING): New token type.
1136         * internal.h (struct cpp_reader): Add utf8_cset_desc field.
1137         * lex.c (lex_raw_string): New function.
1138         (lex_string): Handle u8 string literals, call lex_raw_string
1139         for raw string literals.
1140         (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
1141         sequences.
1142         * macro.c (stringify_arg): Handle CPP_UTF8STRING.
1144 2009-10-14  Jakub Jelinek  <jakub@redhat.com>
1146         PR preprocessor/41543
1147         * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
1148         * line-map.c (linemap_init): Initialize highest_location and
1149         highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
1151 2009-10-09  Jason Merrill  <jason@redhat.com>
1153         * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
1155 2009-10-09  Neil Vachharajani <nvachhar@google.com>
1157         * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
1158         sccs.
1160 2009-09-23  Loren J. Rittle  <ljrittle@acm.org>
1162         * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
1163         * configure: Rebuilt.
1165 2009-09-22  Richard Guenther  <rguenther@suse.de>
1167         PR pch/38987
1168         * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
1170 2009-09-18  Chris Demetriou  <cgd@google.com>
1172         PR preprocessor/28435:
1173         * include/cpplib.h (struct cpp_options): Add new member
1174         deps.need_preprocessor_output.
1175         * files.c (open_file_failed): If preprocessor output is needed
1176         always report an error.
1178 2009-09-13  Kai Tietz  <kai.tietz@onevision.com>
1180         * configure.ac: Set for i?86-w64-mingw*
1181         need_64bit_hwint to yes.
1182         * configure: Regenerated.
1184 2009-09-10  Jason Merrill  <jason@redhat.com>
1186         * directives.c (cpp_define): constify.
1188 2009-09-02  Ian Lance Taylor  <iant@google.com>
1190         * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
1192 2009-08-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1194         * configure.ac (AC_PREREQ): Bump to 2.64.
1196 2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1198         * aclocal.m4: Regenerate.
1199         * config.in: Regenerate.
1200         * configure: Regenerate.
1202 2009-08-17  Tom Tromey  <tromey@redhat.com>
1204         PR preprocessor/41067:
1205         * charset.c (convert_escape): Add missing ":" to error text.
1207 2009-07-27  Douglas B Rupp  <rupp@gnat.com>
1209         * include/cpplib.h (INO_T_CPP): New macro.
1210         (struct cpp_dir): Use it.
1212 2009-07-20  Jerry Quinn  <jlquinn@optonline.net>
1214         PR regression/40800
1215         * configure.ac: Use = instead of == for testing
1216         ENABLE_BUILD_WITH_CXX.
1217         * configure: Rebuild.
1219 2009-07-17  Jerry Quinn  <jlquinn@optonline.net>
1221         * directives.c (do_linemarker, do_line): Use CPP_STRING for
1222         ignored enum value.
1223         * files.c (find_file_in_dir): Add cast from void* to char*.
1224         * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
1225         * Makefile.in: (WARN_CFLAGS): Use general and C-specific
1226         warnings.
1227         (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
1228         ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
1229         COMPILER_FLAGS): New.
1230         (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
1231         (COMPILE.base): Use COMPILER instead of CC.  Use COMPILER_FLAGS
1232         instead of ALL_CFLAGS.
1233         * configure.ac: Invoke AC_PROG_CXX.  Separate C-specific warnings
1234         from other warnings.  Add -Wc++-compat to C-specific warnings.
1235         Check for --enable-build-with-cxx.  Set and substitute
1236         ENABLE_BUILD_WITH_CXX.  Invoke ZW_PROG_COMPILER_DEPENDENCIES
1237         according to ENABLE_BUILD_WITH_CXX.  Invoke AC_LANG before
1238         AC_CHECK_HEADERS.
1239         * configure: Rebuild.
1240         * include/cpp-id-data.h: Remove extern "C".
1241         * include/line-map.h: Likewise.
1242         * include/mkdeps.h: Likewise.
1243         * include/symtab.h: Likewise.
1244         * internal.h: Likewise.
1246 2009-06-23  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1248         * directives.c (parse_include): Add location argument. Update all
1249         calls.
1250         (parse_answer): Likewise.
1251         (do_include_common): Error with exact location.
1252         (parse_assertion): Likewise.
1254 2009-06-18  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1256         * expr.c (num_div_op): Take explicit location.
1258 2009-06-17  Ian Lance Taylor  <iant@google.com>
1260         * include/cpplib.h (progname): Don't declare.
1262 2009-06-12  Ian Lance Taylor  <iant@google.com>
1264         * include/cpplib.h (struct cpp_options): Add
1265         warn_cxx_operator_names field.
1266         (NODE_WARN_OPERATOR): Define.
1267         (struct cpp_hashnode): Increase flags field to 10 bits, decrease
1268         type to 6 bits.
1269         * init.c (mark_named_operators): Add flags parameter.
1270         (cpp_post_options): Pick flags value to pass to
1271         mark_named_operators.
1272         * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
1273         identifier is an operator name in C++.
1275 2009-06-01  Aldy Hernandez  <aldyh@redhat.com>
1277         * include/line-map.h (LAST_SOURCE_COLUMN): New.
1279 2009-06-01  Ian Lance Taylor  <iant@google.com>
1281         * include/cpp-id-data.h: Add extern "C".
1282         * include/line-map.h: Likewise.
1283         * include/mkdeps.h: Likewise.
1284         * include/symtab.h: Likewise.
1285         * internal.h: Likewise.
1287 2009-05-15  Ian Lance Taylor  <iant@google.com>
1289         * include/cpplib.h (enum cpp_builtin_type): Rename from enum
1290         builtin_type.  Change all uses.
1292 2009-05-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1294         PR cpp/36674
1295         * directives (do_linemarker): Compensate for the increment in
1296         location that occurs when we reach the end of line.
1297         * files (_cpp_stack_include): Mention _cpp_find_file in the
1298         comment.
1300 2009-05-10  Joseph Myers  <joseph@codesourcery.com>
1302         * include/cpplib.h (enum cpp_token_fld_kind): Add
1303         CPP_TOKEN_FLD_TOKEN_NO.
1304         (struct cpp_macro_arg, struct cpp_identifier): Define.
1305         (union cpp_token_u): Use struct cpp_identifier for identifiers.
1306         Use struct cpp_macro_arg for macro arguments.  Add token_no for
1307         CPP_PASTE token numbers.
1308         * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
1309         do_pragma_poison, parse_assertion): Use val.node.node in place of
1310         val.node.
1311         * expr.c (parse_defined, eval_token): Use val.node.node in place
1312         of val.node.
1313         * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
1314         cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
1315         cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
1316         place of val.arg_no.  Use val.node.node in place of val.node.
1317         * macro.c (replace_args, cpp_get_token, parse_params,
1318         lex_expansion_token, create_iso_definition, cpp_macro_definition):
1319         Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
1320         Use val.node.node in place of val.node.
1322 2009-05-03  Joseph Myers  <joseph@codesourcery.com>
1324         * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
1325         UTF-8 sequences.
1327 2009-04-25  Joseph Myers  <joseph@codesourcery.com>
1329         PR preprocessor/39559
1330         * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
1331         constants larger than intmax_t in C99 mode.
1333 2009-04-21  Taras Glek <tglek@mozilla.com>
1335         * include/cpp-id-data.h: Update GTY annotations to new syntax.
1336         * include/cpplib.h: Likewise.
1337         * include/line-map.h: Likewise.
1338         * include/symtab.h: Likewise.
1340 2009-04-22  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1342         PR c++/14875
1343         * lex.c (cpp_type2name): Take a flags parameter. Call
1344         cpp_named_operator2name for named operators and cpp_digraph2name
1345         for digraphs.
1346         (cpp_digraph2name): New.
1347         (cpp_spell_token): Use it.
1348         (cpp_output_token): Likewise.
1349         * include/cpplib.h (cpp_type2name): Update declaration.
1350         * init.c (cpp_named_operator2name): New.
1351         * internal.h (cpp_named_operator2name): Declare.
1353 2009-04-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1355         PR c++/13358
1356         * init.c (cpp_create_reader): Wlong_long is disabled by default.
1357         * expr.c (cpp_classify_number): Give different messages for C and
1358         C++ front-ends.
1360 2009-04-19  Joseph Myers  <joseph@codesourcery.com>
1362         PR preprocessor/20078
1363         * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
1364         field.
1365         * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
1366         (struct cpp_token): Change flags to unsigned short.
1367         * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
1368         (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
1369         (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
1370         tokens.
1371         * macro.c (macro_real_token_count): New.
1372         (enter_macro_context, replace_args): Use macro_real_token_count.
1373         (create_iso_definition): Record whitespace surrounding and digraph
1374         spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
1375         Set extra_tokens and save CPP_PASTE tokens with arg_no set for
1376         multiple consecutive ## tokens.
1377         (_cpp_create_definition): Initialize extra_tokens.
1378         (cpp_macro_definition): Use macro_real_token_count.
1380 2009-04-18  Joseph Myers  <joseph@codesourcery.com>
1382         * directives.c (parse_include): Pass true to check_eol.
1384 2009-04-18  Joseph Myers  <joseph@codesourcery.com>
1386         PR preprocessor/39646
1387         * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
1388         * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
1389         * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
1390         place of LC_RENAME.
1392 2009-04-18  Joseph Myers  <joseph@codesourcery.com>
1394         PR preprocessor/39647
1395         * directives.c (check_eol): Add parameter expand.
1396         (do_undef, parse_include, do_line, do_linemarker, do_ident,
1397         do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
1398         do_else, do_endif, do_assert, do_unassert): All callers changed.
1399         Pass true from do_line, false elsewhere.
1401 2009-04-12  Joseph Myers  <joseph@codesourcery.com>
1403         PR preprocessor/31869
1404         * macro.c (stringify_arg): Handle NULL source token in padding
1405         token where previous padding token did not have source token with
1406         preceding whitespace.
1408 2009-04-09  Jakub Jelinek  <jakub@redhat.com>
1410         * Makefile.in: Change copyright header to refer to version
1411         3 of the GNU General Public License and to point readers at the
1412         COPYING3 file and the FSF's license web page.
1413         * charset.c: Likewise.
1414         * directives-only.c: Likewise.
1415         * directives.c: Likewise.
1416         * errors.c: Likewise.
1417         * expr.c: Likewise.
1418         * files.c: Likewise.
1419         * identifiers.c: Likewise.
1420         * include/cpp-id-data.h: Likewise.
1421         * include/cpplib.h: Likewise.
1422         * include/line-map.h: Likewise.
1423         * include/mkdeps.h: Likewise.
1424         * include/symtab.h: Likewise.
1425         * init.c: Likewise.
1426         * internal.h: Likewise.
1427         * lex.c: Likewise.
1428         * line-map.c: Likewise.
1429         * macro.c: Likewise.
1430         * makeucnid.c: Likewise.
1431         * mkdeps.c: Likewise.
1432         * pch.c: Likewise.
1433         * symtab.c: Likewise.
1434         * system.h: Likewise.
1435         * traditional.c: Likewise.
1436         * ucnid.tab: Likewise.
1437         * ucnid.h: Regenerate.
1439 2009-04-01  Janis Johnson  <janis187@us.ibm.com>
1441         PR c/39027
1442         * include/cpplib.h (CPP_N_DEFAULT): Define.
1443         * expr.c (interpret_float_suffix): Recognize d or D for double,
1444         return new value for default.
1445         (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
1447         PR c/33466
1448         * expr.c (interpret_float_suffix): Reject invalid suffix that uses
1449         letters from decimal float and fixed-point suffixes.
1451 2009-03-31  Joseph Myers  <joseph@codesourcery.com>
1453         PR preprocessor/15638
1454         * files.c (_cpp_find_file): Call open_file_failed after diagnosing
1455         invalid PCH.
1456         (open_file_failed): Make error for missing file fatal.
1457         * include/cpplib.h (CPP_DL_FATAL): Define.
1459 2009-03-30  Sergiy Vyshnevetskiy  <serg@vostok.net>
1461         PR preprocessor/31932:
1462         * internal.h: Don't mention HAVE_ICONV_H.
1463         * configure, config.in: Rebuild.
1464         * configure.ac: Don't check for iconv.h.
1466 2009-03-30  Tom Tromey  <tromey@redhat.com>
1468         PR preprocessor/39512:
1469         * line-map.c (linemap_init): Initialize 'reallocator' field.
1471 2009-03-30  Jakub Jelinek  <jakub@redhat.com>
1473         PR target/39558
1474         * macro.c (cpp_get_token): If macro_to_expand returns NULL
1475         and used some tokens, add CPP_PADDING before next token.
1477 2009-03-29  Joseph Myers  <joseph@codesourcery.com>
1479         PR preprocessor/34695
1480         * makedepend.c: Remove.
1481         * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
1482         (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
1483         * directives.c (cpp_errors): Remove.
1484         * errors.c (print_location, _cpp_begin_message, v_message):
1485         Remove.
1486         (cpp_error, cpp_error_with_line): Always use error callback.
1487         (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
1488         * include/cpplib.h (cpp_options): Remove pedantic_errors,
1489         inhibit_warnings, warn_system_headers, inhibit_errors,
1490         warnings_are_errors, client_diagnostic.
1491         (cpp_callbacks): Add extra arguments to error callback; make it
1492         return bool.
1493         (cpp_finish): Return void.
1494         (cpp_destroy): Remove inaccurate comment about return value.
1495         (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
1496         (CPP_DL_NOTE): Define.
1497         * include/line-map.h (linemap_print_containing_files): Remove.
1498         * init.c (cpp_finish): Do not check for or return number of
1499         errors.
1500         * internal.h (cpp_reader): Remove errors field.
1501         * line-map.c (linemap_print_containing_files): Remove.
1502         * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
1503         about previous definition.  Only emit it if previous diagnostic
1504         was emitted.
1506 2009-03-28  Joseph Myers  <joseph@codesourcery.com>
1508         * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
1509         mkinstalldirs.
1511 2009-03-18  Jakub Jelinek  <jakub@redhat.com>
1513         * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
1515 2009-02-21  Joseph Myers  <joseph@codesourcery.com>
1517         * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
1518         header name.
1519         (_cpp_lex_direct): Handle this.
1521 2009-02-15  Richard Guenther  <rguenther@suse.de>
1523         Revert last change.
1525 2009-02-13  Richard Guenther  <rguenther@suse.de>
1527         * configure.ac: Enable LFS.
1528         * configure: Re-generate.
1529         * config.in: Likewise.
1531 2009-01-05  Ben Elliston  <bje@au.ibm.com>
1533         * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
1534         (.po.pox): Likewise.
1535         (po/$(PACKAGE).pot): Likewise.
1537 2008-12-10  Alexandre Oliva  <aoliva@redhat.com>
1539         PR target/37033
1540         * pch.c (cpp_valid_state): Improve message for poisoned symbols.
1541         Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
1543 2008-11-29  Joseph Myers  <joseph@codesourcery.com>
1545         * lex.c (cpp_token_len): Use 6 as default length.
1547 2008-10-31  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1549         * expr.c (struct op): Add location.
1550         (_cpp_parse_expr): Propagate locations throught the stack
1551         of expressions.
1552         (reduce): Likewise.
1553         (check_promotion): Use explicit location in errors.
1555 2008-10-05  Matthew Gingell  <gingell@adacore.com>
1556             Arnaud Charlet  <charlet@adacore.com>
1558         * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
1559         (cpp_get_comments): New function.
1560         * internal.h (struct cpp_reader): Add comments field.
1561         * init.c (cpp_destroy): Free comments.
1562         * lex.c (store_comment, cpp_get_comments): New functions.
1563         (comments): New struct.
1564         (save_comment): Store comments in comments struct.
1566 2008-09-18  Simon Baldwin  <simonb@google.com>
1568         * include/cpplib.h (struct cpp_options): Add new boolean flag
1569         warn_builtin_macro_redefined.
1570         * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
1571         * (struct builtin_operator): Split out from previous struct builtin,
1572         enhance extra const correctness.
1573         * (struct builtin_macro): Split out from previous struct builtin, add
1574         new always_warn_if_redefined flag, enhance const correctness.
1575         * (mark_named_operators): Use struct builtin_operator.
1576         * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
1577         to builtins selectively.
1578         * macro.c (warn_of_redefinition): Return false if a builtin macro
1579         is not flagged with NODE_WARN.
1581 2008-07-31  Jakub Jelinek  <jakub@redhat.com>
1583         PR preprocessor/36649
1584         * files.c (struct report_missing_guard_data): New type.
1585         (report_missing_guard): Put paths into an array instead of printing
1586         them right away.  Return 1 rather than 0.
1587         (report_missing_guard_cmp): New function.
1588         (_cpp_report_missing_guards): Sort and print paths gathered by
1589         report_missing_guard callback.
1591 2008-07-22  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1593         PR 28079
1594         * directives.c (strtolinenum): Handle overflow.
1595         (do_line): Give a warning if line number overflowed.
1596         (do_linemarker): Update call to strtolinenum.
1598 2008-07-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1600         * include/line-map.h (linenum_type): New typedef.
1601         (struct line_map): Use it.
1602         (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
1603         (SOURCE_COLUMN): Likewise.
1604         * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
1605         source_location values in a variable of type linenum_type.
1606         * directives.c (struct if_stack): Use linenum_type.
1607         (strtoul_for_line): Rename as strtolinenum.
1608         (do_line): Use linenum_type.
1609         (do_linemarker): Use linenum_type and strtolinenum.
1610         (_cpp_do_file_change): Use linenum_t.
1611         * line-map.c (linemap_add): Likewise.
1612         (linemap_line_start): Likewise.
1613         * traditional.c (struct fun_macro): 'line' is a source_location.
1614         * errors.c (print_location): Use linenum_type.
1615         * directives-only.c (_cpp_preprocess_dir_only): Likewise.
1616         * internal.h (CPP_INCREMENT_LINE): Likewise.
1617         * lex.c (_cpp_skip_block_comment): Use source_location.
1618         
1619 2008-07-14  Ben Elliston  <bje@au.ibm.com>
1621         * include/cpplib.h (NODE_CONDITIONAL): New.
1622         (struct cpp_callbacks): New macro_to_expand field.
1623         (struct cpp_hashnode): Adjust size of flags and type fields.
1624         (cpp_peek_token): Prototype.
1625         * lex.c (cpp_peek_token): New function.
1626         (_cpp_temp_token): Protect pre-existing lookaheads.
1627         * macro.c (cpp_get_token): Expand any conditional macros.
1628         (_cpp_backup_tokens_direct): New.
1629         (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
1630         (warn_of_redefinition): Silently allow redefined conditional
1631         macros.
1632         (_cpp_create_definition): Remove the conditional flag when a user
1633         defines one of the conditional macros.
1634         * internal.h (_cpp_backup_tokens_direct): New prototype.
1636 2008-06-13  Andrew Haley  <aph@redhat.com>
1638         PR preprocessor/33305
1639         * macro.c (replace_args): Print a warning for empty macro
1640         arguments in C89 and C++.
1642 2008-06-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1644         * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
1645         * configure: Regenerate.
1647 2008-06-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1649         * Makefile.in (datarootdir): New variable.
1651 2008-06-12  H.J. Lu  <hongjiu.lu@intel.com>
1653         PR preprocessor/36479
1654         * charset.c (cpp_interpret_string_notranslate): Also set
1655         narrow_cset_desc.width.
1657 2008-06-07  Joseph Myers  <joseph@codesourcery.com>
1659         * configure.ac (parisc*64*-*-*): Remove.
1660         * configure: Regenerate.
1662 2008-05-30  Tom Tromey  <tromey@redhat.com>
1664         PR preprocessor/36320:
1665         * internal.h (_cpp_parse_expr): Update.
1666         * expr.c (_cpp_parse_expr): Add 'is_if' argument.  Update error
1667         messages.
1668         * directives.c (do_if): Update.
1669         (do_elif): Require expression if processing group.
1671 2008-05-30  Danny Smith  <dannysmith@users.sourceforge.net>
1673         * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
1675 2008-05-21  Tom Tromey  <tromey@redhat.com>
1677         PR preprocessor/27777:
1678         * lex.c (cpp_output_line_to_string): New function.
1679         * internal.h (_cpp_begin_message): Don't declare.
1680         * errors.c (_cpp_begin_message): Now static.
1681         * include/cpplib.h (cpp_output_line_to_string): Declare.
1682         * directives.c (do_diagnostic): Rewrote.  Use
1683         cpp_output_line_to_string.  Don't use _cpp_begin_message.
1685 2008-05-21  Tom Tromey  <tromey@redhat.com>
1687         * include/symtab.h (HT_ALLOCED): Remove.
1688         (ht_purge): Declare.
1689         * symtab.c (DELETED): New define.
1690         (ht_lookup): Update comment.
1691         (ht_lookup_with_hash): Handle deleted entries.  Remove HT_ALLOCED
1692         code.  Use subobject allocator for strings, if it exists.
1693         (ht_expand): Handle deleted entries.
1694         (ht_forall): Likewise.
1695         (ht_purge): New function.
1696         (ht_dump_statistics): Print deletion statistics.
1698 2008-05-13  Tom Tromey  <tromey@redhat.com>
1700         PR preprocessor/22168:
1701         * include/cpplib.h (struct cpp_options) <objc>: Update
1702         documentation.
1703         * expr.c (eval_token): Warn for use of assertions.
1704         * directives.c (directive_diagnostics): Warn about extensions.
1705         (DEPRECATED): New define.
1706         (DIRECTIVE_TABLE): Use it.
1708 2008-05-06  Tom Tromey  <tromey@redhat.com>
1710         PR preprocessor/35313, PR preprocessor/36088:
1711         * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
1712         (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
1714 2008-05-04  David S. Miller  <davem@davemloft.net>
1716         * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
1717         * configure: Regenerate.
1719 2008-04-22  Daniel Franke  <franke.daniel@gmail.com>
1721         * include/cpplib.h (cpp_define_formatted): New.
1722         * directives.c (cpp_define_formatted): New.
1724 2008-04-21  Tom Tromey  <tromey@redhat.com>
1726         PR libcpp/33415:
1727         * charset.c (_cpp_convert_input): Add buffer_start argument.
1728         Ignore UTF-8 BOM if seen.
1729         * internal.h (_cpp_convert_input): Add argument.
1730         * files.c (struct _cpp_file) <buffer_start>: New field.
1731         (destroy_cpp_file): Free buffer_start, not buffer.
1732         (_cpp_pop_file_buffer): Likewise.
1733         (read_file_guts): Update.
1735 2008-04-18  Kris Van Hees <kris.van.hees@oracle.com>
1737         * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
1738         * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
1739         (struct cpp_options): Added uliterals.
1740         (cpp_interpret_string): Update prototype.
1741         (cpp_interpret_string_notranslate): Idem.
1742         * charset.c (init_iconv_desc): New width member in cset_converter.
1743         (cpp_init_iconv): Add support for char{16,32}_cset_desc.
1744         (convert_ucn): Idem.
1745         (emit_numeric_escape): Idem.
1746         (convert_hex): Idem.
1747         (convert_oct): Idem.
1748         (convert_escape): Idem.
1749         (converter_for_type): New function.
1750         (cpp_interpret_string): Use converter_for_type, support u and U prefix.
1751         (cpp_interpret_string_notranslate): Match changed prototype.
1752         (wide_str_to_charconst): Use converter_for_type.
1753         (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
1754         * directives.c (linemarker_dir): Macro U changed to UC.
1755         (parse_include): Idem.
1756         (register_pragma_1): Idem.
1757         (restore_registered_pragmas): Idem.
1758         (get__Pragma_string): Support CPP_STRING{16,32}.
1759         * expr.c (eval_token): Support CPP_CHAR{16,32}.
1760         * init.c (struct lang_flags): Added uliterals.
1761         (lang_defaults): Idem.
1762         * internal.h (struct cset_converter) <width>: New field.
1763         (struct cpp_reader) <char16_cset_desc>: Idem.
1764         (struct cpp_reader) <char32_cset_desc>: Idem.
1765         * lex.c (digraph_spellings): Macro U changed to UC.
1766         (OP, TK): Idem.
1767         (lex_string): Add support for u'...', U'...', u"..." and U"...".
1768         (_cpp_lex_direct): Idem.
1769         * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
1770         (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
1772 2008-04-18  Paolo Bonzini  <bonzini@gnu.org>
1774         PR bootstrap/35457
1775         * aclocal.m4: Regenerate.
1776         * configure: Regenerate.
1778 2008-04-17  Tom Tromey  <tromey@redhat.com>
1780         PR libcpp/34866:
1781         * errors.c (cpp_error): Don't reference a token before the start
1782         of the current run.
1784 2008-04-16  Tom Tromey  <tromey@redhat.com>
1786         * Makefile.in (TAGS_SOURCES): New variable.
1787         (TAGS): New target.
1789 2008-04-11  Kaz Kojima  <kkojima@gcc.gnu.org>
1791         * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
1792         and shbe-*-*.
1793         * configure: Rebuilt.
1795 2008-04-02  Joseph Myers  <joseph@codesourcery.com>
1797         * include/cpplib.h (struct cpp_callbacks): Add used_define,
1798         used_undef and before_define.
1799         (NODE_USED): Define.
1800         * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
1801         do_ifndef, cpp_pop_definition): Handle new flag and use new
1802         callbacks.
1803         * expr.c (parse_defined): Handle new flag and use new callbacks.
1804         * macro.c (enter_macro_context, _cpp_free_definition): Handle new
1805         flag and use new callbacks.
1807 2008-04-01  Jakub Jelinek  <jakub@redhat.com>
1809         PR pch/13675
1810         * files.c (struct _cpp_file): Remove pch field.
1811         (pch_open_file): Don't set file->pch, just file->pchname.
1812         (should_stack_file): After pfile->cb.read_pch call
1813         free pchname and clear pchname, don't close file->fd.
1814         Test file->pchname instead of file->pch.  Don't close fd after cb.
1815         (_cpp_stack_include): Test file->pchname instead of file->pch.
1817 2008-03-28  Tom Tromey  <tromey@redhat.com>
1819         * Makefile.in (POSTCOMPILE): New variable.
1820         (.c.o): Use it.
1822 2008-03-13  Tom Tromey  <tromey@redhat.com>
1824         PR libcpp/35322:
1825         * directives.c (destringize_and_run): Set pfile->directive.
1827 2008-03-06  Markus Milleder  <markus.milleder@generali.at>
1829         PR preprocessor/35458
1830         * mkdeps.c (munge): Quote '#' with a '\'.
1832 2008-02-27  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1834         PR preprocessor/35379
1835         * mkdeps.c (deps_write): Ensure the first target always appears
1836         in the first column, without leading backslash newline.  Avoid
1837         some more extra whitespace.
1839 2008-02-25  Thiemo Seufer <ths@mips.com>
1841         * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
1843 2008-02-19  Tom Tromey  <tromey@redhat.com>
1845         * traditional.c (lex_identifier): Use CPP_HASHNODE.
1846         * lex.c (lex_identifier): Use CPP_HASHNODE.
1847         * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
1848         do-while.
1849         * identifiers.c (alloc_node): Change return type.
1850         (_cpp_init_hashtable): Don't cast 'alloc_node'.
1851         (proxy_assertion_broken): New declaration.
1852         (cpp_forall_identifiers): Move comment.
1853         * line-map.c (linemap_add): Comment fix.
1854         (linemap_line_start): Indentation fix.
1856 2008-01-25  Jakub Jelinek  <jakub@redhat.com>
1858         PR preprocessor/34692
1859         * macro.c (collect_args): Add pragma_buff argument.  Push
1860         CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
1861         than into arguments.  Reset prevent_expansion and parsing_args
1862         state at CPP_PRAGMA_EOL/CPP_EOF.
1863         (funlike_invocation_p): Add pragma_buff argument, pass it through
1864         to collect_args.
1865         (enter_macro_context): Add result argument.  Adjust
1866         funlike_invocation_p caller.  Emit all deferred pragma tokens
1867         gathered during collect_args before the expansion, add a padding
1868         token.  Return 2 instead of 1 if any pragma tokens were prepended.
1869         (cpp_get_token): If enter_macro_context returns 2, don't return
1870         a padding token, instead cycle to grab CPP_PRAGMA token.
1871         * directives.c (_cpp_handle_directive): If was_parsing_args
1872         in deferred pragma, leave parsing_args and prevent_expansion as is.
1874 2008-01-22  Tom Tromey  <tromey@redhat.com>
1876         PR c++/34859
1877         * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
1878         __STDC_CONSTANT_MACROS.
1880 2008-01-07  Fred Fish  <fnf@specifix.com>
1882         PR preprocessor/30363
1883         * traditional.c (replace_args_and_push): Add local variable
1884         cxtquote, calculate the replacement text size assuming a 
1885         worst case of every input character quoted with backslash,
1886         and properly handle output quoting of quote characters in
1887         actual arguments used in function-like macros.
1889 2008-01-03  Tom Tromey  <tromey@redhat.com>
1891         PR preprocessor/34602
1892         * directives.c (do_line): Don't try to spell EOF token.
1893         (do_linemarker): Add comment.
1895 2007-12-11  DJ Delorie  <dj@redhat.com>
1897         * charset.c (convert_using_iconv): Close out any shift states,
1898         returning to the initial state.
1900 2007-12-06  Tom Tromey  <tromey@redhat.com>
1902         PR c/29172
1903         * internal.h (struct cpp_reader) <file_hash_entries>: Changed
1904         type.
1905         <file_hash_entries_allocated, file_hash_entries_used>: Removed.
1906         * files.c (FILE_HASH_POOL_SIZE): New macro.
1907         (struct file_hash_entry_pool): New.
1908         (destroy_all_cpp_files): New function.
1909         (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
1910         (new_file_hash_entry): Update.
1911         (free_file_hash_entries): New function.
1912         (_cpp_cleanup_files): Call free_file_hash_entries and
1913         destroy_all_cpp_files.
1914         (cpp_clear_file_cache): New function.
1915         * include/cpplib.h (cpp_clear_file_cache): Declare.
1917 2007-12-03  Tom Tromey  <tromey@redhat.com>
1919         PR preprocessor/34288
1920         * configure.ac, config.in: Rebuilt.
1921         * configure.ac: Check for ssize_t.
1923 2007-11-30  Tom Tromey  <tromey@redhat.com>
1925         PR preprocessor/32868
1926         * macro.c (_cpp_create_definition): Special case
1927         __STDC_FORMAT_MACROS.
1929 2007-11-16  Michael Matz  <matz@suse.de>
1931         * files.c (search_path_head): Fix check for absolute paths.
1933 2007-11-11  Tom Tromey  <tromey@redhat.com>
1935         PR c++/17557
1936         * include/cpplib.h (cpp_included_before): Declare.
1937         * files.c (struct file_hash_entry) <location>: New field.
1938         (_cpp_find_file): Initialize new field.
1939         (make_cpp_dir): Likewise.
1940         (cpp_included_before): New function.
1942 2007-11-01  Tom Tromey  <tromey@redhat.com>
1944         PR preprocessor/30805
1945         * macro.c (paste_tokens): Handle padding token.
1946         (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
1948 2007-10-31  Tom Tromey  <tromey@redhat.com>
1950         PR preprocessor/30786
1951         * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
1952         * directives.c (_cpp_do__Pragma): Return error status.
1953         * internal.h (_cpp_do__Pragma): Update.
1954         * directives.c (get__Pragma_string): Back up if EOF seen.
1956 2007-09-06  Tom Tromey  <tromey@redhat.com>
1958         * internal.h (struct cpp_reader) <invocation_location>: New
1959         field.
1960         (struct cpp_reader) <set_invocation_location>: Likewise.
1961         * init.c (cpp_set_line_map): New function.
1962         * line-map.c (linemap_add): Use linemap's allocator.
1963         * include/line-map.h (GTY): Define.
1964         (line_map_realloc): New typedef.
1965         (struct line_map): Mark with GTY.
1966         (struct line_maps): Likewise.
1967         (struct line_maps) <maps>: Likewise.
1968         (struct line_maps) <reallocator>: New field.
1969         * include/symtab.h (GTY): Conditionally define.
1970         * include/cpplib.h (cpp_set_line_map): Declare.
1971         (cpp_get_token_with_location): Declare.
1972         * macro.c (cpp_get_token): Set invocation_location on the reader.
1973         (cpp_get_token_with_location): New function.
1975 2007-08-30  Chao-ying Fu  <fu@mips.com>
1977         * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
1978         ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
1979         (cpp_classify_number): Support decimal fixed-point constants without
1980         exponents.
1981         Warn about fixed-point constants when -pedantic.
1982         * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
1983         comments to support fixed-point values.
1984         (CPP_N_FRACT, CPP_N_ACCUM): Define.
1986 2007-08-18  Tom Tromey  <tromey@redhat.com>
1988         PR preprocessor/32974
1989         * directives.c (parse_include): Don't check for EOL when
1990         processing #pragma dependency.
1992 2007-07-30  Ollie Wild  <aaw@google.com>
1994         * directives-only.c: New file.
1995         * internal.h (struct _cpp_dir_only_callbacks): New.
1996         (_cpp_preprocess_dir_only): New function.
1997         * directives.c (_cpp_handle_directive): Check directives_only before
1998         disabling execution of indented directives.
1999         * files.c (_cpp_stack_file): Add directives_only check.
2000         * include/cpplib.h (struct cpp_options): Add directives_only.
2001         (cpp_init_special_builtins): New function.
2002         * init.c (cpp_init_special_builtins): New function.
2003         (cpp_init_builtins): Move builtin_array initialization to
2004         cpp_init_special_builtins.
2005         (post_options): Check directives_only before setting
2006         pfile->state.prevent_expansion = 1.
2007         * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
2008         is expanded inside a directive while -fdirectives-only is enabled.
2009         * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
2010         (libcpp_a_SOURCES): Add directives-only.c.
2012 2007-07-04  Uros Bizjak  <ubizjak@gmail.com>
2014         * traditional.c (_cpp_scan_out_logical_line): Initialize
2015         fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
2016         fmacro.args to prevent 'may be used uninitialized' warning.
2018 2007-07-03  Uros Bizjak  <ubizjak@gmail.com>
2020         * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
2021         Add new constants.
2022         * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
2023         suffixes.  Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
2024         for 'q' or 'Q' suffixes.
2026 2007-06-17  Danny Smith  <dannysmith@users.sourceforge.net
2028         * files.c (open_file): Correct typo.
2030 2007-06-16  Vladimir Prus  <vladimir@codesourcery.com>
2032         * files.c (open_file): Prevent the call
2033         for stat from overwriting errno.
2035 2007-06-09  Vladimir Prus  <vladimir@codesourcery.com>
2037         * files.c (open_file): Account for the
2038         fact that on windows, opening a directory gives
2039         EACCES.
2041 2007-06-05  Joerg Wunsch  <j.gnu@uriah.heep.sax.de>
2043         PR preprocessor/23479
2044         * expr.c (cpp_classify_number): Implement 0b-prefixed binary
2045         integer constants.
2046         (append_digit): Likewise.
2047         * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
2048         binary integer constants.
2050 2007-05-31  Dave Korn  <dave.korn@artimi.com>
2052         PR preprocessor/14331
2053         * lex.c (_cpp_get_fresh_line):  Don't warn if no newline at EOF.
2055 2007-05-24  Ollie Wild  <aaw@google.com>
2057         * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
2058         * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
2059         (cpp_write_pch_state): Save __COUNTER__ state.
2060         (cpp_valid_state): Check valid __COUNTER__ state.
2061         (cpp_read_state): Read new __COUNTER__ state.
2062         * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
2063         * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
2064         * internal.h (struct cpp_reader): Add counter member.
2066 2007-05-23  Simon Martin  <simartin@users.sourceforge.net>
2068         PR preprocessor/20077
2069         * macro.c (create_iso_definition): Fixed the method to determine
2070         whether the token-pasting operator appears at the beginning or the end
2071         of a macro.
2073 2007-05-21  Ian Lance Taylor  <iant@google.com>
2075         * internal.h (struct cpp_reader): Add new fields:
2076         nonexistent_file_hash and nonexistent_file_ob.
2077         * files.c: Include "obstack.h".
2078         (find_file_in_dir): Before trying to open the file, look up the
2079         path name in the hash table of nonexistent files.  After failing
2080         to open the file, add the path name to the hash table.
2081         (_cpp_find_file): Cache the results of looking up the file name
2082         starting with the quote and bracket chain heads, if we can.
2083         (nonexistent_file_hash_eq): New static function.
2084         (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
2085         pfile->nonexistent_file_ob.
2086         (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
2087         pfile->nonexistent_file_ob.
2089 2007-05-14  Janis Johnson  <janis187@us.ibm.com>
2091         * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
2093         PR c/31924
2094         * expr.c (interpret_float_suffix): Check for invalid suffix.
2096 2007-05-02  Eric Christopher  <echristo@apple.com>
2098         * expr.c (num_div_op): Don't overflow if the result is
2099         zero.
2101 2007-05-02  Tom Tromey  <tromey@redhat.com>
2103         PR preprocessor/28709
2104         * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
2106 2007-03-30  Michael Meissner  <michael.meissner@amd.com>
2108         * directives.c (lex_macro_node_from_str): Fix alloca call to be
2109         type correct.
2111 2007-03-30  Richard Henderson  <rth@redhat.com>
2113         * directives.c (lex_macro_node_from_str): New.
2114         (cpp_push_definition, cpp_pop_definition): New.
2115         * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
2117 2007-03-01  Brooks Moses  <brooks.moses@codesourcery.com>
2119         * Makefile.in: Add dummy install-pdf target.
2121 2007-01-30  Tom Tromey  <tromey@redhat.com>
2123         PR preprocessor/30468
2124         * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
2125         './'.
2127 2007-01-30  Tom Tromey  <tromey@redhat.com>
2129         PR preprocessor/29966
2130         * macro.c (lex_expansion_token): Save and restore cpp_reader's
2131         cur_token.
2132         (_cpp_create_definition): Don't restore cur_token here.
2133         * lex.c (_cpp_lex_token): Added assertion.
2135 2007-01-27  Tom Tromey  <tromey@redhat.com>
2137         * configure: Rebuilt.
2139 2007-01-12  Tom Tromey  <tromey@redhat.com>
2141         PR preprocessor/28227
2142         * directives.c (lex_macro_node): Added 'is_def_or_undef'
2143         argument.
2144         (do_define): Update.
2145         (do_undef): Update.
2146         (do_ifdef): Update.
2147         (do_ifndef): Update.
2149 2007-01-11  Paolo Bonzini  <bonzini@gnu.org>
2151         * configure: Regenerate.
2153 2007-01-11  Paolo Bonzini  <bonzini@gnu.org>
2155         * configure: Regenerate.
2157 2007-01-04  Tom Tromey  <tromey@redhat.com>
2159         PR preprocessor/28165
2160         * internal.h (cpp_in_primary_file): New function.
2161         * directives.c (do_include_next): Use cpp_in_primary_file.
2162         (do_pragma_once): Likewise.
2163         (do_pragma_system_header): Likewise.
2165 2006-12-29  Ian Lance Taylor  <iant@google.com>
2167         * lex.c (_cpp_clean_line): Add uses of __builtin_expect.  Don't
2168         look backward at the end of the line unless we saw a backslash.
2170 2006-12-29  Jakub Jelinek  <jakub@redhat.com>
2172         PR preprocessor/29612
2173         * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
2174         only when new_sysp is non-zero.
2176 2006-12-28  Tom Tromey  <tromey@redhat.com>
2178         PR preprocessor/30001
2179         * charset.c (_cpp_convert_input): Check that to.len is greater
2180         than zero.
2182 2006-11-20  Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
2184         * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
2185         * configure: Rebuilt.
2187 2006-11-01      Douglas Gregor <doug.gregor@gmail.com>
2189         * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
2190         for experimental C++0x mode.
2191         * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
2192         adopted the preprocessor changes introduced in C99.
2194 2006-10-29  Joseph Myers  <joseph@codesourcery.com>
2196         * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
2197         depending on --enable-targets=all.
2198         * configure: Regenerate.
2200 2006-10-12  Jakub Jelinek  <jakub@redhat.com>
2202         PR preprocessor/28709
2203         * macro.c (paste_tokens): Do error reporting here, use BUF with the
2204         spelled LHS token as opposed to spelling it again.
2205         (paste_all_tokens): Don't report errors here, just break on failure.
2207 2006-10-10  Brooks Moses  <bmoses@stanford.edu>
2209         * Makefile.in: Added empty "pdf" target.
2211 2006-09-22  Geoffrey Keating  <geoffk@apple.com>
2213         * configure.ac: Make need_64_bit_hwint case for x86-darwin
2214         match exactly the glob in gcc/config.gcc.
2215         * configure: Regenerate.
2217 2006-09-13  Joseph S. Myers  <joseph@codesourcery.com>
2219         PR c/28768
2220         PR preprocessor/14634
2221         * lex.c (lex_string): Pedwarn for unterminated literals.
2223 2006-09-08  Eric Christopher  <echristo@apple.com>
2225         * configure.ac: Add 64-bit HWI support for i?86-darwin.
2227 2006-08-14  Steve Ellcey  <sje@cup.hp.com>
2229         PR c++/28288
2230         PR c++/14556
2231         * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
2232         (CPP_LAST_EQ): Change.
2233         (CPP_LAST_PUNCTUATOR): Change.
2234         * expr.c (cpp_operator): Remove MIN and MAX.
2235         (reduce): Remove CPP_MIN and CPP_MAX.
2236         (num_binary_op): Ditto.
2237         * lex.c (_cpp_lex_direct): Ditto.
2238         (cpp_avoid_paste): Remove ? as legal symbol after > or <.
2240 2006-06-09  Jakub Jelinek  <jakub@redhat.com>
2242         PR preprocessor/27746
2243         * directives.c (do_pragma): Handle pragma with valid namespace
2244         and invalid name coming from macro expansion.
2245         * directives.c (destringize_and_run): Initialize next field in
2246         context.
2248         PR c/27747
2249         PR c++/27748
2250         * directives.c (destringize_and_run): Set NO_EXPAND on the
2251         tokens.
2253         * macro.c (_cpp_backup_tokens): Fix comment typo.
2255 2006-05-31  Daniel Jacobowitz  <dan@codesourcery.com>
2257         * Makefile.in (CATALOGS): Add po/ prefix.
2258         * configure: Regenerated.
2260 2006-05-23  Carlos O'Donell  <carlos@codesourcery.com>
2262         * Makefile.in: Add install-html target. Add install-html to .PHONY
2264 2006-02-17  Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
2266         * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
2267         * files.c (_cpp_get_file_stat): New function.
2268         * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
2269         * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
2270         * internal.h (_cpp_get_file_stat): Prototype.
2271         (struct cpp_buffer): Add timestamp.
2273 2006-01-23  Jakub Jelinek  <jakub@redhat.com>
2275         PR preprocessor/25717
2276         * init.c (cpp_init_builtins): If __STDC__ will not change value
2277         between system headers and other sources, define it as a normal
2278         macro rather than a builtin.
2279         * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
2280         cpp_in_system_header condition.
2282 2006-01-05  Paolo Bonzini  <bonzini@gnu.org>
2284         * Makefile.in: Use -MMD instead of -MD.
2286 2006-01-04  Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
2287             Richard Henderson  <rth@redhat.com>
2289         Merge from gomp branch:
2290         * directives.c (struct pragma_entry): Add is_deferred.  Add ident
2291         entry to value union.
2292         (end_directive): Don't eat the line if in_deferred_pragma.
2293         (run_directive): Remove pragma hacks.
2294         (insert_pragma_entry): Remove.
2295         (new_pragma_entry): New.
2296         (register_pragma_1): Split out of register_pragma.  Only handle
2297         the lookup tree and return the new entry.
2298         (cpp_register_pragma): Fill in the pragma entry here.
2299         (cpp_register_deferred_pragma): New.
2300         (register_pragma_internal): New.
2301         (_cpp_init_internal_pragmas): Use register_pragma_internal.
2302         (do_pragma): Allow pragma expansion after namespace.  For deferred
2303         pragmas, don't slurp the line into a string.
2304         (destringize_and_run): Save tokens for deferred pragmas.
2305         (cpp_handle_deferred_pragma): Remove.
2306         * macro.c (builtin_macro): Remove pragma token hack.
2307         (_cpp_push_token_context): Rename from push_token_context and export.
2308         * internal.h (struct lexer_state): Add pragma_allow_expansion.
2309         (_cpp_push_token_context): Declare.
2310         * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
2311         a token.  Update the line number correctly if so.
2312         (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
2313         (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
2314         * include/cpplib.h (PRAGMA_EOL): New.
2315         (CPP_TOKEN_FLD_PRAGMA): New.
2316         (struct cpp_token): Add val.pragma.
2317         (struct cpp_options): Remove defer_pragmas.
2318         (cpp_handle_deferred_pragma): Remove.
2319         (cpp_register_deferred_pragma): Declare.
2321 2006-01-01  Jakub Jelinek  <jakub@redhat.com>
2323         PR c++/25294
2324         * directives.c (do_pragma): If pragma line ends with multi-line
2325         block comment, end the saved deferred pragma string before that
2326         comment.  Handle embedded '\0' chars on the pragma line.
2328 2005-12-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
2330         PR c++/23333
2331         * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
2333 2005-12-07  Jon Grimm  <jgrimm2@us.ibm.com>
2334             Ben Elliston  <bje@au.ibm.com>
2336         * include/cpplib.h (CPP_N_DFLOAT): New.
2337         * expr.c (interpret_float_suffix): Identify df, dd, and dl
2338         suffixes as decimal floating point constants.
2339         (cpp_classify_number): Disallow hexadecimal DFP constants.
2341 2005-11-14  Gerald Pfeifer  <gerald@pfeifer.com>
2342             Ian Lance Taylor  <ian@airs.com>
2344         * include/cpplib.h (struct cpp_callbacks): Annotate error with
2345         ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
2347 2005-11-09  Per Bothner  <per@bothner.com>
2348             Uros Bizjak  <uros@kss-loka.si>
2350         PR c/24101
2351         * init.c (read_original_filename): Temporarily set
2352         state.in_directive before calling _cpp_lex_direct for
2353         CPP_HASH tokens.
2355 2005-11-03  James E Wilson  <wilson@specifix.com>
2357         PR preprocessor/24202
2358         * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
2360 2005-11-04  Joseph S. Myers  <joseph@codesourcery.com>
2362         * include/cpplib.h (struct cpp_callbacks): Make error take
2363         va_list* parameter.
2364         * errors.c (cpp_error): Update call to callback.
2366 2005-11-03  Andrew Pinski  <pinskia@physics.uc.edu>
2368         PR preprocessor/22042
2369         * macro.c (_cpp_builtin_macro_text): Lower the needed max
2370         buffer size.
2371         (cpp_quote_string): Don't octalify non printable
2372         charactors.
2374 2005-11-03  Joseph S. Myers  <joseph@codesourcery.com>
2376         PR c++/17964
2377         * include/cpplib.h (struct cpp_options): Add client_diagnostic.
2378         (struct cpp_callbacks): Add error.
2379         * errors.c (cpp_error): If client_diagnostic, use error callback.
2380         * charset.c (convert_escape): Don't use %03o in diagnostic.
2382 2005-10-21  James E Wilson  <wilson@specifix.com>
2384         PR preprocessor/15220
2385         * files.c (_cpp_find_file): New parameter angle_brackets.  Fix all
2386         callers.  Pass to open_file_failed.
2387         (open_file_failed): New parameter angle_brackets.  Fix all callers.
2388         Use in print_dep assignment.
2389         * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
2390         * internal.h (_cpp_find_file): Add new parm to declaration.
2392 2005-10-08  Kazu Hirata  <kazu@codesourcery.com>
2394         * configure.ac: Require 64-bit int for arm*-*-*eabi*.
2395         * configure: Regenerate.
2397 2005-10-04  Ian Lance Taylor  <ian@airs.com>
2399         PR preprocessor/13726
2400         * directives.c (check_eol_return_comments): New static function.
2401         (parse_include): Add buf parameter.  Change all callers.
2402         (do_include_common): If not discard comments, turn on
2403         save_comments.  Pass collected comments to include callback.
2404         * include/cpplib.h (struct cpp_callbacks): Add new parameter to
2405         include callback: cpp_token list.
2407 2005-09-20  Joseph S. Myers  <joseph@codesourcery.com>
2409         * include/cpplib.h (struct cpp_options): Add extended_identifiers.
2410         * init.c (struct lang_flags, lang_defaults): Add
2411         extended_identifiers.
2412         (cpp_set_lang): Use it.
2413         * lex.c (forms_identifier_p): Check extended_identifiers.
2415 2005-08-30  Jakub Jelinek  <jakub@redhat.com>
2417         PR preprocessor/20348
2418         PR preprocessor/20356
2419         * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
2420         2004-06-05 changes.
2422 2005-07-23  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2424         * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
2425         -Wmissing-format-attribute.
2427         * configure: Regenerate.
2429 2005-06-29  Kelley Cook  <kcook@gcc.gnu.org>
2431         * all files: Update FSF address in copyright headers.
2432         * makeucnid.c (write_copyright): Update outputted FSF address.
2434 2005-06-13  Zack Weinberg  <zack@codesourcery.com>
2436         * configure.ac: Invoke ZW_CREATE_DEPDIR and
2437         ZW_PROG_COMPILER_DEPENDENCIES.
2438         * aclocal.m4, configure: Regenerate.
2439         * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
2440         New variables.
2441         (distclean): Clean up $(DEPDIR) and its contents.
2442         (.c.o): Use $(COMPILE).
2443         Include $(DEPDIR)/*.Po for most object->header dependencies.
2445 2005-05-28  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2447         * configure.ac: Check declarations for asprintf and vasprintf.
2448         * config.in: Regenerate.
2449         * configure: Likewise.
2451         * charset.c (conversion_loop): Use XRESIZEVEC.
2452         (convert_no_conversion): Likewise.
2453         (convert_using_iconv): Likewise.
2454         (init_iconv_desc): Cast return value of alloca.
2455         (cpp_host_to_exec_charset): Use XNEWVEC.
2456         (emit_numeric_escape): Use XRESIZEVEC.
2457         (cpp_interpret_string): Use XNEWVEC.
2458         (cpp_interpret_string): Use XRESIZEVEC.
2459         (_cpp_interpret_identifier): Cast return value of alloca.
2460         (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
2461         * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
2462         (parse_include): Use XNEWVEC.
2463         (insert_pragma_entry): Rename local variable "new" to
2464         "new_entry".
2465         (save_registered_pragmas): Cast return value of xmemdup.
2466         (destringize_and_run): Same for alloca.
2467         (parse_assertion): Likewise.
2468         (do_assert): Cast allocated storage to proper type.
2469         (cpp_define): Likewise.
2470         (_cpp_define_builtin): Likewise.
2471         (cpp_undef): Likewise.
2472         (handle_assertion): Likewise.
2473         (cpp_push_buffer): Rename local variable "new" to "new_buffer".
2474         * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
2475         (CPP_UMINUS): Likewise.
2476         (struct cpp_operator): Rename from struct operator.
2477         (_cpp_expand_op_stack): Use XRESIZEVEC.
2478         * files.c (pch_open_file): Use XNEWVEC.
2479         (pch_open_file): Use XRESIZEVEC.
2480         (read_file_guts): Use XNEWVEC and XRESIZEVEC.
2481         (dir_name_of_file): Use XNEWVEC.
2482         (make_cpp_file): Use XCNEW.
2483         (make_cpp_dir): Likewise.
2484         (allocate_file_hash_entries): USE XNEWVEC.
2485         (cpp_included): Cast return value of htab_find_with_hash.
2486         (append_file_to_dir): Use XNEWVEC.
2487         (read_filename_string): Likewise. Use XRESIZEVEC too.
2488         (read_name_map): Cast return value of alloca.  Use XRESIZEVEC.
2489         (remap_filename): Use XNEWVEC.
2490         (struct pchf_entry): Move definition out of struct pchf_data.
2491         (_cpp_save_file_entries): Use XCNEWVAR.
2492         (_cpp_read_file_entries): Use XNEWVAR.
2493         * identifiers.c (alloc_node): Use XOBNEW.
2494         * init.c (cpp_create_reader): Use XCNEW.
2495         (cpp_init_builtins): Cast of b->value to enum builtin_type.
2496         (read_original_directory): Cast return value of alloca.
2497         * lex.c (add_line_note): Use XRESIZEVEC.
2498         (warn_about_normalization): Use XNEWVEC.
2499         (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
2500         (new_buff): Use XNEWVEC.
2501         * line-map.c (linemap_add): Use XRESIZEVEC.
2502         * macro.c (builtin_macro): Cast return value of alloca.
2503         (paste_tokens): Likewise.
2504         (expand_arg): Use XNEWVEC and XRESIZEVEC.
2505         (_cpp_save_parameter): Use XRESIZEVEC.
2506         (create_iso_definition): Cast allocated storage to proper type.
2507         (_cpp_create_definition): Likewise.
2508         (cpp_macro_definition): Use XRESIZEVEC.
2509         * makedepend.c (add_clm): Use XNEW.
2510         (add_dir): Likewise.
2511         * mkdeps.c (munge): Use XNEWVEC.
2512         (deps_init): Use XCNEW.
2513         (deps_add_target): Use XRESIZEVEC.
2514         (deps_add_default_target): Cast return value of alloca.
2515         (deps_add_dep): Use XRESIZEVEC.
2516         (deps_add_vpath): Likewise.  Use XNEWVEC too.
2517         (deps_restore): Likewise.
2518         * pch.c (save_idents): Use XNEW and XNEWVEC.
2519         (cpp_save_state): Use XNEW.
2520         (count_defs): Cast return value of htab_find.
2521         (write_defs): Likewise.
2522         (cpp_write_pch_deps): Use XNEWVEC.
2523         (collect_ht_nodes): Use XRESIZEVEC.
2524         (cpp_valid_state): Use XNEWVEC.
2525         (save_macros): Use XRESIZEVEC.  Cast return value of xmemdup.
2526         * symtab.c (ht_create): Use XCNEW.
2527         (ht_lookup_with_hash): Cast return value of obstack_copy0.
2528         (ht_expand): Use XCNEWVEC.
2529         * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
2530         (bool): Do not define if __cplusplus.
2532 2005-05-12  Zack Weinberg  <zack@codesourcery.com>
2534         * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
2535         (do_sccs): Delete function definition, #define to do_ident.
2536         (do_ident): Don't hardwire directive name.
2538 2005-05-12  Ryota Kunisawa  <kunisawa@access.co.jp>
2540         PR bootstrap/21230
2541         * configure: Regenerate.
2543 2005-04-27  Andris Pavenis  <pavenis@latnet.lv>
2545         * files.c: Include io.h for DJGPP to get prototype of setmode.
2547 2005-04-19  Per Bothner  <per@bothner.com>
2549         PR preprocessor/20907
2550         * line-map.c (linemap_line_start): Fix bug when we need to increse
2551         column_bits but can re-use the current line_map.
2553 2005-04-19  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2555         * system.h (fopen, fdopen, freopen): Define these to the unlocked
2556         libiberty functions.
2558 2005-04-11  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2560         * configure.ac (libcpp_UNLOCKED_FUNCS): New.
2561         (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
2562         * system.h (putchar, getc, getchar, clearerr, feof, fileno,
2563         fflush, fgetc, fgets, ferror, fread): Redefine to the associated
2564         _unlocked function.
2565         (fwrite_unlocked): Fix prototype.
2567         * configure, config.in: Regenerate.
2569 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
2571         PR preprocessor/19475
2572         * macro.c (create_iso_definition): For < ISO C99, don't
2573         pedwarn if there is no whitespace between macro name and its
2574         replacement, but the replacement starts with a basic character
2575         set character.
2577 2005-03-28  Andreas Jaeger  <aj@suse.de>
2579         * lex.c (warn_about_normalization): Cast field width to int to
2580         avoid warning.
2582 2005-03-19  Joseph S. Myers  <joseph@codesourcery.com>
2584         * configure.ac: Consistently use solaris2.1[0-9]* instead of
2585         solaris2.1[0-9].
2586         * configure: Regenerate.
2588 2005-03-15  Geoffrey Keating  <geoffk@apple.com>
2590         * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
2591         UCN rather than printing an error.
2593 2005-03-14  Geoffrey Keating  <geoffk@apple.com>
2595         * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
2597 2005-03-14  Geoffrey Keating  <geoffk@apple.com>
2599         * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
2600         * charset.c: Update for new format of ucnid.h.
2601         (ucn_valid_in_identifier): Update for new format of ucnid.h.
2602         Add NST parameter, and update it; update callers.
2603         (cpp_valid_ucn): Add NST parameter, update callers.  Replace abort
2604         with cpp_error.
2605         (convert_ucn): Pass normalize_state to cpp_valid_ucn.
2606         * internal.h (struct normalize_state): New.
2607         (INITIAL_NORMALIZE_STATE): New.
2608         (NORMALIZE_STATE_RESULT): New.
2609         (NORMALIZE_STATE_UPDATE_IDNUM): New.
2610         (_cpp_valid_ucn): New.
2611         * lex.c (warn_about_normalization): New.
2612         (forms_identifier_p): Add normalize_state parameter, update callers.
2613         (lex_identifier): Add normalize_state parameter, update callers.  Keep
2614         the state current.
2615         (lex_number): Likewise.
2616         (_cpp_lex_direct): Pass normalize_state to subroutines.  Check
2617         it with warn_about_normalization.
2618         * makeucnid.c: New.
2619         * ucnid.h: Replace.
2620         * ucnid.pl: Remove.
2621         * ucnid.tab: Make appropriate for input to makeucnid.c.  Remove
2622         comments about obsolete version of C++.
2623         * include/cpplib.h (enum cpp_normalize_level): New.
2624         (struct cpp_options): Add warn_normalize field.
2626 2005-03-11  Geoffrey Keating  <geoffk@apple.com>
2628         * directives.c (glue_header_name): Update call to cpp_spell_token.
2629         * internal.h (_cpp_interpret_identifier): New.
2630         * charset.c (_cpp_interpret_identifier): New.
2631         (_cpp_valid_ucn): Allow UCN version of '$'.
2632         * lex.c (lex_identifier): Add extra parameter to indicate if initial
2633         character was '$' or '\'.  Support identifiers with UCNs.
2634         (forms_identifier_p): Allow UCNs.
2635         (_cpp_lex_direct): Pass extra parameter to lex_identifier.
2636         (utf8_to_ucn): New.
2637         (cpp_spell_token): Add FORSTRING parameter.  Use it.
2638         (cpp_token_as_text): Update call to cpp_spell_token.
2639         (cpp_output_token): Write UCNs back out.
2640         (stringify_arg): Update call to cpp_spell_token.
2641         (paste_tokens): Likewise.
2642         (cpp_macro_definition): Likewise.
2643         * macro.c (stringify_arg): Likewise.
2644         (paste_tokens): Likewise.
2645         (cpp_macro_definition): Likewise.
2646         * include/cpplib.h: Add parameter to cpp_spell_token.
2648 2005-03-04  Jakub Jelinek  <jakub@redhat.com>
2650         PR bootstrap/20282
2651         PR bootstrap/20305
2652         * macro.c (replace_args, cpp_get_token): Copy whole
2653         cpp_token_u instead of just cpp_string field from it.
2655 2005-02-28  Devang Patel  <dpatel@apple.com>
2657         * directives.c (do_line): Save sysp early before line table is
2658         realloc'ed.
2660 2005-02-20  Zack Weinberg  <zack@codesourcery.com>
2662         PR 18785
2663         * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
2664         (cpp_host_to_exec_charset): New function.
2665         * include/cpplib.h: Declare cpp_host_to_exec_charset.
2667 2005-02-19  Devang Patel  <dpatel@apple.com>
2669         * charset.c (_cpp_convert_input): Check '\r' before inserting
2670         '\n' at the end.
2672 2005-02-15  Eric Christopher  <echristo@redhat.com>
2674         PR preprocessor/19077
2675         * macro.c (cpp_macro_definition): Move handling of whitespace
2676         to PREV_WHITE conditional. Remove overloading of len
2677         variable.
2679 2005-02-14  Kazu Hirata  <kazu@cs.umass.edu>
2681         * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
2682         traditional.c: Update copyright.
2684 2005-02-14  Paolo Bonzini  <bonzini@gnu.org>
2686         PR bootstrap/19818
2687         * configure.ac: Check for declaration of basename and getopt.
2688         * config.in: Regenerate.
2689         * configure: Regenerate.
2690         * internal.h (ustrcspn): New.
2691         * macro.c (create_iso_definition): Fix allocation of memory.
2692         (padding_token): Add cast to remove const-ness.
2693         * pch.c (cpp_read_state): Use ustrcspn.
2695 2005-02-08  Mike Stump  <mrs@apple.com>
2697         * files.c (pchf_adder): Remove.
2698         (struct pchf_adder_info): Likewise.
2699         (_cpp_save_file_entries): Write out all files so that #import works.
2701 2005-01-23  Joseph S. Myers  <joseph@codesourcery.com>
2703         * configure: Regenerate.
2705 2005-01-11  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
2707         * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
2709         * include/cpplib.h: Also update copyright years.
2711 2005-01-03  Geoffrey Keating  <geoffk@apple.com>
2713         * files.c (_cpp_find_file): Add files found by search_path_exhausted
2714         to the list of all files.
2716 2005-01-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2718         * internal.h: Update references to Cpp lib filenames.
2719         * directives.c: Likewise.
2720         * init.c: Likewise.
2721         * macro.c: Likewise.
2722         * traditional.c: Likewise.
2724 2004-12-15  Eric Botcazou  <ebotcazou@libertysurf.fr>
2726         PR preprocessor/15167
2727         * files.c (destroy_cpp_file): New function.
2728         (should_stack_file): Make a new file if the
2729         compared file is still stacked.
2731 2004-11-28  Nathanael Nerode  <neroden@gcc.gnu.org>
2733         PR preprocessor/17610
2734         * directives.c (do_include_common): Error out if an empty filename
2735         is given for #include (or #include_next or #import).
2737 2004-11-27  Roger Sayle  <roger@eyesopen.com>
2738             Zack Weinberg  <zack@codesourcery.com>
2740         * internal.h: Replace all uses of uchar with unsigned char.
2741         * include/cpp-id-data.h: Likewise.  Guard typedef of uchar
2742         with !IN_GCC, so uchar is only defined whilst building libcpp.
2744 2004-11-24  Kelley Cook  <kcook@gcc.gnu.org>
2746         * aclocal.m4: Regenerate.
2748 2004-11-24  Roger Sayle  <roger@eyesopen.com>
2750         PR preprocessor/15824
2751         * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
2752         directly, instead of the non-existant "system.h" and "ansidecl.h".
2753         * configure: Regenerate.
2755 2004-11-23  Daniel Jacobowitz  <dan@codesourcery.com>
2756             Joseph Myers  <joseph@codesourcery.com>
2758         * internal.h (struct lexer_state): Add in_deferred_pragma.
2759         * directives.c (struct pragma_entry): Add allow_expansion.
2760         (insert_pragma_entry): Take allow_expansion flag.
2761         (register_pragma): Likewise.
2762         (cpp_register_pragma): Likewise.
2763         (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
2764         (do_pragma): Honor allow_expansion.
2765         (cpp_handle_deferred_pragma): Set in_deferred_pragma.
2766         * include/cpplib.h (cpp_register_pragma): Update prototype.
2768 2004-11-18  Daniel Jacobowitz  <dan@codesourcery.com>
2769             Mark Mitchell  <mark@codesourcery.com>
2771         * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
2772         need_64bit_hwint=yes.
2773         * configure: Regenerate.
2775 2004-11-09  Joseph S. Myers  <joseph@codesourcery.com>
2777         * Makefile.in ($(PACKAGE).pot): New rule.  Depend on
2778         po/$(PACKAGE).pot.
2779         (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
2780         arguments.  Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
2781         Remove local srcdir path from generated file.
2783 2004-11-04  Zack Weinberg  <zack@codesourcery.com>
2784             Gerald Pfeifer  <gerald@pfeifer.com>
2786         * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
2787         as well.
2789 2004-10-27  Zack Weinberg  <zack@codesourcery.com>
2791         PR 18075
2792         * directives.c (do_pragma): Do not defer pragmas which are unknown.
2793         (cpp_handle_deferred_pragma): Add cast to silence warning.
2795 2004-10-14  Joseph S. Myers  <jsm@polyomino.org.uk>
2797         * errors.c (_cpp_begin_message): Print "error: " for errors.
2799 2004-10-10  Andreas Jaeger  <aj@suse.de>
2801         * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
2802         * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
2804 2004-10-08  Andrew Pinski  <pinskia@physics.uc.edu>
2806         * pch.c (cpp_write_pch_state): Remove variable z as it is not
2807         used.
2808         (cpp_read_state): Remove unused variables, m, d and mac_count.
2810 2004-09-29  Per Bothner  <per@bothner.com>
2812         * directives.c (cpp_handle_deferred_pragma):  Save, clear and restore
2813         cb.line_change.  Otherwise do_pragma will call the line_change
2814         call-back with a meaningless line number.
2816 2004-09-24  Zack Weinberg  <zack@codesourcery.com>
2818         * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
2819         programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
2820         ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
2821         * aclocal.m4, configure: Regenerate.
2822         * init.c: Include localedir.h.
2823         * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
2824         (DEFS): Delete.
2825         (.c.o): Use $(ALL_CFLAGS).
2826         (localedir.h, localedir.hs): New rules.
2827         (clean): Use rm -rf to remove directories.
2828         (distclean): Also delete localedir.h and localedir.hs.
2829         (init.o): Update dependencies.
2831 2004-09-22  Kelley Cook  <kcook@gcc.gnu.org>
2833         * Makefile.in (aclocal.m4): Update dependencies.
2834         * configure.ac (AC_CONFIG_MACRO_DIR): New.
2835         * aclocal.m4, configure: Regenerate.
2837 2004-09-17  Zack Weinberg  <zack@codesourcery.com>
2839         * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
2840         (_cpp_convert_input, _cpp_default_encoding): Add comments.
2841         Some other comments in this file also tweaked.
2843         * directives.c (do_pragma): Save current buffer position
2844         before lexing the pragma keywords; don't call
2845         _cpp_backup_tokens in the defer_pragmas case.
2847 2004-09-15  Per Bothner  <per@bothner.com>
2849         * include/line-map.h (line_map_start):  Add parameter names so
2850         preceding comment makes sense.
2851         (linemap_add):  Remove from comment mention of non-existing parameter.
2853 2004-09-09  Matt Austern  <austern@apple.com>
2854             Zack Weinberg  <zack@codesourcery.com>
2856         * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
2857         prefixes throughout.  Add entry for PRAGMA.  Remove
2858         unnecessary "= 0" from EQ.
2859         (enum cpp_ttype): Adjust OP and TK definitions to restore
2860         prefixes, via token-paste.
2861         (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
2862         Change from #defines to additional cpp_ttype enumerators.
2863         (struct cpp_options): Add defer_pragmas.
2864         (cpp_handle_deferred_pragma): Prototype new interface.
2866         * internal.h (struct cpp_reader): Add directive_result.
2867         * directives.c (struct pragma_entry): Add is_internal field;
2868         give boolean fields type bool.
2869         (start_directive): Initialize pfile->directive_result.type.
2870         (_cpp_do__Pragma): Likewise.
2871         (run_directive): Do not crash if pfile->buffer->prev is NULL.
2872         (insert_pragma_entry): Add 'internal' argument; set new->is_internal
2873         from it.
2874         (register_pragma): New static function, bulk of former
2875         cpp_register_pragma here; add 'internal' argument, pass along
2876         to insert_pragma_entry.
2877         (cpp_register_pragma): Now a wrapper around register_pragma which
2878         always passes false for 'internal' argument.
2879         (_cpp_init_internal_pragmas): Call register_pragma directly, passing
2880         true for 'internal'.
2881         (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
2882         an internal pragma, save text till the end of the line as a CPP_PRAGMA
2883         token instead of executing the pragma.
2884         (cpp_handle_deferred_pragma): New interface.
2885         * lex.c (token_spellings): Adjust OP and TK definitions to
2886         match changes to cpplib.h.
2887         (_cpp_lex_token): Check for a directive-result token and
2888         return it if present.
2889         (cpp_token_val_index): Handle CPP_PRAGMA.
2890         * macro.c (cpp_builtin_macro_text): Correct comment.
2891         (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
2893 2004-09-06  Serge Belyshev  <belyshev@lubercy.com>
2895         PR preprocessor/14699
2896         * symtab.c (ht_dump_statistics): Change type of sum_of_squares
2897         from size_t to double.
2899 2004-08-28  Andreas Schwab  <schwab@suse.de>
2900             Andreas Jaeger <aj@suse.de>
2902         * configure.ac: Set PACKAGE correctly.
2903         * configure: Regenerated.
2905 2004-08-25  Paolo Bonzini  <bonzini@gnu.org>
2907         * Makefile.in: Add back top_builddir.
2909 2004-08-25  Paolo Bonzini  <bonzini@gnu.org>
2911         * configure.ac: Replace Automake macro invocations
2912         with manual Autoconf checks and substitutions.
2913         * configure: Regenerate.
2914         * aclocal.m4: Regenerate.
2915         * config.in: Regenerate.
2916         * Makefile.am: Removed.
2917         * Makefile.in: Heavy simplification and reorganization.
2919 2004-08-09  Mark Mitchell  <mark@codesourcery.com>
2921         * configure.ac (arm*-*-eabi*): New target.
2922         (arm*-*-symbianelf*): Likewise.
2923         * configure: Regenerated.
2925 2004-07-24  Bernardo Innocenti  <bernie@develer.com>
2927         * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
2928         * directives.c: Use XNEW-family macros from libiberty.
2929         * lex.c: Likewise.
2930         * macro.c: Likewise.
2931         * cpplib.h (cpp_deps_style): Export enum with name.
2933 2004-07-23  Matthias Klose  <doko@debian.org>
2935         * init.c (init_library): Use PACKAGE for the text domain.
2937 2004-07-16  Andris Pavenis  <pavenis@latnet.lv>
2939         PR preprocessor/16366
2940         * internal.h (struct cpp_reader): New field dir_hash.
2941         * files.c (make_cpp_dir): Use dir_hash, not file_hash.
2942         (_cpp_init_files, _cpp_cleanup_files): Update for new field.
2944 2004-07-04  Neil Booth  <neil@duron.akihabara.co.uk>
2946         PR preprocessor/16192
2947         PR preprocessor/15913
2948         PR preprocessor/15572
2949         * expr.c (_cpp_parse_expr): Handle remaining cases where an
2950         expression is missing.
2951         * init.c (post_options): Traditional cpp doesn't do // comments.
2953 2004-06-30  Per Bothner  <per@bothner.com>
2955         * include/line-map.h (fileline):  Remove old typedef.
2956         * internal.h (struct cpp_reader):  Use source_location typedef instead.
2958 2004-06-26  Zack Weinberg  <zack@codesourcery.com>
2960         Partially revert patch of 2004-06-05.
2961         * files.c (search_cache): Remove pfile argument.  Don't check
2962         for file that would be found by "" or <> search here...
2963         (_cpp_find_file): ...do it here, before calling find_file_in_dir.
2964         Do not apply directory-of-current-file correction to files
2965         found by this check.  Rearrange code slightly.
2967 2004-06-21  Geoffrey Keating  <geoffk@apple.com>
2969         * files.c (should_stack_file): Correct swapped parameters to call
2970         to cb.read_pch.
2971         * pch.c (cpp_valid_state): Handle -fpreprocessed.
2973 2004-06-15  Paolo Bonzini  <bonzini@gnu.org>
2975         * Makefile.in: Regenerate with automake 1.8.5.
2976         * aclocal.m4: Likewise.
2977         * configure: Regenerate.
2979 2004-06-11  Zack Weinberg  <zack@codesourcery.com>
2981         * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
2982         * configure, config.in: Regenerate.
2983         * system.h: Unconditionally define bool as unsigned char,
2984         BOOL_BITFIELD as unsigned int.
2985         * .cvsignore: New file.
2987 2004-06-09  Geoffrey Keating  <geoffk@apple.com>
2989         * traditional.c (push_replacement_text): Set macro->traditional.
2990         (save_replacement_text): Likewise.
2991         * pch.c (cpp_write_pch_state): Don't write list of defined macros.
2992         (struct save_macro_item): Delete.
2993         (struct save_macro_data): Use a character array not the previous
2994         structured format.
2995         (save_macros): Save macro as text not as internal structures.
2996         (cpp_prepare_state): Update for changes to save_macro_data.
2997         (cpp_read_state): Don't read macros defined in PCH.  Restore
2998         -D macros as text.
2999         * macro.c (create_iso_definition): Honour alloc_subobject.
3000         Clear traditional flag.
3001         (_cpp_create_definition): Honour alloc_subobject.
3002         * lex.c (cpp_token_val_index): New.
3003         * internal.h: Include cpp-id-data.h.
3004         (uchar): Move definition to cpp-id-data.h.
3005         (U): Likewise.
3006         (cpp_macro): Likewise.
3007         * directives.c (struct answer): Move to cpp-id-data.h.
3008         (do_assert): Honour alloc_subobject.
3010         * include/symtab.h (struct ht): Add field 'alloc_subobject'.
3011         * include/cpplib.h (struct cpp_string): Add GTY marker.
3012         (enum cpp_token_fld_kind): New.
3013         (struct cpp_token): Add GTY markers.
3014         (cpp_token_val_index): Prototype.
3015         (CPP_HASHNODE_VALUE_IDX): New.
3016         (struct cpp_hashnode): Don't skip fields of 'value' when marking.
3017         * include/cpp-id-data.h: New file.
3019 2004-06-09  Paolo Bonzini  <bonzini@gnu.org>
3021         * Makefile.am (all-local): New.
3022         * Makefile.in: Regenerate.
3024 2004-06-06  Roger Sayle  <roger@eyesopen.com>
3026         * Makefile.am (LIBICONV): Declare.
3027         (makedepend_LDADD): Use LIBICONV.
3028         * Makefile.in: Regenerate.
3030 2004-06-05  Andrew Pinski  <pinskia@physics.uc.edu>
3032         * Makefile.am (LIBINTL): Declare
3033         (makedepend_LDADD): Use LIBINTL.
3034         * Makefile.in: Regenerate.
3036 2004-06-05  Zack Weinberg  <zack@codesourcery.com>
3038         * Makefile.am: Add makedepend.
3039         * Makefile.in, aclocal.m4: Regenerate.
3040         * charset.c: Insert a space to avoid a warning.
3041         * directives.c: Include mkdeps.h.
3042         (_cpp_handle_directive): Reenable macro expander if appropriate.
3043         (undefine_macros): Inline body of _cpp_free_definition for speed.
3044         Do not call undef callback or _cpp_warn_if_unused_macro.
3045         (cpp_get_deps): New interface.
3046         * files.c (search_cache): Add pfile argument.  Check for file
3047         that would be found by "" or <> search here...
3048         (_cpp_find_file): ...not here.  Correct recorded start_dir of
3049         files found by directory-of-current-file search that would be
3050         found by "" or <> search.
3051         * init.c (cpp_add_dependency_target): Delete.
3052         * internal.h (struct lexer_state): Add discarding_output flag.
3053         * lex.c (lex_identifier): Compute hash function while scanning.
3054         * macro.c (cpp_scan_nooutput): Disable macro expansion outside
3055         directives.
3056         * makedepend.c: New file.
3057         * mkdeps.c (struct deps): Add vpath vector.
3058         (apply_vpath, deps_add_vpath): New function.
3059         (deps_free): Free vpath vector.
3060         (deps_add_dep, deps_add_target): Use apply_vpath.
3061         * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
3062         (ht_lookup_with_hash): New function.
3063         * cpplib.h, mkdeps.h: Update prototypes.
3064         * symtab.h: Update prototypes.
3065         (HT_HASHSTEP, HT_FINISH): New macros.
3067 2004-05-29  Geoffrey Keating  <geoffk@apple.com>
3069         * symtab.c (ht_create): Set entries_owned.
3070         (ht_destroy): Honour entries_owned.
3071         (ht_expand): Likewise.
3072         (ht_load): New.
3073         * include/symtab.h (struct ht): New field 'entries_owned'
3074         (ht_load): New prototype.
3076 2004-05-26  Paolo Bonzini  <bonzini@gnu.org>
3078         PR bootstrap/15651
3079         * configure.ac: Fix m4 quoting when picking
3080         the size of HOST_WIDE_INT.
3081         * configure: Regenerate.
3083 2004-05-25  Paolo Bonzini  <bonzini@gnu.org>
3085         * Makefile.am: the correct directory for
3086         gettext include files is given by @INCINTL@.
3087         * Makefile.in: Regenerate.
3089 2004-05-24  Paolo Bonzini  <bonzini@gnu.org>
3091         * system.h [!ENABLE_NLS]: dgettext takes two
3092         parameters.
3094 2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
3096         Moved libcpp from the gcc subdirectory to the toplevel.
3097         * Makefile.am: New file.
3098         * Makefile.in: Regenerate.
3099         * configure.ac: New file.
3100         * configure: Regenerate.
3101         * config.in: Regenerate.
3102         * charset.c: Moved from gcc/cppcharset.c.  Add note about
3103         brokenness of input charset detection.  Adjust for change
3104         in name of cppucnid.h.
3105         * errors.c: Moved from gcc/cpperror.c.  Do not include intl.h.
3106         * expr.c: Moved from gcc/cppexp.c.
3107         * files.c: Moved from gcc/cppfiles.c.  Do not include intl.h.
3108         Remove #define of O_BINARY, it is in system.h.
3109         * identifiers.c: Moved from gcc/cpphash.c.
3110         * internal.h: Moved from gcc/cpphash.h.  Change header
3111         guard name.  All other files adjusted to match name change.
3112         * init.c: Moved from gcc/cppinit.c.
3113         (init_library) [ENABLE_NLS]: Call bindtextdomain.
3114         * lex.c: Moved from gcc/cpplex.c.
3115         * directives.c: Moved from gcc/cpplib.c.
3116         * macro.c: Moved from gcc/cppmacro.c.
3117         * pch.c: Moved from gcc/cpppch.c.  Do not include intl.h.
3118         * traditional.c: Moved from gcc/cpptrad.c.
3119         * ucnid.h: Moved from gcc/cppucnid.h.  Change header
3120         guard name.
3121         * ucnid.pl: Moved from gcc/cppucnid.pl.
3122         * ucnid.tab: Moved from gcc/cppucnid.tab.  Change header
3123         guard name.
3124         * symtab.c: Moved from gcc/hashtable.c.
3125         * line-map.c: Moved from gcc.  Do not include intl.h.
3126         * mkdeps.c: Moved from gcc.
3127         * system.h: New file.
3128         * include/cpplib.h: Moved from gcc.  Change header guard name.
3129         * include/line-map.h: Moved from gcc.  Change header guard name.
3130         * include/mkdeps.h: Moved from gcc.  Change header guard name.
3131         * include/symtab.h: Moved from gcc/hashtable.h.  Change header
3132         guard name.