]> git.ipfire.org Git - thirdparty/gcc.git/blame - libcpp/ChangeLog
c-lex.c (c_lex_with_flags): For CPP_COMMENT token with PREV_FALLTHROUGH...
[thirdparty/gcc.git] / libcpp / ChangeLog
CommitLineData
7bad794a
JJ
12016-10-08 Jakub Jelinek <jakub@redhat.com>
2
3 * lex.c (fallthrough_comment_p): Fix off-by-one size comparison
4 errors, cleanup.
5 (_cpp_lex_direct): Allow arbitrary comments in between
6 fallthrough_comment_p comment and following token.
7
67ef83c6
KN
82016-10-04 Kelvin Nilsen <kelvin@gcc.gnu.org>
9
10 PR target/77847
11 * lex.c (search_line_fast): Add a FALLTHROUGH comment to correct
12 compiler error in the version of this function that is
13 conditionally compiled when GCC_VERSION >= 4005 and both
14 __ALTIVEC__ and __BIG_ENDIAN__ symbols are defined.
15
81fea426
MP
162016-09-26 Marek Polacek <polacek@redhat.com>
17 Jakub Jelinek <jakub@redhat.com>
18
19 PR c/7652
20 * include/cpplib.h (PREV_FALLTHROUGH): Define.
21 * internal.h (CPP_FALLTHRU): Define.
22 * lex.c (fallthrough_comment_p): New function.
23 (_cpp_lex_direct): Set PREV_FALLTHROUGH on tokens succeeding a falls
24 through comment.
25
bbd6fcf3
DM
262016-09-23 David Malcolm <dmalcolm@redhat.com>
27
28 PR preprocessor/77672
29 * charset.c (cpp_interpret_string_1): Add a source_range for the
30 NUL-terminator, using the location of the trailing quote of the
31 final string.
32
63cb3926
JM
332016-09-21 Jason Merrill <jason@redhat.com>
34
35 * line-map.c (linemap_location_from_macro_definition_p): New.
36 * line-map.h: Declare it.
37
31316208
DM
382016-09-15 David Malcolm <dmalcolm@redhat.com>
39
40 * include/line-map.h (class rich_location): Note that newlines
41 aren't supported in fix-it text.
42 * line-map.c (rich_location::add_fixit_insert_before): Reject
43 attempts to add fix-its containing newlines.
44 (rich_location::add_fixit_replace): Likewise.
45
254830ba
DM
462016-09-13 David Malcolm <dmalcolm@redhat.com>
47
48 * include/line-map.h (class rich_location): Add description of
49 fix-it hints to leading comment.
50 (rich_location::add_fixit_insert): Rename both overloaded methods
51 to..
52 (rich_location::add_fixit_insert_before): ...this, updating their
53 comments.
54 (rich_location::add_fixit_insert_after): Two new overloaded
55 methods.
56 (rich_location::stop_supporting_fixits): New method.
57 * line-map.c (rich_location::add_fixit_insert): Rename both
58 overloaded methods to..
59 (rich_location::add_fixit_insert_before): ...this, updating their
60 comments.
61 (rich_location::add_fixit_insert_after): Two new methods.
62 (rich_location::reject_impossible_fixit): Split out
63 failure-handling into...
64 (rich_location::stop_supporting_fixits): New method.
65
c65236d6
DM
662016-09-02 David Malcolm <dmalcolm@redhat.com>
67
68 * include/line-map.h (rich_location::seen_impossible_fixit_p): New
69 accessor.
70
3d4f9f87
DM
712016-08-31 David Malcolm <dmalcolm@redhat.com>
72
73 * include/line-map.h (class fixit_remove): Remove stray decl.
74 (fixit_hint::affects_line_p): Make const.
75 (fixit_insert::affects_line_p): Likewise.
76 (fixit_replace::affects_line_p): Likewise.
77 * line-map.c (fixit_insert::affects_line_p): Likewise.
78 (fixit_replace::affects_line_p): Likewise.
79
b816477a
DM
802016-08-30 David Malcolm <dmalcolm@redhat.com>
81
82 * include/line-map.h (class semi_embedded_vec): New class.
83 (semi_embedded_vec<T, NUM_EMBEDDED>::semi_embedded_vec): New ctor.
84 (semi_embedded_vec<T, NUM_EMBEDDED>::~semi_embedded_vec): New
85 dtor.
86 (semi_embedded_vec<T, NUM_EMBEDDED>::operator[]): New methods.
87 (semi_embedded_vec<T, NUM_EMBEDDED>::push): New method.
88 (semi_embedded_vec<T, NUM_EMBEDDED>::truncate): New method.
89 (rich_location::get_num_locations): Reimplement in terms of
90 m_ranges.
91 (rich_location::get_range): Make non-inline.
92 (rich_location::get_num_fixit_hints): Reimplement in terms of
93 m_fixit_hints.
94 (rich_location::add_fixit): New function.
95 (rich_location::MAX_RANGES): Rename to...
96 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this.
97 (rich_location::MAX_FIXIT_HINTS): Rename to...
98 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this, and make
99 private.
100 (rich_location::m_num_ranges): Eliminate in favor of...
101 (rich_location::m_ranges): ...this, converting from a fixed-size
102 array to a semi_embedded_vec.
103 (rich_location::m_num_fixit_hints): Eliminate in favor of...
104 (rich_location::m_fixit_hints): ...this, converting from a
105 fixed-size array to a semi_embedded_vec.
106 * line-map.c (rich_location::rich_location): Update for above
107 changes.
108 (rich_location::~rich_location): Likewise.
109 (rich_location::get_loc): Likewise.
110 (rich_location::get_range): New methods.
111 (rich_location::add_range): Update for above changes.
112 (rich_location::set_range): Likewise.
113 (rich_location::add_fixit_insert): Likewise.
114 (rich_location::add_fixit_replace): Likewise.
115 (rich_location::get_last_fixit_hint): Likewise.
116 (rich_location::reject_impossible_fixit): Likewise.
117 (rich_location::add_fixit): New method.
118
f9087798
DM
1192016-08-30 David Malcolm <dmalcolm@redhat.com>
120
121 * include/line-map.h (rich_location::add_fixit_insert): Add
122 comments. Add overload omitting the source_location param.
123 (rich_location::add_fixit_remove): Add comments. Add overloads
124 omitting the range, and accepting a source_location.
125 (rich_location::add_fixit_replace): Likewise.
126 * line-map.c (rich_location::add_fixit_insert): Add comments. Add
127 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
2aa51413
DM
1322016-08-26 David Malcolm <dmalcolm@redhat.com>
133
134 * include/line-map.h (get_pure_location): New decl.
135 * line-map.c (get_pure_location): Move here, from gcc/input.c, adding
136 a line_maps * param.
137 (rich_location::add_fixit_insert): Call get_pure_location on "where".
138 (rich_location::add_fixit_replace): Call get_pure_location on the
139 end-points.
140
ee908516
DM
1412016-08-26 David Malcolm <dmalcolm@redhat.com>
142
143 * include/line-map.h (rich_location): Eliminate unimplemented
144 constructor based on source_range.
145 (rich_location::get_last_fixit_hint): New method.
146 (rich_location::reject_impossible_fixit): New method.
147 (rich_location): Add fields m_line_table and
148 m_seen_impossible_fixit.
149 (fixit_hint::maybe_append_replace): New pure virtual function.
150 (fixit_insert::maybe_append_replace): New function.
151 (fixit_replace::maybe_append_replace): New function.
152 * line-map.c (rich_location::rich_location): Initialize
153 m_line_table and m_seen_impossible_fixit.
154 (rich_location::add_fixit_insert): Call
155 reject_impossible_fixit and bail out if true.
156 (column_before_p): New function.
157 (rich_location::add_fixit_replace): Call reject_impossible_fixit
158 and bail out if true. Attempt to consolidate with neighboring
159 fixits.
160 (rich_location::get_last_fixit_hint): New method.
161 (rich_location::reject_impossible_fixit): New method.
162 (fixit_insert::maybe_append_replace): New method.
163 (fixit_replace::maybe_append_replace): New method.
164
d672cded
DM
1652016-08-23 David Malcolm <dmalcolm@redhat.com>
166
167 * include/line-map.h (source_range::from_locations): New method.
168
2ffe0809
DM
1692016-08-19 David Malcolm <dmalcolm@redhat.com>
170
171 * include/line-map.h (fixit_hint::kind): Delete REPLACE.
172 (class fixit_remove): Delete.
173 * line-map.c (rich_location::add_fixit_remove): Reimplement
174 by calling add_fixit_replace with an empty string.
175 (fixit_remove::fixit_remove): Delete.
176 (fixit_remove::affects_line_p): Delete.
177
c65699ef
JM
1782016-08-19 Joseph Myers <joseph@codesourcery.com>
179
180 PR c/32187
181 * include/cpplib.h (CPP_N_FLOATN, CPP_N_FLOATNX)
182 (CPP_N_WIDTH_FLOATN_NX, CPP_FLOATN_SHIFT, CPP_FLOATN_MAX): New
183 macros.
184 * expr.c (interpret_float_suffix): Handle fN, fNx, FN and FNx
185 suffixes.
186
fcf830ab
PK
1872016-08-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
188
189 * expr.c (eval_token): Append "evaluates to 0" to Wundef diagnostic.
190
cb18fd07
DM
1912016-08-18 David Malcolm <dmalcolm@redhat.com>
192
193 * directives.c (directive_names): New array.
194 (_cpp_handle_directive): Offer spelling suggestions for misspelled
195 directives.
196 * errors.c (cpp_diagnostic_at_richloc): New function.
197 (cpp_error_at_richloc): New function.
198 * include/cpplib.h (struct cpp_callbacks): Add field
199 "get_suggestion".
200 (cpp_error_at_richloc): New decl.
201
9c62c873
MP
2022016-08-18 Marek Polacek <polacek@redhat.com>
203
204 PR c/7652
205 * pch.c (write_macdef): Add CPP_FALLTHRU.
206
191816a3
MP
2072016-08-12 Marek Polacek <polacek@redhat.com>
208
209 PR c/7652
210 * lex.c (search_line_fast): Add FALLTHRU.
211 (_cpp_lex_direct): Likewise.
212 (cpp_token_val_index): Adjust fall through comment.
213 * macro.c (parse_params): Add FALLTHRU.
214 * pch.c (count_defs): Adjust fall through comment.
215 (write_defs): Likewise.
216
e7864d68
DM
2172016-08-06 David Malcolm <dmalcolm@redhat.com>
218
219 PR bootstrap/72823
220 * charset.c (_cpp_valid_ucn): Replace overzealous assert with one
221 that allows for char_range to be non-NULL when loc_reader is NULL.
222
88fa5555
DM
2232016-08-05 David Malcolm <dmalcolm@redhat.com>
224
225 * charset.c (cpp_substring_ranges::cpp_substring_ranges): New
226 constructor.
227 (cpp_substring_ranges::~cpp_substring_ranges): New destructor.
228 (cpp_substring_ranges::add_range): New method.
229 (cpp_substring_ranges::add_n_ranges): New method.
230 (_cpp_valid_ucn): Add "char_range" and "loc_reader" params; if
231 they are non-NULL, read position information from *loc_reader
232 and update char_range->m_finish accordingly.
233 (convert_ucn): Add "char_range", "loc_reader", and "ranges"
234 params. If loc_reader is non-NULL, read location information from
235 it, and update *ranges accordingly, using char_range.
236 Conditionalize the conversion into tbuf on tbuf being non-NULL.
237 (convert_hex): Likewise, conditionalizing the call to
238 emit_numeric_escape on tbuf.
239 (convert_oct): Likewise.
240 (convert_escape): Add params "loc_reader" and "ranges". If
241 loc_reader is non-NULL, read location information from it, and
242 update *ranges accordingly. Conditionalize the conversion into
243 tbuf on tbuf being non-NULL.
244 (cpp_interpret_string): Rename to...
245 (cpp_interpret_string_1): ...this, adding params "loc_readers" and
246 "out". Use "to" to conditionalize the initialization and usage of
247 "tbuf", such as running the converter. If "loc_readers" is
248 non-NULL, use the instances within it, reading location
249 information from them, and passing them to convert_escape; likewise
250 write to "out" if loc_readers is non-NULL. Check for leading
251 quote and issue an error if it is not present. Update boundary
252 check from "== limit" to ">= limit" to protect against erroneous
253 location values to calls that are not parsing string literals.
254 (cpp_interpret_string): Reimplement in terms to
255 cpp_interpret_string_1.
256 (noop_error_cb): New function.
257 (cpp_interpret_string_ranges): New function.
258 (cpp_string_location_reader::cpp_string_location_reader): New
259 constructor.
260 (cpp_string_location_reader::get_next): New method.
261 * include/cpplib.h (class cpp_string_location_reader): New class.
262 (class cpp_substring_ranges): New class.
263 (cpp_interpret_string_ranges): New prototype.
264 * internal.h (_cpp_valid_ucn): Add params "char_range" and
265 "loc_reader".
266 * lex.c (forms_identifier_p): Pass NULL for new params to
267 _cpp_valid_ucn.
268
8204be6c
AS
2692016-08-01 Andreas Schwab <schwab@suse.de>
270
271 * include/cpplib.h: Fix comment typo.
272
a01fc549
DM
2732016-07-27 David Malcolm <dmalcolm@redhat.com>
274
275 * include/line-map.h (source_location): Fix line numbers in
276 comment.
277
741d3be5
DM
2782016-07-11 David Malcolm <dmalcolm@redhat.com>
279
280 * include/line-map.h (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES):
281 Move here from line-map.c.
282 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
283 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): Move from
284 here to line-map.h.
285 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
286
ac81cf0b
DM
2872016-06-22 David Malcolm <dmalcolm@redhat.com>
288
289 * directives.c (do_include_common): Pass on "location" to
290 _cpp_stack_include.
291 * errors.c (cpp_diagnostic): Reimplement in terms of...
292 (cpp_diagnostic_at): New function.
293 (cpp_error_at): New function.
294 (cpp_errno_filename): Add "loc" param and use it by using
295 cpp_error_at rather than cpp_error.
296 * files.c (find_file_in_dir): Add "loc" param and pass it to
297 open_file_failed.
298 (_cpp_find_file): Add "loc" param. Use it to convert calls to
299 cpp_error to cpp_error_at, and pass it to find_file_in_dir and
300 open_file_failed.
301 (read_file_guts): Add "loc" param. Use it to convert calls to
302 cpp_error to cpp_error_at. Pass it to cpp_errno_filename.
303 (read_file): Add "loc" param. Pass it to open_file_failed and
304 read_file_guts.
305 (should_stack_file): Add "loc" param. Pass it to read_file.
306 (_cpp_stack_file): Add "loc" param. Pass it to should_stack_file.
307 (_cpp_stack_include): Add "loc" param. Pass it to
308 _cpp_find_file and _cpp_stack_file.
309 (open_file_failed): Add "loc" param. Pass it to
310 cpp_errno_filename.
311 (_cpp_fake_include): Add 0 as a source_location in call to
312 _cpp_find_file.
313 (_cpp_compare_file_date): Likewise.
314 (cpp_push_include): Likewise for call to _cpp_stack_include.
315 (cpp_push_default_include): Likewise.
316 (_cpp_save_file_entries): Likewise for call to open_file_failed.
317 (_cpp_has_header): Likewise for call to _cpp_find_file.
318 * include/cpplib.h (cpp_errno_filename): Add source_location
319 param.
320 (cpp_error_at): New declaration.
321 * init.c (cpp_read_main_file): Add 0 as a source_location in calls
322 to _cpp_find_file and _cpp_stack_file.
323 * internal.h (_cpp_find_file): Add source_location param.
324 (_cpp_stack_file): Likewise.
325 (_cpp_stack_include): Likewise.
326
a93eac6a
DM
3272016-06-22 David Malcolm <dmalcolm@redhat.com>
328
329 * include/line-map.h (fixit_hint::get_start_loc): New pure virtual
330 function.
331 (fixit_hint::maybe_get_end_loc): Likewise.
332 (fixit_insert::get_start_loc): New function, implementing
333 fixit_hint::get_start_loc.
334 (fixit_insert::maybe_get_end_loc): New function, implementing
335 fixit_hint::maybe_get_end_loc.
336 (fixit_remove::get_start_loc): New function, implementing
337 fixit_hint::get_start_loc.
338 (fixit_remove::maybe_get_end_loc): New function, implementing
339 fixit_hint::maybe_get_end_loc.
340 (fixit_replace::get_start_loc): New function, implementing
341 fixit_hint::get_start_loc.
342 (fixit_replace::maybe_get_end_loc): New function, implementing
343 fixit_hint::maybe_get_end_loc.
344
fe55692c
JDA
3452016-06-21 John David Anglin <danglin@gcc.gnu.org>
346
347 * line-map.c (location_adhoc_data_update): Use int64_t instead of
348 long long.
349 (get_combined_adhoc_loc): Likewise.
350
15c98b2e
ES
3512016-06-01 Eduard Sanou <dhole@openmailbox.org>
352
353 * include/cpplib.h (cpp_callbacks): Add get_source_date_epoch
354 callback.
355 * include/cpplib.h (cpp_init_source_date_epoch): Remove prototype.
356 * init.c (cpp_init_source_date_epoch): Remove function.
357 * init.c (cpp_create_reader): Initialize pfile->source_date_epoch.
358 * internal.h (cpp_reader): Extend comment about source_date_epoch.
359 * macro.c (_cpp_builtin_macro_text): Use get_source_date_epoch
360 callback only once, read pfile->source_date_epoch on future passes.
361 Check that get_source_date_epoch callback is not NULL.
362
ceb17928
ML
3632016-05-20 Martin Liska <mliska@suse.cz>
364
365 * config.in: Regenerated.
366 * configure: Likewise.
367 * configure.ac: Handle --enable-valgrind-annotations.
368 * lex.c (new_buff): Use ENABLE_VALGRIND_ANNOTATIONS instead
369 of ENABLE_VALGRIND_CHECKING.
370 (_cpp_free_buff): Likewise.
371
174f6622
ES
3722016-04-28 Eduard Sanou <dhole@openmailbox.org>
373 Matthias Klose <doko@debian.org>
374
375 * include/cpplib.h (cpp_init_source_date_epoch): Prototype.
376 * init.c (cpp_init_source_date_epoch): New function.
377 * internal.h: Added source_date_epoch variable to struct
378 cpp_reader to store a reproducible date.
379 * macro.c (_cpp_builtin_macro_text): Set pfile->date timestamp from
380 pfile->source_date_epoch instead of localtime if source_date_epoch is
381 set, to be used for __DATE__ and __TIME__ macros to help reproducible
382 builds.
383
12de2245
BS
3842016-04-13 Bernd Schmidt <bschmidt@redhat.com>
385
386 Patch from Roger Orr <rogero@howzatt.demon.co.uk>
387 PR preprocessor/69650
388 * directives.c (do_linemarker): Reread map after calling
389 cpp_get_token.
390
64824205
RH
3912016-04-06 Richard Henderson <rth@redhat.com>
392
393 PR preprocessor/61817
394 PR preprocessor/69391
395 * internal.h (_cpp_builtin_macro_text): Update decl.
396 * macro.c (_cpp_builtin_macro_text): Accept location for __LINE__.
397 (builtin_macro): Accept a second location for __LINE__.
398 (enter_macro_context): Compute both virtual and real expansion
399 locations for the macro.
400
3caf0ca1
BS
4012016-03-25 Bernd Schmidt <bschmidt@redhat.com>
402
403 PR lto/69650
404 * directives.c (do_linemarker): Test for file left but not entered
405 here.
406 * line-map.c (linemap_add): Not here.
407
6b366948
JJ
4082016-03-21 Jakub Jelinek <jakub@redhat.com>
409
410 PR target/70296
411 * include/cpplib.h (cpp_fun_like_macro_p): New prototype.
412 * macro.c (cpp_fun_like_macro_p): New function.
413
64567cfd
RH
4142016-03-15 Richard Henderson <rth@redhat.com>
415
416 * line-map.c (new_linemap): Make alloc_size a size_t.
417
2aaeea19
JM
4182016-03-14 Jason Merrill <jason@redhat.com>
419
420 * expr.c (cpp_classify_number): Hex floats are new in C++1z.
421 * init.c (lang_defaults): Likewise.
422
b4f3232d
DM
4232016-03-09 David Malcolm <dmalcolm@redhat.com>
424
425 PR c/68473
426 PR c++/70105
427 * line-map.c (linemap_macro_map_loc_unwind_toward_spelling): Move
428 decl...
429 * include/line-map.h
430 (linemap_macro_map_loc_unwind_toward_spelling): ...here,
431 converting from static to extern.
432
40499f81
DM
4332016-03-09 David Malcolm <dmalcolm@redhat.com>
434
435 PR c/68473
436 PR c++/70105
437 * include/line-map.h (source_range::debug): Delete.
438 (struct location_range): Update comment. Replace
439 expanded_location fields "m_start", "m_finish", and "m_caret" with
440 a source_location field: "m_loc".
441 (class rich_location): Reword comment.
442 (rich_location::get_loc): Reimplement in terms of a new overloaded
443 variant which takes an unsigned int.
444 (rich_location::get_loc_addr): Delete.
445 (rich_location::add_range): Drop params "start" and "finish" in
446 favor of param "loc". Drop overloaded variants taking a
447 source_range or location_range *.
448 (rich_location::lazily_expand_location): Delete in favor of...
449 (rich_location::get_expanded_location): New decl.
450 (rich_location::m_loc): Delete field.
451 (rich_location::m_column_override): New field.
452 * line-map.c (rich_location::rich_location): Drop name of
453 line_maps * param. Update initializations for deletion of field
454 "m_loc" and addition of field "m_column_override". Reimplement
455 body as a call to add_range. Delete overloaded variant taking a
456 source_range.
457 (rich_location::get_loc): New function.
458 (rich_location::lazily_expand_location): Delete in favor of...
459 (rich_location::get_expanded_location): New function.
460 (rich_location::override_column): Reimplement.
461 (rich_location::add_range): Drop params "start" and "finish" in
462 favor of param "loc". Eliminate location expansion in favor of
463 simply storing loc. Drop overloaded variants taking a
464 source_range or location_range *.
465 (rich_location::set_range): Eliminate location expansion.
466
7168133a
DM
4672016-02-29 David Malcolm <dmalcolm@redhat.com>
468
469 PR preprocessor/69985
470 (linemap_position_for_loc_and_offset): Rename param from "offset"
471 to "column_offset". Right-shift the column_offset by m_range_bits
472 of the pertinent ordinary map whenever offsetting a
473 source_location. For clarity, offset the column by the column
474 offset, rather than the other way around.
475
196440f8
DM
4762016-02-23 David Malcolm <dmalcolm@redhat.com>
477
478 PR preprocessor/69126
479 PR preprocessor/69543
480 * line-map.c (linemap_compare_locations): At the function top,
481 replace inlined bodies of get_location_from_adhoc_loc with calls
482 to get_location_from_adhoc_loc. Add a pair of calls to
483 get_location_from_adhoc_loc at the bottom of the function, to
484 avoid meaningless comparisons of ad-hoc and non-ad-hoc locations.
485
44714d8c
DM
4862016-02-08 David Malcolm <dmalcolm@redhat.com>
487
488 PR preprocessor/69664
489 * errors.c (cpp_diagnostic_with_line): Only call
490 rich_location::override_column if the column is non-zero.
491 * line-map.c (rich_location::override_column): Update columns
492 within m_ranges[0]. Add assertions to verify that doing so is
493 sane.
494
b5c1c988
JJ
4952016-02-05 Jakub Jelinek <jakub@redhat.com>
496
497 PR c++/69628
498 * charset.c (cpp_interpret_charconst): Clear *PCHARS_SEEN
499 and *UNSIGNEDP if bailing out early due to errors.
500
e2eb5056
JJ
5012016-01-28 Jakub Jelinek <jakub@redhat.com>
502
4bda5946
JJ
503 PR pch/68176
504 * files.c (_cpp_find_file): Set file->implicit_preinclude even if
505 included from file->implicit_preinclude header.
506
e2eb5056
JJ
507 * directives.c (destringize_and_run): Adjust prototype.
508
0afff540
DM
5092016-01-27 David Malcolm <dmalcolm@redhat.com>
510
511 PR preprocessor/69126
512 * directives.c (destringize_and_run): Add expansion_loc param; use
513 it when handling unexpanded pragmas to fixup the locations of the
514 synthesized tokens.
515 (_cpp_do__Pragma): Add expansion_loc param and use it when calling
516 destringize_and_run.
517 * internal.h (_cpp_do__Pragma): Add expansion_loc param.
518 * macro.c (builtin_macro): Pass expansion location of _Pragma to
519 _cpp_do__Pragma.
520
c7df95d8
DM
5212016-01-14 David Malcolm <dmalcolm@redhat.com>
522
523 PR preprocessor/69177
524 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): New
525 constant.
526 (LINE_MAP_MAX_LOCATION_WITH_COLS): Add note about unit tests
527 to comment.
528 (can_be_stored_compactly_p): Reduce threshold from
529 LINE_MAP_MAX_LOCATION_WITH_COLS to
530 LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES.
531 (get_combined_adhoc_loc): Likewise.
532 (get_range_from_loc): Likewise.
533 (linemap_line_start): Ensure that a new ordinary map is created
534 when transitioning from range-packing being enabled to disabled,
535 at the LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES threshold. Set
536 range_bits to 0 for new ordinary maps when beyond this limit.
537 Prevent the "increase the column bits of a freshly created map"
538 optimization if the range bits has reduced.
539
53290e07
JJ
5402016-01-08 Jakub Jelinek <jakub@redhat.com>
541
542 PR c++/69145
543 * files.c (cpp_included_before): If IS_ADHOC_LOC (location), lookup
544 real location from the line_table.
545
818ab71a
JJ
5462016-01-04 Jakub Jelinek <jakub@redhat.com>
547
548 Update copyright years.
549
329590d7
DM
5502015-12-22 David Malcolm <dmalcolm@redhat.com>
551
552 * line-map.c (get_combined_adhoc_loc): Remove condition
553 on locus < RESERVED_LOCATION_COUNT when considering
554 whether a caret == start == finish location can be
555 simply stored as the caret location.
556
f79520bb
DM
5572015-12-07 David Malcolm <dmalcolm@redhat.com>
558
559 * include/line-map.h (rich_location::set_range): Add line_maps *
560 param; convert param from source_range to source_location. Drop
561 "overwrite_loc_p" param.
562 * line-map.c (rich_location::set_range): Likewise, acting as if
563 "overwrite_loc_p" were true, and getting range from the location.
564
a87a86e1
DM
5652015-11-20 David Malcolm <dmalcolm@redhat.com>
566
567 PR 62314
568 * include/line-map.h (source_range::intersects_line_p): New
569 method.
570 (rich_location::~rich_location): New.
571 (rich_location::add_fixit_insert): New method.
572 (rich_location::add_fixit_remove): New method.
573 (rich_location::add_fixit_replace): New method.
574 (rich_location::get_num_fixit_hints): New accessor.
575 (rich_location::get_fixit_hint): New accessor.
576 (rich_location::MAX_FIXIT_HINTS): New constant.
577 (rich_location::m_num_fixit_hints): New field.
578 (rich_location::m_fixit_hints): New field.
579 (class fixit_hint): New class.
580 (class fixit_insert): New class.
581 (class fixit_remove): New class.
582 (class fixit_replace): New class.
583 * line-map.c (source_range::intersects_line_p): New method.
584 (rich_location::rich_location): Add initialization of
585 m_num_fixit_hints to both ctors.
586 (rich_location::~rich_location): New.
587 (rich_location::add_fixit_insert): New method.
588 (rich_location::add_fixit_remove): New method.
589 (rich_location::add_fixit_replace): New method.
590 (fixit_insert::fixit_insert): New.
591 (fixit_insert::~fixit_insert): New.
592 (fixit_insert::affects_line_p): New.
593 (fixit_remove::fixit_remove): New.
594 (fixit_remove::affects_line_p): New.
595 (fixit_replace::fixit_replace): New.
596 (fixit_replace::~fixit_replace): New.
597 (fixit_replace::affects_line_p): New.
598
46ce03de
JJ
5992015-11-19 Jakub Jelinek <jakub@redhat.com>
600
601 PR preprocessor/60736
602 * include/cpplib.h (cpp_errno_filename): New prototype.
603 * errors.c (cpp_errno): Don't handle msgid "" specially, use
604 _(msgid) instead of msgid as argument to cpp_error.
605 (cpp_errno_filename): New function.
606 * files.c (read_file_guts): Use cpp_errno_filename instead of
607 cpp_errno.
608 (open_file_failed): Likewise. Use file->name if file->path is NULL
609 in diagnostics.
610
ebedc9a3
DM
6112015-11-13 David Malcolm <dmalcolm@redhat.com>
612
613 * errors.c (cpp_diagnostic): Pass pfile->line_table to
614 rich_location ctor.
615 (cpp_diagnostic_with_line): Likewise.
616 * include/cpplib.h (struct cpp_token): Update comment for src_loc
617 to indicate that the range of the token is "baked into" the
618 source_location.
619 * include/line-map.h (source_location): Update the descriptive
620 comment to reflect the packing scheme for short ranges, adding
621 worked examples of location encoding.
622 (struct line_map_ordinary): Drop field "column_bits" in favor
623 of field "m_column_and_range_bits"; add field "m_range_bits".
624 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
625 (location_adhoc_data): Add source_range field.
626 (struct line_maps): Add fields "default_range_bits",
627 "num_optimized_ranges" and "num_unoptimized_ranges".
628 (get_combined_adhoc_loc): Add source_range param.
629 (get_range_from_loc): New declaration.
630 (pure_location_p): New prototype.
631 (COMBINE_LOCATION_DATA): Add source_range param.
632 (SOURCE_LINE): Update for renaming of column_bits.
633 (SOURCE_COLUMN): Likewise. Shift the column right by the map's
634 range_bits.
635 (LAST_SOURCE_LINE_LOCATION): Update for renaming of column_bits.
636 (linemap_position_for_line_and_column): Add line_maps * params.
637 (rich_location::rich_location): Likewise.
638 * lex.c (_cpp_lex_direct): Capture the range of the token, baking
639 it into token->src_loc via a call to COMBINE_LOCATION_DATA.
640 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): Reduce from 1U << 17 to
641 1U << 12.
642 (location_adhoc_data_hash): Add the src_range into
643 the hash value.
644 (location_adhoc_data_eq): Require equality of the src_range
645 values.
646 (can_be_stored_compactly_p): New function.
647 (get_combined_adhoc_loc): Add src_range param, and store it,
648 via a bit-packing scheme for short ranges, otherwise within the
649 lookaside table. Remove the requirement that data is non-NULL.
650 (get_range_from_adhoc_loc): New function.
651 (get_range_from_loc): New function.
652 (pure_location_p): New function.
653 (linemap_add): Ensure that start_location has zero for the
654 range_bits, unless we're past LINE_MAP_MAX_LOCATION_WITH_COLS.
655 Initialize range_bits to zero. Assert that the start_location
656 is "pure".
657 (linemap_line_start): Assert that the
658 column_and_range_bits >= range_bits.
659 Update determinination of whether we need to start a new map
660 using the effective column bits, without the range bits.
661 Use the set's default_range_bits in new maps, apart from
662 those with column_bits == 0, which should also have 0 range_bits.
663 Increase the column bits for new maps by the range bits.
664 When adding lines to an existing map, use set->highest_line
665 directly rather than offsetting highest by SOURCE_COLUMN.
666 Add assertions to sanity-check the return value.
667 (linemap_position_for_column): Offset to_column by range_bits.
668 Update set->highest_location if necessary.
669 (linemap_position_for_line_and_column): Add line_maps * param.
670 Update the calculation to offset the column by range_bits, and
671 conditionalize it on being <= LINE_MAP_MAX_LOCATION_WITH_COLS.
672 Bound it by LINEMAPS_MACRO_LOWEST_LOCATION. Update
673 set->highest_location if necessary.
674 (linemap_position_for_loc_and_offset): Handle ad-hoc locations;
675 pass "set" to linemap_position_for_line_and_column.
676 (linemap_macro_map_loc_unwind_toward_spelling): Add line_maps
677 param. Handle ad-hoc locations.
678 (linemap_location_in_system_header_p): Pass on "set" to call to
679 linemap_macro_map_loc_unwind_toward_spelling.
680 (linemap_macro_loc_to_spelling_point): Retain ad-hoc locations.
681 Pass on "set" to call to
682 linemap_macro_map_loc_unwind_toward_spelling.
683 (linemap_resolve_location): Retain ad-hoc locations. Pass on
684 "set" to call to linemap_macro_map_loc_unwind_toward_spelling.
685 (linemap_unwind_toward_expansion): Pass on "set" to call to
686 linemap_macro_map_loc_unwind_toward_spelling.
687 (linemap_expand_location): Extract the data pointer before
688 extracting the location.
689 (rich_location::rich_location): Add line_maps param; use it to
690 extract the range from the source_location.
691 * location-example.txt: Regenerate, showing new representation.
692
8a645150
DM
6932015-11-06 David Malcolm <dmalcolm@redhat.com>
694
695 * errors.c (cpp_diagnostic): Update for change in signature
696 of "error" callback.
697 (cpp_diagnostic_with_line): Likewise, calling override_column
698 on the rich_location.
699 * include/cpplib.h (struct cpp_callbacks): Within "error"
700 callback, convert param from source_location to rich_location *,
701 and drop column_override param.
702 * include/line-map.h (struct source_range): New struct.
703 (struct location_range): New struct.
704 (class rich_location): New class.
705 (linemap_client_expand_location_to_spelling_point): New declaration.
706 * line-map.c (rich_location::rich_location): New ctors.
707 (rich_location::lazily_expand_location): New method.
708 (rich_location::override_column): New method.
709 (rich_location::add_range): New methods.
710 (rich_location::set_range): New method.
711
ee015909
DM
7122015-11-06 David Malcolm <dmalcolm@redhat.com>
713
714 * include/line-map.h (struct linemap_stats): Add fields
715 "adhoc_table_size" and "adhoc_table_entries_used".
716 * line-map.c (linemap_get_statistics): Populate above fields.
717
a6c764d0
MM
7182015-11-04 Mikhail Maltsev <maltsevm@gmail.com>
719
720 * config.in: Regenerate.
721 * configure: Regenerate.
722 * configure.ac: Remove ENABLE_CHECKING.
723
49445904
UB
7242015-11-03 Uros Bizjak <ubizjak@gmail.com>
725
726 * lex.c (search_line_sse42): Correctly advance the pointer to an
727 aligned address.
728
525ce910
DM
7292015-11-02 David Malcolm <dmalcolm@redhat.com>
730
731 * include/line-map.h (source_location): In the table in the
732 descriptive comment, show UNKNOWN_LOCATION, BUILTINS_LOCATION,
733 LINE_MAP_MAX_LOCATION_WITH_COLS, LINE_MAP_MAX_SOURCE_LOCATION.
734 Add notes about ad-hoc values.
735
7ec491c0
MM
7362015-10-21 Mikhail Maltsev <maltsevm@gmail.com>
737
22d66382
MM
738 * include/line-map.h: Use CHECKING_P instead of ENABLE_CHECKING.
739 * init.c: Likewise.
740 * macro.c (struct macro_arg_token_iter, set_arg_token,
741 macro_arg_token_iter_init, macro_arg_token_iter_forward,
742 macro_arg_token_iter_get_token, macro_arg_token_iter_get_location,
743 alloc_expanded_arg_mem, _cpp_backup_tokens): Likewise.
744
7ec491c0
MM
745 * config.in: Regenerate.
746 * configure: Regenerate.
747 * configure.ac (CHECKING_P): Define.
748 * system.h (fancy_abort): Declare.
749 (abort): Define.
750 (gcc_assert): Define. Use CHECKING_P.
751
179b8d05
MM
7522015-10-13 Mikhail Maltsev <maltsevm@gmail.com>
753
754 * system.h (CHECKING_P, gcc_checking_assert): Define.
755
87b470b3
MLI
7562015-09-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
757
758 PR c/66415
759 * line-map.c (linemap_position_for_loc_and_offset): Handle the
760 case of long lines encoded in multiple maps.
761
85bc8baa
MP
7622015-09-07 Marek Polacek <polacek@redhat.com>
763
764 * system.h (INTTYPE_MINIMUM): Rewrite to avoid shift warning.
765
bf5372e7
YS
7662015-08-06 Yaakov Selkowitz <yselkowi@redhat.com>
767
768 * configure: Regenerate.
769
d17f7d59
TS
7702015-07-08 Thomas Schwinge <thomas@codesourcery.com>
771
772 * include/line-map.h (RESERVED_LOCATION_COUNT): Change type to
773 source_location.
774
fbb22910
PC
7752015-07-02 Paolo Carlini <paolo.carlini@oracle.com>
776
d885793d 777 PR preprocessor/53690
fbb22910
PC
778 * charset.c (_cpp_valid_ucn): Add cppchar_t * parameter and change
779 return type to bool. Fix encoding of \u0000 and \U00000000 in C++.
780 (convert_ucn): Adjust call.
781 * lex.c (forms_identifier_p): Likewise.
782 * internal.h (_cpp_valid_ucn): Adjust declaration.
783
fe95b036
ESR
7842015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
785
786 Implement N4197 - Adding u8 character literals
787 * include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens;
788 (struct cpp_options): Add utf8_char_literals.
789 * init.c (struct lang_flags): Add utf8_char_literals;
790 (struct lang_flags lang_defaults): Add column for utf8_char_literals.
fbb22910 791 * macro.c (stringify_arg()): Treat CPP_UTF8CHAR token;
fe95b036
ESR
792 * expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()):
793 Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens;
794 (cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token;
795 (eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token.
796 * lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens.
797 * charset.c (converter_for_type(), cpp_interpret_charconst()):
798 Treat CPP_UTF8CHAR token.
799
dc6bcf52
UB
8002015-06-30 Uros Bizjak <ubizjak@gmail.com>
801
802 * lex.c (search_line_sse42) [__GCC_ASM_FLAG_OUTPUTS__]: New main
803 loop using asm flag outputs.
804
a1661b90
MP
8052015-06-08 Marek Polacek <polacek@redhat.com>
806
807 PR c/66415
808 * line-map.c (linemap_position_for_loc_and_offset): Remove
809 linemap_assert_fails; reverse conditions.
810
815facd3
MLI
8112015-05-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
812
813 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER
814 LINE_MAP_MAX_LOCATION_WITH_COLS,LINE_MAP_MAX_SOURCE_LOCATION):
815 New constants.
816 (linemap_line_start): Use them.
817 (linemap_position_for_column): Use them.
818
c819ed29
DM
8192015-05-20 David Malcolm <dmalcolm@redhat.com>
820
821 * include/line-map.h (MAP_START_LOCATION): Eliminate the non-const
822 variant, and tweak comment for the const variant.
823 (ORDINARY_MAP_STARTING_LINE_NUMBER): Drop the non-const variant.
824 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
825 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
826 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
827 (ORDINARY_MAP_FILE_NAME): Drop the non-const variant.
828 (MACRO_MAP_MACRO): Likewise.
829 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
830 (MACRO_MAP_LOCATIONS): Likewise.
831 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
832 * line-map.c (linemap_add): Replace writes through macros with
833 direct field accesses.
834 (linemap_enter_macro): Likewise.
835 (linemap_line_start): Likewise.
836
0e50b624
DM
8372015-05-19 David Malcolm <dmalcolm@redhat.com>
838
839 * directives.c (do_line): Strengthen local "map" from
840 const line_map * to const line_map_ordinary *.
841 (do_linemarker): Likewise.
842 (_cpp_do_file_change): Assert that we're not dealing with
843 a macro map. Introduce local "ord_map" via a call to
844 linemap_check_ordinary, guarded within the check for
845 non-NULL. Use it for typesafety.
846 * files.c (cpp_make_system_header): Strengthen local "map" from
847 const line_map * to const line_map_ordinary *.
848 * include/cpplib.h (struct cpp_callbacks): Likewise for second
849 parameter of "file_change" callback.
850 * include/line-map.h (struct line_map): Convert from a struct
851 containing a union to a base class.
852 (struct line_map_ordinary): Convert to a subclass of line_map.
853 (struct line_map_macro): Likewise.
854 (linemap_check_ordinary): Strengthen return type from line_map *
855 to line_map_ordinary *, and add a const-variant.
856 (linemap_check_macro): New pair of functions.
857 (ORDINARY_MAP_STARTING_LINE_NUMBER): Strengthen param from
858 const line_map * to const line_map_ordinary *, eliminating call
859 to linemap_check_ordinary. Likewise for the non-const variant.
860 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
861 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
862 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Likewise.
863 (ORDINARY_MAP_FILE_NAME): Likewise.
864 (MACRO_MAP_MACRO): Strengthen param from const line_map * to
865 const line_map_macro *. Likewise for the non-const variant.
866 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
867 (MACRO_MAP_LOCATIONS): Likewise.
868 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
869 (struct maps_info): Replace with...
870 (struct maps_info_ordinary):...this and...
871 (struct maps_info_macro): ...this.
872 (struct line_maps): Convert fields "info_ordinary" and
873 "info_macro" to the above new structs.
874 (LINEMAPS_MAP_INFO): Delete both functions.
875 (LINEMAPS_MAPS): Likewise.
876 (LINEMAPS_ALLOCATED): Rewrite both variants to avoid using
877 LINEMAPS_MAP_INFO.
878 (LINEMAPS_USED): Likewise.
879 (LINEMAPS_CACHE): Likewise.
880 (LINEMAPS_MAP_AT): Likewise.
881 (LINEMAPS_ORDINARY_MAPS): Strengthen return type from line_map *
882 to line_map_ordinary *.
883 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
884 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
885 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
886 (LINEMAPS_MACRO_MAPS): Strengthen return type from line_map * to
887 line_map_macro *.
888 (LINEMAPS_MACRO_MAP_AT): Likewise.
889 (LINEMAPS_LAST_MACRO_MAP): Likewise.
890 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
891 (linemap_map_get_macro_name): Strengthen param from
892 const line_map * to const line_map_macro *.
893 (SOURCE_LINE): Strengthen first param from const line_map * to
894 const line_map_ordinary *, removing call to
895 linemap_check_ordinary.
896 (SOURCE_COLUMN): Likewise.
897 (LAST_SOURCE_LINE_LOCATION): Likewise.
898 (LAST_SOURCE_LINE): Strengthen first param from const line_map *
899 to const line_map_ordinary *.
900 (LAST_SOURCE_COLUMN): Likewise.
901 (INCLUDED_FROM): Strengthen return type from line_map * to
902 line_map_ordinary *., and second param from const line_map *
903 to const line_map_ordinary *, removing call to
904 linemap_check_ordinary.
905 (MAIN_FILE_P): Strengthen param from const line_map * to
906 const line_map_ordinary *, removing call to
907 linemap_check_ordinary.
908 (linemap_position_for_line_and_column): Strengthen param from
909 const line_map * to const line_map_ordinary *.
910 (LINEMAP_FILE): Strengthen param from const line_map * to
911 const line_map_ordinary *, removing call to
912 linemap_check_ordinary.
913 (LINEMAP_LINE): Likewise.
914 (LINEMAP_SYSP): Likewise.
915 (linemap_resolve_location): Strengthen final param from
916 const line_map ** to const line_map_ordinary **.
917 * internal.h (CPP_INCREMENT_LINE): Likewise for local "map".
918 (linemap_enter_macro): Strengthen return type from
919 const line_map * to const line_map_macro *.
920 (linemap_add_macro_token): Likewise for first param.
921 * line-map.c (linemap_check_files_exited): Strengthen local "map"
922 from const line_map * to const line_map_ordinary *.
923 (new_linemap): Introduce local "map_size" and use it when
924 calculating how large the buffer should be. Rewrite based
925 on change of info_macro and info_ordinary into distinct types.
926 (linemap_add): Strengthen locals "map" and "from" from line_map *
927 to line_map_ordinary *.
928 (linemap_enter_macro): Strengthen return type from
929 const line_map * to const line_map_macro *, and local "map" from
930 line_map * to line_map_macro *.
931 (linemap_add_macro_token): Strengthen param "map" from
932 const line_map * to const line_map_macro *.
933 (linemap_line_start): Strengthen local "map" from line_map * to
934 line_map_ordinary *.
935 (linemap_position_for_column): Likewise.
936 (linemap_position_for_line_and_column): Strengthen first param
937 from const line_map * to const line_map_ordinary *.
938 (linemap_position_for_loc_and_offset): Strengthen local "map" from
939 const line_map * to const line_map_ordinary *.
940 (linemap_ordinary_map_lookup): Likewise for return type and locals
941 "cached" and "result".
942 (linemap_macro_map_lookup): Strengthen return type and locals
943 "cached" and "result" from const line_map * to
944 const line_map_macro *.
945 (linemap_macro_map_loc_to_exp_point): Likewise for param "map".
946 (linemap_macro_map_loc_to_def_point): Likewise.
947 (linemap_macro_map_loc_unwind_toward_spelling): Likewise.
948 (linemap_get_expansion_line): Strengthen local "map" from
949 const line_map * to const line_map_ordinary *.
950 (linemap_get_expansion_filename): Likewise.
951 (linemap_map_get_macro_name): Strengthen param from
952 const line_map * to const line_map_macro *.
953 (linemap_location_in_system_header_p): Add call to
954 linemap_check_ordinary in region guarded by
955 !linemap_macro_expansion_map_p. Introduce local "macro_map" via
956 linemap_check_macro in other region, using it in place of "map"
957 for typesafety.
958 (first_map_in_common_1): Add calls to linemap_check_macro.
959 (trace_include): Strengthen param "map" from const line_map * to
960 const line_map_ordinary *.
961 (linemap_macro_loc_to_spelling_point): Strengthen final param from
962 const line_map ** to const line_map_ordinary **. Replace a
963 C-style cast with a const_cast, and add calls to
964 linemap_check_macro and linemap_check_ordinary.
965 (linemap_macro_loc_to_def_point): Likewise.
966 (linemap_macro_loc_to_exp_point): Likewise.
967 (linemap_resolve_location): Strengthen final param from
968 const line_map ** to const line_map_ordinary **.
969 (linemap_unwind_toward_expansion): Introduce local "macro_map" via
970 a checked cast and use it in place of *map.
971 (linemap_unwind_to_first_non_reserved_loc): Strengthen local
972 "map1" from const line_map * to const line_map_ordinary *.
973 (linemap_expand_location): Introduce local "ord_map" via a checked
974 cast and use it in place of map.
975 (linemap_dump): Make local "map" const. Strengthen local
976 "includer_map" from line_map * to const line_map_ordinary *.
977 Introduce locals "ord_map" and "macro_map" via checked casts and
978 use them in place of "map" for typesafety.
979 (linemap_dump_location): Strengthen local "map" from
980 const line_map * to const line_map_ordinary *.
981 (linemap_get_file_highest_location): Update for elimination of
982 union.
983 (linemap_get_statistics): Strengthen local "cur_map" from
984 line_map * to const line_map_macro *. Update uses of sizeof to
985 use the appropriate line_map subclasses.
986 * macro.c (_cpp_warn_if_unused_macro): Add call to
987 linemap_check_ordinary.
988 (builtin_macro): Strengthen local "map" from const line_map * to
989 const line_map_macro *.
990 (enter_macro_context): Likewise.
991 (replace_args): Likewise.
992 (tokens_buff_put_token_to): Likewise for param "map".
993 (tokens_buff_add_token): Likewise.
994
ba4ad400
DM
9952015-05-13 David Malcolm <dmalcolm@redhat.com>
996
997 * include/line-map.h (source_location): Add a reference to
998 location-example.txt to the descriptive comment.
999 * location-example.txt: New file.
1000
0501dbd9
DM
10012015-05-13 David Malcolm <dmalcolm@redhat.com>
1002
1003 * include/line-map.h (MAX_SOURCE_LOCATION): Convert from a macro
1004 to a const source_location.
1005 (RESERVED_LOCATION_COUNT): Likewise.
1006 (linemap_check_ordinary): Convert from a macro to a pair of inline
1007 functions, for const/non-const arguments.
1008 (MAP_START_LOCATION): Likewise.
1009 (ORDINARY_MAP_STARTING_LINE_NUMBER): Likewise.
1010 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
1011 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
1012 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Convert from a macro to a
1013 pair of inline functions, for const/non-const arguments, where the
1014 latter is named...
1015 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): New function.
1016 (ORDINARY_MAP_FILE_NAME): Convert from a macro to a pair of inline
1017 functions, for const/non-const arguments.
1018 (MACRO_MAP_MACRO): Likewise.
1019 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
1020 (MACRO_MAP_LOCATIONS): Likewise.
1021 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
1022 (LINEMAPS_MAP_INFO): Likewise.
1023 (LINEMAPS_MAPS): Likewise.
1024 (LINEMAPS_ALLOCATED): Likewise.
1025 (LINEMAPS_USED): Likewise.
1026 (LINEMAPS_CACHE): Likewise.
1027 (LINEMAPS_ORDINARY_CACHE): Likewise.
1028 (LINEMAPS_MACRO_CACHE): Likewise.
1029 (LINEMAPS_MAP_AT): Convert from a macro to an inline function.
1030 (LINEMAPS_LAST_MAP): Likewise.
1031 (LINEMAPS_LAST_ALLOCATED_MAP): Likewise.
1032 (LINEMAPS_ORDINARY_MAPS): Likewise.
1033 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
1034 (LINEMAPS_ORDINARY_ALLOCATED): Likewise.
1035 (LINEMAPS_ORDINARY_USED): Likewise.
1036 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
1037 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
1038 (LINEMAPS_MACRO_MAPS): Likewise.
1039 (LINEMAPS_MACRO_MAP_AT): Likewise.
1040 (LINEMAPS_MACRO_ALLOCATED): Likewise.
1041 (LINEMAPS_MACRO_USED): Likewise.
1042 (LINEMAPS_MACRO_LOWEST_LOCATION): Likewise.
1043 (LINEMAPS_LAST_MACRO_MAP): Likewise.
1044 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
1045 (IS_ADHOC_LOC): Likewise.
1046 (COMBINE_LOCATION_DATA): Likewise.
1047 (SOURCE_LINE): Likewise.
1048 (SOURCE_COLUMN): Likewise.
1049 (LAST_SOURCE_LINE_LOCATION): Likewise.
1050 (LAST_SOURCE_LINE): Likewise.
1051 (LAST_SOURCE_COLUMN): Likewise.
1052 (LAST_SOURCE_LINE_LOCATION)
1053 (INCLUDED_FROM): Likewise.
1054 (MAIN_FILE_P): Likewise.
1055 (LINEMAP_FILE): Likewise.
1056 (LINEMAP_LINE): Likewise.
1057 (LINEMAP_SYSP): Likewise.
1058 (linemap_location_before_p): Likewise.
1059 * line-map.c (linemap_check_files_exited): Make local "map" const.
1060 (linemap_add): Use SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS.
1061 (linemap_line_start): Likewise.
1062
eb70f327
MH
10632015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
1064
1065 * aclocal.m4: Regenerated with automake-1.11.6.
1066
60c12095
DM
10672015-05-13 David Malcolm <dmalcolm@redhat.com>
1068
1069 * include/line-map.h (linemap_assert): Move up within the file to
1070 before all of the map accessor macros.
1071 (linemap_assert_fails): Likewise.
1072 (linemap_check_ordinary): Likewise.
1073 (linemap_macro_expansion_map_p): Likewise.
1074
c3388e62
DM
10752015-05-12 David Malcolm <dmalcolm@redhat.com>
1076
1077 * directives.c (do_line): Set seen_line_directive on line_table.
1078 (do_linemarker): Likewise.
1079 * include/line-map.h (struct line_maps): Add new field
1080 "seen_line_directive".
1081
fe191308
JM
10822015-05-08 Jason Merrill <jason@redhat.com>
1083
1084 * include/cpplib.h: Add CPP_W_CXX11_COMPAT.
1085 (struct cpp_options): Add cpp_warn_cxx11_compat.
1086 * init.c (cpp_create_reader): Initialize it.
1087 * lex.c (lex_string): Add -Wc++11-compat warning.
1088
21c0a521
DM
10892015-05-05 David Malcolm <dmalcolm@redhat.com>
1090
1091 * pch.c (cpp_valid_state): Fix indentation so that it reflects the
1092 block structure.
1093
c87b25e6
DM
10942015-05-05 David Malcolm <dmalcolm@redhat.com>
1095
1096 * include/line-map.h: Fix comment at the top of the file.
1097 (source_location): Rewrite and expand the comment for this
1098 typedef, adding an ascii-art table to clarify how source_location
1099 values are allocated.
1100 * line-map.c: Fix comment at the top of the file.
1101
ca708025
RB
11022015-04-09 Richard Biener <rguenther@suse.de>
1103
1104 PR pch/65550
1105 * files.c (pch_open_file): Allow main and pre-included files
1106 when trying to open a PCH.
1107
e4b33ee5
JJ
11082015-04-06 Jakub Jelinek <jakub@redhat.com>
1109
1110 PR preprocessor/61977
1111 * lex.c (cpp_peek_token): If peektok is CPP_EOF, back it up
1112 with all tokens peeked by the current function.
1113
b8cd77f4
JJ
11142015-04-02 Jakub Jelinek <jakub@redhat.com>
1115
1116 PR preprocessor/61977
1117 * lex.c (cpp_peek_token): Temporarily clear pfile->cb.line_change.
1118
fb136e35
JJ
11192015-03-23 Jakub Jelinek <jakub@redhat.com>
1120
1121 PR preprocessor/65238
1122 * internal.h (_cpp_scan_out_logical_line): Add third argument.
1123 * directives.c (prepare_directive_trad): Pass false to it.
1124 * traditional.c (_cpp_read_logical_line_trad,
1125 _cpp_create_trad_definition): Likewise.
1126 (struct fun_macro): Add paramc field.
1127 (fun_like_macro): New function.
1128 (maybe_start_funlike): Handle NODE_BUILTIN macros. Initialize
1129 macro->paramc field.
1130 (save_argument): Use macro->paramc instead of
1131 macro->node->value.macro->paramc.
1132 (push_replacement_text): Formatting fix.
1133 (recursive_macro): Use fun_like_macro helper.
1134 (_cpp_scan_out_logical_line): Likewise. Add BUILTIN_MACRO_ARG
1135 argument. Initialize fmacro.paramc field. Handle builtin
1136 function-like macros.
1137
a5858a3d
ESR
11382015-03-16 Edward Smith-Rowland <3dw4rd@verizon.net>
1139
1140 PR c++/64626
1141 * lex.c (lex_number): If a number ends with digit-seps (') skip back
1142 and let lex_string take them.
1143
44d95244
MT
11442015-03-02 Markus Trippelsdorf <markus@trippelsdorf.de>
1145
1146 PR target/65261
1147 * lex.c (search_line_fast): Silence ubsan errors.
1148
f8abc9ba
DS
11492015-02-03 <dodji@redhat.com>
1150
1151 PR preprocessor/64803
1152 * internal.h (cpp_reader::top_most_macro_node): New data member.
1153 * macro.c (enter_macro_context): Pass the location of the end of
1154 the top-most invocation of the function-like macro, or the
1155 location of the expansion point of the top-most object-like macro.
1156 (cpp_get_token_1): Store the top-most macro node in the new
1157 pfile->top_most_macro_node data member.
1158 (_cpp_pop_context): Clear the new cpp_reader::top_most_macro_node
1159 data member.
1160
95d0610c
SN
11612015-01-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
1162
1163 * lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON.
1164
10ef8f28
MP
11652015-01-23 Marek Polacek <polacek@redhat.com>
1166
1167 DR#412
1168 PR preprocessor/60570
1169 * directives.c (do_elif): Don't evaluate #elif conditionals
1170 when they don't need to be.
1171
6e6cb471
JJ
11722015-01-16 Jakub Jelinek <jakub@redhat.com>
1173
1174 * expr.c (cpp_classify_number): Add N_() around ?: string
1175 literals used in cpp_error_with_line call as format string.
1176
5624e564
JJ
11772015-01-05 Jakub Jelinek <jakub@redhat.com>
1178
1179 Update copyright years.
1180
1f8d3e84
JJ
11812014-12-19 Jakub Jelinek <jakub@redhat.com>
1182
1183 PR preprocessor/63831
1184 * directives.c (lex_macro_node): Remove __has_attribute__ handling.
1185 * internal.h (struct spec_node): Remove n__has_attribute__ field.
1186 (struct lexer_state): Remove in__has_attribute__ field.
1187 * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_ATTRIBUTE.
1188 * identifiers.c (_cpp_init_hashtable): Remove __has_attribute__
1189 handling.
1190 * init.c (builtin_array): Add __has_attribute and __has_cpp_attribute.
1191 (cpp_init_special_builtins): Don't initialize __has_attribute
1192 or __has_cpp_attribute if CLK_ASM or pfile->cb.has_attribute is NULL.
1193 * traditional.c (enum ls): Remove ls_has_attribute,
1194 ls_has_attribute_close.
1195 (_cpp_scan_out_logical_line): Remove __has_attribute__ handling.
1196 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_ATTRIBUTE.
1197 * pch.c (cpp_read_state): Remove __has_attribute__ handling.
1198 * expr.c (eval_token): Likewise.
1199 (parse_has_attribute): Removed.
1200
01ca36af
UB
12012014-12-11 Uros Bizjak <ubizjak@gmail.com>
1202
1203 * directives.c (cpp_define_formatted): Use xvasprintf.
1204
b93c0722
MLI
12052014-12-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
1206
1207 * line-map.c (linemap_position_for_loc_and_offset): Add new
1208 linemap_assert_fails.
1209
73bd8329
MLI
12102014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
1211
1212 * include/line-map.h (linemap_assert_fails): Declare.
1213 * line-map.c (linemap_position_for_loc_and_offset): Use it.
1214
9c320ab1
MLI
12152014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
1216
49445904
UB
1217 * line-map.c (linemap_add): Fix typo.
1218 (linemap_line_start): Fix whitespace.
9c320ab1 1219
81fee4a7
JM
12202014-11-29 John Schmerge <jbschmerge@gmail.com>
1221
1222 PR preprocessor/41698
1223 * charset.c (one_utf8_to_utf16): Do not produce surrogate pairs
1224 for 0xffff.
1225
43ba1c6c
JJ
12262014-11-25 Jakub Jelinek <jakub@redhat.com>
1227
1228 PR preprocessor/60436
1229 * line-map.c (linemap_line_start): If highest is above 0x60000000
1230 and we are still tracking columns or highest is above 0x70000000,
1231 force add_map.
1232
8a23b100
UB
12332014-11-20 Uros Bizjak <ubizjak@gmail.com>
1234
1235 PR target/63966
1b6b13f3
UB
1236 * lex.c [__i386__ || __x86_64__]: Compile special SSE functions
1237 only for (__GNUC__ >= 5 || !defined(__PIC__)).
8a23b100 1238
d82f1e13
MLI
12392014-11-13 Manuel López-Ibáñez <manu@gcc.gnu.org>
1240
1241 * include/line-map.h: Include EXPR, so that unused variable warnings
1242 do not occur.
1243
3aa34c1d
MLI
12442014-11-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
1245
1246 PR fortran/44054
1247 * include/line-map.h (linemap_position_for_loc_and_offset):
1248 Declare.
1249 * line-map.c (linemap_position_for_loc_and_offset): New.
1250
35485da9
DM
12512014-11-11 David Malcolm <dmalcolm@redhat.com>
1252
1253 * ChangeLog.jit: New.
1254
42fd12b1
ESR
12552014-11-10 Edward Smith-Rowland <3dw4rd@verizon.net>
1256
1257 * include/cpplib.h (cpp_callbacks): Add has_attribute.
1258 * internal.h (lexer_state): Add in__has_attribute__.
1259 * directives.c (lex_macro_node): Prevent use of __has_attribute__
1260 as a macro.
1261 * expr.c (parse_has_attribute): New function; (eval_token): Look for
1262 __has_attribute__ and route to parse_has_attribute.
1263 * identifiers.c (_cpp_init_hashtable): Initialize n__has_attribute__.
1264 * pch.c (cpp_read_state): Initialize n__has_attribute__.
1265 * traditional.c (enum ls): Add ls_has_attribute, ls_has_attribute_close;
1266 (_cpp_scan_out_logical_line): Attend to __has_attribute__.
1267
be5ffc59
JM
12682014-11-06 Joseph Myers <joseph@codesourcery.com>
1269
1270 * include/cpp-id-data.h (struct cpp_macro): Update comment
1271 regarding parameters.
1272 * include/cpplib.h (struct cpp_macro_arg, struct cpp_identifier):
1273 Add spelling fields.
1274 (struct cpp_token): Update comment on macro_arg.
1275 * internal.h (_cpp_save_parameter): Add extra argument.
1276 (_cpp_spell_ident_ucns): New declaration.
1277 * lex.c (lex_identifier): Add SPELLING argument. Set *SPELLING to
1278 original spelling of identifier.
1279 (_cpp_lex_direct): Update calls to lex_identifier.
1280 (_cpp_spell_ident_ucns): New function, factored out of
1281 cpp_spell_token.
1282 (cpp_spell_token): Adjust FORSTRING argument semantics to return
1283 original spelling of identifiers. Use _cpp_spell_ident_ucns in
1284 !FORSTRING case.
1285 (_cpp_equiv_tokens): Check spellings of identifiers and macro
1286 arguments are identical.
1287 * macro.c (macro_arg_saved_data): New structure.
1288 (paste_tokens): Use original spellings of identifiers from
1289 cpp_spell_token.
1290 (_cpp_save_parameter): Add argument SPELLING. Save both canonical
1291 node and its value.
1292 (parse_params): Update calls to _cpp_save_parameter.
1293 (lex_expansion_token): Save spelling of macro argument tokens.
1294 (_cpp_create_definition): Extract canonical node from saved data.
1295 (cpp_macro_definition): Use UCNs in spelling of macro name. Use
1296 original spellings of macro argument tokens and identifiers.
1297 * traditional.c (scan_parameters): Update call to
1298 _cpp_save_parameter.
1299
701cade1
JM
13002014-11-05 Joseph Myers <joseph@codesourcery.com>
1301
1302 PR preprocessor/9449
1303 * init.c (lang_defaults): Enable extended identifiers for C++ and
1304 C99-based standards.
1305
19a9ba64
AM
13062014-10-22 Alan Modra <amodra@gmail.com>
1307
1308 * symtab.c (ht_create): Use obstack_specify_allocation in place of
1309 _obstack_begin.
1310 * files.c (_cpp_init_files): Likewise.
1311 * init.c (cpp_create_reader): Likewise.
1312 * identifiers.c (_cpp_init_hashtable): Likewise.
1313
3aac0952
MLI
13142014-10-14 Manuel López-Ibáñez <manu@gcc.gnu.org>
1315
1316 * include/line-map.h (linemap_location_from_macro_expansion_p):
1317 const struct line_maps * argument.
1318 (linemap_position_for_line_and_column): const struct line_map *
1319 argument.
1320 * line-map.c (linemap_add_macro_token): Use correct argument name
1321 in comment.
1322 (linemap_position_for_line_and_column): const struct line_map *
1323 argument.
1324 (linemap_macro_map_loc_to_def_point): Fix comment. Make static.
1325 (linemap_location_from_macro_expansion_p): const struct line_maps *
1326 argument.
1327 (linemap_resolve_location): Fix argument names in comment.
1328
0ccaaab0
BS
13292014-10-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
1330
1331 * lex.c (search_line_fast): Add new version to be used for Power8
1332 and later targets when Altivec is enabled. Restrict the existing
1333 Altivec version to big-endian systems so that lvsr is not used on
1334 little endian, where it is deprecated. Remove LE-specific code
1335 from the now-BE-only version.
1336
dc257367
BE
13372014-10-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
1338 Jeff Law <law@redhat.com>
1339
1340 * charset.c (convert_no_conversion): Reallocate memory with 25%
1341 headroom.
1342
a15f7cb8
ESR
13432014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net>
1344
1345 Implement SD-6: SG10 Feature Test Recommendations
1346 * internal.h (lexer_state, spec_nodes): Add in__has_include__.
1347 * directives.c: Support __has_include__ builtin.
1348 * expr.c (parse_has_include): New function to parse __has_include__
1349 builtin; (eval_token()): Use it.
1350 * files.c (_cpp_has_header()): New funtion to look for header;
1351 (open_file_failed()): Not an error to not find a header file for
1352 __has_include__.
1353 * identifiers.c (_cpp_init_hashtable()): Add entry for __has_include__.
1354 * pch.c (cpp_read_state): Lookup __has_include__.
1355 * traditional.c (enum ls, _cpp_scan_out_logical_line()): Walk through
1356 __has_include__ statements.
1357
cc811a8a
BE
13582014-09-30 Bernd Edlinger <bernd.edlinger@hotmail.de>
1359
1360 PR preprocessor/58893
1361 * errors.c (cpp_diagnostic): Fix possible out of bounds access.
1362 * files.c (_cpp_stack_include): Initialize src_loc for IT_CMDLINE.
1363
083e891e
MP
13642014-09-24 Marek Polacek <polacek@redhat.com>
1365
1366 PR c/61405
1367 PR c/53874
1368 * include/cpplib.h (enum cpp_ttype): Define CPP_KEYWORD.
1369
d87fc699
JH
13702014-09-17 Jan Hubicka <hubicka@ucw.cz>
1371
1372 * charset.c (conversion): Rename to ...
1373 (cpp_conversion): ... this one; update.
1374 * files.c (file_hash_entry): Rename to ...
1375 (cpp_file_hash_entry): ... this one ; update.
1376
909eb89c
MP
13772014-09-17 Marek Polacek <polacek@redhat.com>
1378
1379 PR c/61854
1380 * init.c (struct lang_flags): Remove cplusplus_comments.
1381 (cpp_set_lang): Likewise.
1382 (post_options): Likewise.
1383 * lex.c (_cpp_lex_direct): Disallow C++ style comments in C90/C94.
1384
1ef33fd4
MLI
13852014-09-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
1386
1387 * include/cpplib.h (struct cpp_options): Declare warn_normalize as
1388 int instead of enum.
1389
2b71f4a4
MLI
13902014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
1391
1392 * macro.c (replace_args): Use cpp_pedwarning, cpp_warning and
1393 CPP_W flags.
1394 * include/cpplib.h: Add CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC.
1395 * init.c (cpp_create_reader): Do not init to -1 here.
1396 * expr.c (num_binary_op): Use cpp_pedwarning.
1397
81b5d104
MLI
13982014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
1399
1400 * directives.c (check_eol_1): New.
1401 (check_eol_endif_labels): New.
1402 (check_eol): Call check_eol_1.
1403 (do_else,do_endif): Call check_eol_endif_labels.
1404
b753b37b
MLI
14052014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
1406
1407 * macro.c (warn_of_redefinition): Suppress warnings for builtins
1408 that lack the NODE_WARN flag, unless Wbuiltin-macro-redefined.
1409 (_cpp_create_definition): Use Wbuiltin-macro-redefined for
1410 builtins that lack the NODE_WARN flag.
1411 * directives.c (do_undef): Likewise.
1412 * init.c (cpp_init_special_builtins): Do not change flags
1413 depending on Wbuiltin-macro-redefined.
1414
7c05e50c
ESR
14152014-08-28 Edward Smith-Rowland <3dw4rd@verizon.net>
1416
1417 PR cpp/23827 - standard C++ should not have hex float preprocessor
1418 tokens
1419 * libcpp/init.c (lang_flags): Change CXX98 flag for extended numbers
1420 from 1 to 0.
1421 * libcpp/expr.c (cpp_classify_number): Weite error message for improper
1422 use of hex floating literal.
1423
e4276ba5
ESR
14242014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
1425
1426 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z;
1427 Rename CLK_GNUCXX1Y, CLK_CXX1Y to CLK_GNUCXX14, CLK_CXX14;
1428 * init.c (struct lang_flags lang_defaults): Add column for trigraphs;
1429 Add rows for CLK_GNUCXX1Z, CLK_CXX1Z; (cpp_set_lang): Set trigraphs;
1430 (cpp_init_builtins): Set __cplusplus to 201402L for C++14;
1431 Set __cplusplus to 201500L for C++17.
1432 * expr.c (cpp_classify_number): Change C++1y to C++14 in binary
1433 constants error message.
1434
dd3ff077
MP
14352014-08-20 Marek Polacek <polacek@redhat.com>
1436
1437 * include/cpplib.h (cpp_options): Use signed char.
1438 * lex.c (_cpp_lex_direct): Don't warn in C++ mode.
1439
3f4f5c9a
MP
14402014-08-19 Marek Polacek <polacek@redhat.com>
1441
1442 * lex.c (_cpp_lex_direct): Fix a typo.
1443
177cce46
MP
14442014-08-19 Marek Polacek <polacek@redhat.com>
1445
1446 * charset.c (_cpp_valid_ucn): Warn only if -Wc90-c99-compat.
1447 * lex.c (_cpp_lex_direct): Likewise.
1448 * macro.c (replace_args): Likewise.
1449 (parse_params): Likewise.
1450 * include/cpplib.h (cpp_options): Change cpp_warn_c90_c99_compat
1451 to char.
1452
f3bede71
MP
14532014-08-10 Marek Polacek <polacek@redhat.com>
1454
1455 PR c/51849
1456 * lex.c (_cpp_lex_direct): Warn when -Wc90-c99-compat is in effect.
1457 * charset.c (_cpp_valid_ucn): Likewise.
1458 * include/cpplib.h (cpp_options): Add cpp_warn_c90_c99_compat.
1459 * macro.c (replace_args): Warn when -Wc90-c99-compat is in effect.
1460 (parse_params): Likewise.
1461
61eb99f6
MP
14622014-07-27 Marek Polacek <polacek@redhat.com>
1463
1464 PR c/61861
1465 * macro.c (builtin_macro): Add location parameter. Set
1466 location of builtin macro to the expansion point.
1467 (enter_macro_context): Pass location to builtin_macro.
1468
c468587a
DS
14692014-07-16 Dodji Seketeli <dodji@redhat.com>
1470
1471 Support location tracking for built-in macro tokens
1472 * include/line-map.h (line_maps::builtin_location): New data
1473 member.
1474 (line_map_init): Add a new parameter to initialize the new
1475 line_maps::builtin_location data member.
1476 * line-map.c (linemap_init): Initialize the
1477 line_maps::builtin_location data member.
1478 * macro.c (builtin_macro): Create a macro map and track the token
1479 resulting from the expansion of a built-in macro.
1480
3976796b
ESR
14812014-07-10 Edward Smith-Rowland <3dw4rd@verizon.net>
1482 Jonathan Wakely <jwakely@redhat.com>
1483
c786fca6 1484 PR preprocessor/61389
3976796b
ESR
1485 * macro.c (_cpp_arguments_ok, parse_params, create_iso_definition):
1486 Warning messages mention C++11 in c++ mode and C99 in c mode.
1487 * lex.c (lex_identifier_intern, lex_identifier): Ditto
1488
7aee8646
ESR
14892014-07-09 Edward Smith-Rowland <3dw4rd@verizon.net>
1490
1491 PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped
1492 by preprocessor
1493 * lex.c (lex_raw_string ()): Do not warn about invalid suffix
1494 if skipping. (lex_string ()): Ditto.
1495
98ba7482
ESR
14962014-06-04 Edward Smith-Rowland <3dw4rd@verizon.net>
1497
1498 PR c++/61038
1499 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
1500 Combine user-defined escape logic with the other string and char logic.
1501
edf6ddf6
RB
15022014-05-26 Richard Biener <rguenther@suse.de>
1503
1504 * configure.ac: Remove long long and __int64 type checks,
1505 add check for uint64_t and fail if that wasn't found.
1506 * include/cpplib.h (cpp_num_part): Use uint64_t.
1507 * config.in: Regenerate.
1508 * configure: Likewise.
1509
28939589
MP
15102014-05-21 Marek Polacek <polacek@redhat.com>
1511
1512 PR c/61212
1513 * files.c (find_file_in_dir): Add parens around &&.
1514
49039169
ESR
15152014-05-20 Edward Smith-Rowland <3dw4rd@verizon.net>
1516
28939589 1517 PR c++/61038
49039169
ESR
1518 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
1519 Check for user-defined literal strings and user-defined literal chars
1520 to escape necessary characters.
1521
54da09ee
RB
15222014-05-20 Richard Biener <rguenther@suse.de>
1523
1524 * configure.ac: Copy gcc logic of detecting a 64bit type.
1525 Remove HOST_WIDE_INT define.
1526 * include/cpplib.h: typedef cpp_num_part to a 64bit type,
1527 similar to how hwint.h does it.
1528 * config.in: Regenerate.
1529 * configure: Likewise.
1530
eac3e079
JY
15312014-05-09 Joey Ye <joey.ye@arm.com>
1532
1533 * files.c (find_file_in_dir): Always try to shorten for DOS
1534 non-system headers.
1535 * init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS.
1536
f543058d
RB
15372014-05-07 Richard Biener <rguenther@suse.de>
1538
1539 * configure.ac: Always set need_64bit_hwint to yes.
1540 * configure: Regenerated.
1541
d9f069ab
RO
15422014-04-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1543
1544 * lex.c: Remove Solaris 9 reference.
1545
341c653c
WL
15462014-02-24 Walter Lee <walt@tilera.com>
1547
1548 * configure.ac: Change "tilepro" triplet to "tilepro*".
1549 * configure: Regenerate.
1550
179652df
JJ
15512014-02-19 Jakub Jelinek <jakub@redhat.com>
1552
1553 PR preprocessor/58844
1554 * macro.c (enter_macro_context): Only push
1555 macro_real_token_count (macro) tokens rather than
1556 macro->count tokens, regardless of
1557 CPP_OPTION (pfile, track-macro-expansion).
1558
acf601ae
JJ
15592014-02-07 Jakub Jelinek <jakub@redhat.com>
1560
1561 PR preprocessor/56824
1562 * line-map.c (get_combined_adhoc_loc, linemap_get_expansion_line,
1563 linemap_get_expansion_filename, linemap_location_in_system_header_p,
1564 linemap_location_from_macro_expansion_p,
1565 linemap_macro_loc_to_spelling_point, linemap_macro_loc_to_def_point,
1566 linemap_macro_loc_to_exp_point, linemap_expand_location): Fix
1567 formatting.
1568 (linemap_compare_locations): Look through adhoc locations for both
1569 l0 and l1.
1570
7ecc3eb9
DS
15712014-01-23 Dodji Seketeli <dodji@redhat.com>
1572
1573 PR PR preprocessor/58580
1574 * include/line-map.h (linemap_get_file_highest_location): Declare
1575 new function.
1576 * line-map.c (linemap_get_file_highest_location): Define it.
1577
35c3d610
RS
15782014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
1579
1580 Update copyright years
1581
3a4efce7
JM
15822013-12-09 Joseph Myers <joseph@codesourcery.com>
1583
1584 PR preprocessor/55715
1585 * expr.c (num_binary_op): Implement subtraction directly rather
1586 than with negation and falling through into addition case.
1587
aadce585
BS
15882013-11-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
1589
1590 * lex.c (search_line_fast): Correct for little endian.
1591
d3f4ff8b
JM
15922013-11-15 Joseph Myers <joseph@codesourcery.com>
1593
1594 * ucnid.tab: Add C11 and C11NOSTART data.
1595 * makeucnid.c (digit): Rename enum value to N99.
1596 (C11, N11, all_languages): New enum values.
1597 (NUM_CODE_POINTS, MAX_CODE_POINT): New macros.
1598 (flags, decomp, combining_value): Use NUM_CODE_POINTS as array
1599 size.
1600 (decomp): Use unsigned int as element type.
1601 (all_decomp): New array.
1602 (read_ucnid): Handle C11 and C11NOSTART. Use MAX_CODE_POINT.
1603 (read_table): Use MAX_CODE_POINT. Store all decompositions in
1604 all_decomp.
1605 (read_derived): Use MAX_CODE_POINT.
1606 (write_table): Use NUM_CODE_POINTS. Print N99, C11 and N11
1607 flags. Print whole array variable declaration rather than just
1608 array contents.
1609 (char_id_valid, write_context_switch): New functions.
1610 (main): Call write_context_switch.
1611 * ucnid.h: Regenerate.
1612 * include/cpplib.h (struct cpp_options): Add c11_identifiers.
1613 * init.c (struct lang_flags): Add c11_identifiers.
1614 (cpp_set_lang): Set c11_identifiers option from selected language.
1615 * internal.h (struct normalize_state): Document "previous" as
1616 previous starter character.
1617 (NORMALIZE_STATE_UPDATE_IDNUM): Take character as argument.
1618 * charset.c (DIG): Rename enum value to N99.
1619 (C11, N11): New enum values.
1620 (struct ucnrange): Give name to struct. Use short for flags and
1621 unsigned int for end of range. Include ucnid.h for whole variable
1622 declaration.
1623 (ucn_valid_in_identifier): Allow for characters up to 0x10FFFF.
1624 Allow for C11 in determining valid characters and valid start
1625 characters. Use check_nfc for non-Hangul context-dependent
1626 checks. Only store starter characters in nst->previous.
1627 (_cpp_valid_ucn): Pass new argument to
1628 NORMALIZE_STATE_UPDATE_IDNUM.
1629 * lex.c (lex_identifier): Pass new argument to
1630 NORMALIZE_STATE_UPDATE_IDNUM. Call NORMALIZE_STATE_UPDATE_IDNUM
1631 after initial non-UCN part of identifier.
1632 (lex_number): Pass new argument to NORMALIZE_STATE_UPDATE_IDNUM.
1633
54848ff8
JM
16342013-11-15 Joseph Myers <joseph@codesourcery.com>
1635
1636 * ucnid.tab: Mark C99 digits as [C99DIG].
1637 * makeucnid.c (read_ucnid): Handle [C99DIG].
1638 (read_table): Don't check for digit characters.
1639 * ucnid.h: Regenerate.
1640
5157b91e
TB
16412013-11-06 Tobias Burnus <burnus@net-b.de>
1642
1643 * macro.c (_cpp_builtin_macro_text): Correct
1644 wording of two warnings.
1645
e8ff5196
TB
16462013-11-05 Tobias Burnus <burnus@net-b.de>
1647
1648 * include/cpplib.h (CPP_W_DATE_TIME): Added.
1649 (cpp_options): Add warn_date_time.
1650 * init.c (cpp_create_reader): Init it.
1651 * macro.c (_cpp_builtin_macro_text): Warn when
1652 __DATE__/__TIME__/__TIMESTAMP__ is used.
1653
7057e645
ESR
16542013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
1655
e8ff5196 1656 Implement C++14 digit separators.
7057e645
ESR
1657 * include/cpplib.h (cpp_options): Add digit_separators flag.
1658 * internal.h (DIGIT_SEP(c)): New macro.
1659 * expr.c (cpp_classify_number): Check improper placement of digit sep;
1660 (cpp_interpret_integer): Skip over digit separators.
1661 * init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add
1662 digit separator flags per language; (cpp_set_lang): Set
1663 digit_separators
1664 * lex.c (lex_number): Add digits separator to allowable characters for
1665 C++14.
1666
459260ec
DM
16672013-10-15 David Malcolm <dmalcolm@redhat.com>
1668
1669 * Makefile.in (PICFLAG): New.
1670 (ALL_CFLAGS): Add PICFLAG.
1671 (ALL_CXXFLAGS): Likewise.
1672 * configure.ac: Add --enable-host-shared, setting up new
1673 PICFLAG variable.
1674 * configure: Regenerate.
1675
fd6eea0c
RE
16762013-08-07 Richard Earnshaw <rearnsha@arm.com>
1677
1678 * configure.ac: Set need_64bit_hwint for all arm targets.
1679 * configure: Regenerated.
1680
8cf88735
JJ
16812013-07-20 Jakub Jelinek <jakub@redhat.com>
1682
1683 PR preprocessor/57620
1684 * lex.c (lex_raw_string): Undo phase1 and phase2 transformations
1685 between R" and final " rather than only in between R"del( and )del".
1686
87e356ba
JJ
16872013-07-10 Jakub Jelinek <jakub@redhat.com>
1688
d5e48350
JJ
1689 PR preprocessor/57824
1690 * lex.c (lex_raw_string): Allow reading new-lines if
1691 in_deferred_pragma or if parsing_args and there is still
1692 data in the current buffer.
1693
c26302d5
JJ
1694 * include/cpplib.h (cpp_token_val_index): Change parameter type to
1695 const cpp_token *.
1696 * lex.c (cpp_token_val_index): Likewise.
1697
87e356ba
JJ
1698 PR preprocessor/57757
1699 * lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING
1700 or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that
1701 starts if a-zA-Z_.
1702
c865f923
ESR
17032013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
1704
1705 * lex.c (lex_raw_string(), lex_string()): Constrain suffixes treated
1706 as concatenated literal and macro to just the patterns found in
1707 inttypes.h; (is_macro()): New.
1708
39953c79
DC
17092013-06-24 Dehao Chen <dehao@google.com>
1710
1711 * files.c (_cpp_stack_include): Fix the highest_location when header
1712 file is guarded by #ifndef and is included twice.
1713
01187df0
JJ
17142013-04-28 Jakub Jelinek <jakub@redhat.com>
1715
1716 N3472 binary constants
1717 * include/cpplib.h (struct cpp_options): Fix a typo in user_literals
1718 field comment. Add binary_constants field.
1719 * init.c (struct lang_flags): Add binary_constants field.
1720 (lang_defaults): Add bin_cst column to the table.
1721 (cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants).
1722 * expr.c (cpp_classify_number): Talk about C++11 instead of C++0x
1723 in diagnostics. Accept binary constants if
1724 CPP_OPTION (pfile, binary_constants) even when pedantic. Adjust
1725 pedwarn message.
1726
61949153
PC
17272013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
1728
1729 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y.
1730 * init.c (lang_defaults): Add defaults for the latter.
1731 (cpp_init_builtins): Define __cplusplus as 201300L for the latter.
1732 * lex.c (_cpp_lex_direct): Update.
1733
994a4cc0
SH
17342013-04-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
1735
1736 PR target/56771
1737 * configure.ac: Require 64-bit int for arm*-*-rtems*.
1738 * configure: Regenerate.
1739
28937f11
JJ
17402013-03-06 Jakub Jelinek <jakub@redhat.com>
1741
1742 PR middle-end/56461
1743 * internal.h (struct cpp_buffer): Add to_free field.
1744 (_cpp_pop_file_buffer): Add third argument.
1745 * files.c (_cpp_stack_file): Set buffer->to_free.
1746 (_cpp_pop_file_buffer): Add to_free argument. Free to_free
1747 if non-NULL, and if equal to file->buffer_start, also clear
1748 file->buffer{,_start,_valid}.
1749 * directives.c (_cpp_pop_buffer): Pass buffer->to_free
1750 to _cpp_pop_file_buffer.
1751
3b8af25b
JJ
17522013-03-01 Jakub Jelinek <jakub@redhat.com>
1753
1754 PR middle-end/56461
1755 * files.c (_cpp_save_file_entries): Free result at the end.
1756 * pch.c (cpp_string_free): New function.
1757 (cpp_save_state): Use it in htab_create call.
1758 (cpp_write_pch_deps): Free ss->defs. Destroy ss->definedhash.
1759
1a80db97
JJ
17602013-02-28 Jakub Jelinek <jakub@redhat.com>
1761
15fd8332
JJ
1762 * files.c (_cpp_find_file): If returning early, before storing
1763 something to *hash_slot and *hash_slot is NULL, call htab_clear_slot
1764 on it. Access *hash_slot using void * type rather than
1765 struct file_hash_entry * to avoid aliasing issues.
1766
1a80db97
JJ
1767 * configure.ac: Don't define ENABLE_CHECKING whenever
1768 --enable-checking is seen, instead use similar --enable-checking=yes
1769 vs. --enable-checking=release default as gcc/ subdir has and
1770 define ENABLE_CHECKING if ENABLE_CHECKING is defined in gcc/.
1771 Define ENABLE_VALGRIND_CHECKING if requested.
1772 * lex.c (new_buff): If ENABLE_VALGRIND_CHECKING, put _cpp_buff
1773 struct first in the allocated buffer and result->base after it.
1774 (_cpp_free_buff): If ENABLE_VALGRIND_CHECKING, free buff itself
1775 instead of buff->base.
1776 * config.in: Regenerated.
1777 * configure: Regenerated.
1778
561f7fc7
ESR
17792013-02-13 Ed Smith-Rowland <3dw4rd@verizon.net>
1780
1781 PR c++/55582
61949153 1782 * lex.c (lex_raw_string): Allow string literal with suffix
561f7fc7
ESR
1783 beginning with 's' to be parsed as a C++11 user-defined literal.
1784
500f3ed9
RS
17852013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
1786
1787 Update copyright years.
1788
1582c677
PC
17892013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
1790
1791 PR c++/54526 (again)
1792 * lex.c (_cpp_lex_direct): In C++11 mode, implement 2.5 p3, bullet 2.
1793
8ac16127
MG
17942013-01-03 Marc Glisse <marc.glisse@inria.fr>
1795
1796 PR bootstrap/50177
1797 * line-map.c (get_combined_adhoc_loc): Cast from extern "C" type.
1798 (new_linemap): Likewise.
1799 (linemap_enter_macro): Likewise.
1800
f41e5bd1
JJ
18012012-12-03 Jakub Jelinek <jakub@redhat.com>
1802
1803 PR bootstrap/55380
1804 PR other/54691
1805 * files.c (read_file_guts): Allocate extra 16 bytes instead of
1806 1 byte at the end of buf. Pass size + 16 instead of size
1807 to _cpp_convert_input.
1808 * charset.c (_cpp_convert_input): Reallocate if there aren't
1809 at least 16 bytes beyond to.len in the buffer. Clear 16 bytes
1810 at to.text + to.len.
1811
31962032
SE
18122012-11-21 Steve Ellcey <sellcey@mips.com>
1813
1814 PR pch/55399
1815 * files.c (pch_open_file): Fix check for implicit_preinclude.
1816
5dc99c46
SB
18172012-11-16 Simon Baldwin <simonb@google.com>
1818
1819 * include/cpplib.h (struct cpp_options): Add canonical_system_headers.
1820 * files.c (find_file_in_dir): Call maybe_shorter_path() only if
1821 canonical_system_headers is set.
1822 * init.c (cpp_create_reader): Initialize canonical_system_headers.
1823 * configure.ac: Add new --enable-canonical-system-headers.
1824 * configure: Regenerate.
1825 * config.in: Regenerate.
1826
a4a0016d
ESR
18272012-11-09 Ed Smith-Rowland <3dw4rd@verizon.net>
1828
1829 PR c++/54413
1830 * include/cpplib.h (cpp_interpret_float_suffix): Add cpp_reader* arg.
1831 (cpp_interpret_int_suffix): Add cpp_reader* arg.
1832 * init.c (cpp_create_reader): Iitialize new flags.
1833 * expr.c (interpret_float_suffix): Use new flags.
1834 (cpp_interpret_float_suffix): Add cpp_reader* arg.
1835 (interpret_int_suffix): Use new flags.
1836 (cpp_interpret_int_suffix): Add cpp_reader* arg.
1837 (cpp_classify_number): Adjust calls to interpret_x_suffix.
1838
04ce690f
IB
18392012-10-23 Ian Bolton <ian.bolton@arm.com>
1840 Jim MacArthur <jim.macarthur@arm.com>
1841 Marcus Shawcroft <marcus.shawcroft@arm.com>
1842 Nigel Stephens <nigel.stephens@arm.com>
1843 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
1844 Richard Earnshaw <rearnsha@arm.com>
1845 Sofiane Naci <sofiane.naci@arm.com>
1846 Stephen Thomas <stephen.thomas@arm.com>
1847 Tejas Belagod <tejas.belagod@arm.com>
1848 Yufeng Zhang <yufeng.zhang@arm.com>
1849
1850 * configure.ac: Enable AArch64.
1851 * configure: Regenerate.
1852
1efcb8c6
JM
18532012-10-23 Joseph Myers <joseph@codesourcery.com>
1854
1855 * files.c (struct _cpp_file): Add implicit_preinclude.
1856 (pch_open_file): Allow a previously opened implicitly included
1857 file.
1858 (_cpp_find_file): Add implicit_preinclude argument. Free file and
1859 do not call open_file_failed if implicit_preinclude. Store
1860 implicit_preinclude value.
1861 (_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date):
1862 Update calls to _cpp_find_file.
1863 (_cpp_stack_include): Handle IT_DEFAULT.
1864 (cpp_push_default_include): New.
1865 * include/cpplib.h (cpp_push_default_include): Declare.
1866 * init.c (cpp_read_main_file): Update call to _cpp_find_file.
1867 * internal.h (enum include_type): Add IT_DEFAULT.
1868 (_cpp_find_file): Update prototype.
1869
55e7f907
TB
18702012-10-15 Tobias Burnus <burnus@net-b.de>
1871
1872 * files.c (read_file_guts, _cpp_save_file_entries): Free memory
1873 before returning.
1874 * lex.c (warn_about_normalization): Ditto.
1875 * mkdeps.c (deps_save): Ditto.
1876 * pch.c (cpp_valid_state): Ditto.
1877
f591bd8f
FW
18782012-10-04 Florian Weimer <fweimer@redhat.com>
1879
1880 * directives.c (do_pragma_warning_or_error): New.
1881 (do_pragma_warning): New.
1882 (do_pragma_error): New.
1883 (_cpp_init_internal_pragmas): Register new pragmas.
1884
ec6e0399
DC
18852012-09-25 Dehao Chen <dehao@google.com>
1886
1887 PR middle-end/54704
1888 * line-map.c (location_adhoc_data_hash): Fix the hash function.
1889
52187008
DC
18902012-09-25 Dehao Chen <dehao@google.com>
1891
1892 PR middle-end/54645
1893 * include/line-map.h (location_adhoc_data): Move location_adhoc_data
1894 into GC.
1895 (location_adhoc_data_map): Likewise.
1896 (line_maps): Likewise.
1897 (rebuild_location_adhoc_htab): New Function.
1898 * line-map.c (+rebuild_location_adhoc_htab): new Funcion.
1899 (get_combined_adhoc_loc): Move location_adhoc_data into GC.
1900 (location_adhoc_data_fini): Likewise.
1901 (linemap_init): Likewise.
1902 (location_adhoc_data_init): Remove Function.
1903
5368224f
DC
19042012-09-19 Dehao Chen <dehao@google.com>
1905
1906 * include/line-map.h (MAX_SOURCE_LOCATION): New value.
1907 (location_adhoc_data_fini): New.
1908 (get_combined_adhoc_loc): New.
1909 (get_data_from_adhoc_loc): New.
1910 (get_location_from_adhoc_loc): New.
1911 (location_adhoc_data_map): New.
1912 (COMBINE_LOCATION_DATA): New.
1913 (IS_ADHOC_LOC): New.
1914 (expanded_location): New field.
1915 (line_maps): New field.
1916 * line-map.c (location_adhoc_data): New.
1917 (location_adhoc_data_hash): New.
1918 (location_adhoc_data_eq): New.
1919 (location_adhoc_data_update): New.
1920 (get_combined_adhoc_loc): New.
1921 (get_data_from_adhoc_loc): New.
1922 (get_location_from_adhoc_loc): New.
1923 (location_adhoc_data_init): New.
1924 (location_adhoc_data_fini): New.
1925 (linemap_init): Initialize location_adhoc_data.
1926 (linemap_lookup): Change to use new location.
1927 (linemap_ordinary_map_lookup): Likewise.
1928 (linemap_macro_map_lookup): Likewise.
1929 (linemap_macro_map_loc_to_def_point): Likewise.
1930 (linemap_macro_map_loc_unwind_toward_spel): Likewise.
1931 (linemap_get_expansion_line): Likewise.
1932 (linemap_get_expansion_filename): Likewise.
1933 (linemap_location_in_system_header_p): Likewise.
1934 (linemap_location_from_macro_expansion_p): Likewise.
1935 (linemap_macro_loc_to_spelling_point): Likewise.
1936 (linemap_macro_loc_to_def_point): Likewise.
1937 (linemap_macro_loc_to_exp_point): Likewise.
1938 (linemap_resolve_location): Likewise.
1939 (linemap_unwind_toward_expansion): Likewise.
1940 (linemap_unwind_to_first_non_reserved_loc): Likewise.
1941 (linemap_expand_location): Likewise.
1942 (linemap_dump_location): Likewise.
1943 (linemap_line_start): Likewise.
1944
f3d25c65
DS
19452012-05-25 Dodji Seketeli <dodji@redhat.com>
1946
1947 PR preprocessor/53469
1948 * directives.c (do_pragma): Use the virtual location for the
1949 pragma token, instead of its spelling location.
1950
0823efed
DN
19512012-08-14 Diego Novillo <dnovillo@google.com>
1952
1953 Merge from cxx-conversion branch. Configury.
1954
1955 * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
1956 * configure.ac: Likewise.
1957 * configure: Regenerate.
1958
19592012-08-14 Lawrence Crowl <crowl@google.com>
1960
1961 Merge from cxx-conversion branch. New C++ hash table.
1962
1963 * include/symtab.h (typedef struct ht hash_table): Change the typedef
1964 name to cpp_hash_table. Update all users of the typedef.
1965
c0fd3497
LB
19662012-07-30 Laurynas Biveinis <laurynas.biveinis@gmail.com>
1967
1968 * include/line-map.h (line_map_macro): Use the "atomic" GTY option
1969 for the macro_locations field.
1970
d35d1c0f
UB
19712011-06-19 Uros Bizjak <ubizjak@gmail.com>
1972
1973 * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
1974 __builtin_ia32_pcmpestri128 instead of asm.
1975
d86d2119
DA
19762012-06-04 Dimitrios Apostolou <jimis@gmx.net>
1977
1978 * line-map.c (linemap_enter_macro): Don't zero max_column_hint in
1979 every macro. This improves performance by reducing the number of
1980 reallocations when track-macro-expansion is on.
1981
7ca643e1
DS
19822012-06-04 Dodji Seketeli <dodji@redhat.com>
1983
1984 PR preprocessor/53463
1985 * line-map.c (linemap_location_in_system_header_p): For built-in
1986 macro tokens, check the first expansion point location that is not
1987 for a token coming from a built-in macro.
1988
7d9641cc
JM
19892012-05-29 Joseph Myers <joseph@codesourcery.com>
1990
1991 * directives.c: Fix typos.
1992 * include/line-map.h: Fix typos.
1993 * line-map.c: Fix typos.
1994 * macro.c: Fix typos.
1995
53a103d3
DS
19962012-05-25 Dodji Seketeli <dodji@redhat.com>
1997
1998 PR bootstrap/53459
1999 * lex.c (search_line_fast): Avoid unused local typedefs to simulate
2000 a static assertion.
2001
828a7f76
DS
20022012-05-29 Dodji Seketeli <dodji@redhat.com>
2003
2004 PR preprocessor/53229
2005 * internal.h (cpp_reader::set_invocation_location): Remove.
2006 (cpp_reader::about_to_expand_macro_p): New member flag.
2007 * directives.c (do_pragma): Remove Kludge as
2008 pfile->set_invocation_location is no more.
2009 * macro.c (cpp_get_token_1): Do away with the use of
2010 cpp_reader::set_invocation_location. Just collect the macro
2011 expansion point when we are about to expand the top-most macro.
2012 Do not override cpp_reader::about_to_expand_macro_p.
2013 This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding
2014 properly handle locations of expansion points.
2015 (cpp_get_token_with_location): Adjust, as
2016 cpp_reader::set_invocation_location is no more.
2017 (paste_tokens): Take a virtual location parameter for
2018 the LHS of the pasting operator. Use it in diagnostics. Update
2019 comments.
2020 (paste_all_tokens): Tighten the assert. Propagate the location of
2021 the expansion point when no virtual locations are available.
2022 Pass the virtual location to paste_tokens.
2023 (in_macro_expansion_p): New static function.
2024 (enter_macro_context): Set the cpp_reader::about_to_expand_macro_p
2025 flag until we really start expanding the macro.
2026
0b2c4be5
DS
20272012-05-16 Dodji Seketeli <dodji@redhat.com>
2028
2029 PR preprocessor/7263
2030 * include/cpplib.h (cpp_classify_number): Take a location
2031 parameter.
2032 * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic
2033 macros that take a location parameter.
2034 (cpp_classify_number): Take a (virtual) location parameter. Use
2035 it for diagnostics. Adjust comments.
2036 (eval_token): Take a location parameter. Pass it to
2037 cpp_classify_number and to diagnostic routines.
2038 (_cpp_parse_expr): Use virtual locations of tokens when parsing
2039 expressions. Pass a virtual location to eval_token and to
2040 diagnostic routines.
2041
638d2065
TG
20422012-05-10 Tristan Gingold <gingold@adacore.com>
2043
2044 * expr.c (interpret_float_suffix): Add a guard.
2045
3ad64f53
DS
20462012-05-02 Dodji Seketeli <dodji@redhat.com>
2047
2048 Properly initialize cpp_context in destringize_and_run
2049 * directives.c (destringize_and_run): Properly initialize the new
2050 context.
2051 * macro.c (_cpp_pop_context): Assert that we shouldn't try to pop
2052 the initial base context, which has the same life time as the
2053 current instance of cpp_file.
2054
b193dfa8
MLI
20552012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
2056 Dodji Seketeli <dodji@seketeli.org>
2057
3efc2959 2058 PR c++/52974
b193dfa8
MLI
2059 * libcpp/files.c (maybe_shorter_path): New.
2060 (find_file_in_dir): Use it.
2061
4e65a470
DS
20622012-04-30 Dodji Seketeli <dodji@redhat.com>
2063
51fce2d3
DS
2064 Switch -ftrack-macro-expansion=2 on by default.
2065 * init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
2066 by default. Add comments.
2067
c4ca1a09
DS
2068 Strip "<built-in>" loc from displayed expansion context
2069 * include/line-map.h (linemap_unwind_toward_expansion): Fix typo
2070 in comment.
2071 (linemap_unwind_to_first_non_reserved_loc): Declare new function.
2072 * line-map.c (linemap_unwind_to_first_non_reserved_loc): Define
2073 new function.
2074
3600218c
DS
2075 Fix expansion point loc for macro-like tokens
2076 * macro.c (macro_of_context): New static function.
2077 (_cpp_push_token_context, push_extended_tokens_context): If the
2078 macro argument is NULL, it means we are continuing the expansion
2079 of the current macro, if any. Update comments.
2080 (_cpp_pop_context): Re-enable expansion of the macro only when we
2081 are really out of the context of the current expansion.
2082
0ff2b8a0
DS
2083 Fix token pasting with -ftrack-macro-expansion
2084 * macro.c (paste_all_tokens): Put the token resulting from pasting
2085 into an extended token context with -ftrack-macro-location is in
2086 effect.
2087
4e65a470
DS
2088 Fix cpp_sys_macro_p with -ftrack-macro-expansion
2089 * macro.c (cpp_sys_macro_p): Support -ftrack-macro-expansion.
2090
112448b4
DS
20912012-04-29 Dodji Seketeli <dodji@redhat.com>
2092
2093 * lex.c (lex_raw_string): Change C++ style comments into C style
2094 comments.
19a9ba64 2095 (lex_string): Likewise.
112448b4 2096
7f5f5f98
OW
20972012-04-27 Ollie Wild <aaw@google.com>
2098
2099 * include/cpplib.h (struct cpp_options): Add new field,
2100 warn_literal_suffix.
2101 (CPP_W_LITERAL_SUFFIX): New enum.
2102 * init.c (cpp_create_reader): Default initialization of
2103 warn_literal_suffix.
2104 * lex.c (lex_raw_string): Treat user-defined literals which don't
2105 begin with '_' as separate tokens and produce a warning.
2106 (lex_string): Ditto.
2107
1d72e96f
MLI
21082012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
2109
2110 * line-map.c (linemap_resolve_location): Synchronize comments with
2111 those in line-map.h.
2112 * include/line-map.h (linemap_resolve_location): Fix spelling in
2113 comment.
2114
e75b54a2
RE
21152012-03-22 Richard Earnshaw <rearnsha@arm.com>
2116
2117 * lex.c (search_line_fast): Provide Neon-optimized version for ARM.
2118
7888f266
RO
21192012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2120
2121 * lex.c: Remove Solaris 8 reference.
2122
dd552284
WL
21232012-02-14 Walter Lee <walt@tilera.com>
2124
2125 * configure.ac: Require 64-bit hwint for tilegx and tilepro.
2126 * configure: Regenerate.
2127
2c5cbc31
RG
21282012-01-09 Richard Guenther <rguenther@suse.de>
2129
2130 * macro.c (_cpp_builtin_macro_text): Remove unused variable map.
2131
b492b686
GF
21322012-01-09 Gary Funck <gary@intrepid.com>
2133
2134 PR preprocessor/33919
2135 * files.c (_cpp_get_file_name): New. Implement file name
2136 access function.
2137 * internal.h (_cpp_get_file_name): New prototype.
2138 * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
2139 to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
2140
75291c57
OH
21412012-01-03 Olivier Hainque <hainque@adacore.com>
2142
2143 * system.h: Prior to #define, #undef fopen and freopen unconditionally.
2144
48b0b196
JM
21452011-12-20 Joseph Myers <joseph@codesourcery.com>
2146
2147 * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
2148 (CLK_STDC1X): Change to CLK_STDC11.
2149 * init.c (lang_defaults): Update comments.
2150 (cpp_init_builtins): Update language tests. Use 201112L for C11
2151 __STDC_VERSION__.
2152
4a5e00ca
AS
21532011-12-20 Andreas Schwab <schwab@linux-m68k.org>
2154
2155 * configure: Regenerate.
2156
095af58f
AS
21572011-12-19 Andreas Schwab <schwab@linux-m68k.org>
2158
2159 * configure: Regenerate.
2160
b0c084b7
JJ
21612011-12-07 Jakub Jelinek <jakub@redhat.com>
2162
2163 PR bootstrap/50237
2164 * internal.h (_cpp_init_lexer): New prototype.
2165 * init.c (init_library): Call it.
2166 * lex.c (init_vectorized_lexer): Remove constructor attribute,
2167 add inline keyword.
2168 (HAVE_init_vectorized_lexer): Define.
2169 (_cpp_init_lexer): New function.
2170
9b554be9
DS
21712011-12-03 Dodji Seketeli <dodji@redhat.com>
2172
2173 * macro.c (tokens_buff_remove_last_token)
2174 (tokens_buff_put_token_to): Add an 'inline' function specifier to
2175 the prototype.
2176
8dcf72a8
DN
21772011-11-22 Diego Novillo <dnovillo@google.com>
2178
2179 * include/line-map.h (linemap_dump): Declare.
2180 (line_table_dump): Declare.
2181 * line-map.c (linemap_dump): New.
2182 (line_table_dump): New.
2183
7e74ce3f
ESR
21842011-11-21 Ed Smith-Rowland <3dw4rd@verizon.net>
2185
2186 PR c++/50958
2187 * expr.c (cpp_userdef_char_remove_type): Fix typo.
2188
e9411247
MM
21892011-11-03 Michael Matz <matz@suse.de>
2190
2191 PR bootstrap/50857
2192 * configure.ac: Check for -fno-exceptions -fno-rtti.
2193 * configure: Regenerate.
2194 * Makefile.in (NOEXCEPTION_FLAGS): New flag.
2195 (ALL_CXXFLAGS): Use it.
2196
0c1dace3
PC
21972011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
2198
2199 * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
2200
25339f10
JM
22012011-11-02 Jason Merrill <jason@redhat.com>
2202
2203 PR c++/50810
2204 * configure.ac: Add -Wno-narrowing to warning options.
2205
97e3ad20
JM
22062011-10-31 Jason Merrill <jason@redhat.com>
2207
1fb80b0c
JM
2208 PR libstdc++/1773
2209 * init.c (cpp_init_builtins): Set __cplusplus for C++11.
2210
97e3ad20
JM
2211 PR c++/50920
2212 * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
2213 CLK_GNUCXX0X to CLK_GNUCXX11.
2214
3ce4f9e4
ESR
22152011-10-26 Ed Smith-Rowland <3dw4rd@verizon.net>
2216
2217 Implement C++11 user-defined literals.
2218 * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
2219 cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
2220 cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
2221 cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
2222 (cpp_classify_number): Classify unrecognized tokens as user-defined
2223 literals.
2224 * include/cpplib.h: Add new tokens for user-defined literals.
2225 * init.c: Add new preprocessor flag (cxx11).
2226 * lex.c: (lex_string, lex_raw_string): Handle user-defined literals
2227 including concatenation and promotion with suffixes.
2228
3bb0c8db
DS
22292011-10-24 Dodji Seketeli <dodji@redhat.com>
2230
2231 * line-map.c (linemap_macro_map_lookup): Fix logic.
2232
84756fd4
DS
22332011-10-24 Dodji Seketeli <dodji@redhat.com>
2234
2235 * include/line-map.h (linemap_expand_location): Take a line table
2236 parameter. Update comment.
2237 (linemap_resolve_location): Update comment.
2238 (linemap_expand_location_full): Remove.
2239 * line-map.c (linemap_resolve_location): Handle reserved
2240 locations; return a NULL map in those cases.
2241 (linemap_expand_location): If location is reserved, return a
2242 zeroed expanded location. Update comment. Take a line table to
2243 assert that the function takes non-virtual locations only.
2244 (linemap_expand_location_full): remove.
2245 (linemap_dump_location): Handle the fact that
2246 linemap_resolve_location can return NULL line maps when the
2247 location resolves to a reserved location.
2248
2249 * line-map.c (linemap_macro_map_lookup): Fix logic.
2250
ad2305ad
DS
22512011-10-22 Dodji Seketeli <dodji@redhat.com>
2252
2253 PR bootstrap/50778
2254 * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
2255 context to act upon.
2256 * lex.c (_cpp_remaining_tokens_num_in_context): Likewise. Update
2257 comment.
2258 (cpp_token_from_context_at): Likewise.
2259 (cpp_peek_token): Use the context to peek tokens from.
2260
cbbcf655
DS
22612011-10-20 Dodji Seketeli <dodji@redhat.com>
2262
2263 PR bootstrap/50801
2264 * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
2265 number of tokens.
2266
d17687f6
DS
22672011-10-18 Dodji Seketeli <dodji@redhat.com>
2268
2269 PR bootstrap/50760
2270 * include/line-map.h (struct linemap_stats): Change the type of
19a9ba64 2271 the members from size_t to long.
d17687f6 2272 * macro.c (macro_arg_token_iter_init): Unconditionally initialize
19a9ba64 2273 iter->location_ptr.
d17687f6 2274
411f92de
DS
22752011-10-17 Dodji Seketeli <dodji@redhat.com>
2276
2277 * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
19a9ba64
AM
2278 variable without using it if ENABLE_CHECKING is not defined. Mark
2279 the LOCATION parameter as being unused.
411f92de 2280
b9bd6f74
TT
22812011-10-15 Tom Tromey <tromey@redhat.com>
2282 Dodji Seketeli <dodji@redhat.com>
2283
2284 * include/line-map.h (struct line_maps::alloced_size_for_request):
2285 New member.
2286 * line-map.c (new_linemap): Use set->alloced_size_for_request to
2287 get the actual allocated size of line maps.
2288
64a1a422
TT
22892011-10-15 Tom Tromey <tromey@redhat.com>
2290 Dodji Seketeli <dodji@redhat.com>
2291
2292 * line-map.h (struct linemap_stats): Declare new struct.
2293 (linemap_get_statistics): Declare ...
2294 * line-map.c (linemap_get_statistics): ... new function.
2295 * macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
2296 Declare new counters.
2297 (enter_macro_context, replace_args): Update
2298 num_macro_tokens_counter.
2299 (cpp_get_token_1): Update num_expanded_macros_counter.
2300
847e697a
TT
23012011-10-15 Tom Tromey <tromey@redhat.com>
2302 Dodji Seketeli <dodji@redhat.com>
2303
2304 * include/cpplib.h (struct cpp_options)<debug>: New struct member.
2305 * include/line-map.h (linemap_dump_location): Declare ...
2306 * line-map.c (linemap_dump_location): ... new function.
2307
92582b75
TT
23082011-10-15 Tom Tromey <tromey@redhat.com>
2309 Dodji Seketeli <dodji@redhat.com>
2310
2311 * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
2312 New option.
2313 * internal.h (struct macro_context): New struct.
2314 (enum context_tokens_kind): New enum.
2315 (struct cpp_context)<tokens_kind>: New member of type enum
2316 context_tokens_kind.
2317 (struct cpp_context)<macro>: Remove this. Replace it with an enum
2318 of macro and macro_context.
2319 (struct cpp_context)<direct_p>: Remove.
2320 (_cpp_remaining_tokens_num_in_context): Declare new function.
2321 * directives.c (destringize_and_run): Adjust.
2322 * lex.c (_cpp_remaining_tokens_num_in_context)
2323 (_cpp_token_from_context_at): Define new functions
2324 (cpp_peek_token): Use them.
2325 * init.c (cpp_create_reader): Initialize the base context to zero.
2326 (_cpp_token_from_context_at): Define new static function.
2327 (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
2328 _cpp_token_from_context_at.
2329 * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
2330 members.
2331 (enum macro_arg_token_kind): New enum.
2332 (struct macro_arg_token_iter): New struct.
2333 (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
2334 (alloc_expanded_arg_mem, ensure_expanded_arg_room)
2335 (delete_macro_args, set_arg_token, get_arg_token_location)
2336 (arg_token_ptr_at, macro_arg_token_iter_init)
2337 (macro_arg_token_iter_get_token)
2338 (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
2339 (expanded_token_index, tokens_buff_new, tokens_buff_count)
2340 (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
2341 (tokens_buff_add_token, tokens_buff_remove_last_token)
2342 (reached_end_of_context, consume_next_token_from_context): New
2343 static functions.
2344 (cpp_get_token_1): New static function. Split and extended from
2345 cpp_get_token. Use reached_end_of_context and
2346 consume_next_token_from_context. Unify its return point. Move
2347 the location tweaking from cpp_get_token_with_location in here.
2348 (cpp_get_token): Use cpp_get_token_1
2349 (stringify_arg): Use the new arg_token_at.
2350 (paste_all_tokens): Support tokens coming from extended tokens
2351 contexts.
2352 (collect_args): Return the number of collected arguments, by
2353 parameter. Store virtual locations of tokens that constitute the
2354 collected args.
2355 (funlike_invocation_p): Return the number of collected arguments,
2356 by parameter.
2357 (enter_macro_context): Add a parameter for macro expansion point.
2358 Pass it to replace_args and to the "used" cpp callback. Get the
2359 number of function-like macro arguments from funlike_invocation_p,
2360 pass it to the new delete_macro_args to free the memory used by
2361 macro args. When -ftrack-macro-expansion is in effect, for macros
2362 that have no arguments, create a macro map for the macro expansion
2363 and use it to allocate proper virtual locations for tokens
2364 resulting from the expansion. Push an extended tokens context
2365 containing the tokens resulting from macro expansion and their
2366 virtual locations.
2367 (replace_args): Rename the different variables named 'count' into
2368 variables with more meaningful names. Create a macro map;
2369 allocate virtual locations of tokens resulting from this
2370 expansion. Use macro_arg_token_iter to iterate over tokens of a
2371 given macro. Handle the case of the argument of
2372 -ftrack-macro-expansion being < 2. Don't free macro arguments
2373 memory resulting from expand_arg here, as these are freed by the
2374 caller of replace_arg using delete_macro_args now. Push extended
2375 token context.
2376 (next_context, push_ptoken_context, _cpp_push_token_context)
2377 (_cpp_push_text_context): Properly initialize the context.
2378 (expand_arg): Use the new alloc_expanded_arg_mem,
2379 push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
2380 (_cpp_pop_context): Really free the memory held by the context.
2381 Handle freeing memory used by extended tokens contexts.
2382 (cpp_get_token_with_location): Use cpp_get_token_1.
2383 (cpp_sys_macro_p): Adjust.
2384 (_cpp_backup_tokens): Support the new kinds of token contexts.
2385 * traditional.c (recursive_macro): Adjust.
2386
46427374
TT
23872011-10-15 Tom Tromey <tromey@redhat>
2388 Dodji Seketeli <dodji@redhat.com>
2389
2390 * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
2391 member.
2392 (MAX_SOURCE_LOCATION): New constant.
2393 (struct line_map_ordinary, struct line_map_macro): New structs.
19a9ba64 2394 (struct line_map): Turn this into a union of the two above. Add
46427374
TT
2395 comments.
2396 (struct maps_info): New struct.
2397 (struct line_maps)<info_ordinary, info_macro>: Two new fields.
2398 These now carry the map information that was previously scattered
2399 in struct line_maps.
2400 (struct map_info::allocated): Fix comment.
2401 (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
2402 (ORDINARY_MAP_STARTING_LINE_NUMBER)
2403 (ORDINARY_MAP_INCLUDER_FILE_INDEX)
2404 (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
2405 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
2406 (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
2407 (MACRO_MAP_EXPANSION_POINT_LOCATION)
2408 (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
2409 (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
2410 (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
2411 (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
2412 (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
2413 (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
2414 (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
2415 (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
2416 (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
2417 (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
2418 (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
2419 information.
2420 (linemap_check_ordinary, linemap_assert)
2421 (linemap_location_before_p): New macros.
2422 (linemap_position_for_line_and_column)
2423 (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
2424 (linemap_macro_expansion_map_p)
2425 (linemap_macro_map_loc_to_def_point)
2426 (linemap_macro_map_loc_unwind_once)
2427 (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
2428 (linemap_get_source_line linemap_get_source_column)
2429 (linemap_map_get_macro_name, linemap_get_file_path)
2430 (linemap_location_in_system_header_p)
2431 (linemap_location_from_macro_expansion_p): Declare new functions.
2432 (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
2433 (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
2434 accessors act on ordinary maps only.
2435 (INCLUDED_FROM): Return NULL for main files; use the new
2436 accessors.
2437 (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
2438 (struct expanded_location): Move here from gcc/input.h
2439 (linemap_resolve_location, linemap_expand_location)
2440 (linemap_expand_location_full): Declare new functions.
2441 * line-map.c: Include cpplib.h, internal.h
2442 (linemap_enter_macro, linemap_add_macro_token)
2443 (linemap_get_expansion_line, linemap_get_expansion_filename): New
2444 functions that are private to libcpp.
2445 (linemap_assert): New macro.
2446 (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
2447 (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
2448 (linemap_macro_map_loc_unwind_toward_spelling)
2449 (linemap_macro_map_loc_to_exp_point)
2450 (first_map_in_common_1, first_map_in_common): New static
2451 functions.
2452 (new_linemap): Define new static functions. Extracted and
2453 enhanced from ...
2454 (linemap_add): ... here. Use linemap_assert in lieu of abort
2455 previously.
2456 (linemap_tracks_macro_expansion_locs_p)
2457 (linemap_add_macro_token, linemap_macro_expansion_map_p)
2458 (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
2459 (linemap_macro_map_loc_to_def_point)
2460 (linemap_macro_map_loc_unwind_once)
2461 (linemap_step_out_once, linemap_map_get_index)
2462 (linemap_get_source_line,linemap_get_source_column)
2463 (linemap_get_file_path, linemap_map_get_macro_name)
2464 (linemap_location_in_system_header_p)
2465 (linemap_location_originated_from_system_header_p)
2466 (linemap_location_from_macro_expansion_p)
2467 (linemap_tracks_macro_expansion_locs_p)
2468 (linemap_resolve_location, linemap_expand_location)
2469 (linemap_expand_location_full)
2470 (linemap_tracks_macro_expansion_locs_p)
2471 (linemap_position_for_line_and_column, linemap_compare_locations):
2472 Define new public functions.
2473 (linemap_init): Initialize ordinary and macro maps information in
2474 the map set.
2475 (linemap_check_files_exited): Use the new accessors.
2476 (linemap_free): Remove this dead code.
2477 (linemap_line_start): Assert this uses an ordinary map. Adjust to
2478 use the new ordinary map accessors and data structures. Don't
2479 overflow past the lowest possible macro token's location.
2480 (linemap_position_for_column): Assert the ordinary maps of the map
2481 set are really ordinary. Use ordinary map accessors.
2482 (linemap_lookup): Keep the same logic but generalize to allow
2483 lookup of both ordinary and macro maps. Do not crash when called
2484 with an empty line table.
2485 * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
2486 new API of line-map.h.
2487 * directives.c (start_directive, do_line, do_linemarker)
2488 (do_linemarker): Likewise.
2489 * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
2490 (make_cpp_dir, cpp_make_system_header): Likewise.
2491 * init.c (cpp_read_main_file): Likewise.
2492 * internal.h (CPP_INCREMENT_LINE): Likewise.
2493 (linemap_enter_macro, linemap_add_macro_token)
2494 (linemap_get_expansion_line, linemap_get_expansion_filename): New
2495 functions private to libcpp.
2496 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
2497 (skip_line_comment, skip_whitespace, lex_raw_string)
2498 (_cpp_lex_direct): Likewise.
2499 * macro.c (_cpp_builtin_macro_text): Likewise.
2500 (_cpp_aligned_alloc): Initialize the new name member of the macro.
2501 * traditional.c (copy_comment, _cpp_scan_out_logical_line):
2502 Likewise.
2503 * errors.c (cpp_diagnostic): Adjust to new linemap API.
2504
892a371f
DS
25052011-08-28 Dodji Seketeli <dodji@redhat.com>
2506
2507 * line-map.c (linemap_add): Assert that reason must not be
2508 LC_RENAME when called for the first time on a "main input file".
2509
e3dfef44
GC
25102011-08-22 Gabriel Charette <gchare@google.com>
2511
2512 * init.c (cpp_create_reader): Inititalize forced_token_location_p.
2513 * internal.h (struct cpp_reader): Add field forced_token_location_p.
2514 * lex.c (_cpp_lex_direct): Use forced_token_location_p.
2515 (cpp_force_token_locations): New.
2516 (cpp_stop_forcing_token_locations): New.
2517
32fe396e
RO
25182011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2519
2520 PR libstdc++/1773
2521 * init.c (cpp_init_builtins): Define __cplusplus 19971L.
2522
7c1ffff9
JM
25232011-08-18 Joseph Myers <joseph@codesourcery.com>
2524
2525 * include/cpplib.h (struct cpp_options): Fix typo.
2526
a48e3dd1
JM
25272011-08-18 Joseph Myers <joseph@codesourcery.com>
2528
2529 * include/cpplib.h (struct cpp_options): Add rliterals.
2530 * init.c (struct lang_flags, lang_defaults): Add rliterals.
2531 (cpp_set_lang): Set rliterals option.
2532 (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
2533 * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
2534
3f6ced10
GC
25352011-08-15 Gabriel Charette <gchare@google.com>
2536
2537 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
2538 Update all users to use linemap_position_for_column instead.
2539
0681d04c
GC
25402011-07-28 Gabriel Charette <gchare@google.com>
2541
2542 * include/line-map.h (struct line_maps):
2543 Remove unused field last_listed. Update all users.
2544
5e9627ca
L
25452011-07-28 H.J. Lu <hongjiu.lu@intel.com>
2546
2547 * configure.ac: Set need_64bit_hwint to yes for x86 targets.
2548 * configure: Regenerated.
2549
a024b70f
RO
25502011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2551
2552 * system.h [__cplusplus]: Wrap C function declarations in extern "C".
2553
5b6d595b
RO
25542011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2555 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2556
2557 PR bootstrap/49794
2558 * configure.ac: Test AM_ICONV with CXX.
2559 * configure: Regenerate.
2560 * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
2561
d0a9fbe1
DS
25622011-07-15 Dodji Seketeli <dodji@redhat.com>
2563
2564 * directives.c (struct if_stack): Use source_location as type
2565 here.
2566 * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
2567 indent, def_pragma, used_define, used_undef>: Properly use
2568 source_location as parameter type, rather than unsigned int.
2569
fbdd5d87
RO
25702011-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2571
2572 PR target/39150
2573 * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
2574 like i[34567]86-*-solaris2.1[0-9]*.
2575 * configure: Regenerate.
2576
8787a05a
JM
25772011-06-16 Jason Merrill <jason@redhat.com>
2578
2579 PR c++/45399
2580 * lex.c (lex_raw_string): Don't check for embedded NUL.
2581
38fbfaf6
DS
25822011-06-06 Dodji Seketeli <dodji@redhat.com>
2583
2584 PR preprocessor/48532
2585 * directives.c (do_pragma): Don't forget the invocation location
2586 when parsing the pragma name of a namespaced pragma directive.
2587
fc0993ac
JT
25882011-05-29 John Tytgat <John.Tytgat@aaug.net>
2589
2590 * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
2591
ef230b38
UB
25922011-05-22 Uros Bizjak <ubizjak@gmail.com>
2593
2594 PR target/49104
2595 * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
2596 is defined. Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
2597
e5b0dad8
JK
25982011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
2599
2600 * system.h (ENUM_BITFIELD): Remove.
2601
6cfae070
JJ
26022011-04-24 Jakub Jelinek <jakub@redhat.com>
2603
2604 PR preprocessor/48740
2605 * lex.c (lex_raw_string): When raw string ends with
2606 ??) followed by raw prefix and ", ensure it is preprocessed
2607 with ??) rather than ??].
2608
04695783
JM
26092011-04-20 Jim Meyering <meyering@redhat.com>
2610
2611 * files.c (destroy_cpp_file): Remove useless if-before-free.
2612 * init.c (cpp_destroy): Likewise.
2613 * macro.c (replace_args): Likewise.
2614 * pch.c (cpp_valid_state): Likewise.
2615
4489800d
KT
26162011-03-25 Kai Tietz <ktietz@redhat.com>
2617
2618 * files.c (file_hash_eq): Use filename_cmp
2619 instead of strcmp.
2620 (nonexistent_file_hash_eq): Likewise.
2621 (remap_filename): Likewise.
2622 Handle absolute DOS-path,
2623 (append_file_to_dir): Check for IS_DIR_SEPARATOR
2624 instead of slash.
2625 (read_name_map): Likewise.
2626 * linemap.c (linemap_add): Use filename_cmp
2627 instead of strcmp.
2628 * mkdeps.c (apply_vpath): Use filename_ncmp
2629 instead of strncmp.
2630 (deps_restore): Use filename_cmp instead of
2631 strcmp.
2632 * init.c (read_original_directory): Use
2633 IS_DIR_SEPARATOR instead of checking for slash.
2634
f3c33d9d
MM
26352011-03-21 Michael Meissner <meissner@linux.vnet.ibm.com>
2636
2637 PR preprocessor/48192
2638 * directives.c (do_ifdef): Do not consider conditional macros as
2639 being defined.
2640 (do_ifndef): Ditto.
2641 * expr.c (parse_defined): Ditto.
2642
01956319
RH
26432011-03-18 Richard Henderson <rth@redhat.com>
2644
2645 PR bootstrap/45381
2646 * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
2647
c5a62c6f 26482011-11-04 Eric Botcazou <ebotcazou@adacore.com>
19a9ba64 2649 Jakub Jelinek <jakub@redhat.com>
c5a62c6f
EB
2650
2651 PR preprocessor/39213
2652 * directives.c (end_directive): Call _cpp_remove_overlay for deferred
2653 pragmas as well in traditional mode.
2654
0e1a989c
ILT
26552010-11-17 Ian Lance Taylor <iant@google.com>
2656
2657 PR bootstrap/45538
2658 * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of
2659 AC_LANG based on ENABLE_BUILD_WITH_CXX.
2660
651a20b5
KT
26612010-11-16 Kai Tietz <kai.tietz@onevision.com>
2662
2663 PR preprocessor/17349
2664 * lex.c (save_comment): Handle in argument passing c++
2665 comments special.
2666
480767a9
ILT
26672010-11-02 Ian Lance Taylor <iant@google.com>
2668
2669 * configure.ac: Use AC_SYS_LARGEFILE.
2670 * configure: Rebuild.
2671 * config.in: Rebuild.
2672
078419c9 26732010-10-19 Basile Starynkevitch <basile@starynkevitch.net>
480767a9 2674
078419c9
BS
2675 * line-map.h (source_location): Remove obsolete comment
2676 mentioning location_s.
2677
d6874138
KT
26782010-09-29 Kai Tietz <kai.tietz@onevision.com>
2679
2680 PR preprocessor/45362
2681 * directives.c (cpp_pop_definition): Make static.
2682 (do_pragma_push_macro): Reworked to store text
2683 definition.
2684 (do_pragma_pop_macro): Add free text definition.
2685 (cpp_push_definition): Removed.
2686 * include/cpplib.h (cpp_push_definition): Removed.
2687 (cpp_pop_definition): Likewise.
2688 * internal.h (def_pragma_macro): Remove member 'value'
2689 and add new members 'definition', 'line',
2690 'syshdr', 'sued' and 'is_undef'.
2691 * pch.c (_cpp_restore_pushed_macros): Rework to work
2692 on text definition and store additional macro flags.
2693 (_cpp_save_pushed_macros): Likewise.
2694
e3339d0f
JM
26952010-09-29 Joseph Myers <joseph@codesourcery.com>
2696
2697 * include/cpplib.h (cpp_options): Rename warn_deprecated,
2698 warn_traditional, warn_long_long and pedantic.
2699 * directives.c (directive_diagnostics, _cpp_handle_directive):
2700 Update names of cpp_options members.
2701 * expr.c (cpp_classify_number, eval_token): Update names of
2702 cpp_options members.
2703 * init.c (cpp_create_reader, post_options): Update names of
2704 cpp_options members.
2705 * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
2706 cpp_options members.
2707 * macro.c (parse_params): Update names of cpp_options members.
2708
128465e6
ILT
27092010-09-15 Ian Lance Taylor <iant@google.com>
2710
2711 * init.c: Fix type name in comment.
2712
a69d2520
JJ
27132010-08-31 Jakub Jelinek <jakub@redhat.com>
2714
2715 PR preprocessor/45457
2716 * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
2717 needed.
2718 * directives.c (do_ifdef, do_ifndef): Likewise.
2719
707bcb7a
RO
27202010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2721
2722 * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
2723
6f173e52
RH
27242010-08-24 Richard Henderson <rth@redhat.com>
2725
2726 PR bootstrap/45376
2727 * configure.ac (HAVE_SSE4): New check.
2728 * configure, config.in: Rebuild.
2729 * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
2730
789d73cb
RO
27312010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2732
2733 * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
2734 etc. on Solaris 2/x86.
2735
246a2fcb
RH
27362010-08-21 Richard Henderson <rth@redhat.com>
2737 Andi Kleen <ak@linux.intel.com>
2738 David S. Miller <davem@davemloft.net>
2739
2740 * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
2741 (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
2742 (ptrdiff_t): Check via AC_CHECK_TYPE.
2743 * config.in, configure: Rebuild.
2744 * system.h: Include stdint.h, if available.
2745 * lex.c (WORDS_BIGENDIAN): Provide default.
2746 (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
2747 acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
2748 search_line_sse2, search_line_sse42, init_vectorized_lexer,
2749 search_line_fast): New.
2750 (_cpp_clean_line): Use search_line_fast. Restructure the fast
2751 loop to make it clear when we're leaving the loop. Stay in the
2752 fast loop for non-trigraph '?'.
2753
8e680db5
JJ
27542010-06-11 Jakub Jelinek <jakub@redhat.com>
2755
2756 * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
2757 callback.
2758 (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
2759 (cpp_macro_definition): Remove const qual from second argument.
2760 * macro.c (enter_macro_context): Call user_builtin_macro callback for
2761 NODE_BUILTIN !NODE_USED macros.
2762 (warn_of_redefinition): Likewise. Remove const qual from second
2763 argument.
2764 (cpp_macro_definition): Likewise.
2765 * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
2766 for NODE_BUILTIN !NODE_USED macros.
2767
1cb42611
JM
27682010-06-10 Joseph Myers <joseph@codesourcery.com>
2769
2770 * include/cpplib.h (struct cpp_options): Remove show_column.
2771 * init.c (cpp_create_reader, post_options): Don't set show_column.
2772
ff5dfc48
JR
27732010-06-09 Joern Rennecke <joern.rennecke@embecosm.com>
2774
2775 PR bootstrap/44432
2776 * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
2777 check that C++ compiler works.
2778 * configure: Regenerate.
2779
a9429e29
LB
27802010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
2781
2782 * include/symtab.h (ht_identifier_ptr): New.
2783
c3f247f4
RW
27842010-06-03 Joern Rennecke <joern.rennecke@embecosm.com>
2785 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2786
2787 PR bootstrap/42798
2788 * configure.ac: Check for declaration of 'basename(char *)'.
2789 * configure: Regenerate.
2790 * config.in: Regenerate.
2791
2778d766
JM
27922010-04-25 Joseph Myers <joseph@codesourcery.com>
2793
2794 * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
2795 * init.c (lang_defaults): Add entries for new language variants.
2796 (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
2797 variants.
2798
d8a12e84
MLI
27992010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
2800
2801 PR cpp/43195
2802 * files.c (report_missing_guard): Test for #pragma once.
2803
87cf0651
SB
28042010-04-07 Simon Baldwin <simonb@google.com>
2805
2806 * directives.c (do_diagnostic): Add warning reason argument,
2807 call appropriate error reporting function for code.
2808 (directive_diagnostics): Call specific warning functions with
2809 warning reason where appropriate.
2810 (do_error, do_warning, do_pragma_dependency): Add warning reason
2811 argument to do_diagnostic calls.
2812 * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
2813 _cpp_create_definition): Call specific warning functions with
2814 warning reason where appropriate.
2815 * Makefile.in: Add new diagnostic functions to gettext translations.
2816 * include/cpplib.h (struct cpp_callbacks): Add warning reason code
2817 to error callback.
2818 (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
2819 CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
2820 (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
2821 CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
2822 CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
2823 CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
2824 CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
2825 CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
2826 CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
2827 warning reason codes.
2828 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
2829 cpp_warning_with_line, cpp_pedwarning_with_line,
2830 cpp_warning_with_line_syshdr): New specific error reporting functions.
2831 * pch.c (cpp_valid_state): Call specific warning functions with
2832 warning reason where appropriate.
2833 * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
2834 diagnostic handlers.
2835 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
2836 cpp_warning_with_line, cpp_pedwarning_with_line,
2837 cpp_warning_with_line_syshdr): New specific error reporting functions.
2838 * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
2839 specific warning functions with warning reason where appropriate.
2840 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
2841 warn_about_normalization, lex_identifier_intern, lex_identifier,
2842 _cpp_lex_direct): Ditto.
2843 * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
2844 narrow_str_to_charconst): Ditto.
2845
d947ada0
JJ
28462010-04-06 Jakub Jelinek <jakub@redhat.com>
2847
2848 PR preprocessor/43642
2849 * lex.c (lex_raw_string): Change type of TYPE variable to
2850 unsigned char.
2851
4d9e8446
RW
28522010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2853
2854 * aclocal.m4: Regenerate.
2855
52150625
JM
28562010-03-29 Jason Merrill <jason@redhat.com>
2857
00a81b8b
JM
2858 More N3077 raw string changes
2859 * charset.c (cpp_interpret_string): Don't transform UCNs in raw
2860 strings.
2861 * lex.c (bufring_append): Split out from...
2862 (lex_raw_string): ...here. Undo trigraph and line splicing
2863 transformations. Do process line notes in multi-line literals.
2864 (_cpp_process_line_notes): Ignore notes that were already handled.
2865
52150625
JM
2866 Some raw string changes from N3077
2867 * charset.c (cpp_interpret_string): Change inner delimiters to ().
2868 * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter.
2869
709d7160
JJ
28702010-02-11 Jakub Jelinek <jakub@redhat.com>
2871
2872 * init.c (read_original_filename): Don't call read_original_directory
2873 if _cpp_handle_directive returns 0.
2874
dadab4fd
JM
28752010-01-01 Joseph Myers <joseph@codesourcery.com>
2876
2877 PR preprocessor/41947
2878 * expr.c (cpp_classify_number): Give error for hexadecimal
2879 floating-point constant with no digits before or after point.
2880
3de8a540
AC
28812009-11-20 Arnaud Charlet <charlet@adacore.com>
2882
2883 * macro.c (enter_macro_context): Call cb.used callback if defined.
2884 * directives.c (do_idef, do_ifndef): Ditto.
2885 * include/cpplib.h (struct cpp_callbacks): Add used callback.
2886
17e7cb85
KT
28872009-11-11 Kai Tietz <kai.tietz@onevision.com>
2888
2889 * directives.c (do_pragma_push_macro): New pragma handler.
2890 (do_pragma_pop_macro): Likewise.
2891 (_cpp_init_internal_pragmas): Add push_macro and
2892 pop_macro handler to internal pragmas.
2893 (lex_macro_node_from_str): Removed.
2894 (cpp_push_definition): Replace lex_macro_node_from_str
2895 by _cpp_lex_identifier.
2896 (cpp_pop_definition): Likewise.
2897 * internal.h (_cpp_lex_identifier): New prototype.
2898 (def_pragma_macro): New structure.
2899 (cpp_reader): New member pushed_macros.
2900 * lex.c (_cpp_lex_identifier): New function.
2901 (lex_identifier_intern): New function.
2902 * init.c (cpp_create_reader): Initialize pushed_macros
2903 member.
2904 (cpp_destroy): Free elements in pushed_macros member.
2905 * pch.c (_cpp_save_pushed_macros): New function.
2906 (_cpp_restore_pushed_macros): Likewise.
2907 (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
2908 (cpp_read_state): Use _cpp_restore_pushed_macros.
2909
2c6e3f55
JJ
29102009-10-19 Jakub Jelinek <jakub@redhat.com>
2911
2912 * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
2913 (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
2914 and char32_cset_desc.
2915 (converter_for_type): Handle CPP_UTF8STRING.
2916 (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
2917 * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
2918 (parse_include): Reject raw strings.
2919 * include/cpplib.h (CPP_UTF8STRING): New token type.
2920 * internal.h (struct cpp_reader): Add utf8_cset_desc field.
2921 * lex.c (lex_raw_string): New function.
2922 (lex_string): Handle u8 string literals, call lex_raw_string
2923 for raw string literals.
2924 (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
2925 sequences.
2926 * macro.c (stringify_arg): Handle CPP_UTF8STRING.
2927
96c169e1
JJ
29282009-10-14 Jakub Jelinek <jakub@redhat.com>
2929
2930 PR preprocessor/41543
2931 * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
2932 * line-map.c (linemap_init): Initialize highest_location and
2933 highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
2934
30c99a9e
JM
29352009-10-09 Jason Merrill <jason@redhat.com>
2936
2937 * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
2938
2214382c
NV
29392009-10-09 Neil Vachharajani <nvachhar@google.com>
2940
2941 * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
2942 sccs.
2943
e02222d2
LR
29442009-09-23 Loren J. Rittle <ljrittle@acm.org>
2945
2946 * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
2947 * configure: Rebuilt.
2948
9a8a2b7a
RG
29492009-09-22 Richard Guenther <rguenther@suse.de>
2950
2951 PR pch/38987
2952 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
2953
74dc6a11
CD
29542009-09-18 Chris Demetriou <cgd@google.com>
2955
2956 PR preprocessor/28435:
2957 * include/cpplib.h (struct cpp_options): Add new member
2958 deps.need_preprocessor_output.
2959 * files.c (open_file_failed): If preprocessor output is needed
2960 always report an error.
2961
933608b7
KT
29622009-09-13 Kai Tietz <kai.tietz@onevision.com>
2963
2964 * configure.ac: Set for i?86-w64-mingw*
2965 need_64bit_hwint to yes.
2966 * configure: Regenerated.
2967
86373e7e
JM
29682009-09-10 Jason Merrill <jason@redhat.com>
2969
2970 * directives.c (cpp_define): constify.
2971
fd2ab214
ILT
29722009-09-02 Ian Lance Taylor <iant@google.com>
2973
2974 * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
2975
df58e648
RW
29762009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2977
2978 * configure.ac (AC_PREREQ): Bump to 2.64.
2979
5213506e
RW
29802009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2981
2982 * aclocal.m4: Regenerate.
2983 * config.in: Regenerate.
2984 * configure: Regenerate.
2985
709a22df
TT
29862009-08-17 Tom Tromey <tromey@redhat.com>
2987
2988 PR preprocessor/41067:
2989 * charset.c (convert_escape): Add missing ":" to error text.
2990
0c539b47
DR
29912009-07-27 Douglas B Rupp <rupp@gnat.com>
2992
2993 * include/cpplib.h (INO_T_CPP): New macro.
2994 (struct cpp_dir): Use it.
2995
2b69c841
JQ
29962009-07-20 Jerry Quinn <jlquinn@optonline.net>
2997
2998 PR regression/40800
2999 * configure.ac: Use = instead of == for testing
3000 ENABLE_BUILD_WITH_CXX.
3001 * configure: Rebuild.
3002
f1bf410c
JQ
30032009-07-17 Jerry Quinn <jlquinn@optonline.net>
3004
3005 * directives.c (do_linemarker, do_line): Use CPP_STRING for
3006 ignored enum value.
3007 * files.c (find_file_in_dir): Add cast from void* to char*.
3008 * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
3009 * Makefile.in: (WARN_CFLAGS): Use general and C-specific
3010 warnings.
3011 (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
3012 ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
3013 COMPILER_FLAGS): New.
3014 (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
3015 (COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS
3016 instead of ALL_CFLAGS.
3017 * configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings
3018 from other warnings. Add -Wc++-compat to C-specific warnings.
3019 Check for --enable-build-with-cxx. Set and substitute
3020 ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES
3021 according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before
3022 AC_CHECK_HEADERS.
3023 * configure: Rebuild.
3024 * include/cpp-id-data.h: Remove extern "C".
3025 * include/line-map.h: Likewise.
3026 * include/mkdeps.h: Likewise.
3027 * include/symtab.h: Likewise.
3028 * internal.h: Likewise.
3029
a28fbdba
MLI
30302009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3031
3032 * directives.c (parse_include): Add location argument. Update all
3033 calls.
3034 (parse_answer): Likewise.
3035 (do_include_common): Error with exact location.
3036 (parse_assertion): Likewise.
3037
b506a5a2
MLI
30382009-06-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
3039
3040 * expr.c (num_div_op): Take explicit location.
3041
7d8847a4
ILT
30422009-06-17 Ian Lance Taylor <iant@google.com>
3043
3044 * include/cpplib.h (progname): Don't declare.
3045
3d8b2a98
ILT
30462009-06-12 Ian Lance Taylor <iant@google.com>
3047
3048 * include/cpplib.h (struct cpp_options): Add
3049 warn_cxx_operator_names field.
3050 (NODE_WARN_OPERATOR): Define.
3051 (struct cpp_hashnode): Increase flags field to 10 bits, decrease
3052 type to 6 bits.
3053 * init.c (mark_named_operators): Add flags parameter.
3054 (cpp_post_options): Pick flags value to pass to
3055 mark_named_operators.
3056 * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
3057 identifier is an operator name in C++.
3058
e74fe492
AH
30592009-06-01 Aldy Hernandez <aldyh@redhat.com>
3060
3061 * include/line-map.h (LAST_SOURCE_COLUMN): New.
3062
4851089f
ILT
30632009-06-01 Ian Lance Taylor <iant@google.com>
3064
3065 * include/cpp-id-data.h: Add extern "C".
3066 * include/line-map.h: Likewise.
3067 * include/mkdeps.h: Likewise.
3068 * include/symtab.h: Likewise.
3069 * internal.h: Likewise.
3070
7e5487a2
ILT
30712009-05-15 Ian Lance Taylor <iant@google.com>
3072
3073 * include/cpplib.h (enum cpp_builtin_type): Rename from enum
3074 builtin_type. Change all uses.
3075
00b0c19b
MLI
30762009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3077
3078 PR cpp/36674
3079 * directives (do_linemarker): Compensate for the increment in
3080 location that occurs when we reach the end of line.
3081 * files (_cpp_stack_include): Mention _cpp_find_file in the
3082 comment.
3083
9a0c6187
JM
30842009-05-10 Joseph Myers <joseph@codesourcery.com>
3085
3086 * include/cpplib.h (enum cpp_token_fld_kind): Add
3087 CPP_TOKEN_FLD_TOKEN_NO.
3088 (struct cpp_macro_arg, struct cpp_identifier): Define.
3089 (union cpp_token_u): Use struct cpp_identifier for identifiers.
3090 Use struct cpp_macro_arg for macro arguments. Add token_no for
3091 CPP_PASTE token numbers.
3092 * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
3093 do_pragma_poison, parse_assertion): Use val.node.node in place of
3094 val.node.
3095 * expr.c (parse_defined, eval_token): Use val.node.node in place
3096 of val.node.
3097 * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
3098 cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
3099 cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
3100 place of val.arg_no. Use val.node.node in place of val.node.
3101 * macro.c (replace_args, cpp_get_token, parse_params,
3102 lex_expansion_token, create_iso_definition, cpp_macro_definition):
3103 Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
3104 Use val.node.node in place of val.node.
3105
9e322bc1
JM
31062009-05-03 Joseph Myers <joseph@codesourcery.com>
3107
3108 * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
3109 UTF-8 sequences.
3110
f88d0772
JM
31112009-04-25 Joseph Myers <joseph@codesourcery.com>
3112
3113 PR preprocessor/39559
3114 * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
3115 constants larger than intmax_t in C99 mode.
3116
d1b38208
TG
31172009-04-21 Taras Glek <tglek@mozilla.com>
3118
3119 * include/cpp-id-data.h: Update GTY annotations to new syntax.
3120 * include/cpplib.h: Likewise.
3121 * include/line-map.h: Likewise.
3122 * include/symtab.h: Likewise.
3123
cfc93532
MLI
31242009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3125
3126 PR c++/14875
3127 * lex.c (cpp_type2name): Take a flags parameter. Call
3128 cpp_named_operator2name for named operators and cpp_digraph2name
3129 for digraphs.
3130 (cpp_digraph2name): New.
3131 (cpp_spell_token): Use it.
3132 (cpp_output_token): Likewise.
3133 * include/cpplib.h (cpp_type2name): Update declaration.
3134 * init.c (cpp_named_operator2name): New.
3135 * internal.h (cpp_named_operator2name): Declare.
3136
9c650d90
MLI
31372009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3138
3139 PR c++/13358
3140 * init.c (cpp_create_reader): Wlong_long is disabled by default.
3141 * expr.c (cpp_classify_number): Give different messages for C and
3142 C++ front-ends.
3143
aa508502
JM
31442009-04-19 Joseph Myers <joseph@codesourcery.com>
3145
3146 PR preprocessor/20078
3147 * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
3148 field.
3149 * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
3150 (struct cpp_token): Change flags to unsigned short.
3151 * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
3152 (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
3153 (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
3154 tokens.
3155 * macro.c (macro_real_token_count): New.
3156 (enter_macro_context, replace_args): Use macro_real_token_count.
3157 (create_iso_definition): Record whitespace surrounding and digraph
3158 spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
3159 Set extra_tokens and save CPP_PASTE tokens with arg_no set for
3160 multiple consecutive ## tokens.
3161 (_cpp_create_definition): Initialize extra_tokens.
3162 (cpp_macro_definition): Use macro_real_token_count.
3163
61cc8223
JM
31642009-04-18 Joseph Myers <joseph@codesourcery.com>
3165
3166 * directives.c (parse_include): Pass true to check_eol.
3167
c7f9c0b9
JM
31682009-04-18 Joseph Myers <joseph@codesourcery.com>
3169
3170 PR preprocessor/39646
3171 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
3172 * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
3173 * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
3174 place of LC_RENAME.
3175
a5cb563b
JM
31762009-04-18 Joseph Myers <joseph@codesourcery.com>
3177
3178 PR preprocessor/39647
3179 * directives.c (check_eol): Add parameter expand.
3180 (do_undef, parse_include, do_line, do_linemarker, do_ident,
3181 do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
3182 do_else, do_endif, do_assert, do_unassert): All callers changed.
3183 Pass true from do_line, false elsewhere.
3184
18f41a1b
JM
31852009-04-12 Joseph Myers <joseph@codesourcery.com>
3186
3187 PR preprocessor/31869
3188 * macro.c (stringify_arg): Handle NULL source token in padding
3189 token where previous padding token did not have source token with
3190 preceding whitespace.
3191
748086b7
JJ
31922009-04-09 Jakub Jelinek <jakub@redhat.com>
3193
3194 * Makefile.in: Change copyright header to refer to version
3195 3 of the GNU General Public License and to point readers at the
3196 COPYING3 file and the FSF's license web page.
3197 * charset.c: Likewise.
3198 * directives-only.c: Likewise.
3199 * directives.c: Likewise.
3200 * errors.c: Likewise.
3201 * expr.c: Likewise.
3202 * files.c: Likewise.
3203 * identifiers.c: Likewise.
3204 * include/cpp-id-data.h: Likewise.
3205 * include/cpplib.h: Likewise.
3206 * include/line-map.h: Likewise.
3207 * include/mkdeps.h: Likewise.
3208 * include/symtab.h: Likewise.
3209 * init.c: Likewise.
3210 * internal.h: Likewise.
3211 * lex.c: Likewise.
3212 * line-map.c: Likewise.
3213 * macro.c: Likewise.
3214 * makeucnid.c: Likewise.
3215 * mkdeps.c: Likewise.
3216 * pch.c: Likewise.
3217 * symtab.c: Likewise.
3218 * system.h: Likewise.
3219 * traditional.c: Likewise.
3220 * ucnid.tab: Likewise.
3221 * ucnid.h: Regenerate.
3222
eec49116
JJ
32232009-04-01 Janis Johnson <janis187@us.ibm.com>
3224
839a3b8a
JJ
3225 PR c/39027
3226 * include/cpplib.h (CPP_N_DEFAULT): Define.
3227 * expr.c (interpret_float_suffix): Recognize d or D for double,
3228 return new value for default.
3229 (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
3230
eec49116
JJ
3231 PR c/33466
3232 * expr.c (interpret_float_suffix): Reject invalid suffix that uses
3233 letters from decimal float and fixed-point suffixes.
3234
47580d22
JM
32352009-03-31 Joseph Myers <joseph@codesourcery.com>
3236
3237 PR preprocessor/15638
3238 * files.c (_cpp_find_file): Call open_file_failed after diagnosing
3239 invalid PCH.
3240 (open_file_failed): Make error for missing file fatal.
3241 * include/cpplib.h (CPP_DL_FATAL): Define.
3242
5a2df0fa
SV
32432009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net>
3244
3245 PR preprocessor/31932:
3246 * internal.h: Don't mention HAVE_ICONV_H.
3247 * configure, config.in: Rebuild.
3248 * configure.ac: Don't check for iconv.h.
3249
c1a8a3c6
TT
32502009-03-30 Tom Tromey <tromey@redhat.com>
3251
3252 PR preprocessor/39512:
3253 * line-map.c (linemap_init): Initialize 'reallocator' field.
3254
a37a7b8a
JJ
32552009-03-30 Jakub Jelinek <jakub@redhat.com>
3256
3257 PR target/39558
3258 * macro.c (cpp_get_token): If macro_to_expand returns NULL
3259 and used some tokens, add CPP_PADDING before next token.
3260
148e4216
JM
32612009-03-29 Joseph Myers <joseph@codesourcery.com>
3262
3263 PR preprocessor/34695
3264 * makedepend.c: Remove.
3265 * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
3266 (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
3267 * directives.c (cpp_errors): Remove.
3268 * errors.c (print_location, _cpp_begin_message, v_message):
3269 Remove.
3270 (cpp_error, cpp_error_with_line): Always use error callback.
3271 (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
3272 * include/cpplib.h (cpp_options): Remove pedantic_errors,
3273 inhibit_warnings, warn_system_headers, inhibit_errors,
3274 warnings_are_errors, client_diagnostic.
3275 (cpp_callbacks): Add extra arguments to error callback; make it
3276 return bool.
3277 (cpp_finish): Return void.
3278 (cpp_destroy): Remove inaccurate comment about return value.
3279 (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
3280 (CPP_DL_NOTE): Define.
3281 * include/line-map.h (linemap_print_containing_files): Remove.
3282 * init.c (cpp_finish): Do not check for or return number of
3283 errors.
3284 * internal.h (cpp_reader): Remove errors field.
3285 * line-map.c (linemap_print_containing_files): Remove.
3286 * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
3287 about previous definition. Only emit it if previous diagnostic
3288 was emitted.
3289
f1450211
JM
32902009-03-28 Joseph Myers <joseph@codesourcery.com>
3291
3292 * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
3293 mkinstalldirs.
3294
8f5929e1
JJ
32952009-03-18 Jakub Jelinek <jakub@redhat.com>
3296
3297 * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
3298
4bb09c26
JM
32992009-02-21 Joseph Myers <joseph@codesourcery.com>
3300
3301 * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
3302 header name.
3303 (_cpp_lex_direct): Handle this.
3304
68c9ab45
RG
33052009-02-15 Richard Guenther <rguenther@suse.de>
3306
3307 Revert last change.
3308
601b3e1a
RG
33092009-02-13 Richard Guenther <rguenther@suse.de>
3310
3311 * configure.ac: Enable LFS.
3312 * configure: Re-generate.
3313 * config.in: Likewise.
3314
fc0cd180
BE
33152009-01-05 Ben Elliston <bje@au.ibm.com>
3316
3317 * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
3318 (.po.pox): Likewise.
3319 (po/$(PACKAGE).pot): Likewise.
3320
db89a3be
AO
33212008-12-10 Alexandre Oliva <aoliva@redhat.com>
3322
3323 PR target/37033
3324 * pch.c (cpp_valid_state): Improve message for poisoned symbols.
3325 Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
3326
cc955282
JM
33272008-11-29 Joseph Myers <joseph@codesourcery.com>
3328
3329 * lex.c (cpp_token_len): Use 6 as default length.
3330
47960aaf
MLI
33312008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org>
3332
3333 * expr.c (struct op): Add location.
3334 (_cpp_parse_expr): Propagate locations throught the stack
3335 of expressions.
3336 (reduce): Likewise.
3337 (check_promotion): Use explicit location in errors.
3338
631d0d36
MG
33392008-10-05 Matthew Gingell <gingell@adacore.com>
3340 Arnaud Charlet <charlet@adacore.com>
3341
3342 * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
3343 (cpp_get_comments): New function.
3344 * internal.h (struct cpp_reader): Add comments field.
3345 * init.c (cpp_destroy): Free comments.
3346 * lex.c (store_comment, cpp_get_comments): New functions.
3347 (comments): New struct.
3348 (save_comment): Store comments in comments struct.
3349
c047ce93
SB
33502008-09-18 Simon Baldwin <simonb@google.com>
3351
3352 * include/cpplib.h (struct cpp_options): Add new boolean flag
3353 warn_builtin_macro_redefined.
3354 * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
3355 * (struct builtin_operator): Split out from previous struct builtin,
3356 enhance extra const correctness.
3357 * (struct builtin_macro): Split out from previous struct builtin, add
3358 new always_warn_if_redefined flag, enhance const correctness.
3359 * (mark_named_operators): Use struct builtin_operator.
3360 * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
3361 to builtins selectively.
3362 * macro.c (warn_of_redefinition): Return false if a builtin macro
3363 is not flagged with NODE_WARN.
3364
affa55c6
JJ
33652008-07-31 Jakub Jelinek <jakub@redhat.com>
3366
3367 PR preprocessor/36649
3368 * files.c (struct report_missing_guard_data): New type.
3369 (report_missing_guard): Put paths into an array instead of printing
3370 them right away. Return 1 rather than 0.
3371 (report_missing_guard_cmp): New function.
3372 (_cpp_report_missing_guards): Sort and print paths gathered by
3373 report_missing_guard callback.
3374
3b8f20a1
MLI
33752008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3376
3377 PR 28079
3378 * directives.c (strtolinenum): Handle overflow.
3379 (do_line): Give a warning if line number overflowed.
3380 (do_linemarker): Update call to strtolinenum.
3381
1bb64668
MLI
33822008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3383
3384 * include/line-map.h (linenum_type): New typedef.
3385 (struct line_map): Use it.
3386 (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
3387 (SOURCE_COLUMN): Likewise.
3388 * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
3389 source_location values in a variable of type linenum_type.
3390 * directives.c (struct if_stack): Use linenum_type.
3391 (strtoul_for_line): Rename as strtolinenum.
3392 (do_line): Use linenum_type.
3393 (do_linemarker): Use linenum_type and strtolinenum.
3394 (_cpp_do_file_change): Use linenum_t.
3395 * line-map.c (linemap_add): Likewise.
3396 (linemap_line_start): Likewise.
3397 * traditional.c (struct fun_macro): 'line' is a source_location.
3398 * errors.c (print_location): Use linenum_type.
3399 * directives-only.c (_cpp_preprocess_dir_only): Likewise.
3400 * internal.h (CPP_INCREMENT_LINE): Likewise.
3401 * lex.c (_cpp_skip_block_comment): Use source_location.
19a9ba64 3402
5950c3c9
BE
34032008-07-14 Ben Elliston <bje@au.ibm.com>
3404
3405 * include/cpplib.h (NODE_CONDITIONAL): New.
3406 (struct cpp_callbacks): New macro_to_expand field.
3407 (struct cpp_hashnode): Adjust size of flags and type fields.
3408 (cpp_peek_token): Prototype.
3409 * lex.c (cpp_peek_token): New function.
3410 (_cpp_temp_token): Protect pre-existing lookaheads.
3411 * macro.c (cpp_get_token): Expand any conditional macros.
3412 (_cpp_backup_tokens_direct): New.
3413 (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
3414 (warn_of_redefinition): Silently allow redefined conditional
3415 macros.
3416 (_cpp_create_definition): Remove the conditional flag when a user
3417 defines one of the conditional macros.
3418 * internal.h (_cpp_backup_tokens_direct): New prototype.
3419
e85edc9e
AH
34202008-06-13 Andrew Haley <aph@redhat.com>
3421
3422 PR preprocessor/33305
3423 * macro.c (replace_args): Print a warning for empty macro
3424 arguments in C89 and C++.
3425
18c04407
RW
34262008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3427
3428 * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
3429 * configure: Regenerate.
3430
2d09b640
RW
34312008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3432
3433 * Makefile.in (datarootdir): New variable.
3434
0b7c73cc
L
34352008-06-12 H.J. Lu <hongjiu.lu@intel.com>
3436
3437 PR preprocessor/36479
3438 * charset.c (cpp_interpret_string_notranslate): Also set
3439 narrow_cset_desc.width.
3440
cd985f66
JM
34412008-06-07 Joseph Myers <joseph@codesourcery.com>
3442
3443 * configure.ac (parisc*64*-*-*): Remove.
3444 * configure: Regenerate.
3445
d750887f
TT
34462008-05-30 Tom Tromey <tromey@redhat.com>
3447
3448 PR preprocessor/36320:
3449 * internal.h (_cpp_parse_expr): Update.
3450 * expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error
3451 messages.
3452 * directives.c (do_if): Update.
3453 (do_elif): Require expression if processing group.
3454
c100de59
DS
34552008-05-30 Danny Smith <dannysmith@users.sourceforge.net>
3456
3457 * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
3458
5d6342eb
TT
34592008-05-21 Tom Tromey <tromey@redhat.com>
3460
3461 PR preprocessor/27777:
3462 * lex.c (cpp_output_line_to_string): New function.
3463 * internal.h (_cpp_begin_message): Don't declare.
3464 * errors.c (_cpp_begin_message): Now static.
3465 * include/cpplib.h (cpp_output_line_to_string): Declare.
3466 * directives.c (do_diagnostic): Rewrote. Use
3467 cpp_output_line_to_string. Don't use _cpp_begin_message.
3468
dae4174e
TT
34692008-05-21 Tom Tromey <tromey@redhat.com>
3470
3471 * include/symtab.h (HT_ALLOCED): Remove.
3472 (ht_purge): Declare.
3473 * symtab.c (DELETED): New define.
3474 (ht_lookup): Update comment.
3475 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED
3476 code. Use subobject allocator for strings, if it exists.
3477 (ht_expand): Handle deleted entries.
3478 (ht_forall): Likewise.
3479 (ht_purge): New function.
3480 (ht_dump_statistics): Print deletion statistics.
3481
899015a0
TT
34822008-05-13 Tom Tromey <tromey@redhat.com>
3483
3484 PR preprocessor/22168:
3485 * include/cpplib.h (struct cpp_options) <objc>: Update
3486 documentation.
3487 * expr.c (eval_token): Warn for use of assertions.
3488 * directives.c (directive_diagnostics): Warn about extensions.
3489 (DEPRECATED): New define.
3490 (DIRECTIVE_TABLE): Use it.
3491
71c10038
TT
34922008-05-06 Tom Tromey <tromey@redhat.com>
3493
3494 PR preprocessor/35313, PR preprocessor/36088:
3495 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
3496 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
3497
2bd0fe3d
DM
34982008-05-04 David S. Miller <davem@davemloft.net>
3499
3500 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
3501 * configure: Regenerate.
3502
28f68625
DF
35032008-04-22 Daniel Franke <franke.daniel@gmail.com>
3504
3505 * include/cpplib.h (cpp_define_formatted): New.
3506 * directives.c (cpp_define_formatted): New.
3507
688e7a53
TT
35082008-04-21 Tom Tromey <tromey@redhat.com>
3509
3510 PR libcpp/33415:
3511 * charset.c (_cpp_convert_input): Add buffer_start argument.
3512 Ignore UTF-8 BOM if seen.
3513 * internal.h (_cpp_convert_input): Add argument.
3514 * files.c (struct _cpp_file) <buffer_start>: New field.
3515 (destroy_cpp_file): Free buffer_start, not buffer.
3516 (_cpp_pop_file_buffer): Likewise.
3517 (read_file_guts): Update.
3518
b6baa67d
KVH
35192008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
3520
3521 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
3522 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
3523 (struct cpp_options): Added uliterals.
3524 (cpp_interpret_string): Update prototype.
3525 (cpp_interpret_string_notranslate): Idem.
3526 * charset.c (init_iconv_desc): New width member in cset_converter.
3527 (cpp_init_iconv): Add support for char{16,32}_cset_desc.
3528 (convert_ucn): Idem.
3529 (emit_numeric_escape): Idem.
3530 (convert_hex): Idem.
3531 (convert_oct): Idem.
3532 (convert_escape): Idem.
3533 (converter_for_type): New function.
3534 (cpp_interpret_string): Use converter_for_type, support u and U prefix.
3535 (cpp_interpret_string_notranslate): Match changed prototype.
3536 (wide_str_to_charconst): Use converter_for_type.
3537 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
3538 * directives.c (linemarker_dir): Macro U changed to UC.
3539 (parse_include): Idem.
3540 (register_pragma_1): Idem.
3541 (restore_registered_pragmas): Idem.
3542 (get__Pragma_string): Support CPP_STRING{16,32}.
3543 * expr.c (eval_token): Support CPP_CHAR{16,32}.
3544 * init.c (struct lang_flags): Added uliterals.
3545 (lang_defaults): Idem.
3546 * internal.h (struct cset_converter) <width>: New field.
3547 (struct cpp_reader) <char16_cset_desc>: Idem.
3548 (struct cpp_reader) <char32_cset_desc>: Idem.
3549 * lex.c (digraph_spellings): Macro U changed to UC.
3550 (OP, TK): Idem.
3551 (lex_string): Add support for u'...', U'...', u"..." and U"...".
3552 (_cpp_lex_direct): Idem.
3553 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
3554 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
3555
deb984e6
PB
35562008-04-18 Paolo Bonzini <bonzini@gnu.org>
3557
3558 PR bootstrap/35457
3559 * aclocal.m4: Regenerate.
3560 * configure: Regenerate.
3561
bf048bea
TT
35622008-04-17 Tom Tromey <tromey@redhat.com>
3563
3564 PR libcpp/34866:
3565 * errors.c (cpp_error): Don't reference a token before the start
3566 of the current run.
3567
7f27b0f8
TT
35682008-04-16 Tom Tromey <tromey@redhat.com>
3569
3570 * Makefile.in (TAGS_SOURCES): New variable.
3571 (TAGS): New target.
3572
a1fcb9a1
KK
35732008-04-11 Kaz Kojima <kkojima@gcc.gnu.org>
3574
3575 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
3576 and shbe-*-*.
3577 * configure: Rebuilt.
3578
93d45d9e
JM
35792008-04-02 Joseph Myers <joseph@codesourcery.com>
3580
3581 * include/cpplib.h (struct cpp_callbacks): Add used_define,
3582 used_undef and before_define.
3583 (NODE_USED): Define.
3584 * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
3585 do_ifndef, cpp_pop_definition): Handle new flag and use new
3586 callbacks.
3587 * expr.c (parse_defined): Handle new flag and use new callbacks.
3588 * macro.c (enter_macro_context, _cpp_free_definition): Handle new
3589 flag and use new callbacks.
3590
d4c32e1d
JJ
35912008-04-01 Jakub Jelinek <jakub@redhat.com>
3592
3593 PR pch/13675
3594 * files.c (struct _cpp_file): Remove pch field.
3595 (pch_open_file): Don't set file->pch, just file->pchname.
3596 (should_stack_file): After pfile->cb.read_pch call
3597 free pchname and clear pchname, don't close file->fd.
3598 Test file->pchname instead of file->pch. Don't close fd after cb.
3599 (_cpp_stack_include): Test file->pchname instead of file->pch.
3600
161031e3
TT
36012008-03-28 Tom Tromey <tromey@redhat.com>
3602
3603 * Makefile.in (POSTCOMPILE): New variable.
3604 (.c.o): Use it.
3605
14ccf800
TT
36062008-03-13 Tom Tromey <tromey@redhat.com>
3607
3608 PR libcpp/35322:
3609 * directives.c (destringize_and_run): Set pfile->directive.
3610
830465c6
MM
36112008-03-06 Markus Milleder <markus.milleder@generali.at>
3612
3613 PR preprocessor/35458
3614 * mkdeps.c (munge): Quote '#' with a '\'.
3615
d482a073
RW
36162008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3617
3618 PR preprocessor/35379
3619 * mkdeps.c (deps_write): Ensure the first target always appears
3620 in the first column, without leading backslash newline. Avoid
3621 some more extra whitespace.
3622
185a6cc1
TS
36232008-02-25 Thiemo Seufer <ths@mips.com>
3624
d482a073 3625 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
185a6cc1 3626
2bf41bf0
TT
36272008-02-19 Tom Tromey <tromey@redhat.com>
3628
3629 * traditional.c (lex_identifier): Use CPP_HASHNODE.
3630 * lex.c (lex_identifier): Use CPP_HASHNODE.
3631 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
3632 do-while.
3633 * identifiers.c (alloc_node): Change return type.
3634 (_cpp_init_hashtable): Don't cast 'alloc_node'.
3635 (proxy_assertion_broken): New declaration.
3636 (cpp_forall_identifiers): Move comment.
3637 * line-map.c (linemap_add): Comment fix.
3638 (linemap_line_start): Indentation fix.
3639
765d600a
JJ
36402008-01-25 Jakub Jelinek <jakub@redhat.com>
3641
3642 PR preprocessor/34692
3643 * macro.c (collect_args): Add pragma_buff argument. Push
3644 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
3645 than into arguments. Reset prevent_expansion and parsing_args
3646 state at CPP_PRAGMA_EOL/CPP_EOF.
3647 (funlike_invocation_p): Add pragma_buff argument, pass it through
3648 to collect_args.
3649 (enter_macro_context): Add result argument. Adjust
3650 funlike_invocation_p caller. Emit all deferred pragma tokens
3651 gathered during collect_args before the expansion, add a padding
3652 token. Return 2 instead of 1 if any pragma tokens were prepended.
3653 (cpp_get_token): If enter_macro_context returns 2, don't return
3654 a padding token, instead cycle to grab CPP_PRAGMA token.
3655 * directives.c (_cpp_handle_directive): If was_parsing_args
3656 in deferred pragma, leave parsing_args and prevent_expansion as is.
3657
ec46053b
TT
36582008-01-22 Tom Tromey <tromey@redhat.com>
3659
765d600a 3660 PR c++/34859
ec46053b
TT
3661 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
3662 __STDC_CONSTANT_MACROS.
3663
681c6ab0
FF
36642008-01-07 Fred Fish <fnf@specifix.com>
3665
765d600a 3666 PR preprocessor/30363
681c6ab0 3667 * traditional.c (replace_args_and_push): Add local variable
19a9ba64 3668 cxtquote, calculate the replacement text size assuming a
681c6ab0
FF
3669 worst case of every input character quoted with backslash,
3670 and properly handle output quoting of quote characters in
3671 actual arguments used in function-like macros.
3672
33ae4837
TT
36732008-01-03 Tom Tromey <tromey@redhat.com>
3674
765d600a 3675 PR preprocessor/34602
33ae4837
TT
3676 * directives.c (do_line): Don't try to spell EOF token.
3677 (do_linemarker): Add comment.
3678
675575f5
DD
36792007-12-11 DJ Delorie <dj@redhat.com>
3680
3681 * charset.c (convert_using_iconv): Close out any shift states,
3682 returning to the initial state.
3683
97f6bd40
TT
36842007-12-06 Tom Tromey <tromey@redhat.com>
3685
765d600a 3686 PR c/29172
97f6bd40
TT
3687 * internal.h (struct cpp_reader) <file_hash_entries>: Changed
3688 type.
3689 <file_hash_entries_allocated, file_hash_entries_used>: Removed.
3690 * files.c (FILE_HASH_POOL_SIZE): New macro.
3691 (struct file_hash_entry_pool): New.
3692 (destroy_all_cpp_files): New function.
3693 (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
3694 (new_file_hash_entry): Update.
3695 (free_file_hash_entries): New function.
3696 (_cpp_cleanup_files): Call free_file_hash_entries and
3697 destroy_all_cpp_files.
3698 (cpp_clear_file_cache): New function.
3699 * include/cpplib.h (cpp_clear_file_cache): Declare.
3700
d56a25e1
TT
37012007-12-03 Tom Tromey <tromey@redhat.com>
3702
765d600a 3703 PR preprocessor/34288
d56a25e1
TT
3704 * configure.ac, config.in: Rebuilt.
3705 * configure.ac: Check for ssize_t.
3706
607f74e9
TT
37072007-11-30 Tom Tromey <tromey@redhat.com>
3708
765d600a 3709 PR preprocessor/32868
607f74e9
TT
3710 * macro.c (_cpp_create_definition): Special case
3711 __STDC_FORMAT_MACROS.
3712
b0f4807f
MM
37132007-11-16 Michael Matz <matz@suse.de>
3714
3715 * files.c (search_path_head): Fix check for absolute paths.
3716
f1e20710
TT
37172007-11-11 Tom Tromey <tromey@redhat.com>
3718
765d600a 3719 PR c++/17557
f1e20710
TT
3720 * include/cpplib.h (cpp_included_before): Declare.
3721 * files.c (struct file_hash_entry) <location>: New field.
3722 (_cpp_find_file): Initialize new field.
3723 (make_cpp_dir): Likewise.
3724 (cpp_included_before): New function.
3725
f373b44d
TT
37262007-11-01 Tom Tromey <tromey@redhat.com>
3727
765d600a 3728 PR preprocessor/30805
f373b44d
TT
3729 * macro.c (paste_tokens): Handle padding token.
3730 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
3731
5b9a40df
TT
37322007-10-31 Tom Tromey <tromey@redhat.com>
3733
765d600a 3734 PR preprocessor/30786
5b9a40df
TT
3735 * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
3736 * directives.c (_cpp_do__Pragma): Return error status.
3737 * internal.h (_cpp_do__Pragma): Update.
3738 * directives.c (get__Pragma_string): Back up if EOF seen.
3739
5ffeb913
TT
37402007-09-06 Tom Tromey <tromey@redhat.com>
3741
3742 * internal.h (struct cpp_reader) <invocation_location>: New
3743 field.
3744 (struct cpp_reader) <set_invocation_location>: Likewise.
3745 * init.c (cpp_set_line_map): New function.
3746 * line-map.c (linemap_add): Use linemap's allocator.
3747 * include/line-map.h (GTY): Define.
3748 (line_map_realloc): New typedef.
3749 (struct line_map): Mark with GTY.
3750 (struct line_maps): Likewise.
3751 (struct line_maps) <maps>: Likewise.
3752 (struct line_maps) <reallocator>: New field.
3753 * include/symtab.h (GTY): Conditionally define.
3754 * include/cpplib.h (cpp_set_line_map): Declare.
3755 (cpp_get_token_with_location): Declare.
3756 * macro.c (cpp_get_token): Set invocation_location on the reader.
3757 (cpp_get_token_with_location): New function.
3758
ac6b1c67
CF
37592007-08-30 Chao-ying Fu <fu@mips.com>
3760
3761 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
3762 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
3763 (cpp_classify_number): Support decimal fixed-point constants without
3764 exponents.
3765 Warn about fixed-point constants when -pedantic.
3766 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
3767 comments to support fixed-point values.
3768 (CPP_N_FRACT, CPP_N_ACCUM): Define.
3769
cda5e672
TT
37702007-08-18 Tom Tromey <tromey@redhat.com>
3771
765d600a 3772 PR preprocessor/32974
cda5e672
TT
3773 * directives.c (parse_include): Don't check for EOL when
3774 processing #pragma dependency.
3775
ccfc4c91
OW
37762007-07-30 Ollie Wild <aaw@google.com>
3777
3778 * directives-only.c: New file.
3779 * internal.h (struct _cpp_dir_only_callbacks): New.
3780 (_cpp_preprocess_dir_only): New function.
3781 * directives.c (_cpp_handle_directive): Check directives_only before
3782 disabling execution of indented directives.
3783 * files.c (_cpp_stack_file): Add directives_only check.
3784 * include/cpplib.h (struct cpp_options): Add directives_only.
3785 (cpp_init_special_builtins): New function.
3786 * init.c (cpp_init_special_builtins): New function.
3787 (cpp_init_builtins): Move builtin_array initialization to
3788 cpp_init_special_builtins.
3789 (post_options): Check directives_only before setting
3790 pfile->state.prevent_expansion = 1.
3791 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
3792 is expanded inside a directive while -fdirectives-only is enabled.
3793 * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
3794 (libcpp_a_SOURCES): Add directives-only.c.
3795
a206413a
UB
37962007-07-04 Uros Bizjak <ubizjak@gmail.com>
3797
3798 * traditional.c (_cpp_scan_out_logical_line): Initialize
3799 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
3800 fmacro.args to prevent 'may be used uninitialized' warning.
3801
c77cd3d1
UB
38022007-07-03 Uros Bizjak <ubizjak@gmail.com>
3803
3804 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
3805 Add new constants.
3806 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
3807 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
3808 for 'q' or 'Q' suffixes.
3809
66938a1d
DS
38102007-06-17 Danny Smith <dannysmith@users.sourceforge.net
3811
e1311401 3812 * files.c (open_file): Correct typo.
66938a1d 3813
71995ede
VP
38142007-06-16 Vladimir Prus <vladimir@codesourcery.com>
3815
e1311401 3816 * files.c (open_file): Prevent the call
71995ede
VP
3817 for stat from overwriting errno.
3818
84152c25
VP
38192007-06-09 Vladimir Prus <vladimir@codesourcery.com>
3820
e1311401 3821 * files.c (open_file): Account for the
19a9ba64
AM
3822 fact that on windows, opening a directory gives
3823 EACCES.
84152c25 3824
f7fd775f
JW
38252007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
3826
3827 PR preprocessor/23479
3828 * expr.c (cpp_classify_number): Implement 0b-prefixed binary
3829 integer constants.
3830 (append_digit): Likewise.
3831 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
3832 binary integer constants.
3833
ed0e74e0
DK
38342007-05-31 Dave Korn <dave.korn@artimi.com>
3835
3836 PR preprocessor/14331
3837 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
3838
a702045a
OW
38392007-05-24 Ollie Wild <aaw@google.com>
3840
3841 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
3842 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
3843 (cpp_write_pch_state): Save __COUNTER__ state.
3844 (cpp_valid_state): Check valid __COUNTER__ state.
3845 (cpp_read_state): Read new __COUNTER__ state.
3846 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
3847 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
3848 * internal.h (struct cpp_reader): Add counter member.
3849
126e073b
SM
38502007-05-23 Simon Martin <simartin@users.sourceforge.net>
3851
3852 PR preprocessor/20077
3853 * macro.c (create_iso_definition): Fixed the method to determine
3854 whether the token-pasting operator appears at the beginning or the end
3855 of a macro.
3856
0b4cafec
ILT
38572007-05-21 Ian Lance Taylor <iant@google.com>
3858
3859 * internal.h (struct cpp_reader): Add new fields:
3860 nonexistent_file_hash and nonexistent_file_ob.
3861 * files.c: Include "obstack.h".
3862 (find_file_in_dir): Before trying to open the file, look up the
3863 path name in the hash table of nonexistent files. After failing
3864 to open the file, add the path name to the hash table.
3865 (_cpp_find_file): Cache the results of looking up the file name
3866 starting with the quote and bracket chain heads, if we can.
3867 (nonexistent_file_hash_eq): New static function.
3868 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
3869 pfile->nonexistent_file_ob.
3870 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
3871 pfile->nonexistent_file_ob.
3872
30e04921
JJ
38732007-05-14 Janis Johnson <janis187@us.ibm.com>
3874
19a9ba64 3875 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
5a6bb57e 3876
30e04921
JJ
3877 PR c/31924
3878 * expr.c (interpret_float_suffix): Check for invalid suffix.
3879
22a8a52d
EC
38802007-05-02 Eric Christopher <echristo@apple.com>
3881
3882 * expr.c (num_div_op): Don't overflow if the result is
3883 zero.
3884
fca35e1b
TT
38852007-05-02 Tom Tromey <tromey@redhat.com>
3886
765d600a 3887 PR preprocessor/28709
fca35e1b
TT
3888 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
3889
4cd97075
MM
38902007-03-30 Michael Meissner <michael.meissner@amd.com>
3891
3892 * directives.c (lex_macro_node_from_str): Fix alloca call to be
3893 type correct.
3894
121de39f
RH
38952007-03-30 Richard Henderson <rth@redhat.com>
3896
3897 * directives.c (lex_macro_node_from_str): New.
3898 (cpp_push_definition, cpp_pop_definition): New.
3899 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
3900
4fcb360b
BM
39012007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
3902
3903 * Makefile.in: Add dummy install-pdf target.
3904
67e64439
TT
39052007-01-30 Tom Tromey <tromey@redhat.com>
3906
765d600a 3907 PR preprocessor/30468
67e64439
TT
3908 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
3909 './'.
3910
ee380365
TT
39112007-01-30 Tom Tromey <tromey@redhat.com>
3912
765d600a 3913 PR preprocessor/29966
ee380365
TT
3914 * macro.c (lex_expansion_token): Save and restore cpp_reader's
3915 cur_token.
3916 (_cpp_create_definition): Don't restore cur_token here.
3917 * lex.c (_cpp_lex_token): Added assertion.
3918
024abeb3
TT
39192007-01-27 Tom Tromey <tromey@redhat.com>
3920
3921 * configure: Rebuilt.
3922
ee1c2a10
TT
39232007-01-12 Tom Tromey <tromey@redhat.com>
3924
765d600a 3925 PR preprocessor/28227
ee1c2a10
TT
3926 * directives.c (lex_macro_node): Added 'is_def_or_undef'
3927 argument.
3928 (do_define): Update.
3929 (do_undef): Update.
3930 (do_ifdef): Update.
3931 (do_ifndef): Update.
3932
67214c16
PB
39332007-01-11 Paolo Bonzini <bonzini@gnu.org>
3934
3935 * configure: Regenerate.
3936
1aa6ca40
PB
39372007-01-11 Paolo Bonzini <bonzini@gnu.org>
3938
3939 * configure: Regenerate.
3940
705e2d28
TT
39412007-01-04 Tom Tromey <tromey@redhat.com>
3942
765d600a 3943 PR preprocessor/28165
705e2d28
TT
3944 * internal.h (cpp_in_primary_file): New function.
3945 * directives.c (do_include_next): Use cpp_in_primary_file.
3946 (do_pragma_once): Likewise.
3947 (do_pragma_system_header): Likewise.
3948
7af45bd4
ILT
39492006-12-29 Ian Lance Taylor <iant@google.com>
3950
3951 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
3952 look backward at the end of the line unless we saw a backslash.
3953
9d30f270
JJ
39542006-12-29 Jakub Jelinek <jakub@redhat.com>
3955
3956 PR preprocessor/29612
3957 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
3958 only when new_sysp is non-zero.
3959
30b0edc0
TT
39602006-12-28 Tom Tromey <tromey@redhat.com>
3961
765d600a 3962 PR preprocessor/30001
30b0edc0
TT
3963 * charset.c (_cpp_convert_input): Check that to.len is greater
3964 than zero.
3965
85d9c13c
TS
39662006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
3967
3968 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
83cc06b2 3969 * configure: Rebuilt.
85d9c13c 3970
dfafdaa6
DG
39712006-11-01 Douglas Gregor <doug.gregor@gmail.com>
3972
3973 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
3974 for experimental C++0x mode.
3975 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
3976 adopted the preprocessor changes introduced in C99.
3977
0f45f0f5
JM
39782006-10-29 Joseph Myers <joseph@codesourcery.com>
3979
3980 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
3981 depending on --enable-targets=all.
3982 * configure: Regenerate.
3983
de000d22
JJ
39842006-10-12 Jakub Jelinek <jakub@redhat.com>
3985
3986 PR preprocessor/28709
3987 * macro.c (paste_tokens): Do error reporting here, use BUF with the
3988 spelled LHS token as opposed to spelling it again.
3989 (paste_all_tokens): Don't report errors here, just break on failure.
3990
b5422ad7
BM
39912006-10-10 Brooks Moses <bmoses@stanford.edu>
3992
3993 * Makefile.in: Added empty "pdf" target.
3994
aaf50ff2
GK
39952006-09-22 Geoffrey Keating <geoffk@apple.com>
3996
3997 * configure.ac: Make need_64_bit_hwint case for x86-darwin
3998 match exactly the glob in gcc/config.gcc.
3999 * configure: Regenerate.
4000
c663e301
JM
40012006-09-13 Joseph S. Myers <joseph@codesourcery.com>
4002
4003 PR c/28768
4004 PR preprocessor/14634
4005 * lex.c (lex_string): Pedwarn for unterminated literals.
4006
f7288899
EC
40072006-09-08 Eric Christopher <echristo@apple.com>
4008
4009 * configure.ac: Add 64-bit HWI support for i?86-darwin.
4010
b52dbbf8
SE
40112006-08-14 Steve Ellcey <sje@cup.hp.com>
4012
4013 PR c++/28288
4014 PR c++/14556
4015 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
4016 (CPP_LAST_EQ): Change.
4017 (CPP_LAST_PUNCTUATOR): Change.
4018 * expr.c (cpp_operator): Remove MIN and MAX.
4019 (reduce): Remove CPP_MIN and CPP_MAX.
4020 (num_binary_op): Ditto.
4021 * lex.c (_cpp_lex_direct): Ditto.
4022 (cpp_avoid_paste): Remove ? as legal symbol after > or <.
4023
1c90c6f9
JJ
40242006-06-09 Jakub Jelinek <jakub@redhat.com>
4025
4026 PR preprocessor/27746
4027 * directives.c (do_pragma): Handle pragma with valid namespace
4028 and invalid name coming from macro expansion.
4029 * directives.c (destringize_and_run): Initialize next field in
4030 context.
4031
4032 PR c/27747
4033 PR c++/27748
4034 * directives.c (destringize_and_run): Set NO_EXPAND on the
4035 tokens.
4036
4037 * macro.c (_cpp_backup_tokens): Fix comment typo.
4038
5c3c3683
DJ
40392006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
4040
4041 * Makefile.in (CATALOGS): Add po/ prefix.
4042 * configure: Regenerated.
4043
b2bd74bc
CD
40442006-05-23 Carlos O'Donell <carlos@codesourcery.com>
4045
4046 * Makefile.in: Add install-html target. Add install-html to .PHONY
4047
be8ac3e2
GZ
40482006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
4049
4050 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
4051 * files.c (_cpp_get_file_stat): New function.
4052 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
4053 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
4054 * internal.h (_cpp_get_file_stat): Prototype.
4055 (struct cpp_buffer): Add timestamp.
4056
83900997
JJ
40572006-01-23 Jakub Jelinek <jakub@redhat.com>
4058
4059 PR preprocessor/25717
4060 * init.c (cpp_init_builtins): If __STDC__ will not change value
4061 between system headers and other sources, define it as a normal
4062 macro rather than a builtin.
4063 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
4064 cpp_in_system_header condition.
4065
40662006-01-05 Paolo Bonzini <bonzini@gnu.org>
9220c30c
PB
4067
4068 * Makefile.in: Use -MMD instead of -MD.
4069
bc4071dd
RH
40702006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
4071 Richard Henderson <rth@redhat.com>
4072
4073 Merge from gomp branch:
4074 * directives.c (struct pragma_entry): Add is_deferred. Add ident
4075 entry to value union.
4076 (end_directive): Don't eat the line if in_deferred_pragma.
4077 (run_directive): Remove pragma hacks.
4078 (insert_pragma_entry): Remove.
4079 (new_pragma_entry): New.
4080 (register_pragma_1): Split out of register_pragma. Only handle
4081 the lookup tree and return the new entry.
4082 (cpp_register_pragma): Fill in the pragma entry here.
4083 (cpp_register_deferred_pragma): New.
4084 (register_pragma_internal): New.
4085 (_cpp_init_internal_pragmas): Use register_pragma_internal.
4086 (do_pragma): Allow pragma expansion after namespace. For deferred
4087 pragmas, don't slurp the line into a string.
4088 (destringize_and_run): Save tokens for deferred pragmas.
4089 (cpp_handle_deferred_pragma): Remove.
4090 * macro.c (builtin_macro): Remove pragma token hack.
4091 (_cpp_push_token_context): Rename from push_token_context and export.
4092 * internal.h (struct lexer_state): Add pragma_allow_expansion.
4093 (_cpp_push_token_context): Declare.
4094 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
4095 a token. Update the line number correctly if so.
4096 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
4097 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
4098 * include/cpplib.h (PRAGMA_EOL): New.
4099 (CPP_TOKEN_FLD_PRAGMA): New.
4100 (struct cpp_token): Add val.pragma.
4101 (struct cpp_options): Remove defer_pragmas.
4102 (cpp_handle_deferred_pragma): Remove.
4103 (cpp_register_deferred_pragma): Declare.
4104
d09e893f
JJ
41052006-01-01 Jakub Jelinek <jakub@redhat.com>
4106
4107 PR c++/25294
4108 * directives.c (do_pragma): If pragma line ends with multi-line
4109 block comment, end the saved deferred pragma string before that
4110 comment. Handle embedded '\0' chars on the pragma line.
4111
ab84748a
VR
41122005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
4113
4114 PR c++/23333
4115 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
4116
ad6ed77e
JG
41172005-12-07 Jon Grimm <jgrimm2@us.ibm.com>
4118 Ben Elliston <bje@au.ibm.com>
4119
4120 * include/cpplib.h (CPP_N_DFLOAT): New.
4121 * expr.c (interpret_float_suffix): Identify df, dd, and dl
4122 suffixes as decimal floating point constants.
4123 (cpp_classify_number): Disallow hexadecimal DFP constants.
4124
ba096620 41252005-11-14 Gerald Pfeifer <gerald@pfeifer.com>
bc4071dd 4126 Ian Lance Taylor <ian@airs.com>
ba096620
GP
4127
4128 * include/cpplib.h (struct cpp_callbacks): Annotate error with
4129 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
4130
456b8ce5
UB
41312005-11-09 Per Bothner <per@bothner.com>
4132 Uros Bizjak <uros@kss-loka.si>
f7288899 4133
456b8ce5
UB
4134 PR c/24101
4135 * init.c (read_original_filename): Temporarily set
4136 state.in_directive before calling _cpp_lex_direct for
4137 CPP_HASH tokens.
4138
5571f74f
JW
41392005-11-03 James E Wilson <wilson@specifix.com>
4140
4141 PR preprocessor/24202
4142 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
4143
a63607ed
JM
41442005-11-04 Joseph S. Myers <joseph@codesourcery.com>
4145
4146 * include/cpplib.h (struct cpp_callbacks): Make error take
4147 va_list* parameter.
4148 * errors.c (cpp_error): Update call to callback.
4149
651ed942
AP
41502005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
4151
4152 PR preprocessor/22042
4153 * macro.c (_cpp_builtin_macro_text): Lower the needed max
4154 buffer size.
4155 (cpp_quote_string): Don't octalify non printable
4156 charactors.
4157
178b58b5
JM
41582005-11-03 Joseph S. Myers <joseph@codesourcery.com>
4159
4160 PR c++/17964
4161 * include/cpplib.h (struct cpp_options): Add client_diagnostic.
4162 (struct cpp_callbacks): Add error.
4163 * errors.c (cpp_error): If client_diagnostic, use error callback.
4164 * charset.c (convert_escape): Don't use %03o in diagnostic.
4165
3ee5ed11 41662005-10-21 James E Wilson <wilson@specifix.com>
6568f34b
JW
4167
4168 PR preprocessor/15220
4169 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all
4170 callers. Pass to open_file_failed.
4171 (open_file_failed): New parameter angle_brackets. Fix all callers.
4172 Use in print_dep assignment.
4173 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
4174 * internal.h (_cpp_find_file): Add new parm to declaration.
f7288899 4175
077fc835
KH
41762005-10-08 Kazu Hirata <kazu@codesourcery.com>
4177
4178 * configure.ac: Require 64-bit int for arm*-*-*eabi*.
4179 * configure: Regenerate.
4180
cbc43ae0
ILT
41812005-10-04 Ian Lance Taylor <ian@airs.com>
4182
4183 PR preprocessor/13726
4184 * directives.c (check_eol_return_comments): New static function.
4185 (parse_include): Add buf parameter. Change all callers.
4186 (do_include_common): If not discard comments, turn on
4187 save_comments. Pass collected comments to include callback.
4188 * include/cpplib.h (struct cpp_callbacks): Add new parameter to
4189 include callback: cpp_token list.
4190
af15a2fe
JM
41912005-09-20 Joseph S. Myers <joseph@codesourcery.com>
4192
4193 * include/cpplib.h (struct cpp_options): Add extended_identifiers.
4194 * init.c (struct lang_flags, lang_defaults): Add
4195 extended_identifiers.
4196 (cpp_set_lang): Use it.
4197 * lex.c (forms_identifier_p): Check extended_identifiers.
4198
f5eab47e
JJ
41992005-08-30 Jakub Jelinek <jakub@redhat.com>
4200
4201 PR preprocessor/20348
4202 PR preprocessor/20356
4203 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
4204 2004-06-05 changes.
4205
467129e6
KG
42062005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4207
4208 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
4209 -Wmissing-format-attribute.
4210
4211 * configure: Regenerate.
4212
200031d1
KC
42132005-06-29 Kelley Cook <kcook@gcc.gnu.org>
4214
4215 * all files: Update FSF address in copyright headers.
4216 * makeucnid.c (write_copyright): Update outputted FSF address.
4217
f610dd5f
ZW
42182005-06-13 Zack Weinberg <zack@codesourcery.com>
4219
4220 * configure.ac: Invoke ZW_CREATE_DEPDIR and
4221 ZW_PROG_COMPILER_DEPENDENCIES.
4222 * aclocal.m4, configure: Regenerate.
4223 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
4224 New variables.
4225 (distclean): Clean up $(DEPDIR) and its contents.
4226 (.c.o): Use $(COMPILE).
4227 Include $(DEPDIR)/*.Po for most object->header dependencies.
4228
c3f829c1
GDR
42292005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
4230
4231 * configure.ac: Check declarations for asprintf and vasprintf.
4232 * config.in: Regenerate.
4233 * configure: Likewise.
4234
4235 * charset.c (conversion_loop): Use XRESIZEVEC.
4236 (convert_no_conversion): Likewise.
4237 (convert_using_iconv): Likewise.
4238 (init_iconv_desc): Cast return value of alloca.
4239 (cpp_host_to_exec_charset): Use XNEWVEC.
4240 (emit_numeric_escape): Use XRESIZEVEC.
4241 (cpp_interpret_string): Use XNEWVEC.
4242 (cpp_interpret_string): Use XRESIZEVEC.
4243 (_cpp_interpret_identifier): Cast return value of alloca.
4244 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
4245 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
4246 (parse_include): Use XNEWVEC.
4247 (insert_pragma_entry): Rename local variable "new" to
f610dd5f 4248 "new_entry".
c3f829c1
GDR
4249 (save_registered_pragmas): Cast return value of xmemdup.
4250 (destringize_and_run): Same for alloca.
4251 (parse_assertion): Likewise.
4252 (do_assert): Cast allocated storage to proper type.
4253 (cpp_define): Likewise.
4254 (_cpp_define_builtin): Likewise.
4255 (cpp_undef): Likewise.
4256 (handle_assertion): Likewise.
4257 (cpp_push_buffer): Rename local variable "new" to "new_buffer".
4258 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
4259 (CPP_UMINUS): Likewise.
4260 (struct cpp_operator): Rename from struct operator.
4261 (_cpp_expand_op_stack): Use XRESIZEVEC.
4262 * files.c (pch_open_file): Use XNEWVEC.
4263 (pch_open_file): Use XRESIZEVEC.
4264 (read_file_guts): Use XNEWVEC and XRESIZEVEC.
4265 (dir_name_of_file): Use XNEWVEC.
4266 (make_cpp_file): Use XCNEW.
4267 (make_cpp_dir): Likewise.
4268 (allocate_file_hash_entries): USE XNEWVEC.
4269 (cpp_included): Cast return value of htab_find_with_hash.
4270 (append_file_to_dir): Use XNEWVEC.
4271 (read_filename_string): Likewise. Use XRESIZEVEC too.
4272 (read_name_map): Cast return value of alloca. Use XRESIZEVEC.
4273 (remap_filename): Use XNEWVEC.
4274 (struct pchf_entry): Move definition out of struct pchf_data.
4275 (_cpp_save_file_entries): Use XCNEWVAR.
4276 (_cpp_read_file_entries): Use XNEWVAR.
4277 * identifiers.c (alloc_node): Use XOBNEW.
4278 * init.c (cpp_create_reader): Use XCNEW.
4279 (cpp_init_builtins): Cast of b->value to enum builtin_type.
4280 (read_original_directory): Cast return value of alloca.
4281 * lex.c (add_line_note): Use XRESIZEVEC.
4282 (warn_about_normalization): Use XNEWVEC.
4283 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
4284 (new_buff): Use XNEWVEC.
4285 * line-map.c (linemap_add): Use XRESIZEVEC.
4286 * macro.c (builtin_macro): Cast return value of alloca.
4287 (paste_tokens): Likewise.
4288 (expand_arg): Use XNEWVEC and XRESIZEVEC.
4289 (_cpp_save_parameter): Use XRESIZEVEC.
4290 (create_iso_definition): Cast allocated storage to proper type.
4291 (_cpp_create_definition): Likewise.
4292 (cpp_macro_definition): Use XRESIZEVEC.
4293 * makedepend.c (add_clm): Use XNEW.
4294 (add_dir): Likewise.
4295 * mkdeps.c (munge): Use XNEWVEC.
4296 (deps_init): Use XCNEW.
4297 (deps_add_target): Use XRESIZEVEC.
4298 (deps_add_default_target): Cast return value of alloca.
4299 (deps_add_dep): Use XRESIZEVEC.
4300 (deps_add_vpath): Likewise. Use XNEWVEC too.
4301 (deps_restore): Likewise.
4302 * pch.c (save_idents): Use XNEW and XNEWVEC.
4303 (cpp_save_state): Use XNEW.
4304 (count_defs): Cast return value of htab_find.
4305 (write_defs): Likewise.
4306 (cpp_write_pch_deps): Use XNEWVEC.
4307 (collect_ht_nodes): Use XRESIZEVEC.
4308 (cpp_valid_state): Use XNEWVEC.
4309 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup.
4310 * symtab.c (ht_create): Use XCNEW.
4311 (ht_lookup_with_hash): Cast return value of obstack_copy0.
4312 (ht_expand): Use XCNEWVEC.
4313 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
4314 (bool): Do not define if __cplusplus.
4315
1ed17cd5
ZW
43162005-05-12 Zack Weinberg <zack@codesourcery.com>
4317
4318 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
4319 (do_sccs): Delete function definition, #define to do_ident.
4320 (do_ident): Don't hardwire directive name.
4321
5a8c20ce
RK
43222005-05-12 Ryota Kunisawa <kunisawa@access.co.jp>
4323
4324 PR bootstrap/21230
4325 * configure: Regenerate.
4326
473c5bc9
AP
43272005-04-27 Andris Pavenis <pavenis@latnet.lv>
4328
4329 * files.c: Include io.h for DJGPP to get prototype of setmode.
4330
c1fc5047
PB
43312005-04-19 Per Bothner <per@bothner.com>
4332
4333 PR preprocessor/20907
4334 * line-map.c (linemap_line_start): Fix bug when we need to increse
4335 column_bits but can re-use the current line_map.
4336
042630ad
KG
43372005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4338
4339 * system.h (fopen, fdopen, freopen): Define these to the unlocked
4340 libiberty functions.
4341
0d667716
KG
43422005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4343
4344 * configure.ac (libcpp_UNLOCKED_FUNCS): New.
4345 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
4346 * system.h (putchar, getc, getchar, clearerr, feof, fileno,
4347 fflush, fgetc, fgets, ferror, fread): Redefine to the associated
4348 _unlocked function.
4349 (fwrite_unlocked): Fix prototype.
1ed17cd5 4350
0d667716
KG
4351 * configure, config.in: Regenerate.
4352
cae064e7
JJ
43532005-04-05 Jakub Jelinek <jakub@redhat.com>
4354
4355 PR preprocessor/19475
4356 * macro.c (create_iso_definition): For < ISO C99, don't
4357 pedwarn if there is no whitespace between macro name and its
4358 replacement, but the replacement starts with a basic character
4359 set character.
4360
cbada204
AJ
43612005-03-28 Andreas Jaeger <aj@suse.de>
4362
4363 * lex.c (warn_about_normalization): Cast field width to int to
4364 avoid warning.
4365
f42eccdb
JM
43662005-03-19 Joseph S. Myers <joseph@codesourcery.com>
4367
4368 * configure.ac: Consistently use solaris2.1[0-9]* instead of
4369 solaris2.1[0-9].
4370 * configure: Regenerate.
4371
c79e602b
GK
43722005-03-15 Geoffrey Keating <geoffk@apple.com>
4373
4374 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
4375 UCN rather than printing an error.
4376
50668cf6
GK
43772005-03-14 Geoffrey Keating <geoffk@apple.com>
4378
6baba9bb
GK
4379 * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
4380
43812005-03-14 Geoffrey Keating <geoffk@apple.com>
1ed17cd5 4382
50668cf6
GK
4383 * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
4384 * charset.c: Update for new format of ucnid.h.
4385 (ucn_valid_in_identifier): Update for new format of ucnid.h.
4386 Add NST parameter, and update it; update callers.
4387 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort
4388 with cpp_error.
4389 (convert_ucn): Pass normalize_state to cpp_valid_ucn.
4390 * internal.h (struct normalize_state): New.
4391 (INITIAL_NORMALIZE_STATE): New.
4392 (NORMALIZE_STATE_RESULT): New.
4393 (NORMALIZE_STATE_UPDATE_IDNUM): New.
4394 (_cpp_valid_ucn): New.
4395 * lex.c (warn_about_normalization): New.
4396 (forms_identifier_p): Add normalize_state parameter, update callers.
4397 (lex_identifier): Add normalize_state parameter, update callers. Keep
4398 the state current.
4399 (lex_number): Likewise.
4400 (_cpp_lex_direct): Pass normalize_state to subroutines. Check
4401 it with warn_about_normalization.
4402 * makeucnid.c: New.
4403 * ucnid.h: Replace.
4404 * ucnid.pl: Remove.
4405 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove
4406 comments about obsolete version of C++.
4407 * include/cpplib.h (enum cpp_normalize_level): New.
4408 (struct cpp_options): Add warn_normalize field.
4409
47e20491
GK
44102005-03-11 Geoffrey Keating <geoffk@apple.com>
4411
4412 * directives.c (glue_header_name): Update call to cpp_spell_token.
4413 * internal.h (_cpp_interpret_identifier): New.
4414 * charset.c (_cpp_interpret_identifier): New.
4415 (_cpp_valid_ucn): Allow UCN version of '$'.
4416 * lex.c (lex_identifier): Add extra parameter to indicate if initial
4417 character was '$' or '\'. Support identifiers with UCNs.
4418 (forms_identifier_p): Allow UCNs.
4419 (_cpp_lex_direct): Pass extra parameter to lex_identifier.
4420 (utf8_to_ucn): New.
4421 (cpp_spell_token): Add FORSTRING parameter. Use it.
4422 (cpp_token_as_text): Update call to cpp_spell_token.
4423 (cpp_output_token): Write UCNs back out.
4424 (stringify_arg): Update call to cpp_spell_token.
4425 (paste_tokens): Likewise.
4426 (cpp_macro_definition): Likewise.
4427 * macro.c (stringify_arg): Likewise.
4428 (paste_tokens): Likewise.
4429 (cpp_macro_definition): Likewise.
4430 * include/cpplib.h: Add parameter to cpp_spell_token.
4431
73096711
JJ
44322005-03-04 Jakub Jelinek <jakub@redhat.com>
4433
4434 PR bootstrap/20282
4435 PR bootstrap/20305
4436 * macro.c (replace_args, cpp_get_token): Copy whole
4437 cpp_token_u instead of just cpp_string field from it.
4438
2203a881
DP
44392005-02-28 Devang Patel <dpatel@apple.com>
4440
4441 * directives.c (do_line): Save sysp early before line table is
4442 realloc'ed.
1ed17cd5 4443
c5ff069d
ZW
44442005-02-20 Zack Weinberg <zack@codesourcery.com>
4445
4446 PR 18785
4447 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
4448 (cpp_host_to_exec_charset): New function.
4449 * include/cpplib.h: Declare cpp_host_to_exec_charset.
4450
04c90eea
DP
44512005-02-19 Devang Patel <dpatel@apple.com>
4452
4453 * charset.c (_cpp_convert_input): Check '\r' before inserting
4454 '\n' at the end.
c5ff069d 4455
6da55c00
EC
44562005-02-15 Eric Christopher <echristo@redhat.com>
4457
4458 PR preprocessor/19077
4459 * macro.c (cpp_macro_definition): Move handling of whitespace
4460 to PREV_WHITE conditional. Remove overloading of len
4461 variable.
4462
31c3e631
KH
44632005-02-14 Kazu Hirata <kazu@cs.umass.edu>
4464
4465 * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
4466 traditional.c: Update copyright.
4467
be0f1e54
PB
44682005-02-14 Paolo Bonzini <bonzini@gnu.org>
4469
4470 PR bootstrap/19818
4471 * configure.ac: Check for declaration of basename and getopt.
4472 * config.in: Regenerate.
4473 * configure: Regenerate.
4474 * internal.h (ustrcspn): New.
4475 * macro.c (create_iso_definition): Fix allocation of memory.
4476 (padding_token): Add cast to remove const-ness.
4477 * pch.c (cpp_read_state): Use ustrcspn.
4478
ecddfb39
MS
44792005-02-08 Mike Stump <mrs@apple.com>
4480
4481 * files.c (pchf_adder): Remove.
4482 (struct pchf_adder_info): Likewise.
4483 (_cpp_save_file_entries): Write out all files so that #import works.
4484
9fcdd891
JM
44852005-01-23 Joseph S. Myers <joseph@codesourcery.com>
4486
4487 * configure: Regenerate.
4488
ecfd72e7
TS
44892005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
4490
4491 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
4492
6c25a4f7 4493 * include/cpplib.h: Also update copyright years.
c5ff069d 4494
942926ad
GK
44952005-01-03 Geoffrey Keating <geoffk@apple.com>
4496
4497 * files.c (_cpp_find_file): Add files found by search_path_exhausted
4498 to the list of all files.
4499
a2566ae9
GDR
45002005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
4501
4502 * internal.h: Update references to Cpp lib filenames.
4503 * directives.c: Likewise.
4504 * init.c: Likewise.
4505 * macro.c: Likewise.
4506 * traditional.c: Likewise.
4507
1b449375
EB
45082004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
4509
4510 PR preprocessor/15167
4511 * files.c (destroy_cpp_file): New function.
4512 (should_stack_file): Make a new file if the
4513 compared file is still stacked.
4514
28303828
NN
45152004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
4516
c5ff069d 4517 PR preprocessor/17610
28303828
NN
4518 * directives.c (do_include_common): Error out if an empty filename
4519 is given for #include (or #include_next or #import).
4520
c812785a
RS
45212004-11-27 Roger Sayle <roger@eyesopen.com>
4522 Zack Weinberg <zack@codesourcery.com>
4523
4524 * internal.h: Replace all uses of uchar with unsigned char.
4525 * include/cpp-id-data.h: Likewise. Guard typedef of uchar
4526 with !IN_GCC, so uchar is only defined whilst building libcpp.
4527
f91eaa01
KC
45282004-11-24 Kelley Cook <kcook@gcc.gnu.org>
4529
4530 * aclocal.m4: Regenerate.
4531
f78ce0c2
RS
45322004-11-24 Roger Sayle <roger@eyesopen.com>
4533
4534 PR preprocessor/15824
4535 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
4536 directly, instead of the non-existant "system.h" and "ansidecl.h".
4537 * configure: Regenerate.
4538
b5b3e36a 45392004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
c5ff069d 4540 Joseph Myers <joseph@codesourcery.com>
b5b3e36a
DJ
4541
4542 * internal.h (struct lexer_state): Add in_deferred_pragma.
4543 * directives.c (struct pragma_entry): Add allow_expansion.
4544 (insert_pragma_entry): Take allow_expansion flag.
4545 (register_pragma): Likewise.
4546 (cpp_register_pragma): Likewise.
4547 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
4548 (do_pragma): Honor allow_expansion.
4549 (cpp_handle_deferred_pragma): Set in_deferred_pragma.
4550 * include/cpplib.h (cpp_register_pragma): Update prototype.
4551
a8e68029 45522004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
c5ff069d 4553 Mark Mitchell <mark@codesourcery.com>
a8e68029
DJ
4554
4555 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
4556 need_64bit_hwint=yes.
4557 * configure: Regenerate.
4558
50f47ee0
JM
45592004-11-09 Joseph S. Myers <joseph@codesourcery.com>
4560
4561 * Makefile.in ($(PACKAGE).pot): New rule. Depend on
4562 po/$(PACKAGE).pot.
4563 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
4564 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
4565 Remove local srcdir path from generated file.
4566
968e08d6 45672004-11-04 Zack Weinberg <zack@codesourcery.com>
c5ff069d 4568 Gerald Pfeifer <gerald@pfeifer.com>
968e08d6
ZW
4569
4570 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
4571 as well.
4572
3da3d587
ZW
45732004-10-27 Zack Weinberg <zack@codesourcery.com>
4574
4575 PR 18075
4576 * directives.c (do_pragma): Do not defer pragmas which are unknown.
4577 (cpp_handle_deferred_pragma): Add cast to silence warning.
4578
ac24fc25
JM
45792004-10-14 Joseph S. Myers <jsm@polyomino.org.uk>
4580
4581 * errors.c (_cpp_begin_message): Print "error: " for errors.
4582
7731405b
AJ
45832004-10-10 Andreas Jaeger <aj@suse.de>
4584
4585 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
4586 * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
4587
646544e3
AP
45882004-10-08 Andrew Pinski <pinskia@physics.uc.edu>
4589
4590 * pch.c (cpp_write_pch_state): Remove variable z as it is not
4591 used.
4592 (cpp_read_state): Remove unused variables, m, d and mac_count.
4593
67a74146
PB
45942004-09-29 Per Bothner <per@bothner.com>
4595
4596 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore
4597 cb.line_change. Otherwise do_pragma will call the line_change
4598 call-back with a meaningless line number.
4599
018a4785
ZW
46002004-09-24 Zack Weinberg <zack@codesourcery.com>
4601
4602 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
4603 programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
4604 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
4605 * aclocal.m4, configure: Regenerate.
4606 * init.c: Include localedir.h.
4607 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
4608 (DEFS): Delete.
4609 (.c.o): Use $(ALL_CFLAGS).
4610 (localedir.h, localedir.hs): New rules.
4611 (clean): Use rm -rf to remove directories.
4612 (distclean): Also delete localedir.h and localedir.hs.
4613 (init.o): Update dependencies.
4614
88fa57d7
KC
46152004-09-22 Kelley Cook <kcook@gcc.gnu.org>
4616
4617 * Makefile.in (aclocal.m4): Update dependencies.
4618 * configure.ac (AC_CONFIG_MACRO_DIR): New.
4619 * aclocal.m4, configure: Regenerate.
4620
8f8e9aa5
ZW
46212004-09-17 Zack Weinberg <zack@codesourcery.com>
4622
a29f62d9
ZW
4623 * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
4624 (_cpp_convert_input, _cpp_default_encoding): Add comments.
4625 Some other comments in this file also tweaked.
4626
8f8e9aa5
ZW
4627 * directives.c (do_pragma): Save current buffer position
4628 before lexing the pragma keywords; don't call
4629 _cpp_backup_tokens in the defer_pragmas case.
4630
a2981930
PB
46312004-09-15 Per Bothner <per@bothner.com>
4632
4633 * include/line-map.h (line_map_start): Add parameter names so
4634 preceding comment makes sense.
4635 (linemap_add): Remove from comment mention of non-existing parameter.
4636
21b11495
ZW
46372004-09-09 Matt Austern <austern@apple.com>
4638 Zack Weinberg <zack@codesourcery.com>
4639
4640 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
4641 prefixes throughout. Add entry for PRAGMA. Remove
4642 unnecessary "= 0" from EQ.
4643 (enum cpp_ttype): Adjust OP and TK definitions to restore
4644 prefixes, via token-paste.
4645 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
4646 Change from #defines to additional cpp_ttype enumerators.
4647 (struct cpp_options): Add defer_pragmas.
4648 (cpp_handle_deferred_pragma): Prototype new interface.
4649
4650 * internal.h (struct cpp_reader): Add directive_result.
4651 * directives.c (struct pragma_entry): Add is_internal field;
4652 give boolean fields type bool.
4653 (start_directive): Initialize pfile->directive_result.type.
4654 (_cpp_do__Pragma): Likewise.
4655 (run_directive): Do not crash if pfile->buffer->prev is NULL.
4656 (insert_pragma_entry): Add 'internal' argument; set new->is_internal
4657 from it.
4658 (register_pragma): New static function, bulk of former
4659 cpp_register_pragma here; add 'internal' argument, pass along
4660 to insert_pragma_entry.
4661 (cpp_register_pragma): Now a wrapper around register_pragma which
4662 always passes false for 'internal' argument.
4663 (_cpp_init_internal_pragmas): Call register_pragma directly, passing
4664 true for 'internal'.
4665 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
4666 an internal pragma, save text till the end of the line as a CPP_PRAGMA
4667 token instead of executing the pragma.
4668 (cpp_handle_deferred_pragma): New interface.
4669 * lex.c (token_spellings): Adjust OP and TK definitions to
4670 match changes to cpplib.h.
4671 (_cpp_lex_token): Check for a directive-result token and
4672 return it if present.
4673 (cpp_token_val_index): Handle CPP_PRAGMA.
4674 * macro.c (cpp_builtin_macro_text): Correct comment.
4675 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
4676
0fd9e8dd
SB
46772004-09-06 Serge Belyshev <belyshev@lubercy.com>
4678
4679 PR preprocessor/14699
4680 * symtab.c (ht_dump_statistics): Change type of sum_of_squares
4681 from size_t to double.
4682
39b8ce7f
AS
46832004-08-28 Andreas Schwab <schwab@suse.de>
4684 Andreas Jaeger <aj@suse.de>
4685
4686 * configure.ac: Set PACKAGE correctly.
4687 * configure: Regenerated.
4688
5d1f4b27
PB
46892004-08-25 Paolo Bonzini <bonzini@gnu.org>
4690
4691 * Makefile.in: Add back top_builddir.
4692
078e3ffe
PB
46932004-08-25 Paolo Bonzini <bonzini@gnu.org>
4694
4695 * configure.ac: Replace Automake macro invocations
4696 with manual Autoconf checks and substitutions.
4697 * configure: Regenerate.
4698 * aclocal.m4: Regenerate.
4699 * config.in: Regenerate.
4700 * Makefile.am: Removed.
4701 * Makefile.in: Heavy simplification and reorganization.
4702
b3f8d95d
MM
47032004-08-09 Mark Mitchell <mark@codesourcery.com>
4704
4705 * configure.ac (arm*-*-eabi*): New target.
4706 (arm*-*-symbianelf*): Likewise.
4707 * configure: Regenerated.
4708
72bb2c39
BI
47092004-07-24 Bernardo Innocenti <bernie@develer.com>
4710
4711 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
4712 * directives.c: Use XNEW-family macros from libiberty.
4713 * lex.c: Likewise.
4714 * macro.c: Likewise.
4715 * cpplib.h (cpp_deps_style): Export enum with name.
4716
21b11495 47172004-07-23 Matthias Klose <doko@debian.org>
72bb2c39 4718
21b11495 4719 * init.c (init_library): Use PACKAGE for the text domain.
85eac2a0 4720
a23ee064
AP
47212004-07-16 Andris Pavenis <pavenis@latnet.lv>
4722
4723 PR preprocessor/16366
4724 * internal.h (struct cpp_reader): New field dir_hash.
4725 * files.c (make_cpp_dir): Use dir_hash, not file_hash.
4726 (_cpp_init_files, _cpp_cleanup_files): Update for new field.
4727
a09d4744
NB
47282004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
4729
4730 PR preprocessor/16192
4731 PR preprocessor/15913
4732 PR preprocessor/15572
4733 * expr.c (_cpp_parse_expr): Handle remaining cases where an
4734 expression is missing.
4735 * init.c (post_options): Traditional cpp doesn't do // comments.
4736
f58f7def
PB
47372004-06-30 Per Bothner <per@bothner.com>
4738
4739 * include/line-map.h (fileline): Remove old typedef.
4740 * internal.h (struct cpp_reader): Use source_location typedef instead.
4741
e83d8d43
ZW
47422004-06-26 Zack Weinberg <zack@codesourcery.com>
4743
4744 Partially revert patch of 2004-06-05.
4745 * files.c (search_cache): Remove pfile argument. Don't check
4746 for file that would be found by "" or <> search here...
4747 (_cpp_find_file): ...do it here, before calling find_file_in_dir.
4748 Do not apply directory-of-current-file correction to files
4749 found by this check. Rearrange code slightly.
4750
c0d578e6
GK
47512004-06-21 Geoffrey Keating <geoffk@apple.com>
4752
4753 * files.c (should_stack_file): Correct swapped parameters to call
4754 to cb.read_pch.
4755 * pch.c (cpp_valid_state): Handle -fpreprocessed.
4756
159d5224
PB
47572004-06-15 Paolo Bonzini <bonzini@gnu.org>
4758
4759 * Makefile.in: Regenerate with automake 1.8.5.
4760 * aclocal.m4: Likewise.
4761 * configure: Regenerate.
4762
2fac9c01
ZW
47632004-06-11 Zack Weinberg <zack@codesourcery.com>
4764
4765 * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
4766 * configure, config.in: Regenerate.
4767 * system.h: Unconditionally define bool as unsigned char,
4768 BOOL_BITFIELD as unsigned int.
4769 * .cvsignore: New file.
4770
d8044160
GK
47712004-06-09 Geoffrey Keating <geoffk@apple.com>
4772
4773 * traditional.c (push_replacement_text): Set macro->traditional.
4774 (save_replacement_text): Likewise.
4775 * pch.c (cpp_write_pch_state): Don't write list of defined macros.
4776 (struct save_macro_item): Delete.
4777 (struct save_macro_data): Use a character array not the previous
4778 structured format.
4779 (save_macros): Save macro as text not as internal structures.
4780 (cpp_prepare_state): Update for changes to save_macro_data.
4781 (cpp_read_state): Don't read macros defined in PCH. Restore
2cf22451 4782 -D macros as text.
d8044160
GK
4783 * macro.c (create_iso_definition): Honour alloc_subobject.
4784 Clear traditional flag.
4785 (_cpp_create_definition): Honour alloc_subobject.
4786 * lex.c (cpp_token_val_index): New.
4787 * internal.h: Include cpp-id-data.h.
4788 (uchar): Move definition to cpp-id-data.h.
4789 (U): Likewise.
4790 (cpp_macro): Likewise.
4791 * directives.c (struct answer): Move to cpp-id-data.h.
4792 (do_assert): Honour alloc_subobject.
2cf22451
ZW
4793
4794 * include/symtab.h (struct ht): Add field 'alloc_subobject'.
4795 * include/cpplib.h (struct cpp_string): Add GTY marker.
4796 (enum cpp_token_fld_kind): New.
4797 (struct cpp_token): Add GTY markers.
4798 (cpp_token_val_index): Prototype.
4799 (CPP_HASHNODE_VALUE_IDX): New.
4800 (struct cpp_hashnode): Don't skip fields of 'value' when marking.
4801 * include/cpp-id-data.h: New file.
d8044160 4802
0ca8e815
PB
48032004-06-09 Paolo Bonzini <bonzini@gnu.org>
4804
4805 * Makefile.am (all-local): New.
4806 * Makefile.in: Regenerate.
4807
b51fa00f
RS
48082004-06-06 Roger Sayle <roger@eyesopen.com>
4809
4810 * Makefile.am (LIBICONV): Declare.
4811 (makedepend_LDADD): Use LIBICONV.
4812 * Makefile.in: Regenerate.
4813
5e2f3f39
AP
48142004-06-05 Andrew Pinski <pinskia@physics.uc.edu>
4815
4816 * Makefile.am (LIBINTL): Declare
4817 (makedepend_LDADD): Use LIBINTL.
4818 * Makefile.in: Regenerate.
4819
c6e83800
ZW
48202004-06-05 Zack Weinberg <zack@codesourcery.com>
4821
4822 * Makefile.am: Add makedepend.
4823 * Makefile.in, aclocal.m4: Regenerate.
4824 * charset.c: Insert a space to avoid a warning.
4825 * directives.c: Include mkdeps.h.
4826 (_cpp_handle_directive): Reenable macro expander if appropriate.
4827 (undefine_macros): Inline body of _cpp_free_definition for speed.
4828 Do not call undef callback or _cpp_warn_if_unused_macro.
4829 (cpp_get_deps): New interface.
4830 * files.c (search_cache): Add pfile argument. Check for file
4831 that would be found by "" or <> search here...
4832 (_cpp_find_file): ...not here. Correct recorded start_dir of
4833 files found by directory-of-current-file search that would be
4834 found by "" or <> search.
4835 * init.c (cpp_add_dependency_target): Delete.
4836 * internal.h (struct lexer_state): Add discarding_output flag.
4837 * lex.c (lex_identifier): Compute hash function while scanning.
4838 * macro.c (cpp_scan_nooutput): Disable macro expansion outside
4839 directives.
4840 * makedepend.c: New file.
4841 * mkdeps.c (struct deps): Add vpath vector.
4842 (apply_vpath, deps_add_vpath): New function.
4843 (deps_free): Free vpath vector.
4844 (deps_add_dep, deps_add_target): Use apply_vpath.
4845 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
4846 (ht_lookup_with_hash): New function.
4847 * cpplib.h, mkdeps.h: Update prototypes.
4848 * symtab.h: Update prototypes.
4849 (HT_HASHSTEP, HT_FINISH): New macros.
4850
b453c95f
GK
48512004-05-29 Geoffrey Keating <geoffk@apple.com>
4852
4853 * symtab.c (ht_create): Set entries_owned.
4854 (ht_destroy): Honour entries_owned.
4855 (ht_expand): Likewise.
4856 (ht_load): New.
2cf22451
ZW
4857 * include/symtab.h (struct ht): New field 'entries_owned'
4858 (ht_load): New prototype.
b453c95f 4859
963e23c5
PB
48602004-05-26 Paolo Bonzini <bonzini@gnu.org>
4861
4862 PR bootstrap/15651
4863 * configure.ac: Fix m4 quoting when picking
4864 the size of HOST_WIDE_INT.
4865 * configure: Regenerate.
4866
0429bc77
PB
48672004-05-25 Paolo Bonzini <bonzini@gnu.org>
4868
4869 * Makefile.am: the correct directory for
4870 gettext include files is given by @INCINTL@.
4871 * Makefile.in: Regenerate.
4872
c86dd7db
PB
48732004-05-24 Paolo Bonzini <bonzini@gnu.org>
4874
4875 * system.h [!ENABLE_NLS]: dgettext takes two
4876 parameters.
4877
4f4e53dd
PB
48782004-05-23 Paolo Bonzini <bonzini@gnu.org>
4879
4880 Moved libcpp from the gcc subdirectory to the toplevel.
4881 * Makefile.am: New file.
4882 * Makefile.in: Regenerate.
4883 * configure.ac: New file.
4884 * configure: Regenerate.
4885 * config.in: Regenerate.
4886 * charset.c: Moved from gcc/cppcharset.c. Add note about
4887 brokenness of input charset detection. Adjust for change
4888 in name of cppucnid.h.
4889 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
4890 * expr.c: Moved from gcc/cppexp.c.
4891 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
4892 Remove #define of O_BINARY, it is in system.h.
4893 * identifiers.c: Moved from gcc/cpphash.c.
4894 * internal.h: Moved from gcc/cpphash.h. Change header
4895 guard name. All other files adjusted to match name change.
4896 * init.c: Moved from gcc/cppinit.c.
4897 (init_library) [ENABLE_NLS]: Call bindtextdomain.
4898 * lex.c: Moved from gcc/cpplex.c.
4899 * directives.c: Moved from gcc/cpplib.c.
4900 * macro.c: Moved from gcc/cppmacro.c.
4901 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
4902 * traditional.c: Moved from gcc/cpptrad.c.
4903 * ucnid.h: Moved from gcc/cppucnid.h. Change header
4904 guard name.
4905 * ucnid.pl: Moved from gcc/cppucnid.pl.
4906 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header
4907 guard name.
4908 * symtab.c: Moved from gcc/hashtable.c.
4909 * line-map.c: Moved from gcc. Do not include intl.h.
4910 * mkdeps.c: Moved from gcc.
4911 * system.h: New file.
2cf22451
ZW
4912 * include/cpplib.h: Moved from gcc. Change header guard name.
4913 * include/line-map.h: Moved from gcc. Change header guard name.
4914 * include/mkdeps.h: Moved from gcc. Change header guard name.
4915 * include/symtab.h: Moved from gcc/hashtable.h. Change header
4916 guard name.
818ab71a
JJ
4917\f
4918Copyright (C) 2004-2016 Free Software Foundation, Inc.
4919
4920Copying and distribution of this file, with or without modification,
4921are permitted in any medium without royalty provided the copyright
4922notice and this notice are preserved.