]> git.ipfire.org Git - thirdparty/gcc.git/blame - libcpp/ChangeLog
rs6000: Fix sanitizer frame unwind on 32-bit ABIs
[thirdparty/gcc.git] / libcpp / ChangeLog
CommitLineData
b44f8ad8
JW
12018-02-28 Jonathan Wakely <jwakely@redhat.com>
2
3 PR preprocessor/84517
4 * lex.c (is_macro_not_literal_suffix): New function.
5 (lex_raw_string, lex_string): Use is_macro_not_literal_suffix to
6 decide when to issue -Wliteral-suffix warnings.
7
fe74f9b4
RB
82018-02-16 Richard Biener <rguenther@suse.de>
9
10 PR bootstrap/82939
11 * line-map.c (linemap_init): Avoid broken value-init when compiling
12 with GCC 4.2.
13
60887f8c
JM
142018-02-15 Jason Merrill <jason@redhat.com>
15 Jakub Jelinek <jakub@redhat.com>
16
17 PR preprocessor/83063 - __VA_OPT__ and ##
18 PR preprocessor/83708
19 * macro.c (vaopt_state): Reorder m_last_was_paste before m_state.
20 (vaopt_state::vaopt_state): Adjust.
21 (vaopt_state::update_flags): Add BEGIN and END.
22 (vaopt_state::update): Return them.
23 (copy_paste_flag): Factor out of replace_args.
24 (last_token_is): New.
25 (replace_args): Handle BEGIN and END. Avoid padding there.
26 (tokens_buff_last_token_ptr): Return NULL if no tokens.
27
1306a81d
JJ
282018-01-31 Jakub Jelinek <jakub@redhat.com>
29
30 PR preprocessor/69869
31 * traditional.c (skip_macro_block_comment): Return bool, true if
32 the macro block comment is unterminated.
33 (copy_comment): Use return value from skip_macro_block_comment instead
34 of always false.
35
53723269
JJ
362018-01-27 Jakub Jelinek <jakub@redhat.com>
37
38 * include/cpplib.h (enum cpp_builtin_type): Change BT_LAST_USER from
39 BT_FIRST_USER + 31 to BT_FIRST_USER + 63.
40
7365279f
BK
412018-01-18 Boris Kolpackov <boris@codesynthesis.com>
42
43 PR other/70268
44 * include/cpplib.h (cpp_callbacks::remap_filename): New callback.
53723269 45 * macro.c (_cpp_builtin_macro_text): Call remap_filename for
7365279f
BK
46 __FILE__ and __BASE_FILE__.
47
a3a821c9
KN
482018-01-10 Kelvin Nilsen <kelvin@gcc.gnu.org>
49
50 * lex.c (search_line_fast): Remove illegal coercion of an
51 unaligned pointer value to vector pointer type and replace with
52 use of __builtin_vec_vsx_ld () built-in function, which operates
53 on unaligned pointer values.
54
85ec4feb
JJ
552018-01-03 Jakub Jelinek <jakub@redhat.com>
56
57 Update copyright years.
58
35c4515b
MW
592017-12-20 Michael Weiser <michael.weiser@gmx.de>
60
61 PR preprocessor/83492
62 * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]:
63 Fix selection of big-endian shift parameters by using
64 __ARM_BIG_ENDIAN.
65
c65e18d3
BE
662017-12-14 Bernd Edlinger <bernd.edlinger@hotmail.de>
67
68 * internal.h (maybe_print_line): Change signature.
7365279f 69
a7b1ce04
JJ
702017-12-05 Jakub Jelinek <jakub@redhat.com>
71
72 PR c++/79228
73 * expr.c (interpret_float_suffix): Avoid memcmp.
74 (interpret_int_suffix): Likewise. Don't check for if.
75
f2b8b8ad
JM
762017-12-01 Jason Merrill <jason@redhat.com>
77
78 PR c++/79228 - extensions hide C++14 complex literal operators
79 * expr.c (interpret_float_suffix): Ignore 'i' in C++14 and up.
80 (interpret_int_suffix): Likewise.
81
6df8934f
DM
822017-11-28 David Malcolm <dmalcolm@redhat.com>
83
84 PR c/82050
85 * include/line-map.h (LINE_MAP_MAX_COLUMN_NUMBER): Move here.
86 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): ...from here.
87 (rich_location::maybe_add_fixit): Reject fix-it hints in which
88 the start column exceeds the next column.
89
34b81eb9
EG
902017-11-20 Eric Gallager <egall@gwmail.gwu.edu>
91
92 PR preprocessor/81794
93 * macro.c (check_trad_stringification): Have warning be controlled
94 by -Wtraditional.
95
01ada121
DM
962017-11-20 David Malcolm <dmalcolm@redhat.com>
97
98 PR c++/72786
99 * include/cpplib.h (cpp_macro_definition_location): New decl.
100 * macro.c (cpp_macro_definition): New function.
101
fb771b9d
TT
1022017-11-13 Tom Tromey <tom@tromey.com>
103
104 * pch.c (cpp_read_state): Set n__VA_OPT__.
105 * macro.c (vaopt_state): New class.
106 (_cpp_arguments_ok): Check va_opt flag.
107 (replace_args, create_iso_definition): Use vaopt_state.
108 * lex.c (lex_identifier_intern): Possibly issue errors for
109 __VA_OPT__.
110 (lex_identifier): Likewise.
111 (maybe_va_opt_error): New function.
112 * internal.h (struct lexer_state) <va_args_ok>: Update comment.
113 (struct spec_nodes) <n__VA_OPT__>: New field.
114 * init.c (struct lang_flags) <va_opt>: New field.
115 (lang_defaults): Add entries for C++2A. Update all entries for
116 va_opt.
117 (cpp_set_lang): Initialize va_opt.
118 * include/cpplib.h (struct cpp_options) <va_opt>: New field.
119 * identifiers.c (_cpp_init_hashtable): Initialize n__VA_OPT__.
120
846b84fb
DM
1212017-11-13 David Malcolm <dmalcolm@redhat.com>
122
123 * include/line-map.h (linenum_type): Move this typedef and the
124 comment describing column numbering to near the top of the file.
125
7d19c460
MK
1262017-11-06 Mukesh Kapoor <mukesh.kapoor@oracle.com>
127
128 PR c++/80955
129 * lex.c (lex_string): When checking for a valid macro for the
130 warning related to -Wliteral-suffix (CPP_W_LITERAL_SUFFIX),
131 check that the macro name does not start with an underscore
132 before calling is_macro().
133
c830c7d5
TV
1342017-11-05 Tom de Vries <tom@codesourcery.com>
135
136 PR other/82784
137 * lex.c (BUF_APPEND): Remove semicolon after
138 "do {} while (0)".
139
64a5912c
DM
1402017-10-31 David Malcolm <dmalcolm@redhat.com>
141
142 * directives.c (_cpp_handle_directive): Update for renaming of
143 cpp_error_at_richloc to cpp_error_at.
144 * errors.c (cpp_diagnostic_at_richloc): Rename to...
145 (cpp_diagnostic_at): ...this, dropping the location_t-based
146 implementation.
147 (cpp_diagnostic): Update for removal of location_t-based
148 cpp_diagnostic_at.
149 (cpp_error_at): Likewise.
150 (cpp_error_at_richloc): Rename to...
151 (cpp_error_at): ...this, and update for renaming of
152 cpp_diagnostic_at_richloc.
153 * include/cpplib.h (cpp_error_at_richloc): Rename to...
154 (cpp_error_at): ...this.
155
c76dc9c3
JM
1562017-10-30 Joseph Myers <joseph@codesourcery.com>
157
158 * include/cpplib.h (enum c_lang): Add CLK_GNUC17 and CLK_STDC17.
159 * init.c (lang_defaults): Add GNUC17 and STDC17 data.
160 (cpp_init_builtins): Handle C17 value of __STDC_VERSION__.
161
35b82d26
NS
1622017-10-10 Nathan Sidwell <nathan@acm.org>
163
164 PR preprocessor/82506
165 * macro.c (cpp_quote_string): Escape raw LFs.
166
026a79f7
AS
1672017-09-15 Andrew Sutton <andrew.n.sutton@gmail.com>
168 Jakub Jelinek <jakub@redhat.com>
169
170 Add support for -std=c++2a.
171 * include/cpplib.h (c_lang): Add CXX2A and GNUCXX2A.
172 * init.c (lang_defaults): Add rows for CXX2A and GNUCXX2A.
173 (cpp_init_builtins): Set __cplusplus to 201709L for C++2a.
174
7b936140
JJ
1752017-09-15 Jakub Jelinek <jakub@redhat.com>
176
177 * include/cpplib.h (enum c_lang): Rename CLK_GNUCXX1Z
178 to CLK_GNUCXX17 and CLK_CXX1Z to CLK_CXX17.
179 * init.c (lang_defaults, cpp_init_builtins): Likewise.
180 * expr.c (cpp_classify_number): Use C++17 instead of C++1z
181 in diagnostics.
182
738f7c2e
DM
1832017-07-07 David Malcolm <dmalcolm@redhat.com>
184
185 PR c++/79300
186 * line-map.c (linemap_macro_loc_to_def_point): Preserve range
187 information for macro expansions by delaying resolving ad-hoc
188 locations until within the loop.
189
c471c6ed
DM
1902017-07-06 David Malcolm <dmalcolm@redhat.com>
191
192 PR c++/79300
193 * include/line-map.h (enum location_aspect): New enum.
194 (linemap_client_expand_location_to_spelling_point): Add
195 enum location_aspect param.
196 * line-map.c (rich_location::get_expanded_location): Update for
197 new param of linemap_client_expand_location_to_spelling_point.
198 (rich_location::maybe_add_fixit): Likewise.
199 (fixit_hint::affects_line_p): Likewise.
200
6d522731
JJ
2012017-06-21 Jakub Jelinek <jakub@redhat.com>
202
203 * line-map.c (location_adhoc_data_update): Perform addition in
204 uintptr_t type rather than char * type. Read *data using
205 ptrdiff_t type instead of int64_t.
206 (get_combined_adhoc_loc): Change offset type to ptrdiff_t from
207 int64_t.
208
c7a980b8
DM
2092017-06-20 David Malcolm <dmalcolm@redhat.com>
210
211 * include/line-map.h (class rich_location): Document that attempts
212 to delete or replace a range *affecting* multiple lines will fail.
213 * line-map.c (rich_location::maybe_add_fixit): Implement this
214 restriction.
215
b09649fd
DM
2162017-06-09 David Malcolm <dmalcolm@redhat.com>
217
218 * include/line-map.h
219 (rich_location::fixits_cannot_be_auto_applied): New method.
220 (rich_location::fixits_can_be_auto_applied_p): New accessor.
221 (rich_location::m_fixits_cannot_be_auto_applied): New field.
222 * line-map.c (rich_location::rich_location): Initialize new field.
223
05945a1b
DM
2242017-06-05 David Malcolm <dmalcolm@redhat.com>
225
226 * include/cpplib.h (struct cpp_callbacks): Add "comment"
227 callback.
228 * lex.c (_cpp_lex_direct): Call the comment callback if non-NULL.
229
ad53f123
DM
2302017-05-02 David Malcolm <dmalcolm@redhat.com>
231
232 * include/line-map.h (class rich_location): Update description of
233 newline handling.
234 (class fixit_hint): Likewise.
235 (fixit_hint::ends_with_newline_p): New decl.
236 * line-map.c (rich_location::maybe_add_fixit): Support newlines
237 in fix-it hints that are insertions of single lines at the start
238 of a line. Don't consolidate into such fix-it hints.
239 (fixit_hint::ends_with_newline_p): New method.
240
338035aa
DM
2412017-05-01 David Malcolm <dmalcolm@redhat.com>
242
243 * include/line-map.h (source_range::intersects_line_p): Delete.
244 (rich_location::add_fixit): Delete.
245 (rich_location::maybe_add_fixit): New method.
246 (class fixit_hint): Reimplement in terms of...
247 (class fixit_replace): ...this.
248 (class fixit_insert): Delete.
249 * line-map.c (linemap_position_for_loc_and_offset): Drop overzealous
250 linemap_assert_fails.
251 (source_range::intersects_line_p): Rename to...
252 (fixit_hint::affects_line_p): New function.
253 (rich_location::add_fixit_insert_before): Reimplement in terms of
254 maybe_add_fixit, moving validation there.
255 (rich_location::add_fixit_insert_after): Likewise.
256 (column_before_p): Delete.
257 (rich_location::add_fixit_replace): Reimplement in terms of
258 maybe_add_fixit, moving validation there. Convert closed input range
259 to half-open range.
260 (rich_location::add_fixit): Delete.
261 (rich_location::maybe_add_fixit): New function.
262 (fixit_insert::fixit_insert): Delete.
263 (fixit_insert::~fixit_insert): Delete.
264 (fixit_insert::affects_line_p): Delete.
265 (fixit_insert::maybe_append_replace): Delete.
266 (fixit_replace::fixit_replace): Rename to...
267 (fixit_hint::fixit_hint): ...this, rewriting as necessary.
268 (fixit_replace::~fixit_replace): Delete.
269 (fixit_replace::affects_line_p): Delete.
270 (fixit_replace::maybe_append_replace): Rename to...
271 (fixit_hint::maybe_append): ...this, rewriting as necessary.
272
5764ee3c
JW
2732017-04-03 Jonathan Wakely <jwakely@redhat.com>
274
275 * include/line-map.h (LINEMAPS_MACRO_MAPS): Fix typo in comment.
276 * lex.c (search_line_fast): Likewise.
277 * pch.h (cpp_valid_state): Likewise.
278
8c00ae24
AS
2792017-03-21 Andreas Schwab <schwab@suse.de>
280
281 * lex.c (search_line_fast) [__ARM_NEON && __ARM_64BIT_STATE]:
282 Convert 64-bit value to boolean before passing to
283 __builtin_expect.
284
85e653c9
JM
2852017-03-16 Jason Merrill <jason@redhat.com>
286
287 * init.c (cpp_init_builtins): Update __cplusplus for C++17.
288
e228c50f
GP
2892017-02-09 Gerald Pfeifer <gerald@pfeifer.com>
290
291 * Makefile.in (po/$(PACKAGE).pot): Adjust bug reporting URL.
292
b9f4757f
DM
2932017-01-10 David Malcolm <dmalcolm@redhat.com>
294
295 PR c++/77949
296 * line-map.c (linemap_position_for_column): When calling
297 linemap_start_line, detect if a new linemap was created with
298 0 column bits, and bail out early if this is the case.
299 (linemap_position_for_loc_and_offset): Replace overzealous
300 linemap_assert_fails with a simple conditional; use correct
301 bit count.
302
5ccf1d8d
DM
3032017-01-07 David Malcolm <dmalcolm@redhat.com>
304
305 PR c++/72803
306 * line-map.c (linemap_line_start): When determining if the highest
307 column given out so far will fit into a proposed change to the
308 current map, use the effective number of column bits, rather than
309 the total number of column + range bits.
310
cbe34bb5
JJ
3112017-01-01 Jakub Jelinek <jakub@redhat.com>
312
313 Update copyright years.
314
a3998c2f
DM
3152016-12-15 David Malcolm <dmalcolm@redhat.com>
316
317 PR preprocessor/78680
318 PR preprocessor/78811
319 * lex.c (_cpp_lex_direct): Only determine the end-location of
320 the token and build a range for non-reserved start locations.
321 Do not do it for EOF tokens.
322
470a60b2
DM
3232016-12-12 David Malcolm <dmalcolm@redhat.com>
324
325 PR preprocessor/78680
326 * lex.c (_cpp_lex_direct): Ensure line notes are processed before
327 computing the end-point of the token.
328
fb2675cb
PB
3292016-11-23 Paolo Bonzini <bonzini@gnu.org>
330
331 * include/cpplib.h (struct cpp_options): Add new member
332 warn_expansion_to_defined.
333 (CPP_W_EXPANSION_TO_DEFINED): New enum member.
334 * expr.c (parse_defined): Warn for all uses of "defined"
335 in macros, and tie warning to CPP_W_EXPANSION_TO_DEFINED.
336 Make it a pedwarning instead of a warning.
337 * system.h (HAVE_DESIGNATED_INITIALIZERS): Do not use
338 "defined" in macros.
339
b8f56412
DM
3402016-11-17 David Malcolm <dmalcolm@redhat.com>
341
342 * charset.c (cpp_interpret_string_1): Skip locations from
343 loc_reader when advancing 'p' when handling raw strings.
344
3549e181
JJ
3452016-11-16 Jakub Jelinek <jakub@redhat.com>
346
347 PR bootstrap/72823
348 * configure.ac (ENABLE_ASSERT_CHECKING): Define if gcc configure
349 would define that macro.
350 * configure: Regenerated.
351 * config.in: Regenerated.
352
a6ac871c
RE
3532016-11-08 Richard Earnshaw <rearnsha@arm.com>
354
355 * lex.c (search_line_fast): New implementation for AArch64.
356
f5ea989d
DM
3572016-10-25 David Malcolm <dmalcolm@redhat.com>
358
359 * files.c (destroy_cpp_file): Free file->path.
360
2be1b796
DM
3612016-10-25 David Malcolm <dmalcolm@redhat.com>
362
363 * include/line-map.h (line_maps::~line_maps): New dtor.
364 (location_adhoc_data_fini): Delete decl.
365 * line-map.c (line_maps::~line_maps): New dtor.
366 (location_adhoc_data_fini): Delete.
367
58f30963
AP
3682016-10-21 Andris Pavenis <andris.pavenis@iki.fi>
369
370 PR preprocessor/71681
371 * files.c (remap_filename): Fix handling -remap in subdirectories.
372
70f6d5e1
JJ
3732016-10-12 Jakub Jelinek <jakub@redhat.com>
374
375 * include/cpplib.h (struct cpp_options): Add
376 cpp_warn_implicit_fallthrough.
377 * init.c (cpp_create_reader): Initialize it to 0.
378 * lex.c (fallthrough_comment_p): Handle different
379 cpp_warn_implicit_fallthrough levels. Whitespace fixes.
380
7bad794a
JJ
3812016-10-08 Jakub Jelinek <jakub@redhat.com>
382
ee19ef45
JJ
383 * lex.c (fallthrough_comment_p): Accept Else, fallthrough.
384
81b02905
JJ
385 * lex.c (fallthrough_comment_p): Extend to handle more common FALLTHRU
386 comment styles.
387
7bad794a
JJ
388 * lex.c (fallthrough_comment_p): Fix off-by-one size comparison
389 errors, cleanup.
390 (_cpp_lex_direct): Allow arbitrary comments in between
391 fallthrough_comment_p comment and following token.
392
67ef83c6
KN
3932016-10-04 Kelvin Nilsen <kelvin@gcc.gnu.org>
394
395 PR target/77847
396 * lex.c (search_line_fast): Add a FALLTHROUGH comment to correct
397 compiler error in the version of this function that is
398 conditionally compiled when GCC_VERSION >= 4005 and both
399 __ALTIVEC__ and __BIG_ENDIAN__ symbols are defined.
400
81fea426
MP
4012016-09-26 Marek Polacek <polacek@redhat.com>
402 Jakub Jelinek <jakub@redhat.com>
403
404 PR c/7652
405 * include/cpplib.h (PREV_FALLTHROUGH): Define.
406 * internal.h (CPP_FALLTHRU): Define.
407 * lex.c (fallthrough_comment_p): New function.
408 (_cpp_lex_direct): Set PREV_FALLTHROUGH on tokens succeeding a falls
409 through comment.
410
bbd6fcf3
DM
4112016-09-23 David Malcolm <dmalcolm@redhat.com>
412
413 PR preprocessor/77672
414 * charset.c (cpp_interpret_string_1): Add a source_range for the
415 NUL-terminator, using the location of the trailing quote of the
416 final string.
417
63cb3926
JM
4182016-09-21 Jason Merrill <jason@redhat.com>
419
420 * line-map.c (linemap_location_from_macro_definition_p): New.
421 * line-map.h: Declare it.
422
31316208
DM
4232016-09-15 David Malcolm <dmalcolm@redhat.com>
424
425 * include/line-map.h (class rich_location): Note that newlines
426 aren't supported in fix-it text.
427 * line-map.c (rich_location::add_fixit_insert_before): Reject
428 attempts to add fix-its containing newlines.
429 (rich_location::add_fixit_replace): Likewise.
430
254830ba
DM
4312016-09-13 David Malcolm <dmalcolm@redhat.com>
432
433 * include/line-map.h (class rich_location): Add description of
434 fix-it hints to leading comment.
435 (rich_location::add_fixit_insert): Rename both overloaded methods
436 to..
437 (rich_location::add_fixit_insert_before): ...this, updating their
438 comments.
439 (rich_location::add_fixit_insert_after): Two new overloaded
440 methods.
441 (rich_location::stop_supporting_fixits): New method.
442 * line-map.c (rich_location::add_fixit_insert): Rename both
443 overloaded methods to..
444 (rich_location::add_fixit_insert_before): ...this, updating their
445 comments.
446 (rich_location::add_fixit_insert_after): Two new methods.
447 (rich_location::reject_impossible_fixit): Split out
448 failure-handling into...
449 (rich_location::stop_supporting_fixits): New method.
450
c65236d6
DM
4512016-09-02 David Malcolm <dmalcolm@redhat.com>
452
453 * include/line-map.h (rich_location::seen_impossible_fixit_p): New
454 accessor.
455
3d4f9f87
DM
4562016-08-31 David Malcolm <dmalcolm@redhat.com>
457
458 * include/line-map.h (class fixit_remove): Remove stray decl.
459 (fixit_hint::affects_line_p): Make const.
460 (fixit_insert::affects_line_p): Likewise.
461 (fixit_replace::affects_line_p): Likewise.
462 * line-map.c (fixit_insert::affects_line_p): Likewise.
463 (fixit_replace::affects_line_p): Likewise.
464
b816477a
DM
4652016-08-30 David Malcolm <dmalcolm@redhat.com>
466
467 * include/line-map.h (class semi_embedded_vec): New class.
468 (semi_embedded_vec<T, NUM_EMBEDDED>::semi_embedded_vec): New ctor.
469 (semi_embedded_vec<T, NUM_EMBEDDED>::~semi_embedded_vec): New
470 dtor.
471 (semi_embedded_vec<T, NUM_EMBEDDED>::operator[]): New methods.
472 (semi_embedded_vec<T, NUM_EMBEDDED>::push): New method.
473 (semi_embedded_vec<T, NUM_EMBEDDED>::truncate): New method.
474 (rich_location::get_num_locations): Reimplement in terms of
475 m_ranges.
476 (rich_location::get_range): Make non-inline.
477 (rich_location::get_num_fixit_hints): Reimplement in terms of
478 m_fixit_hints.
479 (rich_location::add_fixit): New function.
480 (rich_location::MAX_RANGES): Rename to...
481 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this.
482 (rich_location::MAX_FIXIT_HINTS): Rename to...
483 (rich_location::STATICALLY_ALLOCATED_RANGES): ...this, and make
484 private.
485 (rich_location::m_num_ranges): Eliminate in favor of...
486 (rich_location::m_ranges): ...this, converting from a fixed-size
487 array to a semi_embedded_vec.
488 (rich_location::m_num_fixit_hints): Eliminate in favor of...
489 (rich_location::m_fixit_hints): ...this, converting from a
490 fixed-size array to a semi_embedded_vec.
491 * line-map.c (rich_location::rich_location): Update for above
492 changes.
493 (rich_location::~rich_location): Likewise.
494 (rich_location::get_loc): Likewise.
495 (rich_location::get_range): New methods.
496 (rich_location::add_range): Update for above changes.
497 (rich_location::set_range): Likewise.
498 (rich_location::add_fixit_insert): Likewise.
499 (rich_location::add_fixit_replace): Likewise.
500 (rich_location::get_last_fixit_hint): Likewise.
501 (rich_location::reject_impossible_fixit): Likewise.
502 (rich_location::add_fixit): New method.
503
f9087798
DM
5042016-08-30 David Malcolm <dmalcolm@redhat.com>
505
506 * include/line-map.h (rich_location::add_fixit_insert): Add
507 comments. Add overload omitting the source_location param.
508 (rich_location::add_fixit_remove): Add comments. Add overloads
509 omitting the range, and accepting a source_location.
510 (rich_location::add_fixit_replace): Likewise.
511 * line-map.c (rich_location::add_fixit_insert): Add comments. Add
512 overload omitting the source_location param.
513 (rich_location::add_fixit_remove): Add comments. Add overloads
514 omitting the range, and accepting a source_location.
515 (rich_location::add_fixit_replace): Likewise.
516
2aa51413
DM
5172016-08-26 David Malcolm <dmalcolm@redhat.com>
518
519 * include/line-map.h (get_pure_location): New decl.
520 * line-map.c (get_pure_location): Move here, from gcc/input.c, adding
521 a line_maps * param.
522 (rich_location::add_fixit_insert): Call get_pure_location on "where".
523 (rich_location::add_fixit_replace): Call get_pure_location on the
524 end-points.
525
ee908516
DM
5262016-08-26 David Malcolm <dmalcolm@redhat.com>
527
528 * include/line-map.h (rich_location): Eliminate unimplemented
529 constructor based on source_range.
530 (rich_location::get_last_fixit_hint): New method.
531 (rich_location::reject_impossible_fixit): New method.
532 (rich_location): Add fields m_line_table and
533 m_seen_impossible_fixit.
534 (fixit_hint::maybe_append_replace): New pure virtual function.
535 (fixit_insert::maybe_append_replace): New function.
536 (fixit_replace::maybe_append_replace): New function.
537 * line-map.c (rich_location::rich_location): Initialize
538 m_line_table and m_seen_impossible_fixit.
539 (rich_location::add_fixit_insert): Call
540 reject_impossible_fixit and bail out if true.
541 (column_before_p): New function.
542 (rich_location::add_fixit_replace): Call reject_impossible_fixit
543 and bail out if true. Attempt to consolidate with neighboring
544 fixits.
545 (rich_location::get_last_fixit_hint): New method.
546 (rich_location::reject_impossible_fixit): New method.
547 (fixit_insert::maybe_append_replace): New method.
548 (fixit_replace::maybe_append_replace): New method.
549
d672cded
DM
5502016-08-23 David Malcolm <dmalcolm@redhat.com>
551
552 * include/line-map.h (source_range::from_locations): New method.
553
2ffe0809
DM
5542016-08-19 David Malcolm <dmalcolm@redhat.com>
555
556 * include/line-map.h (fixit_hint::kind): Delete REPLACE.
557 (class fixit_remove): Delete.
558 * line-map.c (rich_location::add_fixit_remove): Reimplement
559 by calling add_fixit_replace with an empty string.
560 (fixit_remove::fixit_remove): Delete.
561 (fixit_remove::affects_line_p): Delete.
562
c65699ef
JM
5632016-08-19 Joseph Myers <joseph@codesourcery.com>
564
565 PR c/32187
566 * include/cpplib.h (CPP_N_FLOATN, CPP_N_FLOATNX)
567 (CPP_N_WIDTH_FLOATN_NX, CPP_FLOATN_SHIFT, CPP_FLOATN_MAX): New
568 macros.
569 * expr.c (interpret_float_suffix): Handle fN, fNx, FN and FNx
570 suffixes.
571
fcf830ab
PK
5722016-08-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
573
574 * expr.c (eval_token): Append "evaluates to 0" to Wundef diagnostic.
575
cb18fd07
DM
5762016-08-18 David Malcolm <dmalcolm@redhat.com>
577
578 * directives.c (directive_names): New array.
579 (_cpp_handle_directive): Offer spelling suggestions for misspelled
580 directives.
581 * errors.c (cpp_diagnostic_at_richloc): New function.
582 (cpp_error_at_richloc): New function.
583 * include/cpplib.h (struct cpp_callbacks): Add field
584 "get_suggestion".
585 (cpp_error_at_richloc): New decl.
586
9c62c873
MP
5872016-08-18 Marek Polacek <polacek@redhat.com>
588
589 PR c/7652
590 * pch.c (write_macdef): Add CPP_FALLTHRU.
591
191816a3
MP
5922016-08-12 Marek Polacek <polacek@redhat.com>
593
594 PR c/7652
595 * lex.c (search_line_fast): Add FALLTHRU.
596 (_cpp_lex_direct): Likewise.
597 (cpp_token_val_index): Adjust fall through comment.
598 * macro.c (parse_params): Add FALLTHRU.
599 * pch.c (count_defs): Adjust fall through comment.
600 (write_defs): Likewise.
601
e7864d68
DM
6022016-08-06 David Malcolm <dmalcolm@redhat.com>
603
604 PR bootstrap/72823
605 * charset.c (_cpp_valid_ucn): Replace overzealous assert with one
606 that allows for char_range to be non-NULL when loc_reader is NULL.
607
88fa5555
DM
6082016-08-05 David Malcolm <dmalcolm@redhat.com>
609
610 * charset.c (cpp_substring_ranges::cpp_substring_ranges): New
611 constructor.
612 (cpp_substring_ranges::~cpp_substring_ranges): New destructor.
613 (cpp_substring_ranges::add_range): New method.
614 (cpp_substring_ranges::add_n_ranges): New method.
615 (_cpp_valid_ucn): Add "char_range" and "loc_reader" params; if
616 they are non-NULL, read position information from *loc_reader
617 and update char_range->m_finish accordingly.
618 (convert_ucn): Add "char_range", "loc_reader", and "ranges"
619 params. If loc_reader is non-NULL, read location information from
620 it, and update *ranges accordingly, using char_range.
621 Conditionalize the conversion into tbuf on tbuf being non-NULL.
622 (convert_hex): Likewise, conditionalizing the call to
623 emit_numeric_escape on tbuf.
624 (convert_oct): Likewise.
625 (convert_escape): Add params "loc_reader" and "ranges". If
626 loc_reader is non-NULL, read location information from it, and
627 update *ranges accordingly. Conditionalize the conversion into
628 tbuf on tbuf being non-NULL.
629 (cpp_interpret_string): Rename to...
630 (cpp_interpret_string_1): ...this, adding params "loc_readers" and
631 "out". Use "to" to conditionalize the initialization and usage of
632 "tbuf", such as running the converter. If "loc_readers" is
633 non-NULL, use the instances within it, reading location
634 information from them, and passing them to convert_escape; likewise
635 write to "out" if loc_readers is non-NULL. Check for leading
636 quote and issue an error if it is not present. Update boundary
637 check from "== limit" to ">= limit" to protect against erroneous
638 location values to calls that are not parsing string literals.
639 (cpp_interpret_string): Reimplement in terms to
640 cpp_interpret_string_1.
641 (noop_error_cb): New function.
642 (cpp_interpret_string_ranges): New function.
643 (cpp_string_location_reader::cpp_string_location_reader): New
644 constructor.
645 (cpp_string_location_reader::get_next): New method.
646 * include/cpplib.h (class cpp_string_location_reader): New class.
647 (class cpp_substring_ranges): New class.
648 (cpp_interpret_string_ranges): New prototype.
649 * internal.h (_cpp_valid_ucn): Add params "char_range" and
650 "loc_reader".
651 * lex.c (forms_identifier_p): Pass NULL for new params to
652 _cpp_valid_ucn.
653
8204be6c
AS
6542016-08-01 Andreas Schwab <schwab@suse.de>
655
656 * include/cpplib.h: Fix comment typo.
657
a01fc549
DM
6582016-07-27 David Malcolm <dmalcolm@redhat.com>
659
660 * include/line-map.h (source_location): Fix line numbers in
661 comment.
662
741d3be5
DM
6632016-07-11 David Malcolm <dmalcolm@redhat.com>
664
665 * include/line-map.h (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES):
666 Move here from line-map.c.
667 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
668 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): Move from
669 here to line-map.h.
670 (LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
671
ac81cf0b
DM
6722016-06-22 David Malcolm <dmalcolm@redhat.com>
673
674 * directives.c (do_include_common): Pass on "location" to
675 _cpp_stack_include.
676 * errors.c (cpp_diagnostic): Reimplement in terms of...
677 (cpp_diagnostic_at): New function.
678 (cpp_error_at): New function.
679 (cpp_errno_filename): Add "loc" param and use it by using
680 cpp_error_at rather than cpp_error.
681 * files.c (find_file_in_dir): Add "loc" param and pass it to
682 open_file_failed.
683 (_cpp_find_file): Add "loc" param. Use it to convert calls to
684 cpp_error to cpp_error_at, and pass it to find_file_in_dir and
685 open_file_failed.
686 (read_file_guts): Add "loc" param. Use it to convert calls to
687 cpp_error to cpp_error_at. Pass it to cpp_errno_filename.
688 (read_file): Add "loc" param. Pass it to open_file_failed and
689 read_file_guts.
690 (should_stack_file): Add "loc" param. Pass it to read_file.
691 (_cpp_stack_file): Add "loc" param. Pass it to should_stack_file.
692 (_cpp_stack_include): Add "loc" param. Pass it to
693 _cpp_find_file and _cpp_stack_file.
694 (open_file_failed): Add "loc" param. Pass it to
695 cpp_errno_filename.
696 (_cpp_fake_include): Add 0 as a source_location in call to
697 _cpp_find_file.
698 (_cpp_compare_file_date): Likewise.
699 (cpp_push_include): Likewise for call to _cpp_stack_include.
700 (cpp_push_default_include): Likewise.
701 (_cpp_save_file_entries): Likewise for call to open_file_failed.
702 (_cpp_has_header): Likewise for call to _cpp_find_file.
703 * include/cpplib.h (cpp_errno_filename): Add source_location
704 param.
705 (cpp_error_at): New declaration.
706 * init.c (cpp_read_main_file): Add 0 as a source_location in calls
707 to _cpp_find_file and _cpp_stack_file.
708 * internal.h (_cpp_find_file): Add source_location param.
709 (_cpp_stack_file): Likewise.
710 (_cpp_stack_include): Likewise.
711
a93eac6a
DM
7122016-06-22 David Malcolm <dmalcolm@redhat.com>
713
714 * include/line-map.h (fixit_hint::get_start_loc): New pure virtual
715 function.
716 (fixit_hint::maybe_get_end_loc): Likewise.
717 (fixit_insert::get_start_loc): New function, implementing
718 fixit_hint::get_start_loc.
719 (fixit_insert::maybe_get_end_loc): New function, implementing
720 fixit_hint::maybe_get_end_loc.
721 (fixit_remove::get_start_loc): New function, implementing
722 fixit_hint::get_start_loc.
723 (fixit_remove::maybe_get_end_loc): New function, implementing
724 fixit_hint::maybe_get_end_loc.
725 (fixit_replace::get_start_loc): New function, implementing
726 fixit_hint::get_start_loc.
727 (fixit_replace::maybe_get_end_loc): New function, implementing
728 fixit_hint::maybe_get_end_loc.
729
fe55692c
JDA
7302016-06-21 John David Anglin <danglin@gcc.gnu.org>
731
732 * line-map.c (location_adhoc_data_update): Use int64_t instead of
733 long long.
734 (get_combined_adhoc_loc): Likewise.
735
15c98b2e
ES
7362016-06-01 Eduard Sanou <dhole@openmailbox.org>
737
738 * include/cpplib.h (cpp_callbacks): Add get_source_date_epoch
739 callback.
740 * include/cpplib.h (cpp_init_source_date_epoch): Remove prototype.
741 * init.c (cpp_init_source_date_epoch): Remove function.
742 * init.c (cpp_create_reader): Initialize pfile->source_date_epoch.
743 * internal.h (cpp_reader): Extend comment about source_date_epoch.
744 * macro.c (_cpp_builtin_macro_text): Use get_source_date_epoch
745 callback only once, read pfile->source_date_epoch on future passes.
746 Check that get_source_date_epoch callback is not NULL.
747
ceb17928
ML
7482016-05-20 Martin Liska <mliska@suse.cz>
749
750 * config.in: Regenerated.
751 * configure: Likewise.
752 * configure.ac: Handle --enable-valgrind-annotations.
753 * lex.c (new_buff): Use ENABLE_VALGRIND_ANNOTATIONS instead
754 of ENABLE_VALGRIND_CHECKING.
755 (_cpp_free_buff): Likewise.
756
174f6622
ES
7572016-04-28 Eduard Sanou <dhole@openmailbox.org>
758 Matthias Klose <doko@debian.org>
759
760 * include/cpplib.h (cpp_init_source_date_epoch): Prototype.
761 * init.c (cpp_init_source_date_epoch): New function.
762 * internal.h: Added source_date_epoch variable to struct
763 cpp_reader to store a reproducible date.
7365279f
BK
764 * macro.c (_cpp_builtin_macro_text): Set pfile->date timestamp from
765 pfile->source_date_epoch instead of localtime if source_date_epoch is
766 set, to be used for __DATE__ and __TIME__ macros to help reproducible
174f6622
ES
767 builds.
768
12de2245
BS
7692016-04-13 Bernd Schmidt <bschmidt@redhat.com>
770
771 Patch from Roger Orr <rogero@howzatt.demon.co.uk>
772 PR preprocessor/69650
773 * directives.c (do_linemarker): Reread map after calling
774 cpp_get_token.
775
64824205
RH
7762016-04-06 Richard Henderson <rth@redhat.com>
777
778 PR preprocessor/61817
779 PR preprocessor/69391
780 * internal.h (_cpp_builtin_macro_text): Update decl.
781 * macro.c (_cpp_builtin_macro_text): Accept location for __LINE__.
782 (builtin_macro): Accept a second location for __LINE__.
783 (enter_macro_context): Compute both virtual and real expansion
784 locations for the macro.
785
3caf0ca1
BS
7862016-03-25 Bernd Schmidt <bschmidt@redhat.com>
787
788 PR lto/69650
789 * directives.c (do_linemarker): Test for file left but not entered
790 here.
791 * line-map.c (linemap_add): Not here.
792
6b366948
JJ
7932016-03-21 Jakub Jelinek <jakub@redhat.com>
794
795 PR target/70296
796 * include/cpplib.h (cpp_fun_like_macro_p): New prototype.
797 * macro.c (cpp_fun_like_macro_p): New function.
798
64567cfd
RH
7992016-03-15 Richard Henderson <rth@redhat.com>
800
801 * line-map.c (new_linemap): Make alloc_size a size_t.
802
2aaeea19
JM
8032016-03-14 Jason Merrill <jason@redhat.com>
804
805 * expr.c (cpp_classify_number): Hex floats are new in C++1z.
806 * init.c (lang_defaults): Likewise.
807
b4f3232d
DM
8082016-03-09 David Malcolm <dmalcolm@redhat.com>
809
810 PR c/68473
811 PR c++/70105
812 * line-map.c (linemap_macro_map_loc_unwind_toward_spelling): Move
813 decl...
814 * include/line-map.h
815 (linemap_macro_map_loc_unwind_toward_spelling): ...here,
816 converting from static to extern.
817
40499f81
DM
8182016-03-09 David Malcolm <dmalcolm@redhat.com>
819
820 PR c/68473
821 PR c++/70105
822 * include/line-map.h (source_range::debug): Delete.
823 (struct location_range): Update comment. Replace
824 expanded_location fields "m_start", "m_finish", and "m_caret" with
825 a source_location field: "m_loc".
826 (class rich_location): Reword comment.
827 (rich_location::get_loc): Reimplement in terms of a new overloaded
828 variant which takes an unsigned int.
829 (rich_location::get_loc_addr): Delete.
830 (rich_location::add_range): Drop params "start" and "finish" in
831 favor of param "loc". Drop overloaded variants taking a
832 source_range or location_range *.
833 (rich_location::lazily_expand_location): Delete in favor of...
834 (rich_location::get_expanded_location): New decl.
835 (rich_location::m_loc): Delete field.
836 (rich_location::m_column_override): New field.
837 * line-map.c (rich_location::rich_location): Drop name of
838 line_maps * param. Update initializations for deletion of field
839 "m_loc" and addition of field "m_column_override". Reimplement
840 body as a call to add_range. Delete overloaded variant taking a
841 source_range.
842 (rich_location::get_loc): New function.
843 (rich_location::lazily_expand_location): Delete in favor of...
844 (rich_location::get_expanded_location): New function.
845 (rich_location::override_column): Reimplement.
846 (rich_location::add_range): Drop params "start" and "finish" in
847 favor of param "loc". Eliminate location expansion in favor of
848 simply storing loc. Drop overloaded variants taking a
849 source_range or location_range *.
850 (rich_location::set_range): Eliminate location expansion.
851
7168133a
DM
8522016-02-29 David Malcolm <dmalcolm@redhat.com>
853
854 PR preprocessor/69985
855 (linemap_position_for_loc_and_offset): Rename param from "offset"
856 to "column_offset". Right-shift the column_offset by m_range_bits
857 of the pertinent ordinary map whenever offsetting a
858 source_location. For clarity, offset the column by the column
859 offset, rather than the other way around.
860
196440f8
DM
8612016-02-23 David Malcolm <dmalcolm@redhat.com>
862
863 PR preprocessor/69126
864 PR preprocessor/69543
865 * line-map.c (linemap_compare_locations): At the function top,
866 replace inlined bodies of get_location_from_adhoc_loc with calls
867 to get_location_from_adhoc_loc. Add a pair of calls to
868 get_location_from_adhoc_loc at the bottom of the function, to
869 avoid meaningless comparisons of ad-hoc and non-ad-hoc locations.
870
44714d8c
DM
8712016-02-08 David Malcolm <dmalcolm@redhat.com>
872
873 PR preprocessor/69664
874 * errors.c (cpp_diagnostic_with_line): Only call
875 rich_location::override_column if the column is non-zero.
876 * line-map.c (rich_location::override_column): Update columns
877 within m_ranges[0]. Add assertions to verify that doing so is
878 sane.
879
b5c1c988
JJ
8802016-02-05 Jakub Jelinek <jakub@redhat.com>
881
882 PR c++/69628
883 * charset.c (cpp_interpret_charconst): Clear *PCHARS_SEEN
884 and *UNSIGNEDP if bailing out early due to errors.
885
e2eb5056
JJ
8862016-01-28 Jakub Jelinek <jakub@redhat.com>
887
4bda5946
JJ
888 PR pch/68176
889 * files.c (_cpp_find_file): Set file->implicit_preinclude even if
890 included from file->implicit_preinclude header.
891
e2eb5056
JJ
892 * directives.c (destringize_and_run): Adjust prototype.
893
0afff540
DM
8942016-01-27 David Malcolm <dmalcolm@redhat.com>
895
896 PR preprocessor/69126
897 * directives.c (destringize_and_run): Add expansion_loc param; use
898 it when handling unexpanded pragmas to fixup the locations of the
899 synthesized tokens.
900 (_cpp_do__Pragma): Add expansion_loc param and use it when calling
901 destringize_and_run.
902 * internal.h (_cpp_do__Pragma): Add expansion_loc param.
903 * macro.c (builtin_macro): Pass expansion location of _Pragma to
904 _cpp_do__Pragma.
905
c7df95d8
DM
9062016-01-14 David Malcolm <dmalcolm@redhat.com>
907
908 PR preprocessor/69177
909 * line-map.c (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): New
910 constant.
911 (LINE_MAP_MAX_LOCATION_WITH_COLS): Add note about unit tests
912 to comment.
913 (can_be_stored_compactly_p): Reduce threshold from
914 LINE_MAP_MAX_LOCATION_WITH_COLS to
915 LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES.
916 (get_combined_adhoc_loc): Likewise.
917 (get_range_from_loc): Likewise.
918 (linemap_line_start): Ensure that a new ordinary map is created
919 when transitioning from range-packing being enabled to disabled,
920 at the LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES threshold. Set
921 range_bits to 0 for new ordinary maps when beyond this limit.
922 Prevent the "increase the column bits of a freshly created map"
923 optimization if the range bits has reduced.
924
53290e07
JJ
9252016-01-08 Jakub Jelinek <jakub@redhat.com>
926
927 PR c++/69145
928 * files.c (cpp_included_before): If IS_ADHOC_LOC (location), lookup
929 real location from the line_table.
930
818ab71a
JJ
9312016-01-04 Jakub Jelinek <jakub@redhat.com>
932
933 Update copyright years.
934
329590d7
DM
9352015-12-22 David Malcolm <dmalcolm@redhat.com>
936
937 * line-map.c (get_combined_adhoc_loc): Remove condition
938 on locus < RESERVED_LOCATION_COUNT when considering
939 whether a caret == start == finish location can be
940 simply stored as the caret location.
941
f79520bb
DM
9422015-12-07 David Malcolm <dmalcolm@redhat.com>
943
944 * include/line-map.h (rich_location::set_range): Add line_maps *
945 param; convert param from source_range to source_location. Drop
946 "overwrite_loc_p" param.
947 * line-map.c (rich_location::set_range): Likewise, acting as if
948 "overwrite_loc_p" were true, and getting range from the location.
949
a87a86e1
DM
9502015-11-20 David Malcolm <dmalcolm@redhat.com>
951
952 PR 62314
953 * include/line-map.h (source_range::intersects_line_p): New
954 method.
955 (rich_location::~rich_location): New.
956 (rich_location::add_fixit_insert): New method.
957 (rich_location::add_fixit_remove): New method.
958 (rich_location::add_fixit_replace): New method.
959 (rich_location::get_num_fixit_hints): New accessor.
960 (rich_location::get_fixit_hint): New accessor.
961 (rich_location::MAX_FIXIT_HINTS): New constant.
962 (rich_location::m_num_fixit_hints): New field.
963 (rich_location::m_fixit_hints): New field.
964 (class fixit_hint): New class.
965 (class fixit_insert): New class.
966 (class fixit_remove): New class.
967 (class fixit_replace): New class.
968 * line-map.c (source_range::intersects_line_p): New method.
969 (rich_location::rich_location): Add initialization of
970 m_num_fixit_hints to both ctors.
971 (rich_location::~rich_location): New.
972 (rich_location::add_fixit_insert): New method.
973 (rich_location::add_fixit_remove): New method.
974 (rich_location::add_fixit_replace): New method.
975 (fixit_insert::fixit_insert): New.
976 (fixit_insert::~fixit_insert): New.
977 (fixit_insert::affects_line_p): New.
978 (fixit_remove::fixit_remove): New.
979 (fixit_remove::affects_line_p): New.
980 (fixit_replace::fixit_replace): New.
981 (fixit_replace::~fixit_replace): New.
982 (fixit_replace::affects_line_p): New.
983
46ce03de
JJ
9842015-11-19 Jakub Jelinek <jakub@redhat.com>
985
986 PR preprocessor/60736
987 * include/cpplib.h (cpp_errno_filename): New prototype.
988 * errors.c (cpp_errno): Don't handle msgid "" specially, use
989 _(msgid) instead of msgid as argument to cpp_error.
990 (cpp_errno_filename): New function.
991 * files.c (read_file_guts): Use cpp_errno_filename instead of
992 cpp_errno.
993 (open_file_failed): Likewise. Use file->name if file->path is NULL
994 in diagnostics.
995
ebedc9a3
DM
9962015-11-13 David Malcolm <dmalcolm@redhat.com>
997
998 * errors.c (cpp_diagnostic): Pass pfile->line_table to
999 rich_location ctor.
1000 (cpp_diagnostic_with_line): Likewise.
1001 * include/cpplib.h (struct cpp_token): Update comment for src_loc
1002 to indicate that the range of the token is "baked into" the
1003 source_location.
1004 * include/line-map.h (source_location): Update the descriptive
1005 comment to reflect the packing scheme for short ranges, adding
1006 worked examples of location encoding.
1007 (struct line_map_ordinary): Drop field "column_bits" in favor
1008 of field "m_column_and_range_bits"; add field "m_range_bits".
1009 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
1010 (location_adhoc_data): Add source_range field.
1011 (struct line_maps): Add fields "default_range_bits",
1012 "num_optimized_ranges" and "num_unoptimized_ranges".
1013 (get_combined_adhoc_loc): Add source_range param.
1014 (get_range_from_loc): New declaration.
1015 (pure_location_p): New prototype.
1016 (COMBINE_LOCATION_DATA): Add source_range param.
1017 (SOURCE_LINE): Update for renaming of column_bits.
1018 (SOURCE_COLUMN): Likewise. Shift the column right by the map's
1019 range_bits.
1020 (LAST_SOURCE_LINE_LOCATION): Update for renaming of column_bits.
1021 (linemap_position_for_line_and_column): Add line_maps * params.
1022 (rich_location::rich_location): Likewise.
1023 * lex.c (_cpp_lex_direct): Capture the range of the token, baking
1024 it into token->src_loc via a call to COMBINE_LOCATION_DATA.
1025 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): Reduce from 1U << 17 to
1026 1U << 12.
1027 (location_adhoc_data_hash): Add the src_range into
1028 the hash value.
1029 (location_adhoc_data_eq): Require equality of the src_range
1030 values.
1031 (can_be_stored_compactly_p): New function.
1032 (get_combined_adhoc_loc): Add src_range param, and store it,
1033 via a bit-packing scheme for short ranges, otherwise within the
1034 lookaside table. Remove the requirement that data is non-NULL.
1035 (get_range_from_adhoc_loc): New function.
1036 (get_range_from_loc): New function.
1037 (pure_location_p): New function.
1038 (linemap_add): Ensure that start_location has zero for the
1039 range_bits, unless we're past LINE_MAP_MAX_LOCATION_WITH_COLS.
1040 Initialize range_bits to zero. Assert that the start_location
1041 is "pure".
1042 (linemap_line_start): Assert that the
1043 column_and_range_bits >= range_bits.
1044 Update determinination of whether we need to start a new map
1045 using the effective column bits, without the range bits.
1046 Use the set's default_range_bits in new maps, apart from
1047 those with column_bits == 0, which should also have 0 range_bits.
1048 Increase the column bits for new maps by the range bits.
1049 When adding lines to an existing map, use set->highest_line
1050 directly rather than offsetting highest by SOURCE_COLUMN.
1051 Add assertions to sanity-check the return value.
1052 (linemap_position_for_column): Offset to_column by range_bits.
1053 Update set->highest_location if necessary.
1054 (linemap_position_for_line_and_column): Add line_maps * param.
1055 Update the calculation to offset the column by range_bits, and
1056 conditionalize it on being <= LINE_MAP_MAX_LOCATION_WITH_COLS.
1057 Bound it by LINEMAPS_MACRO_LOWEST_LOCATION. Update
1058 set->highest_location if necessary.
1059 (linemap_position_for_loc_and_offset): Handle ad-hoc locations;
1060 pass "set" to linemap_position_for_line_and_column.
1061 (linemap_macro_map_loc_unwind_toward_spelling): Add line_maps
1062 param. Handle ad-hoc locations.
1063 (linemap_location_in_system_header_p): Pass on "set" to call to
1064 linemap_macro_map_loc_unwind_toward_spelling.
1065 (linemap_macro_loc_to_spelling_point): Retain ad-hoc locations.
1066 Pass on "set" to call to
1067 linemap_macro_map_loc_unwind_toward_spelling.
1068 (linemap_resolve_location): Retain ad-hoc locations. Pass on
1069 "set" to call to linemap_macro_map_loc_unwind_toward_spelling.
1070 (linemap_unwind_toward_expansion): Pass on "set" to call to
1071 linemap_macro_map_loc_unwind_toward_spelling.
1072 (linemap_expand_location): Extract the data pointer before
1073 extracting the location.
1074 (rich_location::rich_location): Add line_maps param; use it to
1075 extract the range from the source_location.
1076 * location-example.txt: Regenerate, showing new representation.
1077
8a645150
DM
10782015-11-06 David Malcolm <dmalcolm@redhat.com>
1079
1080 * errors.c (cpp_diagnostic): Update for change in signature
1081 of "error" callback.
1082 (cpp_diagnostic_with_line): Likewise, calling override_column
1083 on the rich_location.
1084 * include/cpplib.h (struct cpp_callbacks): Within "error"
1085 callback, convert param from source_location to rich_location *,
1086 and drop column_override param.
1087 * include/line-map.h (struct source_range): New struct.
1088 (struct location_range): New struct.
1089 (class rich_location): New class.
1090 (linemap_client_expand_location_to_spelling_point): New declaration.
1091 * line-map.c (rich_location::rich_location): New ctors.
1092 (rich_location::lazily_expand_location): New method.
1093 (rich_location::override_column): New method.
1094 (rich_location::add_range): New methods.
1095 (rich_location::set_range): New method.
1096
ee015909
DM
10972015-11-06 David Malcolm <dmalcolm@redhat.com>
1098
1099 * include/line-map.h (struct linemap_stats): Add fields
1100 "adhoc_table_size" and "adhoc_table_entries_used".
1101 * line-map.c (linemap_get_statistics): Populate above fields.
1102
a6c764d0
MM
11032015-11-04 Mikhail Maltsev <maltsevm@gmail.com>
1104
1105 * config.in: Regenerate.
1106 * configure: Regenerate.
1107 * configure.ac: Remove ENABLE_CHECKING.
1108
49445904
UB
11092015-11-03 Uros Bizjak <ubizjak@gmail.com>
1110
1111 * lex.c (search_line_sse42): Correctly advance the pointer to an
1112 aligned address.
1113
525ce910
DM
11142015-11-02 David Malcolm <dmalcolm@redhat.com>
1115
1116 * include/line-map.h (source_location): In the table in the
1117 descriptive comment, show UNKNOWN_LOCATION, BUILTINS_LOCATION,
1118 LINE_MAP_MAX_LOCATION_WITH_COLS, LINE_MAP_MAX_SOURCE_LOCATION.
1119 Add notes about ad-hoc values.
1120
7ec491c0
MM
11212015-10-21 Mikhail Maltsev <maltsevm@gmail.com>
1122
22d66382
MM
1123 * include/line-map.h: Use CHECKING_P instead of ENABLE_CHECKING.
1124 * init.c: Likewise.
1125 * macro.c (struct macro_arg_token_iter, set_arg_token,
1126 macro_arg_token_iter_init, macro_arg_token_iter_forward,
1127 macro_arg_token_iter_get_token, macro_arg_token_iter_get_location,
1128 alloc_expanded_arg_mem, _cpp_backup_tokens): Likewise.
1129
7ec491c0
MM
1130 * config.in: Regenerate.
1131 * configure: Regenerate.
1132 * configure.ac (CHECKING_P): Define.
1133 * system.h (fancy_abort): Declare.
1134 (abort): Define.
1135 (gcc_assert): Define. Use CHECKING_P.
1136
179b8d05
MM
11372015-10-13 Mikhail Maltsev <maltsevm@gmail.com>
1138
1139 * system.h (CHECKING_P, gcc_checking_assert): Define.
1140
87b470b3
MLI
11412015-09-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
1142
1143 PR c/66415
1144 * line-map.c (linemap_position_for_loc_and_offset): Handle the
1145 case of long lines encoded in multiple maps.
1146
85bc8baa
MP
11472015-09-07 Marek Polacek <polacek@redhat.com>
1148
1149 * system.h (INTTYPE_MINIMUM): Rewrite to avoid shift warning.
1150
bf5372e7
YS
11512015-08-06 Yaakov Selkowitz <yselkowi@redhat.com>
1152
1153 * configure: Regenerate.
1154
d17f7d59
TS
11552015-07-08 Thomas Schwinge <thomas@codesourcery.com>
1156
1157 * include/line-map.h (RESERVED_LOCATION_COUNT): Change type to
1158 source_location.
1159
fbb22910
PC
11602015-07-02 Paolo Carlini <paolo.carlini@oracle.com>
1161
d885793d 1162 PR preprocessor/53690
fbb22910
PC
1163 * charset.c (_cpp_valid_ucn): Add cppchar_t * parameter and change
1164 return type to bool. Fix encoding of \u0000 and \U00000000 in C++.
1165 (convert_ucn): Adjust call.
1166 * lex.c (forms_identifier_p): Likewise.
1167 * internal.h (_cpp_valid_ucn): Adjust declaration.
1168
fe95b036
ESR
11692015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
1170
1171 Implement N4197 - Adding u8 character literals
1172 * include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens;
1173 (struct cpp_options): Add utf8_char_literals.
1174 * init.c (struct lang_flags): Add utf8_char_literals;
1175 (struct lang_flags lang_defaults): Add column for utf8_char_literals.
fbb22910 1176 * macro.c (stringify_arg()): Treat CPP_UTF8CHAR token;
fe95b036
ESR
1177 * expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()):
1178 Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens;
1179 (cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token;
1180 (eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token.
1181 * lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens.
1182 * charset.c (converter_for_type(), cpp_interpret_charconst()):
1183 Treat CPP_UTF8CHAR token.
1184
dc6bcf52
UB
11852015-06-30 Uros Bizjak <ubizjak@gmail.com>
1186
1187 * lex.c (search_line_sse42) [__GCC_ASM_FLAG_OUTPUTS__]: New main
1188 loop using asm flag outputs.
1189
a1661b90
MP
11902015-06-08 Marek Polacek <polacek@redhat.com>
1191
1192 PR c/66415
1193 * line-map.c (linemap_position_for_loc_and_offset): Remove
1194 linemap_assert_fails; reverse conditions.
1195
815facd3
MLI
11962015-05-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
1197
1198 * line-map.c (LINE_MAP_MAX_COLUMN_NUMBER
1199 LINE_MAP_MAX_LOCATION_WITH_COLS,LINE_MAP_MAX_SOURCE_LOCATION):
1200 New constants.
1201 (linemap_line_start): Use them.
1202 (linemap_position_for_column): Use them.
1203
c819ed29
DM
12042015-05-20 David Malcolm <dmalcolm@redhat.com>
1205
1206 * include/line-map.h (MAP_START_LOCATION): Eliminate the non-const
1207 variant, and tweak comment for the const variant.
1208 (ORDINARY_MAP_STARTING_LINE_NUMBER): Drop the non-const variant.
1209 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
1210 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
1211 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
1212 (ORDINARY_MAP_FILE_NAME): Drop the non-const variant.
1213 (MACRO_MAP_MACRO): Likewise.
1214 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
1215 (MACRO_MAP_LOCATIONS): Likewise.
1216 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
1217 * line-map.c (linemap_add): Replace writes through macros with
1218 direct field accesses.
1219 (linemap_enter_macro): Likewise.
1220 (linemap_line_start): Likewise.
1221
0e50b624
DM
12222015-05-19 David Malcolm <dmalcolm@redhat.com>
1223
1224 * directives.c (do_line): Strengthen local "map" from
1225 const line_map * to const line_map_ordinary *.
1226 (do_linemarker): Likewise.
1227 (_cpp_do_file_change): Assert that we're not dealing with
1228 a macro map. Introduce local "ord_map" via a call to
1229 linemap_check_ordinary, guarded within the check for
1230 non-NULL. Use it for typesafety.
1231 * files.c (cpp_make_system_header): Strengthen local "map" from
1232 const line_map * to const line_map_ordinary *.
1233 * include/cpplib.h (struct cpp_callbacks): Likewise for second
1234 parameter of "file_change" callback.
1235 * include/line-map.h (struct line_map): Convert from a struct
1236 containing a union to a base class.
1237 (struct line_map_ordinary): Convert to a subclass of line_map.
1238 (struct line_map_macro): Likewise.
1239 (linemap_check_ordinary): Strengthen return type from line_map *
1240 to line_map_ordinary *, and add a const-variant.
1241 (linemap_check_macro): New pair of functions.
1242 (ORDINARY_MAP_STARTING_LINE_NUMBER): Strengthen param from
1243 const line_map * to const line_map_ordinary *, eliminating call
1244 to linemap_check_ordinary. Likewise for the non-const variant.
1245 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
1246 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
1247 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Likewise.
1248 (ORDINARY_MAP_FILE_NAME): Likewise.
1249 (MACRO_MAP_MACRO): Strengthen param from const line_map * to
1250 const line_map_macro *. Likewise for the non-const variant.
1251 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
1252 (MACRO_MAP_LOCATIONS): Likewise.
1253 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
1254 (struct maps_info): Replace with...
1255 (struct maps_info_ordinary):...this and...
1256 (struct maps_info_macro): ...this.
1257 (struct line_maps): Convert fields "info_ordinary" and
1258 "info_macro" to the above new structs.
1259 (LINEMAPS_MAP_INFO): Delete both functions.
1260 (LINEMAPS_MAPS): Likewise.
1261 (LINEMAPS_ALLOCATED): Rewrite both variants to avoid using
1262 LINEMAPS_MAP_INFO.
1263 (LINEMAPS_USED): Likewise.
1264 (LINEMAPS_CACHE): Likewise.
1265 (LINEMAPS_MAP_AT): Likewise.
1266 (LINEMAPS_ORDINARY_MAPS): Strengthen return type from line_map *
1267 to line_map_ordinary *.
1268 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
1269 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
1270 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
1271 (LINEMAPS_MACRO_MAPS): Strengthen return type from line_map * to
1272 line_map_macro *.
1273 (LINEMAPS_MACRO_MAP_AT): Likewise.
1274 (LINEMAPS_LAST_MACRO_MAP): Likewise.
1275 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
1276 (linemap_map_get_macro_name): Strengthen param from
1277 const line_map * to const line_map_macro *.
1278 (SOURCE_LINE): Strengthen first param from const line_map * to
1279 const line_map_ordinary *, removing call to
1280 linemap_check_ordinary.
1281 (SOURCE_COLUMN): Likewise.
1282 (LAST_SOURCE_LINE_LOCATION): Likewise.
1283 (LAST_SOURCE_LINE): Strengthen first param from const line_map *
1284 to const line_map_ordinary *.
1285 (LAST_SOURCE_COLUMN): Likewise.
1286 (INCLUDED_FROM): Strengthen return type from line_map * to
1287 line_map_ordinary *., and second param from const line_map *
1288 to const line_map_ordinary *, removing call to
1289 linemap_check_ordinary.
1290 (MAIN_FILE_P): Strengthen param from const line_map * to
1291 const line_map_ordinary *, removing call to
1292 linemap_check_ordinary.
1293 (linemap_position_for_line_and_column): Strengthen param from
1294 const line_map * to const line_map_ordinary *.
1295 (LINEMAP_FILE): Strengthen param from const line_map * to
1296 const line_map_ordinary *, removing call to
1297 linemap_check_ordinary.
1298 (LINEMAP_LINE): Likewise.
1299 (LINEMAP_SYSP): Likewise.
1300 (linemap_resolve_location): Strengthen final param from
1301 const line_map ** to const line_map_ordinary **.
1302 * internal.h (CPP_INCREMENT_LINE): Likewise for local "map".
1303 (linemap_enter_macro): Strengthen return type from
1304 const line_map * to const line_map_macro *.
1305 (linemap_add_macro_token): Likewise for first param.
1306 * line-map.c (linemap_check_files_exited): Strengthen local "map"
1307 from const line_map * to const line_map_ordinary *.
1308 (new_linemap): Introduce local "map_size" and use it when
1309 calculating how large the buffer should be. Rewrite based
1310 on change of info_macro and info_ordinary into distinct types.
1311 (linemap_add): Strengthen locals "map" and "from" from line_map *
1312 to line_map_ordinary *.
1313 (linemap_enter_macro): Strengthen return type from
1314 const line_map * to const line_map_macro *, and local "map" from
1315 line_map * to line_map_macro *.
1316 (linemap_add_macro_token): Strengthen param "map" from
1317 const line_map * to const line_map_macro *.
1318 (linemap_line_start): Strengthen local "map" from line_map * to
1319 line_map_ordinary *.
1320 (linemap_position_for_column): Likewise.
1321 (linemap_position_for_line_and_column): Strengthen first param
1322 from const line_map * to const line_map_ordinary *.
1323 (linemap_position_for_loc_and_offset): Strengthen local "map" from
1324 const line_map * to const line_map_ordinary *.
1325 (linemap_ordinary_map_lookup): Likewise for return type and locals
1326 "cached" and "result".
1327 (linemap_macro_map_lookup): Strengthen return type and locals
1328 "cached" and "result" from const line_map * to
1329 const line_map_macro *.
1330 (linemap_macro_map_loc_to_exp_point): Likewise for param "map".
1331 (linemap_macro_map_loc_to_def_point): Likewise.
1332 (linemap_macro_map_loc_unwind_toward_spelling): Likewise.
1333 (linemap_get_expansion_line): Strengthen local "map" from
1334 const line_map * to const line_map_ordinary *.
1335 (linemap_get_expansion_filename): Likewise.
1336 (linemap_map_get_macro_name): Strengthen param from
1337 const line_map * to const line_map_macro *.
1338 (linemap_location_in_system_header_p): Add call to
1339 linemap_check_ordinary in region guarded by
1340 !linemap_macro_expansion_map_p. Introduce local "macro_map" via
1341 linemap_check_macro in other region, using it in place of "map"
1342 for typesafety.
1343 (first_map_in_common_1): Add calls to linemap_check_macro.
1344 (trace_include): Strengthen param "map" from const line_map * to
1345 const line_map_ordinary *.
1346 (linemap_macro_loc_to_spelling_point): Strengthen final param from
1347 const line_map ** to const line_map_ordinary **. Replace a
1348 C-style cast with a const_cast, and add calls to
1349 linemap_check_macro and linemap_check_ordinary.
1350 (linemap_macro_loc_to_def_point): Likewise.
1351 (linemap_macro_loc_to_exp_point): Likewise.
1352 (linemap_resolve_location): Strengthen final param from
1353 const line_map ** to const line_map_ordinary **.
1354 (linemap_unwind_toward_expansion): Introduce local "macro_map" via
1355 a checked cast and use it in place of *map.
1356 (linemap_unwind_to_first_non_reserved_loc): Strengthen local
1357 "map1" from const line_map * to const line_map_ordinary *.
1358 (linemap_expand_location): Introduce local "ord_map" via a checked
1359 cast and use it in place of map.
1360 (linemap_dump): Make local "map" const. Strengthen local
1361 "includer_map" from line_map * to const line_map_ordinary *.
1362 Introduce locals "ord_map" and "macro_map" via checked casts and
1363 use them in place of "map" for typesafety.
1364 (linemap_dump_location): Strengthen local "map" from
1365 const line_map * to const line_map_ordinary *.
1366 (linemap_get_file_highest_location): Update for elimination of
1367 union.
1368 (linemap_get_statistics): Strengthen local "cur_map" from
1369 line_map * to const line_map_macro *. Update uses of sizeof to
1370 use the appropriate line_map subclasses.
1371 * macro.c (_cpp_warn_if_unused_macro): Add call to
1372 linemap_check_ordinary.
1373 (builtin_macro): Strengthen local "map" from const line_map * to
1374 const line_map_macro *.
1375 (enter_macro_context): Likewise.
1376 (replace_args): Likewise.
1377 (tokens_buff_put_token_to): Likewise for param "map".
1378 (tokens_buff_add_token): Likewise.
1379
ba4ad400
DM
13802015-05-13 David Malcolm <dmalcolm@redhat.com>
1381
1382 * include/line-map.h (source_location): Add a reference to
1383 location-example.txt to the descriptive comment.
1384 * location-example.txt: New file.
1385
0501dbd9
DM
13862015-05-13 David Malcolm <dmalcolm@redhat.com>
1387
1388 * include/line-map.h (MAX_SOURCE_LOCATION): Convert from a macro
1389 to a const source_location.
1390 (RESERVED_LOCATION_COUNT): Likewise.
1391 (linemap_check_ordinary): Convert from a macro to a pair of inline
1392 functions, for const/non-const arguments.
1393 (MAP_START_LOCATION): Likewise.
1394 (ORDINARY_MAP_STARTING_LINE_NUMBER): Likewise.
1395 (ORDINARY_MAP_INCLUDER_FILE_INDEX): Likewise.
1396 (ORDINARY_MAP_IN_SYSTEM_HEADER_P): Likewise.
1397 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Convert from a macro to a
1398 pair of inline functions, for const/non-const arguments, where the
1399 latter is named...
1400 (SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): New function.
1401 (ORDINARY_MAP_FILE_NAME): Convert from a macro to a pair of inline
1402 functions, for const/non-const arguments.
1403 (MACRO_MAP_MACRO): Likewise.
1404 (MACRO_MAP_NUM_MACRO_TOKENS): Likewise.
1405 (MACRO_MAP_LOCATIONS): Likewise.
1406 (MACRO_MAP_EXPANSION_POINT_LOCATION): Likewise.
1407 (LINEMAPS_MAP_INFO): Likewise.
1408 (LINEMAPS_MAPS): Likewise.
1409 (LINEMAPS_ALLOCATED): Likewise.
1410 (LINEMAPS_USED): Likewise.
1411 (LINEMAPS_CACHE): Likewise.
1412 (LINEMAPS_ORDINARY_CACHE): Likewise.
1413 (LINEMAPS_MACRO_CACHE): Likewise.
1414 (LINEMAPS_MAP_AT): Convert from a macro to an inline function.
1415 (LINEMAPS_LAST_MAP): Likewise.
1416 (LINEMAPS_LAST_ALLOCATED_MAP): Likewise.
1417 (LINEMAPS_ORDINARY_MAPS): Likewise.
1418 (LINEMAPS_ORDINARY_MAP_AT): Likewise.
1419 (LINEMAPS_ORDINARY_ALLOCATED): Likewise.
1420 (LINEMAPS_ORDINARY_USED): Likewise.
1421 (LINEMAPS_LAST_ORDINARY_MAP): Likewise.
1422 (LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP): Likewise.
1423 (LINEMAPS_MACRO_MAPS): Likewise.
1424 (LINEMAPS_MACRO_MAP_AT): Likewise.
1425 (LINEMAPS_MACRO_ALLOCATED): Likewise.
1426 (LINEMAPS_MACRO_USED): Likewise.
1427 (LINEMAPS_MACRO_LOWEST_LOCATION): Likewise.
1428 (LINEMAPS_LAST_MACRO_MAP): Likewise.
1429 (LINEMAPS_LAST_ALLOCATED_MACRO_MAP): Likewise.
1430 (IS_ADHOC_LOC): Likewise.
1431 (COMBINE_LOCATION_DATA): Likewise.
1432 (SOURCE_LINE): Likewise.
1433 (SOURCE_COLUMN): Likewise.
1434 (LAST_SOURCE_LINE_LOCATION): Likewise.
1435 (LAST_SOURCE_LINE): Likewise.
1436 (LAST_SOURCE_COLUMN): Likewise.
1437 (LAST_SOURCE_LINE_LOCATION)
1438 (INCLUDED_FROM): Likewise.
1439 (MAIN_FILE_P): Likewise.
1440 (LINEMAP_FILE): Likewise.
1441 (LINEMAP_LINE): Likewise.
1442 (LINEMAP_SYSP): Likewise.
1443 (linemap_location_before_p): Likewise.
1444 * line-map.c (linemap_check_files_exited): Make local "map" const.
1445 (linemap_add): Use SET_ORDINARY_MAP_NUMBER_OF_COLUMN_BITS.
1446 (linemap_line_start): Likewise.
1447
eb70f327
MH
14482015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
1449
1450 * aclocal.m4: Regenerated with automake-1.11.6.
1451
60c12095
DM
14522015-05-13 David Malcolm <dmalcolm@redhat.com>
1453
1454 * include/line-map.h (linemap_assert): Move up within the file to
1455 before all of the map accessor macros.
1456 (linemap_assert_fails): Likewise.
1457 (linemap_check_ordinary): Likewise.
1458 (linemap_macro_expansion_map_p): Likewise.
1459
c3388e62
DM
14602015-05-12 David Malcolm <dmalcolm@redhat.com>
1461
1462 * directives.c (do_line): Set seen_line_directive on line_table.
1463 (do_linemarker): Likewise.
1464 * include/line-map.h (struct line_maps): Add new field
1465 "seen_line_directive".
1466
fe191308
JM
14672015-05-08 Jason Merrill <jason@redhat.com>
1468
1469 * include/cpplib.h: Add CPP_W_CXX11_COMPAT.
1470 (struct cpp_options): Add cpp_warn_cxx11_compat.
1471 * init.c (cpp_create_reader): Initialize it.
1472 * lex.c (lex_string): Add -Wc++11-compat warning.
1473
21c0a521
DM
14742015-05-05 David Malcolm <dmalcolm@redhat.com>
1475
1476 * pch.c (cpp_valid_state): Fix indentation so that it reflects the
1477 block structure.
1478
c87b25e6
DM
14792015-05-05 David Malcolm <dmalcolm@redhat.com>
1480
1481 * include/line-map.h: Fix comment at the top of the file.
1482 (source_location): Rewrite and expand the comment for this
1483 typedef, adding an ascii-art table to clarify how source_location
1484 values are allocated.
1485 * line-map.c: Fix comment at the top of the file.
1486
ca708025
RB
14872015-04-09 Richard Biener <rguenther@suse.de>
1488
1489 PR pch/65550
1490 * files.c (pch_open_file): Allow main and pre-included files
1491 when trying to open a PCH.
1492
e4b33ee5
JJ
14932015-04-06 Jakub Jelinek <jakub@redhat.com>
1494
1495 PR preprocessor/61977
1496 * lex.c (cpp_peek_token): If peektok is CPP_EOF, back it up
1497 with all tokens peeked by the current function.
1498
b8cd77f4
JJ
14992015-04-02 Jakub Jelinek <jakub@redhat.com>
1500
1501 PR preprocessor/61977
1502 * lex.c (cpp_peek_token): Temporarily clear pfile->cb.line_change.
1503
fb136e35
JJ
15042015-03-23 Jakub Jelinek <jakub@redhat.com>
1505
1506 PR preprocessor/65238
1507 * internal.h (_cpp_scan_out_logical_line): Add third argument.
1508 * directives.c (prepare_directive_trad): Pass false to it.
1509 * traditional.c (_cpp_read_logical_line_trad,
1510 _cpp_create_trad_definition): Likewise.
1511 (struct fun_macro): Add paramc field.
1512 (fun_like_macro): New function.
1513 (maybe_start_funlike): Handle NODE_BUILTIN macros. Initialize
1514 macro->paramc field.
1515 (save_argument): Use macro->paramc instead of
1516 macro->node->value.macro->paramc.
1517 (push_replacement_text): Formatting fix.
1518 (recursive_macro): Use fun_like_macro helper.
1519 (_cpp_scan_out_logical_line): Likewise. Add BUILTIN_MACRO_ARG
1520 argument. Initialize fmacro.paramc field. Handle builtin
1521 function-like macros.
1522
a5858a3d
ESR
15232015-03-16 Edward Smith-Rowland <3dw4rd@verizon.net>
1524
1525 PR c++/64626
1526 * lex.c (lex_number): If a number ends with digit-seps (') skip back
1527 and let lex_string take them.
1528
44d95244
MT
15292015-03-02 Markus Trippelsdorf <markus@trippelsdorf.de>
1530
1531 PR target/65261
1532 * lex.c (search_line_fast): Silence ubsan errors.
1533
f8abc9ba
DS
15342015-02-03 <dodji@redhat.com>
1535
1536 PR preprocessor/64803
1537 * internal.h (cpp_reader::top_most_macro_node): New data member.
1538 * macro.c (enter_macro_context): Pass the location of the end of
1539 the top-most invocation of the function-like macro, or the
1540 location of the expansion point of the top-most object-like macro.
1541 (cpp_get_token_1): Store the top-most macro node in the new
1542 pfile->top_most_macro_node data member.
1543 (_cpp_pop_context): Clear the new cpp_reader::top_most_macro_node
1544 data member.
1545
95d0610c
SN
15462015-01-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
1547
1548 * lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON.
1549
10ef8f28
MP
15502015-01-23 Marek Polacek <polacek@redhat.com>
1551
1552 DR#412
1553 PR preprocessor/60570
1554 * directives.c (do_elif): Don't evaluate #elif conditionals
1555 when they don't need to be.
1556
6e6cb471
JJ
15572015-01-16 Jakub Jelinek <jakub@redhat.com>
1558
1559 * expr.c (cpp_classify_number): Add N_() around ?: string
1560 literals used in cpp_error_with_line call as format string.
1561
5624e564
JJ
15622015-01-05 Jakub Jelinek <jakub@redhat.com>
1563
1564 Update copyright years.
1565
1f8d3e84
JJ
15662014-12-19 Jakub Jelinek <jakub@redhat.com>
1567
1568 PR preprocessor/63831
1569 * directives.c (lex_macro_node): Remove __has_attribute__ handling.
1570 * internal.h (struct spec_node): Remove n__has_attribute__ field.
1571 (struct lexer_state): Remove in__has_attribute__ field.
1572 * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_ATTRIBUTE.
1573 * identifiers.c (_cpp_init_hashtable): Remove __has_attribute__
1574 handling.
1575 * init.c (builtin_array): Add __has_attribute and __has_cpp_attribute.
1576 (cpp_init_special_builtins): Don't initialize __has_attribute
1577 or __has_cpp_attribute if CLK_ASM or pfile->cb.has_attribute is NULL.
1578 * traditional.c (enum ls): Remove ls_has_attribute,
1579 ls_has_attribute_close.
1580 (_cpp_scan_out_logical_line): Remove __has_attribute__ handling.
1581 * include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_ATTRIBUTE.
1582 * pch.c (cpp_read_state): Remove __has_attribute__ handling.
1583 * expr.c (eval_token): Likewise.
1584 (parse_has_attribute): Removed.
1585
01ca36af
UB
15862014-12-11 Uros Bizjak <ubizjak@gmail.com>
1587
1588 * directives.c (cpp_define_formatted): Use xvasprintf.
1589
b93c0722
MLI
15902014-12-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
1591
1592 * line-map.c (linemap_position_for_loc_and_offset): Add new
1593 linemap_assert_fails.
1594
73bd8329
MLI
15952014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
1596
1597 * include/line-map.h (linemap_assert_fails): Declare.
1598 * line-map.c (linemap_position_for_loc_and_offset): Use it.
1599
9c320ab1
MLI
16002014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
1601
49445904
UB
1602 * line-map.c (linemap_add): Fix typo.
1603 (linemap_line_start): Fix whitespace.
9c320ab1 1604
81fee4a7
JM
16052014-11-29 John Schmerge <jbschmerge@gmail.com>
1606
1607 PR preprocessor/41698
1608 * charset.c (one_utf8_to_utf16): Do not produce surrogate pairs
1609 for 0xffff.
1610
43ba1c6c
JJ
16112014-11-25 Jakub Jelinek <jakub@redhat.com>
1612
1613 PR preprocessor/60436
1614 * line-map.c (linemap_line_start): If highest is above 0x60000000
1615 and we are still tracking columns or highest is above 0x70000000,
1616 force add_map.
1617
8a23b100
UB
16182014-11-20 Uros Bizjak <ubizjak@gmail.com>
1619
1620 PR target/63966
1b6b13f3
UB
1621 * lex.c [__i386__ || __x86_64__]: Compile special SSE functions
1622 only for (__GNUC__ >= 5 || !defined(__PIC__)).
8a23b100 1623
d82f1e13
MLI
16242014-11-13 Manuel López-Ibáñez <manu@gcc.gnu.org>
1625
1626 * include/line-map.h: Include EXPR, so that unused variable warnings
1627 do not occur.
1628
3aa34c1d
MLI
16292014-11-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
1630
1631 PR fortran/44054
1632 * include/line-map.h (linemap_position_for_loc_and_offset):
1633 Declare.
1634 * line-map.c (linemap_position_for_loc_and_offset): New.
1635
35485da9
DM
16362014-11-11 David Malcolm <dmalcolm@redhat.com>
1637
1638 * ChangeLog.jit: New.
1639
42fd12b1
ESR
16402014-11-10 Edward Smith-Rowland <3dw4rd@verizon.net>
1641
1642 * include/cpplib.h (cpp_callbacks): Add has_attribute.
1643 * internal.h (lexer_state): Add in__has_attribute__.
1644 * directives.c (lex_macro_node): Prevent use of __has_attribute__
1645 as a macro.
1646 * expr.c (parse_has_attribute): New function; (eval_token): Look for
1647 __has_attribute__ and route to parse_has_attribute.
1648 * identifiers.c (_cpp_init_hashtable): Initialize n__has_attribute__.
1649 * pch.c (cpp_read_state): Initialize n__has_attribute__.
1650 * traditional.c (enum ls): Add ls_has_attribute, ls_has_attribute_close;
1651 (_cpp_scan_out_logical_line): Attend to __has_attribute__.
1652
be5ffc59
JM
16532014-11-06 Joseph Myers <joseph@codesourcery.com>
1654
1655 * include/cpp-id-data.h (struct cpp_macro): Update comment
1656 regarding parameters.
1657 * include/cpplib.h (struct cpp_macro_arg, struct cpp_identifier):
1658 Add spelling fields.
1659 (struct cpp_token): Update comment on macro_arg.
1660 * internal.h (_cpp_save_parameter): Add extra argument.
1661 (_cpp_spell_ident_ucns): New declaration.
1662 * lex.c (lex_identifier): Add SPELLING argument. Set *SPELLING to
1663 original spelling of identifier.
1664 (_cpp_lex_direct): Update calls to lex_identifier.
1665 (_cpp_spell_ident_ucns): New function, factored out of
1666 cpp_spell_token.
1667 (cpp_spell_token): Adjust FORSTRING argument semantics to return
1668 original spelling of identifiers. Use _cpp_spell_ident_ucns in
1669 !FORSTRING case.
1670 (_cpp_equiv_tokens): Check spellings of identifiers and macro
1671 arguments are identical.
1672 * macro.c (macro_arg_saved_data): New structure.
1673 (paste_tokens): Use original spellings of identifiers from
1674 cpp_spell_token.
1675 (_cpp_save_parameter): Add argument SPELLING. Save both canonical
1676 node and its value.
1677 (parse_params): Update calls to _cpp_save_parameter.
1678 (lex_expansion_token): Save spelling of macro argument tokens.
1679 (_cpp_create_definition): Extract canonical node from saved data.
1680 (cpp_macro_definition): Use UCNs in spelling of macro name. Use
1681 original spellings of macro argument tokens and identifiers.
1682 * traditional.c (scan_parameters): Update call to
1683 _cpp_save_parameter.
1684
701cade1
JM
16852014-11-05 Joseph Myers <joseph@codesourcery.com>
1686
1687 PR preprocessor/9449
1688 * init.c (lang_defaults): Enable extended identifiers for C++ and
1689 C99-based standards.
1690
19a9ba64
AM
16912014-10-22 Alan Modra <amodra@gmail.com>
1692
1693 * symtab.c (ht_create): Use obstack_specify_allocation in place of
1694 _obstack_begin.
1695 * files.c (_cpp_init_files): Likewise.
1696 * init.c (cpp_create_reader): Likewise.
1697 * identifiers.c (_cpp_init_hashtable): Likewise.
1698
3aac0952
MLI
16992014-10-14 Manuel López-Ibáñez <manu@gcc.gnu.org>
1700
1701 * include/line-map.h (linemap_location_from_macro_expansion_p):
1702 const struct line_maps * argument.
1703 (linemap_position_for_line_and_column): const struct line_map *
1704 argument.
1705 * line-map.c (linemap_add_macro_token): Use correct argument name
1706 in comment.
1707 (linemap_position_for_line_and_column): const struct line_map *
1708 argument.
1709 (linemap_macro_map_loc_to_def_point): Fix comment. Make static.
1710 (linemap_location_from_macro_expansion_p): const struct line_maps *
1711 argument.
1712 (linemap_resolve_location): Fix argument names in comment.
1713
0ccaaab0
BS
17142014-10-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
1715
1716 * lex.c (search_line_fast): Add new version to be used for Power8
1717 and later targets when Altivec is enabled. Restrict the existing
1718 Altivec version to big-endian systems so that lvsr is not used on
1719 little endian, where it is deprecated. Remove LE-specific code
1720 from the now-BE-only version.
1721
dc257367
BE
17222014-10-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
1723 Jeff Law <law@redhat.com>
1724
1725 * charset.c (convert_no_conversion): Reallocate memory with 25%
1726 headroom.
1727
a15f7cb8
ESR
17282014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net>
1729
1730 Implement SD-6: SG10 Feature Test Recommendations
1731 * internal.h (lexer_state, spec_nodes): Add in__has_include__.
1732 * directives.c: Support __has_include__ builtin.
1733 * expr.c (parse_has_include): New function to parse __has_include__
1734 builtin; (eval_token()): Use it.
1735 * files.c (_cpp_has_header()): New funtion to look for header;
1736 (open_file_failed()): Not an error to not find a header file for
1737 __has_include__.
1738 * identifiers.c (_cpp_init_hashtable()): Add entry for __has_include__.
1739 * pch.c (cpp_read_state): Lookup __has_include__.
1740 * traditional.c (enum ls, _cpp_scan_out_logical_line()): Walk through
1741 __has_include__ statements.
1742
cc811a8a
BE
17432014-09-30 Bernd Edlinger <bernd.edlinger@hotmail.de>
1744
1745 PR preprocessor/58893
1746 * errors.c (cpp_diagnostic): Fix possible out of bounds access.
1747 * files.c (_cpp_stack_include): Initialize src_loc for IT_CMDLINE.
1748
083e891e
MP
17492014-09-24 Marek Polacek <polacek@redhat.com>
1750
1751 PR c/61405
1752 PR c/53874
1753 * include/cpplib.h (enum cpp_ttype): Define CPP_KEYWORD.
1754
d87fc699
JH
17552014-09-17 Jan Hubicka <hubicka@ucw.cz>
1756
1757 * charset.c (conversion): Rename to ...
1758 (cpp_conversion): ... this one; update.
1759 * files.c (file_hash_entry): Rename to ...
1760 (cpp_file_hash_entry): ... this one ; update.
1761
909eb89c
MP
17622014-09-17 Marek Polacek <polacek@redhat.com>
1763
1764 PR c/61854
1765 * init.c (struct lang_flags): Remove cplusplus_comments.
1766 (cpp_set_lang): Likewise.
1767 (post_options): Likewise.
1768 * lex.c (_cpp_lex_direct): Disallow C++ style comments in C90/C94.
1769
1ef33fd4
MLI
17702014-09-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
1771
1772 * include/cpplib.h (struct cpp_options): Declare warn_normalize as
1773 int instead of enum.
1774
2b71f4a4
MLI
17752014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
1776
1777 * macro.c (replace_args): Use cpp_pedwarning, cpp_warning and
1778 CPP_W flags.
1779 * include/cpplib.h: Add CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC.
1780 * init.c (cpp_create_reader): Do not init to -1 here.
1781 * expr.c (num_binary_op): Use cpp_pedwarning.
1782
81b5d104
MLI
17832014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
1784
1785 * directives.c (check_eol_1): New.
1786 (check_eol_endif_labels): New.
1787 (check_eol): Call check_eol_1.
1788 (do_else,do_endif): Call check_eol_endif_labels.
1789
b753b37b
MLI
17902014-08-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
1791
1792 * macro.c (warn_of_redefinition): Suppress warnings for builtins
1793 that lack the NODE_WARN flag, unless Wbuiltin-macro-redefined.
1794 (_cpp_create_definition): Use Wbuiltin-macro-redefined for
1795 builtins that lack the NODE_WARN flag.
1796 * directives.c (do_undef): Likewise.
1797 * init.c (cpp_init_special_builtins): Do not change flags
1798 depending on Wbuiltin-macro-redefined.
1799
7c05e50c
ESR
18002014-08-28 Edward Smith-Rowland <3dw4rd@verizon.net>
1801
1802 PR cpp/23827 - standard C++ should not have hex float preprocessor
1803 tokens
1804 * libcpp/init.c (lang_flags): Change CXX98 flag for extended numbers
1805 from 1 to 0.
1806 * libcpp/expr.c (cpp_classify_number): Weite error message for improper
1807 use of hex floating literal.
1808
e4276ba5
ESR
18092014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
1810
1811 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z;
1812 Rename CLK_GNUCXX1Y, CLK_CXX1Y to CLK_GNUCXX14, CLK_CXX14;
1813 * init.c (struct lang_flags lang_defaults): Add column for trigraphs;
1814 Add rows for CLK_GNUCXX1Z, CLK_CXX1Z; (cpp_set_lang): Set trigraphs;
1815 (cpp_init_builtins): Set __cplusplus to 201402L for C++14;
1816 Set __cplusplus to 201500L for C++17.
1817 * expr.c (cpp_classify_number): Change C++1y to C++14 in binary
1818 constants error message.
1819
dd3ff077
MP
18202014-08-20 Marek Polacek <polacek@redhat.com>
1821
1822 * include/cpplib.h (cpp_options): Use signed char.
1823 * lex.c (_cpp_lex_direct): Don't warn in C++ mode.
1824
3f4f5c9a
MP
18252014-08-19 Marek Polacek <polacek@redhat.com>
1826
1827 * lex.c (_cpp_lex_direct): Fix a typo.
1828
177cce46
MP
18292014-08-19 Marek Polacek <polacek@redhat.com>
1830
1831 * charset.c (_cpp_valid_ucn): Warn only if -Wc90-c99-compat.
1832 * lex.c (_cpp_lex_direct): Likewise.
1833 * macro.c (replace_args): Likewise.
1834 (parse_params): Likewise.
1835 * include/cpplib.h (cpp_options): Change cpp_warn_c90_c99_compat
1836 to char.
1837
f3bede71
MP
18382014-08-10 Marek Polacek <polacek@redhat.com>
1839
1840 PR c/51849
1841 * lex.c (_cpp_lex_direct): Warn when -Wc90-c99-compat is in effect.
1842 * charset.c (_cpp_valid_ucn): Likewise.
1843 * include/cpplib.h (cpp_options): Add cpp_warn_c90_c99_compat.
1844 * macro.c (replace_args): Warn when -Wc90-c99-compat is in effect.
1845 (parse_params): Likewise.
1846
61eb99f6
MP
18472014-07-27 Marek Polacek <polacek@redhat.com>
1848
1849 PR c/61861
1850 * macro.c (builtin_macro): Add location parameter. Set
1851 location of builtin macro to the expansion point.
1852 (enter_macro_context): Pass location to builtin_macro.
1853
c468587a
DS
18542014-07-16 Dodji Seketeli <dodji@redhat.com>
1855
1856 Support location tracking for built-in macro tokens
1857 * include/line-map.h (line_maps::builtin_location): New data
1858 member.
1859 (line_map_init): Add a new parameter to initialize the new
1860 line_maps::builtin_location data member.
1861 * line-map.c (linemap_init): Initialize the
1862 line_maps::builtin_location data member.
1863 * macro.c (builtin_macro): Create a macro map and track the token
1864 resulting from the expansion of a built-in macro.
1865
3976796b
ESR
18662014-07-10 Edward Smith-Rowland <3dw4rd@verizon.net>
1867 Jonathan Wakely <jwakely@redhat.com>
1868
c786fca6 1869 PR preprocessor/61389
3976796b
ESR
1870 * macro.c (_cpp_arguments_ok, parse_params, create_iso_definition):
1871 Warning messages mention C++11 in c++ mode and C99 in c mode.
1872 * lex.c (lex_identifier_intern, lex_identifier): Ditto
1873
7aee8646
ESR
18742014-07-09 Edward Smith-Rowland <3dw4rd@verizon.net>
1875
1876 PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped
1877 by preprocessor
1878 * lex.c (lex_raw_string ()): Do not warn about invalid suffix
1879 if skipping. (lex_string ()): Ditto.
1880
98ba7482
ESR
18812014-06-04 Edward Smith-Rowland <3dw4rd@verizon.net>
1882
1883 PR c++/61038
1884 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
1885 Combine user-defined escape logic with the other string and char logic.
1886
edf6ddf6
RB
18872014-05-26 Richard Biener <rguenther@suse.de>
1888
1889 * configure.ac: Remove long long and __int64 type checks,
1890 add check for uint64_t and fail if that wasn't found.
1891 * include/cpplib.h (cpp_num_part): Use uint64_t.
1892 * config.in: Regenerate.
1893 * configure: Likewise.
1894
28939589
MP
18952014-05-21 Marek Polacek <polacek@redhat.com>
1896
1897 PR c/61212
1898 * files.c (find_file_in_dir): Add parens around &&.
1899
49039169
ESR
19002014-05-20 Edward Smith-Rowland <3dw4rd@verizon.net>
1901
28939589 1902 PR c++/61038
49039169
ESR
1903 * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
1904 Check for user-defined literal strings and user-defined literal chars
1905 to escape necessary characters.
1906
54da09ee
RB
19072014-05-20 Richard Biener <rguenther@suse.de>
1908
1909 * configure.ac: Copy gcc logic of detecting a 64bit type.
1910 Remove HOST_WIDE_INT define.
1911 * include/cpplib.h: typedef cpp_num_part to a 64bit type,
1912 similar to how hwint.h does it.
1913 * config.in: Regenerate.
1914 * configure: Likewise.
1915
eac3e079
JY
19162014-05-09 Joey Ye <joey.ye@arm.com>
1917
1918 * files.c (find_file_in_dir): Always try to shorten for DOS
1919 non-system headers.
1920 * init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS.
1921
f543058d
RB
19222014-05-07 Richard Biener <rguenther@suse.de>
1923
1924 * configure.ac: Always set need_64bit_hwint to yes.
1925 * configure: Regenerated.
1926
d9f069ab
RO
19272014-04-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1928
1929 * lex.c: Remove Solaris 9 reference.
1930
341c653c
WL
19312014-02-24 Walter Lee <walt@tilera.com>
1932
1933 * configure.ac: Change "tilepro" triplet to "tilepro*".
1934 * configure: Regenerate.
1935
179652df
JJ
19362014-02-19 Jakub Jelinek <jakub@redhat.com>
1937
1938 PR preprocessor/58844
1939 * macro.c (enter_macro_context): Only push
1940 macro_real_token_count (macro) tokens rather than
1941 macro->count tokens, regardless of
1942 CPP_OPTION (pfile, track-macro-expansion).
1943
acf601ae
JJ
19442014-02-07 Jakub Jelinek <jakub@redhat.com>
1945
1946 PR preprocessor/56824
1947 * line-map.c (get_combined_adhoc_loc, linemap_get_expansion_line,
1948 linemap_get_expansion_filename, linemap_location_in_system_header_p,
1949 linemap_location_from_macro_expansion_p,
1950 linemap_macro_loc_to_spelling_point, linemap_macro_loc_to_def_point,
1951 linemap_macro_loc_to_exp_point, linemap_expand_location): Fix
1952 formatting.
1953 (linemap_compare_locations): Look through adhoc locations for both
1954 l0 and l1.
1955
7ecc3eb9
DS
19562014-01-23 Dodji Seketeli <dodji@redhat.com>
1957
1958 PR PR preprocessor/58580
1959 * include/line-map.h (linemap_get_file_highest_location): Declare
1960 new function.
1961 * line-map.c (linemap_get_file_highest_location): Define it.
1962
35c3d610
RS
19632014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
1964
1965 Update copyright years
1966
3a4efce7
JM
19672013-12-09 Joseph Myers <joseph@codesourcery.com>
1968
1969 PR preprocessor/55715
1970 * expr.c (num_binary_op): Implement subtraction directly rather
1971 than with negation and falling through into addition case.
1972
aadce585
BS
19732013-11-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
1974
1975 * lex.c (search_line_fast): Correct for little endian.
1976
d3f4ff8b
JM
19772013-11-15 Joseph Myers <joseph@codesourcery.com>
1978
1979 * ucnid.tab: Add C11 and C11NOSTART data.
1980 * makeucnid.c (digit): Rename enum value to N99.
1981 (C11, N11, all_languages): New enum values.
1982 (NUM_CODE_POINTS, MAX_CODE_POINT): New macros.
1983 (flags, decomp, combining_value): Use NUM_CODE_POINTS as array
1984 size.
1985 (decomp): Use unsigned int as element type.
1986 (all_decomp): New array.
1987 (read_ucnid): Handle C11 and C11NOSTART. Use MAX_CODE_POINT.
1988 (read_table): Use MAX_CODE_POINT. Store all decompositions in
1989 all_decomp.
1990 (read_derived): Use MAX_CODE_POINT.
1991 (write_table): Use NUM_CODE_POINTS. Print N99, C11 and N11
1992 flags. Print whole array variable declaration rather than just
1993 array contents.
1994 (char_id_valid, write_context_switch): New functions.
1995 (main): Call write_context_switch.
1996 * ucnid.h: Regenerate.
1997 * include/cpplib.h (struct cpp_options): Add c11_identifiers.
1998 * init.c (struct lang_flags): Add c11_identifiers.
1999 (cpp_set_lang): Set c11_identifiers option from selected language.
2000 * internal.h (struct normalize_state): Document "previous" as
2001 previous starter character.
2002 (NORMALIZE_STATE_UPDATE_IDNUM): Take character as argument.
2003 * charset.c (DIG): Rename enum value to N99.
2004 (C11, N11): New enum values.
2005 (struct ucnrange): Give name to struct. Use short for flags and
2006 unsigned int for end of range. Include ucnid.h for whole variable
2007 declaration.
2008 (ucn_valid_in_identifier): Allow for characters up to 0x10FFFF.
2009 Allow for C11 in determining valid characters and valid start
2010 characters. Use check_nfc for non-Hangul context-dependent
2011 checks. Only store starter characters in nst->previous.
2012 (_cpp_valid_ucn): Pass new argument to
2013 NORMALIZE_STATE_UPDATE_IDNUM.
2014 * lex.c (lex_identifier): Pass new argument to
2015 NORMALIZE_STATE_UPDATE_IDNUM. Call NORMALIZE_STATE_UPDATE_IDNUM
2016 after initial non-UCN part of identifier.
2017 (lex_number): Pass new argument to NORMALIZE_STATE_UPDATE_IDNUM.
2018
54848ff8
JM
20192013-11-15 Joseph Myers <joseph@codesourcery.com>
2020
2021 * ucnid.tab: Mark C99 digits as [C99DIG].
2022 * makeucnid.c (read_ucnid): Handle [C99DIG].
2023 (read_table): Don't check for digit characters.
2024 * ucnid.h: Regenerate.
2025
5157b91e
TB
20262013-11-06 Tobias Burnus <burnus@net-b.de>
2027
2028 * macro.c (_cpp_builtin_macro_text): Correct
2029 wording of two warnings.
2030
e8ff5196
TB
20312013-11-05 Tobias Burnus <burnus@net-b.de>
2032
2033 * include/cpplib.h (CPP_W_DATE_TIME): Added.
2034 (cpp_options): Add warn_date_time.
2035 * init.c (cpp_create_reader): Init it.
2036 * macro.c (_cpp_builtin_macro_text): Warn when
2037 __DATE__/__TIME__/__TIMESTAMP__ is used.
2038
7057e645
ESR
20392013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
2040
e8ff5196 2041 Implement C++14 digit separators.
7057e645
ESR
2042 * include/cpplib.h (cpp_options): Add digit_separators flag.
2043 * internal.h (DIGIT_SEP(c)): New macro.
2044 * expr.c (cpp_classify_number): Check improper placement of digit sep;
2045 (cpp_interpret_integer): Skip over digit separators.
2046 * init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add
2047 digit separator flags per language; (cpp_set_lang): Set
2048 digit_separators
2049 * lex.c (lex_number): Add digits separator to allowable characters for
2050 C++14.
2051
459260ec
DM
20522013-10-15 David Malcolm <dmalcolm@redhat.com>
2053
2054 * Makefile.in (PICFLAG): New.
2055 (ALL_CFLAGS): Add PICFLAG.
2056 (ALL_CXXFLAGS): Likewise.
2057 * configure.ac: Add --enable-host-shared, setting up new
2058 PICFLAG variable.
2059 * configure: Regenerate.
2060
fd6eea0c
RE
20612013-08-07 Richard Earnshaw <rearnsha@arm.com>
2062
2063 * configure.ac: Set need_64bit_hwint for all arm targets.
2064 * configure: Regenerated.
2065
8cf88735
JJ
20662013-07-20 Jakub Jelinek <jakub@redhat.com>
2067
2068 PR preprocessor/57620
2069 * lex.c (lex_raw_string): Undo phase1 and phase2 transformations
2070 between R" and final " rather than only in between R"del( and )del".
2071
87e356ba
JJ
20722013-07-10 Jakub Jelinek <jakub@redhat.com>
2073
d5e48350
JJ
2074 PR preprocessor/57824
2075 * lex.c (lex_raw_string): Allow reading new-lines if
2076 in_deferred_pragma or if parsing_args and there is still
2077 data in the current buffer.
2078
c26302d5
JJ
2079 * include/cpplib.h (cpp_token_val_index): Change parameter type to
2080 const cpp_token *.
2081 * lex.c (cpp_token_val_index): Likewise.
2082
87e356ba
JJ
2083 PR preprocessor/57757
2084 * lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING
2085 or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that
2086 starts if a-zA-Z_.
2087
c865f923
ESR
20882013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
2089
2090 * lex.c (lex_raw_string(), lex_string()): Constrain suffixes treated
2091 as concatenated literal and macro to just the patterns found in
2092 inttypes.h; (is_macro()): New.
2093
39953c79
DC
20942013-06-24 Dehao Chen <dehao@google.com>
2095
2096 * files.c (_cpp_stack_include): Fix the highest_location when header
2097 file is guarded by #ifndef and is included twice.
2098
01187df0
JJ
20992013-04-28 Jakub Jelinek <jakub@redhat.com>
2100
2101 N3472 binary constants
2102 * include/cpplib.h (struct cpp_options): Fix a typo in user_literals
2103 field comment. Add binary_constants field.
2104 * init.c (struct lang_flags): Add binary_constants field.
2105 (lang_defaults): Add bin_cst column to the table.
2106 (cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants).
2107 * expr.c (cpp_classify_number): Talk about C++11 instead of C++0x
2108 in diagnostics. Accept binary constants if
2109 CPP_OPTION (pfile, binary_constants) even when pedantic. Adjust
2110 pedwarn message.
2111
61949153
PC
21122013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
2113
2114 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y.
2115 * init.c (lang_defaults): Add defaults for the latter.
2116 (cpp_init_builtins): Define __cplusplus as 201300L for the latter.
2117 * lex.c (_cpp_lex_direct): Update.
2118
994a4cc0
SH
21192013-04-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
2120
2121 PR target/56771
2122 * configure.ac: Require 64-bit int for arm*-*-rtems*.
2123 * configure: Regenerate.
2124
28937f11
JJ
21252013-03-06 Jakub Jelinek <jakub@redhat.com>
2126
2127 PR middle-end/56461
2128 * internal.h (struct cpp_buffer): Add to_free field.
2129 (_cpp_pop_file_buffer): Add third argument.
2130 * files.c (_cpp_stack_file): Set buffer->to_free.
2131 (_cpp_pop_file_buffer): Add to_free argument. Free to_free
2132 if non-NULL, and if equal to file->buffer_start, also clear
2133 file->buffer{,_start,_valid}.
2134 * directives.c (_cpp_pop_buffer): Pass buffer->to_free
2135 to _cpp_pop_file_buffer.
2136
3b8af25b
JJ
21372013-03-01 Jakub Jelinek <jakub@redhat.com>
2138
2139 PR middle-end/56461
2140 * files.c (_cpp_save_file_entries): Free result at the end.
2141 * pch.c (cpp_string_free): New function.
2142 (cpp_save_state): Use it in htab_create call.
2143 (cpp_write_pch_deps): Free ss->defs. Destroy ss->definedhash.
2144
1a80db97
JJ
21452013-02-28 Jakub Jelinek <jakub@redhat.com>
2146
15fd8332
JJ
2147 * files.c (_cpp_find_file): If returning early, before storing
2148 something to *hash_slot and *hash_slot is NULL, call htab_clear_slot
2149 on it. Access *hash_slot using void * type rather than
2150 struct file_hash_entry * to avoid aliasing issues.
2151
1a80db97
JJ
2152 * configure.ac: Don't define ENABLE_CHECKING whenever
2153 --enable-checking is seen, instead use similar --enable-checking=yes
2154 vs. --enable-checking=release default as gcc/ subdir has and
2155 define ENABLE_CHECKING if ENABLE_CHECKING is defined in gcc/.
2156 Define ENABLE_VALGRIND_CHECKING if requested.
2157 * lex.c (new_buff): If ENABLE_VALGRIND_CHECKING, put _cpp_buff
2158 struct first in the allocated buffer and result->base after it.
2159 (_cpp_free_buff): If ENABLE_VALGRIND_CHECKING, free buff itself
2160 instead of buff->base.
2161 * config.in: Regenerated.
2162 * configure: Regenerated.
2163
561f7fc7
ESR
21642013-02-13 Ed Smith-Rowland <3dw4rd@verizon.net>
2165
2166 PR c++/55582
61949153 2167 * lex.c (lex_raw_string): Allow string literal with suffix
561f7fc7
ESR
2168 beginning with 's' to be parsed as a C++11 user-defined literal.
2169
500f3ed9
RS
21702013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
2171
2172 Update copyright years.
2173
1582c677
PC
21742013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
2175
2176 PR c++/54526 (again)
2177 * lex.c (_cpp_lex_direct): In C++11 mode, implement 2.5 p3, bullet 2.
2178
8ac16127
MG
21792013-01-03 Marc Glisse <marc.glisse@inria.fr>
2180
2181 PR bootstrap/50177
2182 * line-map.c (get_combined_adhoc_loc): Cast from extern "C" type.
2183 (new_linemap): Likewise.
2184 (linemap_enter_macro): Likewise.
2185
f41e5bd1
JJ
21862012-12-03 Jakub Jelinek <jakub@redhat.com>
2187
2188 PR bootstrap/55380
2189 PR other/54691
2190 * files.c (read_file_guts): Allocate extra 16 bytes instead of
2191 1 byte at the end of buf. Pass size + 16 instead of size
2192 to _cpp_convert_input.
2193 * charset.c (_cpp_convert_input): Reallocate if there aren't
2194 at least 16 bytes beyond to.len in the buffer. Clear 16 bytes
2195 at to.text + to.len.
2196
31962032
SE
21972012-11-21 Steve Ellcey <sellcey@mips.com>
2198
2199 PR pch/55399
2200 * files.c (pch_open_file): Fix check for implicit_preinclude.
2201
5dc99c46
SB
22022012-11-16 Simon Baldwin <simonb@google.com>
2203
2204 * include/cpplib.h (struct cpp_options): Add canonical_system_headers.
2205 * files.c (find_file_in_dir): Call maybe_shorter_path() only if
2206 canonical_system_headers is set.
2207 * init.c (cpp_create_reader): Initialize canonical_system_headers.
2208 * configure.ac: Add new --enable-canonical-system-headers.
2209 * configure: Regenerate.
2210 * config.in: Regenerate.
2211
a4a0016d
ESR
22122012-11-09 Ed Smith-Rowland <3dw4rd@verizon.net>
2213
2214 PR c++/54413
2215 * include/cpplib.h (cpp_interpret_float_suffix): Add cpp_reader* arg.
2216 (cpp_interpret_int_suffix): Add cpp_reader* arg.
2217 * init.c (cpp_create_reader): Iitialize new flags.
2218 * expr.c (interpret_float_suffix): Use new flags.
2219 (cpp_interpret_float_suffix): Add cpp_reader* arg.
2220 (interpret_int_suffix): Use new flags.
2221 (cpp_interpret_int_suffix): Add cpp_reader* arg.
2222 (cpp_classify_number): Adjust calls to interpret_x_suffix.
2223
04ce690f
IB
22242012-10-23 Ian Bolton <ian.bolton@arm.com>
2225 Jim MacArthur <jim.macarthur@arm.com>
2226 Marcus Shawcroft <marcus.shawcroft@arm.com>
2227 Nigel Stephens <nigel.stephens@arm.com>
2228 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
2229 Richard Earnshaw <rearnsha@arm.com>
2230 Sofiane Naci <sofiane.naci@arm.com>
2231 Stephen Thomas <stephen.thomas@arm.com>
2232 Tejas Belagod <tejas.belagod@arm.com>
2233 Yufeng Zhang <yufeng.zhang@arm.com>
2234
2235 * configure.ac: Enable AArch64.
2236 * configure: Regenerate.
2237
1efcb8c6
JM
22382012-10-23 Joseph Myers <joseph@codesourcery.com>
2239
2240 * files.c (struct _cpp_file): Add implicit_preinclude.
2241 (pch_open_file): Allow a previously opened implicitly included
2242 file.
2243 (_cpp_find_file): Add implicit_preinclude argument. Free file and
2244 do not call open_file_failed if implicit_preinclude. Store
2245 implicit_preinclude value.
2246 (_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date):
2247 Update calls to _cpp_find_file.
2248 (_cpp_stack_include): Handle IT_DEFAULT.
2249 (cpp_push_default_include): New.
2250 * include/cpplib.h (cpp_push_default_include): Declare.
2251 * init.c (cpp_read_main_file): Update call to _cpp_find_file.
2252 * internal.h (enum include_type): Add IT_DEFAULT.
2253 (_cpp_find_file): Update prototype.
2254
55e7f907
TB
22552012-10-15 Tobias Burnus <burnus@net-b.de>
2256
2257 * files.c (read_file_guts, _cpp_save_file_entries): Free memory
2258 before returning.
2259 * lex.c (warn_about_normalization): Ditto.
2260 * mkdeps.c (deps_save): Ditto.
2261 * pch.c (cpp_valid_state): Ditto.
2262
f591bd8f
FW
22632012-10-04 Florian Weimer <fweimer@redhat.com>
2264
2265 * directives.c (do_pragma_warning_or_error): New.
2266 (do_pragma_warning): New.
2267 (do_pragma_error): New.
2268 (_cpp_init_internal_pragmas): Register new pragmas.
2269
ec6e0399
DC
22702012-09-25 Dehao Chen <dehao@google.com>
2271
2272 PR middle-end/54704
2273 * line-map.c (location_adhoc_data_hash): Fix the hash function.
2274
52187008
DC
22752012-09-25 Dehao Chen <dehao@google.com>
2276
2277 PR middle-end/54645
2278 * include/line-map.h (location_adhoc_data): Move location_adhoc_data
2279 into GC.
2280 (location_adhoc_data_map): Likewise.
2281 (line_maps): Likewise.
2282 (rebuild_location_adhoc_htab): New Function.
2283 * line-map.c (+rebuild_location_adhoc_htab): new Funcion.
2284 (get_combined_adhoc_loc): Move location_adhoc_data into GC.
2285 (location_adhoc_data_fini): Likewise.
2286 (linemap_init): Likewise.
2287 (location_adhoc_data_init): Remove Function.
2288
5368224f
DC
22892012-09-19 Dehao Chen <dehao@google.com>
2290
2291 * include/line-map.h (MAX_SOURCE_LOCATION): New value.
2292 (location_adhoc_data_fini): New.
2293 (get_combined_adhoc_loc): New.
2294 (get_data_from_adhoc_loc): New.
2295 (get_location_from_adhoc_loc): New.
2296 (location_adhoc_data_map): New.
2297 (COMBINE_LOCATION_DATA): New.
2298 (IS_ADHOC_LOC): New.
2299 (expanded_location): New field.
2300 (line_maps): New field.
2301 * line-map.c (location_adhoc_data): New.
2302 (location_adhoc_data_hash): New.
2303 (location_adhoc_data_eq): New.
2304 (location_adhoc_data_update): New.
2305 (get_combined_adhoc_loc): New.
2306 (get_data_from_adhoc_loc): New.
2307 (get_location_from_adhoc_loc): New.
2308 (location_adhoc_data_init): New.
2309 (location_adhoc_data_fini): New.
2310 (linemap_init): Initialize location_adhoc_data.
2311 (linemap_lookup): Change to use new location.
2312 (linemap_ordinary_map_lookup): Likewise.
2313 (linemap_macro_map_lookup): Likewise.
2314 (linemap_macro_map_loc_to_def_point): Likewise.
2315 (linemap_macro_map_loc_unwind_toward_spel): Likewise.
2316 (linemap_get_expansion_line): Likewise.
2317 (linemap_get_expansion_filename): Likewise.
2318 (linemap_location_in_system_header_p): Likewise.
2319 (linemap_location_from_macro_expansion_p): Likewise.
2320 (linemap_macro_loc_to_spelling_point): Likewise.
2321 (linemap_macro_loc_to_def_point): Likewise.
2322 (linemap_macro_loc_to_exp_point): Likewise.
2323 (linemap_resolve_location): Likewise.
2324 (linemap_unwind_toward_expansion): Likewise.
2325 (linemap_unwind_to_first_non_reserved_loc): Likewise.
2326 (linemap_expand_location): Likewise.
2327 (linemap_dump_location): Likewise.
2328 (linemap_line_start): Likewise.
2329
f3d25c65
DS
23302012-05-25 Dodji Seketeli <dodji@redhat.com>
2331
2332 PR preprocessor/53469
2333 * directives.c (do_pragma): Use the virtual location for the
2334 pragma token, instead of its spelling location.
2335
0823efed
DN
23362012-08-14 Diego Novillo <dnovillo@google.com>
2337
2338 Merge from cxx-conversion branch. Configury.
2339
2340 * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
2341 * configure.ac: Likewise.
2342 * configure: Regenerate.
2343
23442012-08-14 Lawrence Crowl <crowl@google.com>
2345
2346 Merge from cxx-conversion branch. New C++ hash table.
2347
2348 * include/symtab.h (typedef struct ht hash_table): Change the typedef
2349 name to cpp_hash_table. Update all users of the typedef.
2350
c0fd3497
LB
23512012-07-30 Laurynas Biveinis <laurynas.biveinis@gmail.com>
2352
2353 * include/line-map.h (line_map_macro): Use the "atomic" GTY option
2354 for the macro_locations field.
2355
d35d1c0f
UB
23562011-06-19 Uros Bizjak <ubizjak@gmail.com>
2357
2358 * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
2359 __builtin_ia32_pcmpestri128 instead of asm.
2360
d86d2119
DA
23612012-06-04 Dimitrios Apostolou <jimis@gmx.net>
2362
2363 * line-map.c (linemap_enter_macro): Don't zero max_column_hint in
2364 every macro. This improves performance by reducing the number of
2365 reallocations when track-macro-expansion is on.
2366
7ca643e1
DS
23672012-06-04 Dodji Seketeli <dodji@redhat.com>
2368
2369 PR preprocessor/53463
2370 * line-map.c (linemap_location_in_system_header_p): For built-in
2371 macro tokens, check the first expansion point location that is not
2372 for a token coming from a built-in macro.
2373
7d9641cc
JM
23742012-05-29 Joseph Myers <joseph@codesourcery.com>
2375
2376 * directives.c: Fix typos.
2377 * include/line-map.h: Fix typos.
2378 * line-map.c: Fix typos.
2379 * macro.c: Fix typos.
2380
53a103d3
DS
23812012-05-25 Dodji Seketeli <dodji@redhat.com>
2382
2383 PR bootstrap/53459
2384 * lex.c (search_line_fast): Avoid unused local typedefs to simulate
2385 a static assertion.
2386
828a7f76
DS
23872012-05-29 Dodji Seketeli <dodji@redhat.com>
2388
2389 PR preprocessor/53229
2390 * internal.h (cpp_reader::set_invocation_location): Remove.
2391 (cpp_reader::about_to_expand_macro_p): New member flag.
2392 * directives.c (do_pragma): Remove Kludge as
2393 pfile->set_invocation_location is no more.
2394 * macro.c (cpp_get_token_1): Do away with the use of
2395 cpp_reader::set_invocation_location. Just collect the macro
2396 expansion point when we are about to expand the top-most macro.
2397 Do not override cpp_reader::about_to_expand_macro_p.
2398 This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding
2399 properly handle locations of expansion points.
2400 (cpp_get_token_with_location): Adjust, as
2401 cpp_reader::set_invocation_location is no more.
2402 (paste_tokens): Take a virtual location parameter for
2403 the LHS of the pasting operator. Use it in diagnostics. Update
2404 comments.
2405 (paste_all_tokens): Tighten the assert. Propagate the location of
2406 the expansion point when no virtual locations are available.
2407 Pass the virtual location to paste_tokens.
2408 (in_macro_expansion_p): New static function.
2409 (enter_macro_context): Set the cpp_reader::about_to_expand_macro_p
2410 flag until we really start expanding the macro.
2411
0b2c4be5
DS
24122012-05-16 Dodji Seketeli <dodji@redhat.com>
2413
2414 PR preprocessor/7263
2415 * include/cpplib.h (cpp_classify_number): Take a location
2416 parameter.
2417 * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic
2418 macros that take a location parameter.
2419 (cpp_classify_number): Take a (virtual) location parameter. Use
2420 it for diagnostics. Adjust comments.
2421 (eval_token): Take a location parameter. Pass it to
2422 cpp_classify_number and to diagnostic routines.
2423 (_cpp_parse_expr): Use virtual locations of tokens when parsing
2424 expressions. Pass a virtual location to eval_token and to
2425 diagnostic routines.
2426
638d2065
TG
24272012-05-10 Tristan Gingold <gingold@adacore.com>
2428
2429 * expr.c (interpret_float_suffix): Add a guard.
2430
3ad64f53
DS
24312012-05-02 Dodji Seketeli <dodji@redhat.com>
2432
2433 Properly initialize cpp_context in destringize_and_run
2434 * directives.c (destringize_and_run): Properly initialize the new
2435 context.
2436 * macro.c (_cpp_pop_context): Assert that we shouldn't try to pop
2437 the initial base context, which has the same life time as the
2438 current instance of cpp_file.
2439
b193dfa8
MLI
24402012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
2441 Dodji Seketeli <dodji@seketeli.org>
2442
3efc2959 2443 PR c++/52974
b193dfa8
MLI
2444 * libcpp/files.c (maybe_shorter_path): New.
2445 (find_file_in_dir): Use it.
2446
4e65a470
DS
24472012-04-30 Dodji Seketeli <dodji@redhat.com>
2448
51fce2d3
DS
2449 Switch -ftrack-macro-expansion=2 on by default.
2450 * init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
2451 by default. Add comments.
2452
c4ca1a09
DS
2453 Strip "<built-in>" loc from displayed expansion context
2454 * include/line-map.h (linemap_unwind_toward_expansion): Fix typo
2455 in comment.
2456 (linemap_unwind_to_first_non_reserved_loc): Declare new function.
2457 * line-map.c (linemap_unwind_to_first_non_reserved_loc): Define
2458 new function.
2459
3600218c
DS
2460 Fix expansion point loc for macro-like tokens
2461 * macro.c (macro_of_context): New static function.
2462 (_cpp_push_token_context, push_extended_tokens_context): If the
2463 macro argument is NULL, it means we are continuing the expansion
2464 of the current macro, if any. Update comments.
2465 (_cpp_pop_context): Re-enable expansion of the macro only when we
2466 are really out of the context of the current expansion.
2467
0ff2b8a0
DS
2468 Fix token pasting with -ftrack-macro-expansion
2469 * macro.c (paste_all_tokens): Put the token resulting from pasting
2470 into an extended token context with -ftrack-macro-location is in
2471 effect.
2472
4e65a470
DS
2473 Fix cpp_sys_macro_p with -ftrack-macro-expansion
2474 * macro.c (cpp_sys_macro_p): Support -ftrack-macro-expansion.
2475
112448b4
DS
24762012-04-29 Dodji Seketeli <dodji@redhat.com>
2477
2478 * lex.c (lex_raw_string): Change C++ style comments into C style
2479 comments.
19a9ba64 2480 (lex_string): Likewise.
112448b4 2481
7f5f5f98
OW
24822012-04-27 Ollie Wild <aaw@google.com>
2483
2484 * include/cpplib.h (struct cpp_options): Add new field,
2485 warn_literal_suffix.
2486 (CPP_W_LITERAL_SUFFIX): New enum.
2487 * init.c (cpp_create_reader): Default initialization of
2488 warn_literal_suffix.
2489 * lex.c (lex_raw_string): Treat user-defined literals which don't
2490 begin with '_' as separate tokens and produce a warning.
2491 (lex_string): Ditto.
2492
1d72e96f
MLI
24932012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
2494
2495 * line-map.c (linemap_resolve_location): Synchronize comments with
2496 those in line-map.h.
2497 * include/line-map.h (linemap_resolve_location): Fix spelling in
2498 comment.
2499
e75b54a2
RE
25002012-03-22 Richard Earnshaw <rearnsha@arm.com>
2501
2502 * lex.c (search_line_fast): Provide Neon-optimized version for ARM.
2503
7888f266
RO
25042012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2505
2506 * lex.c: Remove Solaris 8 reference.
2507
dd552284
WL
25082012-02-14 Walter Lee <walt@tilera.com>
2509
2510 * configure.ac: Require 64-bit hwint for tilegx and tilepro.
2511 * configure: Regenerate.
2512
2c5cbc31
RG
25132012-01-09 Richard Guenther <rguenther@suse.de>
2514
2515 * macro.c (_cpp_builtin_macro_text): Remove unused variable map.
2516
b492b686
GF
25172012-01-09 Gary Funck <gary@intrepid.com>
2518
2519 PR preprocessor/33919
2520 * files.c (_cpp_get_file_name): New. Implement file name
2521 access function.
2522 * internal.h (_cpp_get_file_name): New prototype.
2523 * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
2524 to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
2525
75291c57
OH
25262012-01-03 Olivier Hainque <hainque@adacore.com>
2527
2528 * system.h: Prior to #define, #undef fopen and freopen unconditionally.
2529
48b0b196
JM
25302011-12-20 Joseph Myers <joseph@codesourcery.com>
2531
2532 * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
2533 (CLK_STDC1X): Change to CLK_STDC11.
2534 * init.c (lang_defaults): Update comments.
2535 (cpp_init_builtins): Update language tests. Use 201112L for C11
2536 __STDC_VERSION__.
2537
4a5e00ca
AS
25382011-12-20 Andreas Schwab <schwab@linux-m68k.org>
2539
2540 * configure: Regenerate.
2541
095af58f
AS
25422011-12-19 Andreas Schwab <schwab@linux-m68k.org>
2543
2544 * configure: Regenerate.
2545
b0c084b7
JJ
25462011-12-07 Jakub Jelinek <jakub@redhat.com>
2547
2548 PR bootstrap/50237
2549 * internal.h (_cpp_init_lexer): New prototype.
2550 * init.c (init_library): Call it.
2551 * lex.c (init_vectorized_lexer): Remove constructor attribute,
2552 add inline keyword.
2553 (HAVE_init_vectorized_lexer): Define.
2554 (_cpp_init_lexer): New function.
2555
9b554be9
DS
25562011-12-03 Dodji Seketeli <dodji@redhat.com>
2557
2558 * macro.c (tokens_buff_remove_last_token)
2559 (tokens_buff_put_token_to): Add an 'inline' function specifier to
2560 the prototype.
2561
8dcf72a8
DN
25622011-11-22 Diego Novillo <dnovillo@google.com>
2563
2564 * include/line-map.h (linemap_dump): Declare.
2565 (line_table_dump): Declare.
2566 * line-map.c (linemap_dump): New.
2567 (line_table_dump): New.
2568
7e74ce3f
ESR
25692011-11-21 Ed Smith-Rowland <3dw4rd@verizon.net>
2570
2571 PR c++/50958
2572 * expr.c (cpp_userdef_char_remove_type): Fix typo.
2573
e9411247
MM
25742011-11-03 Michael Matz <matz@suse.de>
2575
2576 PR bootstrap/50857
2577 * configure.ac: Check for -fno-exceptions -fno-rtti.
2578 * configure: Regenerate.
2579 * Makefile.in (NOEXCEPTION_FLAGS): New flag.
2580 (ALL_CXXFLAGS): Use it.
2581
0c1dace3
PC
25822011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
2583
2584 * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
2585
25339f10
JM
25862011-11-02 Jason Merrill <jason@redhat.com>
2587
2588 PR c++/50810
2589 * configure.ac: Add -Wno-narrowing to warning options.
2590
97e3ad20
JM
25912011-10-31 Jason Merrill <jason@redhat.com>
2592
1fb80b0c
JM
2593 PR libstdc++/1773
2594 * init.c (cpp_init_builtins): Set __cplusplus for C++11.
2595
97e3ad20
JM
2596 PR c++/50920
2597 * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
2598 CLK_GNUCXX0X to CLK_GNUCXX11.
2599
3ce4f9e4
ESR
26002011-10-26 Ed Smith-Rowland <3dw4rd@verizon.net>
2601
2602 Implement C++11 user-defined literals.
2603 * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
2604 cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
2605 cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
2606 cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
2607 (cpp_classify_number): Classify unrecognized tokens as user-defined
2608 literals.
2609 * include/cpplib.h: Add new tokens for user-defined literals.
2610 * init.c: Add new preprocessor flag (cxx11).
2611 * lex.c: (lex_string, lex_raw_string): Handle user-defined literals
2612 including concatenation and promotion with suffixes.
2613
3bb0c8db
DS
26142011-10-24 Dodji Seketeli <dodji@redhat.com>
2615
2616 * line-map.c (linemap_macro_map_lookup): Fix logic.
2617
84756fd4
DS
26182011-10-24 Dodji Seketeli <dodji@redhat.com>
2619
2620 * include/line-map.h (linemap_expand_location): Take a line table
2621 parameter. Update comment.
2622 (linemap_resolve_location): Update comment.
2623 (linemap_expand_location_full): Remove.
2624 * line-map.c (linemap_resolve_location): Handle reserved
2625 locations; return a NULL map in those cases.
2626 (linemap_expand_location): If location is reserved, return a
2627 zeroed expanded location. Update comment. Take a line table to
2628 assert that the function takes non-virtual locations only.
2629 (linemap_expand_location_full): remove.
2630 (linemap_dump_location): Handle the fact that
2631 linemap_resolve_location can return NULL line maps when the
2632 location resolves to a reserved location.
2633
2634 * line-map.c (linemap_macro_map_lookup): Fix logic.
2635
ad2305ad
DS
26362011-10-22 Dodji Seketeli <dodji@redhat.com>
2637
2638 PR bootstrap/50778
2639 * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
2640 context to act upon.
2641 * lex.c (_cpp_remaining_tokens_num_in_context): Likewise. Update
2642 comment.
2643 (cpp_token_from_context_at): Likewise.
2644 (cpp_peek_token): Use the context to peek tokens from.
2645
cbbcf655
DS
26462011-10-20 Dodji Seketeli <dodji@redhat.com>
2647
2648 PR bootstrap/50801
2649 * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
2650 number of tokens.
2651
d17687f6
DS
26522011-10-18 Dodji Seketeli <dodji@redhat.com>
2653
2654 PR bootstrap/50760
2655 * include/line-map.h (struct linemap_stats): Change the type of
19a9ba64 2656 the members from size_t to long.
d17687f6 2657 * macro.c (macro_arg_token_iter_init): Unconditionally initialize
19a9ba64 2658 iter->location_ptr.
d17687f6 2659
411f92de
DS
26602011-10-17 Dodji Seketeli <dodji@redhat.com>
2661
2662 * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
19a9ba64
AM
2663 variable without using it if ENABLE_CHECKING is not defined. Mark
2664 the LOCATION parameter as being unused.
411f92de 2665
b9bd6f74
TT
26662011-10-15 Tom Tromey <tromey@redhat.com>
2667 Dodji Seketeli <dodji@redhat.com>
2668
2669 * include/line-map.h (struct line_maps::alloced_size_for_request):
2670 New member.
2671 * line-map.c (new_linemap): Use set->alloced_size_for_request to
2672 get the actual allocated size of line maps.
2673
64a1a422
TT
26742011-10-15 Tom Tromey <tromey@redhat.com>
2675 Dodji Seketeli <dodji@redhat.com>
2676
2677 * line-map.h (struct linemap_stats): Declare new struct.
2678 (linemap_get_statistics): Declare ...
2679 * line-map.c (linemap_get_statistics): ... new function.
2680 * macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
2681 Declare new counters.
2682 (enter_macro_context, replace_args): Update
2683 num_macro_tokens_counter.
2684 (cpp_get_token_1): Update num_expanded_macros_counter.
2685
847e697a
TT
26862011-10-15 Tom Tromey <tromey@redhat.com>
2687 Dodji Seketeli <dodji@redhat.com>
2688
2689 * include/cpplib.h (struct cpp_options)<debug>: New struct member.
2690 * include/line-map.h (linemap_dump_location): Declare ...
2691 * line-map.c (linemap_dump_location): ... new function.
2692
92582b75
TT
26932011-10-15 Tom Tromey <tromey@redhat.com>
2694 Dodji Seketeli <dodji@redhat.com>
2695
2696 * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
2697 New option.
2698 * internal.h (struct macro_context): New struct.
2699 (enum context_tokens_kind): New enum.
2700 (struct cpp_context)<tokens_kind>: New member of type enum
2701 context_tokens_kind.
2702 (struct cpp_context)<macro>: Remove this. Replace it with an enum
2703 of macro and macro_context.
2704 (struct cpp_context)<direct_p>: Remove.
2705 (_cpp_remaining_tokens_num_in_context): Declare new function.
2706 * directives.c (destringize_and_run): Adjust.
2707 * lex.c (_cpp_remaining_tokens_num_in_context)
2708 (_cpp_token_from_context_at): Define new functions
2709 (cpp_peek_token): Use them.
2710 * init.c (cpp_create_reader): Initialize the base context to zero.
2711 (_cpp_token_from_context_at): Define new static function.
2712 (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
2713 _cpp_token_from_context_at.
2714 * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
2715 members.
2716 (enum macro_arg_token_kind): New enum.
2717 (struct macro_arg_token_iter): New struct.
2718 (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
2719 (alloc_expanded_arg_mem, ensure_expanded_arg_room)
2720 (delete_macro_args, set_arg_token, get_arg_token_location)
2721 (arg_token_ptr_at, macro_arg_token_iter_init)
2722 (macro_arg_token_iter_get_token)
2723 (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
2724 (expanded_token_index, tokens_buff_new, tokens_buff_count)
2725 (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
2726 (tokens_buff_add_token, tokens_buff_remove_last_token)
2727 (reached_end_of_context, consume_next_token_from_context): New
2728 static functions.
2729 (cpp_get_token_1): New static function. Split and extended from
2730 cpp_get_token. Use reached_end_of_context and
2731 consume_next_token_from_context. Unify its return point. Move
2732 the location tweaking from cpp_get_token_with_location in here.
2733 (cpp_get_token): Use cpp_get_token_1
2734 (stringify_arg): Use the new arg_token_at.
2735 (paste_all_tokens): Support tokens coming from extended tokens
2736 contexts.
2737 (collect_args): Return the number of collected arguments, by
2738 parameter. Store virtual locations of tokens that constitute the
2739 collected args.
2740 (funlike_invocation_p): Return the number of collected arguments,
2741 by parameter.
2742 (enter_macro_context): Add a parameter for macro expansion point.
2743 Pass it to replace_args and to the "used" cpp callback. Get the
2744 number of function-like macro arguments from funlike_invocation_p,
2745 pass it to the new delete_macro_args to free the memory used by
2746 macro args. When -ftrack-macro-expansion is in effect, for macros
2747 that have no arguments, create a macro map for the macro expansion
2748 and use it to allocate proper virtual locations for tokens
2749 resulting from the expansion. Push an extended tokens context
2750 containing the tokens resulting from macro expansion and their
2751 virtual locations.
2752 (replace_args): Rename the different variables named 'count' into
2753 variables with more meaningful names. Create a macro map;
2754 allocate virtual locations of tokens resulting from this
2755 expansion. Use macro_arg_token_iter to iterate over tokens of a
2756 given macro. Handle the case of the argument of
2757 -ftrack-macro-expansion being < 2. Don't free macro arguments
2758 memory resulting from expand_arg here, as these are freed by the
2759 caller of replace_arg using delete_macro_args now. Push extended
2760 token context.
2761 (next_context, push_ptoken_context, _cpp_push_token_context)
2762 (_cpp_push_text_context): Properly initialize the context.
2763 (expand_arg): Use the new alloc_expanded_arg_mem,
2764 push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
2765 (_cpp_pop_context): Really free the memory held by the context.
2766 Handle freeing memory used by extended tokens contexts.
2767 (cpp_get_token_with_location): Use cpp_get_token_1.
2768 (cpp_sys_macro_p): Adjust.
2769 (_cpp_backup_tokens): Support the new kinds of token contexts.
2770 * traditional.c (recursive_macro): Adjust.
2771
46427374
TT
27722011-10-15 Tom Tromey <tromey@redhat>
2773 Dodji Seketeli <dodji@redhat.com>
2774
2775 * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
2776 member.
2777 (MAX_SOURCE_LOCATION): New constant.
2778 (struct line_map_ordinary, struct line_map_macro): New structs.
19a9ba64 2779 (struct line_map): Turn this into a union of the two above. Add
46427374
TT
2780 comments.
2781 (struct maps_info): New struct.
2782 (struct line_maps)<info_ordinary, info_macro>: Two new fields.
2783 These now carry the map information that was previously scattered
2784 in struct line_maps.
2785 (struct map_info::allocated): Fix comment.
2786 (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
2787 (ORDINARY_MAP_STARTING_LINE_NUMBER)
2788 (ORDINARY_MAP_INCLUDER_FILE_INDEX)
2789 (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
2790 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
2791 (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
2792 (MACRO_MAP_EXPANSION_POINT_LOCATION)
2793 (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
2794 (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
2795 (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
2796 (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
2797 (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
2798 (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
2799 (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
2800 (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
2801 (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
2802 (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
2803 (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
2804 information.
2805 (linemap_check_ordinary, linemap_assert)
2806 (linemap_location_before_p): New macros.
2807 (linemap_position_for_line_and_column)
2808 (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
2809 (linemap_macro_expansion_map_p)
2810 (linemap_macro_map_loc_to_def_point)
2811 (linemap_macro_map_loc_unwind_once)
2812 (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
2813 (linemap_get_source_line linemap_get_source_column)
2814 (linemap_map_get_macro_name, linemap_get_file_path)
2815 (linemap_location_in_system_header_p)
2816 (linemap_location_from_macro_expansion_p): Declare new functions.
2817 (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
2818 (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
2819 accessors act on ordinary maps only.
2820 (INCLUDED_FROM): Return NULL for main files; use the new
2821 accessors.
2822 (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
2823 (struct expanded_location): Move here from gcc/input.h
2824 (linemap_resolve_location, linemap_expand_location)
2825 (linemap_expand_location_full): Declare new functions.
2826 * line-map.c: Include cpplib.h, internal.h
2827 (linemap_enter_macro, linemap_add_macro_token)
2828 (linemap_get_expansion_line, linemap_get_expansion_filename): New
2829 functions that are private to libcpp.
2830 (linemap_assert): New macro.
2831 (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
2832 (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
2833 (linemap_macro_map_loc_unwind_toward_spelling)
2834 (linemap_macro_map_loc_to_exp_point)
2835 (first_map_in_common_1, first_map_in_common): New static
2836 functions.
2837 (new_linemap): Define new static functions. Extracted and
2838 enhanced from ...
2839 (linemap_add): ... here. Use linemap_assert in lieu of abort
2840 previously.
2841 (linemap_tracks_macro_expansion_locs_p)
2842 (linemap_add_macro_token, linemap_macro_expansion_map_p)
2843 (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
2844 (linemap_macro_map_loc_to_def_point)
2845 (linemap_macro_map_loc_unwind_once)
2846 (linemap_step_out_once, linemap_map_get_index)
2847 (linemap_get_source_line,linemap_get_source_column)
2848 (linemap_get_file_path, linemap_map_get_macro_name)
2849 (linemap_location_in_system_header_p)
2850 (linemap_location_originated_from_system_header_p)
2851 (linemap_location_from_macro_expansion_p)
2852 (linemap_tracks_macro_expansion_locs_p)
2853 (linemap_resolve_location, linemap_expand_location)
2854 (linemap_expand_location_full)
2855 (linemap_tracks_macro_expansion_locs_p)
2856 (linemap_position_for_line_and_column, linemap_compare_locations):
2857 Define new public functions.
2858 (linemap_init): Initialize ordinary and macro maps information in
2859 the map set.
2860 (linemap_check_files_exited): Use the new accessors.
2861 (linemap_free): Remove this dead code.
2862 (linemap_line_start): Assert this uses an ordinary map. Adjust to
2863 use the new ordinary map accessors and data structures. Don't
2864 overflow past the lowest possible macro token's location.
2865 (linemap_position_for_column): Assert the ordinary maps of the map
2866 set are really ordinary. Use ordinary map accessors.
2867 (linemap_lookup): Keep the same logic but generalize to allow
2868 lookup of both ordinary and macro maps. Do not crash when called
2869 with an empty line table.
2870 * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
2871 new API of line-map.h.
2872 * directives.c (start_directive, do_line, do_linemarker)
2873 (do_linemarker): Likewise.
2874 * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
2875 (make_cpp_dir, cpp_make_system_header): Likewise.
2876 * init.c (cpp_read_main_file): Likewise.
2877 * internal.h (CPP_INCREMENT_LINE): Likewise.
2878 (linemap_enter_macro, linemap_add_macro_token)
2879 (linemap_get_expansion_line, linemap_get_expansion_filename): New
2880 functions private to libcpp.
2881 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
2882 (skip_line_comment, skip_whitespace, lex_raw_string)
2883 (_cpp_lex_direct): Likewise.
2884 * macro.c (_cpp_builtin_macro_text): Likewise.
2885 (_cpp_aligned_alloc): Initialize the new name member of the macro.
2886 * traditional.c (copy_comment, _cpp_scan_out_logical_line):
2887 Likewise.
2888 * errors.c (cpp_diagnostic): Adjust to new linemap API.
2889
892a371f
DS
28902011-08-28 Dodji Seketeli <dodji@redhat.com>
2891
2892 * line-map.c (linemap_add): Assert that reason must not be
2893 LC_RENAME when called for the first time on a "main input file".
2894
e3dfef44
GC
28952011-08-22 Gabriel Charette <gchare@google.com>
2896
2897 * init.c (cpp_create_reader): Inititalize forced_token_location_p.
2898 * internal.h (struct cpp_reader): Add field forced_token_location_p.
2899 * lex.c (_cpp_lex_direct): Use forced_token_location_p.
2900 (cpp_force_token_locations): New.
2901 (cpp_stop_forcing_token_locations): New.
2902
32fe396e
RO
29032011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2904
2905 PR libstdc++/1773
2906 * init.c (cpp_init_builtins): Define __cplusplus 19971L.
2907
7c1ffff9
JM
29082011-08-18 Joseph Myers <joseph@codesourcery.com>
2909
2910 * include/cpplib.h (struct cpp_options): Fix typo.
2911
a48e3dd1
JM
29122011-08-18 Joseph Myers <joseph@codesourcery.com>
2913
2914 * include/cpplib.h (struct cpp_options): Add rliterals.
2915 * init.c (struct lang_flags, lang_defaults): Add rliterals.
2916 (cpp_set_lang): Set rliterals option.
2917 (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
2918 * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
2919
3f6ced10
GC
29202011-08-15 Gabriel Charette <gchare@google.com>
2921
2922 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
2923 Update all users to use linemap_position_for_column instead.
2924
0681d04c
GC
29252011-07-28 Gabriel Charette <gchare@google.com>
2926
2927 * include/line-map.h (struct line_maps):
2928 Remove unused field last_listed. Update all users.
2929
5e9627ca
L
29302011-07-28 H.J. Lu <hongjiu.lu@intel.com>
2931
2932 * configure.ac: Set need_64bit_hwint to yes for x86 targets.
2933 * configure: Regenerated.
2934
a024b70f
RO
29352011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2936
2937 * system.h [__cplusplus]: Wrap C function declarations in extern "C".
2938
5b6d595b
RO
29392011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2940 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2941
2942 PR bootstrap/49794
2943 * configure.ac: Test AM_ICONV with CXX.
2944 * configure: Regenerate.
2945 * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
2946
d0a9fbe1
DS
29472011-07-15 Dodji Seketeli <dodji@redhat.com>
2948
2949 * directives.c (struct if_stack): Use source_location as type
2950 here.
2951 * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
2952 indent, def_pragma, used_define, used_undef>: Properly use
2953 source_location as parameter type, rather than unsigned int.
2954
fbdd5d87
RO
29552011-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2956
2957 PR target/39150
2958 * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
2959 like i[34567]86-*-solaris2.1[0-9]*.
2960 * configure: Regenerate.
2961
8787a05a
JM
29622011-06-16 Jason Merrill <jason@redhat.com>
2963
2964 PR c++/45399
2965 * lex.c (lex_raw_string): Don't check for embedded NUL.
2966
38fbfaf6
DS
29672011-06-06 Dodji Seketeli <dodji@redhat.com>
2968
2969 PR preprocessor/48532
2970 * directives.c (do_pragma): Don't forget the invocation location
2971 when parsing the pragma name of a namespaced pragma directive.
2972
fc0993ac
JT
29732011-05-29 John Tytgat <John.Tytgat@aaug.net>
2974
2975 * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
2976
ef230b38
UB
29772011-05-22 Uros Bizjak <ubizjak@gmail.com>
2978
2979 PR target/49104
2980 * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
2981 is defined. Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
2982
e5b0dad8
JK
29832011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
2984
2985 * system.h (ENUM_BITFIELD): Remove.
2986
6cfae070
JJ
29872011-04-24 Jakub Jelinek <jakub@redhat.com>
2988
2989 PR preprocessor/48740
2990 * lex.c (lex_raw_string): When raw string ends with
2991 ??) followed by raw prefix and ", ensure it is preprocessed
2992 with ??) rather than ??].
2993
04695783
JM
29942011-04-20 Jim Meyering <meyering@redhat.com>
2995
2996 * files.c (destroy_cpp_file): Remove useless if-before-free.
2997 * init.c (cpp_destroy): Likewise.
2998 * macro.c (replace_args): Likewise.
2999 * pch.c (cpp_valid_state): Likewise.
3000
4489800d
KT
30012011-03-25 Kai Tietz <ktietz@redhat.com>
3002
3003 * files.c (file_hash_eq): Use filename_cmp
3004 instead of strcmp.
3005 (nonexistent_file_hash_eq): Likewise.
3006 (remap_filename): Likewise.
3007 Handle absolute DOS-path,
3008 (append_file_to_dir): Check for IS_DIR_SEPARATOR
3009 instead of slash.
3010 (read_name_map): Likewise.
3011 * linemap.c (linemap_add): Use filename_cmp
3012 instead of strcmp.
3013 * mkdeps.c (apply_vpath): Use filename_ncmp
3014 instead of strncmp.
3015 (deps_restore): Use filename_cmp instead of
3016 strcmp.
3017 * init.c (read_original_directory): Use
3018 IS_DIR_SEPARATOR instead of checking for slash.
3019
f3c33d9d
MM
30202011-03-21 Michael Meissner <meissner@linux.vnet.ibm.com>
3021
3022 PR preprocessor/48192
3023 * directives.c (do_ifdef): Do not consider conditional macros as
3024 being defined.
3025 (do_ifndef): Ditto.
3026 * expr.c (parse_defined): Ditto.
3027
01956319
RH
30282011-03-18 Richard Henderson <rth@redhat.com>
3029
3030 PR bootstrap/45381
3031 * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
3032
c5a62c6f 30332011-11-04 Eric Botcazou <ebotcazou@adacore.com>
19a9ba64 3034 Jakub Jelinek <jakub@redhat.com>
c5a62c6f
EB
3035
3036 PR preprocessor/39213
3037 * directives.c (end_directive): Call _cpp_remove_overlay for deferred
3038 pragmas as well in traditional mode.
3039
0e1a989c
ILT
30402010-11-17 Ian Lance Taylor <iant@google.com>
3041
3042 PR bootstrap/45538
3043 * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of
3044 AC_LANG based on ENABLE_BUILD_WITH_CXX.
3045
651a20b5
KT
30462010-11-16 Kai Tietz <kai.tietz@onevision.com>
3047
3048 PR preprocessor/17349
3049 * lex.c (save_comment): Handle in argument passing c++
3050 comments special.
3051
480767a9
ILT
30522010-11-02 Ian Lance Taylor <iant@google.com>
3053
3054 * configure.ac: Use AC_SYS_LARGEFILE.
3055 * configure: Rebuild.
3056 * config.in: Rebuild.
3057
078419c9 30582010-10-19 Basile Starynkevitch <basile@starynkevitch.net>
480767a9 3059
078419c9
BS
3060 * line-map.h (source_location): Remove obsolete comment
3061 mentioning location_s.
3062
d6874138
KT
30632010-09-29 Kai Tietz <kai.tietz@onevision.com>
3064
3065 PR preprocessor/45362
3066 * directives.c (cpp_pop_definition): Make static.
3067 (do_pragma_push_macro): Reworked to store text
3068 definition.
3069 (do_pragma_pop_macro): Add free text definition.
3070 (cpp_push_definition): Removed.
3071 * include/cpplib.h (cpp_push_definition): Removed.
3072 (cpp_pop_definition): Likewise.
3073 * internal.h (def_pragma_macro): Remove member 'value'
3074 and add new members 'definition', 'line',
3075 'syshdr', 'sued' and 'is_undef'.
3076 * pch.c (_cpp_restore_pushed_macros): Rework to work
3077 on text definition and store additional macro flags.
3078 (_cpp_save_pushed_macros): Likewise.
3079
e3339d0f
JM
30802010-09-29 Joseph Myers <joseph@codesourcery.com>
3081
3082 * include/cpplib.h (cpp_options): Rename warn_deprecated,
3083 warn_traditional, warn_long_long and pedantic.
3084 * directives.c (directive_diagnostics, _cpp_handle_directive):
3085 Update names of cpp_options members.
3086 * expr.c (cpp_classify_number, eval_token): Update names of
3087 cpp_options members.
3088 * init.c (cpp_create_reader, post_options): Update names of
3089 cpp_options members.
3090 * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
3091 cpp_options members.
3092 * macro.c (parse_params): Update names of cpp_options members.
3093
128465e6
ILT
30942010-09-15 Ian Lance Taylor <iant@google.com>
3095
3096 * init.c: Fix type name in comment.
3097
a69d2520
JJ
30982010-08-31 Jakub Jelinek <jakub@redhat.com>
3099
3100 PR preprocessor/45457
3101 * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
3102 needed.
3103 * directives.c (do_ifdef, do_ifndef): Likewise.
3104
707bcb7a
RO
31052010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3106
3107 * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
3108
6f173e52
RH
31092010-08-24 Richard Henderson <rth@redhat.com>
3110
3111 PR bootstrap/45376
3112 * configure.ac (HAVE_SSE4): New check.
3113 * configure, config.in: Rebuild.
3114 * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
3115
789d73cb
RO
31162010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3117
3118 * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
3119 etc. on Solaris 2/x86.
3120
246a2fcb
RH
31212010-08-21 Richard Henderson <rth@redhat.com>
3122 Andi Kleen <ak@linux.intel.com>
3123 David S. Miller <davem@davemloft.net>
3124
3125 * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
3126 (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
3127 (ptrdiff_t): Check via AC_CHECK_TYPE.
3128 * config.in, configure: Rebuild.
3129 * system.h: Include stdint.h, if available.
3130 * lex.c (WORDS_BIGENDIAN): Provide default.
3131 (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
3132 acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
3133 search_line_sse2, search_line_sse42, init_vectorized_lexer,
3134 search_line_fast): New.
3135 (_cpp_clean_line): Use search_line_fast. Restructure the fast
3136 loop to make it clear when we're leaving the loop. Stay in the
3137 fast loop for non-trigraph '?'.
3138
8e680db5
JJ
31392010-06-11 Jakub Jelinek <jakub@redhat.com>
3140
3141 * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
3142 callback.
3143 (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
3144 (cpp_macro_definition): Remove const qual from second argument.
3145 * macro.c (enter_macro_context): Call user_builtin_macro callback for
3146 NODE_BUILTIN !NODE_USED macros.
3147 (warn_of_redefinition): Likewise. Remove const qual from second
3148 argument.
3149 (cpp_macro_definition): Likewise.
3150 * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
3151 for NODE_BUILTIN !NODE_USED macros.
3152
1cb42611
JM
31532010-06-10 Joseph Myers <joseph@codesourcery.com>
3154
3155 * include/cpplib.h (struct cpp_options): Remove show_column.
3156 * init.c (cpp_create_reader, post_options): Don't set show_column.
3157
ff5dfc48
JR
31582010-06-09 Joern Rennecke <joern.rennecke@embecosm.com>
3159
3160 PR bootstrap/44432
3161 * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
3162 check that C++ compiler works.
3163 * configure: Regenerate.
3164
a9429e29
LB
31652010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
3166
3167 * include/symtab.h (ht_identifier_ptr): New.
3168
c3f247f4
RW
31692010-06-03 Joern Rennecke <joern.rennecke@embecosm.com>
3170 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3171
3172 PR bootstrap/42798
3173 * configure.ac: Check for declaration of 'basename(char *)'.
3174 * configure: Regenerate.
3175 * config.in: Regenerate.
3176
2778d766
JM
31772010-04-25 Joseph Myers <joseph@codesourcery.com>
3178
3179 * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
3180 * init.c (lang_defaults): Add entries for new language variants.
3181 (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
3182 variants.
3183
d8a12e84
MLI
31842010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
3185
3186 PR cpp/43195
3187 * files.c (report_missing_guard): Test for #pragma once.
3188
87cf0651
SB
31892010-04-07 Simon Baldwin <simonb@google.com>
3190
3191 * directives.c (do_diagnostic): Add warning reason argument,
3192 call appropriate error reporting function for code.
3193 (directive_diagnostics): Call specific warning functions with
3194 warning reason where appropriate.
3195 (do_error, do_warning, do_pragma_dependency): Add warning reason
3196 argument to do_diagnostic calls.
3197 * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
3198 _cpp_create_definition): Call specific warning functions with
3199 warning reason where appropriate.
3200 * Makefile.in: Add new diagnostic functions to gettext translations.
3201 * include/cpplib.h (struct cpp_callbacks): Add warning reason code
3202 to error callback.
3203 (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
3204 CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
3205 (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
3206 CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
3207 CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
3208 CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
3209 CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
3210 CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
3211 CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
3212 warning reason codes.
3213 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
3214 cpp_warning_with_line, cpp_pedwarning_with_line,
3215 cpp_warning_with_line_syshdr): New specific error reporting functions.
3216 * pch.c (cpp_valid_state): Call specific warning functions with
3217 warning reason where appropriate.
3218 * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
3219 diagnostic handlers.
3220 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
3221 cpp_warning_with_line, cpp_pedwarning_with_line,
3222 cpp_warning_with_line_syshdr): New specific error reporting functions.
3223 * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
3224 specific warning functions with warning reason where appropriate.
3225 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
3226 warn_about_normalization, lex_identifier_intern, lex_identifier,
3227 _cpp_lex_direct): Ditto.
3228 * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
3229 narrow_str_to_charconst): Ditto.
3230
d947ada0
JJ
32312010-04-06 Jakub Jelinek <jakub@redhat.com>
3232
3233 PR preprocessor/43642
3234 * lex.c (lex_raw_string): Change type of TYPE variable to
3235 unsigned char.
3236
4d9e8446
RW
32372010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3238
3239 * aclocal.m4: Regenerate.
3240
52150625
JM
32412010-03-29 Jason Merrill <jason@redhat.com>
3242
00a81b8b
JM
3243 More N3077 raw string changes
3244 * charset.c (cpp_interpret_string): Don't transform UCNs in raw
3245 strings.
3246 * lex.c (bufring_append): Split out from...
3247 (lex_raw_string): ...here. Undo trigraph and line splicing
3248 transformations. Do process line notes in multi-line literals.
3249 (_cpp_process_line_notes): Ignore notes that were already handled.
3250
52150625
JM
3251 Some raw string changes from N3077
3252 * charset.c (cpp_interpret_string): Change inner delimiters to ().
3253 * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter.
3254
709d7160
JJ
32552010-02-11 Jakub Jelinek <jakub@redhat.com>
3256
3257 * init.c (read_original_filename): Don't call read_original_directory
3258 if _cpp_handle_directive returns 0.
3259
dadab4fd
JM
32602010-01-01 Joseph Myers <joseph@codesourcery.com>
3261
3262 PR preprocessor/41947
3263 * expr.c (cpp_classify_number): Give error for hexadecimal
3264 floating-point constant with no digits before or after point.
3265
3de8a540
AC
32662009-11-20 Arnaud Charlet <charlet@adacore.com>
3267
3268 * macro.c (enter_macro_context): Call cb.used callback if defined.
3269 * directives.c (do_idef, do_ifndef): Ditto.
3270 * include/cpplib.h (struct cpp_callbacks): Add used callback.
3271
17e7cb85
KT
32722009-11-11 Kai Tietz <kai.tietz@onevision.com>
3273
3274 * directives.c (do_pragma_push_macro): New pragma handler.
3275 (do_pragma_pop_macro): Likewise.
3276 (_cpp_init_internal_pragmas): Add push_macro and
3277 pop_macro handler to internal pragmas.
3278 (lex_macro_node_from_str): Removed.
3279 (cpp_push_definition): Replace lex_macro_node_from_str
3280 by _cpp_lex_identifier.
3281 (cpp_pop_definition): Likewise.
3282 * internal.h (_cpp_lex_identifier): New prototype.
3283 (def_pragma_macro): New structure.
3284 (cpp_reader): New member pushed_macros.
3285 * lex.c (_cpp_lex_identifier): New function.
3286 (lex_identifier_intern): New function.
3287 * init.c (cpp_create_reader): Initialize pushed_macros
3288 member.
3289 (cpp_destroy): Free elements in pushed_macros member.
3290 * pch.c (_cpp_save_pushed_macros): New function.
3291 (_cpp_restore_pushed_macros): Likewise.
3292 (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
3293 (cpp_read_state): Use _cpp_restore_pushed_macros.
3294
2c6e3f55
JJ
32952009-10-19 Jakub Jelinek <jakub@redhat.com>
3296
3297 * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
3298 (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
3299 and char32_cset_desc.
3300 (converter_for_type): Handle CPP_UTF8STRING.
3301 (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
3302 * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
3303 (parse_include): Reject raw strings.
3304 * include/cpplib.h (CPP_UTF8STRING): New token type.
3305 * internal.h (struct cpp_reader): Add utf8_cset_desc field.
3306 * lex.c (lex_raw_string): New function.
3307 (lex_string): Handle u8 string literals, call lex_raw_string
3308 for raw string literals.
3309 (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
3310 sequences.
3311 * macro.c (stringify_arg): Handle CPP_UTF8STRING.
3312
96c169e1
JJ
33132009-10-14 Jakub Jelinek <jakub@redhat.com>
3314
3315 PR preprocessor/41543
3316 * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
3317 * line-map.c (linemap_init): Initialize highest_location and
3318 highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
3319
30c99a9e
JM
33202009-10-09 Jason Merrill <jason@redhat.com>
3321
3322 * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
3323
2214382c
NV
33242009-10-09 Neil Vachharajani <nvachhar@google.com>
3325
3326 * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
3327 sccs.
3328
e02222d2
LR
33292009-09-23 Loren J. Rittle <ljrittle@acm.org>
3330
3331 * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
3332 * configure: Rebuilt.
3333
9a8a2b7a
RG
33342009-09-22 Richard Guenther <rguenther@suse.de>
3335
3336 PR pch/38987
3337 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
3338
74dc6a11
CD
33392009-09-18 Chris Demetriou <cgd@google.com>
3340
3341 PR preprocessor/28435:
3342 * include/cpplib.h (struct cpp_options): Add new member
3343 deps.need_preprocessor_output.
3344 * files.c (open_file_failed): If preprocessor output is needed
3345 always report an error.
3346
933608b7
KT
33472009-09-13 Kai Tietz <kai.tietz@onevision.com>
3348
3349 * configure.ac: Set for i?86-w64-mingw*
3350 need_64bit_hwint to yes.
3351 * configure: Regenerated.
3352
86373e7e
JM
33532009-09-10 Jason Merrill <jason@redhat.com>
3354
3355 * directives.c (cpp_define): constify.
3356
fd2ab214
ILT
33572009-09-02 Ian Lance Taylor <iant@google.com>
3358
3359 * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
3360
df58e648
RW
33612009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3362
3363 * configure.ac (AC_PREREQ): Bump to 2.64.
3364
5213506e
RW
33652009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3366
3367 * aclocal.m4: Regenerate.
3368 * config.in: Regenerate.
3369 * configure: Regenerate.
3370
709a22df
TT
33712009-08-17 Tom Tromey <tromey@redhat.com>
3372
3373 PR preprocessor/41067:
3374 * charset.c (convert_escape): Add missing ":" to error text.
3375
0c539b47
DR
33762009-07-27 Douglas B Rupp <rupp@gnat.com>
3377
3378 * include/cpplib.h (INO_T_CPP): New macro.
3379 (struct cpp_dir): Use it.
3380
2b69c841
JQ
33812009-07-20 Jerry Quinn <jlquinn@optonline.net>
3382
3383 PR regression/40800
3384 * configure.ac: Use = instead of == for testing
3385 ENABLE_BUILD_WITH_CXX.
3386 * configure: Rebuild.
3387
f1bf410c
JQ
33882009-07-17 Jerry Quinn <jlquinn@optonline.net>
3389
3390 * directives.c (do_linemarker, do_line): Use CPP_STRING for
3391 ignored enum value.
3392 * files.c (find_file_in_dir): Add cast from void* to char*.
3393 * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
3394 * Makefile.in: (WARN_CFLAGS): Use general and C-specific
3395 warnings.
3396 (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
3397 ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
3398 COMPILER_FLAGS): New.
3399 (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
3400 (COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS
3401 instead of ALL_CFLAGS.
3402 * configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings
3403 from other warnings. Add -Wc++-compat to C-specific warnings.
3404 Check for --enable-build-with-cxx. Set and substitute
3405 ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES
3406 according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before
3407 AC_CHECK_HEADERS.
3408 * configure: Rebuild.
3409 * include/cpp-id-data.h: Remove extern "C".
3410 * include/line-map.h: Likewise.
3411 * include/mkdeps.h: Likewise.
3412 * include/symtab.h: Likewise.
3413 * internal.h: Likewise.
3414
a28fbdba
MLI
34152009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3416
3417 * directives.c (parse_include): Add location argument. Update all
3418 calls.
3419 (parse_answer): Likewise.
3420 (do_include_common): Error with exact location.
3421 (parse_assertion): Likewise.
3422
b506a5a2
MLI
34232009-06-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
3424
3425 * expr.c (num_div_op): Take explicit location.
3426
7d8847a4
ILT
34272009-06-17 Ian Lance Taylor <iant@google.com>
3428
3429 * include/cpplib.h (progname): Don't declare.
3430
3d8b2a98
ILT
34312009-06-12 Ian Lance Taylor <iant@google.com>
3432
3433 * include/cpplib.h (struct cpp_options): Add
3434 warn_cxx_operator_names field.
3435 (NODE_WARN_OPERATOR): Define.
3436 (struct cpp_hashnode): Increase flags field to 10 bits, decrease
3437 type to 6 bits.
3438 * init.c (mark_named_operators): Add flags parameter.
3439 (cpp_post_options): Pick flags value to pass to
3440 mark_named_operators.
3441 * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
3442 identifier is an operator name in C++.
3443
e74fe492
AH
34442009-06-01 Aldy Hernandez <aldyh@redhat.com>
3445
3446 * include/line-map.h (LAST_SOURCE_COLUMN): New.
3447
4851089f
ILT
34482009-06-01 Ian Lance Taylor <iant@google.com>
3449
3450 * include/cpp-id-data.h: Add extern "C".
3451 * include/line-map.h: Likewise.
3452 * include/mkdeps.h: Likewise.
3453 * include/symtab.h: Likewise.
3454 * internal.h: Likewise.
3455
7e5487a2
ILT
34562009-05-15 Ian Lance Taylor <iant@google.com>
3457
3458 * include/cpplib.h (enum cpp_builtin_type): Rename from enum
3459 builtin_type. Change all uses.
3460
00b0c19b
MLI
34612009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3462
3463 PR cpp/36674
3464 * directives (do_linemarker): Compensate for the increment in
3465 location that occurs when we reach the end of line.
3466 * files (_cpp_stack_include): Mention _cpp_find_file in the
3467 comment.
3468
9a0c6187
JM
34692009-05-10 Joseph Myers <joseph@codesourcery.com>
3470
3471 * include/cpplib.h (enum cpp_token_fld_kind): Add
3472 CPP_TOKEN_FLD_TOKEN_NO.
3473 (struct cpp_macro_arg, struct cpp_identifier): Define.
3474 (union cpp_token_u): Use struct cpp_identifier for identifiers.
3475 Use struct cpp_macro_arg for macro arguments. Add token_no for
3476 CPP_PASTE token numbers.
3477 * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
3478 do_pragma_poison, parse_assertion): Use val.node.node in place of
3479 val.node.
3480 * expr.c (parse_defined, eval_token): Use val.node.node in place
3481 of val.node.
3482 * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
3483 cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
3484 cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
3485 place of val.arg_no. Use val.node.node in place of val.node.
3486 * macro.c (replace_args, cpp_get_token, parse_params,
3487 lex_expansion_token, create_iso_definition, cpp_macro_definition):
3488 Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
3489 Use val.node.node in place of val.node.
3490
9e322bc1
JM
34912009-05-03 Joseph Myers <joseph@codesourcery.com>
3492
3493 * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
3494 UTF-8 sequences.
3495
f88d0772
JM
34962009-04-25 Joseph Myers <joseph@codesourcery.com>
3497
3498 PR preprocessor/39559
3499 * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
3500 constants larger than intmax_t in C99 mode.
3501
d1b38208
TG
35022009-04-21 Taras Glek <tglek@mozilla.com>
3503
3504 * include/cpp-id-data.h: Update GTY annotations to new syntax.
3505 * include/cpplib.h: Likewise.
3506 * include/line-map.h: Likewise.
3507 * include/symtab.h: Likewise.
3508
cfc93532
MLI
35092009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3510
3511 PR c++/14875
3512 * lex.c (cpp_type2name): Take a flags parameter. Call
3513 cpp_named_operator2name for named operators and cpp_digraph2name
3514 for digraphs.
3515 (cpp_digraph2name): New.
3516 (cpp_spell_token): Use it.
3517 (cpp_output_token): Likewise.
3518 * include/cpplib.h (cpp_type2name): Update declaration.
3519 * init.c (cpp_named_operator2name): New.
3520 * internal.h (cpp_named_operator2name): Declare.
3521
9c650d90
MLI
35222009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3523
3524 PR c++/13358
3525 * init.c (cpp_create_reader): Wlong_long is disabled by default.
3526 * expr.c (cpp_classify_number): Give different messages for C and
3527 C++ front-ends.
3528
aa508502
JM
35292009-04-19 Joseph Myers <joseph@codesourcery.com>
3530
3531 PR preprocessor/20078
3532 * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
3533 field.
3534 * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
3535 (struct cpp_token): Change flags to unsigned short.
3536 * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
3537 (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
3538 (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
3539 tokens.
3540 * macro.c (macro_real_token_count): New.
3541 (enter_macro_context, replace_args): Use macro_real_token_count.
3542 (create_iso_definition): Record whitespace surrounding and digraph
3543 spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
3544 Set extra_tokens and save CPP_PASTE tokens with arg_no set for
3545 multiple consecutive ## tokens.
3546 (_cpp_create_definition): Initialize extra_tokens.
3547 (cpp_macro_definition): Use macro_real_token_count.
3548
61cc8223
JM
35492009-04-18 Joseph Myers <joseph@codesourcery.com>
3550
3551 * directives.c (parse_include): Pass true to check_eol.
3552
c7f9c0b9
JM
35532009-04-18 Joseph Myers <joseph@codesourcery.com>
3554
3555 PR preprocessor/39646
3556 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
3557 * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
3558 * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
3559 place of LC_RENAME.
3560
a5cb563b
JM
35612009-04-18 Joseph Myers <joseph@codesourcery.com>
3562
3563 PR preprocessor/39647
3564 * directives.c (check_eol): Add parameter expand.
3565 (do_undef, parse_include, do_line, do_linemarker, do_ident,
3566 do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
3567 do_else, do_endif, do_assert, do_unassert): All callers changed.
3568 Pass true from do_line, false elsewhere.
3569
18f41a1b
JM
35702009-04-12 Joseph Myers <joseph@codesourcery.com>
3571
3572 PR preprocessor/31869
3573 * macro.c (stringify_arg): Handle NULL source token in padding
3574 token where previous padding token did not have source token with
3575 preceding whitespace.
3576
748086b7
JJ
35772009-04-09 Jakub Jelinek <jakub@redhat.com>
3578
3579 * Makefile.in: Change copyright header to refer to version
3580 3 of the GNU General Public License and to point readers at the
3581 COPYING3 file and the FSF's license web page.
3582 * charset.c: Likewise.
3583 * directives-only.c: Likewise.
3584 * directives.c: Likewise.
3585 * errors.c: Likewise.
3586 * expr.c: Likewise.
3587 * files.c: Likewise.
3588 * identifiers.c: Likewise.
3589 * include/cpp-id-data.h: Likewise.
3590 * include/cpplib.h: Likewise.
3591 * include/line-map.h: Likewise.
3592 * include/mkdeps.h: Likewise.
3593 * include/symtab.h: Likewise.
3594 * init.c: Likewise.
3595 * internal.h: Likewise.
3596 * lex.c: Likewise.
3597 * line-map.c: Likewise.
3598 * macro.c: Likewise.
3599 * makeucnid.c: Likewise.
3600 * mkdeps.c: Likewise.
3601 * pch.c: Likewise.
3602 * symtab.c: Likewise.
3603 * system.h: Likewise.
3604 * traditional.c: Likewise.
3605 * ucnid.tab: Likewise.
3606 * ucnid.h: Regenerate.
3607
eec49116
JJ
36082009-04-01 Janis Johnson <janis187@us.ibm.com>
3609
839a3b8a
JJ
3610 PR c/39027
3611 * include/cpplib.h (CPP_N_DEFAULT): Define.
3612 * expr.c (interpret_float_suffix): Recognize d or D for double,
3613 return new value for default.
3614 (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
3615
eec49116
JJ
3616 PR c/33466
3617 * expr.c (interpret_float_suffix): Reject invalid suffix that uses
3618 letters from decimal float and fixed-point suffixes.
3619
47580d22
JM
36202009-03-31 Joseph Myers <joseph@codesourcery.com>
3621
3622 PR preprocessor/15638
3623 * files.c (_cpp_find_file): Call open_file_failed after diagnosing
3624 invalid PCH.
3625 (open_file_failed): Make error for missing file fatal.
3626 * include/cpplib.h (CPP_DL_FATAL): Define.
3627
5a2df0fa
SV
36282009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net>
3629
3630 PR preprocessor/31932:
3631 * internal.h: Don't mention HAVE_ICONV_H.
3632 * configure, config.in: Rebuild.
3633 * configure.ac: Don't check for iconv.h.
3634
c1a8a3c6
TT
36352009-03-30 Tom Tromey <tromey@redhat.com>
3636
3637 PR preprocessor/39512:
3638 * line-map.c (linemap_init): Initialize 'reallocator' field.
3639
a37a7b8a
JJ
36402009-03-30 Jakub Jelinek <jakub@redhat.com>
3641
3642 PR target/39558
3643 * macro.c (cpp_get_token): If macro_to_expand returns NULL
3644 and used some tokens, add CPP_PADDING before next token.
3645
148e4216
JM
36462009-03-29 Joseph Myers <joseph@codesourcery.com>
3647
3648 PR preprocessor/34695
3649 * makedepend.c: Remove.
3650 * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
3651 (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
3652 * directives.c (cpp_errors): Remove.
3653 * errors.c (print_location, _cpp_begin_message, v_message):
3654 Remove.
3655 (cpp_error, cpp_error_with_line): Always use error callback.
3656 (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
3657 * include/cpplib.h (cpp_options): Remove pedantic_errors,
3658 inhibit_warnings, warn_system_headers, inhibit_errors,
3659 warnings_are_errors, client_diagnostic.
3660 (cpp_callbacks): Add extra arguments to error callback; make it
3661 return bool.
3662 (cpp_finish): Return void.
3663 (cpp_destroy): Remove inaccurate comment about return value.
3664 (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
3665 (CPP_DL_NOTE): Define.
3666 * include/line-map.h (linemap_print_containing_files): Remove.
3667 * init.c (cpp_finish): Do not check for or return number of
3668 errors.
3669 * internal.h (cpp_reader): Remove errors field.
3670 * line-map.c (linemap_print_containing_files): Remove.
3671 * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
3672 about previous definition. Only emit it if previous diagnostic
3673 was emitted.
3674
f1450211
JM
36752009-03-28 Joseph Myers <joseph@codesourcery.com>
3676
3677 * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
3678 mkinstalldirs.
3679
8f5929e1
JJ
36802009-03-18 Jakub Jelinek <jakub@redhat.com>
3681
3682 * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
3683
4bb09c26
JM
36842009-02-21 Joseph Myers <joseph@codesourcery.com>
3685
3686 * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
3687 header name.
3688 (_cpp_lex_direct): Handle this.
3689
68c9ab45
RG
36902009-02-15 Richard Guenther <rguenther@suse.de>
3691
3692 Revert last change.
3693
601b3e1a
RG
36942009-02-13 Richard Guenther <rguenther@suse.de>
3695
3696 * configure.ac: Enable LFS.
3697 * configure: Re-generate.
3698 * config.in: Likewise.
3699
fc0cd180
BE
37002009-01-05 Ben Elliston <bje@au.ibm.com>
3701
3702 * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
3703 (.po.pox): Likewise.
3704 (po/$(PACKAGE).pot): Likewise.
3705
db89a3be
AO
37062008-12-10 Alexandre Oliva <aoliva@redhat.com>
3707
3708 PR target/37033
3709 * pch.c (cpp_valid_state): Improve message for poisoned symbols.
3710 Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
3711
cc955282
JM
37122008-11-29 Joseph Myers <joseph@codesourcery.com>
3713
3714 * lex.c (cpp_token_len): Use 6 as default length.
3715
47960aaf
MLI
37162008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org>
3717
3718 * expr.c (struct op): Add location.
3719 (_cpp_parse_expr): Propagate locations throught the stack
3720 of expressions.
3721 (reduce): Likewise.
3722 (check_promotion): Use explicit location in errors.
3723
631d0d36
MG
37242008-10-05 Matthew Gingell <gingell@adacore.com>
3725 Arnaud Charlet <charlet@adacore.com>
3726
3727 * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
3728 (cpp_get_comments): New function.
3729 * internal.h (struct cpp_reader): Add comments field.
3730 * init.c (cpp_destroy): Free comments.
3731 * lex.c (store_comment, cpp_get_comments): New functions.
3732 (comments): New struct.
3733 (save_comment): Store comments in comments struct.
3734
c047ce93
SB
37352008-09-18 Simon Baldwin <simonb@google.com>
3736
3737 * include/cpplib.h (struct cpp_options): Add new boolean flag
3738 warn_builtin_macro_redefined.
3739 * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
3740 * (struct builtin_operator): Split out from previous struct builtin,
3741 enhance extra const correctness.
3742 * (struct builtin_macro): Split out from previous struct builtin, add
3743 new always_warn_if_redefined flag, enhance const correctness.
3744 * (mark_named_operators): Use struct builtin_operator.
3745 * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
3746 to builtins selectively.
3747 * macro.c (warn_of_redefinition): Return false if a builtin macro
3748 is not flagged with NODE_WARN.
3749
affa55c6
JJ
37502008-07-31 Jakub Jelinek <jakub@redhat.com>
3751
3752 PR preprocessor/36649
3753 * files.c (struct report_missing_guard_data): New type.
3754 (report_missing_guard): Put paths into an array instead of printing
3755 them right away. Return 1 rather than 0.
3756 (report_missing_guard_cmp): New function.
3757 (_cpp_report_missing_guards): Sort and print paths gathered by
3758 report_missing_guard callback.
3759
3b8f20a1
MLI
37602008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3761
3762 PR 28079
3763 * directives.c (strtolinenum): Handle overflow.
3764 (do_line): Give a warning if line number overflowed.
3765 (do_linemarker): Update call to strtolinenum.
3766
1bb64668
MLI
37672008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3768
3769 * include/line-map.h (linenum_type): New typedef.
3770 (struct line_map): Use it.
3771 (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
3772 (SOURCE_COLUMN): Likewise.
3773 * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
3774 source_location values in a variable of type linenum_type.
3775 * directives.c (struct if_stack): Use linenum_type.
3776 (strtoul_for_line): Rename as strtolinenum.
3777 (do_line): Use linenum_type.
3778 (do_linemarker): Use linenum_type and strtolinenum.
3779 (_cpp_do_file_change): Use linenum_t.
3780 * line-map.c (linemap_add): Likewise.
3781 (linemap_line_start): Likewise.
3782 * traditional.c (struct fun_macro): 'line' is a source_location.
3783 * errors.c (print_location): Use linenum_type.
3784 * directives-only.c (_cpp_preprocess_dir_only): Likewise.
3785 * internal.h (CPP_INCREMENT_LINE): Likewise.
3786 * lex.c (_cpp_skip_block_comment): Use source_location.
19a9ba64 3787
5950c3c9
BE
37882008-07-14 Ben Elliston <bje@au.ibm.com>
3789
3790 * include/cpplib.h (NODE_CONDITIONAL): New.
3791 (struct cpp_callbacks): New macro_to_expand field.
3792 (struct cpp_hashnode): Adjust size of flags and type fields.
3793 (cpp_peek_token): Prototype.
3794 * lex.c (cpp_peek_token): New function.
3795 (_cpp_temp_token): Protect pre-existing lookaheads.
3796 * macro.c (cpp_get_token): Expand any conditional macros.
3797 (_cpp_backup_tokens_direct): New.
3798 (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
3799 (warn_of_redefinition): Silently allow redefined conditional
3800 macros.
3801 (_cpp_create_definition): Remove the conditional flag when a user
3802 defines one of the conditional macros.
3803 * internal.h (_cpp_backup_tokens_direct): New prototype.
3804
e85edc9e
AH
38052008-06-13 Andrew Haley <aph@redhat.com>
3806
3807 PR preprocessor/33305
3808 * macro.c (replace_args): Print a warning for empty macro
3809 arguments in C89 and C++.
3810
18c04407
RW
38112008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3812
3813 * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
3814 * configure: Regenerate.
3815
2d09b640
RW
38162008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3817
3818 * Makefile.in (datarootdir): New variable.
3819
0b7c73cc
L
38202008-06-12 H.J. Lu <hongjiu.lu@intel.com>
3821
3822 PR preprocessor/36479
3823 * charset.c (cpp_interpret_string_notranslate): Also set
3824 narrow_cset_desc.width.
3825
cd985f66
JM
38262008-06-07 Joseph Myers <joseph@codesourcery.com>
3827
3828 * configure.ac (parisc*64*-*-*): Remove.
3829 * configure: Regenerate.
3830
d750887f
TT
38312008-05-30 Tom Tromey <tromey@redhat.com>
3832
3833 PR preprocessor/36320:
3834 * internal.h (_cpp_parse_expr): Update.
3835 * expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error
3836 messages.
3837 * directives.c (do_if): Update.
3838 (do_elif): Require expression if processing group.
3839
c100de59
DS
38402008-05-30 Danny Smith <dannysmith@users.sourceforge.net>
3841
3842 * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
3843
5d6342eb
TT
38442008-05-21 Tom Tromey <tromey@redhat.com>
3845
3846 PR preprocessor/27777:
3847 * lex.c (cpp_output_line_to_string): New function.
3848 * internal.h (_cpp_begin_message): Don't declare.
3849 * errors.c (_cpp_begin_message): Now static.
3850 * include/cpplib.h (cpp_output_line_to_string): Declare.
3851 * directives.c (do_diagnostic): Rewrote. Use
3852 cpp_output_line_to_string. Don't use _cpp_begin_message.
3853
dae4174e
TT
38542008-05-21 Tom Tromey <tromey@redhat.com>
3855
3856 * include/symtab.h (HT_ALLOCED): Remove.
3857 (ht_purge): Declare.
3858 * symtab.c (DELETED): New define.
3859 (ht_lookup): Update comment.
3860 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED
3861 code. Use subobject allocator for strings, if it exists.
3862 (ht_expand): Handle deleted entries.
3863 (ht_forall): Likewise.
3864 (ht_purge): New function.
3865 (ht_dump_statistics): Print deletion statistics.
3866
899015a0
TT
38672008-05-13 Tom Tromey <tromey@redhat.com>
3868
3869 PR preprocessor/22168:
3870 * include/cpplib.h (struct cpp_options) <objc>: Update
3871 documentation.
3872 * expr.c (eval_token): Warn for use of assertions.
3873 * directives.c (directive_diagnostics): Warn about extensions.
3874 (DEPRECATED): New define.
3875 (DIRECTIVE_TABLE): Use it.
3876
71c10038
TT
38772008-05-06 Tom Tromey <tromey@redhat.com>
3878
3879 PR preprocessor/35313, PR preprocessor/36088:
3880 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
3881 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
3882
2bd0fe3d
DM
38832008-05-04 David S. Miller <davem@davemloft.net>
3884
3885 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
3886 * configure: Regenerate.
3887
28f68625
DF
38882008-04-22 Daniel Franke <franke.daniel@gmail.com>
3889
3890 * include/cpplib.h (cpp_define_formatted): New.
3891 * directives.c (cpp_define_formatted): New.
3892
688e7a53
TT
38932008-04-21 Tom Tromey <tromey@redhat.com>
3894
3895 PR libcpp/33415:
3896 * charset.c (_cpp_convert_input): Add buffer_start argument.
3897 Ignore UTF-8 BOM if seen.
3898 * internal.h (_cpp_convert_input): Add argument.
3899 * files.c (struct _cpp_file) <buffer_start>: New field.
3900 (destroy_cpp_file): Free buffer_start, not buffer.
3901 (_cpp_pop_file_buffer): Likewise.
3902 (read_file_guts): Update.
3903
b6baa67d
KVH
39042008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
3905
3906 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
3907 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
3908 (struct cpp_options): Added uliterals.
3909 (cpp_interpret_string): Update prototype.
3910 (cpp_interpret_string_notranslate): Idem.
3911 * charset.c (init_iconv_desc): New width member in cset_converter.
3912 (cpp_init_iconv): Add support for char{16,32}_cset_desc.
3913 (convert_ucn): Idem.
3914 (emit_numeric_escape): Idem.
3915 (convert_hex): Idem.
3916 (convert_oct): Idem.
3917 (convert_escape): Idem.
3918 (converter_for_type): New function.
3919 (cpp_interpret_string): Use converter_for_type, support u and U prefix.
3920 (cpp_interpret_string_notranslate): Match changed prototype.
3921 (wide_str_to_charconst): Use converter_for_type.
3922 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
3923 * directives.c (linemarker_dir): Macro U changed to UC.
3924 (parse_include): Idem.
3925 (register_pragma_1): Idem.
3926 (restore_registered_pragmas): Idem.
3927 (get__Pragma_string): Support CPP_STRING{16,32}.
3928 * expr.c (eval_token): Support CPP_CHAR{16,32}.
3929 * init.c (struct lang_flags): Added uliterals.
3930 (lang_defaults): Idem.
3931 * internal.h (struct cset_converter) <width>: New field.
3932 (struct cpp_reader) <char16_cset_desc>: Idem.
3933 (struct cpp_reader) <char32_cset_desc>: Idem.
3934 * lex.c (digraph_spellings): Macro U changed to UC.
3935 (OP, TK): Idem.
3936 (lex_string): Add support for u'...', U'...', u"..." and U"...".
3937 (_cpp_lex_direct): Idem.
3938 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
3939 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
3940
deb984e6
PB
39412008-04-18 Paolo Bonzini <bonzini@gnu.org>
3942
3943 PR bootstrap/35457
3944 * aclocal.m4: Regenerate.
3945 * configure: Regenerate.
3946
bf048bea
TT
39472008-04-17 Tom Tromey <tromey@redhat.com>
3948
3949 PR libcpp/34866:
3950 * errors.c (cpp_error): Don't reference a token before the start
3951 of the current run.
3952
7f27b0f8
TT
39532008-04-16 Tom Tromey <tromey@redhat.com>
3954
3955 * Makefile.in (TAGS_SOURCES): New variable.
3956 (TAGS): New target.
3957
a1fcb9a1
KK
39582008-04-11 Kaz Kojima <kkojima@gcc.gnu.org>
3959
3960 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
3961 and shbe-*-*.
3962 * configure: Rebuilt.
3963
93d45d9e
JM
39642008-04-02 Joseph Myers <joseph@codesourcery.com>
3965
3966 * include/cpplib.h (struct cpp_callbacks): Add used_define,
3967 used_undef and before_define.
3968 (NODE_USED): Define.
3969 * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
3970 do_ifndef, cpp_pop_definition): Handle new flag and use new
3971 callbacks.
3972 * expr.c (parse_defined): Handle new flag and use new callbacks.
3973 * macro.c (enter_macro_context, _cpp_free_definition): Handle new
3974 flag and use new callbacks.
3975
d4c32e1d
JJ
39762008-04-01 Jakub Jelinek <jakub@redhat.com>
3977
3978 PR pch/13675
3979 * files.c (struct _cpp_file): Remove pch field.
3980 (pch_open_file): Don't set file->pch, just file->pchname.
3981 (should_stack_file): After pfile->cb.read_pch call
3982 free pchname and clear pchname, don't close file->fd.
3983 Test file->pchname instead of file->pch. Don't close fd after cb.
3984 (_cpp_stack_include): Test file->pchname instead of file->pch.
3985
161031e3
TT
39862008-03-28 Tom Tromey <tromey@redhat.com>
3987
3988 * Makefile.in (POSTCOMPILE): New variable.
3989 (.c.o): Use it.
3990
14ccf800
TT
39912008-03-13 Tom Tromey <tromey@redhat.com>
3992
3993 PR libcpp/35322:
3994 * directives.c (destringize_and_run): Set pfile->directive.
3995
830465c6
MM
39962008-03-06 Markus Milleder <markus.milleder@generali.at>
3997
3998 PR preprocessor/35458
3999 * mkdeps.c (munge): Quote '#' with a '\'.
4000
d482a073
RW
40012008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4002
4003 PR preprocessor/35379
4004 * mkdeps.c (deps_write): Ensure the first target always appears
4005 in the first column, without leading backslash newline. Avoid
4006 some more extra whitespace.
4007
185a6cc1
TS
40082008-02-25 Thiemo Seufer <ths@mips.com>
4009
d482a073 4010 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
185a6cc1 4011
2bf41bf0
TT
40122008-02-19 Tom Tromey <tromey@redhat.com>
4013
4014 * traditional.c (lex_identifier): Use CPP_HASHNODE.
4015 * lex.c (lex_identifier): Use CPP_HASHNODE.
4016 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
4017 do-while.
4018 * identifiers.c (alloc_node): Change return type.
4019 (_cpp_init_hashtable): Don't cast 'alloc_node'.
4020 (proxy_assertion_broken): New declaration.
4021 (cpp_forall_identifiers): Move comment.
4022 * line-map.c (linemap_add): Comment fix.
4023 (linemap_line_start): Indentation fix.
4024
765d600a
JJ
40252008-01-25 Jakub Jelinek <jakub@redhat.com>
4026
4027 PR preprocessor/34692
4028 * macro.c (collect_args): Add pragma_buff argument. Push
4029 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
4030 than into arguments. Reset prevent_expansion and parsing_args
4031 state at CPP_PRAGMA_EOL/CPP_EOF.
4032 (funlike_invocation_p): Add pragma_buff argument, pass it through
4033 to collect_args.
4034 (enter_macro_context): Add result argument. Adjust
4035 funlike_invocation_p caller. Emit all deferred pragma tokens
4036 gathered during collect_args before the expansion, add a padding
4037 token. Return 2 instead of 1 if any pragma tokens were prepended.
4038 (cpp_get_token): If enter_macro_context returns 2, don't return
4039 a padding token, instead cycle to grab CPP_PRAGMA token.
4040 * directives.c (_cpp_handle_directive): If was_parsing_args
4041 in deferred pragma, leave parsing_args and prevent_expansion as is.
4042
ec46053b
TT
40432008-01-22 Tom Tromey <tromey@redhat.com>
4044
765d600a 4045 PR c++/34859
ec46053b
TT
4046 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
4047 __STDC_CONSTANT_MACROS.
4048
681c6ab0
FF
40492008-01-07 Fred Fish <fnf@specifix.com>
4050
765d600a 4051 PR preprocessor/30363
681c6ab0 4052 * traditional.c (replace_args_and_push): Add local variable
19a9ba64 4053 cxtquote, calculate the replacement text size assuming a
681c6ab0
FF
4054 worst case of every input character quoted with backslash,
4055 and properly handle output quoting of quote characters in
4056 actual arguments used in function-like macros.
4057
33ae4837
TT
40582008-01-03 Tom Tromey <tromey@redhat.com>
4059
765d600a 4060 PR preprocessor/34602
33ae4837
TT
4061 * directives.c (do_line): Don't try to spell EOF token.
4062 (do_linemarker): Add comment.
4063
675575f5
DD
40642007-12-11 DJ Delorie <dj@redhat.com>
4065
4066 * charset.c (convert_using_iconv): Close out any shift states,
4067 returning to the initial state.
4068
97f6bd40
TT
40692007-12-06 Tom Tromey <tromey@redhat.com>
4070
765d600a 4071 PR c/29172
97f6bd40
TT
4072 * internal.h (struct cpp_reader) <file_hash_entries>: Changed
4073 type.
4074 <file_hash_entries_allocated, file_hash_entries_used>: Removed.
4075 * files.c (FILE_HASH_POOL_SIZE): New macro.
4076 (struct file_hash_entry_pool): New.
4077 (destroy_all_cpp_files): New function.
4078 (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
4079 (new_file_hash_entry): Update.
4080 (free_file_hash_entries): New function.
4081 (_cpp_cleanup_files): Call free_file_hash_entries and
4082 destroy_all_cpp_files.
4083 (cpp_clear_file_cache): New function.
4084 * include/cpplib.h (cpp_clear_file_cache): Declare.
4085
d56a25e1
TT
40862007-12-03 Tom Tromey <tromey@redhat.com>
4087
765d600a 4088 PR preprocessor/34288
d56a25e1
TT
4089 * configure.ac, config.in: Rebuilt.
4090 * configure.ac: Check for ssize_t.
4091
607f74e9
TT
40922007-11-30 Tom Tromey <tromey@redhat.com>
4093
765d600a 4094 PR preprocessor/32868
607f74e9
TT
4095 * macro.c (_cpp_create_definition): Special case
4096 __STDC_FORMAT_MACROS.
4097
b0f4807f
MM
40982007-11-16 Michael Matz <matz@suse.de>
4099
4100 * files.c (search_path_head): Fix check for absolute paths.
4101
f1e20710
TT
41022007-11-11 Tom Tromey <tromey@redhat.com>
4103
765d600a 4104 PR c++/17557
f1e20710
TT
4105 * include/cpplib.h (cpp_included_before): Declare.
4106 * files.c (struct file_hash_entry) <location>: New field.
4107 (_cpp_find_file): Initialize new field.
4108 (make_cpp_dir): Likewise.
4109 (cpp_included_before): New function.
4110
f373b44d
TT
41112007-11-01 Tom Tromey <tromey@redhat.com>
4112
765d600a 4113 PR preprocessor/30805
f373b44d
TT
4114 * macro.c (paste_tokens): Handle padding token.
4115 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
4116
5b9a40df
TT
41172007-10-31 Tom Tromey <tromey@redhat.com>
4118
765d600a 4119 PR preprocessor/30786
5b9a40df
TT
4120 * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
4121 * directives.c (_cpp_do__Pragma): Return error status.
4122 * internal.h (_cpp_do__Pragma): Update.
4123 * directives.c (get__Pragma_string): Back up if EOF seen.
4124
5ffeb913
TT
41252007-09-06 Tom Tromey <tromey@redhat.com>
4126
4127 * internal.h (struct cpp_reader) <invocation_location>: New
4128 field.
4129 (struct cpp_reader) <set_invocation_location>: Likewise.
4130 * init.c (cpp_set_line_map): New function.
4131 * line-map.c (linemap_add): Use linemap's allocator.
4132 * include/line-map.h (GTY): Define.
4133 (line_map_realloc): New typedef.
4134 (struct line_map): Mark with GTY.
4135 (struct line_maps): Likewise.
4136 (struct line_maps) <maps>: Likewise.
4137 (struct line_maps) <reallocator>: New field.
4138 * include/symtab.h (GTY): Conditionally define.
4139 * include/cpplib.h (cpp_set_line_map): Declare.
4140 (cpp_get_token_with_location): Declare.
4141 * macro.c (cpp_get_token): Set invocation_location on the reader.
4142 (cpp_get_token_with_location): New function.
4143
ac6b1c67
CF
41442007-08-30 Chao-ying Fu <fu@mips.com>
4145
4146 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
4147 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
4148 (cpp_classify_number): Support decimal fixed-point constants without
4149 exponents.
4150 Warn about fixed-point constants when -pedantic.
4151 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
4152 comments to support fixed-point values.
4153 (CPP_N_FRACT, CPP_N_ACCUM): Define.
4154
cda5e672
TT
41552007-08-18 Tom Tromey <tromey@redhat.com>
4156
765d600a 4157 PR preprocessor/32974
cda5e672
TT
4158 * directives.c (parse_include): Don't check for EOL when
4159 processing #pragma dependency.
4160
ccfc4c91
OW
41612007-07-30 Ollie Wild <aaw@google.com>
4162
4163 * directives-only.c: New file.
4164 * internal.h (struct _cpp_dir_only_callbacks): New.
4165 (_cpp_preprocess_dir_only): New function.
4166 * directives.c (_cpp_handle_directive): Check directives_only before
4167 disabling execution of indented directives.
4168 * files.c (_cpp_stack_file): Add directives_only check.
4169 * include/cpplib.h (struct cpp_options): Add directives_only.
4170 (cpp_init_special_builtins): New function.
4171 * init.c (cpp_init_special_builtins): New function.
4172 (cpp_init_builtins): Move builtin_array initialization to
4173 cpp_init_special_builtins.
4174 (post_options): Check directives_only before setting
4175 pfile->state.prevent_expansion = 1.
4176 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
4177 is expanded inside a directive while -fdirectives-only is enabled.
4178 * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
4179 (libcpp_a_SOURCES): Add directives-only.c.
4180
a206413a
UB
41812007-07-04 Uros Bizjak <ubizjak@gmail.com>
4182
4183 * traditional.c (_cpp_scan_out_logical_line): Initialize
4184 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
4185 fmacro.args to prevent 'may be used uninitialized' warning.
4186
c77cd3d1
UB
41872007-07-03 Uros Bizjak <ubizjak@gmail.com>
4188
4189 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
4190 Add new constants.
4191 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
4192 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
4193 for 'q' or 'Q' suffixes.
4194
66938a1d
DS
41952007-06-17 Danny Smith <dannysmith@users.sourceforge.net
4196
e1311401 4197 * files.c (open_file): Correct typo.
66938a1d 4198
71995ede
VP
41992007-06-16 Vladimir Prus <vladimir@codesourcery.com>
4200
e1311401 4201 * files.c (open_file): Prevent the call
71995ede
VP
4202 for stat from overwriting errno.
4203
84152c25
VP
42042007-06-09 Vladimir Prus <vladimir@codesourcery.com>
4205
e1311401 4206 * files.c (open_file): Account for the
19a9ba64
AM
4207 fact that on windows, opening a directory gives
4208 EACCES.
84152c25 4209
f7fd775f
JW
42102007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
4211
4212 PR preprocessor/23479
4213 * expr.c (cpp_classify_number): Implement 0b-prefixed binary
4214 integer constants.
4215 (append_digit): Likewise.
4216 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
4217 binary integer constants.
4218
ed0e74e0
DK
42192007-05-31 Dave Korn <dave.korn@artimi.com>
4220
4221 PR preprocessor/14331
4222 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
4223
a702045a
OW
42242007-05-24 Ollie Wild <aaw@google.com>
4225
4226 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
4227 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
4228 (cpp_write_pch_state): Save __COUNTER__ state.
4229 (cpp_valid_state): Check valid __COUNTER__ state.
4230 (cpp_read_state): Read new __COUNTER__ state.
4231 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
4232 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
4233 * internal.h (struct cpp_reader): Add counter member.
4234
126e073b
SM
42352007-05-23 Simon Martin <simartin@users.sourceforge.net>
4236
4237 PR preprocessor/20077
4238 * macro.c (create_iso_definition): Fixed the method to determine
4239 whether the token-pasting operator appears at the beginning or the end
4240 of a macro.
4241
0b4cafec
ILT
42422007-05-21 Ian Lance Taylor <iant@google.com>
4243
4244 * internal.h (struct cpp_reader): Add new fields:
4245 nonexistent_file_hash and nonexistent_file_ob.
4246 * files.c: Include "obstack.h".
4247 (find_file_in_dir): Before trying to open the file, look up the
4248 path name in the hash table of nonexistent files. After failing
4249 to open the file, add the path name to the hash table.
4250 (_cpp_find_file): Cache the results of looking up the file name
4251 starting with the quote and bracket chain heads, if we can.
4252 (nonexistent_file_hash_eq): New static function.
4253 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
4254 pfile->nonexistent_file_ob.
4255 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
4256 pfile->nonexistent_file_ob.
4257
30e04921
JJ
42582007-05-14 Janis Johnson <janis187@us.ibm.com>
4259
19a9ba64 4260 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
5a6bb57e 4261
30e04921
JJ
4262 PR c/31924
4263 * expr.c (interpret_float_suffix): Check for invalid suffix.
4264
22a8a52d
EC
42652007-05-02 Eric Christopher <echristo@apple.com>
4266
4267 * expr.c (num_div_op): Don't overflow if the result is
4268 zero.
4269
fca35e1b
TT
42702007-05-02 Tom Tromey <tromey@redhat.com>
4271
765d600a 4272 PR preprocessor/28709
fca35e1b
TT
4273 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
4274
4cd97075
MM
42752007-03-30 Michael Meissner <michael.meissner@amd.com>
4276
4277 * directives.c (lex_macro_node_from_str): Fix alloca call to be
4278 type correct.
4279
121de39f
RH
42802007-03-30 Richard Henderson <rth@redhat.com>
4281
4282 * directives.c (lex_macro_node_from_str): New.
4283 (cpp_push_definition, cpp_pop_definition): New.
4284 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
4285
4fcb360b
BM
42862007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
4287
4288 * Makefile.in: Add dummy install-pdf target.
4289
67e64439
TT
42902007-01-30 Tom Tromey <tromey@redhat.com>
4291
765d600a 4292 PR preprocessor/30468
67e64439
TT
4293 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
4294 './'.
4295
ee380365
TT
42962007-01-30 Tom Tromey <tromey@redhat.com>
4297
765d600a 4298 PR preprocessor/29966
ee380365
TT
4299 * macro.c (lex_expansion_token): Save and restore cpp_reader's
4300 cur_token.
4301 (_cpp_create_definition): Don't restore cur_token here.
4302 * lex.c (_cpp_lex_token): Added assertion.
4303
024abeb3
TT
43042007-01-27 Tom Tromey <tromey@redhat.com>
4305
4306 * configure: Rebuilt.
4307
ee1c2a10
TT
43082007-01-12 Tom Tromey <tromey@redhat.com>
4309
765d600a 4310 PR preprocessor/28227
ee1c2a10
TT
4311 * directives.c (lex_macro_node): Added 'is_def_or_undef'
4312 argument.
4313 (do_define): Update.
4314 (do_undef): Update.
4315 (do_ifdef): Update.
4316 (do_ifndef): Update.
4317
67214c16
PB
43182007-01-11 Paolo Bonzini <bonzini@gnu.org>
4319
4320 * configure: Regenerate.
4321
1aa6ca40
PB
43222007-01-11 Paolo Bonzini <bonzini@gnu.org>
4323
4324 * configure: Regenerate.
4325
705e2d28
TT
43262007-01-04 Tom Tromey <tromey@redhat.com>
4327
765d600a 4328 PR preprocessor/28165
705e2d28
TT
4329 * internal.h (cpp_in_primary_file): New function.
4330 * directives.c (do_include_next): Use cpp_in_primary_file.
4331 (do_pragma_once): Likewise.
4332 (do_pragma_system_header): Likewise.
4333
7af45bd4
ILT
43342006-12-29 Ian Lance Taylor <iant@google.com>
4335
4336 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
4337 look backward at the end of the line unless we saw a backslash.
4338
9d30f270
JJ
43392006-12-29 Jakub Jelinek <jakub@redhat.com>
4340
4341 PR preprocessor/29612
4342 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
4343 only when new_sysp is non-zero.
4344
30b0edc0
TT
43452006-12-28 Tom Tromey <tromey@redhat.com>
4346
765d600a 4347 PR preprocessor/30001
30b0edc0
TT
4348 * charset.c (_cpp_convert_input): Check that to.len is greater
4349 than zero.
4350
85d9c13c
TS
43512006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
4352
4353 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
83cc06b2 4354 * configure: Rebuilt.
85d9c13c 4355
dfafdaa6
DG
43562006-11-01 Douglas Gregor <doug.gregor@gmail.com>
4357
4358 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
4359 for experimental C++0x mode.
4360 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
4361 adopted the preprocessor changes introduced in C99.
4362
0f45f0f5
JM
43632006-10-29 Joseph Myers <joseph@codesourcery.com>
4364
4365 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
4366 depending on --enable-targets=all.
4367 * configure: Regenerate.
4368
de000d22
JJ
43692006-10-12 Jakub Jelinek <jakub@redhat.com>
4370
4371 PR preprocessor/28709
4372 * macro.c (paste_tokens): Do error reporting here, use BUF with the
4373 spelled LHS token as opposed to spelling it again.
4374 (paste_all_tokens): Don't report errors here, just break on failure.
4375
b5422ad7
BM
43762006-10-10 Brooks Moses <bmoses@stanford.edu>
4377
4378 * Makefile.in: Added empty "pdf" target.
4379
aaf50ff2
GK
43802006-09-22 Geoffrey Keating <geoffk@apple.com>
4381
4382 * configure.ac: Make need_64_bit_hwint case for x86-darwin
4383 match exactly the glob in gcc/config.gcc.
4384 * configure: Regenerate.
4385
c663e301
JM
43862006-09-13 Joseph S. Myers <joseph@codesourcery.com>
4387
4388 PR c/28768
4389 PR preprocessor/14634
4390 * lex.c (lex_string): Pedwarn for unterminated literals.
4391
f7288899
EC
43922006-09-08 Eric Christopher <echristo@apple.com>
4393
4394 * configure.ac: Add 64-bit HWI support for i?86-darwin.
4395
b52dbbf8
SE
43962006-08-14 Steve Ellcey <sje@cup.hp.com>
4397
4398 PR c++/28288
4399 PR c++/14556
4400 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
4401 (CPP_LAST_EQ): Change.
4402 (CPP_LAST_PUNCTUATOR): Change.
4403 * expr.c (cpp_operator): Remove MIN and MAX.
4404 (reduce): Remove CPP_MIN and CPP_MAX.
4405 (num_binary_op): Ditto.
4406 * lex.c (_cpp_lex_direct): Ditto.
4407 (cpp_avoid_paste): Remove ? as legal symbol after > or <.
4408
1c90c6f9
JJ
44092006-06-09 Jakub Jelinek <jakub@redhat.com>
4410
4411 PR preprocessor/27746
4412 * directives.c (do_pragma): Handle pragma with valid namespace
4413 and invalid name coming from macro expansion.
4414 * directives.c (destringize_and_run): Initialize next field in
4415 context.
4416
4417 PR c/27747
4418 PR c++/27748
4419 * directives.c (destringize_and_run): Set NO_EXPAND on the
4420 tokens.
4421
4422 * macro.c (_cpp_backup_tokens): Fix comment typo.
4423
5c3c3683
DJ
44242006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
4425
4426 * Makefile.in (CATALOGS): Add po/ prefix.
4427 * configure: Regenerated.
4428
b2bd74bc
CD
44292006-05-23 Carlos O'Donell <carlos@codesourcery.com>
4430
4431 * Makefile.in: Add install-html target. Add install-html to .PHONY
4432
be8ac3e2
GZ
44332006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
4434
4435 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
4436 * files.c (_cpp_get_file_stat): New function.
4437 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
4438 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
4439 * internal.h (_cpp_get_file_stat): Prototype.
4440 (struct cpp_buffer): Add timestamp.
4441
83900997
JJ
44422006-01-23 Jakub Jelinek <jakub@redhat.com>
4443
4444 PR preprocessor/25717
4445 * init.c (cpp_init_builtins): If __STDC__ will not change value
4446 between system headers and other sources, define it as a normal
4447 macro rather than a builtin.
4448 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
4449 cpp_in_system_header condition.
4450
44512006-01-05 Paolo Bonzini <bonzini@gnu.org>
9220c30c
PB
4452
4453 * Makefile.in: Use -MMD instead of -MD.
4454
bc4071dd
RH
44552006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
4456 Richard Henderson <rth@redhat.com>
4457
4458 Merge from gomp branch:
4459 * directives.c (struct pragma_entry): Add is_deferred. Add ident
4460 entry to value union.
4461 (end_directive): Don't eat the line if in_deferred_pragma.
4462 (run_directive): Remove pragma hacks.
4463 (insert_pragma_entry): Remove.
4464 (new_pragma_entry): New.
4465 (register_pragma_1): Split out of register_pragma. Only handle
4466 the lookup tree and return the new entry.
4467 (cpp_register_pragma): Fill in the pragma entry here.
4468 (cpp_register_deferred_pragma): New.
4469 (register_pragma_internal): New.
4470 (_cpp_init_internal_pragmas): Use register_pragma_internal.
4471 (do_pragma): Allow pragma expansion after namespace. For deferred
4472 pragmas, don't slurp the line into a string.
4473 (destringize_and_run): Save tokens for deferred pragmas.
4474 (cpp_handle_deferred_pragma): Remove.
4475 * macro.c (builtin_macro): Remove pragma token hack.
4476 (_cpp_push_token_context): Rename from push_token_context and export.
4477 * internal.h (struct lexer_state): Add pragma_allow_expansion.
4478 (_cpp_push_token_context): Declare.
4479 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
4480 a token. Update the line number correctly if so.
4481 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
4482 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
4483 * include/cpplib.h (PRAGMA_EOL): New.
4484 (CPP_TOKEN_FLD_PRAGMA): New.
4485 (struct cpp_token): Add val.pragma.
4486 (struct cpp_options): Remove defer_pragmas.
4487 (cpp_handle_deferred_pragma): Remove.
4488 (cpp_register_deferred_pragma): Declare.
4489
d09e893f
JJ
44902006-01-01 Jakub Jelinek <jakub@redhat.com>
4491
4492 PR c++/25294
4493 * directives.c (do_pragma): If pragma line ends with multi-line
4494 block comment, end the saved deferred pragma string before that
4495 comment. Handle embedded '\0' chars on the pragma line.
4496
ab84748a
VR
44972005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
4498
4499 PR c++/23333
4500 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
4501
ad6ed77e
JG
45022005-12-07 Jon Grimm <jgrimm2@us.ibm.com>
4503 Ben Elliston <bje@au.ibm.com>
4504
4505 * include/cpplib.h (CPP_N_DFLOAT): New.
4506 * expr.c (interpret_float_suffix): Identify df, dd, and dl
4507 suffixes as decimal floating point constants.
4508 (cpp_classify_number): Disallow hexadecimal DFP constants.
4509
ba096620 45102005-11-14 Gerald Pfeifer <gerald@pfeifer.com>
bc4071dd 4511 Ian Lance Taylor <ian@airs.com>
ba096620
GP
4512
4513 * include/cpplib.h (struct cpp_callbacks): Annotate error with
4514 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
4515
456b8ce5
UB
45162005-11-09 Per Bothner <per@bothner.com>
4517 Uros Bizjak <uros@kss-loka.si>
f7288899 4518
456b8ce5
UB
4519 PR c/24101
4520 * init.c (read_original_filename): Temporarily set
4521 state.in_directive before calling _cpp_lex_direct for
4522 CPP_HASH tokens.
4523
5571f74f
JW
45242005-11-03 James E Wilson <wilson@specifix.com>
4525
4526 PR preprocessor/24202
4527 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
4528
a63607ed
JM
45292005-11-04 Joseph S. Myers <joseph@codesourcery.com>
4530
4531 * include/cpplib.h (struct cpp_callbacks): Make error take
4532 va_list* parameter.
4533 * errors.c (cpp_error): Update call to callback.
4534
651ed942
AP
45352005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
4536
4537 PR preprocessor/22042
4538 * macro.c (_cpp_builtin_macro_text): Lower the needed max
4539 buffer size.
4540 (cpp_quote_string): Don't octalify non printable
4541 charactors.
4542
178b58b5
JM
45432005-11-03 Joseph S. Myers <joseph@codesourcery.com>
4544
4545 PR c++/17964
4546 * include/cpplib.h (struct cpp_options): Add client_diagnostic.
4547 (struct cpp_callbacks): Add error.
4548 * errors.c (cpp_error): If client_diagnostic, use error callback.
4549 * charset.c (convert_escape): Don't use %03o in diagnostic.
4550
3ee5ed11 45512005-10-21 James E Wilson <wilson@specifix.com>
6568f34b
JW
4552
4553 PR preprocessor/15220
4554 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all
4555 callers. Pass to open_file_failed.
4556 (open_file_failed): New parameter angle_brackets. Fix all callers.
4557 Use in print_dep assignment.
4558 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
4559 * internal.h (_cpp_find_file): Add new parm to declaration.
f7288899 4560
077fc835
KH
45612005-10-08 Kazu Hirata <kazu@codesourcery.com>
4562
4563 * configure.ac: Require 64-bit int for arm*-*-*eabi*.
4564 * configure: Regenerate.
4565
cbc43ae0
ILT
45662005-10-04 Ian Lance Taylor <ian@airs.com>
4567
4568 PR preprocessor/13726
4569 * directives.c (check_eol_return_comments): New static function.
4570 (parse_include): Add buf parameter. Change all callers.
4571 (do_include_common): If not discard comments, turn on
4572 save_comments. Pass collected comments to include callback.
4573 * include/cpplib.h (struct cpp_callbacks): Add new parameter to
4574 include callback: cpp_token list.
4575
af15a2fe
JM
45762005-09-20 Joseph S. Myers <joseph@codesourcery.com>
4577
4578 * include/cpplib.h (struct cpp_options): Add extended_identifiers.
4579 * init.c (struct lang_flags, lang_defaults): Add
4580 extended_identifiers.
4581 (cpp_set_lang): Use it.
4582 * lex.c (forms_identifier_p): Check extended_identifiers.
4583
f5eab47e
JJ
45842005-08-30 Jakub Jelinek <jakub@redhat.com>
4585
4586 PR preprocessor/20348
4587 PR preprocessor/20356
4588 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
4589 2004-06-05 changes.
4590
467129e6
KG
45912005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4592
4593 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
4594 -Wmissing-format-attribute.
4595
4596 * configure: Regenerate.
4597
200031d1
KC
45982005-06-29 Kelley Cook <kcook@gcc.gnu.org>
4599
4600 * all files: Update FSF address in copyright headers.
4601 * makeucnid.c (write_copyright): Update outputted FSF address.
4602
f610dd5f
ZW
46032005-06-13 Zack Weinberg <zack@codesourcery.com>
4604
4605 * configure.ac: Invoke ZW_CREATE_DEPDIR and
4606 ZW_PROG_COMPILER_DEPENDENCIES.
4607 * aclocal.m4, configure: Regenerate.
4608 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
4609 New variables.
4610 (distclean): Clean up $(DEPDIR) and its contents.
4611 (.c.o): Use $(COMPILE).
4612 Include $(DEPDIR)/*.Po for most object->header dependencies.
4613
c3f829c1
GDR
46142005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
4615
4616 * configure.ac: Check declarations for asprintf and vasprintf.
4617 * config.in: Regenerate.
4618 * configure: Likewise.
4619
4620 * charset.c (conversion_loop): Use XRESIZEVEC.
4621 (convert_no_conversion): Likewise.
4622 (convert_using_iconv): Likewise.
4623 (init_iconv_desc): Cast return value of alloca.
4624 (cpp_host_to_exec_charset): Use XNEWVEC.
4625 (emit_numeric_escape): Use XRESIZEVEC.
4626 (cpp_interpret_string): Use XNEWVEC.
4627 (cpp_interpret_string): Use XRESIZEVEC.
4628 (_cpp_interpret_identifier): Cast return value of alloca.
4629 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
4630 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
4631 (parse_include): Use XNEWVEC.
4632 (insert_pragma_entry): Rename local variable "new" to
f610dd5f 4633 "new_entry".
c3f829c1
GDR
4634 (save_registered_pragmas): Cast return value of xmemdup.
4635 (destringize_and_run): Same for alloca.
4636 (parse_assertion): Likewise.
4637 (do_assert): Cast allocated storage to proper type.
4638 (cpp_define): Likewise.
4639 (_cpp_define_builtin): Likewise.
4640 (cpp_undef): Likewise.
4641 (handle_assertion): Likewise.
4642 (cpp_push_buffer): Rename local variable "new" to "new_buffer".
4643 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
4644 (CPP_UMINUS): Likewise.
4645 (struct cpp_operator): Rename from struct operator.
4646 (_cpp_expand_op_stack): Use XRESIZEVEC.
4647 * files.c (pch_open_file): Use XNEWVEC.
4648 (pch_open_file): Use XRESIZEVEC.
4649 (read_file_guts): Use XNEWVEC and XRESIZEVEC.
4650 (dir_name_of_file): Use XNEWVEC.
4651 (make_cpp_file): Use XCNEW.
4652 (make_cpp_dir): Likewise.
4653 (allocate_file_hash_entries): USE XNEWVEC.
4654 (cpp_included): Cast return value of htab_find_with_hash.
4655 (append_file_to_dir): Use XNEWVEC.
4656 (read_filename_string): Likewise. Use XRESIZEVEC too.
4657 (read_name_map): Cast return value of alloca. Use XRESIZEVEC.
4658 (remap_filename): Use XNEWVEC.
4659 (struct pchf_entry): Move definition out of struct pchf_data.
4660 (_cpp_save_file_entries): Use XCNEWVAR.
4661 (_cpp_read_file_entries): Use XNEWVAR.
4662 * identifiers.c (alloc_node): Use XOBNEW.
4663 * init.c (cpp_create_reader): Use XCNEW.
4664 (cpp_init_builtins): Cast of b->value to enum builtin_type.
4665 (read_original_directory): Cast return value of alloca.
4666 * lex.c (add_line_note): Use XRESIZEVEC.
4667 (warn_about_normalization): Use XNEWVEC.
4668 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
4669 (new_buff): Use XNEWVEC.
4670 * line-map.c (linemap_add): Use XRESIZEVEC.
4671 * macro.c (builtin_macro): Cast return value of alloca.
4672 (paste_tokens): Likewise.
4673 (expand_arg): Use XNEWVEC and XRESIZEVEC.
4674 (_cpp_save_parameter): Use XRESIZEVEC.
4675 (create_iso_definition): Cast allocated storage to proper type.
4676 (_cpp_create_definition): Likewise.
4677 (cpp_macro_definition): Use XRESIZEVEC.
4678 * makedepend.c (add_clm): Use XNEW.
4679 (add_dir): Likewise.
4680 * mkdeps.c (munge): Use XNEWVEC.
4681 (deps_init): Use XCNEW.
4682 (deps_add_target): Use XRESIZEVEC.
4683 (deps_add_default_target): Cast return value of alloca.
4684 (deps_add_dep): Use XRESIZEVEC.
4685 (deps_add_vpath): Likewise. Use XNEWVEC too.
4686 (deps_restore): Likewise.
4687 * pch.c (save_idents): Use XNEW and XNEWVEC.
4688 (cpp_save_state): Use XNEW.
4689 (count_defs): Cast return value of htab_find.
4690 (write_defs): Likewise.
4691 (cpp_write_pch_deps): Use XNEWVEC.
4692 (collect_ht_nodes): Use XRESIZEVEC.
4693 (cpp_valid_state): Use XNEWVEC.
4694 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup.
4695 * symtab.c (ht_create): Use XCNEW.
4696 (ht_lookup_with_hash): Cast return value of obstack_copy0.
4697 (ht_expand): Use XCNEWVEC.
4698 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
4699 (bool): Do not define if __cplusplus.
4700
1ed17cd5
ZW
47012005-05-12 Zack Weinberg <zack@codesourcery.com>
4702
4703 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
4704 (do_sccs): Delete function definition, #define to do_ident.
4705 (do_ident): Don't hardwire directive name.
4706
5a8c20ce
RK
47072005-05-12 Ryota Kunisawa <kunisawa@access.co.jp>
4708
4709 PR bootstrap/21230
4710 * configure: Regenerate.
4711
473c5bc9
AP
47122005-04-27 Andris Pavenis <pavenis@latnet.lv>
4713
4714 * files.c: Include io.h for DJGPP to get prototype of setmode.
4715
c1fc5047
PB
47162005-04-19 Per Bothner <per@bothner.com>
4717
4718 PR preprocessor/20907
4719 * line-map.c (linemap_line_start): Fix bug when we need to increse
4720 column_bits but can re-use the current line_map.
4721
042630ad
KG
47222005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4723
4724 * system.h (fopen, fdopen, freopen): Define these to the unlocked
4725 libiberty functions.
4726
0d667716
KG
47272005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4728
4729 * configure.ac (libcpp_UNLOCKED_FUNCS): New.
4730 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
4731 * system.h (putchar, getc, getchar, clearerr, feof, fileno,
4732 fflush, fgetc, fgets, ferror, fread): Redefine to the associated
4733 _unlocked function.
4734 (fwrite_unlocked): Fix prototype.
1ed17cd5 4735
0d667716
KG
4736 * configure, config.in: Regenerate.
4737
cae064e7
JJ
47382005-04-05 Jakub Jelinek <jakub@redhat.com>
4739
4740 PR preprocessor/19475
4741 * macro.c (create_iso_definition): For < ISO C99, don't
4742 pedwarn if there is no whitespace between macro name and its
4743 replacement, but the replacement starts with a basic character
4744 set character.
4745
cbada204
AJ
47462005-03-28 Andreas Jaeger <aj@suse.de>
4747
4748 * lex.c (warn_about_normalization): Cast field width to int to
4749 avoid warning.
4750
f42eccdb
JM
47512005-03-19 Joseph S. Myers <joseph@codesourcery.com>
4752
4753 * configure.ac: Consistently use solaris2.1[0-9]* instead of
4754 solaris2.1[0-9].
4755 * configure: Regenerate.
4756
c79e602b
GK
47572005-03-15 Geoffrey Keating <geoffk@apple.com>
4758
4759 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
4760 UCN rather than printing an error.
4761
50668cf6
GK
47622005-03-14 Geoffrey Keating <geoffk@apple.com>
4763
6baba9bb
GK
4764 * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
4765
47662005-03-14 Geoffrey Keating <geoffk@apple.com>
1ed17cd5 4767
50668cf6
GK
4768 * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
4769 * charset.c: Update for new format of ucnid.h.
4770 (ucn_valid_in_identifier): Update for new format of ucnid.h.
4771 Add NST parameter, and update it; update callers.
4772 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort
4773 with cpp_error.
4774 (convert_ucn): Pass normalize_state to cpp_valid_ucn.
4775 * internal.h (struct normalize_state): New.
4776 (INITIAL_NORMALIZE_STATE): New.
4777 (NORMALIZE_STATE_RESULT): New.
4778 (NORMALIZE_STATE_UPDATE_IDNUM): New.
4779 (_cpp_valid_ucn): New.
4780 * lex.c (warn_about_normalization): New.
4781 (forms_identifier_p): Add normalize_state parameter, update callers.
4782 (lex_identifier): Add normalize_state parameter, update callers. Keep
4783 the state current.
4784 (lex_number): Likewise.
4785 (_cpp_lex_direct): Pass normalize_state to subroutines. Check
4786 it with warn_about_normalization.
4787 * makeucnid.c: New.
4788 * ucnid.h: Replace.
4789 * ucnid.pl: Remove.
4790 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove
4791 comments about obsolete version of C++.
4792 * include/cpplib.h (enum cpp_normalize_level): New.
4793 (struct cpp_options): Add warn_normalize field.
4794
47e20491
GK
47952005-03-11 Geoffrey Keating <geoffk@apple.com>
4796
4797 * directives.c (glue_header_name): Update call to cpp_spell_token.
4798 * internal.h (_cpp_interpret_identifier): New.
4799 * charset.c (_cpp_interpret_identifier): New.
4800 (_cpp_valid_ucn): Allow UCN version of '$'.
4801 * lex.c (lex_identifier): Add extra parameter to indicate if initial
4802 character was '$' or '\'. Support identifiers with UCNs.
4803 (forms_identifier_p): Allow UCNs.
4804 (_cpp_lex_direct): Pass extra parameter to lex_identifier.
4805 (utf8_to_ucn): New.
4806 (cpp_spell_token): Add FORSTRING parameter. Use it.
4807 (cpp_token_as_text): Update call to cpp_spell_token.
4808 (cpp_output_token): Write UCNs back out.
4809 (stringify_arg): Update call to cpp_spell_token.
4810 (paste_tokens): Likewise.
4811 (cpp_macro_definition): Likewise.
4812 * macro.c (stringify_arg): Likewise.
4813 (paste_tokens): Likewise.
4814 (cpp_macro_definition): Likewise.
4815 * include/cpplib.h: Add parameter to cpp_spell_token.
4816
73096711
JJ
48172005-03-04 Jakub Jelinek <jakub@redhat.com>
4818
4819 PR bootstrap/20282
4820 PR bootstrap/20305
4821 * macro.c (replace_args, cpp_get_token): Copy whole
4822 cpp_token_u instead of just cpp_string field from it.
4823
2203a881
DP
48242005-02-28 Devang Patel <dpatel@apple.com>
4825
4826 * directives.c (do_line): Save sysp early before line table is
4827 realloc'ed.
1ed17cd5 4828
c5ff069d
ZW
48292005-02-20 Zack Weinberg <zack@codesourcery.com>
4830
4831 PR 18785
4832 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
4833 (cpp_host_to_exec_charset): New function.
4834 * include/cpplib.h: Declare cpp_host_to_exec_charset.
4835
04c90eea
DP
48362005-02-19 Devang Patel <dpatel@apple.com>
4837
4838 * charset.c (_cpp_convert_input): Check '\r' before inserting
4839 '\n' at the end.
c5ff069d 4840
6da55c00
EC
48412005-02-15 Eric Christopher <echristo@redhat.com>
4842
4843 PR preprocessor/19077
4844 * macro.c (cpp_macro_definition): Move handling of whitespace
4845 to PREV_WHITE conditional. Remove overloading of len
4846 variable.
4847
31c3e631
KH
48482005-02-14 Kazu Hirata <kazu@cs.umass.edu>
4849
4850 * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
4851 traditional.c: Update copyright.
4852
be0f1e54
PB
48532005-02-14 Paolo Bonzini <bonzini@gnu.org>
4854
4855 PR bootstrap/19818
4856 * configure.ac: Check for declaration of basename and getopt.
4857 * config.in: Regenerate.
4858 * configure: Regenerate.
4859 * internal.h (ustrcspn): New.
4860 * macro.c (create_iso_definition): Fix allocation of memory.
4861 (padding_token): Add cast to remove const-ness.
4862 * pch.c (cpp_read_state): Use ustrcspn.
4863
ecddfb39
MS
48642005-02-08 Mike Stump <mrs@apple.com>
4865
4866 * files.c (pchf_adder): Remove.
4867 (struct pchf_adder_info): Likewise.
4868 (_cpp_save_file_entries): Write out all files so that #import works.
4869
9fcdd891
JM
48702005-01-23 Joseph S. Myers <joseph@codesourcery.com>
4871
4872 * configure: Regenerate.
4873
ecfd72e7
TS
48742005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
4875
4876 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
4877
6c25a4f7 4878 * include/cpplib.h: Also update copyright years.
c5ff069d 4879
942926ad
GK
48802005-01-03 Geoffrey Keating <geoffk@apple.com>
4881
4882 * files.c (_cpp_find_file): Add files found by search_path_exhausted
4883 to the list of all files.
4884
a2566ae9
GDR
48852005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
4886
4887 * internal.h: Update references to Cpp lib filenames.
4888 * directives.c: Likewise.
4889 * init.c: Likewise.
4890 * macro.c: Likewise.
4891 * traditional.c: Likewise.
4892
1b449375
EB
48932004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
4894
4895 PR preprocessor/15167
4896 * files.c (destroy_cpp_file): New function.
4897 (should_stack_file): Make a new file if the
4898 compared file is still stacked.
4899
28303828
NN
49002004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
4901
c5ff069d 4902 PR preprocessor/17610
28303828
NN
4903 * directives.c (do_include_common): Error out if an empty filename
4904 is given for #include (or #include_next or #import).
4905
c812785a
RS
49062004-11-27 Roger Sayle <roger@eyesopen.com>
4907 Zack Weinberg <zack@codesourcery.com>
4908
4909 * internal.h: Replace all uses of uchar with unsigned char.
4910 * include/cpp-id-data.h: Likewise. Guard typedef of uchar
4911 with !IN_GCC, so uchar is only defined whilst building libcpp.
4912
f91eaa01
KC
49132004-11-24 Kelley Cook <kcook@gcc.gnu.org>
4914
4915 * aclocal.m4: Regenerate.
4916
f78ce0c2
RS
49172004-11-24 Roger Sayle <roger@eyesopen.com>
4918
4919 PR preprocessor/15824
4920 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
4921 directly, instead of the non-existant "system.h" and "ansidecl.h".
4922 * configure: Regenerate.
4923
b5b3e36a 49242004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
c5ff069d 4925 Joseph Myers <joseph@codesourcery.com>
b5b3e36a
DJ
4926
4927 * internal.h (struct lexer_state): Add in_deferred_pragma.
4928 * directives.c (struct pragma_entry): Add allow_expansion.
4929 (insert_pragma_entry): Take allow_expansion flag.
4930 (register_pragma): Likewise.
4931 (cpp_register_pragma): Likewise.
4932 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
4933 (do_pragma): Honor allow_expansion.
4934 (cpp_handle_deferred_pragma): Set in_deferred_pragma.
4935 * include/cpplib.h (cpp_register_pragma): Update prototype.
4936
a8e68029 49372004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
c5ff069d 4938 Mark Mitchell <mark@codesourcery.com>
a8e68029
DJ
4939
4940 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
4941 need_64bit_hwint=yes.
4942 * configure: Regenerate.
4943
50f47ee0
JM
49442004-11-09 Joseph S. Myers <joseph@codesourcery.com>
4945
4946 * Makefile.in ($(PACKAGE).pot): New rule. Depend on
4947 po/$(PACKAGE).pot.
4948 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
4949 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
4950 Remove local srcdir path from generated file.
4951
968e08d6 49522004-11-04 Zack Weinberg <zack@codesourcery.com>
c5ff069d 4953 Gerald Pfeifer <gerald@pfeifer.com>
968e08d6
ZW
4954
4955 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
4956 as well.
4957
3da3d587
ZW
49582004-10-27 Zack Weinberg <zack@codesourcery.com>
4959
4960 PR 18075
4961 * directives.c (do_pragma): Do not defer pragmas which are unknown.
4962 (cpp_handle_deferred_pragma): Add cast to silence warning.
4963
ac24fc25
JM
49642004-10-14 Joseph S. Myers <jsm@polyomino.org.uk>
4965
4966 * errors.c (_cpp_begin_message): Print "error: " for errors.
4967
7731405b
AJ
49682004-10-10 Andreas Jaeger <aj@suse.de>
4969
4970 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
4971 * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
4972
646544e3
AP
49732004-10-08 Andrew Pinski <pinskia@physics.uc.edu>
4974
4975 * pch.c (cpp_write_pch_state): Remove variable z as it is not
4976 used.
4977 (cpp_read_state): Remove unused variables, m, d and mac_count.
4978
67a74146
PB
49792004-09-29 Per Bothner <per@bothner.com>
4980
4981 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore
4982 cb.line_change. Otherwise do_pragma will call the line_change
4983 call-back with a meaningless line number.
4984
018a4785
ZW
49852004-09-24 Zack Weinberg <zack@codesourcery.com>
4986
4987 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
4988 programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
4989 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
4990 * aclocal.m4, configure: Regenerate.
4991 * init.c: Include localedir.h.
4992 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
4993 (DEFS): Delete.
4994 (.c.o): Use $(ALL_CFLAGS).
4995 (localedir.h, localedir.hs): New rules.
4996 (clean): Use rm -rf to remove directories.
4997 (distclean): Also delete localedir.h and localedir.hs.
4998 (init.o): Update dependencies.
4999
88fa57d7
KC
50002004-09-22 Kelley Cook <kcook@gcc.gnu.org>
5001
5002 * Makefile.in (aclocal.m4): Update dependencies.
5003 * configure.ac (AC_CONFIG_MACRO_DIR): New.
5004 * aclocal.m4, configure: Regenerate.
5005
8f8e9aa5
ZW
50062004-09-17 Zack Weinberg <zack@codesourcery.com>
5007
a29f62d9
ZW
5008 * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
5009 (_cpp_convert_input, _cpp_default_encoding): Add comments.
5010 Some other comments in this file also tweaked.
5011
8f8e9aa5
ZW
5012 * directives.c (do_pragma): Save current buffer position
5013 before lexing the pragma keywords; don't call
5014 _cpp_backup_tokens in the defer_pragmas case.
5015
a2981930
PB
50162004-09-15 Per Bothner <per@bothner.com>
5017
5018 * include/line-map.h (line_map_start): Add parameter names so
5019 preceding comment makes sense.
5020 (linemap_add): Remove from comment mention of non-existing parameter.
5021
21b11495
ZW
50222004-09-09 Matt Austern <austern@apple.com>
5023 Zack Weinberg <zack@codesourcery.com>
5024
5025 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
5026 prefixes throughout. Add entry for PRAGMA. Remove
5027 unnecessary "= 0" from EQ.
5028 (enum cpp_ttype): Adjust OP and TK definitions to restore
5029 prefixes, via token-paste.
5030 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
5031 Change from #defines to additional cpp_ttype enumerators.
5032 (struct cpp_options): Add defer_pragmas.
5033 (cpp_handle_deferred_pragma): Prototype new interface.
5034
5035 * internal.h (struct cpp_reader): Add directive_result.
5036 * directives.c (struct pragma_entry): Add is_internal field;
5037 give boolean fields type bool.
5038 (start_directive): Initialize pfile->directive_result.type.
5039 (_cpp_do__Pragma): Likewise.
5040 (run_directive): Do not crash if pfile->buffer->prev is NULL.
5041 (insert_pragma_entry): Add 'internal' argument; set new->is_internal
5042 from it.
5043 (register_pragma): New static function, bulk of former
5044 cpp_register_pragma here; add 'internal' argument, pass along
5045 to insert_pragma_entry.
5046 (cpp_register_pragma): Now a wrapper around register_pragma which
5047 always passes false for 'internal' argument.
5048 (_cpp_init_internal_pragmas): Call register_pragma directly, passing
5049 true for 'internal'.
5050 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
5051 an internal pragma, save text till the end of the line as a CPP_PRAGMA
5052 token instead of executing the pragma.
5053 (cpp_handle_deferred_pragma): New interface.
5054 * lex.c (token_spellings): Adjust OP and TK definitions to
5055 match changes to cpplib.h.
5056 (_cpp_lex_token): Check for a directive-result token and
5057 return it if present.
5058 (cpp_token_val_index): Handle CPP_PRAGMA.
5059 * macro.c (cpp_builtin_macro_text): Correct comment.
5060 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
5061
0fd9e8dd
SB
50622004-09-06 Serge Belyshev <belyshev@lubercy.com>
5063
5064 PR preprocessor/14699
5065 * symtab.c (ht_dump_statistics): Change type of sum_of_squares
5066 from size_t to double.
5067
39b8ce7f
AS
50682004-08-28 Andreas Schwab <schwab@suse.de>
5069 Andreas Jaeger <aj@suse.de>
5070
5071 * configure.ac: Set PACKAGE correctly.
5072 * configure: Regenerated.
5073
5d1f4b27
PB
50742004-08-25 Paolo Bonzini <bonzini@gnu.org>
5075
5076 * Makefile.in: Add back top_builddir.
5077
078e3ffe
PB
50782004-08-25 Paolo Bonzini <bonzini@gnu.org>
5079
5080 * configure.ac: Replace Automake macro invocations
5081 with manual Autoconf checks and substitutions.
5082 * configure: Regenerate.
5083 * aclocal.m4: Regenerate.
5084 * config.in: Regenerate.
5085 * Makefile.am: Removed.
5086 * Makefile.in: Heavy simplification and reorganization.
5087
b3f8d95d
MM
50882004-08-09 Mark Mitchell <mark@codesourcery.com>
5089
5090 * configure.ac (arm*-*-eabi*): New target.
5091 (arm*-*-symbianelf*): Likewise.
5092 * configure: Regenerated.
5093
72bb2c39
BI
50942004-07-24 Bernardo Innocenti <bernie@develer.com>
5095
5096 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
5097 * directives.c: Use XNEW-family macros from libiberty.
5098 * lex.c: Likewise.
5099 * macro.c: Likewise.
5100 * cpplib.h (cpp_deps_style): Export enum with name.
5101
21b11495 51022004-07-23 Matthias Klose <doko@debian.org>
72bb2c39 5103
21b11495 5104 * init.c (init_library): Use PACKAGE for the text domain.
85eac2a0 5105
a23ee064
AP
51062004-07-16 Andris Pavenis <pavenis@latnet.lv>
5107
5108 PR preprocessor/16366
5109 * internal.h (struct cpp_reader): New field dir_hash.
5110 * files.c (make_cpp_dir): Use dir_hash, not file_hash.
5111 (_cpp_init_files, _cpp_cleanup_files): Update for new field.
5112
a09d4744
NB
51132004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
5114
5115 PR preprocessor/16192
5116 PR preprocessor/15913
5117 PR preprocessor/15572
5118 * expr.c (_cpp_parse_expr): Handle remaining cases where an
5119 expression is missing.
5120 * init.c (post_options): Traditional cpp doesn't do // comments.
5121
f58f7def
PB
51222004-06-30 Per Bothner <per@bothner.com>
5123
5124 * include/line-map.h (fileline): Remove old typedef.
5125 * internal.h (struct cpp_reader): Use source_location typedef instead.
5126
e83d8d43
ZW
51272004-06-26 Zack Weinberg <zack@codesourcery.com>
5128
5129 Partially revert patch of 2004-06-05.
5130 * files.c (search_cache): Remove pfile argument. Don't check
5131 for file that would be found by "" or <> search here...
5132 (_cpp_find_file): ...do it here, before calling find_file_in_dir.
5133 Do not apply directory-of-current-file correction to files
5134 found by this check. Rearrange code slightly.
5135
c0d578e6
GK
51362004-06-21 Geoffrey Keating <geoffk@apple.com>
5137
5138 * files.c (should_stack_file): Correct swapped parameters to call
5139 to cb.read_pch.
5140 * pch.c (cpp_valid_state): Handle -fpreprocessed.
5141
159d5224
PB
51422004-06-15 Paolo Bonzini <bonzini@gnu.org>
5143
5144 * Makefile.in: Regenerate with automake 1.8.5.
5145 * aclocal.m4: Likewise.
5146 * configure: Regenerate.
5147
2fac9c01
ZW
51482004-06-11 Zack Weinberg <zack@codesourcery.com>
5149
5150 * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
5151 * configure, config.in: Regenerate.
5152 * system.h: Unconditionally define bool as unsigned char,
5153 BOOL_BITFIELD as unsigned int.
5154 * .cvsignore: New file.
5155
d8044160
GK
51562004-06-09 Geoffrey Keating <geoffk@apple.com>
5157
5158 * traditional.c (push_replacement_text): Set macro->traditional.
5159 (save_replacement_text): Likewise.
5160 * pch.c (cpp_write_pch_state): Don't write list of defined macros.
5161 (struct save_macro_item): Delete.
5162 (struct save_macro_data): Use a character array not the previous
5163 structured format.
5164 (save_macros): Save macro as text not as internal structures.
5165 (cpp_prepare_state): Update for changes to save_macro_data.
5166 (cpp_read_state): Don't read macros defined in PCH. Restore
2cf22451 5167 -D macros as text.
d8044160
GK
5168 * macro.c (create_iso_definition): Honour alloc_subobject.
5169 Clear traditional flag.
5170 (_cpp_create_definition): Honour alloc_subobject.
5171 * lex.c (cpp_token_val_index): New.
5172 * internal.h: Include cpp-id-data.h.
5173 (uchar): Move definition to cpp-id-data.h.
5174 (U): Likewise.
5175 (cpp_macro): Likewise.
5176 * directives.c (struct answer): Move to cpp-id-data.h.
5177 (do_assert): Honour alloc_subobject.
2cf22451
ZW
5178
5179 * include/symtab.h (struct ht): Add field 'alloc_subobject'.
5180 * include/cpplib.h (struct cpp_string): Add GTY marker.
5181 (enum cpp_token_fld_kind): New.
5182 (struct cpp_token): Add GTY markers.
5183 (cpp_token_val_index): Prototype.
5184 (CPP_HASHNODE_VALUE_IDX): New.
5185 (struct cpp_hashnode): Don't skip fields of 'value' when marking.
5186 * include/cpp-id-data.h: New file.
d8044160 5187
0ca8e815
PB
51882004-06-09 Paolo Bonzini <bonzini@gnu.org>
5189
5190 * Makefile.am (all-local): New.
5191 * Makefile.in: Regenerate.
5192
b51fa00f
RS
51932004-06-06 Roger Sayle <roger@eyesopen.com>
5194
5195 * Makefile.am (LIBICONV): Declare.
5196 (makedepend_LDADD): Use LIBICONV.
5197 * Makefile.in: Regenerate.
5198
5e2f3f39
AP
51992004-06-05 Andrew Pinski <pinskia@physics.uc.edu>
5200
5201 * Makefile.am (LIBINTL): Declare
5202 (makedepend_LDADD): Use LIBINTL.
5203 * Makefile.in: Regenerate.
5204
c6e83800
ZW
52052004-06-05 Zack Weinberg <zack@codesourcery.com>
5206
5207 * Makefile.am: Add makedepend.
5208 * Makefile.in, aclocal.m4: Regenerate.
5209 * charset.c: Insert a space to avoid a warning.
5210 * directives.c: Include mkdeps.h.
5211 (_cpp_handle_directive): Reenable macro expander if appropriate.
5212 (undefine_macros): Inline body of _cpp_free_definition for speed.
5213 Do not call undef callback or _cpp_warn_if_unused_macro.
5214 (cpp_get_deps): New interface.
5215 * files.c (search_cache): Add pfile argument. Check for file
5216 that would be found by "" or <> search here...
5217 (_cpp_find_file): ...not here. Correct recorded start_dir of
5218 files found by directory-of-current-file search that would be
5219 found by "" or <> search.
5220 * init.c (cpp_add_dependency_target): Delete.
5221 * internal.h (struct lexer_state): Add discarding_output flag.
5222 * lex.c (lex_identifier): Compute hash function while scanning.
5223 * macro.c (cpp_scan_nooutput): Disable macro expansion outside
5224 directives.
5225 * makedepend.c: New file.
5226 * mkdeps.c (struct deps): Add vpath vector.
5227 (apply_vpath, deps_add_vpath): New function.
5228 (deps_free): Free vpath vector.
5229 (deps_add_dep, deps_add_target): Use apply_vpath.
5230 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
5231 (ht_lookup_with_hash): New function.
5232 * cpplib.h, mkdeps.h: Update prototypes.
5233 * symtab.h: Update prototypes.
5234 (HT_HASHSTEP, HT_FINISH): New macros.
5235
b453c95f
GK
52362004-05-29 Geoffrey Keating <geoffk@apple.com>
5237
5238 * symtab.c (ht_create): Set entries_owned.
5239 (ht_destroy): Honour entries_owned.
5240 (ht_expand): Likewise.
5241 (ht_load): New.
2cf22451
ZW
5242 * include/symtab.h (struct ht): New field 'entries_owned'
5243 (ht_load): New prototype.
b453c95f 5244
963e23c5
PB
52452004-05-26 Paolo Bonzini <bonzini@gnu.org>
5246
5247 PR bootstrap/15651
5248 * configure.ac: Fix m4 quoting when picking
5249 the size of HOST_WIDE_INT.
5250 * configure: Regenerate.
5251
0429bc77
PB
52522004-05-25 Paolo Bonzini <bonzini@gnu.org>
5253
5254 * Makefile.am: the correct directory for
5255 gettext include files is given by @INCINTL@.
5256 * Makefile.in: Regenerate.
5257
c86dd7db
PB
52582004-05-24 Paolo Bonzini <bonzini@gnu.org>
5259
5260 * system.h [!ENABLE_NLS]: dgettext takes two
5261 parameters.
5262
4f4e53dd
PB
52632004-05-23 Paolo Bonzini <bonzini@gnu.org>
5264
5265 Moved libcpp from the gcc subdirectory to the toplevel.
5266 * Makefile.am: New file.
5267 * Makefile.in: Regenerate.
5268 * configure.ac: New file.
5269 * configure: Regenerate.
5270 * config.in: Regenerate.
5271 * charset.c: Moved from gcc/cppcharset.c. Add note about
5272 brokenness of input charset detection. Adjust for change
5273 in name of cppucnid.h.
5274 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
5275 * expr.c: Moved from gcc/cppexp.c.
5276 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
5277 Remove #define of O_BINARY, it is in system.h.
5278 * identifiers.c: Moved from gcc/cpphash.c.
5279 * internal.h: Moved from gcc/cpphash.h. Change header
5280 guard name. All other files adjusted to match name change.
5281 * init.c: Moved from gcc/cppinit.c.
5282 (init_library) [ENABLE_NLS]: Call bindtextdomain.
5283 * lex.c: Moved from gcc/cpplex.c.
5284 * directives.c: Moved from gcc/cpplib.c.
5285 * macro.c: Moved from gcc/cppmacro.c.
5286 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
5287 * traditional.c: Moved from gcc/cpptrad.c.
5288 * ucnid.h: Moved from gcc/cppucnid.h. Change header
5289 guard name.
5290 * ucnid.pl: Moved from gcc/cppucnid.pl.
5291 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header
5292 guard name.
5293 * symtab.c: Moved from gcc/hashtable.c.
5294 * line-map.c: Moved from gcc. Do not include intl.h.
5295 * mkdeps.c: Moved from gcc.
5296 * system.h: New file.
2cf22451
ZW
5297 * include/cpplib.h: Moved from gcc. Change header guard name.
5298 * include/line-map.h: Moved from gcc. Change header guard name.
5299 * include/mkdeps.h: Moved from gcc. Change header guard name.
5300 * include/symtab.h: Moved from gcc/hashtable.h. Change header
5301 guard name.
818ab71a 5302\f
85ec4feb 5303Copyright (C) 2004-2018 Free Software Foundation, Inc.
818ab71a
JJ
5304
5305Copying and distribution of this file, with or without modification,
5306are permitted in any medium without royalty provided the copyright
5307notice and this notice are preserved.