|
LLVM
10.0.0
|
#include "llvm/Bitstream/BitstreamWriter.h"
Public Member Functions | |
| BitstreamWriter (SmallVectorImpl< char > &O) | |
| ~BitstreamWriter () | |
| uint64_t | GetCurrentBitNo () const |
| Retrieve the current position in the stream, in bits. More... | |
| unsigned | GetAbbrevIDWidth () const |
| Retrieve the number of bits currently used to encode an abbrev ID. More... | |
| void | BackpatchWord (uint64_t BitNo, unsigned NewWord) |
| Backpatch a 32-bit word in the output at the given bit offset with the specified value. More... | |
| 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. More... | |
| BlockInfo * | getBlockInfo (unsigned BlockID) |
| getBlockInfo - If there is block info for the specified ID, return it, otherwise return null. More... | |
| void | EnterSubblock (unsigned BlockID, unsigned CodeLen) |
| void | ExitBlock () |
| template<class UIntTy > | |
| void | emitBlob (ArrayRef< UIntTy > Bytes, bool ShouldEmitSize=true) |
| Emit a blob, including flushing before and tail-padding. More... | |
| void | emitBlob (StringRef Bytes, bool ShouldEmitSize=true) |
| template<typename Container > | |
| 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. More... | |
| template<typename Container > | |
| void | EmitRecordWithAbbrev (unsigned Abbrev, const Container &Vals) |
| EmitRecordWithAbbrev - Emit a record with the specified abbreviation. More... | |
| template<typename Container > | |
| 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. More... | |
| template<typename Container > | |
| void | EmitRecordWithBlob (unsigned Abbrev, const Container &Vals, const char *BlobData, unsigned BlobLen) |
| template<typename Container > | |
| void | EmitRecordWithArray (unsigned Abbrev, const Container &Vals, StringRef Array) |
| EmitRecordWithArray - Just like EmitRecordWithBlob, works with records that end with an array. More... | |
| template<typename Container > | |
| 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. More... | |
| void | EnterBlockInfoBlock () |
| EnterBlockInfoBlock - Start emitting the BLOCKINFO_BLOCK. More... | |
| unsigned | EmitBlockInfoAbbrev (unsigned BlockID, std::shared_ptr< BitCodeAbbrev > Abbv) |
| EmitBlockInfoAbbrev - Emit a DEFINE_ABBREV record for the specified BlockID. More... | |
Definition at line 27 of file BitstreamWriter.h.
|
inlineexplicit |
Definition at line 84 of file BitstreamWriter.h.
|
inline |
Definition at line 87 of file BitstreamWriter.h.
References assert().
|
inline |
Backpatch a 32-bit word in the output at the given bit offset with the specified value.
Definition at line 104 of file BitstreamWriter.h.
References assert().
Referenced by BackpatchWord64(), emitSignedInt64(), and ExitBlock().
|
inline |
Definition at line 114 of file BitstreamWriter.h.
References BackpatchWord().
Definition at line 119 of file BitstreamWriter.h.
References assert().
Referenced by EmitCode(), EmitRecordWithArray(), EmitVBR(), EmitVBR64(), EnterSubblock(), ExitBlock(), llvm::remarks::BitstreamRemarkSerializerHelper::setupBlockInfo(), and writeBitcodeHeader().
|
inline |
Emits the abbreviation Abbv to the stream.
Definition at line 490 of file BitstreamWriter.h.
References llvm::bitc::FIRST_APPLICATION_ABBREV.
Referenced by emitSignedInt64(), getAttrKindEncoding(), getEncodedUnnamedAddr(), getOptimizationFlags(), getStringEncoding(), rotateSign(), writeIdentificationBlock(), llvm::WriteIndexToFile(), writeTypeIdCompatibleVtableSummaryRecord(), and llvm::BitcodeWriter::~BitcodeWriter().
|
inline |
Emit a blob, including flushing before and tail-padding.
Definition at line 384 of file BitstreamWriter.h.
References assert(), B, EmitVBR(), FlushToWord(), llvm::isUInt< 8 >(), and llvm::ArrayRef< T >::size().
Referenced by emitBlob(), and ExitBlock().
Definition at line 402 of file BitstreamWriter.h.
References llvm::StringRef::data(), emitBlob(), llvm::makeArrayRef(), and llvm::StringRef::size().
|
inline |
EmitBlockInfoAbbrev - Emit a DEFINE_ABBREV record for the specified BlockID.
Definition at line 532 of file BitstreamWriter.h.
References llvm::bitc::FIRST_APPLICATION_ABBREV, and Info.
Referenced by emitSignedInt64(), llvm::remarks::BitstreamRemarkSerializerHelper::setupMetaBlockInfo(), llvm::remarks::BitstreamRemarkSerializerHelper::setupMetaExternalFile(), llvm::remarks::BitstreamRemarkSerializerHelper::setupMetaRemarkVersion(), llvm::remarks::BitstreamRemarkSerializerHelper::setupMetaStrTab(), and llvm::remarks::BitstreamRemarkSerializerHelper::setupRemarkBlockInfo().
|
inline |
EmitCode - Emit the specified code.
Definition at line 177 of file BitstreamWriter.h.
References Emit().
Referenced by EmitRecord(), EmitRecordWithArray(), EnterSubblock(), and ExitBlock().
|
inline |
EmitRecord - Emit the specified record to the stream, using an abbrev if we have one to compress the output.
Definition at line 410 of file BitstreamWriter.h.
References llvm::numbers::e, EmitCode(), EmitVBR(), EmitVBR64(), llvm::makeArrayRef(), and llvm::bitc::UNABBREV_RECORD.
Referenced by emitSignedInt64(), EnterBlockInfoBlock(), getAttrKindEncoding(), getEncodedUnnamedAddr(), getOptimizationFlags(), getStringEncoding(), initBlock(), rotateSign(), setRecordName(), writeFunctionTypeMetadataRecords(), writeIdentificationBlock(), llvm::WriteIndexToFile(), writeStringRecord(), and writeTypeIdCompatibleVtableSummaryRecord().
|
inline |
EmitRecordWithAbbrev - Emit a record with the specified abbreviation.
Unlike EmitRecord, the code for the record should be included in Vals as the first entry.
Definition at line 430 of file BitstreamWriter.h.
References llvm::makeArrayRef(), and llvm::None.
Referenced by llvm::remarks::BitstreamRemarkSerializerHelper::emitMetaBlock(), llvm::remarks::BitstreamRemarkSerializerHelper::emitMetaRemarkVersion(), llvm::remarks::BitstreamRemarkSerializerHelper::emitRemarkBlock(), and getEncodedUnnamedAddr().
|
inline |
EmitRecordWithArray - Just like EmitRecordWithBlob, works with records that end with an array.
Definition at line 454 of file BitstreamWriter.h.
References llvm::makeArrayRef(), and llvm::None.
|
inline |
Definition at line 459 of file BitstreamWriter.h.
References llvm::bitc::DEFINE_ABBREV, llvm::numbers::e, Emit(), EmitCode(), EmitVBR(), EmitVBR64(), llvm::BitCodeAbbrevOp::getEncoding(), llvm::BitCodeAbbrevOp::getEncodingData(), llvm::BitCodeAbbrevOp::getLiteralValue(), llvm::BitCodeAbbrev::getNumOperandInfos(), llvm::BitCodeAbbrev::getOperandInfo(), llvm::BitCodeAbbrevOp::hasEncodingData(), llvm::BitCodeAbbrevOp::isLiteral(), llvm::makeArrayRef(), and llvm::None.
|
inline |
EmitRecordWithBlob - Emit the specified record to the stream, using an abbrev that includes a blob at the end.
The blob data to emit is specified by the pointer and length specified at the end. In contrast to EmitRecord, this routine expects that the first entry in Vals is the code of the record.
Definition at line 440 of file BitstreamWriter.h.
References llvm::makeArrayRef(), and llvm::None.
Referenced by llvm::remarks::BitstreamRemarkSerializerHelper::emitMetaExternalFile(), llvm::remarks::BitstreamRemarkSerializerHelper::emitMetaStrTab(), and llvm::BitcodeWriter::~BitcodeWriter().
|
inline |
Definition at line 445 of file BitstreamWriter.h.
References llvm::makeArrayRef(), and llvm::None.
Definition at line 146 of file BitstreamWriter.h.
References assert(), Emit(), and Threshold.
Referenced by emitBlob(), EmitRecord(), EmitRecordWithArray(), EmitVBR64(), EnterSubblock(), and ExitBlock().
|
inline |
Definition at line 159 of file BitstreamWriter.h.
References assert(), Emit(), EmitVBR(), and Threshold.
Referenced by EmitRecord(), EmitRecordWithArray(), and ExitBlock().
|
inline |
EnterBlockInfoBlock - Start emitting the BLOCKINFO_BLOCK.
Definition at line 502 of file BitstreamWriter.h.
References llvm::bitc::BLOCKINFO_BLOCK_ID, llvm::bitc::BLOCKINFO_CODE_SETBID, EmitRecord(), EnterSubblock(), getBlockInfo(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by emitSignedInt64(), and llvm::remarks::BitstreamRemarkSerializerHelper::setupBlockInfo().
Definition at line 199 of file BitstreamWriter.h.
References llvm::bitc::BlockIDWidth, llvm::bitc::BlockSizeWidth, llvm::bitc::CodeLenWidth, Emit(), EmitCode(), EmitVBR(), llvm::bitc::ENTER_SUBBLOCK, FlushToWord(), getBlockInfo(), and Info.
Referenced by llvm::remarks::BitstreamRemarkSerializerHelper::emitMetaBlock(), llvm::remarks::BitstreamRemarkSerializerHelper::emitRemarkBlock(), emitSignedInt64(), EnterBlockInfoBlock(), getAttrKindEncoding(), llvm::WriteBitcodeToFile(), writeIdentificationBlock(), llvm::WriteIndexToFile(), writeTypeIdCompatibleVtableSummaryRecord(), and llvm::BitcodeWriter::~BitcodeWriter().
|
inline |
Definition at line 228 of file BitstreamWriter.h.
References llvm::BitCodeAbbrevOp::Array, assert(), B, BackpatchWord(), llvm::BitCodeAbbrevOp::Blob, llvm::BitCodeAbbrevOp::Char6, llvm::StringRef::data(), llvm::numbers::e, Emit(), emitBlob(), EmitCode(), EmitVBR(), EmitVBR64(), llvm::BitCodeAbbrevOp::EncodeChar6(), llvm::bitc::END_BLOCK, llvm::bitc::FIRST_APPLICATION_ABBREV, llvm::BitCodeAbbrevOp::Fixed, FlushToWord(), llvm::BitCodeAbbrevOp::getEncoding(), llvm::BitCodeAbbrevOp::getEncodingData(), llvm::BitCodeAbbrevOp::getLiteralValue(), llvm::Optional< T >::getValue(), llvm::BitCodeAbbrevOp::isLiteral(), llvm_unreachable, llvm::StringRef::size(), llvm::ArrayRef< T >::size(), llvm::ArrayRef< T >::slice(), and llvm::BitCodeAbbrevOp::VBR.
Referenced by llvm::remarks::BitstreamRemarkSerializerHelper::emitMetaBlock(), llvm::remarks::BitstreamRemarkSerializerHelper::emitRemarkBlock(), emitSignedInt64(), getAttrKindEncoding(), llvm::remarks::BitstreamRemarkSerializerHelper::setupBlockInfo(), llvm::WriteBitcodeToFile(), writeIdentificationBlock(), llvm::WriteIndexToFile(), writeTypeIdCompatibleVtableSummaryRecord(), and llvm::BitcodeWriter::~BitcodeWriter().
|
inline |
Definition at line 138 of file BitstreamWriter.h.
Referenced by emitBlob(), EnterSubblock(), and ExitBlock().
|
inline |
Retrieve the number of bits currently used to encode an abbrev ID.
Definition at line 96 of file BitstreamWriter.h.
|
inline |
getBlockInfo - If there is block info for the specified ID, return it, otherwise return null.
Definition at line 187 of file BitstreamWriter.h.
References llvm::numbers::e.
Referenced by EnterBlockInfoBlock(), and EnterSubblock().
|
inline |
Retrieve the current position in the stream, in bits.
Definition at line 93 of file BitstreamWriter.h.
Referenced by emitSignedInt64(), and getEncodedUnnamedAddr().
1.8.13