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