Introduce opencl_cast_type_operation
authorTom Tromey <tom@tromey.com>
Mon, 8 Mar 2021 14:27:57 +0000 (07:27 -0700)
committerTom Tromey <tom@tromey.com>
Mon, 8 Mar 2021 14:28:30 +0000 (07:28 -0700)
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.

gdb/ChangeLog
gdb/c-exp.h
gdb/opencl-lang.c

index 856d6ffbf0a46f66e816afb9f87f62713d436c72..5abe97e6907f2bf2bab0ef529ad3310456954ed2 100644 (file)
@@ -1,3 +1,8 @@
+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.
index 2d224c8c633dfbb51e2e7871a21db840bcc70bf3..68efa62c5a8e9ba9bee0411e51bc4efcae8fa06d 100644 (file)
@@ -27,6 +27,8 @@ extern struct value *eval_op_objc_selector (struct type *expect_type,
                                            struct expression *exp,
                                            enum noside noside,
                                            const char *sel);
+extern struct value *opencl_value_cast (struct type *type, struct value *arg);
+
 namespace expr
 {
 
@@ -105,6 +107,9 @@ public:
   { return OP_OBJC_MSGCALL; }
 };
 
+using opencl_cast_type_operation = cxx_cast_operation<UNOP_CAST_TYPE,
+                                                     opencl_value_cast>;
+
 }/* namespace expr */
 
 #endif /* C_EXP_H */
index b45e47eb5067e505c292d362199a9052d281b158..c31eb51a3901c8b525fd49f8ade41efaf0ccd1fa 100644 (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))
This page took 0.026944 seconds and 4 git commands to generate.