mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +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:
@@ -31,9 +31,10 @@ extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data,
|
||||
}
|
||||
|
||||
static constexpr llvm::StringLiteral TestFileName = "test.carbon";
|
||||
llvm::vfs::InMemoryFileSystem fs;
|
||||
llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> fs =
|
||||
new llvm::vfs::InMemoryFileSystem;
|
||||
llvm::StringRef data_ref(reinterpret_cast<const char*>(data), size);
|
||||
CARBON_CHECK(fs.addFile(
|
||||
CARBON_CHECK(fs->addFile(
|
||||
TestFileName, /*ModificationTime=*/0,
|
||||
llvm::MemoryBuffer::getMemBuffer(data_ref, /*BufferName=*/TestFileName,
|
||||
/*RequiresNullTerminator=*/false)));
|
||||
|
||||
Reference in New Issue
Block a user