Age | Commit message (Collapse) | Author | Files | Lines |
|
This patch combines:
[PATCH 05/10] Add ranges to libcpp tokens (via ad-hoc data, unoptimized)
[PATCH 06/10] Track expression ranges in C frontend
[PATCH 07/10] Add plugin to recursively dump the source-ranges in a tree (v2)
[PATCH 08/10] Wire things up so that libcpp users get token underlines
[PATCH 09/10] Delay some resolution of ad-hoc locations, preserving ranges
[PATCH 10/10] Compress short ranges into source_location
[PATCH] libcpp: add examples to source_location description
along with fixes for the nits identified during review.
gcc/ChangeLog:
* Makefile.in (OBJS): Add gcc-rich-location.o.
* diagnostic.c (diagnostic_append_note): Pass line_table to
rich_location ctor.
(emit_diagnostic): Likewise.
(inform): Likewise.
(inform_n): Likewise.
(warning): Likewise.
(warning_at): Likewise.
(warning_n): Likewise.
(pedwarn): Likewise.
(permerror): Likewise.
(error): Likewise.
(error_n): Likewise.
(error_at): Likewise.
(sorry): Likewise.
(fatal_error): Likewise.
(internal_error): Likewise.
(internal_error_no_backtrace): Likewise.
(source_range::debug): Likewise.
* gcc-rich-location.c: New file.
* gcc-rich-location.h: New file.
* genmatch.c (fatal_at): Pass line_table to rich_location ctor.
(warning_at): Likewise.
* gimple.h (gimple_set_block): Use set_block function.
* input.c (dump_line_table_statistics): Dump stats on how many
ranges were optimized vs how many needed ad-hoc table.
(write_digit_row): Add "map" param; use its range_bits
to calculate the per-character offset.
(dump_location_info): Print the range and column bits for each
ordinary map. Use the range bits to calculate the per-character
offset. Pass the map as a new param to the various calls to
write_digit_row. Eliminate uses of
ORDINARY_MAP_NUMBER_OF_COLUMN_BITS.
* print-tree.c (print_node): Print any source range information.
* rtl-error.c (diagnostic_for_asm): Likewise.
* toplev.c (general_init): Initialize line_table's
default_range_bits.
* tree-cfg.c (move_block_to_fn): Likewise.
(move_block_to_fn): Likewise.
* tree-inline.c (copy_phis_for_bb): Likewise.
* tree.c (tree_set_block): Likewise.
(get_pure_location): New function.
(set_source_range): New functions.
(set_block): New function.
(set_source_range): New functions.
* tree.h (CAN_HAVE_RANGE_P): New.
(EXPR_LOCATION_RANGE): New.
(EXPR_HAS_RANGE): New.
(get_expr_source_range): New inline function.
(DECL_LOCATION_RANGE): New.
(set_source_range): New decls.
(get_decl_source_range): New inline function.
gcc/ada/ChangeLog:
* gcc-interface/trans.c (Sloc_to_locus): Add line_table param when
calling linemap_position_for_line_and_column.
gcc/c-family/ChangeLog:
* c-common.c (c_fully_fold_internal): Capture existing souce_range,
and store it on the result.
* c-opts.c (c_common_init_options): Set
global_dc->colorize_source_p.
gcc/c/ChangeLog:
* c-decl.c (warn_defaults_to): Pass line_table to
rich_location ctor.
* c-errors.c (pedwarn_c99): Likewise.
(pedwarn_c90): Likewise.
* c-parser.c (set_c_expr_source_range): New functions.
(c_token::get_range): New method.
(c_token::get_finish): New method.
(c_parser_expr_no_commas): Call set_c_expr_source_range on the ret
based on the range from the start of the LHS to the end of the
RHS.
(c_parser_conditional_expression): Likewise, based on the range
from the start of the cond.value to the end of exp2.value.
(c_parser_binary_expression): Call set_c_expr_source_range on
the stack values for TRUTH_ANDIF_EXPR and TRUTH_ORIF_EXPR.
(c_parser_cast_expression): Call set_c_expr_source_range on ret
based on the cast_loc through to the end of the expr.
(c_parser_unary_expression): Likewise, based on the
op_loc through to the end of op.
(c_parser_sizeof_expression) Likewise, based on the start of the
sizeof token through to either the closing paren or the end of
expr.
(c_parser_postfix_expression): Likewise, using the token range,
or from the open paren through to the close paren for
parenthesized expressions.
(c_parser_postfix_expression_after_primary): Likewise, for
various kinds of expression.
* c-tree.h (struct c_expr): Add field "src_range".
(c_expr::get_start): New method.
(c_expr::get_finish): New method.
(set_c_expr_source_range): New decls.
* c-typeck.c (parser_build_unary_op): Call set_c_expr_source_range
on ret for prefix unary ops.
(parser_build_binary_op): Likewise, running from the start of
arg1.value through to the end of arg2.value.
gcc/cp/ChangeLog:
* error.c (pedwarn_cxx98): Pass line_table to rich_location ctor.
gcc/fortran/ChangeLog:
* error.c (gfc_warning): Pass line_table to rich_location ctor.
(gfc_warning_now_at): Likewise.
(gfc_warning_now): Likewise.
(gfc_error_now): Likewise.
(gfc_fatal_error): Likewise.
(gfc_error): Likewise.
(gfc_internal_error): Likewise.
gcc/testsuite/ChangeLog:
* gcc.dg/diagnostic-token-ranges.c: New file.
* gcc.dg/diagnostic-tree-expr-ranges-2.c: New file.
* gcc.dg/plugin/diagnostic-test-expressions-1.c: New file.
* gcc.dg/plugin/diagnostic-test-show-trees-1.c: New file.
* gcc.dg/plugin/diagnostic_plugin_show_trees.c: New file.
* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c (get_loc): Add
line_table param when calling
linemap_position_for_line_and_column.
(test_show_locus): Pass line_table to rich_location ctors.
(plugin_init): Remove setting of global_dc->colorize_source_p.
* gcc.dg/plugin/diagnostic_plugin_test_tree_expression_range.c:
New file.
* gcc.dg/plugin/plugin.exp (plugin_test_list): Add
diagnostic_plugin_test_tree_expression_range.c,
diagnostic-test-expressions-1.c, diagnostic_plugin_show_trees.c,
and diagnostic-test-show-trees-1.c.
libcpp/ChangeLog:
* errors.c (cpp_diagnostic): Pass pfile->line_table to
rich_location ctor.
(cpp_diagnostic_with_line): Likewise.
* include/cpplib.h (struct cpp_token): Update comment for src_loc
to indicate that the range of the token is "baked into" the
source_location.
* include/line-map.h (source_location): Update the descriptive
comment to reflect the packing scheme for short ranges, adding
worked examples of location encoding.
(struct line_map_ordinary): Drop field "column_bits" in favor
of field "m_column_and_range_bits"; add field "m_range_bits".
(ORDINARY_MAP_NUMBER_OF_COLUMN_BITS): Delete.
(location_adhoc_data): Add source_range field.
(struct line_maps): Add fields "default_range_bits",
"num_optimized_ranges" and "num_unoptimized_ranges".
(get_combined_adhoc_loc): Add source_range param.
(get_range_from_loc): New declaration.
(pure_location_p): New prototype.
(COMBINE_LOCATION_DATA): Add source_range param.
(SOURCE_LINE): Update for renaming of column_bits.
(SOURCE_COLUMN): Likewise. Shift the column right by the map's
range_bits.
(LAST_SOURCE_LINE_LOCATION): Update for renaming of column_bits.
(linemap_position_for_line_and_column): Add line_maps * params.
(rich_location::rich_location): Likewise.
* lex.c (_cpp_lex_direct): Capture the range of the token, baking
it into token->src_loc via a call to COMBINE_LOCATION_DATA.
* line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): Reduce from 1U << 17 to
1U << 12.
(location_adhoc_data_hash): Add the src_range into
the hash value.
(location_adhoc_data_eq): Require equality of the src_range
values.
(can_be_stored_compactly_p): New function.
(get_combined_adhoc_loc): Add src_range param, and store it,
via a bit-packing scheme for short ranges, otherwise within the
lookaside table. Remove the requirement that data is non-NULL.
(get_range_from_adhoc_loc): New function.
(get_range_from_loc): New function.
(pure_location_p): New function.
(linemap_add): Ensure that start_location has zero for the
range_bits, unless we're past LINE_MAP_MAX_LOCATION_WITH_COLS.
Initialize range_bits to zero. Assert that the start_location
is "pure".
(linemap_line_start): Assert that the
column_and_range_bits >= range_bits.
Update determinination of whether we need to start a new map
using the effective column bits, without the range bits.
Use the set's default_range_bits in new maps, apart from
those with column_bits == 0, which should also have 0 range_bits.
Increase the column bits for new maps by the range bits.
When adding lines to an existing map, use set->highest_line
directly rather than offsetting highest by SOURCE_COLUMN.
Add assertions to sanity-check the return value.
(linemap_position_for_column): Offset to_column by range_bits.
Update set->highest_location if necessary.
(linemap_position_for_line_and_column): Add line_maps * param.
Update the calculation to offset the column by range_bits, and
conditionalize it on being <= LINE_MAP_MAX_LOCATION_WITH_COLS.
Bound it by LINEMAPS_MACRO_LOWEST_LOCATION. Update
set->highest_location if necessary.
(linemap_position_for_loc_and_offset): Handle ad-hoc locations;
pass "set" to linemap_position_for_line_and_column.
(linemap_macro_map_loc_unwind_toward_spelling): Add line_maps
param. Handle ad-hoc locations.
(linemap_location_in_system_header_p): Pass on "set" to call to
linemap_macro_map_loc_unwind_toward_spelling.
(linemap_macro_loc_to_spelling_point): Retain ad-hoc locations.
Pass on "set" to call to
linemap_macro_map_loc_unwind_toward_spelling.
(linemap_resolve_location): Retain ad-hoc locations. Pass on
"set" to call to linemap_macro_map_loc_unwind_toward_spelling.
(linemap_unwind_toward_expansion): Pass on "set" to call to
linemap_macro_map_loc_unwind_toward_spelling.
(linemap_expand_location): Extract the data pointer before
extracting the location.
(rich_location::rich_location): Add line_maps param; use it to
extract the range from the source_location.
* location-example.txt: Regenerate, showing new representation.
From-SVN: r230331
|
|
* lex.c (search_line_sse42): Correctly advance the pointer to an
aligned address.
From-SVN: r229718
|
|
as U+0001.)
/libcpp
2015-07-02 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53690
* charset.c (_cpp_valid_ucn): Add cppchar_t * parameter and change
return type to bool. Fix encoding of \u0000 and \U00000000 in C++.
(convert_ucn): Adjust call.
* lex.c (forms_identifier_p): Likewise.
* internal.h (_cpp_valid_ucn): Adjust declaration.
/gcc/testsuite
2015-07-02 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53690
* g++.dg/cpp/pr53690.C: New.
From-SVN: r225353
|
|
libcpp:
2015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
Implement N4197 - Adding u8 character literals
* include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens;
(struct cpp_options): Add utf8_char_literals.
* init.c (struct lang_flags): Add utf8_char_literals;
(struct lang_flags lang_defaults): Add column for utf8_char_literals.
* macro.c (stringify_arg()): Treat CPP_UTF8CHAR token;
* expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()):
Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens;
(cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token;
(eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token.
* lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens.
* charset.c (converter_for_type(), cpp_interpret_charconst()):
Treat CPP_UTF8CHAR token.
gcc/c-family:
2015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
Implement N4197 - Adding u8 character literals
* c-family/c-ada-spec.c (print_ada_macros()): Treat CPP_UTF8CHAR
like CPP_CHAR.
* c-family/c-common.c (c_parse_error()): print CPP_UTF8CHAR
and CPP_UTF8CHAR_USERDEF tokens.
* c-family/c-lex.c (c_lex_with_flags()): Treat CPP_UTF8CHAR_USERDEF
and CPP_UTF8CHAR tokens; (lex_charconst()): Treat CPP_UTF8CHAR token.
gcc/cp:
2015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
Implement N4197 - Adding u8 character literals
* parser.c (cp_parser_primary_expression()): Treat CPP_UTF8CHAR
and CPP_UTF8CHAR_USERDEF tokens;
(cp_parser_parenthesized_expression_list()): Treat CPP_UTF8CHAR token.
gcc/testsuite:
2015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
Implement N4197 - Adding u8 character literals
* g++.dg/cpp1z/utf8.C: New.
* g++.dg/cpp1z/utf8-neg.C: New.
* g++.dg/cpp1z/udlit-utf8char.C: New.
From-SVN: r225185
|
|
* lex.c (search_line_sse42) [__GCC_ASM_FLAG_OUTPUTS__]: New main
loop using asm flag outputs.
From-SVN: r225160
|
|
libcpp/
* lex.c (lex_string): Add -Wc++11-compat warning.
* include/cpplib.h: Add CPP_W_CXX11_COMPAT.
(struct cpp_options): Add cpp_warn_cxx11_compat.
* init.c (cpp_create_reader): Initialize it.
gcc/c-family/
* c.opt (Wc++0x-compat): Set it.
From-SVN: r222961
|
|
"vector")
PR preprocessor/61977
* lex.c (cpp_peek_token): If peektok is CPP_EOF, back it up
with all tokens peeked by the current function.
* gcc.dg/cpp/pr61977.c: New test.
From-SVN: r221882
|
|
"vector")
PR preprocessor/61977
* lex.c (cpp_peek_token): Temporarily clear pfile->cb.line_change.
* gcc.target/powerpc/pr61977-1.c: New test.
* gcc.target/powerpc/pr61977-2.c: New test.
From-SVN: r221839
|
|
libcpp/
2015-03-16 Edward Smith-Rowland <3dw4rd@verizon.net>
PR c++/64626
* lex.c (lex_number): If a number ends with digit-seps (') skip back
and let lex_string take them.
gcc/testsuite/
2015-03-16 Edward Smith-Rowland <3dw4rd@verizon.net>
PR c++/64626
g++.dg/cpp1y/pr64626-1.C: New.
g++.dg/cpp1y/pr64626-2.C: New.
g++.dg/cpp1y/digit-sep-neg.C: Adjust errors and warnings.
From-SVN: r221470
|
|
runtime error: load of misaligned address 0x01002172dfc6 for type 'const uchar', which requires 16 byte alignment)
Fix PR65261
Running bootstrap-ubsan on ppc64le shows many instances of:
libcpp/lex.c:552:30: runtime error: load of misaligned address
0x01001f31d37a for type 'const uchar', which requires 16 byte alignment
But the unaligned vector loads are intended in this case, because they
are preferable to forced-alignment on POWER8. So just silence the ubsan
errors.
2015-03-02 Markus Trippelsdorf <markus@trippelsdorf.de>
include/
PR target/65261
* ansidecl.h (ATTRIBUTE_NO_SANITIZE_UNDEFINED): New macro.
libcpp/
PR target/65261
* lex.c (search_line_fast): Silence ubsan errors.
From-SVN: r221190
|
|
2015-01-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
* lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON.
From-SVN: r220281
|
|
From-SVN: r219188
|
|
PR target/63966
* lex.c [__i386__ || __x86_64__]: Compile special SSE functions
only for (__GNUC__ >= 5 || !defined(__PIC__)).
From-SVN: r217851
|
|
PR target/63966
* lex.c [__i386__ || __x86_64__]: Include system <cpuid.h> for
GCC_VERSION < 5000.
From-SVN: r217830
|
|
This patch makes cpplib track the original spellings of extended
identifiers, as well as the canonical UTF-8 version, in order to
follow standard semantics properly without needing a convoluted and
undocumented canonicalization in translation phase 1 (see bug 9449
comments 39-46 regarding such a canonicalization).
The spelling is tracked in cpp_identifier and cpp_macro_arg without
making cpp_token any larger. The original spelling is used for checks
of duplicate macro definitions, stringizing (see the C++ tests added;
this case is only an issue for C++ not C because C makes it
implementation-defined whether a \ is inserted before the \ of a UCN
in a string or character constant when stringizing, while C++ does
not), pasting (relevant when the result is then stringized for C++)
and when macro definitions are output as text (e.g. for -d options).
Once a macro has been defined, only the original spelling of the
argument names needs keeping in the argument list. While it is being
defined, however, both spellings are needed: the original one for
subsequent saving for checks of duplicate macro definitions, and the
canonical one which is the node marked specially to generate macro
argument tokens rather than normal identifier tokens. The buffer that
is used to save the original values of the identifier tokens is
changed so that it stores both those original values and a pointer to
the canonical hash nodes, so that those canonical nodes can be found
when their values need restoring after the macro definition has been
parsed.
I believe this covers the known standards issues in extended
identifiers support (the remaining unimplemented C99 areas in GCC all
being floating-point-related), except for C++ translation of extended
characters to UCNs in phase 1 (which I have no plans to work on).
There are however probably issues left with handling of extended
identifiers in other places, as listed in
<https://gcc.gnu.org/ml/gcc-patches/2014-11/msg00337.html> (those
issues are generally the sort of thing that could be addressed as bugs
outside development stage 1). (The bulk of the potential issues Zack
was concerned about in 2003-5, that resulted in extended identifiers
being disabled in the absence of -fextended-identifiers, were
effectively eliminated by the audit and fixes I did in 2009, however;
that todo list reflects what was left over after that audit.)
Bootstrapped with no regressions on x86_64-unknown-linux-gnu.
libcpp:
* include/cpp-id-data.h (struct cpp_macro): Update comment
regarding parameters.
* include/cpplib.h (struct cpp_macro_arg, struct cpp_identifier):
Add spelling fields.
(struct cpp_token): Update comment on macro_arg.
* internal.h (_cpp_save_parameter): Add extra argument.
(_cpp_spell_ident_ucns): New declaration.
* lex.c (lex_identifier): Add SPELLING argument. Set *SPELLING to
original spelling of identifier.
(_cpp_lex_direct): Update calls to lex_identifier.
(_cpp_spell_ident_ucns): New function, factored out of
cpp_spell_token.
(cpp_spell_token): Adjust FORSTRING argument semantics to return
original spelling of identifiers. Use _cpp_spell_ident_ucns in
!FORSTRING case.
(_cpp_equiv_tokens): Check spellings of identifiers and macro
arguments are identical.
* macro.c (macro_arg_saved_data): New structure.
(paste_tokens): Use original spellings of identifiers from
cpp_spell_token.
(_cpp_save_parameter): Add argument SPELLING. Save both canonical
node and its value.
(parse_params): Update calls to _cpp_save_parameter.
(lex_expansion_token): Save spelling of macro argument tokens.
(_cpp_create_definition): Extract canonical node from saved data.
(cpp_macro_definition): Use UCNs in spelling of macro name. Use
original spellings of macro argument tokens and identifiers.
* traditional.c (scan_parameters): Update call to
_cpp_save_parameter.
gcc:
* doc/invoke.texi (-std=c99, -std=c11): Don't refer to corner
cases of extended identifiers.
gcc/testsuite:
* g++.dg/cpp/ucnid-2.C, g++.dg/cpp/ucnid-3.C,
gcc.dg/cpp/ucnid-11.c, gcc.dg/cpp/ucnid-12.c,
gcc.dg/cpp/ucnid-13.c, gcc.dg/cpp/ucnid-14.c,
gcc.dg/cpp/ucnid-15.c: New tests.
From-SVN: r217202
|
|
targets when Altivec is enabled.
2014-10-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* lex.c (search_line_fast): Add new version to be used for Power8
and later targets when Altivec is enabled. Restrict the existing
Altivec version to big-endian systems so that lvsr is not used on
little endian, where it is deprecated. Remove LE-specific code
from the now-BE-only version.
From-SVN: r215873
|
|
PR c/61854
libcpp/
* init.c (struct lang_flags): Remove cplusplus_comments.
(cpp_set_lang): Likewise.
(post_options): Likewise.
* lex.c (_cpp_lex_direct): Disallow C++ style comments in C90/C94.
testsuite/
* gcc.dg/cpp/pr61854-1.c: New test.
* gcc.dg/cpp/pr61854-2.c: New test.
* gcc.dg/cpp/pr61854-3.c: New test.
* gcc.dg/cpp/pr61854-3.h: New test.
* gcc.dg/cpp/pr61854-4.c: New test.
* gcc.dg/cpp/pr61854-5.c: New test.
* gcc.dg/cpp/pr61854-6.c: New test.
* gcc.dg/cpp/pr61854-7.c: New test.
* gcc.dg/cpp/pr61854-c90.c: New test.
* gcc.dg/cpp/pr61854-c94.c: New test.
From-SVN: r215339
|
|
* include/cpplib.h (cpp_options): Use signed char.
* lex.c (_cpp_lex_direct): Don't warn in C++ mode.
From-SVN: r214210
|
|
From-SVN: r214166
|
|
warn_c90_c99_compat.
gcc/c-family/
* c-opts.c (sanitize_cpp_opts): Make warn_long_long be set according
to warn_c90_c99_compat.
* c.opt (Wc90-c99-compat, Wdeclaration-after-statement): Initialize
to -1.
gcc/c/
* c-decl.c (warn_variable_length_array): Pass OPT_Wvla unconditionally
to pedwarn_c90.
* c-errors.c: Include "opts.h".
(pedwarn_c90): Rewrite to handle -Wno-c90-c99-compat better.
* c-parser.c (disable_extension_diagnostics): Handle negative value
of warn_c90_c99_compat, too.
(restore_extension_diagnostics): Likewise.
(c_parser_compound_statement_nostart): Pass
OPT_Wdeclaration_after_statement unconditionally to pedwarn_c90.
gcc/testsuite/
* gcc.dg/Wc90-c99-compat-4.c: Remove all dg-warnings.
* gcc.dg/Wc90-c99-compat-5.c: Remove all dg-errors.
* gcc.dg/Wc90-c99-compat-7.c: New test.
* gcc.dg/Wc90-c99-compat-8.c: New test.
* gcc.dg/Wdeclaration-after-statement-4.c: New test.
libcpp/
* charset.c (_cpp_valid_ucn): Warn only if -Wc90-c99-compat.
* lex.c (_cpp_lex_direct): Likewise.
* macro.c (replace_args): Likewise.
(parse_params): Likewise.
* include/cpplib.h (cpp_options): Change cpp_warn_c90_c99_compat
to char.
From-SVN: r214131
|
|
PR c/51849
gcc/
* gcc/doc/invoke.texi: Document -Wc90-c99-compat.
gcc/c-family/
* c-opts.c (sanitize_cpp_opts): Pass warn_c90_c99_compat to libcpp.
* c.opt (Wc90-c99-compat): Add option.
gcc/c/
* c-decl.c (build_array_declarator): Remove check for !flag_isoc99.
Call pedwarn_c90 instead of pedwarn.
(check_bitfield_type_and_width): Likewise.
(declspecs_add_qual): Likewise.
(declspecs_add_type): Likewise.
(warn_variable_length_array): Unify function for -pedantic and -Wvla.
Adjust to only call pedwarn_c90.
(grokdeclarator): Remove pedantic && !flag_isoc99 check. Call
pedwarn_c90 instead of pedwarn.
* c-errors.c (pedwarn_c90): Handle -Wc90-c99-compat.
* c-parser.c (disable_extension_diagnostics): Handle
warn_c90_c99_compat.
(restore_extension_diagnostics): Likewise.
(c_parser_enum_specifier): Remove check for !flag_isoc99. Call
pedwarn_c90 instead of pedwarn.
(c_parser_initelt): Likewise.
(c_parser_postfix_expression): Likewise.
(c_parser_postfix_expression_after_paren_type): Likewise.
(c_parser_compound_statement_nostart): Remove check for !flag_isoc99.
* c-tree.h: Fix formatting.
* c-typeck.c (build_array_ref): Remove check for !flag_isoc99. Call
pedwarn_c90 instead of pedwarn.
gcc/testsuite/
* gcc.dg/Wc90-c99-compat-1.c: New test.
* gcc.dg/Wc90-c99-compat-2.c: New test.
* gcc.dg/Wc90-c99-compat-3.c: New test.
* gcc.dg/Wc90-c99-compat-4.c: New test.
* gcc.dg/Wc90-c99-compat-5.c: New test.
* gcc.dg/Wc90-c99-compat-6.c: New test.
* gcc.dg/wvla-1.c: Adjust dg-warning.
* gcc.dg/wvla-2.c: Adjust dg-warning.
* gcc.dg/wvla-4.c: Adjust dg-warning.
* gcc.dg/wvla-6.c: Adjust dg-warning.
libcpp/
* lex.c (_cpp_lex_direct): Warn when -Wc90-c99-compat is in effect.
* charset.c (_cpp_valid_ucn): Likewise.
* include/cpplib.h (cpp_options): Add cpp_warn_c90_c99_compat.
* macro.c (replace_args): Warn when -Wc90-c99-compat is in effect.
(parse_params): Likewise.
From-SVN: r213786
|
|
for C++ input files)
2014-07-10 Edward Smith-Rowland <3dw4rd@verizon.net>
Jonathan Wakely <jwakely@redhat.com>
PR CPP/61389
* macro.c (_cpp_arguments_ok, parse_params, create_iso_definition):
Warning messages mention C++11 in c++ mode and C99 in c mode.
* lex.c (lex_identifier_intern, lex_identifier): Ditto
Co-Authored-By: Jonathan Wakely <jwakely@redhat.com>
From-SVN: r212441
|
|
libcpp/
2014-07-09 Edward Smith-Rowland <3dw4rd@verizon.net>
PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped
by preprocessor
* lex.c (lex_raw_string ()): Do not warn about invalid suffix
if skipping. (lex_string ()): Ditto.
gcc/testsuite/
2014-07-09 Edward Smith-Rowland <3dw4rd@verizon.net>
PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped
g++.dg/cpp0x/pr58155.C: New.
From-SVN: r212392
|
|
libstdc++-v3:
* configure.host: Remove solaris2.9 handling.
Change os_include_dir to os/solaris/solaris2.10.
* acinclude.m4 (ac_has_gthreads): Remove solaris2.9* handling.
* crossconfig.m4: Remove *-solaris2.9 handling, simplify.
* configure: Regenerate.
* config/abi/post/solaris2.9: Remove.
* config/os/solaris/solaris2.9: Rename to ...
* config/os/solaris/solaris2.10: ... this.
* config/os/solaris/solaris2.10/os_defines.h (CLOCK_MONOTONIC):
Remove.
* doc/xml/manual/configure.xml (--enable-libstdcxx-threads):
Remove Solaris 9 reference.
* doc/html/manual/configure.html: Regenerate.
* testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc:
Remove *-*-solaris2.9 xfail.
* testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/12.cc:
Likewise.
* testsuite/ext/enc_filebuf/char/13598.cc: Remove *-*-solaris2.9
xfail.
libjava:
* configure.ac (THREADLIBS, THREADSPEC): Remove *-*-solaris2.9
handling.
* configure: Regenerate.
libgfortran:
* config/fpu-387.h [__sun__ && __svr4__]: Remove SSE execution
check.
libgcc:
* config/i386/crtfastmath.c (set_fast_math): Remove SSE execution
check.
* config/i386/sol2-unwind.h (x86_fallback_frame_state): Remove
Solaris 9 single-threaded support.
* config/sparc/sol2-unwind.h (sparc64_is_sighandler): Remove
Solaris 9 single-threaded support. Add call_user_handler code
sequences.
(sparc_is_sighandler): Likewise.
libcpp:
* lex.c: Remove Solaris 9 reference.
gcc/testsuite:
* gcc.c-torture/compile/pr28865.c: Remove dg-xfail-if.
* gcc.dg/c99-stdint-6.c: Remove dg-options for *-*-solaris2.9.
* gcc.dg/lto/20090210_0.c: Remove dg-extra-ld-options for
*-*-solaris2.9.
* gcc.dg/torture/pr47917.c: Remove dg-options for *-*-solaris2.9.
* gcc.target/i386/pr22076.c: Remove i?86-*-solaris2.9 handling
from dg-options.
* gcc.target/i386/pr22152.c: Remove i?86-*-solaris2.9 handling
from dg-additional-options.
* gcc.target/i386/vect8-ret.c: Remove i?86-*-solaris2.9 handling
from dg-options.
* gcc.dg/vect/tree-vect.h (check_vect): Remove Solaris 9 SSE2
execution check.
* gcc.target/i386/sse-os-support.h [__sun__ && __svr4__]
(sigill_hdlr): Remove.
(sse_os_support) [__sun__ && __svr4__]: Remove SSE execution
check.
* gfortran.dg/erf_3.F90: Remove sparc*-*-solaris2.9* handling.
* gfortran.dg/fmt_en.f90: Remove i?86-*-solaris2.9* handling.
* gfortran.dg/round_4.f90: Remove *-*-solaris2.9* handling.
* lib/target-supports.exp (add_options_for_tls): Remove
*-*-solaris2.9* handling.
gcc:
* config.gcc (enable_obsolete): Remove *-*-solaris2.9*.
(*-*-solaris2.[0-9] | *-*-solaris2.[0-9].*): Mark unsupported.
(*-*-solaris2*): Simplify.
(i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*): Likewise.
(i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*): Remove
*-*-solaris2.9* handling.
* configure.ac (gcc_cv_as_hidden): Remove test for Solaris 9/x86
as bug.
(gcc_cv_ld_hidden): Remove *-*-solaris2.9* handling.
(ld_tls_support): Remove i?86-*-solaris2.9, sparc*-*-solaris2.9
handling, simplify.
(gcc_cv_as_gstabs_flag): Remove workaround for Solaris 9/x86 as bug.
* configure: Regenerate.
* config/i386/sol2-9.h: Remove.
* doc/install.texi (Specific, i?86-*-solaris2.9): Remove.
(Specific, *-*-solaris2*): Mention Solaris 9 support removal.
Remove Solaris 9 references.
fixincludes:
* inclhack.def (math_exception): Bypass on *-*-solaris2.1[0-9]*.
(solaris_int_types): Remove.
(solaris_longjmp_noreturn): Remove.
(solaris_mutex_init_2): Remove.
(solaris_once_init_2): Remove.
(solaris_sys_va_list): Remove.
* fixincl.x: Regenerate.
* tests/base/iso/setjmp_iso.h: Remove.
* tests/base/pthread.h [SOLARIS_MUTEX_INIT_2_CHECK]: Remove.
[SOLARIS_ONCE_INIT_1_CHECK]: Remove wrapping done by
solaris_once_init_2.
[SOLARIS_ONCE_INIT_2_CHECK]: Remove.
* tests/base/sys/int_types.h: Remove.
* tests/base/sys/va_list.h: Remove.
contrib:
* config-list.mk (LIST): Remove sparc-sun-solaris2.9, i686-solaris2.9.
From-SVN: r209621
|
|
From-SVN: r206293
|
|
2013-11-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* lex.c (search_line_fast): Correct for little endian.
From-SVN: r204970
|
|
gcc/testsuite:
* c-c++-common/cpp/ucnid-2011-1.c: New test.
libcpp:
* ucnid.tab: Add C11 and C11NOSTART data.
* makeucnid.c (digit): Rename enum value to N99.
(C11, N11, all_languages): New enum values.
(NUM_CODE_POINTS, MAX_CODE_POINT): New macros.
(flags, decomp, combining_value): Use NUM_CODE_POINTS as array
size.
(decomp): Use unsigned int as element type.
(all_decomp): New array.
(read_ucnid): Handle C11 and C11NOSTART. Use MAX_CODE_POINT.
(read_table): Use MAX_CODE_POINT. Store all decompositions in
all_decomp.
(read_derived): Use MAX_CODE_POINT.
(write_table): Use NUM_CODE_POINTS. Print N99, C11 and N11
flags. Print whole array variable declaration rather than just
array contents.
(char_id_valid, write_context_switch): New functions.
(main): Call write_context_switch.
* ucnid.h: Regenerate.
* include/cpplib.h (struct cpp_options): Add c11_identifiers.
* init.c (struct lang_flags): Add c11_identifiers.
(cpp_set_lang): Set c11_identifiers option from selected language.
* internal.h (struct normalize_state): Document "previous" as
previous starter character.
(NORMALIZE_STATE_UPDATE_IDNUM): Take character as argument.
* charset.c (DIG): Rename enum value to N99.
(C11, N11): New enum values.
(struct ucnrange): Give name to struct. Use short for flags and
unsigned int for end of range. Include ucnid.h for whole variable
declaration.
(ucn_valid_in_identifier): Allow for characters up to 0x10FFFF.
Allow for C11 in determining valid characters and valid start
characters. Use check_nfc for non-Hangul context-dependent
checks. Only store starter characters in nst->previous.
(_cpp_valid_ucn): Pass new argument to
NORMALIZE_STATE_UPDATE_IDNUM.
* lex.c (lex_identifier): Pass new argument to
NORMALIZE_STATE_UPDATE_IDNUM. Call NORMALIZE_STATE_UPDATE_IDNUM
after initial non-UCN part of identifier.
(lex_number): Pass new argument to NORMALIZE_STATE_UPDATE_IDNUM.
From-SVN: r204886
|
|
libcpp:
2013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
Implement C++14 digit separators.
* include/cpplib.h (cpp_options): Add digit_separators flag.
* internal.h (DIGIT_SEP(c)): New macro.
* expr.c (cpp_classify_number): Check improper placement of digit sep;
(cpp_interpret_integer): Skip over digit separators.
* init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add
digit separator flags per language; (cpp_set_lang): Set
digit_separators
* lex.c (lex_number): Add digits separator to allowable characters for
C++14.
gcc/c-family:
2013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
Implement C++14 digit separators.
* c-lex.c (interpret_float): Remove digit separators from scratch string
before building real literal.
gcc/testsuite:
2013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
Implement C++14 digit separators.
* g++.dg/cpp1y/digit-sep.C: New.
* g++.dg/cpp1y/digit-sep-neg.C: New.
* g++.dg/cpp1y/digit-sep-cxx11-neg.C: New.
libstdc++-v3:
2013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
Implement C++14 digit separators.
* include/include/bits/parse_numbers.h: Change struct _Digit<_Base, '`'>
to struct _Digit<_Base, '\''>.
From-SVN: r204260
|
|
parsing.)
PR preprocessor/57620
* lex.c (lex_raw_string): Undo phase1 and phase2 transformations
between R" and final " rather than only in between R"del( and )del".
* c-c++-common/raw-string-2.c (s12, u12, U12, L12): Remove.
(main): Don't test {s,u,U,L}12.
* c-c++-common/raw-string-13.c: New test.
* c-c++-common/raw-string-14.c: New test.
* c-c++-common/raw-string-15.c: New test.
* c-c++-common/raw-string-16.c: New test.
From-SVN: r201091
|
|
arguments or deferred pragmas)
PR preprocessor/57824
* lex.c (lex_raw_string): Allow reading new-lines if
in_deferred_pragma or if parsing_args and there is still
data in the current buffer.
* c-c++-common/raw-string-17.c: New test.
* c-c++-common/gomp/pr57824.c: New test.
From-SVN: r200879
|
|
CPP_TOKEN_FLD_STR tokens, not just CPP_COMMENT.
* c-ppoutput.c (scan_translation_unit): Call account_for_newlines
for all CPP_TOKEN_FLD_STR tokens, not just CPP_COMMENT.
* include/cpplib.h (cpp_token_val_index): Change parameter type to
const cpp_token *.
* lex.c (cpp_token_val_index): Likewise.
* c-c++-common/raw-string-18.c: New test.
* c-c++-common/raw-string-19.c: New test.
From-SVN: r200878
|
|
for C++11 user-defined literals)
PR preprocessor/57757
* lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING
or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that
starts if a-zA-Z_.
* g++.dg/cpp/paste1.C: New test.
* g++.dg/cpp/paste2.C: New test.
From-SVN: r200875
|
|
literal and macro to just the...
libcpp:
2013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
* lex.c (lex_raw_string(), lex_string()): Constrain suffixes treated
as concatenated literal and macro to just the patterns found in
inttypes.h; (is_macro()): New.
gcc/cp:
2013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
* cp-tree.h (UDLIT_OP_ANSI_PREFIX): Remove space.
* parser.c (cp_parser_operator()): Parse user-defined string
literal as literal operator.
gcc/testsuite:
2013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
* g++.dg/cpp0x/udlit-nospace-neg.C: Adjust.
* g++.dg/cpp1y/udlit-enc-prefix-neg.C: New.
* g++.dg/cpp1y/udlit-userdef-string.C: New.
* g++.dg/cpp1y/complex_literals.h: New.
From-SVN: r200563
|
|
/libcpp
2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
* include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y.
* init.c (lang_defaults): Add defaults for the latter.
(cpp_init_builtins): Define __cplusplus as 201300L for the latter.
* lex.c (_cpp_lex_direct): Update.
/gcc/c-family
2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
* c-opts.c (set_std_cxx11): Use CLK_CXX1Y and CLK_GNUCXX1Y.
/gcc/testsuite
2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
* g++.dg/cpp1y/cplusplus.C: New.
From-SVN: r198261
|
|
* configure.ac: Don't define ENABLE_CHECKING whenever
--enable-checking is seen, instead use similar --enable-checking=yes
vs. --enable-checking=release default as gcc/ subdir has and
define ENABLE_CHECKING if ENABLE_CHECKING is defined in gcc/.
Define ENABLE_VALGRIND_CHECKING if requested.
* lex.c (new_buff): If ENABLE_VALGRIND_CHECKING, put _cpp_buff
struct first in the allocated buffer and result->base after it.
(_cpp_free_buff): If ENABLE_VALGRIND_CHECKING, free buff itself
instead of buff->base.
* config.in: Regenerated.
* configure: Regenerated.
From-SVN: r196333
|
|
without leading underscore.)
gcc/libcpp/
2013-02-13 Ed Smith-Rowland <3dw4rd@verizon.net>
PR c++/55582
* libcpp/lex.c (lex_raw_string): Allow string literal with suffix
beginning with 's' to be parsed as a C++11 user-defined literal.
gcc/testsuite/
2013-02-13 Ed Smith-Rowland <3dw4rd@verizon.net>
PR c++/55582
* g++.dg/cpp0x/udlit-string-literal.h: New.
* g++.dg/cpp0x/udlit-string-literal.C: New.
From-SVN: r196041
|
|
From-SVN: r195162
|
|
/libcpp
2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/54526 (again)
* lex.c (_cpp_lex_direct): In C++11 mode, implement 2.5 p3, bullet 2.
/gcc/cp
2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/54526 (again)
* parser.c (cp_parser_template_id): Revert core of previous change
(keep adjusted inform message).
/gcc/testsuite
2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/54526 (again)
* g++.dg/cpp0x/parse2.C: Extend.
* g++.old-deja/g++.other/crash28.C: Adjust.
From-SVN: r194909
|
|
2012-10-15 Tobias Burnus <burnus@net-b.de>
* files.c (read_file_guts, _cpp_save_file_entries): Free memory
before returning.
* lex.c (warn_about_normalization): Ditto.
* mkdeps.c (deps_save): Ditto.
* pch.c (cpp_valid_state): Ditto.
From-SVN: r192474
|
|
__builtin_ia32_pcmpestri128 instead of asm.
* lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
__builtin_ia32_pcmpestri128 instead of asm.
From-SVN: r188782
|
|
PR bootstrap/53459
* lex.c (search_line_fast): Avoid unused local typedefs to simulate
a static assertion.
From-SVN: r187947
|
|
This reverts commit r187853
From-SVN: r187946
|
|
libcpp/
PR bootstrap/53459
* lex.c (search_line_fast): Remove unused typedef check_count.
From-SVN: r187853
|
|
I noticed that the file lex.c had C++ style comments, which I believe
is against the coding standards of the project.
Fixed, tested and applied to master as per the obvious rule.
libcpp/
* lex.c (lex_raw_string): Change C++ style comments into C
style comments.
(lex_string): Likewise.
From-SVN: r186946
|
|
This option, which is enabled by default, causes the preprocessor to warn
when a string or character literal is followed by a ud-suffix which does
not begin with an underscore. According to [lex.ext]p10, this is
ill-formed.
Also modifies the preprocessor to treat such ill-formed suffixes as separate
preprocessing tokens. This is consistent with the Clang front end (see
http://llvm.org/viewvc/llvm-project?view=rev&revision=152287), and enables
backwards compatibility with code that uses formatting macros from
<inttypes.h>, as in the following code block:
int main() {
int64_t i64 = 123;
printf("My int64: %"PRId64"\n", i64);
}
Google ref b/6377711.
2012-04-27 Ollie Wild <aaw@google.com>
PR c++/52538
* gcc/c-family/c-common.c: Add CPP_W_LITERAL_SUFFIX mapping.
* gcc/c-family/c-opts.c (c_common_handle_option): Handle
OPT_Wliteral_suffix.
* gcc/c-family/c.opt: Add Wliteral-suffix.
* gcc/doc/invoke.texi (Wliteral-suffix): Document new option.
* gcc/testsuite/g++.dg/cpp0x/Wliteral-suffix.c: New test.
* libcpp/include/cpplib.h (struct cpp_options): Add new field,
warn_literal_suffix.
(CPP_W_LITERAL_SUFFIX): New enum.
* libcpp/init.c (cpp_create_reader): Default initialization of
warn_literal_suffix.
* libcpp/lex.c (lex_raw_string): Treat user-defined literals which
don't begin with '_' as separate tokens and produce a warning.
(lex_string): Ditto.
From-SVN: r186909
|
|
From-SVN: r185702
|
|
libstdc++-v3:
* config/os/solaris/solaris2.8: Rename to ...
* config/os/solaris/solaris2.9: ... this.
* config/abi/post/solaris2.8: Rename to ...
* config/abi/post/solaris2.9: ... this.
* configure.host (os_include_dir): Remove solaris2.8.
Reflect renaming.
(abi_baseline_pair): Remove *-*-solaris2.8.
Reflect renaming.
* configure.ac (GLIBCXX_CHECK_MATH_PROTO): Remove
(GLIBCXX_CHECK_STDLIB_PROTO): Remove.
* acinclude.m4 (GLIBCXX_CHECK_MATH_PROTO): Remove
(GLIBCXX_CHECK_STDLIB_PROTO): Remove.
(GLIBCXX_CHECK_GTHREADS): Remove Solaris 8 handling.
* crossconfig.m4 (GLIBCXX_CROSSCONFIG): Remove *-solaris2.8
handling.
* configure: Regenerate.
* config.h.in: Regenerate.
* config/os/solaris/solaris2.9/os_defines.h
(__CORRECT_ISO_CPP_MATH_H_PROTO): Define.
(__CORRECT_ISO_CPP_STDLIB_H_PROTO): Define.
* include/c_global/cmath: Rename __CORRECT_ISO_CPP_MATH_H_PROTO1
to __CORRECT_ISO_CPP_MATH_H_PROTO.
[!__CORRECT_ISO_CPP_MATH_H_PROTO2]: Remove.
* include/tr1/cmath: Rename __CORRECT_ISO_CPP_MATH_H_PROTO1 to
__CORRECT_ISO_CPP_MATH_H_PROTO.
* doc/xml/manual/configure.xml (Configure, --enable-libstdcxx-threads):
Remove Solaris 8 reference.
* testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc:
Don't xfail on *-*-solaris2.8.
* testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/12.cc:
Likewise.
* testsuite/ext/enc_filebuf/char/13598.cc: Don't xfail on
*-*-solaris2.8.
libjava:
* configure.ac (THREADLIBS): Remove *-*-solaris2.8 handling.
* configure: Regenerate.
libgcc:
* config/i386/sol2-unwind.h (x86_fallback_frame_state): Remove
Solaris 8 handling.
* config/sparc/sol2-unwind.h (sparc64_is_sighandler): Remove
Solaris 8 handling.
(sparc_is_sighandler): Likewise.
libcpp:
* lex.c: Remove Solaris 8 reference.
gcc/testsuite:
* g++.dg/warn/miss-format-1.C: Remove *-*-solaris2.8 handling.
* gcc.dg/c99-stdint-6.c: Likewise.
* gcc.dg/lto/20090210_0.c: Likewise.
* gcc.dg/pr28796-2.c: Don't skip on sparc*-sun-solaris2.8.
* gcc.dg/pragma-init-fini.c: Don't skip on i?86-*-solaris2.8.
* gcc.dg/pragma-init-fini-2.c: Likewise.
* gcc.dg/torture/pr47917.c: Remove *-*-solaris2.8 handling.
* gcc.target/i386/pr22076.c: Remove i?86-*-solaris2.8 handling.
* gcc.target/i386/pr22152.c: Likewise.
* gcc.target/i386/vect8-ret.c: Likewise.
* lib/target-supports.exp (add_options_for_tls): Remove Solaris 8
handling.
gcc:
* config.gcc (enable_obsolete): Remove *-*-solaris2.8*.
(*-*-solaris2.[0-8], *-*-solaris2.[0-8].*): Mark unsupported.
(i[34567]86-*-solaris2*, x86_64-*-solaris2.1[0-9]*): Remove
Solaris 8 support.
* configure.ac (gcc_cv_ld_hidden): Remove *-*-solaris2.8*.
(ld_tls_support): Remove Solaris 8 references.
(lwp_dir, lwp_spec): Remove support for alternate thread library.
* acinclude.m4 (gcc_cv_initfini_array): Remove *-*-solaris2.*
tests.
* configure: Regenerate.
* config.in: Regenerate.
* config/sol2.h (LINK_SPEC): Remove LIB_THREAD_LDFLAGS_SPEC.
* config/i386/sol2.h: Remove Solaris 8 references.
* doc/install.texi (Specific, i?86-*-solaris2.[89]): Rename to ...
(i?86-*-solaris2.9): ... this.
Remove Solaris 8 references.
(Specific, *-*-solaris2*): Document Solaris 8 removal.
Remove Solaris 8 references.
fixincludes:
* inclhack.def (math_exception): Remove duplicate.
(solaris_cond_init): Remove.
(solaris_sys_va_list): Remove Solaris 8 support.
* fixincl.x: Regenerate.
* tests/base/pthread.h [SOLARIS_COND_INIT_CHECK]: Remove.
From-SVN: r185392
|
|
PR bootstrap/50237
* internal.h (_cpp_init_lexer): New prototype.
* init.c (init_library): Call it.
* lex.c (init_vectorized_lexer): Remove constructor attribute,
add inline keyword.
(HAVE_init_vectorized_lexer): Define.
(_cpp_init_lexer): New function.
From-SVN: r182090
|
|
libcpp/
* expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
(cpp_classify_number): Classify unrecognized tokens as user-defined
literals.
* include/cpplib.h: Add new tokens for user-defined literals.
* init.c: Add new preprocessor flag (cxx11).
* lex.c: (lex_string, lex_raw_string): Handle user-defined literals
including concatenation and promotion with suffixes.
c-family/
* c-common.c (build_userdef_literal): New.
* c-common.def: New tree code.
* c-common.h (tree_userdef_literal): New tree struct and accessors.
* c-lex.c (interpret_float): Add suffix parm.
(c_lex_with_flags): Build literal tokens.
cp/
* cp-objcp-common.c: (cp_tree_size) Return size of USERDEF_LITERAL tree.
* cp-tree.h: (UDLIT_OP_*, UDLIT_OPER_P): Literal operator
name tools. New tree code for user-defined literals.
* cxx-pretty-print.h: (pp_cxx_userdef_literal) New.
* cxx-pretty-print.c: (pp_cxx_userdef_literal) New.
(pp_cxx_primary_expression, pp_cxx_expression): Use it.
* decl.c: (cp_tree_node_structure): Return new tree code.
(duplicate_decls): Check for raw vs. template operator conflicts.
(grokfndecl, grokdeclarator): New checks for literal operators.
* error.c: (dump_expr): Warn about user-defined literals
in C++98 mode. (dump_function_name): Pretty printing.
* mangle.c: (write_literal_operator_name): New.
(write_unqualified_id, write_unqualified_name): Use it.
* parser.c: (cp_parser_operator): Handle operator"".
(cp_parser_userdef_char_literal, cp_parser_userdef_numeric_literal,
cp_parser_userdef_string_literal): New.
(cp_parser_primary_expression): Handle new user-defined literal tokens
with new functions.
* semantics.c: (potential_constant_expression_1): Add
user-defined literals.
* typeck.c (check_raw_literal_operator,
check_literal_operator_args): New.
From-SVN: r180536
|
|
libcpp/
* include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
context to act upon.
* lex.c (_cpp_remaining_tokens_num_in_context): Likewise. Update
comment.
(cpp_token_from_context_at): Likewise.
(cpp_peek_token): Use the context to peek tokens from.
From-SVN: r180328
|