|
LLVM 24.0.0git
|
#include "llvm/CGData/CodeGenDataReader.h"
Public Member Functions | |
| CodeGenDataReader ()=default | |
| virtual | ~CodeGenDataReader ()=default |
| virtual Error | read ()=0 |
| Read the header. Required before reading first record. | |
| virtual uint32_t | getVersion () const =0 |
| Return the codegen data version. | |
| virtual CGDataKind | getDataKind () const =0 |
| Return the codegen data kind. | |
| virtual bool | hasOutlinedHashTree () const =0 |
| Return true if the data has an outlined hash tree. | |
| virtual bool | hasStableFunctionMap () const =0 |
| Return true if the data has a stable function map. | |
| std::unique_ptr< OutlinedHashTree > | releaseOutlinedHashTree () |
| Return the outlined hash tree that is released from the reader. | |
| std::unique_ptr< StableFunctionMap > | releaseStableFunctionMap () |
Static Public Member Functions | |
| static LLVM_ABI Expected< std::unique_ptr< CodeGenDataReader > > | create (const Twine &Path, vfs::FileSystem &FS, bool LazyLoading=false) |
| Factory method to create an appropriately typed reader for the given codegen data file path and file system. | |
| static LLVM_ABI Expected< std::unique_ptr< CodeGenDataReader > > | create (std::unique_ptr< MemoryBuffer > Buffer, bool LazyLoading=false) |
| Factory method to create an appropriately typed reader for the given memory buffer. | |
| static LLVM_ABI Error | mergeFromObjectFile (const object::ObjectFile *Obj, OutlinedHashTreeRecord &GlobalOutlineRecord, StableFunctionMapRecord &GlobalFunctionMapRecord, stable_hash *CombinedHash=nullptr) |
| Extract the cgdata embedded in sections from the given object file and merge them into the GlobalOutlineRecord. | |
Protected Member Functions | |
| Error | error (cgdata_error Err, const std::string &ErrMsg="") |
| Set the current error and return same. | |
| Error | error (Error &&E) |
| Error | success () |
| Clear the current error and return a successful one. | |
Protected Attributes | |
| OutlinedHashTreeRecord | HashTreeRecord |
| The outlined hash tree that has been read. | |
| StableFunctionMapRecord | FunctionMapRecord |
| The stable function map that has been read. When it's released by. | |
Definition at line 25 of file CodeGenDataReader.h.
|
default |
|
virtualdefault |
|
static |
Factory method to create an appropriately typed reader for the given codegen data file path and file system.
LazyLoading defers deserializing the stable function map of indexed codegen data.
Definition at line 132 of file CodeGenDataReader.cpp.
References create(), and llvm::setupMemoryBuffer().
Referenced by create(), and llvm::CodeGenData::getInstance().
|
static |
Factory method to create an appropriately typed reader for the given memory buffer.
Definition at line 142 of file CodeGenDataReader.cpp.
References llvm::empty_cgdata, llvm::IndexedCodeGenDataReader::hasFormat(), llvm::TextCodeGenDataReader::hasFormat(), llvm::make_error(), and llvm::malformed.
|
inlineprotected |
Set the current error and return same.
Definition at line 83 of file CodeGenDataReader.h.
References llvm::make_error(), llvm::success, and llvm::Error::success().
Definition at line 91 of file CodeGenDataReader.h.
References E(), llvm::CGDataError::get(), llvm::CGDataError::getMessage(), llvm::handleAllErrors(), and llvm::make_error().
|
pure virtual |
Return the codegen data kind.
Implemented in llvm::IndexedCodeGenDataReader, and llvm::TextCodeGenDataReader.
|
pure virtual |
Return the codegen data version.
Implemented in llvm::IndexedCodeGenDataReader, and llvm::TextCodeGenDataReader.
|
pure virtual |
Return true if the data has an outlined hash tree.
Implemented in llvm::IndexedCodeGenDataReader, and llvm::TextCodeGenDataReader.
|
pure virtual |
Return true if the data has a stable function map.
Implemented in llvm::IndexedCodeGenDataReader, and llvm::TextCodeGenDataReader.
|
static |
Extract the cgdata embedded in sections from the given object file and merge them into the GlobalOutlineRecord.
This is a static helper that is used by llvm-cgdata --merge or ThinLTO's two-codegen rounds. Optionally, CombinedHash can be used to compuate the combined hash of the merged data.
Definition at line 40 of file CodeGenDataReader.cpp.
References llvm::Data, llvm::OutlinedHashTreeRecord::deserialize(), llvm::StableFunctionMapRecord::deserialize(), llvm::getCodeGenDataSectionName(), llvm::OutlinedHashTreeRecord::merge(), llvm::StableFunctionMapRecord::merge(), llvm::stable_hash_combine(), llvm::Error::success(), llvm::Expected< T >::takeError(), and llvm::xxh3_64bits().
Referenced by llvm::cgdata::mergeCodeGenData().
|
pure virtual |
Read the header. Required before reading first record.
Implemented in llvm::IndexedCodeGenDataReader, and llvm::TextCodeGenDataReader.
|
inline |
Return the outlined hash tree that is released from the reader.
Definition at line 44 of file CodeGenDataReader.h.
References HashTreeRecord.
|
inline |
Definition at line 47 of file CodeGenDataReader.h.
References FunctionMapRecord.
|
inlineprotected |
Clear the current error and return a successful one.
Definition at line 100 of file CodeGenDataReader.h.
References error, and llvm::success.
Referenced by llvm::IndexedCodeGenDataReader::read().
|
protected |
The stable function map that has been read. When it's released by.
Definition at line 80 of file CodeGenDataReader.h.
Referenced by llvm::IndexedCodeGenDataReader::read(), llvm::TextCodeGenDataReader::read(), and releaseStableFunctionMap().
|
protected |
The outlined hash tree that has been read.
When it's released by releaseOutlinedHashTree(), it's no longer valid.
Definition at line 76 of file CodeGenDataReader.h.
Referenced by llvm::IndexedCodeGenDataReader::read(), llvm::TextCodeGenDataReader::read(), and releaseOutlinedHashTree().