mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Plumbing for a Virtual File System
Adds the -vfsoverlay frontend option that enables the user to pass VFS overlay YAML files to Swift. These files define a (potentially many-layered) virtual mapping on which we predicate a VFS. Switch all input-based memory buffer reads in the Frontend to the new FileSystem-based approach.
This commit is contained in:
@@ -42,7 +42,7 @@ static FileOrError findModule(ASTContext &ctx, StringRef moduleID,
|
||||
llvm::sys::path::append(inputFilename, moduleID);
|
||||
inputFilename.append(".swift");
|
||||
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> FileBufOrErr =
|
||||
llvm::MemoryBuffer::getFile(inputFilename.str());
|
||||
ctx.SourceMgr.getFileSystem()->getBufferForFile(inputFilename.str());
|
||||
|
||||
// Return if we loaded a file
|
||||
if (FileBufOrErr)
|
||||
|
||||
Reference in New Issue
Block a user