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