diff options
author | Pedro Alves <pedro@palves.net> | 2020-11-16 19:15:00 +0000 |
---|---|---|
committer | Pedro Alves <pedro@palves.net> | 2020-11-20 13:27:01 +0000 |
commit | cbbcd7a716d7f1f65c57aa6ba6e034ecb9a78378 (patch) | |
tree | d2d5bd43aaa5a9adf354ff9f17945c285bc4ce04 /gdb/language.h | |
parent | e6f6aa8d184c38230d9acd91a49aa0cbe3f37e42 (diff) | |
download | gdb-cbbcd7a716d7f1f65c57aa6ba6e034ecb9a78378.zip gdb-cbbcd7a716d7f1f65c57aa6ba6e034ecb9a78378.tar.gz gdb-cbbcd7a716d7f1f65c57aa6ba6e034ecb9a78378.tar.bz2 |
language_lookup_primitive_type, std::function -> gdb::function_view
gdb/ChangeLog:
* language.c (language_arch_info::lookup_primitive_type): Use
gdb::function_view instead of gdb::function.
(template language_lookup_primitive_type): Rename to ...
(language_lookup_primitive_type_1): ... this, and make static.
(language_lookup_primitive_type(const struct language_defn *,
struct gdbarch *, const char *): Make non-template.
(language_lookup_primitive_type(const struct language_defn *,
struct gdbarch *, std::function<bool (struct type *)>): Make
non-template and use gdb::function_view.
* language.h (language_arch_info::lookup_primitive_type): Use
gdb::function_view instead of std::function.
(language_lookup_primitive_type): No longer template.
* opencl-lang.c (lookup_opencl_vector_type): 'filter' is now a
lambda instead of a std::function.
Diffstat (limited to 'gdb/language.h')
-rw-r--r-- | gdb/language.h | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/gdb/language.h b/gdb/language.h index 1b60264..e955340 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -140,7 +140,7 @@ struct language_arch_info /* Lookup a primitive type for which FILTER returns true. Will return nullptr if no matching type is found. */ struct type *lookup_primitive_type - (std::function<bool (struct type *)> filter); + (gdb::function_view<bool (struct type *)> filter); /* Lookup a primitive type called NAME and return the type as a symbol. LANG is the language for which type is being looked up. */ @@ -719,15 +719,26 @@ struct type *language_bool_type (const struct language_defn *l, struct type *language_string_char_type (const struct language_defn *l, struct gdbarch *gdbarch); -/* Look up a type from the set of OS/ABI specific types defined in GDBARCH - for language L. ARG is used for selecting the matching type, and is - passed through to the corresponding lookup_primitive_type member - function inside the language_arch_info class. */ +/* Look up a type from the set of OS/ABI specific types defined in + GDBARCH for language L. NAME is used for selecting the matching + type, and is passed through to the corresponding + lookup_primitive_type member function inside the language_arch_info + class. */ -template<typename T> struct type *language_lookup_primitive_type (const struct language_defn *l, struct gdbarch *gdbarch, - T arg); + const char *name); + +/* Look up a type from the set of OS/ABI specific types defined in + GDBARCH for language L. FILTER is used for selecting the matching + type, and is passed through to the corresponding + lookup_primitive_type member function inside the language_arch_info + class. */ + +struct type *language_lookup_primitive_type + (const struct language_defn *la, + struct gdbarch *gdbarch, + gdb::function_view<bool (struct type *)> filter); /* Wrapper around language_lookup_primitive_type to return the corresponding symbol. */ |