Index: clang/lib/Frontend/CompilerInvocation.cpp =================================================================== --- clang/lib/Frontend/CompilerInvocation.cpp +++ clang/lib/Frontend/CompilerInvocation.cpp @@ -4028,10 +4028,9 @@ llvm::vfs::getRealFileSystem()); } -IntrusiveRefCntPtr -clang::createVFSFromCompilerInvocation( - const CompilerInvocation &CI, DiagnosticsEngine &Diags, - IntrusiveRefCntPtr BaseFS) { +static IntrusiveRefCntPtr +addVFSOverlays(const CompilerInvocation &CI, DiagnosticsEngine &Diags, + IntrusiveRefCntPtr BaseFS) { if (CI.getHeaderSearchOpts().VFSOverlayFiles.empty()) return BaseFS; @@ -4057,3 +4056,12 @@ } return Result; } + +IntrusiveRefCntPtr +clang::createVFSFromCompilerInvocation( + const CompilerInvocation &CI, DiagnosticsEngine &Diags, + IntrusiveRefCntPtr BaseFS) { + IntrusiveRefCntPtr FS = std::move(BaseFS); + FS = addVFSOverlays(CI, Diags, std::move(FS)); + return FS; +}