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/extension.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gdb/extension.c') diff --git a/gdb/extension.c b/gdb/extension.c index 9cb393e..2d7a381 100644 --- a/gdb/extension.c +++ b/gdb/extension.c @@ -939,10 +939,10 @@ xmethod_worker::get_result_type (value *object, gdb::array_view args) /* See extension.h. */ -gdb::optional +std::optional ext_lang_colorize (const std::string &filename, const std::string &contents) { - gdb::optional result; + std::optional result; for (const struct extension_language_defn *extlang : extension_languages) { @@ -959,10 +959,10 @@ ext_lang_colorize (const std::string &filename, const std::string &contents) /* See extension.h. */ -gdb::optional +std::optional ext_lang_colorize_disasm (const std::string &content, gdbarch *gdbarch) { - gdb::optional result; + std::optional result; for (const struct extension_language_defn *extlang : extension_languages) { @@ -979,7 +979,7 @@ ext_lang_colorize_disasm (const std::string &content, gdbarch *gdbarch) /* See extension.h. */ -gdb::optional +std::optional ext_lang_print_insn (struct gdbarch *gdbarch, CORE_ADDR address, struct disassemble_info *info) { @@ -988,7 +988,7 @@ ext_lang_print_insn (struct gdbarch *gdbarch, CORE_ADDR address, if (extlang->ops == nullptr || extlang->ops->print_insn == nullptr) continue; - gdb::optional length + std::optional length = extlang->ops->print_insn (gdbarch, address, info); if (length.has_value ()) return length; -- cgit v1.1