LLVM 20.0.0git
|
This format is a simple text format that's suitable for test data. More...
#include "llvm/CGData/CodeGenDataReader.h"
Public Member Functions | |
TextCodeGenDataReader (std::unique_ptr< MemoryBuffer > DataBuffer_) | |
TextCodeGenDataReader (const TextCodeGenDataReader &)=delete | |
TextCodeGenDataReader & | operator= (const TextCodeGenDataReader &)=delete |
Error | read () override |
Read the contents including the header. | |
uint32_t | getVersion () const override |
Text format does not have version, so return 0. | |
CGDataKind | getDataKind () const override |
Return the codegen data kind. | |
bool | hasOutlinedHashTree () const override |
Return true if the header indicates the data has an outlined hash tree. | |
Public Member Functions inherited from llvm::CodeGenDataReader | |
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. | |
std::unique_ptr< OutlinedHashTree > | releaseOutlinedHashTree () |
Return the outlined hash tree that is released from the reader. | |
Static Public Member Functions | |
static bool | hasFormat (const MemoryBuffer &Buffer) |
Return true if the given buffer is in text codegen data format. | |
Static Public Member Functions inherited from llvm::CodeGenDataReader | |
static Expected< std::unique_ptr< CodeGenDataReader > > | create (const Twine &Path, vfs::FileSystem &FS) |
Factory method to create an appropriately typed reader for the given codegen data file path and file system. | |
static Expected< std::unique_ptr< CodeGenDataReader > > | create (std::unique_ptr< MemoryBuffer > Buffer) |
Factory method to create an appropriately typed reader for the given memory buffer. | |
static Error | mergeFromObjectFile (const object::ObjectFile *Obj, OutlinedHashTreeRecord &GlobalOutlineRecord) |
Extract the cgdata embedded in sections from the given object file and merge them into the GlobalOutlineRecord. | |
Additional Inherited Members | |
Protected Member Functions inherited from llvm::CodeGenDataReader | |
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 inherited from llvm::CodeGenDataReader | |
OutlinedHashTreeRecord | HashTreeRecord |
The outlined hash tree that has been read. | |
This format is a simple text format that's suitable for test data.
The header is a custom format starting with :
per line to indicate which codegen data is recorded. #
is used to indicate a comment. The subsequent data is a YAML format per each codegen data in order. Currently, it only has a function outlined hash tree.
Definition at line 122 of file CodeGenDataReader.h.
|
inline |
Definition at line 131 of file CodeGenDataReader.h.
|
delete |
|
inlineoverridevirtual |
Return the codegen data kind.
Implements llvm::CodeGenDataReader.
Definition at line 143 of file CodeGenDataReader.h.
|
inlineoverridevirtual |
Text format does not have version, so return 0.
Implements llvm::CodeGenDataReader.
Definition at line 141 of file CodeGenDataReader.h.
|
static |
Return true if the given buffer is in text codegen data format.
Definition at line 132 of file CodeGenDataReader.cpp.
References llvm::all_of(), llvm::MemoryBuffer::getBuffer(), and llvm::StringRef::take_front().
Referenced by llvm::CodeGenDataReader::create().
|
inlineoverridevirtual |
Return true if the header indicates the data has an outlined hash tree.
This does not mean that the data is still available.
Implements llvm::CodeGenDataReader.
Definition at line 146 of file CodeGenDataReader.h.
References llvm::FunctionOutlinedHashTree.
Referenced by read().
|
delete |
|
overridevirtual |
Read the contents including the header.
Implements llvm::CodeGenDataReader.
Definition at line 138 of file CodeGenDataReader.cpp.
References llvm::bad_header, llvm::StringRef::data(), llvm::OutlinedHashTreeRecord::deserializeYAML(), llvm::StringRef::drop_front(), llvm::StringRef::empty(), error, llvm::FunctionOutlinedHashTree, llvm::CodeGenDataReader::HashTreeRecord, hasOutlinedHashTree(), llvm::line_iterator::is_at_eof(), llvm::StringRef::rtrim(), Size, llvm::StringRef::starts_with(), llvm::Error::success(), llvm::StringRef::trim(), and llvm::Unknown.