aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-exp.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-03-08 07:27:57 -0700
committerTom Tromey <tom@tromey.com>2021-03-08 07:28:31 -0700
commit944fd3b8126f27569a6a3552b3457ba8a8cc3f87 (patch)
treeb222df7620e4a10d3f3577239297c75595d58d41 /gdb/c-exp.h
parent33b79214629c2b1b219e82bb34aed5fb03913634 (diff)
downloadfsf-binutils-gdb-944fd3b8126f27569a6a3552b3457ba8a8cc3f87.zip
fsf-binutils-gdb-944fd3b8126f27569a6a3552b3457ba8a8cc3f87.tar.gz
fsf-binutils-gdb-944fd3b8126f27569a6a3552b3457ba8a8cc3f87.tar.bz2
Implement OpenCL logical binary operations
This implements "&&" and "||" for OpenCL. gdb/ChangeLog 2021-03-08 Tom Tromey <tom@tromey.com> * opencl-lang.c (opencl_logical_binop_operation::evaluate): New method. * c-exp.h (class opencl_logical_binop_operation): New.
Diffstat (limited to 'gdb/c-exp.h')
-rw-r--r--gdb/c-exp.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/c-exp.h b/gdb/c-exp.h
index 58a16d5..f75b4ae 100644
--- a/gdb/c-exp.h
+++ b/gdb/c-exp.h
@@ -186,6 +186,23 @@ public:
{ return STRUCTOP_STRUCT; }
};
+/* This handles the "&&" and "||" operations for OpenCL. */
+class opencl_logical_binop_operation
+ : public tuple_holding_operation<enum exp_opcode,
+ operation_up, operation_up>
+{
+public:
+
+ using tuple_holding_operation::tuple_holding_operation;
+
+ value *evaluate (struct type *expect_type,
+ struct expression *exp,
+ enum noside noside) override;
+
+ enum exp_opcode opcode () const override
+ { return std::get<0> (m_storage); }
+};
+
}/* namespace expr */
#endif /* C_EXP_H */