support: add a utility function to normalise path separators

Add a utility function to convert the Windows path separator to Unix style path
separators.  This is used by a subsequent change in clang to enable the use of
Windows SDK headers on Linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203611 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Saleem Abdulrasool
2014-03-11 22:05:42 +00:00
parent ff73a2bf86
commit 404a72729b
4 changed files with 63 additions and 0 deletions
+8
View File
@@ -269,6 +269,14 @@ private:
/// platform specific error_code.
error_code make_absolute(SmallVectorImpl<char> &path);
/// @brief Normalize path separators in \a Path
///
/// If the path contains any '\' separators, they are transformed into '/'.
/// This is particularly useful when cross-compiling Windows on Linux, but is
/// safe to invoke on Windows, which accepts both characters as a path
/// separator.
error_code normalize_separators(SmallVectorImpl<char> &Path);
/// @brief Create all the non-existent directories in path.
///
/// @param path Directories to create.