[llvm] r185123 - Don't ask for a mode when we are not keeping the file.

Rafael Espindola rafael.espindola at gmail.com
Thu Jun 27 18:05:47 PDT 2013


Author: rafael
Date: Thu Jun 27 20:05:47 2013
New Revision: 185123

URL: http://llvm.org/viewvc/llvm-project?rev=185123&view=rev
Log:
Don't ask for a mode when we are not keeping the file.

Modified:
    llvm/trunk/include/llvm/Support/FileSystem.h
    llvm/trunk/lib/Support/Path.cpp

Modified: llvm/trunk/include/llvm/Support/FileSystem.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/FileSystem.h?rev=185123&r1=185122&r2=185123&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/FileSystem.h (original)
+++ llvm/trunk/include/llvm/Support/FileSystem.h Thu Jun 27 20:05:47 2013
@@ -573,8 +573,7 @@ error_code unique_file(const Twine &mode
 
 /// @brief Simpler version for clients that don't want an open file.
 error_code unique_file(const Twine &Model, SmallVectorImpl<char> &ResultPath,
-                       bool MakeAbsolute = true,
-                       unsigned Mode = owner_read | owner_write);
+                       bool MakeAbsolute = true);
 
 error_code createUniqueDirectory(const Twine &Prefix,
                                  SmallVectorImpl<char> &ResultPath);

Modified: llvm/trunk/lib/Support/Path.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Path.cpp?rev=185123&r1=185122&r2=185123&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Path.cpp (original)
+++ llvm/trunk/lib/Support/Path.cpp Thu Jun 27 20:05:47 2013
@@ -626,12 +626,12 @@ bool is_relative(const Twine &path) {
 namespace fs {
 
 error_code unique_file(const Twine &Model, SmallVectorImpl<char> &ResultPath,
-                       bool MakeAbsolute, unsigned Mode) {
+                       bool MakeAbsolute) {
   // FIXME: This is really inefficient. unique_path creates a path an tries to
   // open it. We should factor the code so that we just don't create/open the
   // file when we don't need it.
   int FD;
-  error_code Ret = unique_file(Model, FD, ResultPath, MakeAbsolute, Mode);
+  error_code Ret = unique_file(Model, FD, ResultPath, MakeAbsolute, all_read);
   if (Ret)
     return Ret;
 





More information about the llvm-commits mailing list