/* Definitions for C expressions
- Copyright (C) 2020 Free Software Foundation, Inc.
+ Copyright (C) 2020-2022 Free Software Foundation, Inc.
This file is part of GDB.
struct expression *exp,
enum noside noside) override
{
- if (noside == EVAL_SKIP)
- return eval_skip_value (exp);
const std::string &str = std::get<0> (m_storage);
return value_nsstring (exp->gdbarch, str.c_str (), str.size () + 1);
}
struct expression *exp,
enum noside noside) override
{
- if (noside == EVAL_SKIP)
- return eval_skip_value (exp);
return eval_op_objc_selector (expect_type, exp, noside,
std::get<0> (m_storage).c_str ());
}
using opencl_not_operation = unop_operation<UNOP_LOGICAL_NOT,
opencl_logical_not>;
+/* STRUCTOP_STRUCT implementation for OpenCL. */
+class opencl_structop_operation
+ : public structop_base_operation
+{
+public:
+
+ using structop_base_operation::structop_base_operation;
+
+ value *evaluate (struct type *expect_type,
+ struct expression *exp,
+ enum noside noside) override;
+
+ enum exp_opcode opcode () const override
+ { 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); }
+};
+
+/* The ?: ternary operator for OpenCL. */
+class opencl_ternop_cond_operation
+ : public tuple_holding_operation<operation_up, 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 TERNOP_COND; }
+};
+
}/* namespace expr */
#endif /* C_EXP_H */