This changes value_bits_synthetic_pointer to be a method of value.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
fputs_styled ("<optimized out or zero length>",
metadata_style.style (), stream);
}
- else if (value_bits_synthetic_pointer
- (val, type->field (i).loc_bitpos (),
- TYPE_FIELD_BITSIZE (type, i)))
+ else if (val->bits_synthetic_pointer
+ (type->field (i).loc_bitpos (),
+ TYPE_FIELD_BITSIZE (type, i)))
{
fputs_styled (_("<synthetic pointer>"),
metadata_style.style (), stream);
{
struct type *type = check_typedef (value->type ());
- if (value_bits_synthetic_pointer (value, value->embedded_offset (),
- TARGET_CHAR_BIT * type->length ()))
+ if (value->bits_synthetic_pointer (value->embedded_offset (),
+ TARGET_CHAR_BIT * type->length ()))
{
const piece_closure *closure
= (piece_closure *) value->computed_closure ();
int comp_offset = (i == start) ? startrest : 0;
int comp_length = (i == end) ? endrest : elsize;
- if (!value_bits_synthetic_pointer (c->val,
- c->indices[i] * elsize + comp_offset,
- comp_length))
+ if (!c->val->bits_synthetic_pointer (c->indices[i] * elsize + comp_offset,
+ comp_length))
return 0;
}
fputs_styled ("<optimized out or zero length>",
metadata_style.style (), stream);
}
- else if (value_bits_synthetic_pointer
- (val, type->field (i).loc_bitpos (),
- TYPE_FIELD_BITSIZE (type, i)))
+ else if (val->bits_synthetic_pointer
+ (type->field (i).loc_bitpos (),
+ TYPE_FIELD_BITSIZE (type, i)))
{
fputs_styled (_("<synthetic pointer>"),
metadata_style.style (), stream);
if (TYPE_IS_REFERENCE (type))
{
- if (value_bits_synthetic_pointer (arg1, arg1->embedded_offset (),
- TARGET_CHAR_BIT * type->length ()))
+ if (arg1->bits_synthetic_pointer (arg1->embedded_offset (),
+ TARGET_CHAR_BIT * type->length ()))
arg1 = coerce_ref (arg1);
else
{
return 0;
}
- if (value_bits_synthetic_pointer (val, TARGET_CHAR_BIT * embedded_offset,
- TARGET_CHAR_BIT * type->length ()))
+ if (val->bits_synthetic_pointer (TARGET_CHAR_BIT * embedded_offset,
+ TARGET_CHAR_BIT * type->length ()))
{
const int is_ref = type->code () == TYPE_CODE_REF;
int ref_is_addressable = 0;
struct type *elttype = check_typedef (type->target_type ());
struct value *deref_val = NULL;
const int value_is_synthetic
- = value_bits_synthetic_pointer (original_value,
- TARGET_CHAR_BIT * embedded_offset,
- TARGET_CHAR_BIT * type->length ());
+ = original_value->bits_synthetic_pointer (TARGET_CHAR_BIT * embedded_offset,
+ TARGET_CHAR_BIT * type->length ());
const int must_coerce_ref = ((options->addressprint && value_is_synthetic)
|| options->deref_ref);
const int type_is_defined = elttype->code () != TYPE_CODE_UNDEF;
}
int
-value_bits_synthetic_pointer (const struct value *value,
- LONGEST offset, LONGEST length)
+value::bits_synthetic_pointer (LONGEST offset, LONGEST length) const
{
- if (value->m_lval != lval_computed
- || !value->m_location.computed.funcs->check_synthetic_pointer)
+ if (m_lval != lval_computed
+ || !m_location.computed.funcs->check_synthetic_pointer)
return 0;
- return value->m_location.computed.funcs->check_synthetic_pointer (value,
- offset,
- length);
+ return m_location.computed.funcs->check_synthetic_pointer (this, offset,
+ length);
}
const struct lval_funcs *
values. */
bool contents_eq (const struct value *val2) const;
+ /* Given a value, determine whether the bits starting at OFFSET and
+ extending for LENGTH bits are a synthetic pointer. */
+
+ int bits_synthetic_pointer (LONGEST offset, LONGEST length) const;
+
/* Type of value; either not an lval, or one of the various
different possible kinds of lval. */
extern struct value *coerce_array (struct value *value);
-/* Given a value, determine whether the bits starting at OFFSET and
- extending for LENGTH bits are a synthetic pointer. */
-
-extern int value_bits_synthetic_pointer (const struct value *value,
- LONGEST offset, LONGEST length);
-
/* Given a value, determine whether the contents bytes starting at
OFFSET and extending for LENGTH bytes are available. This returns
nonzero if all bytes in the given range are available, zero if any