memcpy (value_contents_raw (val).data (),
value_contents (fromval).data (),
type->length ());
- deprecated_set_value_type (val, type);
+ val->deprecated_set_type (type);
return val;
}
than as an access. Another symptom of the same issue
would be that an expression trying to dereference the
element would also be improperly rejected. */
- deprecated_set_value_type (elt, saved_elt_type);
+ elt->deprecated_set_type (saved_elt_type);
}
elt_type = ada_check_typedef (elt->type ());
if (type2->target_type ()->length () != type->target_type ()->length ())
error (_("Incompatible types in assignment"));
- deprecated_set_value_type (val, type);
+ val->deprecated_set_type (type);
}
return val;
}
if (type != saved_type)
{
val = value_copy (val);
- deprecated_set_value_type (val, type);
+ val->deprecated_set_type (type);
}
if (is_fixed_point_type (type))
/* Function objc_msg_lookup returns a pointer. */
struct type *tem_type = called_method->type ();
tem_type = lookup_pointer_type (lookup_function_type (tem_type));
- deprecated_set_value_type (called_method, tem_type);
+ called_method->deprecated_set_type (tem_type);
called_method = call_function_by_hand (called_method, NULL, args);
}
else
error (_("I'm confused: virtual function table has bad type"));
/* Reinstantiate the function pointer with the correct type. */
- deprecated_set_value_type (vfn,
- lookup_pointer_type (TYPE_FN_FIELD_TYPE (f, j)));
+ vfn->deprecated_set_type (lookup_pointer_type (TYPE_FN_FIELD_TYPE (f, j)));
*arg1p = arg1;
return vfn;
= i386_return_value (gdbarch, function, inner_type, regcache,
read_value, writebuf);
if (read_value != nullptr)
- deprecated_set_value_type (*read_value, type);
+ (*read_value)->deprecated_set_type (type);
return result;
}
else
type = lookup_pointer_type(sym->type ());
- deprecated_set_value_type (nsstringValue, type);
+ nsstringValue->deprecated_set_type (type);
return nsstringValue;
}
{
struct value *v = value_addr (v2);
- deprecated_set_value_type (v, type);
+ v->deprecated_set_type (type);
return v;
}
}
/* No superclass found, just change the pointer type. */
arg2 = value_copy (arg2);
- deprecated_set_value_type (arg2, type);
+ arg2->deprecated_set_type (type);
set_value_enclosing_type (arg2, type);
set_value_pointed_to_offset (arg2, 0); /* pai: chk_val */
return arg2;
if (arg2->type () != type)
{
arg2 = value_copy (arg2);
- deprecated_set_value_type (arg2, type);
+ arg2->deprecated_set_type (type);
}
return arg2;
}
range_type->target_type (),
low_bound,
new_length + low_bound - 1);
- deprecated_set_value_type (arg2,
- create_array_type (NULL,
+ arg2->deprecated_set_type (create_array_type (NULL,
element_type,
range_type));
return arg2;
return value_cast_pointers (to_type, arg2, 0);
arg2 = value_copy (arg2);
- deprecated_set_value_type (arg2, to_type);
+ arg2->deprecated_set_type (to_type);
set_value_enclosing_type (arg2, to_type);
set_value_pointed_to_offset (arg2, 0); /* pai: chk_val */
return arg2;
= lookup_pointer_type (enclosing_type->target_type ());
arg2 = value_copy (arg1);
- deprecated_set_value_type (arg2, type_ptr);
+ arg2->deprecated_set_type (type_ptr);
set_value_enclosing_type (arg2, enclosing_type_ptr);
return arg2;
return arg1;
arg2 = value_addr (arg1);
- deprecated_set_value_type (arg2, lookup_reference_type (type, refcode));
+ arg2->deprecated_set_type (lookup_reference_type (type, refcode));
return arg2;
}
else
{
v2 = value_copy (arg1);
- deprecated_set_value_type (v2, basetype);
+ v2->deprecated_set_type (basetype);
set_value_embedded_offset (v2, boffset);
}
value_rtti_type used for its computation. */
new_val = value_at_lazy (real_type, value_address (argp) - top +
(using_enc ? 0 : value_embedded_offset (argp)));
- deprecated_set_value_type (new_val, argp->type ());
+ new_val->deprecated_set_type (argp->type ());
set_value_embedded_offset (new_val, (using_enc
? top + value_embedded_offset (argp)
: top));
/* Accessor methods. */
-void
-deprecated_set_value_type (struct value *value, struct type *type)
-{
- value->m_type = type;
-}
-
LONGEST
value_offset (const struct value *value)
{
struct type *m_enclosing_type = value_enclosing_type (v);
struct value *cv_val = value_copy (v);
- deprecated_set_value_type (cv_val,
- make_cv_type (cnst, voltl, val_type, NULL));
+ cv_val->deprecated_set_type (make_cv_type (cnst, voltl, val_type, NULL));
set_value_enclosing_type (cv_val,
make_cv_type (cnst, voltl, m_enclosing_type, NULL));
original_value_address);
/* Re-adjust type. */
- deprecated_set_value_type (value, resolved_original_target_type);
+ value->deprecated_set_type (resolved_original_target_type);
/* Add embedding info. */
set_value_enclosing_type (value, enc_type);
struct type *type () const
{ return m_type; }
+ /* This is being used to change the type of an existing value, that
+ code should instead be creating a new value with the changed type
+ (but possibly shared content). */
+ void deprecated_set_type (struct type *type)
+ { m_type = type; }
+
/* Type of value; either not an lval, or one of the various
different possible kinds of lval. */
extern struct gdbarch *get_value_arch (const struct value *value);
-/* This is being used to change the type of an existing value, that
- code should instead be creating a new value with the changed type
- (but possibly shared content). */
-
-extern void deprecated_set_value_type (struct value *value,
- struct type *type);
-
/* Only used for bitfields; number of bits contained in them. */
extern LONGEST value_bitsize (const struct value *);