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