+2020-09-14 Simon Marchi <simon.marchi@efficios.com>
+
+ * gdbtypes.h (struct type) <is_vector, set_is_vector>: New methods.
+ (TYPE_VECTOR): Use type::is_vector, change all write call sites to
+ use type::set_is_vector.
+
2020-09-14 Simon Marchi <simon.marchi@efficios.com>
* gdbtypes.h (TYPE_VARARGS): Remove, replace all
elem = builtin_type (gdbarch)->builtin_double;
append_composite_type_field (t, "f64", elem);
- TYPE_VECTOR (t) = 1;
+ t->set_is_vector (true);
t->set_name ("neon_d");
tdep->neon_double_type = t;
}
elem = builtin_type (gdbarch)->builtin_double;
append_composite_type_field (t, "f64", init_vector_type (elem, 2));
- TYPE_VECTOR (t) = 1;
+ t->set_is_vector (true);
t->set_name ("neon_q");
tdep->neon_quad_type = t;
}
append_composite_type_field (t, "u8",
init_vector_type (bt->builtin_int8, 16));
- TYPE_VECTOR (t) = 1;
+ t->set_is_vector (true);
t->set_name ("builtin_type_vec128i");
return t;
TYPE_TARGET_TYPE (inner_array) = elt_type;
}
- TYPE_VECTOR (array_type) = 1;
+ array_type->set_is_vector (true);
}
struct type *
/* * Identify a vector type. Gcc is handling this by adding an extra
attribute to the array type. We slurp that in as a new flag of a
type. This is used only in dwarf2read.c. */
-#define TYPE_VECTOR(t) (TYPE_MAIN_TYPE (t)->flag_vector)
+#define TYPE_VECTOR(t) ((t)->is_vector ())
/* * The debugging formats (especially STABS) do not contain enough
information to represent all Ada types---especially those whose
unsigned int m_flag_target_stub : 1;
unsigned int m_flag_prototyped : 1;
unsigned int m_flag_varargs : 1;
- unsigned int flag_vector : 1;
+ unsigned int m_flag_vector : 1;
unsigned int flag_stub_supported : 1;
unsigned int flag_gnu_ifunc : 1;
unsigned int flag_fixed_instance : 1;
this->main_type->m_flag_varargs = has_varargs;
}
+ bool is_vector () const
+ {
+ return this->main_type->m_flag_vector;
+ }
+
+ void set_is_vector (bool is_vector)
+ {
+ this->main_type->m_flag_vector = is_vector;
+ }
+
/* * Return the dynamic property of the requested KIND from this type's
list of dynamic properties. */
dynamic_prop *dyn_prop (dynamic_prop_node_kind kind) const;
append_composite_type_field (t, "v4_int128",
init_vector_type (bt->builtin_int128, 4));
- TYPE_VECTOR (t) = 1;
+ t->set_is_vector (true);
t->set_name ("builtin_type_vec512i");
tdep->i386_zmm_type = t;
}
append_composite_type_field (t, "v2_int128",
init_vector_type (bt->builtin_int128, 2));
- TYPE_VECTOR (t) = 1;
+ t->set_is_vector (true);
t->set_name ("builtin_type_vec256i");
tdep->i386_ymm_type = t;
}
append_composite_type_field (t, "v8_int8",
init_vector_type (bt->builtin_int8, 8));
- TYPE_VECTOR (t) = 1;
+ t->set_is_vector (true);
t->set_name ("builtin_type_vec64i");
tdep->i386_mmx_type = t;
}
"__gdb_builtin_type_fpreg_d", TYPE_CODE_UNION);
append_composite_type_field (t, "float", bt->builtin_float);
append_composite_type_field (t, "double", bt->builtin_double);
- TYPE_VECTOR (t) = 1;
+ t->set_is_vector (true);
t->set_name ("builtin_type_fpreg_d");
tdep->riscv_fpreg_d_type = t;
}
append_composite_type_field (t, "v8_int8",
init_vector_type (bt->builtin_int8, 8));
- TYPE_VECTOR (t) = 1;
+ t->set_is_vector (true);
t->set_name ("ppc_builtin_type_vec64");
tdep->ppc_builtin_type_vec64 = t;
}
append_composite_type_field (t, "v16_int8",
init_vector_type (bt->builtin_int8, 16));
- TYPE_VECTOR (t) = 1;
+ t->set_is_vector (true);
t->set_name ("ppc_builtin_type_vec128");
tdep->ppc_builtin_type_vec128 = t;
}
union as a vector also. This allows e.g. a union of two
vector types to show up automatically in "info vector". */
if (TYPE_VECTOR (field_gdb_type))
- TYPE_VECTOR (m_type) = 1;
+ m_type->set_is_vector (true);
}
}