]> git.ipfire.org Git - thirdparty/gcc.git/blame - libcpp/ChangeLog
* config/spu/spu.c (spu_expand_insv): Avoid undefined behavior.
[thirdparty/gcc.git] / libcpp / ChangeLog
CommitLineData
8df4088d 12015-09-07 Marek Polacek <polacek@redhat.com>
2
3 * system.h (INTTYPE_MINIMUM): Rewrite to avoid shift warning.
4
29890f2e 52015-08-06 Yaakov Selkowitz <yselkowi@redhat.com>
6
7 * configure: Regenerate.
8
a5ea4da3 92015-07-08 Thomas Schwinge <thomas@codesourcery.com>
10
11 * include/line-map.h (RESERVED_LOCATION_COUNT): Change type to
12 source_location.
13
880e4baa 142015-07-02 Paolo Carlini <paolo.carlini@oracle.com>
15
7c35064e 16 PR preprocessor/53690
880e4baa 17 * charset.c (_cpp_valid_ucn): Add cppchar_t * parameter and change
18 return type to bool. Fix encoding of \u0000 and \U00000000 in C++.
19 (convert_ucn): Adjust call.
20 * lex.c (forms_identifier_p): Likewise.
21 * internal.h (_cpp_valid_ucn): Adjust declaration.
22
30b1ba42 232015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
24
25 Implement N4197 - Adding u8 character literals
26 * include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens;
27 (struct cpp_options): Add utf8_char_literals.
28 * init.c (struct lang_flags): Add utf8_char_literals;
29 (struct lang_flags lang_defaults): Add column for utf8_char_literals.
880e4baa 30 * macro.c (stringify_arg()): Treat CPP_UTF8CHAR token;
30b1ba42 31 * expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()):
32 Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens;
33 (cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token;
34 (eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token.
35 * lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens.
36 * charset.c (converter_for_type(), cpp_interpret_charconst()):
37 Treat CPP_UTF8CHAR token.
38
5ac78bd3 392015-06-30 Uros Bizjak <ubizjak@gmail.com>
40
41 * lex.c (search_line_sse42) [__GCC_ASM_FLAG_OUTPUTS__]: New main
42 loop using asm flag outputs.
43
6e84ccad 442015-06-08 Marek Polacek <polacek@redhat.com>
45
46 PR c/66415
47 * line-map.c (linemap_position_for_loc_and_offset): Remove
48 linemap_assert_fails; reverse conditions.
49
0d344d27 502015-05-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
51
52 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER
53 LINE_MAP_MAX_LOCATION_WITH_COLS,LINE_MAP_MAX_SOURCE_LOCATION):
54 New constants.
55 (linemap_line_start): Use them.
56 (linemap_position_for_column): Use them.
57
3ce1a212 582015-05-20 David Malcolm <dmalcolm@redhat.com>
59
60 * include/line-map.h (MAP_START_LOCATION): Eliminate the non-const
61 variant, and tweak comment for the const variant.
62 (ORDINARY_MAP_STARTING_LINE_NUMBER): Drop the non-const variant.
63 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
64 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
65 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
66 (ORDINARY_MAP_FILE_NAME): Drop the non-const variant.
67 (MACRO_MAP_MACRO): Likewise.
68 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
69 (MACRO_MAP_LOCATIONS): Likewise.
70 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
71 * line-map.c (linemap_add): Replace writes through macros with
72 direct field accesses.
73 (linemap_enter_macro): Likewise.
74 (linemap_line_start): Likewise.
75
551e34da 762015-05-19 David Malcolm <dmalcolm@redhat.com>
77
78 * directives.c (do_line): Strengthen local "map" from
79 const line_map * to const line_map_ordinary *.
80 (do_linemarker): Likewise.
81 (_cpp_do_file_change): Assert that we're not dealing with
82 a macro map. Introduce local "ord_map" via a call to
83 linemap_check_ordinary, guarded within the check for
84 non-NULL. Use it for typesafety.
85 * files.c (cpp_make_system_header): Strengthen local "map" from
86 const line_map * to const line_map_ordinary *.
87 * include/cpplib.h (struct cpp_callbacks): Likewise for second
88 parameter of "file_change" callback.
89 * include/line-map.h (struct line_map): Convert from a struct
90 containing a union to a base class.
91 (struct line_map_ordinary): Convert to a subclass of line_map.
92 (struct line_map_macro): Likewise.
93 (linemap_check_ordinary): Strengthen return type from line_map *
94 to line_map_ordinary *, and add a const-variant.
95 (linemap_check_macro): New pair of functions.
96 (ORDINARY_MAP_STARTING_LINE_NUMBER): Strengthen param from
97 const line_map * to const line_map_ordinary *, eliminating call
98 to linemap_check_ordinary. Likewise for the non-const variant.
99 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
100 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
101 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Likewise.
102 (ORDINARY_MAP_FILE_NAME): Likewise.
103 (MACRO_MAP_MACRO): Strengthen param from const line_map * to
104 const line_map_macro *. Likewise for the non-const variant.
105 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
106 (MACRO_MAP_LOCATIONS): Likewise.
107 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
108 (struct maps_info): Replace with...
109 (struct maps_info_ordinary):...this and...
110 (struct maps_info_macro): ...this.
111 (struct line_maps): Convert fields "info_ordinary" and
112 "info_macro" to the above new structs.
113 (LINEMAPS_MAP_INFO): Delete both functions.
114 (LINEMAPS_MAPS): Likewise.
115 (LINEMAPS_ALLOCATED): Rewrite both variants to avoid using
116 LINEMAPS_MAP_INFO.
117 (LINEMAPS_USED): Likewise.
118 (LINEMAPS_CACHE): Likewise.
119 (LINEMAPS_MAP_AT): Likewise.
120 (LINEMAPS_ORDINARY_MAPS): Strengthen return type from line_map *
121 to line_map_ordinary *.
122 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
123 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
124 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
125 (LINEMAPS_MACRO_MAPS): Strengthen return type from line_map * to
126 line_map_macro *.
127 (LINEMAPS_MACRO_MAP_AT): Likewise.
128 (LINEMAPS_LAST_MACRO_MAP): Likewise.
129 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
130 (linemap_map_get_macro_name): Strengthen param from
131 const line_map * to const line_map_macro *.
132 (SOURCE_LINE): Strengthen first param from const line_map * to
133 const line_map_ordinary *, removing call to
134 linemap_check_ordinary.
135 (SOURCE_COLUMN): Likewise.
136 (LAST_SOURCE_LINE_LOCATION): Likewise.
137 (LAST_SOURCE_LINE): Strengthen first param from const line_map *
138 to const line_map_ordinary *.
139 (LAST_SOURCE_COLUMN): Likewise.
140 (INCLUDED_FROM): Strengthen return type from line_map * to
141 line_map_ordinary *., and second param from const line_map *
142 to const line_map_ordinary *, removing call to
143 linemap_check_ordinary.
144 (MAIN_FILE_P): Strengthen param from const line_map * to
145 const line_map_ordinary *, removing call to
146 linemap_check_ordinary.
147 (linemap_position_for_line_and_column): Strengthen param from
148 const line_map * to const line_map_ordinary *.
149 (LINEMAP_FILE): Strengthen param from const line_map * to
150 const line_map_ordinary *, removing call to
151 linemap_check_ordinary.
152 (LINEMAP_LINE): Likewise.
153 (LINEMAP_SYSP): Likewise.
154 (linemap_resolve_location): Strengthen final param from
155 const line_map ** to const line_map_ordinary **.
156 * internal.h (CPP_INCREMENT_LINE): Likewise for local "map".
157 (linemap_enter_macro): Strengthen return type from
158 const line_map * to const line_map_macro *.
159 (linemap_add_macro_token): Likewise for first param.
160 * line-map.c (linemap_check_files_exited): Strengthen local "map"
161 from const line_map * to const line_map_ordinary *.
162 (new_linemap): Introduce local "map_size" and use it when
163 calculating how large the buffer should be. Rewrite based
164 on change of info_macro and info_ordinary into distinct types.
165 (linemap_add): Strengthen locals "map" and "from" from line_map *
166 to line_map_ordinary *.
167 (linemap_enter_macro): Strengthen return type from
168 const line_map * to const line_map_macro *, and local "map" from
169 line_map * to line_map_macro *.
170 (linemap_add_macro_token): Strengthen param "map" from
171 const line_map * to const line_map_macro *.
172 (linemap_line_start): Strengthen local "map" from line_map * to
173 line_map_ordinary *.
174 (linemap_position_for_column): Likewise.
175 (linemap_position_for_line_and_column): Strengthen first param
176 from const line_map * to const line_map_ordinary *.
177 (linemap_position_for_loc_and_offset): Strengthen local "map" from
178 const line_map * to const line_map_ordinary *.
179 (linemap_ordinary_map_lookup): Likewise for return type and locals
180 "cached" and "result".
181 (linemap_macro_map_lookup): Strengthen return type and locals
182 "cached" and "result" from const line_map * to
183 const line_map_macro *.
184 (linemap_macro_map_loc_to_exp_point): Likewise for param "map".
185 (linemap_macro_map_loc_to_def_point): Likewise.
186 (linemap_macro_map_loc_unwind_toward_spelling): Likewise.
187 (linemap_get_expansion_line): Strengthen local "map" from
188 const line_map * to const line_map_ordinary *.
189 (linemap_get_expansion_filename): Likewise.
190 (linemap_map_get_macro_name): Strengthen param from
191 const line_map * to const line_map_macro *.
192 (linemap_location_in_system_header_p): Add call to
193 linemap_check_ordinary in region guarded by
194 !linemap_macro_expansion_map_p. Introduce local "macro_map" via
195 linemap_check_macro in other region, using it in place of "map"
196 for typesafety.
197 (first_map_in_common_1): Add calls to linemap_check_macro.
198 (trace_include): Strengthen param "map" from const line_map * to
199 const line_map_ordinary *.
200 (linemap_macro_loc_to_spelling_point): Strengthen final param from
201 const line_map ** to const line_map_ordinary **. Replace a
202 C-style cast with a const_cast, and add calls to
203 linemap_check_macro and linemap_check_ordinary.
204 (linemap_macro_loc_to_def_point): Likewise.
205 (linemap_macro_loc_to_exp_point): Likewise.
206 (linemap_resolve_location): Strengthen final param from
207 const line_map ** to const line_map_ordinary **.
208 (linemap_unwind_toward_expansion): Introduce local "macro_map" via
209 a checked cast and use it in place of *map.
210 (linemap_unwind_to_first_non_reserved_loc): Strengthen local
211 "map1" from const line_map * to const line_map_ordinary *.
212 (linemap_expand_location): Introduce local "ord_map" via a checked
213 cast and use it in place of map.
214 (linemap_dump): Make local "map" const. Strengthen local
215 "includer_map" from line_map * to const line_map_ordinary *.
216 Introduce locals "ord_map" and "macro_map" via checked casts and
217 use them in place of "map" for typesafety.
218 (linemap_dump_location): Strengthen local "map" from
219 const line_map * to const line_map_ordinary *.
220 (linemap_get_file_highest_location): Update for elimination of
221 union.
222 (linemap_get_statistics): Strengthen local "cur_map" from
223 line_map * to const line_map_macro *. Update uses of sizeof to
224 use the appropriate line_map subclasses.
225 * macro.c (_cpp_warn_if_unused_macro): Add call to
226 linemap_check_ordinary.
227 (builtin_macro): Strengthen local "map" from const line_map * to
228 const line_map_macro *.
229 (enter_macro_context): Likewise.
230 (replace_args): Likewise.
231 (tokens_buff_put_token_to): Likewise for param "map".
232 (tokens_buff_add_token): Likewise.
233
28f17529 2342015-05-13 David Malcolm <dmalcolm@redhat.com>
235
236 * include/line-map.h (source_location): Add a reference to
237 location-example.txt to the descriptive comment.
238 * location-example.txt: New file.
239
aa041196 2402015-05-13 David Malcolm <dmalcolm@redhat.com>
241
242 * include/line-map.h (MAX_SOURCE_LOCATION): Convert from a macro
243 to a const source_location.
244 (RESERVED_LOCATION_COUNT): Likewise.
245 (linemap_check_ordinary): Convert from a macro to a pair of inline
246 functions, for const/non-const arguments.
247 (MAP_START_LOCATION): Likewise.
248 (ORDINARY_MAP_STARTING_LINE_NUMBER): Likewise.
249 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
250 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
251 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Convert from a macro to a
252 pair of inline functions, for const/non-const arguments, where the
253 latter is named...
254 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): New function.
255 (ORDINARY_MAP_FILE_NAME): Convert from a macro to a pair of inline
256 functions, for const/non-const arguments.
257 (MACRO_MAP_MACRO): Likewise.
258 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
259 (MACRO_MAP_LOCATIONS): Likewise.
260 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
261 (LINEMAPS_MAP_INFO): Likewise.
262 (LINEMAPS_MAPS): Likewise.
263 (LINEMAPS_ALLOCATED): Likewise.
264 (LINEMAPS_USED): Likewise.
265 (LINEMAPS_CACHE): Likewise.
266 (LINEMAPS_ORDINARY_CACHE): Likewise.
267 (LINEMAPS_MACRO_CACHE): Likewise.
268 (LINEMAPS_MAP_AT): Convert from a macro to an inline function.
269 (LINEMAPS_LAST_MAP): Likewise.
270 (LINEMAPS_LAST_ALLOCATED_MAP): Likewise.
271 (LINEMAPS_ORDINARY_MAPS): Likewise.
272 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
273 (LINEMAPS_ORDINARY_ALLOCATED): Likewise.
274 (LINEMAPS_ORDINARY_USED): Likewise.
275 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
276 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
277 (LINEMAPS_MACRO_MAPS): Likewise.
278 (LINEMAPS_MACRO_MAP_AT): Likewise.
279 (LINEMAPS_MACRO_ALLOCATED): Likewise.
280 (LINEMAPS_MACRO_USED): Likewise.
281 (LINEMAPS_MACRO_LOWEST_LOCATION): Likewise.
282 (LINEMAPS_LAST_MACRO_MAP): Likewise.
283 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
284 (IS_ADHOC_LOC): Likewise.
285 (COMBINE_LOCATION_DATA): Likewise.
286 (SOURCE_LINE): Likewise.
287 (SOURCE_COLUMN): Likewise.
288 (LAST_SOURCE_LINE_LOCATION): Likewise.
289 (LAST_SOURCE_LINE): Likewise.
290 (LAST_SOURCE_COLUMN): Likewise.
291 (LAST_SOURCE_LINE_LOCATION)
292 (INCLUDED_FROM): Likewise.
293 (MAIN_FILE_P): Likewise.
294 (LINEMAP_FILE): Likewise.
295 (LINEMAP_LINE): Likewise.
296 (LINEMAP_SYSP): Likewise.
297 (linemap_location_before_p): Likewise.
298 * line-map.c (linemap_check_files_exited): Make local "map" const.
299 (linemap_add): Use SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS.
300 (linemap_line_start): Likewise.
301
1a20ca67 3022015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
303
304 * aclocal.m4: Regenerated with automake-1.11.6.
305
c43181ff 3062015-05-13 David Malcolm <dmalcolm@redhat.com>
307
308 * include/line-map.h (linemap_assert): Move up within the file to
309 before all of the map accessor macros.
310 (linemap_assert_fails): Likewise.
311 (linemap_check_ordinary): Likewise.
312 (linemap_macro_expansion_map_p): Likewise.
313
e5f01cba 3142015-05-12 David Malcolm <dmalcolm@redhat.com>
315
316 * directives.c (do_line): Set seen_line_directive on line_table.
317 (do_linemarker): Likewise.
318 * include/line-map.h (struct line_maps): Add new field
319 "seen_line_directive".
320
1b03cc89 3212015-05-08 Jason Merrill <jason@redhat.com>
322
323 * include/cpplib.h: Add CPP_W_CXX11_COMPAT.
324 (struct cpp_options): Add cpp_warn_cxx11_compat.
325 * init.c (cpp_create_reader): Initialize it.
326 * lex.c (lex_string): Add -Wc++11-compat warning.
327
5c6f6a61 3282015-05-05 David Malcolm <dmalcolm@redhat.com>
329
330 * pch.c (cpp_valid_state): Fix indentation so that it reflects the
331 block structure.
332
78536ab7 3332015-05-05 David Malcolm <dmalcolm@redhat.com>
334
335 * include/line-map.h: Fix comment at the top of the file.
336 (source_location): Rewrite and expand the comment for this
337 typedef, adding an ascii-art table to clarify how source_location
338 values are allocated.
339 * line-map.c: Fix comment at the top of the file.
340
2c8df1f3 3412015-04-09 Richard Biener <rguenther@suse.de>
342
343 PR pch/65550
344 * files.c (pch_open_file): Allow main and pre-included files
345 when trying to open a PCH.
346
a0b98841 3472015-04-06 Jakub Jelinek <jakub@redhat.com>
348
349 PR preprocessor/61977
350 * lex.c (cpp_peek_token): If peektok is CPP_EOF, back it up
351 with all tokens peeked by the current function.
352
2b130ae8 3532015-04-02 Jakub Jelinek <jakub@redhat.com>
354
355 PR preprocessor/61977
356 * lex.c (cpp_peek_token): Temporarily clear pfile->cb.line_change.
357
640a5806 3582015-03-23 Jakub Jelinek <jakub@redhat.com>
359
360 PR preprocessor/65238
361 * internal.h (_cpp_scan_out_logical_line): Add third argument.
362 * directives.c (prepare_directive_trad): Pass false to it.
363 * traditional.c (_cpp_read_logical_line_trad,
364 _cpp_create_trad_definition): Likewise.
365 (struct fun_macro): Add paramc field.
366 (fun_like_macro): New function.
367 (maybe_start_funlike): Handle NODE_BUILTIN macros. Initialize
368 macro->paramc field.
369 (save_argument): Use macro->paramc instead of
370 macro->node->value.macro->paramc.
371 (push_replacement_text): Formatting fix.
372 (recursive_macro): Use fun_like_macro helper.
373 (_cpp_scan_out_logical_line): Likewise. Add BUILTIN_MACRO_ARG
374 argument. Initialize fmacro.paramc field. Handle builtin
375 function-like macros.
376
fc753aa0 3772015-03-16 Edward Smith-Rowland <3dw4rd@verizon.net>
378
379 PR c++/64626
380 * lex.c (lex_number): If a number ends with digit-seps (') skip back
381 and let lex_string take them.
382
45e87ca9 3832015-03-02 Markus Trippelsdorf <markus@trippelsdorf.de>
384
385 PR target/65261
386 * lex.c (search_line_fast): Silence ubsan errors.
387
825751e2 3882015-02-03 <dodji@redhat.com>
389
390 PR preprocessor/64803
391 * internal.h (cpp_reader::top_most_macro_node): New data member.
392 * macro.c (enter_macro_context): Pass the location of the end of
393 the top-most invocation of the function-like macro, or the
394 location of the expansion point of the top-most object-like macro.
395 (cpp_get_token_1): Store the top-most macro node in the new
396 pfile->top_most_macro_node data member.
397 (_cpp_pop_context): Clear the new cpp_reader::top_most_macro_node
398 data member.
399
c1a66267 4002015-01-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
401
402 * lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON.
403
6ca4fe46 4042015-01-23 Marek Polacek <polacek@redhat.com>
405
406 DR#412
407 PR preprocessor/60570
408 * directives.c (do_elif): Don't evaluate #elif conditionals
409 when they don't need to be.
410
e2de5ff7 4112015-01-16 Jakub Jelinek <jakub@redhat.com>
412
413 * expr.c (cpp_classify_number): Add N_() around ?: string
414 literals used in cpp_error_with_line call as format string.
415
d353bf18 4162015-01-05 Jakub Jelinek <jakub@redhat.com>
417
418 Update copyright years.
419
33058239 4202014-12-19 Jakub Jelinek <jakub@redhat.com>
421
422 PR preprocessor/63831
423 * directives.c (lex_macro_node): Remove __has_attribute__ handling.
424 * internal.h (struct spec_node): Remove n__has_attribute__ field.
425 (struct lexer_state): Remove in__has_attribute__ field.
426 * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_ATTRIBUTE.
427 * identifiers.c (_cpp_init_hashtable): Remove __has_attribute__
428 handling.
429 * init.c (builtin_array): Add __has_attribute and __has_cpp_attribute.
430 (cpp_init_special_builtins): Don't initialize __has_attribute
431 or __has_cpp_attribute if CLK_ASM or pfile->cb.has_attribute is NULL.
432 * traditional.c (enum ls): Remove ls_has_attribute,
433 ls_has_attribute_close.
434 (_cpp_scan_out_logical_line): Remove __has_attribute__ handling.
435 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_ATTRIBUTE.
436 * pch.c (cpp_read_state): Remove __has_attribute__ handling.
437 * expr.c (eval_token): Likewise.
438 (parse_has_attribute): Removed.
439
5d95297a 4402014-12-11 Uros Bizjak <ubizjak@gmail.com>
441
442 * directives.c (cpp_define_formatted): Use xvasprintf.
443
6d6bdc28 4442014-12-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
445
446 * line-map.c (linemap_position_for_loc_and_offset): Add new
447 linemap_assert_fails.
448
324da92d 4492014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
450
451 * include/line-map.h (linemap_assert_fails): Declare.
452 * line-map.c (linemap_position_for_loc_and_offset): Use it.
453
351855a5 4542014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
455
456 * line-map.c (linemap_add): Fix typo.
457 (linemap_line_start): Fix whitespace.
458
e6260d89 4592014-11-29 John Schmerge <jbschmerge@gmail.com>
460
461 PR preprocessor/41698
462 * charset.c (one_utf8_to_utf16): Do not produce surrogate pairs
463 for 0xffff.
464
1feb1b2d 4652014-11-25 Jakub Jelinek <jakub@redhat.com>
466
467 PR preprocessor/60436
468 * line-map.c (linemap_line_start): If highest is above 0x60000000
469 and we are still tracking columns or highest is above 0x70000000,
470 force add_map.
471
024db613 4722014-11-20 Uros Bizjak <ubizjak@gmail.com>
473
474 PR target/63966
c3e56f20 475 * lex.c [__i386__ || __x86_64__]: Compile special SSE functions
476 only for (__GNUC__ >= 5 || !defined(__PIC__)).
024db613 477
36a4e8f0 4782014-11-13 Manuel López-Ibáñez <manu@gcc.gnu.org>
479
480 * include/line-map.h: Include EXPR, so that unused variable warnings
481 do not occur.
482
766928aa 4832014-11-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
484
485 PR fortran/44054
486 * include/line-map.h (linemap_position_for_loc_and_offset):
487 Declare.
488 * line-map.c (linemap_position_for_loc_and_offset): New.
489
863e76f9 4902014-11-11 David Malcolm <dmalcolm@redhat.com>
491
492 * ChangeLog.jit: New.
493
3aa2fa44 4942014-11-10 Edward Smith-Rowland <3dw4rd@verizon.net>
495
496 * include/cpplib.h (cpp_callbacks): Add has_attribute.
497 * internal.h (lexer_state): Add in__has_attribute__.
498 * directives.c (lex_macro_node): Prevent use of __has_attribute__
499 as a macro.
500 * expr.c (parse_has_attribute): New function; (eval_token): Look for
501 __has_attribute__ and route to parse_has_attribute.
502 * identifiers.c (_cpp_init_hashtable): Initialize n__has_attribute__.
503 * pch.c (cpp_read_state): Initialize n__has_attribute__.
504 * traditional.c (enum ls): Add ls_has_attribute, ls_has_attribute_close;
505 (_cpp_scan_out_logical_line): Attend to __has_attribute__.
506
109ca87a 5072014-11-06 Joseph Myers <joseph@codesourcery.com>
508
509 * include/cpp-id-data.h (struct cpp_macro): Update comment
510 regarding parameters.
511 * include/cpplib.h (struct cpp_macro_arg, struct cpp_identifier):
512 Add spelling fields.
513 (struct cpp_token): Update comment on macro_arg.
514 * internal.h (_cpp_save_parameter): Add extra argument.
515 (_cpp_spell_ident_ucns): New declaration.
516 * lex.c (lex_identifier): Add SPELLING argument. Set *SPELLING to
517 original spelling of identifier.
518 (_cpp_lex_direct): Update calls to lex_identifier.
519 (_cpp_spell_ident_ucns): New function, factored out of
520 cpp_spell_token.
521 (cpp_spell_token): Adjust FORSTRING argument semantics to return
522 original spelling of identifiers. Use _cpp_spell_ident_ucns in
523 !FORSTRING case.
524 (_cpp_equiv_tokens): Check spellings of identifiers and macro
525 arguments are identical.
526 * macro.c (macro_arg_saved_data): New structure.
527 (paste_tokens): Use original spellings of identifiers from
528 cpp_spell_token.
529 (_cpp_save_parameter): Add argument SPELLING. Save both canonical
530 node and its value.
531 (parse_params): Update calls to _cpp_save_parameter.
532 (lex_expansion_token): Save spelling of macro argument tokens.
533 (_cpp_create_definition): Extract canonical node from saved data.
534 (cpp_macro_definition): Use UCNs in spelling of macro name. Use
535 original spellings of macro argument tokens and identifiers.
536 * traditional.c (scan_parameters): Update call to
537 _cpp_save_parameter.
538
95795723 5392014-11-05 Joseph Myers <joseph@codesourcery.com>
540
541 PR preprocessor/9449
542 * init.c (lang_defaults): Enable extended identifiers for C++ and
543 C99-based standards.
544
cc0a8c77 5452014-10-22 Alan Modra <amodra@gmail.com>
546
547 * symtab.c (ht_create): Use obstack_specify_allocation in place of
548 _obstack_begin.
549 * files.c (_cpp_init_files): Likewise.
550 * init.c (cpp_create_reader): Likewise.
551 * identifiers.c (_cpp_init_hashtable): Likewise.
552
1fcf9669 5532014-10-14 Manuel López-Ibáñez <manu@gcc.gnu.org>
554
555 * include/line-map.h (linemap_location_from_macro_expansion_p):
556 const struct line_maps * argument.
557 (linemap_position_for_line_and_column): const struct line_map *
558 argument.
559 * line-map.c (linemap_add_macro_token): Use correct argument name
560 in comment.
561 (linemap_position_for_line_and_column): const struct line_map *
562 argument.
563 (linemap_macro_map_loc_to_def_point): Fix comment. Make static.
564 (linemap_location_from_macro_expansion_p): const struct line_maps *
565 argument.
566 (linemap_resolve_location): Fix argument names in comment.
567
e347736d 5682014-10-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
569
570 * lex.c (search_line_fast): Add new version to be used for Power8
571 and later targets when Altivec is enabled. Restrict the existing
572 Altivec version to big-endian systems so that lvsr is not used on
573 little endian, where it is deprecated. Remove LE-specific code
574 from the now-BE-only version.
575
3f21cd58 5762014-10-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
577 Jeff Law <law@redhat.com>
578
579 * charset.c (convert_no_conversion): Reallocate memory with 25%
580 headroom.
581
f6751ff2 5822014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net>
583
584 Implement SD-6: SG10 Feature Test Recommendations
585 * internal.h (lexer_state, spec_nodes): Add in__has_include__.
586 * directives.c: Support __has_include__ builtin.
587 * expr.c (parse_has_include): New function to parse __has_include__
588 builtin; (eval_token()): Use it.
589 * files.c (_cpp_has_header()): New funtion to look for header;
590 (open_file_failed()): Not an error to not find a header file for
591 __has_include__.
592 * identifiers.c (_cpp_init_hashtable()): Add entry for __has_include__.
593 * pch.c (cpp_read_state): Lookup __has_include__.
594 * traditional.c (enum ls, _cpp_scan_out_logical_line()): Walk through
595 __has_include__ statements.
596
2cb897aa 5972014-09-30 Bernd Edlinger <bernd.edlinger@hotmail.de>
598
599 PR preprocessor/58893
600 * errors.c (cpp_diagnostic): Fix possible out of bounds access.
601 * files.c (_cpp_stack_include): Initialize src_loc for IT_CMDLINE.
602
5213d6c9 6032014-09-24 Marek Polacek <polacek@redhat.com>
604
605 PR c/61405
606 PR c/53874
607 * include/cpplib.h (enum cpp_ttype): Define CPP_KEYWORD.
608
47d6df07 6092014-09-17 Jan Hubicka <hubicka@ucw.cz>
610
611 * charset.c (conversion): Rename to ...
612 (cpp_conversion): ... this one; update.
613 * files.c (file_hash_entry): Rename to ...
614 (cpp_file_hash_entry): ... this one ; update.
615
118b2dc7 6162014-09-17 Marek Polacek <polacek@redhat.com>
617
618 PR c/61854
619 * init.c (struct lang_flags): Remove cplusplus_comments.
620 (cpp_set_lang): Likewise.
621 (post_options): Likewise.
622 * lex.c (_cpp_lex_direct): Disallow C++ style comments in C90/C94.
623
bcc1f37e 6242014-09-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
625
626 * include/cpplib.h (struct cpp_options): Declare warn_normalize as
627 int instead of enum.
628
04afd878 6292014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
630
631 * macro.c (replace_args): Use cpp_pedwarning, cpp_warning and
632 CPP_W flags.
633 * include/cpplib.h: Add CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC.
634 * init.c (cpp_create_reader): Do not init to -1 here.
635 * expr.c (num_binary_op): Use cpp_pedwarning.
636
f0fbe519 6372014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
638
639 * directives.c (check_eol_1): New.
640 (check_eol_endif_labels): New.
641 (check_eol): Call check_eol_1.
642 (do_else,do_endif): Call check_eol_endif_labels.
643
a7d2e480 6442014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
645
646 * macro.c (warn_of_redefinition): Suppress warnings for builtins
647 that lack the NODE_WARN flag, unless Wbuiltin-macro-redefined.
648 (_cpp_create_definition): Use Wbuiltin-macro-redefined for
649 builtins that lack the NODE_WARN flag.
650 * directives.c (do_undef): Likewise.
651 * init.c (cpp_init_special_builtins): Do not change flags
652 depending on Wbuiltin-macro-redefined.
653
2ab4e475 6542014-08-28 Edward Smith-Rowland <3dw4rd@verizon.net>
655
656 PR cpp/23827 - standard C++ should not have hex float preprocessor
657 tokens
658 * libcpp/init.c (lang_flags): Change CXX98 flag for extended numbers
659 from 1 to 0.
660 * libcpp/expr.c (cpp_classify_number): Weite error message for improper
661 use of hex floating literal.
662
4e454776 6632014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
664
665 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z;
666 Rename CLK_GNUCXX1Y, CLK_CXX1Y to CLK_GNUCXX14, CLK_CXX14;
667 * init.c (struct lang_flags lang_defaults): Add column for trigraphs;
668 Add rows for CLK_GNUCXX1Z, CLK_CXX1Z; (cpp_set_lang): Set trigraphs;
669 (cpp_init_builtins): Set __cplusplus to 201402L for C++14;
670 Set __cplusplus to 201500L for C++17.
671 * expr.c (cpp_classify_number): Change C++1y to C++14 in binary
672 constants error message.
673
4c860a45 6742014-08-20 Marek Polacek <polacek@redhat.com>
675
676 * include/cpplib.h (cpp_options): Use signed char.
677 * lex.c (_cpp_lex_direct): Don't warn in C++ mode.
678
d87a26d9 6792014-08-19 Marek Polacek <polacek@redhat.com>
680
681 * lex.c (_cpp_lex_direct): Fix a typo.
682
806fe15e 6832014-08-19 Marek Polacek <polacek@redhat.com>
684
685 * charset.c (_cpp_valid_ucn): Warn only if -Wc90-c99-compat.
686 * lex.c (_cpp_lex_direct): Likewise.
687 * macro.c (replace_args): Likewise.
688 (parse_params): Likewise.
689 * include/cpplib.h (cpp_options): Change cpp_warn_c90_c99_compat
690 to char.
691
890c2e2f 6922014-08-10 Marek Polacek <polacek@redhat.com>
693
694 PR c/51849
695 * lex.c (_cpp_lex_direct): Warn when -Wc90-c99-compat is in effect.
696 * charset.c (_cpp_valid_ucn): Likewise.
697 * include/cpplib.h (cpp_options): Add cpp_warn_c90_c99_compat.
698 * macro.c (replace_args): Warn when -Wc90-c99-compat is in effect.
699 (parse_params): Likewise.
700
2e82cf2c 7012014-07-27 Marek Polacek <polacek@redhat.com>
702
703 PR c/61861
704 * macro.c (builtin_macro): Add location parameter. Set
705 location of builtin macro to the expansion point.
706 (enter_macro_context): Pass location to builtin_macro.
707
a4cfdfed 7082014-07-16 Dodji Seketeli <dodji@redhat.com>
709
710 Support location tracking for built-in macro tokens
711 * include/line-map.h (line_maps::builtin_location): New data
712 member.
713 (line_map_init): Add a new parameter to initialize the new
714 line_maps::builtin_location data member.
715 * line-map.c (linemap_init): Initialize the
716 line_maps::builtin_location data member.
717 * macro.c (builtin_macro): Create a macro map and track the token
718 resulting from the expansion of a built-in macro.
719
49f161b6 7202014-07-10 Edward Smith-Rowland <3dw4rd@verizon.net>
721 Jonathan Wakely <jwakely@redhat.com>
722
b5905560 723 PR preprocessor/61389
49f161b6 724 * macro.c (_cpp_arguments_ok, parse_params, create_iso_definition):
725 Warning messages mention C++11 in c++ mode and C99 in c mode.
726 * lex.c (lex_identifier_intern, lex_identifier): Ditto
727
8947e5dc 7282014-07-09 Edward Smith-Rowland <3dw4rd@verizon.net>
729
730 PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped
731 by preprocessor
732 * lex.c (lex_raw_string ()): Do not warn about invalid suffix
733 if skipping. (lex_string ()): Ditto.
734
649bbfc4 7352014-06-04 Edward Smith-Rowland <3dw4rd@verizon.net>
736
737 PR c++/61038
738 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
739 Combine user-defined escape logic with the other string and char logic.
740
1c8ad86a 7412014-05-26 Richard Biener <rguenther@suse.de>
742
743 * configure.ac: Remove long long and __int64 type checks,
744 add check for uint64_t and fail if that wasn't found.
745 * include/cpplib.h (cpp_num_part): Use uint64_t.
746 * config.in: Regenerate.
747 * configure: Likewise.
748
0ac81b0e 7492014-05-21 Marek Polacek <polacek@redhat.com>
750
751 PR c/61212
752 * files.c (find_file_in_dir): Add parens around &&.
753
df271348 7542014-05-20 Edward Smith-Rowland <3dw4rd@verizon.net>
755
0ac81b0e 756 PR c++/61038
df271348 757 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
758 Check for user-defined literal strings and user-defined literal chars
759 to escape necessary characters.
760
a3034794 7612014-05-20 Richard Biener <rguenther@suse.de>
762
763 * configure.ac: Copy gcc logic of detecting a 64bit type.
764 Remove HOST_WIDE_INT define.
765 * include/cpplib.h: typedef cpp_num_part to a 64bit type,
766 similar to how hwint.h does it.
767 * config.in: Regenerate.
768 * configure: Likewise.
769
1c9b820a 7702014-05-09 Joey Ye <joey.ye@arm.com>
771
772 * files.c (find_file_in_dir): Always try to shorten for DOS
773 non-system headers.
774 * init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS.
775
da3c842e 7762014-05-07 Richard Biener <rguenther@suse.de>
777
778 * configure.ac: Always set need_64bit_hwint to yes.
779 * configure: Regenerated.
780
3efb5d22 7812014-04-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
782
783 * lex.c: Remove Solaris 9 reference.
784
2da35515 7852014-02-24 Walter Lee <walt@tilera.com>
786
787 * configure.ac: Change "tilepro" triplet to "tilepro*".
788 * configure: Regenerate.
789
9b48364f 7902014-02-19 Jakub Jelinek <jakub@redhat.com>
791
792 PR preprocessor/58844
793 * macro.c (enter_macro_context): Only push
794 macro_real_token_count (macro) tokens rather than
795 macro->count tokens, regardless of
796 CPP_OPTION (pfile, track-macro-expansion).
797
6e5a7913 7982014-02-07 Jakub Jelinek <jakub@redhat.com>
799
800 PR preprocessor/56824
801 * line-map.c (get_combined_adhoc_loc, linemap_get_expansion_line,
802 linemap_get_expansion_filename, linemap_location_in_system_header_p,
803 linemap_location_from_macro_expansion_p,
804 linemap_macro_loc_to_spelling_point, linemap_macro_loc_to_def_point,
805 linemap_macro_loc_to_exp_point, linemap_expand_location): Fix
806 formatting.
807 (linemap_compare_locations): Look through adhoc locations for both
808 l0 and l1.
809
ffc2c526 8102014-01-23 Dodji Seketeli <dodji@redhat.com>
811
812 PR PR preprocessor/58580
813 * include/line-map.h (linemap_get_file_highest_location): Declare
814 new function.
815 * line-map.c (linemap_get_file_highest_location): Define it.
816
806a3d45 8172014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
818
819 Update copyright years
820
e7d8908f 8212013-12-09 Joseph Myers <joseph@codesourcery.com>
822
823 PR preprocessor/55715
824 * expr.c (num_binary_op): Implement subtraction directly rather
825 than with negation and falling through into addition case.
826
eb992054 8272013-11-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
828
829 * lex.c (search_line_fast): Correct for little endian.
830
460f52aa 8312013-11-15 Joseph Myers <joseph@codesourcery.com>
832
833 * ucnid.tab: Add C11 and C11NOSTART data.
834 * makeucnid.c (digit): Rename enum value to N99.
835 (C11, N11, all_languages): New enum values.
836 (NUM_CODE_POINTS, MAX_CODE_POINT): New macros.
837 (flags, decomp, combining_value): Use NUM_CODE_POINTS as array
838 size.
839 (decomp): Use unsigned int as element type.
840 (all_decomp): New array.
841 (read_ucnid): Handle C11 and C11NOSTART. Use MAX_CODE_POINT.
842 (read_table): Use MAX_CODE_POINT. Store all decompositions in
843 all_decomp.
844 (read_derived): Use MAX_CODE_POINT.
845 (write_table): Use NUM_CODE_POINTS. Print N99, C11 and N11
846 flags. Print whole array variable declaration rather than just
847 array contents.
848 (char_id_valid, write_context_switch): New functions.
849 (main): Call write_context_switch.
850 * ucnid.h: Regenerate.
851 * include/cpplib.h (struct cpp_options): Add c11_identifiers.
852 * init.c (struct lang_flags): Add c11_identifiers.
853 (cpp_set_lang): Set c11_identifiers option from selected language.
854 * internal.h (struct normalize_state): Document "previous" as
855 previous starter character.
856 (NORMALIZE_STATE_UPDATE_IDNUM): Take character as argument.
857 * charset.c (DIG): Rename enum value to N99.
858 (C11, N11): New enum values.
859 (struct ucnrange): Give name to struct. Use short for flags and
860 unsigned int for end of range. Include ucnid.h for whole variable
861 declaration.
862 (ucn_valid_in_identifier): Allow for characters up to 0x10FFFF.
863 Allow for C11 in determining valid characters and valid start
864 characters. Use check_nfc for non-Hangul context-dependent
865 checks. Only store starter characters in nst->previous.
866 (_cpp_valid_ucn): Pass new argument to
867 NORMALIZE_STATE_UPDATE_IDNUM.
868 * lex.c (lex_identifier): Pass new argument to
869 NORMALIZE_STATE_UPDATE_IDNUM. Call NORMALIZE_STATE_UPDATE_IDNUM
870 after initial non-UCN part of identifier.
871 (lex_number): Pass new argument to NORMALIZE_STATE_UPDATE_IDNUM.
872
ceaeebbe 8732013-11-15 Joseph Myers <joseph@codesourcery.com>
874
875 * ucnid.tab: Mark C99 digits as [C99DIG].
876 * makeucnid.c (read_ucnid): Handle [C99DIG].
877 (read_table): Don't check for digit characters.
878 * ucnid.h: Regenerate.
879
5b1a0622 8802013-11-06 Tobias Burnus <burnus@net-b.de>
881
882 * macro.c (_cpp_builtin_macro_text): Correct
883 wording of two warnings.
884
9148bda3 8852013-11-05 Tobias Burnus <burnus@net-b.de>
886
887 * include/cpplib.h (CPP_W_DATE_TIME): Added.
888 (cpp_options): Add warn_date_time.
889 * init.c (cpp_create_reader): Init it.
890 * macro.c (_cpp_builtin_macro_text): Warn when
891 __DATE__/__TIME__/__TIMESTAMP__ is used.
892
4d6f7dd4 8932013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
894
9148bda3 895 Implement C++14 digit separators.
4d6f7dd4 896 * include/cpplib.h (cpp_options): Add digit_separators flag.
897 * internal.h (DIGIT_SEP(c)): New macro.
898 * expr.c (cpp_classify_number): Check improper placement of digit sep;
899 (cpp_interpret_integer): Skip over digit separators.
900 * init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add
901 digit separator flags per language; (cpp_set_lang): Set
902 digit_separators
903 * lex.c (lex_number): Add digits separator to allowable characters for
904 C++14.
905
2bd17377 9062013-10-15 David Malcolm <dmalcolm@redhat.com>
907
908 * Makefile.in (PICFLAG): New.
909 (ALL_CFLAGS): Add PICFLAG.
910 (ALL_CXXFLAGS): Likewise.
911 * configure.ac: Add --enable-host-shared, setting up new
912 PICFLAG variable.
913 * configure: Regenerate.
914
97d17efa 9152013-08-07 Richard Earnshaw <rearnsha@arm.com>
916
917 * configure.ac: Set need_64bit_hwint for all arm targets.
918 * configure: Regenerated.
919
ffb840b4 9202013-07-20 Jakub Jelinek <jakub@redhat.com>
921
922 PR preprocessor/57620
923 * lex.c (lex_raw_string): Undo phase1 and phase2 transformations
924 between R" and final " rather than only in between R"del( and )del".
925
bd285415 9262013-07-10 Jakub Jelinek <jakub@redhat.com>
927
c7691e08 928 PR preprocessor/57824
929 * lex.c (lex_raw_string): Allow reading new-lines if
930 in_deferred_pragma or if parsing_args and there is still
931 data in the current buffer.
932
da31536d 933 * include/cpplib.h (cpp_token_val_index): Change parameter type to
934 const cpp_token *.
935 * lex.c (cpp_token_val_index): Likewise.
936
bd285415 937 PR preprocessor/57757
938 * lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING
939 or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that
940 starts if a-zA-Z_.
941
4e8832f3 9422013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
943
944 * lex.c (lex_raw_string(), lex_string()): Constrain suffixes treated
945 as concatenated literal and macro to just the patterns found in
946 inttypes.h; (is_macro()): New.
947
5bd48b2e 9482013-06-24 Dehao Chen <dehao@google.com>
949
950 * files.c (_cpp_stack_include): Fix the highest_location when header
951 file is guarded by #ifndef and is included twice.
952
d8c8614f 9532013-04-28 Jakub Jelinek <jakub@redhat.com>
954
955 N3472 binary constants
956 * include/cpplib.h (struct cpp_options): Fix a typo in user_literals
957 field comment. Add binary_constants field.
958 * init.c (struct lang_flags): Add binary_constants field.
959 (lang_defaults): Add bin_cst column to the table.
960 (cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants).
961 * expr.c (cpp_classify_number): Talk about C++11 instead of C++0x
962 in diagnostics. Accept binary constants if
963 CPP_OPTION (pfile, binary_constants) even when pedantic. Adjust
964 pedwarn message.
965
1638c736 9662013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
967
968 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y.
969 * init.c (lang_defaults): Add defaults for the latter.
970 (cpp_init_builtins): Define __cplusplus as 201300L for the latter.
971 * lex.c (_cpp_lex_direct): Update.
972
0ca702f2 9732013-04-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
974
975 PR target/56771
976 * configure.ac: Require 64-bit int for arm*-*-rtems*.
977 * configure: Regenerate.
978
914db4b7 9792013-03-06 Jakub Jelinek <jakub@redhat.com>
980
981 PR middle-end/56461
982 * internal.h (struct cpp_buffer): Add to_free field.
983 (_cpp_pop_file_buffer): Add third argument.
984 * files.c (_cpp_stack_file): Set buffer->to_free.
985 (_cpp_pop_file_buffer): Add to_free argument. Free to_free
986 if non-NULL, and if equal to file->buffer_start, also clear
987 file->buffer{,_start,_valid}.
988 * directives.c (_cpp_pop_buffer): Pass buffer->to_free
989 to _cpp_pop_file_buffer.
990
39bcf299 9912013-03-01 Jakub Jelinek <jakub@redhat.com>
992
993 PR middle-end/56461
994 * files.c (_cpp_save_file_entries): Free result at the end.
995 * pch.c (cpp_string_free): New function.
996 (cpp_save_state): Use it in htab_create call.
997 (cpp_write_pch_deps): Free ss->defs. Destroy ss->definedhash.
998
61ed1f10 9992013-02-28 Jakub Jelinek <jakub@redhat.com>
1000
cde9343a 1001 * files.c (_cpp_find_file): If returning early, before storing
1002 something to *hash_slot and *hash_slot is NULL, call htab_clear_slot
1003 on it. Access *hash_slot using void * type rather than
1004 struct file_hash_entry * to avoid aliasing issues.
1005
61ed1f10 1006 * configure.ac: Don't define ENABLE_CHECKING whenever
1007 --enable-checking is seen, instead use similar --enable-checking=yes
1008 vs. --enable-checking=release default as gcc/ subdir has and
1009 define ENABLE_CHECKING if ENABLE_CHECKING is defined in gcc/.
1010 Define ENABLE_VALGRIND_CHECKING if requested.
1011 * lex.c (new_buff): If ENABLE_VALGRIND_CHECKING, put _cpp_buff
1012 struct first in the allocated buffer and result->base after it.
1013 (_cpp_free_buff): If ENABLE_VALGRIND_CHECKING, free buff itself
1014 instead of buff->base.
1015 * config.in: Regenerated.
1016 * configure: Regenerated.
1017
911b08c6 10182013-02-13 Ed Smith-Rowland <3dw4rd@verizon.net>
1019
1020 PR c++/55582
1638c736 1021 * lex.c (lex_raw_string): Allow string literal with suffix
911b08c6 1022 beginning with 's' to be parsed as a C++11 user-defined literal.
1023
cec7bb47 10242013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
1025
1026 Update copyright years.
1027
1aa79d39 10282013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
1029
1030 PR c++/54526 (again)
1031 * lex.c (_cpp_lex_direct): In C++11 mode, implement 2.5 p3, bullet 2.
1032
de2e6b8a 10332013-01-03 Marc Glisse <marc.glisse@inria.fr>
1034
1035 PR bootstrap/50177
1036 * line-map.c (get_combined_adhoc_loc): Cast from extern "C" type.
1037 (new_linemap): Likewise.
1038 (linemap_enter_macro): Likewise.
1039
8e1d1b0c 10402012-12-03 Jakub Jelinek <jakub@redhat.com>
1041
1042 PR bootstrap/55380
1043 PR other/54691
1044 * files.c (read_file_guts): Allocate extra 16 bytes instead of
1045 1 byte at the end of buf. Pass size + 16 instead of size
1046 to _cpp_convert_input.
1047 * charset.c (_cpp_convert_input): Reallocate if there aren't
1048 at least 16 bytes beyond to.len in the buffer. Clear 16 bytes
1049 at to.text + to.len.
1050
8ad1eb94 10512012-11-21 Steve Ellcey <sellcey@mips.com>
1052
1053 PR pch/55399
1054 * files.c (pch_open_file): Fix check for implicit_preinclude.
1055
52bc861d 10562012-11-16 Simon Baldwin <simonb@google.com>
1057
1058 * include/cpplib.h (struct cpp_options): Add canonical_system_headers.
1059 * files.c (find_file_in_dir): Call maybe_shorter_path() only if
1060 canonical_system_headers is set.
1061 * init.c (cpp_create_reader): Initialize canonical_system_headers.
1062 * configure.ac: Add new --enable-canonical-system-headers.
1063 * configure: Regenerate.
1064 * config.in: Regenerate.
1065
2dd00636 10662012-11-09 Ed Smith-Rowland <3dw4rd@verizon.net>
1067
1068 PR c++/54413
1069 * include/cpplib.h (cpp_interpret_float_suffix): Add cpp_reader* arg.
1070 (cpp_interpret_int_suffix): Add cpp_reader* arg.
1071 * init.c (cpp_create_reader): Iitialize new flags.
1072 * expr.c (interpret_float_suffix): Use new flags.
1073 (cpp_interpret_float_suffix): Add cpp_reader* arg.
1074 (interpret_int_suffix): Use new flags.
1075 (cpp_interpret_int_suffix): Add cpp_reader* arg.
1076 (cpp_classify_number): Adjust calls to interpret_x_suffix.
1077
5b1d5fe6 10782012-10-23 Ian Bolton <ian.bolton@arm.com>
1079 Jim MacArthur <jim.macarthur@arm.com>
1080 Marcus Shawcroft <marcus.shawcroft@arm.com>
1081 Nigel Stephens <nigel.stephens@arm.com>
1082 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
1083 Richard Earnshaw <rearnsha@arm.com>
1084 Sofiane Naci <sofiane.naci@arm.com>
1085 Stephen Thomas <stephen.thomas@arm.com>
1086 Tejas Belagod <tejas.belagod@arm.com>
1087 Yufeng Zhang <yufeng.zhang@arm.com>
1088
1089 * configure.ac: Enable AArch64.
1090 * configure: Regenerate.
1091
6adc88f8 10922012-10-23 Joseph Myers <joseph@codesourcery.com>
1093
1094 * files.c (struct _cpp_file): Add implicit_preinclude.
1095 (pch_open_file): Allow a previously opened implicitly included
1096 file.
1097 (_cpp_find_file): Add implicit_preinclude argument. Free file and
1098 do not call open_file_failed if implicit_preinclude. Store
1099 implicit_preinclude value.
1100 (_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date):
1101 Update calls to _cpp_find_file.
1102 (_cpp_stack_include): Handle IT_DEFAULT.
1103 (cpp_push_default_include): New.
1104 * include/cpplib.h (cpp_push_default_include): Declare.
1105 * init.c (cpp_read_main_file): Update call to _cpp_find_file.
1106 * internal.h (enum include_type): Add IT_DEFAULT.
1107 (_cpp_find_file): Update prototype.
1108
15fc692a 11092012-10-15 Tobias Burnus <burnus@net-b.de>
1110
1111 * files.c (read_file_guts, _cpp_save_file_entries): Free memory
1112 before returning.
1113 * lex.c (warn_about_normalization): Ditto.
1114 * mkdeps.c (deps_save): Ditto.
1115 * pch.c (cpp_valid_state): Ditto.
1116
a1f1781a 11172012-10-04 Florian Weimer <fweimer@redhat.com>
1118
1119 * directives.c (do_pragma_warning_or_error): New.
1120 (do_pragma_warning): New.
1121 (do_pragma_error): New.
1122 (_cpp_init_internal_pragmas): Register new pragmas.
1123
bda16c7c 11242012-09-25 Dehao Chen <dehao@google.com>
1125
1126 PR middle-end/54704
1127 * line-map.c (location_adhoc_data_hash): Fix the hash function.
1128
5c1946c8 11292012-09-25 Dehao Chen <dehao@google.com>
1130
1131 PR middle-end/54645
1132 * include/line-map.h (location_adhoc_data): Move location_adhoc_data
1133 into GC.
1134 (location_adhoc_data_map): Likewise.
1135 (line_maps): Likewise.
1136 (rebuild_location_adhoc_htab): New Function.
1137 * line-map.c (+rebuild_location_adhoc_htab): new Funcion.
1138 (get_combined_adhoc_loc): Move location_adhoc_data into GC.
1139 (location_adhoc_data_fini): Likewise.
1140 (linemap_init): Likewise.
1141 (location_adhoc_data_init): Remove Function.
1142
5169661d 11432012-09-19 Dehao Chen <dehao@google.com>
1144
1145 * include/line-map.h (MAX_SOURCE_LOCATION): New value.
1146 (location_adhoc_data_fini): New.
1147 (get_combined_adhoc_loc): New.
1148 (get_data_from_adhoc_loc): New.
1149 (get_location_from_adhoc_loc): New.
1150 (location_adhoc_data_map): New.
1151 (COMBINE_LOCATION_DATA): New.
1152 (IS_ADHOC_LOC): New.
1153 (expanded_location): New field.
1154 (line_maps): New field.
1155 * line-map.c (location_adhoc_data): New.
1156 (location_adhoc_data_hash): New.
1157 (location_adhoc_data_eq): New.
1158 (location_adhoc_data_update): New.
1159 (get_combined_adhoc_loc): New.
1160 (get_data_from_adhoc_loc): New.
1161 (get_location_from_adhoc_loc): New.
1162 (location_adhoc_data_init): New.
1163 (location_adhoc_data_fini): New.
1164 (linemap_init): Initialize location_adhoc_data.
1165 (linemap_lookup): Change to use new location.
1166 (linemap_ordinary_map_lookup): Likewise.
1167 (linemap_macro_map_lookup): Likewise.
1168 (linemap_macro_map_loc_to_def_point): Likewise.
1169 (linemap_macro_map_loc_unwind_toward_spel): Likewise.
1170 (linemap_get_expansion_line): Likewise.
1171 (linemap_get_expansion_filename): Likewise.
1172 (linemap_location_in_system_header_p): Likewise.
1173 (linemap_location_from_macro_expansion_p): Likewise.
1174 (linemap_macro_loc_to_spelling_point): Likewise.
1175 (linemap_macro_loc_to_def_point): Likewise.
1176 (linemap_macro_loc_to_exp_point): Likewise.
1177 (linemap_resolve_location): Likewise.
1178 (linemap_unwind_toward_expansion): Likewise.
1179 (linemap_unwind_to_first_non_reserved_loc): Likewise.
1180 (linemap_expand_location): Likewise.
1181 (linemap_dump_location): Likewise.
1182 (linemap_line_start): Likewise.
1183
307df3d0 11842012-05-25 Dodji Seketeli <dodji@redhat.com>
1185
1186 PR preprocessor/53469
1187 * directives.c (do_pragma): Use the virtual location for the
1188 pragma token, instead of its spelling location.
1189
2b15d2ba 11902012-08-14 Diego Novillo <dnovillo@google.com>
1191
1192 Merge from cxx-conversion branch. Configury.
1193
1194 * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
1195 * configure.ac: Likewise.
1196 * configure: Regenerate.
1197
11982012-08-14 Lawrence Crowl <crowl@google.com>
1199
1200 Merge from cxx-conversion branch. New C++ hash table.
1201
1202 * include/symtab.h (typedef struct ht hash_table): Change the typedef
1203 name to cpp_hash_table. Update all users of the typedef.
1204
65f4cf9c 12052012-07-30 Laurynas Biveinis <laurynas.biveinis@gmail.com>
1206
1207 * include/line-map.h (line_map_macro): Use the "atomic" GTY option
1208 for the macro_locations field.
1209
112f073c 12102011-06-19 Uros Bizjak <ubizjak@gmail.com>
1211
1212 * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
1213 __builtin_ia32_pcmpestri128 instead of asm.
1214
c8dda42f 12152012-06-04 Dimitrios Apostolou <jimis@gmx.net>
1216
1217 * line-map.c (linemap_enter_macro): Don't zero max_column_hint in
1218 every macro. This improves performance by reducing the number of
1219 reallocations when track-macro-expansion is on.
1220
0aa42a53 12212012-06-04 Dodji Seketeli <dodji@redhat.com>
1222
1223 PR preprocessor/53463
1224 * line-map.c (linemap_location_in_system_header_p): For built-in
1225 macro tokens, check the first expansion point location that is not
1226 for a token coming from a built-in macro.
1227
e8aa7eaf 12282012-05-29 Joseph Myers <joseph@codesourcery.com>
1229
1230 * directives.c: Fix typos.
1231 * include/line-map.h: Fix typos.
1232 * line-map.c: Fix typos.
1233 * macro.c: Fix typos.
1234
5fe44548 12352012-05-25 Dodji Seketeli <dodji@redhat.com>
1236
1237 PR bootstrap/53459
1238 * lex.c (search_line_fast): Avoid unused local typedefs to simulate
1239 a static assertion.
1240
8c6425eb 12412012-05-29 Dodji Seketeli <dodji@redhat.com>
1242
1243 PR preprocessor/53229
1244 * internal.h (cpp_reader::set_invocation_location): Remove.
1245 (cpp_reader::about_to_expand_macro_p): New member flag.
1246 * directives.c (do_pragma): Remove Kludge as
1247 pfile->set_invocation_location is no more.
1248 * macro.c (cpp_get_token_1): Do away with the use of
1249 cpp_reader::set_invocation_location. Just collect the macro
1250 expansion point when we are about to expand the top-most macro.
1251 Do not override cpp_reader::about_to_expand_macro_p.
1252 This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding
1253 properly handle locations of expansion points.
1254 (cpp_get_token_with_location): Adjust, as
1255 cpp_reader::set_invocation_location is no more.
1256 (paste_tokens): Take a virtual location parameter for
1257 the LHS of the pasting operator. Use it in diagnostics. Update
1258 comments.
1259 (paste_all_tokens): Tighten the assert. Propagate the location of
1260 the expansion point when no virtual locations are available.
1261 Pass the virtual location to paste_tokens.
1262 (in_macro_expansion_p): New static function.
1263 (enter_macro_context): Set the cpp_reader::about_to_expand_macro_p
1264 flag until we really start expanding the macro.
1265
a60f3e81 12662012-05-16 Dodji Seketeli <dodji@redhat.com>
1267
1268 PR preprocessor/7263
1269 * include/cpplib.h (cpp_classify_number): Take a location
1270 parameter.
1271 * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic
1272 macros that take a location parameter.
1273 (cpp_classify_number): Take a (virtual) location parameter. Use
1274 it for diagnostics. Adjust comments.
1275 (eval_token): Take a location parameter. Pass it to
1276 cpp_classify_number and to diagnostic routines.
1277 (_cpp_parse_expr): Use virtual locations of tokens when parsing
1278 expressions. Pass a virtual location to eval_token and to
1279 diagnostic routines.
1280
3069d7f8 12812012-05-10 Tristan Gingold <gingold@adacore.com>
1282
1283 * expr.c (interpret_float_suffix): Add a guard.
1284
6cfa7465 12852012-05-02 Dodji Seketeli <dodji@redhat.com>
1286
1287 Properly initialize cpp_context in destringize_and_run
1288 * directives.c (destringize_and_run): Properly initialize the new
1289 context.
1290 * macro.c (_cpp_pop_context): Assert that we shouldn't try to pop
1291 the initial base context, which has the same life time as the
1292 current instance of cpp_file.
1293
47b6a3fe 12942012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
1295 Dodji Seketeli <dodji@seketeli.org>
1296
ffca20e9 1297 PR c++/52974
47b6a3fe 1298 * libcpp/files.c (maybe_shorter_path): New.
1299 (find_file_in_dir): Use it.
1300
d16f4f47 13012012-04-30 Dodji Seketeli <dodji@redhat.com>
1302
611f1003 1303 Switch -ftrack-macro-expansion=2 on by default.
1304 * init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
1305 by default. Add comments.
1306
bd172d61 1307 Strip "<built-in>" loc from displayed expansion context
1308 * include/line-map.h (linemap_unwind_toward_expansion): Fix typo
1309 in comment.
1310 (linemap_unwind_to_first_non_reserved_loc): Declare new function.
1311 * line-map.c (linemap_unwind_to_first_non_reserved_loc): Define
1312 new function.
1313
00abfdc0 1314 Fix expansion point loc for macro-like tokens
1315 * macro.c (macro_of_context): New static function.
1316 (_cpp_push_token_context, push_extended_tokens_context): If the
1317 macro argument is NULL, it means we are continuing the expansion
1318 of the current macro, if any. Update comments.
1319 (_cpp_pop_context): Re-enable expansion of the macro only when we
1320 are really out of the context of the current expansion.
1321
c55700de 1322 Fix token pasting with -ftrack-macro-expansion
1323 * macro.c (paste_all_tokens): Put the token resulting from pasting
1324 into an extended token context with -ftrack-macro-location is in
1325 effect.
1326
d16f4f47 1327 Fix cpp_sys_macro_p with -ftrack-macro-expansion
1328 * macro.c (cpp_sys_macro_p): Support -ftrack-macro-expansion.
1329
86c82b61 13302012-04-29 Dodji Seketeli <dodji@redhat.com>
1331
1332 * lex.c (lex_raw_string): Change C++ style comments into C style
1333 comments.
cc0a8c77 1334 (lex_string): Likewise.
86c82b61 1335
76d340ac 13362012-04-27 Ollie Wild <aaw@google.com>
1337
1338 * include/cpplib.h (struct cpp_options): Add new field,
1339 warn_literal_suffix.
1340 (CPP_W_LITERAL_SUFFIX): New enum.
1341 * init.c (cpp_create_reader): Default initialization of
1342 warn_literal_suffix.
1343 * lex.c (lex_raw_string): Treat user-defined literals which don't
1344 begin with '_' as separate tokens and produce a warning.
1345 (lex_string): Ditto.
1346
3f898bd2 13472012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
1348
1349 * line-map.c (linemap_resolve_location): Synchronize comments with
1350 those in line-map.h.
1351 * include/line-map.h (linemap_resolve_location): Fix spelling in
1352 comment.
1353
c434932e 13542012-03-22 Richard Earnshaw <rearnsha@arm.com>
1355
1356 * lex.c (search_line_fast): Provide Neon-optimized version for ARM.
1357
264a5d11 13582012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1359
1360 * lex.c: Remove Solaris 8 reference.
1361
7ce78e23 13622012-02-14 Walter Lee <walt@tilera.com>
1363
1364 * configure.ac: Require 64-bit hwint for tilegx and tilepro.
1365 * configure: Regenerate.
1366
d6fb6576 13672012-01-09 Richard Guenther <rguenther@suse.de>
1368
1369 * macro.c (_cpp_builtin_macro_text): Remove unused variable map.
1370
5e791406 13712012-01-09 Gary Funck <gary@intrepid.com>
1372
1373 PR preprocessor/33919
1374 * files.c (_cpp_get_file_name): New. Implement file name
1375 access function.
1376 * internal.h (_cpp_get_file_name): New prototype.
1377 * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
1378 to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
1379
131e69c7 13802012-01-03 Olivier Hainque <hainque@adacore.com>
1381
1382 * system.h: Prior to #define, #undef fopen and freopen unconditionally.
1383
32074525 13842011-12-20 Joseph Myers <joseph@codesourcery.com>
1385
1386 * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
1387 (CLK_STDC1X): Change to CLK_STDC11.
1388 * init.c (lang_defaults): Update comments.
1389 (cpp_init_builtins): Update language tests. Use 201112L for C11
1390 __STDC_VERSION__.
1391
80cfebdb 13922011-12-20 Andreas Schwab <schwab@linux-m68k.org>
1393
1394 * configure: Regenerate.
1395
705de1ef 13962011-12-19 Andreas Schwab <schwab@linux-m68k.org>
1397
1398 * configure: Regenerate.
1399
b735cc56 14002011-12-07 Jakub Jelinek <jakub@redhat.com>
1401
1402 PR bootstrap/50237
1403 * internal.h (_cpp_init_lexer): New prototype.
1404 * init.c (init_library): Call it.
1405 * lex.c (init_vectorized_lexer): Remove constructor attribute,
1406 add inline keyword.
1407 (HAVE_init_vectorized_lexer): Define.
1408 (_cpp_init_lexer): New function.
1409
80e34234 14102011-12-03 Dodji Seketeli <dodji@redhat.com>
1411
1412 * macro.c (tokens_buff_remove_last_token)
1413 (tokens_buff_put_token_to): Add an 'inline' function specifier to
1414 the prototype.
1415
b082215e 14162011-11-22 Diego Novillo <dnovillo@google.com>
1417
1418 * include/line-map.h (linemap_dump): Declare.
1419 (line_table_dump): Declare.
1420 * line-map.c (linemap_dump): New.
1421 (line_table_dump): New.
1422
b06c89b6 14232011-11-21 Ed Smith-Rowland <3dw4rd@verizon.net>
1424
1425 PR c++/50958
1426 * expr.c (cpp_userdef_char_remove_type): Fix typo.
1427
7c801b60 14282011-11-03 Michael Matz <matz@suse.de>
1429
1430 PR bootstrap/50857
1431 * configure.ac: Check for -fno-exceptions -fno-rtti.
1432 * configure: Regenerate.
1433 * Makefile.in (NOEXCEPTION_FLAGS): New flag.
1434 (ALL_CXXFLAGS): Use it.
1435
d8954404 14362011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
1437
1438 * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
1439
7e783eb3 14402011-11-02 Jason Merrill <jason@redhat.com>
1441
1442 PR c++/50810
1443 * configure.ac: Add -Wno-narrowing to warning options.
1444
0d84dc2d 14452011-10-31 Jason Merrill <jason@redhat.com>
1446
de803ff2 1447 PR libstdc++/1773
1448 * init.c (cpp_init_builtins): Set __cplusplus for C++11.
1449
0d84dc2d 1450 PR c++/50920
1451 * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
1452 CLK_GNUCXX0X to CLK_GNUCXX11.
1453
244db24d 14542011-10-26 Ed Smith-Rowland <3dw4rd@verizon.net>
1455
1456 Implement C++11 user-defined literals.
1457 * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
1458 cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
1459 cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
1460 cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
1461 (cpp_classify_number): Classify unrecognized tokens as user-defined
1462 literals.
1463 * include/cpplib.h: Add new tokens for user-defined literals.
1464 * init.c: Add new preprocessor flag (cxx11).
1465 * lex.c: (lex_string, lex_raw_string): Handle user-defined literals
1466 including concatenation and promotion with suffixes.
1467
68928989 14682011-10-24 Dodji Seketeli <dodji@redhat.com>
1469
1470 * line-map.c (linemap_macro_map_lookup): Fix logic.
1471
5ebe2143 14722011-10-24 Dodji Seketeli <dodji@redhat.com>
1473
1474 * include/line-map.h (linemap_expand_location): Take a line table
1475 parameter. Update comment.
1476 (linemap_resolve_location): Update comment.
1477 (linemap_expand_location_full): Remove.
1478 * line-map.c (linemap_resolve_location): Handle reserved
1479 locations; return a NULL map in those cases.
1480 (linemap_expand_location): If location is reserved, return a
1481 zeroed expanded location. Update comment. Take a line table to
1482 assert that the function takes non-virtual locations only.
1483 (linemap_expand_location_full): remove.
1484 (linemap_dump_location): Handle the fact that
1485 linemap_resolve_location can return NULL line maps when the
1486 location resolves to a reserved location.
1487
1488 * line-map.c (linemap_macro_map_lookup): Fix logic.
1489
a2eb22f0 14902011-10-22 Dodji Seketeli <dodji@redhat.com>
1491
1492 PR bootstrap/50778
1493 * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
1494 context to act upon.
1495 * lex.c (_cpp_remaining_tokens_num_in_context): Likewise. Update
1496 comment.
1497 (cpp_token_from_context_at): Likewise.
1498 (cpp_peek_token): Use the context to peek tokens from.
1499
ac6130e2 15002011-10-20 Dodji Seketeli <dodji@redhat.com>
1501
1502 PR bootstrap/50801
1503 * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
1504 number of tokens.
1505
2a688977 15062011-10-18 Dodji Seketeli <dodji@redhat.com>
1507
1508 PR bootstrap/50760
1509 * include/line-map.h (struct linemap_stats): Change the type of
cc0a8c77 1510 the members from size_t to long.
2a688977 1511 * macro.c (macro_arg_token_iter_init): Unconditionally initialize
cc0a8c77 1512 iter->location_ptr.
2a688977 1513
a67520a9 15142011-10-17 Dodji Seketeli <dodji@redhat.com>
1515
1516 * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
cc0a8c77 1517 variable without using it if ENABLE_CHECKING is not defined. Mark
1518 the LOCATION parameter as being unused.
a67520a9 1519
1ae3520e 15202011-10-15 Tom Tromey <tromey@redhat.com>
1521 Dodji Seketeli <dodji@redhat.com>
1522
1523 * include/line-map.h (struct line_maps::alloced_size_for_request):
1524 New member.
1525 * line-map.c (new_linemap): Use set->alloced_size_for_request to
1526 get the actual allocated size of line maps.
1527
e77b8253 15282011-10-15 Tom Tromey <tromey@redhat.com>
1529 Dodji Seketeli <dodji@redhat.com>
1530
1531 * line-map.h (struct linemap_stats): Declare new struct.
1532 (linemap_get_statistics): Declare ...
1533 * line-map.c (linemap_get_statistics): ... new function.
1534 * macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
1535 Declare new counters.
1536 (enter_macro_context, replace_args): Update
1537 num_macro_tokens_counter.
1538 (cpp_get_token_1): Update num_expanded_macros_counter.
1539
62db153a 15402011-10-15 Tom Tromey <tromey@redhat.com>
1541 Dodji Seketeli <dodji@redhat.com>
1542
1543 * include/cpplib.h (struct cpp_options)<debug>: New struct member.
1544 * include/line-map.h (linemap_dump_location): Declare ...
1545 * line-map.c (linemap_dump_location): ... new function.
1546
ce70f433 15472011-10-15 Tom Tromey <tromey@redhat.com>
1548 Dodji Seketeli <dodji@redhat.com>
1549
1550 * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
1551 New option.
1552 * internal.h (struct macro_context): New struct.
1553 (enum context_tokens_kind): New enum.
1554 (struct cpp_context)<tokens_kind>: New member of type enum
1555 context_tokens_kind.
1556 (struct cpp_context)<macro>: Remove this. Replace it with an enum
1557 of macro and macro_context.
1558 (struct cpp_context)<direct_p>: Remove.
1559 (_cpp_remaining_tokens_num_in_context): Declare new function.
1560 * directives.c (destringize_and_run): Adjust.
1561 * lex.c (_cpp_remaining_tokens_num_in_context)
1562 (_cpp_token_from_context_at): Define new functions
1563 (cpp_peek_token): Use them.
1564 * init.c (cpp_create_reader): Initialize the base context to zero.
1565 (_cpp_token_from_context_at): Define new static function.
1566 (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
1567 _cpp_token_from_context_at.
1568 * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
1569 members.
1570 (enum macro_arg_token_kind): New enum.
1571 (struct macro_arg_token_iter): New struct.
1572 (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
1573 (alloc_expanded_arg_mem, ensure_expanded_arg_room)
1574 (delete_macro_args, set_arg_token, get_arg_token_location)
1575 (arg_token_ptr_at, macro_arg_token_iter_init)
1576 (macro_arg_token_iter_get_token)
1577 (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
1578 (expanded_token_index, tokens_buff_new, tokens_buff_count)
1579 (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
1580 (tokens_buff_add_token, tokens_buff_remove_last_token)
1581 (reached_end_of_context, consume_next_token_from_context): New
1582 static functions.
1583 (cpp_get_token_1): New static function. Split and extended from
1584 cpp_get_token. Use reached_end_of_context and
1585 consume_next_token_from_context. Unify its return point. Move
1586 the location tweaking from cpp_get_token_with_location in here.
1587 (cpp_get_token): Use cpp_get_token_1
1588 (stringify_arg): Use the new arg_token_at.
1589 (paste_all_tokens): Support tokens coming from extended tokens
1590 contexts.
1591 (collect_args): Return the number of collected arguments, by
1592 parameter. Store virtual locations of tokens that constitute the
1593 collected args.
1594 (funlike_invocation_p): Return the number of collected arguments,
1595 by parameter.
1596 (enter_macro_context): Add a parameter for macro expansion point.
1597 Pass it to replace_args and to the "used" cpp callback. Get the
1598 number of function-like macro arguments from funlike_invocation_p,
1599 pass it to the new delete_macro_args to free the memory used by
1600 macro args. When -ftrack-macro-expansion is in effect, for macros
1601 that have no arguments, create a macro map for the macro expansion
1602 and use it to allocate proper virtual locations for tokens
1603 resulting from the expansion. Push an extended tokens context
1604 containing the tokens resulting from macro expansion and their
1605 virtual locations.
1606 (replace_args): Rename the different variables named 'count' into
1607 variables with more meaningful names. Create a macro map;
1608 allocate virtual locations of tokens resulting from this
1609 expansion. Use macro_arg_token_iter to iterate over tokens of a
1610 given macro. Handle the case of the argument of
1611 -ftrack-macro-expansion being < 2. Don't free macro arguments
1612 memory resulting from expand_arg here, as these are freed by the
1613 caller of replace_arg using delete_macro_args now. Push extended
1614 token context.
1615 (next_context, push_ptoken_context, _cpp_push_token_context)
1616 (_cpp_push_text_context): Properly initialize the context.
1617 (expand_arg): Use the new alloc_expanded_arg_mem,
1618 push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
1619 (_cpp_pop_context): Really free the memory held by the context.
1620 Handle freeing memory used by extended tokens contexts.
1621 (cpp_get_token_with_location): Use cpp_get_token_1.
1622 (cpp_sys_macro_p): Adjust.
1623 (_cpp_backup_tokens): Support the new kinds of token contexts.
1624 * traditional.c (recursive_macro): Adjust.
1625
97bfb9ef 16262011-10-15 Tom Tromey <tromey@redhat>
1627 Dodji Seketeli <dodji@redhat.com>
1628
1629 * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
1630 member.
1631 (MAX_SOURCE_LOCATION): New constant.
1632 (struct line_map_ordinary, struct line_map_macro): New structs.
cc0a8c77 1633 (struct line_map): Turn this into a union of the two above. Add
97bfb9ef 1634 comments.
1635 (struct maps_info): New struct.
1636 (struct line_maps)<info_ordinary, info_macro>: Two new fields.
1637 These now carry the map information that was previously scattered
1638 in struct line_maps.
1639 (struct map_info::allocated): Fix comment.
1640 (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
1641 (ORDINARY_MAP_STARTING_LINE_NUMBER)
1642 (ORDINARY_MAP_INCLUDER_FILE_INDEX)
1643 (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
1644 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
1645 (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
1646 (MACRO_MAP_EXPANSION_POINT_LOCATION)
1647 (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
1648 (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
1649 (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
1650 (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
1651 (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
1652 (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
1653 (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
1654 (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
1655 (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
1656 (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
1657 (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
1658 information.
1659 (linemap_check_ordinary, linemap_assert)
1660 (linemap_location_before_p): New macros.
1661 (linemap_position_for_line_and_column)
1662 (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
1663 (linemap_macro_expansion_map_p)
1664 (linemap_macro_map_loc_to_def_point)
1665 (linemap_macro_map_loc_unwind_once)
1666 (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
1667 (linemap_get_source_line linemap_get_source_column)
1668 (linemap_map_get_macro_name, linemap_get_file_path)
1669 (linemap_location_in_system_header_p)
1670 (linemap_location_from_macro_expansion_p): Declare new functions.
1671 (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
1672 (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
1673 accessors act on ordinary maps only.
1674 (INCLUDED_FROM): Return NULL for main files; use the new
1675 accessors.
1676 (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
1677 (struct expanded_location): Move here from gcc/input.h
1678 (linemap_resolve_location, linemap_expand_location)
1679 (linemap_expand_location_full): Declare new functions.
1680 * line-map.c: Include cpplib.h, internal.h
1681 (linemap_enter_macro, linemap_add_macro_token)
1682 (linemap_get_expansion_line, linemap_get_expansion_filename): New
1683 functions that are private to libcpp.
1684 (linemap_assert): New macro.
1685 (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
1686 (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
1687 (linemap_macro_map_loc_unwind_toward_spelling)
1688 (linemap_macro_map_loc_to_exp_point)
1689 (first_map_in_common_1, first_map_in_common): New static
1690 functions.
1691 (new_linemap): Define new static functions. Extracted and
1692 enhanced from ...
1693 (linemap_add): ... here. Use linemap_assert in lieu of abort
1694 previously.
1695 (linemap_tracks_macro_expansion_locs_p)
1696 (linemap_add_macro_token, linemap_macro_expansion_map_p)
1697 (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
1698 (linemap_macro_map_loc_to_def_point)
1699 (linemap_macro_map_loc_unwind_once)
1700 (linemap_step_out_once, linemap_map_get_index)
1701 (linemap_get_source_line,linemap_get_source_column)
1702 (linemap_get_file_path, linemap_map_get_macro_name)
1703 (linemap_location_in_system_header_p)
1704 (linemap_location_originated_from_system_header_p)
1705 (linemap_location_from_macro_expansion_p)
1706 (linemap_tracks_macro_expansion_locs_p)
1707 (linemap_resolve_location, linemap_expand_location)
1708 (linemap_expand_location_full)
1709 (linemap_tracks_macro_expansion_locs_p)
1710 (linemap_position_for_line_and_column, linemap_compare_locations):
1711 Define new public functions.
1712 (linemap_init): Initialize ordinary and macro maps information in
1713 the map set.
1714 (linemap_check_files_exited): Use the new accessors.
1715 (linemap_free): Remove this dead code.
1716 (linemap_line_start): Assert this uses an ordinary map. Adjust to
1717 use the new ordinary map accessors and data structures. Don't
1718 overflow past the lowest possible macro token's location.
1719 (linemap_position_for_column): Assert the ordinary maps of the map
1720 set are really ordinary. Use ordinary map accessors.
1721 (linemap_lookup): Keep the same logic but generalize to allow
1722 lookup of both ordinary and macro maps. Do not crash when called
1723 with an empty line table.
1724 * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
1725 new API of line-map.h.
1726 * directives.c (start_directive, do_line, do_linemarker)
1727 (do_linemarker): Likewise.
1728 * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
1729 (make_cpp_dir, cpp_make_system_header): Likewise.
1730 * init.c (cpp_read_main_file): Likewise.
1731 * internal.h (CPP_INCREMENT_LINE): Likewise.
1732 (linemap_enter_macro, linemap_add_macro_token)
1733 (linemap_get_expansion_line, linemap_get_expansion_filename): New
1734 functions private to libcpp.
1735 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
1736 (skip_line_comment, skip_whitespace, lex_raw_string)
1737 (_cpp_lex_direct): Likewise.
1738 * macro.c (_cpp_builtin_macro_text): Likewise.
1739 (_cpp_aligned_alloc): Initialize the new name member of the macro.
1740 * traditional.c (copy_comment, _cpp_scan_out_logical_line):
1741 Likewise.
1742 * errors.c (cpp_diagnostic): Adjust to new linemap API.
1743
1dc92c59 17442011-08-28 Dodji Seketeli <dodji@redhat.com>
1745
1746 * line-map.c (linemap_add): Assert that reason must not be
1747 LC_RENAME when called for the first time on a "main input file".
1748
6ea2c7a3 17492011-08-22 Gabriel Charette <gchare@google.com>
1750
1751 * init.c (cpp_create_reader): Inititalize forced_token_location_p.
1752 * internal.h (struct cpp_reader): Add field forced_token_location_p.
1753 * lex.c (_cpp_lex_direct): Use forced_token_location_p.
1754 (cpp_force_token_locations): New.
1755 (cpp_stop_forcing_token_locations): New.
1756
985e7f10 17572011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1758
1759 PR libstdc++/1773
1760 * init.c (cpp_init_builtins): Define __cplusplus 19971L.
1761
094a55ba 17622011-08-18 Joseph Myers <joseph@codesourcery.com>
1763
1764 * include/cpplib.h (struct cpp_options): Fix typo.
1765
6f6f3dd7 17662011-08-18 Joseph Myers <joseph@codesourcery.com>
1767
1768 * include/cpplib.h (struct cpp_options): Add rliterals.
1769 * init.c (struct lang_flags, lang_defaults): Add rliterals.
1770 (cpp_set_lang): Set rliterals option.
1771 (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
1772 * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
1773
80ea6373 17742011-08-15 Gabriel Charette <gchare@google.com>
1775
1776 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
1777 Update all users to use linemap_position_for_column instead.
1778
d44dc666 17792011-07-28 Gabriel Charette <gchare@google.com>
1780
1781 * include/line-map.h (struct line_maps):
1782 Remove unused field last_listed. Update all users.
1783
6b4db1bd 17842011-07-28 H.J. Lu <hongjiu.lu@intel.com>
1785
1786 * configure.ac: Set need_64bit_hwint to yes for x86 targets.
1787 * configure: Regenerated.
1788
80e4662c 17892011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1790
1791 * system.h [__cplusplus]: Wrap C function declarations in extern "C".
1792
6678cb4e 17932011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1794 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1795
1796 PR bootstrap/49794
1797 * configure.ac: Test AM_ICONV with CXX.
1798 * configure: Regenerate.
1799 * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
1800
c219ee5c 18012011-07-15 Dodji Seketeli <dodji@redhat.com>
1802
1803 * directives.c (struct if_stack): Use source_location as type
1804 here.
1805 * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
1806 indent, def_pragma, used_define, used_undef>: Properly use
1807 source_location as parameter type, rather than unsigned int.
1808
14f27bc6 18092011-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1810
1811 PR target/39150
1812 * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
1813 like i[34567]86-*-solaris2.1[0-9]*.
1814 * configure: Regenerate.
1815
414663ef 18162011-06-16 Jason Merrill <jason@redhat.com>
1817
1818 PR c++/45399
1819 * lex.c (lex_raw_string): Don't check for embedded NUL.
1820
2c694d44 18212011-06-06 Dodji Seketeli <dodji@redhat.com>
1822
1823 PR preprocessor/48532
1824 * directives.c (do_pragma): Don't forget the invocation location
1825 when parsing the pragma name of a namespaced pragma directive.
1826
9793dd8e 18272011-05-29 John Tytgat <John.Tytgat@aaug.net>
1828
1829 * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
1830
cef70b8a 18312011-05-22 Uros Bizjak <ubizjak@gmail.com>
1832
1833 PR target/49104
1834 * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
1835 is defined. Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
1836
cdd0bb4b 18372011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
1838
1839 * system.h (ENUM_BITFIELD): Remove.
1840
0ff0cd04 18412011-04-24 Jakub Jelinek <jakub@redhat.com>
1842
1843 PR preprocessor/48740
1844 * lex.c (lex_raw_string): When raw string ends with
1845 ??) followed by raw prefix and ", ensure it is preprocessed
1846 with ??) rather than ??].
1847
dd045aee 18482011-04-20 Jim Meyering <meyering@redhat.com>
1849
1850 * files.c (destroy_cpp_file): Remove useless if-before-free.
1851 * init.c (cpp_destroy): Likewise.
1852 * macro.c (replace_args): Likewise.
1853 * pch.c (cpp_valid_state): Likewise.
1854
bb7824b5 18552011-03-25 Kai Tietz <ktietz@redhat.com>
1856
1857 * files.c (file_hash_eq): Use filename_cmp
1858 instead of strcmp.
1859 (nonexistent_file_hash_eq): Likewise.
1860 (remap_filename): Likewise.
1861 Handle absolute DOS-path,
1862 (append_file_to_dir): Check for IS_DIR_SEPARATOR
1863 instead of slash.
1864 (read_name_map): Likewise.
1865 * linemap.c (linemap_add): Use filename_cmp
1866 instead of strcmp.
1867 * mkdeps.c (apply_vpath): Use filename_ncmp
1868 instead of strncmp.
1869 (deps_restore): Use filename_cmp instead of
1870 strcmp.
1871 * init.c (read_original_directory): Use
1872 IS_DIR_SEPARATOR instead of checking for slash.
1873
00e59df9 18742011-03-21 Michael Meissner <meissner@linux.vnet.ibm.com>
1875
1876 PR preprocessor/48192
1877 * directives.c (do_ifdef): Do not consider conditional macros as
1878 being defined.
1879 (do_ifndef): Ditto.
1880 * expr.c (parse_defined): Ditto.
1881
70ebee13 18822011-03-18 Richard Henderson <rth@redhat.com>
1883
1884 PR bootstrap/45381
1885 * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
1886
65861c3e 18872011-11-04 Eric Botcazou <ebotcazou@adacore.com>
cc0a8c77 1888 Jakub Jelinek <jakub@redhat.com>
65861c3e 1889
1890 PR preprocessor/39213
1891 * directives.c (end_directive): Call _cpp_remove_overlay for deferred
1892 pragmas as well in traditional mode.
1893
be04fdf9 18942010-11-17 Ian Lance Taylor <iant@google.com>
1895
1896 PR bootstrap/45538
1897 * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of
1898 AC_LANG based on ENABLE_BUILD_WITH_CXX.
1899
560ab0b2 19002010-11-16 Kai Tietz <kai.tietz@onevision.com>
1901
1902 PR preprocessor/17349
1903 * lex.c (save_comment): Handle in argument passing c++
1904 comments special.
1905
075f1161 19062010-11-02 Ian Lance Taylor <iant@google.com>
1907
1908 * configure.ac: Use AC_SYS_LARGEFILE.
1909 * configure: Rebuild.
1910 * config.in: Rebuild.
1911
bc3d3e89 19122010-10-19 Basile Starynkevitch <basile@starynkevitch.net>
075f1161 1913
bc3d3e89 1914 * line-map.h (source_location): Remove obsolete comment
1915 mentioning location_s.
1916
0d601ff4 19172010-09-29 Kai Tietz <kai.tietz@onevision.com>
1918
1919 PR preprocessor/45362
1920 * directives.c (cpp_pop_definition): Make static.
1921 (do_pragma_push_macro): Reworked to store text
1922 definition.
1923 (do_pragma_pop_macro): Add free text definition.
1924 (cpp_push_definition): Removed.
1925 * include/cpplib.h (cpp_push_definition): Removed.
1926 (cpp_pop_definition): Likewise.
1927 * internal.h (def_pragma_macro): Remove member 'value'
1928 and add new members 'definition', 'line',
1929 'syshdr', 'sued' and 'is_undef'.
1930 * pch.c (_cpp_restore_pushed_macros): Rework to work
1931 on text definition and store additional macro flags.
1932 (_cpp_save_pushed_macros): Likewise.
1933
5ae82d58 19342010-09-29 Joseph Myers <joseph@codesourcery.com>
1935
1936 * include/cpplib.h (cpp_options): Rename warn_deprecated,
1937 warn_traditional, warn_long_long and pedantic.
1938 * directives.c (directive_diagnostics, _cpp_handle_directive):
1939 Update names of cpp_options members.
1940 * expr.c (cpp_classify_number, eval_token): Update names of
1941 cpp_options members.
1942 * init.c (cpp_create_reader, post_options): Update names of
1943 cpp_options members.
1944 * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
1945 cpp_options members.
1946 * macro.c (parse_params): Update names of cpp_options members.
1947
ced52ffd 19482010-09-15 Ian Lance Taylor <iant@google.com>
1949
1950 * init.c: Fix type name in comment.
1951
df863d33 19522010-08-31 Jakub Jelinek <jakub@redhat.com>
1953
1954 PR preprocessor/45457
1955 * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
1956 needed.
1957 * directives.c (do_ifdef, do_ifndef): Likewise.
1958
9e76b586 19592010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1960
1961 * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
1962
b315ae35 19632010-08-24 Richard Henderson <rth@redhat.com>
1964
1965 PR bootstrap/45376
1966 * configure.ac (HAVE_SSE4): New check.
1967 * configure, config.in: Rebuild.
1968 * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
1969
8ab29ece 19702010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1971
1972 * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
1973 etc. on Solaris 2/x86.
1974
2431e8ba 19752010-08-21 Richard Henderson <rth@redhat.com>
1976 Andi Kleen <ak@linux.intel.com>
1977 David S. Miller <davem@davemloft.net>
1978
1979 * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
1980 (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
1981 (ptrdiff_t): Check via AC_CHECK_TYPE.
1982 * config.in, configure: Rebuild.
1983 * system.h: Include stdint.h, if available.
1984 * lex.c (WORDS_BIGENDIAN): Provide default.
1985 (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
1986 acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
1987 search_line_sse2, search_line_sse42, init_vectorized_lexer,
1988 search_line_fast): New.
1989 (_cpp_clean_line): Use search_line_fast. Restructure the fast
1990 loop to make it clear when we're leaving the loop. Stay in the
1991 fast loop for non-trigraph '?'.
1992
25692381 19932010-06-11 Jakub Jelinek <jakub@redhat.com>
1994
1995 * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
1996 callback.
1997 (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
1998 (cpp_macro_definition): Remove const qual from second argument.
1999 * macro.c (enter_macro_context): Call user_builtin_macro callback for
2000 NODE_BUILTIN !NODE_USED macros.
2001 (warn_of_redefinition): Likewise. Remove const qual from second
2002 argument.
2003 (cpp_macro_definition): Likewise.
2004 * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
2005 for NODE_BUILTIN !NODE_USED macros.
2006
abf6a617 20072010-06-10 Joseph Myers <joseph@codesourcery.com>
2008
2009 * include/cpplib.h (struct cpp_options): Remove show_column.
2010 * init.c (cpp_create_reader, post_options): Don't set show_column.
2011
9d135bb6 20122010-06-09 Joern Rennecke <joern.rennecke@embecosm.com>
2013
2014 PR bootstrap/44432
2015 * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
2016 check that C++ compiler works.
2017 * configure: Regenerate.
2018
ba72912a 20192010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
2020
2021 * include/symtab.h (ht_identifier_ptr): New.
2022
050318d9 20232010-06-03 Joern Rennecke <joern.rennecke@embecosm.com>
2024 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2025
2026 PR bootstrap/42798
2027 * configure.ac: Check for declaration of 'basename(char *)'.
2028 * configure: Regenerate.
2029 * config.in: Regenerate.
2030
39012afb 20312010-04-25 Joseph Myers <joseph@codesourcery.com>
2032
2033 * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
2034 * init.c (lang_defaults): Add entries for new language variants.
2035 (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
2036 variants.
2037
721e9705 20382010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
2039
2040 PR cpp/43195
2041 * files.c (report_missing_guard): Test for #pragma once.
2042
3a79f5da 20432010-04-07 Simon Baldwin <simonb@google.com>
2044
2045 * directives.c (do_diagnostic): Add warning reason argument,
2046 call appropriate error reporting function for code.
2047 (directive_diagnostics): Call specific warning functions with
2048 warning reason where appropriate.
2049 (do_error, do_warning, do_pragma_dependency): Add warning reason
2050 argument to do_diagnostic calls.
2051 * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
2052 _cpp_create_definition): Call specific warning functions with
2053 warning reason where appropriate.
2054 * Makefile.in: Add new diagnostic functions to gettext translations.
2055 * include/cpplib.h (struct cpp_callbacks): Add warning reason code
2056 to error callback.
2057 (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
2058 CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
2059 (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
2060 CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
2061 CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
2062 CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
2063 CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
2064 CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
2065 CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
2066 warning reason codes.
2067 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
2068 cpp_warning_with_line, cpp_pedwarning_with_line,
2069 cpp_warning_with_line_syshdr): New specific error reporting functions.
2070 * pch.c (cpp_valid_state): Call specific warning functions with
2071 warning reason where appropriate.
2072 * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
2073 diagnostic handlers.
2074 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
2075 cpp_warning_with_line, cpp_pedwarning_with_line,
2076 cpp_warning_with_line_syshdr): New specific error reporting functions.
2077 * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
2078 specific warning functions with warning reason where appropriate.
2079 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
2080 warn_about_normalization, lex_identifier_intern, lex_identifier,
2081 _cpp_lex_direct): Ditto.
2082 * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
2083 narrow_str_to_charconst): Ditto.
2084
56e2ce2d 20852010-04-06 Jakub Jelinek <jakub@redhat.com>
2086
2087 PR preprocessor/43642
2088 * lex.c (lex_raw_string): Change type of TYPE variable to
2089 unsigned char.
2090
e0934084 20912010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2092
2093 * aclocal.m4: Regenerate.
2094
7fe0ef3a 20952010-03-29 Jason Merrill <jason@redhat.com>
2096
3a45011c 2097 More N3077 raw string changes
2098 * charset.c (cpp_interpret_string): Don't transform UCNs in raw
2099 strings.
2100 * lex.c (bufring_append): Split out from...
2101 (lex_raw_string): ...here. Undo trigraph and line splicing
2102 transformations. Do process line notes in multi-line literals.
2103 (_cpp_process_line_notes): Ignore notes that were already handled.
2104
7fe0ef3a 2105 Some raw string changes from N3077
2106 * charset.c (cpp_interpret_string): Change inner delimiters to ().
2107 * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter.
2108
65f40615 21092010-02-11 Jakub Jelinek <jakub@redhat.com>
2110
2111 * init.c (read_original_filename): Don't call read_original_directory
2112 if _cpp_handle_directive returns 0.
2113
0074cd57 21142010-01-01 Joseph Myers <joseph@codesourcery.com>
2115
2116 PR preprocessor/41947
2117 * expr.c (cpp_classify_number): Give error for hexadecimal
2118 floating-point constant with no digits before or after point.
2119
116f0a5f 21202009-11-20 Arnaud Charlet <charlet@adacore.com>
2121
2122 * macro.c (enter_macro_context): Call cb.used callback if defined.
2123 * directives.c (do_idef, do_ifndef): Ditto.
2124 * include/cpplib.h (struct cpp_callbacks): Add used callback.
2125
038c21f1 21262009-11-11 Kai Tietz <kai.tietz@onevision.com>
2127
2128 * directives.c (do_pragma_push_macro): New pragma handler.
2129 (do_pragma_pop_macro): Likewise.
2130 (_cpp_init_internal_pragmas): Add push_macro and
2131 pop_macro handler to internal pragmas.
2132 (lex_macro_node_from_str): Removed.
2133 (cpp_push_definition): Replace lex_macro_node_from_str
2134 by _cpp_lex_identifier.
2135 (cpp_pop_definition): Likewise.
2136 * internal.h (_cpp_lex_identifier): New prototype.
2137 (def_pragma_macro): New structure.
2138 (cpp_reader): New member pushed_macros.
2139 * lex.c (_cpp_lex_identifier): New function.
2140 (lex_identifier_intern): New function.
2141 * init.c (cpp_create_reader): Initialize pushed_macros
2142 member.
2143 (cpp_destroy): Free elements in pushed_macros member.
2144 * pch.c (_cpp_save_pushed_macros): New function.
2145 (_cpp_restore_pushed_macros): Likewise.
2146 (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
2147 (cpp_read_state): Use _cpp_restore_pushed_macros.
2148
538ba11a 21492009-10-19 Jakub Jelinek <jakub@redhat.com>
2150
2151 * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
2152 (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
2153 and char32_cset_desc.
2154 (converter_for_type): Handle CPP_UTF8STRING.
2155 (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
2156 * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
2157 (parse_include): Reject raw strings.
2158 * include/cpplib.h (CPP_UTF8STRING): New token type.
2159 * internal.h (struct cpp_reader): Add utf8_cset_desc field.
2160 * lex.c (lex_raw_string): New function.
2161 (lex_string): Handle u8 string literals, call lex_raw_string
2162 for raw string literals.
2163 (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
2164 sequences.
2165 * macro.c (stringify_arg): Handle CPP_UTF8STRING.
2166
af4d2883 21672009-10-14 Jakub Jelinek <jakub@redhat.com>
2168
2169 PR preprocessor/41543
2170 * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
2171 * line-map.c (linemap_init): Initialize highest_location and
2172 highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
2173
8e83a065 21742009-10-09 Jason Merrill <jason@redhat.com>
2175
2176 * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
2177
8f2ff12e 21782009-10-09 Neil Vachharajani <nvachhar@google.com>
2179
2180 * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
2181 sccs.
2182
fc25a827 21832009-09-23 Loren J. Rittle <ljrittle@acm.org>
2184
2185 * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
2186 * configure: Rebuilt.
2187
fa12a6a5 21882009-09-22 Richard Guenther <rguenther@suse.de>
2189
2190 PR pch/38987
2191 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
2192
c25f2689 21932009-09-18 Chris Demetriou <cgd@google.com>
2194
2195 PR preprocessor/28435:
2196 * include/cpplib.h (struct cpp_options): Add new member
2197 deps.need_preprocessor_output.
2198 * files.c (open_file_failed): If preprocessor output is needed
2199 always report an error.
2200
a4f7c8f7 22012009-09-13 Kai Tietz <kai.tietz@onevision.com>
2202
2203 * configure.ac: Set for i?86-w64-mingw*
2204 need_64bit_hwint to yes.
2205 * configure: Regenerated.
2206
3f24af9b 22072009-09-10 Jason Merrill <jason@redhat.com>
2208
2209 * directives.c (cpp_define): constify.
2210
2a50bfcf 22112009-09-02 Ian Lance Taylor <iant@google.com>
2212
2213 * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
2214
81a71e2b 22152009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2216
2217 * configure.ac (AC_PREREQ): Bump to 2.64.
2218
cd9a469c 22192009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2220
2221 * aclocal.m4: Regenerate.
2222 * config.in: Regenerate.
2223 * configure: Regenerate.
2224
ed184982 22252009-08-17 Tom Tromey <tromey@redhat.com>
2226
2227 PR preprocessor/41067:
2228 * charset.c (convert_escape): Add missing ":" to error text.
2229
7ad75c55 22302009-07-27 Douglas B Rupp <rupp@gnat.com>
2231
2232 * include/cpplib.h (INO_T_CPP): New macro.
2233 (struct cpp_dir): Use it.
2234
80b97ef3 22352009-07-20 Jerry Quinn <jlquinn@optonline.net>
2236
2237 PR regression/40800
2238 * configure.ac: Use = instead of == for testing
2239 ENABLE_BUILD_WITH_CXX.
2240 * configure: Rebuild.
2241
723ebaea 22422009-07-17 Jerry Quinn <jlquinn@optonline.net>
2243
2244 * directives.c (do_linemarker, do_line): Use CPP_STRING for
2245 ignored enum value.
2246 * files.c (find_file_in_dir): Add cast from void* to char*.
2247 * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
2248 * Makefile.in: (WARN_CFLAGS): Use general and C-specific
2249 warnings.
2250 (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
2251 ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
2252 COMPILER_FLAGS): New.
2253 (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
2254 (COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS
2255 instead of ALL_CFLAGS.
2256 * configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings
2257 from other warnings. Add -Wc++-compat to C-specific warnings.
2258 Check for --enable-build-with-cxx. Set and substitute
2259 ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES
2260 according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before
2261 AC_CHECK_HEADERS.
2262 * configure: Rebuild.
2263 * include/cpp-id-data.h: Remove extern "C".
2264 * include/line-map.h: Likewise.
2265 * include/mkdeps.h: Likewise.
2266 * include/symtab.h: Likewise.
2267 * internal.h: Likewise.
2268
78ed8e3d 22692009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2270
2271 * directives.c (parse_include): Add location argument. Update all
2272 calls.
2273 (parse_answer): Likewise.
2274 (do_include_common): Error with exact location.
2275 (parse_assertion): Likewise.
2276
46821594 22772009-06-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
2278
2279 * expr.c (num_div_op): Take explicit location.
2280
52b290f1 22812009-06-17 Ian Lance Taylor <iant@google.com>
2282
2283 * include/cpplib.h (progname): Don't declare.
2284
2a6a6991 22852009-06-12 Ian Lance Taylor <iant@google.com>
2286
2287 * include/cpplib.h (struct cpp_options): Add
2288 warn_cxx_operator_names field.
2289 (NODE_WARN_OPERATOR): Define.
2290 (struct cpp_hashnode): Increase flags field to 10 bits, decrease
2291 type to 6 bits.
2292 * init.c (mark_named_operators): Add flags parameter.
2293 (cpp_post_options): Pick flags value to pass to
2294 mark_named_operators.
2295 * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
2296 identifier is an operator name in C++.
2297
b559b9e2 22982009-06-01 Aldy Hernandez <aldyh@redhat.com>
2299
2300 * include/line-map.h (LAST_SOURCE_COLUMN): New.
2301
e61157d7 23022009-06-01 Ian Lance Taylor <iant@google.com>
2303
2304 * include/cpp-id-data.h: Add extern "C".
2305 * include/line-map.h: Likewise.
2306 * include/mkdeps.h: Likewise.
2307 * include/symtab.h: Likewise.
2308 * internal.h: Likewise.
2309
26dbec0a 23102009-05-15 Ian Lance Taylor <iant@google.com>
2311
2312 * include/cpplib.h (enum cpp_builtin_type): Rename from enum
2313 builtin_type. Change all uses.
2314
5b500807 23152009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2316
2317 PR cpp/36674
2318 * directives (do_linemarker): Compensate for the increment in
2319 location that occurs when we reach the end of line.
2320 * files (_cpp_stack_include): Mention _cpp_find_file in the
2321 comment.
2322
2ee04baa 23232009-05-10 Joseph Myers <joseph@codesourcery.com>
2324
2325 * include/cpplib.h (enum cpp_token_fld_kind): Add
2326 CPP_TOKEN_FLD_TOKEN_NO.
2327 (struct cpp_macro_arg, struct cpp_identifier): Define.
2328 (union cpp_token_u): Use struct cpp_identifier for identifiers.
2329 Use struct cpp_macro_arg for macro arguments. Add token_no for
2330 CPP_PASTE token numbers.
2331 * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
2332 do_pragma_poison, parse_assertion): Use val.node.node in place of
2333 val.node.
2334 * expr.c (parse_defined, eval_token): Use val.node.node in place
2335 of val.node.
2336 * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
2337 cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
2338 cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
2339 place of val.arg_no. Use val.node.node in place of val.node.
2340 * macro.c (replace_args, cpp_get_token, parse_params,
2341 lex_expansion_token, create_iso_definition, cpp_macro_definition):
2342 Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
2343 Use val.node.node in place of val.node.
2344
49a657d9 23452009-05-03 Joseph Myers <joseph@codesourcery.com>
2346
2347 * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
2348 UTF-8 sequences.
2349
9c6183dd 23502009-04-25 Joseph Myers <joseph@codesourcery.com>
2351
2352 PR preprocessor/39559
2353 * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
2354 constants larger than intmax_t in C99 mode.
2355
fb1e4f4a 23562009-04-21 Taras Glek <tglek@mozilla.com>
2357
2358 * include/cpp-id-data.h: Update GTY annotations to new syntax.
2359 * include/cpplib.h: Likewise.
2360 * include/line-map.h: Likewise.
2361 * include/symtab.h: Likewise.
2362
ba99525e 23632009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2364
2365 PR c++/14875
2366 * lex.c (cpp_type2name): Take a flags parameter. Call
2367 cpp_named_operator2name for named operators and cpp_digraph2name
2368 for digraphs.
2369 (cpp_digraph2name): New.
2370 (cpp_spell_token): Use it.
2371 (cpp_output_token): Likewise.
2372 * include/cpplib.h (cpp_type2name): Update declaration.
2373 * init.c (cpp_named_operator2name): New.
2374 * internal.h (cpp_named_operator2name): Declare.
2375
9ab71c6b 23762009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2377
2378 PR c++/13358
2379 * init.c (cpp_create_reader): Wlong_long is disabled by default.
2380 * expr.c (cpp_classify_number): Give different messages for C and
2381 C++ front-ends.
2382
941f2388 23832009-04-19 Joseph Myers <joseph@codesourcery.com>
2384
2385 PR preprocessor/20078
2386 * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
2387 field.
2388 * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
2389 (struct cpp_token): Change flags to unsigned short.
2390 * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
2391 (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
2392 (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
2393 tokens.
2394 * macro.c (macro_real_token_count): New.
2395 (enter_macro_context, replace_args): Use macro_real_token_count.
2396 (create_iso_definition): Record whitespace surrounding and digraph
2397 spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
2398 Set extra_tokens and save CPP_PASTE tokens with arg_no set for
2399 multiple consecutive ## tokens.
2400 (_cpp_create_definition): Initialize extra_tokens.
2401 (cpp_macro_definition): Use macro_real_token_count.
2402
3e52c418 24032009-04-18 Joseph Myers <joseph@codesourcery.com>
2404
2405 * directives.c (parse_include): Pass true to check_eol.
2406
1eecdb28 24072009-04-18 Joseph Myers <joseph@codesourcery.com>
2408
2409 PR preprocessor/39646
2410 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
2411 * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
2412 * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
2413 place of LC_RENAME.
2414
6cda323a 24152009-04-18 Joseph Myers <joseph@codesourcery.com>
2416
2417 PR preprocessor/39647
2418 * directives.c (check_eol): Add parameter expand.
2419 (do_undef, parse_include, do_line, do_linemarker, do_ident,
2420 do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
2421 do_else, do_endif, do_assert, do_unassert): All callers changed.
2422 Pass true from do_line, false elsewhere.
2423
e21164ef 24242009-04-12 Joseph Myers <joseph@codesourcery.com>
2425
2426 PR preprocessor/31869
2427 * macro.c (stringify_arg): Handle NULL source token in padding
2428 token where previous padding token did not have source token with
2429 preceding whitespace.
2430
6bc9506f 24312009-04-09 Jakub Jelinek <jakub@redhat.com>
2432
2433 * Makefile.in: Change copyright header to refer to version
2434 3 of the GNU General Public License and to point readers at the
2435 COPYING3 file and the FSF's license web page.
2436 * charset.c: Likewise.
2437 * directives-only.c: Likewise.
2438 * directives.c: Likewise.
2439 * errors.c: Likewise.
2440 * expr.c: Likewise.
2441 * files.c: Likewise.
2442 * identifiers.c: Likewise.
2443 * include/cpp-id-data.h: Likewise.
2444 * include/cpplib.h: Likewise.
2445 * include/line-map.h: Likewise.
2446 * include/mkdeps.h: Likewise.
2447 * include/symtab.h: Likewise.
2448 * init.c: Likewise.
2449 * internal.h: Likewise.
2450 * lex.c: Likewise.
2451 * line-map.c: Likewise.
2452 * macro.c: Likewise.
2453 * makeucnid.c: Likewise.
2454 * mkdeps.c: Likewise.
2455 * pch.c: Likewise.
2456 * symtab.c: Likewise.
2457 * system.h: Likewise.
2458 * traditional.c: Likewise.
2459 * ucnid.tab: Likewise.
2460 * ucnid.h: Regenerate.
2461
5840fdcf 24622009-04-01 Janis Johnson <janis187@us.ibm.com>
2463
f8ed6d41 2464 PR c/39027
2465 * include/cpplib.h (CPP_N_DEFAULT): Define.
2466 * expr.c (interpret_float_suffix): Recognize d or D for double,
2467 return new value for default.
2468 (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
2469
5840fdcf 2470 PR c/33466
2471 * expr.c (interpret_float_suffix): Reject invalid suffix that uses
2472 letters from decimal float and fixed-point suffixes.
2473
ff903809 24742009-03-31 Joseph Myers <joseph@codesourcery.com>
2475
2476 PR preprocessor/15638
2477 * files.c (_cpp_find_file): Call open_file_failed after diagnosing
2478 invalid PCH.
2479 (open_file_failed): Make error for missing file fatal.
2480 * include/cpplib.h (CPP_DL_FATAL): Define.
2481
bfba65a4 24822009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net>
2483
2484 PR preprocessor/31932:
2485 * internal.h: Don't mention HAVE_ICONV_H.
2486 * configure, config.in: Rebuild.
2487 * configure.ac: Don't check for iconv.h.
2488
102a7306 24892009-03-30 Tom Tromey <tromey@redhat.com>
2490
2491 PR preprocessor/39512:
2492 * line-map.c (linemap_init): Initialize 'reallocator' field.
2493
4514949a 24942009-03-30 Jakub Jelinek <jakub@redhat.com>
2495
2496 PR target/39558
2497 * macro.c (cpp_get_token): If macro_to_expand returns NULL
2498 and used some tokens, add CPP_PADDING before next token.
2499
7f5f3953 25002009-03-29 Joseph Myers <joseph@codesourcery.com>
2501
2502 PR preprocessor/34695
2503 * makedepend.c: Remove.
2504 * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
2505 (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
2506 * directives.c (cpp_errors): Remove.
2507 * errors.c (print_location, _cpp_begin_message, v_message):
2508 Remove.
2509 (cpp_error, cpp_error_with_line): Always use error callback.
2510 (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
2511 * include/cpplib.h (cpp_options): Remove pedantic_errors,
2512 inhibit_warnings, warn_system_headers, inhibit_errors,
2513 warnings_are_errors, client_diagnostic.
2514 (cpp_callbacks): Add extra arguments to error callback; make it
2515 return bool.
2516 (cpp_finish): Return void.
2517 (cpp_destroy): Remove inaccurate comment about return value.
2518 (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
2519 (CPP_DL_NOTE): Define.
2520 * include/line-map.h (linemap_print_containing_files): Remove.
2521 * init.c (cpp_finish): Do not check for or return number of
2522 errors.
2523 * internal.h (cpp_reader): Remove errors field.
2524 * line-map.c (linemap_print_containing_files): Remove.
2525 * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
2526 about previous definition. Only emit it if previous diagnostic
2527 was emitted.
2528
d5a78dd0 25292009-03-28 Joseph Myers <joseph@codesourcery.com>
2530
2531 * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
2532 mkinstalldirs.
2533
0ac758f7 25342009-03-18 Jakub Jelinek <jakub@redhat.com>
2535
2536 * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
2537
7811eab5 25382009-02-21 Joseph Myers <joseph@codesourcery.com>
2539
2540 * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
2541 header name.
2542 (_cpp_lex_direct): Handle this.
2543
b5c49426 25442009-02-15 Richard Guenther <rguenther@suse.de>
2545
2546 Revert last change.
2547
76549266 25482009-02-13 Richard Guenther <rguenther@suse.de>
2549
2550 * configure.ac: Enable LFS.
2551 * configure: Re-generate.
2552 * config.in: Likewise.
2553
e7ae053d 25542009-01-05 Ben Elliston <bje@au.ibm.com>
2555
2556 * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
2557 (.po.pox): Likewise.
2558 (po/$(PACKAGE).pot): Likewise.
2559
c1203b1c 25602008-12-10 Alexandre Oliva <aoliva@redhat.com>
2561
2562 PR target/37033
2563 * pch.c (cpp_valid_state): Improve message for poisoned symbols.
2564 Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
2565
cd740bd5 25662008-11-29 Joseph Myers <joseph@codesourcery.com>
2567
2568 * lex.c (cpp_token_len): Use 6 as default length.
2569
ae5c166d 25702008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org>
2571
2572 * expr.c (struct op): Add location.
2573 (_cpp_parse_expr): Propagate locations throught the stack
2574 of expressions.
2575 (reduce): Likewise.
2576 (check_promotion): Use explicit location in errors.
2577
956c6108 25782008-10-05 Matthew Gingell <gingell@adacore.com>
2579 Arnaud Charlet <charlet@adacore.com>
2580
2581 * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
2582 (cpp_get_comments): New function.
2583 * internal.h (struct cpp_reader): Add comments field.
2584 * init.c (cpp_destroy): Free comments.
2585 * lex.c (store_comment, cpp_get_comments): New functions.
2586 (comments): New struct.
2587 (save_comment): Store comments in comments struct.
2588
2ad0b097 25892008-09-18 Simon Baldwin <simonb@google.com>
2590
2591 * include/cpplib.h (struct cpp_options): Add new boolean flag
2592 warn_builtin_macro_redefined.
2593 * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
2594 * (struct builtin_operator): Split out from previous struct builtin,
2595 enhance extra const correctness.
2596 * (struct builtin_macro): Split out from previous struct builtin, add
2597 new always_warn_if_redefined flag, enhance const correctness.
2598 * (mark_named_operators): Use struct builtin_operator.
2599 * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
2600 to builtins selectively.
2601 * macro.c (warn_of_redefinition): Return false if a builtin macro
2602 is not flagged with NODE_WARN.
2603
408c2285 26042008-07-31 Jakub Jelinek <jakub@redhat.com>
2605
2606 PR preprocessor/36649
2607 * files.c (struct report_missing_guard_data): New type.
2608 (report_missing_guard): Put paths into an array instead of printing
2609 them right away. Return 1 rather than 0.
2610 (report_missing_guard_cmp): New function.
2611 (_cpp_report_missing_guards): Sort and print paths gathered by
2612 report_missing_guard callback.
2613
98e29890 26142008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2615
2616 PR 28079
2617 * directives.c (strtolinenum): Handle overflow.
2618 (do_line): Give a warning if line number overflowed.
2619 (do_linemarker): Update call to strtolinenum.
2620
4999c35b 26212008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2622
2623 * include/line-map.h (linenum_type): New typedef.
2624 (struct line_map): Use it.
2625 (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
2626 (SOURCE_COLUMN): Likewise.
2627 * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
2628 source_location values in a variable of type linenum_type.
2629 * directives.c (struct if_stack): Use linenum_type.
2630 (strtoul_for_line): Rename as strtolinenum.
2631 (do_line): Use linenum_type.
2632 (do_linemarker): Use linenum_type and strtolinenum.
2633 (_cpp_do_file_change): Use linenum_t.
2634 * line-map.c (linemap_add): Likewise.
2635 (linemap_line_start): Likewise.
2636 * traditional.c (struct fun_macro): 'line' is a source_location.
2637 * errors.c (print_location): Use linenum_type.
2638 * directives-only.c (_cpp_preprocess_dir_only): Likewise.
2639 * internal.h (CPP_INCREMENT_LINE): Likewise.
2640 * lex.c (_cpp_skip_block_comment): Use source_location.
cc0a8c77 2641
89768577 26422008-07-14 Ben Elliston <bje@au.ibm.com>
2643
2644 * include/cpplib.h (NODE_CONDITIONAL): New.
2645 (struct cpp_callbacks): New macro_to_expand field.
2646 (struct cpp_hashnode): Adjust size of flags and type fields.
2647 (cpp_peek_token): Prototype.
2648 * lex.c (cpp_peek_token): New function.
2649 (_cpp_temp_token): Protect pre-existing lookaheads.
2650 * macro.c (cpp_get_token): Expand any conditional macros.
2651 (_cpp_backup_tokens_direct): New.
2652 (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
2653 (warn_of_redefinition): Silently allow redefined conditional
2654 macros.
2655 (_cpp_create_definition): Remove the conditional flag when a user
2656 defines one of the conditional macros.
2657 * internal.h (_cpp_backup_tokens_direct): New prototype.
2658
403c2b12 26592008-06-13 Andrew Haley <aph@redhat.com>
2660
2661 PR preprocessor/33305
2662 * macro.c (replace_args): Print a warning for empty macro
2663 arguments in C89 and C++.
2664
5b2c7553 26652008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2666
2667 * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
2668 * configure: Regenerate.
2669
b9de6413 26702008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2671
2672 * Makefile.in (datarootdir): New variable.
2673
bfa57d81 26742008-06-12 H.J. Lu <hongjiu.lu@intel.com>
2675
2676 PR preprocessor/36479
2677 * charset.c (cpp_interpret_string_notranslate): Also set
2678 narrow_cset_desc.width.
2679
6af9f7ea 26802008-06-07 Joseph Myers <joseph@codesourcery.com>
2681
2682 * configure.ac (parisc*64*-*-*): Remove.
2683 * configure: Regenerate.
2684
536a48ee 26852008-05-30 Tom Tromey <tromey@redhat.com>
2686
2687 PR preprocessor/36320:
2688 * internal.h (_cpp_parse_expr): Update.
2689 * expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error
2690 messages.
2691 * directives.c (do_if): Update.
2692 (do_elif): Require expression if processing group.
2693
f4d02485 26942008-05-30 Danny Smith <dannysmith@users.sourceforge.net>
2695
2696 * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
2697
c0770282 26982008-05-21 Tom Tromey <tromey@redhat.com>
2699
2700 PR preprocessor/27777:
2701 * lex.c (cpp_output_line_to_string): New function.
2702 * internal.h (_cpp_begin_message): Don't declare.
2703 * errors.c (_cpp_begin_message): Now static.
2704 * include/cpplib.h (cpp_output_line_to_string): Declare.
2705 * directives.c (do_diagnostic): Rewrote. Use
2706 cpp_output_line_to_string. Don't use _cpp_begin_message.
2707
dfecde36 27082008-05-21 Tom Tromey <tromey@redhat.com>
2709
2710 * include/symtab.h (HT_ALLOCED): Remove.
2711 (ht_purge): Declare.
2712 * symtab.c (DELETED): New define.
2713 (ht_lookup): Update comment.
2714 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED
2715 code. Use subobject allocator for strings, if it exists.
2716 (ht_expand): Handle deleted entries.
2717 (ht_forall): Likewise.
2718 (ht_purge): New function.
2719 (ht_dump_statistics): Print deletion statistics.
2720
fb9753dc 27212008-05-13 Tom Tromey <tromey@redhat.com>
2722
2723 PR preprocessor/22168:
2724 * include/cpplib.h (struct cpp_options) <objc>: Update
2725 documentation.
2726 * expr.c (eval_token): Warn for use of assertions.
2727 * directives.c (directive_diagnostics): Warn about extensions.
2728 (DEPRECATED): New define.
2729 (DIRECTIVE_TABLE): Use it.
2730
151e90cc 27312008-05-06 Tom Tromey <tromey@redhat.com>
2732
2733 PR preprocessor/35313, PR preprocessor/36088:
2734 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
2735 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
2736
2cd62354 27372008-05-04 David S. Miller <davem@davemloft.net>
2738
2739 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
2740 * configure: Regenerate.
2741
85e51d59 27422008-04-22 Daniel Franke <franke.daniel@gmail.com>
2743
2744 * include/cpplib.h (cpp_define_formatted): New.
2745 * directives.c (cpp_define_formatted): New.
2746
d656d07a 27472008-04-21 Tom Tromey <tromey@redhat.com>
2748
2749 PR libcpp/33415:
2750 * charset.c (_cpp_convert_input): Add buffer_start argument.
2751 Ignore UTF-8 BOM if seen.
2752 * internal.h (_cpp_convert_input): Add argument.
2753 * files.c (struct _cpp_file) <buffer_start>: New field.
2754 (destroy_cpp_file): Free buffer_start, not buffer.
2755 (_cpp_pop_file_buffer): Likewise.
2756 (read_file_guts): Update.
2757
924bbf02 27582008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
2759
2760 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
2761 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
2762 (struct cpp_options): Added uliterals.
2763 (cpp_interpret_string): Update prototype.
2764 (cpp_interpret_string_notranslate): Idem.
2765 * charset.c (init_iconv_desc): New width member in cset_converter.
2766 (cpp_init_iconv): Add support for char{16,32}_cset_desc.
2767 (convert_ucn): Idem.
2768 (emit_numeric_escape): Idem.
2769 (convert_hex): Idem.
2770 (convert_oct): Idem.
2771 (convert_escape): Idem.
2772 (converter_for_type): New function.
2773 (cpp_interpret_string): Use converter_for_type, support u and U prefix.
2774 (cpp_interpret_string_notranslate): Match changed prototype.
2775 (wide_str_to_charconst): Use converter_for_type.
2776 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
2777 * directives.c (linemarker_dir): Macro U changed to UC.
2778 (parse_include): Idem.
2779 (register_pragma_1): Idem.
2780 (restore_registered_pragmas): Idem.
2781 (get__Pragma_string): Support CPP_STRING{16,32}.
2782 * expr.c (eval_token): Support CPP_CHAR{16,32}.
2783 * init.c (struct lang_flags): Added uliterals.
2784 (lang_defaults): Idem.
2785 * internal.h (struct cset_converter) <width>: New field.
2786 (struct cpp_reader) <char16_cset_desc>: Idem.
2787 (struct cpp_reader) <char32_cset_desc>: Idem.
2788 * lex.c (digraph_spellings): Macro U changed to UC.
2789 (OP, TK): Idem.
2790 (lex_string): Add support for u'...', U'...', u"..." and U"...".
2791 (_cpp_lex_direct): Idem.
2792 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
2793 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
2794
6a88da51 27952008-04-18 Paolo Bonzini <bonzini@gnu.org>
2796
2797 PR bootstrap/35457
2798 * aclocal.m4: Regenerate.
2799 * configure: Regenerate.
2800
6e6d82ef 28012008-04-17 Tom Tromey <tromey@redhat.com>
2802
2803 PR libcpp/34866:
2804 * errors.c (cpp_error): Don't reference a token before the start
2805 of the current run.
2806
f521616b 28072008-04-16 Tom Tromey <tromey@redhat.com>
2808
2809 * Makefile.in (TAGS_SOURCES): New variable.
2810 (TAGS): New target.
2811
fc7383ad 28122008-04-11 Kaz Kojima <kkojima@gcc.gnu.org>
2813
2814 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
2815 and shbe-*-*.
2816 * configure: Rebuilt.
2817
34c3de48 28182008-04-02 Joseph Myers <joseph@codesourcery.com>
2819
2820 * include/cpplib.h (struct cpp_callbacks): Add used_define,
2821 used_undef and before_define.
2822 (NODE_USED): Define.
2823 * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
2824 do_ifndef, cpp_pop_definition): Handle new flag and use new
2825 callbacks.
2826 * expr.c (parse_defined): Handle new flag and use new callbacks.
2827 * macro.c (enter_macro_context, _cpp_free_definition): Handle new
2828 flag and use new callbacks.
2829
f2225b1a 28302008-04-01 Jakub Jelinek <jakub@redhat.com>
2831
2832 PR pch/13675
2833 * files.c (struct _cpp_file): Remove pch field.
2834 (pch_open_file): Don't set file->pch, just file->pchname.
2835 (should_stack_file): After pfile->cb.read_pch call
2836 free pchname and clear pchname, don't close file->fd.
2837 Test file->pchname instead of file->pch. Don't close fd after cb.
2838 (_cpp_stack_include): Test file->pchname instead of file->pch.
2839
5a959782 28402008-03-28 Tom Tromey <tromey@redhat.com>
2841
2842 * Makefile.in (POSTCOMPILE): New variable.
2843 (.c.o): Use it.
2844
8302ff7f 28452008-03-13 Tom Tromey <tromey@redhat.com>
2846
2847 PR libcpp/35322:
2848 * directives.c (destringize_and_run): Set pfile->directive.
2849
8bd452d9 28502008-03-06 Markus Milleder <markus.milleder@generali.at>
2851
2852 PR preprocessor/35458
2853 * mkdeps.c (munge): Quote '#' with a '\'.
2854
0c62b06e 28552008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2856
2857 PR preprocessor/35379
2858 * mkdeps.c (deps_write): Ensure the first target always appears
2859 in the first column, without leading backslash newline. Avoid
2860 some more extra whitespace.
2861
6b0c1373 28622008-02-25 Thiemo Seufer <ths@mips.com>
2863
0c62b06e 2864 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
6b0c1373 2865
e297899b 28662008-02-19 Tom Tromey <tromey@redhat.com>
2867
2868 * traditional.c (lex_identifier): Use CPP_HASHNODE.
2869 * lex.c (lex_identifier): Use CPP_HASHNODE.
2870 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
2871 do-while.
2872 * identifiers.c (alloc_node): Change return type.
2873 (_cpp_init_hashtable): Don't cast 'alloc_node'.
2874 (proxy_assertion_broken): New declaration.
2875 (cpp_forall_identifiers): Move comment.
2876 * line-map.c (linemap_add): Comment fix.
2877 (linemap_line_start): Indentation fix.
2878
45f9f140 28792008-01-25 Jakub Jelinek <jakub@redhat.com>
2880
2881 PR preprocessor/34692
2882 * macro.c (collect_args): Add pragma_buff argument. Push
2883 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
2884 than into arguments. Reset prevent_expansion and parsing_args
2885 state at CPP_PRAGMA_EOL/CPP_EOF.
2886 (funlike_invocation_p): Add pragma_buff argument, pass it through
2887 to collect_args.
2888 (enter_macro_context): Add result argument. Adjust
2889 funlike_invocation_p caller. Emit all deferred pragma tokens
2890 gathered during collect_args before the expansion, add a padding
2891 token. Return 2 instead of 1 if any pragma tokens were prepended.
2892 (cpp_get_token): If enter_macro_context returns 2, don't return
2893 a padding token, instead cycle to grab CPP_PRAGMA token.
2894 * directives.c (_cpp_handle_directive): If was_parsing_args
2895 in deferred pragma, leave parsing_args and prevent_expansion as is.
2896
a56d0856 28972008-01-22 Tom Tromey <tromey@redhat.com>
2898
45f9f140 2899 PR c++/34859
a56d0856 2900 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
2901 __STDC_CONSTANT_MACROS.
2902
7a1a608c 29032008-01-07 Fred Fish <fnf@specifix.com>
2904
45f9f140 2905 PR preprocessor/30363
7a1a608c 2906 * traditional.c (replace_args_and_push): Add local variable
cc0a8c77 2907 cxtquote, calculate the replacement text size assuming a
7a1a608c 2908 worst case of every input character quoted with backslash,
2909 and properly handle output quoting of quote characters in
2910 actual arguments used in function-like macros.
2911
cde59b72 29122008-01-03 Tom Tromey <tromey@redhat.com>
2913
45f9f140 2914 PR preprocessor/34602
cde59b72 2915 * directives.c (do_line): Don't try to spell EOF token.
2916 (do_linemarker): Add comment.
2917
2d1f9589 29182007-12-11 DJ Delorie <dj@redhat.com>
2919
2920 * charset.c (convert_using_iconv): Close out any shift states,
2921 returning to the initial state.
2922
64cb8c90 29232007-12-06 Tom Tromey <tromey@redhat.com>
2924
45f9f140 2925 PR c/29172
64cb8c90 2926 * internal.h (struct cpp_reader) <file_hash_entries>: Changed
2927 type.
2928 <file_hash_entries_allocated, file_hash_entries_used>: Removed.
2929 * files.c (FILE_HASH_POOL_SIZE): New macro.
2930 (struct file_hash_entry_pool): New.
2931 (destroy_all_cpp_files): New function.
2932 (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
2933 (new_file_hash_entry): Update.
2934 (free_file_hash_entries): New function.
2935 (_cpp_cleanup_files): Call free_file_hash_entries and
2936 destroy_all_cpp_files.
2937 (cpp_clear_file_cache): New function.
2938 * include/cpplib.h (cpp_clear_file_cache): Declare.
2939
d08a0ab3 29402007-12-03 Tom Tromey <tromey@redhat.com>
2941
45f9f140 2942 PR preprocessor/34288
d08a0ab3 2943 * configure.ac, config.in: Rebuilt.
2944 * configure.ac: Check for ssize_t.
2945
5eb3761c 29462007-11-30 Tom Tromey <tromey@redhat.com>
2947
45f9f140 2948 PR preprocessor/32868
5eb3761c 2949 * macro.c (_cpp_create_definition): Special case
2950 __STDC_FORMAT_MACROS.
2951
bce619a6 29522007-11-16 Michael Matz <matz@suse.de>
2953
2954 * files.c (search_path_head): Fix check for absolute paths.
2955
67015c73 29562007-11-11 Tom Tromey <tromey@redhat.com>
2957
45f9f140 2958 PR c++/17557
67015c73 2959 * include/cpplib.h (cpp_included_before): Declare.
2960 * files.c (struct file_hash_entry) <location>: New field.
2961 (_cpp_find_file): Initialize new field.
2962 (make_cpp_dir): Likewise.
2963 (cpp_included_before): New function.
2964
1991d8eb 29652007-11-01 Tom Tromey <tromey@redhat.com>
2966
45f9f140 2967 PR preprocessor/30805
1991d8eb 2968 * macro.c (paste_tokens): Handle padding token.
2969 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
2970
2d507e67 29712007-10-31 Tom Tromey <tromey@redhat.com>
2972
45f9f140 2973 PR preprocessor/30786
2d507e67 2974 * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
2975 * directives.c (_cpp_do__Pragma): Return error status.
2976 * internal.h (_cpp_do__Pragma): Update.
2977 * directives.c (get__Pragma_string): Back up if EOF seen.
2978
931b0a0f 29792007-09-06 Tom Tromey <tromey@redhat.com>
2980
2981 * internal.h (struct cpp_reader) <invocation_location>: New
2982 field.
2983 (struct cpp_reader) <set_invocation_location>: Likewise.
2984 * init.c (cpp_set_line_map): New function.
2985 * line-map.c (linemap_add): Use linemap's allocator.
2986 * include/line-map.h (GTY): Define.
2987 (line_map_realloc): New typedef.
2988 (struct line_map): Mark with GTY.
2989 (struct line_maps): Likewise.
2990 (struct line_maps) <maps>: Likewise.
2991 (struct line_maps) <reallocator>: New field.
2992 * include/symtab.h (GTY): Conditionally define.
2993 * include/cpplib.h (cpp_set_line_map): Declare.
2994 (cpp_get_token_with_location): Declare.
2995 * macro.c (cpp_get_token): Set invocation_location on the reader.
2996 (cpp_get_token_with_location): New function.
2997
84373723 29982007-08-30 Chao-ying Fu <fu@mips.com>
2999
3000 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
3001 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
3002 (cpp_classify_number): Support decimal fixed-point constants without
3003 exponents.
3004 Warn about fixed-point constants when -pedantic.
3005 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
3006 comments to support fixed-point values.
3007 (CPP_N_FRACT, CPP_N_ACCUM): Define.
3008
36ec4203 30092007-08-18 Tom Tromey <tromey@redhat.com>
3010
45f9f140 3011 PR preprocessor/32974
36ec4203 3012 * directives.c (parse_include): Don't check for EOL when
3013 processing #pragma dependency.
3014
fcde64dc 30152007-07-30 Ollie Wild <aaw@google.com>
3016
3017 * directives-only.c: New file.
3018 * internal.h (struct _cpp_dir_only_callbacks): New.
3019 (_cpp_preprocess_dir_only): New function.
3020 * directives.c (_cpp_handle_directive): Check directives_only before
3021 disabling execution of indented directives.
3022 * files.c (_cpp_stack_file): Add directives_only check.
3023 * include/cpplib.h (struct cpp_options): Add directives_only.
3024 (cpp_init_special_builtins): New function.
3025 * init.c (cpp_init_special_builtins): New function.
3026 (cpp_init_builtins): Move builtin_array initialization to
3027 cpp_init_special_builtins.
3028 (post_options): Check directives_only before setting
3029 pfile->state.prevent_expansion = 1.
3030 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
3031 is expanded inside a directive while -fdirectives-only is enabled.
3032 * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
3033 (libcpp_a_SOURCES): Add directives-only.c.
3034
ddedd1e1 30352007-07-04 Uros Bizjak <ubizjak@gmail.com>
3036
3037 * traditional.c (_cpp_scan_out_logical_line): Initialize
3038 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
3039 fmacro.args to prevent 'may be used uninitialized' warning.
3040
430be8e2 30412007-07-03 Uros Bizjak <ubizjak@gmail.com>
3042
3043 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
3044 Add new constants.
3045 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
3046 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
3047 for 'q' or 'Q' suffixes.
3048
909dc303 30492007-06-17 Danny Smith <dannysmith@users.sourceforge.net
3050
857d7d5e 3051 * files.c (open_file): Correct typo.
909dc303 3052
7d6f49d6 30532007-06-16 Vladimir Prus <vladimir@codesourcery.com>
3054
857d7d5e 3055 * files.c (open_file): Prevent the call
7d6f49d6 3056 for stat from overwriting errno.
3057
be21d64c 30582007-06-09 Vladimir Prus <vladimir@codesourcery.com>
3059
857d7d5e 3060 * files.c (open_file): Account for the
cc0a8c77 3061 fact that on windows, opening a directory gives
3062 EACCES.
be21d64c 3063
d7282a2b 30642007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
3065
3066 PR preprocessor/23479
3067 * expr.c (cpp_classify_number): Implement 0b-prefixed binary
3068 integer constants.
3069 (append_digit): Likewise.
3070 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
3071 binary integer constants.
3072
0448520c 30732007-05-31 Dave Korn <dave.korn@artimi.com>
3074
3075 PR preprocessor/14331
3076 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
3077
ce079f70 30782007-05-24 Ollie Wild <aaw@google.com>
3079
3080 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
3081 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
3082 (cpp_write_pch_state): Save __COUNTER__ state.
3083 (cpp_valid_state): Check valid __COUNTER__ state.
3084 (cpp_read_state): Read new __COUNTER__ state.
3085 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
3086 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
3087 * internal.h (struct cpp_reader): Add counter member.
3088
3b6c638e 30892007-05-23 Simon Martin <simartin@users.sourceforge.net>
3090
3091 PR preprocessor/20077
3092 * macro.c (create_iso_definition): Fixed the method to determine
3093 whether the token-pasting operator appears at the beginning or the end
3094 of a macro.
3095
248dfc42 30962007-05-21 Ian Lance Taylor <iant@google.com>
3097
3098 * internal.h (struct cpp_reader): Add new fields:
3099 nonexistent_file_hash and nonexistent_file_ob.
3100 * files.c: Include "obstack.h".
3101 (find_file_in_dir): Before trying to open the file, look up the
3102 path name in the hash table of nonexistent files. After failing
3103 to open the file, add the path name to the hash table.
3104 (_cpp_find_file): Cache the results of looking up the file name
3105 starting with the quote and bracket chain heads, if we can.
3106 (nonexistent_file_hash_eq): New static function.
3107 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
3108 pfile->nonexistent_file_ob.
3109 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
3110 pfile->nonexistent_file_ob.
3111
c55e2f1b 31122007-05-14 Janis Johnson <janis187@us.ibm.com>
3113
cc0a8c77 3114 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
5c00409a 3115
c55e2f1b 3116 PR c/31924
3117 * expr.c (interpret_float_suffix): Check for invalid suffix.
3118
dd97b5e4 31192007-05-02 Eric Christopher <echristo@apple.com>
3120
3121 * expr.c (num_div_op): Don't overflow if the result is
3122 zero.
3123
3127c357 31242007-05-02 Tom Tromey <tromey@redhat.com>
3125
45f9f140 3126 PR preprocessor/28709
3127c357 3127 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
3128
f23c2abe 31292007-03-30 Michael Meissner <michael.meissner@amd.com>
3130
3131 * directives.c (lex_macro_node_from_str): Fix alloca call to be
3132 type correct.
3133
3fa3949d 31342007-03-30 Richard Henderson <rth@redhat.com>
3135
3136 * directives.c (lex_macro_node_from_str): New.
3137 (cpp_push_definition, cpp_pop_definition): New.
3138 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
3139
7262ccd6 31402007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
3141
3142 * Makefile.in: Add dummy install-pdf target.
3143
09edb0e9 31442007-01-30 Tom Tromey <tromey@redhat.com>
3145
45f9f140 3146 PR preprocessor/30468
09edb0e9 3147 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
3148 './'.
3149
e0ff7935 31502007-01-30 Tom Tromey <tromey@redhat.com>
3151
45f9f140 3152 PR preprocessor/29966
e0ff7935 3153 * macro.c (lex_expansion_token): Save and restore cpp_reader's
3154 cur_token.
3155 (_cpp_create_definition): Don't restore cur_token here.
3156 * lex.c (_cpp_lex_token): Added assertion.
3157
87d210c3 31582007-01-27 Tom Tromey <tromey@redhat.com>
3159
3160 * configure: Rebuilt.
3161
3e2a04b5 31622007-01-12 Tom Tromey <tromey@redhat.com>
3163
45f9f140 3164 PR preprocessor/28227
3e2a04b5 3165 * directives.c (lex_macro_node): Added 'is_def_or_undef'
3166 argument.
3167 (do_define): Update.
3168 (do_undef): Update.
3169 (do_ifdef): Update.
3170 (do_ifndef): Update.
3171
6a6e7e2f 31722007-01-11 Paolo Bonzini <bonzini@gnu.org>
3173
3174 * configure: Regenerate.
3175
77258a2e 31762007-01-11 Paolo Bonzini <bonzini@gnu.org>
3177
3178 * configure: Regenerate.
3179
927b511f 31802007-01-04 Tom Tromey <tromey@redhat.com>
3181
45f9f140 3182 PR preprocessor/28165
927b511f 3183 * internal.h (cpp_in_primary_file): New function.
3184 * directives.c (do_include_next): Use cpp_in_primary_file.
3185 (do_pragma_once): Likewise.
3186 (do_pragma_system_header): Likewise.
3187
5008f5c5 31882006-12-29 Ian Lance Taylor <iant@google.com>
3189
3190 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
3191 look backward at the end of the line unless we saw a backslash.
3192
5d70627e 31932006-12-29 Jakub Jelinek <jakub@redhat.com>
3194
3195 PR preprocessor/29612
3196 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
3197 only when new_sysp is non-zero.
3198
854f075e 31992006-12-28 Tom Tromey <tromey@redhat.com>
3200
45f9f140 3201 PR preprocessor/30001
854f075e 3202 * charset.c (_cpp_convert_input): Check that to.len is greater
3203 than zero.
3204
644459d0 32052006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
3206
3207 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
db375b8e 3208 * configure: Rebuilt.
644459d0 3209
093aec7c 32102006-11-01 Douglas Gregor <doug.gregor@gmail.com>
3211
3212 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
3213 for experimental C++0x mode.
3214 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
3215 adopted the preprocessor changes introduced in C99.
3216
54bb64fb 32172006-10-29 Joseph Myers <joseph@codesourcery.com>
3218
3219 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
3220 depending on --enable-targets=all.
3221 * configure: Regenerate.
3222
46139d3f 32232006-10-12 Jakub Jelinek <jakub@redhat.com>
3224
3225 PR preprocessor/28709
3226 * macro.c (paste_tokens): Do error reporting here, use BUF with the
3227 spelled LHS token as opposed to spelling it again.
3228 (paste_all_tokens): Don't report errors here, just break on failure.
3229
51f93521 32302006-10-10 Brooks Moses <bmoses@stanford.edu>
3231
3232 * Makefile.in: Added empty "pdf" target.
3233
32bca58b 32342006-09-22 Geoffrey Keating <geoffk@apple.com>
3235
3236 * configure.ac: Make need_64_bit_hwint case for x86-darwin
3237 match exactly the glob in gcc/config.gcc.
3238 * configure: Regenerate.
3239
0b67f687 32402006-09-13 Joseph S. Myers <joseph@codesourcery.com>
3241
3242 PR c/28768
3243 PR preprocessor/14634
3244 * lex.c (lex_string): Pedwarn for unterminated literals.
3245
3ebc7dec 32462006-09-08 Eric Christopher <echristo@apple.com>
3247
3248 * configure.ac: Add 64-bit HWI support for i?86-darwin.
3249
e58c07f7 32502006-08-14 Steve Ellcey <sje@cup.hp.com>
3251
3252 PR c++/28288
3253 PR c++/14556
3254 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
3255 (CPP_LAST_EQ): Change.
3256 (CPP_LAST_PUNCTUATOR): Change.
3257 * expr.c (cpp_operator): Remove MIN and MAX.
3258 (reduce): Remove CPP_MIN and CPP_MAX.
3259 (num_binary_op): Ditto.
3260 * lex.c (_cpp_lex_direct): Ditto.
3261 (cpp_avoid_paste): Remove ? as legal symbol after > or <.
3262
add258d7 32632006-06-09 Jakub Jelinek <jakub@redhat.com>
3264
3265 PR preprocessor/27746
3266 * directives.c (do_pragma): Handle pragma with valid namespace
3267 and invalid name coming from macro expansion.
3268 * directives.c (destringize_and_run): Initialize next field in
3269 context.
3270
3271 PR c/27747
3272 PR c++/27748
3273 * directives.c (destringize_and_run): Set NO_EXPAND on the
3274 tokens.
3275
3276 * macro.c (_cpp_backup_tokens): Fix comment typo.
3277
49688a56 32782006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
3279
3280 * Makefile.in (CATALOGS): Add po/ prefix.
3281 * configure: Regenerated.
3282
8f597c12 32832006-05-23 Carlos O'Donell <carlos@codesourcery.com>
3284
3285 * Makefile.in: Add install-html target. Add install-html to .PHONY
3286
cca5dddc 32872006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
3288
3289 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
3290 * files.c (_cpp_get_file_stat): New function.
3291 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
3292 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
3293 * internal.h (_cpp_get_file_stat): Prototype.
3294 (struct cpp_buffer): Add timestamp.
3295
31614f7c 32962006-01-23 Jakub Jelinek <jakub@redhat.com>
3297
3298 PR preprocessor/25717
3299 * init.c (cpp_init_builtins): If __STDC__ will not change value
3300 between system headers and other sources, define it as a normal
3301 macro rather than a builtin.
3302 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
3303 cpp_in_system_header condition.
3304
33052006-01-05 Paolo Bonzini <bonzini@gnu.org>
3c77e017 3306
3307 * Makefile.in: Use -MMD instead of -MD.
3308
b75b98aa 33092006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
3310 Richard Henderson <rth@redhat.com>
3311
3312 Merge from gomp branch:
3313 * directives.c (struct pragma_entry): Add is_deferred. Add ident
3314 entry to value union.
3315 (end_directive): Don't eat the line if in_deferred_pragma.
3316 (run_directive): Remove pragma hacks.
3317 (insert_pragma_entry): Remove.
3318 (new_pragma_entry): New.
3319 (register_pragma_1): Split out of register_pragma. Only handle
3320 the lookup tree and return the new entry.
3321 (cpp_register_pragma): Fill in the pragma entry here.
3322 (cpp_register_deferred_pragma): New.
3323 (register_pragma_internal): New.
3324 (_cpp_init_internal_pragmas): Use register_pragma_internal.
3325 (do_pragma): Allow pragma expansion after namespace. For deferred
3326 pragmas, don't slurp the line into a string.
3327 (destringize_and_run): Save tokens for deferred pragmas.
3328 (cpp_handle_deferred_pragma): Remove.
3329 * macro.c (builtin_macro): Remove pragma token hack.
3330 (_cpp_push_token_context): Rename from push_token_context and export.
3331 * internal.h (struct lexer_state): Add pragma_allow_expansion.
3332 (_cpp_push_token_context): Declare.
3333 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
3334 a token. Update the line number correctly if so.
3335 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
3336 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
3337 * include/cpplib.h (PRAGMA_EOL): New.
3338 (CPP_TOKEN_FLD_PRAGMA): New.
3339 (struct cpp_token): Add val.pragma.
3340 (struct cpp_options): Remove defer_pragmas.
3341 (cpp_handle_deferred_pragma): Remove.
3342 (cpp_register_deferred_pragma): Declare.
3343
986ca356 33442006-01-01 Jakub Jelinek <jakub@redhat.com>
3345
3346 PR c++/25294
3347 * directives.c (do_pragma): If pragma line ends with multi-line
3348 block comment, end the saved deferred pragma string before that
3349 comment. Handle embedded '\0' chars on the pragma line.
3350
8dba02f7 33512005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
3352
3353 PR c++/23333
3354 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
3355
6db045b0 33562005-12-07 Jon Grimm <jgrimm2@us.ibm.com>
3357 Ben Elliston <bje@au.ibm.com>
3358
3359 * include/cpplib.h (CPP_N_DFLOAT): New.
3360 * expr.c (interpret_float_suffix): Identify df, dd, and dl
3361 suffixes as decimal floating point constants.
3362 (cpp_classify_number): Disallow hexadecimal DFP constants.
3363
9a7c76f9 33642005-11-14 Gerald Pfeifer <gerald@pfeifer.com>
b75b98aa 3365 Ian Lance Taylor <ian@airs.com>
9a7c76f9 3366
3367 * include/cpplib.h (struct cpp_callbacks): Annotate error with
3368 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
3369
0c5e3a3d 33702005-11-09 Per Bothner <per@bothner.com>
3371 Uros Bizjak <uros@kss-loka.si>
3ebc7dec 3372
0c5e3a3d 3373 PR c/24101
3374 * init.c (read_original_filename): Temporarily set
3375 state.in_directive before calling _cpp_lex_direct for
3376 CPP_HASH tokens.
3377
3c2359db 33782005-11-03 James E Wilson <wilson@specifix.com>
3379
3380 PR preprocessor/24202
3381 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
3382
d65b3a40 33832005-11-04 Joseph S. Myers <joseph@codesourcery.com>
3384
3385 * include/cpplib.h (struct cpp_callbacks): Make error take
3386 va_list* parameter.
3387 * errors.c (cpp_error): Update call to callback.
3388
cc9012f7 33892005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
3390
3391 PR preprocessor/22042
3392 * macro.c (_cpp_builtin_macro_text): Lower the needed max
3393 buffer size.
3394 (cpp_quote_string): Don't octalify non printable
3395 charactors.
3396
eb0d20b7 33972005-11-03 Joseph S. Myers <joseph@codesourcery.com>
3398
3399 PR c++/17964
3400 * include/cpplib.h (struct cpp_options): Add client_diagnostic.
3401 (struct cpp_callbacks): Add error.
3402 * errors.c (cpp_error): If client_diagnostic, use error callback.
3403 * charset.c (convert_escape): Don't use %03o in diagnostic.
3404
de4aacc0 34052005-10-21 James E Wilson <wilson@specifix.com>
04c0bfd0 3406
3407 PR preprocessor/15220
3408 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all
3409 callers. Pass to open_file_failed.
3410 (open_file_failed): New parameter angle_brackets. Fix all callers.
3411 Use in print_dep assignment.
3412 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
3413 * internal.h (_cpp_find_file): Add new parm to declaration.
3ebc7dec 3414
6783d878 34152005-10-08 Kazu Hirata <kazu@codesourcery.com>
3416
3417 * configure.ac: Require 64-bit int for arm*-*-*eabi*.
3418 * configure: Regenerate.
3419
f789fe3e 34202005-10-04 Ian Lance Taylor <ian@airs.com>
3421
3422 PR preprocessor/13726
3423 * directives.c (check_eol_return_comments): New static function.
3424 (parse_include): Add buf parameter. Change all callers.
3425 (do_include_common): If not discard comments, turn on
3426 save_comments. Pass collected comments to include callback.
3427 * include/cpplib.h (struct cpp_callbacks): Add new parameter to
3428 include callback: cpp_token list.
3429
865c4e44 34302005-09-20 Joseph S. Myers <joseph@codesourcery.com>
3431
3432 * include/cpplib.h (struct cpp_options): Add extended_identifiers.
3433 * init.c (struct lang_flags, lang_defaults): Add
3434 extended_identifiers.
3435 (cpp_set_lang): Use it.
3436 * lex.c (forms_identifier_p): Check extended_identifiers.
3437
56845aa6 34382005-08-30 Jakub Jelinek <jakub@redhat.com>
3439
3440 PR preprocessor/20348
3441 PR preprocessor/20356
3442 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
3443 2004-06-05 changes.
3444
72ee8ff9 34452005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3446
3447 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
3448 -Wmissing-format-attribute.
3449
3450 * configure: Regenerate.
3451
2656917a 34522005-06-29 Kelley Cook <kcook@gcc.gnu.org>
3453
3454 * all files: Update FSF address in copyright headers.
3455 * makeucnid.c (write_copyright): Update outputted FSF address.
3456
cbaa9876 34572005-06-13 Zack Weinberg <zack@codesourcery.com>
3458
3459 * configure.ac: Invoke ZW_CREATE_DEPDIR and
3460 ZW_PROG_COMPILER_DEPENDENCIES.
3461 * aclocal.m4, configure: Regenerate.
3462 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
3463 New variables.
3464 (distclean): Clean up $(DEPDIR) and its contents.
3465 (.c.o): Use $(COMPILE).
3466 Include $(DEPDIR)/*.Po for most object->header dependencies.
3467
720aca92 34682005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
3469
3470 * configure.ac: Check declarations for asprintf and vasprintf.
3471 * config.in: Regenerate.
3472 * configure: Likewise.
3473
3474 * charset.c (conversion_loop): Use XRESIZEVEC.
3475 (convert_no_conversion): Likewise.
3476 (convert_using_iconv): Likewise.
3477 (init_iconv_desc): Cast return value of alloca.
3478 (cpp_host_to_exec_charset): Use XNEWVEC.
3479 (emit_numeric_escape): Use XRESIZEVEC.
3480 (cpp_interpret_string): Use XNEWVEC.
3481 (cpp_interpret_string): Use XRESIZEVEC.
3482 (_cpp_interpret_identifier): Cast return value of alloca.
3483 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
3484 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
3485 (parse_include): Use XNEWVEC.
3486 (insert_pragma_entry): Rename local variable "new" to
cbaa9876 3487 "new_entry".
720aca92 3488 (save_registered_pragmas): Cast return value of xmemdup.
3489 (destringize_and_run): Same for alloca.
3490 (parse_assertion): Likewise.
3491 (do_assert): Cast allocated storage to proper type.
3492 (cpp_define): Likewise.
3493 (_cpp_define_builtin): Likewise.
3494 (cpp_undef): Likewise.
3495 (handle_assertion): Likewise.
3496 (cpp_push_buffer): Rename local variable "new" to "new_buffer".
3497 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
3498 (CPP_UMINUS): Likewise.
3499 (struct cpp_operator): Rename from struct operator.
3500 (_cpp_expand_op_stack): Use XRESIZEVEC.
3501 * files.c (pch_open_file): Use XNEWVEC.
3502 (pch_open_file): Use XRESIZEVEC.
3503 (read_file_guts): Use XNEWVEC and XRESIZEVEC.
3504 (dir_name_of_file): Use XNEWVEC.
3505 (make_cpp_file): Use XCNEW.
3506 (make_cpp_dir): Likewise.
3507 (allocate_file_hash_entries): USE XNEWVEC.
3508 (cpp_included): Cast return value of htab_find_with_hash.
3509 (append_file_to_dir): Use XNEWVEC.
3510 (read_filename_string): Likewise. Use XRESIZEVEC too.
3511 (read_name_map): Cast return value of alloca. Use XRESIZEVEC.
3512 (remap_filename): Use XNEWVEC.
3513 (struct pchf_entry): Move definition out of struct pchf_data.
3514 (_cpp_save_file_entries): Use XCNEWVAR.
3515 (_cpp_read_file_entries): Use XNEWVAR.
3516 * identifiers.c (alloc_node): Use XOBNEW.
3517 * init.c (cpp_create_reader): Use XCNEW.
3518 (cpp_init_builtins): Cast of b->value to enum builtin_type.
3519 (read_original_directory): Cast return value of alloca.
3520 * lex.c (add_line_note): Use XRESIZEVEC.
3521 (warn_about_normalization): Use XNEWVEC.
3522 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
3523 (new_buff): Use XNEWVEC.
3524 * line-map.c (linemap_add): Use XRESIZEVEC.
3525 * macro.c (builtin_macro): Cast return value of alloca.
3526 (paste_tokens): Likewise.
3527 (expand_arg): Use XNEWVEC and XRESIZEVEC.
3528 (_cpp_save_parameter): Use XRESIZEVEC.
3529 (create_iso_definition): Cast allocated storage to proper type.
3530 (_cpp_create_definition): Likewise.
3531 (cpp_macro_definition): Use XRESIZEVEC.
3532 * makedepend.c (add_clm): Use XNEW.
3533 (add_dir): Likewise.
3534 * mkdeps.c (munge): Use XNEWVEC.
3535 (deps_init): Use XCNEW.
3536 (deps_add_target): Use XRESIZEVEC.
3537 (deps_add_default_target): Cast return value of alloca.
3538 (deps_add_dep): Use XRESIZEVEC.
3539 (deps_add_vpath): Likewise. Use XNEWVEC too.
3540 (deps_restore): Likewise.
3541 * pch.c (save_idents): Use XNEW and XNEWVEC.
3542 (cpp_save_state): Use XNEW.
3543 (count_defs): Cast return value of htab_find.
3544 (write_defs): Likewise.
3545 (cpp_write_pch_deps): Use XNEWVEC.
3546 (collect_ht_nodes): Use XRESIZEVEC.
3547 (cpp_valid_state): Use XNEWVEC.
3548 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup.
3549 * symtab.c (ht_create): Use XCNEW.
3550 (ht_lookup_with_hash): Cast return value of obstack_copy0.
3551 (ht_expand): Use XCNEWVEC.
3552 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
3553 (bool): Do not define if __cplusplus.
3554
81e19b31 35552005-05-12 Zack Weinberg <zack@codesourcery.com>
3556
3557 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
3558 (do_sccs): Delete function definition, #define to do_ident.
3559 (do_ident): Don't hardwire directive name.
3560
18f11b84 35612005-05-12 Ryota Kunisawa <kunisawa@access.co.jp>
3562
3563 PR bootstrap/21230
3564 * configure: Regenerate.
3565
2dc04f36 35662005-04-27 Andris Pavenis <pavenis@latnet.lv>
3567
3568 * files.c: Include io.h for DJGPP to get prototype of setmode.
3569
0b7f838f 35702005-04-19 Per Bothner <per@bothner.com>
3571
3572 PR preprocessor/20907
3573 * line-map.c (linemap_line_start): Fix bug when we need to increse
3574 column_bits but can re-use the current line_map.
3575
2224c90b 35762005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3577
3578 * system.h (fopen, fdopen, freopen): Define these to the unlocked
3579 libiberty functions.
3580
077a3c99 35812005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3582
3583 * configure.ac (libcpp_UNLOCKED_FUNCS): New.
3584 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
3585 * system.h (putchar, getc, getchar, clearerr, feof, fileno,
3586 fflush, fgetc, fgets, ferror, fread): Redefine to the associated
3587 _unlocked function.
3588 (fwrite_unlocked): Fix prototype.
81e19b31 3589
077a3c99 3590 * configure, config.in: Regenerate.
3591
99617355 35922005-04-05 Jakub Jelinek <jakub@redhat.com>
3593
3594 PR preprocessor/19475
3595 * macro.c (create_iso_definition): For < ISO C99, don't
3596 pedwarn if there is no whitespace between macro name and its
3597 replacement, but the replacement starts with a basic character
3598 set character.
3599
3827dee5 36002005-03-28 Andreas Jaeger <aj@suse.de>
3601
3602 * lex.c (warn_about_normalization): Cast field width to int to
3603 avoid warning.
3604
b8273627 36052005-03-19 Joseph S. Myers <joseph@codesourcery.com>
3606
3607 * configure.ac: Consistently use solaris2.1[0-9]* instead of
3608 solaris2.1[0-9].
3609 * configure: Regenerate.
3610
bc65f24f 36112005-03-15 Geoffrey Keating <geoffk@apple.com>
3612
3613 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
3614 UCN rather than printing an error.
3615
bce47149 36162005-03-14 Geoffrey Keating <geoffk@apple.com>
3617
4e9d1e6d 3618 * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
3619
36202005-03-14 Geoffrey Keating <geoffk@apple.com>
81e19b31 3621
bce47149 3622 * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
3623 * charset.c: Update for new format of ucnid.h.
3624 (ucn_valid_in_identifier): Update for new format of ucnid.h.
3625 Add NST parameter, and update it; update callers.
3626 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort
3627 with cpp_error.
3628 (convert_ucn): Pass normalize_state to cpp_valid_ucn.
3629 * internal.h (struct normalize_state): New.
3630 (INITIAL_NORMALIZE_STATE): New.
3631 (NORMALIZE_STATE_RESULT): New.
3632 (NORMALIZE_STATE_UPDATE_IDNUM): New.
3633 (_cpp_valid_ucn): New.
3634 * lex.c (warn_about_normalization): New.
3635 (forms_identifier_p): Add normalize_state parameter, update callers.
3636 (lex_identifier): Add normalize_state parameter, update callers. Keep
3637 the state current.
3638 (lex_number): Likewise.
3639 (_cpp_lex_direct): Pass normalize_state to subroutines. Check
3640 it with warn_about_normalization.
3641 * makeucnid.c: New.
3642 * ucnid.h: Replace.
3643 * ucnid.pl: Remove.
3644 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove
3645 comments about obsolete version of C++.
3646 * include/cpplib.h (enum cpp_normalize_level): New.
3647 (struct cpp_options): Add warn_normalize field.
3648
bb1fa6bb 36492005-03-11 Geoffrey Keating <geoffk@apple.com>
3650
3651 * directives.c (glue_header_name): Update call to cpp_spell_token.
3652 * internal.h (_cpp_interpret_identifier): New.
3653 * charset.c (_cpp_interpret_identifier): New.
3654 (_cpp_valid_ucn): Allow UCN version of '$'.
3655 * lex.c (lex_identifier): Add extra parameter to indicate if initial
3656 character was '$' or '\'. Support identifiers with UCNs.
3657 (forms_identifier_p): Allow UCNs.
3658 (_cpp_lex_direct): Pass extra parameter to lex_identifier.
3659 (utf8_to_ucn): New.
3660 (cpp_spell_token): Add FORSTRING parameter. Use it.
3661 (cpp_token_as_text): Update call to cpp_spell_token.
3662 (cpp_output_token): Write UCNs back out.
3663 (stringify_arg): Update call to cpp_spell_token.
3664 (paste_tokens): Likewise.
3665 (cpp_macro_definition): Likewise.
3666 * macro.c (stringify_arg): Likewise.
3667 (paste_tokens): Likewise.
3668 (cpp_macro_definition): Likewise.
3669 * include/cpplib.h: Add parameter to cpp_spell_token.
3670
960391da 36712005-03-04 Jakub Jelinek <jakub@redhat.com>
3672
3673 PR bootstrap/20282
3674 PR bootstrap/20305
3675 * macro.c (replace_args, cpp_get_token): Copy whole
3676 cpp_token_u instead of just cpp_string field from it.
3677
b0d0794d 36782005-02-28 Devang Patel <dpatel@apple.com>
3679
3680 * directives.c (do_line): Save sysp early before line table is
3681 realloc'ed.
81e19b31 3682
624d37a6 36832005-02-20 Zack Weinberg <zack@codesourcery.com>
3684
3685 PR 18785
3686 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
3687 (cpp_host_to_exec_charset): New function.
3688 * include/cpplib.h: Declare cpp_host_to_exec_charset.
3689
f86986bc 36902005-02-19 Devang Patel <dpatel@apple.com>
3691
3692 * charset.c (_cpp_convert_input): Check '\r' before inserting
3693 '\n' at the end.
624d37a6 3694
9936e07d 36952005-02-15 Eric Christopher <echristo@redhat.com>
3696
3697 PR preprocessor/19077
3698 * macro.c (cpp_macro_definition): Move handling of whitespace
3699 to PREV_WHITE conditional. Remove overloading of len
3700 variable.
3701
129a1540 37022005-02-14 Kazu Hirata <kazu@cs.umass.edu>
3703
3704 * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
3705 traditional.c: Update copyright.
3706
bb30d1f4 37072005-02-14 Paolo Bonzini <bonzini@gnu.org>
3708
3709 PR bootstrap/19818
3710 * configure.ac: Check for declaration of basename and getopt.
3711 * config.in: Regenerate.
3712 * configure: Regenerate.
3713 * internal.h (ustrcspn): New.
3714 * macro.c (create_iso_definition): Fix allocation of memory.
3715 (padding_token): Add cast to remove const-ness.
3716 * pch.c (cpp_read_state): Use ustrcspn.
3717
26ec4f15 37182005-02-08 Mike Stump <mrs@apple.com>
3719
3720 * files.c (pchf_adder): Remove.
3721 (struct pchf_adder_info): Likewise.
3722 (_cpp_save_file_entries): Write out all files so that #import works.
3723
0cb78cbd 37242005-01-23 Joseph S. Myers <joseph@codesourcery.com>
3725
3726 * configure: Regenerate.
3727
d862067c 37282005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
3729
3730 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
3731
457e71e4 3732 * include/cpplib.h: Also update copyright years.
624d37a6 3733
ba841ef8 37342005-01-03 Geoffrey Keating <geoffk@apple.com>
3735
3736 * files.c (_cpp_find_file): Add files found by search_path_exhausted
3737 to the list of all files.
3738
f03668bd 37392005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
3740
3741 * internal.h: Update references to Cpp lib filenames.
3742 * directives.c: Likewise.
3743 * init.c: Likewise.
3744 * macro.c: Likewise.
3745 * traditional.c: Likewise.
3746
461ea98d 37472004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
3748
3749 PR preprocessor/15167
3750 * files.c (destroy_cpp_file): New function.
3751 (should_stack_file): Make a new file if the
3752 compared file is still stacked.
3753
bd9e37a6 37542004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
3755
624d37a6 3756 PR preprocessor/17610
bd9e37a6 3757 * directives.c (do_include_common): Error out if an empty filename
3758 is given for #include (or #include_next or #import).
3759
fe4dcd90 37602004-11-27 Roger Sayle <roger@eyesopen.com>
3761 Zack Weinberg <zack@codesourcery.com>
3762
3763 * internal.h: Replace all uses of uchar with unsigned char.
3764 * include/cpp-id-data.h: Likewise. Guard typedef of uchar
3765 with !IN_GCC, so uchar is only defined whilst building libcpp.
3766
ac7cc2f4 37672004-11-24 Kelley Cook <kcook@gcc.gnu.org>
3768
3769 * aclocal.m4: Regenerate.
3770
6e11b263 37712004-11-24 Roger Sayle <roger@eyesopen.com>
3772
3773 PR preprocessor/15824
3774 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
3775 directly, instead of the non-existant "system.h" and "ansidecl.h".
3776 * configure: Regenerate.
3777
68bf2ad9 37782004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
624d37a6 3779 Joseph Myers <joseph@codesourcery.com>
68bf2ad9 3780
3781 * internal.h (struct lexer_state): Add in_deferred_pragma.
3782 * directives.c (struct pragma_entry): Add allow_expansion.
3783 (insert_pragma_entry): Take allow_expansion flag.
3784 (register_pragma): Likewise.
3785 (cpp_register_pragma): Likewise.
3786 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
3787 (do_pragma): Honor allow_expansion.
3788 (cpp_handle_deferred_pragma): Set in_deferred_pragma.
3789 * include/cpplib.h (cpp_register_pragma): Update prototype.
3790
27559c4e 37912004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
624d37a6 3792 Mark Mitchell <mark@codesourcery.com>
27559c4e 3793
3794 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
3795 need_64bit_hwint=yes.
3796 * configure: Regenerate.
3797
34ae664d 37982004-11-09 Joseph S. Myers <joseph@codesourcery.com>
3799
3800 * Makefile.in ($(PACKAGE).pot): New rule. Depend on
3801 po/$(PACKAGE).pot.
3802 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
3803 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
3804 Remove local srcdir path from generated file.
3805
39b83bdb 38062004-11-04 Zack Weinberg <zack@codesourcery.com>
624d37a6 3807 Gerald Pfeifer <gerald@pfeifer.com>
39b83bdb 3808
3809 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
3810 as well.
3811
a095c1b5 38122004-10-27 Zack Weinberg <zack@codesourcery.com>
3813
3814 PR 18075
3815 * directives.c (do_pragma): Do not defer pragmas which are unknown.
3816 (cpp_handle_deferred_pragma): Add cast to silence warning.
3817
700b0d81 38182004-10-14 Joseph S. Myers <jsm@polyomino.org.uk>
3819
3820 * errors.c (_cpp_begin_message): Print "error: " for errors.
3821
fbe83ac1 38222004-10-10 Andreas Jaeger <aj@suse.de>
3823
3824 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
3825 * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
3826
09f10c94 38272004-10-08 Andrew Pinski <pinskia@physics.uc.edu>
3828
3829 * pch.c (cpp_write_pch_state): Remove variable z as it is not
3830 used.
3831 (cpp_read_state): Remove unused variables, m, d and mac_count.
3832
a8b2a8d5 38332004-09-29 Per Bothner <per@bothner.com>
3834
3835 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore
3836 cb.line_change. Otherwise do_pragma will call the line_change
3837 call-back with a meaningless line number.
3838
21164c01 38392004-09-24 Zack Weinberg <zack@codesourcery.com>
3840
3841 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
3842 programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
3843 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
3844 * aclocal.m4, configure: Regenerate.
3845 * init.c: Include localedir.h.
3846 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
3847 (DEFS): Delete.
3848 (.c.o): Use $(ALL_CFLAGS).
3849 (localedir.h, localedir.hs): New rules.
3850 (clean): Use rm -rf to remove directories.
3851 (distclean): Also delete localedir.h and localedir.hs.
3852 (init.o): Update dependencies.
3853
986086aa 38542004-09-22 Kelley Cook <kcook@gcc.gnu.org>
3855
3856 * Makefile.in (aclocal.m4): Update dependencies.
3857 * configure.ac (AC_CONFIG_MACRO_DIR): New.
3858 * aclocal.m4, configure: Regenerate.
3859
e9cc3617 38602004-09-17 Zack Weinberg <zack@codesourcery.com>
3861
0097f6a2 3862 * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
3863 (_cpp_convert_input, _cpp_default_encoding): Add comments.
3864 Some other comments in this file also tweaked.
3865
e9cc3617 3866 * directives.c (do_pragma): Save current buffer position
3867 before lexing the pragma keywords; don't call
3868 _cpp_backup_tokens in the defer_pragmas case.
3869
9832c977 38702004-09-15 Per Bothner <per@bothner.com>
3871
3872 * include/line-map.h (line_map_start): Add parameter names so
3873 preceding comment makes sense.
3874 (linemap_add): Remove from comment mention of non-existing parameter.
3875
d6d3c909 38762004-09-09 Matt Austern <austern@apple.com>
3877 Zack Weinberg <zack@codesourcery.com>
3878
3879 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
3880 prefixes throughout. Add entry for PRAGMA. Remove
3881 unnecessary "= 0" from EQ.
3882 (enum cpp_ttype): Adjust OP and TK definitions to restore
3883 prefixes, via token-paste.
3884 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
3885 Change from #defines to additional cpp_ttype enumerators.
3886 (struct cpp_options): Add defer_pragmas.
3887 (cpp_handle_deferred_pragma): Prototype new interface.
3888
3889 * internal.h (struct cpp_reader): Add directive_result.
3890 * directives.c (struct pragma_entry): Add is_internal field;
3891 give boolean fields type bool.
3892 (start_directive): Initialize pfile->directive_result.type.
3893 (_cpp_do__Pragma): Likewise.
3894 (run_directive): Do not crash if pfile->buffer->prev is NULL.
3895 (insert_pragma_entry): Add 'internal' argument; set new->is_internal
3896 from it.
3897 (register_pragma): New static function, bulk of former
3898 cpp_register_pragma here; add 'internal' argument, pass along
3899 to insert_pragma_entry.
3900 (cpp_register_pragma): Now a wrapper around register_pragma which
3901 always passes false for 'internal' argument.
3902 (_cpp_init_internal_pragmas): Call register_pragma directly, passing
3903 true for 'internal'.
3904 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
3905 an internal pragma, save text till the end of the line as a CPP_PRAGMA
3906 token instead of executing the pragma.
3907 (cpp_handle_deferred_pragma): New interface.
3908 * lex.c (token_spellings): Adjust OP and TK definitions to
3909 match changes to cpplib.h.
3910 (_cpp_lex_token): Check for a directive-result token and
3911 return it if present.
3912 (cpp_token_val_index): Handle CPP_PRAGMA.
3913 * macro.c (cpp_builtin_macro_text): Correct comment.
3914 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
3915
735a9bc4 39162004-09-06 Serge Belyshev <belyshev@lubercy.com>
3917
3918 PR preprocessor/14699
3919 * symtab.c (ht_dump_statistics): Change type of sum_of_squares
3920 from size_t to double.
3921
25696d3f 39222004-08-28 Andreas Schwab <schwab@suse.de>
3923 Andreas Jaeger <aj@suse.de>
3924
3925 * configure.ac: Set PACKAGE correctly.
3926 * configure: Regenerated.
3927
99439f5b 39282004-08-25 Paolo Bonzini <bonzini@gnu.org>
3929
3930 * Makefile.in: Add back top_builddir.
3931
a668be26 39322004-08-25 Paolo Bonzini <bonzini@gnu.org>
3933
3934 * configure.ac: Replace Automake macro invocations
3935 with manual Autoconf checks and substitutions.
3936 * configure: Regenerate.
3937 * aclocal.m4: Regenerate.
3938 * config.in: Regenerate.
3939 * Makefile.am: Removed.
3940 * Makefile.in: Heavy simplification and reorganization.
3941
30e9913f 39422004-08-09 Mark Mitchell <mark@codesourcery.com>
3943
3944 * configure.ac (arm*-*-eabi*): New target.
3945 (arm*-*-symbianelf*): Likewise.
3946 * configure: Regenerated.
3947
3b298764 39482004-07-24 Bernardo Innocenti <bernie@develer.com>
3949
3950 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
3951 * directives.c: Use XNEW-family macros from libiberty.
3952 * lex.c: Likewise.
3953 * macro.c: Likewise.
3954 * cpplib.h (cpp_deps_style): Export enum with name.
3955
d6d3c909 39562004-07-23 Matthias Klose <doko@debian.org>
3b298764 3957
d6d3c909 3958 * init.c (init_library): Use PACKAGE for the text domain.
1ed7d058 3959
821fa045 39602004-07-16 Andris Pavenis <pavenis@latnet.lv>
3961
3962 PR preprocessor/16366
3963 * internal.h (struct cpp_reader): New field dir_hash.
3964 * files.c (make_cpp_dir): Use dir_hash, not file_hash.
3965 (_cpp_init_files, _cpp_cleanup_files): Update for new field.
3966
d80efa72 39672004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
3968
3969 PR preprocessor/16192
3970 PR preprocessor/15913
3971 PR preprocessor/15572
3972 * expr.c (_cpp_parse_expr): Handle remaining cases where an
3973 expression is missing.
3974 * init.c (post_options): Traditional cpp doesn't do // comments.
3975
ed000086 39762004-06-30 Per Bothner <per@bothner.com>
3977
3978 * include/line-map.h (fileline): Remove old typedef.
3979 * internal.h (struct cpp_reader): Use source_location typedef instead.
3980
dcb9d064 39812004-06-26 Zack Weinberg <zack@codesourcery.com>
3982
3983 Partially revert patch of 2004-06-05.
3984 * files.c (search_cache): Remove pfile argument. Don't check
3985 for file that would be found by "" or <> search here...
3986 (_cpp_find_file): ...do it here, before calling find_file_in_dir.
3987 Do not apply directory-of-current-file correction to files
3988 found by this check. Rearrange code slightly.
3989
d718b525 39902004-06-21 Geoffrey Keating <geoffk@apple.com>
3991
3992 * files.c (should_stack_file): Correct swapped parameters to call
3993 to cb.read_pch.
3994 * pch.c (cpp_valid_state): Handle -fpreprocessed.
3995
79b68529 39962004-06-15 Paolo Bonzini <bonzini@gnu.org>
3997
3998 * Makefile.in: Regenerate with automake 1.8.5.
3999 * aclocal.m4: Likewise.
4000 * configure: Regenerate.
4001
151899c5 40022004-06-11 Zack Weinberg <zack@codesourcery.com>
4003
4004 * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
4005 * configure, config.in: Regenerate.
4006 * system.h: Unconditionally define bool as unsigned char,
4007 BOOL_BITFIELD as unsigned int.
4008 * .cvsignore: New file.
4009
c39ed964 40102004-06-09 Geoffrey Keating <geoffk@apple.com>
4011
4012 * traditional.c (push_replacement_text): Set macro->traditional.
4013 (save_replacement_text): Likewise.
4014 * pch.c (cpp_write_pch_state): Don't write list of defined macros.
4015 (struct save_macro_item): Delete.
4016 (struct save_macro_data): Use a character array not the previous
4017 structured format.
4018 (save_macros): Save macro as text not as internal structures.
4019 (cpp_prepare_state): Update for changes to save_macro_data.
4020 (cpp_read_state): Don't read macros defined in PCH. Restore
c84ca916 4021 -D macros as text.
c39ed964 4022 * macro.c (create_iso_definition): Honour alloc_subobject.
4023 Clear traditional flag.
4024 (_cpp_create_definition): Honour alloc_subobject.
4025 * lex.c (cpp_token_val_index): New.
4026 * internal.h: Include cpp-id-data.h.
4027 (uchar): Move definition to cpp-id-data.h.
4028 (U): Likewise.
4029 (cpp_macro): Likewise.
4030 * directives.c (struct answer): Move to cpp-id-data.h.
4031 (do_assert): Honour alloc_subobject.
c84ca916 4032
4033 * include/symtab.h (struct ht): Add field 'alloc_subobject'.
4034 * include/cpplib.h (struct cpp_string): Add GTY marker.
4035 (enum cpp_token_fld_kind): New.
4036 (struct cpp_token): Add GTY markers.
4037 (cpp_token_val_index): Prototype.
4038 (CPP_HASHNODE_VALUE_IDX): New.
4039 (struct cpp_hashnode): Don't skip fields of 'value' when marking.
4040 * include/cpp-id-data.h: New file.
c39ed964 4041
dd6e5561 40422004-06-09 Paolo Bonzini <bonzini@gnu.org>
4043
4044 * Makefile.am (all-local): New.
4045 * Makefile.in: Regenerate.
4046
8af0c78d 40472004-06-06 Roger Sayle <roger@eyesopen.com>
4048
4049 * Makefile.am (LIBICONV): Declare.
4050 (makedepend_LDADD): Use LIBICONV.
4051 * Makefile.in: Regenerate.
4052
30302733 40532004-06-05 Andrew Pinski <pinskia@physics.uc.edu>
4054
4055 * Makefile.am (LIBINTL): Declare
4056 (makedepend_LDADD): Use LIBINTL.
4057 * Makefile.in: Regenerate.
4058
3eb3f293 40592004-06-05 Zack Weinberg <zack@codesourcery.com>
4060
4061 * Makefile.am: Add makedepend.
4062 * Makefile.in, aclocal.m4: Regenerate.
4063 * charset.c: Insert a space to avoid a warning.
4064 * directives.c: Include mkdeps.h.
4065 (_cpp_handle_directive): Reenable macro expander if appropriate.
4066 (undefine_macros): Inline body of _cpp_free_definition for speed.
4067 Do not call undef callback or _cpp_warn_if_unused_macro.
4068 (cpp_get_deps): New interface.
4069 * files.c (search_cache): Add pfile argument. Check for file
4070 that would be found by "" or <> search here...
4071 (_cpp_find_file): ...not here. Correct recorded start_dir of
4072 files found by directory-of-current-file search that would be
4073 found by "" or <> search.
4074 * init.c (cpp_add_dependency_target): Delete.
4075 * internal.h (struct lexer_state): Add discarding_output flag.
4076 * lex.c (lex_identifier): Compute hash function while scanning.
4077 * macro.c (cpp_scan_nooutput): Disable macro expansion outside
4078 directives.
4079 * makedepend.c: New file.
4080 * mkdeps.c (struct deps): Add vpath vector.
4081 (apply_vpath, deps_add_vpath): New function.
4082 (deps_free): Free vpath vector.
4083 (deps_add_dep, deps_add_target): Use apply_vpath.
4084 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
4085 (ht_lookup_with_hash): New function.
4086 * cpplib.h, mkdeps.h: Update prototypes.
4087 * symtab.h: Update prototypes.
4088 (HT_HASHSTEP, HT_FINISH): New macros.
4089
8ed01400 40902004-05-29 Geoffrey Keating <geoffk@apple.com>
4091
4092 * symtab.c (ht_create): Set entries_owned.
4093 (ht_destroy): Honour entries_owned.
4094 (ht_expand): Likewise.
4095 (ht_load): New.
c84ca916 4096 * include/symtab.h (struct ht): New field 'entries_owned'
4097 (ht_load): New prototype.
8ed01400 4098
347a3ab5 40992004-05-26 Paolo Bonzini <bonzini@gnu.org>
4100
4101 PR bootstrap/15651
4102 * configure.ac: Fix m4 quoting when picking
4103 the size of HOST_WIDE_INT.
4104 * configure: Regenerate.
4105
fc231f28 41062004-05-25 Paolo Bonzini <bonzini@gnu.org>
4107
4108 * Makefile.am: the correct directory for
4109 gettext include files is given by @INCINTL@.
4110 * Makefile.in: Regenerate.
4111
babfbd63 41122004-05-24 Paolo Bonzini <bonzini@gnu.org>
4113
4114 * system.h [!ENABLE_NLS]: dgettext takes two
4115 parameters.
4116
d856c8a6 41172004-05-23 Paolo Bonzini <bonzini@gnu.org>
4118
4119 Moved libcpp from the gcc subdirectory to the toplevel.
4120 * Makefile.am: New file.
4121 * Makefile.in: Regenerate.
4122 * configure.ac: New file.
4123 * configure: Regenerate.
4124 * config.in: Regenerate.
4125 * charset.c: Moved from gcc/cppcharset.c. Add note about
4126 brokenness of input charset detection. Adjust for change
4127 in name of cppucnid.h.
4128 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
4129 * expr.c: Moved from gcc/cppexp.c.
4130 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
4131 Remove #define of O_BINARY, it is in system.h.
4132 * identifiers.c: Moved from gcc/cpphash.c.
4133 * internal.h: Moved from gcc/cpphash.h. Change header
4134 guard name. All other files adjusted to match name change.
4135 * init.c: Moved from gcc/cppinit.c.
4136 (init_library) [ENABLE_NLS]: Call bindtextdomain.
4137 * lex.c: Moved from gcc/cpplex.c.
4138 * directives.c: Moved from gcc/cpplib.c.
4139 * macro.c: Moved from gcc/cppmacro.c.
4140 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
4141 * traditional.c: Moved from gcc/cpptrad.c.
4142 * ucnid.h: Moved from gcc/cppucnid.h. Change header
4143 guard name.
4144 * ucnid.pl: Moved from gcc/cppucnid.pl.
4145 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header
4146 guard name.
4147 * symtab.c: Moved from gcc/hashtable.c.
4148 * line-map.c: Moved from gcc. Do not include intl.h.
4149 * mkdeps.c: Moved from gcc.
4150 * system.h: New file.
c84ca916 4151 * include/cpplib.h: Moved from gcc. Change header guard name.
4152 * include/line-map.h: Moved from gcc. Change header guard name.
4153 * include/mkdeps.h: Moved from gcc. Change header guard name.
4154 * include/symtab.h: Moved from gcc/hashtable.h. Change header
4155 guard name.