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