Misc cleanups to the FileSytem api.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 11 Sep 2014 20:30:02 +0000 (20:30 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 11 Sep 2014 20:30:02 +0000 (20:30 +0000)
commit8d230cd536cfc00cc58e749f6e9cf58dd138b0bb
tree4e14385aeb1c8be53bb7feb1fd2477af85a03258
parentd4604dca9413d44feaa9e6f067b64b7dc9ad80f0
Misc cleanups to the FileSytem api.

The main difference is the removal of

std::error_code exists(const Twine &path, bool &result);

It was an horribly redundant interface since a file not existing is also a valid
error_code. Now we have an access function that returns just an error_code. This
is the only function that has to be implemented for Unix and Windows. The
functions can_write, exists and can_execute an now just wrappers.

One still has to be very careful using these function to avoid introducing
race conditions (Time of check to time of use).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217625 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/FileSystem.h
lib/Support/LockFileManager.cpp
lib/Support/Path.cpp
lib/Support/Unix/Path.inc
lib/Support/Windows/Path.inc
unittests/Support/FileOutputBufferTest.cpp
unittests/Support/Path.cpp