if (domain->is_const ())
gdb_printf (stream, " const");
- if (TYPE_VOLATILE (domain))
+ if (domain->is_volatile ())
gdb_printf (stream, " volatile");
if (TYPE_RESTRICT (domain))
did_print_modifier = 1;
}
- if (TYPE_VOLATILE (type))
+ if (type->is_volatile ())
{
if (did_print_modifier || need_pre_space)
gdb_printf (stream, " ");
if (type->is_const ())
quals |= GCC_QUALIFIER_CONST;
- if (TYPE_VOLATILE (type))
+ if (type->is_volatile ())
quals |= GCC_QUALIFIER_VOLATILE;
if (TYPE_RESTRICT (type))
quals |= GCC_QUALIFIER_RESTRICT;
{
/* If we are converting a qualified type, first convert the
unqualified type and then apply the qualifiers. */
- if (type->is_const () || TYPE_VOLATILE (type) || TYPE_RESTRICT (type))
+ if (type->is_const () || type->is_volatile () || TYPE_RESTRICT (type))
return convert_qualified (context, type);
switch (type->code ())
if (method_type->is_const ())
quals |= GCC_CP_QUALIFIER_CONST;
- if (TYPE_VOLATILE (method_type))
+ if (method_type->is_volatile ())
quals |= GCC_CP_QUALIFIER_VOLATILE;
if (TYPE_RESTRICT (method_type))
quals |= GCC_CP_QUALIFIER_RESTRICT;
if (type->is_const ())
quals |= GCC_CP_QUALIFIER_CONST;
- if (TYPE_VOLATILE (type))
+ if (type->is_volatile ())
quals |= GCC_CP_QUALIFIER_VOLATILE;
if (TYPE_RESTRICT (type))
quals |= GCC_CP_QUALIFIER_RESTRICT;
{
/* If we are converting a qualified type, first convert the
unqualified type and then apply the qualifiers. */
- if (type->is_const () || TYPE_VOLATILE (type) || TYPE_RESTRICT (type))
+ if (type->is_const () || type->is_volatile () || TYPE_RESTRICT (type))
return compile_cplus_convert_qualified (instance, type);
switch (type->code ())
el_type = inner_array->target_type ();
cnst |= el_type->is_const ();
- voltl |= TYPE_VOLATILE (el_type);
+ voltl |= el_type->is_volatile ();
inner_array->set_target_type (make_cv_type (cnst, voltl, el_type));
return set_tid_type (ccp, tid, base_type);
base_type = builtin_type (objfile)->builtin_error;
}
}
- cv_type = make_cv_type (1, TYPE_VOLATILE (base_type), base_type);
+ cv_type = make_cv_type (1, base_type->is_volatile (), base_type);
return set_tid_type (ccp, tid, cv_type);
}
el_type = inner_array->target_type ();
cnst |= el_type->is_const ();
- voltl |= TYPE_VOLATILE (el_type);
+ voltl |= el_type->is_volatile ();
inner_array->set_target_type (make_cv_type (cnst, voltl, el_type));
return set_die_type (die, base_type, cu);
if (base_type->code () == TYPE_CODE_ARRAY)
return add_array_cv_type (die, cu, base_type, 1, 0);
- cv_type = make_cv_type (1, TYPE_VOLATILE (base_type), base_type);
+ cv_type = make_cv_type (1, base_type->is_volatile (), base_type);
return set_die_type (die, cv_type, cu);
}
is_this = 1;
if (is_this)
- arg_type = make_cv_type (1, TYPE_VOLATILE (arg_type),
+ arg_type = make_cv_type (1, arg_type->is_volatile (),
arg_type);
}
/* Make sure they are CV equal. */
if (t1->is_const () != t2->is_const ())
rank.subrank |= CV_CONVERSION_CONST;
- if (TYPE_VOLATILE (t1) != TYPE_VOLATILE (t2))
+ if (t1->is_volatile () != t2->is_volatile ())
rank.subrank |= CV_CONVERSION_VOLATILE;
if (rank.subrank != 0)
return sum_ranks (CV_CONVERSION_BADNESS, rank);
/* Make sure they are CV equal, too. */
if (t1->is_const () != t2->is_const ())
rank.subrank |= CV_CONVERSION_CONST;
- if (TYPE_VOLATILE (t1) != TYPE_VOLATILE (t2))
+ if (t1->is_volatile () != t2->is_volatile ())
rank.subrank |= CV_CONVERSION_VOLATILE;
if (rank.subrank != 0)
return sum_ranks (CV_CONVERSION_BADNESS, rank);
gdb_printf ("%*sinstance_flags [", spaces, "");
if (type->is_const ())
gdb_puts (" TYPE_CONST");
- if (TYPE_VOLATILE (type))
- {
- gdb_puts (" TYPE_VOLATILE");
- }
+ if (type->is_volatile ())
+ gdb_puts (" TYPE_VOLATILE");
if (TYPE_CODE_SPACE (type))
{
gdb_puts (" TYPE_CODE_SPACE");
bool is_atomic : 1;
};
-#define TYPE_VOLATILE(t) (((t)->instance_flags ()).is_volatile)
#define TYPE_RESTRICT(t) (((t)->instance_flags ()).is_restrict)
#define TYPE_ATOMIC(t) (((t)->instance_flags ()).is_atomic)
return this->m_instance_flags.is_const;
}
+ /* Return if this type is volatile. */
+ bool is_volatile () const
+ {
+ return this->m_instance_flags.is_volatile;
+ }
+
/* Get the bounds bounds of this type. The type must be a range type. */
range_bounds *bounds () const
{
if (dst_type == NULL)
dst_type = init_vector_type (elm_type, n);
- make_cv_type (type->is_const (), TYPE_VOLATILE (type), dst_type);
+ make_cv_type (type->is_const (), type->is_volatile (), dst_type);
if (noside == EVAL_AVOID_SIDE_EFFECTS)
ret = value::allocate (dst_type);
try
{
- type = make_cv_type (1, TYPE_VOLATILE (type), type);
+ type = make_cv_type (1, type->is_volatile (), type);
}
catch (const gdb_exception &except)
{
rtype = lookup_pointer_type (type);
break;
case DEMANGLE_COMPONENT_CONST:
- rtype = make_cv_type (1, TYPE_VOLATILE (type), type);
+ rtype = make_cv_type (1, type->is_volatile (), type);
break;
case DEMANGLE_COMPONENT_VOLATILE:
rtype = make_cv_type (type->is_const (), 1, type);
process_qualifiers:
if (make_const)
follow_type = make_cv_type (make_const,
- TYPE_VOLATILE (follow_type),
+ follow_type->is_volatile (),
follow_type);
if (make_volatile)
follow_type = make_cv_type (follow_type->is_const (),
{
if (intype->is_const () != TYPE_FN_FIELD_CONST (f, j))
continue;
- if (TYPE_VOLATILE (intype) != TYPE_FN_FIELD_VOLATILE (f, j))
+ if (intype->is_volatile () != TYPE_FN_FIELD_VOLATILE (f, j))
continue;
if (compare_parameters (TYPE_FN_FIELD_TYPE (f, j), intype, 0)
/* Copy qualifiers to the referenced object. */
target_type = target->type ();
real_type = make_cv_type (target_type->is_const (),
- TYPE_VOLATILE (target_type), real_type);
+ target_type->is_volatile (), real_type);
if (TYPE_IS_REFERENCE (type))
real_type = lookup_reference_type (real_type, type->code ());
else if (type->code () == TYPE_CODE_PTR)
internal_error (_("Unexpected value type."));
/* Copy qualifiers to the pointer/reference. */
- real_type = make_cv_type (type->is_const (), TYPE_VOLATILE (type),
+ real_type = make_cv_type (type->is_const (), type->is_volatile (),
real_type);
}