diff --git a/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp b/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp --- a/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp +++ b/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp @@ -50,12 +50,11 @@ Marshaller::Marshaller(llvm::StringRef RemoteIndexRoot, llvm::StringRef LocalIndexRoot) : Strings(Arena) { - llvm::StringRef PosixSeparator = - llvm::sys::path::get_separator(llvm::sys::path::Style::posix); + llvm::StringRef PosixSeparator = get_separator(llvm::sys::path::Style::posix); if (!RemoteIndexRoot.empty()) { assert(llvm::sys::path::is_absolute(RemoteIndexRoot)); - this->RemoteIndexRoot = llvm::sys::path::convert_to_slash( - RemoteIndexRoot, llvm::sys::path::Style::windows); + this->RemoteIndexRoot = + convert_to_slash(RemoteIndexRoot, llvm::sys::path::Style::windows); llvm::StringRef Path(this->RemoteIndexRoot); if (!is_separator(this->RemoteIndexRoot.back(), llvm::sys::path::Style::posix)) @@ -63,8 +62,8 @@ } if (!LocalIndexRoot.empty()) { assert(llvm::sys::path::is_absolute(LocalIndexRoot)); - this->LocalIndexRoot = llvm::sys::path::convert_to_slash( - LocalIndexRoot, llvm::sys::path::Style::windows); + this->LocalIndexRoot = + convert_to_slash(LocalIndexRoot, llvm::sys::path::Style::windows); llvm::StringRef Path(this->LocalIndexRoot); if (!is_separator(this->LocalIndexRoot.back(), llvm::sys::path::Style::posix)) @@ -218,8 +217,8 @@ for (const auto &Path : From.ProximityPaths) { llvm::SmallString<256> RelativePath = llvm::StringRef(Path); if (llvm::sys::path::replace_path_prefix(RelativePath, LocalIndexRoot, "")) - RPCRequest.add_proximity_paths(llvm::sys::path::convert_to_slash( - RelativePath, llvm::sys::path::Style::windows)); + RPCRequest.add_proximity_paths( + convert_to_slash(RelativePath, llvm::sys::path::Style::windows)); } for (const auto &Type : From.PreferredTypes) RPCRequest.add_preferred_types(Type); @@ -311,7 +310,7 @@ assert(RelativePath == llvm::sys::path::convert_to_slash(RelativePath)); if (RelativePath.empty()) return error("Empty relative path."); - if (llvm::sys::path::is_absolute(RelativePath, llvm::sys::path::Style::posix)) + if (is_absolute(RelativePath, llvm::sys::path::Style::posix)) return error("RelativePath '{0}' is absolute.", RelativePath); llvm::SmallString<256> FullPath = llvm::StringRef(LocalIndexRoot); llvm::sys::path::append(FullPath, RelativePath); @@ -329,14 +328,12 @@ llvm::SmallString<256> Result = ParsedURI->body(); llvm::StringRef Path(Result); // Check for Windows paths (URI=file:///X:/path => Body=/X:/path) - if (llvm::sys::path::is_absolute(Path.substr(1), - llvm::sys::path::Style::windows)) + if (is_absolute(Path.substr(1), llvm::sys::path::Style::windows)) Result = Path.drop_front(); if (!llvm::sys::path::replace_path_prefix(Result, RemoteIndexRoot, "")) return error("File path '{0}' doesn't start with '{1}'.", Result.str(), RemoteIndexRoot); - assert(Result == llvm::sys::path::convert_to_slash( - Result, llvm::sys::path::Style::windows)); + assert(Result == convert_to_slash(Result, llvm::sys::path::Style::windows)); return std::string(Result); }