OSDN Git Service

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