aboutsummaryrefslogtreecommitdiff
path: root/gdb/compile
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2018-12-31 17:41:38 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2019-01-03 21:24:00 +0000
commit06d3e5b0046d69e3da3450d2eb07c29f0c1a189a (patch)
treee0b86260f64d08ee047298504ee0b3228c1081f8 /gdb/compile
parent66644cd32ba63e7fda70e455766b438631ec0b61 (diff)
downloadgdb-06d3e5b0046d69e3da3450d2eb07c29f0c1a189a.zip
gdb-06d3e5b0046d69e3da3450d2eb07c29f0c1a189a.tar.gz
gdb-06d3e5b0046d69e3da3450d2eb07c29f0c1a189a.tar.bz2
gdb: Remove a cleanup from find_overload_match
This patch changes cp-support.c:cp_func_name to return a 'gdb::unique_xmalloc_ptr<char>' instead of a 'char *'. This allows a cleanup to be removed from valops.c:find_overload_match. gdb/ChangeLog: * compile/compile-cplus-types.c (compile_cplus_instance::decl_name): Handle changes to cp_func_name. * cp-support.c (cp_func_name): Update header comment, update return type. * cp-support.h (cp_func_name): Update return type in declaration. * valops.c (find_overload_match): Move temp_func local to top level of function and change its type. Use temp_func to hold and delete temporary string obtained from cp_func_name.
Diffstat (limited to 'gdb/compile')
-rw-r--r--gdb/compile/compile-cplus-types.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/compile/compile-cplus-types.c b/gdb/compile/compile-cplus-types.c
index 3de0d8e..910a874 100644
--- a/gdb/compile/compile-cplus-types.c
+++ b/gdb/compile/compile-cplus-types.c
@@ -63,9 +63,9 @@ compile_cplus_instance::decl_name (const char *natural)
if (natural == nullptr)
return nullptr;
- char *name = cp_func_name (natural);
+ gdb::unique_xmalloc_ptr<char> name = cp_func_name (natural);
if (name != nullptr)
- return gdb::unique_xmalloc_ptr<char> (name);
+ return name;
return gdb::unique_xmalloc_ptr<char> (xstrdup (natural));
}