OSDN Git Service

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