diff options
author | dj <dj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-10-14 19:44:36 +0000 |
---|---|---|
committer | dj <dj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-10-14 19:44:36 +0000 |
commit | 9f75f0266e3611513f196c898088e2712a71eaf4 (patch) | |
tree | e12f293c8d0e0b83e0dc6b0b250a64fb5d4bcd50 /gcc/c/c-parser.c | |
parent | b59bd98f4b8df2e37835310db9ad8d627a2cf3cc (diff) | |
download | gcc-9f75f0266e3611513f196c898088e2712a71eaf4.tar.gz |
* machmode.h (int_n_data_t): New.
(int_n_enabled_p): New.
(int_n_data): New.
* tree.c (int_n_enabled_p): New.
(int_n_trees): New.
(make_or_reuse_type): Check for all __intN types, not just
__int128.
(build_common_tree_nodes): Likewise. Also fill in integer_typs[]
entries.
* tree.h (int128_integer_type_node): Remove.
(int128_unsigned_type_node): Remove.
(int_n_trees_t): New.
(int_n_enabled_p): New.
(int_n_trees): New.
* toplev.c (standard_type_bitsize): New.
(do_compile): Check which __intN types are enabled for the current
run.
* builtin-types.def (BT_INT128): Remove.
(BT_UINT128): Remove.
* machmode.def: Add macro to create __int128 for all targets.
* stor-layout.c (mode_for_size): Support __intN types.
(smallest_mode_for_size): Likewise.
(initialize_sizetypes): Support __intN types.
* genmodes.c (struct mode_data): Add int_n field.
(blank_mode): Likewise.
(INT_N): New.
(make_int_n): New.
(emit_insn_modes_h): Count __intN entries and define
NUM_INT_N_ENTS.
(emit_mode_int_n): New.
(emit_insn_modes_c): Call it.
* gimple.c (gimple_signed_or_unsigned_type): Check for all __intN
types, not just __int128.
* tree-core.h (integer_type_kind): Remove __int128-specific
entries, reserve spots for __intN entries.
libstdc++-v3/
* src/c++11/limits.cc: Add support for __intN types.
* include/std/type_traits: Likewise.
* include/std/limits: Likewise.
* include/c_std/cstdlib: Likewise.
* include/bits/cpp_type_traits.h: Likewise.
* include/c_global/cstdlib: Likewise.
c-family/
* c-pretty-print.c (pp_c_integer_constant): Check for all __intN
types, not just __int128.
* c-cppbuiltin.c (c_cpp_builtins): Add builtins for all __intN
types, not just __int128.
(cpp_atomic_builtins): Round pointer sizes up.
(type_suffix): Use type precision, not specific types.
* c-common.c (c_common_reswords): Remove __int128 special case.
(c_common_type_for_size): Check for all __intN types, not just
__int128.
(c_common_type_for_mode): Likewise.
(c_common_signed_or_unsigned_type): Likewise.
(c_build_bitfield_integer_type): Likewise.
(c_common_nodes_and_builtins): Likewise.
(keyword_begins_type_specifier): Likewise.
* c-common.h (rid): Remove RID_INT128 and add RID_INT_N_* for all
__intN variants.
c/
* c-parser.c (c_parse_init): Add RID entries for each __intN.
(c_token_starts_typename): Check all __intN, not just __int128.
(c_token_starts_declspecs): Likewise.
(c_parser_declspecs): Likewise.
(c_parser_attribute_any_word): Likewise.
(c_parser_objc_selector): Likewise.
* c-tree.h (c_typespec_keyword): cts_int128 -> cts_int_n.
(struct c_declspecs): Add int_n_idx field to record *which* __intN
is specified.
* c-decl.c (declspecs_add_type): Check for all __intN, not just
__int128.
(finish_declspecs): Likewise.
testsuite/
* g++.dg/abi/mangle64.C: New.
cp/
* typeck.c (cp_common_type): Check for all __intN types, not just
__int128.
* decl.c (grokdeclarator): Likewise.
* rtti.c (emit_support_tinfos): Check for all __intN types, not just
__int128.
* parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Check
for all __intN types, not just __int128.
(cp_parser_simple_type_specifier): Likewise.
* mangle.c (integer_type_codes): Remove int128-specific codes.
* cp-tree.h (cp_decl_specifier_seq): Add int_n_idx to store which
__intN was specified.
* lex.c (init_reswords): Reserve all __intN keywords.
lto/
* lto-lang.c (lto_build_c_type_nodes): Check intN types for
size-type as well.
(lto_init): Initialize all intN types, not just int128.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216220 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c/c-parser.c')
-rw-r--r-- | gcc/c/c-parser.c | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 346448a149d..fa146de35d0 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -113,6 +113,16 @@ c_parse_init (void) C_IS_RESERVED_WORD (id) = 1; ridpointers [(int) c_common_reswords[i].rid] = id; } + + for (i = 0; i < NUM_INT_N_ENTS; i++) + { + /* We always create the symbols but they aren't always supported. */ + char name[50]; + sprintf (name, "__int%d", int_n_data[i].bitsize); + id = get_identifier (xstrdup (name)); + C_SET_RID_CODE (id, RID_FIRST_INT_N + i); + C_IS_RESERVED_WORD (id) = 1; + } } /* The C lexer intermediates between the lexer in cpplib and c-lex.c @@ -483,7 +493,6 @@ c_token_starts_typename (c_token *token) { case RID_UNSIGNED: case RID_LONG: - case RID_INT128: case RID_SHORT: case RID_SIGNED: case RID_COMPLEX: @@ -511,6 +520,10 @@ c_token_starts_typename (c_token *token) case RID_AUTO_TYPE: return true; default: + if (token->keyword >= RID_FIRST_INT_N + && token->keyword < RID_FIRST_INT_N + NUM_INT_N_ENTS + && int_n_enabled_p[token->keyword - RID_FIRST_INT_N]) + return true; return false; } case CPP_LESS: @@ -641,7 +654,6 @@ c_token_starts_declspecs (c_token *token) case RID_THREAD: case RID_UNSIGNED: case RID_LONG: - case RID_INT128: case RID_SHORT: case RID_SIGNED: case RID_COMPLEX: @@ -670,6 +682,10 @@ c_token_starts_declspecs (c_token *token) case RID_AUTO_TYPE: return true; default: + if (token->keyword >= RID_FIRST_INT_N + && token->keyword < RID_FIRST_INT_N + NUM_INT_N_ENTS + && int_n_enabled_p[token->keyword - RID_FIRST_INT_N]) + return true; return false; } case CPP_LESS: @@ -2158,7 +2174,7 @@ c_parser_static_assert_declaration_no_semi (c_parser *parser) type-specifier: typeof-specifier __auto_type - __int128 + __intN _Decimal32 _Decimal64 _Decimal128 @@ -2312,7 +2328,6 @@ c_parser_declspecs (c_parser *parser, struct c_declspecs *specs, /* Fall through. */ case RID_UNSIGNED: case RID_LONG: - case RID_INT128: case RID_SHORT: case RID_SIGNED: case RID_COMPLEX: @@ -2328,6 +2343,10 @@ c_parser_declspecs (c_parser *parser, struct c_declspecs *specs, case RID_FRACT: case RID_ACCUM: case RID_SAT: + case RID_INT_N_0: + case RID_INT_N_1: + case RID_INT_N_2: + case RID_INT_N_3: if (!typespec_ok) goto out; attrs_ok = true; @@ -3738,7 +3757,6 @@ c_parser_attribute_any_word (c_parser *parser) case RID_STATIC: case RID_UNSIGNED: case RID_LONG: - case RID_INT128: case RID_CONST: case RID_EXTERN: case RID_REGISTER: @@ -3768,6 +3786,10 @@ c_parser_attribute_any_word (c_parser *parser) case RID_TRANSACTION_CANCEL: case RID_ATOMIC: case RID_AUTO_TYPE: + case RID_INT_N_0: + case RID_INT_N_1: + case RID_INT_N_2: + case RID_INT_N_3: ok = true; break; default: @@ -8992,7 +9014,6 @@ c_parser_objc_selector (c_parser *parser) case RID_ALIGNOF: case RID_UNSIGNED: case RID_LONG: - case RID_INT128: case RID_CONST: case RID_SHORT: case RID_VOLATILE: @@ -9013,6 +9034,10 @@ c_parser_objc_selector (c_parser *parser) case RID_BOOL: case RID_ATOMIC: case RID_AUTO_TYPE: + case RID_INT_N_0: + case RID_INT_N_1: + case RID_INT_N_2: + case RID_INT_N_3: c_parser_consume_token (parser); return value; default: |