]> git.ipfire.org Git - thirdparty/gcc.git/blame - libcpp/ChangeLog
Daily bump.
[thirdparty/gcc.git] / libcpp / ChangeLog
CommitLineData
c375ef08 12016-10-04 Kelvin Nilsen <kelvin@gcc.gnu.org>
2
3 PR target/77847
4 * lex.c (search_line_fast): Add a FALLTHROUGH comment to correct
5 compiler error in the version of this function that is
6 conditionally compiled when GCC_VERSION >= 4005 and both
7 __ALTIVEC__ and __BIG_ENDIAN__ symbols are defined.
8
3c77f69c 92016-09-26 Marek Polacek <polacek@redhat.com>
10 Jakub Jelinek <jakub@redhat.com>
11
12 PR c/7652
13 * include/cpplib.h (PREV_FALLTHROUGH): Define.
14 * internal.h (CPP_FALLTHRU): Define.
15 * lex.c (fallthrough_comment_p): New function.
16 (_cpp_lex_direct): Set PREV_FALLTHROUGH on tokens succeeding a falls
17 through comment.
18
7413e757 192016-09-23 David Malcolm <dmalcolm@redhat.com>
20
21 PR preprocessor/77672
22 * charset.c (cpp_interpret_string_1): Add a source_range for the
23 NUL-terminator, using the location of the trailing quote of the
24 final string.
25
e496fd6f 262016-09-21 Jason Merrill <jason@redhat.com>
27
28 * line-map.c (linemap_location_from_macro_definition_p): New.
29 * line-map.h: Declare it.
30
d9020fe6 312016-09-15 David Malcolm <dmalcolm@redhat.com>
32
33 * include/line-map.h (class rich_location): Note that newlines
34 aren't supported in fix-it text.
35 * line-map.c (rich_location::add_fixit_insert_before): Reject
36 attempts to add fix-its containing newlines.
37 (rich_location::add_fixit_replace): Likewise.
38
68ef907c 392016-09-13 David Malcolm <dmalcolm@redhat.com>
40
41 * include/line-map.h (class rich_location): Add description of
42 fix-it hints to leading comment.
43 (rich_location::add_fixit_insert): Rename both overloaded methods
44 to..
45 (rich_location::add_fixit_insert_before): ...this, updating their
46 comments.
47 (rich_location::add_fixit_insert_after): Two new overloaded
48 methods.
49 (rich_location::stop_supporting_fixits): New method.
50 * line-map.c (rich_location::add_fixit_insert): Rename both
51 overloaded methods to..
52 (rich_location::add_fixit_insert_before): ...this, updating their
53 comments.
54 (rich_location::add_fixit_insert_after): Two new methods.
55 (rich_location::reject_impossible_fixit): Split out
56 failure-handling into...
57 (rich_location::stop_supporting_fixits): New method.
58
fe066ce3 592016-09-02 David Malcolm <dmalcolm@redhat.com>
60
61 * include/line-map.h (rich_location::seen_impossible_fixit_p): New
62 accessor.
63
70017c99 642016-08-31 David Malcolm <dmalcolm@redhat.com>
65
66 * include/line-map.h (class fixit_remove): Remove stray decl.
67 (fixit_hint::affects_line_p): Make const.
68 (fixit_insert::affects_line_p): Likewise.
69 (fixit_replace::affects_line_p): Likewise.
70 * line-map.c (fixit_insert::affects_line_p): Likewise.
71 (fixit_replace::affects_line_p): Likewise.
72
d6dd1b60 732016-08-30 David Malcolm <dmalcolm@redhat.com>
74
75 * include/line-map.h (class semi_embedded_vec): New class.
76 (semi_embedded_vec<T, NUM_EMBEDDED>::semi_embedded_vec): New ctor.
77 (semi_embedded_vec<T, NUM_EMBEDDED>::~semi_embedded_vec): New
78 dtor.
79 (semi_embedded_vec<T, NUM_EMBEDDED>::operator[]): New methods.
80 (semi_embedded_vec<T, NUM_EMBEDDED>::push): New method.
81 (semi_embedded_vec<T, NUM_EMBEDDED>::truncate): New method.
82 (rich_location::get_num_locations): Reimplement in terms of
83 m_ranges.
84 (rich_location::get_range): Make non-inline.
85 (rich_location::get_num_fixit_hints): Reimplement in terms of
86 m_fixit_hints.
87 (rich_location::add_fixit): New function.
88 (rich_location::MAX_RANGES): Rename to...
89 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this.
90 (rich_location::MAX_FIXIT_HINTS): Rename to...
91 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this, and make
92 private.
93 (rich_location::m_num_ranges): Eliminate in favor of...
94 (rich_location::m_ranges): ...this, converting from a fixed-size
95 array to a semi_embedded_vec.
96 (rich_location::m_num_fixit_hints): Eliminate in favor of...
97 (rich_location::m_fixit_hints): ...this, converting from a
98 fixed-size array to a semi_embedded_vec.
99 * line-map.c (rich_location::rich_location): Update for above
100 changes.
101 (rich_location::~rich_location): Likewise.
102 (rich_location::get_loc): Likewise.
103 (rich_location::get_range): New methods.
104 (rich_location::add_range): Update for above changes.
105 (rich_location::set_range): Likewise.
106 (rich_location::add_fixit_insert): Likewise.
107 (rich_location::add_fixit_replace): Likewise.
108 (rich_location::get_last_fixit_hint): Likewise.
109 (rich_location::reject_impossible_fixit): Likewise.
110 (rich_location::add_fixit): New method.
111
850c2009 1122016-08-30 David Malcolm <dmalcolm@redhat.com>
113
114 * include/line-map.h (rich_location::add_fixit_insert): Add
115 comments. Add overload omitting the source_location param.
116 (rich_location::add_fixit_remove): Add comments. Add overloads
117 omitting the range, and accepting a source_location.
118 (rich_location::add_fixit_replace): Likewise.
119 * line-map.c (rich_location::add_fixit_insert): Add comments. Add
120 overload omitting the source_location param.
121 (rich_location::add_fixit_remove): Add comments. Add overloads
122 omitting the range, and accepting a source_location.
123 (rich_location::add_fixit_replace): Likewise.
124
a02b4eae 1252016-08-26 David Malcolm <dmalcolm@redhat.com>
126
127 * include/line-map.h (get_pure_location): New decl.
128 * line-map.c (get_pure_location): Move here, from gcc/input.c, adding
129 a line_maps * param.
130 (rich_location::add_fixit_insert): Call get_pure_location on "where".
131 (rich_location::add_fixit_replace): Call get_pure_location on the
132 end-points.
133
367964fa 1342016-08-26 David Malcolm <dmalcolm@redhat.com>
135
136 * include/line-map.h (rich_location): Eliminate unimplemented
137 constructor based on source_range.
138 (rich_location::get_last_fixit_hint): New method.
139 (rich_location::reject_impossible_fixit): New method.
140 (rich_location): Add fields m_line_table and
141 m_seen_impossible_fixit.
142 (fixit_hint::maybe_append_replace): New pure virtual function.
143 (fixit_insert::maybe_append_replace): New function.
144 (fixit_replace::maybe_append_replace): New function.
145 * line-map.c (rich_location::rich_location): Initialize
146 m_line_table and m_seen_impossible_fixit.
147 (rich_location::add_fixit_insert): Call
148 reject_impossible_fixit and bail out if true.
149 (column_before_p): New function.
150 (rich_location::add_fixit_replace): Call reject_impossible_fixit
151 and bail out if true. Attempt to consolidate with neighboring
152 fixits.
153 (rich_location::get_last_fixit_hint): New method.
154 (rich_location::reject_impossible_fixit): New method.
155 (fixit_insert::maybe_append_replace): New method.
156 (fixit_replace::maybe_append_replace): New method.
157
a59dbf08 1582016-08-23 David Malcolm <dmalcolm@redhat.com>
159
160 * include/line-map.h (source_range::from_locations): New method.
161
73ffb7be 1622016-08-19 David Malcolm <dmalcolm@redhat.com>
163
164 * include/line-map.h (fixit_hint::kind): Delete REPLACE.
165 (class fixit_remove): Delete.
166 * line-map.c (rich_location::add_fixit_remove): Reimplement
167 by calling add_fixit_replace with an empty string.
168 (fixit_remove::fixit_remove): Delete.
169 (fixit_remove::affects_line_p): Delete.
170
82c85aba 1712016-08-19 Joseph Myers <joseph@codesourcery.com>
172
173 PR c/32187
174 * include/cpplib.h (CPP_N_FLOATN, CPP_N_FLOATNX)
175 (CPP_N_WIDTH_FLOATN_NX, CPP_FLOATN_SHIFT, CPP_FLOATN_MAX): New
176 macros.
177 * expr.c (interpret_float_suffix): Handle fN, fNx, FN and FNx
178 suffixes.
179
6d7de609 1802016-08-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
181
182 * expr.c (eval_token): Append "evaluates to 0" to Wundef diagnostic.
183
5c8151fa 1842016-08-18 David Malcolm <dmalcolm@redhat.com>
185
186 * directives.c (directive_names): New array.
187 (_cpp_handle_directive): Offer spelling suggestions for misspelled
188 directives.
189 * errors.c (cpp_diagnostic_at_richloc): New function.
190 (cpp_error_at_richloc): New function.
191 * include/cpplib.h (struct cpp_callbacks): Add field
192 "get_suggestion".
193 (cpp_error_at_richloc): New decl.
194
fa5f704b 1952016-08-18 Marek Polacek <polacek@redhat.com>
196
197 PR c/7652
198 * pch.c (write_macdef): Add CPP_FALLTHRU.
199
e3533433 2002016-08-12 Marek Polacek <polacek@redhat.com>
201
202 PR c/7652
203 * lex.c (search_line_fast): Add FALLTHRU.
204 (_cpp_lex_direct): Likewise.
205 (cpp_token_val_index): Adjust fall through comment.
206 * macro.c (parse_params): Add FALLTHRU.
207 * pch.c (count_defs): Adjust fall through comment.
208 (write_defs): Likewise.
209
67376ed1 2102016-08-06 David Malcolm <dmalcolm@redhat.com>
211
212 PR bootstrap/72823
213 * charset.c (_cpp_valid_ucn): Replace overzealous assert with one
214 that allows for char_range to be non-NULL when loc_reader is NULL.
215
d4166bdc 2162016-08-05 David Malcolm <dmalcolm@redhat.com>
217
218 * charset.c (cpp_substring_ranges::cpp_substring_ranges): New
219 constructor.
220 (cpp_substring_ranges::~cpp_substring_ranges): New destructor.
221 (cpp_substring_ranges::add_range): New method.
222 (cpp_substring_ranges::add_n_ranges): New method.
223 (_cpp_valid_ucn): Add "char_range" and "loc_reader" params; if
224 they are non-NULL, read position information from *loc_reader
225 and update char_range->m_finish accordingly.
226 (convert_ucn): Add "char_range", "loc_reader", and "ranges"
227 params. If loc_reader is non-NULL, read location information from
228 it, and update *ranges accordingly, using char_range.
229 Conditionalize the conversion into tbuf on tbuf being non-NULL.
230 (convert_hex): Likewise, conditionalizing the call to
231 emit_numeric_escape on tbuf.
232 (convert_oct): Likewise.
233 (convert_escape): Add params "loc_reader" and "ranges". If
234 loc_reader is non-NULL, read location information from it, and
235 update *ranges accordingly. Conditionalize the conversion into
236 tbuf on tbuf being non-NULL.
237 (cpp_interpret_string): Rename to...
238 (cpp_interpret_string_1): ...this, adding params "loc_readers" and
239 "out". Use "to" to conditionalize the initialization and usage of
240 "tbuf", such as running the converter. If "loc_readers" is
241 non-NULL, use the instances within it, reading location
242 information from them, and passing them to convert_escape; likewise
243 write to "out" if loc_readers is non-NULL. Check for leading
244 quote and issue an error if it is not present. Update boundary
245 check from "== limit" to ">= limit" to protect against erroneous
246 location values to calls that are not parsing string literals.
247 (cpp_interpret_string): Reimplement in terms to
248 cpp_interpret_string_1.
249 (noop_error_cb): New function.
250 (cpp_interpret_string_ranges): New function.
251 (cpp_string_location_reader::cpp_string_location_reader): New
252 constructor.
253 (cpp_string_location_reader::get_next): New method.
254 * include/cpplib.h (class cpp_string_location_reader): New class.
255 (class cpp_substring_ranges): New class.
256 (cpp_interpret_string_ranges): New prototype.
257 * internal.h (_cpp_valid_ucn): Add params "char_range" and
258 "loc_reader".
259 * lex.c (forms_identifier_p): Pass NULL for new params to
260 _cpp_valid_ucn.
261
5a29175d 2622016-08-01 Andreas Schwab <schwab@suse.de>
263
264 * include/cpplib.h: Fix comment typo.
265
f17776ff 2662016-07-27 David Malcolm <dmalcolm@redhat.com>
267
268 * include/line-map.h (source_location): Fix line numbers in
269 comment.
270
b73690a4 2712016-07-11 David Malcolm <dmalcolm@redhat.com>
272
273 * include/line-map.h (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES):
274 Move here from line-map.c.
275 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
276 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): Move from
277 here to line-map.h.
278 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
279
e557fc7f 2802016-06-22 David Malcolm <dmalcolm@redhat.com>
281
282 * directives.c (do_include_common): Pass on "location" to
283 _cpp_stack_include.
284 * errors.c (cpp_diagnostic): Reimplement in terms of...
285 (cpp_diagnostic_at): New function.
286 (cpp_error_at): New function.
287 (cpp_errno_filename): Add "loc" param and use it by using
288 cpp_error_at rather than cpp_error.
289 * files.c (find_file_in_dir): Add "loc" param and pass it to
290 open_file_failed.
291 (_cpp_find_file): Add "loc" param. Use it to convert calls to
292 cpp_error to cpp_error_at, and pass it to find_file_in_dir and
293 open_file_failed.
294 (read_file_guts): Add "loc" param. Use it to convert calls to
295 cpp_error to cpp_error_at. Pass it to cpp_errno_filename.
296 (read_file): Add "loc" param. Pass it to open_file_failed and
297 read_file_guts.
298 (should_stack_file): Add "loc" param. Pass it to read_file.
299 (_cpp_stack_file): Add "loc" param. Pass it to should_stack_file.
300 (_cpp_stack_include): Add "loc" param. Pass it to
301 _cpp_find_file and _cpp_stack_file.
302 (open_file_failed): Add "loc" param. Pass it to
303 cpp_errno_filename.
304 (_cpp_fake_include): Add 0 as a source_location in call to
305 _cpp_find_file.
306 (_cpp_compare_file_date): Likewise.
307 (cpp_push_include): Likewise for call to _cpp_stack_include.
308 (cpp_push_default_include): Likewise.
309 (_cpp_save_file_entries): Likewise for call to open_file_failed.
310 (_cpp_has_header): Likewise for call to _cpp_find_file.
311 * include/cpplib.h (cpp_errno_filename): Add source_location
312 param.
313 (cpp_error_at): New declaration.
314 * init.c (cpp_read_main_file): Add 0 as a source_location in calls
315 to _cpp_find_file and _cpp_stack_file.
316 * internal.h (_cpp_find_file): Add source_location param.
317 (_cpp_stack_file): Likewise.
318 (_cpp_stack_include): Likewise.
319
6628b04d 3202016-06-22 David Malcolm <dmalcolm@redhat.com>
321
322 * include/line-map.h (fixit_hint::get_start_loc): New pure virtual
323 function.
324 (fixit_hint::maybe_get_end_loc): Likewise.
325 (fixit_insert::get_start_loc): New function, implementing
326 fixit_hint::get_start_loc.
327 (fixit_insert::maybe_get_end_loc): New function, implementing
328 fixit_hint::maybe_get_end_loc.
329 (fixit_remove::get_start_loc): New function, implementing
330 fixit_hint::get_start_loc.
331 (fixit_remove::maybe_get_end_loc): New function, implementing
332 fixit_hint::maybe_get_end_loc.
333 (fixit_replace::get_start_loc): New function, implementing
334 fixit_hint::get_start_loc.
335 (fixit_replace::maybe_get_end_loc): New function, implementing
336 fixit_hint::maybe_get_end_loc.
337
bd08c370 3382016-06-21 John David Anglin <danglin@gcc.gnu.org>
339
340 * line-map.c (location_adhoc_data_update): Use int64_t instead of
341 long long.
342 (get_combined_adhoc_loc): Likewise.
343
dfa5c0d3 3442016-06-01 Eduard Sanou <dhole@openmailbox.org>
345
346 * include/cpplib.h (cpp_callbacks): Add get_source_date_epoch
347 callback.
348 * include/cpplib.h (cpp_init_source_date_epoch): Remove prototype.
349 * init.c (cpp_init_source_date_epoch): Remove function.
350 * init.c (cpp_create_reader): Initialize pfile->source_date_epoch.
351 * internal.h (cpp_reader): Extend comment about source_date_epoch.
352 * macro.c (_cpp_builtin_macro_text): Use get_source_date_epoch
353 callback only once, read pfile->source_date_epoch on future passes.
354 Check that get_source_date_epoch callback is not NULL.
355
f0f7510b 3562016-05-20 Martin Liska <mliska@suse.cz>
357
358 * config.in: Regenerated.
359 * configure: Likewise.
360 * configure.ac: Handle --enable-valgrind-annotations.
361 * lex.c (new_buff): Use ENABLE_VALGRIND_ANNOTATIONS instead
362 of ENABLE_VALGRIND_CHECKING.
363 (_cpp_free_buff): Likewise.
364
e3e8c48c 3652016-04-28 Eduard Sanou <dhole@openmailbox.org>
366 Matthias Klose <doko@debian.org>
367
368 * include/cpplib.h (cpp_init_source_date_epoch): Prototype.
369 * init.c (cpp_init_source_date_epoch): New function.
370 * internal.h: Added source_date_epoch variable to struct
371 cpp_reader to store a reproducible date.
372 * macro.c (_cpp_builtin_macro_text): Set pfile->date timestamp from
373 pfile->source_date_epoch instead of localtime if source_date_epoch is
374 set, to be used for __DATE__ and __TIME__ macros to help reproducible
375 builds.
376
09321e85 3772016-04-13 Bernd Schmidt <bschmidt@redhat.com>
378
379 Patch from Roger Orr <rogero@howzatt.demon.co.uk>
380 PR preprocessor/69650
381 * directives.c (do_linemarker): Reread map after calling
382 cpp_get_token.
383
382ece2d 3842016-04-06 Richard Henderson <rth@redhat.com>
385
386 PR preprocessor/61817
387 PR preprocessor/69391
388 * internal.h (_cpp_builtin_macro_text): Update decl.
389 * macro.c (_cpp_builtin_macro_text): Accept location for __LINE__.
390 (builtin_macro): Accept a second location for __LINE__.
391 (enter_macro_context): Compute both virtual and real expansion
392 locations for the macro.
393
f175ba0f 3942016-03-25 Bernd Schmidt <bschmidt@redhat.com>
395
396 PR lto/69650
397 * directives.c (do_linemarker): Test for file left but not entered
398 here.
399 * line-map.c (linemap_add): Not here.
400
afdde20c 4012016-03-21 Jakub Jelinek <jakub@redhat.com>
402
403 PR target/70296
404 * include/cpplib.h (cpp_fun_like_macro_p): New prototype.
405 * macro.c (cpp_fun_like_macro_p): New function.
406
523f8924 4072016-03-15 Richard Henderson <rth@redhat.com>
408
409 * line-map.c (new_linemap): Make alloc_size a size_t.
410
14c36b14 4112016-03-14 Jason Merrill <jason@redhat.com>
412
413 * expr.c (cpp_classify_number): Hex floats are new in C++1z.
414 * init.c (lang_defaults): Likewise.
415
c24757cf 4162016-03-09 David Malcolm <dmalcolm@redhat.com>
417
418 PR c/68473
419 PR c++/70105
420 * line-map.c (linemap_macro_map_loc_unwind_toward_spelling): Move
421 decl...
422 * include/line-map.h
423 (linemap_macro_map_loc_unwind_toward_spelling): ...here,
424 converting from static to extern.
425
83108969 4262016-03-09 David Malcolm <dmalcolm@redhat.com>
427
428 PR c/68473
429 PR c++/70105
430 * include/line-map.h (source_range::debug): Delete.
431 (struct location_range): Update comment. Replace
432 expanded_location fields "m_start", "m_finish", and "m_caret" with
433 a source_location field: "m_loc".
434 (class rich_location): Reword comment.
435 (rich_location::get_loc): Reimplement in terms of a new overloaded
436 variant which takes an unsigned int.
437 (rich_location::get_loc_addr): Delete.
438 (rich_location::add_range): Drop params "start" and "finish" in
439 favor of param "loc". Drop overloaded variants taking a
440 source_range or location_range *.
441 (rich_location::lazily_expand_location): Delete in favor of...
442 (rich_location::get_expanded_location): New decl.
443 (rich_location::m_loc): Delete field.
444 (rich_location::m_column_override): New field.
445 * line-map.c (rich_location::rich_location): Drop name of
446 line_maps * param. Update initializations for deletion of field
447 "m_loc" and addition of field "m_column_override". Reimplement
448 body as a call to add_range. Delete overloaded variant taking a
449 source_range.
450 (rich_location::get_loc): New function.
451 (rich_location::lazily_expand_location): Delete in favor of...
452 (rich_location::get_expanded_location): New function.
453 (rich_location::override_column): Reimplement.
454 (rich_location::add_range): Drop params "start" and "finish" in
455 favor of param "loc". Eliminate location expansion in favor of
456 simply storing loc. Drop overloaded variants taking a
457 source_range or location_range *.
458 (rich_location::set_range): Eliminate location expansion.
459
1ed1f69a 4602016-02-29 David Malcolm <dmalcolm@redhat.com>
461
462 PR preprocessor/69985
463 (linemap_position_for_loc_and_offset): Rename param from "offset"
464 to "column_offset". Right-shift the column_offset by m_range_bits
465 of the pertinent ordinary map whenever offsetting a
466 source_location. For clarity, offset the column by the column
467 offset, rather than the other way around.
468
52609ec3 4692016-02-23 David Malcolm <dmalcolm@redhat.com>
470
471 PR preprocessor/69126
472 PR preprocessor/69543
473 * line-map.c (linemap_compare_locations): At the function top,
474 replace inlined bodies of get_location_from_adhoc_loc with calls
475 to get_location_from_adhoc_loc. Add a pair of calls to
476 get_location_from_adhoc_loc at the bottom of the function, to
477 avoid meaningless comparisons of ad-hoc and non-ad-hoc locations.
478
86e0b129 4792016-02-08 David Malcolm <dmalcolm@redhat.com>
480
481 PR preprocessor/69664
482 * errors.c (cpp_diagnostic_with_line): Only call
483 rich_location::override_column if the column is non-zero.
484 * line-map.c (rich_location::override_column): Update columns
485 within m_ranges[0]. Add assertions to verify that doing so is
486 sane.
487
1e302465 4882016-02-05 Jakub Jelinek <jakub@redhat.com>
489
490 PR c++/69628
491 * charset.c (cpp_interpret_charconst): Clear *PCHARS_SEEN
492 and *UNSIGNEDP if bailing out early due to errors.
493
1e6115dd 4942016-01-28 Jakub Jelinek <jakub@redhat.com>
495
9cd9799e 496 PR pch/68176
497 * files.c (_cpp_find_file): Set file->implicit_preinclude even if
498 included from file->implicit_preinclude header.
499
1e6115dd 500 * directives.c (destringize_and_run): Adjust prototype.
501
eec96426 5022016-01-27 David Malcolm <dmalcolm@redhat.com>
503
504 PR preprocessor/69126
505 * directives.c (destringize_and_run): Add expansion_loc param; use
506 it when handling unexpanded pragmas to fixup the locations of the
507 synthesized tokens.
508 (_cpp_do__Pragma): Add expansion_loc param and use it when calling
509 destringize_and_run.
510 * internal.h (_cpp_do__Pragma): Add expansion_loc param.
511 * macro.c (builtin_macro): Pass expansion location of _Pragma to
512 _cpp_do__Pragma.
513
a7ed4583 5142016-01-14 David Malcolm <dmalcolm@redhat.com>
515
516 PR preprocessor/69177
517 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): New
518 constant.
519 (LINE_MAP_MAX_LOCATION_WITH_COLS): Add note about unit tests
520 to comment.
521 (can_be_stored_compactly_p): Reduce threshold from
522 LINE_MAP_MAX_LOCATION_WITH_COLS to
523 LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES.
524 (get_combined_adhoc_loc): Likewise.
525 (get_range_from_loc): Likewise.
526 (linemap_line_start): Ensure that a new ordinary map is created
527 when transitioning from range-packing being enabled to disabled,
528 at the LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES threshold. Set
529 range_bits to 0 for new ordinary maps when beyond this limit.
530 Prevent the "increase the column bits of a freshly created map"
531 optimization if the range bits has reduced.
532
5d034e37 5332016-01-08 Jakub Jelinek <jakub@redhat.com>
534
535 PR c++/69145
536 * files.c (cpp_included_before): If IS_ADHOC_LOC (location), lookup
537 real location from the line_table.
538
f1717362 5392016-01-04 Jakub Jelinek <jakub@redhat.com>
540
541 Update copyright years.
542
7b4b11d3 5432015-12-22 David Malcolm <dmalcolm@redhat.com>
544
545 * line-map.c (get_combined_adhoc_loc): Remove condition
546 on locus < RESERVED_LOCATION_COUNT when considering
547 whether a caret == start == finish location can be
548 simply stored as the caret location.
549
d0f713f4 5502015-12-07 David Malcolm <dmalcolm@redhat.com>
551
552 * include/line-map.h (rich_location::set_range): Add line_maps *
553 param; convert param from source_range to source_location. Drop
554 "overwrite_loc_p" param.
555 * line-map.c (rich_location::set_range): Likewise, acting as if
556 "overwrite_loc_p" were true, and getting range from the location.
557
734caf84 5582015-11-20 David Malcolm <dmalcolm@redhat.com>
559
560 PR 62314
561 * include/line-map.h (source_range::intersects_line_p): New
562 method.
563 (rich_location::~rich_location): New.
564 (rich_location::add_fixit_insert): New method.
565 (rich_location::add_fixit_remove): New method.
566 (rich_location::add_fixit_replace): New method.
567 (rich_location::get_num_fixit_hints): New accessor.
568 (rich_location::get_fixit_hint): New accessor.
569 (rich_location::MAX_FIXIT_HINTS): New constant.
570 (rich_location::m_num_fixit_hints): New field.
571 (rich_location::m_fixit_hints): New field.
572 (class fixit_hint): New class.
573 (class fixit_insert): New class.
574 (class fixit_remove): New class.
575 (class fixit_replace): New class.
576 * line-map.c (source_range::intersects_line_p): New method.
577 (rich_location::rich_location): Add initialization of
578 m_num_fixit_hints to both ctors.
579 (rich_location::~rich_location): New.
580 (rich_location::add_fixit_insert): New method.
581 (rich_location::add_fixit_remove): New method.
582 (rich_location::add_fixit_replace): New method.
583 (fixit_insert::fixit_insert): New.
584 (fixit_insert::~fixit_insert): New.
585 (fixit_insert::affects_line_p): New.
586 (fixit_remove::fixit_remove): New.
587 (fixit_remove::affects_line_p): New.
588 (fixit_replace::fixit_replace): New.
589 (fixit_replace::~fixit_replace): New.
590 (fixit_replace::affects_line_p): New.
591
55d11fae 5922015-11-19 Jakub Jelinek <jakub@redhat.com>
593
594 PR preprocessor/60736
595 * include/cpplib.h (cpp_errno_filename): New prototype.
596 * errors.c (cpp_errno): Don't handle msgid "" specially, use
597 _(msgid) instead of msgid as argument to cpp_error.
598 (cpp_errno_filename): New function.
599 * files.c (read_file_guts): Use cpp_errno_filename instead of
600 cpp_errno.
601 (open_file_failed): Likewise. Use file->name if file->path is NULL
602 in diagnostics.
603
a96cefb2 6042015-11-13 David Malcolm <dmalcolm@redhat.com>
605
606 * errors.c (cpp_diagnostic): Pass pfile->line_table to
607 rich_location ctor.
608 (cpp_diagnostic_with_line): Likewise.
609 * include/cpplib.h (struct cpp_token): Update comment for src_loc
610 to indicate that the range of the token is "baked into" the
611 source_location.
612 * include/line-map.h (source_location): Update the descriptive
613 comment to reflect the packing scheme for short ranges, adding
614 worked examples of location encoding.
615 (struct line_map_ordinary): Drop field "column_bits" in favor
616 of field "m_column_and_range_bits"; add field "m_range_bits".
617 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
618 (location_adhoc_data): Add source_range field.
619 (struct line_maps): Add fields "default_range_bits",
620 "num_optimized_ranges" and "num_unoptimized_ranges".
621 (get_combined_adhoc_loc): Add source_range param.
622 (get_range_from_loc): New declaration.
623 (pure_location_p): New prototype.
624 (COMBINE_LOCATION_DATA): Add source_range param.
625 (SOURCE_LINE): Update for renaming of column_bits.
626 (SOURCE_COLUMN): Likewise. Shift the column right by the map's
627 range_bits.
628 (LAST_SOURCE_LINE_LOCATION): Update for renaming of column_bits.
629 (linemap_position_for_line_and_column): Add line_maps * params.
630 (rich_location::rich_location): Likewise.
631 * lex.c (_cpp_lex_direct): Capture the range of the token, baking
632 it into token->src_loc via a call to COMBINE_LOCATION_DATA.
633 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): Reduce from 1U << 17 to
634 1U << 12.
635 (location_adhoc_data_hash): Add the src_range into
636 the hash value.
637 (location_adhoc_data_eq): Require equality of the src_range
638 values.
639 (can_be_stored_compactly_p): New function.
640 (get_combined_adhoc_loc): Add src_range param, and store it,
641 via a bit-packing scheme for short ranges, otherwise within the
642 lookaside table. Remove the requirement that data is non-NULL.
643 (get_range_from_adhoc_loc): New function.
644 (get_range_from_loc): New function.
645 (pure_location_p): New function.
646 (linemap_add): Ensure that start_location has zero for the
647 range_bits, unless we're past LINE_MAP_MAX_LOCATION_WITH_COLS.
648 Initialize range_bits to zero. Assert that the start_location
649 is "pure".
650 (linemap_line_start): Assert that the
651 column_and_range_bits >= range_bits.
652 Update determinination of whether we need to start a new map
653 using the effective column bits, without the range bits.
654 Use the set's default_range_bits in new maps, apart from
655 those with column_bits == 0, which should also have 0 range_bits.
656 Increase the column bits for new maps by the range bits.
657 When adding lines to an existing map, use set->highest_line
658 directly rather than offsetting highest by SOURCE_COLUMN.
659 Add assertions to sanity-check the return value.
660 (linemap_position_for_column): Offset to_column by range_bits.
661 Update set->highest_location if necessary.
662 (linemap_position_for_line_and_column): Add line_maps * param.
663 Update the calculation to offset the column by range_bits, and
664 conditionalize it on being <= LINE_MAP_MAX_LOCATION_WITH_COLS.
665 Bound it by LINEMAPS_MACRO_LOWEST_LOCATION. Update
666 set->highest_location if necessary.
667 (linemap_position_for_loc_and_offset): Handle ad-hoc locations;
668 pass "set" to linemap_position_for_line_and_column.
669 (linemap_macro_map_loc_unwind_toward_spelling): Add line_maps
670 param. Handle ad-hoc locations.
671 (linemap_location_in_system_header_p): Pass on "set" to call to
672 linemap_macro_map_loc_unwind_toward_spelling.
673 (linemap_macro_loc_to_spelling_point): Retain ad-hoc locations.
674 Pass on "set" to call to
675 linemap_macro_map_loc_unwind_toward_spelling.
676 (linemap_resolve_location): Retain ad-hoc locations. Pass on
677 "set" to call to linemap_macro_map_loc_unwind_toward_spelling.
678 (linemap_unwind_toward_expansion): Pass on "set" to call to
679 linemap_macro_map_loc_unwind_toward_spelling.
680 (linemap_expand_location): Extract the data pointer before
681 extracting the location.
682 (rich_location::rich_location): Add line_maps param; use it to
683 extract the range from the source_location.
684 * location-example.txt: Regenerate, showing new representation.
685
f0479000 6862015-11-06 David Malcolm <dmalcolm@redhat.com>
687
688 * errors.c (cpp_diagnostic): Update for change in signature
689 of "error" callback.
690 (cpp_diagnostic_with_line): Likewise, calling override_column
691 on the rich_location.
692 * include/cpplib.h (struct cpp_callbacks): Within "error"
693 callback, convert param from source_location to rich_location *,
694 and drop column_override param.
695 * include/line-map.h (struct source_range): New struct.
696 (struct location_range): New struct.
697 (class rich_location): New class.
698 (linemap_client_expand_location_to_spelling_point): New declaration.
699 * line-map.c (rich_location::rich_location): New ctors.
700 (rich_location::lazily_expand_location): New method.
701 (rich_location::override_column): New method.
702 (rich_location::add_range): New methods.
703 (rich_location::set_range): New method.
704
0ffb4474 7052015-11-06 David Malcolm <dmalcolm@redhat.com>
706
707 * include/line-map.h (struct linemap_stats): Add fields
708 "adhoc_table_size" and "adhoc_table_entries_used".
709 * line-map.c (linemap_get_statistics): Populate above fields.
710
29134d13 7112015-11-04 Mikhail Maltsev <maltsevm@gmail.com>
712
713 * config.in: Regenerate.
714 * configure: Regenerate.
715 * configure.ac: Remove ENABLE_CHECKING.
716
71e4c29d 7172015-11-03 Uros Bizjak <ubizjak@gmail.com>
718
719 * lex.c (search_line_sse42): Correctly advance the pointer to an
720 aligned address.
721
988403a9 7222015-11-02 David Malcolm <dmalcolm@redhat.com>
723
724 * include/line-map.h (source_location): In the table in the
725 descriptive comment, show UNKNOWN_LOCATION, BUILTINS_LOCATION,
726 LINE_MAP_MAX_LOCATION_WITH_COLS, LINE_MAP_MAX_SOURCE_LOCATION.
727 Add notes about ad-hoc values.
728
92a110bb 7292015-10-21 Mikhail Maltsev <maltsevm@gmail.com>
730
cfec10de 731 * include/line-map.h: Use CHECKING_P instead of ENABLE_CHECKING.
732 * init.c: Likewise.
733 * macro.c (struct macro_arg_token_iter, set_arg_token,
734 macro_arg_token_iter_init, macro_arg_token_iter_forward,
735 macro_arg_token_iter_get_token, macro_arg_token_iter_get_location,
736 alloc_expanded_arg_mem, _cpp_backup_tokens): Likewise.
737
92a110bb 738 * config.in: Regenerate.
739 * configure: Regenerate.
740 * configure.ac (CHECKING_P): Define.
741 * system.h (fancy_abort): Declare.
742 (abort): Define.
743 (gcc_assert): Define. Use CHECKING_P.
744
4fb48515 7452015-10-13 Mikhail Maltsev <maltsevm@gmail.com>
746
747 * system.h (CHECKING_P, gcc_checking_assert): Define.
748
3cff347a 7492015-09-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
750
751 PR c/66415
752 * line-map.c (linemap_position_for_loc_and_offset): Handle the
753 case of long lines encoded in multiple maps.
754
8df4088d 7552015-09-07 Marek Polacek <polacek@redhat.com>
756
757 * system.h (INTTYPE_MINIMUM): Rewrite to avoid shift warning.
758
29890f2e 7592015-08-06 Yaakov Selkowitz <yselkowi@redhat.com>
760
761 * configure: Regenerate.
762
a5ea4da3 7632015-07-08 Thomas Schwinge <thomas@codesourcery.com>
764
765 * include/line-map.h (RESERVED_LOCATION_COUNT): Change type to
766 source_location.
767
880e4baa 7682015-07-02 Paolo Carlini <paolo.carlini@oracle.com>
769
7c35064e 770 PR preprocessor/53690
880e4baa 771 * charset.c (_cpp_valid_ucn): Add cppchar_t * parameter and change
772 return type to bool. Fix encoding of \u0000 and \U00000000 in C++.
773 (convert_ucn): Adjust call.
774 * lex.c (forms_identifier_p): Likewise.
775 * internal.h (_cpp_valid_ucn): Adjust declaration.
776
30b1ba42 7772015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
778
779 Implement N4197 - Adding u8 character literals
780 * include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens;
781 (struct cpp_options): Add utf8_char_literals.
782 * init.c (struct lang_flags): Add utf8_char_literals;
783 (struct lang_flags lang_defaults): Add column for utf8_char_literals.
880e4baa 784 * macro.c (stringify_arg()): Treat CPP_UTF8CHAR token;
30b1ba42 785 * expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()):
786 Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens;
787 (cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token;
788 (eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token.
789 * lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens.
790 * charset.c (converter_for_type(), cpp_interpret_charconst()):
791 Treat CPP_UTF8CHAR token.
792
5ac78bd3 7932015-06-30 Uros Bizjak <ubizjak@gmail.com>
794
795 * lex.c (search_line_sse42) [__GCC_ASM_FLAG_OUTPUTS__]: New main
796 loop using asm flag outputs.
797
6e84ccad 7982015-06-08 Marek Polacek <polacek@redhat.com>
799
800 PR c/66415
801 * line-map.c (linemap_position_for_loc_and_offset): Remove
802 linemap_assert_fails; reverse conditions.
803
0d344d27 8042015-05-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
805
806 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER
807 LINE_MAP_MAX_LOCATION_WITH_COLS,LINE_MAP_MAX_SOURCE_LOCATION):
808 New constants.
809 (linemap_line_start): Use them.
810 (linemap_position_for_column): Use them.
811
3ce1a212 8122015-05-20 David Malcolm <dmalcolm@redhat.com>
813
814 * include/line-map.h (MAP_START_LOCATION): Eliminate the non-const
815 variant, and tweak comment for the const variant.
816 (ORDINARY_MAP_STARTING_LINE_NUMBER): Drop the non-const variant.
817 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
818 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
819 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
820 (ORDINARY_MAP_FILE_NAME): Drop the non-const variant.
821 (MACRO_MAP_MACRO): Likewise.
822 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
823 (MACRO_MAP_LOCATIONS): Likewise.
824 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
825 * line-map.c (linemap_add): Replace writes through macros with
826 direct field accesses.
827 (linemap_enter_macro): Likewise.
828 (linemap_line_start): Likewise.
829
551e34da 8302015-05-19 David Malcolm <dmalcolm@redhat.com>
831
832 * directives.c (do_line): Strengthen local "map" from
833 const line_map * to const line_map_ordinary *.
834 (do_linemarker): Likewise.
835 (_cpp_do_file_change): Assert that we're not dealing with
836 a macro map. Introduce local "ord_map" via a call to
837 linemap_check_ordinary, guarded within the check for
838 non-NULL. Use it for typesafety.
839 * files.c (cpp_make_system_header): Strengthen local "map" from
840 const line_map * to const line_map_ordinary *.
841 * include/cpplib.h (struct cpp_callbacks): Likewise for second
842 parameter of "file_change" callback.
843 * include/line-map.h (struct line_map): Convert from a struct
844 containing a union to a base class.
845 (struct line_map_ordinary): Convert to a subclass of line_map.
846 (struct line_map_macro): Likewise.
847 (linemap_check_ordinary): Strengthen return type from line_map *
848 to line_map_ordinary *, and add a const-variant.
849 (linemap_check_macro): New pair of functions.
850 (ORDINARY_MAP_STARTING_LINE_NUMBER): Strengthen param from
851 const line_map * to const line_map_ordinary *, eliminating call
852 to linemap_check_ordinary. Likewise for the non-const variant.
853 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
854 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
855 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Likewise.
856 (ORDINARY_MAP_FILE_NAME): Likewise.
857 (MACRO_MAP_MACRO): Strengthen param from const line_map * to
858 const line_map_macro *. Likewise for the non-const variant.
859 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
860 (MACRO_MAP_LOCATIONS): Likewise.
861 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
862 (struct maps_info): Replace with...
863 (struct maps_info_ordinary):...this and...
864 (struct maps_info_macro): ...this.
865 (struct line_maps): Convert fields "info_ordinary" and
866 "info_macro" to the above new structs.
867 (LINEMAPS_MAP_INFO): Delete both functions.
868 (LINEMAPS_MAPS): Likewise.
869 (LINEMAPS_ALLOCATED): Rewrite both variants to avoid using
870 LINEMAPS_MAP_INFO.
871 (LINEMAPS_USED): Likewise.
872 (LINEMAPS_CACHE): Likewise.
873 (LINEMAPS_MAP_AT): Likewise.
874 (LINEMAPS_ORDINARY_MAPS): Strengthen return type from line_map *
875 to line_map_ordinary *.
876 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
877 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
878 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
879 (LINEMAPS_MACRO_MAPS): Strengthen return type from line_map * to
880 line_map_macro *.
881 (LINEMAPS_MACRO_MAP_AT): Likewise.
882 (LINEMAPS_LAST_MACRO_MAP): Likewise.
883 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
884 (linemap_map_get_macro_name): Strengthen param from
885 const line_map * to const line_map_macro *.
886 (SOURCE_LINE): Strengthen first param from const line_map * to
887 const line_map_ordinary *, removing call to
888 linemap_check_ordinary.
889 (SOURCE_COLUMN): Likewise.
890 (LAST_SOURCE_LINE_LOCATION): Likewise.
891 (LAST_SOURCE_LINE): Strengthen first param from const line_map *
892 to const line_map_ordinary *.
893 (LAST_SOURCE_COLUMN): Likewise.
894 (INCLUDED_FROM): Strengthen return type from line_map * to
895 line_map_ordinary *., and second param from const line_map *
896 to const line_map_ordinary *, removing call to
897 linemap_check_ordinary.
898 (MAIN_FILE_P): Strengthen param from const line_map * to
899 const line_map_ordinary *, removing call to
900 linemap_check_ordinary.
901 (linemap_position_for_line_and_column): Strengthen param from
902 const line_map * to const line_map_ordinary *.
903 (LINEMAP_FILE): Strengthen param from const line_map * to
904 const line_map_ordinary *, removing call to
905 linemap_check_ordinary.
906 (LINEMAP_LINE): Likewise.
907 (LINEMAP_SYSP): Likewise.
908 (linemap_resolve_location): Strengthen final param from
909 const line_map ** to const line_map_ordinary **.
910 * internal.h (CPP_INCREMENT_LINE): Likewise for local "map".
911 (linemap_enter_macro): Strengthen return type from
912 const line_map * to const line_map_macro *.
913 (linemap_add_macro_token): Likewise for first param.
914 * line-map.c (linemap_check_files_exited): Strengthen local "map"
915 from const line_map * to const line_map_ordinary *.
916 (new_linemap): Introduce local "map_size" and use it when
917 calculating how large the buffer should be. Rewrite based
918 on change of info_macro and info_ordinary into distinct types.
919 (linemap_add): Strengthen locals "map" and "from" from line_map *
920 to line_map_ordinary *.
921 (linemap_enter_macro): Strengthen return type from
922 const line_map * to const line_map_macro *, and local "map" from
923 line_map * to line_map_macro *.
924 (linemap_add_macro_token): Strengthen param "map" from
925 const line_map * to const line_map_macro *.
926 (linemap_line_start): Strengthen local "map" from line_map * to
927 line_map_ordinary *.
928 (linemap_position_for_column): Likewise.
929 (linemap_position_for_line_and_column): Strengthen first param
930 from const line_map * to const line_map_ordinary *.
931 (linemap_position_for_loc_and_offset): Strengthen local "map" from
932 const line_map * to const line_map_ordinary *.
933 (linemap_ordinary_map_lookup): Likewise for return type and locals
934 "cached" and "result".
935 (linemap_macro_map_lookup): Strengthen return type and locals
936 "cached" and "result" from const line_map * to
937 const line_map_macro *.
938 (linemap_macro_map_loc_to_exp_point): Likewise for param "map".
939 (linemap_macro_map_loc_to_def_point): Likewise.
940 (linemap_macro_map_loc_unwind_toward_spelling): Likewise.
941 (linemap_get_expansion_line): Strengthen local "map" from
942 const line_map * to const line_map_ordinary *.
943 (linemap_get_expansion_filename): Likewise.
944 (linemap_map_get_macro_name): Strengthen param from
945 const line_map * to const line_map_macro *.
946 (linemap_location_in_system_header_p): Add call to
947 linemap_check_ordinary in region guarded by
948 !linemap_macro_expansion_map_p. Introduce local "macro_map" via
949 linemap_check_macro in other region, using it in place of "map"
950 for typesafety.
951 (first_map_in_common_1): Add calls to linemap_check_macro.
952 (trace_include): Strengthen param "map" from const line_map * to
953 const line_map_ordinary *.
954 (linemap_macro_loc_to_spelling_point): Strengthen final param from
955 const line_map ** to const line_map_ordinary **. Replace a
956 C-style cast with a const_cast, and add calls to
957 linemap_check_macro and linemap_check_ordinary.
958 (linemap_macro_loc_to_def_point): Likewise.
959 (linemap_macro_loc_to_exp_point): Likewise.
960 (linemap_resolve_location): Strengthen final param from
961 const line_map ** to const line_map_ordinary **.
962 (linemap_unwind_toward_expansion): Introduce local "macro_map" via
963 a checked cast and use it in place of *map.
964 (linemap_unwind_to_first_non_reserved_loc): Strengthen local
965 "map1" from const line_map * to const line_map_ordinary *.
966 (linemap_expand_location): Introduce local "ord_map" via a checked
967 cast and use it in place of map.
968 (linemap_dump): Make local "map" const. Strengthen local
969 "includer_map" from line_map * to const line_map_ordinary *.
970 Introduce locals "ord_map" and "macro_map" via checked casts and
971 use them in place of "map" for typesafety.
972 (linemap_dump_location): Strengthen local "map" from
973 const line_map * to const line_map_ordinary *.
974 (linemap_get_file_highest_location): Update for elimination of
975 union.
976 (linemap_get_statistics): Strengthen local "cur_map" from
977 line_map * to const line_map_macro *. Update uses of sizeof to
978 use the appropriate line_map subclasses.
979 * macro.c (_cpp_warn_if_unused_macro): Add call to
980 linemap_check_ordinary.
981 (builtin_macro): Strengthen local "map" from const line_map * to
982 const line_map_macro *.
983 (enter_macro_context): Likewise.
984 (replace_args): Likewise.
985 (tokens_buff_put_token_to): Likewise for param "map".
986 (tokens_buff_add_token): Likewise.
987
28f17529 9882015-05-13 David Malcolm <dmalcolm@redhat.com>
989
990 * include/line-map.h (source_location): Add a reference to
991 location-example.txt to the descriptive comment.
992 * location-example.txt: New file.
993
aa041196 9942015-05-13 David Malcolm <dmalcolm@redhat.com>
995
996 * include/line-map.h (MAX_SOURCE_LOCATION): Convert from a macro
997 to a const source_location.
998 (RESERVED_LOCATION_COUNT): Likewise.
999 (linemap_check_ordinary): Convert from a macro to a pair of inline
1000 functions, for const/non-const arguments.
1001 (MAP_START_LOCATION): Likewise.
1002 (ORDINARY_MAP_STARTING_LINE_NUMBER): Likewise.
1003 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
1004 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
1005 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Convert from a macro to a
1006 pair of inline functions, for const/non-const arguments, where the
1007 latter is named...
1008 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): New function.
1009 (ORDINARY_MAP_FILE_NAME): Convert from a macro to a pair of inline
1010 functions, for const/non-const arguments.
1011 (MACRO_MAP_MACRO): Likewise.
1012 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
1013 (MACRO_MAP_LOCATIONS): Likewise.
1014 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
1015 (LINEMAPS_MAP_INFO): Likewise.
1016 (LINEMAPS_MAPS): Likewise.
1017 (LINEMAPS_ALLOCATED): Likewise.
1018 (LINEMAPS_USED): Likewise.
1019 (LINEMAPS_CACHE): Likewise.
1020 (LINEMAPS_ORDINARY_CACHE): Likewise.
1021 (LINEMAPS_MACRO_CACHE): Likewise.
1022 (LINEMAPS_MAP_AT): Convert from a macro to an inline function.
1023 (LINEMAPS_LAST_MAP): Likewise.
1024 (LINEMAPS_LAST_ALLOCATED_MAP): Likewise.
1025 (LINEMAPS_ORDINARY_MAPS): Likewise.
1026 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
1027 (LINEMAPS_ORDINARY_ALLOCATED): Likewise.
1028 (LINEMAPS_ORDINARY_USED): Likewise.
1029 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
1030 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
1031 (LINEMAPS_MACRO_MAPS): Likewise.
1032 (LINEMAPS_MACRO_MAP_AT): Likewise.
1033 (LINEMAPS_MACRO_ALLOCATED): Likewise.
1034 (LINEMAPS_MACRO_USED): Likewise.
1035 (LINEMAPS_MACRO_LOWEST_LOCATION): Likewise.
1036 (LINEMAPS_LAST_MACRO_MAP): Likewise.
1037 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
1038 (IS_ADHOC_LOC): Likewise.
1039 (COMBINE_LOCATION_DATA): Likewise.
1040 (SOURCE_LINE): Likewise.
1041 (SOURCE_COLUMN): Likewise.
1042 (LAST_SOURCE_LINE_LOCATION): Likewise.
1043 (LAST_SOURCE_LINE): Likewise.
1044 (LAST_SOURCE_COLUMN): Likewise.
1045 (LAST_SOURCE_LINE_LOCATION)
1046 (INCLUDED_FROM): Likewise.
1047 (MAIN_FILE_P): Likewise.
1048 (LINEMAP_FILE): Likewise.
1049 (LINEMAP_LINE): Likewise.
1050 (LINEMAP_SYSP): Likewise.
1051 (linemap_location_before_p): Likewise.
1052 * line-map.c (linemap_check_files_exited): Make local "map" const.
1053 (linemap_add): Use SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS.
1054 (linemap_line_start): Likewise.
1055
1a20ca67 10562015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
1057
1058 * aclocal.m4: Regenerated with automake-1.11.6.
1059
c43181ff 10602015-05-13 David Malcolm <dmalcolm@redhat.com>
1061
1062 * include/line-map.h (linemap_assert): Move up within the file to
1063 before all of the map accessor macros.
1064 (linemap_assert_fails): Likewise.
1065 (linemap_check_ordinary): Likewise.
1066 (linemap_macro_expansion_map_p): Likewise.
1067
e5f01cba 10682015-05-12 David Malcolm <dmalcolm@redhat.com>
1069
1070 * directives.c (do_line): Set seen_line_directive on line_table.
1071 (do_linemarker): Likewise.
1072 * include/line-map.h (struct line_maps): Add new field
1073 "seen_line_directive".
1074
1b03cc89 10752015-05-08 Jason Merrill <jason@redhat.com>
1076
1077 * include/cpplib.h: Add CPP_W_CXX11_COMPAT.
1078 (struct cpp_options): Add cpp_warn_cxx11_compat.
1079 * init.c (cpp_create_reader): Initialize it.
1080 * lex.c (lex_string): Add -Wc++11-compat warning.
1081
5c6f6a61 10822015-05-05 David Malcolm <dmalcolm@redhat.com>
1083
1084 * pch.c (cpp_valid_state): Fix indentation so that it reflects the
1085 block structure.
1086
78536ab7 10872015-05-05 David Malcolm <dmalcolm@redhat.com>
1088
1089 * include/line-map.h: Fix comment at the top of the file.
1090 (source_location): Rewrite and expand the comment for this
1091 typedef, adding an ascii-art table to clarify how source_location
1092 values are allocated.
1093 * line-map.c: Fix comment at the top of the file.
1094
2c8df1f3 10952015-04-09 Richard Biener <rguenther@suse.de>
1096
1097 PR pch/65550
1098 * files.c (pch_open_file): Allow main and pre-included files
1099 when trying to open a PCH.
1100
a0b98841 11012015-04-06 Jakub Jelinek <jakub@redhat.com>
1102
1103 PR preprocessor/61977
1104 * lex.c (cpp_peek_token): If peektok is CPP_EOF, back it up
1105 with all tokens peeked by the current function.
1106
2b130ae8 11072015-04-02 Jakub Jelinek <jakub@redhat.com>
1108
1109 PR preprocessor/61977
1110 * lex.c (cpp_peek_token): Temporarily clear pfile->cb.line_change.
1111
640a5806 11122015-03-23 Jakub Jelinek <jakub@redhat.com>
1113
1114 PR preprocessor/65238
1115 * internal.h (_cpp_scan_out_logical_line): Add third argument.
1116 * directives.c (prepare_directive_trad): Pass false to it.
1117 * traditional.c (_cpp_read_logical_line_trad,
1118 _cpp_create_trad_definition): Likewise.
1119 (struct fun_macro): Add paramc field.
1120 (fun_like_macro): New function.
1121 (maybe_start_funlike): Handle NODE_BUILTIN macros. Initialize
1122 macro->paramc field.
1123 (save_argument): Use macro->paramc instead of
1124 macro->node->value.macro->paramc.
1125 (push_replacement_text): Formatting fix.
1126 (recursive_macro): Use fun_like_macro helper.
1127 (_cpp_scan_out_logical_line): Likewise. Add BUILTIN_MACRO_ARG
1128 argument. Initialize fmacro.paramc field. Handle builtin
1129 function-like macros.
1130
fc753aa0 11312015-03-16 Edward Smith-Rowland <3dw4rd@verizon.net>
1132
1133 PR c++/64626
1134 * lex.c (lex_number): If a number ends with digit-seps (') skip back
1135 and let lex_string take them.
1136
45e87ca9 11372015-03-02 Markus Trippelsdorf <markus@trippelsdorf.de>
1138
1139 PR target/65261
1140 * lex.c (search_line_fast): Silence ubsan errors.
1141
825751e2 11422015-02-03 <dodji@redhat.com>
1143
1144 PR preprocessor/64803
1145 * internal.h (cpp_reader::top_most_macro_node): New data member.
1146 * macro.c (enter_macro_context): Pass the location of the end of
1147 the top-most invocation of the function-like macro, or the
1148 location of the expansion point of the top-most object-like macro.
1149 (cpp_get_token_1): Store the top-most macro node in the new
1150 pfile->top_most_macro_node data member.
1151 (_cpp_pop_context): Clear the new cpp_reader::top_most_macro_node
1152 data member.
1153
c1a66267 11542015-01-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
1155
1156 * lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON.
1157
6ca4fe46 11582015-01-23 Marek Polacek <polacek@redhat.com>
1159
1160 DR#412
1161 PR preprocessor/60570
1162 * directives.c (do_elif): Don't evaluate #elif conditionals
1163 when they don't need to be.
1164
e2de5ff7 11652015-01-16 Jakub Jelinek <jakub@redhat.com>
1166
1167 * expr.c (cpp_classify_number): Add N_() around ?: string
1168 literals used in cpp_error_with_line call as format string.
1169
d353bf18 11702015-01-05 Jakub Jelinek <jakub@redhat.com>
1171
1172 Update copyright years.
1173
33058239 11742014-12-19 Jakub Jelinek <jakub@redhat.com>
1175
1176 PR preprocessor/63831
1177 * directives.c (lex_macro_node): Remove __has_attribute__ handling.
1178 * internal.h (struct spec_node): Remove n__has_attribute__ field.
1179 (struct lexer_state): Remove in__has_attribute__ field.
1180 * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_ATTRIBUTE.
1181 * identifiers.c (_cpp_init_hashtable): Remove __has_attribute__
1182 handling.
1183 * init.c (builtin_array): Add __has_attribute and __has_cpp_attribute.
1184 (cpp_init_special_builtins): Don't initialize __has_attribute
1185 or __has_cpp_attribute if CLK_ASM or pfile->cb.has_attribute is NULL.
1186 * traditional.c (enum ls): Remove ls_has_attribute,
1187 ls_has_attribute_close.
1188 (_cpp_scan_out_logical_line): Remove __has_attribute__ handling.
1189 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_ATTRIBUTE.
1190 * pch.c (cpp_read_state): Remove __has_attribute__ handling.
1191 * expr.c (eval_token): Likewise.
1192 (parse_has_attribute): Removed.
1193
5d95297a 11942014-12-11 Uros Bizjak <ubizjak@gmail.com>
1195
1196 * directives.c (cpp_define_formatted): Use xvasprintf.
1197
6d6bdc28 11982014-12-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
1199
1200 * line-map.c (linemap_position_for_loc_and_offset): Add new
1201 linemap_assert_fails.
1202
324da92d 12032014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
1204
1205 * include/line-map.h (linemap_assert_fails): Declare.
1206 * line-map.c (linemap_position_for_loc_and_offset): Use it.
1207
351855a5 12082014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
1209
71e4c29d 1210 * line-map.c (linemap_add): Fix typo.
1211 (linemap_line_start): Fix whitespace.
351855a5 1212
e6260d89 12132014-11-29 John Schmerge <jbschmerge@gmail.com>
1214
1215 PR preprocessor/41698
1216 * charset.c (one_utf8_to_utf16): Do not produce surrogate pairs
1217 for 0xffff.
1218
1feb1b2d 12192014-11-25 Jakub Jelinek <jakub@redhat.com>
1220
1221 PR preprocessor/60436
1222 * line-map.c (linemap_line_start): If highest is above 0x60000000
1223 and we are still tracking columns or highest is above 0x70000000,
1224 force add_map.
1225
024db613 12262014-11-20 Uros Bizjak <ubizjak@gmail.com>
1227
1228 PR target/63966
c3e56f20 1229 * lex.c [__i386__ || __x86_64__]: Compile special SSE functions
1230 only for (__GNUC__ >= 5 || !defined(__PIC__)).
024db613 1231
36a4e8f0 12322014-11-13 Manuel López-Ibáñez <manu@gcc.gnu.org>
1233
1234 * include/line-map.h: Include EXPR, so that unused variable warnings
1235 do not occur.
1236
766928aa 12372014-11-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
1238
1239 PR fortran/44054
1240 * include/line-map.h (linemap_position_for_loc_and_offset):
1241 Declare.
1242 * line-map.c (linemap_position_for_loc_and_offset): New.
1243
863e76f9 12442014-11-11 David Malcolm <dmalcolm@redhat.com>
1245
1246 * ChangeLog.jit: New.
1247
3aa2fa44 12482014-11-10 Edward Smith-Rowland <3dw4rd@verizon.net>
1249
1250 * include/cpplib.h (cpp_callbacks): Add has_attribute.
1251 * internal.h (lexer_state): Add in__has_attribute__.
1252 * directives.c (lex_macro_node): Prevent use of __has_attribute__
1253 as a macro.
1254 * expr.c (parse_has_attribute): New function; (eval_token): Look for
1255 __has_attribute__ and route to parse_has_attribute.
1256 * identifiers.c (_cpp_init_hashtable): Initialize n__has_attribute__.
1257 * pch.c (cpp_read_state): Initialize n__has_attribute__.
1258 * traditional.c (enum ls): Add ls_has_attribute, ls_has_attribute_close;
1259 (_cpp_scan_out_logical_line): Attend to __has_attribute__.
1260
109ca87a 12612014-11-06 Joseph Myers <joseph@codesourcery.com>
1262
1263 * include/cpp-id-data.h (struct cpp_macro): Update comment
1264 regarding parameters.
1265 * include/cpplib.h (struct cpp_macro_arg, struct cpp_identifier):
1266 Add spelling fields.
1267 (struct cpp_token): Update comment on macro_arg.
1268 * internal.h (_cpp_save_parameter): Add extra argument.
1269 (_cpp_spell_ident_ucns): New declaration.
1270 * lex.c (lex_identifier): Add SPELLING argument. Set *SPELLING to
1271 original spelling of identifier.
1272 (_cpp_lex_direct): Update calls to lex_identifier.
1273 (_cpp_spell_ident_ucns): New function, factored out of
1274 cpp_spell_token.
1275 (cpp_spell_token): Adjust FORSTRING argument semantics to return
1276 original spelling of identifiers. Use _cpp_spell_ident_ucns in
1277 !FORSTRING case.
1278 (_cpp_equiv_tokens): Check spellings of identifiers and macro
1279 arguments are identical.
1280 * macro.c (macro_arg_saved_data): New structure.
1281 (paste_tokens): Use original spellings of identifiers from
1282 cpp_spell_token.
1283 (_cpp_save_parameter): Add argument SPELLING. Save both canonical
1284 node and its value.
1285 (parse_params): Update calls to _cpp_save_parameter.
1286 (lex_expansion_token): Save spelling of macro argument tokens.
1287 (_cpp_create_definition): Extract canonical node from saved data.
1288 (cpp_macro_definition): Use UCNs in spelling of macro name. Use
1289 original spellings of macro argument tokens and identifiers.
1290 * traditional.c (scan_parameters): Update call to
1291 _cpp_save_parameter.
1292
95795723 12932014-11-05 Joseph Myers <joseph@codesourcery.com>
1294
1295 PR preprocessor/9449
1296 * init.c (lang_defaults): Enable extended identifiers for C++ and
1297 C99-based standards.
1298
cc0a8c77 12992014-10-22 Alan Modra <amodra@gmail.com>
1300
1301 * symtab.c (ht_create): Use obstack_specify_allocation in place of
1302 _obstack_begin.
1303 * files.c (_cpp_init_files): Likewise.
1304 * init.c (cpp_create_reader): Likewise.
1305 * identifiers.c (_cpp_init_hashtable): Likewise.
1306
1fcf9669 13072014-10-14 Manuel López-Ibáñez <manu@gcc.gnu.org>
1308
1309 * include/line-map.h (linemap_location_from_macro_expansion_p):
1310 const struct line_maps * argument.
1311 (linemap_position_for_line_and_column): const struct line_map *
1312 argument.
1313 * line-map.c (linemap_add_macro_token): Use correct argument name
1314 in comment.
1315 (linemap_position_for_line_and_column): const struct line_map *
1316 argument.
1317 (linemap_macro_map_loc_to_def_point): Fix comment. Make static.
1318 (linemap_location_from_macro_expansion_p): const struct line_maps *
1319 argument.
1320 (linemap_resolve_location): Fix argument names in comment.
1321
e347736d 13222014-10-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
1323
1324 * lex.c (search_line_fast): Add new version to be used for Power8
1325 and later targets when Altivec is enabled. Restrict the existing
1326 Altivec version to big-endian systems so that lvsr is not used on
1327 little endian, where it is deprecated. Remove LE-specific code
1328 from the now-BE-only version.
1329
3f21cd58 13302014-10-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
1331 Jeff Law <law@redhat.com>
1332
1333 * charset.c (convert_no_conversion): Reallocate memory with 25%
1334 headroom.
1335
f6751ff2 13362014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net>
1337
1338 Implement SD-6: SG10 Feature Test Recommendations
1339 * internal.h (lexer_state, spec_nodes): Add in__has_include__.
1340 * directives.c: Support __has_include__ builtin.
1341 * expr.c (parse_has_include): New function to parse __has_include__
1342 builtin; (eval_token()): Use it.
1343 * files.c (_cpp_has_header()): New funtion to look for header;
1344 (open_file_failed()): Not an error to not find a header file for
1345 __has_include__.
1346 * identifiers.c (_cpp_init_hashtable()): Add entry for __has_include__.
1347 * pch.c (cpp_read_state): Lookup __has_include__.
1348 * traditional.c (enum ls, _cpp_scan_out_logical_line()): Walk through
1349 __has_include__ statements.
1350
2cb897aa 13512014-09-30 Bernd Edlinger <bernd.edlinger@hotmail.de>
1352
1353 PR preprocessor/58893
1354 * errors.c (cpp_diagnostic): Fix possible out of bounds access.
1355 * files.c (_cpp_stack_include): Initialize src_loc for IT_CMDLINE.
1356
5213d6c9 13572014-09-24 Marek Polacek <polacek@redhat.com>
1358
1359 PR c/61405
1360 PR c/53874
1361 * include/cpplib.h (enum cpp_ttype): Define CPP_KEYWORD.
1362
47d6df07 13632014-09-17 Jan Hubicka <hubicka@ucw.cz>
1364
1365 * charset.c (conversion): Rename to ...
1366 (cpp_conversion): ... this one; update.
1367 * files.c (file_hash_entry): Rename to ...
1368 (cpp_file_hash_entry): ... this one ; update.
1369
118b2dc7 13702014-09-17 Marek Polacek <polacek@redhat.com>
1371
1372 PR c/61854
1373 * init.c (struct lang_flags): Remove cplusplus_comments.
1374 (cpp_set_lang): Likewise.
1375 (post_options): Likewise.
1376 * lex.c (_cpp_lex_direct): Disallow C++ style comments in C90/C94.
1377
bcc1f37e 13782014-09-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
1379
1380 * include/cpplib.h (struct cpp_options): Declare warn_normalize as
1381 int instead of enum.
1382
04afd878 13832014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
1384
1385 * macro.c (replace_args): Use cpp_pedwarning, cpp_warning and
1386 CPP_W flags.
1387 * include/cpplib.h: Add CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC.
1388 * init.c (cpp_create_reader): Do not init to -1 here.
1389 * expr.c (num_binary_op): Use cpp_pedwarning.
1390
f0fbe519 13912014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
1392
1393 * directives.c (check_eol_1): New.
1394 (check_eol_endif_labels): New.
1395 (check_eol): Call check_eol_1.
1396 (do_else,do_endif): Call check_eol_endif_labels.
1397
a7d2e480 13982014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
1399
1400 * macro.c (warn_of_redefinition): Suppress warnings for builtins
1401 that lack the NODE_WARN flag, unless Wbuiltin-macro-redefined.
1402 (_cpp_create_definition): Use Wbuiltin-macro-redefined for
1403 builtins that lack the NODE_WARN flag.
1404 * directives.c (do_undef): Likewise.
1405 * init.c (cpp_init_special_builtins): Do not change flags
1406 depending on Wbuiltin-macro-redefined.
1407
2ab4e475 14082014-08-28 Edward Smith-Rowland <3dw4rd@verizon.net>
1409
1410 PR cpp/23827 - standard C++ should not have hex float preprocessor
1411 tokens
1412 * libcpp/init.c (lang_flags): Change CXX98 flag for extended numbers
1413 from 1 to 0.
1414 * libcpp/expr.c (cpp_classify_number): Weite error message for improper
1415 use of hex floating literal.
1416
4e454776 14172014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
1418
1419 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z;
1420 Rename CLK_GNUCXX1Y, CLK_CXX1Y to CLK_GNUCXX14, CLK_CXX14;
1421 * init.c (struct lang_flags lang_defaults): Add column for trigraphs;
1422 Add rows for CLK_GNUCXX1Z, CLK_CXX1Z; (cpp_set_lang): Set trigraphs;
1423 (cpp_init_builtins): Set __cplusplus to 201402L for C++14;
1424 Set __cplusplus to 201500L for C++17.
1425 * expr.c (cpp_classify_number): Change C++1y to C++14 in binary
1426 constants error message.
1427
4c860a45 14282014-08-20 Marek Polacek <polacek@redhat.com>
1429
1430 * include/cpplib.h (cpp_options): Use signed char.
1431 * lex.c (_cpp_lex_direct): Don't warn in C++ mode.
1432
d87a26d9 14332014-08-19 Marek Polacek <polacek@redhat.com>
1434
1435 * lex.c (_cpp_lex_direct): Fix a typo.
1436
806fe15e 14372014-08-19 Marek Polacek <polacek@redhat.com>
1438
1439 * charset.c (_cpp_valid_ucn): Warn only if -Wc90-c99-compat.
1440 * lex.c (_cpp_lex_direct): Likewise.
1441 * macro.c (replace_args): Likewise.
1442 (parse_params): Likewise.
1443 * include/cpplib.h (cpp_options): Change cpp_warn_c90_c99_compat
1444 to char.
1445
890c2e2f 14462014-08-10 Marek Polacek <polacek@redhat.com>
1447
1448 PR c/51849
1449 * lex.c (_cpp_lex_direct): Warn when -Wc90-c99-compat is in effect.
1450 * charset.c (_cpp_valid_ucn): Likewise.
1451 * include/cpplib.h (cpp_options): Add cpp_warn_c90_c99_compat.
1452 * macro.c (replace_args): Warn when -Wc90-c99-compat is in effect.
1453 (parse_params): Likewise.
1454
2e82cf2c 14552014-07-27 Marek Polacek <polacek@redhat.com>
1456
1457 PR c/61861
1458 * macro.c (builtin_macro): Add location parameter. Set
1459 location of builtin macro to the expansion point.
1460 (enter_macro_context): Pass location to builtin_macro.
1461
a4cfdfed 14622014-07-16 Dodji Seketeli <dodji@redhat.com>
1463
1464 Support location tracking for built-in macro tokens
1465 * include/line-map.h (line_maps::builtin_location): New data
1466 member.
1467 (line_map_init): Add a new parameter to initialize the new
1468 line_maps::builtin_location data member.
1469 * line-map.c (linemap_init): Initialize the
1470 line_maps::builtin_location data member.
1471 * macro.c (builtin_macro): Create a macro map and track the token
1472 resulting from the expansion of a built-in macro.
1473
49f161b6 14742014-07-10 Edward Smith-Rowland <3dw4rd@verizon.net>
1475 Jonathan Wakely <jwakely@redhat.com>
1476
b5905560 1477 PR preprocessor/61389
49f161b6 1478 * macro.c (_cpp_arguments_ok, parse_params, create_iso_definition):
1479 Warning messages mention C++11 in c++ mode and C99 in c mode.
1480 * lex.c (lex_identifier_intern, lex_identifier): Ditto
1481
8947e5dc 14822014-07-09 Edward Smith-Rowland <3dw4rd@verizon.net>
1483
1484 PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped
1485 by preprocessor
1486 * lex.c (lex_raw_string ()): Do not warn about invalid suffix
1487 if skipping. (lex_string ()): Ditto.
1488
649bbfc4 14892014-06-04 Edward Smith-Rowland <3dw4rd@verizon.net>
1490
1491 PR c++/61038
1492 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
1493 Combine user-defined escape logic with the other string and char logic.
1494
1c8ad86a 14952014-05-26 Richard Biener <rguenther@suse.de>
1496
1497 * configure.ac: Remove long long and __int64 type checks,
1498 add check for uint64_t and fail if that wasn't found.
1499 * include/cpplib.h (cpp_num_part): Use uint64_t.
1500 * config.in: Regenerate.
1501 * configure: Likewise.
1502
0ac81b0e 15032014-05-21 Marek Polacek <polacek@redhat.com>
1504
1505 PR c/61212
1506 * files.c (find_file_in_dir): Add parens around &&.
1507
df271348 15082014-05-20 Edward Smith-Rowland <3dw4rd@verizon.net>
1509
0ac81b0e 1510 PR c++/61038
df271348 1511 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
1512 Check for user-defined literal strings and user-defined literal chars
1513 to escape necessary characters.
1514
a3034794 15152014-05-20 Richard Biener <rguenther@suse.de>
1516
1517 * configure.ac: Copy gcc logic of detecting a 64bit type.
1518 Remove HOST_WIDE_INT define.
1519 * include/cpplib.h: typedef cpp_num_part to a 64bit type,
1520 similar to how hwint.h does it.
1521 * config.in: Regenerate.
1522 * configure: Likewise.
1523
1c9b820a 15242014-05-09 Joey Ye <joey.ye@arm.com>
1525
1526 * files.c (find_file_in_dir): Always try to shorten for DOS
1527 non-system headers.
1528 * init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS.
1529
da3c842e 15302014-05-07 Richard Biener <rguenther@suse.de>
1531
1532 * configure.ac: Always set need_64bit_hwint to yes.
1533 * configure: Regenerated.
1534
3efb5d22 15352014-04-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1536
1537 * lex.c: Remove Solaris 9 reference.
1538
2da35515 15392014-02-24 Walter Lee <walt@tilera.com>
1540
1541 * configure.ac: Change "tilepro" triplet to "tilepro*".
1542 * configure: Regenerate.
1543
9b48364f 15442014-02-19 Jakub Jelinek <jakub@redhat.com>
1545
1546 PR preprocessor/58844
1547 * macro.c (enter_macro_context): Only push
1548 macro_real_token_count (macro) tokens rather than
1549 macro->count tokens, regardless of
1550 CPP_OPTION (pfile, track-macro-expansion).
1551
6e5a7913 15522014-02-07 Jakub Jelinek <jakub@redhat.com>
1553
1554 PR preprocessor/56824
1555 * line-map.c (get_combined_adhoc_loc, linemap_get_expansion_line,
1556 linemap_get_expansion_filename, linemap_location_in_system_header_p,
1557 linemap_location_from_macro_expansion_p,
1558 linemap_macro_loc_to_spelling_point, linemap_macro_loc_to_def_point,
1559 linemap_macro_loc_to_exp_point, linemap_expand_location): Fix
1560 formatting.
1561 (linemap_compare_locations): Look through adhoc locations for both
1562 l0 and l1.
1563
ffc2c526 15642014-01-23 Dodji Seketeli <dodji@redhat.com>
1565
1566 PR PR preprocessor/58580
1567 * include/line-map.h (linemap_get_file_highest_location): Declare
1568 new function.
1569 * line-map.c (linemap_get_file_highest_location): Define it.
1570
806a3d45 15712014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
1572
1573 Update copyright years
1574
e7d8908f 15752013-12-09 Joseph Myers <joseph@codesourcery.com>
1576
1577 PR preprocessor/55715
1578 * expr.c (num_binary_op): Implement subtraction directly rather
1579 than with negation and falling through into addition case.
1580
eb992054 15812013-11-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
1582
1583 * lex.c (search_line_fast): Correct for little endian.
1584
460f52aa 15852013-11-15 Joseph Myers <joseph@codesourcery.com>
1586
1587 * ucnid.tab: Add C11 and C11NOSTART data.
1588 * makeucnid.c (digit): Rename enum value to N99.
1589 (C11, N11, all_languages): New enum values.
1590 (NUM_CODE_POINTS, MAX_CODE_POINT): New macros.
1591 (flags, decomp, combining_value): Use NUM_CODE_POINTS as array
1592 size.
1593 (decomp): Use unsigned int as element type.
1594 (all_decomp): New array.
1595 (read_ucnid): Handle C11 and C11NOSTART. Use MAX_CODE_POINT.
1596 (read_table): Use MAX_CODE_POINT. Store all decompositions in
1597 all_decomp.
1598 (read_derived): Use MAX_CODE_POINT.
1599 (write_table): Use NUM_CODE_POINTS. Print N99, C11 and N11
1600 flags. Print whole array variable declaration rather than just
1601 array contents.
1602 (char_id_valid, write_context_switch): New functions.
1603 (main): Call write_context_switch.
1604 * ucnid.h: Regenerate.
1605 * include/cpplib.h (struct cpp_options): Add c11_identifiers.
1606 * init.c (struct lang_flags): Add c11_identifiers.
1607 (cpp_set_lang): Set c11_identifiers option from selected language.
1608 * internal.h (struct normalize_state): Document "previous" as
1609 previous starter character.
1610 (NORMALIZE_STATE_UPDATE_IDNUM): Take character as argument.
1611 * charset.c (DIG): Rename enum value to N99.
1612 (C11, N11): New enum values.
1613 (struct ucnrange): Give name to struct. Use short for flags and
1614 unsigned int for end of range. Include ucnid.h for whole variable
1615 declaration.
1616 (ucn_valid_in_identifier): Allow for characters up to 0x10FFFF.
1617 Allow for C11 in determining valid characters and valid start
1618 characters. Use check_nfc for non-Hangul context-dependent
1619 checks. Only store starter characters in nst->previous.
1620 (_cpp_valid_ucn): Pass new argument to
1621 NORMALIZE_STATE_UPDATE_IDNUM.
1622 * lex.c (lex_identifier): Pass new argument to
1623 NORMALIZE_STATE_UPDATE_IDNUM. Call NORMALIZE_STATE_UPDATE_IDNUM
1624 after initial non-UCN part of identifier.
1625 (lex_number): Pass new argument to NORMALIZE_STATE_UPDATE_IDNUM.
1626
ceaeebbe 16272013-11-15 Joseph Myers <joseph@codesourcery.com>
1628
1629 * ucnid.tab: Mark C99 digits as [C99DIG].
1630 * makeucnid.c (read_ucnid): Handle [C99DIG].
1631 (read_table): Don't check for digit characters.
1632 * ucnid.h: Regenerate.
1633
5b1a0622 16342013-11-06 Tobias Burnus <burnus@net-b.de>
1635
1636 * macro.c (_cpp_builtin_macro_text): Correct
1637 wording of two warnings.
1638
9148bda3 16392013-11-05 Tobias Burnus <burnus@net-b.de>
1640
1641 * include/cpplib.h (CPP_W_DATE_TIME): Added.
1642 (cpp_options): Add warn_date_time.
1643 * init.c (cpp_create_reader): Init it.
1644 * macro.c (_cpp_builtin_macro_text): Warn when
1645 __DATE__/__TIME__/__TIMESTAMP__ is used.
1646
4d6f7dd4 16472013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
1648
9148bda3 1649 Implement C++14 digit separators.
4d6f7dd4 1650 * include/cpplib.h (cpp_options): Add digit_separators flag.
1651 * internal.h (DIGIT_SEP(c)): New macro.
1652 * expr.c (cpp_classify_number): Check improper placement of digit sep;
1653 (cpp_interpret_integer): Skip over digit separators.
1654 * init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add
1655 digit separator flags per language; (cpp_set_lang): Set
1656 digit_separators
1657 * lex.c (lex_number): Add digits separator to allowable characters for
1658 C++14.
1659
2bd17377 16602013-10-15 David Malcolm <dmalcolm@redhat.com>
1661
1662 * Makefile.in (PICFLAG): New.
1663 (ALL_CFLAGS): Add PICFLAG.
1664 (ALL_CXXFLAGS): Likewise.
1665 * configure.ac: Add --enable-host-shared, setting up new
1666 PICFLAG variable.
1667 * configure: Regenerate.
1668
97d17efa 16692013-08-07 Richard Earnshaw <rearnsha@arm.com>
1670
1671 * configure.ac: Set need_64bit_hwint for all arm targets.
1672 * configure: Regenerated.
1673
ffb840b4 16742013-07-20 Jakub Jelinek <jakub@redhat.com>
1675
1676 PR preprocessor/57620
1677 * lex.c (lex_raw_string): Undo phase1 and phase2 transformations
1678 between R" and final " rather than only in between R"del( and )del".
1679
bd285415 16802013-07-10 Jakub Jelinek <jakub@redhat.com>
1681
c7691e08 1682 PR preprocessor/57824
1683 * lex.c (lex_raw_string): Allow reading new-lines if
1684 in_deferred_pragma or if parsing_args and there is still
1685 data in the current buffer.
1686
da31536d 1687 * include/cpplib.h (cpp_token_val_index): Change parameter type to
1688 const cpp_token *.
1689 * lex.c (cpp_token_val_index): Likewise.
1690
bd285415 1691 PR preprocessor/57757
1692 * lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING
1693 or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that
1694 starts if a-zA-Z_.
1695
4e8832f3 16962013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
1697
1698 * lex.c (lex_raw_string(), lex_string()): Constrain suffixes treated
1699 as concatenated literal and macro to just the patterns found in
1700 inttypes.h; (is_macro()): New.
1701
5bd48b2e 17022013-06-24 Dehao Chen <dehao@google.com>
1703
1704 * files.c (_cpp_stack_include): Fix the highest_location when header
1705 file is guarded by #ifndef and is included twice.
1706
d8c8614f 17072013-04-28 Jakub Jelinek <jakub@redhat.com>
1708
1709 N3472 binary constants
1710 * include/cpplib.h (struct cpp_options): Fix a typo in user_literals
1711 field comment. Add binary_constants field.
1712 * init.c (struct lang_flags): Add binary_constants field.
1713 (lang_defaults): Add bin_cst column to the table.
1714 (cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants).
1715 * expr.c (cpp_classify_number): Talk about C++11 instead of C++0x
1716 in diagnostics. Accept binary constants if
1717 CPP_OPTION (pfile, binary_constants) even when pedantic. Adjust
1718 pedwarn message.
1719
1638c736 17202013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
1721
1722 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y.
1723 * init.c (lang_defaults): Add defaults for the latter.
1724 (cpp_init_builtins): Define __cplusplus as 201300L for the latter.
1725 * lex.c (_cpp_lex_direct): Update.
1726
0ca702f2 17272013-04-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
1728
1729 PR target/56771
1730 * configure.ac: Require 64-bit int for arm*-*-rtems*.
1731 * configure: Regenerate.
1732
914db4b7 17332013-03-06 Jakub Jelinek <jakub@redhat.com>
1734
1735 PR middle-end/56461
1736 * internal.h (struct cpp_buffer): Add to_free field.
1737 (_cpp_pop_file_buffer): Add third argument.
1738 * files.c (_cpp_stack_file): Set buffer->to_free.
1739 (_cpp_pop_file_buffer): Add to_free argument. Free to_free
1740 if non-NULL, and if equal to file->buffer_start, also clear
1741 file->buffer{,_start,_valid}.
1742 * directives.c (_cpp_pop_buffer): Pass buffer->to_free
1743 to _cpp_pop_file_buffer.
1744
39bcf299 17452013-03-01 Jakub Jelinek <jakub@redhat.com>
1746
1747 PR middle-end/56461
1748 * files.c (_cpp_save_file_entries): Free result at the end.
1749 * pch.c (cpp_string_free): New function.
1750 (cpp_save_state): Use it in htab_create call.
1751 (cpp_write_pch_deps): Free ss->defs. Destroy ss->definedhash.
1752
61ed1f10 17532013-02-28 Jakub Jelinek <jakub@redhat.com>
1754
cde9343a 1755 * files.c (_cpp_find_file): If returning early, before storing
1756 something to *hash_slot and *hash_slot is NULL, call htab_clear_slot
1757 on it. Access *hash_slot using void * type rather than
1758 struct file_hash_entry * to avoid aliasing issues.
1759
61ed1f10 1760 * configure.ac: Don't define ENABLE_CHECKING whenever
1761 --enable-checking is seen, instead use similar --enable-checking=yes
1762 vs. --enable-checking=release default as gcc/ subdir has and
1763 define ENABLE_CHECKING if ENABLE_CHECKING is defined in gcc/.
1764 Define ENABLE_VALGRIND_CHECKING if requested.
1765 * lex.c (new_buff): If ENABLE_VALGRIND_CHECKING, put _cpp_buff
1766 struct first in the allocated buffer and result->base after it.
1767 (_cpp_free_buff): If ENABLE_VALGRIND_CHECKING, free buff itself
1768 instead of buff->base.
1769 * config.in: Regenerated.
1770 * configure: Regenerated.
1771
911b08c6 17722013-02-13 Ed Smith-Rowland <3dw4rd@verizon.net>
1773
1774 PR c++/55582
1638c736 1775 * lex.c (lex_raw_string): Allow string literal with suffix
911b08c6 1776 beginning with 's' to be parsed as a C++11 user-defined literal.
1777
cec7bb47 17782013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
1779
1780 Update copyright years.
1781
1aa79d39 17822013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
1783
1784 PR c++/54526 (again)
1785 * lex.c (_cpp_lex_direct): In C++11 mode, implement 2.5 p3, bullet 2.
1786
de2e6b8a 17872013-01-03 Marc Glisse <marc.glisse@inria.fr>
1788
1789 PR bootstrap/50177
1790 * line-map.c (get_combined_adhoc_loc): Cast from extern "C" type.
1791 (new_linemap): Likewise.
1792 (linemap_enter_macro): Likewise.
1793
8e1d1b0c 17942012-12-03 Jakub Jelinek <jakub@redhat.com>
1795
1796 PR bootstrap/55380
1797 PR other/54691
1798 * files.c (read_file_guts): Allocate extra 16 bytes instead of
1799 1 byte at the end of buf. Pass size + 16 instead of size
1800 to _cpp_convert_input.
1801 * charset.c (_cpp_convert_input): Reallocate if there aren't
1802 at least 16 bytes beyond to.len in the buffer. Clear 16 bytes
1803 at to.text + to.len.
1804
8ad1eb94 18052012-11-21 Steve Ellcey <sellcey@mips.com>
1806
1807 PR pch/55399
1808 * files.c (pch_open_file): Fix check for implicit_preinclude.
1809
52bc861d 18102012-11-16 Simon Baldwin <simonb@google.com>
1811
1812 * include/cpplib.h (struct cpp_options): Add canonical_system_headers.
1813 * files.c (find_file_in_dir): Call maybe_shorter_path() only if
1814 canonical_system_headers is set.
1815 * init.c (cpp_create_reader): Initialize canonical_system_headers.
1816 * configure.ac: Add new --enable-canonical-system-headers.
1817 * configure: Regenerate.
1818 * config.in: Regenerate.
1819
2dd00636 18202012-11-09 Ed Smith-Rowland <3dw4rd@verizon.net>
1821
1822 PR c++/54413
1823 * include/cpplib.h (cpp_interpret_float_suffix): Add cpp_reader* arg.
1824 (cpp_interpret_int_suffix): Add cpp_reader* arg.
1825 * init.c (cpp_create_reader): Iitialize new flags.
1826 * expr.c (interpret_float_suffix): Use new flags.
1827 (cpp_interpret_float_suffix): Add cpp_reader* arg.
1828 (interpret_int_suffix): Use new flags.
1829 (cpp_interpret_int_suffix): Add cpp_reader* arg.
1830 (cpp_classify_number): Adjust calls to interpret_x_suffix.
1831
5b1d5fe6 18322012-10-23 Ian Bolton <ian.bolton@arm.com>
1833 Jim MacArthur <jim.macarthur@arm.com>
1834 Marcus Shawcroft <marcus.shawcroft@arm.com>
1835 Nigel Stephens <nigel.stephens@arm.com>
1836 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
1837 Richard Earnshaw <rearnsha@arm.com>
1838 Sofiane Naci <sofiane.naci@arm.com>
1839 Stephen Thomas <stephen.thomas@arm.com>
1840 Tejas Belagod <tejas.belagod@arm.com>
1841 Yufeng Zhang <yufeng.zhang@arm.com>
1842
1843 * configure.ac: Enable AArch64.
1844 * configure: Regenerate.
1845
6adc88f8 18462012-10-23 Joseph Myers <joseph@codesourcery.com>
1847
1848 * files.c (struct _cpp_file): Add implicit_preinclude.
1849 (pch_open_file): Allow a previously opened implicitly included
1850 file.
1851 (_cpp_find_file): Add implicit_preinclude argument. Free file and
1852 do not call open_file_failed if implicit_preinclude. Store
1853 implicit_preinclude value.
1854 (_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date):
1855 Update calls to _cpp_find_file.
1856 (_cpp_stack_include): Handle IT_DEFAULT.
1857 (cpp_push_default_include): New.
1858 * include/cpplib.h (cpp_push_default_include): Declare.
1859 * init.c (cpp_read_main_file): Update call to _cpp_find_file.
1860 * internal.h (enum include_type): Add IT_DEFAULT.
1861 (_cpp_find_file): Update prototype.
1862
15fc692a 18632012-10-15 Tobias Burnus <burnus@net-b.de>
1864
1865 * files.c (read_file_guts, _cpp_save_file_entries): Free memory
1866 before returning.
1867 * lex.c (warn_about_normalization): Ditto.
1868 * mkdeps.c (deps_save): Ditto.
1869 * pch.c (cpp_valid_state): Ditto.
1870
a1f1781a 18712012-10-04 Florian Weimer <fweimer@redhat.com>
1872
1873 * directives.c (do_pragma_warning_or_error): New.
1874 (do_pragma_warning): New.
1875 (do_pragma_error): New.
1876 (_cpp_init_internal_pragmas): Register new pragmas.
1877
bda16c7c 18782012-09-25 Dehao Chen <dehao@google.com>
1879
1880 PR middle-end/54704
1881 * line-map.c (location_adhoc_data_hash): Fix the hash function.
1882
5c1946c8 18832012-09-25 Dehao Chen <dehao@google.com>
1884
1885 PR middle-end/54645
1886 * include/line-map.h (location_adhoc_data): Move location_adhoc_data
1887 into GC.
1888 (location_adhoc_data_map): Likewise.
1889 (line_maps): Likewise.
1890 (rebuild_location_adhoc_htab): New Function.
1891 * line-map.c (+rebuild_location_adhoc_htab): new Funcion.
1892 (get_combined_adhoc_loc): Move location_adhoc_data into GC.
1893 (location_adhoc_data_fini): Likewise.
1894 (linemap_init): Likewise.
1895 (location_adhoc_data_init): Remove Function.
1896
5169661d 18972012-09-19 Dehao Chen <dehao@google.com>
1898
1899 * include/line-map.h (MAX_SOURCE_LOCATION): New value.
1900 (location_adhoc_data_fini): New.
1901 (get_combined_adhoc_loc): New.
1902 (get_data_from_adhoc_loc): New.
1903 (get_location_from_adhoc_loc): New.
1904 (location_adhoc_data_map): New.
1905 (COMBINE_LOCATION_DATA): New.
1906 (IS_ADHOC_LOC): New.
1907 (expanded_location): New field.
1908 (line_maps): New field.
1909 * line-map.c (location_adhoc_data): New.
1910 (location_adhoc_data_hash): New.
1911 (location_adhoc_data_eq): New.
1912 (location_adhoc_data_update): New.
1913 (get_combined_adhoc_loc): New.
1914 (get_data_from_adhoc_loc): New.
1915 (get_location_from_adhoc_loc): New.
1916 (location_adhoc_data_init): New.
1917 (location_adhoc_data_fini): New.
1918 (linemap_init): Initialize location_adhoc_data.
1919 (linemap_lookup): Change to use new location.
1920 (linemap_ordinary_map_lookup): Likewise.
1921 (linemap_macro_map_lookup): Likewise.
1922 (linemap_macro_map_loc_to_def_point): Likewise.
1923 (linemap_macro_map_loc_unwind_toward_spel): Likewise.
1924 (linemap_get_expansion_line): Likewise.
1925 (linemap_get_expansion_filename): Likewise.
1926 (linemap_location_in_system_header_p): Likewise.
1927 (linemap_location_from_macro_expansion_p): Likewise.
1928 (linemap_macro_loc_to_spelling_point): Likewise.
1929 (linemap_macro_loc_to_def_point): Likewise.
1930 (linemap_macro_loc_to_exp_point): Likewise.
1931 (linemap_resolve_location): Likewise.
1932 (linemap_unwind_toward_expansion): Likewise.
1933 (linemap_unwind_to_first_non_reserved_loc): Likewise.
1934 (linemap_expand_location): Likewise.
1935 (linemap_dump_location): Likewise.
1936 (linemap_line_start): Likewise.
1937
307df3d0 19382012-05-25 Dodji Seketeli <dodji@redhat.com>
1939
1940 PR preprocessor/53469
1941 * directives.c (do_pragma): Use the virtual location for the
1942 pragma token, instead of its spelling location.
1943
2b15d2ba 19442012-08-14 Diego Novillo <dnovillo@google.com>
1945
1946 Merge from cxx-conversion branch. Configury.
1947
1948 * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
1949 * configure.ac: Likewise.
1950 * configure: Regenerate.
1951
19522012-08-14 Lawrence Crowl <crowl@google.com>
1953
1954 Merge from cxx-conversion branch. New C++ hash table.
1955
1956 * include/symtab.h (typedef struct ht hash_table): Change the typedef
1957 name to cpp_hash_table. Update all users of the typedef.
1958
65f4cf9c 19592012-07-30 Laurynas Biveinis <laurynas.biveinis@gmail.com>
1960
1961 * include/line-map.h (line_map_macro): Use the "atomic" GTY option
1962 for the macro_locations field.
1963
112f073c 19642011-06-19 Uros Bizjak <ubizjak@gmail.com>
1965
1966 * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
1967 __builtin_ia32_pcmpestri128 instead of asm.
1968
c8dda42f 19692012-06-04 Dimitrios Apostolou <jimis@gmx.net>
1970
1971 * line-map.c (linemap_enter_macro): Don't zero max_column_hint in
1972 every macro. This improves performance by reducing the number of
1973 reallocations when track-macro-expansion is on.
1974
0aa42a53 19752012-06-04 Dodji Seketeli <dodji@redhat.com>
1976
1977 PR preprocessor/53463
1978 * line-map.c (linemap_location_in_system_header_p): For built-in
1979 macro tokens, check the first expansion point location that is not
1980 for a token coming from a built-in macro.
1981
e8aa7eaf 19822012-05-29 Joseph Myers <joseph@codesourcery.com>
1983
1984 * directives.c: Fix typos.
1985 * include/line-map.h: Fix typos.
1986 * line-map.c: Fix typos.
1987 * macro.c: Fix typos.
1988
5fe44548 19892012-05-25 Dodji Seketeli <dodji@redhat.com>
1990
1991 PR bootstrap/53459
1992 * lex.c (search_line_fast): Avoid unused local typedefs to simulate
1993 a static assertion.
1994
8c6425eb 19952012-05-29 Dodji Seketeli <dodji@redhat.com>
1996
1997 PR preprocessor/53229
1998 * internal.h (cpp_reader::set_invocation_location): Remove.
1999 (cpp_reader::about_to_expand_macro_p): New member flag.
2000 * directives.c (do_pragma): Remove Kludge as
2001 pfile->set_invocation_location is no more.
2002 * macro.c (cpp_get_token_1): Do away with the use of
2003 cpp_reader::set_invocation_location. Just collect the macro
2004 expansion point when we are about to expand the top-most macro.
2005 Do not override cpp_reader::about_to_expand_macro_p.
2006 This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding
2007 properly handle locations of expansion points.
2008 (cpp_get_token_with_location): Adjust, as
2009 cpp_reader::set_invocation_location is no more.
2010 (paste_tokens): Take a virtual location parameter for
2011 the LHS of the pasting operator. Use it in diagnostics. Update
2012 comments.
2013 (paste_all_tokens): Tighten the assert. Propagate the location of
2014 the expansion point when no virtual locations are available.
2015 Pass the virtual location to paste_tokens.
2016 (in_macro_expansion_p): New static function.
2017 (enter_macro_context): Set the cpp_reader::about_to_expand_macro_p
2018 flag until we really start expanding the macro.
2019
a60f3e81 20202012-05-16 Dodji Seketeli <dodji@redhat.com>
2021
2022 PR preprocessor/7263
2023 * include/cpplib.h (cpp_classify_number): Take a location
2024 parameter.
2025 * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic
2026 macros that take a location parameter.
2027 (cpp_classify_number): Take a (virtual) location parameter. Use
2028 it for diagnostics. Adjust comments.
2029 (eval_token): Take a location parameter. Pass it to
2030 cpp_classify_number and to diagnostic routines.
2031 (_cpp_parse_expr): Use virtual locations of tokens when parsing
2032 expressions. Pass a virtual location to eval_token and to
2033 diagnostic routines.
2034
3069d7f8 20352012-05-10 Tristan Gingold <gingold@adacore.com>
2036
2037 * expr.c (interpret_float_suffix): Add a guard.
2038
6cfa7465 20392012-05-02 Dodji Seketeli <dodji@redhat.com>
2040
2041 Properly initialize cpp_context in destringize_and_run
2042 * directives.c (destringize_and_run): Properly initialize the new
2043 context.
2044 * macro.c (_cpp_pop_context): Assert that we shouldn't try to pop
2045 the initial base context, which has the same life time as the
2046 current instance of cpp_file.
2047
47b6a3fe 20482012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
2049 Dodji Seketeli <dodji@seketeli.org>
2050
ffca20e9 2051 PR c++/52974
47b6a3fe 2052 * libcpp/files.c (maybe_shorter_path): New.
2053 (find_file_in_dir): Use it.
2054
d16f4f47 20552012-04-30 Dodji Seketeli <dodji@redhat.com>
2056
611f1003 2057 Switch -ftrack-macro-expansion=2 on by default.
2058 * init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
2059 by default. Add comments.
2060
bd172d61 2061 Strip "<built-in>" loc from displayed expansion context
2062 * include/line-map.h (linemap_unwind_toward_expansion): Fix typo
2063 in comment.
2064 (linemap_unwind_to_first_non_reserved_loc): Declare new function.
2065 * line-map.c (linemap_unwind_to_first_non_reserved_loc): Define
2066 new function.
2067
00abfdc0 2068 Fix expansion point loc for macro-like tokens
2069 * macro.c (macro_of_context): New static function.
2070 (_cpp_push_token_context, push_extended_tokens_context): If the
2071 macro argument is NULL, it means we are continuing the expansion
2072 of the current macro, if any. Update comments.
2073 (_cpp_pop_context): Re-enable expansion of the macro only when we
2074 are really out of the context of the current expansion.
2075
c55700de 2076 Fix token pasting with -ftrack-macro-expansion
2077 * macro.c (paste_all_tokens): Put the token resulting from pasting
2078 into an extended token context with -ftrack-macro-location is in
2079 effect.
2080
d16f4f47 2081 Fix cpp_sys_macro_p with -ftrack-macro-expansion
2082 * macro.c (cpp_sys_macro_p): Support -ftrack-macro-expansion.
2083
86c82b61 20842012-04-29 Dodji Seketeli <dodji@redhat.com>
2085
2086 * lex.c (lex_raw_string): Change C++ style comments into C style
2087 comments.
cc0a8c77 2088 (lex_string): Likewise.
86c82b61 2089
76d340ac 20902012-04-27 Ollie Wild <aaw@google.com>
2091
2092 * include/cpplib.h (struct cpp_options): Add new field,
2093 warn_literal_suffix.
2094 (CPP_W_LITERAL_SUFFIX): New enum.
2095 * init.c (cpp_create_reader): Default initialization of
2096 warn_literal_suffix.
2097 * lex.c (lex_raw_string): Treat user-defined literals which don't
2098 begin with '_' as separate tokens and produce a warning.
2099 (lex_string): Ditto.
2100
3f898bd2 21012012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
2102
2103 * line-map.c (linemap_resolve_location): Synchronize comments with
2104 those in line-map.h.
2105 * include/line-map.h (linemap_resolve_location): Fix spelling in
2106 comment.
2107
c434932e 21082012-03-22 Richard Earnshaw <rearnsha@arm.com>
2109
2110 * lex.c (search_line_fast): Provide Neon-optimized version for ARM.
2111
264a5d11 21122012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2113
2114 * lex.c: Remove Solaris 8 reference.
2115
7ce78e23 21162012-02-14 Walter Lee <walt@tilera.com>
2117
2118 * configure.ac: Require 64-bit hwint for tilegx and tilepro.
2119 * configure: Regenerate.
2120
d6fb6576 21212012-01-09 Richard Guenther <rguenther@suse.de>
2122
2123 * macro.c (_cpp_builtin_macro_text): Remove unused variable map.
2124
5e791406 21252012-01-09 Gary Funck <gary@intrepid.com>
2126
2127 PR preprocessor/33919
2128 * files.c (_cpp_get_file_name): New. Implement file name
2129 access function.
2130 * internal.h (_cpp_get_file_name): New prototype.
2131 * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
2132 to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
2133
131e69c7 21342012-01-03 Olivier Hainque <hainque@adacore.com>
2135
2136 * system.h: Prior to #define, #undef fopen and freopen unconditionally.
2137
32074525 21382011-12-20 Joseph Myers <joseph@codesourcery.com>
2139
2140 * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
2141 (CLK_STDC1X): Change to CLK_STDC11.
2142 * init.c (lang_defaults): Update comments.
2143 (cpp_init_builtins): Update language tests. Use 201112L for C11
2144 __STDC_VERSION__.
2145
80cfebdb 21462011-12-20 Andreas Schwab <schwab@linux-m68k.org>
2147
2148 * configure: Regenerate.
2149
705de1ef 21502011-12-19 Andreas Schwab <schwab@linux-m68k.org>
2151
2152 * configure: Regenerate.
2153
b735cc56 21542011-12-07 Jakub Jelinek <jakub@redhat.com>
2155
2156 PR bootstrap/50237
2157 * internal.h (_cpp_init_lexer): New prototype.
2158 * init.c (init_library): Call it.
2159 * lex.c (init_vectorized_lexer): Remove constructor attribute,
2160 add inline keyword.
2161 (HAVE_init_vectorized_lexer): Define.
2162 (_cpp_init_lexer): New function.
2163
80e34234 21642011-12-03 Dodji Seketeli <dodji@redhat.com>
2165
2166 * macro.c (tokens_buff_remove_last_token)
2167 (tokens_buff_put_token_to): Add an 'inline' function specifier to
2168 the prototype.
2169
b082215e 21702011-11-22 Diego Novillo <dnovillo@google.com>
2171
2172 * include/line-map.h (linemap_dump): Declare.
2173 (line_table_dump): Declare.
2174 * line-map.c (linemap_dump): New.
2175 (line_table_dump): New.
2176
b06c89b6 21772011-11-21 Ed Smith-Rowland <3dw4rd@verizon.net>
2178
2179 PR c++/50958
2180 * expr.c (cpp_userdef_char_remove_type): Fix typo.
2181
7c801b60 21822011-11-03 Michael Matz <matz@suse.de>
2183
2184 PR bootstrap/50857
2185 * configure.ac: Check for -fno-exceptions -fno-rtti.
2186 * configure: Regenerate.
2187 * Makefile.in (NOEXCEPTION_FLAGS): New flag.
2188 (ALL_CXXFLAGS): Use it.
2189
d8954404 21902011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
2191
2192 * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
2193
7e783eb3 21942011-11-02 Jason Merrill <jason@redhat.com>
2195
2196 PR c++/50810
2197 * configure.ac: Add -Wno-narrowing to warning options.
2198
0d84dc2d 21992011-10-31 Jason Merrill <jason@redhat.com>
2200
de803ff2 2201 PR libstdc++/1773
2202 * init.c (cpp_init_builtins): Set __cplusplus for C++11.
2203
0d84dc2d 2204 PR c++/50920
2205 * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
2206 CLK_GNUCXX0X to CLK_GNUCXX11.
2207
244db24d 22082011-10-26 Ed Smith-Rowland <3dw4rd@verizon.net>
2209
2210 Implement C++11 user-defined literals.
2211 * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
2212 cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
2213 cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
2214 cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
2215 (cpp_classify_number): Classify unrecognized tokens as user-defined
2216 literals.
2217 * include/cpplib.h: Add new tokens for user-defined literals.
2218 * init.c: Add new preprocessor flag (cxx11).
2219 * lex.c: (lex_string, lex_raw_string): Handle user-defined literals
2220 including concatenation and promotion with suffixes.
2221
68928989 22222011-10-24 Dodji Seketeli <dodji@redhat.com>
2223
2224 * line-map.c (linemap_macro_map_lookup): Fix logic.
2225
5ebe2143 22262011-10-24 Dodji Seketeli <dodji@redhat.com>
2227
2228 * include/line-map.h (linemap_expand_location): Take a line table
2229 parameter. Update comment.
2230 (linemap_resolve_location): Update comment.
2231 (linemap_expand_location_full): Remove.
2232 * line-map.c (linemap_resolve_location): Handle reserved
2233 locations; return a NULL map in those cases.
2234 (linemap_expand_location): If location is reserved, return a
2235 zeroed expanded location. Update comment. Take a line table to
2236 assert that the function takes non-virtual locations only.
2237 (linemap_expand_location_full): remove.
2238 (linemap_dump_location): Handle the fact that
2239 linemap_resolve_location can return NULL line maps when the
2240 location resolves to a reserved location.
2241
2242 * line-map.c (linemap_macro_map_lookup): Fix logic.
2243
a2eb22f0 22442011-10-22 Dodji Seketeli <dodji@redhat.com>
2245
2246 PR bootstrap/50778
2247 * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
2248 context to act upon.
2249 * lex.c (_cpp_remaining_tokens_num_in_context): Likewise. Update
2250 comment.
2251 (cpp_token_from_context_at): Likewise.
2252 (cpp_peek_token): Use the context to peek tokens from.
2253
ac6130e2 22542011-10-20 Dodji Seketeli <dodji@redhat.com>
2255
2256 PR bootstrap/50801
2257 * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
2258 number of tokens.
2259
2a688977 22602011-10-18 Dodji Seketeli <dodji@redhat.com>
2261
2262 PR bootstrap/50760
2263 * include/line-map.h (struct linemap_stats): Change the type of
cc0a8c77 2264 the members from size_t to long.
2a688977 2265 * macro.c (macro_arg_token_iter_init): Unconditionally initialize
cc0a8c77 2266 iter->location_ptr.
2a688977 2267
a67520a9 22682011-10-17 Dodji Seketeli <dodji@redhat.com>
2269
2270 * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
cc0a8c77 2271 variable without using it if ENABLE_CHECKING is not defined. Mark
2272 the LOCATION parameter as being unused.
a67520a9 2273
1ae3520e 22742011-10-15 Tom Tromey <tromey@redhat.com>
2275 Dodji Seketeli <dodji@redhat.com>
2276
2277 * include/line-map.h (struct line_maps::alloced_size_for_request):
2278 New member.
2279 * line-map.c (new_linemap): Use set->alloced_size_for_request to
2280 get the actual allocated size of line maps.
2281
e77b8253 22822011-10-15 Tom Tromey <tromey@redhat.com>
2283 Dodji Seketeli <dodji@redhat.com>
2284
2285 * line-map.h (struct linemap_stats): Declare new struct.
2286 (linemap_get_statistics): Declare ...
2287 * line-map.c (linemap_get_statistics): ... new function.
2288 * macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
2289 Declare new counters.
2290 (enter_macro_context, replace_args): Update
2291 num_macro_tokens_counter.
2292 (cpp_get_token_1): Update num_expanded_macros_counter.
2293
62db153a 22942011-10-15 Tom Tromey <tromey@redhat.com>
2295 Dodji Seketeli <dodji@redhat.com>
2296
2297 * include/cpplib.h (struct cpp_options)<debug>: New struct member.
2298 * include/line-map.h (linemap_dump_location): Declare ...
2299 * line-map.c (linemap_dump_location): ... new function.
2300
ce70f433 23012011-10-15 Tom Tromey <tromey@redhat.com>
2302 Dodji Seketeli <dodji@redhat.com>
2303
2304 * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
2305 New option.
2306 * internal.h (struct macro_context): New struct.
2307 (enum context_tokens_kind): New enum.
2308 (struct cpp_context)<tokens_kind>: New member of type enum
2309 context_tokens_kind.
2310 (struct cpp_context)<macro>: Remove this. Replace it with an enum
2311 of macro and macro_context.
2312 (struct cpp_context)<direct_p>: Remove.
2313 (_cpp_remaining_tokens_num_in_context): Declare new function.
2314 * directives.c (destringize_and_run): Adjust.
2315 * lex.c (_cpp_remaining_tokens_num_in_context)
2316 (_cpp_token_from_context_at): Define new functions
2317 (cpp_peek_token): Use them.
2318 * init.c (cpp_create_reader): Initialize the base context to zero.
2319 (_cpp_token_from_context_at): Define new static function.
2320 (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
2321 _cpp_token_from_context_at.
2322 * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
2323 members.
2324 (enum macro_arg_token_kind): New enum.
2325 (struct macro_arg_token_iter): New struct.
2326 (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
2327 (alloc_expanded_arg_mem, ensure_expanded_arg_room)
2328 (delete_macro_args, set_arg_token, get_arg_token_location)
2329 (arg_token_ptr_at, macro_arg_token_iter_init)
2330 (macro_arg_token_iter_get_token)
2331 (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
2332 (expanded_token_index, tokens_buff_new, tokens_buff_count)
2333 (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
2334 (tokens_buff_add_token, tokens_buff_remove_last_token)
2335 (reached_end_of_context, consume_next_token_from_context): New
2336 static functions.
2337 (cpp_get_token_1): New static function. Split and extended from
2338 cpp_get_token. Use reached_end_of_context and
2339 consume_next_token_from_context. Unify its return point. Move
2340 the location tweaking from cpp_get_token_with_location in here.
2341 (cpp_get_token): Use cpp_get_token_1
2342 (stringify_arg): Use the new arg_token_at.
2343 (paste_all_tokens): Support tokens coming from extended tokens
2344 contexts.
2345 (collect_args): Return the number of collected arguments, by
2346 parameter. Store virtual locations of tokens that constitute the
2347 collected args.
2348 (funlike_invocation_p): Return the number of collected arguments,
2349 by parameter.
2350 (enter_macro_context): Add a parameter for macro expansion point.
2351 Pass it to replace_args and to the "used" cpp callback. Get the
2352 number of function-like macro arguments from funlike_invocation_p,
2353 pass it to the new delete_macro_args to free the memory used by
2354 macro args. When -ftrack-macro-expansion is in effect, for macros
2355 that have no arguments, create a macro map for the macro expansion
2356 and use it to allocate proper virtual locations for tokens
2357 resulting from the expansion. Push an extended tokens context
2358 containing the tokens resulting from macro expansion and their
2359 virtual locations.
2360 (replace_args): Rename the different variables named 'count' into
2361 variables with more meaningful names. Create a macro map;
2362 allocate virtual locations of tokens resulting from this
2363 expansion. Use macro_arg_token_iter to iterate over tokens of a
2364 given macro. Handle the case of the argument of
2365 -ftrack-macro-expansion being < 2. Don't free macro arguments
2366 memory resulting from expand_arg here, as these are freed by the
2367 caller of replace_arg using delete_macro_args now. Push extended
2368 token context.
2369 (next_context, push_ptoken_context, _cpp_push_token_context)
2370 (_cpp_push_text_context): Properly initialize the context.
2371 (expand_arg): Use the new alloc_expanded_arg_mem,
2372 push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
2373 (_cpp_pop_context): Really free the memory held by the context.
2374 Handle freeing memory used by extended tokens contexts.
2375 (cpp_get_token_with_location): Use cpp_get_token_1.
2376 (cpp_sys_macro_p): Adjust.
2377 (_cpp_backup_tokens): Support the new kinds of token contexts.
2378 * traditional.c (recursive_macro): Adjust.
2379
97bfb9ef 23802011-10-15 Tom Tromey <tromey@redhat>
2381 Dodji Seketeli <dodji@redhat.com>
2382
2383 * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
2384 member.
2385 (MAX_SOURCE_LOCATION): New constant.
2386 (struct line_map_ordinary, struct line_map_macro): New structs.
cc0a8c77 2387 (struct line_map): Turn this into a union of the two above. Add
97bfb9ef 2388 comments.
2389 (struct maps_info): New struct.
2390 (struct line_maps)<info_ordinary, info_macro>: Two new fields.
2391 These now carry the map information that was previously scattered
2392 in struct line_maps.
2393 (struct map_info::allocated): Fix comment.
2394 (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
2395 (ORDINARY_MAP_STARTING_LINE_NUMBER)
2396 (ORDINARY_MAP_INCLUDER_FILE_INDEX)
2397 (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
2398 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
2399 (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
2400 (MACRO_MAP_EXPANSION_POINT_LOCATION)
2401 (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
2402 (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
2403 (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
2404 (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
2405 (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
2406 (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
2407 (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
2408 (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
2409 (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
2410 (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
2411 (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
2412 information.
2413 (linemap_check_ordinary, linemap_assert)
2414 (linemap_location_before_p): New macros.
2415 (linemap_position_for_line_and_column)
2416 (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
2417 (linemap_macro_expansion_map_p)
2418 (linemap_macro_map_loc_to_def_point)
2419 (linemap_macro_map_loc_unwind_once)
2420 (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
2421 (linemap_get_source_line linemap_get_source_column)
2422 (linemap_map_get_macro_name, linemap_get_file_path)
2423 (linemap_location_in_system_header_p)
2424 (linemap_location_from_macro_expansion_p): Declare new functions.
2425 (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
2426 (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
2427 accessors act on ordinary maps only.
2428 (INCLUDED_FROM): Return NULL for main files; use the new
2429 accessors.
2430 (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
2431 (struct expanded_location): Move here from gcc/input.h
2432 (linemap_resolve_location, linemap_expand_location)
2433 (linemap_expand_location_full): Declare new functions.
2434 * line-map.c: Include cpplib.h, internal.h
2435 (linemap_enter_macro, linemap_add_macro_token)
2436 (linemap_get_expansion_line, linemap_get_expansion_filename): New
2437 functions that are private to libcpp.
2438 (linemap_assert): New macro.
2439 (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
2440 (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
2441 (linemap_macro_map_loc_unwind_toward_spelling)
2442 (linemap_macro_map_loc_to_exp_point)
2443 (first_map_in_common_1, first_map_in_common): New static
2444 functions.
2445 (new_linemap): Define new static functions. Extracted and
2446 enhanced from ...
2447 (linemap_add): ... here. Use linemap_assert in lieu of abort
2448 previously.
2449 (linemap_tracks_macro_expansion_locs_p)
2450 (linemap_add_macro_token, linemap_macro_expansion_map_p)
2451 (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
2452 (linemap_macro_map_loc_to_def_point)
2453 (linemap_macro_map_loc_unwind_once)
2454 (linemap_step_out_once, linemap_map_get_index)
2455 (linemap_get_source_line,linemap_get_source_column)
2456 (linemap_get_file_path, linemap_map_get_macro_name)
2457 (linemap_location_in_system_header_p)
2458 (linemap_location_originated_from_system_header_p)
2459 (linemap_location_from_macro_expansion_p)
2460 (linemap_tracks_macro_expansion_locs_p)
2461 (linemap_resolve_location, linemap_expand_location)
2462 (linemap_expand_location_full)
2463 (linemap_tracks_macro_expansion_locs_p)
2464 (linemap_position_for_line_and_column, linemap_compare_locations):
2465 Define new public functions.
2466 (linemap_init): Initialize ordinary and macro maps information in
2467 the map set.
2468 (linemap_check_files_exited): Use the new accessors.
2469 (linemap_free): Remove this dead code.
2470 (linemap_line_start): Assert this uses an ordinary map. Adjust to
2471 use the new ordinary map accessors and data structures. Don't
2472 overflow past the lowest possible macro token's location.
2473 (linemap_position_for_column): Assert the ordinary maps of the map
2474 set are really ordinary. Use ordinary map accessors.
2475 (linemap_lookup): Keep the same logic but generalize to allow
2476 lookup of both ordinary and macro maps. Do not crash when called
2477 with an empty line table.
2478 * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
2479 new API of line-map.h.
2480 * directives.c (start_directive, do_line, do_linemarker)
2481 (do_linemarker): Likewise.
2482 * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
2483 (make_cpp_dir, cpp_make_system_header): Likewise.
2484 * init.c (cpp_read_main_file): Likewise.
2485 * internal.h (CPP_INCREMENT_LINE): Likewise.
2486 (linemap_enter_macro, linemap_add_macro_token)
2487 (linemap_get_expansion_line, linemap_get_expansion_filename): New
2488 functions private to libcpp.
2489 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
2490 (skip_line_comment, skip_whitespace, lex_raw_string)
2491 (_cpp_lex_direct): Likewise.
2492 * macro.c (_cpp_builtin_macro_text): Likewise.
2493 (_cpp_aligned_alloc): Initialize the new name member of the macro.
2494 * traditional.c (copy_comment, _cpp_scan_out_logical_line):
2495 Likewise.
2496 * errors.c (cpp_diagnostic): Adjust to new linemap API.
2497
1dc92c59 24982011-08-28 Dodji Seketeli <dodji@redhat.com>
2499
2500 * line-map.c (linemap_add): Assert that reason must not be
2501 LC_RENAME when called for the first time on a "main input file".
2502
6ea2c7a3 25032011-08-22 Gabriel Charette <gchare@google.com>
2504
2505 * init.c (cpp_create_reader): Inititalize forced_token_location_p.
2506 * internal.h (struct cpp_reader): Add field forced_token_location_p.
2507 * lex.c (_cpp_lex_direct): Use forced_token_location_p.
2508 (cpp_force_token_locations): New.
2509 (cpp_stop_forcing_token_locations): New.
2510
985e7f10 25112011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2512
2513 PR libstdc++/1773
2514 * init.c (cpp_init_builtins): Define __cplusplus 19971L.
2515
094a55ba 25162011-08-18 Joseph Myers <joseph@codesourcery.com>
2517
2518 * include/cpplib.h (struct cpp_options): Fix typo.
2519
6f6f3dd7 25202011-08-18 Joseph Myers <joseph@codesourcery.com>
2521
2522 * include/cpplib.h (struct cpp_options): Add rliterals.
2523 * init.c (struct lang_flags, lang_defaults): Add rliterals.
2524 (cpp_set_lang): Set rliterals option.
2525 (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
2526 * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
2527
80ea6373 25282011-08-15 Gabriel Charette <gchare@google.com>
2529
2530 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
2531 Update all users to use linemap_position_for_column instead.
2532
d44dc666 25332011-07-28 Gabriel Charette <gchare@google.com>
2534
2535 * include/line-map.h (struct line_maps):
2536 Remove unused field last_listed. Update all users.
2537
6b4db1bd 25382011-07-28 H.J. Lu <hongjiu.lu@intel.com>
2539
2540 * configure.ac: Set need_64bit_hwint to yes for x86 targets.
2541 * configure: Regenerated.
2542
80e4662c 25432011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2544
2545 * system.h [__cplusplus]: Wrap C function declarations in extern "C".
2546
6678cb4e 25472011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2548 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2549
2550 PR bootstrap/49794
2551 * configure.ac: Test AM_ICONV with CXX.
2552 * configure: Regenerate.
2553 * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
2554
c219ee5c 25552011-07-15 Dodji Seketeli <dodji@redhat.com>
2556
2557 * directives.c (struct if_stack): Use source_location as type
2558 here.
2559 * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
2560 indent, def_pragma, used_define, used_undef>: Properly use
2561 source_location as parameter type, rather than unsigned int.
2562
14f27bc6 25632011-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2564
2565 PR target/39150
2566 * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
2567 like i[34567]86-*-solaris2.1[0-9]*.
2568 * configure: Regenerate.
2569
414663ef 25702011-06-16 Jason Merrill <jason@redhat.com>
2571
2572 PR c++/45399
2573 * lex.c (lex_raw_string): Don't check for embedded NUL.
2574
2c694d44 25752011-06-06 Dodji Seketeli <dodji@redhat.com>
2576
2577 PR preprocessor/48532
2578 * directives.c (do_pragma): Don't forget the invocation location
2579 when parsing the pragma name of a namespaced pragma directive.
2580
9793dd8e 25812011-05-29 John Tytgat <John.Tytgat@aaug.net>
2582
2583 * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
2584
cef70b8a 25852011-05-22 Uros Bizjak <ubizjak@gmail.com>
2586
2587 PR target/49104
2588 * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
2589 is defined. Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
2590
cdd0bb4b 25912011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
2592
2593 * system.h (ENUM_BITFIELD): Remove.
2594
0ff0cd04 25952011-04-24 Jakub Jelinek <jakub@redhat.com>
2596
2597 PR preprocessor/48740
2598 * lex.c (lex_raw_string): When raw string ends with
2599 ??) followed by raw prefix and ", ensure it is preprocessed
2600 with ??) rather than ??].
2601
dd045aee 26022011-04-20 Jim Meyering <meyering@redhat.com>
2603
2604 * files.c (destroy_cpp_file): Remove useless if-before-free.
2605 * init.c (cpp_destroy): Likewise.
2606 * macro.c (replace_args): Likewise.
2607 * pch.c (cpp_valid_state): Likewise.
2608
bb7824b5 26092011-03-25 Kai Tietz <ktietz@redhat.com>
2610
2611 * files.c (file_hash_eq): Use filename_cmp
2612 instead of strcmp.
2613 (nonexistent_file_hash_eq): Likewise.
2614 (remap_filename): Likewise.
2615 Handle absolute DOS-path,
2616 (append_file_to_dir): Check for IS_DIR_SEPARATOR
2617 instead of slash.
2618 (read_name_map): Likewise.
2619 * linemap.c (linemap_add): Use filename_cmp
2620 instead of strcmp.
2621 * mkdeps.c (apply_vpath): Use filename_ncmp
2622 instead of strncmp.
2623 (deps_restore): Use filename_cmp instead of
2624 strcmp.
2625 * init.c (read_original_directory): Use
2626 IS_DIR_SEPARATOR instead of checking for slash.
2627
00e59df9 26282011-03-21 Michael Meissner <meissner@linux.vnet.ibm.com>
2629
2630 PR preprocessor/48192
2631 * directives.c (do_ifdef): Do not consider conditional macros as
2632 being defined.
2633 (do_ifndef): Ditto.
2634 * expr.c (parse_defined): Ditto.
2635
70ebee13 26362011-03-18 Richard Henderson <rth@redhat.com>
2637
2638 PR bootstrap/45381
2639 * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
2640
65861c3e 26412011-11-04 Eric Botcazou <ebotcazou@adacore.com>
cc0a8c77 2642 Jakub Jelinek <jakub@redhat.com>
65861c3e 2643
2644 PR preprocessor/39213
2645 * directives.c (end_directive): Call _cpp_remove_overlay for deferred
2646 pragmas as well in traditional mode.
2647
be04fdf9 26482010-11-17 Ian Lance Taylor <iant@google.com>
2649
2650 PR bootstrap/45538
2651 * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of
2652 AC_LANG based on ENABLE_BUILD_WITH_CXX.
2653
560ab0b2 26542010-11-16 Kai Tietz <kai.tietz@onevision.com>
2655
2656 PR preprocessor/17349
2657 * lex.c (save_comment): Handle in argument passing c++
2658 comments special.
2659
075f1161 26602010-11-02 Ian Lance Taylor <iant@google.com>
2661
2662 * configure.ac: Use AC_SYS_LARGEFILE.
2663 * configure: Rebuild.
2664 * config.in: Rebuild.
2665
bc3d3e89 26662010-10-19 Basile Starynkevitch <basile@starynkevitch.net>
075f1161 2667
bc3d3e89 2668 * line-map.h (source_location): Remove obsolete comment
2669 mentioning location_s.
2670
0d601ff4 26712010-09-29 Kai Tietz <kai.tietz@onevision.com>
2672
2673 PR preprocessor/45362
2674 * directives.c (cpp_pop_definition): Make static.
2675 (do_pragma_push_macro): Reworked to store text
2676 definition.
2677 (do_pragma_pop_macro): Add free text definition.
2678 (cpp_push_definition): Removed.
2679 * include/cpplib.h (cpp_push_definition): Removed.
2680 (cpp_pop_definition): Likewise.
2681 * internal.h (def_pragma_macro): Remove member 'value'
2682 and add new members 'definition', 'line',
2683 'syshdr', 'sued' and 'is_undef'.
2684 * pch.c (_cpp_restore_pushed_macros): Rework to work
2685 on text definition and store additional macro flags.
2686 (_cpp_save_pushed_macros): Likewise.
2687
5ae82d58 26882010-09-29 Joseph Myers <joseph@codesourcery.com>
2689
2690 * include/cpplib.h (cpp_options): Rename warn_deprecated,
2691 warn_traditional, warn_long_long and pedantic.
2692 * directives.c (directive_diagnostics, _cpp_handle_directive):
2693 Update names of cpp_options members.
2694 * expr.c (cpp_classify_number, eval_token): Update names of
2695 cpp_options members.
2696 * init.c (cpp_create_reader, post_options): Update names of
2697 cpp_options members.
2698 * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
2699 cpp_options members.
2700 * macro.c (parse_params): Update names of cpp_options members.
2701
ced52ffd 27022010-09-15 Ian Lance Taylor <iant@google.com>
2703
2704 * init.c: Fix type name in comment.
2705
df863d33 27062010-08-31 Jakub Jelinek <jakub@redhat.com>
2707
2708 PR preprocessor/45457
2709 * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
2710 needed.
2711 * directives.c (do_ifdef, do_ifndef): Likewise.
2712
9e76b586 27132010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2714
2715 * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
2716
b315ae35 27172010-08-24 Richard Henderson <rth@redhat.com>
2718
2719 PR bootstrap/45376
2720 * configure.ac (HAVE_SSE4): New check.
2721 * configure, config.in: Rebuild.
2722 * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
2723
8ab29ece 27242010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2725
2726 * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
2727 etc. on Solaris 2/x86.
2728
2431e8ba 27292010-08-21 Richard Henderson <rth@redhat.com>
2730 Andi Kleen <ak@linux.intel.com>
2731 David S. Miller <davem@davemloft.net>
2732
2733 * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
2734 (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
2735 (ptrdiff_t): Check via AC_CHECK_TYPE.
2736 * config.in, configure: Rebuild.
2737 * system.h: Include stdint.h, if available.
2738 * lex.c (WORDS_BIGENDIAN): Provide default.
2739 (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
2740 acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
2741 search_line_sse2, search_line_sse42, init_vectorized_lexer,
2742 search_line_fast): New.
2743 (_cpp_clean_line): Use search_line_fast. Restructure the fast
2744 loop to make it clear when we're leaving the loop. Stay in the
2745 fast loop for non-trigraph '?'.
2746
25692381 27472010-06-11 Jakub Jelinek <jakub@redhat.com>
2748
2749 * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
2750 callback.
2751 (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
2752 (cpp_macro_definition): Remove const qual from second argument.
2753 * macro.c (enter_macro_context): Call user_builtin_macro callback for
2754 NODE_BUILTIN !NODE_USED macros.
2755 (warn_of_redefinition): Likewise. Remove const qual from second
2756 argument.
2757 (cpp_macro_definition): Likewise.
2758 * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
2759 for NODE_BUILTIN !NODE_USED macros.
2760
abf6a617 27612010-06-10 Joseph Myers <joseph@codesourcery.com>
2762
2763 * include/cpplib.h (struct cpp_options): Remove show_column.
2764 * init.c (cpp_create_reader, post_options): Don't set show_column.
2765
9d135bb6 27662010-06-09 Joern Rennecke <joern.rennecke@embecosm.com>
2767
2768 PR bootstrap/44432
2769 * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
2770 check that C++ compiler works.
2771 * configure: Regenerate.
2772
ba72912a 27732010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
2774
2775 * include/symtab.h (ht_identifier_ptr): New.
2776
050318d9 27772010-06-03 Joern Rennecke <joern.rennecke@embecosm.com>
2778 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2779
2780 PR bootstrap/42798
2781 * configure.ac: Check for declaration of 'basename(char *)'.
2782 * configure: Regenerate.
2783 * config.in: Regenerate.
2784
39012afb 27852010-04-25 Joseph Myers <joseph@codesourcery.com>
2786
2787 * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
2788 * init.c (lang_defaults): Add entries for new language variants.
2789 (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
2790 variants.
2791
721e9705 27922010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
2793
2794 PR cpp/43195
2795 * files.c (report_missing_guard): Test for #pragma once.
2796
3a79f5da 27972010-04-07 Simon Baldwin <simonb@google.com>
2798
2799 * directives.c (do_diagnostic): Add warning reason argument,
2800 call appropriate error reporting function for code.
2801 (directive_diagnostics): Call specific warning functions with
2802 warning reason where appropriate.
2803 (do_error, do_warning, do_pragma_dependency): Add warning reason
2804 argument to do_diagnostic calls.
2805 * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
2806 _cpp_create_definition): Call specific warning functions with
2807 warning reason where appropriate.
2808 * Makefile.in: Add new diagnostic functions to gettext translations.
2809 * include/cpplib.h (struct cpp_callbacks): Add warning reason code
2810 to error callback.
2811 (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
2812 CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
2813 (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
2814 CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
2815 CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
2816 CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
2817 CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
2818 CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
2819 CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
2820 warning reason codes.
2821 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
2822 cpp_warning_with_line, cpp_pedwarning_with_line,
2823 cpp_warning_with_line_syshdr): New specific error reporting functions.
2824 * pch.c (cpp_valid_state): Call specific warning functions with
2825 warning reason where appropriate.
2826 * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
2827 diagnostic handlers.
2828 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
2829 cpp_warning_with_line, cpp_pedwarning_with_line,
2830 cpp_warning_with_line_syshdr): New specific error reporting functions.
2831 * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
2832 specific warning functions with warning reason where appropriate.
2833 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
2834 warn_about_normalization, lex_identifier_intern, lex_identifier,
2835 _cpp_lex_direct): Ditto.
2836 * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
2837 narrow_str_to_charconst): Ditto.
2838
56e2ce2d 28392010-04-06 Jakub Jelinek <jakub@redhat.com>
2840
2841 PR preprocessor/43642
2842 * lex.c (lex_raw_string): Change type of TYPE variable to
2843 unsigned char.
2844
e0934084 28452010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2846
2847 * aclocal.m4: Regenerate.
2848
7fe0ef3a 28492010-03-29 Jason Merrill <jason@redhat.com>
2850
3a45011c 2851 More N3077 raw string changes
2852 * charset.c (cpp_interpret_string): Don't transform UCNs in raw
2853 strings.
2854 * lex.c (bufring_append): Split out from...
2855 (lex_raw_string): ...here. Undo trigraph and line splicing
2856 transformations. Do process line notes in multi-line literals.
2857 (_cpp_process_line_notes): Ignore notes that were already handled.
2858
7fe0ef3a 2859 Some raw string changes from N3077
2860 * charset.c (cpp_interpret_string): Change inner delimiters to ().
2861 * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter.
2862
65f40615 28632010-02-11 Jakub Jelinek <jakub@redhat.com>
2864
2865 * init.c (read_original_filename): Don't call read_original_directory
2866 if _cpp_handle_directive returns 0.
2867
0074cd57 28682010-01-01 Joseph Myers <joseph@codesourcery.com>
2869
2870 PR preprocessor/41947
2871 * expr.c (cpp_classify_number): Give error for hexadecimal
2872 floating-point constant with no digits before or after point.
2873
116f0a5f 28742009-11-20 Arnaud Charlet <charlet@adacore.com>
2875
2876 * macro.c (enter_macro_context): Call cb.used callback if defined.
2877 * directives.c (do_idef, do_ifndef): Ditto.
2878 * include/cpplib.h (struct cpp_callbacks): Add used callback.
2879
038c21f1 28802009-11-11 Kai Tietz <kai.tietz@onevision.com>
2881
2882 * directives.c (do_pragma_push_macro): New pragma handler.
2883 (do_pragma_pop_macro): Likewise.
2884 (_cpp_init_internal_pragmas): Add push_macro and
2885 pop_macro handler to internal pragmas.
2886 (lex_macro_node_from_str): Removed.
2887 (cpp_push_definition): Replace lex_macro_node_from_str
2888 by _cpp_lex_identifier.
2889 (cpp_pop_definition): Likewise.
2890 * internal.h (_cpp_lex_identifier): New prototype.
2891 (def_pragma_macro): New structure.
2892 (cpp_reader): New member pushed_macros.
2893 * lex.c (_cpp_lex_identifier): New function.
2894 (lex_identifier_intern): New function.
2895 * init.c (cpp_create_reader): Initialize pushed_macros
2896 member.
2897 (cpp_destroy): Free elements in pushed_macros member.
2898 * pch.c (_cpp_save_pushed_macros): New function.
2899 (_cpp_restore_pushed_macros): Likewise.
2900 (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
2901 (cpp_read_state): Use _cpp_restore_pushed_macros.
2902
538ba11a 29032009-10-19 Jakub Jelinek <jakub@redhat.com>
2904
2905 * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
2906 (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
2907 and char32_cset_desc.
2908 (converter_for_type): Handle CPP_UTF8STRING.
2909 (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
2910 * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
2911 (parse_include): Reject raw strings.
2912 * include/cpplib.h (CPP_UTF8STRING): New token type.
2913 * internal.h (struct cpp_reader): Add utf8_cset_desc field.
2914 * lex.c (lex_raw_string): New function.
2915 (lex_string): Handle u8 string literals, call lex_raw_string
2916 for raw string literals.
2917 (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
2918 sequences.
2919 * macro.c (stringify_arg): Handle CPP_UTF8STRING.
2920
af4d2883 29212009-10-14 Jakub Jelinek <jakub@redhat.com>
2922
2923 PR preprocessor/41543
2924 * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
2925 * line-map.c (linemap_init): Initialize highest_location and
2926 highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
2927
8e83a065 29282009-10-09 Jason Merrill <jason@redhat.com>
2929
2930 * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
2931
8f2ff12e 29322009-10-09 Neil Vachharajani <nvachhar@google.com>
2933
2934 * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
2935 sccs.
2936
fc25a827 29372009-09-23 Loren J. Rittle <ljrittle@acm.org>
2938
2939 * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
2940 * configure: Rebuilt.
2941
fa12a6a5 29422009-09-22 Richard Guenther <rguenther@suse.de>
2943
2944 PR pch/38987
2945 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
2946
c25f2689 29472009-09-18 Chris Demetriou <cgd@google.com>
2948
2949 PR preprocessor/28435:
2950 * include/cpplib.h (struct cpp_options): Add new member
2951 deps.need_preprocessor_output.
2952 * files.c (open_file_failed): If preprocessor output is needed
2953 always report an error.
2954
a4f7c8f7 29552009-09-13 Kai Tietz <kai.tietz@onevision.com>
2956
2957 * configure.ac: Set for i?86-w64-mingw*
2958 need_64bit_hwint to yes.
2959 * configure: Regenerated.
2960
3f24af9b 29612009-09-10 Jason Merrill <jason@redhat.com>
2962
2963 * directives.c (cpp_define): constify.
2964
2a50bfcf 29652009-09-02 Ian Lance Taylor <iant@google.com>
2966
2967 * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
2968
81a71e2b 29692009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2970
2971 * configure.ac (AC_PREREQ): Bump to 2.64.
2972
cd9a469c 29732009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2974
2975 * aclocal.m4: Regenerate.
2976 * config.in: Regenerate.
2977 * configure: Regenerate.
2978
ed184982 29792009-08-17 Tom Tromey <tromey@redhat.com>
2980
2981 PR preprocessor/41067:
2982 * charset.c (convert_escape): Add missing ":" to error text.
2983
7ad75c55 29842009-07-27 Douglas B Rupp <rupp@gnat.com>
2985
2986 * include/cpplib.h (INO_T_CPP): New macro.
2987 (struct cpp_dir): Use it.
2988
80b97ef3 29892009-07-20 Jerry Quinn <jlquinn@optonline.net>
2990
2991 PR regression/40800
2992 * configure.ac: Use = instead of == for testing
2993 ENABLE_BUILD_WITH_CXX.
2994 * configure: Rebuild.
2995
723ebaea 29962009-07-17 Jerry Quinn <jlquinn@optonline.net>
2997
2998 * directives.c (do_linemarker, do_line): Use CPP_STRING for
2999 ignored enum value.
3000 * files.c (find_file_in_dir): Add cast from void* to char*.
3001 * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
3002 * Makefile.in: (WARN_CFLAGS): Use general and C-specific
3003 warnings.
3004 (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
3005 ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
3006 COMPILER_FLAGS): New.
3007 (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
3008 (COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS
3009 instead of ALL_CFLAGS.
3010 * configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings
3011 from other warnings. Add -Wc++-compat to C-specific warnings.
3012 Check for --enable-build-with-cxx. Set and substitute
3013 ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES
3014 according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before
3015 AC_CHECK_HEADERS.
3016 * configure: Rebuild.
3017 * include/cpp-id-data.h: Remove extern "C".
3018 * include/line-map.h: Likewise.
3019 * include/mkdeps.h: Likewise.
3020 * include/symtab.h: Likewise.
3021 * internal.h: Likewise.
3022
78ed8e3d 30232009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3024
3025 * directives.c (parse_include): Add location argument. Update all
3026 calls.
3027 (parse_answer): Likewise.
3028 (do_include_common): Error with exact location.
3029 (parse_assertion): Likewise.
3030
46821594 30312009-06-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
3032
3033 * expr.c (num_div_op): Take explicit location.
3034
52b290f1 30352009-06-17 Ian Lance Taylor <iant@google.com>
3036
3037 * include/cpplib.h (progname): Don't declare.
3038
2a6a6991 30392009-06-12 Ian Lance Taylor <iant@google.com>
3040
3041 * include/cpplib.h (struct cpp_options): Add
3042 warn_cxx_operator_names field.
3043 (NODE_WARN_OPERATOR): Define.
3044 (struct cpp_hashnode): Increase flags field to 10 bits, decrease
3045 type to 6 bits.
3046 * init.c (mark_named_operators): Add flags parameter.
3047 (cpp_post_options): Pick flags value to pass to
3048 mark_named_operators.
3049 * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
3050 identifier is an operator name in C++.
3051
b559b9e2 30522009-06-01 Aldy Hernandez <aldyh@redhat.com>
3053
3054 * include/line-map.h (LAST_SOURCE_COLUMN): New.
3055
e61157d7 30562009-06-01 Ian Lance Taylor <iant@google.com>
3057
3058 * include/cpp-id-data.h: Add extern "C".
3059 * include/line-map.h: Likewise.
3060 * include/mkdeps.h: Likewise.
3061 * include/symtab.h: Likewise.
3062 * internal.h: Likewise.
3063
26dbec0a 30642009-05-15 Ian Lance Taylor <iant@google.com>
3065
3066 * include/cpplib.h (enum cpp_builtin_type): Rename from enum
3067 builtin_type. Change all uses.
3068
5b500807 30692009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3070
3071 PR cpp/36674
3072 * directives (do_linemarker): Compensate for the increment in
3073 location that occurs when we reach the end of line.
3074 * files (_cpp_stack_include): Mention _cpp_find_file in the
3075 comment.
3076
2ee04baa 30772009-05-10 Joseph Myers <joseph@codesourcery.com>
3078
3079 * include/cpplib.h (enum cpp_token_fld_kind): Add
3080 CPP_TOKEN_FLD_TOKEN_NO.
3081 (struct cpp_macro_arg, struct cpp_identifier): Define.
3082 (union cpp_token_u): Use struct cpp_identifier for identifiers.
3083 Use struct cpp_macro_arg for macro arguments. Add token_no for
3084 CPP_PASTE token numbers.
3085 * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
3086 do_pragma_poison, parse_assertion): Use val.node.node in place of
3087 val.node.
3088 * expr.c (parse_defined, eval_token): Use val.node.node in place
3089 of val.node.
3090 * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
3091 cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
3092 cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
3093 place of val.arg_no. Use val.node.node in place of val.node.
3094 * macro.c (replace_args, cpp_get_token, parse_params,
3095 lex_expansion_token, create_iso_definition, cpp_macro_definition):
3096 Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
3097 Use val.node.node in place of val.node.
3098
49a657d9 30992009-05-03 Joseph Myers <joseph@codesourcery.com>
3100
3101 * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
3102 UTF-8 sequences.
3103
9c6183dd 31042009-04-25 Joseph Myers <joseph@codesourcery.com>
3105
3106 PR preprocessor/39559
3107 * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
3108 constants larger than intmax_t in C99 mode.
3109
fb1e4f4a 31102009-04-21 Taras Glek <tglek@mozilla.com>
3111
3112 * include/cpp-id-data.h: Update GTY annotations to new syntax.
3113 * include/cpplib.h: Likewise.
3114 * include/line-map.h: Likewise.
3115 * include/symtab.h: Likewise.
3116
ba99525e 31172009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3118
3119 PR c++/14875
3120 * lex.c (cpp_type2name): Take a flags parameter. Call
3121 cpp_named_operator2name for named operators and cpp_digraph2name
3122 for digraphs.
3123 (cpp_digraph2name): New.
3124 (cpp_spell_token): Use it.
3125 (cpp_output_token): Likewise.
3126 * include/cpplib.h (cpp_type2name): Update declaration.
3127 * init.c (cpp_named_operator2name): New.
3128 * internal.h (cpp_named_operator2name): Declare.
3129
9ab71c6b 31302009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3131
3132 PR c++/13358
3133 * init.c (cpp_create_reader): Wlong_long is disabled by default.
3134 * expr.c (cpp_classify_number): Give different messages for C and
3135 C++ front-ends.
3136
941f2388 31372009-04-19 Joseph Myers <joseph@codesourcery.com>
3138
3139 PR preprocessor/20078
3140 * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
3141 field.
3142 * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
3143 (struct cpp_token): Change flags to unsigned short.
3144 * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
3145 (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
3146 (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
3147 tokens.
3148 * macro.c (macro_real_token_count): New.
3149 (enter_macro_context, replace_args): Use macro_real_token_count.
3150 (create_iso_definition): Record whitespace surrounding and digraph
3151 spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
3152 Set extra_tokens and save CPP_PASTE tokens with arg_no set for
3153 multiple consecutive ## tokens.
3154 (_cpp_create_definition): Initialize extra_tokens.
3155 (cpp_macro_definition): Use macro_real_token_count.
3156
3e52c418 31572009-04-18 Joseph Myers <joseph@codesourcery.com>
3158
3159 * directives.c (parse_include): Pass true to check_eol.
3160
1eecdb28 31612009-04-18 Joseph Myers <joseph@codesourcery.com>
3162
3163 PR preprocessor/39646
3164 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
3165 * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
3166 * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
3167 place of LC_RENAME.
3168
6cda323a 31692009-04-18 Joseph Myers <joseph@codesourcery.com>
3170
3171 PR preprocessor/39647
3172 * directives.c (check_eol): Add parameter expand.
3173 (do_undef, parse_include, do_line, do_linemarker, do_ident,
3174 do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
3175 do_else, do_endif, do_assert, do_unassert): All callers changed.
3176 Pass true from do_line, false elsewhere.
3177
e21164ef 31782009-04-12 Joseph Myers <joseph@codesourcery.com>
3179
3180 PR preprocessor/31869
3181 * macro.c (stringify_arg): Handle NULL source token in padding
3182 token where previous padding token did not have source token with
3183 preceding whitespace.
3184
6bc9506f 31852009-04-09 Jakub Jelinek <jakub@redhat.com>
3186
3187 * Makefile.in: Change copyright header to refer to version
3188 3 of the GNU General Public License and to point readers at the
3189 COPYING3 file and the FSF's license web page.
3190 * charset.c: Likewise.
3191 * directives-only.c: Likewise.
3192 * directives.c: Likewise.
3193 * errors.c: Likewise.
3194 * expr.c: Likewise.
3195 * files.c: Likewise.
3196 * identifiers.c: Likewise.
3197 * include/cpp-id-data.h: Likewise.
3198 * include/cpplib.h: Likewise.
3199 * include/line-map.h: Likewise.
3200 * include/mkdeps.h: Likewise.
3201 * include/symtab.h: Likewise.
3202 * init.c: Likewise.
3203 * internal.h: Likewise.
3204 * lex.c: Likewise.
3205 * line-map.c: Likewise.
3206 * macro.c: Likewise.
3207 * makeucnid.c: Likewise.
3208 * mkdeps.c: Likewise.
3209 * pch.c: Likewise.
3210 * symtab.c: Likewise.
3211 * system.h: Likewise.
3212 * traditional.c: Likewise.
3213 * ucnid.tab: Likewise.
3214 * ucnid.h: Regenerate.
3215
5840fdcf 32162009-04-01 Janis Johnson <janis187@us.ibm.com>
3217
f8ed6d41 3218 PR c/39027
3219 * include/cpplib.h (CPP_N_DEFAULT): Define.
3220 * expr.c (interpret_float_suffix): Recognize d or D for double,
3221 return new value for default.
3222 (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
3223
5840fdcf 3224 PR c/33466
3225 * expr.c (interpret_float_suffix): Reject invalid suffix that uses
3226 letters from decimal float and fixed-point suffixes.
3227
ff903809 32282009-03-31 Joseph Myers <joseph@codesourcery.com>
3229
3230 PR preprocessor/15638
3231 * files.c (_cpp_find_file): Call open_file_failed after diagnosing
3232 invalid PCH.
3233 (open_file_failed): Make error for missing file fatal.
3234 * include/cpplib.h (CPP_DL_FATAL): Define.
3235
bfba65a4 32362009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net>
3237
3238 PR preprocessor/31932:
3239 * internal.h: Don't mention HAVE_ICONV_H.
3240 * configure, config.in: Rebuild.
3241 * configure.ac: Don't check for iconv.h.
3242
102a7306 32432009-03-30 Tom Tromey <tromey@redhat.com>
3244
3245 PR preprocessor/39512:
3246 * line-map.c (linemap_init): Initialize 'reallocator' field.
3247
4514949a 32482009-03-30 Jakub Jelinek <jakub@redhat.com>
3249
3250 PR target/39558
3251 * macro.c (cpp_get_token): If macro_to_expand returns NULL
3252 and used some tokens, add CPP_PADDING before next token.
3253
7f5f3953 32542009-03-29 Joseph Myers <joseph@codesourcery.com>
3255
3256 PR preprocessor/34695
3257 * makedepend.c: Remove.
3258 * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
3259 (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
3260 * directives.c (cpp_errors): Remove.
3261 * errors.c (print_location, _cpp_begin_message, v_message):
3262 Remove.
3263 (cpp_error, cpp_error_with_line): Always use error callback.
3264 (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
3265 * include/cpplib.h (cpp_options): Remove pedantic_errors,
3266 inhibit_warnings, warn_system_headers, inhibit_errors,
3267 warnings_are_errors, client_diagnostic.
3268 (cpp_callbacks): Add extra arguments to error callback; make it
3269 return bool.
3270 (cpp_finish): Return void.
3271 (cpp_destroy): Remove inaccurate comment about return value.
3272 (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
3273 (CPP_DL_NOTE): Define.
3274 * include/line-map.h (linemap_print_containing_files): Remove.
3275 * init.c (cpp_finish): Do not check for or return number of
3276 errors.
3277 * internal.h (cpp_reader): Remove errors field.
3278 * line-map.c (linemap_print_containing_files): Remove.
3279 * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
3280 about previous definition. Only emit it if previous diagnostic
3281 was emitted.
3282
d5a78dd0 32832009-03-28 Joseph Myers <joseph@codesourcery.com>
3284
3285 * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
3286 mkinstalldirs.
3287
0ac758f7 32882009-03-18 Jakub Jelinek <jakub@redhat.com>
3289
3290 * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
3291
7811eab5 32922009-02-21 Joseph Myers <joseph@codesourcery.com>
3293
3294 * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
3295 header name.
3296 (_cpp_lex_direct): Handle this.
3297
b5c49426 32982009-02-15 Richard Guenther <rguenther@suse.de>
3299
3300 Revert last change.
3301
76549266 33022009-02-13 Richard Guenther <rguenther@suse.de>
3303
3304 * configure.ac: Enable LFS.
3305 * configure: Re-generate.
3306 * config.in: Likewise.
3307
e7ae053d 33082009-01-05 Ben Elliston <bje@au.ibm.com>
3309
3310 * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
3311 (.po.pox): Likewise.
3312 (po/$(PACKAGE).pot): Likewise.
3313
c1203b1c 33142008-12-10 Alexandre Oliva <aoliva@redhat.com>
3315
3316 PR target/37033
3317 * pch.c (cpp_valid_state): Improve message for poisoned symbols.
3318 Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
3319
cd740bd5 33202008-11-29 Joseph Myers <joseph@codesourcery.com>
3321
3322 * lex.c (cpp_token_len): Use 6 as default length.
3323
ae5c166d 33242008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org>
3325
3326 * expr.c (struct op): Add location.
3327 (_cpp_parse_expr): Propagate locations throught the stack
3328 of expressions.
3329 (reduce): Likewise.
3330 (check_promotion): Use explicit location in errors.
3331
956c6108 33322008-10-05 Matthew Gingell <gingell@adacore.com>
3333 Arnaud Charlet <charlet@adacore.com>
3334
3335 * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
3336 (cpp_get_comments): New function.
3337 * internal.h (struct cpp_reader): Add comments field.
3338 * init.c (cpp_destroy): Free comments.
3339 * lex.c (store_comment, cpp_get_comments): New functions.
3340 (comments): New struct.
3341 (save_comment): Store comments in comments struct.
3342
2ad0b097 33432008-09-18 Simon Baldwin <simonb@google.com>
3344
3345 * include/cpplib.h (struct cpp_options): Add new boolean flag
3346 warn_builtin_macro_redefined.
3347 * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
3348 * (struct builtin_operator): Split out from previous struct builtin,
3349 enhance extra const correctness.
3350 * (struct builtin_macro): Split out from previous struct builtin, add
3351 new always_warn_if_redefined flag, enhance const correctness.
3352 * (mark_named_operators): Use struct builtin_operator.
3353 * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
3354 to builtins selectively.
3355 * macro.c (warn_of_redefinition): Return false if a builtin macro
3356 is not flagged with NODE_WARN.
3357
408c2285 33582008-07-31 Jakub Jelinek <jakub@redhat.com>
3359
3360 PR preprocessor/36649
3361 * files.c (struct report_missing_guard_data): New type.
3362 (report_missing_guard): Put paths into an array instead of printing
3363 them right away. Return 1 rather than 0.
3364 (report_missing_guard_cmp): New function.
3365 (_cpp_report_missing_guards): Sort and print paths gathered by
3366 report_missing_guard callback.
3367
98e29890 33682008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3369
3370 PR 28079
3371 * directives.c (strtolinenum): Handle overflow.
3372 (do_line): Give a warning if line number overflowed.
3373 (do_linemarker): Update call to strtolinenum.
3374
4999c35b 33752008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3376
3377 * include/line-map.h (linenum_type): New typedef.
3378 (struct line_map): Use it.
3379 (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
3380 (SOURCE_COLUMN): Likewise.
3381 * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
3382 source_location values in a variable of type linenum_type.
3383 * directives.c (struct if_stack): Use linenum_type.
3384 (strtoul_for_line): Rename as strtolinenum.
3385 (do_line): Use linenum_type.
3386 (do_linemarker): Use linenum_type and strtolinenum.
3387 (_cpp_do_file_change): Use linenum_t.
3388 * line-map.c (linemap_add): Likewise.
3389 (linemap_line_start): Likewise.
3390 * traditional.c (struct fun_macro): 'line' is a source_location.
3391 * errors.c (print_location): Use linenum_type.
3392 * directives-only.c (_cpp_preprocess_dir_only): Likewise.
3393 * internal.h (CPP_INCREMENT_LINE): Likewise.
3394 * lex.c (_cpp_skip_block_comment): Use source_location.
cc0a8c77 3395
89768577 33962008-07-14 Ben Elliston <bje@au.ibm.com>
3397
3398 * include/cpplib.h (NODE_CONDITIONAL): New.
3399 (struct cpp_callbacks): New macro_to_expand field.
3400 (struct cpp_hashnode): Adjust size of flags and type fields.
3401 (cpp_peek_token): Prototype.
3402 * lex.c (cpp_peek_token): New function.
3403 (_cpp_temp_token): Protect pre-existing lookaheads.
3404 * macro.c (cpp_get_token): Expand any conditional macros.
3405 (_cpp_backup_tokens_direct): New.
3406 (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
3407 (warn_of_redefinition): Silently allow redefined conditional
3408 macros.
3409 (_cpp_create_definition): Remove the conditional flag when a user
3410 defines one of the conditional macros.
3411 * internal.h (_cpp_backup_tokens_direct): New prototype.
3412
403c2b12 34132008-06-13 Andrew Haley <aph@redhat.com>
3414
3415 PR preprocessor/33305
3416 * macro.c (replace_args): Print a warning for empty macro
3417 arguments in C89 and C++.
3418
5b2c7553 34192008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3420
3421 * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
3422 * configure: Regenerate.
3423
b9de6413 34242008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3425
3426 * Makefile.in (datarootdir): New variable.
3427
bfa57d81 34282008-06-12 H.J. Lu <hongjiu.lu@intel.com>
3429
3430 PR preprocessor/36479
3431 * charset.c (cpp_interpret_string_notranslate): Also set
3432 narrow_cset_desc.width.
3433
6af9f7ea 34342008-06-07 Joseph Myers <joseph@codesourcery.com>
3435
3436 * configure.ac (parisc*64*-*-*): Remove.
3437 * configure: Regenerate.
3438
536a48ee 34392008-05-30 Tom Tromey <tromey@redhat.com>
3440
3441 PR preprocessor/36320:
3442 * internal.h (_cpp_parse_expr): Update.
3443 * expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error
3444 messages.
3445 * directives.c (do_if): Update.
3446 (do_elif): Require expression if processing group.
3447
f4d02485 34482008-05-30 Danny Smith <dannysmith@users.sourceforge.net>
3449
3450 * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
3451
c0770282 34522008-05-21 Tom Tromey <tromey@redhat.com>
3453
3454 PR preprocessor/27777:
3455 * lex.c (cpp_output_line_to_string): New function.
3456 * internal.h (_cpp_begin_message): Don't declare.
3457 * errors.c (_cpp_begin_message): Now static.
3458 * include/cpplib.h (cpp_output_line_to_string): Declare.
3459 * directives.c (do_diagnostic): Rewrote. Use
3460 cpp_output_line_to_string. Don't use _cpp_begin_message.
3461
dfecde36 34622008-05-21 Tom Tromey <tromey@redhat.com>
3463
3464 * include/symtab.h (HT_ALLOCED): Remove.
3465 (ht_purge): Declare.
3466 * symtab.c (DELETED): New define.
3467 (ht_lookup): Update comment.
3468 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED
3469 code. Use subobject allocator for strings, if it exists.
3470 (ht_expand): Handle deleted entries.
3471 (ht_forall): Likewise.
3472 (ht_purge): New function.
3473 (ht_dump_statistics): Print deletion statistics.
3474
fb9753dc 34752008-05-13 Tom Tromey <tromey@redhat.com>
3476
3477 PR preprocessor/22168:
3478 * include/cpplib.h (struct cpp_options) <objc>: Update
3479 documentation.
3480 * expr.c (eval_token): Warn for use of assertions.
3481 * directives.c (directive_diagnostics): Warn about extensions.
3482 (DEPRECATED): New define.
3483 (DIRECTIVE_TABLE): Use it.
3484
151e90cc 34852008-05-06 Tom Tromey <tromey@redhat.com>
3486
3487 PR preprocessor/35313, PR preprocessor/36088:
3488 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
3489 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
3490
2cd62354 34912008-05-04 David S. Miller <davem@davemloft.net>
3492
3493 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
3494 * configure: Regenerate.
3495
85e51d59 34962008-04-22 Daniel Franke <franke.daniel@gmail.com>
3497
3498 * include/cpplib.h (cpp_define_formatted): New.
3499 * directives.c (cpp_define_formatted): New.
3500
d656d07a 35012008-04-21 Tom Tromey <tromey@redhat.com>
3502
3503 PR libcpp/33415:
3504 * charset.c (_cpp_convert_input): Add buffer_start argument.
3505 Ignore UTF-8 BOM if seen.
3506 * internal.h (_cpp_convert_input): Add argument.
3507 * files.c (struct _cpp_file) <buffer_start>: New field.
3508 (destroy_cpp_file): Free buffer_start, not buffer.
3509 (_cpp_pop_file_buffer): Likewise.
3510 (read_file_guts): Update.
3511
924bbf02 35122008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
3513
3514 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
3515 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
3516 (struct cpp_options): Added uliterals.
3517 (cpp_interpret_string): Update prototype.
3518 (cpp_interpret_string_notranslate): Idem.
3519 * charset.c (init_iconv_desc): New width member in cset_converter.
3520 (cpp_init_iconv): Add support for char{16,32}_cset_desc.
3521 (convert_ucn): Idem.
3522 (emit_numeric_escape): Idem.
3523 (convert_hex): Idem.
3524 (convert_oct): Idem.
3525 (convert_escape): Idem.
3526 (converter_for_type): New function.
3527 (cpp_interpret_string): Use converter_for_type, support u and U prefix.
3528 (cpp_interpret_string_notranslate): Match changed prototype.
3529 (wide_str_to_charconst): Use converter_for_type.
3530 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
3531 * directives.c (linemarker_dir): Macro U changed to UC.
3532 (parse_include): Idem.
3533 (register_pragma_1): Idem.
3534 (restore_registered_pragmas): Idem.
3535 (get__Pragma_string): Support CPP_STRING{16,32}.
3536 * expr.c (eval_token): Support CPP_CHAR{16,32}.
3537 * init.c (struct lang_flags): Added uliterals.
3538 (lang_defaults): Idem.
3539 * internal.h (struct cset_converter) <width>: New field.
3540 (struct cpp_reader) <char16_cset_desc>: Idem.
3541 (struct cpp_reader) <char32_cset_desc>: Idem.
3542 * lex.c (digraph_spellings): Macro U changed to UC.
3543 (OP, TK): Idem.
3544 (lex_string): Add support for u'...', U'...', u"..." and U"...".
3545 (_cpp_lex_direct): Idem.
3546 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
3547 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
3548
6a88da51 35492008-04-18 Paolo Bonzini <bonzini@gnu.org>
3550
3551 PR bootstrap/35457
3552 * aclocal.m4: Regenerate.
3553 * configure: Regenerate.
3554
6e6d82ef 35552008-04-17 Tom Tromey <tromey@redhat.com>
3556
3557 PR libcpp/34866:
3558 * errors.c (cpp_error): Don't reference a token before the start
3559 of the current run.
3560
f521616b 35612008-04-16 Tom Tromey <tromey@redhat.com>
3562
3563 * Makefile.in (TAGS_SOURCES): New variable.
3564 (TAGS): New target.
3565
fc7383ad 35662008-04-11 Kaz Kojima <kkojima@gcc.gnu.org>
3567
3568 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
3569 and shbe-*-*.
3570 * configure: Rebuilt.
3571
34c3de48 35722008-04-02 Joseph Myers <joseph@codesourcery.com>
3573
3574 * include/cpplib.h (struct cpp_callbacks): Add used_define,
3575 used_undef and before_define.
3576 (NODE_USED): Define.
3577 * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
3578 do_ifndef, cpp_pop_definition): Handle new flag and use new
3579 callbacks.
3580 * expr.c (parse_defined): Handle new flag and use new callbacks.
3581 * macro.c (enter_macro_context, _cpp_free_definition): Handle new
3582 flag and use new callbacks.
3583
f2225b1a 35842008-04-01 Jakub Jelinek <jakub@redhat.com>
3585
3586 PR pch/13675
3587 * files.c (struct _cpp_file): Remove pch field.
3588 (pch_open_file): Don't set file->pch, just file->pchname.
3589 (should_stack_file): After pfile->cb.read_pch call
3590 free pchname and clear pchname, don't close file->fd.
3591 Test file->pchname instead of file->pch. Don't close fd after cb.
3592 (_cpp_stack_include): Test file->pchname instead of file->pch.
3593
5a959782 35942008-03-28 Tom Tromey <tromey@redhat.com>
3595
3596 * Makefile.in (POSTCOMPILE): New variable.
3597 (.c.o): Use it.
3598
8302ff7f 35992008-03-13 Tom Tromey <tromey@redhat.com>
3600
3601 PR libcpp/35322:
3602 * directives.c (destringize_and_run): Set pfile->directive.
3603
8bd452d9 36042008-03-06 Markus Milleder <markus.milleder@generali.at>
3605
3606 PR preprocessor/35458
3607 * mkdeps.c (munge): Quote '#' with a '\'.
3608
0c62b06e 36092008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3610
3611 PR preprocessor/35379
3612 * mkdeps.c (deps_write): Ensure the first target always appears
3613 in the first column, without leading backslash newline. Avoid
3614 some more extra whitespace.
3615
6b0c1373 36162008-02-25 Thiemo Seufer <ths@mips.com>
3617
0c62b06e 3618 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
6b0c1373 3619
e297899b 36202008-02-19 Tom Tromey <tromey@redhat.com>
3621
3622 * traditional.c (lex_identifier): Use CPP_HASHNODE.
3623 * lex.c (lex_identifier): Use CPP_HASHNODE.
3624 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
3625 do-while.
3626 * identifiers.c (alloc_node): Change return type.
3627 (_cpp_init_hashtable): Don't cast 'alloc_node'.
3628 (proxy_assertion_broken): New declaration.
3629 (cpp_forall_identifiers): Move comment.
3630 * line-map.c (linemap_add): Comment fix.
3631 (linemap_line_start): Indentation fix.
3632
45f9f140 36332008-01-25 Jakub Jelinek <jakub@redhat.com>
3634
3635 PR preprocessor/34692
3636 * macro.c (collect_args): Add pragma_buff argument. Push
3637 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
3638 than into arguments. Reset prevent_expansion and parsing_args
3639 state at CPP_PRAGMA_EOL/CPP_EOF.
3640 (funlike_invocation_p): Add pragma_buff argument, pass it through
3641 to collect_args.
3642 (enter_macro_context): Add result argument. Adjust
3643 funlike_invocation_p caller. Emit all deferred pragma tokens
3644 gathered during collect_args before the expansion, add a padding
3645 token. Return 2 instead of 1 if any pragma tokens were prepended.
3646 (cpp_get_token): If enter_macro_context returns 2, don't return
3647 a padding token, instead cycle to grab CPP_PRAGMA token.
3648 * directives.c (_cpp_handle_directive): If was_parsing_args
3649 in deferred pragma, leave parsing_args and prevent_expansion as is.
3650
a56d0856 36512008-01-22 Tom Tromey <tromey@redhat.com>
3652
45f9f140 3653 PR c++/34859
a56d0856 3654 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
3655 __STDC_CONSTANT_MACROS.
3656
7a1a608c 36572008-01-07 Fred Fish <fnf@specifix.com>
3658
45f9f140 3659 PR preprocessor/30363
7a1a608c 3660 * traditional.c (replace_args_and_push): Add local variable
cc0a8c77 3661 cxtquote, calculate the replacement text size assuming a
7a1a608c 3662 worst case of every input character quoted with backslash,
3663 and properly handle output quoting of quote characters in
3664 actual arguments used in function-like macros.
3665
cde59b72 36662008-01-03 Tom Tromey <tromey@redhat.com>
3667
45f9f140 3668 PR preprocessor/34602
cde59b72 3669 * directives.c (do_line): Don't try to spell EOF token.
3670 (do_linemarker): Add comment.
3671
2d1f9589 36722007-12-11 DJ Delorie <dj@redhat.com>
3673
3674 * charset.c (convert_using_iconv): Close out any shift states,
3675 returning to the initial state.
3676
64cb8c90 36772007-12-06 Tom Tromey <tromey@redhat.com>
3678
45f9f140 3679 PR c/29172
64cb8c90 3680 * internal.h (struct cpp_reader) <file_hash_entries>: Changed
3681 type.
3682 <file_hash_entries_allocated, file_hash_entries_used>: Removed.
3683 * files.c (FILE_HASH_POOL_SIZE): New macro.
3684 (struct file_hash_entry_pool): New.
3685 (destroy_all_cpp_files): New function.
3686 (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
3687 (new_file_hash_entry): Update.
3688 (free_file_hash_entries): New function.
3689 (_cpp_cleanup_files): Call free_file_hash_entries and
3690 destroy_all_cpp_files.
3691 (cpp_clear_file_cache): New function.
3692 * include/cpplib.h (cpp_clear_file_cache): Declare.
3693
d08a0ab3 36942007-12-03 Tom Tromey <tromey@redhat.com>
3695
45f9f140 3696 PR preprocessor/34288
d08a0ab3 3697 * configure.ac, config.in: Rebuilt.
3698 * configure.ac: Check for ssize_t.
3699
5eb3761c 37002007-11-30 Tom Tromey <tromey@redhat.com>
3701
45f9f140 3702 PR preprocessor/32868
5eb3761c 3703 * macro.c (_cpp_create_definition): Special case
3704 __STDC_FORMAT_MACROS.
3705
bce619a6 37062007-11-16 Michael Matz <matz@suse.de>
3707
3708 * files.c (search_path_head): Fix check for absolute paths.
3709
67015c73 37102007-11-11 Tom Tromey <tromey@redhat.com>
3711
45f9f140 3712 PR c++/17557
67015c73 3713 * include/cpplib.h (cpp_included_before): Declare.
3714 * files.c (struct file_hash_entry) <location>: New field.
3715 (_cpp_find_file): Initialize new field.
3716 (make_cpp_dir): Likewise.
3717 (cpp_included_before): New function.
3718
1991d8eb 37192007-11-01 Tom Tromey <tromey@redhat.com>
3720
45f9f140 3721 PR preprocessor/30805
1991d8eb 3722 * macro.c (paste_tokens): Handle padding token.
3723 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
3724
2d507e67 37252007-10-31 Tom Tromey <tromey@redhat.com>
3726
45f9f140 3727 PR preprocessor/30786
2d507e67 3728 * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
3729 * directives.c (_cpp_do__Pragma): Return error status.
3730 * internal.h (_cpp_do__Pragma): Update.
3731 * directives.c (get__Pragma_string): Back up if EOF seen.
3732
931b0a0f 37332007-09-06 Tom Tromey <tromey@redhat.com>
3734
3735 * internal.h (struct cpp_reader) <invocation_location>: New
3736 field.
3737 (struct cpp_reader) <set_invocation_location>: Likewise.
3738 * init.c (cpp_set_line_map): New function.
3739 * line-map.c (linemap_add): Use linemap's allocator.
3740 * include/line-map.h (GTY): Define.
3741 (line_map_realloc): New typedef.
3742 (struct line_map): Mark with GTY.
3743 (struct line_maps): Likewise.
3744 (struct line_maps) <maps>: Likewise.
3745 (struct line_maps) <reallocator>: New field.
3746 * include/symtab.h (GTY): Conditionally define.
3747 * include/cpplib.h (cpp_set_line_map): Declare.
3748 (cpp_get_token_with_location): Declare.
3749 * macro.c (cpp_get_token): Set invocation_location on the reader.
3750 (cpp_get_token_with_location): New function.
3751
84373723 37522007-08-30 Chao-ying Fu <fu@mips.com>
3753
3754 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
3755 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
3756 (cpp_classify_number): Support decimal fixed-point constants without
3757 exponents.
3758 Warn about fixed-point constants when -pedantic.
3759 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
3760 comments to support fixed-point values.
3761 (CPP_N_FRACT, CPP_N_ACCUM): Define.
3762
36ec4203 37632007-08-18 Tom Tromey <tromey@redhat.com>
3764
45f9f140 3765 PR preprocessor/32974
36ec4203 3766 * directives.c (parse_include): Don't check for EOL when
3767 processing #pragma dependency.
3768
fcde64dc 37692007-07-30 Ollie Wild <aaw@google.com>
3770
3771 * directives-only.c: New file.
3772 * internal.h (struct _cpp_dir_only_callbacks): New.
3773 (_cpp_preprocess_dir_only): New function.
3774 * directives.c (_cpp_handle_directive): Check directives_only before
3775 disabling execution of indented directives.
3776 * files.c (_cpp_stack_file): Add directives_only check.
3777 * include/cpplib.h (struct cpp_options): Add directives_only.
3778 (cpp_init_special_builtins): New function.
3779 * init.c (cpp_init_special_builtins): New function.
3780 (cpp_init_builtins): Move builtin_array initialization to
3781 cpp_init_special_builtins.
3782 (post_options): Check directives_only before setting
3783 pfile->state.prevent_expansion = 1.
3784 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
3785 is expanded inside a directive while -fdirectives-only is enabled.
3786 * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
3787 (libcpp_a_SOURCES): Add directives-only.c.
3788
ddedd1e1 37892007-07-04 Uros Bizjak <ubizjak@gmail.com>
3790
3791 * traditional.c (_cpp_scan_out_logical_line): Initialize
3792 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
3793 fmacro.args to prevent 'may be used uninitialized' warning.
3794
430be8e2 37952007-07-03 Uros Bizjak <ubizjak@gmail.com>
3796
3797 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
3798 Add new constants.
3799 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
3800 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
3801 for 'q' or 'Q' suffixes.
3802
909dc303 38032007-06-17 Danny Smith <dannysmith@users.sourceforge.net
3804
857d7d5e 3805 * files.c (open_file): Correct typo.
909dc303 3806
7d6f49d6 38072007-06-16 Vladimir Prus <vladimir@codesourcery.com>
3808
857d7d5e 3809 * files.c (open_file): Prevent the call
7d6f49d6 3810 for stat from overwriting errno.
3811
be21d64c 38122007-06-09 Vladimir Prus <vladimir@codesourcery.com>
3813
857d7d5e 3814 * files.c (open_file): Account for the
cc0a8c77 3815 fact that on windows, opening a directory gives
3816 EACCES.
be21d64c 3817
d7282a2b 38182007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
3819
3820 PR preprocessor/23479
3821 * expr.c (cpp_classify_number): Implement 0b-prefixed binary
3822 integer constants.
3823 (append_digit): Likewise.
3824 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
3825 binary integer constants.
3826
0448520c 38272007-05-31 Dave Korn <dave.korn@artimi.com>
3828
3829 PR preprocessor/14331
3830 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
3831
ce079f70 38322007-05-24 Ollie Wild <aaw@google.com>
3833
3834 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
3835 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
3836 (cpp_write_pch_state): Save __COUNTER__ state.
3837 (cpp_valid_state): Check valid __COUNTER__ state.
3838 (cpp_read_state): Read new __COUNTER__ state.
3839 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
3840 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
3841 * internal.h (struct cpp_reader): Add counter member.
3842
3b6c638e 38432007-05-23 Simon Martin <simartin@users.sourceforge.net>
3844
3845 PR preprocessor/20077
3846 * macro.c (create_iso_definition): Fixed the method to determine
3847 whether the token-pasting operator appears at the beginning or the end
3848 of a macro.
3849
248dfc42 38502007-05-21 Ian Lance Taylor <iant@google.com>
3851
3852 * internal.h (struct cpp_reader): Add new fields:
3853 nonexistent_file_hash and nonexistent_file_ob.
3854 * files.c: Include "obstack.h".
3855 (find_file_in_dir): Before trying to open the file, look up the
3856 path name in the hash table of nonexistent files. After failing
3857 to open the file, add the path name to the hash table.
3858 (_cpp_find_file): Cache the results of looking up the file name
3859 starting with the quote and bracket chain heads, if we can.
3860 (nonexistent_file_hash_eq): New static function.
3861 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
3862 pfile->nonexistent_file_ob.
3863 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
3864 pfile->nonexistent_file_ob.
3865
c55e2f1b 38662007-05-14 Janis Johnson <janis187@us.ibm.com>
3867
cc0a8c77 3868 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
5c00409a 3869
c55e2f1b 3870 PR c/31924
3871 * expr.c (interpret_float_suffix): Check for invalid suffix.
3872
dd97b5e4 38732007-05-02 Eric Christopher <echristo@apple.com>
3874
3875 * expr.c (num_div_op): Don't overflow if the result is
3876 zero.
3877
3127c357 38782007-05-02 Tom Tromey <tromey@redhat.com>
3879
45f9f140 3880 PR preprocessor/28709
3127c357 3881 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
3882
f23c2abe 38832007-03-30 Michael Meissner <michael.meissner@amd.com>
3884
3885 * directives.c (lex_macro_node_from_str): Fix alloca call to be
3886 type correct.
3887
3fa3949d 38882007-03-30 Richard Henderson <rth@redhat.com>
3889
3890 * directives.c (lex_macro_node_from_str): New.
3891 (cpp_push_definition, cpp_pop_definition): New.
3892 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
3893
7262ccd6 38942007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
3895
3896 * Makefile.in: Add dummy install-pdf target.
3897
09edb0e9 38982007-01-30 Tom Tromey <tromey@redhat.com>
3899
45f9f140 3900 PR preprocessor/30468
09edb0e9 3901 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
3902 './'.
3903
e0ff7935 39042007-01-30 Tom Tromey <tromey@redhat.com>
3905
45f9f140 3906 PR preprocessor/29966
e0ff7935 3907 * macro.c (lex_expansion_token): Save and restore cpp_reader's
3908 cur_token.
3909 (_cpp_create_definition): Don't restore cur_token here.
3910 * lex.c (_cpp_lex_token): Added assertion.
3911
87d210c3 39122007-01-27 Tom Tromey <tromey@redhat.com>
3913
3914 * configure: Rebuilt.
3915
3e2a04b5 39162007-01-12 Tom Tromey <tromey@redhat.com>
3917
45f9f140 3918 PR preprocessor/28227
3e2a04b5 3919 * directives.c (lex_macro_node): Added 'is_def_or_undef'
3920 argument.
3921 (do_define): Update.
3922 (do_undef): Update.
3923 (do_ifdef): Update.
3924 (do_ifndef): Update.
3925
6a6e7e2f 39262007-01-11 Paolo Bonzini <bonzini@gnu.org>
3927
3928 * configure: Regenerate.
3929
77258a2e 39302007-01-11 Paolo Bonzini <bonzini@gnu.org>
3931
3932 * configure: Regenerate.
3933
927b511f 39342007-01-04 Tom Tromey <tromey@redhat.com>
3935
45f9f140 3936 PR preprocessor/28165
927b511f 3937 * internal.h (cpp_in_primary_file): New function.
3938 * directives.c (do_include_next): Use cpp_in_primary_file.
3939 (do_pragma_once): Likewise.
3940 (do_pragma_system_header): Likewise.
3941
5008f5c5 39422006-12-29 Ian Lance Taylor <iant@google.com>
3943
3944 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
3945 look backward at the end of the line unless we saw a backslash.
3946
5d70627e 39472006-12-29 Jakub Jelinek <jakub@redhat.com>
3948
3949 PR preprocessor/29612
3950 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
3951 only when new_sysp is non-zero.
3952
854f075e 39532006-12-28 Tom Tromey <tromey@redhat.com>
3954
45f9f140 3955 PR preprocessor/30001
854f075e 3956 * charset.c (_cpp_convert_input): Check that to.len is greater
3957 than zero.
3958
644459d0 39592006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
3960
3961 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
db375b8e 3962 * configure: Rebuilt.
644459d0 3963
093aec7c 39642006-11-01 Douglas Gregor <doug.gregor@gmail.com>
3965
3966 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
3967 for experimental C++0x mode.
3968 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
3969 adopted the preprocessor changes introduced in C99.
3970
54bb64fb 39712006-10-29 Joseph Myers <joseph@codesourcery.com>
3972
3973 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
3974 depending on --enable-targets=all.
3975 * configure: Regenerate.
3976
46139d3f 39772006-10-12 Jakub Jelinek <jakub@redhat.com>
3978
3979 PR preprocessor/28709
3980 * macro.c (paste_tokens): Do error reporting here, use BUF with the
3981 spelled LHS token as opposed to spelling it again.
3982 (paste_all_tokens): Don't report errors here, just break on failure.
3983
51f93521 39842006-10-10 Brooks Moses <bmoses@stanford.edu>
3985
3986 * Makefile.in: Added empty "pdf" target.
3987
32bca58b 39882006-09-22 Geoffrey Keating <geoffk@apple.com>
3989
3990 * configure.ac: Make need_64_bit_hwint case for x86-darwin
3991 match exactly the glob in gcc/config.gcc.
3992 * configure: Regenerate.
3993
0b67f687 39942006-09-13 Joseph S. Myers <joseph@codesourcery.com>
3995
3996 PR c/28768
3997 PR preprocessor/14634
3998 * lex.c (lex_string): Pedwarn for unterminated literals.
3999
3ebc7dec 40002006-09-08 Eric Christopher <echristo@apple.com>
4001
4002 * configure.ac: Add 64-bit HWI support for i?86-darwin.
4003
e58c07f7 40042006-08-14 Steve Ellcey <sje@cup.hp.com>
4005
4006 PR c++/28288
4007 PR c++/14556
4008 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
4009 (CPP_LAST_EQ): Change.
4010 (CPP_LAST_PUNCTUATOR): Change.
4011 * expr.c (cpp_operator): Remove MIN and MAX.
4012 (reduce): Remove CPP_MIN and CPP_MAX.
4013 (num_binary_op): Ditto.
4014 * lex.c (_cpp_lex_direct): Ditto.
4015 (cpp_avoid_paste): Remove ? as legal symbol after > or <.
4016
add258d7 40172006-06-09 Jakub Jelinek <jakub@redhat.com>
4018
4019 PR preprocessor/27746
4020 * directives.c (do_pragma): Handle pragma with valid namespace
4021 and invalid name coming from macro expansion.
4022 * directives.c (destringize_and_run): Initialize next field in
4023 context.
4024
4025 PR c/27747
4026 PR c++/27748
4027 * directives.c (destringize_and_run): Set NO_EXPAND on the
4028 tokens.
4029
4030 * macro.c (_cpp_backup_tokens): Fix comment typo.
4031
49688a56 40322006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
4033
4034 * Makefile.in (CATALOGS): Add po/ prefix.
4035 * configure: Regenerated.
4036
8f597c12 40372006-05-23 Carlos O'Donell <carlos@codesourcery.com>
4038
4039 * Makefile.in: Add install-html target. Add install-html to .PHONY
4040
cca5dddc 40412006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
4042
4043 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
4044 * files.c (_cpp_get_file_stat): New function.
4045 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
4046 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
4047 * internal.h (_cpp_get_file_stat): Prototype.
4048 (struct cpp_buffer): Add timestamp.
4049
31614f7c 40502006-01-23 Jakub Jelinek <jakub@redhat.com>
4051
4052 PR preprocessor/25717
4053 * init.c (cpp_init_builtins): If __STDC__ will not change value
4054 between system headers and other sources, define it as a normal
4055 macro rather than a builtin.
4056 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
4057 cpp_in_system_header condition.
4058
40592006-01-05 Paolo Bonzini <bonzini@gnu.org>
3c77e017 4060
4061 * Makefile.in: Use -MMD instead of -MD.
4062
b75b98aa 40632006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
4064 Richard Henderson <rth@redhat.com>
4065
4066 Merge from gomp branch:
4067 * directives.c (struct pragma_entry): Add is_deferred. Add ident
4068 entry to value union.
4069 (end_directive): Don't eat the line if in_deferred_pragma.
4070 (run_directive): Remove pragma hacks.
4071 (insert_pragma_entry): Remove.
4072 (new_pragma_entry): New.
4073 (register_pragma_1): Split out of register_pragma. Only handle
4074 the lookup tree and return the new entry.
4075 (cpp_register_pragma): Fill in the pragma entry here.
4076 (cpp_register_deferred_pragma): New.
4077 (register_pragma_internal): New.
4078 (_cpp_init_internal_pragmas): Use register_pragma_internal.
4079 (do_pragma): Allow pragma expansion after namespace. For deferred
4080 pragmas, don't slurp the line into a string.
4081 (destringize_and_run): Save tokens for deferred pragmas.
4082 (cpp_handle_deferred_pragma): Remove.
4083 * macro.c (builtin_macro): Remove pragma token hack.
4084 (_cpp_push_token_context): Rename from push_token_context and export.
4085 * internal.h (struct lexer_state): Add pragma_allow_expansion.
4086 (_cpp_push_token_context): Declare.
4087 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
4088 a token. Update the line number correctly if so.
4089 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
4090 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
4091 * include/cpplib.h (PRAGMA_EOL): New.
4092 (CPP_TOKEN_FLD_PRAGMA): New.
4093 (struct cpp_token): Add val.pragma.
4094 (struct cpp_options): Remove defer_pragmas.
4095 (cpp_handle_deferred_pragma): Remove.
4096 (cpp_register_deferred_pragma): Declare.
4097
986ca356 40982006-01-01 Jakub Jelinek <jakub@redhat.com>
4099
4100 PR c++/25294
4101 * directives.c (do_pragma): If pragma line ends with multi-line
4102 block comment, end the saved deferred pragma string before that
4103 comment. Handle embedded '\0' chars on the pragma line.
4104
8dba02f7 41052005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
4106
4107 PR c++/23333
4108 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
4109
6db045b0 41102005-12-07 Jon Grimm <jgrimm2@us.ibm.com>
4111 Ben Elliston <bje@au.ibm.com>
4112
4113 * include/cpplib.h (CPP_N_DFLOAT): New.
4114 * expr.c (interpret_float_suffix): Identify df, dd, and dl
4115 suffixes as decimal floating point constants.
4116 (cpp_classify_number): Disallow hexadecimal DFP constants.
4117
9a7c76f9 41182005-11-14 Gerald Pfeifer <gerald@pfeifer.com>
b75b98aa 4119 Ian Lance Taylor <ian@airs.com>
9a7c76f9 4120
4121 * include/cpplib.h (struct cpp_callbacks): Annotate error with
4122 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
4123
0c5e3a3d 41242005-11-09 Per Bothner <per@bothner.com>
4125 Uros Bizjak <uros@kss-loka.si>
3ebc7dec 4126
0c5e3a3d 4127 PR c/24101
4128 * init.c (read_original_filename): Temporarily set
4129 state.in_directive before calling _cpp_lex_direct for
4130 CPP_HASH tokens.
4131
3c2359db 41322005-11-03 James E Wilson <wilson@specifix.com>
4133
4134 PR preprocessor/24202
4135 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
4136
d65b3a40 41372005-11-04 Joseph S. Myers <joseph@codesourcery.com>
4138
4139 * include/cpplib.h (struct cpp_callbacks): Make error take
4140 va_list* parameter.
4141 * errors.c (cpp_error): Update call to callback.
4142
cc9012f7 41432005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
4144
4145 PR preprocessor/22042
4146 * macro.c (_cpp_builtin_macro_text): Lower the needed max
4147 buffer size.
4148 (cpp_quote_string): Don't octalify non printable
4149 charactors.
4150
eb0d20b7 41512005-11-03 Joseph S. Myers <joseph@codesourcery.com>
4152
4153 PR c++/17964
4154 * include/cpplib.h (struct cpp_options): Add client_diagnostic.
4155 (struct cpp_callbacks): Add error.
4156 * errors.c (cpp_error): If client_diagnostic, use error callback.
4157 * charset.c (convert_escape): Don't use %03o in diagnostic.
4158
de4aacc0 41592005-10-21 James E Wilson <wilson@specifix.com>
04c0bfd0 4160
4161 PR preprocessor/15220
4162 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all
4163 callers. Pass to open_file_failed.
4164 (open_file_failed): New parameter angle_brackets. Fix all callers.
4165 Use in print_dep assignment.
4166 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
4167 * internal.h (_cpp_find_file): Add new parm to declaration.
3ebc7dec 4168
6783d878 41692005-10-08 Kazu Hirata <kazu@codesourcery.com>
4170
4171 * configure.ac: Require 64-bit int for arm*-*-*eabi*.
4172 * configure: Regenerate.
4173
f789fe3e 41742005-10-04 Ian Lance Taylor <ian@airs.com>
4175
4176 PR preprocessor/13726
4177 * directives.c (check_eol_return_comments): New static function.
4178 (parse_include): Add buf parameter. Change all callers.
4179 (do_include_common): If not discard comments, turn on
4180 save_comments. Pass collected comments to include callback.
4181 * include/cpplib.h (struct cpp_callbacks): Add new parameter to
4182 include callback: cpp_token list.
4183
865c4e44 41842005-09-20 Joseph S. Myers <joseph@codesourcery.com>
4185
4186 * include/cpplib.h (struct cpp_options): Add extended_identifiers.
4187 * init.c (struct lang_flags, lang_defaults): Add
4188 extended_identifiers.
4189 (cpp_set_lang): Use it.
4190 * lex.c (forms_identifier_p): Check extended_identifiers.
4191
56845aa6 41922005-08-30 Jakub Jelinek <jakub@redhat.com>
4193
4194 PR preprocessor/20348
4195 PR preprocessor/20356
4196 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
4197 2004-06-05 changes.
4198
72ee8ff9 41992005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4200
4201 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
4202 -Wmissing-format-attribute.
4203
4204 * configure: Regenerate.
4205
2656917a 42062005-06-29 Kelley Cook <kcook@gcc.gnu.org>
4207
4208 * all files: Update FSF address in copyright headers.
4209 * makeucnid.c (write_copyright): Update outputted FSF address.
4210
cbaa9876 42112005-06-13 Zack Weinberg <zack@codesourcery.com>
4212
4213 * configure.ac: Invoke ZW_CREATE_DEPDIR and
4214 ZW_PROG_COMPILER_DEPENDENCIES.
4215 * aclocal.m4, configure: Regenerate.
4216 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
4217 New variables.
4218 (distclean): Clean up $(DEPDIR) and its contents.
4219 (.c.o): Use $(COMPILE).
4220 Include $(DEPDIR)/*.Po for most object->header dependencies.
4221
720aca92 42222005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
4223
4224 * configure.ac: Check declarations for asprintf and vasprintf.
4225 * config.in: Regenerate.
4226 * configure: Likewise.
4227
4228 * charset.c (conversion_loop): Use XRESIZEVEC.
4229 (convert_no_conversion): Likewise.
4230 (convert_using_iconv): Likewise.
4231 (init_iconv_desc): Cast return value of alloca.
4232 (cpp_host_to_exec_charset): Use XNEWVEC.
4233 (emit_numeric_escape): Use XRESIZEVEC.
4234 (cpp_interpret_string): Use XNEWVEC.
4235 (cpp_interpret_string): Use XRESIZEVEC.
4236 (_cpp_interpret_identifier): Cast return value of alloca.
4237 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
4238 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
4239 (parse_include): Use XNEWVEC.
4240 (insert_pragma_entry): Rename local variable "new" to
cbaa9876 4241 "new_entry".
720aca92 4242 (save_registered_pragmas): Cast return value of xmemdup.
4243 (destringize_and_run): Same for alloca.
4244 (parse_assertion): Likewise.
4245 (do_assert): Cast allocated storage to proper type.
4246 (cpp_define): Likewise.
4247 (_cpp_define_builtin): Likewise.
4248 (cpp_undef): Likewise.
4249 (handle_assertion): Likewise.
4250 (cpp_push_buffer): Rename local variable "new" to "new_buffer".
4251 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
4252 (CPP_UMINUS): Likewise.
4253 (struct cpp_operator): Rename from struct operator.
4254 (_cpp_expand_op_stack): Use XRESIZEVEC.
4255 * files.c (pch_open_file): Use XNEWVEC.
4256 (pch_open_file): Use XRESIZEVEC.
4257 (read_file_guts): Use XNEWVEC and XRESIZEVEC.
4258 (dir_name_of_file): Use XNEWVEC.
4259 (make_cpp_file): Use XCNEW.
4260 (make_cpp_dir): Likewise.
4261 (allocate_file_hash_entries): USE XNEWVEC.
4262 (cpp_included): Cast return value of htab_find_with_hash.
4263 (append_file_to_dir): Use XNEWVEC.
4264 (read_filename_string): Likewise. Use XRESIZEVEC too.
4265 (read_name_map): Cast return value of alloca. Use XRESIZEVEC.
4266 (remap_filename): Use XNEWVEC.
4267 (struct pchf_entry): Move definition out of struct pchf_data.
4268 (_cpp_save_file_entries): Use XCNEWVAR.
4269 (_cpp_read_file_entries): Use XNEWVAR.
4270 * identifiers.c (alloc_node): Use XOBNEW.
4271 * init.c (cpp_create_reader): Use XCNEW.
4272 (cpp_init_builtins): Cast of b->value to enum builtin_type.
4273 (read_original_directory): Cast return value of alloca.
4274 * lex.c (add_line_note): Use XRESIZEVEC.
4275 (warn_about_normalization): Use XNEWVEC.
4276 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
4277 (new_buff): Use XNEWVEC.
4278 * line-map.c (linemap_add): Use XRESIZEVEC.
4279 * macro.c (builtin_macro): Cast return value of alloca.
4280 (paste_tokens): Likewise.
4281 (expand_arg): Use XNEWVEC and XRESIZEVEC.
4282 (_cpp_save_parameter): Use XRESIZEVEC.
4283 (create_iso_definition): Cast allocated storage to proper type.
4284 (_cpp_create_definition): Likewise.
4285 (cpp_macro_definition): Use XRESIZEVEC.
4286 * makedepend.c (add_clm): Use XNEW.
4287 (add_dir): Likewise.
4288 * mkdeps.c (munge): Use XNEWVEC.
4289 (deps_init): Use XCNEW.
4290 (deps_add_target): Use XRESIZEVEC.
4291 (deps_add_default_target): Cast return value of alloca.
4292 (deps_add_dep): Use XRESIZEVEC.
4293 (deps_add_vpath): Likewise. Use XNEWVEC too.
4294 (deps_restore): Likewise.
4295 * pch.c (save_idents): Use XNEW and XNEWVEC.
4296 (cpp_save_state): Use XNEW.
4297 (count_defs): Cast return value of htab_find.
4298 (write_defs): Likewise.
4299 (cpp_write_pch_deps): Use XNEWVEC.
4300 (collect_ht_nodes): Use XRESIZEVEC.
4301 (cpp_valid_state): Use XNEWVEC.
4302 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup.
4303 * symtab.c (ht_create): Use XCNEW.
4304 (ht_lookup_with_hash): Cast return value of obstack_copy0.
4305 (ht_expand): Use XCNEWVEC.
4306 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
4307 (bool): Do not define if __cplusplus.
4308
81e19b31 43092005-05-12 Zack Weinberg <zack@codesourcery.com>
4310
4311 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
4312 (do_sccs): Delete function definition, #define to do_ident.
4313 (do_ident): Don't hardwire directive name.
4314
18f11b84 43152005-05-12 Ryota Kunisawa <kunisawa@access.co.jp>
4316
4317 PR bootstrap/21230
4318 * configure: Regenerate.
4319
2dc04f36 43202005-04-27 Andris Pavenis <pavenis@latnet.lv>
4321
4322 * files.c: Include io.h for DJGPP to get prototype of setmode.
4323
0b7f838f 43242005-04-19 Per Bothner <per@bothner.com>
4325
4326 PR preprocessor/20907
4327 * line-map.c (linemap_line_start): Fix bug when we need to increse
4328 column_bits but can re-use the current line_map.
4329
2224c90b 43302005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4331
4332 * system.h (fopen, fdopen, freopen): Define these to the unlocked
4333 libiberty functions.
4334
077a3c99 43352005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4336
4337 * configure.ac (libcpp_UNLOCKED_FUNCS): New.
4338 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
4339 * system.h (putchar, getc, getchar, clearerr, feof, fileno,
4340 fflush, fgetc, fgets, ferror, fread): Redefine to the associated
4341 _unlocked function.
4342 (fwrite_unlocked): Fix prototype.
81e19b31 4343
077a3c99 4344 * configure, config.in: Regenerate.
4345
99617355 43462005-04-05 Jakub Jelinek <jakub@redhat.com>
4347
4348 PR preprocessor/19475
4349 * macro.c (create_iso_definition): For < ISO C99, don't
4350 pedwarn if there is no whitespace between macro name and its
4351 replacement, but the replacement starts with a basic character
4352 set character.
4353
3827dee5 43542005-03-28 Andreas Jaeger <aj@suse.de>
4355
4356 * lex.c (warn_about_normalization): Cast field width to int to
4357 avoid warning.
4358
b8273627 43592005-03-19 Joseph S. Myers <joseph@codesourcery.com>
4360
4361 * configure.ac: Consistently use solaris2.1[0-9]* instead of
4362 solaris2.1[0-9].
4363 * configure: Regenerate.
4364
bc65f24f 43652005-03-15 Geoffrey Keating <geoffk@apple.com>
4366
4367 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
4368 UCN rather than printing an error.
4369
bce47149 43702005-03-14 Geoffrey Keating <geoffk@apple.com>
4371
4e9d1e6d 4372 * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
4373
43742005-03-14 Geoffrey Keating <geoffk@apple.com>
81e19b31 4375
bce47149 4376 * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
4377 * charset.c: Update for new format of ucnid.h.
4378 (ucn_valid_in_identifier): Update for new format of ucnid.h.
4379 Add NST parameter, and update it; update callers.
4380 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort
4381 with cpp_error.
4382 (convert_ucn): Pass normalize_state to cpp_valid_ucn.
4383 * internal.h (struct normalize_state): New.
4384 (INITIAL_NORMALIZE_STATE): New.
4385 (NORMALIZE_STATE_RESULT): New.
4386 (NORMALIZE_STATE_UPDATE_IDNUM): New.
4387 (_cpp_valid_ucn): New.
4388 * lex.c (warn_about_normalization): New.
4389 (forms_identifier_p): Add normalize_state parameter, update callers.
4390 (lex_identifier): Add normalize_state parameter, update callers. Keep
4391 the state current.
4392 (lex_number): Likewise.
4393 (_cpp_lex_direct): Pass normalize_state to subroutines. Check
4394 it with warn_about_normalization.
4395 * makeucnid.c: New.
4396 * ucnid.h: Replace.
4397 * ucnid.pl: Remove.
4398 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove
4399 comments about obsolete version of C++.
4400 * include/cpplib.h (enum cpp_normalize_level): New.
4401 (struct cpp_options): Add warn_normalize field.
4402
bb1fa6bb 44032005-03-11 Geoffrey Keating <geoffk@apple.com>
4404
4405 * directives.c (glue_header_name): Update call to cpp_spell_token.
4406 * internal.h (_cpp_interpret_identifier): New.
4407 * charset.c (_cpp_interpret_identifier): New.
4408 (_cpp_valid_ucn): Allow UCN version of '$'.
4409 * lex.c (lex_identifier): Add extra parameter to indicate if initial
4410 character was '$' or '\'. Support identifiers with UCNs.
4411 (forms_identifier_p): Allow UCNs.
4412 (_cpp_lex_direct): Pass extra parameter to lex_identifier.
4413 (utf8_to_ucn): New.
4414 (cpp_spell_token): Add FORSTRING parameter. Use it.
4415 (cpp_token_as_text): Update call to cpp_spell_token.
4416 (cpp_output_token): Write UCNs back out.
4417 (stringify_arg): Update call to cpp_spell_token.
4418 (paste_tokens): Likewise.
4419 (cpp_macro_definition): Likewise.
4420 * macro.c (stringify_arg): Likewise.
4421 (paste_tokens): Likewise.
4422 (cpp_macro_definition): Likewise.
4423 * include/cpplib.h: Add parameter to cpp_spell_token.
4424
960391da 44252005-03-04 Jakub Jelinek <jakub@redhat.com>
4426
4427 PR bootstrap/20282
4428 PR bootstrap/20305
4429 * macro.c (replace_args, cpp_get_token): Copy whole
4430 cpp_token_u instead of just cpp_string field from it.
4431
b0d0794d 44322005-02-28 Devang Patel <dpatel@apple.com>
4433
4434 * directives.c (do_line): Save sysp early before line table is
4435 realloc'ed.
81e19b31 4436
624d37a6 44372005-02-20 Zack Weinberg <zack@codesourcery.com>
4438
4439 PR 18785
4440 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
4441 (cpp_host_to_exec_charset): New function.
4442 * include/cpplib.h: Declare cpp_host_to_exec_charset.
4443
f86986bc 44442005-02-19 Devang Patel <dpatel@apple.com>
4445
4446 * charset.c (_cpp_convert_input): Check '\r' before inserting
4447 '\n' at the end.
624d37a6 4448
9936e07d 44492005-02-15 Eric Christopher <echristo@redhat.com>
4450
4451 PR preprocessor/19077
4452 * macro.c (cpp_macro_definition): Move handling of whitespace
4453 to PREV_WHITE conditional. Remove overloading of len
4454 variable.
4455
129a1540 44562005-02-14 Kazu Hirata <kazu@cs.umass.edu>
4457
4458 * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
4459 traditional.c: Update copyright.
4460
bb30d1f4 44612005-02-14 Paolo Bonzini <bonzini@gnu.org>
4462
4463 PR bootstrap/19818
4464 * configure.ac: Check for declaration of basename and getopt.
4465 * config.in: Regenerate.
4466 * configure: Regenerate.
4467 * internal.h (ustrcspn): New.
4468 * macro.c (create_iso_definition): Fix allocation of memory.
4469 (padding_token): Add cast to remove const-ness.
4470 * pch.c (cpp_read_state): Use ustrcspn.
4471
26ec4f15 44722005-02-08 Mike Stump <mrs@apple.com>
4473
4474 * files.c (pchf_adder): Remove.
4475 (struct pchf_adder_info): Likewise.
4476 (_cpp_save_file_entries): Write out all files so that #import works.
4477
0cb78cbd 44782005-01-23 Joseph S. Myers <joseph@codesourcery.com>
4479
4480 * configure: Regenerate.
4481
d862067c 44822005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
4483
4484 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
4485
457e71e4 4486 * include/cpplib.h: Also update copyright years.
624d37a6 4487
ba841ef8 44882005-01-03 Geoffrey Keating <geoffk@apple.com>
4489
4490 * files.c (_cpp_find_file): Add files found by search_path_exhausted
4491 to the list of all files.
4492
f03668bd 44932005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
4494
4495 * internal.h: Update references to Cpp lib filenames.
4496 * directives.c: Likewise.
4497 * init.c: Likewise.
4498 * macro.c: Likewise.
4499 * traditional.c: Likewise.
4500
461ea98d 45012004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
4502
4503 PR preprocessor/15167
4504 * files.c (destroy_cpp_file): New function.
4505 (should_stack_file): Make a new file if the
4506 compared file is still stacked.
4507
bd9e37a6 45082004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
4509
624d37a6 4510 PR preprocessor/17610
bd9e37a6 4511 * directives.c (do_include_common): Error out if an empty filename
4512 is given for #include (or #include_next or #import).
4513
fe4dcd90 45142004-11-27 Roger Sayle <roger@eyesopen.com>
4515 Zack Weinberg <zack@codesourcery.com>
4516
4517 * internal.h: Replace all uses of uchar with unsigned char.
4518 * include/cpp-id-data.h: Likewise. Guard typedef of uchar
4519 with !IN_GCC, so uchar is only defined whilst building libcpp.
4520
ac7cc2f4 45212004-11-24 Kelley Cook <kcook@gcc.gnu.org>
4522
4523 * aclocal.m4: Regenerate.
4524
6e11b263 45252004-11-24 Roger Sayle <roger@eyesopen.com>
4526
4527 PR preprocessor/15824
4528 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
4529 directly, instead of the non-existant "system.h" and "ansidecl.h".
4530 * configure: Regenerate.
4531
68bf2ad9 45322004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
624d37a6 4533 Joseph Myers <joseph@codesourcery.com>
68bf2ad9 4534
4535 * internal.h (struct lexer_state): Add in_deferred_pragma.
4536 * directives.c (struct pragma_entry): Add allow_expansion.
4537 (insert_pragma_entry): Take allow_expansion flag.
4538 (register_pragma): Likewise.
4539 (cpp_register_pragma): Likewise.
4540 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
4541 (do_pragma): Honor allow_expansion.
4542 (cpp_handle_deferred_pragma): Set in_deferred_pragma.
4543 * include/cpplib.h (cpp_register_pragma): Update prototype.
4544
27559c4e 45452004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
624d37a6 4546 Mark Mitchell <mark@codesourcery.com>
27559c4e 4547
4548 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
4549 need_64bit_hwint=yes.
4550 * configure: Regenerate.
4551
34ae664d 45522004-11-09 Joseph S. Myers <joseph@codesourcery.com>
4553
4554 * Makefile.in ($(PACKAGE).pot): New rule. Depend on
4555 po/$(PACKAGE).pot.
4556 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
4557 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
4558 Remove local srcdir path from generated file.
4559
39b83bdb 45602004-11-04 Zack Weinberg <zack@codesourcery.com>
624d37a6 4561 Gerald Pfeifer <gerald@pfeifer.com>
39b83bdb 4562
4563 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
4564 as well.
4565
a095c1b5 45662004-10-27 Zack Weinberg <zack@codesourcery.com>
4567
4568 PR 18075
4569 * directives.c (do_pragma): Do not defer pragmas which are unknown.
4570 (cpp_handle_deferred_pragma): Add cast to silence warning.
4571
700b0d81 45722004-10-14 Joseph S. Myers <jsm@polyomino.org.uk>
4573
4574 * errors.c (_cpp_begin_message): Print "error: " for errors.
4575
fbe83ac1 45762004-10-10 Andreas Jaeger <aj@suse.de>
4577
4578 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
4579 * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
4580
09f10c94 45812004-10-08 Andrew Pinski <pinskia@physics.uc.edu>
4582
4583 * pch.c (cpp_write_pch_state): Remove variable z as it is not
4584 used.
4585 (cpp_read_state): Remove unused variables, m, d and mac_count.
4586
a8b2a8d5 45872004-09-29 Per Bothner <per@bothner.com>
4588
4589 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore
4590 cb.line_change. Otherwise do_pragma will call the line_change
4591 call-back with a meaningless line number.
4592
21164c01 45932004-09-24 Zack Weinberg <zack@codesourcery.com>
4594
4595 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
4596 programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
4597 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
4598 * aclocal.m4, configure: Regenerate.
4599 * init.c: Include localedir.h.
4600 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
4601 (DEFS): Delete.
4602 (.c.o): Use $(ALL_CFLAGS).
4603 (localedir.h, localedir.hs): New rules.
4604 (clean): Use rm -rf to remove directories.
4605 (distclean): Also delete localedir.h and localedir.hs.
4606 (init.o): Update dependencies.
4607
986086aa 46082004-09-22 Kelley Cook <kcook@gcc.gnu.org>
4609
4610 * Makefile.in (aclocal.m4): Update dependencies.
4611 * configure.ac (AC_CONFIG_MACRO_DIR): New.
4612 * aclocal.m4, configure: Regenerate.
4613
e9cc3617 46142004-09-17 Zack Weinberg <zack@codesourcery.com>
4615
0097f6a2 4616 * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
4617 (_cpp_convert_input, _cpp_default_encoding): Add comments.
4618 Some other comments in this file also tweaked.
4619
e9cc3617 4620 * directives.c (do_pragma): Save current buffer position
4621 before lexing the pragma keywords; don't call
4622 _cpp_backup_tokens in the defer_pragmas case.
4623
9832c977 46242004-09-15 Per Bothner <per@bothner.com>
4625
4626 * include/line-map.h (line_map_start): Add parameter names so
4627 preceding comment makes sense.
4628 (linemap_add): Remove from comment mention of non-existing parameter.
4629
d6d3c909 46302004-09-09 Matt Austern <austern@apple.com>
4631 Zack Weinberg <zack@codesourcery.com>
4632
4633 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
4634 prefixes throughout. Add entry for PRAGMA. Remove
4635 unnecessary "= 0" from EQ.
4636 (enum cpp_ttype): Adjust OP and TK definitions to restore
4637 prefixes, via token-paste.
4638 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
4639 Change from #defines to additional cpp_ttype enumerators.
4640 (struct cpp_options): Add defer_pragmas.
4641 (cpp_handle_deferred_pragma): Prototype new interface.
4642
4643 * internal.h (struct cpp_reader): Add directive_result.
4644 * directives.c (struct pragma_entry): Add is_internal field;
4645 give boolean fields type bool.
4646 (start_directive): Initialize pfile->directive_result.type.
4647 (_cpp_do__Pragma): Likewise.
4648 (run_directive): Do not crash if pfile->buffer->prev is NULL.
4649 (insert_pragma_entry): Add 'internal' argument; set new->is_internal
4650 from it.
4651 (register_pragma): New static function, bulk of former
4652 cpp_register_pragma here; add 'internal' argument, pass along
4653 to insert_pragma_entry.
4654 (cpp_register_pragma): Now a wrapper around register_pragma which
4655 always passes false for 'internal' argument.
4656 (_cpp_init_internal_pragmas): Call register_pragma directly, passing
4657 true for 'internal'.
4658 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
4659 an internal pragma, save text till the end of the line as a CPP_PRAGMA
4660 token instead of executing the pragma.
4661 (cpp_handle_deferred_pragma): New interface.
4662 * lex.c (token_spellings): Adjust OP and TK definitions to
4663 match changes to cpplib.h.
4664 (_cpp_lex_token): Check for a directive-result token and
4665 return it if present.
4666 (cpp_token_val_index): Handle CPP_PRAGMA.
4667 * macro.c (cpp_builtin_macro_text): Correct comment.
4668 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
4669
735a9bc4 46702004-09-06 Serge Belyshev <belyshev@lubercy.com>
4671
4672 PR preprocessor/14699
4673 * symtab.c (ht_dump_statistics): Change type of sum_of_squares
4674 from size_t to double.
4675
25696d3f 46762004-08-28 Andreas Schwab <schwab@suse.de>
4677 Andreas Jaeger <aj@suse.de>
4678
4679 * configure.ac: Set PACKAGE correctly.
4680 * configure: Regenerated.
4681
99439f5b 46822004-08-25 Paolo Bonzini <bonzini@gnu.org>
4683
4684 * Makefile.in: Add back top_builddir.
4685
a668be26 46862004-08-25 Paolo Bonzini <bonzini@gnu.org>
4687
4688 * configure.ac: Replace Automake macro invocations
4689 with manual Autoconf checks and substitutions.
4690 * configure: Regenerate.
4691 * aclocal.m4: Regenerate.
4692 * config.in: Regenerate.
4693 * Makefile.am: Removed.
4694 * Makefile.in: Heavy simplification and reorganization.
4695
30e9913f 46962004-08-09 Mark Mitchell <mark@codesourcery.com>
4697
4698 * configure.ac (arm*-*-eabi*): New target.
4699 (arm*-*-symbianelf*): Likewise.
4700 * configure: Regenerated.
4701
3b298764 47022004-07-24 Bernardo Innocenti <bernie@develer.com>
4703
4704 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
4705 * directives.c: Use XNEW-family macros from libiberty.
4706 * lex.c: Likewise.
4707 * macro.c: Likewise.
4708 * cpplib.h (cpp_deps_style): Export enum with name.
4709
d6d3c909 47102004-07-23 Matthias Klose <doko@debian.org>
3b298764 4711
d6d3c909 4712 * init.c (init_library): Use PACKAGE for the text domain.
1ed7d058 4713
821fa045 47142004-07-16 Andris Pavenis <pavenis@latnet.lv>
4715
4716 PR preprocessor/16366
4717 * internal.h (struct cpp_reader): New field dir_hash.
4718 * files.c (make_cpp_dir): Use dir_hash, not file_hash.
4719 (_cpp_init_files, _cpp_cleanup_files): Update for new field.
4720
d80efa72 47212004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
4722
4723 PR preprocessor/16192
4724 PR preprocessor/15913
4725 PR preprocessor/15572
4726 * expr.c (_cpp_parse_expr): Handle remaining cases where an
4727 expression is missing.
4728 * init.c (post_options): Traditional cpp doesn't do // comments.
4729
ed000086 47302004-06-30 Per Bothner <per@bothner.com>
4731
4732 * include/line-map.h (fileline): Remove old typedef.
4733 * internal.h (struct cpp_reader): Use source_location typedef instead.
4734
dcb9d064 47352004-06-26 Zack Weinberg <zack@codesourcery.com>
4736
4737 Partially revert patch of 2004-06-05.
4738 * files.c (search_cache): Remove pfile argument. Don't check
4739 for file that would be found by "" or <> search here...
4740 (_cpp_find_file): ...do it here, before calling find_file_in_dir.
4741 Do not apply directory-of-current-file correction to files
4742 found by this check. Rearrange code slightly.
4743
d718b525 47442004-06-21 Geoffrey Keating <geoffk@apple.com>
4745
4746 * files.c (should_stack_file): Correct swapped parameters to call
4747 to cb.read_pch.
4748 * pch.c (cpp_valid_state): Handle -fpreprocessed.
4749
79b68529 47502004-06-15 Paolo Bonzini <bonzini@gnu.org>
4751
4752 * Makefile.in: Regenerate with automake 1.8.5.
4753 * aclocal.m4: Likewise.
4754 * configure: Regenerate.
4755
151899c5 47562004-06-11 Zack Weinberg <zack@codesourcery.com>
4757
4758 * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
4759 * configure, config.in: Regenerate.
4760 * system.h: Unconditionally define bool as unsigned char,
4761 BOOL_BITFIELD as unsigned int.
4762 * .cvsignore: New file.
4763
c39ed964 47642004-06-09 Geoffrey Keating <geoffk@apple.com>
4765
4766 * traditional.c (push_replacement_text): Set macro->traditional.
4767 (save_replacement_text): Likewise.
4768 * pch.c (cpp_write_pch_state): Don't write list of defined macros.
4769 (struct save_macro_item): Delete.
4770 (struct save_macro_data): Use a character array not the previous
4771 structured format.
4772 (save_macros): Save macro as text not as internal structures.
4773 (cpp_prepare_state): Update for changes to save_macro_data.
4774 (cpp_read_state): Don't read macros defined in PCH. Restore
c84ca916 4775 -D macros as text.
c39ed964 4776 * macro.c (create_iso_definition): Honour alloc_subobject.
4777 Clear traditional flag.
4778 (_cpp_create_definition): Honour alloc_subobject.
4779 * lex.c (cpp_token_val_index): New.
4780 * internal.h: Include cpp-id-data.h.
4781 (uchar): Move definition to cpp-id-data.h.
4782 (U): Likewise.
4783 (cpp_macro): Likewise.
4784 * directives.c (struct answer): Move to cpp-id-data.h.
4785 (do_assert): Honour alloc_subobject.
c84ca916 4786
4787 * include/symtab.h (struct ht): Add field 'alloc_subobject'.
4788 * include/cpplib.h (struct cpp_string): Add GTY marker.
4789 (enum cpp_token_fld_kind): New.
4790 (struct cpp_token): Add GTY markers.
4791 (cpp_token_val_index): Prototype.
4792 (CPP_HASHNODE_VALUE_IDX): New.
4793 (struct cpp_hashnode): Don't skip fields of 'value' when marking.
4794 * include/cpp-id-data.h: New file.
c39ed964 4795
dd6e5561 47962004-06-09 Paolo Bonzini <bonzini@gnu.org>
4797
4798 * Makefile.am (all-local): New.
4799 * Makefile.in: Regenerate.
4800
8af0c78d 48012004-06-06 Roger Sayle <roger@eyesopen.com>
4802
4803 * Makefile.am (LIBICONV): Declare.
4804 (makedepend_LDADD): Use LIBICONV.
4805 * Makefile.in: Regenerate.
4806
30302733 48072004-06-05 Andrew Pinski <pinskia@physics.uc.edu>
4808
4809 * Makefile.am (LIBINTL): Declare
4810 (makedepend_LDADD): Use LIBINTL.
4811 * Makefile.in: Regenerate.
4812
3eb3f293 48132004-06-05 Zack Weinberg <zack@codesourcery.com>
4814
4815 * Makefile.am: Add makedepend.
4816 * Makefile.in, aclocal.m4: Regenerate.
4817 * charset.c: Insert a space to avoid a warning.
4818 * directives.c: Include mkdeps.h.
4819 (_cpp_handle_directive): Reenable macro expander if appropriate.
4820 (undefine_macros): Inline body of _cpp_free_definition for speed.
4821 Do not call undef callback or _cpp_warn_if_unused_macro.
4822 (cpp_get_deps): New interface.
4823 * files.c (search_cache): Add pfile argument. Check for file
4824 that would be found by "" or <> search here...
4825 (_cpp_find_file): ...not here. Correct recorded start_dir of
4826 files found by directory-of-current-file search that would be
4827 found by "" or <> search.
4828 * init.c (cpp_add_dependency_target): Delete.
4829 * internal.h (struct lexer_state): Add discarding_output flag.
4830 * lex.c (lex_identifier): Compute hash function while scanning.
4831 * macro.c (cpp_scan_nooutput): Disable macro expansion outside
4832 directives.
4833 * makedepend.c: New file.
4834 * mkdeps.c (struct deps): Add vpath vector.
4835 (apply_vpath, deps_add_vpath): New function.
4836 (deps_free): Free vpath vector.
4837 (deps_add_dep, deps_add_target): Use apply_vpath.
4838 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
4839 (ht_lookup_with_hash): New function.
4840 * cpplib.h, mkdeps.h: Update prototypes.
4841 * symtab.h: Update prototypes.
4842 (HT_HASHSTEP, HT_FINISH): New macros.
4843
8ed01400 48442004-05-29 Geoffrey Keating <geoffk@apple.com>
4845
4846 * symtab.c (ht_create): Set entries_owned.
4847 (ht_destroy): Honour entries_owned.
4848 (ht_expand): Likewise.
4849 (ht_load): New.
c84ca916 4850 * include/symtab.h (struct ht): New field 'entries_owned'
4851 (ht_load): New prototype.
8ed01400 4852
347a3ab5 48532004-05-26 Paolo Bonzini <bonzini@gnu.org>
4854
4855 PR bootstrap/15651
4856 * configure.ac: Fix m4 quoting when picking
4857 the size of HOST_WIDE_INT.
4858 * configure: Regenerate.
4859
fc231f28 48602004-05-25 Paolo Bonzini <bonzini@gnu.org>
4861
4862 * Makefile.am: the correct directory for
4863 gettext include files is given by @INCINTL@.
4864 * Makefile.in: Regenerate.
4865
babfbd63 48662004-05-24 Paolo Bonzini <bonzini@gnu.org>
4867
4868 * system.h [!ENABLE_NLS]: dgettext takes two
4869 parameters.
4870
d856c8a6 48712004-05-23 Paolo Bonzini <bonzini@gnu.org>
4872
4873 Moved libcpp from the gcc subdirectory to the toplevel.
4874 * Makefile.am: New file.
4875 * Makefile.in: Regenerate.
4876 * configure.ac: New file.
4877 * configure: Regenerate.
4878 * config.in: Regenerate.
4879 * charset.c: Moved from gcc/cppcharset.c. Add note about
4880 brokenness of input charset detection. Adjust for change
4881 in name of cppucnid.h.
4882 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
4883 * expr.c: Moved from gcc/cppexp.c.
4884 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
4885 Remove #define of O_BINARY, it is in system.h.
4886 * identifiers.c: Moved from gcc/cpphash.c.
4887 * internal.h: Moved from gcc/cpphash.h. Change header
4888 guard name. All other files adjusted to match name change.
4889 * init.c: Moved from gcc/cppinit.c.
4890 (init_library) [ENABLE_NLS]: Call bindtextdomain.
4891 * lex.c: Moved from gcc/cpplex.c.
4892 * directives.c: Moved from gcc/cpplib.c.
4893 * macro.c: Moved from gcc/cppmacro.c.
4894 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
4895 * traditional.c: Moved from gcc/cpptrad.c.
4896 * ucnid.h: Moved from gcc/cppucnid.h. Change header
4897 guard name.
4898 * ucnid.pl: Moved from gcc/cppucnid.pl.
4899 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header
4900 guard name.
4901 * symtab.c: Moved from gcc/hashtable.c.
4902 * line-map.c: Moved from gcc. Do not include intl.h.
4903 * mkdeps.c: Moved from gcc.
4904 * system.h: New file.
c84ca916 4905 * include/cpplib.h: Moved from gcc. Change header guard name.
4906 * include/line-map.h: Moved from gcc. Change header guard name.
4907 * include/mkdeps.h: Moved from gcc. Change header guard name.
4908 * include/symtab.h: Moved from gcc/hashtable.h. Change header
4909 guard name.
f1717362 4910\f
4911Copyright (C) 2004-2016 Free Software Foundation, Inc.
4912
4913Copying and distribution of this file, with or without modification,
4914are permitted in any medium without royalty provided the copyright
4915notice and this notice are preserved.