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