* ada-valprint.c (ada_print_scalar): Accept NULL type argument
to indicate scalar should be printed as default integer. (print_optional_low_bound): Pass NULL to ada_print_scalar to indicate default integer output. * ada-typeprint.c (print_range, print_range_bound): Likewise. (print_choices): Likewise. Thus, accept NULL as val_type. * ada-lang.c (ada_variant_discrim_type): Return NULL when failed to look up controlling discriminant name.
This commit is contained in:
parent
1ce677a4a1
commit
7c964f079e
4 changed files with 28 additions and 14 deletions
|
@ -5648,18 +5648,14 @@ ada_is_variant_part (struct type *type, int field_num)
|
|||
|
||||
/* Assuming that VAR_TYPE is a variant wrapper (type of the variant part)
|
||||
whose discriminants are contained in the record type OUTER_TYPE,
|
||||
returns the type of the controlling discriminant for the variant. */
|
||||
returns the type of the controlling discriminant for the variant.
|
||||
May return NULL if the type could not be found. */
|
||||
|
||||
struct type *
|
||||
ada_variant_discrim_type (struct type *var_type, struct type *outer_type)
|
||||
{
|
||||
char *name = ada_variant_discrim_name (var_type);
|
||||
struct type *type =
|
||||
ada_lookup_struct_elt_type (outer_type, name, 1, 1, NULL);
|
||||
if (type == NULL)
|
||||
return builtin_type_int32;
|
||||
else
|
||||
return type;
|
||||
return ada_lookup_struct_elt_type (outer_type, name, 1, 1, NULL);
|
||||
}
|
||||
|
||||
/* Assuming that TYPE is the type of a variant wrapper, and FIELD_NUM is a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue