For PR351:
* removeFile() -> sys::Path::destroyFile()
* remove extraneous toString() calls
* convert local variables representing path names from std::string to
  sys::Path
* Use sys::Path objects with FileRemove instead of std::string
* Use sys::Path methods for construction of path names


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19001 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/bugpoint/OptimizerDriver.cpp b/tools/bugpoint/OptimizerDriver.cpp
index d141bd0..709eff3 100644
--- a/tools/bugpoint/OptimizerDriver.cpp
+++ b/tools/bugpoint/OptimizerDriver.cpp
@@ -143,7 +143,7 @@
   // If we are supposed to delete the bytecode file or if the passes crashed,
   // remove it now.  This may fail if the file was never created, but that's ok.
   if (DeleteOutput || !ExitedOK)
-    removeFile(OutputFilename);
+    sys::Path(OutputFilename).destroyFile();
   
   if (!Quiet) {
     if (ExitedOK)
@@ -194,6 +194,6 @@
               << BytecodeResult << "'!\n";
     exit(1);
   }
-  removeFile(BytecodeResult);  // No longer need the file on disk
+  sys::Path(BytecodeResult).destroyFile();  // No longer need the file on disk
   return Ret;
 }