support: add a utility function to normalise path separators
[oota-llvm.git] / include / llvm / Support / FileSystem.h
index 906f37f7c189ea830262a35c9cdce017fa26aa29..c5c841575331b9de145f3231660d9475586588b5 100644 (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.