Change value::m_lazy to bool

This changes value::m_lazy to be a bool and updates the various uses.

Reviewed-By: Bruno Larsen <blarsen@redhat.com>
This commit is contained in:
Tom Tromey 2023-02-14 09:37:47 -07:00
parent b2227e67b4
commit a5b210cb69
5 changed files with 15 additions and 15 deletions

View file

@ -1366,7 +1366,7 @@ value_of_dwarf_reg_entry (struct type *type, frame_info_ptr frame,
memcpy (val->contents_raw ().data (),
outer_val->contents_raw ().data (),
checked_type->length ());
val->set_lazy (0);
val->set_lazy (false);
return val;
}

View file

@ -163,7 +163,7 @@ gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
if (!arg1->lazy ())
{
arg1->set_lazy (1);
arg1->set_lazy (true);
arg1->fetch_lazy ();
}

View file

@ -1343,7 +1343,7 @@ value_assign (struct value *toval, struct value *fromval)
information, but its contents are updated from FROMVAL. This
implies the returned value is not lazy, even if TOVAL was. */
val = toval->copy ();
val->set_lazy (0);
val->set_lazy (false);
copy (fromval->contents (), val->contents_raw ());
/* We copy over the enclosing type and pointed-to offset from FROMVAL

View file

@ -939,7 +939,7 @@ value::allocate (struct type *type, bool check_size)
struct value *val = value::allocate_lazy (type);
val->allocate_contents (check_size);
val->m_lazy = 0;
val->m_lazy = false;
return val;
}
@ -991,7 +991,7 @@ value::allocate_optimized_out (struct type *type)
struct value *retval = value::allocate_lazy (type);
retval->mark_bytes_optimized_out (0, type->length ());
retval->set_lazy (0);
retval->set_lazy (false);
return retval;
}
@ -3815,7 +3815,7 @@ value::fetch_lazy_register ()
/* Copy the contents and the unavailability/optimized-out
meta-data from NEW_VAL to VAL. */
set_lazy (0);
set_lazy (false);
new_val->contents_copy (this, embedded_offset (),
new_val->embedded_offset (),
type_length_units (type));
@ -3899,7 +3899,7 @@ value::fetch_lazy ()
else
internal_error (_("Unexpected lazy value type."));
set_lazy (0);
set_lazy (false);
}
/* Implementation of the convenience function $_isvoid. */

View file

@ -133,7 +133,7 @@ private:
/* Values can only be created via "static constructors". */
explicit value (struct type *type_)
: m_modifiable (true),
m_lazy (1),
m_lazy (true),
m_initialized (1),
m_stack (0),
m_is_zero (false),
@ -247,8 +247,8 @@ public:
void set_embedded_offset (LONGEST val)
{ m_embedded_offset = val; }
/* If zero, contents of this value are in the contents field. If
nonzero, contents are in inferior. If the lval field is lval_memory,
/* If false, contents of this value are in the contents field. If
true, contents are in inferior. If the lval field is lval_memory,
the contents are in inferior memory at location.address plus offset.
The lval field may also be lval_register.
@ -262,10 +262,10 @@ public:
element. If you ever change the way lazy flag is set and reset, be
sure to consider this use as well! */
int lazy () const
bool lazy () const
{ return m_lazy; }
void set_lazy (int val)
void set_lazy (bool val)
{ m_lazy = val; }
/* If a value represents a C++ object, then the `type' field gives the
@ -621,8 +621,8 @@ private:
/* Is it modifiable? Only relevant if lval != not_lval. */
bool m_modifiable : 1;
/* If zero, contents of this value are in the contents field. If
nonzero, contents are in inferior. If the lval field is lval_memory,
/* If false, contents of this value are in the contents field. If
true, contents are in inferior. If the lval field is lval_memory,
the contents are in inferior memory at location.address plus offset.
The lval field may also be lval_register.
@ -635,7 +635,7 @@ private:
or array when the user wants to watch a single struct member or
array element. If you ever change the way lazy flag is set and
reset, be sure to consider this use as well! */
unsigned int m_lazy : 1;
bool m_lazy : 1;
/* If value is a variable, is it initialized or not. */
unsigned int m_initialized : 1;