delete file portably
authorDuraid Madina <duraid@octopus.com.au>
Fri, 30 Dec 2005 02:47:21 +0000 (02:47 +0000)
committerDuraid Madina <duraid@octopus.com.au>
Fri, 30 Dec 2005 02:47:21 +0000 (02:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25048 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llc/llc.cpp

index d009fd0735830b419beaa0c9ab143e37233611c5..3880348da1740b3692f9b80a0617b20db0e6b6c5 100644 (file)
@@ -24,6 +24,7 @@
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/PluginLoader.h"
 #include "llvm/Support/PassNameParser.h"
+#include "llvm/Support/FileUtilities.h"
 #include "llvm/Analysis/Verifier.h"
 #include "llvm/System/Signals.h"
 #include "llvm/Config/config.h"
@@ -244,7 +245,7 @@ int main(int argc, char **argv) {
                 << "' does not support generation of this file type!\n";
       if (Out != &std::cout) delete Out;
       // And the Out file is empty and useless, so remove it now.
-      std::remove(OutputFilename.c_str());
+      sys::Path(OutputFilename).eraseFromDisk();
       return 1;
     } else {
       // Run our queue of passes all at once now, efficiently.