]> git.ipfire.org Git - thirdparty/gcc.git/blame - libcpp/ChangeLog
decl.c (parse_version): Don't encode the minor version in the abi version.
[thirdparty/gcc.git] / libcpp / ChangeLog
CommitLineData
12de2245
BS
12016-04-13 Bernd Schmidt <bschmidt@redhat.com>
2
3 Patch from Roger Orr <rogero@howzatt.demon.co.uk>
4 PR preprocessor/69650
5 * directives.c (do_linemarker): Reread map after calling
6 cpp_get_token.
7
64824205
RH
82016-04-06 Richard Henderson <rth@redhat.com>
9
10 PR preprocessor/61817
11 PR preprocessor/69391
12 * internal.h (_cpp_builtin_macro_text): Update decl.
13 * macro.c (_cpp_builtin_macro_text): Accept location for __LINE__.
14 (builtin_macro): Accept a second location for __LINE__.
15 (enter_macro_context): Compute both virtual and real expansion
16 locations for the macro.
17
3caf0ca1
BS
182016-03-25 Bernd Schmidt <bschmidt@redhat.com>
19
20 PR lto/69650
21 * directives.c (do_linemarker): Test for file left but not entered
22 here.
23 * line-map.c (linemap_add): Not here.
24
6b366948
JJ
252016-03-21 Jakub Jelinek <jakub@redhat.com>
26
27 PR target/70296
28 * include/cpplib.h (cpp_fun_like_macro_p): New prototype.
29 * macro.c (cpp_fun_like_macro_p): New function.
30
64567cfd
RH
312016-03-15 Richard Henderson <rth@redhat.com>
32
33 * line-map.c (new_linemap): Make alloc_size a size_t.
34
2aaeea19
JM
352016-03-14 Jason Merrill <jason@redhat.com>
36
37 * expr.c (cpp_classify_number): Hex floats are new in C++1z.
38 * init.c (lang_defaults): Likewise.
39
b4f3232d
DM
402016-03-09 David Malcolm <dmalcolm@redhat.com>
41
42 PR c/68473
43 PR c++/70105
44 * line-map.c (linemap_macro_map_loc_unwind_toward_spelling): Move
45 decl...
46 * include/line-map.h
47 (linemap_macro_map_loc_unwind_toward_spelling): ...here,
48 converting from static to extern.
49
40499f81
DM
502016-03-09 David Malcolm <dmalcolm@redhat.com>
51
52 PR c/68473
53 PR c++/70105
54 * include/line-map.h (source_range::debug): Delete.
55 (struct location_range): Update comment. Replace
56 expanded_location fields "m_start", "m_finish", and "m_caret" with
57 a source_location field: "m_loc".
58 (class rich_location): Reword comment.
59 (rich_location::get_loc): Reimplement in terms of a new overloaded
60 variant which takes an unsigned int.
61 (rich_location::get_loc_addr): Delete.
62 (rich_location::add_range): Drop params "start" and "finish" in
63 favor of param "loc". Drop overloaded variants taking a
64 source_range or location_range *.
65 (rich_location::lazily_expand_location): Delete in favor of...
66 (rich_location::get_expanded_location): New decl.
67 (rich_location::m_loc): Delete field.
68 (rich_location::m_column_override): New field.
69 * line-map.c (rich_location::rich_location): Drop name of
70 line_maps * param. Update initializations for deletion of field
71 "m_loc" and addition of field "m_column_override". Reimplement
72 body as a call to add_range. Delete overloaded variant taking a
73 source_range.
74 (rich_location::get_loc): New function.
75 (rich_location::lazily_expand_location): Delete in favor of...
76 (rich_location::get_expanded_location): New function.
77 (rich_location::override_column): Reimplement.
78 (rich_location::add_range): Drop params "start" and "finish" in
79 favor of param "loc". Eliminate location expansion in favor of
80 simply storing loc. Drop overloaded variants taking a
81 source_range or location_range *.
82 (rich_location::set_range): Eliminate location expansion.
83
7168133a
DM
842016-02-29 David Malcolm <dmalcolm@redhat.com>
85
86 PR preprocessor/69985
87 (linemap_position_for_loc_and_offset): Rename param from "offset"
88 to "column_offset". Right-shift the column_offset by m_range_bits
89 of the pertinent ordinary map whenever offsetting a
90 source_location. For clarity, offset the column by the column
91 offset, rather than the other way around.
92
196440f8
DM
932016-02-23 David Malcolm <dmalcolm@redhat.com>
94
95 PR preprocessor/69126
96 PR preprocessor/69543
97 * line-map.c (linemap_compare_locations): At the function top,
98 replace inlined bodies of get_location_from_adhoc_loc with calls
99 to get_location_from_adhoc_loc. Add a pair of calls to
100 get_location_from_adhoc_loc at the bottom of the function, to
101 avoid meaningless comparisons of ad-hoc and non-ad-hoc locations.
102
44714d8c
DM
1032016-02-08 David Malcolm <dmalcolm@redhat.com>
104
105 PR preprocessor/69664
106 * errors.c (cpp_diagnostic_with_line): Only call
107 rich_location::override_column if the column is non-zero.
108 * line-map.c (rich_location::override_column): Update columns
109 within m_ranges[0]. Add assertions to verify that doing so is
110 sane.
111
b5c1c988
JJ
1122016-02-05 Jakub Jelinek <jakub@redhat.com>
113
114 PR c++/69628
115 * charset.c (cpp_interpret_charconst): Clear *PCHARS_SEEN
116 and *UNSIGNEDP if bailing out early due to errors.
117
e2eb5056
JJ
1182016-01-28 Jakub Jelinek <jakub@redhat.com>
119
4bda5946
JJ
120 PR pch/68176
121 * files.c (_cpp_find_file): Set file->implicit_preinclude even if
122 included from file->implicit_preinclude header.
123
e2eb5056
JJ
124 * directives.c (destringize_and_run): Adjust prototype.
125
0afff540
DM
1262016-01-27 David Malcolm <dmalcolm@redhat.com>
127
128 PR preprocessor/69126
129 * directives.c (destringize_and_run): Add expansion_loc param; use
130 it when handling unexpanded pragmas to fixup the locations of the
131 synthesized tokens.
132 (_cpp_do__Pragma): Add expansion_loc param and use it when calling
133 destringize_and_run.
134 * internal.h (_cpp_do__Pragma): Add expansion_loc param.
135 * macro.c (builtin_macro): Pass expansion location of _Pragma to
136 _cpp_do__Pragma.
137
c7df95d8
DM
1382016-01-14 David Malcolm <dmalcolm@redhat.com>
139
140 PR preprocessor/69177
141 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): New
142 constant.
143 (LINE_MAP_MAX_LOCATION_WITH_COLS): Add note about unit tests
144 to comment.
145 (can_be_stored_compactly_p): Reduce threshold from
146 LINE_MAP_MAX_LOCATION_WITH_COLS to
147 LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES.
148 (get_combined_adhoc_loc): Likewise.
149 (get_range_from_loc): Likewise.
150 (linemap_line_start): Ensure that a new ordinary map is created
151 when transitioning from range-packing being enabled to disabled,
152 at the LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES threshold. Set
153 range_bits to 0 for new ordinary maps when beyond this limit.
154 Prevent the "increase the column bits of a freshly created map"
155 optimization if the range bits has reduced.
156
53290e07
JJ
1572016-01-08 Jakub Jelinek <jakub@redhat.com>
158
159 PR c++/69145
160 * files.c (cpp_included_before): If IS_ADHOC_LOC (location), lookup
161 real location from the line_table.
162
818ab71a
JJ
1632016-01-04 Jakub Jelinek <jakub@redhat.com>
164
165 Update copyright years.
166
329590d7
DM
1672015-12-22 David Malcolm <dmalcolm@redhat.com>
168
169 * line-map.c (get_combined_adhoc_loc): Remove condition
170 on locus < RESERVED_LOCATION_COUNT when considering
171 whether a caret == start == finish location can be
172 simply stored as the caret location.
173
f79520bb
DM
1742015-12-07 David Malcolm <dmalcolm@redhat.com>
175
176 * include/line-map.h (rich_location::set_range): Add line_maps *
177 param; convert param from source_range to source_location. Drop
178 "overwrite_loc_p" param.
179 * line-map.c (rich_location::set_range): Likewise, acting as if
180 "overwrite_loc_p" were true, and getting range from the location.
181
a87a86e1
DM
1822015-11-20 David Malcolm <dmalcolm@redhat.com>
183
184 PR 62314
185 * include/line-map.h (source_range::intersects_line_p): New
186 method.
187 (rich_location::~rich_location): New.
188 (rich_location::add_fixit_insert): New method.
189 (rich_location::add_fixit_remove): New method.
190 (rich_location::add_fixit_replace): New method.
191 (rich_location::get_num_fixit_hints): New accessor.
192 (rich_location::get_fixit_hint): New accessor.
193 (rich_location::MAX_FIXIT_HINTS): New constant.
194 (rich_location::m_num_fixit_hints): New field.
195 (rich_location::m_fixit_hints): New field.
196 (class fixit_hint): New class.
197 (class fixit_insert): New class.
198 (class fixit_remove): New class.
199 (class fixit_replace): New class.
200 * line-map.c (source_range::intersects_line_p): New method.
201 (rich_location::rich_location): Add initialization of
202 m_num_fixit_hints to both ctors.
203 (rich_location::~rich_location): New.
204 (rich_location::add_fixit_insert): New method.
205 (rich_location::add_fixit_remove): New method.
206 (rich_location::add_fixit_replace): New method.
207 (fixit_insert::fixit_insert): New.
208 (fixit_insert::~fixit_insert): New.
209 (fixit_insert::affects_line_p): New.
210 (fixit_remove::fixit_remove): New.
211 (fixit_remove::affects_line_p): New.
212 (fixit_replace::fixit_replace): New.
213 (fixit_replace::~fixit_replace): New.
214 (fixit_replace::affects_line_p): New.
215
46ce03de
JJ
2162015-11-19 Jakub Jelinek <jakub@redhat.com>
217
218 PR preprocessor/60736
219 * include/cpplib.h (cpp_errno_filename): New prototype.
220 * errors.c (cpp_errno): Don't handle msgid "" specially, use
221 _(msgid) instead of msgid as argument to cpp_error.
222 (cpp_errno_filename): New function.
223 * files.c (read_file_guts): Use cpp_errno_filename instead of
224 cpp_errno.
225 (open_file_failed): Likewise. Use file->name if file->path is NULL
226 in diagnostics.
227
ebedc9a3
DM
2282015-11-13 David Malcolm <dmalcolm@redhat.com>
229
230 * errors.c (cpp_diagnostic): Pass pfile->line_table to
231 rich_location ctor.
232 (cpp_diagnostic_with_line): Likewise.
233 * include/cpplib.h (struct cpp_token): Update comment for src_loc
234 to indicate that the range of the token is "baked into" the
235 source_location.
236 * include/line-map.h (source_location): Update the descriptive
237 comment to reflect the packing scheme for short ranges, adding
238 worked examples of location encoding.
239 (struct line_map_ordinary): Drop field "column_bits" in favor
240 of field "m_column_and_range_bits"; add field "m_range_bits".
241 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
242 (location_adhoc_data): Add source_range field.
243 (struct line_maps): Add fields "default_range_bits",
244 "num_optimized_ranges" and "num_unoptimized_ranges".
245 (get_combined_adhoc_loc): Add source_range param.
246 (get_range_from_loc): New declaration.
247 (pure_location_p): New prototype.
248 (COMBINE_LOCATION_DATA): Add source_range param.
249 (SOURCE_LINE): Update for renaming of column_bits.
250 (SOURCE_COLUMN): Likewise. Shift the column right by the map's
251 range_bits.
252 (LAST_SOURCE_LINE_LOCATION): Update for renaming of column_bits.
253 (linemap_position_for_line_and_column): Add line_maps * params.
254 (rich_location::rich_location): Likewise.
255 * lex.c (_cpp_lex_direct): Capture the range of the token, baking
256 it into token->src_loc via a call to COMBINE_LOCATION_DATA.
257 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): Reduce from 1U << 17 to
258 1U << 12.
259 (location_adhoc_data_hash): Add the src_range into
260 the hash value.
261 (location_adhoc_data_eq): Require equality of the src_range
262 values.
263 (can_be_stored_compactly_p): New function.
264 (get_combined_adhoc_loc): Add src_range param, and store it,
265 via a bit-packing scheme for short ranges, otherwise within the
266 lookaside table. Remove the requirement that data is non-NULL.
267 (get_range_from_adhoc_loc): New function.
268 (get_range_from_loc): New function.
269 (pure_location_p): New function.
270 (linemap_add): Ensure that start_location has zero for the
271 range_bits, unless we're past LINE_MAP_MAX_LOCATION_WITH_COLS.
272 Initialize range_bits to zero. Assert that the start_location
273 is "pure".
274 (linemap_line_start): Assert that the
275 column_and_range_bits >= range_bits.
276 Update determinination of whether we need to start a new map
277 using the effective column bits, without the range bits.
278 Use the set's default_range_bits in new maps, apart from
279 those with column_bits == 0, which should also have 0 range_bits.
280 Increase the column bits for new maps by the range bits.
281 When adding lines to an existing map, use set->highest_line
282 directly rather than offsetting highest by SOURCE_COLUMN.
283 Add assertions to sanity-check the return value.
284 (linemap_position_for_column): Offset to_column by range_bits.
285 Update set->highest_location if necessary.
286 (linemap_position_for_line_and_column): Add line_maps * param.
287 Update the calculation to offset the column by range_bits, and
288 conditionalize it on being <= LINE_MAP_MAX_LOCATION_WITH_COLS.
289 Bound it by LINEMAPS_MACRO_LOWEST_LOCATION. Update
290 set->highest_location if necessary.
291 (linemap_position_for_loc_and_offset): Handle ad-hoc locations;
292 pass "set" to linemap_position_for_line_and_column.
293 (linemap_macro_map_loc_unwind_toward_spelling): Add line_maps
294 param. Handle ad-hoc locations.
295 (linemap_location_in_system_header_p): Pass on "set" to call to
296 linemap_macro_map_loc_unwind_toward_spelling.
297 (linemap_macro_loc_to_spelling_point): Retain ad-hoc locations.
298 Pass on "set" to call to
299 linemap_macro_map_loc_unwind_toward_spelling.
300 (linemap_resolve_location): Retain ad-hoc locations. Pass on
301 "set" to call to linemap_macro_map_loc_unwind_toward_spelling.
302 (linemap_unwind_toward_expansion): Pass on "set" to call to
303 linemap_macro_map_loc_unwind_toward_spelling.
304 (linemap_expand_location): Extract the data pointer before
305 extracting the location.
306 (rich_location::rich_location): Add line_maps param; use it to
307 extract the range from the source_location.
308 * location-example.txt: Regenerate, showing new representation.
309
8a645150
DM
3102015-11-06 David Malcolm <dmalcolm@redhat.com>
311
312 * errors.c (cpp_diagnostic): Update for change in signature
313 of "error" callback.
314 (cpp_diagnostic_with_line): Likewise, calling override_column
315 on the rich_location.
316 * include/cpplib.h (struct cpp_callbacks): Within "error"
317 callback, convert param from source_location to rich_location *,
318 and drop column_override param.
319 * include/line-map.h (struct source_range): New struct.
320 (struct location_range): New struct.
321 (class rich_location): New class.
322 (linemap_client_expand_location_to_spelling_point): New declaration.
323 * line-map.c (rich_location::rich_location): New ctors.
324 (rich_location::lazily_expand_location): New method.
325 (rich_location::override_column): New method.
326 (rich_location::add_range): New methods.
327 (rich_location::set_range): New method.
328
ee015909
DM
3292015-11-06 David Malcolm <dmalcolm@redhat.com>
330
331 * include/line-map.h (struct linemap_stats): Add fields
332 "adhoc_table_size" and "adhoc_table_entries_used".
333 * line-map.c (linemap_get_statistics): Populate above fields.
334
a6c764d0
MM
3352015-11-04 Mikhail Maltsev <maltsevm@gmail.com>
336
337 * config.in: Regenerate.
338 * configure: Regenerate.
339 * configure.ac: Remove ENABLE_CHECKING.
340
49445904
UB
3412015-11-03 Uros Bizjak <ubizjak@gmail.com>
342
343 * lex.c (search_line_sse42): Correctly advance the pointer to an
344 aligned address.
345
525ce910
DM
3462015-11-02 David Malcolm <dmalcolm@redhat.com>
347
348 * include/line-map.h (source_location): In the table in the
349 descriptive comment, show UNKNOWN_LOCATION, BUILTINS_LOCATION,
350 LINE_MAP_MAX_LOCATION_WITH_COLS, LINE_MAP_MAX_SOURCE_LOCATION.
351 Add notes about ad-hoc values.
352
7ec491c0
MM
3532015-10-21 Mikhail Maltsev <maltsevm@gmail.com>
354
22d66382
MM
355 * include/line-map.h: Use CHECKING_P instead of ENABLE_CHECKING.
356 * init.c: Likewise.
357 * macro.c (struct macro_arg_token_iter, set_arg_token,
358 macro_arg_token_iter_init, macro_arg_token_iter_forward,
359 macro_arg_token_iter_get_token, macro_arg_token_iter_get_location,
360 alloc_expanded_arg_mem, _cpp_backup_tokens): Likewise.
361
7ec491c0
MM
362 * config.in: Regenerate.
363 * configure: Regenerate.
364 * configure.ac (CHECKING_P): Define.
365 * system.h (fancy_abort): Declare.
366 (abort): Define.
367 (gcc_assert): Define. Use CHECKING_P.
368
179b8d05
MM
3692015-10-13 Mikhail Maltsev <maltsevm@gmail.com>
370
371 * system.h (CHECKING_P, gcc_checking_assert): Define.
372
87b470b3
MLI
3732015-09-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
374
375 PR c/66415
376 * line-map.c (linemap_position_for_loc_and_offset): Handle the
377 case of long lines encoded in multiple maps.
378
85bc8baa
MP
3792015-09-07 Marek Polacek <polacek@redhat.com>
380
381 * system.h (INTTYPE_MINIMUM): Rewrite to avoid shift warning.
382
bf5372e7
YS
3832015-08-06 Yaakov Selkowitz <yselkowi@redhat.com>
384
385 * configure: Regenerate.
386
d17f7d59
TS
3872015-07-08 Thomas Schwinge <thomas@codesourcery.com>
388
389 * include/line-map.h (RESERVED_LOCATION_COUNT): Change type to
390 source_location.
391
fbb22910
PC
3922015-07-02 Paolo Carlini <paolo.carlini@oracle.com>
393
d885793d 394 PR preprocessor/53690
fbb22910
PC
395 * charset.c (_cpp_valid_ucn): Add cppchar_t * parameter and change
396 return type to bool. Fix encoding of \u0000 and \U00000000 in C++.
397 (convert_ucn): Adjust call.
398 * lex.c (forms_identifier_p): Likewise.
399 * internal.h (_cpp_valid_ucn): Adjust declaration.
400
fe95b036
ESR
4012015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
402
403 Implement N4197 - Adding u8 character literals
404 * include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens;
405 (struct cpp_options): Add utf8_char_literals.
406 * init.c (struct lang_flags): Add utf8_char_literals;
407 (struct lang_flags lang_defaults): Add column for utf8_char_literals.
fbb22910 408 * macro.c (stringify_arg()): Treat CPP_UTF8CHAR token;
fe95b036
ESR
409 * expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()):
410 Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens;
411 (cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token;
412 (eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token.
413 * lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens.
414 * charset.c (converter_for_type(), cpp_interpret_charconst()):
415 Treat CPP_UTF8CHAR token.
416
dc6bcf52
UB
4172015-06-30 Uros Bizjak <ubizjak@gmail.com>
418
419 * lex.c (search_line_sse42) [__GCC_ASM_FLAG_OUTPUTS__]: New main
420 loop using asm flag outputs.
421
a1661b90
MP
4222015-06-08 Marek Polacek <polacek@redhat.com>
423
424 PR c/66415
425 * line-map.c (linemap_position_for_loc_and_offset): Remove
426 linemap_assert_fails; reverse conditions.
427
815facd3
MLI
4282015-05-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
429
430 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER
431 LINE_MAP_MAX_LOCATION_WITH_COLS,LINE_MAP_MAX_SOURCE_LOCATION):
432 New constants.
433 (linemap_line_start): Use them.
434 (linemap_position_for_column): Use them.
435
c819ed29
DM
4362015-05-20 David Malcolm <dmalcolm@redhat.com>
437
438 * include/line-map.h (MAP_START_LOCATION): Eliminate the non-const
439 variant, and tweak comment for the const variant.
440 (ORDINARY_MAP_STARTING_LINE_NUMBER): Drop the non-const variant.
441 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
442 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
443 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
444 (ORDINARY_MAP_FILE_NAME): Drop the non-const variant.
445 (MACRO_MAP_MACRO): Likewise.
446 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
447 (MACRO_MAP_LOCATIONS): Likewise.
448 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
449 * line-map.c (linemap_add): Replace writes through macros with
450 direct field accesses.
451 (linemap_enter_macro): Likewise.
452 (linemap_line_start): Likewise.
453
0e50b624
DM
4542015-05-19 David Malcolm <dmalcolm@redhat.com>
455
456 * directives.c (do_line): Strengthen local "map" from
457 const line_map * to const line_map_ordinary *.
458 (do_linemarker): Likewise.
459 (_cpp_do_file_change): Assert that we're not dealing with
460 a macro map. Introduce local "ord_map" via a call to
461 linemap_check_ordinary, guarded within the check for
462 non-NULL. Use it for typesafety.
463 * files.c (cpp_make_system_header): Strengthen local "map" from
464 const line_map * to const line_map_ordinary *.
465 * include/cpplib.h (struct cpp_callbacks): Likewise for second
466 parameter of "file_change" callback.
467 * include/line-map.h (struct line_map): Convert from a struct
468 containing a union to a base class.
469 (struct line_map_ordinary): Convert to a subclass of line_map.
470 (struct line_map_macro): Likewise.
471 (linemap_check_ordinary): Strengthen return type from line_map *
472 to line_map_ordinary *, and add a const-variant.
473 (linemap_check_macro): New pair of functions.
474 (ORDINARY_MAP_STARTING_LINE_NUMBER): Strengthen param from
475 const line_map * to const line_map_ordinary *, eliminating call
476 to linemap_check_ordinary. Likewise for the non-const variant.
477 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
478 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
479 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Likewise.
480 (ORDINARY_MAP_FILE_NAME): Likewise.
481 (MACRO_MAP_MACRO): Strengthen param from const line_map * to
482 const line_map_macro *. Likewise for the non-const variant.
483 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
484 (MACRO_MAP_LOCATIONS): Likewise.
485 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
486 (struct maps_info): Replace with...
487 (struct maps_info_ordinary):...this and...
488 (struct maps_info_macro): ...this.
489 (struct line_maps): Convert fields "info_ordinary" and
490 "info_macro" to the above new structs.
491 (LINEMAPS_MAP_INFO): Delete both functions.
492 (LINEMAPS_MAPS): Likewise.
493 (LINEMAPS_ALLOCATED): Rewrite both variants to avoid using
494 LINEMAPS_MAP_INFO.
495 (LINEMAPS_USED): Likewise.
496 (LINEMAPS_CACHE): Likewise.
497 (LINEMAPS_MAP_AT): Likewise.
498 (LINEMAPS_ORDINARY_MAPS): Strengthen return type from line_map *
499 to line_map_ordinary *.
500 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
501 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
502 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
503 (LINEMAPS_MACRO_MAPS): Strengthen return type from line_map * to
504 line_map_macro *.
505 (LINEMAPS_MACRO_MAP_AT): Likewise.
506 (LINEMAPS_LAST_MACRO_MAP): Likewise.
507 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
508 (linemap_map_get_macro_name): Strengthen param from
509 const line_map * to const line_map_macro *.
510 (SOURCE_LINE): Strengthen first param from const line_map * to
511 const line_map_ordinary *, removing call to
512 linemap_check_ordinary.
513 (SOURCE_COLUMN): Likewise.
514 (LAST_SOURCE_LINE_LOCATION): Likewise.
515 (LAST_SOURCE_LINE): Strengthen first param from const line_map *
516 to const line_map_ordinary *.
517 (LAST_SOURCE_COLUMN): Likewise.
518 (INCLUDED_FROM): Strengthen return type from line_map * to
519 line_map_ordinary *., and second param from const line_map *
520 to const line_map_ordinary *, removing call to
521 linemap_check_ordinary.
522 (MAIN_FILE_P): Strengthen param from const line_map * to
523 const line_map_ordinary *, removing call to
524 linemap_check_ordinary.
525 (linemap_position_for_line_and_column): Strengthen param from
526 const line_map * to const line_map_ordinary *.
527 (LINEMAP_FILE): Strengthen param from const line_map * to
528 const line_map_ordinary *, removing call to
529 linemap_check_ordinary.
530 (LINEMAP_LINE): Likewise.
531 (LINEMAP_SYSP): Likewise.
532 (linemap_resolve_location): Strengthen final param from
533 const line_map ** to const line_map_ordinary **.
534 * internal.h (CPP_INCREMENT_LINE): Likewise for local "map".
535 (linemap_enter_macro): Strengthen return type from
536 const line_map * to const line_map_macro *.
537 (linemap_add_macro_token): Likewise for first param.
538 * line-map.c (linemap_check_files_exited): Strengthen local "map"
539 from const line_map * to const line_map_ordinary *.
540 (new_linemap): Introduce local "map_size" and use it when
541 calculating how large the buffer should be. Rewrite based
542 on change of info_macro and info_ordinary into distinct types.
543 (linemap_add): Strengthen locals "map" and "from" from line_map *
544 to line_map_ordinary *.
545 (linemap_enter_macro): Strengthen return type from
546 const line_map * to const line_map_macro *, and local "map" from
547 line_map * to line_map_macro *.
548 (linemap_add_macro_token): Strengthen param "map" from
549 const line_map * to const line_map_macro *.
550 (linemap_line_start): Strengthen local "map" from line_map * to
551 line_map_ordinary *.
552 (linemap_position_for_column): Likewise.
553 (linemap_position_for_line_and_column): Strengthen first param
554 from const line_map * to const line_map_ordinary *.
555 (linemap_position_for_loc_and_offset): Strengthen local "map" from
556 const line_map * to const line_map_ordinary *.
557 (linemap_ordinary_map_lookup): Likewise for return type and locals
558 "cached" and "result".
559 (linemap_macro_map_lookup): Strengthen return type and locals
560 "cached" and "result" from const line_map * to
561 const line_map_macro *.
562 (linemap_macro_map_loc_to_exp_point): Likewise for param "map".
563 (linemap_macro_map_loc_to_def_point): Likewise.
564 (linemap_macro_map_loc_unwind_toward_spelling): Likewise.
565 (linemap_get_expansion_line): Strengthen local "map" from
566 const line_map * to const line_map_ordinary *.
567 (linemap_get_expansion_filename): Likewise.
568 (linemap_map_get_macro_name): Strengthen param from
569 const line_map * to const line_map_macro *.
570 (linemap_location_in_system_header_p): Add call to
571 linemap_check_ordinary in region guarded by
572 !linemap_macro_expansion_map_p. Introduce local "macro_map" via
573 linemap_check_macro in other region, using it in place of "map"
574 for typesafety.
575 (first_map_in_common_1): Add calls to linemap_check_macro.
576 (trace_include): Strengthen param "map" from const line_map * to
577 const line_map_ordinary *.
578 (linemap_macro_loc_to_spelling_point): Strengthen final param from
579 const line_map ** to const line_map_ordinary **. Replace a
580 C-style cast with a const_cast, and add calls to
581 linemap_check_macro and linemap_check_ordinary.
582 (linemap_macro_loc_to_def_point): Likewise.
583 (linemap_macro_loc_to_exp_point): Likewise.
584 (linemap_resolve_location): Strengthen final param from
585 const line_map ** to const line_map_ordinary **.
586 (linemap_unwind_toward_expansion): Introduce local "macro_map" via
587 a checked cast and use it in place of *map.
588 (linemap_unwind_to_first_non_reserved_loc): Strengthen local
589 "map1" from const line_map * to const line_map_ordinary *.
590 (linemap_expand_location): Introduce local "ord_map" via a checked
591 cast and use it in place of map.
592 (linemap_dump): Make local "map" const. Strengthen local
593 "includer_map" from line_map * to const line_map_ordinary *.
594 Introduce locals "ord_map" and "macro_map" via checked casts and
595 use them in place of "map" for typesafety.
596 (linemap_dump_location): Strengthen local "map" from
597 const line_map * to const line_map_ordinary *.
598 (linemap_get_file_highest_location): Update for elimination of
599 union.
600 (linemap_get_statistics): Strengthen local "cur_map" from
601 line_map * to const line_map_macro *. Update uses of sizeof to
602 use the appropriate line_map subclasses.
603 * macro.c (_cpp_warn_if_unused_macro): Add call to
604 linemap_check_ordinary.
605 (builtin_macro): Strengthen local "map" from const line_map * to
606 const line_map_macro *.
607 (enter_macro_context): Likewise.
608 (replace_args): Likewise.
609 (tokens_buff_put_token_to): Likewise for param "map".
610 (tokens_buff_add_token): Likewise.
611
ba4ad400
DM
6122015-05-13 David Malcolm <dmalcolm@redhat.com>
613
614 * include/line-map.h (source_location): Add a reference to
615 location-example.txt to the descriptive comment.
616 * location-example.txt: New file.
617
0501dbd9
DM
6182015-05-13 David Malcolm <dmalcolm@redhat.com>
619
620 * include/line-map.h (MAX_SOURCE_LOCATION): Convert from a macro
621 to a const source_location.
622 (RESERVED_LOCATION_COUNT): Likewise.
623 (linemap_check_ordinary): Convert from a macro to a pair of inline
624 functions, for const/non-const arguments.
625 (MAP_START_LOCATION): Likewise.
626 (ORDINARY_MAP_STARTING_LINE_NUMBER): Likewise.
627 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
628 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
629 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Convert from a macro to a
630 pair of inline functions, for const/non-const arguments, where the
631 latter is named...
632 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): New function.
633 (ORDINARY_MAP_FILE_NAME): Convert from a macro to a pair of inline
634 functions, for const/non-const arguments.
635 (MACRO_MAP_MACRO): Likewise.
636 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
637 (MACRO_MAP_LOCATIONS): Likewise.
638 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
639 (LINEMAPS_MAP_INFO): Likewise.
640 (LINEMAPS_MAPS): Likewise.
641 (LINEMAPS_ALLOCATED): Likewise.
642 (LINEMAPS_USED): Likewise.
643 (LINEMAPS_CACHE): Likewise.
644 (LINEMAPS_ORDINARY_CACHE): Likewise.
645 (LINEMAPS_MACRO_CACHE): Likewise.
646 (LINEMAPS_MAP_AT): Convert from a macro to an inline function.
647 (LINEMAPS_LAST_MAP): Likewise.
648 (LINEMAPS_LAST_ALLOCATED_MAP): Likewise.
649 (LINEMAPS_ORDINARY_MAPS): Likewise.
650 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
651 (LINEMAPS_ORDINARY_ALLOCATED): Likewise.
652 (LINEMAPS_ORDINARY_USED): Likewise.
653 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
654 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
655 (LINEMAPS_MACRO_MAPS): Likewise.
656 (LINEMAPS_MACRO_MAP_AT): Likewise.
657 (LINEMAPS_MACRO_ALLOCATED): Likewise.
658 (LINEMAPS_MACRO_USED): Likewise.
659 (LINEMAPS_MACRO_LOWEST_LOCATION): Likewise.
660 (LINEMAPS_LAST_MACRO_MAP): Likewise.
661 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
662 (IS_ADHOC_LOC): Likewise.
663 (COMBINE_LOCATION_DATA): Likewise.
664 (SOURCE_LINE): Likewise.
665 (SOURCE_COLUMN): Likewise.
666 (LAST_SOURCE_LINE_LOCATION): Likewise.
667 (LAST_SOURCE_LINE): Likewise.
668 (LAST_SOURCE_COLUMN): Likewise.
669 (LAST_SOURCE_LINE_LOCATION)
670 (INCLUDED_FROM): Likewise.
671 (MAIN_FILE_P): Likewise.
672 (LINEMAP_FILE): Likewise.
673 (LINEMAP_LINE): Likewise.
674 (LINEMAP_SYSP): Likewise.
675 (linemap_location_before_p): Likewise.
676 * line-map.c (linemap_check_files_exited): Make local "map" const.
677 (linemap_add): Use SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS.
678 (linemap_line_start): Likewise.
679
eb70f327
MH
6802015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
681
682 * aclocal.m4: Regenerated with automake-1.11.6.
683
60c12095
DM
6842015-05-13 David Malcolm <dmalcolm@redhat.com>
685
686 * include/line-map.h (linemap_assert): Move up within the file to
687 before all of the map accessor macros.
688 (linemap_assert_fails): Likewise.
689 (linemap_check_ordinary): Likewise.
690 (linemap_macro_expansion_map_p): Likewise.
691
c3388e62
DM
6922015-05-12 David Malcolm <dmalcolm@redhat.com>
693
694 * directives.c (do_line): Set seen_line_directive on line_table.
695 (do_linemarker): Likewise.
696 * include/line-map.h (struct line_maps): Add new field
697 "seen_line_directive".
698
fe191308
JM
6992015-05-08 Jason Merrill <jason@redhat.com>
700
701 * include/cpplib.h: Add CPP_W_CXX11_COMPAT.
702 (struct cpp_options): Add cpp_warn_cxx11_compat.
703 * init.c (cpp_create_reader): Initialize it.
704 * lex.c (lex_string): Add -Wc++11-compat warning.
705
21c0a521
DM
7062015-05-05 David Malcolm <dmalcolm@redhat.com>
707
708 * pch.c (cpp_valid_state): Fix indentation so that it reflects the
709 block structure.
710
c87b25e6
DM
7112015-05-05 David Malcolm <dmalcolm@redhat.com>
712
713 * include/line-map.h: Fix comment at the top of the file.
714 (source_location): Rewrite and expand the comment for this
715 typedef, adding an ascii-art table to clarify how source_location
716 values are allocated.
717 * line-map.c: Fix comment at the top of the file.
718
ca708025
RB
7192015-04-09 Richard Biener <rguenther@suse.de>
720
721 PR pch/65550
722 * files.c (pch_open_file): Allow main and pre-included files
723 when trying to open a PCH.
724
e4b33ee5
JJ
7252015-04-06 Jakub Jelinek <jakub@redhat.com>
726
727 PR preprocessor/61977
728 * lex.c (cpp_peek_token): If peektok is CPP_EOF, back it up
729 with all tokens peeked by the current function.
730
b8cd77f4
JJ
7312015-04-02 Jakub Jelinek <jakub@redhat.com>
732
733 PR preprocessor/61977
734 * lex.c (cpp_peek_token): Temporarily clear pfile->cb.line_change.
735
fb136e35
JJ
7362015-03-23 Jakub Jelinek <jakub@redhat.com>
737
738 PR preprocessor/65238
739 * internal.h (_cpp_scan_out_logical_line): Add third argument.
740 * directives.c (prepare_directive_trad): Pass false to it.
741 * traditional.c (_cpp_read_logical_line_trad,
742 _cpp_create_trad_definition): Likewise.
743 (struct fun_macro): Add paramc field.
744 (fun_like_macro): New function.
745 (maybe_start_funlike): Handle NODE_BUILTIN macros. Initialize
746 macro->paramc field.
747 (save_argument): Use macro->paramc instead of
748 macro->node->value.macro->paramc.
749 (push_replacement_text): Formatting fix.
750 (recursive_macro): Use fun_like_macro helper.
751 (_cpp_scan_out_logical_line): Likewise. Add BUILTIN_MACRO_ARG
752 argument. Initialize fmacro.paramc field. Handle builtin
753 function-like macros.
754
a5858a3d
ESR
7552015-03-16 Edward Smith-Rowland <3dw4rd@verizon.net>
756
757 PR c++/64626
758 * lex.c (lex_number): If a number ends with digit-seps (') skip back
759 and let lex_string take them.
760
44d95244
MT
7612015-03-02 Markus Trippelsdorf <markus@trippelsdorf.de>
762
763 PR target/65261
764 * lex.c (search_line_fast): Silence ubsan errors.
765
f8abc9ba
DS
7662015-02-03 <dodji@redhat.com>
767
768 PR preprocessor/64803
769 * internal.h (cpp_reader::top_most_macro_node): New data member.
770 * macro.c (enter_macro_context): Pass the location of the end of
771 the top-most invocation of the function-like macro, or the
772 location of the expansion point of the top-most object-like macro.
773 (cpp_get_token_1): Store the top-most macro node in the new
774 pfile->top_most_macro_node data member.
775 (_cpp_pop_context): Clear the new cpp_reader::top_most_macro_node
776 data member.
777
95d0610c
SN
7782015-01-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
779
780 * lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON.
781
10ef8f28
MP
7822015-01-23 Marek Polacek <polacek@redhat.com>
783
784 DR#412
785 PR preprocessor/60570
786 * directives.c (do_elif): Don't evaluate #elif conditionals
787 when they don't need to be.
788
6e6cb471
JJ
7892015-01-16 Jakub Jelinek <jakub@redhat.com>
790
791 * expr.c (cpp_classify_number): Add N_() around ?: string
792 literals used in cpp_error_with_line call as format string.
793
5624e564
JJ
7942015-01-05 Jakub Jelinek <jakub@redhat.com>
795
796 Update copyright years.
797
1f8d3e84
JJ
7982014-12-19 Jakub Jelinek <jakub@redhat.com>
799
800 PR preprocessor/63831
801 * directives.c (lex_macro_node): Remove __has_attribute__ handling.
802 * internal.h (struct spec_node): Remove n__has_attribute__ field.
803 (struct lexer_state): Remove in__has_attribute__ field.
804 * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_ATTRIBUTE.
805 * identifiers.c (_cpp_init_hashtable): Remove __has_attribute__
806 handling.
807 * init.c (builtin_array): Add __has_attribute and __has_cpp_attribute.
808 (cpp_init_special_builtins): Don't initialize __has_attribute
809 or __has_cpp_attribute if CLK_ASM or pfile->cb.has_attribute is NULL.
810 * traditional.c (enum ls): Remove ls_has_attribute,
811 ls_has_attribute_close.
812 (_cpp_scan_out_logical_line): Remove __has_attribute__ handling.
813 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_ATTRIBUTE.
814 * pch.c (cpp_read_state): Remove __has_attribute__ handling.
815 * expr.c (eval_token): Likewise.
816 (parse_has_attribute): Removed.
817
01ca36af
UB
8182014-12-11 Uros Bizjak <ubizjak@gmail.com>
819
820 * directives.c (cpp_define_formatted): Use xvasprintf.
821
b93c0722
MLI
8222014-12-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
823
824 * line-map.c (linemap_position_for_loc_and_offset): Add new
825 linemap_assert_fails.
826
73bd8329
MLI
8272014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
828
829 * include/line-map.h (linemap_assert_fails): Declare.
830 * line-map.c (linemap_position_for_loc_and_offset): Use it.
831
9c320ab1
MLI
8322014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
833
49445904
UB
834 * line-map.c (linemap_add): Fix typo.
835 (linemap_line_start): Fix whitespace.
9c320ab1 836
81fee4a7
JM
8372014-11-29 John Schmerge <jbschmerge@gmail.com>
838
839 PR preprocessor/41698
840 * charset.c (one_utf8_to_utf16): Do not produce surrogate pairs
841 for 0xffff.
842
43ba1c6c
JJ
8432014-11-25 Jakub Jelinek <jakub@redhat.com>
844
845 PR preprocessor/60436
846 * line-map.c (linemap_line_start): If highest is above 0x60000000
847 and we are still tracking columns or highest is above 0x70000000,
848 force add_map.
849
8a23b100
UB
8502014-11-20 Uros Bizjak <ubizjak@gmail.com>
851
852 PR target/63966
1b6b13f3
UB
853 * lex.c [__i386__ || __x86_64__]: Compile special SSE functions
854 only for (__GNUC__ >= 5 || !defined(__PIC__)).
8a23b100 855
d82f1e13
MLI
8562014-11-13 Manuel López-Ibáñez <manu@gcc.gnu.org>
857
858 * include/line-map.h: Include EXPR, so that unused variable warnings
859 do not occur.
860
3aa34c1d
MLI
8612014-11-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
862
863 PR fortran/44054
864 * include/line-map.h (linemap_position_for_loc_and_offset):
865 Declare.
866 * line-map.c (linemap_position_for_loc_and_offset): New.
867
35485da9
DM
8682014-11-11 David Malcolm <dmalcolm@redhat.com>
869
870 * ChangeLog.jit: New.
871
42fd12b1
ESR
8722014-11-10 Edward Smith-Rowland <3dw4rd@verizon.net>
873
874 * include/cpplib.h (cpp_callbacks): Add has_attribute.
875 * internal.h (lexer_state): Add in__has_attribute__.
876 * directives.c (lex_macro_node): Prevent use of __has_attribute__
877 as a macro.
878 * expr.c (parse_has_attribute): New function; (eval_token): Look for
879 __has_attribute__ and route to parse_has_attribute.
880 * identifiers.c (_cpp_init_hashtable): Initialize n__has_attribute__.
881 * pch.c (cpp_read_state): Initialize n__has_attribute__.
882 * traditional.c (enum ls): Add ls_has_attribute, ls_has_attribute_close;
883 (_cpp_scan_out_logical_line): Attend to __has_attribute__.
884
be5ffc59
JM
8852014-11-06 Joseph Myers <joseph@codesourcery.com>
886
887 * include/cpp-id-data.h (struct cpp_macro): Update comment
888 regarding parameters.
889 * include/cpplib.h (struct cpp_macro_arg, struct cpp_identifier):
890 Add spelling fields.
891 (struct cpp_token): Update comment on macro_arg.
892 * internal.h (_cpp_save_parameter): Add extra argument.
893 (_cpp_spell_ident_ucns): New declaration.
894 * lex.c (lex_identifier): Add SPELLING argument. Set *SPELLING to
895 original spelling of identifier.
896 (_cpp_lex_direct): Update calls to lex_identifier.
897 (_cpp_spell_ident_ucns): New function, factored out of
898 cpp_spell_token.
899 (cpp_spell_token): Adjust FORSTRING argument semantics to return
900 original spelling of identifiers. Use _cpp_spell_ident_ucns in
901 !FORSTRING case.
902 (_cpp_equiv_tokens): Check spellings of identifiers and macro
903 arguments are identical.
904 * macro.c (macro_arg_saved_data): New structure.
905 (paste_tokens): Use original spellings of identifiers from
906 cpp_spell_token.
907 (_cpp_save_parameter): Add argument SPELLING. Save both canonical
908 node and its value.
909 (parse_params): Update calls to _cpp_save_parameter.
910 (lex_expansion_token): Save spelling of macro argument tokens.
911 (_cpp_create_definition): Extract canonical node from saved data.
912 (cpp_macro_definition): Use UCNs in spelling of macro name. Use
913 original spellings of macro argument tokens and identifiers.
914 * traditional.c (scan_parameters): Update call to
915 _cpp_save_parameter.
916
701cade1
JM
9172014-11-05 Joseph Myers <joseph@codesourcery.com>
918
919 PR preprocessor/9449
920 * init.c (lang_defaults): Enable extended identifiers for C++ and
921 C99-based standards.
922
19a9ba64
AM
9232014-10-22 Alan Modra <amodra@gmail.com>
924
925 * symtab.c (ht_create): Use obstack_specify_allocation in place of
926 _obstack_begin.
927 * files.c (_cpp_init_files): Likewise.
928 * init.c (cpp_create_reader): Likewise.
929 * identifiers.c (_cpp_init_hashtable): Likewise.
930
3aac0952
MLI
9312014-10-14 Manuel López-Ibáñez <manu@gcc.gnu.org>
932
933 * include/line-map.h (linemap_location_from_macro_expansion_p):
934 const struct line_maps * argument.
935 (linemap_position_for_line_and_column): const struct line_map *
936 argument.
937 * line-map.c (linemap_add_macro_token): Use correct argument name
938 in comment.
939 (linemap_position_for_line_and_column): const struct line_map *
940 argument.
941 (linemap_macro_map_loc_to_def_point): Fix comment. Make static.
942 (linemap_location_from_macro_expansion_p): const struct line_maps *
943 argument.
944 (linemap_resolve_location): Fix argument names in comment.
945
0ccaaab0
BS
9462014-10-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
947
948 * lex.c (search_line_fast): Add new version to be used for Power8
949 and later targets when Altivec is enabled. Restrict the existing
950 Altivec version to big-endian systems so that lvsr is not used on
951 little endian, where it is deprecated. Remove LE-specific code
952 from the now-BE-only version.
953
dc257367
BE
9542014-10-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
955 Jeff Law <law@redhat.com>
956
957 * charset.c (convert_no_conversion): Reallocate memory with 25%
958 headroom.
959
a15f7cb8
ESR
9602014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net>
961
962 Implement SD-6: SG10 Feature Test Recommendations
963 * internal.h (lexer_state, spec_nodes): Add in__has_include__.
964 * directives.c: Support __has_include__ builtin.
965 * expr.c (parse_has_include): New function to parse __has_include__
966 builtin; (eval_token()): Use it.
967 * files.c (_cpp_has_header()): New funtion to look for header;
968 (open_file_failed()): Not an error to not find a header file for
969 __has_include__.
970 * identifiers.c (_cpp_init_hashtable()): Add entry for __has_include__.
971 * pch.c (cpp_read_state): Lookup __has_include__.
972 * traditional.c (enum ls, _cpp_scan_out_logical_line()): Walk through
973 __has_include__ statements.
974
cc811a8a
BE
9752014-09-30 Bernd Edlinger <bernd.edlinger@hotmail.de>
976
977 PR preprocessor/58893
978 * errors.c (cpp_diagnostic): Fix possible out of bounds access.
979 * files.c (_cpp_stack_include): Initialize src_loc for IT_CMDLINE.
980
083e891e
MP
9812014-09-24 Marek Polacek <polacek@redhat.com>
982
983 PR c/61405
984 PR c/53874
985 * include/cpplib.h (enum cpp_ttype): Define CPP_KEYWORD.
986
d87fc699
JH
9872014-09-17 Jan Hubicka <hubicka@ucw.cz>
988
989 * charset.c (conversion): Rename to ...
990 (cpp_conversion): ... this one; update.
991 * files.c (file_hash_entry): Rename to ...
992 (cpp_file_hash_entry): ... this one ; update.
993
909eb89c
MP
9942014-09-17 Marek Polacek <polacek@redhat.com>
995
996 PR c/61854
997 * init.c (struct lang_flags): Remove cplusplus_comments.
998 (cpp_set_lang): Likewise.
999 (post_options): Likewise.
1000 * lex.c (_cpp_lex_direct): Disallow C++ style comments in C90/C94.
1001
1ef33fd4
MLI
10022014-09-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
1003
1004 * include/cpplib.h (struct cpp_options): Declare warn_normalize as
1005 int instead of enum.
1006
2b71f4a4
MLI
10072014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
1008
1009 * macro.c (replace_args): Use cpp_pedwarning, cpp_warning and
1010 CPP_W flags.
1011 * include/cpplib.h: Add CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC.
1012 * init.c (cpp_create_reader): Do not init to -1 here.
1013 * expr.c (num_binary_op): Use cpp_pedwarning.
1014
81b5d104
MLI
10152014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
1016
1017 * directives.c (check_eol_1): New.
1018 (check_eol_endif_labels): New.
1019 (check_eol): Call check_eol_1.
1020 (do_else,do_endif): Call check_eol_endif_labels.
1021
b753b37b
MLI
10222014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
1023
1024 * macro.c (warn_of_redefinition): Suppress warnings for builtins
1025 that lack the NODE_WARN flag, unless Wbuiltin-macro-redefined.
1026 (_cpp_create_definition): Use Wbuiltin-macro-redefined for
1027 builtins that lack the NODE_WARN flag.
1028 * directives.c (do_undef): Likewise.
1029 * init.c (cpp_init_special_builtins): Do not change flags
1030 depending on Wbuiltin-macro-redefined.
1031
7c05e50c
ESR
10322014-08-28 Edward Smith-Rowland <3dw4rd@verizon.net>
1033
1034 PR cpp/23827 - standard C++ should not have hex float preprocessor
1035 tokens
1036 * libcpp/init.c (lang_flags): Change CXX98 flag for extended numbers
1037 from 1 to 0.
1038 * libcpp/expr.c (cpp_classify_number): Weite error message for improper
1039 use of hex floating literal.
1040
e4276ba5
ESR
10412014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
1042
1043 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z;
1044 Rename CLK_GNUCXX1Y, CLK_CXX1Y to CLK_GNUCXX14, CLK_CXX14;
1045 * init.c (struct lang_flags lang_defaults): Add column for trigraphs;
1046 Add rows for CLK_GNUCXX1Z, CLK_CXX1Z; (cpp_set_lang): Set trigraphs;
1047 (cpp_init_builtins): Set __cplusplus to 201402L for C++14;
1048 Set __cplusplus to 201500L for C++17.
1049 * expr.c (cpp_classify_number): Change C++1y to C++14 in binary
1050 constants error message.
1051
dd3ff077
MP
10522014-08-20 Marek Polacek <polacek@redhat.com>
1053
1054 * include/cpplib.h (cpp_options): Use signed char.
1055 * lex.c (_cpp_lex_direct): Don't warn in C++ mode.
1056
3f4f5c9a
MP
10572014-08-19 Marek Polacek <polacek@redhat.com>
1058
1059 * lex.c (_cpp_lex_direct): Fix a typo.
1060
177cce46
MP
10612014-08-19 Marek Polacek <polacek@redhat.com>
1062
1063 * charset.c (_cpp_valid_ucn): Warn only if -Wc90-c99-compat.
1064 * lex.c (_cpp_lex_direct): Likewise.
1065 * macro.c (replace_args): Likewise.
1066 (parse_params): Likewise.
1067 * include/cpplib.h (cpp_options): Change cpp_warn_c90_c99_compat
1068 to char.
1069
f3bede71
MP
10702014-08-10 Marek Polacek <polacek@redhat.com>
1071
1072 PR c/51849
1073 * lex.c (_cpp_lex_direct): Warn when -Wc90-c99-compat is in effect.
1074 * charset.c (_cpp_valid_ucn): Likewise.
1075 * include/cpplib.h (cpp_options): Add cpp_warn_c90_c99_compat.
1076 * macro.c (replace_args): Warn when -Wc90-c99-compat is in effect.
1077 (parse_params): Likewise.
1078
61eb99f6
MP
10792014-07-27 Marek Polacek <polacek@redhat.com>
1080
1081 PR c/61861
1082 * macro.c (builtin_macro): Add location parameter. Set
1083 location of builtin macro to the expansion point.
1084 (enter_macro_context): Pass location to builtin_macro.
1085
c468587a
DS
10862014-07-16 Dodji Seketeli <dodji@redhat.com>
1087
1088 Support location tracking for built-in macro tokens
1089 * include/line-map.h (line_maps::builtin_location): New data
1090 member.
1091 (line_map_init): Add a new parameter to initialize the new
1092 line_maps::builtin_location data member.
1093 * line-map.c (linemap_init): Initialize the
1094 line_maps::builtin_location data member.
1095 * macro.c (builtin_macro): Create a macro map and track the token
1096 resulting from the expansion of a built-in macro.
1097
3976796b
ESR
10982014-07-10 Edward Smith-Rowland <3dw4rd@verizon.net>
1099 Jonathan Wakely <jwakely@redhat.com>
1100
c786fca6 1101 PR preprocessor/61389
3976796b
ESR
1102 * macro.c (_cpp_arguments_ok, parse_params, create_iso_definition):
1103 Warning messages mention C++11 in c++ mode and C99 in c mode.
1104 * lex.c (lex_identifier_intern, lex_identifier): Ditto
1105
7aee8646
ESR
11062014-07-09 Edward Smith-Rowland <3dw4rd@verizon.net>
1107
1108 PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped
1109 by preprocessor
1110 * lex.c (lex_raw_string ()): Do not warn about invalid suffix
1111 if skipping. (lex_string ()): Ditto.
1112
98ba7482
ESR
11132014-06-04 Edward Smith-Rowland <3dw4rd@verizon.net>
1114
1115 PR c++/61038
1116 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
1117 Combine user-defined escape logic with the other string and char logic.
1118
edf6ddf6
RB
11192014-05-26 Richard Biener <rguenther@suse.de>
1120
1121 * configure.ac: Remove long long and __int64 type checks,
1122 add check for uint64_t and fail if that wasn't found.
1123 * include/cpplib.h (cpp_num_part): Use uint64_t.
1124 * config.in: Regenerate.
1125 * configure: Likewise.
1126
28939589
MP
11272014-05-21 Marek Polacek <polacek@redhat.com>
1128
1129 PR c/61212
1130 * files.c (find_file_in_dir): Add parens around &&.
1131
49039169
ESR
11322014-05-20 Edward Smith-Rowland <3dw4rd@verizon.net>
1133
28939589 1134 PR c++/61038
49039169
ESR
1135 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
1136 Check for user-defined literal strings and user-defined literal chars
1137 to escape necessary characters.
1138
54da09ee
RB
11392014-05-20 Richard Biener <rguenther@suse.de>
1140
1141 * configure.ac: Copy gcc logic of detecting a 64bit type.
1142 Remove HOST_WIDE_INT define.
1143 * include/cpplib.h: typedef cpp_num_part to a 64bit type,
1144 similar to how hwint.h does it.
1145 * config.in: Regenerate.
1146 * configure: Likewise.
1147
eac3e079
JY
11482014-05-09 Joey Ye <joey.ye@arm.com>
1149
1150 * files.c (find_file_in_dir): Always try to shorten for DOS
1151 non-system headers.
1152 * init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS.
1153
f543058d
RB
11542014-05-07 Richard Biener <rguenther@suse.de>
1155
1156 * configure.ac: Always set need_64bit_hwint to yes.
1157 * configure: Regenerated.
1158
d9f069ab
RO
11592014-04-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1160
1161 * lex.c: Remove Solaris 9 reference.
1162
341c653c
WL
11632014-02-24 Walter Lee <walt@tilera.com>
1164
1165 * configure.ac: Change "tilepro" triplet to "tilepro*".
1166 * configure: Regenerate.
1167
179652df
JJ
11682014-02-19 Jakub Jelinek <jakub@redhat.com>
1169
1170 PR preprocessor/58844
1171 * macro.c (enter_macro_context): Only push
1172 macro_real_token_count (macro) tokens rather than
1173 macro->count tokens, regardless of
1174 CPP_OPTION (pfile, track-macro-expansion).
1175
acf601ae
JJ
11762014-02-07 Jakub Jelinek <jakub@redhat.com>
1177
1178 PR preprocessor/56824
1179 * line-map.c (get_combined_adhoc_loc, linemap_get_expansion_line,
1180 linemap_get_expansion_filename, linemap_location_in_system_header_p,
1181 linemap_location_from_macro_expansion_p,
1182 linemap_macro_loc_to_spelling_point, linemap_macro_loc_to_def_point,
1183 linemap_macro_loc_to_exp_point, linemap_expand_location): Fix
1184 formatting.
1185 (linemap_compare_locations): Look through adhoc locations for both
1186 l0 and l1.
1187
7ecc3eb9
DS
11882014-01-23 Dodji Seketeli <dodji@redhat.com>
1189
1190 PR PR preprocessor/58580
1191 * include/line-map.h (linemap_get_file_highest_location): Declare
1192 new function.
1193 * line-map.c (linemap_get_file_highest_location): Define it.
1194
35c3d610
RS
11952014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
1196
1197 Update copyright years
1198
3a4efce7
JM
11992013-12-09 Joseph Myers <joseph@codesourcery.com>
1200
1201 PR preprocessor/55715
1202 * expr.c (num_binary_op): Implement subtraction directly rather
1203 than with negation and falling through into addition case.
1204
aadce585
BS
12052013-11-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
1206
1207 * lex.c (search_line_fast): Correct for little endian.
1208
d3f4ff8b
JM
12092013-11-15 Joseph Myers <joseph@codesourcery.com>
1210
1211 * ucnid.tab: Add C11 and C11NOSTART data.
1212 * makeucnid.c (digit): Rename enum value to N99.
1213 (C11, N11, all_languages): New enum values.
1214 (NUM_CODE_POINTS, MAX_CODE_POINT): New macros.
1215 (flags, decomp, combining_value): Use NUM_CODE_POINTS as array
1216 size.
1217 (decomp): Use unsigned int as element type.
1218 (all_decomp): New array.
1219 (read_ucnid): Handle C11 and C11NOSTART. Use MAX_CODE_POINT.
1220 (read_table): Use MAX_CODE_POINT. Store all decompositions in
1221 all_decomp.
1222 (read_derived): Use MAX_CODE_POINT.
1223 (write_table): Use NUM_CODE_POINTS. Print N99, C11 and N11
1224 flags. Print whole array variable declaration rather than just
1225 array contents.
1226 (char_id_valid, write_context_switch): New functions.
1227 (main): Call write_context_switch.
1228 * ucnid.h: Regenerate.
1229 * include/cpplib.h (struct cpp_options): Add c11_identifiers.
1230 * init.c (struct lang_flags): Add c11_identifiers.
1231 (cpp_set_lang): Set c11_identifiers option from selected language.
1232 * internal.h (struct normalize_state): Document "previous" as
1233 previous starter character.
1234 (NORMALIZE_STATE_UPDATE_IDNUM): Take character as argument.
1235 * charset.c (DIG): Rename enum value to N99.
1236 (C11, N11): New enum values.
1237 (struct ucnrange): Give name to struct. Use short for flags and
1238 unsigned int for end of range. Include ucnid.h for whole variable
1239 declaration.
1240 (ucn_valid_in_identifier): Allow for characters up to 0x10FFFF.
1241 Allow for C11 in determining valid characters and valid start
1242 characters. Use check_nfc for non-Hangul context-dependent
1243 checks. Only store starter characters in nst->previous.
1244 (_cpp_valid_ucn): Pass new argument to
1245 NORMALIZE_STATE_UPDATE_IDNUM.
1246 * lex.c (lex_identifier): Pass new argument to
1247 NORMALIZE_STATE_UPDATE_IDNUM. Call NORMALIZE_STATE_UPDATE_IDNUM
1248 after initial non-UCN part of identifier.
1249 (lex_number): Pass new argument to NORMALIZE_STATE_UPDATE_IDNUM.
1250
54848ff8
JM
12512013-11-15 Joseph Myers <joseph@codesourcery.com>
1252
1253 * ucnid.tab: Mark C99 digits as [C99DIG].
1254 * makeucnid.c (read_ucnid): Handle [C99DIG].
1255 (read_table): Don't check for digit characters.
1256 * ucnid.h: Regenerate.
1257
5157b91e
TB
12582013-11-06 Tobias Burnus <burnus@net-b.de>
1259
1260 * macro.c (_cpp_builtin_macro_text): Correct
1261 wording of two warnings.
1262
e8ff5196
TB
12632013-11-05 Tobias Burnus <burnus@net-b.de>
1264
1265 * include/cpplib.h (CPP_W_DATE_TIME): Added.
1266 (cpp_options): Add warn_date_time.
1267 * init.c (cpp_create_reader): Init it.
1268 * macro.c (_cpp_builtin_macro_text): Warn when
1269 __DATE__/__TIME__/__TIMESTAMP__ is used.
1270
7057e645
ESR
12712013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
1272
e8ff5196 1273 Implement C++14 digit separators.
7057e645
ESR
1274 * include/cpplib.h (cpp_options): Add digit_separators flag.
1275 * internal.h (DIGIT_SEP(c)): New macro.
1276 * expr.c (cpp_classify_number): Check improper placement of digit sep;
1277 (cpp_interpret_integer): Skip over digit separators.
1278 * init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add
1279 digit separator flags per language; (cpp_set_lang): Set
1280 digit_separators
1281 * lex.c (lex_number): Add digits separator to allowable characters for
1282 C++14.
1283
459260ec
DM
12842013-10-15 David Malcolm <dmalcolm@redhat.com>
1285
1286 * Makefile.in (PICFLAG): New.
1287 (ALL_CFLAGS): Add PICFLAG.
1288 (ALL_CXXFLAGS): Likewise.
1289 * configure.ac: Add --enable-host-shared, setting up new
1290 PICFLAG variable.
1291 * configure: Regenerate.
1292
fd6eea0c
RE
12932013-08-07 Richard Earnshaw <rearnsha@arm.com>
1294
1295 * configure.ac: Set need_64bit_hwint for all arm targets.
1296 * configure: Regenerated.
1297
8cf88735
JJ
12982013-07-20 Jakub Jelinek <jakub@redhat.com>
1299
1300 PR preprocessor/57620
1301 * lex.c (lex_raw_string): Undo phase1 and phase2 transformations
1302 between R" and final " rather than only in between R"del( and )del".
1303
87e356ba
JJ
13042013-07-10 Jakub Jelinek <jakub@redhat.com>
1305
d5e48350
JJ
1306 PR preprocessor/57824
1307 * lex.c (lex_raw_string): Allow reading new-lines if
1308 in_deferred_pragma or if parsing_args and there is still
1309 data in the current buffer.
1310
c26302d5
JJ
1311 * include/cpplib.h (cpp_token_val_index): Change parameter type to
1312 const cpp_token *.
1313 * lex.c (cpp_token_val_index): Likewise.
1314
87e356ba
JJ
1315 PR preprocessor/57757
1316 * lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING
1317 or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that
1318 starts if a-zA-Z_.
1319
c865f923
ESR
13202013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
1321
1322 * lex.c (lex_raw_string(), lex_string()): Constrain suffixes treated
1323 as concatenated literal and macro to just the patterns found in
1324 inttypes.h; (is_macro()): New.
1325
39953c79
DC
13262013-06-24 Dehao Chen <dehao@google.com>
1327
1328 * files.c (_cpp_stack_include): Fix the highest_location when header
1329 file is guarded by #ifndef and is included twice.
1330
01187df0
JJ
13312013-04-28 Jakub Jelinek <jakub@redhat.com>
1332
1333 N3472 binary constants
1334 * include/cpplib.h (struct cpp_options): Fix a typo in user_literals
1335 field comment. Add binary_constants field.
1336 * init.c (struct lang_flags): Add binary_constants field.
1337 (lang_defaults): Add bin_cst column to the table.
1338 (cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants).
1339 * expr.c (cpp_classify_number): Talk about C++11 instead of C++0x
1340 in diagnostics. Accept binary constants if
1341 CPP_OPTION (pfile, binary_constants) even when pedantic. Adjust
1342 pedwarn message.
1343
61949153
PC
13442013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
1345
1346 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y.
1347 * init.c (lang_defaults): Add defaults for the latter.
1348 (cpp_init_builtins): Define __cplusplus as 201300L for the latter.
1349 * lex.c (_cpp_lex_direct): Update.
1350
994a4cc0
SH
13512013-04-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
1352
1353 PR target/56771
1354 * configure.ac: Require 64-bit int for arm*-*-rtems*.
1355 * configure: Regenerate.
1356
28937f11
JJ
13572013-03-06 Jakub Jelinek <jakub@redhat.com>
1358
1359 PR middle-end/56461
1360 * internal.h (struct cpp_buffer): Add to_free field.
1361 (_cpp_pop_file_buffer): Add third argument.
1362 * files.c (_cpp_stack_file): Set buffer->to_free.
1363 (_cpp_pop_file_buffer): Add to_free argument. Free to_free
1364 if non-NULL, and if equal to file->buffer_start, also clear
1365 file->buffer{,_start,_valid}.
1366 * directives.c (_cpp_pop_buffer): Pass buffer->to_free
1367 to _cpp_pop_file_buffer.
1368
3b8af25b
JJ
13692013-03-01 Jakub Jelinek <jakub@redhat.com>
1370
1371 PR middle-end/56461
1372 * files.c (_cpp_save_file_entries): Free result at the end.
1373 * pch.c (cpp_string_free): New function.
1374 (cpp_save_state): Use it in htab_create call.
1375 (cpp_write_pch_deps): Free ss->defs. Destroy ss->definedhash.
1376
1a80db97
JJ
13772013-02-28 Jakub Jelinek <jakub@redhat.com>
1378
15fd8332
JJ
1379 * files.c (_cpp_find_file): If returning early, before storing
1380 something to *hash_slot and *hash_slot is NULL, call htab_clear_slot
1381 on it. Access *hash_slot using void * type rather than
1382 struct file_hash_entry * to avoid aliasing issues.
1383
1a80db97
JJ
1384 * configure.ac: Don't define ENABLE_CHECKING whenever
1385 --enable-checking is seen, instead use similar --enable-checking=yes
1386 vs. --enable-checking=release default as gcc/ subdir has and
1387 define ENABLE_CHECKING if ENABLE_CHECKING is defined in gcc/.
1388 Define ENABLE_VALGRIND_CHECKING if requested.
1389 * lex.c (new_buff): If ENABLE_VALGRIND_CHECKING, put _cpp_buff
1390 struct first in the allocated buffer and result->base after it.
1391 (_cpp_free_buff): If ENABLE_VALGRIND_CHECKING, free buff itself
1392 instead of buff->base.
1393 * config.in: Regenerated.
1394 * configure: Regenerated.
1395
561f7fc7
ESR
13962013-02-13 Ed Smith-Rowland <3dw4rd@verizon.net>
1397
1398 PR c++/55582
61949153 1399 * lex.c (lex_raw_string): Allow string literal with suffix
561f7fc7
ESR
1400 beginning with 's' to be parsed as a C++11 user-defined literal.
1401
500f3ed9
RS
14022013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
1403
1404 Update copyright years.
1405
1582c677
PC
14062013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
1407
1408 PR c++/54526 (again)
1409 * lex.c (_cpp_lex_direct): In C++11 mode, implement 2.5 p3, bullet 2.
1410
8ac16127
MG
14112013-01-03 Marc Glisse <marc.glisse@inria.fr>
1412
1413 PR bootstrap/50177
1414 * line-map.c (get_combined_adhoc_loc): Cast from extern "C" type.
1415 (new_linemap): Likewise.
1416 (linemap_enter_macro): Likewise.
1417
f41e5bd1
JJ
14182012-12-03 Jakub Jelinek <jakub@redhat.com>
1419
1420 PR bootstrap/55380
1421 PR other/54691
1422 * files.c (read_file_guts): Allocate extra 16 bytes instead of
1423 1 byte at the end of buf. Pass size + 16 instead of size
1424 to _cpp_convert_input.
1425 * charset.c (_cpp_convert_input): Reallocate if there aren't
1426 at least 16 bytes beyond to.len in the buffer. Clear 16 bytes
1427 at to.text + to.len.
1428
31962032
SE
14292012-11-21 Steve Ellcey <sellcey@mips.com>
1430
1431 PR pch/55399
1432 * files.c (pch_open_file): Fix check for implicit_preinclude.
1433
5dc99c46
SB
14342012-11-16 Simon Baldwin <simonb@google.com>
1435
1436 * include/cpplib.h (struct cpp_options): Add canonical_system_headers.
1437 * files.c (find_file_in_dir): Call maybe_shorter_path() only if
1438 canonical_system_headers is set.
1439 * init.c (cpp_create_reader): Initialize canonical_system_headers.
1440 * configure.ac: Add new --enable-canonical-system-headers.
1441 * configure: Regenerate.
1442 * config.in: Regenerate.
1443
a4a0016d
ESR
14442012-11-09 Ed Smith-Rowland <3dw4rd@verizon.net>
1445
1446 PR c++/54413
1447 * include/cpplib.h (cpp_interpret_float_suffix): Add cpp_reader* arg.
1448 (cpp_interpret_int_suffix): Add cpp_reader* arg.
1449 * init.c (cpp_create_reader): Iitialize new flags.
1450 * expr.c (interpret_float_suffix): Use new flags.
1451 (cpp_interpret_float_suffix): Add cpp_reader* arg.
1452 (interpret_int_suffix): Use new flags.
1453 (cpp_interpret_int_suffix): Add cpp_reader* arg.
1454 (cpp_classify_number): Adjust calls to interpret_x_suffix.
1455
04ce690f
IB
14562012-10-23 Ian Bolton <ian.bolton@arm.com>
1457 Jim MacArthur <jim.macarthur@arm.com>
1458 Marcus Shawcroft <marcus.shawcroft@arm.com>
1459 Nigel Stephens <nigel.stephens@arm.com>
1460 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
1461 Richard Earnshaw <rearnsha@arm.com>
1462 Sofiane Naci <sofiane.naci@arm.com>
1463 Stephen Thomas <stephen.thomas@arm.com>
1464 Tejas Belagod <tejas.belagod@arm.com>
1465 Yufeng Zhang <yufeng.zhang@arm.com>
1466
1467 * configure.ac: Enable AArch64.
1468 * configure: Regenerate.
1469
1efcb8c6
JM
14702012-10-23 Joseph Myers <joseph@codesourcery.com>
1471
1472 * files.c (struct _cpp_file): Add implicit_preinclude.
1473 (pch_open_file): Allow a previously opened implicitly included
1474 file.
1475 (_cpp_find_file): Add implicit_preinclude argument. Free file and
1476 do not call open_file_failed if implicit_preinclude. Store
1477 implicit_preinclude value.
1478 (_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date):
1479 Update calls to _cpp_find_file.
1480 (_cpp_stack_include): Handle IT_DEFAULT.
1481 (cpp_push_default_include): New.
1482 * include/cpplib.h (cpp_push_default_include): Declare.
1483 * init.c (cpp_read_main_file): Update call to _cpp_find_file.
1484 * internal.h (enum include_type): Add IT_DEFAULT.
1485 (_cpp_find_file): Update prototype.
1486
55e7f907
TB
14872012-10-15 Tobias Burnus <burnus@net-b.de>
1488
1489 * files.c (read_file_guts, _cpp_save_file_entries): Free memory
1490 before returning.
1491 * lex.c (warn_about_normalization): Ditto.
1492 * mkdeps.c (deps_save): Ditto.
1493 * pch.c (cpp_valid_state): Ditto.
1494
f591bd8f
FW
14952012-10-04 Florian Weimer <fweimer@redhat.com>
1496
1497 * directives.c (do_pragma_warning_or_error): New.
1498 (do_pragma_warning): New.
1499 (do_pragma_error): New.
1500 (_cpp_init_internal_pragmas): Register new pragmas.
1501
ec6e0399
DC
15022012-09-25 Dehao Chen <dehao@google.com>
1503
1504 PR middle-end/54704
1505 * line-map.c (location_adhoc_data_hash): Fix the hash function.
1506
52187008
DC
15072012-09-25 Dehao Chen <dehao@google.com>
1508
1509 PR middle-end/54645
1510 * include/line-map.h (location_adhoc_data): Move location_adhoc_data
1511 into GC.
1512 (location_adhoc_data_map): Likewise.
1513 (line_maps): Likewise.
1514 (rebuild_location_adhoc_htab): New Function.
1515 * line-map.c (+rebuild_location_adhoc_htab): new Funcion.
1516 (get_combined_adhoc_loc): Move location_adhoc_data into GC.
1517 (location_adhoc_data_fini): Likewise.
1518 (linemap_init): Likewise.
1519 (location_adhoc_data_init): Remove Function.
1520
5368224f
DC
15212012-09-19 Dehao Chen <dehao@google.com>
1522
1523 * include/line-map.h (MAX_SOURCE_LOCATION): New value.
1524 (location_adhoc_data_fini): New.
1525 (get_combined_adhoc_loc): New.
1526 (get_data_from_adhoc_loc): New.
1527 (get_location_from_adhoc_loc): New.
1528 (location_adhoc_data_map): New.
1529 (COMBINE_LOCATION_DATA): New.
1530 (IS_ADHOC_LOC): New.
1531 (expanded_location): New field.
1532 (line_maps): New field.
1533 * line-map.c (location_adhoc_data): New.
1534 (location_adhoc_data_hash): New.
1535 (location_adhoc_data_eq): New.
1536 (location_adhoc_data_update): New.
1537 (get_combined_adhoc_loc): New.
1538 (get_data_from_adhoc_loc): New.
1539 (get_location_from_adhoc_loc): New.
1540 (location_adhoc_data_init): New.
1541 (location_adhoc_data_fini): New.
1542 (linemap_init): Initialize location_adhoc_data.
1543 (linemap_lookup): Change to use new location.
1544 (linemap_ordinary_map_lookup): Likewise.
1545 (linemap_macro_map_lookup): Likewise.
1546 (linemap_macro_map_loc_to_def_point): Likewise.
1547 (linemap_macro_map_loc_unwind_toward_spel): Likewise.
1548 (linemap_get_expansion_line): Likewise.
1549 (linemap_get_expansion_filename): Likewise.
1550 (linemap_location_in_system_header_p): Likewise.
1551 (linemap_location_from_macro_expansion_p): Likewise.
1552 (linemap_macro_loc_to_spelling_point): Likewise.
1553 (linemap_macro_loc_to_def_point): Likewise.
1554 (linemap_macro_loc_to_exp_point): Likewise.
1555 (linemap_resolve_location): Likewise.
1556 (linemap_unwind_toward_expansion): Likewise.
1557 (linemap_unwind_to_first_non_reserved_loc): Likewise.
1558 (linemap_expand_location): Likewise.
1559 (linemap_dump_location): Likewise.
1560 (linemap_line_start): Likewise.
1561
f3d25c65
DS
15622012-05-25 Dodji Seketeli <dodji@redhat.com>
1563
1564 PR preprocessor/53469
1565 * directives.c (do_pragma): Use the virtual location for the
1566 pragma token, instead of its spelling location.
1567
0823efed
DN
15682012-08-14 Diego Novillo <dnovillo@google.com>
1569
1570 Merge from cxx-conversion branch. Configury.
1571
1572 * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
1573 * configure.ac: Likewise.
1574 * configure: Regenerate.
1575
15762012-08-14 Lawrence Crowl <crowl@google.com>
1577
1578 Merge from cxx-conversion branch. New C++ hash table.
1579
1580 * include/symtab.h (typedef struct ht hash_table): Change the typedef
1581 name to cpp_hash_table. Update all users of the typedef.
1582
c0fd3497
LB
15832012-07-30 Laurynas Biveinis <laurynas.biveinis@gmail.com>
1584
1585 * include/line-map.h (line_map_macro): Use the "atomic" GTY option
1586 for the macro_locations field.
1587
d35d1c0f
UB
15882011-06-19 Uros Bizjak <ubizjak@gmail.com>
1589
1590 * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
1591 __builtin_ia32_pcmpestri128 instead of asm.
1592
d86d2119
DA
15932012-06-04 Dimitrios Apostolou <jimis@gmx.net>
1594
1595 * line-map.c (linemap_enter_macro): Don't zero max_column_hint in
1596 every macro. This improves performance by reducing the number of
1597 reallocations when track-macro-expansion is on.
1598
7ca643e1
DS
15992012-06-04 Dodji Seketeli <dodji@redhat.com>
1600
1601 PR preprocessor/53463
1602 * line-map.c (linemap_location_in_system_header_p): For built-in
1603 macro tokens, check the first expansion point location that is not
1604 for a token coming from a built-in macro.
1605
7d9641cc
JM
16062012-05-29 Joseph Myers <joseph@codesourcery.com>
1607
1608 * directives.c: Fix typos.
1609 * include/line-map.h: Fix typos.
1610 * line-map.c: Fix typos.
1611 * macro.c: Fix typos.
1612
53a103d3
DS
16132012-05-25 Dodji Seketeli <dodji@redhat.com>
1614
1615 PR bootstrap/53459
1616 * lex.c (search_line_fast): Avoid unused local typedefs to simulate
1617 a static assertion.
1618
828a7f76
DS
16192012-05-29 Dodji Seketeli <dodji@redhat.com>
1620
1621 PR preprocessor/53229
1622 * internal.h (cpp_reader::set_invocation_location): Remove.
1623 (cpp_reader::about_to_expand_macro_p): New member flag.
1624 * directives.c (do_pragma): Remove Kludge as
1625 pfile->set_invocation_location is no more.
1626 * macro.c (cpp_get_token_1): Do away with the use of
1627 cpp_reader::set_invocation_location. Just collect the macro
1628 expansion point when we are about to expand the top-most macro.
1629 Do not override cpp_reader::about_to_expand_macro_p.
1630 This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding
1631 properly handle locations of expansion points.
1632 (cpp_get_token_with_location): Adjust, as
1633 cpp_reader::set_invocation_location is no more.
1634 (paste_tokens): Take a virtual location parameter for
1635 the LHS of the pasting operator. Use it in diagnostics. Update
1636 comments.
1637 (paste_all_tokens): Tighten the assert. Propagate the location of
1638 the expansion point when no virtual locations are available.
1639 Pass the virtual location to paste_tokens.
1640 (in_macro_expansion_p): New static function.
1641 (enter_macro_context): Set the cpp_reader::about_to_expand_macro_p
1642 flag until we really start expanding the macro.
1643
0b2c4be5
DS
16442012-05-16 Dodji Seketeli <dodji@redhat.com>
1645
1646 PR preprocessor/7263
1647 * include/cpplib.h (cpp_classify_number): Take a location
1648 parameter.
1649 * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic
1650 macros that take a location parameter.
1651 (cpp_classify_number): Take a (virtual) location parameter. Use
1652 it for diagnostics. Adjust comments.
1653 (eval_token): Take a location parameter. Pass it to
1654 cpp_classify_number and to diagnostic routines.
1655 (_cpp_parse_expr): Use virtual locations of tokens when parsing
1656 expressions. Pass a virtual location to eval_token and to
1657 diagnostic routines.
1658
638d2065
TG
16592012-05-10 Tristan Gingold <gingold@adacore.com>
1660
1661 * expr.c (interpret_float_suffix): Add a guard.
1662
3ad64f53
DS
16632012-05-02 Dodji Seketeli <dodji@redhat.com>
1664
1665 Properly initialize cpp_context in destringize_and_run
1666 * directives.c (destringize_and_run): Properly initialize the new
1667 context.
1668 * macro.c (_cpp_pop_context): Assert that we shouldn't try to pop
1669 the initial base context, which has the same life time as the
1670 current instance of cpp_file.
1671
b193dfa8
MLI
16722012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
1673 Dodji Seketeli <dodji@seketeli.org>
1674
3efc2959 1675 PR c++/52974
b193dfa8
MLI
1676 * libcpp/files.c (maybe_shorter_path): New.
1677 (find_file_in_dir): Use it.
1678
4e65a470
DS
16792012-04-30 Dodji Seketeli <dodji@redhat.com>
1680
51fce2d3
DS
1681 Switch -ftrack-macro-expansion=2 on by default.
1682 * init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
1683 by default. Add comments.
1684
c4ca1a09
DS
1685 Strip "<built-in>" loc from displayed expansion context
1686 * include/line-map.h (linemap_unwind_toward_expansion): Fix typo
1687 in comment.
1688 (linemap_unwind_to_first_non_reserved_loc): Declare new function.
1689 * line-map.c (linemap_unwind_to_first_non_reserved_loc): Define
1690 new function.
1691
3600218c
DS
1692 Fix expansion point loc for macro-like tokens
1693 * macro.c (macro_of_context): New static function.
1694 (_cpp_push_token_context, push_extended_tokens_context): If the
1695 macro argument is NULL, it means we are continuing the expansion
1696 of the current macro, if any. Update comments.
1697 (_cpp_pop_context): Re-enable expansion of the macro only when we
1698 are really out of the context of the current expansion.
1699
0ff2b8a0
DS
1700 Fix token pasting with -ftrack-macro-expansion
1701 * macro.c (paste_all_tokens): Put the token resulting from pasting
1702 into an extended token context with -ftrack-macro-location is in
1703 effect.
1704
4e65a470
DS
1705 Fix cpp_sys_macro_p with -ftrack-macro-expansion
1706 * macro.c (cpp_sys_macro_p): Support -ftrack-macro-expansion.
1707
112448b4
DS
17082012-04-29 Dodji Seketeli <dodji@redhat.com>
1709
1710 * lex.c (lex_raw_string): Change C++ style comments into C style
1711 comments.
19a9ba64 1712 (lex_string): Likewise.
112448b4 1713
7f5f5f98
OW
17142012-04-27 Ollie Wild <aaw@google.com>
1715
1716 * include/cpplib.h (struct cpp_options): Add new field,
1717 warn_literal_suffix.
1718 (CPP_W_LITERAL_SUFFIX): New enum.
1719 * init.c (cpp_create_reader): Default initialization of
1720 warn_literal_suffix.
1721 * lex.c (lex_raw_string): Treat user-defined literals which don't
1722 begin with '_' as separate tokens and produce a warning.
1723 (lex_string): Ditto.
1724
1d72e96f
MLI
17252012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
1726
1727 * line-map.c (linemap_resolve_location): Synchronize comments with
1728 those in line-map.h.
1729 * include/line-map.h (linemap_resolve_location): Fix spelling in
1730 comment.
1731
e75b54a2
RE
17322012-03-22 Richard Earnshaw <rearnsha@arm.com>
1733
1734 * lex.c (search_line_fast): Provide Neon-optimized version for ARM.
1735
7888f266
RO
17362012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1737
1738 * lex.c: Remove Solaris 8 reference.
1739
dd552284
WL
17402012-02-14 Walter Lee <walt@tilera.com>
1741
1742 * configure.ac: Require 64-bit hwint for tilegx and tilepro.
1743 * configure: Regenerate.
1744
2c5cbc31
RG
17452012-01-09 Richard Guenther <rguenther@suse.de>
1746
1747 * macro.c (_cpp_builtin_macro_text): Remove unused variable map.
1748
b492b686
GF
17492012-01-09 Gary Funck <gary@intrepid.com>
1750
1751 PR preprocessor/33919
1752 * files.c (_cpp_get_file_name): New. Implement file name
1753 access function.
1754 * internal.h (_cpp_get_file_name): New prototype.
1755 * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
1756 to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
1757
75291c57
OH
17582012-01-03 Olivier Hainque <hainque@adacore.com>
1759
1760 * system.h: Prior to #define, #undef fopen and freopen unconditionally.
1761
48b0b196
JM
17622011-12-20 Joseph Myers <joseph@codesourcery.com>
1763
1764 * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
1765 (CLK_STDC1X): Change to CLK_STDC11.
1766 * init.c (lang_defaults): Update comments.
1767 (cpp_init_builtins): Update language tests. Use 201112L for C11
1768 __STDC_VERSION__.
1769
4a5e00ca
AS
17702011-12-20 Andreas Schwab <schwab@linux-m68k.org>
1771
1772 * configure: Regenerate.
1773
095af58f
AS
17742011-12-19 Andreas Schwab <schwab@linux-m68k.org>
1775
1776 * configure: Regenerate.
1777
b0c084b7
JJ
17782011-12-07 Jakub Jelinek <jakub@redhat.com>
1779
1780 PR bootstrap/50237
1781 * internal.h (_cpp_init_lexer): New prototype.
1782 * init.c (init_library): Call it.
1783 * lex.c (init_vectorized_lexer): Remove constructor attribute,
1784 add inline keyword.
1785 (HAVE_init_vectorized_lexer): Define.
1786 (_cpp_init_lexer): New function.
1787
9b554be9
DS
17882011-12-03 Dodji Seketeli <dodji@redhat.com>
1789
1790 * macro.c (tokens_buff_remove_last_token)
1791 (tokens_buff_put_token_to): Add an 'inline' function specifier to
1792 the prototype.
1793
8dcf72a8
DN
17942011-11-22 Diego Novillo <dnovillo@google.com>
1795
1796 * include/line-map.h (linemap_dump): Declare.
1797 (line_table_dump): Declare.
1798 * line-map.c (linemap_dump): New.
1799 (line_table_dump): New.
1800
7e74ce3f
ESR
18012011-11-21 Ed Smith-Rowland <3dw4rd@verizon.net>
1802
1803 PR c++/50958
1804 * expr.c (cpp_userdef_char_remove_type): Fix typo.
1805
e9411247
MM
18062011-11-03 Michael Matz <matz@suse.de>
1807
1808 PR bootstrap/50857
1809 * configure.ac: Check for -fno-exceptions -fno-rtti.
1810 * configure: Regenerate.
1811 * Makefile.in (NOEXCEPTION_FLAGS): New flag.
1812 (ALL_CXXFLAGS): Use it.
1813
0c1dace3
PC
18142011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
1815
1816 * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
1817
25339f10
JM
18182011-11-02 Jason Merrill <jason@redhat.com>
1819
1820 PR c++/50810
1821 * configure.ac: Add -Wno-narrowing to warning options.
1822
97e3ad20
JM
18232011-10-31 Jason Merrill <jason@redhat.com>
1824
1fb80b0c
JM
1825 PR libstdc++/1773
1826 * init.c (cpp_init_builtins): Set __cplusplus for C++11.
1827
97e3ad20
JM
1828 PR c++/50920
1829 * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
1830 CLK_GNUCXX0X to CLK_GNUCXX11.
1831
3ce4f9e4
ESR
18322011-10-26 Ed Smith-Rowland <3dw4rd@verizon.net>
1833
1834 Implement C++11 user-defined literals.
1835 * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
1836 cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
1837 cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
1838 cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
1839 (cpp_classify_number): Classify unrecognized tokens as user-defined
1840 literals.
1841 * include/cpplib.h: Add new tokens for user-defined literals.
1842 * init.c: Add new preprocessor flag (cxx11).
1843 * lex.c: (lex_string, lex_raw_string): Handle user-defined literals
1844 including concatenation and promotion with suffixes.
1845
3bb0c8db
DS
18462011-10-24 Dodji Seketeli <dodji@redhat.com>
1847
1848 * line-map.c (linemap_macro_map_lookup): Fix logic.
1849
84756fd4
DS
18502011-10-24 Dodji Seketeli <dodji@redhat.com>
1851
1852 * include/line-map.h (linemap_expand_location): Take a line table
1853 parameter. Update comment.
1854 (linemap_resolve_location): Update comment.
1855 (linemap_expand_location_full): Remove.
1856 * line-map.c (linemap_resolve_location): Handle reserved
1857 locations; return a NULL map in those cases.
1858 (linemap_expand_location): If location is reserved, return a
1859 zeroed expanded location. Update comment. Take a line table to
1860 assert that the function takes non-virtual locations only.
1861 (linemap_expand_location_full): remove.
1862 (linemap_dump_location): Handle the fact that
1863 linemap_resolve_location can return NULL line maps when the
1864 location resolves to a reserved location.
1865
1866 * line-map.c (linemap_macro_map_lookup): Fix logic.
1867
ad2305ad
DS
18682011-10-22 Dodji Seketeli <dodji@redhat.com>
1869
1870 PR bootstrap/50778
1871 * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
1872 context to act upon.
1873 * lex.c (_cpp_remaining_tokens_num_in_context): Likewise. Update
1874 comment.
1875 (cpp_token_from_context_at): Likewise.
1876 (cpp_peek_token): Use the context to peek tokens from.
1877
cbbcf655
DS
18782011-10-20 Dodji Seketeli <dodji@redhat.com>
1879
1880 PR bootstrap/50801
1881 * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
1882 number of tokens.
1883
d17687f6
DS
18842011-10-18 Dodji Seketeli <dodji@redhat.com>
1885
1886 PR bootstrap/50760
1887 * include/line-map.h (struct linemap_stats): Change the type of
19a9ba64 1888 the members from size_t to long.
d17687f6 1889 * macro.c (macro_arg_token_iter_init): Unconditionally initialize
19a9ba64 1890 iter->location_ptr.
d17687f6 1891
411f92de
DS
18922011-10-17 Dodji Seketeli <dodji@redhat.com>
1893
1894 * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
19a9ba64
AM
1895 variable without using it if ENABLE_CHECKING is not defined. Mark
1896 the LOCATION parameter as being unused.
411f92de 1897
b9bd6f74
TT
18982011-10-15 Tom Tromey <tromey@redhat.com>
1899 Dodji Seketeli <dodji@redhat.com>
1900
1901 * include/line-map.h (struct line_maps::alloced_size_for_request):
1902 New member.
1903 * line-map.c (new_linemap): Use set->alloced_size_for_request to
1904 get the actual allocated size of line maps.
1905
64a1a422
TT
19062011-10-15 Tom Tromey <tromey@redhat.com>
1907 Dodji Seketeli <dodji@redhat.com>
1908
1909 * line-map.h (struct linemap_stats): Declare new struct.
1910 (linemap_get_statistics): Declare ...
1911 * line-map.c (linemap_get_statistics): ... new function.
1912 * macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
1913 Declare new counters.
1914 (enter_macro_context, replace_args): Update
1915 num_macro_tokens_counter.
1916 (cpp_get_token_1): Update num_expanded_macros_counter.
1917
847e697a
TT
19182011-10-15 Tom Tromey <tromey@redhat.com>
1919 Dodji Seketeli <dodji@redhat.com>
1920
1921 * include/cpplib.h (struct cpp_options)<debug>: New struct member.
1922 * include/line-map.h (linemap_dump_location): Declare ...
1923 * line-map.c (linemap_dump_location): ... new function.
1924
92582b75
TT
19252011-10-15 Tom Tromey <tromey@redhat.com>
1926 Dodji Seketeli <dodji@redhat.com>
1927
1928 * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
1929 New option.
1930 * internal.h (struct macro_context): New struct.
1931 (enum context_tokens_kind): New enum.
1932 (struct cpp_context)<tokens_kind>: New member of type enum
1933 context_tokens_kind.
1934 (struct cpp_context)<macro>: Remove this. Replace it with an enum
1935 of macro and macro_context.
1936 (struct cpp_context)<direct_p>: Remove.
1937 (_cpp_remaining_tokens_num_in_context): Declare new function.
1938 * directives.c (destringize_and_run): Adjust.
1939 * lex.c (_cpp_remaining_tokens_num_in_context)
1940 (_cpp_token_from_context_at): Define new functions
1941 (cpp_peek_token): Use them.
1942 * init.c (cpp_create_reader): Initialize the base context to zero.
1943 (_cpp_token_from_context_at): Define new static function.
1944 (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
1945 _cpp_token_from_context_at.
1946 * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
1947 members.
1948 (enum macro_arg_token_kind): New enum.
1949 (struct macro_arg_token_iter): New struct.
1950 (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
1951 (alloc_expanded_arg_mem, ensure_expanded_arg_room)
1952 (delete_macro_args, set_arg_token, get_arg_token_location)
1953 (arg_token_ptr_at, macro_arg_token_iter_init)
1954 (macro_arg_token_iter_get_token)
1955 (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
1956 (expanded_token_index, tokens_buff_new, tokens_buff_count)
1957 (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
1958 (tokens_buff_add_token, tokens_buff_remove_last_token)
1959 (reached_end_of_context, consume_next_token_from_context): New
1960 static functions.
1961 (cpp_get_token_1): New static function. Split and extended from
1962 cpp_get_token. Use reached_end_of_context and
1963 consume_next_token_from_context. Unify its return point. Move
1964 the location tweaking from cpp_get_token_with_location in here.
1965 (cpp_get_token): Use cpp_get_token_1
1966 (stringify_arg): Use the new arg_token_at.
1967 (paste_all_tokens): Support tokens coming from extended tokens
1968 contexts.
1969 (collect_args): Return the number of collected arguments, by
1970 parameter. Store virtual locations of tokens that constitute the
1971 collected args.
1972 (funlike_invocation_p): Return the number of collected arguments,
1973 by parameter.
1974 (enter_macro_context): Add a parameter for macro expansion point.
1975 Pass it to replace_args and to the "used" cpp callback. Get the
1976 number of function-like macro arguments from funlike_invocation_p,
1977 pass it to the new delete_macro_args to free the memory used by
1978 macro args. When -ftrack-macro-expansion is in effect, for macros
1979 that have no arguments, create a macro map for the macro expansion
1980 and use it to allocate proper virtual locations for tokens
1981 resulting from the expansion. Push an extended tokens context
1982 containing the tokens resulting from macro expansion and their
1983 virtual locations.
1984 (replace_args): Rename the different variables named 'count' into
1985 variables with more meaningful names. Create a macro map;
1986 allocate virtual locations of tokens resulting from this
1987 expansion. Use macro_arg_token_iter to iterate over tokens of a
1988 given macro. Handle the case of the argument of
1989 -ftrack-macro-expansion being < 2. Don't free macro arguments
1990 memory resulting from expand_arg here, as these are freed by the
1991 caller of replace_arg using delete_macro_args now. Push extended
1992 token context.
1993 (next_context, push_ptoken_context, _cpp_push_token_context)
1994 (_cpp_push_text_context): Properly initialize the context.
1995 (expand_arg): Use the new alloc_expanded_arg_mem,
1996 push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
1997 (_cpp_pop_context): Really free the memory held by the context.
1998 Handle freeing memory used by extended tokens contexts.
1999 (cpp_get_token_with_location): Use cpp_get_token_1.
2000 (cpp_sys_macro_p): Adjust.
2001 (_cpp_backup_tokens): Support the new kinds of token contexts.
2002 * traditional.c (recursive_macro): Adjust.
2003
46427374
TT
20042011-10-15 Tom Tromey <tromey@redhat>
2005 Dodji Seketeli <dodji@redhat.com>
2006
2007 * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
2008 member.
2009 (MAX_SOURCE_LOCATION): New constant.
2010 (struct line_map_ordinary, struct line_map_macro): New structs.
19a9ba64 2011 (struct line_map): Turn this into a union of the two above. Add
46427374
TT
2012 comments.
2013 (struct maps_info): New struct.
2014 (struct line_maps)<info_ordinary, info_macro>: Two new fields.
2015 These now carry the map information that was previously scattered
2016 in struct line_maps.
2017 (struct map_info::allocated): Fix comment.
2018 (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
2019 (ORDINARY_MAP_STARTING_LINE_NUMBER)
2020 (ORDINARY_MAP_INCLUDER_FILE_INDEX)
2021 (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
2022 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
2023 (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
2024 (MACRO_MAP_EXPANSION_POINT_LOCATION)
2025 (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
2026 (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
2027 (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
2028 (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
2029 (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
2030 (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
2031 (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
2032 (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
2033 (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
2034 (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
2035 (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
2036 information.
2037 (linemap_check_ordinary, linemap_assert)
2038 (linemap_location_before_p): New macros.
2039 (linemap_position_for_line_and_column)
2040 (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
2041 (linemap_macro_expansion_map_p)
2042 (linemap_macro_map_loc_to_def_point)
2043 (linemap_macro_map_loc_unwind_once)
2044 (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
2045 (linemap_get_source_line linemap_get_source_column)
2046 (linemap_map_get_macro_name, linemap_get_file_path)
2047 (linemap_location_in_system_header_p)
2048 (linemap_location_from_macro_expansion_p): Declare new functions.
2049 (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
2050 (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
2051 accessors act on ordinary maps only.
2052 (INCLUDED_FROM): Return NULL for main files; use the new
2053 accessors.
2054 (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
2055 (struct expanded_location): Move here from gcc/input.h
2056 (linemap_resolve_location, linemap_expand_location)
2057 (linemap_expand_location_full): Declare new functions.
2058 * line-map.c: Include cpplib.h, internal.h
2059 (linemap_enter_macro, linemap_add_macro_token)
2060 (linemap_get_expansion_line, linemap_get_expansion_filename): New
2061 functions that are private to libcpp.
2062 (linemap_assert): New macro.
2063 (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
2064 (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
2065 (linemap_macro_map_loc_unwind_toward_spelling)
2066 (linemap_macro_map_loc_to_exp_point)
2067 (first_map_in_common_1, first_map_in_common): New static
2068 functions.
2069 (new_linemap): Define new static functions. Extracted and
2070 enhanced from ...
2071 (linemap_add): ... here. Use linemap_assert in lieu of abort
2072 previously.
2073 (linemap_tracks_macro_expansion_locs_p)
2074 (linemap_add_macro_token, linemap_macro_expansion_map_p)
2075 (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
2076 (linemap_macro_map_loc_to_def_point)
2077 (linemap_macro_map_loc_unwind_once)
2078 (linemap_step_out_once, linemap_map_get_index)
2079 (linemap_get_source_line,linemap_get_source_column)
2080 (linemap_get_file_path, linemap_map_get_macro_name)
2081 (linemap_location_in_system_header_p)
2082 (linemap_location_originated_from_system_header_p)
2083 (linemap_location_from_macro_expansion_p)
2084 (linemap_tracks_macro_expansion_locs_p)
2085 (linemap_resolve_location, linemap_expand_location)
2086 (linemap_expand_location_full)
2087 (linemap_tracks_macro_expansion_locs_p)
2088 (linemap_position_for_line_and_column, linemap_compare_locations):
2089 Define new public functions.
2090 (linemap_init): Initialize ordinary and macro maps information in
2091 the map set.
2092 (linemap_check_files_exited): Use the new accessors.
2093 (linemap_free): Remove this dead code.
2094 (linemap_line_start): Assert this uses an ordinary map. Adjust to
2095 use the new ordinary map accessors and data structures. Don't
2096 overflow past the lowest possible macro token's location.
2097 (linemap_position_for_column): Assert the ordinary maps of the map
2098 set are really ordinary. Use ordinary map accessors.
2099 (linemap_lookup): Keep the same logic but generalize to allow
2100 lookup of both ordinary and macro maps. Do not crash when called
2101 with an empty line table.
2102 * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
2103 new API of line-map.h.
2104 * directives.c (start_directive, do_line, do_linemarker)
2105 (do_linemarker): Likewise.
2106 * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
2107 (make_cpp_dir, cpp_make_system_header): Likewise.
2108 * init.c (cpp_read_main_file): Likewise.
2109 * internal.h (CPP_INCREMENT_LINE): Likewise.
2110 (linemap_enter_macro, linemap_add_macro_token)
2111 (linemap_get_expansion_line, linemap_get_expansion_filename): New
2112 functions private to libcpp.
2113 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
2114 (skip_line_comment, skip_whitespace, lex_raw_string)
2115 (_cpp_lex_direct): Likewise.
2116 * macro.c (_cpp_builtin_macro_text): Likewise.
2117 (_cpp_aligned_alloc): Initialize the new name member of the macro.
2118 * traditional.c (copy_comment, _cpp_scan_out_logical_line):
2119 Likewise.
2120 * errors.c (cpp_diagnostic): Adjust to new linemap API.
2121
892a371f
DS
21222011-08-28 Dodji Seketeli <dodji@redhat.com>
2123
2124 * line-map.c (linemap_add): Assert that reason must not be
2125 LC_RENAME when called for the first time on a "main input file".
2126
e3dfef44
GC
21272011-08-22 Gabriel Charette <gchare@google.com>
2128
2129 * init.c (cpp_create_reader): Inititalize forced_token_location_p.
2130 * internal.h (struct cpp_reader): Add field forced_token_location_p.
2131 * lex.c (_cpp_lex_direct): Use forced_token_location_p.
2132 (cpp_force_token_locations): New.
2133 (cpp_stop_forcing_token_locations): New.
2134
32fe396e
RO
21352011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2136
2137 PR libstdc++/1773
2138 * init.c (cpp_init_builtins): Define __cplusplus 19971L.
2139
7c1ffff9
JM
21402011-08-18 Joseph Myers <joseph@codesourcery.com>
2141
2142 * include/cpplib.h (struct cpp_options): Fix typo.
2143
a48e3dd1
JM
21442011-08-18 Joseph Myers <joseph@codesourcery.com>
2145
2146 * include/cpplib.h (struct cpp_options): Add rliterals.
2147 * init.c (struct lang_flags, lang_defaults): Add rliterals.
2148 (cpp_set_lang): Set rliterals option.
2149 (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
2150 * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
2151
3f6ced10
GC
21522011-08-15 Gabriel Charette <gchare@google.com>
2153
2154 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
2155 Update all users to use linemap_position_for_column instead.
2156
0681d04c
GC
21572011-07-28 Gabriel Charette <gchare@google.com>
2158
2159 * include/line-map.h (struct line_maps):
2160 Remove unused field last_listed. Update all users.
2161
5e9627ca
L
21622011-07-28 H.J. Lu <hongjiu.lu@intel.com>
2163
2164 * configure.ac: Set need_64bit_hwint to yes for x86 targets.
2165 * configure: Regenerated.
2166
a024b70f
RO
21672011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2168
2169 * system.h [__cplusplus]: Wrap C function declarations in extern "C".
2170
5b6d595b
RO
21712011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2172 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2173
2174 PR bootstrap/49794
2175 * configure.ac: Test AM_ICONV with CXX.
2176 * configure: Regenerate.
2177 * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
2178
d0a9fbe1
DS
21792011-07-15 Dodji Seketeli <dodji@redhat.com>
2180
2181 * directives.c (struct if_stack): Use source_location as type
2182 here.
2183 * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
2184 indent, def_pragma, used_define, used_undef>: Properly use
2185 source_location as parameter type, rather than unsigned int.
2186
fbdd5d87
RO
21872011-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2188
2189 PR target/39150
2190 * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
2191 like i[34567]86-*-solaris2.1[0-9]*.
2192 * configure: Regenerate.
2193
8787a05a
JM
21942011-06-16 Jason Merrill <jason@redhat.com>
2195
2196 PR c++/45399
2197 * lex.c (lex_raw_string): Don't check for embedded NUL.
2198
38fbfaf6
DS
21992011-06-06 Dodji Seketeli <dodji@redhat.com>
2200
2201 PR preprocessor/48532
2202 * directives.c (do_pragma): Don't forget the invocation location
2203 when parsing the pragma name of a namespaced pragma directive.
2204
fc0993ac
JT
22052011-05-29 John Tytgat <John.Tytgat@aaug.net>
2206
2207 * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
2208
ef230b38
UB
22092011-05-22 Uros Bizjak <ubizjak@gmail.com>
2210
2211 PR target/49104
2212 * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
2213 is defined. Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
2214
e5b0dad8
JK
22152011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
2216
2217 * system.h (ENUM_BITFIELD): Remove.
2218
6cfae070
JJ
22192011-04-24 Jakub Jelinek <jakub@redhat.com>
2220
2221 PR preprocessor/48740
2222 * lex.c (lex_raw_string): When raw string ends with
2223 ??) followed by raw prefix and ", ensure it is preprocessed
2224 with ??) rather than ??].
2225
04695783
JM
22262011-04-20 Jim Meyering <meyering@redhat.com>
2227
2228 * files.c (destroy_cpp_file): Remove useless if-before-free.
2229 * init.c (cpp_destroy): Likewise.
2230 * macro.c (replace_args): Likewise.
2231 * pch.c (cpp_valid_state): Likewise.
2232
4489800d
KT
22332011-03-25 Kai Tietz <ktietz@redhat.com>
2234
2235 * files.c (file_hash_eq): Use filename_cmp
2236 instead of strcmp.
2237 (nonexistent_file_hash_eq): Likewise.
2238 (remap_filename): Likewise.
2239 Handle absolute DOS-path,
2240 (append_file_to_dir): Check for IS_DIR_SEPARATOR
2241 instead of slash.
2242 (read_name_map): Likewise.
2243 * linemap.c (linemap_add): Use filename_cmp
2244 instead of strcmp.
2245 * mkdeps.c (apply_vpath): Use filename_ncmp
2246 instead of strncmp.
2247 (deps_restore): Use filename_cmp instead of
2248 strcmp.
2249 * init.c (read_original_directory): Use
2250 IS_DIR_SEPARATOR instead of checking for slash.
2251
f3c33d9d
MM
22522011-03-21 Michael Meissner <meissner@linux.vnet.ibm.com>
2253
2254 PR preprocessor/48192
2255 * directives.c (do_ifdef): Do not consider conditional macros as
2256 being defined.
2257 (do_ifndef): Ditto.
2258 * expr.c (parse_defined): Ditto.
2259
01956319
RH
22602011-03-18 Richard Henderson <rth@redhat.com>
2261
2262 PR bootstrap/45381
2263 * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
2264
c5a62c6f 22652011-11-04 Eric Botcazou <ebotcazou@adacore.com>
19a9ba64 2266 Jakub Jelinek <jakub@redhat.com>
c5a62c6f
EB
2267
2268 PR preprocessor/39213
2269 * directives.c (end_directive): Call _cpp_remove_overlay for deferred
2270 pragmas as well in traditional mode.
2271
0e1a989c
ILT
22722010-11-17 Ian Lance Taylor <iant@google.com>
2273
2274 PR bootstrap/45538
2275 * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of
2276 AC_LANG based on ENABLE_BUILD_WITH_CXX.
2277
651a20b5
KT
22782010-11-16 Kai Tietz <kai.tietz@onevision.com>
2279
2280 PR preprocessor/17349
2281 * lex.c (save_comment): Handle in argument passing c++
2282 comments special.
2283
480767a9
ILT
22842010-11-02 Ian Lance Taylor <iant@google.com>
2285
2286 * configure.ac: Use AC_SYS_LARGEFILE.
2287 * configure: Rebuild.
2288 * config.in: Rebuild.
2289
078419c9 22902010-10-19 Basile Starynkevitch <basile@starynkevitch.net>
480767a9 2291
078419c9
BS
2292 * line-map.h (source_location): Remove obsolete comment
2293 mentioning location_s.
2294
d6874138
KT
22952010-09-29 Kai Tietz <kai.tietz@onevision.com>
2296
2297 PR preprocessor/45362
2298 * directives.c (cpp_pop_definition): Make static.
2299 (do_pragma_push_macro): Reworked to store text
2300 definition.
2301 (do_pragma_pop_macro): Add free text definition.
2302 (cpp_push_definition): Removed.
2303 * include/cpplib.h (cpp_push_definition): Removed.
2304 (cpp_pop_definition): Likewise.
2305 * internal.h (def_pragma_macro): Remove member 'value'
2306 and add new members 'definition', 'line',
2307 'syshdr', 'sued' and 'is_undef'.
2308 * pch.c (_cpp_restore_pushed_macros): Rework to work
2309 on text definition and store additional macro flags.
2310 (_cpp_save_pushed_macros): Likewise.
2311
e3339d0f
JM
23122010-09-29 Joseph Myers <joseph@codesourcery.com>
2313
2314 * include/cpplib.h (cpp_options): Rename warn_deprecated,
2315 warn_traditional, warn_long_long and pedantic.
2316 * directives.c (directive_diagnostics, _cpp_handle_directive):
2317 Update names of cpp_options members.
2318 * expr.c (cpp_classify_number, eval_token): Update names of
2319 cpp_options members.
2320 * init.c (cpp_create_reader, post_options): Update names of
2321 cpp_options members.
2322 * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
2323 cpp_options members.
2324 * macro.c (parse_params): Update names of cpp_options members.
2325
128465e6
ILT
23262010-09-15 Ian Lance Taylor <iant@google.com>
2327
2328 * init.c: Fix type name in comment.
2329
a69d2520
JJ
23302010-08-31 Jakub Jelinek <jakub@redhat.com>
2331
2332 PR preprocessor/45457
2333 * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
2334 needed.
2335 * directives.c (do_ifdef, do_ifndef): Likewise.
2336
707bcb7a
RO
23372010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2338
2339 * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
2340
6f173e52
RH
23412010-08-24 Richard Henderson <rth@redhat.com>
2342
2343 PR bootstrap/45376
2344 * configure.ac (HAVE_SSE4): New check.
2345 * configure, config.in: Rebuild.
2346 * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
2347
789d73cb
RO
23482010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2349
2350 * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
2351 etc. on Solaris 2/x86.
2352
246a2fcb
RH
23532010-08-21 Richard Henderson <rth@redhat.com>
2354 Andi Kleen <ak@linux.intel.com>
2355 David S. Miller <davem@davemloft.net>
2356
2357 * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
2358 (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
2359 (ptrdiff_t): Check via AC_CHECK_TYPE.
2360 * config.in, configure: Rebuild.
2361 * system.h: Include stdint.h, if available.
2362 * lex.c (WORDS_BIGENDIAN): Provide default.
2363 (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
2364 acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
2365 search_line_sse2, search_line_sse42, init_vectorized_lexer,
2366 search_line_fast): New.
2367 (_cpp_clean_line): Use search_line_fast. Restructure the fast
2368 loop to make it clear when we're leaving the loop. Stay in the
2369 fast loop for non-trigraph '?'.
2370
8e680db5
JJ
23712010-06-11 Jakub Jelinek <jakub@redhat.com>
2372
2373 * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
2374 callback.
2375 (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
2376 (cpp_macro_definition): Remove const qual from second argument.
2377 * macro.c (enter_macro_context): Call user_builtin_macro callback for
2378 NODE_BUILTIN !NODE_USED macros.
2379 (warn_of_redefinition): Likewise. Remove const qual from second
2380 argument.
2381 (cpp_macro_definition): Likewise.
2382 * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
2383 for NODE_BUILTIN !NODE_USED macros.
2384
1cb42611
JM
23852010-06-10 Joseph Myers <joseph@codesourcery.com>
2386
2387 * include/cpplib.h (struct cpp_options): Remove show_column.
2388 * init.c (cpp_create_reader, post_options): Don't set show_column.
2389
ff5dfc48
JR
23902010-06-09 Joern Rennecke <joern.rennecke@embecosm.com>
2391
2392 PR bootstrap/44432
2393 * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
2394 check that C++ compiler works.
2395 * configure: Regenerate.
2396
a9429e29
LB
23972010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
2398
2399 * include/symtab.h (ht_identifier_ptr): New.
2400
c3f247f4
RW
24012010-06-03 Joern Rennecke <joern.rennecke@embecosm.com>
2402 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2403
2404 PR bootstrap/42798
2405 * configure.ac: Check for declaration of 'basename(char *)'.
2406 * configure: Regenerate.
2407 * config.in: Regenerate.
2408
2778d766
JM
24092010-04-25 Joseph Myers <joseph@codesourcery.com>
2410
2411 * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
2412 * init.c (lang_defaults): Add entries for new language variants.
2413 (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
2414 variants.
2415
d8a12e84
MLI
24162010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
2417
2418 PR cpp/43195
2419 * files.c (report_missing_guard): Test for #pragma once.
2420
87cf0651
SB
24212010-04-07 Simon Baldwin <simonb@google.com>
2422
2423 * directives.c (do_diagnostic): Add warning reason argument,
2424 call appropriate error reporting function for code.
2425 (directive_diagnostics): Call specific warning functions with
2426 warning reason where appropriate.
2427 (do_error, do_warning, do_pragma_dependency): Add warning reason
2428 argument to do_diagnostic calls.
2429 * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
2430 _cpp_create_definition): Call specific warning functions with
2431 warning reason where appropriate.
2432 * Makefile.in: Add new diagnostic functions to gettext translations.
2433 * include/cpplib.h (struct cpp_callbacks): Add warning reason code
2434 to error callback.
2435 (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
2436 CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
2437 (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
2438 CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
2439 CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
2440 CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
2441 CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
2442 CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
2443 CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
2444 warning reason codes.
2445 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
2446 cpp_warning_with_line, cpp_pedwarning_with_line,
2447 cpp_warning_with_line_syshdr): New specific error reporting functions.
2448 * pch.c (cpp_valid_state): Call specific warning functions with
2449 warning reason where appropriate.
2450 * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
2451 diagnostic handlers.
2452 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
2453 cpp_warning_with_line, cpp_pedwarning_with_line,
2454 cpp_warning_with_line_syshdr): New specific error reporting functions.
2455 * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
2456 specific warning functions with warning reason where appropriate.
2457 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
2458 warn_about_normalization, lex_identifier_intern, lex_identifier,
2459 _cpp_lex_direct): Ditto.
2460 * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
2461 narrow_str_to_charconst): Ditto.
2462
d947ada0
JJ
24632010-04-06 Jakub Jelinek <jakub@redhat.com>
2464
2465 PR preprocessor/43642
2466 * lex.c (lex_raw_string): Change type of TYPE variable to
2467 unsigned char.
2468
4d9e8446
RW
24692010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2470
2471 * aclocal.m4: Regenerate.
2472
52150625
JM
24732010-03-29 Jason Merrill <jason@redhat.com>
2474
00a81b8b
JM
2475 More N3077 raw string changes
2476 * charset.c (cpp_interpret_string): Don't transform UCNs in raw
2477 strings.
2478 * lex.c (bufring_append): Split out from...
2479 (lex_raw_string): ...here. Undo trigraph and line splicing
2480 transformations. Do process line notes in multi-line literals.
2481 (_cpp_process_line_notes): Ignore notes that were already handled.
2482
52150625
JM
2483 Some raw string changes from N3077
2484 * charset.c (cpp_interpret_string): Change inner delimiters to ().
2485 * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter.
2486
709d7160
JJ
24872010-02-11 Jakub Jelinek <jakub@redhat.com>
2488
2489 * init.c (read_original_filename): Don't call read_original_directory
2490 if _cpp_handle_directive returns 0.
2491
dadab4fd
JM
24922010-01-01 Joseph Myers <joseph@codesourcery.com>
2493
2494 PR preprocessor/41947
2495 * expr.c (cpp_classify_number): Give error for hexadecimal
2496 floating-point constant with no digits before or after point.
2497
3de8a540
AC
24982009-11-20 Arnaud Charlet <charlet@adacore.com>
2499
2500 * macro.c (enter_macro_context): Call cb.used callback if defined.
2501 * directives.c (do_idef, do_ifndef): Ditto.
2502 * include/cpplib.h (struct cpp_callbacks): Add used callback.
2503
17e7cb85
KT
25042009-11-11 Kai Tietz <kai.tietz@onevision.com>
2505
2506 * directives.c (do_pragma_push_macro): New pragma handler.
2507 (do_pragma_pop_macro): Likewise.
2508 (_cpp_init_internal_pragmas): Add push_macro and
2509 pop_macro handler to internal pragmas.
2510 (lex_macro_node_from_str): Removed.
2511 (cpp_push_definition): Replace lex_macro_node_from_str
2512 by _cpp_lex_identifier.
2513 (cpp_pop_definition): Likewise.
2514 * internal.h (_cpp_lex_identifier): New prototype.
2515 (def_pragma_macro): New structure.
2516 (cpp_reader): New member pushed_macros.
2517 * lex.c (_cpp_lex_identifier): New function.
2518 (lex_identifier_intern): New function.
2519 * init.c (cpp_create_reader): Initialize pushed_macros
2520 member.
2521 (cpp_destroy): Free elements in pushed_macros member.
2522 * pch.c (_cpp_save_pushed_macros): New function.
2523 (_cpp_restore_pushed_macros): Likewise.
2524 (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
2525 (cpp_read_state): Use _cpp_restore_pushed_macros.
2526
2c6e3f55
JJ
25272009-10-19 Jakub Jelinek <jakub@redhat.com>
2528
2529 * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
2530 (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
2531 and char32_cset_desc.
2532 (converter_for_type): Handle CPP_UTF8STRING.
2533 (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
2534 * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
2535 (parse_include): Reject raw strings.
2536 * include/cpplib.h (CPP_UTF8STRING): New token type.
2537 * internal.h (struct cpp_reader): Add utf8_cset_desc field.
2538 * lex.c (lex_raw_string): New function.
2539 (lex_string): Handle u8 string literals, call lex_raw_string
2540 for raw string literals.
2541 (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
2542 sequences.
2543 * macro.c (stringify_arg): Handle CPP_UTF8STRING.
2544
96c169e1
JJ
25452009-10-14 Jakub Jelinek <jakub@redhat.com>
2546
2547 PR preprocessor/41543
2548 * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
2549 * line-map.c (linemap_init): Initialize highest_location and
2550 highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
2551
30c99a9e
JM
25522009-10-09 Jason Merrill <jason@redhat.com>
2553
2554 * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
2555
2214382c
NV
25562009-10-09 Neil Vachharajani <nvachhar@google.com>
2557
2558 * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
2559 sccs.
2560
e02222d2
LR
25612009-09-23 Loren J. Rittle <ljrittle@acm.org>
2562
2563 * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
2564 * configure: Rebuilt.
2565
9a8a2b7a
RG
25662009-09-22 Richard Guenther <rguenther@suse.de>
2567
2568 PR pch/38987
2569 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
2570
74dc6a11
CD
25712009-09-18 Chris Demetriou <cgd@google.com>
2572
2573 PR preprocessor/28435:
2574 * include/cpplib.h (struct cpp_options): Add new member
2575 deps.need_preprocessor_output.
2576 * files.c (open_file_failed): If preprocessor output is needed
2577 always report an error.
2578
933608b7
KT
25792009-09-13 Kai Tietz <kai.tietz@onevision.com>
2580
2581 * configure.ac: Set for i?86-w64-mingw*
2582 need_64bit_hwint to yes.
2583 * configure: Regenerated.
2584
86373e7e
JM
25852009-09-10 Jason Merrill <jason@redhat.com>
2586
2587 * directives.c (cpp_define): constify.
2588
fd2ab214
ILT
25892009-09-02 Ian Lance Taylor <iant@google.com>
2590
2591 * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
2592
df58e648
RW
25932009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2594
2595 * configure.ac (AC_PREREQ): Bump to 2.64.
2596
5213506e
RW
25972009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2598
2599 * aclocal.m4: Regenerate.
2600 * config.in: Regenerate.
2601 * configure: Regenerate.
2602
709a22df
TT
26032009-08-17 Tom Tromey <tromey@redhat.com>
2604
2605 PR preprocessor/41067:
2606 * charset.c (convert_escape): Add missing ":" to error text.
2607
0c539b47
DR
26082009-07-27 Douglas B Rupp <rupp@gnat.com>
2609
2610 * include/cpplib.h (INO_T_CPP): New macro.
2611 (struct cpp_dir): Use it.
2612
2b69c841
JQ
26132009-07-20 Jerry Quinn <jlquinn@optonline.net>
2614
2615 PR regression/40800
2616 * configure.ac: Use = instead of == for testing
2617 ENABLE_BUILD_WITH_CXX.
2618 * configure: Rebuild.
2619
f1bf410c
JQ
26202009-07-17 Jerry Quinn <jlquinn@optonline.net>
2621
2622 * directives.c (do_linemarker, do_line): Use CPP_STRING for
2623 ignored enum value.
2624 * files.c (find_file_in_dir): Add cast from void* to char*.
2625 * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
2626 * Makefile.in: (WARN_CFLAGS): Use general and C-specific
2627 warnings.
2628 (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
2629 ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
2630 COMPILER_FLAGS): New.
2631 (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
2632 (COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS
2633 instead of ALL_CFLAGS.
2634 * configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings
2635 from other warnings. Add -Wc++-compat to C-specific warnings.
2636 Check for --enable-build-with-cxx. Set and substitute
2637 ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES
2638 according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before
2639 AC_CHECK_HEADERS.
2640 * configure: Rebuild.
2641 * include/cpp-id-data.h: Remove extern "C".
2642 * include/line-map.h: Likewise.
2643 * include/mkdeps.h: Likewise.
2644 * include/symtab.h: Likewise.
2645 * internal.h: Likewise.
2646
a28fbdba
MLI
26472009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2648
2649 * directives.c (parse_include): Add location argument. Update all
2650 calls.
2651 (parse_answer): Likewise.
2652 (do_include_common): Error with exact location.
2653 (parse_assertion): Likewise.
2654
b506a5a2
MLI
26552009-06-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
2656
2657 * expr.c (num_div_op): Take explicit location.
2658
7d8847a4
ILT
26592009-06-17 Ian Lance Taylor <iant@google.com>
2660
2661 * include/cpplib.h (progname): Don't declare.
2662
3d8b2a98
ILT
26632009-06-12 Ian Lance Taylor <iant@google.com>
2664
2665 * include/cpplib.h (struct cpp_options): Add
2666 warn_cxx_operator_names field.
2667 (NODE_WARN_OPERATOR): Define.
2668 (struct cpp_hashnode): Increase flags field to 10 bits, decrease
2669 type to 6 bits.
2670 * init.c (mark_named_operators): Add flags parameter.
2671 (cpp_post_options): Pick flags value to pass to
2672 mark_named_operators.
2673 * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
2674 identifier is an operator name in C++.
2675
e74fe492
AH
26762009-06-01 Aldy Hernandez <aldyh@redhat.com>
2677
2678 * include/line-map.h (LAST_SOURCE_COLUMN): New.
2679
4851089f
ILT
26802009-06-01 Ian Lance Taylor <iant@google.com>
2681
2682 * include/cpp-id-data.h: Add extern "C".
2683 * include/line-map.h: Likewise.
2684 * include/mkdeps.h: Likewise.
2685 * include/symtab.h: Likewise.
2686 * internal.h: Likewise.
2687
7e5487a2
ILT
26882009-05-15 Ian Lance Taylor <iant@google.com>
2689
2690 * include/cpplib.h (enum cpp_builtin_type): Rename from enum
2691 builtin_type. Change all uses.
2692
00b0c19b
MLI
26932009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2694
2695 PR cpp/36674
2696 * directives (do_linemarker): Compensate for the increment in
2697 location that occurs when we reach the end of line.
2698 * files (_cpp_stack_include): Mention _cpp_find_file in the
2699 comment.
2700
9a0c6187
JM
27012009-05-10 Joseph Myers <joseph@codesourcery.com>
2702
2703 * include/cpplib.h (enum cpp_token_fld_kind): Add
2704 CPP_TOKEN_FLD_TOKEN_NO.
2705 (struct cpp_macro_arg, struct cpp_identifier): Define.
2706 (union cpp_token_u): Use struct cpp_identifier for identifiers.
2707 Use struct cpp_macro_arg for macro arguments. Add token_no for
2708 CPP_PASTE token numbers.
2709 * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
2710 do_pragma_poison, parse_assertion): Use val.node.node in place of
2711 val.node.
2712 * expr.c (parse_defined, eval_token): Use val.node.node in place
2713 of val.node.
2714 * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
2715 cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
2716 cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
2717 place of val.arg_no. Use val.node.node in place of val.node.
2718 * macro.c (replace_args, cpp_get_token, parse_params,
2719 lex_expansion_token, create_iso_definition, cpp_macro_definition):
2720 Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
2721 Use val.node.node in place of val.node.
2722
9e322bc1
JM
27232009-05-03 Joseph Myers <joseph@codesourcery.com>
2724
2725 * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
2726 UTF-8 sequences.
2727
f88d0772
JM
27282009-04-25 Joseph Myers <joseph@codesourcery.com>
2729
2730 PR preprocessor/39559
2731 * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
2732 constants larger than intmax_t in C99 mode.
2733
d1b38208
TG
27342009-04-21 Taras Glek <tglek@mozilla.com>
2735
2736 * include/cpp-id-data.h: Update GTY annotations to new syntax.
2737 * include/cpplib.h: Likewise.
2738 * include/line-map.h: Likewise.
2739 * include/symtab.h: Likewise.
2740
cfc93532
MLI
27412009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2742
2743 PR c++/14875
2744 * lex.c (cpp_type2name): Take a flags parameter. Call
2745 cpp_named_operator2name for named operators and cpp_digraph2name
2746 for digraphs.
2747 (cpp_digraph2name): New.
2748 (cpp_spell_token): Use it.
2749 (cpp_output_token): Likewise.
2750 * include/cpplib.h (cpp_type2name): Update declaration.
2751 * init.c (cpp_named_operator2name): New.
2752 * internal.h (cpp_named_operator2name): Declare.
2753
9c650d90
MLI
27542009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2755
2756 PR c++/13358
2757 * init.c (cpp_create_reader): Wlong_long is disabled by default.
2758 * expr.c (cpp_classify_number): Give different messages for C and
2759 C++ front-ends.
2760
aa508502
JM
27612009-04-19 Joseph Myers <joseph@codesourcery.com>
2762
2763 PR preprocessor/20078
2764 * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
2765 field.
2766 * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
2767 (struct cpp_token): Change flags to unsigned short.
2768 * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
2769 (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
2770 (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
2771 tokens.
2772 * macro.c (macro_real_token_count): New.
2773 (enter_macro_context, replace_args): Use macro_real_token_count.
2774 (create_iso_definition): Record whitespace surrounding and digraph
2775 spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
2776 Set extra_tokens and save CPP_PASTE tokens with arg_no set for
2777 multiple consecutive ## tokens.
2778 (_cpp_create_definition): Initialize extra_tokens.
2779 (cpp_macro_definition): Use macro_real_token_count.
2780
61cc8223
JM
27812009-04-18 Joseph Myers <joseph@codesourcery.com>
2782
2783 * directives.c (parse_include): Pass true to check_eol.
2784
c7f9c0b9
JM
27852009-04-18 Joseph Myers <joseph@codesourcery.com>
2786
2787 PR preprocessor/39646
2788 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
2789 * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
2790 * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
2791 place of LC_RENAME.
2792
a5cb563b
JM
27932009-04-18 Joseph Myers <joseph@codesourcery.com>
2794
2795 PR preprocessor/39647
2796 * directives.c (check_eol): Add parameter expand.
2797 (do_undef, parse_include, do_line, do_linemarker, do_ident,
2798 do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
2799 do_else, do_endif, do_assert, do_unassert): All callers changed.
2800 Pass true from do_line, false elsewhere.
2801
18f41a1b
JM
28022009-04-12 Joseph Myers <joseph@codesourcery.com>
2803
2804 PR preprocessor/31869
2805 * macro.c (stringify_arg): Handle NULL source token in padding
2806 token where previous padding token did not have source token with
2807 preceding whitespace.
2808
748086b7
JJ
28092009-04-09 Jakub Jelinek <jakub@redhat.com>
2810
2811 * Makefile.in: Change copyright header to refer to version
2812 3 of the GNU General Public License and to point readers at the
2813 COPYING3 file and the FSF's license web page.
2814 * charset.c: Likewise.
2815 * directives-only.c: Likewise.
2816 * directives.c: Likewise.
2817 * errors.c: Likewise.
2818 * expr.c: Likewise.
2819 * files.c: Likewise.
2820 * identifiers.c: Likewise.
2821 * include/cpp-id-data.h: Likewise.
2822 * include/cpplib.h: Likewise.
2823 * include/line-map.h: Likewise.
2824 * include/mkdeps.h: Likewise.
2825 * include/symtab.h: Likewise.
2826 * init.c: Likewise.
2827 * internal.h: Likewise.
2828 * lex.c: Likewise.
2829 * line-map.c: Likewise.
2830 * macro.c: Likewise.
2831 * makeucnid.c: Likewise.
2832 * mkdeps.c: Likewise.
2833 * pch.c: Likewise.
2834 * symtab.c: Likewise.
2835 * system.h: Likewise.
2836 * traditional.c: Likewise.
2837 * ucnid.tab: Likewise.
2838 * ucnid.h: Regenerate.
2839
eec49116
JJ
28402009-04-01 Janis Johnson <janis187@us.ibm.com>
2841
839a3b8a
JJ
2842 PR c/39027
2843 * include/cpplib.h (CPP_N_DEFAULT): Define.
2844 * expr.c (interpret_float_suffix): Recognize d or D for double,
2845 return new value for default.
2846 (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
2847
eec49116
JJ
2848 PR c/33466
2849 * expr.c (interpret_float_suffix): Reject invalid suffix that uses
2850 letters from decimal float and fixed-point suffixes.
2851
47580d22
JM
28522009-03-31 Joseph Myers <joseph@codesourcery.com>
2853
2854 PR preprocessor/15638
2855 * files.c (_cpp_find_file): Call open_file_failed after diagnosing
2856 invalid PCH.
2857 (open_file_failed): Make error for missing file fatal.
2858 * include/cpplib.h (CPP_DL_FATAL): Define.
2859
5a2df0fa
SV
28602009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net>
2861
2862 PR preprocessor/31932:
2863 * internal.h: Don't mention HAVE_ICONV_H.
2864 * configure, config.in: Rebuild.
2865 * configure.ac: Don't check for iconv.h.
2866
c1a8a3c6
TT
28672009-03-30 Tom Tromey <tromey@redhat.com>
2868
2869 PR preprocessor/39512:
2870 * line-map.c (linemap_init): Initialize 'reallocator' field.
2871
a37a7b8a
JJ
28722009-03-30 Jakub Jelinek <jakub@redhat.com>
2873
2874 PR target/39558
2875 * macro.c (cpp_get_token): If macro_to_expand returns NULL
2876 and used some tokens, add CPP_PADDING before next token.
2877
148e4216
JM
28782009-03-29 Joseph Myers <joseph@codesourcery.com>
2879
2880 PR preprocessor/34695
2881 * makedepend.c: Remove.
2882 * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
2883 (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
2884 * directives.c (cpp_errors): Remove.
2885 * errors.c (print_location, _cpp_begin_message, v_message):
2886 Remove.
2887 (cpp_error, cpp_error_with_line): Always use error callback.
2888 (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
2889 * include/cpplib.h (cpp_options): Remove pedantic_errors,
2890 inhibit_warnings, warn_system_headers, inhibit_errors,
2891 warnings_are_errors, client_diagnostic.
2892 (cpp_callbacks): Add extra arguments to error callback; make it
2893 return bool.
2894 (cpp_finish): Return void.
2895 (cpp_destroy): Remove inaccurate comment about return value.
2896 (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
2897 (CPP_DL_NOTE): Define.
2898 * include/line-map.h (linemap_print_containing_files): Remove.
2899 * init.c (cpp_finish): Do not check for or return number of
2900 errors.
2901 * internal.h (cpp_reader): Remove errors field.
2902 * line-map.c (linemap_print_containing_files): Remove.
2903 * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
2904 about previous definition. Only emit it if previous diagnostic
2905 was emitted.
2906
f1450211
JM
29072009-03-28 Joseph Myers <joseph@codesourcery.com>
2908
2909 * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
2910 mkinstalldirs.
2911
8f5929e1
JJ
29122009-03-18 Jakub Jelinek <jakub@redhat.com>
2913
2914 * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
2915
4bb09c26
JM
29162009-02-21 Joseph Myers <joseph@codesourcery.com>
2917
2918 * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
2919 header name.
2920 (_cpp_lex_direct): Handle this.
2921
68c9ab45
RG
29222009-02-15 Richard Guenther <rguenther@suse.de>
2923
2924 Revert last change.
2925
601b3e1a
RG
29262009-02-13 Richard Guenther <rguenther@suse.de>
2927
2928 * configure.ac: Enable LFS.
2929 * configure: Re-generate.
2930 * config.in: Likewise.
2931
fc0cd180
BE
29322009-01-05 Ben Elliston <bje@au.ibm.com>
2933
2934 * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
2935 (.po.pox): Likewise.
2936 (po/$(PACKAGE).pot): Likewise.
2937
db89a3be
AO
29382008-12-10 Alexandre Oliva <aoliva@redhat.com>
2939
2940 PR target/37033
2941 * pch.c (cpp_valid_state): Improve message for poisoned symbols.
2942 Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
2943
cc955282
JM
29442008-11-29 Joseph Myers <joseph@codesourcery.com>
2945
2946 * lex.c (cpp_token_len): Use 6 as default length.
2947
47960aaf
MLI
29482008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org>
2949
2950 * expr.c (struct op): Add location.
2951 (_cpp_parse_expr): Propagate locations throught the stack
2952 of expressions.
2953 (reduce): Likewise.
2954 (check_promotion): Use explicit location in errors.
2955
631d0d36
MG
29562008-10-05 Matthew Gingell <gingell@adacore.com>
2957 Arnaud Charlet <charlet@adacore.com>
2958
2959 * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
2960 (cpp_get_comments): New function.
2961 * internal.h (struct cpp_reader): Add comments field.
2962 * init.c (cpp_destroy): Free comments.
2963 * lex.c (store_comment, cpp_get_comments): New functions.
2964 (comments): New struct.
2965 (save_comment): Store comments in comments struct.
2966
c047ce93
SB
29672008-09-18 Simon Baldwin <simonb@google.com>
2968
2969 * include/cpplib.h (struct cpp_options): Add new boolean flag
2970 warn_builtin_macro_redefined.
2971 * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
2972 * (struct builtin_operator): Split out from previous struct builtin,
2973 enhance extra const correctness.
2974 * (struct builtin_macro): Split out from previous struct builtin, add
2975 new always_warn_if_redefined flag, enhance const correctness.
2976 * (mark_named_operators): Use struct builtin_operator.
2977 * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
2978 to builtins selectively.
2979 * macro.c (warn_of_redefinition): Return false if a builtin macro
2980 is not flagged with NODE_WARN.
2981
affa55c6
JJ
29822008-07-31 Jakub Jelinek <jakub@redhat.com>
2983
2984 PR preprocessor/36649
2985 * files.c (struct report_missing_guard_data): New type.
2986 (report_missing_guard): Put paths into an array instead of printing
2987 them right away. Return 1 rather than 0.
2988 (report_missing_guard_cmp): New function.
2989 (_cpp_report_missing_guards): Sort and print paths gathered by
2990 report_missing_guard callback.
2991
3b8f20a1
MLI
29922008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2993
2994 PR 28079
2995 * directives.c (strtolinenum): Handle overflow.
2996 (do_line): Give a warning if line number overflowed.
2997 (do_linemarker): Update call to strtolinenum.
2998
1bb64668
MLI
29992008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3000
3001 * include/line-map.h (linenum_type): New typedef.
3002 (struct line_map): Use it.
3003 (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
3004 (SOURCE_COLUMN): Likewise.
3005 * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
3006 source_location values in a variable of type linenum_type.
3007 * directives.c (struct if_stack): Use linenum_type.
3008 (strtoul_for_line): Rename as strtolinenum.
3009 (do_line): Use linenum_type.
3010 (do_linemarker): Use linenum_type and strtolinenum.
3011 (_cpp_do_file_change): Use linenum_t.
3012 * line-map.c (linemap_add): Likewise.
3013 (linemap_line_start): Likewise.
3014 * traditional.c (struct fun_macro): 'line' is a source_location.
3015 * errors.c (print_location): Use linenum_type.
3016 * directives-only.c (_cpp_preprocess_dir_only): Likewise.
3017 * internal.h (CPP_INCREMENT_LINE): Likewise.
3018 * lex.c (_cpp_skip_block_comment): Use source_location.
19a9ba64 3019
5950c3c9
BE
30202008-07-14 Ben Elliston <bje@au.ibm.com>
3021
3022 * include/cpplib.h (NODE_CONDITIONAL): New.
3023 (struct cpp_callbacks): New macro_to_expand field.
3024 (struct cpp_hashnode): Adjust size of flags and type fields.
3025 (cpp_peek_token): Prototype.
3026 * lex.c (cpp_peek_token): New function.
3027 (_cpp_temp_token): Protect pre-existing lookaheads.
3028 * macro.c (cpp_get_token): Expand any conditional macros.
3029 (_cpp_backup_tokens_direct): New.
3030 (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
3031 (warn_of_redefinition): Silently allow redefined conditional
3032 macros.
3033 (_cpp_create_definition): Remove the conditional flag when a user
3034 defines one of the conditional macros.
3035 * internal.h (_cpp_backup_tokens_direct): New prototype.
3036
e85edc9e
AH
30372008-06-13 Andrew Haley <aph@redhat.com>
3038
3039 PR preprocessor/33305
3040 * macro.c (replace_args): Print a warning for empty macro
3041 arguments in C89 and C++.
3042
18c04407
RW
30432008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3044
3045 * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
3046 * configure: Regenerate.
3047
2d09b640
RW
30482008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3049
3050 * Makefile.in (datarootdir): New variable.
3051
0b7c73cc
L
30522008-06-12 H.J. Lu <hongjiu.lu@intel.com>
3053
3054 PR preprocessor/36479
3055 * charset.c (cpp_interpret_string_notranslate): Also set
3056 narrow_cset_desc.width.
3057
cd985f66
JM
30582008-06-07 Joseph Myers <joseph@codesourcery.com>
3059
3060 * configure.ac (parisc*64*-*-*): Remove.
3061 * configure: Regenerate.
3062
d750887f
TT
30632008-05-30 Tom Tromey <tromey@redhat.com>
3064
3065 PR preprocessor/36320:
3066 * internal.h (_cpp_parse_expr): Update.
3067 * expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error
3068 messages.
3069 * directives.c (do_if): Update.
3070 (do_elif): Require expression if processing group.
3071
c100de59
DS
30722008-05-30 Danny Smith <dannysmith@users.sourceforge.net>
3073
3074 * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
3075
5d6342eb
TT
30762008-05-21 Tom Tromey <tromey@redhat.com>
3077
3078 PR preprocessor/27777:
3079 * lex.c (cpp_output_line_to_string): New function.
3080 * internal.h (_cpp_begin_message): Don't declare.
3081 * errors.c (_cpp_begin_message): Now static.
3082 * include/cpplib.h (cpp_output_line_to_string): Declare.
3083 * directives.c (do_diagnostic): Rewrote. Use
3084 cpp_output_line_to_string. Don't use _cpp_begin_message.
3085
dae4174e
TT
30862008-05-21 Tom Tromey <tromey@redhat.com>
3087
3088 * include/symtab.h (HT_ALLOCED): Remove.
3089 (ht_purge): Declare.
3090 * symtab.c (DELETED): New define.
3091 (ht_lookup): Update comment.
3092 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED
3093 code. Use subobject allocator for strings, if it exists.
3094 (ht_expand): Handle deleted entries.
3095 (ht_forall): Likewise.
3096 (ht_purge): New function.
3097 (ht_dump_statistics): Print deletion statistics.
3098
899015a0
TT
30992008-05-13 Tom Tromey <tromey@redhat.com>
3100
3101 PR preprocessor/22168:
3102 * include/cpplib.h (struct cpp_options) <objc>: Update
3103 documentation.
3104 * expr.c (eval_token): Warn for use of assertions.
3105 * directives.c (directive_diagnostics): Warn about extensions.
3106 (DEPRECATED): New define.
3107 (DIRECTIVE_TABLE): Use it.
3108
71c10038
TT
31092008-05-06 Tom Tromey <tromey@redhat.com>
3110
3111 PR preprocessor/35313, PR preprocessor/36088:
3112 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
3113 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
3114
2bd0fe3d
DM
31152008-05-04 David S. Miller <davem@davemloft.net>
3116
3117 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
3118 * configure: Regenerate.
3119
28f68625
DF
31202008-04-22 Daniel Franke <franke.daniel@gmail.com>
3121
3122 * include/cpplib.h (cpp_define_formatted): New.
3123 * directives.c (cpp_define_formatted): New.
3124
688e7a53
TT
31252008-04-21 Tom Tromey <tromey@redhat.com>
3126
3127 PR libcpp/33415:
3128 * charset.c (_cpp_convert_input): Add buffer_start argument.
3129 Ignore UTF-8 BOM if seen.
3130 * internal.h (_cpp_convert_input): Add argument.
3131 * files.c (struct _cpp_file) <buffer_start>: New field.
3132 (destroy_cpp_file): Free buffer_start, not buffer.
3133 (_cpp_pop_file_buffer): Likewise.
3134 (read_file_guts): Update.
3135
b6baa67d
KVH
31362008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
3137
3138 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
3139 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
3140 (struct cpp_options): Added uliterals.
3141 (cpp_interpret_string): Update prototype.
3142 (cpp_interpret_string_notranslate): Idem.
3143 * charset.c (init_iconv_desc): New width member in cset_converter.
3144 (cpp_init_iconv): Add support for char{16,32}_cset_desc.
3145 (convert_ucn): Idem.
3146 (emit_numeric_escape): Idem.
3147 (convert_hex): Idem.
3148 (convert_oct): Idem.
3149 (convert_escape): Idem.
3150 (converter_for_type): New function.
3151 (cpp_interpret_string): Use converter_for_type, support u and U prefix.
3152 (cpp_interpret_string_notranslate): Match changed prototype.
3153 (wide_str_to_charconst): Use converter_for_type.
3154 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
3155 * directives.c (linemarker_dir): Macro U changed to UC.
3156 (parse_include): Idem.
3157 (register_pragma_1): Idem.
3158 (restore_registered_pragmas): Idem.
3159 (get__Pragma_string): Support CPP_STRING{16,32}.
3160 * expr.c (eval_token): Support CPP_CHAR{16,32}.
3161 * init.c (struct lang_flags): Added uliterals.
3162 (lang_defaults): Idem.
3163 * internal.h (struct cset_converter) <width>: New field.
3164 (struct cpp_reader) <char16_cset_desc>: Idem.
3165 (struct cpp_reader) <char32_cset_desc>: Idem.
3166 * lex.c (digraph_spellings): Macro U changed to UC.
3167 (OP, TK): Idem.
3168 (lex_string): Add support for u'...', U'...', u"..." and U"...".
3169 (_cpp_lex_direct): Idem.
3170 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
3171 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
3172
deb984e6
PB
31732008-04-18 Paolo Bonzini <bonzini@gnu.org>
3174
3175 PR bootstrap/35457
3176 * aclocal.m4: Regenerate.
3177 * configure: Regenerate.
3178
bf048bea
TT
31792008-04-17 Tom Tromey <tromey@redhat.com>
3180
3181 PR libcpp/34866:
3182 * errors.c (cpp_error): Don't reference a token before the start
3183 of the current run.
3184
7f27b0f8
TT
31852008-04-16 Tom Tromey <tromey@redhat.com>
3186
3187 * Makefile.in (TAGS_SOURCES): New variable.
3188 (TAGS): New target.
3189
a1fcb9a1
KK
31902008-04-11 Kaz Kojima <kkojima@gcc.gnu.org>
3191
3192 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
3193 and shbe-*-*.
3194 * configure: Rebuilt.
3195
93d45d9e
JM
31962008-04-02 Joseph Myers <joseph@codesourcery.com>
3197
3198 * include/cpplib.h (struct cpp_callbacks): Add used_define,
3199 used_undef and before_define.
3200 (NODE_USED): Define.
3201 * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
3202 do_ifndef, cpp_pop_definition): Handle new flag and use new
3203 callbacks.
3204 * expr.c (parse_defined): Handle new flag and use new callbacks.
3205 * macro.c (enter_macro_context, _cpp_free_definition): Handle new
3206 flag and use new callbacks.
3207
d4c32e1d
JJ
32082008-04-01 Jakub Jelinek <jakub@redhat.com>
3209
3210 PR pch/13675
3211 * files.c (struct _cpp_file): Remove pch field.
3212 (pch_open_file): Don't set file->pch, just file->pchname.
3213 (should_stack_file): After pfile->cb.read_pch call
3214 free pchname and clear pchname, don't close file->fd.
3215 Test file->pchname instead of file->pch. Don't close fd after cb.
3216 (_cpp_stack_include): Test file->pchname instead of file->pch.
3217
161031e3
TT
32182008-03-28 Tom Tromey <tromey@redhat.com>
3219
3220 * Makefile.in (POSTCOMPILE): New variable.
3221 (.c.o): Use it.
3222
14ccf800
TT
32232008-03-13 Tom Tromey <tromey@redhat.com>
3224
3225 PR libcpp/35322:
3226 * directives.c (destringize_and_run): Set pfile->directive.
3227
830465c6
MM
32282008-03-06 Markus Milleder <markus.milleder@generali.at>
3229
3230 PR preprocessor/35458
3231 * mkdeps.c (munge): Quote '#' with a '\'.
3232
d482a073
RW
32332008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3234
3235 PR preprocessor/35379
3236 * mkdeps.c (deps_write): Ensure the first target always appears
3237 in the first column, without leading backslash newline. Avoid
3238 some more extra whitespace.
3239
185a6cc1
TS
32402008-02-25 Thiemo Seufer <ths@mips.com>
3241
d482a073 3242 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
185a6cc1 3243
2bf41bf0
TT
32442008-02-19 Tom Tromey <tromey@redhat.com>
3245
3246 * traditional.c (lex_identifier): Use CPP_HASHNODE.
3247 * lex.c (lex_identifier): Use CPP_HASHNODE.
3248 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
3249 do-while.
3250 * identifiers.c (alloc_node): Change return type.
3251 (_cpp_init_hashtable): Don't cast 'alloc_node'.
3252 (proxy_assertion_broken): New declaration.
3253 (cpp_forall_identifiers): Move comment.
3254 * line-map.c (linemap_add): Comment fix.
3255 (linemap_line_start): Indentation fix.
3256
765d600a
JJ
32572008-01-25 Jakub Jelinek <jakub@redhat.com>
3258
3259 PR preprocessor/34692
3260 * macro.c (collect_args): Add pragma_buff argument. Push
3261 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
3262 than into arguments. Reset prevent_expansion and parsing_args
3263 state at CPP_PRAGMA_EOL/CPP_EOF.
3264 (funlike_invocation_p): Add pragma_buff argument, pass it through
3265 to collect_args.
3266 (enter_macro_context): Add result argument. Adjust
3267 funlike_invocation_p caller. Emit all deferred pragma tokens
3268 gathered during collect_args before the expansion, add a padding
3269 token. Return 2 instead of 1 if any pragma tokens were prepended.
3270 (cpp_get_token): If enter_macro_context returns 2, don't return
3271 a padding token, instead cycle to grab CPP_PRAGMA token.
3272 * directives.c (_cpp_handle_directive): If was_parsing_args
3273 in deferred pragma, leave parsing_args and prevent_expansion as is.
3274
ec46053b
TT
32752008-01-22 Tom Tromey <tromey@redhat.com>
3276
765d600a 3277 PR c++/34859
ec46053b
TT
3278 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
3279 __STDC_CONSTANT_MACROS.
3280
681c6ab0
FF
32812008-01-07 Fred Fish <fnf@specifix.com>
3282
765d600a 3283 PR preprocessor/30363
681c6ab0 3284 * traditional.c (replace_args_and_push): Add local variable
19a9ba64 3285 cxtquote, calculate the replacement text size assuming a
681c6ab0
FF
3286 worst case of every input character quoted with backslash,
3287 and properly handle output quoting of quote characters in
3288 actual arguments used in function-like macros.
3289
33ae4837
TT
32902008-01-03 Tom Tromey <tromey@redhat.com>
3291
765d600a 3292 PR preprocessor/34602
33ae4837
TT
3293 * directives.c (do_line): Don't try to spell EOF token.
3294 (do_linemarker): Add comment.
3295
675575f5
DD
32962007-12-11 DJ Delorie <dj@redhat.com>
3297
3298 * charset.c (convert_using_iconv): Close out any shift states,
3299 returning to the initial state.
3300
97f6bd40
TT
33012007-12-06 Tom Tromey <tromey@redhat.com>
3302
765d600a 3303 PR c/29172
97f6bd40
TT
3304 * internal.h (struct cpp_reader) <file_hash_entries>: Changed
3305 type.
3306 <file_hash_entries_allocated, file_hash_entries_used>: Removed.
3307 * files.c (FILE_HASH_POOL_SIZE): New macro.
3308 (struct file_hash_entry_pool): New.
3309 (destroy_all_cpp_files): New function.
3310 (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
3311 (new_file_hash_entry): Update.
3312 (free_file_hash_entries): New function.
3313 (_cpp_cleanup_files): Call free_file_hash_entries and
3314 destroy_all_cpp_files.
3315 (cpp_clear_file_cache): New function.
3316 * include/cpplib.h (cpp_clear_file_cache): Declare.
3317
d56a25e1
TT
33182007-12-03 Tom Tromey <tromey@redhat.com>
3319
765d600a 3320 PR preprocessor/34288
d56a25e1
TT
3321 * configure.ac, config.in: Rebuilt.
3322 * configure.ac: Check for ssize_t.
3323
607f74e9
TT
33242007-11-30 Tom Tromey <tromey@redhat.com>
3325
765d600a 3326 PR preprocessor/32868
607f74e9
TT
3327 * macro.c (_cpp_create_definition): Special case
3328 __STDC_FORMAT_MACROS.
3329
b0f4807f
MM
33302007-11-16 Michael Matz <matz@suse.de>
3331
3332 * files.c (search_path_head): Fix check for absolute paths.
3333
f1e20710
TT
33342007-11-11 Tom Tromey <tromey@redhat.com>
3335
765d600a 3336 PR c++/17557
f1e20710
TT
3337 * include/cpplib.h (cpp_included_before): Declare.
3338 * files.c (struct file_hash_entry) <location>: New field.
3339 (_cpp_find_file): Initialize new field.
3340 (make_cpp_dir): Likewise.
3341 (cpp_included_before): New function.
3342
f373b44d
TT
33432007-11-01 Tom Tromey <tromey@redhat.com>
3344
765d600a 3345 PR preprocessor/30805
f373b44d
TT
3346 * macro.c (paste_tokens): Handle padding token.
3347 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
3348
5b9a40df
TT
33492007-10-31 Tom Tromey <tromey@redhat.com>
3350
765d600a 3351 PR preprocessor/30786
5b9a40df
TT
3352 * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
3353 * directives.c (_cpp_do__Pragma): Return error status.
3354 * internal.h (_cpp_do__Pragma): Update.
3355 * directives.c (get__Pragma_string): Back up if EOF seen.
3356
5ffeb913
TT
33572007-09-06 Tom Tromey <tromey@redhat.com>
3358
3359 * internal.h (struct cpp_reader) <invocation_location>: New
3360 field.
3361 (struct cpp_reader) <set_invocation_location>: Likewise.
3362 * init.c (cpp_set_line_map): New function.
3363 * line-map.c (linemap_add): Use linemap's allocator.
3364 * include/line-map.h (GTY): Define.
3365 (line_map_realloc): New typedef.
3366 (struct line_map): Mark with GTY.
3367 (struct line_maps): Likewise.
3368 (struct line_maps) <maps>: Likewise.
3369 (struct line_maps) <reallocator>: New field.
3370 * include/symtab.h (GTY): Conditionally define.
3371 * include/cpplib.h (cpp_set_line_map): Declare.
3372 (cpp_get_token_with_location): Declare.
3373 * macro.c (cpp_get_token): Set invocation_location on the reader.
3374 (cpp_get_token_with_location): New function.
3375
ac6b1c67
CF
33762007-08-30 Chao-ying Fu <fu@mips.com>
3377
3378 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
3379 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
3380 (cpp_classify_number): Support decimal fixed-point constants without
3381 exponents.
3382 Warn about fixed-point constants when -pedantic.
3383 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
3384 comments to support fixed-point values.
3385 (CPP_N_FRACT, CPP_N_ACCUM): Define.
3386
cda5e672
TT
33872007-08-18 Tom Tromey <tromey@redhat.com>
3388
765d600a 3389 PR preprocessor/32974
cda5e672
TT
3390 * directives.c (parse_include): Don't check for EOL when
3391 processing #pragma dependency.
3392
ccfc4c91
OW
33932007-07-30 Ollie Wild <aaw@google.com>
3394
3395 * directives-only.c: New file.
3396 * internal.h (struct _cpp_dir_only_callbacks): New.
3397 (_cpp_preprocess_dir_only): New function.
3398 * directives.c (_cpp_handle_directive): Check directives_only before
3399 disabling execution of indented directives.
3400 * files.c (_cpp_stack_file): Add directives_only check.
3401 * include/cpplib.h (struct cpp_options): Add directives_only.
3402 (cpp_init_special_builtins): New function.
3403 * init.c (cpp_init_special_builtins): New function.
3404 (cpp_init_builtins): Move builtin_array initialization to
3405 cpp_init_special_builtins.
3406 (post_options): Check directives_only before setting
3407 pfile->state.prevent_expansion = 1.
3408 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
3409 is expanded inside a directive while -fdirectives-only is enabled.
3410 * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
3411 (libcpp_a_SOURCES): Add directives-only.c.
3412
a206413a
UB
34132007-07-04 Uros Bizjak <ubizjak@gmail.com>
3414
3415 * traditional.c (_cpp_scan_out_logical_line): Initialize
3416 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
3417 fmacro.args to prevent 'may be used uninitialized' warning.
3418
c77cd3d1
UB
34192007-07-03 Uros Bizjak <ubizjak@gmail.com>
3420
3421 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
3422 Add new constants.
3423 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
3424 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
3425 for 'q' or 'Q' suffixes.
3426
66938a1d
DS
34272007-06-17 Danny Smith <dannysmith@users.sourceforge.net
3428
e1311401 3429 * files.c (open_file): Correct typo.
66938a1d 3430
71995ede
VP
34312007-06-16 Vladimir Prus <vladimir@codesourcery.com>
3432
e1311401 3433 * files.c (open_file): Prevent the call
71995ede
VP
3434 for stat from overwriting errno.
3435
84152c25
VP
34362007-06-09 Vladimir Prus <vladimir@codesourcery.com>
3437
e1311401 3438 * files.c (open_file): Account for the
19a9ba64
AM
3439 fact that on windows, opening a directory gives
3440 EACCES.
84152c25 3441
f7fd775f
JW
34422007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
3443
3444 PR preprocessor/23479
3445 * expr.c (cpp_classify_number): Implement 0b-prefixed binary
3446 integer constants.
3447 (append_digit): Likewise.
3448 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
3449 binary integer constants.
3450
ed0e74e0
DK
34512007-05-31 Dave Korn <dave.korn@artimi.com>
3452
3453 PR preprocessor/14331
3454 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
3455
a702045a
OW
34562007-05-24 Ollie Wild <aaw@google.com>
3457
3458 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
3459 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
3460 (cpp_write_pch_state): Save __COUNTER__ state.
3461 (cpp_valid_state): Check valid __COUNTER__ state.
3462 (cpp_read_state): Read new __COUNTER__ state.
3463 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
3464 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
3465 * internal.h (struct cpp_reader): Add counter member.
3466
126e073b
SM
34672007-05-23 Simon Martin <simartin@users.sourceforge.net>
3468
3469 PR preprocessor/20077
3470 * macro.c (create_iso_definition): Fixed the method to determine
3471 whether the token-pasting operator appears at the beginning or the end
3472 of a macro.
3473
0b4cafec
ILT
34742007-05-21 Ian Lance Taylor <iant@google.com>
3475
3476 * internal.h (struct cpp_reader): Add new fields:
3477 nonexistent_file_hash and nonexistent_file_ob.
3478 * files.c: Include "obstack.h".
3479 (find_file_in_dir): Before trying to open the file, look up the
3480 path name in the hash table of nonexistent files. After failing
3481 to open the file, add the path name to the hash table.
3482 (_cpp_find_file): Cache the results of looking up the file name
3483 starting with the quote and bracket chain heads, if we can.
3484 (nonexistent_file_hash_eq): New static function.
3485 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
3486 pfile->nonexistent_file_ob.
3487 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
3488 pfile->nonexistent_file_ob.
3489
30e04921
JJ
34902007-05-14 Janis Johnson <janis187@us.ibm.com>
3491
19a9ba64 3492 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
5a6bb57e 3493
30e04921
JJ
3494 PR c/31924
3495 * expr.c (interpret_float_suffix): Check for invalid suffix.
3496
22a8a52d
EC
34972007-05-02 Eric Christopher <echristo@apple.com>
3498
3499 * expr.c (num_div_op): Don't overflow if the result is
3500 zero.
3501
fca35e1b
TT
35022007-05-02 Tom Tromey <tromey@redhat.com>
3503
765d600a 3504 PR preprocessor/28709
fca35e1b
TT
3505 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
3506
4cd97075
MM
35072007-03-30 Michael Meissner <michael.meissner@amd.com>
3508
3509 * directives.c (lex_macro_node_from_str): Fix alloca call to be
3510 type correct.
3511
121de39f
RH
35122007-03-30 Richard Henderson <rth@redhat.com>
3513
3514 * directives.c (lex_macro_node_from_str): New.
3515 (cpp_push_definition, cpp_pop_definition): New.
3516 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
3517
4fcb360b
BM
35182007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
3519
3520 * Makefile.in: Add dummy install-pdf target.
3521
67e64439
TT
35222007-01-30 Tom Tromey <tromey@redhat.com>
3523
765d600a 3524 PR preprocessor/30468
67e64439
TT
3525 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
3526 './'.
3527
ee380365
TT
35282007-01-30 Tom Tromey <tromey@redhat.com>
3529
765d600a 3530 PR preprocessor/29966
ee380365
TT
3531 * macro.c (lex_expansion_token): Save and restore cpp_reader's
3532 cur_token.
3533 (_cpp_create_definition): Don't restore cur_token here.
3534 * lex.c (_cpp_lex_token): Added assertion.
3535
024abeb3
TT
35362007-01-27 Tom Tromey <tromey@redhat.com>
3537
3538 * configure: Rebuilt.
3539
ee1c2a10
TT
35402007-01-12 Tom Tromey <tromey@redhat.com>
3541
765d600a 3542 PR preprocessor/28227
ee1c2a10
TT
3543 * directives.c (lex_macro_node): Added 'is_def_or_undef'
3544 argument.
3545 (do_define): Update.
3546 (do_undef): Update.
3547 (do_ifdef): Update.
3548 (do_ifndef): Update.
3549
67214c16
PB
35502007-01-11 Paolo Bonzini <bonzini@gnu.org>
3551
3552 * configure: Regenerate.
3553
1aa6ca40
PB
35542007-01-11 Paolo Bonzini <bonzini@gnu.org>
3555
3556 * configure: Regenerate.
3557
705e2d28
TT
35582007-01-04 Tom Tromey <tromey@redhat.com>
3559
765d600a 3560 PR preprocessor/28165
705e2d28
TT
3561 * internal.h (cpp_in_primary_file): New function.
3562 * directives.c (do_include_next): Use cpp_in_primary_file.
3563 (do_pragma_once): Likewise.
3564 (do_pragma_system_header): Likewise.
3565
7af45bd4
ILT
35662006-12-29 Ian Lance Taylor <iant@google.com>
3567
3568 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
3569 look backward at the end of the line unless we saw a backslash.
3570
9d30f270
JJ
35712006-12-29 Jakub Jelinek <jakub@redhat.com>
3572
3573 PR preprocessor/29612
3574 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
3575 only when new_sysp is non-zero.
3576
30b0edc0
TT
35772006-12-28 Tom Tromey <tromey@redhat.com>
3578
765d600a 3579 PR preprocessor/30001
30b0edc0
TT
3580 * charset.c (_cpp_convert_input): Check that to.len is greater
3581 than zero.
3582
85d9c13c
TS
35832006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
3584
3585 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
83cc06b2 3586 * configure: Rebuilt.
85d9c13c 3587
dfafdaa6
DG
35882006-11-01 Douglas Gregor <doug.gregor@gmail.com>
3589
3590 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
3591 for experimental C++0x mode.
3592 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
3593 adopted the preprocessor changes introduced in C99.
3594
0f45f0f5
JM
35952006-10-29 Joseph Myers <joseph@codesourcery.com>
3596
3597 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
3598 depending on --enable-targets=all.
3599 * configure: Regenerate.
3600
de000d22
JJ
36012006-10-12 Jakub Jelinek <jakub@redhat.com>
3602
3603 PR preprocessor/28709
3604 * macro.c (paste_tokens): Do error reporting here, use BUF with the
3605 spelled LHS token as opposed to spelling it again.
3606 (paste_all_tokens): Don't report errors here, just break on failure.
3607
b5422ad7
BM
36082006-10-10 Brooks Moses <bmoses@stanford.edu>
3609
3610 * Makefile.in: Added empty "pdf" target.
3611
aaf50ff2
GK
36122006-09-22 Geoffrey Keating <geoffk@apple.com>
3613
3614 * configure.ac: Make need_64_bit_hwint case for x86-darwin
3615 match exactly the glob in gcc/config.gcc.
3616 * configure: Regenerate.
3617
c663e301
JM
36182006-09-13 Joseph S. Myers <joseph@codesourcery.com>
3619
3620 PR c/28768
3621 PR preprocessor/14634
3622 * lex.c (lex_string): Pedwarn for unterminated literals.
3623
f7288899
EC
36242006-09-08 Eric Christopher <echristo@apple.com>
3625
3626 * configure.ac: Add 64-bit HWI support for i?86-darwin.
3627
b52dbbf8
SE
36282006-08-14 Steve Ellcey <sje@cup.hp.com>
3629
3630 PR c++/28288
3631 PR c++/14556
3632 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
3633 (CPP_LAST_EQ): Change.
3634 (CPP_LAST_PUNCTUATOR): Change.
3635 * expr.c (cpp_operator): Remove MIN and MAX.
3636 (reduce): Remove CPP_MIN and CPP_MAX.
3637 (num_binary_op): Ditto.
3638 * lex.c (_cpp_lex_direct): Ditto.
3639 (cpp_avoid_paste): Remove ? as legal symbol after > or <.
3640
1c90c6f9
JJ
36412006-06-09 Jakub Jelinek <jakub@redhat.com>
3642
3643 PR preprocessor/27746
3644 * directives.c (do_pragma): Handle pragma with valid namespace
3645 and invalid name coming from macro expansion.
3646 * directives.c (destringize_and_run): Initialize next field in
3647 context.
3648
3649 PR c/27747
3650 PR c++/27748
3651 * directives.c (destringize_and_run): Set NO_EXPAND on the
3652 tokens.
3653
3654 * macro.c (_cpp_backup_tokens): Fix comment typo.
3655
5c3c3683
DJ
36562006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
3657
3658 * Makefile.in (CATALOGS): Add po/ prefix.
3659 * configure: Regenerated.
3660
b2bd74bc
CD
36612006-05-23 Carlos O'Donell <carlos@codesourcery.com>
3662
3663 * Makefile.in: Add install-html target. Add install-html to .PHONY
3664
be8ac3e2
GZ
36652006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
3666
3667 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
3668 * files.c (_cpp_get_file_stat): New function.
3669 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
3670 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
3671 * internal.h (_cpp_get_file_stat): Prototype.
3672 (struct cpp_buffer): Add timestamp.
3673
83900997
JJ
36742006-01-23 Jakub Jelinek <jakub@redhat.com>
3675
3676 PR preprocessor/25717
3677 * init.c (cpp_init_builtins): If __STDC__ will not change value
3678 between system headers and other sources, define it as a normal
3679 macro rather than a builtin.
3680 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
3681 cpp_in_system_header condition.
3682
36832006-01-05 Paolo Bonzini <bonzini@gnu.org>
9220c30c
PB
3684
3685 * Makefile.in: Use -MMD instead of -MD.
3686
bc4071dd
RH
36872006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
3688 Richard Henderson <rth@redhat.com>
3689
3690 Merge from gomp branch:
3691 * directives.c (struct pragma_entry): Add is_deferred. Add ident
3692 entry to value union.
3693 (end_directive): Don't eat the line if in_deferred_pragma.
3694 (run_directive): Remove pragma hacks.
3695 (insert_pragma_entry): Remove.
3696 (new_pragma_entry): New.
3697 (register_pragma_1): Split out of register_pragma. Only handle
3698 the lookup tree and return the new entry.
3699 (cpp_register_pragma): Fill in the pragma entry here.
3700 (cpp_register_deferred_pragma): New.
3701 (register_pragma_internal): New.
3702 (_cpp_init_internal_pragmas): Use register_pragma_internal.
3703 (do_pragma): Allow pragma expansion after namespace. For deferred
3704 pragmas, don't slurp the line into a string.
3705 (destringize_and_run): Save tokens for deferred pragmas.
3706 (cpp_handle_deferred_pragma): Remove.
3707 * macro.c (builtin_macro): Remove pragma token hack.
3708 (_cpp_push_token_context): Rename from push_token_context and export.
3709 * internal.h (struct lexer_state): Add pragma_allow_expansion.
3710 (_cpp_push_token_context): Declare.
3711 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
3712 a token. Update the line number correctly if so.
3713 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
3714 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
3715 * include/cpplib.h (PRAGMA_EOL): New.
3716 (CPP_TOKEN_FLD_PRAGMA): New.
3717 (struct cpp_token): Add val.pragma.
3718 (struct cpp_options): Remove defer_pragmas.
3719 (cpp_handle_deferred_pragma): Remove.
3720 (cpp_register_deferred_pragma): Declare.
3721
d09e893f
JJ
37222006-01-01 Jakub Jelinek <jakub@redhat.com>
3723
3724 PR c++/25294
3725 * directives.c (do_pragma): If pragma line ends with multi-line
3726 block comment, end the saved deferred pragma string before that
3727 comment. Handle embedded '\0' chars on the pragma line.
3728
ab84748a
VR
37292005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
3730
3731 PR c++/23333
3732 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
3733
ad6ed77e
JG
37342005-12-07 Jon Grimm <jgrimm2@us.ibm.com>
3735 Ben Elliston <bje@au.ibm.com>
3736
3737 * include/cpplib.h (CPP_N_DFLOAT): New.
3738 * expr.c (interpret_float_suffix): Identify df, dd, and dl
3739 suffixes as decimal floating point constants.
3740 (cpp_classify_number): Disallow hexadecimal DFP constants.
3741
ba096620 37422005-11-14 Gerald Pfeifer <gerald@pfeifer.com>
bc4071dd 3743 Ian Lance Taylor <ian@airs.com>
ba096620
GP
3744
3745 * include/cpplib.h (struct cpp_callbacks): Annotate error with
3746 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
3747
456b8ce5
UB
37482005-11-09 Per Bothner <per@bothner.com>
3749 Uros Bizjak <uros@kss-loka.si>
f7288899 3750
456b8ce5
UB
3751 PR c/24101
3752 * init.c (read_original_filename): Temporarily set
3753 state.in_directive before calling _cpp_lex_direct for
3754 CPP_HASH tokens.
3755
5571f74f
JW
37562005-11-03 James E Wilson <wilson@specifix.com>
3757
3758 PR preprocessor/24202
3759 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
3760
a63607ed
JM
37612005-11-04 Joseph S. Myers <joseph@codesourcery.com>
3762
3763 * include/cpplib.h (struct cpp_callbacks): Make error take
3764 va_list* parameter.
3765 * errors.c (cpp_error): Update call to callback.
3766
651ed942
AP
37672005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
3768
3769 PR preprocessor/22042
3770 * macro.c (_cpp_builtin_macro_text): Lower the needed max
3771 buffer size.
3772 (cpp_quote_string): Don't octalify non printable
3773 charactors.
3774
178b58b5
JM
37752005-11-03 Joseph S. Myers <joseph@codesourcery.com>
3776
3777 PR c++/17964
3778 * include/cpplib.h (struct cpp_options): Add client_diagnostic.
3779 (struct cpp_callbacks): Add error.
3780 * errors.c (cpp_error): If client_diagnostic, use error callback.
3781 * charset.c (convert_escape): Don't use %03o in diagnostic.
3782
3ee5ed11 37832005-10-21 James E Wilson <wilson@specifix.com>
6568f34b
JW
3784
3785 PR preprocessor/15220
3786 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all
3787 callers. Pass to open_file_failed.
3788 (open_file_failed): New parameter angle_brackets. Fix all callers.
3789 Use in print_dep assignment.
3790 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
3791 * internal.h (_cpp_find_file): Add new parm to declaration.
f7288899 3792
077fc835
KH
37932005-10-08 Kazu Hirata <kazu@codesourcery.com>
3794
3795 * configure.ac: Require 64-bit int for arm*-*-*eabi*.
3796 * configure: Regenerate.
3797
cbc43ae0
ILT
37982005-10-04 Ian Lance Taylor <ian@airs.com>
3799
3800 PR preprocessor/13726
3801 * directives.c (check_eol_return_comments): New static function.
3802 (parse_include): Add buf parameter. Change all callers.
3803 (do_include_common): If not discard comments, turn on
3804 save_comments. Pass collected comments to include callback.
3805 * include/cpplib.h (struct cpp_callbacks): Add new parameter to
3806 include callback: cpp_token list.
3807
af15a2fe
JM
38082005-09-20 Joseph S. Myers <joseph@codesourcery.com>
3809
3810 * include/cpplib.h (struct cpp_options): Add extended_identifiers.
3811 * init.c (struct lang_flags, lang_defaults): Add
3812 extended_identifiers.
3813 (cpp_set_lang): Use it.
3814 * lex.c (forms_identifier_p): Check extended_identifiers.
3815
f5eab47e
JJ
38162005-08-30 Jakub Jelinek <jakub@redhat.com>
3817
3818 PR preprocessor/20348
3819 PR preprocessor/20356
3820 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
3821 2004-06-05 changes.
3822
467129e6
KG
38232005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3824
3825 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
3826 -Wmissing-format-attribute.
3827
3828 * configure: Regenerate.
3829
200031d1
KC
38302005-06-29 Kelley Cook <kcook@gcc.gnu.org>
3831
3832 * all files: Update FSF address in copyright headers.
3833 * makeucnid.c (write_copyright): Update outputted FSF address.
3834
f610dd5f
ZW
38352005-06-13 Zack Weinberg <zack@codesourcery.com>
3836
3837 * configure.ac: Invoke ZW_CREATE_DEPDIR and
3838 ZW_PROG_COMPILER_DEPENDENCIES.
3839 * aclocal.m4, configure: Regenerate.
3840 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
3841 New variables.
3842 (distclean): Clean up $(DEPDIR) and its contents.
3843 (.c.o): Use $(COMPILE).
3844 Include $(DEPDIR)/*.Po for most object->header dependencies.
3845
c3f829c1
GDR
38462005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
3847
3848 * configure.ac: Check declarations for asprintf and vasprintf.
3849 * config.in: Regenerate.
3850 * configure: Likewise.
3851
3852 * charset.c (conversion_loop): Use XRESIZEVEC.
3853 (convert_no_conversion): Likewise.
3854 (convert_using_iconv): Likewise.
3855 (init_iconv_desc): Cast return value of alloca.
3856 (cpp_host_to_exec_charset): Use XNEWVEC.
3857 (emit_numeric_escape): Use XRESIZEVEC.
3858 (cpp_interpret_string): Use XNEWVEC.
3859 (cpp_interpret_string): Use XRESIZEVEC.
3860 (_cpp_interpret_identifier): Cast return value of alloca.
3861 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
3862 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
3863 (parse_include): Use XNEWVEC.
3864 (insert_pragma_entry): Rename local variable "new" to
f610dd5f 3865 "new_entry".
c3f829c1
GDR
3866 (save_registered_pragmas): Cast return value of xmemdup.
3867 (destringize_and_run): Same for alloca.
3868 (parse_assertion): Likewise.
3869 (do_assert): Cast allocated storage to proper type.
3870 (cpp_define): Likewise.
3871 (_cpp_define_builtin): Likewise.
3872 (cpp_undef): Likewise.
3873 (handle_assertion): Likewise.
3874 (cpp_push_buffer): Rename local variable "new" to "new_buffer".
3875 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
3876 (CPP_UMINUS): Likewise.
3877 (struct cpp_operator): Rename from struct operator.
3878 (_cpp_expand_op_stack): Use XRESIZEVEC.
3879 * files.c (pch_open_file): Use XNEWVEC.
3880 (pch_open_file): Use XRESIZEVEC.
3881 (read_file_guts): Use XNEWVEC and XRESIZEVEC.
3882 (dir_name_of_file): Use XNEWVEC.
3883 (make_cpp_file): Use XCNEW.
3884 (make_cpp_dir): Likewise.
3885 (allocate_file_hash_entries): USE XNEWVEC.
3886 (cpp_included): Cast return value of htab_find_with_hash.
3887 (append_file_to_dir): Use XNEWVEC.
3888 (read_filename_string): Likewise. Use XRESIZEVEC too.
3889 (read_name_map): Cast return value of alloca. Use XRESIZEVEC.
3890 (remap_filename): Use XNEWVEC.
3891 (struct pchf_entry): Move definition out of struct pchf_data.
3892 (_cpp_save_file_entries): Use XCNEWVAR.
3893 (_cpp_read_file_entries): Use XNEWVAR.
3894 * identifiers.c (alloc_node): Use XOBNEW.
3895 * init.c (cpp_create_reader): Use XCNEW.
3896 (cpp_init_builtins): Cast of b->value to enum builtin_type.
3897 (read_original_directory): Cast return value of alloca.
3898 * lex.c (add_line_note): Use XRESIZEVEC.
3899 (warn_about_normalization): Use XNEWVEC.
3900 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
3901 (new_buff): Use XNEWVEC.
3902 * line-map.c (linemap_add): Use XRESIZEVEC.
3903 * macro.c (builtin_macro): Cast return value of alloca.
3904 (paste_tokens): Likewise.
3905 (expand_arg): Use XNEWVEC and XRESIZEVEC.
3906 (_cpp_save_parameter): Use XRESIZEVEC.
3907 (create_iso_definition): Cast allocated storage to proper type.
3908 (_cpp_create_definition): Likewise.
3909 (cpp_macro_definition): Use XRESIZEVEC.
3910 * makedepend.c (add_clm): Use XNEW.
3911 (add_dir): Likewise.
3912 * mkdeps.c (munge): Use XNEWVEC.
3913 (deps_init): Use XCNEW.
3914 (deps_add_target): Use XRESIZEVEC.
3915 (deps_add_default_target): Cast return value of alloca.
3916 (deps_add_dep): Use XRESIZEVEC.
3917 (deps_add_vpath): Likewise. Use XNEWVEC too.
3918 (deps_restore): Likewise.
3919 * pch.c (save_idents): Use XNEW and XNEWVEC.
3920 (cpp_save_state): Use XNEW.
3921 (count_defs): Cast return value of htab_find.
3922 (write_defs): Likewise.
3923 (cpp_write_pch_deps): Use XNEWVEC.
3924 (collect_ht_nodes): Use XRESIZEVEC.
3925 (cpp_valid_state): Use XNEWVEC.
3926 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup.
3927 * symtab.c (ht_create): Use XCNEW.
3928 (ht_lookup_with_hash): Cast return value of obstack_copy0.
3929 (ht_expand): Use XCNEWVEC.
3930 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
3931 (bool): Do not define if __cplusplus.
3932
1ed17cd5
ZW
39332005-05-12 Zack Weinberg <zack@codesourcery.com>
3934
3935 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
3936 (do_sccs): Delete function definition, #define to do_ident.
3937 (do_ident): Don't hardwire directive name.
3938
5a8c20ce
RK
39392005-05-12 Ryota Kunisawa <kunisawa@access.co.jp>
3940
3941 PR bootstrap/21230
3942 * configure: Regenerate.
3943
473c5bc9
AP
39442005-04-27 Andris Pavenis <pavenis@latnet.lv>
3945
3946 * files.c: Include io.h for DJGPP to get prototype of setmode.
3947
c1fc5047
PB
39482005-04-19 Per Bothner <per@bothner.com>
3949
3950 PR preprocessor/20907
3951 * line-map.c (linemap_line_start): Fix bug when we need to increse
3952 column_bits but can re-use the current line_map.
3953
042630ad
KG
39542005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3955
3956 * system.h (fopen, fdopen, freopen): Define these to the unlocked
3957 libiberty functions.
3958
0d667716
KG
39592005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3960
3961 * configure.ac (libcpp_UNLOCKED_FUNCS): New.
3962 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
3963 * system.h (putchar, getc, getchar, clearerr, feof, fileno,
3964 fflush, fgetc, fgets, ferror, fread): Redefine to the associated
3965 _unlocked function.
3966 (fwrite_unlocked): Fix prototype.
1ed17cd5 3967
0d667716
KG
3968 * configure, config.in: Regenerate.
3969
cae064e7
JJ
39702005-04-05 Jakub Jelinek <jakub@redhat.com>
3971
3972 PR preprocessor/19475
3973 * macro.c (create_iso_definition): For < ISO C99, don't
3974 pedwarn if there is no whitespace between macro name and its
3975 replacement, but the replacement starts with a basic character
3976 set character.
3977
cbada204
AJ
39782005-03-28 Andreas Jaeger <aj@suse.de>
3979
3980 * lex.c (warn_about_normalization): Cast field width to int to
3981 avoid warning.
3982
f42eccdb
JM
39832005-03-19 Joseph S. Myers <joseph@codesourcery.com>
3984
3985 * configure.ac: Consistently use solaris2.1[0-9]* instead of
3986 solaris2.1[0-9].
3987 * configure: Regenerate.
3988
c79e602b
GK
39892005-03-15 Geoffrey Keating <geoffk@apple.com>
3990
3991 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
3992 UCN rather than printing an error.
3993
50668cf6
GK
39942005-03-14 Geoffrey Keating <geoffk@apple.com>
3995
6baba9bb
GK
3996 * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
3997
39982005-03-14 Geoffrey Keating <geoffk@apple.com>
1ed17cd5 3999
50668cf6
GK
4000 * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
4001 * charset.c: Update for new format of ucnid.h.
4002 (ucn_valid_in_identifier): Update for new format of ucnid.h.
4003 Add NST parameter, and update it; update callers.
4004 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort
4005 with cpp_error.
4006 (convert_ucn): Pass normalize_state to cpp_valid_ucn.
4007 * internal.h (struct normalize_state): New.
4008 (INITIAL_NORMALIZE_STATE): New.
4009 (NORMALIZE_STATE_RESULT): New.
4010 (NORMALIZE_STATE_UPDATE_IDNUM): New.
4011 (_cpp_valid_ucn): New.
4012 * lex.c (warn_about_normalization): New.
4013 (forms_identifier_p): Add normalize_state parameter, update callers.
4014 (lex_identifier): Add normalize_state parameter, update callers. Keep
4015 the state current.
4016 (lex_number): Likewise.
4017 (_cpp_lex_direct): Pass normalize_state to subroutines. Check
4018 it with warn_about_normalization.
4019 * makeucnid.c: New.
4020 * ucnid.h: Replace.
4021 * ucnid.pl: Remove.
4022 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove
4023 comments about obsolete version of C++.
4024 * include/cpplib.h (enum cpp_normalize_level): New.
4025 (struct cpp_options): Add warn_normalize field.
4026
47e20491
GK
40272005-03-11 Geoffrey Keating <geoffk@apple.com>
4028
4029 * directives.c (glue_header_name): Update call to cpp_spell_token.
4030 * internal.h (_cpp_interpret_identifier): New.
4031 * charset.c (_cpp_interpret_identifier): New.
4032 (_cpp_valid_ucn): Allow UCN version of '$'.
4033 * lex.c (lex_identifier): Add extra parameter to indicate if initial
4034 character was '$' or '\'. Support identifiers with UCNs.
4035 (forms_identifier_p): Allow UCNs.
4036 (_cpp_lex_direct): Pass extra parameter to lex_identifier.
4037 (utf8_to_ucn): New.
4038 (cpp_spell_token): Add FORSTRING parameter. Use it.
4039 (cpp_token_as_text): Update call to cpp_spell_token.
4040 (cpp_output_token): Write UCNs back out.
4041 (stringify_arg): Update call to cpp_spell_token.
4042 (paste_tokens): Likewise.
4043 (cpp_macro_definition): Likewise.
4044 * macro.c (stringify_arg): Likewise.
4045 (paste_tokens): Likewise.
4046 (cpp_macro_definition): Likewise.
4047 * include/cpplib.h: Add parameter to cpp_spell_token.
4048
73096711
JJ
40492005-03-04 Jakub Jelinek <jakub@redhat.com>
4050
4051 PR bootstrap/20282
4052 PR bootstrap/20305
4053 * macro.c (replace_args, cpp_get_token): Copy whole
4054 cpp_token_u instead of just cpp_string field from it.
4055
2203a881
DP
40562005-02-28 Devang Patel <dpatel@apple.com>
4057
4058 * directives.c (do_line): Save sysp early before line table is
4059 realloc'ed.
1ed17cd5 4060
c5ff069d
ZW
40612005-02-20 Zack Weinberg <zack@codesourcery.com>
4062
4063 PR 18785
4064 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
4065 (cpp_host_to_exec_charset): New function.
4066 * include/cpplib.h: Declare cpp_host_to_exec_charset.
4067
04c90eea
DP
40682005-02-19 Devang Patel <dpatel@apple.com>
4069
4070 * charset.c (_cpp_convert_input): Check '\r' before inserting
4071 '\n' at the end.
c5ff069d 4072
6da55c00
EC
40732005-02-15 Eric Christopher <echristo@redhat.com>
4074
4075 PR preprocessor/19077
4076 * macro.c (cpp_macro_definition): Move handling of whitespace
4077 to PREV_WHITE conditional. Remove overloading of len
4078 variable.
4079
31c3e631
KH
40802005-02-14 Kazu Hirata <kazu@cs.umass.edu>
4081
4082 * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
4083 traditional.c: Update copyright.
4084
be0f1e54
PB
40852005-02-14 Paolo Bonzini <bonzini@gnu.org>
4086
4087 PR bootstrap/19818
4088 * configure.ac: Check for declaration of basename and getopt.
4089 * config.in: Regenerate.
4090 * configure: Regenerate.
4091 * internal.h (ustrcspn): New.
4092 * macro.c (create_iso_definition): Fix allocation of memory.
4093 (padding_token): Add cast to remove const-ness.
4094 * pch.c (cpp_read_state): Use ustrcspn.
4095
ecddfb39
MS
40962005-02-08 Mike Stump <mrs@apple.com>
4097
4098 * files.c (pchf_adder): Remove.
4099 (struct pchf_adder_info): Likewise.
4100 (_cpp_save_file_entries): Write out all files so that #import works.
4101
9fcdd891
JM
41022005-01-23 Joseph S. Myers <joseph@codesourcery.com>
4103
4104 * configure: Regenerate.
4105
ecfd72e7
TS
41062005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
4107
4108 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
4109
6c25a4f7 4110 * include/cpplib.h: Also update copyright years.
c5ff069d 4111
942926ad
GK
41122005-01-03 Geoffrey Keating <geoffk@apple.com>
4113
4114 * files.c (_cpp_find_file): Add files found by search_path_exhausted
4115 to the list of all files.
4116
a2566ae9
GDR
41172005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
4118
4119 * internal.h: Update references to Cpp lib filenames.
4120 * directives.c: Likewise.
4121 * init.c: Likewise.
4122 * macro.c: Likewise.
4123 * traditional.c: Likewise.
4124
1b449375
EB
41252004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
4126
4127 PR preprocessor/15167
4128 * files.c (destroy_cpp_file): New function.
4129 (should_stack_file): Make a new file if the
4130 compared file is still stacked.
4131
28303828
NN
41322004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
4133
c5ff069d 4134 PR preprocessor/17610
28303828
NN
4135 * directives.c (do_include_common): Error out if an empty filename
4136 is given for #include (or #include_next or #import).
4137
c812785a
RS
41382004-11-27 Roger Sayle <roger@eyesopen.com>
4139 Zack Weinberg <zack@codesourcery.com>
4140
4141 * internal.h: Replace all uses of uchar with unsigned char.
4142 * include/cpp-id-data.h: Likewise. Guard typedef of uchar
4143 with !IN_GCC, so uchar is only defined whilst building libcpp.
4144
f91eaa01
KC
41452004-11-24 Kelley Cook <kcook@gcc.gnu.org>
4146
4147 * aclocal.m4: Regenerate.
4148
f78ce0c2
RS
41492004-11-24 Roger Sayle <roger@eyesopen.com>
4150
4151 PR preprocessor/15824
4152 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
4153 directly, instead of the non-existant "system.h" and "ansidecl.h".
4154 * configure: Regenerate.
4155
b5b3e36a 41562004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
c5ff069d 4157 Joseph Myers <joseph@codesourcery.com>
b5b3e36a
DJ
4158
4159 * internal.h (struct lexer_state): Add in_deferred_pragma.
4160 * directives.c (struct pragma_entry): Add allow_expansion.
4161 (insert_pragma_entry): Take allow_expansion flag.
4162 (register_pragma): Likewise.
4163 (cpp_register_pragma): Likewise.
4164 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
4165 (do_pragma): Honor allow_expansion.
4166 (cpp_handle_deferred_pragma): Set in_deferred_pragma.
4167 * include/cpplib.h (cpp_register_pragma): Update prototype.
4168
a8e68029 41692004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
c5ff069d 4170 Mark Mitchell <mark@codesourcery.com>
a8e68029
DJ
4171
4172 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
4173 need_64bit_hwint=yes.
4174 * configure: Regenerate.
4175
50f47ee0
JM
41762004-11-09 Joseph S. Myers <joseph@codesourcery.com>
4177
4178 * Makefile.in ($(PACKAGE).pot): New rule. Depend on
4179 po/$(PACKAGE).pot.
4180 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
4181 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
4182 Remove local srcdir path from generated file.
4183
968e08d6 41842004-11-04 Zack Weinberg <zack@codesourcery.com>
c5ff069d 4185 Gerald Pfeifer <gerald@pfeifer.com>
968e08d6
ZW
4186
4187 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
4188 as well.
4189
3da3d587
ZW
41902004-10-27 Zack Weinberg <zack@codesourcery.com>
4191
4192 PR 18075
4193 * directives.c (do_pragma): Do not defer pragmas which are unknown.
4194 (cpp_handle_deferred_pragma): Add cast to silence warning.
4195
ac24fc25
JM
41962004-10-14 Joseph S. Myers <jsm@polyomino.org.uk>
4197
4198 * errors.c (_cpp_begin_message): Print "error: " for errors.
4199
7731405b
AJ
42002004-10-10 Andreas Jaeger <aj@suse.de>
4201
4202 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
4203 * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
4204
646544e3
AP
42052004-10-08 Andrew Pinski <pinskia@physics.uc.edu>
4206
4207 * pch.c (cpp_write_pch_state): Remove variable z as it is not
4208 used.
4209 (cpp_read_state): Remove unused variables, m, d and mac_count.
4210
67a74146
PB
42112004-09-29 Per Bothner <per@bothner.com>
4212
4213 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore
4214 cb.line_change. Otherwise do_pragma will call the line_change
4215 call-back with a meaningless line number.
4216
018a4785
ZW
42172004-09-24 Zack Weinberg <zack@codesourcery.com>
4218
4219 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
4220 programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
4221 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
4222 * aclocal.m4, configure: Regenerate.
4223 * init.c: Include localedir.h.
4224 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
4225 (DEFS): Delete.
4226 (.c.o): Use $(ALL_CFLAGS).
4227 (localedir.h, localedir.hs): New rules.
4228 (clean): Use rm -rf to remove directories.
4229 (distclean): Also delete localedir.h and localedir.hs.
4230 (init.o): Update dependencies.
4231
88fa57d7
KC
42322004-09-22 Kelley Cook <kcook@gcc.gnu.org>
4233
4234 * Makefile.in (aclocal.m4): Update dependencies.
4235 * configure.ac (AC_CONFIG_MACRO_DIR): New.
4236 * aclocal.m4, configure: Regenerate.
4237
8f8e9aa5
ZW
42382004-09-17 Zack Weinberg <zack@codesourcery.com>
4239
a29f62d9
ZW
4240 * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
4241 (_cpp_convert_input, _cpp_default_encoding): Add comments.
4242 Some other comments in this file also tweaked.
4243
8f8e9aa5
ZW
4244 * directives.c (do_pragma): Save current buffer position
4245 before lexing the pragma keywords; don't call
4246 _cpp_backup_tokens in the defer_pragmas case.
4247
a2981930
PB
42482004-09-15 Per Bothner <per@bothner.com>
4249
4250 * include/line-map.h (line_map_start): Add parameter names so
4251 preceding comment makes sense.
4252 (linemap_add): Remove from comment mention of non-existing parameter.
4253
21b11495
ZW
42542004-09-09 Matt Austern <austern@apple.com>
4255 Zack Weinberg <zack@codesourcery.com>
4256
4257 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
4258 prefixes throughout. Add entry for PRAGMA. Remove
4259 unnecessary "= 0" from EQ.
4260 (enum cpp_ttype): Adjust OP and TK definitions to restore
4261 prefixes, via token-paste.
4262 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
4263 Change from #defines to additional cpp_ttype enumerators.
4264 (struct cpp_options): Add defer_pragmas.
4265 (cpp_handle_deferred_pragma): Prototype new interface.
4266
4267 * internal.h (struct cpp_reader): Add directive_result.
4268 * directives.c (struct pragma_entry): Add is_internal field;
4269 give boolean fields type bool.
4270 (start_directive): Initialize pfile->directive_result.type.
4271 (_cpp_do__Pragma): Likewise.
4272 (run_directive): Do not crash if pfile->buffer->prev is NULL.
4273 (insert_pragma_entry): Add 'internal' argument; set new->is_internal
4274 from it.
4275 (register_pragma): New static function, bulk of former
4276 cpp_register_pragma here; add 'internal' argument, pass along
4277 to insert_pragma_entry.
4278 (cpp_register_pragma): Now a wrapper around register_pragma which
4279 always passes false for 'internal' argument.
4280 (_cpp_init_internal_pragmas): Call register_pragma directly, passing
4281 true for 'internal'.
4282 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
4283 an internal pragma, save text till the end of the line as a CPP_PRAGMA
4284 token instead of executing the pragma.
4285 (cpp_handle_deferred_pragma): New interface.
4286 * lex.c (token_spellings): Adjust OP and TK definitions to
4287 match changes to cpplib.h.
4288 (_cpp_lex_token): Check for a directive-result token and
4289 return it if present.
4290 (cpp_token_val_index): Handle CPP_PRAGMA.
4291 * macro.c (cpp_builtin_macro_text): Correct comment.
4292 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
4293
0fd9e8dd
SB
42942004-09-06 Serge Belyshev <belyshev@lubercy.com>
4295
4296 PR preprocessor/14699
4297 * symtab.c (ht_dump_statistics): Change type of sum_of_squares
4298 from size_t to double.
4299
39b8ce7f
AS
43002004-08-28 Andreas Schwab <schwab@suse.de>
4301 Andreas Jaeger <aj@suse.de>
4302
4303 * configure.ac: Set PACKAGE correctly.
4304 * configure: Regenerated.
4305
5d1f4b27
PB
43062004-08-25 Paolo Bonzini <bonzini@gnu.org>
4307
4308 * Makefile.in: Add back top_builddir.
4309
078e3ffe
PB
43102004-08-25 Paolo Bonzini <bonzini@gnu.org>
4311
4312 * configure.ac: Replace Automake macro invocations
4313 with manual Autoconf checks and substitutions.
4314 * configure: Regenerate.
4315 * aclocal.m4: Regenerate.
4316 * config.in: Regenerate.
4317 * Makefile.am: Removed.
4318 * Makefile.in: Heavy simplification and reorganization.
4319
b3f8d95d
MM
43202004-08-09 Mark Mitchell <mark@codesourcery.com>
4321
4322 * configure.ac (arm*-*-eabi*): New target.
4323 (arm*-*-symbianelf*): Likewise.
4324 * configure: Regenerated.
4325
72bb2c39
BI
43262004-07-24 Bernardo Innocenti <bernie@develer.com>
4327
4328 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
4329 * directives.c: Use XNEW-family macros from libiberty.
4330 * lex.c: Likewise.
4331 * macro.c: Likewise.
4332 * cpplib.h (cpp_deps_style): Export enum with name.
4333
21b11495 43342004-07-23 Matthias Klose <doko@debian.org>
72bb2c39 4335
21b11495 4336 * init.c (init_library): Use PACKAGE for the text domain.
85eac2a0 4337
a23ee064
AP
43382004-07-16 Andris Pavenis <pavenis@latnet.lv>
4339
4340 PR preprocessor/16366
4341 * internal.h (struct cpp_reader): New field dir_hash.
4342 * files.c (make_cpp_dir): Use dir_hash, not file_hash.
4343 (_cpp_init_files, _cpp_cleanup_files): Update for new field.
4344
a09d4744
NB
43452004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
4346
4347 PR preprocessor/16192
4348 PR preprocessor/15913
4349 PR preprocessor/15572
4350 * expr.c (_cpp_parse_expr): Handle remaining cases where an
4351 expression is missing.
4352 * init.c (post_options): Traditional cpp doesn't do // comments.
4353
f58f7def
PB
43542004-06-30 Per Bothner <per@bothner.com>
4355
4356 * include/line-map.h (fileline): Remove old typedef.
4357 * internal.h (struct cpp_reader): Use source_location typedef instead.
4358
e83d8d43
ZW
43592004-06-26 Zack Weinberg <zack@codesourcery.com>
4360
4361 Partially revert patch of 2004-06-05.
4362 * files.c (search_cache): Remove pfile argument. Don't check
4363 for file that would be found by "" or <> search here...
4364 (_cpp_find_file): ...do it here, before calling find_file_in_dir.
4365 Do not apply directory-of-current-file correction to files
4366 found by this check. Rearrange code slightly.
4367
c0d578e6
GK
43682004-06-21 Geoffrey Keating <geoffk@apple.com>
4369
4370 * files.c (should_stack_file): Correct swapped parameters to call
4371 to cb.read_pch.
4372 * pch.c (cpp_valid_state): Handle -fpreprocessed.
4373
159d5224
PB
43742004-06-15 Paolo Bonzini <bonzini@gnu.org>
4375
4376 * Makefile.in: Regenerate with automake 1.8.5.
4377 * aclocal.m4: Likewise.
4378 * configure: Regenerate.
4379
2fac9c01
ZW
43802004-06-11 Zack Weinberg <zack@codesourcery.com>
4381
4382 * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
4383 * configure, config.in: Regenerate.
4384 * system.h: Unconditionally define bool as unsigned char,
4385 BOOL_BITFIELD as unsigned int.
4386 * .cvsignore: New file.
4387
d8044160
GK
43882004-06-09 Geoffrey Keating <geoffk@apple.com>
4389
4390 * traditional.c (push_replacement_text): Set macro->traditional.
4391 (save_replacement_text): Likewise.
4392 * pch.c (cpp_write_pch_state): Don't write list of defined macros.
4393 (struct save_macro_item): Delete.
4394 (struct save_macro_data): Use a character array not the previous
4395 structured format.
4396 (save_macros): Save macro as text not as internal structures.
4397 (cpp_prepare_state): Update for changes to save_macro_data.
4398 (cpp_read_state): Don't read macros defined in PCH. Restore
2cf22451 4399 -D macros as text.
d8044160
GK
4400 * macro.c (create_iso_definition): Honour alloc_subobject.
4401 Clear traditional flag.
4402 (_cpp_create_definition): Honour alloc_subobject.
4403 * lex.c (cpp_token_val_index): New.
4404 * internal.h: Include cpp-id-data.h.
4405 (uchar): Move definition to cpp-id-data.h.
4406 (U): Likewise.
4407 (cpp_macro): Likewise.
4408 * directives.c (struct answer): Move to cpp-id-data.h.
4409 (do_assert): Honour alloc_subobject.
2cf22451
ZW
4410
4411 * include/symtab.h (struct ht): Add field 'alloc_subobject'.
4412 * include/cpplib.h (struct cpp_string): Add GTY marker.
4413 (enum cpp_token_fld_kind): New.
4414 (struct cpp_token): Add GTY markers.
4415 (cpp_token_val_index): Prototype.
4416 (CPP_HASHNODE_VALUE_IDX): New.
4417 (struct cpp_hashnode): Don't skip fields of 'value' when marking.
4418 * include/cpp-id-data.h: New file.
d8044160 4419
0ca8e815
PB
44202004-06-09 Paolo Bonzini <bonzini@gnu.org>
4421
4422 * Makefile.am (all-local): New.
4423 * Makefile.in: Regenerate.
4424
b51fa00f
RS
44252004-06-06 Roger Sayle <roger@eyesopen.com>
4426
4427 * Makefile.am (LIBICONV): Declare.
4428 (makedepend_LDADD): Use LIBICONV.
4429 * Makefile.in: Regenerate.
4430
5e2f3f39
AP
44312004-06-05 Andrew Pinski <pinskia@physics.uc.edu>
4432
4433 * Makefile.am (LIBINTL): Declare
4434 (makedepend_LDADD): Use LIBINTL.
4435 * Makefile.in: Regenerate.
4436
c6e83800
ZW
44372004-06-05 Zack Weinberg <zack@codesourcery.com>
4438
4439 * Makefile.am: Add makedepend.
4440 * Makefile.in, aclocal.m4: Regenerate.
4441 * charset.c: Insert a space to avoid a warning.
4442 * directives.c: Include mkdeps.h.
4443 (_cpp_handle_directive): Reenable macro expander if appropriate.
4444 (undefine_macros): Inline body of _cpp_free_definition for speed.
4445 Do not call undef callback or _cpp_warn_if_unused_macro.
4446 (cpp_get_deps): New interface.
4447 * files.c (search_cache): Add pfile argument. Check for file
4448 that would be found by "" or <> search here...
4449 (_cpp_find_file): ...not here. Correct recorded start_dir of
4450 files found by directory-of-current-file search that would be
4451 found by "" or <> search.
4452 * init.c (cpp_add_dependency_target): Delete.
4453 * internal.h (struct lexer_state): Add discarding_output flag.
4454 * lex.c (lex_identifier): Compute hash function while scanning.
4455 * macro.c (cpp_scan_nooutput): Disable macro expansion outside
4456 directives.
4457 * makedepend.c: New file.
4458 * mkdeps.c (struct deps): Add vpath vector.
4459 (apply_vpath, deps_add_vpath): New function.
4460 (deps_free): Free vpath vector.
4461 (deps_add_dep, deps_add_target): Use apply_vpath.
4462 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
4463 (ht_lookup_with_hash): New function.
4464 * cpplib.h, mkdeps.h: Update prototypes.
4465 * symtab.h: Update prototypes.
4466 (HT_HASHSTEP, HT_FINISH): New macros.
4467
b453c95f
GK
44682004-05-29 Geoffrey Keating <geoffk@apple.com>
4469
4470 * symtab.c (ht_create): Set entries_owned.
4471 (ht_destroy): Honour entries_owned.
4472 (ht_expand): Likewise.
4473 (ht_load): New.
2cf22451
ZW
4474 * include/symtab.h (struct ht): New field 'entries_owned'
4475 (ht_load): New prototype.
b453c95f 4476
963e23c5
PB
44772004-05-26 Paolo Bonzini <bonzini@gnu.org>
4478
4479 PR bootstrap/15651
4480 * configure.ac: Fix m4 quoting when picking
4481 the size of HOST_WIDE_INT.
4482 * configure: Regenerate.
4483
0429bc77
PB
44842004-05-25 Paolo Bonzini <bonzini@gnu.org>
4485
4486 * Makefile.am: the correct directory for
4487 gettext include files is given by @INCINTL@.
4488 * Makefile.in: Regenerate.
4489
c86dd7db
PB
44902004-05-24 Paolo Bonzini <bonzini@gnu.org>
4491
4492 * system.h [!ENABLE_NLS]: dgettext takes two
4493 parameters.
4494
4f4e53dd
PB
44952004-05-23 Paolo Bonzini <bonzini@gnu.org>
4496
4497 Moved libcpp from the gcc subdirectory to the toplevel.
4498 * Makefile.am: New file.
4499 * Makefile.in: Regenerate.
4500 * configure.ac: New file.
4501 * configure: Regenerate.
4502 * config.in: Regenerate.
4503 * charset.c: Moved from gcc/cppcharset.c. Add note about
4504 brokenness of input charset detection. Adjust for change
4505 in name of cppucnid.h.
4506 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
4507 * expr.c: Moved from gcc/cppexp.c.
4508 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
4509 Remove #define of O_BINARY, it is in system.h.
4510 * identifiers.c: Moved from gcc/cpphash.c.
4511 * internal.h: Moved from gcc/cpphash.h. Change header
4512 guard name. All other files adjusted to match name change.
4513 * init.c: Moved from gcc/cppinit.c.
4514 (init_library) [ENABLE_NLS]: Call bindtextdomain.
4515 * lex.c: Moved from gcc/cpplex.c.
4516 * directives.c: Moved from gcc/cpplib.c.
4517 * macro.c: Moved from gcc/cppmacro.c.
4518 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
4519 * traditional.c: Moved from gcc/cpptrad.c.
4520 * ucnid.h: Moved from gcc/cppucnid.h. Change header
4521 guard name.
4522 * ucnid.pl: Moved from gcc/cppucnid.pl.
4523 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header
4524 guard name.
4525 * symtab.c: Moved from gcc/hashtable.c.
4526 * line-map.c: Moved from gcc. Do not include intl.h.
4527 * mkdeps.c: Moved from gcc.
4528 * system.h: New file.
2cf22451
ZW
4529 * include/cpplib.h: Moved from gcc. Change header guard name.
4530 * include/line-map.h: Moved from gcc. Change header guard name.
4531 * include/mkdeps.h: Moved from gcc. Change header guard name.
4532 * include/symtab.h: Moved from gcc/hashtable.h. Change header
4533 guard name.
818ab71a
JJ
4534\f
4535Copyright (C) 2004-2016 Free Software Foundation, Inc.
4536
4537Copying and distribution of this file, with or without modification,
4538are permitted in any medium without royalty provided the copyright
4539notice and this notice are preserved.