diff options
Diffstat (limited to 'clang-tools-extra/clangd/FSProvider.cpp')
| -rw-r--r-- | clang-tools-extra/clangd/FSProvider.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/clang-tools-extra/clangd/FSProvider.cpp b/clang-tools-extra/clangd/FSProvider.cpp index 99e7596e83a..794bb82592b 100644 --- a/clang-tools-extra/clangd/FSProvider.cpp +++ b/clang-tools-extra/clangd/FSProvider.cpp @@ -15,8 +15,6 @@ #include "llvm/Support/VirtualFileSystem.h" #include <memory> -using namespace llvm; - namespace clang { namespace clangd { @@ -28,9 +26,9 @@ public: explicit VolatileFileSystem(llvm::IntrusiveRefCntPtr<FileSystem> FS) : ProxyFileSystem(std::move(FS)) {} - llvm::ErrorOr<std::unique_ptr<vfs::File>> - openFileForRead(const Twine &InPath) override { - SmallString<128> Path; + llvm::ErrorOr<std::unique_ptr<llvm::vfs::File>> + openFileForRead(const llvm::Twine &InPath) override { + llvm::SmallString<128> Path; InPath.toVector(Path); auto File = getUnderlyingFS().openFileForRead(Path); @@ -38,28 +36,30 @@ public: return File; // Try to guess preamble files, they can be memory-mapped even on Windows as // clangd has exclusive access to those. - StringRef FileName = llvm::sys::path::filename(Path); + llvm::StringRef FileName = llvm::sys::path::filename(Path); if (FileName.startswith("preamble-") && FileName.endswith(".pch")) return File; return std::unique_ptr<VolatileFile>(new VolatileFile(std::move(*File))); } private: - class VolatileFile : public vfs::File { + class VolatileFile : public llvm::vfs::File { public: - VolatileFile(std::unique_ptr<vfs::File> Wrapped) + VolatileFile(std::unique_ptr<llvm::vfs::File> Wrapped) : Wrapped(std::move(Wrapped)) { assert(this->Wrapped); } virtual llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> - getBuffer(const Twine &Name, int64_t FileSize, bool RequiresNullTerminator, - bool /*IsVolatile*/) override { + getBuffer(const llvm::Twine &Name, int64_t FileSize, + bool RequiresNullTerminator, bool /*IsVolatile*/) override { return Wrapped->getBuffer(Name, FileSize, RequiresNullTerminator, /*IsVolatile=*/true); } - llvm::ErrorOr<vfs::Status> status() override { return Wrapped->status(); } + llvm::ErrorOr<llvm::vfs::Status> status() override { + return Wrapped->status(); + } llvm::ErrorOr<std::string> getName() override { return Wrapped->getName(); } std::error_code close() override { return Wrapped->close(); } @@ -77,7 +77,7 @@ clang::clangd::RealFileSystemProvider::getFileSystem() const { #ifdef _WIN32 return new VolatileFileSystem(vfs::getRealFileSystem()); #else - return vfs::getRealFileSystem(); + return llvm::vfs::getRealFileSystem(); #endif } } // namespace clangd |

