Revert "Remove a use of PathV1.h."
authorRafael Espindola <rafael.espindola@gmail.com>
Mon, 17 Jun 2013 19:54:17 +0000 (19:54 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Mon, 17 Jun 2013 19:54:17 +0000 (19:54 +0000)
This reverts commit r183985.

We were missing the checks for not deleting things like /dev/null.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184111 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/ToolOutputFile.cpp

index 824e0a73d28b0313c3cb3de020b60b08fa963952..af44b4386669cde54398fcf8e13a9e7ca2869294 100644 (file)
@@ -12,7 +12,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Support/ToolOutputFile.h"
-#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/PathV1.h"
 #include "llvm/Support/Signals.h"
 using namespace llvm;
 
@@ -25,10 +25,8 @@ tool_output_file::CleanupInstaller::CleanupInstaller(const char *filename)
 
 tool_output_file::CleanupInstaller::~CleanupInstaller() {
   // Delete the file if the client hasn't told us not to.
-  if (!Keep && Filename != "-") {
-    bool Existed;
-    sys::fs::remove(Filename, Existed);
-  }
+  if (!Keep && Filename != "-")
+    sys::Path(Filename).eraseFromDisk();
 
   // Ok, the file is successfully written and closed, or deleted. There's no
   // further need to clean it up on signals.