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