From f6c2623eb8ac7296b6d7a76657394272a71f5aee Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 6 Feb 2018 01:02:00 +0100 Subject: Return unique_xmalloc_ptr from macro scope functions This changes the macro scope functions (sal_macro_scope, user_macro_scope, and default_macro_scope) to return a unique_xmalloc_ptr, then fixes up the users. This allowed for the removal of several cleanups. 2018-02-08 Tom Tromey * symtab.c (default_collect_symbol_completion_matches_break_on): Use unique_xmalloc_ptr. * macroscope.h: (sal_macro_scope, user_macro_scope) (default_macro_scope): Return unique_xmalloc_ptr. * macroscope.c (sal_macro_scope, user_macro_scope) (default_macro_scope): Return unique_xmalloc_ptr. * macroexp.h (macro_expand, macro_expand_once): Return unique_xmalloc_ptr. * macroexp.c (macro_expand, macro_expand_once): Return unique_xmalloc_ptr. * macrocmd.c (macro_expand_command, macro_expand_once_command) (info_macro_command, info_macros_command): Use unique_xmalloc_ptr. * compile/compile-c-support.c (write_macro_definitions): Use unique_xmalloc_ptr. * c-exp.y (c_parse): Use unique_xmalloc_ptr. --- gdb/compile/compile-c-support.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/compile') diff --git a/gdb/compile/compile-c-support.c b/gdb/compile/compile-c-support.c index 006d3f8..e694648 100644 --- a/gdb/compile/compile-c-support.c +++ b/gdb/compile/compile-c-support.c @@ -157,7 +157,7 @@ static void write_macro_definitions (const struct block *block, CORE_ADDR pc, struct ui_file *file) { - struct macro_scope *scope; + gdb::unique_xmalloc_ptr scope; if (block != NULL) scope = sal_macro_scope (find_pc_line (pc, 0)); -- cgit v1.1