This changes value_array to accept an array view. I also replaced an
alloca with a std::vector in array_operation::evaluate. This function
can work on any size of array, so it seems bad to use alloca.
Reviewed-by: John Baldwin <jhb@FreeBSD.org>
Approved-By: Simon Marchi <simon.marchi@efficios.com>
return set;
}
- value **argvec = XALLOCAVEC (struct value *, nargs);
+ std::vector<value *> argvec (nargs);
for (tem = 0; tem < nargs; tem++)
{
/* Ensure that array expressions are coerced into pointer
for (i = 0; i < copies; ++i)
eltvec[i] = elt;
- return value_array (0, copies - 1, eltvec.data ());
+ return value_array (0, copies - 1, eltvec);
}
else
{
don't currently enforce any restriction on their types). */
struct value *
-value_array (int lowbound, int highbound, struct value **elemvec)
+value_array (int lowbound, int highbound,
+ gdb::array_view<struct value *> elemvec)
{
int nelem;
int idx;
}
extern struct value *value_array (int lowbound, int highbound,
- struct value **elemvec);
+ gdb::array_view<struct value *> elemvec);
extern struct value *value_concat (struct value *arg1, struct value *arg2);