38 "expected value size of " +
itostr(ValueSize) +
41 auto ActionP = Cache.insertLazy(
48 return ActionP.takeError();
49 return (*ActionP)->Data;
70 constexpr uint64_t MB = 1024ull * 1024ull;
71 constexpr uint64_t GB = 1024ull * 1024ull * 1024ull;
76 return CustomSize.takeError();
78 MaxFileSize = **CustomSize;
83 "llvm.actioncache[" + HashName +
"->" +
ValueName +
"]",
85 ValueSize, MaxFileSize, MB)
89 return std::unique_ptr<OnDiskKeyValueDB>(
90 new OnDiskKeyValueDB(ValueSize, std::move(*
ActionCache)));
94 return Cache.validate(
97 auto formatError = [&](
Twine Msg) {
100 "bad cache value at 0x" +
105 if (
Record.Data.size() != ValueSize)
106 return formatError(
"wrong cache value size");
108 return formatError(
"wrong cache value alignment");
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
#define LLVM_UNLIKELY(EXPR)
static constexpr StringLiteral ActionCacheFile
This declares OnDiskKeyValueDB, a key value storage database of fixed size key and value.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
StringRef - Represent a constant reference to a string, i.e.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
LLVM Value Representation.
A cache from a key (that describes an action) to the result of performing that action.
FileOffset is a wrapper around uint64_t to represent the offset of data from the beginning of the fil...
static Expected< OnDiskTrieRawHashMap > create(const Twine &Path, const Twine &TrieName, size_t NumHashBits, uint64_t DataSize, uint64_t MaxFileSize, std::optional< uint64_t > NewFileInitialSize, std::optional< size_t > NewTableNumRootBits=std::nullopt, std::optional< size_t > NewTableNumSubtrieBits=std::nullopt)
Gets or creates a file at Path with a hash-mapped trie named TrieName.
Expected< ArrayRef< char > > put(ArrayRef< uint8_t > Key, ArrayRef< char > Value)
Associate a value with a key.
Expected< std::optional< ArrayRef< char > > > get(ArrayRef< uint8_t > Key)
static Expected< std::unique_ptr< OnDiskKeyValueDB > > open(StringRef Path, StringRef HashName, unsigned KeySize, StringRef ValueName, size_t ValueSize)
Open the on-disk store from a directory.
function_ref< Error(FileOffset Offset, ArrayRef< char > Data)> CheckValueT
Error validate(CheckValueT CheckValue) const
Validate the storage with a callback CheckValue to check the stored value.
constexpr StringLiteral CASFormatVersion
The version for all the ondisk database files.
Expected< std::optional< uint64_t > > getOverriddenMaxMappingSize()
Retrieves an overridden maximum mapping size for CAS files, if any, speicified by LLVM_CAS_MAX_MAPPIN...
LLVM_ABI std::error_code create_directories(const Twine &path, bool IgnoreExisting=true, perms Perms=owner_all|group_all)
Create all the non-existent directories in path.
LLVM_ABI void append(SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
Append to path.
This is an optimization pass for GlobalISel generic memory operations.
StringMapEntry< Value * > ValueName
Error createFileError(const Twine &F, Error E)
Concatenate a source file path and/or name with an Error.
std::string utohexstr(uint64_t X, bool LowerCase=false, unsigned Width=0)
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
OutputIt copy(R &&Range, OutputIt Out)
std::string itostr(int64_t X)
bool isAddrAligned(Align Lhs, const void *Addr)
Checks that Addr is a multiple of the alignment.
This struct is a compact representation of a valid (non-zero power of two) alignment.
Const value proxy to access the records stored in TrieRawHashMap.
Value proxy to access the records stored in TrieRawHashMap.
MutableArrayRef< char > Data