diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-11-25 22:15:57 +0100 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-11-28 01:09:41 +0100 |
commit | 39e46662c2f69c2f9eeeacbebe59cf1e2228f502 (patch) | |
tree | 7ce598bba93bcb5f082e3c3363146589a5c91a89 | |
parent | b7dd40f5f8ea20178e20151da2aed8f1787ac3f3 (diff) | |
download | sparse-39e46662c2f69c2f9eeeacbebe59cf1e2228f502.tar.gz |
spec: replace lllong_ctype by int128_ctype
Sparse knows about __int128_t, __uint128_t & __int128.
However, internally, these types are treated as a kind of 128-bit
'long long long' type. It's mainly a question of variable naming,
but these types are also displayed by show_typename() as
'long long long' which can't be parsed back, neither by GCC,
nor even by sparse itself.
So, rename the variables to use 'int128' and let show_typename()
display these types as '[signed|unsigned] __int128'.
Reported-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | parse.c | 14 | ||||
-rw-r--r-- | show-parse.c | 6 | ||||
-rw-r--r-- | symbol.c | 8 | ||||
-rw-r--r-- | symbol.h | 2 |
4 files changed, 15 insertions, 15 deletions
@@ -493,8 +493,8 @@ static struct init_keyword { /* Predeclared types */ { "__builtin_va_list", NS_TYPEDEF, .type = &ptr_ctype, .op = &spec_op }, { "__builtin_ms_va_list", NS_TYPEDEF, .type = &ptr_ctype, .op = &spec_op }, - { "__int128_t", NS_TYPEDEF, .type = &lllong_ctype, .op = &spec_op }, - { "__uint128_t",NS_TYPEDEF, .type = &ulllong_ctype, .op = &spec_op }, + { "__int128_t", NS_TYPEDEF, .type = &sint128_ctype, .op = &spec_op }, + { "__uint128_t",NS_TYPEDEF, .type = &uint128_ctype, .op = &spec_op }, { "_Float32", NS_TYPEDEF, .type = &float32_ctype, .op = &spec_op }, { "_Float32x", NS_TYPEDEF, .type = &float32x_ctype, .op = &spec_op }, { "_Float64", NS_TYPEDEF, .type = &float64_ctype, .op = &spec_op }, @@ -1229,8 +1229,8 @@ static struct symbol *to_TI_mode(struct symbol *ctype) { if (ctype->ctype.base_type != &int_type) return NULL; - return ctype->ctype.modifiers & MOD_UNSIGNED ? &ulllong_ctype - : &slllong_ctype; + return ctype->ctype.modifiers & MOD_UNSIGNED ? &uint128_ctype + : &sint128_ctype; } static struct symbol *to_pointer_mode(struct symbol *ctype) @@ -1569,13 +1569,13 @@ Catch_all: } static struct symbol * const int_types[] = - {&char_ctype, &short_ctype, &int_ctype, &long_ctype, &llong_ctype, &lllong_ctype}; + {&char_ctype, &short_ctype, &int_ctype, &long_ctype, &llong_ctype, &int128_ctype}; static struct symbol * const signed_types[] = {&schar_ctype, &sshort_ctype, &sint_ctype, &slong_ctype, &sllong_ctype, - &slllong_ctype}; + &sint128_ctype}; static struct symbol * const unsigned_types[] = {&uchar_ctype, &ushort_ctype, &uint_ctype, &ulong_ctype, &ullong_ctype, - &ulllong_ctype}; + &uint128_ctype}; static struct symbol * const real_types[] = {&float_ctype, &double_ctype, &ldouble_ctype}; static struct symbol * const * const types[] = { diff --git a/show-parse.c b/show-parse.c index a0436cbe..f0ea9cae 100644 --- a/show-parse.c +++ b/show-parse.c @@ -235,9 +235,9 @@ static struct ctype_name { { & llong_ctype, "long long", "LL" }, { &sllong_ctype, "signed long long", "LL" }, { &ullong_ctype, "unsigned long long", "ULL" }, - { & lllong_ctype, "long long long", "LLL" }, - { &slllong_ctype, "signed long long long", "LLL" }, - { &ulllong_ctype, "unsigned long long long", "ULLL" }, + { & int128_ctype, "__int128", "" }, + { &sint128_ctype, "signed __int128", "" }, + { &uint128_ctype, "unsigned __int128", "" }, { &void_ctype, "void", "" }, { &bool_ctype, "bool", "" }, @@ -726,7 +726,7 @@ struct symbol bool_ctype, void_ctype, type_ctype, int_ctype, sint_ctype, uint_ctype, long_ctype, slong_ctype, ulong_ctype, llong_ctype, sllong_ctype, ullong_ctype, - lllong_ctype, slllong_ctype, ulllong_ctype, + int128_ctype, sint128_ctype, uint128_ctype, float_ctype, double_ctype, ldouble_ctype, string_ctype, ptr_ctype, lazy_ptr_ctype, incomplete_ctype, label_ctype, bad_ctype, @@ -806,9 +806,9 @@ static const struct ctype_declare { { &llong_ctype, T__INT( 2, longlong) }, { &sllong_ctype, T_SINT( 2, longlong) }, { &ullong_ctype, T_UINT( 2, longlong) }, - { &lllong_ctype, T__INT( 3, longlonglong) }, - { &slllong_ctype, T_SINT( 3, longlonglong) }, - { &ulllong_ctype, T_UINT( 3, longlonglong) }, + { &int128_ctype, T__INT( 3, type128) }, + { &sint128_ctype, T_SINT( 3, type128) }, + { &uint128_ctype, T_UINT( 3, type128) }, { &float_ctype, T_FLOAT(-1, float) }, { &double_ctype, T_FLOAT( 0, double) }, @@ -272,7 +272,7 @@ extern struct symbol bool_ctype, void_ctype, type_ctype, int_ctype, sint_ctype, uint_ctype, long_ctype, slong_ctype, ulong_ctype, llong_ctype, sllong_ctype, ullong_ctype, - lllong_ctype, slllong_ctype, ulllong_ctype, + int128_ctype, sint128_ctype, uint128_ctype, float_ctype, double_ctype, ldouble_ctype, string_ctype, ptr_ctype, lazy_ptr_ctype, incomplete_ctype, label_ctype, bad_ctype, |