diff options
Diffstat (limited to 'clang-tools-extra/unittests')
8 files changed, 24 insertions, 23 deletions
diff --git a/clang-tools-extra/unittests/change-namespace/ChangeNamespaceTests.cpp b/clang-tools-extra/unittests/change-namespace/ChangeNamespaceTests.cpp index 917f7b02e97..6b1259a36c1 100644 --- a/clang-tools-extra/unittests/change-namespace/ChangeNamespaceTests.cpp +++ b/clang-tools-extra/unittests/change-namespace/ChangeNamespaceTests.cpp @@ -12,7 +12,6 @@ #include "clang/ASTMatchers/ASTMatchFinder.h" #include "clang/Basic/FileManager.h" #include "clang/Basic/FileSystemOptions.h" -#include "clang/Basic/VirtualFileSystem.h" #include "clang/Format/Format.h" #include "clang/Frontend/CompilerInstance.h" #include "clang/Frontend/PCHContainerOperations.h" @@ -21,6 +20,7 @@ #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/MemoryBuffer.h" +#include "llvm/Support/VirtualFileSystem.h" #include "gtest/gtest.h" #include <memory> #include <string> diff --git a/clang-tools-extra/unittests/clang-tidy/ClangTidyTest.h b/clang-tools-extra/unittests/clang-tidy/ClangTidyTest.h index 197c137fe86..2d2675489aa 100644 --- a/clang-tools-extra/unittests/clang-tidy/ClangTidyTest.h +++ b/clang-tools-extra/unittests/clang-tidy/ClangTidyTest.h @@ -99,8 +99,8 @@ runCheckOnCode(StringRef Code, std::vector<ClangTidyError> *Errors = nullptr, Args.push_back(Filename.str()); ast_matchers::MatchFinder Finder; - llvm::IntrusiveRefCntPtr<vfs::InMemoryFileSystem> InMemoryFileSystem( - new vfs::InMemoryFileSystem); + llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> InMemoryFileSystem( + new llvm::vfs::InMemoryFileSystem); llvm::IntrusiveRefCntPtr<FileManager> Files( new FileManager(FileSystemOptions(), InMemoryFileSystem)); diff --git a/clang-tools-extra/unittests/clangd/ClangdTests.cpp b/clang-tools-extra/unittests/clangd/ClangdTests.cpp index 87741dfb094..82824fbdd4d 100644 --- a/clang-tools-extra/unittests/clangd/ClangdTests.cpp +++ b/clang-tools-extra/unittests/clangd/ClangdTests.cpp @@ -264,7 +264,7 @@ int b = a; TEST_F(ClangdVFSTest, PropagatesContexts) { static Key<int> Secret; struct FSProvider : public FileSystemProvider { - IntrusiveRefCntPtr<vfs::FileSystem> getFileSystem() const override { + IntrusiveRefCntPtr<llvm::vfs::FileSystem> getFileSystem() const override { Got = Context::current().getExisting(Secret); return buildTestFS({}); } @@ -973,19 +973,19 @@ TEST(ClangdTests, PreambleVFSStatCache) { ListenStatsFSProvider(llvm::StringMap<unsigned> &CountStats) : CountStats(CountStats) {} - IntrusiveRefCntPtr<vfs::FileSystem> getFileSystem() const override { - class ListenStatVFS : public vfs::ProxyFileSystem { + IntrusiveRefCntPtr<llvm::vfs::FileSystem> getFileSystem() const override { + class ListenStatVFS : public llvm::vfs::ProxyFileSystem { public: - ListenStatVFS(IntrusiveRefCntPtr<vfs::FileSystem> FS, + ListenStatVFS(IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS, llvm::StringMap<unsigned> &CountStats) : ProxyFileSystem(std::move(FS)), CountStats(CountStats) {} - llvm::ErrorOr<std::unique_ptr<vfs::File>> + llvm::ErrorOr<std::unique_ptr<llvm::vfs::File>> openFileForRead(const Twine &Path) override { ++CountStats[llvm::sys::path::filename(Path.str())]; return ProxyFileSystem::openFileForRead(Path); } - llvm::ErrorOr<vfs::Status> status(const Twine &Path) override { + llvm::ErrorOr<llvm::vfs::Status> status(const Twine &Path) override { ++CountStats[llvm::sys::path::filename(Path.str())]; return ProxyFileSystem::status(Path); } diff --git a/clang-tools-extra/unittests/clangd/FSTests.cpp b/clang-tools-extra/unittests/clangd/FSTests.cpp index 64e6f8a0e8d..6c0bfec5c84 100644 --- a/clang-tools-extra/unittests/clangd/FSTests.cpp +++ b/clang-tools-extra/unittests/clangd/FSTests.cpp @@ -35,9 +35,10 @@ TEST(FSTests, PreambleStatusCache) { // Main file is not cached. EXPECT_FALSE(StatCache.lookup(testPath("main")).hasValue()); - vfs::Status S("fake", llvm::sys::fs::UniqueID(0, 0), - std::chrono::system_clock::now(), 0, 0, 1024, - llvm::sys::fs::file_type::regular_file, llvm::sys::fs::all_all); + llvm::vfs::Status S("fake", llvm::sys::fs::UniqueID(0, 0), + std::chrono::system_clock::now(), 0, 0, 1024, + llvm::sys::fs::file_type::regular_file, + llvm::sys::fs::all_all); StatCache.update(*FS, S); auto ConsumeFS = StatCache.getConsumingFS(FS); auto Cached = ConsumeFS->status(testPath("fake")); diff --git a/clang-tools-extra/unittests/clangd/SymbolCollectorTests.cpp b/clang-tools-extra/unittests/clangd/SymbolCollectorTests.cpp index 5b3c58e4cd2..7c18e7e3eac 100644 --- a/clang-tools-extra/unittests/clangd/SymbolCollectorTests.cpp +++ b/clang-tools-extra/unittests/clangd/SymbolCollectorTests.cpp @@ -13,7 +13,6 @@ #include "index/SymbolCollector.h" #include "clang/Basic/FileManager.h" #include "clang/Basic/FileSystemOptions.h" -#include "clang/Basic/VirtualFileSystem.h" #include "clang/Frontend/CompilerInstance.h" #include "clang/Index/IndexingAction.h" #include "clang/Tooling/Tooling.h" @@ -21,6 +20,7 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/MemoryBuffer.h" +#include "llvm/Support/VirtualFileSystem.h" #include "gmock/gmock.h" #include "gtest/gtest.h" @@ -219,7 +219,7 @@ public: class SymbolCollectorTest : public ::testing::Test { public: SymbolCollectorTest() - : InMemoryFileSystem(new vfs::InMemoryFileSystem), + : InMemoryFileSystem(new llvm::vfs::InMemoryFileSystem), TestHeaderName(testPath("symbol.h")), TestFileName(testPath("symbol.cc")) { TestHeaderURI = URI::createFile(TestHeaderName).toString(); @@ -258,7 +258,7 @@ public: } protected: - llvm::IntrusiveRefCntPtr<vfs::InMemoryFileSystem> InMemoryFileSystem; + llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> InMemoryFileSystem; std::string TestHeaderName; std::string TestHeaderURI; std::string TestFileName; diff --git a/clang-tools-extra/unittests/clangd/TestFS.h b/clang-tools-extra/unittests/clangd/TestFS.h index 39c0bb22b0e..56bf8a35591 100644 --- a/clang-tools-extra/unittests/clangd/TestFS.h +++ b/clang-tools-extra/unittests/clangd/TestFS.h @@ -13,23 +13,23 @@ #ifndef LLVM_CLANG_TOOLS_EXTRA_UNITTESTS_CLANGD_TESTFS_H #define LLVM_CLANG_TOOLS_EXTRA_UNITTESTS_CLANGD_TESTFS_H #include "ClangdServer.h" -#include "clang/Basic/VirtualFileSystem.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/Support/Path.h" +#include "llvm/Support/VirtualFileSystem.h" namespace clang { namespace clangd { // Builds a VFS that provides access to the provided files, plus temporary // directories. -llvm::IntrusiveRefCntPtr<vfs::FileSystem> +llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> buildTestFS(llvm::StringMap<std::string> const &Files, llvm::StringMap<time_t> const &Timestamps = {}); // A VFS provider that returns TestFSes containing a provided set of files. class MockFSProvider : public FileSystemProvider { public: - IntrusiveRefCntPtr<vfs::FileSystem> getFileSystem() const override { + IntrusiveRefCntPtr<llvm::vfs::FileSystem> getFileSystem() const override { return buildTestFS(Files); } diff --git a/clang-tools-extra/unittests/include-fixer/IncludeFixerTest.cpp b/clang-tools-extra/unittests/include-fixer/IncludeFixerTest.cpp index 4da14f57a6d..519c0837970 100644 --- a/clang-tools-extra/unittests/include-fixer/IncludeFixerTest.cpp +++ b/clang-tools-extra/unittests/include-fixer/IncludeFixerTest.cpp @@ -24,8 +24,8 @@ using find_all_symbols::SymbolAndSignals; static bool runOnCode(tooling::ToolAction *ToolAction, StringRef Code, StringRef FileName, const std::vector<std::string> &ExtraArgs) { - llvm::IntrusiveRefCntPtr<vfs::InMemoryFileSystem> InMemoryFileSystem( - new vfs::InMemoryFileSystem); + llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> InMemoryFileSystem( + new llvm::vfs::InMemoryFileSystem); llvm::IntrusiveRefCntPtr<FileManager> Files( new FileManager(FileSystemOptions(), InMemoryFileSystem)); // FIXME: Investigate why -fms-compatibility breaks tests. diff --git a/clang-tools-extra/unittests/include-fixer/find-all-symbols/FindAllSymbolsTests.cpp b/clang-tools-extra/unittests/include-fixer/find-all-symbols/FindAllSymbolsTests.cpp index 760a253422e..1ad9e7f0dd7 100644 --- a/clang-tools-extra/unittests/include-fixer/find-all-symbols/FindAllSymbolsTests.cpp +++ b/clang-tools-extra/unittests/include-fixer/find-all-symbols/FindAllSymbolsTests.cpp @@ -14,7 +14,6 @@ #include "clang/ASTMatchers/ASTMatchFinder.h" #include "clang/Basic/FileManager.h" #include "clang/Basic/FileSystemOptions.h" -#include "clang/Basic/VirtualFileSystem.h" #include "clang/Frontend/CompilerInstance.h" #include "clang/Frontend/PCHContainerOperations.h" #include "clang/Tooling/Tooling.h" @@ -22,6 +21,7 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/MemoryBuffer.h" +#include "llvm/Support/VirtualFileSystem.h" #include "gtest/gtest.h" #include <memory> #include <string> @@ -63,8 +63,8 @@ public: int used(const SymbolInfo &Symbol) { return Reporter.used(Symbol); } bool runFindAllSymbols(StringRef HeaderCode, StringRef MainCode) { - llvm::IntrusiveRefCntPtr<vfs::InMemoryFileSystem> InMemoryFileSystem( - new vfs::InMemoryFileSystem); + llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> InMemoryFileSystem( + new llvm::vfs::InMemoryFileSystem); llvm::IntrusiveRefCntPtr<FileManager> Files( new FileManager(FileSystemOptions(), InMemoryFileSystem)); |