Introduce opencl_cast_type_operation

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.
This commit is contained in:
Tom Tromey
2021-03-08 07:27:57 -07:00
parent f403a4e4a5
commit e967770468
3 changed files with 12 additions and 1 deletions

View File

@@ -27,6 +27,7 @@
#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
@@ -581,7 +582,7 @@ vector_relop (struct expression *exp, struct value *val1, struct value *val2,
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))