mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-02 22:02:51 +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:
@@ -143,15 +143,16 @@ TEST(SourceGenTest, UniqueIdentifiers) {
|
||||
|
||||
// Check that the source code doesn't have compiler errors.
|
||||
auto TestCompile(llvm::StringRef source) -> bool {
|
||||
llvm::vfs::InMemoryFileSystem fs;
|
||||
llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> fs =
|
||||
new llvm::vfs::InMemoryFileSystem;
|
||||
InstallPaths installation(
|
||||
InstallPaths::MakeForBazelRunfiles(Testing::GetExePath()));
|
||||
Driver driver(fs, &installation, llvm::outs(), llvm::errs());
|
||||
|
||||
AddPreludeFilesToVfs(installation, &fs);
|
||||
AddPreludeFilesToVfs(installation, fs);
|
||||
|
||||
fs.addFile("test.carbon", /*ModificationTime=*/0,
|
||||
llvm::MemoryBuffer::getMemBuffer(source));
|
||||
fs->addFile("test.carbon", /*ModificationTime=*/0,
|
||||
llvm::MemoryBuffer::getMemBuffer(source));
|
||||
return driver.RunCommand({"compile", "--phase=check", "test.carbon"}).success;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user