diff options
-rw-r--r-- | gdb/ada-exp.y | 52 | ||||
-rw-r--r-- | gdb/ada-lex.l | 8 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/parse_number.exp | 2 |
3 files changed, 15 insertions, 47 deletions
diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y index a9c37be..4095106 100644 --- a/gdb/ada-exp.y +++ b/gdb/ada-exp.y @@ -93,18 +93,8 @@ static const struct block *block_lookup (const struct block *, const char *); static void write_ambiguous_var (struct parser_state *, const struct block *, const char *, int); -static struct type *type_int (struct parser_state *); - -static struct type *type_long (struct parser_state *); - -static struct type *type_long_long (struct parser_state *); - -static struct type *type_long_double (struct parser_state *); - static struct type *type_for_char (struct parser_state *, ULONGEST); -static struct type *type_boolean (struct parser_state *); - static struct type *type_system_address (struct parser_state *); static std::string find_completion_bounds (struct parser_state *); @@ -934,9 +924,15 @@ primary : STRING ; primary : TRUEKEYWORD - { write_int (pstate, 1, type_boolean (pstate)); } + { + write_int (pstate, 1, + parse_type (pstate)->builtin_bool); + } | FALSEKEYWORD - { write_int (pstate, 0, type_boolean (pstate)); } + { + write_int (pstate, 0, + parse_type (pstate)->builtin_bool); + } ; primary : NEW NAME @@ -1268,7 +1264,7 @@ write_object_renaming (struct parser_state *par_state, if (next == renaming_expr) goto BadEncoding; renaming_expr = next; - write_int (par_state, val, type_int (par_state)); + write_int (par_state, val, parse_type (par_state)->builtin_int); } else { @@ -1842,30 +1838,6 @@ write_name_assoc (struct parser_state *par_state, struct stoken name) } static struct type * -type_int (struct parser_state *par_state) -{ - return parse_type (par_state)->builtin_int; -} - -static struct type * -type_long (struct parser_state *par_state) -{ - return parse_type (par_state)->builtin_long; -} - -static struct type * -type_long_long (struct parser_state *par_state) -{ - return parse_type (par_state)->builtin_long_long; -} - -static struct type * -type_long_double (struct parser_state *par_state) -{ - return parse_type (par_state)->builtin_long_double; -} - -static struct type * type_for_char (struct parser_state *par_state, ULONGEST value) { if (value <= 0xff) @@ -1881,12 +1853,6 @@ type_for_char (struct parser_state *par_state, ULONGEST value) } static struct type * -type_boolean (struct parser_state *par_state) -{ - return parse_type (par_state)->builtin_bool; -} - -static struct type * type_system_address (struct parser_state *par_state) { struct type *type diff --git a/gdb/ada-lex.l b/gdb/ada-lex.l index 69fc14f..0634f33 100644 --- a/gdb/ada-lex.l +++ b/gdb/ada-lex.l @@ -471,9 +471,9 @@ processInt (struct parser_state *par_state, const char *base0, ULONGEST value = result.as_integer<ULONGEST> (); if (fits_in_type (1, value, int_bits, true)) - yylval.typed_val.type = type_int (par_state); + yylval.typed_val.type = parse_type (par_state)->builtin_int; else if (fits_in_type (1, value, long_bits, true)) - yylval.typed_val.type = type_long (par_state); + yylval.typed_val.type = parse_type (par_state)->builtin_long; else if (fits_in_type (1, value, long_bits, false)) { /* We have a number representable as an unsigned integer quantity. @@ -494,7 +494,7 @@ processInt (struct parser_state *par_state, const char *base0, return INT; } else if (fits_in_type (1, value, long_long_bits, true)) - yylval.typed_val.type = type_long_long (par_state); + yylval.typed_val.type = parse_type (par_state)->builtin_long_long; else if (fits_in_type (1, value, long_long_bits, false)) { yylval.typed_val.type @@ -518,7 +518,7 @@ processInt (struct parser_state *par_state, const char *base0, static int processReal (struct parser_state *par_state, const char *num0) { - yylval.typed_val_float.type = type_long_double (par_state); + yylval.typed_val_float.type = parse_type (par_state)->builtin_long_double; bool parsed = parse_float (num0, strlen (num0), yylval.typed_val_float.type, diff --git a/gdb/testsuite/gdb.base/parse_number.exp b/gdb/testsuite/gdb.base/parse_number.exp index 5dd4fa7..8800dea 100644 --- a/gdb/testsuite/gdb.base/parse_number.exp +++ b/gdb/testsuite/gdb.base/parse_number.exp @@ -145,6 +145,8 @@ proc parse_number { lang n } { } elseif { [fits_in_type $n $long_long_bits u] } { # Note: Interprets ULLONG_MAX as -1. return [list "<$sizeof_long_long-byte integer>" $n] + } elseif { [fits_in_type $n 128 u] } { + return [list "<16-byte integer>" $n] } else { # Overflow. return [list $re_overflow $re_overflow] |