LLVM: include/llvm/Support/VirtualOutputBackends.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#ifndef LLVM_SUPPORT_VIRTUALOUTPUTBACKENDS_H
23#define LLVM_SUPPORT_VIRTUALOUTPUTBACKENDS_H
24
28
30
31
33
34
35
36
38 IntrusiveRefCntPtr UnderlyingBackend,
39 std::function<bool(StringRef, std::optional)> Filter);
40
41
42
43
44LLVM_ABI IntrusiveRefCntPtr
46 IntrusiveRefCntPtr Backend2);
47
48
49
51 LLVM_ABI void anchor() override;
52
53protected:
54
55
56
57
61 if (Error E = UnderlyingBackend->createFile(Path, Config).moveInto(File))
62 return std::move(E);
63 return File.takeImpl();
64 }
65
67
68public:
70 : UnderlyingBackend(std::move(UnderlyingBackend)) {
71 assert(this->UnderlyingBackend && "Expected non-null backend");
72 }
73
74private:
76};
77
78
80 LLVM_ABI void anchor() override;
81
82protected:
86
89
90public:
91
93
94
96
97
99
100
101
103
104
106 };
107
113
115
116
117
118
120};
121
122}
123
124#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file defines the RefCountedBase, ThreadSafeRefCountedBase, and IntrusiveRefCntPtr classes.
This file contains the declarations of the VirtualOutputBackend class, which can be used to virtualiz...
This file contains the declarations of the OutputConfig class.
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
A smart pointer to a reference-counted object that inherits from RefCountedBase or ThreadSafeRefCount...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
StringRef - Represent a constant reference to a string, i.e.
IntrusiveRefCntPtr< OnDiskOutputBackend > clone() const
Definition VirtualOutputBackends.h:108
LLVM_ABI Expected< std::unique_ptr< OutputFileImpl > > createFileImpl(StringRef Path, std::optional< OutputConfig > Config) override
Create a file for Path.
IntrusiveRefCntPtr< OutputBackend > cloneImpl() const override
Must be thread-safe.
Definition VirtualOutputBackends.h:83
OnDiskOutputBackend()=default
OutputSettings Settings
Settings for this backend.
Definition VirtualOutputBackends.h:119
Error makeAbsolute(SmallVectorImpl< char > &Path) const
Resolve an absolute path.
A virtualized output file that writes to a specific backend.
OutputBackend & getUnderlyingBackend() const
Definition VirtualOutputBackends.h:66
ProxyOutputBackend(IntrusiveRefCntPtr< OutputBackend > UnderlyingBackend)
Definition VirtualOutputBackends.h:69
Expected< std::unique_ptr< OutputFileImpl > > createFileImpl(StringRef Path, std::optional< OutputConfig > Config) override
Create a file for Path.
Definition VirtualOutputBackends.h:59
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,...
LLVM_ABI IntrusiveRefCntPtr< OutputBackend > makeMirroringOutputBackend(IntrusiveRefCntPtr< OutputBackend > Backend1, IntrusiveRefCntPtr< OutputBackend > Backend2)
Create a backend that forwards OutputBackend::createFile() to both Backend1 and Backend2.
IntrusiveRefCntPtr< T > makeIntrusiveRefCnt(Args &&...A)
Factory function for creating intrusive ref counted pointers.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.
On disk output settings.
Definition VirtualOutputBackends.h:95
OutputConfig DefaultConfig
Definition VirtualOutputBackends.h:105
bool RemoveOnSignal
Register output files to be deleted if a signal is received.
Definition VirtualOutputBackends.h:98
bool UseTemporaries
Use temporary files.
Definition VirtualOutputBackends.h:102
Full configuration for an output for use by the OutputBackend.