diff options
author | David Blaikie <dblaikie@gmail.com> | 2019-09-12 00:31:57 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2019-09-12 00:31:57 +0000 |
commit | aaef97a55e4885e95c8528e6dc761a63323d19b3 (patch) | |
tree | 10b97fb8dd2c87133d4f3cdf6a52e12c92437367 /llvm/tools/llvm-reduce/TestRunner.h | |
parent | 635d383fad2baef4cb4b241c8dd31c91913c0f32 (diff) | |
download | bcm5719-llvm-aaef97a55e4885e95c8528e6dc761a63323d19b3.tar.gz bcm5719-llvm-aaef97a55e4885e95c8528e6dc761a63323d19b3.zip |
PR43278: llvm-reduce: Use temporary file names (and ToolOutputFile) rather than unique ones - to ensure they're cleaned up
This modifies the tool somewhat to only create files when about to run
the "interestingness" test, and delete them immediately after - this
means some more files will be created sometimes (when "double checking"
work - which should probably be fixed/avoided anyway).
This now creates temporary files, rather than only unique ones, and also
uses ToolOutputFile (without ever calling "keep") to ensure the files
are deleted as soon as the interestingness test is run.
llvm-svn: 371696
Diffstat (limited to 'llvm/tools/llvm-reduce/TestRunner.h')
-rw-r--r-- | llvm/tools/llvm-reduce/TestRunner.h | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/llvm/tools/llvm-reduce/TestRunner.h b/llvm/tools/llvm-reduce/TestRunner.h index 4d5b5bb0375..35235e2adeb 100644 --- a/llvm/tools/llvm-reduce/TestRunner.h +++ b/llvm/tools/llvm-reduce/TestRunner.h @@ -24,29 +24,22 @@ namespace llvm { // respective filename. class TestRunner { public: - TestRunner(StringRef TestName, std::vector<std::string> TestArgs, - StringRef ReducedFilepath); + TestRunner(StringRef TestName, std::vector<std::string> TestArgs); /// Runs the interesting-ness test for the specified file /// @returns 0 if test was successful, 1 if otherwise int run(StringRef Filename); - /// Filename to the most reduced testcase - StringRef getReducedFilepath() const { return ReducedFilepath; } /// Directory where tmp files are created StringRef getTmpDir() const { return TmpDirectory; } /// Returns the most reduced version of the original testcase Module *getProgram() const { return Program.get(); } - void setReducedFilepath(SmallString<128> F) { - ReducedFilepath = std::move(F); - } void setProgram(std::unique_ptr<Module> P) { Program = std::move(P); } private: SmallString<128> TestName; std::vector<std::string> TestArgs; - SmallString<128> ReducedFilepath; SmallString<128> TmpDirectory; std::unique_ptr<Module> Program; }; |