From fc51490baf1d6ad5796d8cb8bb0792de13ce8fce Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Wed, 10 Oct 2018 13:27:25 +0000 Subject: Lift VFS from clang to llvm (NFC) This patch moves the virtual file system form clang to llvm so it can be used by more projects. Concretely the patch: - Moves VirtualFileSystem.{h|cpp} from clang/Basic to llvm/Support. - Moves the corresponding unit test from clang to llvm. - Moves the vfs namespace from clang::vfs to llvm::vfs. - Formats the lines affected by this change, mostly this is the result of the added llvm namespace. RFC on the mailing list: http://lists.llvm.org/pipermail/llvm-dev/2018-October/126657.html Differential revision: https://reviews.llvm.org/D52783 llvm-svn: 344140 --- clang/unittests/AST/ASTImporterTest.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'clang/unittests/AST/ASTImporterTest.cpp') diff --git a/clang/unittests/AST/ASTImporterTest.cpp b/clang/unittests/AST/ASTImporterTest.cpp index 366ff7f0e08..ecfdeb08661 100644 --- a/clang/unittests/AST/ASTImporterTest.cpp +++ b/clang/unittests/AST/ASTImporterTest.cpp @@ -37,10 +37,10 @@ createVirtualFileIfNeeded(ASTUnit *ToAST, StringRef FileName, std::unique_ptr &&Buffer) { assert(ToAST); ASTContext &ToCtx = ToAST->getASTContext(); - auto *OFS = static_cast( + auto *OFS = static_cast( ToCtx.getSourceManager().getFileManager().getVirtualFileSystem().get()); - auto *MFS = - static_cast(OFS->overlays_begin()->get()); + auto *MFS = static_cast( + OFS->overlays_begin()->get()); MFS->addFile(FileName, 0, std::move(Buffer)); } @@ -2482,7 +2482,7 @@ TEST_P(ImportFriendFunctions, ImportFriendChangesLookup) { LookupRes = ToTU->noload_lookup(ToName); EXPECT_EQ(LookupRes.size(), 1u); EXPECT_EQ(DeclCounter().match(ToTU, Pattern), 1u); - + auto *ToFriendF = cast(Import(FromFriendF, Lang_CXX)); LookupRes = ToTU->noload_lookup(ToName); EXPECT_EQ(LookupRes.size(), 1u); @@ -2758,7 +2758,7 @@ TEST_P(ASTImporterTestBase, ImportOfEquivalentRecord) { ToR2 = Import(FromR, Lang_CXX); } - + EXPECT_EQ(ToR1, ToR2); } -- cgit v1.2.3