selftest: split out named_temp_file from temp_source_file
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 31 Aug 2016 00:07:38 +0000 (00:07 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Wed, 31 Aug 2016 00:07:38 +0000 (00:07 +0000)
commit4ecfc45373b2f6bf13ff978f8b6f9411ad13b764
tree1a93335308b8e648e3693e8973cfdf8678cb1bfc
parent71b308914e31765f2110e6692685e0842c317bed
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.

From-SVN: r239875
gcc/ChangeLog
gcc/selftest.c
gcc/selftest.h