LLVM 22.0.0git
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
llvm::StableFunctionMapRecord Struct Reference

The structure of the serialized stable function map is as follows: More...

#include "llvm/CGData/StableFunctionMapRecord.h"

Public Member Functions

 StableFunctionMapRecord ()
 
 StableFunctionMapRecord (std::unique_ptr< StableFunctionMap > FunctionMap)
 
LLVM_ABI void serialize (raw_ostream &OS, std::vector< CGDataPatchItem > &PatchItems) const
 Serialize the stable function map to a raw_ostream.
 
LLVM_ABI void deserialize (const unsigned char *&Ptr)
 Deserialize the stable function map from a raw_ostream.
 
LLVM_ABI void lazyDeserialize (std::shared_ptr< MemoryBuffer > Buffer, uint64_t Offset)
 Lazily deserialize the stable function map from Buffer starting at Offset.
 
LLVM_ABI void serializeYAML (yaml::Output &YOS) const
 Serialize the stable function map to a YAML stream.
 
LLVM_ABI void deserializeYAML (yaml::Input &YIS)
 Deserialize the stable function map from a YAML stream.
 
void finalize (bool SkipTrim=false)
 Finalize the stable function map by trimming content.
 
void merge (const StableFunctionMapRecord &Other)
 Merge the stable function map into this one.
 
bool empty () const
 
void print (raw_ostream &OS=llvm::errs()) const
 Print the stable function map in a YAML format.
 
void setReadStableFunctionMapNames (bool Read)
 Set whether to read stable function names from the buffer.
 

Static Public Member Functions

static LLVM_ABI void serialize (raw_ostream &OS, const StableFunctionMap *FunctionMap, std::vector< CGDataPatchItem > &PatchItems)
 A static helper function to serialize the stable function map without owning the stable function map.
 
static LLVM_ABI void deserializeEntry (const unsigned char *Ptr, stable_hash Hash, StableFunctionMap *FunctionMap)
 A static helper function to deserialize the stable function map entry.
 

Public Attributes

std::unique_ptr< StableFunctionMapFunctionMap
 

Detailed Description

The structure of the serialized stable function map is as follows:

Definition at line 47 of file StableFunctionMapRecord.h.

Constructor & Destructor Documentation

◆ StableFunctionMapRecord() [1/2]

llvm::StableFunctionMapRecord::StableFunctionMapRecord ( )
inline

Definition at line 50 of file StableFunctionMapRecord.h.

References FunctionMap.

◆ StableFunctionMapRecord() [2/2]

llvm::StableFunctionMapRecord::StableFunctionMapRecord ( std::unique_ptr< StableFunctionMap FunctionMap)
inline

Definition at line 54 of file StableFunctionMapRecord.h.

Member Function Documentation

◆ deserialize()

void StableFunctionMapRecord::deserialize ( const unsigned char *&  Ptr)

Deserialize the stable function map from a raw_ostream.

Definition at line 258 of file StableFunctionMapRecord.cpp.

References deserialize(), and Ptr.

Referenced by deserialize(), lazyDeserialize(), llvm::CodeGenDataReader::mergeFromObjectFile(), and llvm::IndexedCodeGenDataReader::read().

◆ deserializeEntry()

void StableFunctionMapRecord::deserializeEntry ( const unsigned char Ptr,
stable_hash  Hash,
StableFunctionMap FunctionMap 
)
static

A static helper function to deserialize the stable function map entry.

Ptr should be pointing to the start of the fixed-sized fields of the entry when passed in.

Definition at line 145 of file StableFunctionMapRecord.cpp.

References assert(), FunctionMap, and Ptr.

◆ deserializeYAML()

void StableFunctionMapRecord::deserializeYAML ( yaml::Input &  YIS)

Deserialize the stable function map from a YAML stream.

Definition at line 284 of file StableFunctionMapRecord.cpp.

References FunctionMap.

Referenced by llvm::TextCodeGenDataReader::read().

◆ empty()

bool llvm::StableFunctionMapRecord::empty ( ) const
inline
Returns
true if the stable function map is empty.

Definition at line 98 of file StableFunctionMapRecord.h.

References FunctionMap.

Referenced by llvm::cgdata::mergeCodeGenData().

◆ finalize()

void llvm::StableFunctionMapRecord::finalize ( bool  SkipTrim = false)
inline

Finalize the stable function map by trimming content.

Definition at line 90 of file StableFunctionMapRecord.h.

References FunctionMap.

Referenced by llvm::cgdata::mergeCodeGenData().

◆ lazyDeserialize()

void StableFunctionMapRecord::lazyDeserialize ( std::shared_ptr< MemoryBuffer Buffer,
uint64_t  Offset 
)

Lazily deserialize the stable function map from Buffer starting at Offset.

The individual stable function entry would be read lazily from Buffer when the function map is accessed.

Definition at line 262 of file StableFunctionMapRecord.cpp.

References deserialize(), FunctionMap, llvm::Offset, and Ptr.

Referenced by llvm::IndexedCodeGenDataReader::read().

◆ merge()

void llvm::StableFunctionMapRecord::merge ( const StableFunctionMapRecord Other)
inline

Merge the stable function map into this one.

Definition at line 93 of file StableFunctionMapRecord.h.

References FunctionMap, and llvm::Other.

Referenced by llvm::CodeGenDataReader::mergeFromObjectFile().

◆ print()

void llvm::StableFunctionMapRecord::print ( raw_ostream OS = llvm::errs()) const
inline

Print the stable function map in a YAML format.

Definition at line 101 of file StableFunctionMapRecord.h.

References OS, and serializeYAML().

◆ serialize() [1/2]

void StableFunctionMapRecord::serialize ( raw_ostream OS,
const StableFunctionMap FunctionMap,
std::vector< CGDataPatchItem > &  PatchItems 
)
static

◆ serialize() [2/2]

void StableFunctionMapRecord::serialize ( raw_ostream OS,
std::vector< CGDataPatchItem > &  PatchItems 
) const

Serialize the stable function map to a raw_ostream.

Definition at line 80 of file StableFunctionMapRecord.cpp.

References FunctionMap, OS, and serialize().

◆ serializeYAML()

void StableFunctionMapRecord::serializeYAML ( yaml::Output &  YOS) const

Serialize the stable function map to a YAML stream.

Definition at line 270 of file StableFunctionMapRecord.cpp.

References llvm::SmallVectorImpl< T >::emplace_back(), FunctionMap, getStableFunctionEntries(), and getStableIndexOperandHashes().

Referenced by print(), and llvm::CodeGenDataWriter::writeText().

◆ setReadStableFunctionMapNames()

void llvm::StableFunctionMapRecord::setReadStableFunctionMapNames ( bool  Read)
inline

Set whether to read stable function names from the buffer.

Has no effect if the function map is read from a YAML stream.

Definition at line 108 of file StableFunctionMapRecord.h.

References assert(), FunctionMap, and llvm::Read.

Referenced by llvm::IndexedCodeGenDataReader::read().

Member Data Documentation

◆ FunctionMap

std::unique_ptr<StableFunctionMap> llvm::StableFunctionMapRecord::FunctionMap

The documentation for this struct was generated from the following files: