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