15#ifndef LLVM_CAS_ONDISKLOGGER_H
16#define LLVM_CAS_ONDISKLOGGER_H
33class OnDiskCASLogger {
41 open(
const Twine &Path,
bool LogAllocations);
63 size_t Before,
size_t After);
65 void *
Region,
size_t Capacity,
68 size_t Size,
size_t AllocSize);
75 bool CheckHash,
bool AllowRecovery,
bool Force,
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Tagged union holding either a T or a Error.
StringRef - Represent a constant reference to a string, i.e.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
LLVM_ABI void logTempFileRemove(StringRef TmpName, std::error_code EC)
LLVM_ABI ~OnDiskCASLogger()
LLVM_ABI void logSubtrieHandleCreate(void *Region, TrieOffset Trie, uint32_t StartBit, uint32_t NumBits)
int64_t TrieOffset
An offset into an OnDiskTrieRawHashMap.
LLVM_ABI void logMappedFileRegionArenaAllocate(void *Region, TrieOffset Off, size_t Size)
LLVM_ABI void logMappedFileRegionArenaResizeFile(StringRef Path, size_t Before, size_t After)
LLVM_ABI void logTempFileKeep(StringRef TmpName, StringRef Name, std::error_code EC)
LLVM_ABI void logUnifiedOnDiskCacheValidateIfNeeded(StringRef Path, uint64_t BootTime, uint64_t ValidationTime, bool CheckHash, bool AllowRecovery, bool Force, std::optional< StringRef > LLVMCas, StringRef ValidationError, bool Skipped, bool Recovered)
LLVM_ABI void logMappedFileRegionArenaCreate(StringRef Path, int FD, void *Region, size_t Capacity, size_t Size)
static LLVM_ABI Expected< std::unique_ptr< OnDiskCASLogger > > open(const Twine &Path, bool LogAllocations)
Create or append to a log file inside the given CAS directory Path.
static LLVM_ABI Expected< std::unique_ptr< OnDiskCASLogger > > openIfEnabled(const Twine &Path)
Create or append to a log file inside the given CAS directory Path if logging is enabled by the envir...
LLVM_ABI void logMappedFileRegionArenaClose(StringRef Path)
LLVM_ABI void logUnifiedOnDiskCacheCollectGarbage(StringRef Path)
LLVM_ABI void logTempFileCreate(StringRef Name)
LLVM_ABI void logMappedFileRegionArenaOom(StringRef Path, size_t Capacity, size_t Size, size_t AllocSize)
LLVM_ABI void logSubtrieHandleCmpXchg(void *Region, TrieOffset Trie, size_t SlotI, TrieOffset Expected, TrieOffset New, TrieOffset Previous)
LLVM_ABI void logHashMappedTrieHandleCreateRecord(void *Region, TrieOffset TrieOffset, ArrayRef< uint8_t > Hash)
A raw_ostream that writes to a file descriptor.
@ Recovered
The data was invalid, but was recovered.
@ Skipped
Validation was skipped, as it was not needed.
This is an optimization pass for GlobalISel generic memory operations.