- default_make_symbol_completion_list,
- opencl_language_arch_info,
- default_print_array_index,
- default_pass_by_reference,
- c_get_string,
- NULL, /* la_get_symbol_name_cmp */
- iterate_over_symbols,
- LANG_MAGIC
+ default_collect_symbol_completion_matches,
+ c_watch_location_expression,
+ NULL, /* la_get_symbol_name_matcher */
+ &default_varobj_ops,
+ NULL,
+ c_is_string_type_p,
+ "{...}" /* la_struct_too_deep_ellipsis */
+};
+
+/* Class representing the OpenCL language. */
+
+class opencl_language : public language_defn
+{
+public:
+ opencl_language ()
+ : language_defn (language_opencl, opencl_language_data)
+ { /* Nothing. */ }
+
+ /* See language.h. */
+ void language_arch_info (struct gdbarch *gdbarch,
+ struct language_arch_info *lai) const override
+ {
+ struct type **types = builtin_opencl_type (gdbarch);
+
+ /* Copy primitive types vector from gdbarch. */
+ lai->primitive_type_vector = types;
+
+ /* Type of elements of strings. */
+ lai->string_char_type = types [opencl_primitive_type_char];
+
+ /* Specifies the return type of logical and relational operations. */
+ lai->bool_type_symbol = "int";
+ lai->bool_type_default = types [opencl_primitive_type_int];
+ }
+
+ /* See language.h. */
+
+ void print_type (struct type *type, const char *varstring,
+ struct ui_file *stream, int show, int level,
+ const struct type_print_options *flags) const override
+ {
+ /* We nearly always defer to C type printing, except that vector types
+ are considered primitive in OpenCL, and should always be printed
+ using their TYPE_NAME. */
+ if (show > 0)
+ {
+ type = check_typedef (type);
+ if (type->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type)
+ && type->name () != NULL)
+ show = 0;
+ }
+
+ c_print_type (type, varstring, stream, show, level, flags);
+ }