aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-01-31 13:29:49 -0700
committerTom Tromey <tom@tromey.com>2023-02-13 15:21:07 -0700
commitb64e260290108f8eb4f7a75f80a8355448aef7e4 (patch)
tree858622f385f161e426e6087407c80a0978bc3052 /gdb
parent317c3ed9fc9bc5dacd267d131e8c9ca7c1cbdced (diff)
downloadfsf-binutils-gdb-b64e260290108f8eb4f7a75f80a8355448aef7e4.zip
fsf-binutils-gdb-b64e260290108f8eb4f7a75f80a8355448aef7e4.tar.gz
fsf-binutils-gdb-b64e260290108f8eb4f7a75f80a8355448aef7e4.tar.bz2
Turn allocate_computed_value into static "constructor"
This turns allocate_computed_value into a static "constructor" of value. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb')
-rw-r--r--gdb/dwarf2/expr.c2
-rw-r--r--gdb/dwarf2/loc.c2
-rw-r--r--gdb/infrun.c2
-rw-r--r--gdb/opencl-lang.c2
-rw-r--r--gdb/value.c6
-rw-r--r--gdb/value.h13
-rw-r--r--gdb/windows-tdep.c2
7 files changed, 14 insertions, 15 deletions
diff --git a/gdb/dwarf2/expr.c b/gdb/dwarf2/expr.c
index fc92de8..ad6cf56 100644
--- a/gdb/dwarf2/expr.c
+++ b/gdb/dwarf2/expr.c
@@ -932,7 +932,7 @@ dwarf_expr_context::fetch_result (struct type *type, struct type *subobj_type,
piece_closure *c
= allocate_piece_closure (this->m_per_cu, this->m_per_objfile,
std::move (this->m_pieces), this->m_frame);
- retval = allocate_computed_value (subobj_type,
+ retval = value::allocate_computed (subobj_type,
&pieced_value_funcs, c);
retval->set_offset (subobj_offset);
}
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
index 2e0b4a8..743a0ce 100644
--- a/gdb/dwarf2/loc.c
+++ b/gdb/dwarf2/loc.c
@@ -1359,7 +1359,7 @@ value_of_dwarf_reg_entry (struct type *type, frame_info_ptr frame,
caller_per_cu,
caller_per_objfile);
- val = allocate_computed_value (type, &entry_data_value_funcs,
+ val = value::allocate_computed (type, &entry_data_value_funcs,
release_value (target_val).release ());
/* Copy the referencing pointer to the new computed value. */
diff --git a/gdb/infrun.c b/gdb/infrun.c
index acf9303..c45c6b5 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -9194,7 +9194,7 @@ siginfo_make_value (struct gdbarch *gdbarch, struct internalvar *var,
{
struct type *type = gdbarch_get_siginfo_type (gdbarch);
- return allocate_computed_value (type, &siginfo_value_funcs, nullptr);
+ return value::allocate_computed (type, &siginfo_value_funcs, nullptr);
}
return value::allocate (builtin_type (gdbarch)->builtin_void);
diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c
index c76f948..25be86e 100644
--- a/gdb/opencl-lang.c
+++ b/gdb/opencl-lang.c
@@ -304,7 +304,7 @@ create_value (struct gdbarch *gdbarch, struct value *val, enum noside noside,
if (VALUE_LVAL (val) != not_lval && !array_has_dups (indices, n))
{
struct lval_closure *c = allocate_lval_closure (indices, n, val);
- ret = allocate_computed_value (dst_type, &opencl_value_funcs, c);
+ ret = value::allocate_computed (dst_type, &opencl_value_funcs, c);
}
else
{
diff --git a/gdb/value.c b/gdb/value.c
index 11c9237..7fb12d8 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -995,9 +995,9 @@ allocate_repeat_value (struct type *type, int count)
}
struct value *
-allocate_computed_value (struct type *type,
- const struct lval_funcs *funcs,
- void *closure)
+value::allocate_computed (struct type *type,
+ const struct lval_funcs *funcs,
+ void *closure)
{
struct value *v = value::allocate_lazy (type);
diff --git a/gdb/value.h b/gdb/value.h
index c1c9199..dbbb619 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -169,6 +169,12 @@ public:
/* Allocate a value and its contents for type TYPE. */
static struct value *allocate (struct type *type);
+ /* Create a computed lvalue, with type TYPE, function pointers
+ FUNCS, and closure CLOSURE. */
+ static struct value *allocate_computed (struct type *type,
+ const struct lval_funcs *funcs,
+ void *closure);
+
~value ();
DISABLE_COPY_AND_ASSIGN (value);
@@ -619,13 +625,6 @@ struct lval_funcs
void (*free_closure) (struct value *v);
};
-/* Create a computed lvalue, with type TYPE, function pointers FUNCS,
- and closure CLOSURE. */
-
-extern struct value *allocate_computed_value (struct type *type,
- const struct lval_funcs *funcs,
- void *closure);
-
extern struct value *allocate_optimized_out_value (struct type *type);
/* Throw an error complaining that the value has been optimized
diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c
index 741333c..893e34d 100644
--- a/gdb/windows-tdep.c
+++ b/gdb/windows-tdep.c
@@ -433,7 +433,7 @@ tlb_make_value (struct gdbarch *gdbarch, struct internalvar *var, void *ignore)
if (target_has_stack () && inferior_ptid != null_ptid)
{
struct type *type = windows_get_tlb_type (gdbarch);
- return allocate_computed_value (type, &tlb_value_funcs, NULL);
+ return value::allocate_computed (type, &tlb_value_funcs, NULL);
}
return value::allocate (builtin_type (gdbarch)->builtin_void);