diff options
author | Lancelot Six <lancelot.six@amd.com> | 2023-10-13 09:27:48 +0000 |
---|---|---|
committer | Lancelot Six <lancelot.six@amd.com> | 2023-11-21 11:52:35 +0000 |
commit | 6b09f1342cf2d8e2b13a0d634acc3bcf2852a73b (patch) | |
tree | 07259601270022a6cbeb89826560262f015e1589 /gdb/xml-tdesc.c | |
parent | 6b62451ad08056f0ba02e192ec34ef67c4294ef4 (diff) | |
download | gdb-6b09f1342cf2d8e2b13a0d634acc3bcf2852a73b.zip gdb-6b09f1342cf2d8e2b13a0d634acc3bcf2852a73b.tar.gz gdb-6b09f1342cf2d8e2b13a0d634acc3bcf2852a73b.tar.bz2 |
gdb: Replace gdb::optional with std::optional
Since GDB now requires C++17, we don't need the internally maintained
gdb::optional implementation. This patch does the following replacing:
- gdb::optional -> std::optional
- gdb::in_place -> std::in_place
- #include "gdbsupport/gdb_optional.h" -> #include <optional>
This change has mostly been done automatically. One exception is
gdbsupport/thread-pool.* which did not use the gdb:: prefix as it
already lives in the gdb namespace.
Change-Id: I19a92fa03e89637bab136c72e34fd351524f65e9
Approved-By: Tom Tromey <tom@tromey.com>
Approved-By: Pedro Alves <pedro@palves.net>
Diffstat (limited to 'gdb/xml-tdesc.c')
-rw-r--r-- | gdb/xml-tdesc.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gdb/xml-tdesc.c b/gdb/xml-tdesc.c index a8b0b05..daf123a 100644 --- a/gdb/xml-tdesc.c +++ b/gdb/xml-tdesc.c @@ -663,7 +663,7 @@ tdesc_parse_xml (const char *document, xml_fetch_another fetcher) const struct target_desc * file_read_description_xml (const char *filename) { - gdb::optional<gdb::char_vector> tdesc_str + std::optional<gdb::char_vector> tdesc_str = xml_fetch_content_from_file (filename, NULL); if (!tdesc_str) { @@ -687,7 +687,7 @@ file_read_description_xml (const char *filename) is "target.xml". Other calls may be performed for the DTD or for <xi:include>. */ -static gdb::optional<gdb::char_vector> +static std::optional<gdb::char_vector> fetch_available_features_from_target (const char *name, target_ops *ops) { /* Read this object as a string. This ensures that a NUL @@ -704,7 +704,7 @@ fetch_available_features_from_target (const char *name, target_ops *ops) const struct target_desc * target_read_description_xml (struct target_ops *ops) { - gdb::optional<gdb::char_vector> tdesc_str + std::optional<gdb::char_vector> tdesc_str = fetch_available_features_from_target ("target.xml", ops); if (!tdesc_str) return NULL; @@ -721,7 +721,7 @@ target_read_description_xml (struct target_ops *ops) includes, but not parsing it. Used to dump whole tdesc as a single XML file. */ -gdb::optional<std::string> +std::optional<std::string> target_fetch_description_xml (struct target_ops *ops) { #if !defined(HAVE_LIBEXPAT) @@ -736,7 +736,7 @@ target_fetch_description_xml (struct target_ops *ops) return {}; #else - gdb::optional<gdb::char_vector> + std::optional<gdb::char_vector> tdesc_str = fetch_available_features_from_target ("target.xml", ops); if (!tdesc_str) return {}; @@ -765,6 +765,6 @@ string_read_description_xml (const char *xml) return tdesc_parse_xml (xml, [] (const char *href) { error (_("xincludes are unsupported with this method")); - return gdb::optional<gdb::char_vector> (); + return std::optional<gdb::char_vector> (); }); } |