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