LLVM 22.0.0git
|
Interface for virtualized outputs. More...
#include "llvm/Support/VirtualOutputBackend.h"
Public Member Functions | |
IntrusiveRefCntPtr< OutputBackend > | clone () const |
Get a backend that points to the same destination as this one but that has independent settings. | |
Expected< OutputFile > | createFile (const Twine &Path, std::optional< OutputConfig > Config=std::nullopt) |
Create a file. | |
virtual | ~OutputBackend ()=default |
Public Member Functions inherited from llvm::RefCountedBase< OutputBackend > | |
unsigned | UseCount () const |
void | Retain () const |
void | Release () const |
Protected Member Functions | |
virtual IntrusiveRefCntPtr< OutputBackend > | cloneImpl () const =0 |
Must be thread-safe. | |
virtual Expected< std::unique_ptr< OutputFileImpl > > | createFileImpl (StringRef Path, std::optional< OutputConfig > Config)=0 |
Create a file for Path . | |
OutputBackend ()=default | |
Protected Member Functions inherited from llvm::RefCountedBase< OutputBackend > | |
RefCountedBase ()=default | |
RefCountedBase & | operator= (const RefCountedBase &)=delete |
~RefCountedBase () |
Interface for virtualized outputs.
If virtual functions are added here, also add them to ProxyOutputBackend.
Definition at line 34 of file VirtualOutputBackend.h.
|
protecteddefault |
Referenced by llvm::vfs::ProxyOutputBackend::getUnderlyingBackend().
|
virtualdefault |
|
inline |
Get a backend that points to the same destination as this one but that has independent settings.
Not thread-safe, but all operations are thread-safe when performed on separate clones of the same backend.
Definition at line 43 of file VirtualOutputBackend.h.
References cloneImpl().
|
protectedpure virtual |
Must be thread-safe.
Virtual function has a different name than clone() so that implementations can override the return value.
Implemented in llvm::vfs::HashingOutputBackend< HasherT >, and llvm::vfs::OnDiskOutputBackend.
Referenced by clone().
Expected< OutputFile > OutputBackend::createFile | ( | const Twine & | Path, |
std::optional< OutputConfig > | Config = std::nullopt ) |
Create a file.
If Config
is std::nullopt
, uses the backend's default OutputConfig (may match OutputConfig::OutputConfig(), or may have been customized).
Thread-safe.
Definition at line 24 of file VirtualOutputBackend.cpp.
References assert(), createFileImpl(), and llvm::make_error().
|
protectedpure virtual |
Create a file for Path
.
Must be thread-safe.
Config
is valid or std::nullopt. Implemented in llvm::vfs::HashingOutputBackend< HasherT >, llvm::vfs::OnDiskOutputBackend, and llvm::vfs::ProxyOutputBackend.
Referenced by createFile().