LLVM: llvm::vfs Namespace Reference (original) (raw)

Classes
class directory_entry
A member of a directory, yielded by a directory_iterator. More...
class directory_iterator
An input iterator over the entries in a virtual path, similar to llvm::sys::fs::directory_iterator. More...
class File
Represents an open file. More...
class FileSystem
The virtual file system interface. More...
class HashingOutputBackend
An output backend that only generates the hash for outputs. More...
class HashingOutputFile
HashingOutputFile. More...
class HashingStream
raw_pwrite_stream that writes to a hasher. More...
class InMemoryFileSystem
An in-memory file system. More...
class NullOutputFileImpl
class OnDiskOutputBackend
An output backend that creates files on disk, wrapping APIs in sys::fs. More...
class OutputBackend
Interface for virtualized outputs. More...
struct OutputConfig
Full configuration for an output for use by the OutputBackend. More...
class OutputConfigError
Error related to an OutputConfig for an OutputFile. More...
class OutputError
Error related to an OutputFile. More...
class OutputFile
A virtualized output file that writes to a specific backend. More...
class OutputFileImpl
class OverlayFileSystem
A file system that allows overlaying one AbstractFileSystem on top of another. More...
class ProxyFileSystem
By default, this delegates all calls to the underlying file system. More...
class ProxyOutputBackend
A helper class for proxying another backend, with the default implementation to forward to the underlying backend. More...
class recursive_directory_iterator
An input iterator over the recursive contents of a virtual path, similar to llvm::sys::fs::recursive_directory_iterator. More...
class RedirectingFileSystem
A virtual file system parsed from a YAML file. More...
class RedirectingFileSystemParser
A helper class to hold the common YAML parsing state. More...
class RedirectingFSDirIterImpl
Directory iterator implementation for RedirectingFileSystem's directory entries. More...
class Status
The result of a status operation. More...
class TempFileOutputError
Error related to a temporary file for an OutputFile. More...
class TracingFileSystem
File system that tracks the number of calls to the underlying file system. More...
struct YAMLVFSEntry
class YAMLVFSWriter
Enumerations
enum class OutputErrorCode { not_closed = 1 , invalid_config, already_closed, has_open_proxy }
Functions
LLVM_ABI IntrusiveRefCntPtr< FileSystem > getRealFileSystem ()
Gets an vfs::FileSystem for the 'real' file system, as seen by the operating system.
LLVM_ABI std::unique_ptr< FileSystem > createPhysicalFileSystem ()
Create an vfs::FileSystem for the 'real' file system, as seen by the operating system.
LLVM_ABI llvm::sys::fs::UniqueID getNextVirtualUniqueID ()
Get a globally unique ID for a virtual file or directory.
LLVM_ABI std::unique_ptr< FileSystem > getVFSFromYAML (std::unique_ptr< llvm::MemoryBuffer > Buffer, llvm::SourceMgr::DiagHandlerTy DiagHandler, StringRef YAMLFilePath, void *DiagContext=nullptr, IntrusiveRefCntPtr< FileSystem > ExternalFS=getRealFileSystem())
Gets a FileSystem for a virtual file system described in YAML format.
LLVM_ABI void collectVFSEntries (RedirectingFileSystem &VFS, SmallVectorImpl< YAMLVFSEntry > &CollectedEntries)
Collect all pairs of <virtual path, real path> entries from the VFS.
LLVM_ABI IntrusiveRefCntPtr< OutputBackend > makeNullOutputBackend ()
Create a backend that ignores all output.
LLVM_ABI IntrusiveRefCntPtr< OutputBackend > makeFilteringOutputBackend (IntrusiveRefCntPtr< OutputBackend > UnderlyingBackend, std::function< bool(StringRef, std::optional< OutputConfig >)> Filter)
Make a backend where OutputBackend::createFile() forwards to UnderlyingBackend when Filter is true, and otherwise returns a NullOutput.
LLVM_ABI IntrusiveRefCntPtr< OutputBackend > makeMirroringOutputBackend (IntrusiveRefCntPtr< OutputBackend > Backend1, IntrusiveRefCntPtr< OutputBackend > Backend2)
Create a backend that forwards OutputBackend::createFile() to both Backend1 and Backend2.
const std::error_category & output_category ()
std::error_code make_error_code (OutputErrorCode EV)
Error convertToOutputError (const Twine &OutputPath, std::error_code EC)
Return Error::success() or use OutputPath to create an OutputError, depending on EC.
Error convertToTempFileOutputError (const Twine &TempPath, const Twine &OutputPath, std::error_code EC)
Return Error::success() or use TempPath and OutputPath to create a TempFileOutputError, depending on EC.
void consumeDiscardOnDestroy (OutputFile &File)
Update File to silently discard itself if it's still open when it's destroyed.
Expected< OutputFile > consumeDiscardOnDestroy (Expected< OutputFile > File)
Update File to silently discard itself if it's still open when it's destroyed.
static sys::fs::UniqueID getUniqueID (hash_code Hash)
static sys::fs::UniqueID getFileID (sys::fs::UniqueID Parent, llvm::StringRef Name, llvm::StringRef Contents)
static sys::fs::UniqueID getDirectoryID (sys::fs::UniqueID Parent, llvm::StringRef Name)

OutputErrorCode

Enumerator
not_closed
invalid_config
already_closed
has_open_proxy

Definition at line 24 of file VirtualOutputError.h.

collectVFSEntries()

consumeDiscardOnDestroy() [1/2]

consumeDiscardOnDestroy() [2/2]

void llvm::vfs::consumeDiscardOnDestroy ( OutputFile & File) inline

convertToOutputError()

Error llvm::vfs::convertToOutputError ( const Twine & OutputPath, std::error_code EC ) inline

convertToTempFileOutputError()

Error llvm::vfs::convertToTempFileOutputError ( const Twine & TempPath, const Twine & OutputPath, std::error_code EC ) inline

createPhysicalFileSystem()

std::unique_ptr< FileSystem > llvm::vfs::createPhysicalFileSystem ( )

Create an [vfs::FileSystem](classllvm%5F1%5F1vfs%5F1%5F1FileSystem.html "The virtual file system interface.") for the 'real' file system, as seen by the operating system.

It has its own working directory, independent of (but initially equal to) that of the process.

Definition at line 405 of file VirtualFileSystem.cpp.

getDirectoryID()

getFileID()

getNextVirtualUniqueID()

UniqueID llvm::vfs::getNextVirtualUniqueID ( )

getRealFileSystem()

Gets an [vfs::FileSystem](classllvm%5F1%5F1vfs%5F1%5F1FileSystem.html "The virtual file system interface.") for the 'real' file system, as seen by the operating system.

The working directory is linked to the process's working directory. (This is usually thread-hostile).

Definition at line 399 of file VirtualFileSystem.cpp.

References llvm::makeIntrusiveRefCnt().

Referenced by llvm::OverlapStats::accumulateCounts(), llvm::FileCollectorBase::addDirectory(), llvm::DataFlowSanitizerPass::DataFlowSanitizerPass(), llvm::AsmPrinter::doInitialization(), llvm::GCOVProfilerPass::GCOVProfilerPass(), llvm::CodeGenData::getInstance(), llvm::MemProfUsePass::MemProfUsePass(), llvm::MIRProfileLoaderPass::MIRProfileLoaderPass(), llvm::PGOInstrumentationUse::PGOInstrumentationUse(), llvm::SampleProfileLoaderPass::run(), and llvm::TableGenMain().

getUniqueID()

getVFSFromYAML()

make_error_code()

std::error_code llvm::vfs::make_error_code ( OutputErrorCode EV) inline

makeFilteringOutputBackend()

makeMirroringOutputBackend()

Create a backend that forwards OutputBackend::createFile() to both Backend1 and Backend2.

Writing to such backend will create identical outputs using two different backends.

Definition at line 81 of file VirtualOutputBackends.cpp.

References assert(), llvm::consumeError(), llvm::raw_ostream::enable_colors(), llvm::isa(), llvm::joinErrors(), llvm::makeIntrusiveRefCnt(), llvm::Offset, llvm::vfs::ProxyOutputBackend::ProxyOutputBackend(), llvm::Release, Retain, Size, and llvm::raw_ostream::write().

makeNullOutputBackend()

output_category()

const std::error_category & llvm::vfs::output_category ( )