Remove make_cleanup_value_free

This removes make_cleanup_value_free, in favor of a unique_ptr
specialization.

Regression tested by the buildbot.

gdb/ChangeLog
2017-10-08  Tom Tromey  <tom@tromey.com>

	* utils.h (make_cleanup_value_free): Remove.
	* utils.c (do_value_free, struct cleanup): Remove.
	* dwarf2loc.c (dwarf2_evaluate_loc_desc_full) <DWARF_VALUE_STACK>:
	Use gdb_value_up.
	* value.h (struct value_deleter): New.
	(gdb_value_up): New typedef.
This commit is contained in:
Tom Tromey
2017-10-08 12:20:49 -06:00
parent b9c04fb268
commit 757325a3f2
5 changed files with 25 additions and 21 deletions

View File

@@ -2478,7 +2478,6 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
size_t len = TYPE_LENGTH (subobj_type);
size_t max = TYPE_LENGTH (type);
struct gdbarch *objfile_gdbarch = get_objfile_arch (objfile);
struct cleanup *cleanup;
if (subobj_byte_offset + len > max)
invalid_synthetic_pointer ();
@@ -2488,7 +2487,7 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
below. */
value_incref (value);
free_values.free_to_mark ();
cleanup = make_cleanup_value_free (value);
gdb_value_up value_holder (value);
retval = allocate_value (subobj_type);
@@ -2498,8 +2497,6 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
memcpy (value_contents_raw (retval),
value_contents_all (value) + subobj_byte_offset, len);
do_cleanups (cleanup);
}
break;