9#ifndef LLDB_CORE_DATAFILECACHE_H
10#define LLDB_CORE_DATAFILECACHE_H
16#include "llvm/ADT/DenseMap.h"
17#include "llvm/Support/CachePruning.h"
18#include "llvm/Support/Caching.h"
19#include "llvm/Support/MemoryBuffer.h"
53 llvm::CachePruningPolicy policy =
72 std::unique_ptr<llvm::MemoryBuffer>
GetCachedData(llvm::StringRef key);
84 bool SetCachedData(llvm::StringRef key, llvm::ArrayRef<uint8_t> data);
217 llvm::StringRef
Get(uint32_t offset)
const;
Many cache files require string tables to store data efficiently.
bool Encode(DataEncoder &encoder)
std::vector< ConstString > m_strings
llvm::DenseMap< ConstString, uint32_t > m_string_to_offset
uint32_t Add(ConstString s)
Add a string into the string table.
ConstStringTable()=default
uint32_t m_next_offset
Skip one byte to start the string table off with an empty string.
A uniqued constant string class.
An binary data encoding class.
This class enables data to be cached into a directory using the llvm caching code.
FileSpec GetCacheFilePath(llvm::StringRef key)
Return the cache file that is associated with the key.
std::unique_ptr< llvm::MemoryBuffer > GetCachedData(llvm::StringRef key)
Get cached data from the cache directory for the specified key.
bool SetCachedData(llvm::StringRef key, llvm::ArrayRef< uint8_t > data)
Set cached data for the specified key.
llvm::FileCache m_cache_callback
std::unique_ptr< llvm::MemoryBuffer > m_mem_buff_up
static llvm::CachePruningPolicy GetLLDBIndexCachePolicy()
Gets the default LLDB index cache policy, which is controlled by the "LLDBIndexCache" family of setti...
Status RemoveCacheFile(llvm::StringRef key)
Remove the cache file associated with the key.
A class that describes an executable image and its associated object and symbol files.
A plug-in interface definition class for object file parsers.
Many cache files require string tables to store data efficiently.
bool Decode(const DataExtractor &data, lldb::offset_t *offset_ptr)
StringTableReader()=default
llvm::StringRef m_data
All of the strings in the string table are contained in m_data.
llvm::StringRef Get(uint32_t offset) const
A class that represents a running process on the host machine.
A signature for a given file on disk.
bool Decode(const DataExtractor &data, lldb::offset_t *offset_ptr)
Decode a serialized version of this object from data.
bool operator==(const CacheSignature &rhs) const
Check if two signatures are the same.
bool operator!=(const CacheSignature &rhs) const
Check if two signatures differ.
bool Encode(DataEncoder &encoder) const
Encode this object into a data encoder object.
bool IsValid() const
Return true only if the CacheSignature is valid.
std::optional< std::time_t > m_mod_time
Modification time of file on disk.
std::optional< std::time_t > m_obj_mod_time
If this describes a .o file with a BSD archive, the BSD archive's modification time will be in m_mod_...
std::optional< UUID > m_uuid
UUID of object file or module.