Replace use of PathV1.h in Program.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183996 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2013-06-14 19:38:45 +00:00
parent 4ebf543b93
commit fcba9c56a2
6 changed files with 69 additions and 75 deletions

View File

@@ -362,6 +362,17 @@ error_code exists(const Twine &path, bool &result) {
return error_code::success();
}
bool can_execute(const Twine &Path) {
SmallString<128> PathStorage;
SmallVector<wchar_t, 128> PathUtf16;
if (UTF8ToUTF16(Path.toStringRef(PathStorage), PathUtf16))
return false;
DWORD Attr = ::GetFileAttributesW(PathUtf16.begin());
return Attr != INVALID_FILE_ATTRIBUTES;
}
bool equivalent(file_status A, file_status B) {
assert(status_known(A) && status_known(B));
return A.FileIndexHigh == B.FileIndexHigh &&