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
commitcf12b17fd05811e08235fd4aaca5306bd78c7527 (patch)
treeb1266eb5299ea2aa2f223e8bdabbb35162f877ab /gdb/c-exp.h
parent944fd3b8126f27569a6a3552b3457ba8a8cc3f87 (diff)
downloadgdb-cf12b17fd05811e08235fd4aaca5306bd78c7527.zip
gdb-cf12b17fd05811e08235fd4aaca5306bd78c7527.tar.gz
gdb-cf12b17fd05811e08235fd4aaca5306bd78c7527.tar.bz2
Implement OpenCL ternary conditional operator
This implements the ?: ternary conditional operator for OpenCL. gdb/ChangeLog 2021-03-08 Tom Tromey <tom@tromey.com> * opencl-lang.c (opencl_ternop_cond_operation::evaluate): New method. * c-exp.h (class opencl_ternop_cond_operation): New.
Diffstat (limited to 'gdb/c-exp.h')
-rw-r--r--gdb/c-exp.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/c-exp.h b/gdb/c-exp.h
index f75b4ae..0ce2bd6 100644
--- a/gdb/c-exp.h
+++ b/gdb/c-exp.h
@@ -203,6 +203,22 @@ public:
{ 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 */