Remove a cleanup from target-descriptions.c
authorTom Tromey <tom@tromey.com>
Wed, 2 Jan 2019 15:03:13 +0000 (08:03 -0700)
committerTom Tromey <tom@tromey.com>
Wed, 2 Jan 2019 23:40:11 +0000 (16:40 -0700)
commitc55d06ec95961fadd9deeffae519ff0f20f237d3
treed29af475537221052acb1202b40769ddf1491a9a
parent3a6ae42d4e4ecfd2441cf9b978b2a54ad6767cb7
Remove a cleanup from target-descriptions.c

This removes a cleanup from target-descriptions.c, by changing it to
use a unique_ptr instead.  Note that a deletion adapter is used, even
though target_desc is allocated with new, to avoid moving target_desc
to target-descriptions.h.

gdb/ChangeLog
2019-01-02  Tom Tromey  <tom@tromey.com>

* xml-tdesc.c (xml_cache): Hold a target_desc_up.
(tdesc_parse_xml): Remove cleanups.
* target-descriptions.h (make_cleanup_free_target_description):
Don't declare.
(target_desc_deleter): New struct.
(target_desc_up): New typedef.
* target-descriptions.c (target_desc_deleter::operator()): Rename
from free_target_description.
(make_cleanup_free_target_description): Remove.
gdb/ChangeLog
gdb/target-descriptions.c
gdb/target-descriptions.h
gdb/xml-tdesc.c