summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/PathV2.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-18 17:01:00 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-18 17:01:00 +0000
commit4526b1d410a3d6d5571ddd27e2531aad13ca6093 (patch)
tree33881cc05fe06c141bd993614a9067442d3eb525 /llvm/lib/Support/PathV2.cpp
parenta637fb8ccdecd5b0a1171f262b48d62efe9452bd (diff)
downloadbcm5719-llvm-4526b1d410a3d6d5571ddd27e2531aad13ca6093.tar.gz
bcm5719-llvm-4526b1d410a3d6d5571ddd27e2531aad13ca6093.zip
Add a version of unique_file that return just the file name.
llvm-svn: 184206
Diffstat (limited to 'llvm/lib/Support/PathV2.cpp')
-rw-r--r--llvm/lib/Support/PathV2.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/lib/Support/PathV2.cpp b/llvm/lib/Support/PathV2.cpp
index 05366202559..0e02953c549 100644
--- a/llvm/lib/Support/PathV2.cpp
+++ b/llvm/lib/Support/PathV2.cpp
@@ -18,8 +18,11 @@
#include <cctype>
#include <cstdio>
#include <cstring>
-#ifdef __APPLE__
+
+#if !defined(_MSC_VER) && !defined(__MINGW32__)
#include <unistd.h>
+#else
+#include <io.h>
#endif
namespace {
@@ -622,6 +625,14 @@ bool is_relative(const Twine &path) {
namespace fs {
+error_code unique_file(const Twine &Model, SmallVectorImpl<char> &ResultPath,
+ bool MakeAbsolute, unsigned Mode) {
+ int FD;
+ error_code Ret = unique_file(Model, FD, ResultPath, MakeAbsolute, Mode);
+ close(FD);
+ return Ret;
+}
+
error_code make_absolute(SmallVectorImpl<char> &path) {
StringRef p(path.data(), path.size());
OpenPOWER on IntegriCloud