aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2004-08-07 19:45:45 +0000
committerAndrew Cagney <cagney@redhat.com>2004-08-07 19:45:45 +0000
commit64d2b26d0a3ea800c312008c7286b2ea9dfae39f (patch)
tree58ee8b0b8dbfa345bf4671959f3ec522d633ad11 /gdb
parent7ad6570da5242fbe15716986032ca353d6f59f96 (diff)
downloadgdb-64d2b26d0a3ea800c312008c7286b2ea9dfae39f.zip
gdb-64d2b26d0a3ea800c312008c7286b2ea9dfae39f.tar.gz
gdb-64d2b26d0a3ea800c312008c7286b2ea9dfae39f.tar.bz2
2004-08-07 Andrew Cagney <cagney@gnu.org>
* c-exp.y: Use builtin_type function to obtain builtin types.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog2
-rw-r--r--gdb/c-exp.y106
2 files changed, 55 insertions, 53 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f392478..fa49a4d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,7 @@
2004-08-07 Andrew Cagney <cagney@gnu.org>
+ * c-exp.y: Use builtin_type function to obtain builtin types.
+
* gdbtypes.h (struct builtin_type): Delete builtin_int0 through to
builtin_uint128.
* gdbtypes.c (gdbtypes_post_init): Update.
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index f0c743f..27d1848 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -501,7 +501,7 @@ exp : VARIABLE
exp : SIZEOF '(' type ')' %prec UNARY
{ write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_int);
+ write_exp_elt_type (builtin_type (current_gdbarch)->builtin_int);
CHECK_TYPEDEF ($3);
write_exp_elt_longcst ((LONGEST) TYPE_LENGTH ($3));
write_exp_elt_opcode (OP_LONG); }
@@ -517,12 +517,12 @@ exp : STRING
while (count-- > 0)
{
write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_char);
+ write_exp_elt_type (builtin_type (current_gdbarch)->builtin_char);
write_exp_elt_longcst ((LONGEST)(*sp++));
write_exp_elt_opcode (OP_LONG);
}
write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_char);
+ write_exp_elt_type (builtin_type (current_gdbarch)->builtin_char);
write_exp_elt_longcst ((LONGEST)'\0');
write_exp_elt_opcode (OP_LONG);
write_exp_elt_opcode (OP_ARRAY);
@@ -534,14 +534,14 @@ exp : STRING
/* C++. */
exp : TRUEKEYWORD
{ write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_bool);
+ write_exp_elt_type (builtin_type (current_gdbarch)->builtin_bool);
write_exp_elt_longcst ((LONGEST) 1);
write_exp_elt_opcode (OP_LONG); }
;
exp : FALSEKEYWORD
{ write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_bool);
+ write_exp_elt_type (builtin_type (current_gdbarch)->builtin_bool);
write_exp_elt_longcst ((LONGEST) 0);
write_exp_elt_opcode (OP_LONG); }
;
@@ -652,8 +652,8 @@ variable: qualified_name
if (msymbol != NULL)
{
write_exp_msymbol (msymbol,
- lookup_function_type (builtin_type_int),
- builtin_type_int);
+ lookup_function_type (builtin_type (current_gdbarch)->builtin_int),
+ builtin_type (current_gdbarch)->builtin_int);
}
else
if (!have_full_symbols () && !have_partial_symbols ())
@@ -708,8 +708,8 @@ variable: name_not_typename
if (msymbol != NULL)
{
write_exp_msymbol (msymbol,
- lookup_function_type (builtin_type_int),
- builtin_type_int);
+ lookup_function_type (builtin_type (current_gdbarch)->builtin_int),
+ builtin_type (current_gdbarch)->builtin_int);
}
else if (!have_full_symbols () && !have_partial_symbols ())
error ("No symbol table is loaded. Use the \"file\" command.");
@@ -795,68 +795,68 @@ func_mod: '(' ')'
type : ptype
| typebase COLONCOLON '*'
- { $$ = lookup_member_type (builtin_type_int, $1); }
+ { $$ = lookup_member_type (builtin_type (current_gdbarch)->builtin_int, $1); }
;
typebase /* Implements (approximately): (type-qualifier)* type-specifier */
: TYPENAME
{ $$ = $1.type; }
| INT_KEYWORD
- { $$ = builtin_type_int; }
+ { $$ = builtin_type (current_gdbarch)->builtin_int; }
| LONG
- { $$ = builtin_type_long; }
+ { $$ = builtin_type (current_gdbarch)->builtin_long; }
| SHORT
- { $$ = builtin_type_short; }
+ { $$ = builtin_type (current_gdbarch)->builtin_short; }
| LONG INT_KEYWORD
- { $$ = builtin_type_long; }
+ { $$ = builtin_type (current_gdbarch)->builtin_long; }
| LONG SIGNED_KEYWORD INT_KEYWORD
- { $$ = builtin_type_long; }
+ { $$ = builtin_type (current_gdbarch)->builtin_long; }
| LONG SIGNED_KEYWORD
- { $$ = builtin_type_long; }
+ { $$ = builtin_type (current_gdbarch)->builtin_long; }
| SIGNED_KEYWORD LONG INT_KEYWORD
- { $$ = builtin_type_long; }
+ { $$ = builtin_type (current_gdbarch)->builtin_long; }
| UNSIGNED LONG INT_KEYWORD
- { $$ = builtin_type_unsigned_long; }
+ { $$ = builtin_type (current_gdbarch)->builtin_unsigned_long; }
| LONG UNSIGNED INT_KEYWORD
- { $$ = builtin_type_unsigned_long; }
+ { $$ = builtin_type (current_gdbarch)->builtin_unsigned_long; }
| LONG UNSIGNED
- { $$ = builtin_type_unsigned_long; }
+ { $$ = builtin_type (current_gdbarch)->builtin_unsigned_long; }
| LONG LONG
- { $$ = builtin_type_long_long; }
+ { $$ = builtin_type (current_gdbarch)->builtin_long_long; }
| LONG LONG INT_KEYWORD
- { $$ = builtin_type_long_long; }
+ { $$ = builtin_type (current_gdbarch)->builtin_long_long; }
| LONG LONG SIGNED_KEYWORD INT_KEYWORD
- { $$ = builtin_type_long_long; }
+ { $$ = builtin_type (current_gdbarch)->builtin_long_long; }
| LONG LONG SIGNED_KEYWORD
- { $$ = builtin_type_long_long; }
+ { $$ = builtin_type (current_gdbarch)->builtin_long_long; }
| SIGNED_KEYWORD LONG LONG
- { $$ = builtin_type_long_long; }
+ { $$ = builtin_type (current_gdbarch)->builtin_long_long; }
| SIGNED_KEYWORD LONG LONG INT_KEYWORD
- { $$ = builtin_type_long_long; }
+ { $$ = builtin_type (current_gdbarch)->builtin_long_long; }
| UNSIGNED LONG LONG
- { $$ = builtin_type_unsigned_long_long; }
+ { $$ = builtin_type (current_gdbarch)->builtin_unsigned_long_long; }
| UNSIGNED LONG LONG INT_KEYWORD
- { $$ = builtin_type_unsigned_long_long; }
+ { $$ = builtin_type (current_gdbarch)->builtin_unsigned_long_long; }
| LONG LONG UNSIGNED
- { $$ = builtin_type_unsigned_long_long; }
+ { $$ = builtin_type (current_gdbarch)->builtin_unsigned_long_long; }
| LONG LONG UNSIGNED INT_KEYWORD
- { $$ = builtin_type_unsigned_long_long; }
+ { $$ = builtin_type (current_gdbarch)->builtin_unsigned_long_long; }
| SHORT INT_KEYWORD
- { $$ = builtin_type_short; }
+ { $$ = builtin_type (current_gdbarch)->builtin_short; }
| SHORT SIGNED_KEYWORD INT_KEYWORD
- { $$ = builtin_type_short; }
+ { $$ = builtin_type (current_gdbarch)->builtin_short; }
| SHORT SIGNED_KEYWORD
- { $$ = builtin_type_short; }
+ { $$ = builtin_type (current_gdbarch)->builtin_short; }
| UNSIGNED SHORT INT_KEYWORD
- { $$ = builtin_type_unsigned_short; }
+ { $$ = builtin_type (current_gdbarch)->builtin_unsigned_short; }
| SHORT UNSIGNED
- { $$ = builtin_type_unsigned_short; }
+ { $$ = builtin_type (current_gdbarch)->builtin_unsigned_short; }
| SHORT UNSIGNED INT_KEYWORD
- { $$ = builtin_type_unsigned_short; }
+ { $$ = builtin_type (current_gdbarch)->builtin_unsigned_short; }
| DOUBLE_KEYWORD
- { $$ = builtin_type_double; }
+ { $$ = builtin_type (current_gdbarch)->builtin_double; }
| LONG DOUBLE_KEYWORD
- { $$ = builtin_type_long_double; }
+ { $$ = builtin_type (current_gdbarch)->builtin_long_double; }
| STRUCT name
{ $$ = lookup_struct (copy_name ($2),
expression_context_block); }
@@ -872,11 +872,11 @@ typebase /* Implements (approximately): (type-qualifier)* type-specifier */
| UNSIGNED typename
{ $$ = lookup_unsigned_typename (TYPE_NAME($2.type)); }
| UNSIGNED
- { $$ = builtin_type_unsigned_int; }
+ { $$ = builtin_type (current_gdbarch)->builtin_unsigned_int; }
| SIGNED_KEYWORD typename
{ $$ = lookup_signed_typename (TYPE_NAME($2.type)); }
| SIGNED_KEYWORD
- { $$ = builtin_type_int; }
+ { $$ = builtin_type (current_gdbarch)->builtin_int; }
/* It appears that this rule for templates is never
reduced; template recognition happens by lookahead
in the token processing code in yylex. */
@@ -966,19 +966,19 @@ typename: TYPENAME
{
$$.stoken.ptr = "int";
$$.stoken.length = 3;
- $$.type = builtin_type_int;
+ $$.type = builtin_type (current_gdbarch)->builtin_int;
}
| LONG
{
$$.stoken.ptr = "long";
$$.stoken.length = 4;
- $$.type = builtin_type_long;
+ $$.type = builtin_type (current_gdbarch)->builtin_long;
}
| SHORT
{
$$.stoken.ptr = "short";
$$.stoken.length = 5;
- $$.type = builtin_type_short;
+ $$.type = builtin_type (current_gdbarch)->builtin_short;
}
;
@@ -1100,11 +1100,11 @@ parse_number (p, len, parsed_float, putithere)
c = tolower (p[len - 1]);
if (c == 'f')
- putithere->typed_val_float.type = builtin_type_float;
+ putithere->typed_val_float.type = builtin_type (current_gdbarch)->builtin_float;
else if (c == 'l')
- putithere->typed_val_float.type = builtin_type_long_double;
+ putithere->typed_val_float.type = builtin_type (current_gdbarch)->builtin_long_double;
else if (isdigit (c) || c == '.')
- putithere->typed_val_float.type = builtin_type_double;
+ putithere->typed_val_float.type = builtin_type (current_gdbarch)->builtin_double;
else
return ERROR;
@@ -1220,15 +1220,15 @@ parse_number (p, len, parsed_float, putithere)
int. This probably should be fixed. GCC gives a warning on
such constants. */
- unsigned_type = builtin_type_unsigned_int;
- signed_type = builtin_type_int;
+ unsigned_type = builtin_type (current_gdbarch)->builtin_unsigned_int;
+ signed_type = builtin_type (current_gdbarch)->builtin_int;
}
else if (long_p <= 1
&& (un >> (TARGET_LONG_BIT - 2)) == 0)
{
high_bit = ((ULONGEST)1) << (TARGET_LONG_BIT-1);
- unsigned_type = builtin_type_unsigned_long;
- signed_type = builtin_type_long;
+ unsigned_type = builtin_type (current_gdbarch)->builtin_unsigned_long;
+ signed_type = builtin_type (current_gdbarch)->builtin_long;
}
else
{
@@ -1239,8 +1239,8 @@ parse_number (p, len, parsed_float, putithere)
else
shift = (TARGET_LONG_LONG_BIT - 1);
high_bit = (ULONGEST) 1 << shift;
- unsigned_type = builtin_type_unsigned_long_long;
- signed_type = builtin_type_long_long;
+ unsigned_type = builtin_type (current_gdbarch)->builtin_unsigned_long_long;
+ signed_type = builtin_type (current_gdbarch)->builtin_long_long;
}
putithere->typed_val_int.val = n;
@@ -1392,7 +1392,7 @@ yylex ()
}
yylval.typed_val_int.val = c;
- yylval.typed_val_int.type = builtin_type_char;
+ yylval.typed_val_int.type = builtin_type (current_gdbarch)->builtin_char;
c = *lexptr++;
if (c != '\'')