Go to the documentation of this file.
15 #ifndef LLVM_SUPPORT_CACHING_H
16 #define LLVM_SUPPORT_CACHING_H
31 std::string OSPath =
"")
33 std::unique_ptr<raw_pwrite_stream>
OS;
42 std::function<Expected<std::unique_ptr<CachedFileStream>>(
unsigned Task)>;
56 std::function<Expected<AddStreamFn>(
unsigned Task,
StringRef Key)>;
71 Twine CacheNameRef,
Twine TempFilePrefixRef,
Twine CacheDirectoryPathRef,
72 AddBufferFn AddBuffer = [](
size_t Task, std::unique_ptr<MemoryBuffer> MB) {
std::function< Expected< AddStreamFn >(unsigned Task, StringRef Key)> FileCache
This is the type of a file cache.
This is an optimization pass for GlobalISel generic memory operations.
std::unique_ptr< raw_pwrite_stream > OS
This class wraps an output stream for a file.
std::function< Expected< std::unique_ptr< CachedFileStream > >(unsigned Task)> AddStreamFn
This type defines the callback to add a file that is generated on the fly.
std::function< void(unsigned Task, std::unique_ptr< MemoryBuffer > MB)> AddBufferFn
This type defines the callback to add a pre-existing file (e.g.
Tagged union holding either a T or a Error.
CachedFileStream(std::unique_ptr< raw_pwrite_stream > OS, std::string OSPath="")
std::string ObjectPathName
Expected< FileCache > localCache(Twine CacheNameRef, Twine TempFilePrefixRef, Twine CacheDirectoryPathRef, AddBufferFn AddBuffer=[](size_t Task, std::unique_ptr< MemoryBuffer > MB) { })
Create a local file system cache which uses the given cache name, temporary file prefix,...
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
virtual ~CachedFileStream()=default
print Print MemDeps of function
StringRef - Represent a constant reference to a string, i.e.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...