]> git.ipfire.org Git - thirdparty/gcc.git/blame - libcpp/ChangeLog
PR target/69706
[thirdparty/gcc.git] / libcpp / ChangeLog
CommitLineData
52609ec3 12016-02-23 David Malcolm <dmalcolm@redhat.com>
2
3 PR preprocessor/69126
4 PR preprocessor/69543
5 * line-map.c (linemap_compare_locations): At the function top,
6 replace inlined bodies of get_location_from_adhoc_loc with calls
7 to get_location_from_adhoc_loc. Add a pair of calls to
8 get_location_from_adhoc_loc at the bottom of the function, to
9 avoid meaningless comparisons of ad-hoc and non-ad-hoc locations.
10
86e0b129 112016-02-08 David Malcolm <dmalcolm@redhat.com>
12
13 PR preprocessor/69664
14 * errors.c (cpp_diagnostic_with_line): Only call
15 rich_location::override_column if the column is non-zero.
16 * line-map.c (rich_location::override_column): Update columns
17 within m_ranges[0]. Add assertions to verify that doing so is
18 sane.
19
1e302465 202016-02-05 Jakub Jelinek <jakub@redhat.com>
21
22 PR c++/69628
23 * charset.c (cpp_interpret_charconst): Clear *PCHARS_SEEN
24 and *UNSIGNEDP if bailing out early due to errors.
25
1e6115dd 262016-01-28 Jakub Jelinek <jakub@redhat.com>
27
9cd9799e 28 PR pch/68176
29 * files.c (_cpp_find_file): Set file->implicit_preinclude even if
30 included from file->implicit_preinclude header.
31
1e6115dd 32 * directives.c (destringize_and_run): Adjust prototype.
33
eec96426 342016-01-27 David Malcolm <dmalcolm@redhat.com>
35
36 PR preprocessor/69126
37 * directives.c (destringize_and_run): Add expansion_loc param; use
38 it when handling unexpanded pragmas to fixup the locations of the
39 synthesized tokens.
40 (_cpp_do__Pragma): Add expansion_loc param and use it when calling
41 destringize_and_run.
42 * internal.h (_cpp_do__Pragma): Add expansion_loc param.
43 * macro.c (builtin_macro): Pass expansion location of _Pragma to
44 _cpp_do__Pragma.
45
a7ed4583 462016-01-14 David Malcolm <dmalcolm@redhat.com>
47
48 PR preprocessor/69177
49 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): New
50 constant.
51 (LINE_MAP_MAX_LOCATION_WITH_COLS): Add note about unit tests
52 to comment.
53 (can_be_stored_compactly_p): Reduce threshold from
54 LINE_MAP_MAX_LOCATION_WITH_COLS to
55 LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES.
56 (get_combined_adhoc_loc): Likewise.
57 (get_range_from_loc): Likewise.
58 (linemap_line_start): Ensure that a new ordinary map is created
59 when transitioning from range-packing being enabled to disabled,
60 at the LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES threshold. Set
61 range_bits to 0 for new ordinary maps when beyond this limit.
62 Prevent the "increase the column bits of a freshly created map"
63 optimization if the range bits has reduced.
64
5d034e37 652016-01-08 Jakub Jelinek <jakub@redhat.com>
66
67 PR c++/69145
68 * files.c (cpp_included_before): If IS_ADHOC_LOC (location), lookup
69 real location from the line_table.
70
f1717362 712016-01-04 Jakub Jelinek <jakub@redhat.com>
72
73 Update copyright years.
74
7b4b11d3 752015-12-22 David Malcolm <dmalcolm@redhat.com>
76
77 * line-map.c (get_combined_adhoc_loc): Remove condition
78 on locus < RESERVED_LOCATION_COUNT when considering
79 whether a caret == start == finish location can be
80 simply stored as the caret location.
81
d0f713f4 822015-12-07 David Malcolm <dmalcolm@redhat.com>
83
84 * include/line-map.h (rich_location::set_range): Add line_maps *
85 param; convert param from source_range to source_location. Drop
86 "overwrite_loc_p" param.
87 * line-map.c (rich_location::set_range): Likewise, acting as if
88 "overwrite_loc_p" were true, and getting range from the location.
89
734caf84 902015-11-20 David Malcolm <dmalcolm@redhat.com>
91
92 PR 62314
93 * include/line-map.h (source_range::intersects_line_p): New
94 method.
95 (rich_location::~rich_location): New.
96 (rich_location::add_fixit_insert): New method.
97 (rich_location::add_fixit_remove): New method.
98 (rich_location::add_fixit_replace): New method.
99 (rich_location::get_num_fixit_hints): New accessor.
100 (rich_location::get_fixit_hint): New accessor.
101 (rich_location::MAX_FIXIT_HINTS): New constant.
102 (rich_location::m_num_fixit_hints): New field.
103 (rich_location::m_fixit_hints): New field.
104 (class fixit_hint): New class.
105 (class fixit_insert): New class.
106 (class fixit_remove): New class.
107 (class fixit_replace): New class.
108 * line-map.c (source_range::intersects_line_p): New method.
109 (rich_location::rich_location): Add initialization of
110 m_num_fixit_hints to both ctors.
111 (rich_location::~rich_location): New.
112 (rich_location::add_fixit_insert): New method.
113 (rich_location::add_fixit_remove): New method.
114 (rich_location::add_fixit_replace): New method.
115 (fixit_insert::fixit_insert): New.
116 (fixit_insert::~fixit_insert): New.
117 (fixit_insert::affects_line_p): New.
118 (fixit_remove::fixit_remove): New.
119 (fixit_remove::affects_line_p): New.
120 (fixit_replace::fixit_replace): New.
121 (fixit_replace::~fixit_replace): New.
122 (fixit_replace::affects_line_p): New.
123
55d11fae 1242015-11-19 Jakub Jelinek <jakub@redhat.com>
125
126 PR preprocessor/60736
127 * include/cpplib.h (cpp_errno_filename): New prototype.
128 * errors.c (cpp_errno): Don't handle msgid "" specially, use
129 _(msgid) instead of msgid as argument to cpp_error.
130 (cpp_errno_filename): New function.
131 * files.c (read_file_guts): Use cpp_errno_filename instead of
132 cpp_errno.
133 (open_file_failed): Likewise. Use file->name if file->path is NULL
134 in diagnostics.
135
a96cefb2 1362015-11-13 David Malcolm <dmalcolm@redhat.com>
137
138 * errors.c (cpp_diagnostic): Pass pfile->line_table to
139 rich_location ctor.
140 (cpp_diagnostic_with_line): Likewise.
141 * include/cpplib.h (struct cpp_token): Update comment for src_loc
142 to indicate that the range of the token is "baked into" the
143 source_location.
144 * include/line-map.h (source_location): Update the descriptive
145 comment to reflect the packing scheme for short ranges, adding
146 worked examples of location encoding.
147 (struct line_map_ordinary): Drop field "column_bits" in favor
148 of field "m_column_and_range_bits"; add field "m_range_bits".
149 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
150 (location_adhoc_data): Add source_range field.
151 (struct line_maps): Add fields "default_range_bits",
152 "num_optimized_ranges" and "num_unoptimized_ranges".
153 (get_combined_adhoc_loc): Add source_range param.
154 (get_range_from_loc): New declaration.
155 (pure_location_p): New prototype.
156 (COMBINE_LOCATION_DATA): Add source_range param.
157 (SOURCE_LINE): Update for renaming of column_bits.
158 (SOURCE_COLUMN): Likewise. Shift the column right by the map's
159 range_bits.
160 (LAST_SOURCE_LINE_LOCATION): Update for renaming of column_bits.
161 (linemap_position_for_line_and_column): Add line_maps * params.
162 (rich_location::rich_location): Likewise.
163 * lex.c (_cpp_lex_direct): Capture the range of the token, baking
164 it into token->src_loc via a call to COMBINE_LOCATION_DATA.
165 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): Reduce from 1U << 17 to
166 1U << 12.
167 (location_adhoc_data_hash): Add the src_range into
168 the hash value.
169 (location_adhoc_data_eq): Require equality of the src_range
170 values.
171 (can_be_stored_compactly_p): New function.
172 (get_combined_adhoc_loc): Add src_range param, and store it,
173 via a bit-packing scheme for short ranges, otherwise within the
174 lookaside table. Remove the requirement that data is non-NULL.
175 (get_range_from_adhoc_loc): New function.
176 (get_range_from_loc): New function.
177 (pure_location_p): New function.
178 (linemap_add): Ensure that start_location has zero for the
179 range_bits, unless we're past LINE_MAP_MAX_LOCATION_WITH_COLS.
180 Initialize range_bits to zero. Assert that the start_location
181 is "pure".
182 (linemap_line_start): Assert that the
183 column_and_range_bits >= range_bits.
184 Update determinination of whether we need to start a new map
185 using the effective column bits, without the range bits.
186 Use the set's default_range_bits in new maps, apart from
187 those with column_bits == 0, which should also have 0 range_bits.
188 Increase the column bits for new maps by the range bits.
189 When adding lines to an existing map, use set->highest_line
190 directly rather than offsetting highest by SOURCE_COLUMN.
191 Add assertions to sanity-check the return value.
192 (linemap_position_for_column): Offset to_column by range_bits.
193 Update set->highest_location if necessary.
194 (linemap_position_for_line_and_column): Add line_maps * param.
195 Update the calculation to offset the column by range_bits, and
196 conditionalize it on being <= LINE_MAP_MAX_LOCATION_WITH_COLS.
197 Bound it by LINEMAPS_MACRO_LOWEST_LOCATION. Update
198 set->highest_location if necessary.
199 (linemap_position_for_loc_and_offset): Handle ad-hoc locations;
200 pass "set" to linemap_position_for_line_and_column.
201 (linemap_macro_map_loc_unwind_toward_spelling): Add line_maps
202 param. Handle ad-hoc locations.
203 (linemap_location_in_system_header_p): Pass on "set" to call to
204 linemap_macro_map_loc_unwind_toward_spelling.
205 (linemap_macro_loc_to_spelling_point): Retain ad-hoc locations.
206 Pass on "set" to call to
207 linemap_macro_map_loc_unwind_toward_spelling.
208 (linemap_resolve_location): Retain ad-hoc locations. Pass on
209 "set" to call to linemap_macro_map_loc_unwind_toward_spelling.
210 (linemap_unwind_toward_expansion): Pass on "set" to call to
211 linemap_macro_map_loc_unwind_toward_spelling.
212 (linemap_expand_location): Extract the data pointer before
213 extracting the location.
214 (rich_location::rich_location): Add line_maps param; use it to
215 extract the range from the source_location.
216 * location-example.txt: Regenerate, showing new representation.
217
f0479000 2182015-11-06 David Malcolm <dmalcolm@redhat.com>
219
220 * errors.c (cpp_diagnostic): Update for change in signature
221 of "error" callback.
222 (cpp_diagnostic_with_line): Likewise, calling override_column
223 on the rich_location.
224 * include/cpplib.h (struct cpp_callbacks): Within "error"
225 callback, convert param from source_location to rich_location *,
226 and drop column_override param.
227 * include/line-map.h (struct source_range): New struct.
228 (struct location_range): New struct.
229 (class rich_location): New class.
230 (linemap_client_expand_location_to_spelling_point): New declaration.
231 * line-map.c (rich_location::rich_location): New ctors.
232 (rich_location::lazily_expand_location): New method.
233 (rich_location::override_column): New method.
234 (rich_location::add_range): New methods.
235 (rich_location::set_range): New method.
236
0ffb4474 2372015-11-06 David Malcolm <dmalcolm@redhat.com>
238
239 * include/line-map.h (struct linemap_stats): Add fields
240 "adhoc_table_size" and "adhoc_table_entries_used".
241 * line-map.c (linemap_get_statistics): Populate above fields.
242
29134d13 2432015-11-04 Mikhail Maltsev <maltsevm@gmail.com>
244
245 * config.in: Regenerate.
246 * configure: Regenerate.
247 * configure.ac: Remove ENABLE_CHECKING.
248
71e4c29d 2492015-11-03 Uros Bizjak <ubizjak@gmail.com>
250
251 * lex.c (search_line_sse42): Correctly advance the pointer to an
252 aligned address.
253
988403a9 2542015-11-02 David Malcolm <dmalcolm@redhat.com>
255
256 * include/line-map.h (source_location): In the table in the
257 descriptive comment, show UNKNOWN_LOCATION, BUILTINS_LOCATION,
258 LINE_MAP_MAX_LOCATION_WITH_COLS, LINE_MAP_MAX_SOURCE_LOCATION.
259 Add notes about ad-hoc values.
260
92a110bb 2612015-10-21 Mikhail Maltsev <maltsevm@gmail.com>
262
cfec10de 263 * include/line-map.h: Use CHECKING_P instead of ENABLE_CHECKING.
264 * init.c: Likewise.
265 * macro.c (struct macro_arg_token_iter, set_arg_token,
266 macro_arg_token_iter_init, macro_arg_token_iter_forward,
267 macro_arg_token_iter_get_token, macro_arg_token_iter_get_location,
268 alloc_expanded_arg_mem, _cpp_backup_tokens): Likewise.
269
92a110bb 270 * config.in: Regenerate.
271 * configure: Regenerate.
272 * configure.ac (CHECKING_P): Define.
273 * system.h (fancy_abort): Declare.
274 (abort): Define.
275 (gcc_assert): Define. Use CHECKING_P.
276
4fb48515 2772015-10-13 Mikhail Maltsev <maltsevm@gmail.com>
278
279 * system.h (CHECKING_P, gcc_checking_assert): Define.
280
3cff347a 2812015-09-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
282
283 PR c/66415
284 * line-map.c (linemap_position_for_loc_and_offset): Handle the
285 case of long lines encoded in multiple maps.
286
8df4088d 2872015-09-07 Marek Polacek <polacek@redhat.com>
288
289 * system.h (INTTYPE_MINIMUM): Rewrite to avoid shift warning.
290
29890f2e 2912015-08-06 Yaakov Selkowitz <yselkowi@redhat.com>
292
293 * configure: Regenerate.
294
a5ea4da3 2952015-07-08 Thomas Schwinge <thomas@codesourcery.com>
296
297 * include/line-map.h (RESERVED_LOCATION_COUNT): Change type to
298 source_location.
299
880e4baa 3002015-07-02 Paolo Carlini <paolo.carlini@oracle.com>
301
7c35064e 302 PR preprocessor/53690
880e4baa 303 * charset.c (_cpp_valid_ucn): Add cppchar_t * parameter and change
304 return type to bool. Fix encoding of \u0000 and \U00000000 in C++.
305 (convert_ucn): Adjust call.
306 * lex.c (forms_identifier_p): Likewise.
307 * internal.h (_cpp_valid_ucn): Adjust declaration.
308
30b1ba42 3092015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
310
311 Implement N4197 - Adding u8 character literals
312 * include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens;
313 (struct cpp_options): Add utf8_char_literals.
314 * init.c (struct lang_flags): Add utf8_char_literals;
315 (struct lang_flags lang_defaults): Add column for utf8_char_literals.
880e4baa 316 * macro.c (stringify_arg()): Treat CPP_UTF8CHAR token;
30b1ba42 317 * expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()):
318 Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens;
319 (cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token;
320 (eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token.
321 * lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens.
322 * charset.c (converter_for_type(), cpp_interpret_charconst()):
323 Treat CPP_UTF8CHAR token.
324
5ac78bd3 3252015-06-30 Uros Bizjak <ubizjak@gmail.com>
326
327 * lex.c (search_line_sse42) [__GCC_ASM_FLAG_OUTPUTS__]: New main
328 loop using asm flag outputs.
329
6e84ccad 3302015-06-08 Marek Polacek <polacek@redhat.com>
331
332 PR c/66415
333 * line-map.c (linemap_position_for_loc_and_offset): Remove
334 linemap_assert_fails; reverse conditions.
335
0d344d27 3362015-05-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
337
338 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER
339 LINE_MAP_MAX_LOCATION_WITH_COLS,LINE_MAP_MAX_SOURCE_LOCATION):
340 New constants.
341 (linemap_line_start): Use them.
342 (linemap_position_for_column): Use them.
343
3ce1a212 3442015-05-20 David Malcolm <dmalcolm@redhat.com>
345
346 * include/line-map.h (MAP_START_LOCATION): Eliminate the non-const
347 variant, and tweak comment for the const variant.
348 (ORDINARY_MAP_STARTING_LINE_NUMBER): Drop the non-const variant.
349 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
350 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
351 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
352 (ORDINARY_MAP_FILE_NAME): Drop the non-const variant.
353 (MACRO_MAP_MACRO): Likewise.
354 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
355 (MACRO_MAP_LOCATIONS): Likewise.
356 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
357 * line-map.c (linemap_add): Replace writes through macros with
358 direct field accesses.
359 (linemap_enter_macro): Likewise.
360 (linemap_line_start): Likewise.
361
551e34da 3622015-05-19 David Malcolm <dmalcolm@redhat.com>
363
364 * directives.c (do_line): Strengthen local "map" from
365 const line_map * to const line_map_ordinary *.
366 (do_linemarker): Likewise.
367 (_cpp_do_file_change): Assert that we're not dealing with
368 a macro map. Introduce local "ord_map" via a call to
369 linemap_check_ordinary, guarded within the check for
370 non-NULL. Use it for typesafety.
371 * files.c (cpp_make_system_header): Strengthen local "map" from
372 const line_map * to const line_map_ordinary *.
373 * include/cpplib.h (struct cpp_callbacks): Likewise for second
374 parameter of "file_change" callback.
375 * include/line-map.h (struct line_map): Convert from a struct
376 containing a union to a base class.
377 (struct line_map_ordinary): Convert to a subclass of line_map.
378 (struct line_map_macro): Likewise.
379 (linemap_check_ordinary): Strengthen return type from line_map *
380 to line_map_ordinary *, and add a const-variant.
381 (linemap_check_macro): New pair of functions.
382 (ORDINARY_MAP_STARTING_LINE_NUMBER): Strengthen param from
383 const line_map * to const line_map_ordinary *, eliminating call
384 to linemap_check_ordinary. Likewise for the non-const variant.
385 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
386 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
387 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Likewise.
388 (ORDINARY_MAP_FILE_NAME): Likewise.
389 (MACRO_MAP_MACRO): Strengthen param from const line_map * to
390 const line_map_macro *. Likewise for the non-const variant.
391 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
392 (MACRO_MAP_LOCATIONS): Likewise.
393 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
394 (struct maps_info): Replace with...
395 (struct maps_info_ordinary):...this and...
396 (struct maps_info_macro): ...this.
397 (struct line_maps): Convert fields "info_ordinary" and
398 "info_macro" to the above new structs.
399 (LINEMAPS_MAP_INFO): Delete both functions.
400 (LINEMAPS_MAPS): Likewise.
401 (LINEMAPS_ALLOCATED): Rewrite both variants to avoid using
402 LINEMAPS_MAP_INFO.
403 (LINEMAPS_USED): Likewise.
404 (LINEMAPS_CACHE): Likewise.
405 (LINEMAPS_MAP_AT): Likewise.
406 (LINEMAPS_ORDINARY_MAPS): Strengthen return type from line_map *
407 to line_map_ordinary *.
408 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
409 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
410 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
411 (LINEMAPS_MACRO_MAPS): Strengthen return type from line_map * to
412 line_map_macro *.
413 (LINEMAPS_MACRO_MAP_AT): Likewise.
414 (LINEMAPS_LAST_MACRO_MAP): Likewise.
415 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
416 (linemap_map_get_macro_name): Strengthen param from
417 const line_map * to const line_map_macro *.
418 (SOURCE_LINE): Strengthen first param from const line_map * to
419 const line_map_ordinary *, removing call to
420 linemap_check_ordinary.
421 (SOURCE_COLUMN): Likewise.
422 (LAST_SOURCE_LINE_LOCATION): Likewise.
423 (LAST_SOURCE_LINE): Strengthen first param from const line_map *
424 to const line_map_ordinary *.
425 (LAST_SOURCE_COLUMN): Likewise.
426 (INCLUDED_FROM): Strengthen return type from line_map * to
427 line_map_ordinary *., and second param from const line_map *
428 to const line_map_ordinary *, removing call to
429 linemap_check_ordinary.
430 (MAIN_FILE_P): Strengthen param from const line_map * to
431 const line_map_ordinary *, removing call to
432 linemap_check_ordinary.
433 (linemap_position_for_line_and_column): Strengthen param from
434 const line_map * to const line_map_ordinary *.
435 (LINEMAP_FILE): Strengthen param from const line_map * to
436 const line_map_ordinary *, removing call to
437 linemap_check_ordinary.
438 (LINEMAP_LINE): Likewise.
439 (LINEMAP_SYSP): Likewise.
440 (linemap_resolve_location): Strengthen final param from
441 const line_map ** to const line_map_ordinary **.
442 * internal.h (CPP_INCREMENT_LINE): Likewise for local "map".
443 (linemap_enter_macro): Strengthen return type from
444 const line_map * to const line_map_macro *.
445 (linemap_add_macro_token): Likewise for first param.
446 * line-map.c (linemap_check_files_exited): Strengthen local "map"
447 from const line_map * to const line_map_ordinary *.
448 (new_linemap): Introduce local "map_size" and use it when
449 calculating how large the buffer should be. Rewrite based
450 on change of info_macro and info_ordinary into distinct types.
451 (linemap_add): Strengthen locals "map" and "from" from line_map *
452 to line_map_ordinary *.
453 (linemap_enter_macro): Strengthen return type from
454 const line_map * to const line_map_macro *, and local "map" from
455 line_map * to line_map_macro *.
456 (linemap_add_macro_token): Strengthen param "map" from
457 const line_map * to const line_map_macro *.
458 (linemap_line_start): Strengthen local "map" from line_map * to
459 line_map_ordinary *.
460 (linemap_position_for_column): Likewise.
461 (linemap_position_for_line_and_column): Strengthen first param
462 from const line_map * to const line_map_ordinary *.
463 (linemap_position_for_loc_and_offset): Strengthen local "map" from
464 const line_map * to const line_map_ordinary *.
465 (linemap_ordinary_map_lookup): Likewise for return type and locals
466 "cached" and "result".
467 (linemap_macro_map_lookup): Strengthen return type and locals
468 "cached" and "result" from const line_map * to
469 const line_map_macro *.
470 (linemap_macro_map_loc_to_exp_point): Likewise for param "map".
471 (linemap_macro_map_loc_to_def_point): Likewise.
472 (linemap_macro_map_loc_unwind_toward_spelling): Likewise.
473 (linemap_get_expansion_line): Strengthen local "map" from
474 const line_map * to const line_map_ordinary *.
475 (linemap_get_expansion_filename): Likewise.
476 (linemap_map_get_macro_name): Strengthen param from
477 const line_map * to const line_map_macro *.
478 (linemap_location_in_system_header_p): Add call to
479 linemap_check_ordinary in region guarded by
480 !linemap_macro_expansion_map_p. Introduce local "macro_map" via
481 linemap_check_macro in other region, using it in place of "map"
482 for typesafety.
483 (first_map_in_common_1): Add calls to linemap_check_macro.
484 (trace_include): Strengthen param "map" from const line_map * to
485 const line_map_ordinary *.
486 (linemap_macro_loc_to_spelling_point): Strengthen final param from
487 const line_map ** to const line_map_ordinary **. Replace a
488 C-style cast with a const_cast, and add calls to
489 linemap_check_macro and linemap_check_ordinary.
490 (linemap_macro_loc_to_def_point): Likewise.
491 (linemap_macro_loc_to_exp_point): Likewise.
492 (linemap_resolve_location): Strengthen final param from
493 const line_map ** to const line_map_ordinary **.
494 (linemap_unwind_toward_expansion): Introduce local "macro_map" via
495 a checked cast and use it in place of *map.
496 (linemap_unwind_to_first_non_reserved_loc): Strengthen local
497 "map1" from const line_map * to const line_map_ordinary *.
498 (linemap_expand_location): Introduce local "ord_map" via a checked
499 cast and use it in place of map.
500 (linemap_dump): Make local "map" const. Strengthen local
501 "includer_map" from line_map * to const line_map_ordinary *.
502 Introduce locals "ord_map" and "macro_map" via checked casts and
503 use them in place of "map" for typesafety.
504 (linemap_dump_location): Strengthen local "map" from
505 const line_map * to const line_map_ordinary *.
506 (linemap_get_file_highest_location): Update for elimination of
507 union.
508 (linemap_get_statistics): Strengthen local "cur_map" from
509 line_map * to const line_map_macro *. Update uses of sizeof to
510 use the appropriate line_map subclasses.
511 * macro.c (_cpp_warn_if_unused_macro): Add call to
512 linemap_check_ordinary.
513 (builtin_macro): Strengthen local "map" from const line_map * to
514 const line_map_macro *.
515 (enter_macro_context): Likewise.
516 (replace_args): Likewise.
517 (tokens_buff_put_token_to): Likewise for param "map".
518 (tokens_buff_add_token): Likewise.
519
28f17529 5202015-05-13 David Malcolm <dmalcolm@redhat.com>
521
522 * include/line-map.h (source_location): Add a reference to
523 location-example.txt to the descriptive comment.
524 * location-example.txt: New file.
525
aa041196 5262015-05-13 David Malcolm <dmalcolm@redhat.com>
527
528 * include/line-map.h (MAX_SOURCE_LOCATION): Convert from a macro
529 to a const source_location.
530 (RESERVED_LOCATION_COUNT): Likewise.
531 (linemap_check_ordinary): Convert from a macro to a pair of inline
532 functions, for const/non-const arguments.
533 (MAP_START_LOCATION): Likewise.
534 (ORDINARY_MAP_STARTING_LINE_NUMBER): Likewise.
535 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
536 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
537 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Convert from a macro to a
538 pair of inline functions, for const/non-const arguments, where the
539 latter is named...
540 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): New function.
541 (ORDINARY_MAP_FILE_NAME): Convert from a macro to a pair of inline
542 functions, for const/non-const arguments.
543 (MACRO_MAP_MACRO): Likewise.
544 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
545 (MACRO_MAP_LOCATIONS): Likewise.
546 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
547 (LINEMAPS_MAP_INFO): Likewise.
548 (LINEMAPS_MAPS): Likewise.
549 (LINEMAPS_ALLOCATED): Likewise.
550 (LINEMAPS_USED): Likewise.
551 (LINEMAPS_CACHE): Likewise.
552 (LINEMAPS_ORDINARY_CACHE): Likewise.
553 (LINEMAPS_MACRO_CACHE): Likewise.
554 (LINEMAPS_MAP_AT): Convert from a macro to an inline function.
555 (LINEMAPS_LAST_MAP): Likewise.
556 (LINEMAPS_LAST_ALLOCATED_MAP): Likewise.
557 (LINEMAPS_ORDINARY_MAPS): Likewise.
558 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
559 (LINEMAPS_ORDINARY_ALLOCATED): Likewise.
560 (LINEMAPS_ORDINARY_USED): Likewise.
561 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
562 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
563 (LINEMAPS_MACRO_MAPS): Likewise.
564 (LINEMAPS_MACRO_MAP_AT): Likewise.
565 (LINEMAPS_MACRO_ALLOCATED): Likewise.
566 (LINEMAPS_MACRO_USED): Likewise.
567 (LINEMAPS_MACRO_LOWEST_LOCATION): Likewise.
568 (LINEMAPS_LAST_MACRO_MAP): Likewise.
569 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
570 (IS_ADHOC_LOC): Likewise.
571 (COMBINE_LOCATION_DATA): Likewise.
572 (SOURCE_LINE): Likewise.
573 (SOURCE_COLUMN): Likewise.
574 (LAST_SOURCE_LINE_LOCATION): Likewise.
575 (LAST_SOURCE_LINE): Likewise.
576 (LAST_SOURCE_COLUMN): Likewise.
577 (LAST_SOURCE_LINE_LOCATION)
578 (INCLUDED_FROM): Likewise.
579 (MAIN_FILE_P): Likewise.
580 (LINEMAP_FILE): Likewise.
581 (LINEMAP_LINE): Likewise.
582 (LINEMAP_SYSP): Likewise.
583 (linemap_location_before_p): Likewise.
584 * line-map.c (linemap_check_files_exited): Make local "map" const.
585 (linemap_add): Use SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS.
586 (linemap_line_start): Likewise.
587
1a20ca67 5882015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
589
590 * aclocal.m4: Regenerated with automake-1.11.6.
591
c43181ff 5922015-05-13 David Malcolm <dmalcolm@redhat.com>
593
594 * include/line-map.h (linemap_assert): Move up within the file to
595 before all of the map accessor macros.
596 (linemap_assert_fails): Likewise.
597 (linemap_check_ordinary): Likewise.
598 (linemap_macro_expansion_map_p): Likewise.
599
e5f01cba 6002015-05-12 David Malcolm <dmalcolm@redhat.com>
601
602 * directives.c (do_line): Set seen_line_directive on line_table.
603 (do_linemarker): Likewise.
604 * include/line-map.h (struct line_maps): Add new field
605 "seen_line_directive".
606
1b03cc89 6072015-05-08 Jason Merrill <jason@redhat.com>
608
609 * include/cpplib.h: Add CPP_W_CXX11_COMPAT.
610 (struct cpp_options): Add cpp_warn_cxx11_compat.
611 * init.c (cpp_create_reader): Initialize it.
612 * lex.c (lex_string): Add -Wc++11-compat warning.
613
5c6f6a61 6142015-05-05 David Malcolm <dmalcolm@redhat.com>
615
616 * pch.c (cpp_valid_state): Fix indentation so that it reflects the
617 block structure.
618
78536ab7 6192015-05-05 David Malcolm <dmalcolm@redhat.com>
620
621 * include/line-map.h: Fix comment at the top of the file.
622 (source_location): Rewrite and expand the comment for this
623 typedef, adding an ascii-art table to clarify how source_location
624 values are allocated.
625 * line-map.c: Fix comment at the top of the file.
626
2c8df1f3 6272015-04-09 Richard Biener <rguenther@suse.de>
628
629 PR pch/65550
630 * files.c (pch_open_file): Allow main and pre-included files
631 when trying to open a PCH.
632
a0b98841 6332015-04-06 Jakub Jelinek <jakub@redhat.com>
634
635 PR preprocessor/61977
636 * lex.c (cpp_peek_token): If peektok is CPP_EOF, back it up
637 with all tokens peeked by the current function.
638
2b130ae8 6392015-04-02 Jakub Jelinek <jakub@redhat.com>
640
641 PR preprocessor/61977
642 * lex.c (cpp_peek_token): Temporarily clear pfile->cb.line_change.
643
640a5806 6442015-03-23 Jakub Jelinek <jakub@redhat.com>
645
646 PR preprocessor/65238
647 * internal.h (_cpp_scan_out_logical_line): Add third argument.
648 * directives.c (prepare_directive_trad): Pass false to it.
649 * traditional.c (_cpp_read_logical_line_trad,
650 _cpp_create_trad_definition): Likewise.
651 (struct fun_macro): Add paramc field.
652 (fun_like_macro): New function.
653 (maybe_start_funlike): Handle NODE_BUILTIN macros. Initialize
654 macro->paramc field.
655 (save_argument): Use macro->paramc instead of
656 macro->node->value.macro->paramc.
657 (push_replacement_text): Formatting fix.
658 (recursive_macro): Use fun_like_macro helper.
659 (_cpp_scan_out_logical_line): Likewise. Add BUILTIN_MACRO_ARG
660 argument. Initialize fmacro.paramc field. Handle builtin
661 function-like macros.
662
fc753aa0 6632015-03-16 Edward Smith-Rowland <3dw4rd@verizon.net>
664
665 PR c++/64626
666 * lex.c (lex_number): If a number ends with digit-seps (') skip back
667 and let lex_string take them.
668
45e87ca9 6692015-03-02 Markus Trippelsdorf <markus@trippelsdorf.de>
670
671 PR target/65261
672 * lex.c (search_line_fast): Silence ubsan errors.
673
825751e2 6742015-02-03 <dodji@redhat.com>
675
676 PR preprocessor/64803
677 * internal.h (cpp_reader::top_most_macro_node): New data member.
678 * macro.c (enter_macro_context): Pass the location of the end of
679 the top-most invocation of the function-like macro, or the
680 location of the expansion point of the top-most object-like macro.
681 (cpp_get_token_1): Store the top-most macro node in the new
682 pfile->top_most_macro_node data member.
683 (_cpp_pop_context): Clear the new cpp_reader::top_most_macro_node
684 data member.
685
c1a66267 6862015-01-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
687
688 * lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON.
689
6ca4fe46 6902015-01-23 Marek Polacek <polacek@redhat.com>
691
692 DR#412
693 PR preprocessor/60570
694 * directives.c (do_elif): Don't evaluate #elif conditionals
695 when they don't need to be.
696
e2de5ff7 6972015-01-16 Jakub Jelinek <jakub@redhat.com>
698
699 * expr.c (cpp_classify_number): Add N_() around ?: string
700 literals used in cpp_error_with_line call as format string.
701
d353bf18 7022015-01-05 Jakub Jelinek <jakub@redhat.com>
703
704 Update copyright years.
705
33058239 7062014-12-19 Jakub Jelinek <jakub@redhat.com>
707
708 PR preprocessor/63831
709 * directives.c (lex_macro_node): Remove __has_attribute__ handling.
710 * internal.h (struct spec_node): Remove n__has_attribute__ field.
711 (struct lexer_state): Remove in__has_attribute__ field.
712 * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_ATTRIBUTE.
713 * identifiers.c (_cpp_init_hashtable): Remove __has_attribute__
714 handling.
715 * init.c (builtin_array): Add __has_attribute and __has_cpp_attribute.
716 (cpp_init_special_builtins): Don't initialize __has_attribute
717 or __has_cpp_attribute if CLK_ASM or pfile->cb.has_attribute is NULL.
718 * traditional.c (enum ls): Remove ls_has_attribute,
719 ls_has_attribute_close.
720 (_cpp_scan_out_logical_line): Remove __has_attribute__ handling.
721 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_ATTRIBUTE.
722 * pch.c (cpp_read_state): Remove __has_attribute__ handling.
723 * expr.c (eval_token): Likewise.
724 (parse_has_attribute): Removed.
725
5d95297a 7262014-12-11 Uros Bizjak <ubizjak@gmail.com>
727
728 * directives.c (cpp_define_formatted): Use xvasprintf.
729
6d6bdc28 7302014-12-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
731
732 * line-map.c (linemap_position_for_loc_and_offset): Add new
733 linemap_assert_fails.
734
324da92d 7352014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
736
737 * include/line-map.h (linemap_assert_fails): Declare.
738 * line-map.c (linemap_position_for_loc_and_offset): Use it.
739
351855a5 7402014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
741
71e4c29d 742 * line-map.c (linemap_add): Fix typo.
743 (linemap_line_start): Fix whitespace.
351855a5 744
e6260d89 7452014-11-29 John Schmerge <jbschmerge@gmail.com>
746
747 PR preprocessor/41698
748 * charset.c (one_utf8_to_utf16): Do not produce surrogate pairs
749 for 0xffff.
750
1feb1b2d 7512014-11-25 Jakub Jelinek <jakub@redhat.com>
752
753 PR preprocessor/60436
754 * line-map.c (linemap_line_start): If highest is above 0x60000000
755 and we are still tracking columns or highest is above 0x70000000,
756 force add_map.
757
024db613 7582014-11-20 Uros Bizjak <ubizjak@gmail.com>
759
760 PR target/63966
c3e56f20 761 * lex.c [__i386__ || __x86_64__]: Compile special SSE functions
762 only for (__GNUC__ >= 5 || !defined(__PIC__)).
024db613 763
36a4e8f0 7642014-11-13 Manuel López-Ibáñez <manu@gcc.gnu.org>
765
766 * include/line-map.h: Include EXPR, so that unused variable warnings
767 do not occur.
768
766928aa 7692014-11-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
770
771 PR fortran/44054
772 * include/line-map.h (linemap_position_for_loc_and_offset):
773 Declare.
774 * line-map.c (linemap_position_for_loc_and_offset): New.
775
863e76f9 7762014-11-11 David Malcolm <dmalcolm@redhat.com>
777
778 * ChangeLog.jit: New.
779
3aa2fa44 7802014-11-10 Edward Smith-Rowland <3dw4rd@verizon.net>
781
782 * include/cpplib.h (cpp_callbacks): Add has_attribute.
783 * internal.h (lexer_state): Add in__has_attribute__.
784 * directives.c (lex_macro_node): Prevent use of __has_attribute__
785 as a macro.
786 * expr.c (parse_has_attribute): New function; (eval_token): Look for
787 __has_attribute__ and route to parse_has_attribute.
788 * identifiers.c (_cpp_init_hashtable): Initialize n__has_attribute__.
789 * pch.c (cpp_read_state): Initialize n__has_attribute__.
790 * traditional.c (enum ls): Add ls_has_attribute, ls_has_attribute_close;
791 (_cpp_scan_out_logical_line): Attend to __has_attribute__.
792
109ca87a 7932014-11-06 Joseph Myers <joseph@codesourcery.com>
794
795 * include/cpp-id-data.h (struct cpp_macro): Update comment
796 regarding parameters.
797 * include/cpplib.h (struct cpp_macro_arg, struct cpp_identifier):
798 Add spelling fields.
799 (struct cpp_token): Update comment on macro_arg.
800 * internal.h (_cpp_save_parameter): Add extra argument.
801 (_cpp_spell_ident_ucns): New declaration.
802 * lex.c (lex_identifier): Add SPELLING argument. Set *SPELLING to
803 original spelling of identifier.
804 (_cpp_lex_direct): Update calls to lex_identifier.
805 (_cpp_spell_ident_ucns): New function, factored out of
806 cpp_spell_token.
807 (cpp_spell_token): Adjust FORSTRING argument semantics to return
808 original spelling of identifiers. Use _cpp_spell_ident_ucns in
809 !FORSTRING case.
810 (_cpp_equiv_tokens): Check spellings of identifiers and macro
811 arguments are identical.
812 * macro.c (macro_arg_saved_data): New structure.
813 (paste_tokens): Use original spellings of identifiers from
814 cpp_spell_token.
815 (_cpp_save_parameter): Add argument SPELLING. Save both canonical
816 node and its value.
817 (parse_params): Update calls to _cpp_save_parameter.
818 (lex_expansion_token): Save spelling of macro argument tokens.
819 (_cpp_create_definition): Extract canonical node from saved data.
820 (cpp_macro_definition): Use UCNs in spelling of macro name. Use
821 original spellings of macro argument tokens and identifiers.
822 * traditional.c (scan_parameters): Update call to
823 _cpp_save_parameter.
824
95795723 8252014-11-05 Joseph Myers <joseph@codesourcery.com>
826
827 PR preprocessor/9449
828 * init.c (lang_defaults): Enable extended identifiers for C++ and
829 C99-based standards.
830
cc0a8c77 8312014-10-22 Alan Modra <amodra@gmail.com>
832
833 * symtab.c (ht_create): Use obstack_specify_allocation in place of
834 _obstack_begin.
835 * files.c (_cpp_init_files): Likewise.
836 * init.c (cpp_create_reader): Likewise.
837 * identifiers.c (_cpp_init_hashtable): Likewise.
838
1fcf9669 8392014-10-14 Manuel López-Ibáñez <manu@gcc.gnu.org>
840
841 * include/line-map.h (linemap_location_from_macro_expansion_p):
842 const struct line_maps * argument.
843 (linemap_position_for_line_and_column): const struct line_map *
844 argument.
845 * line-map.c (linemap_add_macro_token): Use correct argument name
846 in comment.
847 (linemap_position_for_line_and_column): const struct line_map *
848 argument.
849 (linemap_macro_map_loc_to_def_point): Fix comment. Make static.
850 (linemap_location_from_macro_expansion_p): const struct line_maps *
851 argument.
852 (linemap_resolve_location): Fix argument names in comment.
853
e347736d 8542014-10-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
855
856 * lex.c (search_line_fast): Add new version to be used for Power8
857 and later targets when Altivec is enabled. Restrict the existing
858 Altivec version to big-endian systems so that lvsr is not used on
859 little endian, where it is deprecated. Remove LE-specific code
860 from the now-BE-only version.
861
3f21cd58 8622014-10-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
863 Jeff Law <law@redhat.com>
864
865 * charset.c (convert_no_conversion): Reallocate memory with 25%
866 headroom.
867
f6751ff2 8682014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net>
869
870 Implement SD-6: SG10 Feature Test Recommendations
871 * internal.h (lexer_state, spec_nodes): Add in__has_include__.
872 * directives.c: Support __has_include__ builtin.
873 * expr.c (parse_has_include): New function to parse __has_include__
874 builtin; (eval_token()): Use it.
875 * files.c (_cpp_has_header()): New funtion to look for header;
876 (open_file_failed()): Not an error to not find a header file for
877 __has_include__.
878 * identifiers.c (_cpp_init_hashtable()): Add entry for __has_include__.
879 * pch.c (cpp_read_state): Lookup __has_include__.
880 * traditional.c (enum ls, _cpp_scan_out_logical_line()): Walk through
881 __has_include__ statements.
882
2cb897aa 8832014-09-30 Bernd Edlinger <bernd.edlinger@hotmail.de>
884
885 PR preprocessor/58893
886 * errors.c (cpp_diagnostic): Fix possible out of bounds access.
887 * files.c (_cpp_stack_include): Initialize src_loc for IT_CMDLINE.
888
5213d6c9 8892014-09-24 Marek Polacek <polacek@redhat.com>
890
891 PR c/61405
892 PR c/53874
893 * include/cpplib.h (enum cpp_ttype): Define CPP_KEYWORD.
894
47d6df07 8952014-09-17 Jan Hubicka <hubicka@ucw.cz>
896
897 * charset.c (conversion): Rename to ...
898 (cpp_conversion): ... this one; update.
899 * files.c (file_hash_entry): Rename to ...
900 (cpp_file_hash_entry): ... this one ; update.
901
118b2dc7 9022014-09-17 Marek Polacek <polacek@redhat.com>
903
904 PR c/61854
905 * init.c (struct lang_flags): Remove cplusplus_comments.
906 (cpp_set_lang): Likewise.
907 (post_options): Likewise.
908 * lex.c (_cpp_lex_direct): Disallow C++ style comments in C90/C94.
909
bcc1f37e 9102014-09-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
911
912 * include/cpplib.h (struct cpp_options): Declare warn_normalize as
913 int instead of enum.
914
04afd878 9152014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
916
917 * macro.c (replace_args): Use cpp_pedwarning, cpp_warning and
918 CPP_W flags.
919 * include/cpplib.h: Add CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC.
920 * init.c (cpp_create_reader): Do not init to -1 here.
921 * expr.c (num_binary_op): Use cpp_pedwarning.
922
f0fbe519 9232014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
924
925 * directives.c (check_eol_1): New.
926 (check_eol_endif_labels): New.
927 (check_eol): Call check_eol_1.
928 (do_else,do_endif): Call check_eol_endif_labels.
929
a7d2e480 9302014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
931
932 * macro.c (warn_of_redefinition): Suppress warnings for builtins
933 that lack the NODE_WARN flag, unless Wbuiltin-macro-redefined.
934 (_cpp_create_definition): Use Wbuiltin-macro-redefined for
935 builtins that lack the NODE_WARN flag.
936 * directives.c (do_undef): Likewise.
937 * init.c (cpp_init_special_builtins): Do not change flags
938 depending on Wbuiltin-macro-redefined.
939
2ab4e475 9402014-08-28 Edward Smith-Rowland <3dw4rd@verizon.net>
941
942 PR cpp/23827 - standard C++ should not have hex float preprocessor
943 tokens
944 * libcpp/init.c (lang_flags): Change CXX98 flag for extended numbers
945 from 1 to 0.
946 * libcpp/expr.c (cpp_classify_number): Weite error message for improper
947 use of hex floating literal.
948
4e454776 9492014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
950
951 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z;
952 Rename CLK_GNUCXX1Y, CLK_CXX1Y to CLK_GNUCXX14, CLK_CXX14;
953 * init.c (struct lang_flags lang_defaults): Add column for trigraphs;
954 Add rows for CLK_GNUCXX1Z, CLK_CXX1Z; (cpp_set_lang): Set trigraphs;
955 (cpp_init_builtins): Set __cplusplus to 201402L for C++14;
956 Set __cplusplus to 201500L for C++17.
957 * expr.c (cpp_classify_number): Change C++1y to C++14 in binary
958 constants error message.
959
4c860a45 9602014-08-20 Marek Polacek <polacek@redhat.com>
961
962 * include/cpplib.h (cpp_options): Use signed char.
963 * lex.c (_cpp_lex_direct): Don't warn in C++ mode.
964
d87a26d9 9652014-08-19 Marek Polacek <polacek@redhat.com>
966
967 * lex.c (_cpp_lex_direct): Fix a typo.
968
806fe15e 9692014-08-19 Marek Polacek <polacek@redhat.com>
970
971 * charset.c (_cpp_valid_ucn): Warn only if -Wc90-c99-compat.
972 * lex.c (_cpp_lex_direct): Likewise.
973 * macro.c (replace_args): Likewise.
974 (parse_params): Likewise.
975 * include/cpplib.h (cpp_options): Change cpp_warn_c90_c99_compat
976 to char.
977
890c2e2f 9782014-08-10 Marek Polacek <polacek@redhat.com>
979
980 PR c/51849
981 * lex.c (_cpp_lex_direct): Warn when -Wc90-c99-compat is in effect.
982 * charset.c (_cpp_valid_ucn): Likewise.
983 * include/cpplib.h (cpp_options): Add cpp_warn_c90_c99_compat.
984 * macro.c (replace_args): Warn when -Wc90-c99-compat is in effect.
985 (parse_params): Likewise.
986
2e82cf2c 9872014-07-27 Marek Polacek <polacek@redhat.com>
988
989 PR c/61861
990 * macro.c (builtin_macro): Add location parameter. Set
991 location of builtin macro to the expansion point.
992 (enter_macro_context): Pass location to builtin_macro.
993
a4cfdfed 9942014-07-16 Dodji Seketeli <dodji@redhat.com>
995
996 Support location tracking for built-in macro tokens
997 * include/line-map.h (line_maps::builtin_location): New data
998 member.
999 (line_map_init): Add a new parameter to initialize the new
1000 line_maps::builtin_location data member.
1001 * line-map.c (linemap_init): Initialize the
1002 line_maps::builtin_location data member.
1003 * macro.c (builtin_macro): Create a macro map and track the token
1004 resulting from the expansion of a built-in macro.
1005
49f161b6 10062014-07-10 Edward Smith-Rowland <3dw4rd@verizon.net>
1007 Jonathan Wakely <jwakely@redhat.com>
1008
b5905560 1009 PR preprocessor/61389
49f161b6 1010 * macro.c (_cpp_arguments_ok, parse_params, create_iso_definition):
1011 Warning messages mention C++11 in c++ mode and C99 in c mode.
1012 * lex.c (lex_identifier_intern, lex_identifier): Ditto
1013
8947e5dc 10142014-07-09 Edward Smith-Rowland <3dw4rd@verizon.net>
1015
1016 PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped
1017 by preprocessor
1018 * lex.c (lex_raw_string ()): Do not warn about invalid suffix
1019 if skipping. (lex_string ()): Ditto.
1020
649bbfc4 10212014-06-04 Edward Smith-Rowland <3dw4rd@verizon.net>
1022
1023 PR c++/61038
1024 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
1025 Combine user-defined escape logic with the other string and char logic.
1026
1c8ad86a 10272014-05-26 Richard Biener <rguenther@suse.de>
1028
1029 * configure.ac: Remove long long and __int64 type checks,
1030 add check for uint64_t and fail if that wasn't found.
1031 * include/cpplib.h (cpp_num_part): Use uint64_t.
1032 * config.in: Regenerate.
1033 * configure: Likewise.
1034
0ac81b0e 10352014-05-21 Marek Polacek <polacek@redhat.com>
1036
1037 PR c/61212
1038 * files.c (find_file_in_dir): Add parens around &&.
1039
df271348 10402014-05-20 Edward Smith-Rowland <3dw4rd@verizon.net>
1041
0ac81b0e 1042 PR c++/61038
df271348 1043 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
1044 Check for user-defined literal strings and user-defined literal chars
1045 to escape necessary characters.
1046
a3034794 10472014-05-20 Richard Biener <rguenther@suse.de>
1048
1049 * configure.ac: Copy gcc logic of detecting a 64bit type.
1050 Remove HOST_WIDE_INT define.
1051 * include/cpplib.h: typedef cpp_num_part to a 64bit type,
1052 similar to how hwint.h does it.
1053 * config.in: Regenerate.
1054 * configure: Likewise.
1055
1c9b820a 10562014-05-09 Joey Ye <joey.ye@arm.com>
1057
1058 * files.c (find_file_in_dir): Always try to shorten for DOS
1059 non-system headers.
1060 * init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS.
1061
da3c842e 10622014-05-07 Richard Biener <rguenther@suse.de>
1063
1064 * configure.ac: Always set need_64bit_hwint to yes.
1065 * configure: Regenerated.
1066
3efb5d22 10672014-04-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1068
1069 * lex.c: Remove Solaris 9 reference.
1070
2da35515 10712014-02-24 Walter Lee <walt@tilera.com>
1072
1073 * configure.ac: Change "tilepro" triplet to "tilepro*".
1074 * configure: Regenerate.
1075
9b48364f 10762014-02-19 Jakub Jelinek <jakub@redhat.com>
1077
1078 PR preprocessor/58844
1079 * macro.c (enter_macro_context): Only push
1080 macro_real_token_count (macro) tokens rather than
1081 macro->count tokens, regardless of
1082 CPP_OPTION (pfile, track-macro-expansion).
1083
6e5a7913 10842014-02-07 Jakub Jelinek <jakub@redhat.com>
1085
1086 PR preprocessor/56824
1087 * line-map.c (get_combined_adhoc_loc, linemap_get_expansion_line,
1088 linemap_get_expansion_filename, linemap_location_in_system_header_p,
1089 linemap_location_from_macro_expansion_p,
1090 linemap_macro_loc_to_spelling_point, linemap_macro_loc_to_def_point,
1091 linemap_macro_loc_to_exp_point, linemap_expand_location): Fix
1092 formatting.
1093 (linemap_compare_locations): Look through adhoc locations for both
1094 l0 and l1.
1095
ffc2c526 10962014-01-23 Dodji Seketeli <dodji@redhat.com>
1097
1098 PR PR preprocessor/58580
1099 * include/line-map.h (linemap_get_file_highest_location): Declare
1100 new function.
1101 * line-map.c (linemap_get_file_highest_location): Define it.
1102
806a3d45 11032014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
1104
1105 Update copyright years
1106
e7d8908f 11072013-12-09 Joseph Myers <joseph@codesourcery.com>
1108
1109 PR preprocessor/55715
1110 * expr.c (num_binary_op): Implement subtraction directly rather
1111 than with negation and falling through into addition case.
1112
eb992054 11132013-11-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
1114
1115 * lex.c (search_line_fast): Correct for little endian.
1116
460f52aa 11172013-11-15 Joseph Myers <joseph@codesourcery.com>
1118
1119 * ucnid.tab: Add C11 and C11NOSTART data.
1120 * makeucnid.c (digit): Rename enum value to N99.
1121 (C11, N11, all_languages): New enum values.
1122 (NUM_CODE_POINTS, MAX_CODE_POINT): New macros.
1123 (flags, decomp, combining_value): Use NUM_CODE_POINTS as array
1124 size.
1125 (decomp): Use unsigned int as element type.
1126 (all_decomp): New array.
1127 (read_ucnid): Handle C11 and C11NOSTART. Use MAX_CODE_POINT.
1128 (read_table): Use MAX_CODE_POINT. Store all decompositions in
1129 all_decomp.
1130 (read_derived): Use MAX_CODE_POINT.
1131 (write_table): Use NUM_CODE_POINTS. Print N99, C11 and N11
1132 flags. Print whole array variable declaration rather than just
1133 array contents.
1134 (char_id_valid, write_context_switch): New functions.
1135 (main): Call write_context_switch.
1136 * ucnid.h: Regenerate.
1137 * include/cpplib.h (struct cpp_options): Add c11_identifiers.
1138 * init.c (struct lang_flags): Add c11_identifiers.
1139 (cpp_set_lang): Set c11_identifiers option from selected language.
1140 * internal.h (struct normalize_state): Document "previous" as
1141 previous starter character.
1142 (NORMALIZE_STATE_UPDATE_IDNUM): Take character as argument.
1143 * charset.c (DIG): Rename enum value to N99.
1144 (C11, N11): New enum values.
1145 (struct ucnrange): Give name to struct. Use short for flags and
1146 unsigned int for end of range. Include ucnid.h for whole variable
1147 declaration.
1148 (ucn_valid_in_identifier): Allow for characters up to 0x10FFFF.
1149 Allow for C11 in determining valid characters and valid start
1150 characters. Use check_nfc for non-Hangul context-dependent
1151 checks. Only store starter characters in nst->previous.
1152 (_cpp_valid_ucn): Pass new argument to
1153 NORMALIZE_STATE_UPDATE_IDNUM.
1154 * lex.c (lex_identifier): Pass new argument to
1155 NORMALIZE_STATE_UPDATE_IDNUM. Call NORMALIZE_STATE_UPDATE_IDNUM
1156 after initial non-UCN part of identifier.
1157 (lex_number): Pass new argument to NORMALIZE_STATE_UPDATE_IDNUM.
1158
ceaeebbe 11592013-11-15 Joseph Myers <joseph@codesourcery.com>
1160
1161 * ucnid.tab: Mark C99 digits as [C99DIG].
1162 * makeucnid.c (read_ucnid): Handle [C99DIG].
1163 (read_table): Don't check for digit characters.
1164 * ucnid.h: Regenerate.
1165
5b1a0622 11662013-11-06 Tobias Burnus <burnus@net-b.de>
1167
1168 * macro.c (_cpp_builtin_macro_text): Correct
1169 wording of two warnings.
1170
9148bda3 11712013-11-05 Tobias Burnus <burnus@net-b.de>
1172
1173 * include/cpplib.h (CPP_W_DATE_TIME): Added.
1174 (cpp_options): Add warn_date_time.
1175 * init.c (cpp_create_reader): Init it.
1176 * macro.c (_cpp_builtin_macro_text): Warn when
1177 __DATE__/__TIME__/__TIMESTAMP__ is used.
1178
4d6f7dd4 11792013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
1180
9148bda3 1181 Implement C++14 digit separators.
4d6f7dd4 1182 * include/cpplib.h (cpp_options): Add digit_separators flag.
1183 * internal.h (DIGIT_SEP(c)): New macro.
1184 * expr.c (cpp_classify_number): Check improper placement of digit sep;
1185 (cpp_interpret_integer): Skip over digit separators.
1186 * init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add
1187 digit separator flags per language; (cpp_set_lang): Set
1188 digit_separators
1189 * lex.c (lex_number): Add digits separator to allowable characters for
1190 C++14.
1191
2bd17377 11922013-10-15 David Malcolm <dmalcolm@redhat.com>
1193
1194 * Makefile.in (PICFLAG): New.
1195 (ALL_CFLAGS): Add PICFLAG.
1196 (ALL_CXXFLAGS): Likewise.
1197 * configure.ac: Add --enable-host-shared, setting up new
1198 PICFLAG variable.
1199 * configure: Regenerate.
1200
97d17efa 12012013-08-07 Richard Earnshaw <rearnsha@arm.com>
1202
1203 * configure.ac: Set need_64bit_hwint for all arm targets.
1204 * configure: Regenerated.
1205
ffb840b4 12062013-07-20 Jakub Jelinek <jakub@redhat.com>
1207
1208 PR preprocessor/57620
1209 * lex.c (lex_raw_string): Undo phase1 and phase2 transformations
1210 between R" and final " rather than only in between R"del( and )del".
1211
bd285415 12122013-07-10 Jakub Jelinek <jakub@redhat.com>
1213
c7691e08 1214 PR preprocessor/57824
1215 * lex.c (lex_raw_string): Allow reading new-lines if
1216 in_deferred_pragma or if parsing_args and there is still
1217 data in the current buffer.
1218
da31536d 1219 * include/cpplib.h (cpp_token_val_index): Change parameter type to
1220 const cpp_token *.
1221 * lex.c (cpp_token_val_index): Likewise.
1222
bd285415 1223 PR preprocessor/57757
1224 * lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING
1225 or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that
1226 starts if a-zA-Z_.
1227
4e8832f3 12282013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
1229
1230 * lex.c (lex_raw_string(), lex_string()): Constrain suffixes treated
1231 as concatenated literal and macro to just the patterns found in
1232 inttypes.h; (is_macro()): New.
1233
5bd48b2e 12342013-06-24 Dehao Chen <dehao@google.com>
1235
1236 * files.c (_cpp_stack_include): Fix the highest_location when header
1237 file is guarded by #ifndef and is included twice.
1238
d8c8614f 12392013-04-28 Jakub Jelinek <jakub@redhat.com>
1240
1241 N3472 binary constants
1242 * include/cpplib.h (struct cpp_options): Fix a typo in user_literals
1243 field comment. Add binary_constants field.
1244 * init.c (struct lang_flags): Add binary_constants field.
1245 (lang_defaults): Add bin_cst column to the table.
1246 (cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants).
1247 * expr.c (cpp_classify_number): Talk about C++11 instead of C++0x
1248 in diagnostics. Accept binary constants if
1249 CPP_OPTION (pfile, binary_constants) even when pedantic. Adjust
1250 pedwarn message.
1251
1638c736 12522013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
1253
1254 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y.
1255 * init.c (lang_defaults): Add defaults for the latter.
1256 (cpp_init_builtins): Define __cplusplus as 201300L for the latter.
1257 * lex.c (_cpp_lex_direct): Update.
1258
0ca702f2 12592013-04-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
1260
1261 PR target/56771
1262 * configure.ac: Require 64-bit int for arm*-*-rtems*.
1263 * configure: Regenerate.
1264
914db4b7 12652013-03-06 Jakub Jelinek <jakub@redhat.com>
1266
1267 PR middle-end/56461
1268 * internal.h (struct cpp_buffer): Add to_free field.
1269 (_cpp_pop_file_buffer): Add third argument.
1270 * files.c (_cpp_stack_file): Set buffer->to_free.
1271 (_cpp_pop_file_buffer): Add to_free argument. Free to_free
1272 if non-NULL, and if equal to file->buffer_start, also clear
1273 file->buffer{,_start,_valid}.
1274 * directives.c (_cpp_pop_buffer): Pass buffer->to_free
1275 to _cpp_pop_file_buffer.
1276
39bcf299 12772013-03-01 Jakub Jelinek <jakub@redhat.com>
1278
1279 PR middle-end/56461
1280 * files.c (_cpp_save_file_entries): Free result at the end.
1281 * pch.c (cpp_string_free): New function.
1282 (cpp_save_state): Use it in htab_create call.
1283 (cpp_write_pch_deps): Free ss->defs. Destroy ss->definedhash.
1284
61ed1f10 12852013-02-28 Jakub Jelinek <jakub@redhat.com>
1286
cde9343a 1287 * files.c (_cpp_find_file): If returning early, before storing
1288 something to *hash_slot and *hash_slot is NULL, call htab_clear_slot
1289 on it. Access *hash_slot using void * type rather than
1290 struct file_hash_entry * to avoid aliasing issues.
1291
61ed1f10 1292 * configure.ac: Don't define ENABLE_CHECKING whenever
1293 --enable-checking is seen, instead use similar --enable-checking=yes
1294 vs. --enable-checking=release default as gcc/ subdir has and
1295 define ENABLE_CHECKING if ENABLE_CHECKING is defined in gcc/.
1296 Define ENABLE_VALGRIND_CHECKING if requested.
1297 * lex.c (new_buff): If ENABLE_VALGRIND_CHECKING, put _cpp_buff
1298 struct first in the allocated buffer and result->base after it.
1299 (_cpp_free_buff): If ENABLE_VALGRIND_CHECKING, free buff itself
1300 instead of buff->base.
1301 * config.in: Regenerated.
1302 * configure: Regenerated.
1303
911b08c6 13042013-02-13 Ed Smith-Rowland <3dw4rd@verizon.net>
1305
1306 PR c++/55582
1638c736 1307 * lex.c (lex_raw_string): Allow string literal with suffix
911b08c6 1308 beginning with 's' to be parsed as a C++11 user-defined literal.
1309
cec7bb47 13102013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
1311
1312 Update copyright years.
1313
1aa79d39 13142013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
1315
1316 PR c++/54526 (again)
1317 * lex.c (_cpp_lex_direct): In C++11 mode, implement 2.5 p3, bullet 2.
1318
de2e6b8a 13192013-01-03 Marc Glisse <marc.glisse@inria.fr>
1320
1321 PR bootstrap/50177
1322 * line-map.c (get_combined_adhoc_loc): Cast from extern "C" type.
1323 (new_linemap): Likewise.
1324 (linemap_enter_macro): Likewise.
1325
8e1d1b0c 13262012-12-03 Jakub Jelinek <jakub@redhat.com>
1327
1328 PR bootstrap/55380
1329 PR other/54691
1330 * files.c (read_file_guts): Allocate extra 16 bytes instead of
1331 1 byte at the end of buf. Pass size + 16 instead of size
1332 to _cpp_convert_input.
1333 * charset.c (_cpp_convert_input): Reallocate if there aren't
1334 at least 16 bytes beyond to.len in the buffer. Clear 16 bytes
1335 at to.text + to.len.
1336
8ad1eb94 13372012-11-21 Steve Ellcey <sellcey@mips.com>
1338
1339 PR pch/55399
1340 * files.c (pch_open_file): Fix check for implicit_preinclude.
1341
52bc861d 13422012-11-16 Simon Baldwin <simonb@google.com>
1343
1344 * include/cpplib.h (struct cpp_options): Add canonical_system_headers.
1345 * files.c (find_file_in_dir): Call maybe_shorter_path() only if
1346 canonical_system_headers is set.
1347 * init.c (cpp_create_reader): Initialize canonical_system_headers.
1348 * configure.ac: Add new --enable-canonical-system-headers.
1349 * configure: Regenerate.
1350 * config.in: Regenerate.
1351
2dd00636 13522012-11-09 Ed Smith-Rowland <3dw4rd@verizon.net>
1353
1354 PR c++/54413
1355 * include/cpplib.h (cpp_interpret_float_suffix): Add cpp_reader* arg.
1356 (cpp_interpret_int_suffix): Add cpp_reader* arg.
1357 * init.c (cpp_create_reader): Iitialize new flags.
1358 * expr.c (interpret_float_suffix): Use new flags.
1359 (cpp_interpret_float_suffix): Add cpp_reader* arg.
1360 (interpret_int_suffix): Use new flags.
1361 (cpp_interpret_int_suffix): Add cpp_reader* arg.
1362 (cpp_classify_number): Adjust calls to interpret_x_suffix.
1363
5b1d5fe6 13642012-10-23 Ian Bolton <ian.bolton@arm.com>
1365 Jim MacArthur <jim.macarthur@arm.com>
1366 Marcus Shawcroft <marcus.shawcroft@arm.com>
1367 Nigel Stephens <nigel.stephens@arm.com>
1368 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
1369 Richard Earnshaw <rearnsha@arm.com>
1370 Sofiane Naci <sofiane.naci@arm.com>
1371 Stephen Thomas <stephen.thomas@arm.com>
1372 Tejas Belagod <tejas.belagod@arm.com>
1373 Yufeng Zhang <yufeng.zhang@arm.com>
1374
1375 * configure.ac: Enable AArch64.
1376 * configure: Regenerate.
1377
6adc88f8 13782012-10-23 Joseph Myers <joseph@codesourcery.com>
1379
1380 * files.c (struct _cpp_file): Add implicit_preinclude.
1381 (pch_open_file): Allow a previously opened implicitly included
1382 file.
1383 (_cpp_find_file): Add implicit_preinclude argument. Free file and
1384 do not call open_file_failed if implicit_preinclude. Store
1385 implicit_preinclude value.
1386 (_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date):
1387 Update calls to _cpp_find_file.
1388 (_cpp_stack_include): Handle IT_DEFAULT.
1389 (cpp_push_default_include): New.
1390 * include/cpplib.h (cpp_push_default_include): Declare.
1391 * init.c (cpp_read_main_file): Update call to _cpp_find_file.
1392 * internal.h (enum include_type): Add IT_DEFAULT.
1393 (_cpp_find_file): Update prototype.
1394
15fc692a 13952012-10-15 Tobias Burnus <burnus@net-b.de>
1396
1397 * files.c (read_file_guts, _cpp_save_file_entries): Free memory
1398 before returning.
1399 * lex.c (warn_about_normalization): Ditto.
1400 * mkdeps.c (deps_save): Ditto.
1401 * pch.c (cpp_valid_state): Ditto.
1402
a1f1781a 14032012-10-04 Florian Weimer <fweimer@redhat.com>
1404
1405 * directives.c (do_pragma_warning_or_error): New.
1406 (do_pragma_warning): New.
1407 (do_pragma_error): New.
1408 (_cpp_init_internal_pragmas): Register new pragmas.
1409
bda16c7c 14102012-09-25 Dehao Chen <dehao@google.com>
1411
1412 PR middle-end/54704
1413 * line-map.c (location_adhoc_data_hash): Fix the hash function.
1414
5c1946c8 14152012-09-25 Dehao Chen <dehao@google.com>
1416
1417 PR middle-end/54645
1418 * include/line-map.h (location_adhoc_data): Move location_adhoc_data
1419 into GC.
1420 (location_adhoc_data_map): Likewise.
1421 (line_maps): Likewise.
1422 (rebuild_location_adhoc_htab): New Function.
1423 * line-map.c (+rebuild_location_adhoc_htab): new Funcion.
1424 (get_combined_adhoc_loc): Move location_adhoc_data into GC.
1425 (location_adhoc_data_fini): Likewise.
1426 (linemap_init): Likewise.
1427 (location_adhoc_data_init): Remove Function.
1428
5169661d 14292012-09-19 Dehao Chen <dehao@google.com>
1430
1431 * include/line-map.h (MAX_SOURCE_LOCATION): New value.
1432 (location_adhoc_data_fini): New.
1433 (get_combined_adhoc_loc): New.
1434 (get_data_from_adhoc_loc): New.
1435 (get_location_from_adhoc_loc): New.
1436 (location_adhoc_data_map): New.
1437 (COMBINE_LOCATION_DATA): New.
1438 (IS_ADHOC_LOC): New.
1439 (expanded_location): New field.
1440 (line_maps): New field.
1441 * line-map.c (location_adhoc_data): New.
1442 (location_adhoc_data_hash): New.
1443 (location_adhoc_data_eq): New.
1444 (location_adhoc_data_update): New.
1445 (get_combined_adhoc_loc): New.
1446 (get_data_from_adhoc_loc): New.
1447 (get_location_from_adhoc_loc): New.
1448 (location_adhoc_data_init): New.
1449 (location_adhoc_data_fini): New.
1450 (linemap_init): Initialize location_adhoc_data.
1451 (linemap_lookup): Change to use new location.
1452 (linemap_ordinary_map_lookup): Likewise.
1453 (linemap_macro_map_lookup): Likewise.
1454 (linemap_macro_map_loc_to_def_point): Likewise.
1455 (linemap_macro_map_loc_unwind_toward_spel): Likewise.
1456 (linemap_get_expansion_line): Likewise.
1457 (linemap_get_expansion_filename): Likewise.
1458 (linemap_location_in_system_header_p): Likewise.
1459 (linemap_location_from_macro_expansion_p): Likewise.
1460 (linemap_macro_loc_to_spelling_point): Likewise.
1461 (linemap_macro_loc_to_def_point): Likewise.
1462 (linemap_macro_loc_to_exp_point): Likewise.
1463 (linemap_resolve_location): Likewise.
1464 (linemap_unwind_toward_expansion): Likewise.
1465 (linemap_unwind_to_first_non_reserved_loc): Likewise.
1466 (linemap_expand_location): Likewise.
1467 (linemap_dump_location): Likewise.
1468 (linemap_line_start): Likewise.
1469
307df3d0 14702012-05-25 Dodji Seketeli <dodji@redhat.com>
1471
1472 PR preprocessor/53469
1473 * directives.c (do_pragma): Use the virtual location for the
1474 pragma token, instead of its spelling location.
1475
2b15d2ba 14762012-08-14 Diego Novillo <dnovillo@google.com>
1477
1478 Merge from cxx-conversion branch. Configury.
1479
1480 * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
1481 * configure.ac: Likewise.
1482 * configure: Regenerate.
1483
14842012-08-14 Lawrence Crowl <crowl@google.com>
1485
1486 Merge from cxx-conversion branch. New C++ hash table.
1487
1488 * include/symtab.h (typedef struct ht hash_table): Change the typedef
1489 name to cpp_hash_table. Update all users of the typedef.
1490
65f4cf9c 14912012-07-30 Laurynas Biveinis <laurynas.biveinis@gmail.com>
1492
1493 * include/line-map.h (line_map_macro): Use the "atomic" GTY option
1494 for the macro_locations field.
1495
112f073c 14962011-06-19 Uros Bizjak <ubizjak@gmail.com>
1497
1498 * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
1499 __builtin_ia32_pcmpestri128 instead of asm.
1500
c8dda42f 15012012-06-04 Dimitrios Apostolou <jimis@gmx.net>
1502
1503 * line-map.c (linemap_enter_macro): Don't zero max_column_hint in
1504 every macro. This improves performance by reducing the number of
1505 reallocations when track-macro-expansion is on.
1506
0aa42a53 15072012-06-04 Dodji Seketeli <dodji@redhat.com>
1508
1509 PR preprocessor/53463
1510 * line-map.c (linemap_location_in_system_header_p): For built-in
1511 macro tokens, check the first expansion point location that is not
1512 for a token coming from a built-in macro.
1513
e8aa7eaf 15142012-05-29 Joseph Myers <joseph@codesourcery.com>
1515
1516 * directives.c: Fix typos.
1517 * include/line-map.h: Fix typos.
1518 * line-map.c: Fix typos.
1519 * macro.c: Fix typos.
1520
5fe44548 15212012-05-25 Dodji Seketeli <dodji@redhat.com>
1522
1523 PR bootstrap/53459
1524 * lex.c (search_line_fast): Avoid unused local typedefs to simulate
1525 a static assertion.
1526
8c6425eb 15272012-05-29 Dodji Seketeli <dodji@redhat.com>
1528
1529 PR preprocessor/53229
1530 * internal.h (cpp_reader::set_invocation_location): Remove.
1531 (cpp_reader::about_to_expand_macro_p): New member flag.
1532 * directives.c (do_pragma): Remove Kludge as
1533 pfile->set_invocation_location is no more.
1534 * macro.c (cpp_get_token_1): Do away with the use of
1535 cpp_reader::set_invocation_location. Just collect the macro
1536 expansion point when we are about to expand the top-most macro.
1537 Do not override cpp_reader::about_to_expand_macro_p.
1538 This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding
1539 properly handle locations of expansion points.
1540 (cpp_get_token_with_location): Adjust, as
1541 cpp_reader::set_invocation_location is no more.
1542 (paste_tokens): Take a virtual location parameter for
1543 the LHS of the pasting operator. Use it in diagnostics. Update
1544 comments.
1545 (paste_all_tokens): Tighten the assert. Propagate the location of
1546 the expansion point when no virtual locations are available.
1547 Pass the virtual location to paste_tokens.
1548 (in_macro_expansion_p): New static function.
1549 (enter_macro_context): Set the cpp_reader::about_to_expand_macro_p
1550 flag until we really start expanding the macro.
1551
a60f3e81 15522012-05-16 Dodji Seketeli <dodji@redhat.com>
1553
1554 PR preprocessor/7263
1555 * include/cpplib.h (cpp_classify_number): Take a location
1556 parameter.
1557 * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic
1558 macros that take a location parameter.
1559 (cpp_classify_number): Take a (virtual) location parameter. Use
1560 it for diagnostics. Adjust comments.
1561 (eval_token): Take a location parameter. Pass it to
1562 cpp_classify_number and to diagnostic routines.
1563 (_cpp_parse_expr): Use virtual locations of tokens when parsing
1564 expressions. Pass a virtual location to eval_token and to
1565 diagnostic routines.
1566
3069d7f8 15672012-05-10 Tristan Gingold <gingold@adacore.com>
1568
1569 * expr.c (interpret_float_suffix): Add a guard.
1570
6cfa7465 15712012-05-02 Dodji Seketeli <dodji@redhat.com>
1572
1573 Properly initialize cpp_context in destringize_and_run
1574 * directives.c (destringize_and_run): Properly initialize the new
1575 context.
1576 * macro.c (_cpp_pop_context): Assert that we shouldn't try to pop
1577 the initial base context, which has the same life time as the
1578 current instance of cpp_file.
1579
47b6a3fe 15802012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
1581 Dodji Seketeli <dodji@seketeli.org>
1582
ffca20e9 1583 PR c++/52974
47b6a3fe 1584 * libcpp/files.c (maybe_shorter_path): New.
1585 (find_file_in_dir): Use it.
1586
d16f4f47 15872012-04-30 Dodji Seketeli <dodji@redhat.com>
1588
611f1003 1589 Switch -ftrack-macro-expansion=2 on by default.
1590 * init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
1591 by default. Add comments.
1592
bd172d61 1593 Strip "<built-in>" loc from displayed expansion context
1594 * include/line-map.h (linemap_unwind_toward_expansion): Fix typo
1595 in comment.
1596 (linemap_unwind_to_first_non_reserved_loc): Declare new function.
1597 * line-map.c (linemap_unwind_to_first_non_reserved_loc): Define
1598 new function.
1599
00abfdc0 1600 Fix expansion point loc for macro-like tokens
1601 * macro.c (macro_of_context): New static function.
1602 (_cpp_push_token_context, push_extended_tokens_context): If the
1603 macro argument is NULL, it means we are continuing the expansion
1604 of the current macro, if any. Update comments.
1605 (_cpp_pop_context): Re-enable expansion of the macro only when we
1606 are really out of the context of the current expansion.
1607
c55700de 1608 Fix token pasting with -ftrack-macro-expansion
1609 * macro.c (paste_all_tokens): Put the token resulting from pasting
1610 into an extended token context with -ftrack-macro-location is in
1611 effect.
1612
d16f4f47 1613 Fix cpp_sys_macro_p with -ftrack-macro-expansion
1614 * macro.c (cpp_sys_macro_p): Support -ftrack-macro-expansion.
1615
86c82b61 16162012-04-29 Dodji Seketeli <dodji@redhat.com>
1617
1618 * lex.c (lex_raw_string): Change C++ style comments into C style
1619 comments.
cc0a8c77 1620 (lex_string): Likewise.
86c82b61 1621
76d340ac 16222012-04-27 Ollie Wild <aaw@google.com>
1623
1624 * include/cpplib.h (struct cpp_options): Add new field,
1625 warn_literal_suffix.
1626 (CPP_W_LITERAL_SUFFIX): New enum.
1627 * init.c (cpp_create_reader): Default initialization of
1628 warn_literal_suffix.
1629 * lex.c (lex_raw_string): Treat user-defined literals which don't
1630 begin with '_' as separate tokens and produce a warning.
1631 (lex_string): Ditto.
1632
3f898bd2 16332012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
1634
1635 * line-map.c (linemap_resolve_location): Synchronize comments with
1636 those in line-map.h.
1637 * include/line-map.h (linemap_resolve_location): Fix spelling in
1638 comment.
1639
c434932e 16402012-03-22 Richard Earnshaw <rearnsha@arm.com>
1641
1642 * lex.c (search_line_fast): Provide Neon-optimized version for ARM.
1643
264a5d11 16442012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1645
1646 * lex.c: Remove Solaris 8 reference.
1647
7ce78e23 16482012-02-14 Walter Lee <walt@tilera.com>
1649
1650 * configure.ac: Require 64-bit hwint for tilegx and tilepro.
1651 * configure: Regenerate.
1652
d6fb6576 16532012-01-09 Richard Guenther <rguenther@suse.de>
1654
1655 * macro.c (_cpp_builtin_macro_text): Remove unused variable map.
1656
5e791406 16572012-01-09 Gary Funck <gary@intrepid.com>
1658
1659 PR preprocessor/33919
1660 * files.c (_cpp_get_file_name): New. Implement file name
1661 access function.
1662 * internal.h (_cpp_get_file_name): New prototype.
1663 * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
1664 to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
1665
131e69c7 16662012-01-03 Olivier Hainque <hainque@adacore.com>
1667
1668 * system.h: Prior to #define, #undef fopen and freopen unconditionally.
1669
32074525 16702011-12-20 Joseph Myers <joseph@codesourcery.com>
1671
1672 * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
1673 (CLK_STDC1X): Change to CLK_STDC11.
1674 * init.c (lang_defaults): Update comments.
1675 (cpp_init_builtins): Update language tests. Use 201112L for C11
1676 __STDC_VERSION__.
1677
80cfebdb 16782011-12-20 Andreas Schwab <schwab@linux-m68k.org>
1679
1680 * configure: Regenerate.
1681
705de1ef 16822011-12-19 Andreas Schwab <schwab@linux-m68k.org>
1683
1684 * configure: Regenerate.
1685
b735cc56 16862011-12-07 Jakub Jelinek <jakub@redhat.com>
1687
1688 PR bootstrap/50237
1689 * internal.h (_cpp_init_lexer): New prototype.
1690 * init.c (init_library): Call it.
1691 * lex.c (init_vectorized_lexer): Remove constructor attribute,
1692 add inline keyword.
1693 (HAVE_init_vectorized_lexer): Define.
1694 (_cpp_init_lexer): New function.
1695
80e34234 16962011-12-03 Dodji Seketeli <dodji@redhat.com>
1697
1698 * macro.c (tokens_buff_remove_last_token)
1699 (tokens_buff_put_token_to): Add an 'inline' function specifier to
1700 the prototype.
1701
b082215e 17022011-11-22 Diego Novillo <dnovillo@google.com>
1703
1704 * include/line-map.h (linemap_dump): Declare.
1705 (line_table_dump): Declare.
1706 * line-map.c (linemap_dump): New.
1707 (line_table_dump): New.
1708
b06c89b6 17092011-11-21 Ed Smith-Rowland <3dw4rd@verizon.net>
1710
1711 PR c++/50958
1712 * expr.c (cpp_userdef_char_remove_type): Fix typo.
1713
7c801b60 17142011-11-03 Michael Matz <matz@suse.de>
1715
1716 PR bootstrap/50857
1717 * configure.ac: Check for -fno-exceptions -fno-rtti.
1718 * configure: Regenerate.
1719 * Makefile.in (NOEXCEPTION_FLAGS): New flag.
1720 (ALL_CXXFLAGS): Use it.
1721
d8954404 17222011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
1723
1724 * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
1725
7e783eb3 17262011-11-02 Jason Merrill <jason@redhat.com>
1727
1728 PR c++/50810
1729 * configure.ac: Add -Wno-narrowing to warning options.
1730
0d84dc2d 17312011-10-31 Jason Merrill <jason@redhat.com>
1732
de803ff2 1733 PR libstdc++/1773
1734 * init.c (cpp_init_builtins): Set __cplusplus for C++11.
1735
0d84dc2d 1736 PR c++/50920
1737 * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
1738 CLK_GNUCXX0X to CLK_GNUCXX11.
1739
244db24d 17402011-10-26 Ed Smith-Rowland <3dw4rd@verizon.net>
1741
1742 Implement C++11 user-defined literals.
1743 * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
1744 cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
1745 cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
1746 cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
1747 (cpp_classify_number): Classify unrecognized tokens as user-defined
1748 literals.
1749 * include/cpplib.h: Add new tokens for user-defined literals.
1750 * init.c: Add new preprocessor flag (cxx11).
1751 * lex.c: (lex_string, lex_raw_string): Handle user-defined literals
1752 including concatenation and promotion with suffixes.
1753
68928989 17542011-10-24 Dodji Seketeli <dodji@redhat.com>
1755
1756 * line-map.c (linemap_macro_map_lookup): Fix logic.
1757
5ebe2143 17582011-10-24 Dodji Seketeli <dodji@redhat.com>
1759
1760 * include/line-map.h (linemap_expand_location): Take a line table
1761 parameter. Update comment.
1762 (linemap_resolve_location): Update comment.
1763 (linemap_expand_location_full): Remove.
1764 * line-map.c (linemap_resolve_location): Handle reserved
1765 locations; return a NULL map in those cases.
1766 (linemap_expand_location): If location is reserved, return a
1767 zeroed expanded location. Update comment. Take a line table to
1768 assert that the function takes non-virtual locations only.
1769 (linemap_expand_location_full): remove.
1770 (linemap_dump_location): Handle the fact that
1771 linemap_resolve_location can return NULL line maps when the
1772 location resolves to a reserved location.
1773
1774 * line-map.c (linemap_macro_map_lookup): Fix logic.
1775
a2eb22f0 17762011-10-22 Dodji Seketeli <dodji@redhat.com>
1777
1778 PR bootstrap/50778
1779 * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
1780 context to act upon.
1781 * lex.c (_cpp_remaining_tokens_num_in_context): Likewise. Update
1782 comment.
1783 (cpp_token_from_context_at): Likewise.
1784 (cpp_peek_token): Use the context to peek tokens from.
1785
ac6130e2 17862011-10-20 Dodji Seketeli <dodji@redhat.com>
1787
1788 PR bootstrap/50801
1789 * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
1790 number of tokens.
1791
2a688977 17922011-10-18 Dodji Seketeli <dodji@redhat.com>
1793
1794 PR bootstrap/50760
1795 * include/line-map.h (struct linemap_stats): Change the type of
cc0a8c77 1796 the members from size_t to long.
2a688977 1797 * macro.c (macro_arg_token_iter_init): Unconditionally initialize
cc0a8c77 1798 iter->location_ptr.
2a688977 1799
a67520a9 18002011-10-17 Dodji Seketeli <dodji@redhat.com>
1801
1802 * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
cc0a8c77 1803 variable without using it if ENABLE_CHECKING is not defined. Mark
1804 the LOCATION parameter as being unused.
a67520a9 1805
1ae3520e 18062011-10-15 Tom Tromey <tromey@redhat.com>
1807 Dodji Seketeli <dodji@redhat.com>
1808
1809 * include/line-map.h (struct line_maps::alloced_size_for_request):
1810 New member.
1811 * line-map.c (new_linemap): Use set->alloced_size_for_request to
1812 get the actual allocated size of line maps.
1813
e77b8253 18142011-10-15 Tom Tromey <tromey@redhat.com>
1815 Dodji Seketeli <dodji@redhat.com>
1816
1817 * line-map.h (struct linemap_stats): Declare new struct.
1818 (linemap_get_statistics): Declare ...
1819 * line-map.c (linemap_get_statistics): ... new function.
1820 * macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
1821 Declare new counters.
1822 (enter_macro_context, replace_args): Update
1823 num_macro_tokens_counter.
1824 (cpp_get_token_1): Update num_expanded_macros_counter.
1825
62db153a 18262011-10-15 Tom Tromey <tromey@redhat.com>
1827 Dodji Seketeli <dodji@redhat.com>
1828
1829 * include/cpplib.h (struct cpp_options)<debug>: New struct member.
1830 * include/line-map.h (linemap_dump_location): Declare ...
1831 * line-map.c (linemap_dump_location): ... new function.
1832
ce70f433 18332011-10-15 Tom Tromey <tromey@redhat.com>
1834 Dodji Seketeli <dodji@redhat.com>
1835
1836 * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
1837 New option.
1838 * internal.h (struct macro_context): New struct.
1839 (enum context_tokens_kind): New enum.
1840 (struct cpp_context)<tokens_kind>: New member of type enum
1841 context_tokens_kind.
1842 (struct cpp_context)<macro>: Remove this. Replace it with an enum
1843 of macro and macro_context.
1844 (struct cpp_context)<direct_p>: Remove.
1845 (_cpp_remaining_tokens_num_in_context): Declare new function.
1846 * directives.c (destringize_and_run): Adjust.
1847 * lex.c (_cpp_remaining_tokens_num_in_context)
1848 (_cpp_token_from_context_at): Define new functions
1849 (cpp_peek_token): Use them.
1850 * init.c (cpp_create_reader): Initialize the base context to zero.
1851 (_cpp_token_from_context_at): Define new static function.
1852 (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
1853 _cpp_token_from_context_at.
1854 * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
1855 members.
1856 (enum macro_arg_token_kind): New enum.
1857 (struct macro_arg_token_iter): New struct.
1858 (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
1859 (alloc_expanded_arg_mem, ensure_expanded_arg_room)
1860 (delete_macro_args, set_arg_token, get_arg_token_location)
1861 (arg_token_ptr_at, macro_arg_token_iter_init)
1862 (macro_arg_token_iter_get_token)
1863 (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
1864 (expanded_token_index, tokens_buff_new, tokens_buff_count)
1865 (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
1866 (tokens_buff_add_token, tokens_buff_remove_last_token)
1867 (reached_end_of_context, consume_next_token_from_context): New
1868 static functions.
1869 (cpp_get_token_1): New static function. Split and extended from
1870 cpp_get_token. Use reached_end_of_context and
1871 consume_next_token_from_context. Unify its return point. Move
1872 the location tweaking from cpp_get_token_with_location in here.
1873 (cpp_get_token): Use cpp_get_token_1
1874 (stringify_arg): Use the new arg_token_at.
1875 (paste_all_tokens): Support tokens coming from extended tokens
1876 contexts.
1877 (collect_args): Return the number of collected arguments, by
1878 parameter. Store virtual locations of tokens that constitute the
1879 collected args.
1880 (funlike_invocation_p): Return the number of collected arguments,
1881 by parameter.
1882 (enter_macro_context): Add a parameter for macro expansion point.
1883 Pass it to replace_args and to the "used" cpp callback. Get the
1884 number of function-like macro arguments from funlike_invocation_p,
1885 pass it to the new delete_macro_args to free the memory used by
1886 macro args. When -ftrack-macro-expansion is in effect, for macros
1887 that have no arguments, create a macro map for the macro expansion
1888 and use it to allocate proper virtual locations for tokens
1889 resulting from the expansion. Push an extended tokens context
1890 containing the tokens resulting from macro expansion and their
1891 virtual locations.
1892 (replace_args): Rename the different variables named 'count' into
1893 variables with more meaningful names. Create a macro map;
1894 allocate virtual locations of tokens resulting from this
1895 expansion. Use macro_arg_token_iter to iterate over tokens of a
1896 given macro. Handle the case of the argument of
1897 -ftrack-macro-expansion being < 2. Don't free macro arguments
1898 memory resulting from expand_arg here, as these are freed by the
1899 caller of replace_arg using delete_macro_args now. Push extended
1900 token context.
1901 (next_context, push_ptoken_context, _cpp_push_token_context)
1902 (_cpp_push_text_context): Properly initialize the context.
1903 (expand_arg): Use the new alloc_expanded_arg_mem,
1904 push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
1905 (_cpp_pop_context): Really free the memory held by the context.
1906 Handle freeing memory used by extended tokens contexts.
1907 (cpp_get_token_with_location): Use cpp_get_token_1.
1908 (cpp_sys_macro_p): Adjust.
1909 (_cpp_backup_tokens): Support the new kinds of token contexts.
1910 * traditional.c (recursive_macro): Adjust.
1911
97bfb9ef 19122011-10-15 Tom Tromey <tromey@redhat>
1913 Dodji Seketeli <dodji@redhat.com>
1914
1915 * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
1916 member.
1917 (MAX_SOURCE_LOCATION): New constant.
1918 (struct line_map_ordinary, struct line_map_macro): New structs.
cc0a8c77 1919 (struct line_map): Turn this into a union of the two above. Add
97bfb9ef 1920 comments.
1921 (struct maps_info): New struct.
1922 (struct line_maps)<info_ordinary, info_macro>: Two new fields.
1923 These now carry the map information that was previously scattered
1924 in struct line_maps.
1925 (struct map_info::allocated): Fix comment.
1926 (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
1927 (ORDINARY_MAP_STARTING_LINE_NUMBER)
1928 (ORDINARY_MAP_INCLUDER_FILE_INDEX)
1929 (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
1930 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
1931 (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
1932 (MACRO_MAP_EXPANSION_POINT_LOCATION)
1933 (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
1934 (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
1935 (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
1936 (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
1937 (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
1938 (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
1939 (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
1940 (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
1941 (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
1942 (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
1943 (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
1944 information.
1945 (linemap_check_ordinary, linemap_assert)
1946 (linemap_location_before_p): New macros.
1947 (linemap_position_for_line_and_column)
1948 (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
1949 (linemap_macro_expansion_map_p)
1950 (linemap_macro_map_loc_to_def_point)
1951 (linemap_macro_map_loc_unwind_once)
1952 (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
1953 (linemap_get_source_line linemap_get_source_column)
1954 (linemap_map_get_macro_name, linemap_get_file_path)
1955 (linemap_location_in_system_header_p)
1956 (linemap_location_from_macro_expansion_p): Declare new functions.
1957 (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
1958 (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
1959 accessors act on ordinary maps only.
1960 (INCLUDED_FROM): Return NULL for main files; use the new
1961 accessors.
1962 (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
1963 (struct expanded_location): Move here from gcc/input.h
1964 (linemap_resolve_location, linemap_expand_location)
1965 (linemap_expand_location_full): Declare new functions.
1966 * line-map.c: Include cpplib.h, internal.h
1967 (linemap_enter_macro, linemap_add_macro_token)
1968 (linemap_get_expansion_line, linemap_get_expansion_filename): New
1969 functions that are private to libcpp.
1970 (linemap_assert): New macro.
1971 (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
1972 (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
1973 (linemap_macro_map_loc_unwind_toward_spelling)
1974 (linemap_macro_map_loc_to_exp_point)
1975 (first_map_in_common_1, first_map_in_common): New static
1976 functions.
1977 (new_linemap): Define new static functions. Extracted and
1978 enhanced from ...
1979 (linemap_add): ... here. Use linemap_assert in lieu of abort
1980 previously.
1981 (linemap_tracks_macro_expansion_locs_p)
1982 (linemap_add_macro_token, linemap_macro_expansion_map_p)
1983 (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
1984 (linemap_macro_map_loc_to_def_point)
1985 (linemap_macro_map_loc_unwind_once)
1986 (linemap_step_out_once, linemap_map_get_index)
1987 (linemap_get_source_line,linemap_get_source_column)
1988 (linemap_get_file_path, linemap_map_get_macro_name)
1989 (linemap_location_in_system_header_p)
1990 (linemap_location_originated_from_system_header_p)
1991 (linemap_location_from_macro_expansion_p)
1992 (linemap_tracks_macro_expansion_locs_p)
1993 (linemap_resolve_location, linemap_expand_location)
1994 (linemap_expand_location_full)
1995 (linemap_tracks_macro_expansion_locs_p)
1996 (linemap_position_for_line_and_column, linemap_compare_locations):
1997 Define new public functions.
1998 (linemap_init): Initialize ordinary and macro maps information in
1999 the map set.
2000 (linemap_check_files_exited): Use the new accessors.
2001 (linemap_free): Remove this dead code.
2002 (linemap_line_start): Assert this uses an ordinary map. Adjust to
2003 use the new ordinary map accessors and data structures. Don't
2004 overflow past the lowest possible macro token's location.
2005 (linemap_position_for_column): Assert the ordinary maps of the map
2006 set are really ordinary. Use ordinary map accessors.
2007 (linemap_lookup): Keep the same logic but generalize to allow
2008 lookup of both ordinary and macro maps. Do not crash when called
2009 with an empty line table.
2010 * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
2011 new API of line-map.h.
2012 * directives.c (start_directive, do_line, do_linemarker)
2013 (do_linemarker): Likewise.
2014 * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
2015 (make_cpp_dir, cpp_make_system_header): Likewise.
2016 * init.c (cpp_read_main_file): Likewise.
2017 * internal.h (CPP_INCREMENT_LINE): Likewise.
2018 (linemap_enter_macro, linemap_add_macro_token)
2019 (linemap_get_expansion_line, linemap_get_expansion_filename): New
2020 functions private to libcpp.
2021 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
2022 (skip_line_comment, skip_whitespace, lex_raw_string)
2023 (_cpp_lex_direct): Likewise.
2024 * macro.c (_cpp_builtin_macro_text): Likewise.
2025 (_cpp_aligned_alloc): Initialize the new name member of the macro.
2026 * traditional.c (copy_comment, _cpp_scan_out_logical_line):
2027 Likewise.
2028 * errors.c (cpp_diagnostic): Adjust to new linemap API.
2029
1dc92c59 20302011-08-28 Dodji Seketeli <dodji@redhat.com>
2031
2032 * line-map.c (linemap_add): Assert that reason must not be
2033 LC_RENAME when called for the first time on a "main input file".
2034
6ea2c7a3 20352011-08-22 Gabriel Charette <gchare@google.com>
2036
2037 * init.c (cpp_create_reader): Inititalize forced_token_location_p.
2038 * internal.h (struct cpp_reader): Add field forced_token_location_p.
2039 * lex.c (_cpp_lex_direct): Use forced_token_location_p.
2040 (cpp_force_token_locations): New.
2041 (cpp_stop_forcing_token_locations): New.
2042
985e7f10 20432011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2044
2045 PR libstdc++/1773
2046 * init.c (cpp_init_builtins): Define __cplusplus 19971L.
2047
094a55ba 20482011-08-18 Joseph Myers <joseph@codesourcery.com>
2049
2050 * include/cpplib.h (struct cpp_options): Fix typo.
2051
6f6f3dd7 20522011-08-18 Joseph Myers <joseph@codesourcery.com>
2053
2054 * include/cpplib.h (struct cpp_options): Add rliterals.
2055 * init.c (struct lang_flags, lang_defaults): Add rliterals.
2056 (cpp_set_lang): Set rliterals option.
2057 (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
2058 * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
2059
80ea6373 20602011-08-15 Gabriel Charette <gchare@google.com>
2061
2062 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
2063 Update all users to use linemap_position_for_column instead.
2064
d44dc666 20652011-07-28 Gabriel Charette <gchare@google.com>
2066
2067 * include/line-map.h (struct line_maps):
2068 Remove unused field last_listed. Update all users.
2069
6b4db1bd 20702011-07-28 H.J. Lu <hongjiu.lu@intel.com>
2071
2072 * configure.ac: Set need_64bit_hwint to yes for x86 targets.
2073 * configure: Regenerated.
2074
80e4662c 20752011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2076
2077 * system.h [__cplusplus]: Wrap C function declarations in extern "C".
2078
6678cb4e 20792011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2080 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2081
2082 PR bootstrap/49794
2083 * configure.ac: Test AM_ICONV with CXX.
2084 * configure: Regenerate.
2085 * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
2086
c219ee5c 20872011-07-15 Dodji Seketeli <dodji@redhat.com>
2088
2089 * directives.c (struct if_stack): Use source_location as type
2090 here.
2091 * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
2092 indent, def_pragma, used_define, used_undef>: Properly use
2093 source_location as parameter type, rather than unsigned int.
2094
14f27bc6 20952011-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2096
2097 PR target/39150
2098 * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
2099 like i[34567]86-*-solaris2.1[0-9]*.
2100 * configure: Regenerate.
2101
414663ef 21022011-06-16 Jason Merrill <jason@redhat.com>
2103
2104 PR c++/45399
2105 * lex.c (lex_raw_string): Don't check for embedded NUL.
2106
2c694d44 21072011-06-06 Dodji Seketeli <dodji@redhat.com>
2108
2109 PR preprocessor/48532
2110 * directives.c (do_pragma): Don't forget the invocation location
2111 when parsing the pragma name of a namespaced pragma directive.
2112
9793dd8e 21132011-05-29 John Tytgat <John.Tytgat@aaug.net>
2114
2115 * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
2116
cef70b8a 21172011-05-22 Uros Bizjak <ubizjak@gmail.com>
2118
2119 PR target/49104
2120 * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
2121 is defined. Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
2122
cdd0bb4b 21232011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
2124
2125 * system.h (ENUM_BITFIELD): Remove.
2126
0ff0cd04 21272011-04-24 Jakub Jelinek <jakub@redhat.com>
2128
2129 PR preprocessor/48740
2130 * lex.c (lex_raw_string): When raw string ends with
2131 ??) followed by raw prefix and ", ensure it is preprocessed
2132 with ??) rather than ??].
2133
dd045aee 21342011-04-20 Jim Meyering <meyering@redhat.com>
2135
2136 * files.c (destroy_cpp_file): Remove useless if-before-free.
2137 * init.c (cpp_destroy): Likewise.
2138 * macro.c (replace_args): Likewise.
2139 * pch.c (cpp_valid_state): Likewise.
2140
bb7824b5 21412011-03-25 Kai Tietz <ktietz@redhat.com>
2142
2143 * files.c (file_hash_eq): Use filename_cmp
2144 instead of strcmp.
2145 (nonexistent_file_hash_eq): Likewise.
2146 (remap_filename): Likewise.
2147 Handle absolute DOS-path,
2148 (append_file_to_dir): Check for IS_DIR_SEPARATOR
2149 instead of slash.
2150 (read_name_map): Likewise.
2151 * linemap.c (linemap_add): Use filename_cmp
2152 instead of strcmp.
2153 * mkdeps.c (apply_vpath): Use filename_ncmp
2154 instead of strncmp.
2155 (deps_restore): Use filename_cmp instead of
2156 strcmp.
2157 * init.c (read_original_directory): Use
2158 IS_DIR_SEPARATOR instead of checking for slash.
2159
00e59df9 21602011-03-21 Michael Meissner <meissner@linux.vnet.ibm.com>
2161
2162 PR preprocessor/48192
2163 * directives.c (do_ifdef): Do not consider conditional macros as
2164 being defined.
2165 (do_ifndef): Ditto.
2166 * expr.c (parse_defined): Ditto.
2167
70ebee13 21682011-03-18 Richard Henderson <rth@redhat.com>
2169
2170 PR bootstrap/45381
2171 * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
2172
65861c3e 21732011-11-04 Eric Botcazou <ebotcazou@adacore.com>
cc0a8c77 2174 Jakub Jelinek <jakub@redhat.com>
65861c3e 2175
2176 PR preprocessor/39213
2177 * directives.c (end_directive): Call _cpp_remove_overlay for deferred
2178 pragmas as well in traditional mode.
2179
be04fdf9 21802010-11-17 Ian Lance Taylor <iant@google.com>
2181
2182 PR bootstrap/45538
2183 * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of
2184 AC_LANG based on ENABLE_BUILD_WITH_CXX.
2185
560ab0b2 21862010-11-16 Kai Tietz <kai.tietz@onevision.com>
2187
2188 PR preprocessor/17349
2189 * lex.c (save_comment): Handle in argument passing c++
2190 comments special.
2191
075f1161 21922010-11-02 Ian Lance Taylor <iant@google.com>
2193
2194 * configure.ac: Use AC_SYS_LARGEFILE.
2195 * configure: Rebuild.
2196 * config.in: Rebuild.
2197
bc3d3e89 21982010-10-19 Basile Starynkevitch <basile@starynkevitch.net>
075f1161 2199
bc3d3e89 2200 * line-map.h (source_location): Remove obsolete comment
2201 mentioning location_s.
2202
0d601ff4 22032010-09-29 Kai Tietz <kai.tietz@onevision.com>
2204
2205 PR preprocessor/45362
2206 * directives.c (cpp_pop_definition): Make static.
2207 (do_pragma_push_macro): Reworked to store text
2208 definition.
2209 (do_pragma_pop_macro): Add free text definition.
2210 (cpp_push_definition): Removed.
2211 * include/cpplib.h (cpp_push_definition): Removed.
2212 (cpp_pop_definition): Likewise.
2213 * internal.h (def_pragma_macro): Remove member 'value'
2214 and add new members 'definition', 'line',
2215 'syshdr', 'sued' and 'is_undef'.
2216 * pch.c (_cpp_restore_pushed_macros): Rework to work
2217 on text definition and store additional macro flags.
2218 (_cpp_save_pushed_macros): Likewise.
2219
5ae82d58 22202010-09-29 Joseph Myers <joseph@codesourcery.com>
2221
2222 * include/cpplib.h (cpp_options): Rename warn_deprecated,
2223 warn_traditional, warn_long_long and pedantic.
2224 * directives.c (directive_diagnostics, _cpp_handle_directive):
2225 Update names of cpp_options members.
2226 * expr.c (cpp_classify_number, eval_token): Update names of
2227 cpp_options members.
2228 * init.c (cpp_create_reader, post_options): Update names of
2229 cpp_options members.
2230 * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
2231 cpp_options members.
2232 * macro.c (parse_params): Update names of cpp_options members.
2233
ced52ffd 22342010-09-15 Ian Lance Taylor <iant@google.com>
2235
2236 * init.c: Fix type name in comment.
2237
df863d33 22382010-08-31 Jakub Jelinek <jakub@redhat.com>
2239
2240 PR preprocessor/45457
2241 * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
2242 needed.
2243 * directives.c (do_ifdef, do_ifndef): Likewise.
2244
9e76b586 22452010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2246
2247 * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
2248
b315ae35 22492010-08-24 Richard Henderson <rth@redhat.com>
2250
2251 PR bootstrap/45376
2252 * configure.ac (HAVE_SSE4): New check.
2253 * configure, config.in: Rebuild.
2254 * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
2255
8ab29ece 22562010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2257
2258 * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
2259 etc. on Solaris 2/x86.
2260
2431e8ba 22612010-08-21 Richard Henderson <rth@redhat.com>
2262 Andi Kleen <ak@linux.intel.com>
2263 David S. Miller <davem@davemloft.net>
2264
2265 * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
2266 (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
2267 (ptrdiff_t): Check via AC_CHECK_TYPE.
2268 * config.in, configure: Rebuild.
2269 * system.h: Include stdint.h, if available.
2270 * lex.c (WORDS_BIGENDIAN): Provide default.
2271 (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
2272 acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
2273 search_line_sse2, search_line_sse42, init_vectorized_lexer,
2274 search_line_fast): New.
2275 (_cpp_clean_line): Use search_line_fast. Restructure the fast
2276 loop to make it clear when we're leaving the loop. Stay in the
2277 fast loop for non-trigraph '?'.
2278
25692381 22792010-06-11 Jakub Jelinek <jakub@redhat.com>
2280
2281 * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
2282 callback.
2283 (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
2284 (cpp_macro_definition): Remove const qual from second argument.
2285 * macro.c (enter_macro_context): Call user_builtin_macro callback for
2286 NODE_BUILTIN !NODE_USED macros.
2287 (warn_of_redefinition): Likewise. Remove const qual from second
2288 argument.
2289 (cpp_macro_definition): Likewise.
2290 * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
2291 for NODE_BUILTIN !NODE_USED macros.
2292
abf6a617 22932010-06-10 Joseph Myers <joseph@codesourcery.com>
2294
2295 * include/cpplib.h (struct cpp_options): Remove show_column.
2296 * init.c (cpp_create_reader, post_options): Don't set show_column.
2297
9d135bb6 22982010-06-09 Joern Rennecke <joern.rennecke@embecosm.com>
2299
2300 PR bootstrap/44432
2301 * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
2302 check that C++ compiler works.
2303 * configure: Regenerate.
2304
ba72912a 23052010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
2306
2307 * include/symtab.h (ht_identifier_ptr): New.
2308
050318d9 23092010-06-03 Joern Rennecke <joern.rennecke@embecosm.com>
2310 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2311
2312 PR bootstrap/42798
2313 * configure.ac: Check for declaration of 'basename(char *)'.
2314 * configure: Regenerate.
2315 * config.in: Regenerate.
2316
39012afb 23172010-04-25 Joseph Myers <joseph@codesourcery.com>
2318
2319 * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
2320 * init.c (lang_defaults): Add entries for new language variants.
2321 (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
2322 variants.
2323
721e9705 23242010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
2325
2326 PR cpp/43195
2327 * files.c (report_missing_guard): Test for #pragma once.
2328
3a79f5da 23292010-04-07 Simon Baldwin <simonb@google.com>
2330
2331 * directives.c (do_diagnostic): Add warning reason argument,
2332 call appropriate error reporting function for code.
2333 (directive_diagnostics): Call specific warning functions with
2334 warning reason where appropriate.
2335 (do_error, do_warning, do_pragma_dependency): Add warning reason
2336 argument to do_diagnostic calls.
2337 * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
2338 _cpp_create_definition): Call specific warning functions with
2339 warning reason where appropriate.
2340 * Makefile.in: Add new diagnostic functions to gettext translations.
2341 * include/cpplib.h (struct cpp_callbacks): Add warning reason code
2342 to error callback.
2343 (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
2344 CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
2345 (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
2346 CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
2347 CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
2348 CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
2349 CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
2350 CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
2351 CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
2352 warning reason codes.
2353 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
2354 cpp_warning_with_line, cpp_pedwarning_with_line,
2355 cpp_warning_with_line_syshdr): New specific error reporting functions.
2356 * pch.c (cpp_valid_state): Call specific warning functions with
2357 warning reason where appropriate.
2358 * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
2359 diagnostic handlers.
2360 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
2361 cpp_warning_with_line, cpp_pedwarning_with_line,
2362 cpp_warning_with_line_syshdr): New specific error reporting functions.
2363 * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
2364 specific warning functions with warning reason where appropriate.
2365 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
2366 warn_about_normalization, lex_identifier_intern, lex_identifier,
2367 _cpp_lex_direct): Ditto.
2368 * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
2369 narrow_str_to_charconst): Ditto.
2370
56e2ce2d 23712010-04-06 Jakub Jelinek <jakub@redhat.com>
2372
2373 PR preprocessor/43642
2374 * lex.c (lex_raw_string): Change type of TYPE variable to
2375 unsigned char.
2376
e0934084 23772010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2378
2379 * aclocal.m4: Regenerate.
2380
7fe0ef3a 23812010-03-29 Jason Merrill <jason@redhat.com>
2382
3a45011c 2383 More N3077 raw string changes
2384 * charset.c (cpp_interpret_string): Don't transform UCNs in raw
2385 strings.
2386 * lex.c (bufring_append): Split out from...
2387 (lex_raw_string): ...here. Undo trigraph and line splicing
2388 transformations. Do process line notes in multi-line literals.
2389 (_cpp_process_line_notes): Ignore notes that were already handled.
2390
7fe0ef3a 2391 Some raw string changes from N3077
2392 * charset.c (cpp_interpret_string): Change inner delimiters to ().
2393 * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter.
2394
65f40615 23952010-02-11 Jakub Jelinek <jakub@redhat.com>
2396
2397 * init.c (read_original_filename): Don't call read_original_directory
2398 if _cpp_handle_directive returns 0.
2399
0074cd57 24002010-01-01 Joseph Myers <joseph@codesourcery.com>
2401
2402 PR preprocessor/41947
2403 * expr.c (cpp_classify_number): Give error for hexadecimal
2404 floating-point constant with no digits before or after point.
2405
116f0a5f 24062009-11-20 Arnaud Charlet <charlet@adacore.com>
2407
2408 * macro.c (enter_macro_context): Call cb.used callback if defined.
2409 * directives.c (do_idef, do_ifndef): Ditto.
2410 * include/cpplib.h (struct cpp_callbacks): Add used callback.
2411
038c21f1 24122009-11-11 Kai Tietz <kai.tietz@onevision.com>
2413
2414 * directives.c (do_pragma_push_macro): New pragma handler.
2415 (do_pragma_pop_macro): Likewise.
2416 (_cpp_init_internal_pragmas): Add push_macro and
2417 pop_macro handler to internal pragmas.
2418 (lex_macro_node_from_str): Removed.
2419 (cpp_push_definition): Replace lex_macro_node_from_str
2420 by _cpp_lex_identifier.
2421 (cpp_pop_definition): Likewise.
2422 * internal.h (_cpp_lex_identifier): New prototype.
2423 (def_pragma_macro): New structure.
2424 (cpp_reader): New member pushed_macros.
2425 * lex.c (_cpp_lex_identifier): New function.
2426 (lex_identifier_intern): New function.
2427 * init.c (cpp_create_reader): Initialize pushed_macros
2428 member.
2429 (cpp_destroy): Free elements in pushed_macros member.
2430 * pch.c (_cpp_save_pushed_macros): New function.
2431 (_cpp_restore_pushed_macros): Likewise.
2432 (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
2433 (cpp_read_state): Use _cpp_restore_pushed_macros.
2434
538ba11a 24352009-10-19 Jakub Jelinek <jakub@redhat.com>
2436
2437 * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
2438 (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
2439 and char32_cset_desc.
2440 (converter_for_type): Handle CPP_UTF8STRING.
2441 (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
2442 * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
2443 (parse_include): Reject raw strings.
2444 * include/cpplib.h (CPP_UTF8STRING): New token type.
2445 * internal.h (struct cpp_reader): Add utf8_cset_desc field.
2446 * lex.c (lex_raw_string): New function.
2447 (lex_string): Handle u8 string literals, call lex_raw_string
2448 for raw string literals.
2449 (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
2450 sequences.
2451 * macro.c (stringify_arg): Handle CPP_UTF8STRING.
2452
af4d2883 24532009-10-14 Jakub Jelinek <jakub@redhat.com>
2454
2455 PR preprocessor/41543
2456 * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
2457 * line-map.c (linemap_init): Initialize highest_location and
2458 highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
2459
8e83a065 24602009-10-09 Jason Merrill <jason@redhat.com>
2461
2462 * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
2463
8f2ff12e 24642009-10-09 Neil Vachharajani <nvachhar@google.com>
2465
2466 * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
2467 sccs.
2468
fc25a827 24692009-09-23 Loren J. Rittle <ljrittle@acm.org>
2470
2471 * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
2472 * configure: Rebuilt.
2473
fa12a6a5 24742009-09-22 Richard Guenther <rguenther@suse.de>
2475
2476 PR pch/38987
2477 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
2478
c25f2689 24792009-09-18 Chris Demetriou <cgd@google.com>
2480
2481 PR preprocessor/28435:
2482 * include/cpplib.h (struct cpp_options): Add new member
2483 deps.need_preprocessor_output.
2484 * files.c (open_file_failed): If preprocessor output is needed
2485 always report an error.
2486
a4f7c8f7 24872009-09-13 Kai Tietz <kai.tietz@onevision.com>
2488
2489 * configure.ac: Set for i?86-w64-mingw*
2490 need_64bit_hwint to yes.
2491 * configure: Regenerated.
2492
3f24af9b 24932009-09-10 Jason Merrill <jason@redhat.com>
2494
2495 * directives.c (cpp_define): constify.
2496
2a50bfcf 24972009-09-02 Ian Lance Taylor <iant@google.com>
2498
2499 * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
2500
81a71e2b 25012009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2502
2503 * configure.ac (AC_PREREQ): Bump to 2.64.
2504
cd9a469c 25052009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2506
2507 * aclocal.m4: Regenerate.
2508 * config.in: Regenerate.
2509 * configure: Regenerate.
2510
ed184982 25112009-08-17 Tom Tromey <tromey@redhat.com>
2512
2513 PR preprocessor/41067:
2514 * charset.c (convert_escape): Add missing ":" to error text.
2515
7ad75c55 25162009-07-27 Douglas B Rupp <rupp@gnat.com>
2517
2518 * include/cpplib.h (INO_T_CPP): New macro.
2519 (struct cpp_dir): Use it.
2520
80b97ef3 25212009-07-20 Jerry Quinn <jlquinn@optonline.net>
2522
2523 PR regression/40800
2524 * configure.ac: Use = instead of == for testing
2525 ENABLE_BUILD_WITH_CXX.
2526 * configure: Rebuild.
2527
723ebaea 25282009-07-17 Jerry Quinn <jlquinn@optonline.net>
2529
2530 * directives.c (do_linemarker, do_line): Use CPP_STRING for
2531 ignored enum value.
2532 * files.c (find_file_in_dir): Add cast from void* to char*.
2533 * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
2534 * Makefile.in: (WARN_CFLAGS): Use general and C-specific
2535 warnings.
2536 (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
2537 ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
2538 COMPILER_FLAGS): New.
2539 (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
2540 (COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS
2541 instead of ALL_CFLAGS.
2542 * configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings
2543 from other warnings. Add -Wc++-compat to C-specific warnings.
2544 Check for --enable-build-with-cxx. Set and substitute
2545 ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES
2546 according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before
2547 AC_CHECK_HEADERS.
2548 * configure: Rebuild.
2549 * include/cpp-id-data.h: Remove extern "C".
2550 * include/line-map.h: Likewise.
2551 * include/mkdeps.h: Likewise.
2552 * include/symtab.h: Likewise.
2553 * internal.h: Likewise.
2554
78ed8e3d 25552009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2556
2557 * directives.c (parse_include): Add location argument. Update all
2558 calls.
2559 (parse_answer): Likewise.
2560 (do_include_common): Error with exact location.
2561 (parse_assertion): Likewise.
2562
46821594 25632009-06-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
2564
2565 * expr.c (num_div_op): Take explicit location.
2566
52b290f1 25672009-06-17 Ian Lance Taylor <iant@google.com>
2568
2569 * include/cpplib.h (progname): Don't declare.
2570
2a6a6991 25712009-06-12 Ian Lance Taylor <iant@google.com>
2572
2573 * include/cpplib.h (struct cpp_options): Add
2574 warn_cxx_operator_names field.
2575 (NODE_WARN_OPERATOR): Define.
2576 (struct cpp_hashnode): Increase flags field to 10 bits, decrease
2577 type to 6 bits.
2578 * init.c (mark_named_operators): Add flags parameter.
2579 (cpp_post_options): Pick flags value to pass to
2580 mark_named_operators.
2581 * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
2582 identifier is an operator name in C++.
2583
b559b9e2 25842009-06-01 Aldy Hernandez <aldyh@redhat.com>
2585
2586 * include/line-map.h (LAST_SOURCE_COLUMN): New.
2587
e61157d7 25882009-06-01 Ian Lance Taylor <iant@google.com>
2589
2590 * include/cpp-id-data.h: Add extern "C".
2591 * include/line-map.h: Likewise.
2592 * include/mkdeps.h: Likewise.
2593 * include/symtab.h: Likewise.
2594 * internal.h: Likewise.
2595
26dbec0a 25962009-05-15 Ian Lance Taylor <iant@google.com>
2597
2598 * include/cpplib.h (enum cpp_builtin_type): Rename from enum
2599 builtin_type. Change all uses.
2600
5b500807 26012009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2602
2603 PR cpp/36674
2604 * directives (do_linemarker): Compensate for the increment in
2605 location that occurs when we reach the end of line.
2606 * files (_cpp_stack_include): Mention _cpp_find_file in the
2607 comment.
2608
2ee04baa 26092009-05-10 Joseph Myers <joseph@codesourcery.com>
2610
2611 * include/cpplib.h (enum cpp_token_fld_kind): Add
2612 CPP_TOKEN_FLD_TOKEN_NO.
2613 (struct cpp_macro_arg, struct cpp_identifier): Define.
2614 (union cpp_token_u): Use struct cpp_identifier for identifiers.
2615 Use struct cpp_macro_arg for macro arguments. Add token_no for
2616 CPP_PASTE token numbers.
2617 * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
2618 do_pragma_poison, parse_assertion): Use val.node.node in place of
2619 val.node.
2620 * expr.c (parse_defined, eval_token): Use val.node.node in place
2621 of val.node.
2622 * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
2623 cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
2624 cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
2625 place of val.arg_no. Use val.node.node in place of val.node.
2626 * macro.c (replace_args, cpp_get_token, parse_params,
2627 lex_expansion_token, create_iso_definition, cpp_macro_definition):
2628 Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
2629 Use val.node.node in place of val.node.
2630
49a657d9 26312009-05-03 Joseph Myers <joseph@codesourcery.com>
2632
2633 * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
2634 UTF-8 sequences.
2635
9c6183dd 26362009-04-25 Joseph Myers <joseph@codesourcery.com>
2637
2638 PR preprocessor/39559
2639 * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
2640 constants larger than intmax_t in C99 mode.
2641
fb1e4f4a 26422009-04-21 Taras Glek <tglek@mozilla.com>
2643
2644 * include/cpp-id-data.h: Update GTY annotations to new syntax.
2645 * include/cpplib.h: Likewise.
2646 * include/line-map.h: Likewise.
2647 * include/symtab.h: Likewise.
2648
ba99525e 26492009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2650
2651 PR c++/14875
2652 * lex.c (cpp_type2name): Take a flags parameter. Call
2653 cpp_named_operator2name for named operators and cpp_digraph2name
2654 for digraphs.
2655 (cpp_digraph2name): New.
2656 (cpp_spell_token): Use it.
2657 (cpp_output_token): Likewise.
2658 * include/cpplib.h (cpp_type2name): Update declaration.
2659 * init.c (cpp_named_operator2name): New.
2660 * internal.h (cpp_named_operator2name): Declare.
2661
9ab71c6b 26622009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2663
2664 PR c++/13358
2665 * init.c (cpp_create_reader): Wlong_long is disabled by default.
2666 * expr.c (cpp_classify_number): Give different messages for C and
2667 C++ front-ends.
2668
941f2388 26692009-04-19 Joseph Myers <joseph@codesourcery.com>
2670
2671 PR preprocessor/20078
2672 * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
2673 field.
2674 * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
2675 (struct cpp_token): Change flags to unsigned short.
2676 * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
2677 (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
2678 (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
2679 tokens.
2680 * macro.c (macro_real_token_count): New.
2681 (enter_macro_context, replace_args): Use macro_real_token_count.
2682 (create_iso_definition): Record whitespace surrounding and digraph
2683 spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
2684 Set extra_tokens and save CPP_PASTE tokens with arg_no set for
2685 multiple consecutive ## tokens.
2686 (_cpp_create_definition): Initialize extra_tokens.
2687 (cpp_macro_definition): Use macro_real_token_count.
2688
3e52c418 26892009-04-18 Joseph Myers <joseph@codesourcery.com>
2690
2691 * directives.c (parse_include): Pass true to check_eol.
2692
1eecdb28 26932009-04-18 Joseph Myers <joseph@codesourcery.com>
2694
2695 PR preprocessor/39646
2696 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
2697 * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
2698 * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
2699 place of LC_RENAME.
2700
6cda323a 27012009-04-18 Joseph Myers <joseph@codesourcery.com>
2702
2703 PR preprocessor/39647
2704 * directives.c (check_eol): Add parameter expand.
2705 (do_undef, parse_include, do_line, do_linemarker, do_ident,
2706 do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
2707 do_else, do_endif, do_assert, do_unassert): All callers changed.
2708 Pass true from do_line, false elsewhere.
2709
e21164ef 27102009-04-12 Joseph Myers <joseph@codesourcery.com>
2711
2712 PR preprocessor/31869
2713 * macro.c (stringify_arg): Handle NULL source token in padding
2714 token where previous padding token did not have source token with
2715 preceding whitespace.
2716
6bc9506f 27172009-04-09 Jakub Jelinek <jakub@redhat.com>
2718
2719 * Makefile.in: Change copyright header to refer to version
2720 3 of the GNU General Public License and to point readers at the
2721 COPYING3 file and the FSF's license web page.
2722 * charset.c: Likewise.
2723 * directives-only.c: Likewise.
2724 * directives.c: Likewise.
2725 * errors.c: Likewise.
2726 * expr.c: Likewise.
2727 * files.c: Likewise.
2728 * identifiers.c: Likewise.
2729 * include/cpp-id-data.h: Likewise.
2730 * include/cpplib.h: Likewise.
2731 * include/line-map.h: Likewise.
2732 * include/mkdeps.h: Likewise.
2733 * include/symtab.h: Likewise.
2734 * init.c: Likewise.
2735 * internal.h: Likewise.
2736 * lex.c: Likewise.
2737 * line-map.c: Likewise.
2738 * macro.c: Likewise.
2739 * makeucnid.c: Likewise.
2740 * mkdeps.c: Likewise.
2741 * pch.c: Likewise.
2742 * symtab.c: Likewise.
2743 * system.h: Likewise.
2744 * traditional.c: Likewise.
2745 * ucnid.tab: Likewise.
2746 * ucnid.h: Regenerate.
2747
5840fdcf 27482009-04-01 Janis Johnson <janis187@us.ibm.com>
2749
f8ed6d41 2750 PR c/39027
2751 * include/cpplib.h (CPP_N_DEFAULT): Define.
2752 * expr.c (interpret_float_suffix): Recognize d or D for double,
2753 return new value for default.
2754 (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
2755
5840fdcf 2756 PR c/33466
2757 * expr.c (interpret_float_suffix): Reject invalid suffix that uses
2758 letters from decimal float and fixed-point suffixes.
2759
ff903809 27602009-03-31 Joseph Myers <joseph@codesourcery.com>
2761
2762 PR preprocessor/15638
2763 * files.c (_cpp_find_file): Call open_file_failed after diagnosing
2764 invalid PCH.
2765 (open_file_failed): Make error for missing file fatal.
2766 * include/cpplib.h (CPP_DL_FATAL): Define.
2767
bfba65a4 27682009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net>
2769
2770 PR preprocessor/31932:
2771 * internal.h: Don't mention HAVE_ICONV_H.
2772 * configure, config.in: Rebuild.
2773 * configure.ac: Don't check for iconv.h.
2774
102a7306 27752009-03-30 Tom Tromey <tromey@redhat.com>
2776
2777 PR preprocessor/39512:
2778 * line-map.c (linemap_init): Initialize 'reallocator' field.
2779
4514949a 27802009-03-30 Jakub Jelinek <jakub@redhat.com>
2781
2782 PR target/39558
2783 * macro.c (cpp_get_token): If macro_to_expand returns NULL
2784 and used some tokens, add CPP_PADDING before next token.
2785
7f5f3953 27862009-03-29 Joseph Myers <joseph@codesourcery.com>
2787
2788 PR preprocessor/34695
2789 * makedepend.c: Remove.
2790 * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
2791 (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
2792 * directives.c (cpp_errors): Remove.
2793 * errors.c (print_location, _cpp_begin_message, v_message):
2794 Remove.
2795 (cpp_error, cpp_error_with_line): Always use error callback.
2796 (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
2797 * include/cpplib.h (cpp_options): Remove pedantic_errors,
2798 inhibit_warnings, warn_system_headers, inhibit_errors,
2799 warnings_are_errors, client_diagnostic.
2800 (cpp_callbacks): Add extra arguments to error callback; make it
2801 return bool.
2802 (cpp_finish): Return void.
2803 (cpp_destroy): Remove inaccurate comment about return value.
2804 (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
2805 (CPP_DL_NOTE): Define.
2806 * include/line-map.h (linemap_print_containing_files): Remove.
2807 * init.c (cpp_finish): Do not check for or return number of
2808 errors.
2809 * internal.h (cpp_reader): Remove errors field.
2810 * line-map.c (linemap_print_containing_files): Remove.
2811 * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
2812 about previous definition. Only emit it if previous diagnostic
2813 was emitted.
2814
d5a78dd0 28152009-03-28 Joseph Myers <joseph@codesourcery.com>
2816
2817 * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
2818 mkinstalldirs.
2819
0ac758f7 28202009-03-18 Jakub Jelinek <jakub@redhat.com>
2821
2822 * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
2823
7811eab5 28242009-02-21 Joseph Myers <joseph@codesourcery.com>
2825
2826 * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
2827 header name.
2828 (_cpp_lex_direct): Handle this.
2829
b5c49426 28302009-02-15 Richard Guenther <rguenther@suse.de>
2831
2832 Revert last change.
2833
76549266 28342009-02-13 Richard Guenther <rguenther@suse.de>
2835
2836 * configure.ac: Enable LFS.
2837 * configure: Re-generate.
2838 * config.in: Likewise.
2839
e7ae053d 28402009-01-05 Ben Elliston <bje@au.ibm.com>
2841
2842 * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
2843 (.po.pox): Likewise.
2844 (po/$(PACKAGE).pot): Likewise.
2845
c1203b1c 28462008-12-10 Alexandre Oliva <aoliva@redhat.com>
2847
2848 PR target/37033
2849 * pch.c (cpp_valid_state): Improve message for poisoned symbols.
2850 Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
2851
cd740bd5 28522008-11-29 Joseph Myers <joseph@codesourcery.com>
2853
2854 * lex.c (cpp_token_len): Use 6 as default length.
2855
ae5c166d 28562008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org>
2857
2858 * expr.c (struct op): Add location.
2859 (_cpp_parse_expr): Propagate locations throught the stack
2860 of expressions.
2861 (reduce): Likewise.
2862 (check_promotion): Use explicit location in errors.
2863
956c6108 28642008-10-05 Matthew Gingell <gingell@adacore.com>
2865 Arnaud Charlet <charlet@adacore.com>
2866
2867 * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
2868 (cpp_get_comments): New function.
2869 * internal.h (struct cpp_reader): Add comments field.
2870 * init.c (cpp_destroy): Free comments.
2871 * lex.c (store_comment, cpp_get_comments): New functions.
2872 (comments): New struct.
2873 (save_comment): Store comments in comments struct.
2874
2ad0b097 28752008-09-18 Simon Baldwin <simonb@google.com>
2876
2877 * include/cpplib.h (struct cpp_options): Add new boolean flag
2878 warn_builtin_macro_redefined.
2879 * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
2880 * (struct builtin_operator): Split out from previous struct builtin,
2881 enhance extra const correctness.
2882 * (struct builtin_macro): Split out from previous struct builtin, add
2883 new always_warn_if_redefined flag, enhance const correctness.
2884 * (mark_named_operators): Use struct builtin_operator.
2885 * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
2886 to builtins selectively.
2887 * macro.c (warn_of_redefinition): Return false if a builtin macro
2888 is not flagged with NODE_WARN.
2889
408c2285 28902008-07-31 Jakub Jelinek <jakub@redhat.com>
2891
2892 PR preprocessor/36649
2893 * files.c (struct report_missing_guard_data): New type.
2894 (report_missing_guard): Put paths into an array instead of printing
2895 them right away. Return 1 rather than 0.
2896 (report_missing_guard_cmp): New function.
2897 (_cpp_report_missing_guards): Sort and print paths gathered by
2898 report_missing_guard callback.
2899
98e29890 29002008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2901
2902 PR 28079
2903 * directives.c (strtolinenum): Handle overflow.
2904 (do_line): Give a warning if line number overflowed.
2905 (do_linemarker): Update call to strtolinenum.
2906
4999c35b 29072008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2908
2909 * include/line-map.h (linenum_type): New typedef.
2910 (struct line_map): Use it.
2911 (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
2912 (SOURCE_COLUMN): Likewise.
2913 * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
2914 source_location values in a variable of type linenum_type.
2915 * directives.c (struct if_stack): Use linenum_type.
2916 (strtoul_for_line): Rename as strtolinenum.
2917 (do_line): Use linenum_type.
2918 (do_linemarker): Use linenum_type and strtolinenum.
2919 (_cpp_do_file_change): Use linenum_t.
2920 * line-map.c (linemap_add): Likewise.
2921 (linemap_line_start): Likewise.
2922 * traditional.c (struct fun_macro): 'line' is a source_location.
2923 * errors.c (print_location): Use linenum_type.
2924 * directives-only.c (_cpp_preprocess_dir_only): Likewise.
2925 * internal.h (CPP_INCREMENT_LINE): Likewise.
2926 * lex.c (_cpp_skip_block_comment): Use source_location.
cc0a8c77 2927
89768577 29282008-07-14 Ben Elliston <bje@au.ibm.com>
2929
2930 * include/cpplib.h (NODE_CONDITIONAL): New.
2931 (struct cpp_callbacks): New macro_to_expand field.
2932 (struct cpp_hashnode): Adjust size of flags and type fields.
2933 (cpp_peek_token): Prototype.
2934 * lex.c (cpp_peek_token): New function.
2935 (_cpp_temp_token): Protect pre-existing lookaheads.
2936 * macro.c (cpp_get_token): Expand any conditional macros.
2937 (_cpp_backup_tokens_direct): New.
2938 (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
2939 (warn_of_redefinition): Silently allow redefined conditional
2940 macros.
2941 (_cpp_create_definition): Remove the conditional flag when a user
2942 defines one of the conditional macros.
2943 * internal.h (_cpp_backup_tokens_direct): New prototype.
2944
403c2b12 29452008-06-13 Andrew Haley <aph@redhat.com>
2946
2947 PR preprocessor/33305
2948 * macro.c (replace_args): Print a warning for empty macro
2949 arguments in C89 and C++.
2950
5b2c7553 29512008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2952
2953 * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
2954 * configure: Regenerate.
2955
b9de6413 29562008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2957
2958 * Makefile.in (datarootdir): New variable.
2959
bfa57d81 29602008-06-12 H.J. Lu <hongjiu.lu@intel.com>
2961
2962 PR preprocessor/36479
2963 * charset.c (cpp_interpret_string_notranslate): Also set
2964 narrow_cset_desc.width.
2965
6af9f7ea 29662008-06-07 Joseph Myers <joseph@codesourcery.com>
2967
2968 * configure.ac (parisc*64*-*-*): Remove.
2969 * configure: Regenerate.
2970
536a48ee 29712008-05-30 Tom Tromey <tromey@redhat.com>
2972
2973 PR preprocessor/36320:
2974 * internal.h (_cpp_parse_expr): Update.
2975 * expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error
2976 messages.
2977 * directives.c (do_if): Update.
2978 (do_elif): Require expression if processing group.
2979
f4d02485 29802008-05-30 Danny Smith <dannysmith@users.sourceforge.net>
2981
2982 * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
2983
c0770282 29842008-05-21 Tom Tromey <tromey@redhat.com>
2985
2986 PR preprocessor/27777:
2987 * lex.c (cpp_output_line_to_string): New function.
2988 * internal.h (_cpp_begin_message): Don't declare.
2989 * errors.c (_cpp_begin_message): Now static.
2990 * include/cpplib.h (cpp_output_line_to_string): Declare.
2991 * directives.c (do_diagnostic): Rewrote. Use
2992 cpp_output_line_to_string. Don't use _cpp_begin_message.
2993
dfecde36 29942008-05-21 Tom Tromey <tromey@redhat.com>
2995
2996 * include/symtab.h (HT_ALLOCED): Remove.
2997 (ht_purge): Declare.
2998 * symtab.c (DELETED): New define.
2999 (ht_lookup): Update comment.
3000 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED
3001 code. Use subobject allocator for strings, if it exists.
3002 (ht_expand): Handle deleted entries.
3003 (ht_forall): Likewise.
3004 (ht_purge): New function.
3005 (ht_dump_statistics): Print deletion statistics.
3006
fb9753dc 30072008-05-13 Tom Tromey <tromey@redhat.com>
3008
3009 PR preprocessor/22168:
3010 * include/cpplib.h (struct cpp_options) <objc>: Update
3011 documentation.
3012 * expr.c (eval_token): Warn for use of assertions.
3013 * directives.c (directive_diagnostics): Warn about extensions.
3014 (DEPRECATED): New define.
3015 (DIRECTIVE_TABLE): Use it.
3016
151e90cc 30172008-05-06 Tom Tromey <tromey@redhat.com>
3018
3019 PR preprocessor/35313, PR preprocessor/36088:
3020 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
3021 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
3022
2cd62354 30232008-05-04 David S. Miller <davem@davemloft.net>
3024
3025 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
3026 * configure: Regenerate.
3027
85e51d59 30282008-04-22 Daniel Franke <franke.daniel@gmail.com>
3029
3030 * include/cpplib.h (cpp_define_formatted): New.
3031 * directives.c (cpp_define_formatted): New.
3032
d656d07a 30332008-04-21 Tom Tromey <tromey@redhat.com>
3034
3035 PR libcpp/33415:
3036 * charset.c (_cpp_convert_input): Add buffer_start argument.
3037 Ignore UTF-8 BOM if seen.
3038 * internal.h (_cpp_convert_input): Add argument.
3039 * files.c (struct _cpp_file) <buffer_start>: New field.
3040 (destroy_cpp_file): Free buffer_start, not buffer.
3041 (_cpp_pop_file_buffer): Likewise.
3042 (read_file_guts): Update.
3043
924bbf02 30442008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
3045
3046 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
3047 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
3048 (struct cpp_options): Added uliterals.
3049 (cpp_interpret_string): Update prototype.
3050 (cpp_interpret_string_notranslate): Idem.
3051 * charset.c (init_iconv_desc): New width member in cset_converter.
3052 (cpp_init_iconv): Add support for char{16,32}_cset_desc.
3053 (convert_ucn): Idem.
3054 (emit_numeric_escape): Idem.
3055 (convert_hex): Idem.
3056 (convert_oct): Idem.
3057 (convert_escape): Idem.
3058 (converter_for_type): New function.
3059 (cpp_interpret_string): Use converter_for_type, support u and U prefix.
3060 (cpp_interpret_string_notranslate): Match changed prototype.
3061 (wide_str_to_charconst): Use converter_for_type.
3062 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
3063 * directives.c (linemarker_dir): Macro U changed to UC.
3064 (parse_include): Idem.
3065 (register_pragma_1): Idem.
3066 (restore_registered_pragmas): Idem.
3067 (get__Pragma_string): Support CPP_STRING{16,32}.
3068 * expr.c (eval_token): Support CPP_CHAR{16,32}.
3069 * init.c (struct lang_flags): Added uliterals.
3070 (lang_defaults): Idem.
3071 * internal.h (struct cset_converter) <width>: New field.
3072 (struct cpp_reader) <char16_cset_desc>: Idem.
3073 (struct cpp_reader) <char32_cset_desc>: Idem.
3074 * lex.c (digraph_spellings): Macro U changed to UC.
3075 (OP, TK): Idem.
3076 (lex_string): Add support for u'...', U'...', u"..." and U"...".
3077 (_cpp_lex_direct): Idem.
3078 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
3079 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
3080
6a88da51 30812008-04-18 Paolo Bonzini <bonzini@gnu.org>
3082
3083 PR bootstrap/35457
3084 * aclocal.m4: Regenerate.
3085 * configure: Regenerate.
3086
6e6d82ef 30872008-04-17 Tom Tromey <tromey@redhat.com>
3088
3089 PR libcpp/34866:
3090 * errors.c (cpp_error): Don't reference a token before the start
3091 of the current run.
3092
f521616b 30932008-04-16 Tom Tromey <tromey@redhat.com>
3094
3095 * Makefile.in (TAGS_SOURCES): New variable.
3096 (TAGS): New target.
3097
fc7383ad 30982008-04-11 Kaz Kojima <kkojima@gcc.gnu.org>
3099
3100 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
3101 and shbe-*-*.
3102 * configure: Rebuilt.
3103
34c3de48 31042008-04-02 Joseph Myers <joseph@codesourcery.com>
3105
3106 * include/cpplib.h (struct cpp_callbacks): Add used_define,
3107 used_undef and before_define.
3108 (NODE_USED): Define.
3109 * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
3110 do_ifndef, cpp_pop_definition): Handle new flag and use new
3111 callbacks.
3112 * expr.c (parse_defined): Handle new flag and use new callbacks.
3113 * macro.c (enter_macro_context, _cpp_free_definition): Handle new
3114 flag and use new callbacks.
3115
f2225b1a 31162008-04-01 Jakub Jelinek <jakub@redhat.com>
3117
3118 PR pch/13675
3119 * files.c (struct _cpp_file): Remove pch field.
3120 (pch_open_file): Don't set file->pch, just file->pchname.
3121 (should_stack_file): After pfile->cb.read_pch call
3122 free pchname and clear pchname, don't close file->fd.
3123 Test file->pchname instead of file->pch. Don't close fd after cb.
3124 (_cpp_stack_include): Test file->pchname instead of file->pch.
3125
5a959782 31262008-03-28 Tom Tromey <tromey@redhat.com>
3127
3128 * Makefile.in (POSTCOMPILE): New variable.
3129 (.c.o): Use it.
3130
8302ff7f 31312008-03-13 Tom Tromey <tromey@redhat.com>
3132
3133 PR libcpp/35322:
3134 * directives.c (destringize_and_run): Set pfile->directive.
3135
8bd452d9 31362008-03-06 Markus Milleder <markus.milleder@generali.at>
3137
3138 PR preprocessor/35458
3139 * mkdeps.c (munge): Quote '#' with a '\'.
3140
0c62b06e 31412008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3142
3143 PR preprocessor/35379
3144 * mkdeps.c (deps_write): Ensure the first target always appears
3145 in the first column, without leading backslash newline. Avoid
3146 some more extra whitespace.
3147
6b0c1373 31482008-02-25 Thiemo Seufer <ths@mips.com>
3149
0c62b06e 3150 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
6b0c1373 3151
e297899b 31522008-02-19 Tom Tromey <tromey@redhat.com>
3153
3154 * traditional.c (lex_identifier): Use CPP_HASHNODE.
3155 * lex.c (lex_identifier): Use CPP_HASHNODE.
3156 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
3157 do-while.
3158 * identifiers.c (alloc_node): Change return type.
3159 (_cpp_init_hashtable): Don't cast 'alloc_node'.
3160 (proxy_assertion_broken): New declaration.
3161 (cpp_forall_identifiers): Move comment.
3162 * line-map.c (linemap_add): Comment fix.
3163 (linemap_line_start): Indentation fix.
3164
45f9f140 31652008-01-25 Jakub Jelinek <jakub@redhat.com>
3166
3167 PR preprocessor/34692
3168 * macro.c (collect_args): Add pragma_buff argument. Push
3169 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
3170 than into arguments. Reset prevent_expansion and parsing_args
3171 state at CPP_PRAGMA_EOL/CPP_EOF.
3172 (funlike_invocation_p): Add pragma_buff argument, pass it through
3173 to collect_args.
3174 (enter_macro_context): Add result argument. Adjust
3175 funlike_invocation_p caller. Emit all deferred pragma tokens
3176 gathered during collect_args before the expansion, add a padding
3177 token. Return 2 instead of 1 if any pragma tokens were prepended.
3178 (cpp_get_token): If enter_macro_context returns 2, don't return
3179 a padding token, instead cycle to grab CPP_PRAGMA token.
3180 * directives.c (_cpp_handle_directive): If was_parsing_args
3181 in deferred pragma, leave parsing_args and prevent_expansion as is.
3182
a56d0856 31832008-01-22 Tom Tromey <tromey@redhat.com>
3184
45f9f140 3185 PR c++/34859
a56d0856 3186 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
3187 __STDC_CONSTANT_MACROS.
3188
7a1a608c 31892008-01-07 Fred Fish <fnf@specifix.com>
3190
45f9f140 3191 PR preprocessor/30363
7a1a608c 3192 * traditional.c (replace_args_and_push): Add local variable
cc0a8c77 3193 cxtquote, calculate the replacement text size assuming a
7a1a608c 3194 worst case of every input character quoted with backslash,
3195 and properly handle output quoting of quote characters in
3196 actual arguments used in function-like macros.
3197
cde59b72 31982008-01-03 Tom Tromey <tromey@redhat.com>
3199
45f9f140 3200 PR preprocessor/34602
cde59b72 3201 * directives.c (do_line): Don't try to spell EOF token.
3202 (do_linemarker): Add comment.
3203
2d1f9589 32042007-12-11 DJ Delorie <dj@redhat.com>
3205
3206 * charset.c (convert_using_iconv): Close out any shift states,
3207 returning to the initial state.
3208
64cb8c90 32092007-12-06 Tom Tromey <tromey@redhat.com>
3210
45f9f140 3211 PR c/29172
64cb8c90 3212 * internal.h (struct cpp_reader) <file_hash_entries>: Changed
3213 type.
3214 <file_hash_entries_allocated, file_hash_entries_used>: Removed.
3215 * files.c (FILE_HASH_POOL_SIZE): New macro.
3216 (struct file_hash_entry_pool): New.
3217 (destroy_all_cpp_files): New function.
3218 (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
3219 (new_file_hash_entry): Update.
3220 (free_file_hash_entries): New function.
3221 (_cpp_cleanup_files): Call free_file_hash_entries and
3222 destroy_all_cpp_files.
3223 (cpp_clear_file_cache): New function.
3224 * include/cpplib.h (cpp_clear_file_cache): Declare.
3225
d08a0ab3 32262007-12-03 Tom Tromey <tromey@redhat.com>
3227
45f9f140 3228 PR preprocessor/34288
d08a0ab3 3229 * configure.ac, config.in: Rebuilt.
3230 * configure.ac: Check for ssize_t.
3231
5eb3761c 32322007-11-30 Tom Tromey <tromey@redhat.com>
3233
45f9f140 3234 PR preprocessor/32868
5eb3761c 3235 * macro.c (_cpp_create_definition): Special case
3236 __STDC_FORMAT_MACROS.
3237
bce619a6 32382007-11-16 Michael Matz <matz@suse.de>
3239
3240 * files.c (search_path_head): Fix check for absolute paths.
3241
67015c73 32422007-11-11 Tom Tromey <tromey@redhat.com>
3243
45f9f140 3244 PR c++/17557
67015c73 3245 * include/cpplib.h (cpp_included_before): Declare.
3246 * files.c (struct file_hash_entry) <location>: New field.
3247 (_cpp_find_file): Initialize new field.
3248 (make_cpp_dir): Likewise.
3249 (cpp_included_before): New function.
3250
1991d8eb 32512007-11-01 Tom Tromey <tromey@redhat.com>
3252
45f9f140 3253 PR preprocessor/30805
1991d8eb 3254 * macro.c (paste_tokens): Handle padding token.
3255 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
3256
2d507e67 32572007-10-31 Tom Tromey <tromey@redhat.com>
3258
45f9f140 3259 PR preprocessor/30786
2d507e67 3260 * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
3261 * directives.c (_cpp_do__Pragma): Return error status.
3262 * internal.h (_cpp_do__Pragma): Update.
3263 * directives.c (get__Pragma_string): Back up if EOF seen.
3264
931b0a0f 32652007-09-06 Tom Tromey <tromey@redhat.com>
3266
3267 * internal.h (struct cpp_reader) <invocation_location>: New
3268 field.
3269 (struct cpp_reader) <set_invocation_location>: Likewise.
3270 * init.c (cpp_set_line_map): New function.
3271 * line-map.c (linemap_add): Use linemap's allocator.
3272 * include/line-map.h (GTY): Define.
3273 (line_map_realloc): New typedef.
3274 (struct line_map): Mark with GTY.
3275 (struct line_maps): Likewise.
3276 (struct line_maps) <maps>: Likewise.
3277 (struct line_maps) <reallocator>: New field.
3278 * include/symtab.h (GTY): Conditionally define.
3279 * include/cpplib.h (cpp_set_line_map): Declare.
3280 (cpp_get_token_with_location): Declare.
3281 * macro.c (cpp_get_token): Set invocation_location on the reader.
3282 (cpp_get_token_with_location): New function.
3283
84373723 32842007-08-30 Chao-ying Fu <fu@mips.com>
3285
3286 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
3287 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
3288 (cpp_classify_number): Support decimal fixed-point constants without
3289 exponents.
3290 Warn about fixed-point constants when -pedantic.
3291 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
3292 comments to support fixed-point values.
3293 (CPP_N_FRACT, CPP_N_ACCUM): Define.
3294
36ec4203 32952007-08-18 Tom Tromey <tromey@redhat.com>
3296
45f9f140 3297 PR preprocessor/32974
36ec4203 3298 * directives.c (parse_include): Don't check for EOL when
3299 processing #pragma dependency.
3300
fcde64dc 33012007-07-30 Ollie Wild <aaw@google.com>
3302
3303 * directives-only.c: New file.
3304 * internal.h (struct _cpp_dir_only_callbacks): New.
3305 (_cpp_preprocess_dir_only): New function.
3306 * directives.c (_cpp_handle_directive): Check directives_only before
3307 disabling execution of indented directives.
3308 * files.c (_cpp_stack_file): Add directives_only check.
3309 * include/cpplib.h (struct cpp_options): Add directives_only.
3310 (cpp_init_special_builtins): New function.
3311 * init.c (cpp_init_special_builtins): New function.
3312 (cpp_init_builtins): Move builtin_array initialization to
3313 cpp_init_special_builtins.
3314 (post_options): Check directives_only before setting
3315 pfile->state.prevent_expansion = 1.
3316 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
3317 is expanded inside a directive while -fdirectives-only is enabled.
3318 * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
3319 (libcpp_a_SOURCES): Add directives-only.c.
3320
ddedd1e1 33212007-07-04 Uros Bizjak <ubizjak@gmail.com>
3322
3323 * traditional.c (_cpp_scan_out_logical_line): Initialize
3324 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
3325 fmacro.args to prevent 'may be used uninitialized' warning.
3326
430be8e2 33272007-07-03 Uros Bizjak <ubizjak@gmail.com>
3328
3329 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
3330 Add new constants.
3331 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
3332 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
3333 for 'q' or 'Q' suffixes.
3334
909dc303 33352007-06-17 Danny Smith <dannysmith@users.sourceforge.net
3336
857d7d5e 3337 * files.c (open_file): Correct typo.
909dc303 3338
7d6f49d6 33392007-06-16 Vladimir Prus <vladimir@codesourcery.com>
3340
857d7d5e 3341 * files.c (open_file): Prevent the call
7d6f49d6 3342 for stat from overwriting errno.
3343
be21d64c 33442007-06-09 Vladimir Prus <vladimir@codesourcery.com>
3345
857d7d5e 3346 * files.c (open_file): Account for the
cc0a8c77 3347 fact that on windows, opening a directory gives
3348 EACCES.
be21d64c 3349
d7282a2b 33502007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
3351
3352 PR preprocessor/23479
3353 * expr.c (cpp_classify_number): Implement 0b-prefixed binary
3354 integer constants.
3355 (append_digit): Likewise.
3356 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
3357 binary integer constants.
3358
0448520c 33592007-05-31 Dave Korn <dave.korn@artimi.com>
3360
3361 PR preprocessor/14331
3362 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
3363
ce079f70 33642007-05-24 Ollie Wild <aaw@google.com>
3365
3366 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
3367 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
3368 (cpp_write_pch_state): Save __COUNTER__ state.
3369 (cpp_valid_state): Check valid __COUNTER__ state.
3370 (cpp_read_state): Read new __COUNTER__ state.
3371 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
3372 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
3373 * internal.h (struct cpp_reader): Add counter member.
3374
3b6c638e 33752007-05-23 Simon Martin <simartin@users.sourceforge.net>
3376
3377 PR preprocessor/20077
3378 * macro.c (create_iso_definition): Fixed the method to determine
3379 whether the token-pasting operator appears at the beginning or the end
3380 of a macro.
3381
248dfc42 33822007-05-21 Ian Lance Taylor <iant@google.com>
3383
3384 * internal.h (struct cpp_reader): Add new fields:
3385 nonexistent_file_hash and nonexistent_file_ob.
3386 * files.c: Include "obstack.h".
3387 (find_file_in_dir): Before trying to open the file, look up the
3388 path name in the hash table of nonexistent files. After failing
3389 to open the file, add the path name to the hash table.
3390 (_cpp_find_file): Cache the results of looking up the file name
3391 starting with the quote and bracket chain heads, if we can.
3392 (nonexistent_file_hash_eq): New static function.
3393 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
3394 pfile->nonexistent_file_ob.
3395 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
3396 pfile->nonexistent_file_ob.
3397
c55e2f1b 33982007-05-14 Janis Johnson <janis187@us.ibm.com>
3399
cc0a8c77 3400 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
5c00409a 3401
c55e2f1b 3402 PR c/31924
3403 * expr.c (interpret_float_suffix): Check for invalid suffix.
3404
dd97b5e4 34052007-05-02 Eric Christopher <echristo@apple.com>
3406
3407 * expr.c (num_div_op): Don't overflow if the result is
3408 zero.
3409
3127c357 34102007-05-02 Tom Tromey <tromey@redhat.com>
3411
45f9f140 3412 PR preprocessor/28709
3127c357 3413 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
3414
f23c2abe 34152007-03-30 Michael Meissner <michael.meissner@amd.com>
3416
3417 * directives.c (lex_macro_node_from_str): Fix alloca call to be
3418 type correct.
3419
3fa3949d 34202007-03-30 Richard Henderson <rth@redhat.com>
3421
3422 * directives.c (lex_macro_node_from_str): New.
3423 (cpp_push_definition, cpp_pop_definition): New.
3424 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
3425
7262ccd6 34262007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
3427
3428 * Makefile.in: Add dummy install-pdf target.
3429
09edb0e9 34302007-01-30 Tom Tromey <tromey@redhat.com>
3431
45f9f140 3432 PR preprocessor/30468
09edb0e9 3433 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
3434 './'.
3435
e0ff7935 34362007-01-30 Tom Tromey <tromey@redhat.com>
3437
45f9f140 3438 PR preprocessor/29966
e0ff7935 3439 * macro.c (lex_expansion_token): Save and restore cpp_reader's
3440 cur_token.
3441 (_cpp_create_definition): Don't restore cur_token here.
3442 * lex.c (_cpp_lex_token): Added assertion.
3443
87d210c3 34442007-01-27 Tom Tromey <tromey@redhat.com>
3445
3446 * configure: Rebuilt.
3447
3e2a04b5 34482007-01-12 Tom Tromey <tromey@redhat.com>
3449
45f9f140 3450 PR preprocessor/28227
3e2a04b5 3451 * directives.c (lex_macro_node): Added 'is_def_or_undef'
3452 argument.
3453 (do_define): Update.
3454 (do_undef): Update.
3455 (do_ifdef): Update.
3456 (do_ifndef): Update.
3457
6a6e7e2f 34582007-01-11 Paolo Bonzini <bonzini@gnu.org>
3459
3460 * configure: Regenerate.
3461
77258a2e 34622007-01-11 Paolo Bonzini <bonzini@gnu.org>
3463
3464 * configure: Regenerate.
3465
927b511f 34662007-01-04 Tom Tromey <tromey@redhat.com>
3467
45f9f140 3468 PR preprocessor/28165
927b511f 3469 * internal.h (cpp_in_primary_file): New function.
3470 * directives.c (do_include_next): Use cpp_in_primary_file.
3471 (do_pragma_once): Likewise.
3472 (do_pragma_system_header): Likewise.
3473
5008f5c5 34742006-12-29 Ian Lance Taylor <iant@google.com>
3475
3476 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
3477 look backward at the end of the line unless we saw a backslash.
3478
5d70627e 34792006-12-29 Jakub Jelinek <jakub@redhat.com>
3480
3481 PR preprocessor/29612
3482 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
3483 only when new_sysp is non-zero.
3484
854f075e 34852006-12-28 Tom Tromey <tromey@redhat.com>
3486
45f9f140 3487 PR preprocessor/30001
854f075e 3488 * charset.c (_cpp_convert_input): Check that to.len is greater
3489 than zero.
3490
644459d0 34912006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
3492
3493 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
db375b8e 3494 * configure: Rebuilt.
644459d0 3495
093aec7c 34962006-11-01 Douglas Gregor <doug.gregor@gmail.com>
3497
3498 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
3499 for experimental C++0x mode.
3500 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
3501 adopted the preprocessor changes introduced in C99.
3502
54bb64fb 35032006-10-29 Joseph Myers <joseph@codesourcery.com>
3504
3505 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
3506 depending on --enable-targets=all.
3507 * configure: Regenerate.
3508
46139d3f 35092006-10-12 Jakub Jelinek <jakub@redhat.com>
3510
3511 PR preprocessor/28709
3512 * macro.c (paste_tokens): Do error reporting here, use BUF with the
3513 spelled LHS token as opposed to spelling it again.
3514 (paste_all_tokens): Don't report errors here, just break on failure.
3515
51f93521 35162006-10-10 Brooks Moses <bmoses@stanford.edu>
3517
3518 * Makefile.in: Added empty "pdf" target.
3519
32bca58b 35202006-09-22 Geoffrey Keating <geoffk@apple.com>
3521
3522 * configure.ac: Make need_64_bit_hwint case for x86-darwin
3523 match exactly the glob in gcc/config.gcc.
3524 * configure: Regenerate.
3525
0b67f687 35262006-09-13 Joseph S. Myers <joseph@codesourcery.com>
3527
3528 PR c/28768
3529 PR preprocessor/14634
3530 * lex.c (lex_string): Pedwarn for unterminated literals.
3531
3ebc7dec 35322006-09-08 Eric Christopher <echristo@apple.com>
3533
3534 * configure.ac: Add 64-bit HWI support for i?86-darwin.
3535
e58c07f7 35362006-08-14 Steve Ellcey <sje@cup.hp.com>
3537
3538 PR c++/28288
3539 PR c++/14556
3540 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
3541 (CPP_LAST_EQ): Change.
3542 (CPP_LAST_PUNCTUATOR): Change.
3543 * expr.c (cpp_operator): Remove MIN and MAX.
3544 (reduce): Remove CPP_MIN and CPP_MAX.
3545 (num_binary_op): Ditto.
3546 * lex.c (_cpp_lex_direct): Ditto.
3547 (cpp_avoid_paste): Remove ? as legal symbol after > or <.
3548
add258d7 35492006-06-09 Jakub Jelinek <jakub@redhat.com>
3550
3551 PR preprocessor/27746
3552 * directives.c (do_pragma): Handle pragma with valid namespace
3553 and invalid name coming from macro expansion.
3554 * directives.c (destringize_and_run): Initialize next field in
3555 context.
3556
3557 PR c/27747
3558 PR c++/27748
3559 * directives.c (destringize_and_run): Set NO_EXPAND on the
3560 tokens.
3561
3562 * macro.c (_cpp_backup_tokens): Fix comment typo.
3563
49688a56 35642006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
3565
3566 * Makefile.in (CATALOGS): Add po/ prefix.
3567 * configure: Regenerated.
3568
8f597c12 35692006-05-23 Carlos O'Donell <carlos@codesourcery.com>
3570
3571 * Makefile.in: Add install-html target. Add install-html to .PHONY
3572
cca5dddc 35732006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
3574
3575 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
3576 * files.c (_cpp_get_file_stat): New function.
3577 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
3578 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
3579 * internal.h (_cpp_get_file_stat): Prototype.
3580 (struct cpp_buffer): Add timestamp.
3581
31614f7c 35822006-01-23 Jakub Jelinek <jakub@redhat.com>
3583
3584 PR preprocessor/25717
3585 * init.c (cpp_init_builtins): If __STDC__ will not change value
3586 between system headers and other sources, define it as a normal
3587 macro rather than a builtin.
3588 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
3589 cpp_in_system_header condition.
3590
35912006-01-05 Paolo Bonzini <bonzini@gnu.org>
3c77e017 3592
3593 * Makefile.in: Use -MMD instead of -MD.
3594
b75b98aa 35952006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
3596 Richard Henderson <rth@redhat.com>
3597
3598 Merge from gomp branch:
3599 * directives.c (struct pragma_entry): Add is_deferred. Add ident
3600 entry to value union.
3601 (end_directive): Don't eat the line if in_deferred_pragma.
3602 (run_directive): Remove pragma hacks.
3603 (insert_pragma_entry): Remove.
3604 (new_pragma_entry): New.
3605 (register_pragma_1): Split out of register_pragma. Only handle
3606 the lookup tree and return the new entry.
3607 (cpp_register_pragma): Fill in the pragma entry here.
3608 (cpp_register_deferred_pragma): New.
3609 (register_pragma_internal): New.
3610 (_cpp_init_internal_pragmas): Use register_pragma_internal.
3611 (do_pragma): Allow pragma expansion after namespace. For deferred
3612 pragmas, don't slurp the line into a string.
3613 (destringize_and_run): Save tokens for deferred pragmas.
3614 (cpp_handle_deferred_pragma): Remove.
3615 * macro.c (builtin_macro): Remove pragma token hack.
3616 (_cpp_push_token_context): Rename from push_token_context and export.
3617 * internal.h (struct lexer_state): Add pragma_allow_expansion.
3618 (_cpp_push_token_context): Declare.
3619 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
3620 a token. Update the line number correctly if so.
3621 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
3622 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
3623 * include/cpplib.h (PRAGMA_EOL): New.
3624 (CPP_TOKEN_FLD_PRAGMA): New.
3625 (struct cpp_token): Add val.pragma.
3626 (struct cpp_options): Remove defer_pragmas.
3627 (cpp_handle_deferred_pragma): Remove.
3628 (cpp_register_deferred_pragma): Declare.
3629
986ca356 36302006-01-01 Jakub Jelinek <jakub@redhat.com>
3631
3632 PR c++/25294
3633 * directives.c (do_pragma): If pragma line ends with multi-line
3634 block comment, end the saved deferred pragma string before that
3635 comment. Handle embedded '\0' chars on the pragma line.
3636
8dba02f7 36372005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
3638
3639 PR c++/23333
3640 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
3641
6db045b0 36422005-12-07 Jon Grimm <jgrimm2@us.ibm.com>
3643 Ben Elliston <bje@au.ibm.com>
3644
3645 * include/cpplib.h (CPP_N_DFLOAT): New.
3646 * expr.c (interpret_float_suffix): Identify df, dd, and dl
3647 suffixes as decimal floating point constants.
3648 (cpp_classify_number): Disallow hexadecimal DFP constants.
3649
9a7c76f9 36502005-11-14 Gerald Pfeifer <gerald@pfeifer.com>
b75b98aa 3651 Ian Lance Taylor <ian@airs.com>
9a7c76f9 3652
3653 * include/cpplib.h (struct cpp_callbacks): Annotate error with
3654 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
3655
0c5e3a3d 36562005-11-09 Per Bothner <per@bothner.com>
3657 Uros Bizjak <uros@kss-loka.si>
3ebc7dec 3658
0c5e3a3d 3659 PR c/24101
3660 * init.c (read_original_filename): Temporarily set
3661 state.in_directive before calling _cpp_lex_direct for
3662 CPP_HASH tokens.
3663
3c2359db 36642005-11-03 James E Wilson <wilson@specifix.com>
3665
3666 PR preprocessor/24202
3667 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
3668
d65b3a40 36692005-11-04 Joseph S. Myers <joseph@codesourcery.com>
3670
3671 * include/cpplib.h (struct cpp_callbacks): Make error take
3672 va_list* parameter.
3673 * errors.c (cpp_error): Update call to callback.
3674
cc9012f7 36752005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
3676
3677 PR preprocessor/22042
3678 * macro.c (_cpp_builtin_macro_text): Lower the needed max
3679 buffer size.
3680 (cpp_quote_string): Don't octalify non printable
3681 charactors.
3682
eb0d20b7 36832005-11-03 Joseph S. Myers <joseph@codesourcery.com>
3684
3685 PR c++/17964
3686 * include/cpplib.h (struct cpp_options): Add client_diagnostic.
3687 (struct cpp_callbacks): Add error.
3688 * errors.c (cpp_error): If client_diagnostic, use error callback.
3689 * charset.c (convert_escape): Don't use %03o in diagnostic.
3690
de4aacc0 36912005-10-21 James E Wilson <wilson@specifix.com>
04c0bfd0 3692
3693 PR preprocessor/15220
3694 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all
3695 callers. Pass to open_file_failed.
3696 (open_file_failed): New parameter angle_brackets. Fix all callers.
3697 Use in print_dep assignment.
3698 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
3699 * internal.h (_cpp_find_file): Add new parm to declaration.
3ebc7dec 3700
6783d878 37012005-10-08 Kazu Hirata <kazu@codesourcery.com>
3702
3703 * configure.ac: Require 64-bit int for arm*-*-*eabi*.
3704 * configure: Regenerate.
3705
f789fe3e 37062005-10-04 Ian Lance Taylor <ian@airs.com>
3707
3708 PR preprocessor/13726
3709 * directives.c (check_eol_return_comments): New static function.
3710 (parse_include): Add buf parameter. Change all callers.
3711 (do_include_common): If not discard comments, turn on
3712 save_comments. Pass collected comments to include callback.
3713 * include/cpplib.h (struct cpp_callbacks): Add new parameter to
3714 include callback: cpp_token list.
3715
865c4e44 37162005-09-20 Joseph S. Myers <joseph@codesourcery.com>
3717
3718 * include/cpplib.h (struct cpp_options): Add extended_identifiers.
3719 * init.c (struct lang_flags, lang_defaults): Add
3720 extended_identifiers.
3721 (cpp_set_lang): Use it.
3722 * lex.c (forms_identifier_p): Check extended_identifiers.
3723
56845aa6 37242005-08-30 Jakub Jelinek <jakub@redhat.com>
3725
3726 PR preprocessor/20348
3727 PR preprocessor/20356
3728 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
3729 2004-06-05 changes.
3730
72ee8ff9 37312005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3732
3733 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
3734 -Wmissing-format-attribute.
3735
3736 * configure: Regenerate.
3737
2656917a 37382005-06-29 Kelley Cook <kcook@gcc.gnu.org>
3739
3740 * all files: Update FSF address in copyright headers.
3741 * makeucnid.c (write_copyright): Update outputted FSF address.
3742
cbaa9876 37432005-06-13 Zack Weinberg <zack@codesourcery.com>
3744
3745 * configure.ac: Invoke ZW_CREATE_DEPDIR and
3746 ZW_PROG_COMPILER_DEPENDENCIES.
3747 * aclocal.m4, configure: Regenerate.
3748 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
3749 New variables.
3750 (distclean): Clean up $(DEPDIR) and its contents.
3751 (.c.o): Use $(COMPILE).
3752 Include $(DEPDIR)/*.Po for most object->header dependencies.
3753
720aca92 37542005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
3755
3756 * configure.ac: Check declarations for asprintf and vasprintf.
3757 * config.in: Regenerate.
3758 * configure: Likewise.
3759
3760 * charset.c (conversion_loop): Use XRESIZEVEC.
3761 (convert_no_conversion): Likewise.
3762 (convert_using_iconv): Likewise.
3763 (init_iconv_desc): Cast return value of alloca.
3764 (cpp_host_to_exec_charset): Use XNEWVEC.
3765 (emit_numeric_escape): Use XRESIZEVEC.
3766 (cpp_interpret_string): Use XNEWVEC.
3767 (cpp_interpret_string): Use XRESIZEVEC.
3768 (_cpp_interpret_identifier): Cast return value of alloca.
3769 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
3770 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
3771 (parse_include): Use XNEWVEC.
3772 (insert_pragma_entry): Rename local variable "new" to
cbaa9876 3773 "new_entry".
720aca92 3774 (save_registered_pragmas): Cast return value of xmemdup.
3775 (destringize_and_run): Same for alloca.
3776 (parse_assertion): Likewise.
3777 (do_assert): Cast allocated storage to proper type.
3778 (cpp_define): Likewise.
3779 (_cpp_define_builtin): Likewise.
3780 (cpp_undef): Likewise.
3781 (handle_assertion): Likewise.
3782 (cpp_push_buffer): Rename local variable "new" to "new_buffer".
3783 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
3784 (CPP_UMINUS): Likewise.
3785 (struct cpp_operator): Rename from struct operator.
3786 (_cpp_expand_op_stack): Use XRESIZEVEC.
3787 * files.c (pch_open_file): Use XNEWVEC.
3788 (pch_open_file): Use XRESIZEVEC.
3789 (read_file_guts): Use XNEWVEC and XRESIZEVEC.
3790 (dir_name_of_file): Use XNEWVEC.
3791 (make_cpp_file): Use XCNEW.
3792 (make_cpp_dir): Likewise.
3793 (allocate_file_hash_entries): USE XNEWVEC.
3794 (cpp_included): Cast return value of htab_find_with_hash.
3795 (append_file_to_dir): Use XNEWVEC.
3796 (read_filename_string): Likewise. Use XRESIZEVEC too.
3797 (read_name_map): Cast return value of alloca. Use XRESIZEVEC.
3798 (remap_filename): Use XNEWVEC.
3799 (struct pchf_entry): Move definition out of struct pchf_data.
3800 (_cpp_save_file_entries): Use XCNEWVAR.
3801 (_cpp_read_file_entries): Use XNEWVAR.
3802 * identifiers.c (alloc_node): Use XOBNEW.
3803 * init.c (cpp_create_reader): Use XCNEW.
3804 (cpp_init_builtins): Cast of b->value to enum builtin_type.
3805 (read_original_directory): Cast return value of alloca.
3806 * lex.c (add_line_note): Use XRESIZEVEC.
3807 (warn_about_normalization): Use XNEWVEC.
3808 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
3809 (new_buff): Use XNEWVEC.
3810 * line-map.c (linemap_add): Use XRESIZEVEC.
3811 * macro.c (builtin_macro): Cast return value of alloca.
3812 (paste_tokens): Likewise.
3813 (expand_arg): Use XNEWVEC and XRESIZEVEC.
3814 (_cpp_save_parameter): Use XRESIZEVEC.
3815 (create_iso_definition): Cast allocated storage to proper type.
3816 (_cpp_create_definition): Likewise.
3817 (cpp_macro_definition): Use XRESIZEVEC.
3818 * makedepend.c (add_clm): Use XNEW.
3819 (add_dir): Likewise.
3820 * mkdeps.c (munge): Use XNEWVEC.
3821 (deps_init): Use XCNEW.
3822 (deps_add_target): Use XRESIZEVEC.
3823 (deps_add_default_target): Cast return value of alloca.
3824 (deps_add_dep): Use XRESIZEVEC.
3825 (deps_add_vpath): Likewise. Use XNEWVEC too.
3826 (deps_restore): Likewise.
3827 * pch.c (save_idents): Use XNEW and XNEWVEC.
3828 (cpp_save_state): Use XNEW.
3829 (count_defs): Cast return value of htab_find.
3830 (write_defs): Likewise.
3831 (cpp_write_pch_deps): Use XNEWVEC.
3832 (collect_ht_nodes): Use XRESIZEVEC.
3833 (cpp_valid_state): Use XNEWVEC.
3834 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup.
3835 * symtab.c (ht_create): Use XCNEW.
3836 (ht_lookup_with_hash): Cast return value of obstack_copy0.
3837 (ht_expand): Use XCNEWVEC.
3838 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
3839 (bool): Do not define if __cplusplus.
3840
81e19b31 38412005-05-12 Zack Weinberg <zack@codesourcery.com>
3842
3843 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
3844 (do_sccs): Delete function definition, #define to do_ident.
3845 (do_ident): Don't hardwire directive name.
3846
18f11b84 38472005-05-12 Ryota Kunisawa <kunisawa@access.co.jp>
3848
3849 PR bootstrap/21230
3850 * configure: Regenerate.
3851
2dc04f36 38522005-04-27 Andris Pavenis <pavenis@latnet.lv>
3853
3854 * files.c: Include io.h for DJGPP to get prototype of setmode.
3855
0b7f838f 38562005-04-19 Per Bothner <per@bothner.com>
3857
3858 PR preprocessor/20907
3859 * line-map.c (linemap_line_start): Fix bug when we need to increse
3860 column_bits but can re-use the current line_map.
3861
2224c90b 38622005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3863
3864 * system.h (fopen, fdopen, freopen): Define these to the unlocked
3865 libiberty functions.
3866
077a3c99 38672005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3868
3869 * configure.ac (libcpp_UNLOCKED_FUNCS): New.
3870 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
3871 * system.h (putchar, getc, getchar, clearerr, feof, fileno,
3872 fflush, fgetc, fgets, ferror, fread): Redefine to the associated
3873 _unlocked function.
3874 (fwrite_unlocked): Fix prototype.
81e19b31 3875
077a3c99 3876 * configure, config.in: Regenerate.
3877
99617355 38782005-04-05 Jakub Jelinek <jakub@redhat.com>
3879
3880 PR preprocessor/19475
3881 * macro.c (create_iso_definition): For < ISO C99, don't
3882 pedwarn if there is no whitespace between macro name and its
3883 replacement, but the replacement starts with a basic character
3884 set character.
3885
3827dee5 38862005-03-28 Andreas Jaeger <aj@suse.de>
3887
3888 * lex.c (warn_about_normalization): Cast field width to int to
3889 avoid warning.
3890
b8273627 38912005-03-19 Joseph S. Myers <joseph@codesourcery.com>
3892
3893 * configure.ac: Consistently use solaris2.1[0-9]* instead of
3894 solaris2.1[0-9].
3895 * configure: Regenerate.
3896
bc65f24f 38972005-03-15 Geoffrey Keating <geoffk@apple.com>
3898
3899 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
3900 UCN rather than printing an error.
3901
bce47149 39022005-03-14 Geoffrey Keating <geoffk@apple.com>
3903
4e9d1e6d 3904 * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
3905
39062005-03-14 Geoffrey Keating <geoffk@apple.com>
81e19b31 3907
bce47149 3908 * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
3909 * charset.c: Update for new format of ucnid.h.
3910 (ucn_valid_in_identifier): Update for new format of ucnid.h.
3911 Add NST parameter, and update it; update callers.
3912 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort
3913 with cpp_error.
3914 (convert_ucn): Pass normalize_state to cpp_valid_ucn.
3915 * internal.h (struct normalize_state): New.
3916 (INITIAL_NORMALIZE_STATE): New.
3917 (NORMALIZE_STATE_RESULT): New.
3918 (NORMALIZE_STATE_UPDATE_IDNUM): New.
3919 (_cpp_valid_ucn): New.
3920 * lex.c (warn_about_normalization): New.
3921 (forms_identifier_p): Add normalize_state parameter, update callers.
3922 (lex_identifier): Add normalize_state parameter, update callers. Keep
3923 the state current.
3924 (lex_number): Likewise.
3925 (_cpp_lex_direct): Pass normalize_state to subroutines. Check
3926 it with warn_about_normalization.
3927 * makeucnid.c: New.
3928 * ucnid.h: Replace.
3929 * ucnid.pl: Remove.
3930 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove
3931 comments about obsolete version of C++.
3932 * include/cpplib.h (enum cpp_normalize_level): New.
3933 (struct cpp_options): Add warn_normalize field.
3934
bb1fa6bb 39352005-03-11 Geoffrey Keating <geoffk@apple.com>
3936
3937 * directives.c (glue_header_name): Update call to cpp_spell_token.
3938 * internal.h (_cpp_interpret_identifier): New.
3939 * charset.c (_cpp_interpret_identifier): New.
3940 (_cpp_valid_ucn): Allow UCN version of '$'.
3941 * lex.c (lex_identifier): Add extra parameter to indicate if initial
3942 character was '$' or '\'. Support identifiers with UCNs.
3943 (forms_identifier_p): Allow UCNs.
3944 (_cpp_lex_direct): Pass extra parameter to lex_identifier.
3945 (utf8_to_ucn): New.
3946 (cpp_spell_token): Add FORSTRING parameter. Use it.
3947 (cpp_token_as_text): Update call to cpp_spell_token.
3948 (cpp_output_token): Write UCNs back out.
3949 (stringify_arg): Update call to cpp_spell_token.
3950 (paste_tokens): Likewise.
3951 (cpp_macro_definition): Likewise.
3952 * macro.c (stringify_arg): Likewise.
3953 (paste_tokens): Likewise.
3954 (cpp_macro_definition): Likewise.
3955 * include/cpplib.h: Add parameter to cpp_spell_token.
3956
960391da 39572005-03-04 Jakub Jelinek <jakub@redhat.com>
3958
3959 PR bootstrap/20282
3960 PR bootstrap/20305
3961 * macro.c (replace_args, cpp_get_token): Copy whole
3962 cpp_token_u instead of just cpp_string field from it.
3963
b0d0794d 39642005-02-28 Devang Patel <dpatel@apple.com>
3965
3966 * directives.c (do_line): Save sysp early before line table is
3967 realloc'ed.
81e19b31 3968
624d37a6 39692005-02-20 Zack Weinberg <zack@codesourcery.com>
3970
3971 PR 18785
3972 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
3973 (cpp_host_to_exec_charset): New function.
3974 * include/cpplib.h: Declare cpp_host_to_exec_charset.
3975
f86986bc 39762005-02-19 Devang Patel <dpatel@apple.com>
3977
3978 * charset.c (_cpp_convert_input): Check '\r' before inserting
3979 '\n' at the end.
624d37a6 3980
9936e07d 39812005-02-15 Eric Christopher <echristo@redhat.com>
3982
3983 PR preprocessor/19077
3984 * macro.c (cpp_macro_definition): Move handling of whitespace
3985 to PREV_WHITE conditional. Remove overloading of len
3986 variable.
3987
129a1540 39882005-02-14 Kazu Hirata <kazu@cs.umass.edu>
3989
3990 * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
3991 traditional.c: Update copyright.
3992
bb30d1f4 39932005-02-14 Paolo Bonzini <bonzini@gnu.org>
3994
3995 PR bootstrap/19818
3996 * configure.ac: Check for declaration of basename and getopt.
3997 * config.in: Regenerate.
3998 * configure: Regenerate.
3999 * internal.h (ustrcspn): New.
4000 * macro.c (create_iso_definition): Fix allocation of memory.
4001 (padding_token): Add cast to remove const-ness.
4002 * pch.c (cpp_read_state): Use ustrcspn.
4003
26ec4f15 40042005-02-08 Mike Stump <mrs@apple.com>
4005
4006 * files.c (pchf_adder): Remove.
4007 (struct pchf_adder_info): Likewise.
4008 (_cpp_save_file_entries): Write out all files so that #import works.
4009
0cb78cbd 40102005-01-23 Joseph S. Myers <joseph@codesourcery.com>
4011
4012 * configure: Regenerate.
4013
d862067c 40142005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
4015
4016 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
4017
457e71e4 4018 * include/cpplib.h: Also update copyright years.
624d37a6 4019
ba841ef8 40202005-01-03 Geoffrey Keating <geoffk@apple.com>
4021
4022 * files.c (_cpp_find_file): Add files found by search_path_exhausted
4023 to the list of all files.
4024
f03668bd 40252005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
4026
4027 * internal.h: Update references to Cpp lib filenames.
4028 * directives.c: Likewise.
4029 * init.c: Likewise.
4030 * macro.c: Likewise.
4031 * traditional.c: Likewise.
4032
461ea98d 40332004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
4034
4035 PR preprocessor/15167
4036 * files.c (destroy_cpp_file): New function.
4037 (should_stack_file): Make a new file if the
4038 compared file is still stacked.
4039
bd9e37a6 40402004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
4041
624d37a6 4042 PR preprocessor/17610
bd9e37a6 4043 * directives.c (do_include_common): Error out if an empty filename
4044 is given for #include (or #include_next or #import).
4045
fe4dcd90 40462004-11-27 Roger Sayle <roger@eyesopen.com>
4047 Zack Weinberg <zack@codesourcery.com>
4048
4049 * internal.h: Replace all uses of uchar with unsigned char.
4050 * include/cpp-id-data.h: Likewise. Guard typedef of uchar
4051 with !IN_GCC, so uchar is only defined whilst building libcpp.
4052
ac7cc2f4 40532004-11-24 Kelley Cook <kcook@gcc.gnu.org>
4054
4055 * aclocal.m4: Regenerate.
4056
6e11b263 40572004-11-24 Roger Sayle <roger@eyesopen.com>
4058
4059 PR preprocessor/15824
4060 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
4061 directly, instead of the non-existant "system.h" and "ansidecl.h".
4062 * configure: Regenerate.
4063
68bf2ad9 40642004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
624d37a6 4065 Joseph Myers <joseph@codesourcery.com>
68bf2ad9 4066
4067 * internal.h (struct lexer_state): Add in_deferred_pragma.
4068 * directives.c (struct pragma_entry): Add allow_expansion.
4069 (insert_pragma_entry): Take allow_expansion flag.
4070 (register_pragma): Likewise.
4071 (cpp_register_pragma): Likewise.
4072 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
4073 (do_pragma): Honor allow_expansion.
4074 (cpp_handle_deferred_pragma): Set in_deferred_pragma.
4075 * include/cpplib.h (cpp_register_pragma): Update prototype.
4076
27559c4e 40772004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
624d37a6 4078 Mark Mitchell <mark@codesourcery.com>
27559c4e 4079
4080 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
4081 need_64bit_hwint=yes.
4082 * configure: Regenerate.
4083
34ae664d 40842004-11-09 Joseph S. Myers <joseph@codesourcery.com>
4085
4086 * Makefile.in ($(PACKAGE).pot): New rule. Depend on
4087 po/$(PACKAGE).pot.
4088 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
4089 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
4090 Remove local srcdir path from generated file.
4091
39b83bdb 40922004-11-04 Zack Weinberg <zack@codesourcery.com>
624d37a6 4093 Gerald Pfeifer <gerald@pfeifer.com>
39b83bdb 4094
4095 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
4096 as well.
4097
a095c1b5 40982004-10-27 Zack Weinberg <zack@codesourcery.com>
4099
4100 PR 18075
4101 * directives.c (do_pragma): Do not defer pragmas which are unknown.
4102 (cpp_handle_deferred_pragma): Add cast to silence warning.
4103
700b0d81 41042004-10-14 Joseph S. Myers <jsm@polyomino.org.uk>
4105
4106 * errors.c (_cpp_begin_message): Print "error: " for errors.
4107
fbe83ac1 41082004-10-10 Andreas Jaeger <aj@suse.de>
4109
4110 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
4111 * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
4112
09f10c94 41132004-10-08 Andrew Pinski <pinskia@physics.uc.edu>
4114
4115 * pch.c (cpp_write_pch_state): Remove variable z as it is not
4116 used.
4117 (cpp_read_state): Remove unused variables, m, d and mac_count.
4118
a8b2a8d5 41192004-09-29 Per Bothner <per@bothner.com>
4120
4121 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore
4122 cb.line_change. Otherwise do_pragma will call the line_change
4123 call-back with a meaningless line number.
4124
21164c01 41252004-09-24 Zack Weinberg <zack@codesourcery.com>
4126
4127 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
4128 programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
4129 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
4130 * aclocal.m4, configure: Regenerate.
4131 * init.c: Include localedir.h.
4132 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
4133 (DEFS): Delete.
4134 (.c.o): Use $(ALL_CFLAGS).
4135 (localedir.h, localedir.hs): New rules.
4136 (clean): Use rm -rf to remove directories.
4137 (distclean): Also delete localedir.h and localedir.hs.
4138 (init.o): Update dependencies.
4139
986086aa 41402004-09-22 Kelley Cook <kcook@gcc.gnu.org>
4141
4142 * Makefile.in (aclocal.m4): Update dependencies.
4143 * configure.ac (AC_CONFIG_MACRO_DIR): New.
4144 * aclocal.m4, configure: Regenerate.
4145
e9cc3617 41462004-09-17 Zack Weinberg <zack@codesourcery.com>
4147
0097f6a2 4148 * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
4149 (_cpp_convert_input, _cpp_default_encoding): Add comments.
4150 Some other comments in this file also tweaked.
4151
e9cc3617 4152 * directives.c (do_pragma): Save current buffer position
4153 before lexing the pragma keywords; don't call
4154 _cpp_backup_tokens in the defer_pragmas case.
4155
9832c977 41562004-09-15 Per Bothner <per@bothner.com>
4157
4158 * include/line-map.h (line_map_start): Add parameter names so
4159 preceding comment makes sense.
4160 (linemap_add): Remove from comment mention of non-existing parameter.
4161
d6d3c909 41622004-09-09 Matt Austern <austern@apple.com>
4163 Zack Weinberg <zack@codesourcery.com>
4164
4165 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
4166 prefixes throughout. Add entry for PRAGMA. Remove
4167 unnecessary "= 0" from EQ.
4168 (enum cpp_ttype): Adjust OP and TK definitions to restore
4169 prefixes, via token-paste.
4170 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
4171 Change from #defines to additional cpp_ttype enumerators.
4172 (struct cpp_options): Add defer_pragmas.
4173 (cpp_handle_deferred_pragma): Prototype new interface.
4174
4175 * internal.h (struct cpp_reader): Add directive_result.
4176 * directives.c (struct pragma_entry): Add is_internal field;
4177 give boolean fields type bool.
4178 (start_directive): Initialize pfile->directive_result.type.
4179 (_cpp_do__Pragma): Likewise.
4180 (run_directive): Do not crash if pfile->buffer->prev is NULL.
4181 (insert_pragma_entry): Add 'internal' argument; set new->is_internal
4182 from it.
4183 (register_pragma): New static function, bulk of former
4184 cpp_register_pragma here; add 'internal' argument, pass along
4185 to insert_pragma_entry.
4186 (cpp_register_pragma): Now a wrapper around register_pragma which
4187 always passes false for 'internal' argument.
4188 (_cpp_init_internal_pragmas): Call register_pragma directly, passing
4189 true for 'internal'.
4190 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
4191 an internal pragma, save text till the end of the line as a CPP_PRAGMA
4192 token instead of executing the pragma.
4193 (cpp_handle_deferred_pragma): New interface.
4194 * lex.c (token_spellings): Adjust OP and TK definitions to
4195 match changes to cpplib.h.
4196 (_cpp_lex_token): Check for a directive-result token and
4197 return it if present.
4198 (cpp_token_val_index): Handle CPP_PRAGMA.
4199 * macro.c (cpp_builtin_macro_text): Correct comment.
4200 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
4201
735a9bc4 42022004-09-06 Serge Belyshev <belyshev@lubercy.com>
4203
4204 PR preprocessor/14699
4205 * symtab.c (ht_dump_statistics): Change type of sum_of_squares
4206 from size_t to double.
4207
25696d3f 42082004-08-28 Andreas Schwab <schwab@suse.de>
4209 Andreas Jaeger <aj@suse.de>
4210
4211 * configure.ac: Set PACKAGE correctly.
4212 * configure: Regenerated.
4213
99439f5b 42142004-08-25 Paolo Bonzini <bonzini@gnu.org>
4215
4216 * Makefile.in: Add back top_builddir.
4217
a668be26 42182004-08-25 Paolo Bonzini <bonzini@gnu.org>
4219
4220 * configure.ac: Replace Automake macro invocations
4221 with manual Autoconf checks and substitutions.
4222 * configure: Regenerate.
4223 * aclocal.m4: Regenerate.
4224 * config.in: Regenerate.
4225 * Makefile.am: Removed.
4226 * Makefile.in: Heavy simplification and reorganization.
4227
30e9913f 42282004-08-09 Mark Mitchell <mark@codesourcery.com>
4229
4230 * configure.ac (arm*-*-eabi*): New target.
4231 (arm*-*-symbianelf*): Likewise.
4232 * configure: Regenerated.
4233
3b298764 42342004-07-24 Bernardo Innocenti <bernie@develer.com>
4235
4236 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
4237 * directives.c: Use XNEW-family macros from libiberty.
4238 * lex.c: Likewise.
4239 * macro.c: Likewise.
4240 * cpplib.h (cpp_deps_style): Export enum with name.
4241
d6d3c909 42422004-07-23 Matthias Klose <doko@debian.org>
3b298764 4243
d6d3c909 4244 * init.c (init_library): Use PACKAGE for the text domain.
1ed7d058 4245
821fa045 42462004-07-16 Andris Pavenis <pavenis@latnet.lv>
4247
4248 PR preprocessor/16366
4249 * internal.h (struct cpp_reader): New field dir_hash.
4250 * files.c (make_cpp_dir): Use dir_hash, not file_hash.
4251 (_cpp_init_files, _cpp_cleanup_files): Update for new field.
4252
d80efa72 42532004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
4254
4255 PR preprocessor/16192
4256 PR preprocessor/15913
4257 PR preprocessor/15572
4258 * expr.c (_cpp_parse_expr): Handle remaining cases where an
4259 expression is missing.
4260 * init.c (post_options): Traditional cpp doesn't do // comments.
4261
ed000086 42622004-06-30 Per Bothner <per@bothner.com>
4263
4264 * include/line-map.h (fileline): Remove old typedef.
4265 * internal.h (struct cpp_reader): Use source_location typedef instead.
4266
dcb9d064 42672004-06-26 Zack Weinberg <zack@codesourcery.com>
4268
4269 Partially revert patch of 2004-06-05.
4270 * files.c (search_cache): Remove pfile argument. Don't check
4271 for file that would be found by "" or <> search here...
4272 (_cpp_find_file): ...do it here, before calling find_file_in_dir.
4273 Do not apply directory-of-current-file correction to files
4274 found by this check. Rearrange code slightly.
4275
d718b525 42762004-06-21 Geoffrey Keating <geoffk@apple.com>
4277
4278 * files.c (should_stack_file): Correct swapped parameters to call
4279 to cb.read_pch.
4280 * pch.c (cpp_valid_state): Handle -fpreprocessed.
4281
79b68529 42822004-06-15 Paolo Bonzini <bonzini@gnu.org>
4283
4284 * Makefile.in: Regenerate with automake 1.8.5.
4285 * aclocal.m4: Likewise.
4286 * configure: Regenerate.
4287
151899c5 42882004-06-11 Zack Weinberg <zack@codesourcery.com>
4289
4290 * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
4291 * configure, config.in: Regenerate.
4292 * system.h: Unconditionally define bool as unsigned char,
4293 BOOL_BITFIELD as unsigned int.
4294 * .cvsignore: New file.
4295
c39ed964 42962004-06-09 Geoffrey Keating <geoffk@apple.com>
4297
4298 * traditional.c (push_replacement_text): Set macro->traditional.
4299 (save_replacement_text): Likewise.
4300 * pch.c (cpp_write_pch_state): Don't write list of defined macros.
4301 (struct save_macro_item): Delete.
4302 (struct save_macro_data): Use a character array not the previous
4303 structured format.
4304 (save_macros): Save macro as text not as internal structures.
4305 (cpp_prepare_state): Update for changes to save_macro_data.
4306 (cpp_read_state): Don't read macros defined in PCH. Restore
c84ca916 4307 -D macros as text.
c39ed964 4308 * macro.c (create_iso_definition): Honour alloc_subobject.
4309 Clear traditional flag.
4310 (_cpp_create_definition): Honour alloc_subobject.
4311 * lex.c (cpp_token_val_index): New.
4312 * internal.h: Include cpp-id-data.h.
4313 (uchar): Move definition to cpp-id-data.h.
4314 (U): Likewise.
4315 (cpp_macro): Likewise.
4316 * directives.c (struct answer): Move to cpp-id-data.h.
4317 (do_assert): Honour alloc_subobject.
c84ca916 4318
4319 * include/symtab.h (struct ht): Add field 'alloc_subobject'.
4320 * include/cpplib.h (struct cpp_string): Add GTY marker.
4321 (enum cpp_token_fld_kind): New.
4322 (struct cpp_token): Add GTY markers.
4323 (cpp_token_val_index): Prototype.
4324 (CPP_HASHNODE_VALUE_IDX): New.
4325 (struct cpp_hashnode): Don't skip fields of 'value' when marking.
4326 * include/cpp-id-data.h: New file.
c39ed964 4327
dd6e5561 43282004-06-09 Paolo Bonzini <bonzini@gnu.org>
4329
4330 * Makefile.am (all-local): New.
4331 * Makefile.in: Regenerate.
4332
8af0c78d 43332004-06-06 Roger Sayle <roger@eyesopen.com>
4334
4335 * Makefile.am (LIBICONV): Declare.
4336 (makedepend_LDADD): Use LIBICONV.
4337 * Makefile.in: Regenerate.
4338
30302733 43392004-06-05 Andrew Pinski <pinskia@physics.uc.edu>
4340
4341 * Makefile.am (LIBINTL): Declare
4342 (makedepend_LDADD): Use LIBINTL.
4343 * Makefile.in: Regenerate.
4344
3eb3f293 43452004-06-05 Zack Weinberg <zack@codesourcery.com>
4346
4347 * Makefile.am: Add makedepend.
4348 * Makefile.in, aclocal.m4: Regenerate.
4349 * charset.c: Insert a space to avoid a warning.
4350 * directives.c: Include mkdeps.h.
4351 (_cpp_handle_directive): Reenable macro expander if appropriate.
4352 (undefine_macros): Inline body of _cpp_free_definition for speed.
4353 Do not call undef callback or _cpp_warn_if_unused_macro.
4354 (cpp_get_deps): New interface.
4355 * files.c (search_cache): Add pfile argument. Check for file
4356 that would be found by "" or <> search here...
4357 (_cpp_find_file): ...not here. Correct recorded start_dir of
4358 files found by directory-of-current-file search that would be
4359 found by "" or <> search.
4360 * init.c (cpp_add_dependency_target): Delete.
4361 * internal.h (struct lexer_state): Add discarding_output flag.
4362 * lex.c (lex_identifier): Compute hash function while scanning.
4363 * macro.c (cpp_scan_nooutput): Disable macro expansion outside
4364 directives.
4365 * makedepend.c: New file.
4366 * mkdeps.c (struct deps): Add vpath vector.
4367 (apply_vpath, deps_add_vpath): New function.
4368 (deps_free): Free vpath vector.
4369 (deps_add_dep, deps_add_target): Use apply_vpath.
4370 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
4371 (ht_lookup_with_hash): New function.
4372 * cpplib.h, mkdeps.h: Update prototypes.
4373 * symtab.h: Update prototypes.
4374 (HT_HASHSTEP, HT_FINISH): New macros.
4375
8ed01400 43762004-05-29 Geoffrey Keating <geoffk@apple.com>
4377
4378 * symtab.c (ht_create): Set entries_owned.
4379 (ht_destroy): Honour entries_owned.
4380 (ht_expand): Likewise.
4381 (ht_load): New.
c84ca916 4382 * include/symtab.h (struct ht): New field 'entries_owned'
4383 (ht_load): New prototype.
8ed01400 4384
347a3ab5 43852004-05-26 Paolo Bonzini <bonzini@gnu.org>
4386
4387 PR bootstrap/15651
4388 * configure.ac: Fix m4 quoting when picking
4389 the size of HOST_WIDE_INT.
4390 * configure: Regenerate.
4391
fc231f28 43922004-05-25 Paolo Bonzini <bonzini@gnu.org>
4393
4394 * Makefile.am: the correct directory for
4395 gettext include files is given by @INCINTL@.
4396 * Makefile.in: Regenerate.
4397
babfbd63 43982004-05-24 Paolo Bonzini <bonzini@gnu.org>
4399
4400 * system.h [!ENABLE_NLS]: dgettext takes two
4401 parameters.
4402
d856c8a6 44032004-05-23 Paolo Bonzini <bonzini@gnu.org>
4404
4405 Moved libcpp from the gcc subdirectory to the toplevel.
4406 * Makefile.am: New file.
4407 * Makefile.in: Regenerate.
4408 * configure.ac: New file.
4409 * configure: Regenerate.
4410 * config.in: Regenerate.
4411 * charset.c: Moved from gcc/cppcharset.c. Add note about
4412 brokenness of input charset detection. Adjust for change
4413 in name of cppucnid.h.
4414 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
4415 * expr.c: Moved from gcc/cppexp.c.
4416 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
4417 Remove #define of O_BINARY, it is in system.h.
4418 * identifiers.c: Moved from gcc/cpphash.c.
4419 * internal.h: Moved from gcc/cpphash.h. Change header
4420 guard name. All other files adjusted to match name change.
4421 * init.c: Moved from gcc/cppinit.c.
4422 (init_library) [ENABLE_NLS]: Call bindtextdomain.
4423 * lex.c: Moved from gcc/cpplex.c.
4424 * directives.c: Moved from gcc/cpplib.c.
4425 * macro.c: Moved from gcc/cppmacro.c.
4426 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
4427 * traditional.c: Moved from gcc/cpptrad.c.
4428 * ucnid.h: Moved from gcc/cppucnid.h. Change header
4429 guard name.
4430 * ucnid.pl: Moved from gcc/cppucnid.pl.
4431 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header
4432 guard name.
4433 * symtab.c: Moved from gcc/hashtable.c.
4434 * line-map.c: Moved from gcc. Do not include intl.h.
4435 * mkdeps.c: Moved from gcc.
4436 * system.h: New file.
c84ca916 4437 * include/cpplib.h: Moved from gcc. Change header guard name.
4438 * include/line-map.h: Moved from gcc. Change header guard name.
4439 * include/mkdeps.h: Moved from gcc. Change header guard name.
4440 * include/symtab.h: Moved from gcc/hashtable.h. Change header
4441 guard name.
f1717362 4442\f
4443Copyright (C) 2004-2016 Free Software Foundation, Inc.
4444
4445Copying and distribution of this file, with or without modification,
4446are permitted in any medium without royalty provided the copyright
4447notice and this notice are preserved.