dexonsmith created this revision. dexonsmith added reviewers: JDevlieghere, jansvoboda11, akyrtzi. Herald added a subscriber: ributzka. dexonsmith requested review of this revision.
This is a prep patch to reduce noise in a follow-up, which will add another layer. https://reviews.llvm.org/D91368 Files: clang/lib/Frontend/CompilerInvocation.cpp Index: clang/lib/Frontend/CompilerInvocation.cpp =================================================================== --- clang/lib/Frontend/CompilerInvocation.cpp +++ clang/lib/Frontend/CompilerInvocation.cpp @@ -4028,10 +4028,9 @@ llvm::vfs::getRealFileSystem()); } -IntrusiveRefCntPtr<llvm::vfs::FileSystem> -clang::createVFSFromCompilerInvocation( - const CompilerInvocation &CI, DiagnosticsEngine &Diags, - IntrusiveRefCntPtr<llvm::vfs::FileSystem> BaseFS) { +static IntrusiveRefCntPtr<llvm::vfs::FileSystem> +addVFSOverlays(const CompilerInvocation &CI, DiagnosticsEngine &Diags, + IntrusiveRefCntPtr<llvm::vfs::FileSystem> BaseFS) { if (CI.getHeaderSearchOpts().VFSOverlayFiles.empty()) return BaseFS; @@ -4057,3 +4056,12 @@ } return Result; } + +IntrusiveRefCntPtr<llvm::vfs::FileSystem> +clang::createVFSFromCompilerInvocation( + const CompilerInvocation &CI, DiagnosticsEngine &Diags, + IntrusiveRefCntPtr<llvm::vfs::FileSystem> BaseFS) { + IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS = std::move(BaseFS); + FS = addVFSOverlays(CI, Diags, std::move(FS)); + return FS; +}
Index: clang/lib/Frontend/CompilerInvocation.cpp =================================================================== --- clang/lib/Frontend/CompilerInvocation.cpp +++ clang/lib/Frontend/CompilerInvocation.cpp @@ -4028,10 +4028,9 @@ llvm::vfs::getRealFileSystem()); } -IntrusiveRefCntPtr<llvm::vfs::FileSystem> -clang::createVFSFromCompilerInvocation( - const CompilerInvocation &CI, DiagnosticsEngine &Diags, - IntrusiveRefCntPtr<llvm::vfs::FileSystem> BaseFS) { +static IntrusiveRefCntPtr<llvm::vfs::FileSystem> +addVFSOverlays(const CompilerInvocation &CI, DiagnosticsEngine &Diags, + IntrusiveRefCntPtr<llvm::vfs::FileSystem> BaseFS) { if (CI.getHeaderSearchOpts().VFSOverlayFiles.empty()) return BaseFS; @@ -4057,3 +4056,12 @@ } return Result; } + +IntrusiveRefCntPtr<llvm::vfs::FileSystem> +clang::createVFSFromCompilerInvocation( + const CompilerInvocation &CI, DiagnosticsEngine &Diags, + IntrusiveRefCntPtr<llvm::vfs::FileSystem> BaseFS) { + IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS = std::move(BaseFS); + FS = addVFSOverlays(CI, Diags, std::move(FS)); + return FS; +}
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits