Propagate llvm::vfs::FileSystem from driver_env to Clang (#4537)

As discussed in #4530 . This required switching to using
`llvm::IntrusiveRefCntPtr` in a number of places.

---------

Co-authored-by: Josh L <josh11b@users.noreply.github.com>
This commit is contained in:
josh11b
2024-11-18 18:24:19 +00:00
committed by GitHub
co-authored by Josh L
parent 825714f06b
commit 47bfa375af
23 changed files with 80 additions and 56 deletions
+4 -3
View File
@@ -34,11 +34,12 @@ class ToolchainFileTest : public FileTestBase {
}
auto Run(const llvm::SmallVector<llvm::StringRef>& test_args,
llvm::vfs::InMemoryFileSystem& fs, llvm::raw_pwrite_stream& stdout,
llvm::raw_pwrite_stream& stderr) -> ErrorOr<RunResult> override {
llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem>& fs,
llvm::raw_pwrite_stream& stdout, llvm::raw_pwrite_stream& stderr)
-> ErrorOr<RunResult> override {
CARBON_ASSIGN_OR_RETURN(auto prelude, installation_.ReadPreludeManifest());
for (const auto& file : prelude) {
CARBON_RETURN_IF_ERROR(AddFile(fs, file));
CARBON_RETURN_IF_ERROR(AddFile(*fs, file));
}
Driver driver(fs, &installation_, stdout, stderr);