diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-07-17 14:58:25 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-07-17 14:58:25 +0000 |
commit | a0d9b6b69322b27fae1c646271b5d4cc44a7bce5 (patch) | |
tree | b9800e9a52d1c9eb5727d2db575463f25071a81c /llvm/lib/Support/Path.cpp | |
parent | ec7cd269680336be3eb0a99e1752bba05eb07d38 (diff) | |
download | bcm5719-llvm-a0d9b6b69322b27fae1c646271b5d4cc44a7bce5.tar.gz bcm5719-llvm-a0d9b6b69322b27fae1c646271b5d4cc44a7bce5.zip |
Split openFileForRead into Windows and Unix versions.
This has some advantages:
* Lets us use native, utf16 windows functions.
* Easy to produce good errors on windows about trying to use a
directory when we want a file.
* Simplifies the unix version a bit.
llvm-svn: 186511
Diffstat (limited to 'llvm/lib/Support/Path.cpp')
-rw-r--r-- | llvm/lib/Support/Path.cpp | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp index 0fb7666aeba..171ccc3970e 100644 --- a/llvm/lib/Support/Path.cpp +++ b/llvm/lib/Support/Path.cpp @@ -722,21 +722,6 @@ error_code openFileForWrite(const Twine &Name, int &ResultFD, return error_code::success(); } -error_code openFileForRead(const Twine &Name, int &ResultFD) { - int OpenFlags = O_RDONLY; -#ifdef O_BINARY - OpenFlags |= O_BINARY; // Open input file in binary mode on win32. -#endif - - SmallString<128> Storage; - StringRef P = Name.toNullTerminatedStringRef(Storage); - while ((ResultFD = open(P.begin(), OpenFlags)) < 0) { - if (errno != EINTR) - return error_code(errno, system_category()); - } - return error_code::success(); -} - error_code make_absolute(SmallVectorImpl<char> &path) { StringRef p(path.data(), path.size()); |