summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unix/PathV2.inc
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-14 19:38:45 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-14 19:38:45 +0000
commitb0a5c96379e7f6fd25fc7f8b9cdc237a6852d4e4 (patch)
tree5660a31ed62406c207352fa748f65d0fe05d73e1 /llvm/lib/Support/Unix/PathV2.inc
parentba0d5424e1d84b8db65b0fa553774ee00ccdc8a1 (diff)
downloadbcm5719-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/Unix/PathV2.inc')
-rw-r--r--llvm/lib/Support/Unix/PathV2.inc7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Support/Unix/PathV2.inc b/llvm/lib/Support/Unix/PathV2.inc
index 7e0aead151b..df8841220b5 100644
--- a/llvm/lib/Support/Unix/PathV2.inc
+++ b/llvm/lib/Support/Unix/PathV2.inc
@@ -292,6 +292,13 @@ error_code exists(const Twine &path, bool &result) {
return error_code::success();
}
+bool can_execute(const Twine &Path) {
+ SmallString<128> PathStorage;
+ StringRef P = Path.toNullTerminatedStringRef(PathStorage);
+
+ return ::access(P.begin(), X_OK) != -1;
+}
+
bool equivalent(file_status A, file_status B) {
assert(status_known(A) && status_known(B));
return A.fs_st_dev == B.fs_st_dev &&
OpenPOWER on IntegriCloud