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