mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-29 02:20:51 +00:00
Simplify tag management in value structs
Instead of actively setting the tagged field of struct value *, initialize the tagged field right when allocating a new value. This simplifies the management of this field.
This commit is contained in:
@@ -1453,10 +1453,7 @@ aarch64_prologue_prev_register (struct frame_info *this_frame,
|
||||
|
||||
/* Copy the capability tag over, if it exists. */
|
||||
if (prev_regnum == tdep->cap_reg_pcc && value_tagged (lr_value))
|
||||
{
|
||||
set_value_tagged (lr_value_adjusted, 1);
|
||||
set_value_tag (lr_value_adjusted, value_tag (lr_value));
|
||||
}
|
||||
set_value_tag (lr_value_adjusted, value_tag (lr_value));
|
||||
|
||||
return lr_value_adjusted;
|
||||
}
|
||||
@@ -1651,10 +1648,7 @@ aarch64_dwarf2_prev_register (struct frame_info *this_frame,
|
||||
|
||||
/* Copy the capability tag over, if it exists. */
|
||||
if (regnum == tdep->cap_reg_pcc && value_tagged (lr_value))
|
||||
{
|
||||
set_value_tagged (lr_value_adjusted, 1);
|
||||
set_value_tag (lr_value_adjusted, value_tag (lr_value));
|
||||
}
|
||||
set_value_tag (lr_value_adjusted, value_tag (lr_value));
|
||||
|
||||
return lr_value_adjusted;
|
||||
}
|
||||
@@ -3476,7 +3470,6 @@ morello_extract_return_value (struct value *value, struct regcache *regs,
|
||||
if (aapcs64_cap)
|
||||
{
|
||||
regno = tdep->cap_reg_base + AARCH64_X0_REGNUM;
|
||||
set_value_tagged (value, true);
|
||||
set_value_tag (value, true);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -178,10 +178,13 @@ struct value
|
||||
lazy (1),
|
||||
initialized (1),
|
||||
stack (0),
|
||||
tagged (0),
|
||||
type (type_),
|
||||
enclosing_type (type_)
|
||||
{
|
||||
if (type_ != nullptr
|
||||
&& (type_->code () == TYPE_CODE_CAPABILITY
|
||||
|| TYPE_CAPABILITY (type_)))
|
||||
tagged = 1;
|
||||
}
|
||||
|
||||
~value ()
|
||||
@@ -341,7 +344,7 @@ struct value
|
||||
LONGEST pointed_to_offset = 0;
|
||||
|
||||
/* The tag value, if tagged. */
|
||||
bool tag;
|
||||
bool tag = false;
|
||||
|
||||
/* Actual contents of the value. Target byte-order. NULL or not
|
||||
valid if lazy is nonzero. */
|
||||
@@ -3857,7 +3860,6 @@ value_fetch_lazy_memory (struct value *val)
|
||||
|
||||
if (TYPE_CAPABILITY (type))
|
||||
{
|
||||
set_value_tagged (val, true);
|
||||
bool tag = gdbarch_get_cap_tag_from_address (get_value_arch (val), addr);
|
||||
set_value_tag (val, tag);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user