]> git.ipfire.org Git - thirdparty/gcc.git/commit
libcc1: add more uses of 'deleter'
authorTom Tromey <tom@tromey.com>
Tue, 4 May 2021 21:26:58 +0000 (15:26 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 5 May 2021 06:06:17 +0000 (00:06 -0600)
commit0f237df286ecaf366e19601917bedaf6224929d0
tree181d82fe9796bb364de8241a78e5a82c3782c260
parent0d5a0b9af5b9c0f07eabcdb1a7a6454c06cdf8ae
libcc1: add more uses of 'deleter'

This changes libcc1 to use the 'deleter' template in a few more
places.  The template and basic specializations are moved to a new
header, then some unmarshall functions are changed to use this code.
This change avoids the need to repeat cleanup code in the
unmarshallers.

libcc1

* rpc.hh (deleter): Move template and some specializations to
deleter.hh.
(argument_wrapper<const T *>): Use cc1_plugin::unique_ptr.
* marshall.cc (cc1_plugin::unmarshall): Use
cc1_plugin::unique_ptr.
* marshall-cp.hh (deleter): New specializations.
(unmarshall): Use cc1_plugin::unique_ptr.
* deleter.hh: New file.
libcc1/deleter.hh [new file with mode: 0644]
libcc1/marshall-cp.hh
libcc1/marshall.cc
libcc1/rpc.hh