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