Turn value_bitpos into method

This changes value_bitpos to be a method of value.  Much of this patch
was written by script.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
This commit is contained in:
Tom Tromey
2023-01-31 09:44:47 -07:00
parent f49d5fa263
commit 5011c493fb
6 changed files with 30 additions and 39 deletions

View File

@ -180,6 +180,15 @@ struct value
void set_bitsize (LONGEST bit)
{ m_bitsize = bit; }
/* Only used for bitfields; position of start of field. For
little-endian targets, it is the position of the LSB. For
big-endian targets, it is the position of the MSB. */
LONGEST bitpos () const
{ return m_bitpos; }
void set_bitpos (LONGEST bit)
{ m_bitpos = bit; }
/* Type of value; either not an lval, or one of the various
different possible kinds of lval. */
@ -358,13 +367,6 @@ struct value
ULONGEST m_limited_length = 0;
};
/* Only used for bitfields; position of start of field. For
little-endian targets, it is the position of the LSB. For
big-endian targets, it is the position of the MSB. */
extern LONGEST value_bitpos (const struct value *);
extern void set_value_bitpos (struct value *, LONGEST bit);
/* Only used for bitfields; the containing value. This allows a
single read from the target when displaying multiple
bitfields. */