diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-14 19:38:45 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-14 19:38:45 +0000 |
commit | b0a5c96379e7f6fd25fc7f8b9cdc237a6852d4e4 (patch) | |
tree | 5660a31ed62406c207352fa748f65d0fe05d73e1 /llvm/lib/Support/Windows/PathV2.inc | |
parent | ba0d5424e1d84b8db65b0fa553774ee00ccdc8a1 (diff) | |
download | bcm5719-llvm-b0a5c96379e7f6fd25fc7f8b9cdc237a6852d4e4.tar.gz bcm5719-llvm-b0a5c96379e7f6fd25fc7f8b9cdc237a6852d4e4.zip |
Replace use of PathV1.h in Program.cpp.
llvm-svn: 183996
Diffstat (limited to 'llvm/lib/Support/Windows/PathV2.inc')
-rw-r--r-- | llvm/lib/Support/Windows/PathV2.inc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Support/Windows/PathV2.inc b/llvm/lib/Support/Windows/PathV2.inc index 23f3d14f91f..ea383895f2a 100644 --- a/llvm/lib/Support/Windows/PathV2.inc +++ b/llvm/lib/Support/Windows/PathV2.inc @@ -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 && |