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