From 6b09f1342cf2d8e2b13a0d634acc3bcf2852a73b Mon Sep 17 00:00:00 2001 From: Lancelot Six Date: Fri, 13 Oct 2023 09:27:48 +0000 Subject: 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 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 Approved-By: Pedro Alves --- gdb/xml-tdesc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gdb/xml-tdesc.c') 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 tdesc_str + std::optional 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 . */ -static gdb::optional +static std::optional 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 tdesc_str + std::optional 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::optional 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 + std::optional 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 (); + return std::optional (); }); } -- cgit v1.1