struct objfile *objfile = cu->per_objfile->objfile;
struct type *type;
struct type *element_type, *range_type, *index_type;
- struct attribute *attr;
const char *name;
struct dynamic_prop *byte_stride_prop = NULL;
unsigned int bit_stride = 0;
if (type)
return type;
- attr = dwarf2_attr (die, DW_AT_byte_stride, cu);
- if (attr != NULL)
+ if (attribute *attr = dwarf2_attr (die, DW_AT_byte_stride, cu);
+ attr != nullptr)
{
int stride_ok;
struct type *prop_type = cu->addr_sized_int_type (false);
}
}
- attr = dwarf2_attr (die, DW_AT_bit_stride, cu);
- if (attr != NULL)
+ if (attribute *attr = dwarf2_attr (die, DW_AT_bit_stride, cu);
+ attr != nullptr)
bit_stride = attr->unsigned_constant ().value_or (0);
/* Irix 6.2 native cc creates array types without children for
custom vendor extension. The main difference between a regular
array and the vector variant is that vectors are passed by value
to functions. */
- attr = dwarf2_attr (die, DW_AT_GNU_vector, cu);
- if (attr != nullptr)
+ if (attribute *attr = dwarf2_attr (die, DW_AT_GNU_vector, cu);
+ attr != nullptr)
make_vector_type (type);
/* The DIE may have DW_AT_byte_size set. For example an OpenCL
implementation may choose to implement triple vectors using this
attribute. */
- attr = dwarf2_attr (die, DW_AT_byte_size, cu);
- if (attr != nullptr && attr->form_is_unsigned ())
+ if (attribute *attr = dwarf2_attr (die, DW_AT_byte_size, cu);
+ attr != nullptr && attr->form_is_unsigned ())
{
if (attr->as_unsigned () >= type->length ())
type->set_length (attr->as_unsigned ());