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