[llvm-commits] CVS: llvm/include/llvm/Support/FileUtilities.h

Reid Spencer reid at x10sys.com
Thu Dec 16 15:00:16 PST 2004



Changes in directory llvm/include/llvm/Support:

FileUtilities.h updated: 1.25 -> 1.26
---
Log message:

For PR351: http://llvm.cs.uiuc.edu/PR351 :
* Remove the "removeFile" function, now implemented by the 
  sys::Path::destroyFile method.
* Make the FileRemove work with a sys::Path instead of a std::string


---
Diffs of the changes:  (+5 -8)

Index: llvm/include/llvm/Support/FileUtilities.h
diff -u llvm/include/llvm/Support/FileUtilities.h:1.25 llvm/include/llvm/Support/FileUtilities.h:1.26
--- llvm/include/llvm/Support/FileUtilities.h:1.25	Tue Dec 14 19:46:54 2004
+++ llvm/include/llvm/Support/FileUtilities.h	Thu Dec 16 17:00:05 2004
@@ -15,7 +15,7 @@
 #ifndef LLVM_SUPPORT_FILEUTILITIES_H
 #define LLVM_SUPPORT_FILEUTILITIES_H
 
-#include <string>
+#include "llvm/System/Path.h"
 
 namespace llvm {
 
@@ -34,10 +34,6 @@
 ///
 void MoveFileOverIfUpdated(const std::string &New, const std::string &Old);
  
-/// removeFile - Delete the specified file.
-///
-void removeFile(const std::string &Filename);
-
 /// FDHandle - Simple handle class to make sure a file descriptor gets closed
 /// when the object is destroyed.  This handle acts similarly to an
 /// std::auto_ptr, in that the copy constructor and assignment operators
@@ -81,14 +77,15 @@
   /// specified (if deleteIt is true).
   ///
   class FileRemover {
-    std::string Filename;
+    sys::Path Filename;
     bool DeleteIt;
   public:
-    FileRemover(const std::string &filename, bool deleteIt = true)
+    FileRemover(const sys::Path &filename, bool deleteIt = true)
       : Filename(filename), DeleteIt(deleteIt) {}
     
     ~FileRemover() {
-      if (DeleteIt) removeFile(Filename);
+      if (DeleteIt) 
+        Filename.destroyFile();
     }
 
     /// releaseFile - Take ownership of the file away from the FileRemover so it






More information about the llvm-commits mailing list