LLVM
8.0.1
|
#include "llvm/Bitcode/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) |
EmitAbbrev - This emits an abbreviation 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 28 of file BitstreamWriter.h.
|
inlineexplicit |
Definition at line 85 of file BitstreamWriter.h.
|
inline |
Definition at line 88 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 105 of file BitstreamWriter.h.
References assert().
Referenced by BackpatchWord64(), emitSignedInt64(), and ExitBlock().
|
inline |
Definition at line 115 of file BitstreamWriter.h.
References BackpatchWord().
Definition at line 120 of file BitstreamWriter.h.
References assert().
Referenced by EmitCode(), EmitRecordWithArray(), EmitVBR(), EmitVBR64(), EnterSubblock(), ExitBlock(), and writeBitcodeHeader().
|
inline |
EmitAbbrev - This emits an abbreviation to the stream.
Note that this method takes ownership of the specified abbrev.
Definition at line 492 of file BitstreamWriter.h.
References llvm::bitc::FIRST_APPLICATION_ABBREV.
Referenced by emitSignedInt64(), getAttrKindEncoding(), getEncodedUnnamedAddr(), getOptimizationFlags(), getStringEncoding(), rotateSign(), writeIdentificationBlock(), llvm::WriteIndexToFile(), and llvm::BitcodeWriter::~BitcodeWriter().
|
inline |
Emit a blob, including flushing before and tail-padding.
Definition at line 385 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 403 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 535 of file BitstreamWriter.h.
References llvm::bitc::FIRST_APPLICATION_ABBREV, and Info.
Referenced by emitSignedInt64().
|
inline |
EmitCode - Emit the specified code.
Definition at line 178 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 411 of file BitstreamWriter.h.
References EmitCode(), EmitVBR(), EmitVBR64(), llvm::makeArrayRef(), and llvm::bitc::UNABBREV_RECORD.
Referenced by emitSignedInt64(), EnterBlockInfoBlock(), getAttrKindEncoding(), getEncodedUnnamedAddr(), getOptimizationFlags(), getStringEncoding(), rotateSign(), writeFunctionTypeMetadataRecords(), writeIdentificationBlock(), llvm::WriteIndexToFile(), writeStringRecord(), and writeTypeIdSummaryRecord().
|
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 431 of file BitstreamWriter.h.
References llvm::makeArrayRef(), and llvm::None.
Referenced by getEncodedUnnamedAddr().
|
inline |
EmitRecordWithArray - Just like EmitRecordWithBlob, works with records that end with an array.
Definition at line 455 of file BitstreamWriter.h.
References llvm::makeArrayRef(), and llvm::None.
|
inline |
Definition at line 460 of file BitstreamWriter.h.
References llvm::bitc::DEFINE_ABBREV, 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 441 of file BitstreamWriter.h.
References llvm::makeArrayRef(), and llvm::None.
Referenced by rotateSign(), and llvm::BitcodeWriter::~BitcodeWriter().
|
inline |
Definition at line 446 of file BitstreamWriter.h.
References llvm::makeArrayRef(), and llvm::None.
Definition at line 147 of file BitstreamWriter.h.
References assert(), Emit(), and Threshold.
Referenced by emitBlob(), EmitRecord(), EmitRecordWithArray(), EmitVBR64(), EnterSubblock(), ExitBlock(), and rotateSign().
|
inline |
Definition at line 160 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 505 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().
Definition at line 200 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 emitSignedInt64(), EnterBlockInfoBlock(), getAttrKindEncoding(), llvm::WriteBitcodeToFile(), writeIdentificationBlock(), llvm::WriteIndexToFile(), and llvm::BitcodeWriter::~BitcodeWriter().
|
inline |
Definition at line 229 of file BitstreamWriter.h.
References llvm::BitCodeAbbrevOp::Array, assert(), B, BackpatchWord(), llvm::BitCodeAbbrevOp::Blob, llvm::BitCodeAbbrevOp::Char6, llvm::StringRef::data(), 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 emitSignedInt64(), getAttrKindEncoding(), llvm::WriteBitcodeToFile(), writeIdentificationBlock(), llvm::WriteIndexToFile(), and llvm::BitcodeWriter::~BitcodeWriter().
|
inline |
Definition at line 139 of file BitstreamWriter.h.
Referenced by emitBlob(), EnterSubblock(), ExitBlock(), and rotateSign().
|
inline |
Retrieve the number of bits currently used to encode an abbrev ID.
Definition at line 97 of file BitstreamWriter.h.
|
inline |
getBlockInfo - If there is block info for the specified ID, return it, otherwise return null.
Definition at line 188 of file BitstreamWriter.h.
Referenced by EnterBlockInfoBlock(), and EnterSubblock().
|
inline |
Retrieve the current position in the stream, in bits.
Definition at line 94 of file BitstreamWriter.h.
Referenced by emitSignedInt64(), and getEncodedUnnamedAddr().