From b44b9a736559154bd4cd0feb91709b11774537ec Mon Sep 17 00:00:00 2001 From: Bert Maher Date: Wed, 7 Nov 2018 21:21:20 -0800 Subject: [PATCH] [easy] Clean up temporary files --- lib/Graph/Graph.cpp | 2 ++ tests/unittests/quantizationTest.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Graph/Graph.cpp b/lib/Graph/Graph.cpp index 022e5cfd4c..cdc5846448 100644 --- a/lib/Graph/Graph.cpp +++ b/lib/Graph/Graph.cpp @@ -250,6 +250,7 @@ void Module::dumpDAG() { llvm::SmallString<64> dotPath; llvm::sys::fs::createTemporaryFile("dotty_graph_dump", "dot", dotPath); dumpDAG(dotPath); + llvm::sys::fs::remove(dotPath); } void Module::dumpDAG(llvm::StringRef dotFilename) { @@ -2177,6 +2178,7 @@ void Function::dumpDAG() { llvm::SmallString<64> dotPath; llvm::sys::fs::createTemporaryFile("dotty_graph_dump", "dot", dotPath); dumpDAG(dotPath); + llvm::sys::fs::remove(dotPath); } void Function::dumpDAG(llvm::StringRef dotFilename) { diff --git a/tests/unittests/quantizationTest.cpp b/tests/unittests/quantizationTest.cpp index 6b41fa5d08..837599643f 100644 --- a/tests/unittests/quantizationTest.cpp +++ b/tests/unittests/quantizationTest.cpp @@ -57,7 +57,7 @@ void testSerialization(const std::vector &expected) { serializeToYaml(filePath, expected); std::vector deserialized = deserializeFromYaml(filePath); - + llvm::sys::fs::remove(filePath); EXPECT_EQ(expected, deserialized); }