diff options
author | Lancelot Six <lancelot.six@amd.com> | 2023-10-13 10:54:46 +0000 |
---|---|---|
committer | Lancelot Six <lancelot.six@amd.com> | 2023-11-21 11:52:36 +0000 |
commit | 882b0505164f9474ef565cbc237df34a65061a8f (patch) | |
tree | 1e9784ba6c4f4ef6075792c62b16e464b364e7a2 /gdb/amdgpu-tdep.c | |
parent | 8082468ffe65095cdd640fb081b9d3d28dd7add4 (diff) | |
download | binutils-882b0505164f9474ef565cbc237df34a65061a8f.zip binutils-882b0505164f9474ef565cbc237df34a65061a8f.tar.gz binutils-882b0505164f9474ef565cbc237df34a65061a8f.tar.bz2 |
gdb: Remove uses of gdb::to_string (const std::string_view &)
This patch removes all uses of to_string(const std::string_view&) and
use the std::string ctor or implicit conversion from std::string_view to
std::string instead.
A later patch will remove this gdb::to_string while removing
gdbsupport/gdb_string_view.h.
Change-Id: I877cde557a0727be7b0435107e3c7a2aac165895
Approved-By: Tom Tromey <tom@tromey.com>
Approved-By: Pedro Alves <pedro@palves.net>
Diffstat (limited to 'gdb/amdgpu-tdep.c')
-rw-r--r-- | gdb/amdgpu-tdep.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/gdb/amdgpu-tdep.c b/gdb/amdgpu-tdep.c index 58d26fc..15f3288 100644 --- a/gdb/amdgpu-tdep.c +++ b/gdb/amdgpu-tdep.c @@ -27,7 +27,6 @@ #include "frame-unwind.h" #include "gdbarch.h" #include "gdbsupport/selftest.h" -#include "gdbsupport/gdb_string_view.h" #include "gdbtypes.h" #include "inferior.h" #include "objfiles.h" @@ -402,7 +401,7 @@ parse_amd_dbgapi_register_type_enum_fields if (value > std::numeric_limits<uint32_t>::max ()) enum_type.set_bit_size (64); - enum_type.add_enumerator (gdb::to_string (name), value); + enum_type.add_enumerator (std::string (name), value); fields = fields.substr (matches[0].rm_eo); } @@ -446,7 +445,7 @@ parse_amd_dbgapi_register_type_flags_fields ULONGEST pos_begin = try_strtoulst (pos_begin_str); if (field_type_str == "bool") - flags_type.add_field (gdb::to_string (field_name), pos_begin, pos_begin, + flags_type.add_field (std::string (field_name), pos_begin, pos_begin, nullptr); else { @@ -457,7 +456,7 @@ parse_amd_dbgapi_register_type_flags_fields ULONGEST pos_end = try_strtoulst (pos_end_str.substr (1)); const amd_dbgapi_register_type &field_type = parse_amd_dbgapi_register_type (field_type_str, type_map); - flags_type.add_field (gdb::to_string (field_name), pos_begin, pos_end, + flags_type.add_field (std::string (field_name), pos_begin, pos_end, &field_type); } @@ -471,7 +470,7 @@ static const amd_dbgapi_register_type & parse_amd_dbgapi_register_type_scalar (std::string_view name, amd_dbgapi_register_type_map &type_map) { - std::string name_str = gdb::to_string (name); + std::string name_str (name); auto it = type_map.find (name_str); if (it != type_map.end ()) { @@ -534,7 +533,7 @@ parse_amd_dbgapi_register_type (std::string_view type_str, std::string_view count_str_view = type_str.substr (pos_open_bracket + 1, pos_close_bracket - pos_open_bracket); - std::string count_str = gdb::to_string (count_str_view); + std::string count_str (count_str_view); unsigned int count = std::stoul (count_str); std::string lookup_name @@ -580,7 +579,7 @@ parse_amd_dbgapi_register_type (std::string_view type_str, /* No braces, lookup existing type. */ if (existing_type_it == type_map.end ()) error (_("reference to unknown type %s."), - gdb::to_string (name).c_str ()); + std::string (name).c_str ()); if (existing_type_it->second->kind () != amd_dbgapi_register_type::kind::FLAGS) @@ -593,7 +592,7 @@ parse_amd_dbgapi_register_type (std::string_view type_str, /* With braces, it's a definition. */ if (existing_type_it != type_map.end ()) error (_("re-definition of type %s."), - gdb::to_string (name).c_str ()); + std::string (name).c_str ()); amd_dbgapi_register_type_flags_up flags_type (new amd_dbgapi_register_type_flags (bit_size, name)); @@ -632,7 +631,7 @@ parse_amd_dbgapi_register_type (std::string_view type_str, /* No braces, lookup existing type. */ if (existing_type_it == type_map.end ()) error (_("reference to unknown type %s"), - gdb::to_string (name).c_str ()); + std::string (name).c_str ()); if (existing_type_it->second->kind () != amd_dbgapi_register_type::kind::ENUM) @@ -645,7 +644,7 @@ parse_amd_dbgapi_register_type (std::string_view type_str, /* With braces, it's a definition. */ if (existing_type_it != type_map.end ()) error (_("re-definition of type %s"), - gdb::to_string (name).c_str ()); + std::string (name).c_str ()); amd_dbgapi_register_type_enum_up enum_type (new amd_dbgapi_register_type_enum (name)); |