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