mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 18:21:16 +01:00
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:
@@ -28,8 +28,9 @@ class ExplorerFileTest : 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 {
|
||||
// Add the prelude.
|
||||
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> prelude =
|
||||
llvm::MemoryBuffer::getFile("explorer/data/prelude.carbon");
|
||||
@@ -41,7 +42,8 @@ class ExplorerFileTest : public FileTestBase {
|
||||
// here.
|
||||
static constexpr llvm::StringLiteral PreludePath =
|
||||
"/explorer/data/prelude.carbon";
|
||||
if (!fs.addFile(PreludePath, /*ModificationTime=*/0, std::move(*prelude))) {
|
||||
if (!fs->addFile(PreludePath, /*ModificationTime=*/0,
|
||||
std::move(*prelude))) {
|
||||
return ErrorBuilder() << "Duplicate prelude.carbon";
|
||||
}
|
||||
|
||||
@@ -52,7 +54,7 @@ class ExplorerFileTest : public FileTestBase {
|
||||
|
||||
int exit_code = ExplorerMain(
|
||||
args.size(), args.data(), /*install_path=*/"", PreludePath, stdout,
|
||||
stderr, check_trace_output() ? stdout : trace_stream_, fs);
|
||||
stderr, check_trace_output() ? stdout : trace_stream_, *fs);
|
||||
|
||||
return {{.success = exit_code == EXIT_SUCCESS}};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user