summaryrefslogtreecommitdiff
path: root/lib/Support/Path.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/Path.cpp')
-rw-r--r--lib/Support/Path.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Support/Path.cpp b/lib/Support/Path.cpp
index 0616d05aff573..4bb035eeccca8 100644
--- a/lib/Support/Path.cpp
+++ b/lib/Support/Path.cpp
@@ -571,6 +571,16 @@ void native(SmallVectorImpl<char> &Path) {
#endif
}
+std::string convert_to_slash(StringRef path) {
+#ifdef LLVM_ON_WIN32
+ std::string s = path.str();
+ std::replace(s.begin(), s.end(), '\\', '/');
+ return s;
+#else
+ return path;
+#endif
+}
+
StringRef filename(StringRef path) {
return *rbegin(path);
}