LLVM: llvm::BitstreamWriter Class Reference (original) (raw)
#include "[llvm/Bitstream/BitstreamWriter.h](BitstreamWriter%5F8h%5Fsource.html)"
Public Member Functions | |
---|---|
BitstreamWriter (raw_ostream &OutStream, uint32_t FlushThreshold=512) | |
Create a BitstreamWriter over a raw_ostream OutStream. | |
BitstreamWriter (SmallVectorImpl< char > &Buff) | |
Convenience constructor for users that start with a vector - avoids needing to wrap it in a raw_svector_ostream. | |
~BitstreamWriter () | |
void | markAndBlockFlushing () |
For scenarios where the user wants to access a section of the stream to (for example) compute some checksum, disable flushing and remember the position in the internal buffer where that happened. | |
StringRef | getMarkedBufferAndResumeFlushing () |
resumes flushing, but does not flush, and returns the section in the internal buffer starting from the position marked with markAndBlockFlushing. | |
uint64_t | GetCurrentBitNo () const |
Retrieve the current position in the stream, in bits. | |
unsigned | GetAbbrevIDWidth () const |
Retrieve the number of bits currently used to encode an abbrev ID. | |
void | BackpatchByte (uint64_t BitNo, uint8_t NewByte) |
Backpatch a byte in the output at the given bit offset with the specified value. | |
void | BackpatchHalfWord (uint64_t BitNo, uint16_t Val) |
void | BackpatchWord (uint64_t BitNo, unsigned Val) |
void | BackpatchWord64 (uint64_t BitNo, uint64_t Val) |
void | Emit (uint32_t Val, unsigned NumBits) |
void | FlushToWord () |
void | EmitVBR (uint32_t Val, unsigned NumBits) |
void | EmitVBR64 (uint64_t Val, unsigned NumBits) |
void | EmitCode (unsigned Val) |
EmitCode - Emit the specified code. | |
BlockInfo * | getBlockInfo (unsigned BlockID) |
getBlockInfo - If there is block info for the specified ID, return it, otherwise return null. | |
void | EnterSubblock (unsigned BlockID, unsigned CodeLen) |
void | ExitBlock () |
template | |
void | emitBlob (ArrayRef< UIntTy > Bytes, bool ShouldEmitSize=true) |
Emit a blob, including flushing before and tail-padding. | |
void | emitBlob (StringRef Bytes, bool ShouldEmitSize=true) |
template | |
void | EmitRecord (unsigned Code, const Container &Vals, unsigned Abbrev=0) |
EmitRecord - Emit the specified record to the stream, using an abbrev if we have one to compress the output. | |
template | |
void | EmitRecordWithAbbrev (unsigned Abbrev, const Container &Vals) |
EmitRecordWithAbbrev - Emit a record with the specified abbreviation. | |
template | |
void | EmitRecordWithBlob (unsigned Abbrev, const Container &Vals, StringRef Blob) |
EmitRecordWithBlob - Emit the specified record to the stream, using an abbrev that includes a blob at the end. | |
template | |
void | EmitRecordWithBlob (unsigned Abbrev, const Container &Vals, const char *BlobData, unsigned BlobLen) |
template | |
void | EmitRecordWithArray (unsigned Abbrev, const Container &Vals, StringRef Array) |
EmitRecordWithArray - Just like EmitRecordWithBlob, works with records that end with an array. | |
template | |
void | EmitRecordWithArray (unsigned Abbrev, const Container &Vals, const char *ArrayData, unsigned ArrayLen) |
unsigned | EmitAbbrev (std::shared_ptr< BitCodeAbbrev > Abbv) |
Emits the abbreviation Abbv to the stream. | |
void | EnterBlockInfoBlock () |
EnterBlockInfoBlock - Start emitting the BLOCKINFO_BLOCK. | |
unsigned | EmitBlockInfoAbbrev (unsigned BlockID, std::shared_ptr< BitCodeAbbrev > Abbv) |
EmitBlockInfoAbbrev - Emit a DEFINE_ABBREV record for the specified BlockID. | |
Definition at line 31 of file BitstreamWriter.h.
llvm::BitstreamWriter::BitstreamWriter ( raw_ostream & OutStream, uint32_t FlushThreshold = 512 ) | inline |
---|
◆ BitstreamWriter() [2/2]
◆ ~BitstreamWriter()
llvm::BitstreamWriter::~BitstreamWriter ( ) | inline |
---|
◆ BackpatchByte()
void llvm::BitstreamWriter::BackpatchByte ( uint64_t BitNo, uint8_t NewByte ) | inline |
---|
◆ BackpatchHalfWord()
void llvm::BitstreamWriter::BackpatchHalfWord ( uint64_t BitNo, uint16_t Val ) | inline |
---|
◆ BackpatchWord()
void llvm::BitstreamWriter::BackpatchWord ( uint64_t BitNo, unsigned Val ) | inline |
---|
◆ BackpatchWord64()
void llvm::BitstreamWriter::BackpatchWord64 ( uint64_t BitNo, uint64_t Val ) | inline |
---|
◆ Emit()
◆ EmitAbbrev()
◆ emitBlob() [1/2]
template
void llvm::BitstreamWriter::emitBlob ( ArrayRef< UIntTy > Bytes, bool ShouldEmitSize = true ) | inline |
---|
Emit a blob, including flushing before and tail-padding.
Definition at line 547 of file BitstreamWriter.h.
References llvm::all_of(), llvm::SmallVectorImpl< T >::append(), assert(), B, llvm::ArrayRef< T >::begin(), EmitVBR(), llvm::ArrayRef< T >::end(), FlushToWord(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::ArrayRef< T >::size().
Referenced by emitBlob().
◆ emitBlob() [2/2]
void llvm::BitstreamWriter::emitBlob ( StringRef Bytes, bool ShouldEmitSize = true ) | inline |
---|
◆ EmitBlockInfoAbbrev()
◆ EmitCode()
void llvm::BitstreamWriter::EmitCode ( unsigned Val) | inline |
---|
◆ EmitRecord()
template
void llvm::BitstreamWriter::EmitRecord ( unsigned Code, const Container & Vals, unsigned Abbrev = 0 ) | inline |
---|
EmitRecord - Emit the specified record to the stream, using an abbrev if we have one to compress the output.
Definition at line 571 of file BitstreamWriter.h.
References EmitCode(), EmitVBR(), EmitVBR64(), and llvm::bitc::UNABBREV_RECORD.
Referenced by llvm::PGOCtxProfileWriter::PGOCtxProfileWriter(), writeFunctionHeapProfileRecords(), writeFunctionTypeMetadataRecords(), writeIdentificationBlock(), writeMemoryProfileRadixTree(), writeStringRecord(), and llvm::dxil::DXILBitcodeWriter::writeStringRecord().
◆ EmitRecordWithAbbrev()
template
void llvm::BitstreamWriter::EmitRecordWithAbbrev ( unsigned Abbrev, const Container & Vals ) | inline |
---|
◆ EmitRecordWithArray() [1/2]
template
◆ EmitRecordWithArray() [2/2]
template
void llvm::BitstreamWriter::EmitRecordWithArray ( unsigned Abbrev, const Container & Vals, StringRef Array ) | inline |
---|
◆ EmitRecordWithBlob() [1/2]
template
◆ EmitRecordWithBlob() [2/2]
template
void llvm::BitstreamWriter::EmitRecordWithBlob ( unsigned Abbrev, const Container & Vals, StringRef Blob ) | inline |
---|
◆ EmitVBR()
◆ EmitVBR64()
◆ EnterBlockInfoBlock()
void llvm::BitstreamWriter::EnterBlockInfoBlock ( ) | inline |
---|
◆ EnterSubblock()
void llvm::BitstreamWriter::EnterSubblock ( unsigned BlockID, unsigned CodeLen ) | inline |
---|
Definition at line 363 of file BitstreamWriter.h.
References llvm::append_range(), llvm::bitc::BlockIDWidth, llvm::bitc::BlockSizeWidth, llvm::bitc::CodeLenWidth, Emit(), EmitCode(), EmitVBR(), llvm::bitc::ENTER_SUBBLOCK, FlushToWord(), getBlockInfo(), and Info.
Referenced by llvm::BCBlockRAII::BCBlockRAII(), llvm::remarks::BitstreamRemarkSerializerHelper::emitMetaBlock(), llvm::remarks::BitstreamRemarkSerializerHelper::emitRemarkBlock(), EnterBlockInfoBlock(), llvm::PGOCtxProfileWriter::PGOCtxProfileWriter(), llvm::dxil::DXILBitcodeWriter::write(), and writeIdentificationBlock().
◆ ExitBlock()
void llvm::BitstreamWriter::ExitBlock ( ) | inline |
---|
Definition at line 390 of file BitstreamWriter.h.
References assert(), B, BackpatchWord(), EmitCode(), llvm::bitc::END_BLOCK, and FlushToWord().
Referenced by llvm::remarks::BitstreamRemarkSerializerHelper::emitMetaBlock(), llvm::remarks::BitstreamRemarkSerializerHelper::emitRemarkBlock(), llvm::PGOCtxProfileWriter::PGOCtxProfileWriter(), llvm::remarks::BitstreamRemarkSerializerHelper::setupBlockInfo(), llvm::dxil::DXILBitcodeWriter::write(), writeIdentificationBlock(), and llvm::BCBlockRAII::~BCBlockRAII().
◆ FlushToWord()
void llvm::BitstreamWriter::FlushToWord ( ) | inline |
---|
◆ GetAbbrevIDWidth()
unsigned llvm::BitstreamWriter::GetAbbrevIDWidth ( ) const | inline |
---|
Retrieve the number of bits currently used to encode an abbrev ID.
Definition at line 197 of file BitstreamWriter.h.
◆ getBlockInfo()
BlockInfo * llvm::BitstreamWriter::getBlockInfo ( unsigned BlockID) | inline |
---|
◆ GetCurrentBitNo()
uint64_t llvm::BitstreamWriter::GetCurrentBitNo ( ) const | inline |
---|
Retrieve the current position in the stream, in bits.
Definition at line 194 of file BitstreamWriter.h.
◆ getMarkedBufferAndResumeFlushing()
StringRef llvm::BitstreamWriter::getMarkedBufferAndResumeFlushing ( ) | inline |
---|
resumes flushing, but does not flush, and returns the section in the internal buffer starting from the position marked with markAndBlockFlushing.
The return should be processed before any additional calls to this object, because those may cause a flush and invalidate the return.
Definition at line 186 of file BitstreamWriter.h.
References assert(), and llvm::SmallVectorBase< Size_T >::size().
◆ markAndBlockFlushing()
void llvm::BitstreamWriter::markAndBlockFlushing ( ) | inline |
---|
For scenarios where the user wants to access a section of the stream to (for example) compute some checksum, disable flushing and remember the position in the internal buffer where that happened.
Must be paired with a call to getMarkedBufferAndResumeFlushing.
Definition at line 176 of file BitstreamWriter.h.
References assert(), and llvm::SmallVectorBase< Size_T >::size().
The documentation for this class was generated from the following file:
- include/llvm/Bitstream/BitstreamWriter.h