This adds class opencl_cast_type_operation, which implements
UNOP_CAST_TYPE for OpenCL.
gdb/ChangeLog
2021-03-08 Tom Tromey <tom@tromey.com>
* opencl-lang.c (opencl_value_cast): No longer static.
* c-exp.h (opencl_cast_type_operation): New typedef.
+2021-03-08 Tom Tromey <tom@tromey.com>
+
+ * opencl-lang.c (opencl_value_cast): No longer static.
+ * c-exp.h (opencl_cast_type_operation): New typedef.
+
2021-03-08 Tom Tromey <tom@tromey.com>
* f-exp.h (eval_op_f_allocated): Declare.
struct expression *exp,
enum noside noside,
const char *sel);
+extern struct value *opencl_value_cast (struct type *type, struct value *arg);
+
namespace expr
{
{ return OP_OBJC_MSGCALL; }
};
+using opencl_cast_type_operation = cxx_cast_operation<UNOP_CAST_TYPE,
+ opencl_value_cast>;
+
}/* namespace expr */
#endif /* C_EXP_H */
#include "varobj.h"
#include "c-lang.h"
#include "gdbarch.h"
+#include "c-exp.h"
/* Returns the corresponding OpenCL vector type from the given type code,
the length of the element type, the unsigned flag and the amount of
behaviour of scalar to vector casting. As far as possibly we're going
to try and delegate back to the standard value_cast function. */
-static struct value *
+struct value *
opencl_value_cast (struct type *type, struct value *arg)
{
if (type != value_type (arg))