diff --git a/llvm/include/llvm/Support/Path.h b/llvm/include/llvm/Support/Path.h --- a/llvm/include/llvm/Support/Path.h +++ b/llvm/include/llvm/Support/Path.h @@ -174,6 +174,21 @@ StringRef NewPrefix, Style style = Style::native); +/// Remove redundant leading "./" pieces and consecutive separators. +/// +/// @param path Input path. +/// @result The cleaned-up \a path. +StringRef remove_leading_dotslash(StringRef path, Style style = Style::native); + +/// In-place remove any './' and optionally '../' components from a path. +/// +/// @param path processed path +/// @param remove_dot_dot specify if '../' (except for leading "../") should be +/// removed +/// @result True if path was changed +bool remove_dots(SmallVectorImpl &path, bool remove_dot_dot = false, + Style style = Style::native); + /// Append to path. /// /// @code @@ -499,21 +514,6 @@ /// @result True if the path is relative, false if it is not. bool is_relative(const Twine &path, Style style = Style::native); -/// Remove redundant leading "./" pieces and consecutive separators. -/// -/// @param path Input path. -/// @result The cleaned-up \a path. -StringRef remove_leading_dotslash(StringRef path, Style style = Style::native); - -/// In-place remove any './' and optionally '../' components from a path. -/// -/// @param path processed path -/// @param remove_dot_dot specify if '../' (except for leading "../") should be -/// removed -/// @result True if path was changed -bool remove_dots(SmallVectorImpl &path, bool remove_dot_dot = false, - Style style = Style::native); - } // end namespace path } // end namespace sys } // end namespace llvm