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/lib/Frontend/CompilerInvocation.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 851fd49..e848e50 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -23,7 +23,6 @@ #include "clang/Basic/SourceLocation.h" #include "clang/Basic/TargetOptions.h" #include "clang/Basic/Version.h" -#include "clang/Basic/VirtualFileSystem.h" #include "clang/Basic/Visibility.h" #include "clang/Basic/XRayInstr.h" #include "clang/Config/config.h" @@ -77,6 +76,7 @@ #include "llvm/Support/Process.h" #include "llvm/Support/Regex.h" #include "llvm/Support/VersionTuple.h" +#include "llvm/Support/VirtualFileSystem.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetOptions.h" #include @@ -3245,21 +3245,21 @@ void BuryPointer(const void *Ptr) { GraveYard[Idx] = Ptr; } -IntrusiveRefCntPtr +IntrusiveRefCntPtr createVFSFromCompilerInvocation(const CompilerInvocation &CI, DiagnosticsEngine &Diags) { - return createVFSFromCompilerInvocation(CI, Diags, vfs::getRealFileSystem()); + return createVFSFromCompilerInvocation(CI, Diags, + llvm::vfs::getRealFileSystem()); } -IntrusiveRefCntPtr -createVFSFromCompilerInvocation(const CompilerInvocation &CI, - DiagnosticsEngine &Diags, - IntrusiveRefCntPtr BaseFS) { +IntrusiveRefCntPtr createVFSFromCompilerInvocation( + const CompilerInvocation &CI, DiagnosticsEngine &Diags, + IntrusiveRefCntPtr BaseFS) { if (CI.getHeaderSearchOpts().VFSOverlayFiles.empty()) return BaseFS; - IntrusiveRefCntPtr Overlay( - new vfs::OverlayFileSystem(BaseFS)); + IntrusiveRefCntPtr Overlay( + new llvm::vfs::OverlayFileSystem(BaseFS)); // earlier vfs files are on the bottom for (const auto &File : CI.getHeaderSearchOpts().VFSOverlayFiles) { llvm::ErrorOr> Buffer = @@ -3269,7 +3269,7 @@ createVFSFromCompilerInvocation(const CompilerInvocation &CI, continue; } - IntrusiveRefCntPtr FS = vfs::getVFSFromYAML( + IntrusiveRefCntPtr FS = llvm::vfs::getVFSFromYAML( std::move(Buffer.get()), /*DiagHandler*/ nullptr, File); if (FS) Overlay->pushOverlay(FS); -- cgit v1.1