[llvm-commits] CVS: llvm/lib/Bytecode/Archive/ArchiveWriter.cpp

Reid Spencer reid at x10sys.com
Thu Jul 7 20:09:14 PDT 2005



Changes in directory llvm/lib/Bytecode/Archive:

ArchiveWriter.cpp updated: 1.19 -> 1.20
---
Log message:

Final Changes For PR495: http://llvm.cs.uiuc.edu/PR495 :

This chagne just renames some sys::Path methods to ensure they are not 
misused. The Path documentation now divides methods into two dimensions: 
Path/Disk and accessor/mutator. Path accessors and mutators only operate 
on the Path object itself without making any disk accesses. Disk accessors 
and mutators will also access or modify the file system. Because of the
potentially destructive nature of disk mutators, it was decided that all
such methods should end in the work "Disk" to ensure the user recognizes
that the change will occur on the file system. This patch makes that
change. The method name changes are:

makeReadable        -> makeReadableOnDisk
makeWriteable       -> makeWriteableOnDisk
makeExecutable      -> makeExecutableOnDisk
setStatusInfo       -> setStatusInfoOnDisk
createDirectory     -> createDirectoryOnDisk
createFile          -> createFileOnDisk
createTemporaryFile -> createTemporaryFileOnDisk
destroy             -> eraseFromDisk
rename              -> renamePathOnDisk

These changes pass the Linux Deja Gnu tests.



---
Diffs of the changes:  (+4 -4)

 ArchiveWriter.cpp |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)


Index: llvm/lib/Bytecode/Archive/ArchiveWriter.cpp
diff -u llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.19 llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.20
--- llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.19	Thu Jul  7 18:21:43 2005
+++ llvm/lib/Bytecode/Archive/ArchiveWriter.cpp	Thu Jul  7 22:08:58 2005
@@ -374,7 +374,7 @@
 
   // Create a temporary file to store the archive in
   sys::Path TmpArchive = archPath;
-  TmpArchive.createTemporaryFile();
+  TmpArchive.createTemporaryFileOnDisk();
 
   // Make sure the temporary gets removed if we crash
   sys::RemoveFileOnSignal(TmpArchive);
@@ -450,17 +450,17 @@
       // Close up shop
       FinalFile.close();
       arch.close();
-      TmpArchive.destroy();
+      TmpArchive.eraseFromDisk();
 
     } else {
       // We don't have to insert the symbol table, so just renaming the temp
       // file to the correct name will suffice.
-      TmpArchive.rename(archPath);
+      TmpArchive.renamePathOnDisk(archPath);
     }
   } catch (...) {
     // Make sure we clean up.
     if (TmpArchive.exists())
-      TmpArchive.destroy();
+      TmpArchive.eraseFromDisk();
     throw;
   }
 }






More information about the llvm-commits mailing list