|
LLVM 22.0.0git
|
The string table used for serializing remarks. More...
#include "llvm/Remarks/RemarkStringTable.h"
Public Member Functions | |
| StringTable ()=default | |
| StringTable (const StringTable &)=delete | |
| Disable copy. | |
| StringTable & | operator= (const StringTable &)=delete |
| StringTable (StringTable &&)=default | |
| Should be movable. | |
| StringTable & | operator= (StringTable &&)=default |
| LLVM_ABI | StringTable (const ParsedStringTable &Other) |
| Construct a string table from a ParsedStringTable. | |
| LLVM_ABI std::pair< unsigned, StringRef > | add (StringRef Str) |
| Add a string to the table. It returns an unique ID of the string. | |
| LLVM_ABI void | internalize (Remark &R) |
Modify R to use strings from this string table. | |
| LLVM_ABI void | serialize (raw_ostream &OS) const |
| Serialize the string table to a stream. | |
| LLVM_ABI std::vector< StringRef > | serialize () const |
| Serialize the string table to a vector. | |
Public Attributes | |
| StringMap< unsigned, BumpPtrAllocator > | StrTab |
| The string table containing all the unique strings used in the output. | |
| size_t | SerializedSize = 0 |
| Total size of the string table when serialized. | |
The string table used for serializing remarks.
This table can be for example serialized in a section to be consumed after the compilation.
Definition at line 37 of file RemarkStringTable.h.
|
default |
Referenced by operator=(), operator=(), StringTable(), and StringTable().
|
delete |
Disable copy.
References StringTable().
|
default |
Should be movable.
References StringTable().
| StringTable::StringTable | ( | const ParsedStringTable & | Other | ) |
Construct a string table from a ParsedStringTable.
Definition at line 23 of file RemarkStringTable.cpp.
References add(), llvm_unreachable, and llvm::Other.
Add a string to the table. It returns an unique ID of the string.
Definition at line 31 of file RemarkStringTable.cpp.
References SerializedSize, and StrTab.
Referenced by llvm::remarks::BitstreamRemarkSerializerHelper::emitRemark(), internalize(), and StringTable().
| void StringTable::internalize | ( | Remark & | R | ) |
Modify R to use strings from this string table.
If the string table does not contain the strings, it adds them.
Definition at line 41 of file RemarkStringTable.cpp.
References add(), llvm::remarks::Argument::Key, llvm::remarks::Argument::Loc, and llvm::remarks::Argument::Val.
|
delete |
References StringTable().
|
default |
References LLVM_ABI, llvm::Other, and StringTable().
| std::vector< StringRef > StringTable::serialize | ( | ) | const |
Serialize the string table to a vector.
This allows users to do the actual writing to file/memory/other. The string with the ID == N should be the N-th element in the vector.
Definition at line 65 of file RemarkStringTable.cpp.
References StrTab.
| void StringTable::serialize | ( | raw_ostream & | OS | ) | const |
Serialize the string table to a stream.
It is serialized as a little endian uint64 (the size of the table in bytes) followed by a sequence of NULL-terminated strings, where the N-th string is the string with the ID N in the StrTab map.
Definition at line 56 of file RemarkStringTable.cpp.
References serialize(), and llvm::raw_ostream::write().
Referenced by llvm::remarks::BitstreamRemarkSerializerHelper::emitMetaStrTab(), and serialize().
| size_t llvm::remarks::StringTable::SerializedSize = 0 |
Total size of the string table when serialized.
Definition at line 42 of file RemarkStringTable.h.
Referenced by add().
| StringMap<unsigned, BumpPtrAllocator> llvm::remarks::StringTable::StrTab |
The string table containing all the unique strings used in the output.
It maps a string to an unique ID.
Definition at line 40 of file RemarkStringTable.h.
Referenced by add(), and serialize().