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