aboutsummaryrefslogtreecommitdiff
path: root/gdb/compile/compile-internal.h
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2018-08-10 10:38:56 -0700
committerKeith Seitz <keiths@redhat.com>2018-08-10 11:14:25 -0700
commitbd923e510884a92514a4f9d90d79592d248d5d92 (patch)
tree95c8395b4e3c64552a5f6d6cbf9ca9db08e592a4 /gdb/compile/compile-internal.h
parentd7f449c026181e14162a67407842462e4bc0d8bd (diff)
downloadbinutils-bd923e510884a92514a4f9d90d79592d248d5d92.zip
binutils-bd923e510884a92514a4f9d90d79592d248d5d92.tar.gz
binutils-bd923e510884a92514a4f9d90d79592d248d5d92.tar.bz2
Return unique_xmalloc_ptr for generate_c_for_variable_locations
This patch eliminates two cleanups in compile/ by changing generate_c_for_variable_locations so that it returns a unique_ptr. gdb/ChangeLog: * compile/compile-c-support.c (c_compute_program): Use unique_xmalloc_ptr to eliminate cleanup. * compile/compile-c-symbols.c (generate_c_for_variable_locations): Return a unique_xmalloc_ptr and eliminate cleanup. * compile/compile-internal.h (generate_c_for_variable_locations): Return unique_xmalloc_ptr and update description.
Diffstat (limited to 'gdb/compile/compile-internal.h')
-rw-r--r--gdb/compile/compile-internal.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/gdb/compile/compile-internal.h b/gdb/compile/compile-internal.h
index c92cb64..01beb1d 100644
--- a/gdb/compile/compile-internal.h
+++ b/gdb/compile/compile-internal.h
@@ -128,11 +128,12 @@ extern gcc_c_symbol_address_function gcc_symbol_address;
extern struct compile_instance *new_compile_instance (struct gcc_c_context *fe);
/* Emit code to compute the address for all the local variables in
- scope at PC in BLOCK. Returns a malloc'd vector, indexed by gdb
- register number, where each element indicates if the corresponding
- register is needed to compute a local variable. */
+ scope at PC in BLOCK. Returns a vector, indexed by gdb register
+ number, where each element indicates if the corresponding register
+ is needed to compute a local variable. */
-extern unsigned char *generate_c_for_variable_locations
+extern gdb::unique_xmalloc_ptr<unsigned char>
+ generate_c_for_variable_locations
(struct compile_c_instance *compiler,
string_file &stream,
struct gdbarch *gdbarch,