selftest: split out named_temp_file from temp_source_file
commitb99fc6a11e62b4e17d37995a9cb7065f3cf2e6bf
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 31 Aug 2016 00:07:38 +0000 (31 00:07 +0000)
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 31 Aug 2016 00:07:38 +0000 (31 00:07 +0000)
tree1a93335308b8e648e3693e8973cfdf8678cb1bfc
parent2e7400dfe767ef03e671381ab8d82315a984113a
selftest: split out named_temp_file from temp_source_file

Split out a new base class for temp_source_file, named_temp_file,
moving the deletion to the base class dtor, so that we can write
out temporary files in other ways in selftests.

gcc/ChangeLog:
* selftest.c (selftest::named_temp_file::named_temp_file): New
ctor.
(selftest::temp_source_file::~temp_source_file): Move to...
(selftest::named_temp_file::~named_temp_file): ...here.
(selftest::test_named_temp_file): New function.
(selftest::selftest_c_tests): Call test_named_temp_file.
* selftest.h (class named_temp_file): New class.
(class temp_source_file): Convert to a subclass of named_temp_file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239875 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/selftest.c
gcc/selftest.h