LLVM API Documentation
#include <BitstreamWriter.h>
Classes | |
struct | Block |
struct | BlockInfo |
Public Member Functions | |
BitstreamWriter (SmallVectorImpl< char > &O) | |
~BitstreamWriter () | |
uint64_t | GetCurrentBitNo () const |
Retrieve the current position in the stream, in bits. | |
void | Emit (uint32_t Val, unsigned NumBits) |
void | Emit64 (uint64_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) |
void | EnterSubblock (unsigned BlockID, unsigned CodeLen) |
void | ExitBlock () |
template<typename uintty > | |
void | EmitRecord (unsigned Code, SmallVectorImpl< uintty > &Vals, unsigned Abbrev=0) |
template<typename uintty > | |
void | EmitRecordWithAbbrev (unsigned Abbrev, SmallVectorImpl< uintty > &Vals) |
template<typename uintty > | |
void | EmitRecordWithBlob (unsigned Abbrev, SmallVectorImpl< uintty > &Vals, StringRef Blob) |
template<typename uintty > | |
void | EmitRecordWithBlob (unsigned Abbrev, SmallVectorImpl< uintty > &Vals, const char *BlobData, unsigned BlobLen) |
template<typename uintty > | |
void | EmitRecordWithArray (unsigned Abbrev, SmallVectorImpl< uintty > &Vals, StringRef Array) |
template<typename uintty > | |
void | EmitRecordWithArray (unsigned Abbrev, SmallVectorImpl< uintty > &Vals, const char *ArrayData, unsigned ArrayLen) |
unsigned | EmitAbbrev (BitCodeAbbrev *Abbv) |
void | EnterBlockInfoBlock (unsigned CodeWidth) |
EnterBlockInfoBlock - Start emitting the BLOCKINFO_BLOCK. | |
unsigned | EmitBlockInfoAbbrev (unsigned BlockID, BitCodeAbbrev *Abbv) |
Definition at line 25 of file BitstreamWriter.h.
llvm::BitstreamWriter::BitstreamWriter | ( | SmallVectorImpl< char > & | O | ) | [inline, explicit] |
Definition at line 96 of file BitstreamWriter.h.
llvm::BitstreamWriter::~BitstreamWriter | ( | ) | [inline] |
Definition at line 99 of file BitstreamWriter.h.
void llvm::BitstreamWriter::Emit | ( | uint32_t | Val, |
unsigned | NumBits | ||
) | [inline] |
Definition at line 111 of file BitstreamWriter.h.
Referenced by Emit64(), EmitCode(), EmitVBR(), EmitVBR64(), EnterSubblock(), and llvm::WriteBitcodeToFile().
void llvm::BitstreamWriter::Emit64 | ( | uint64_t | Val, |
unsigned | NumBits | ||
) | [inline] |
Definition at line 130 of file BitstreamWriter.h.
References Emit().
unsigned llvm::BitstreamWriter::EmitAbbrev | ( | BitCodeAbbrev * | Abbv | ) | [inline] |
EmitAbbrev - This emits an abbreviation to the stream. Note that this method takes ownership of the specified abbrev.
Definition at line 473 of file BitstreamWriter.h.
Referenced by WriteConstants(), WriteModuleInfo(), WriteModuleMetadata(), and WriteTypeTable().
unsigned llvm::BitstreamWriter::EmitBlockInfoAbbrev | ( | unsigned | BlockID, |
BitCodeAbbrev * | Abbv | ||
) | [inline] |
EmitBlockInfoAbbrev - Emit a DEFINE_ABBREV record for the specified BlockID.
Definition at line 515 of file BitstreamWriter.h.
References llvm::bitc::FIRST_APPLICATION_ABBREV.
Referenced by WriteBlockInfo().
void llvm::BitstreamWriter::EmitCode | ( | unsigned | Val | ) | [inline] |
EmitCode - Emit the specified code.
Definition at line 178 of file BitstreamWriter.h.
References Emit().
Referenced by EmitRecord(), EnterSubblock(), and ExitBlock().
void llvm::BitstreamWriter::EmitRecord | ( | unsigned | Code, |
SmallVectorImpl< uintty > & | 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 390 of file BitstreamWriter.h.
References llvm::SmallVectorTemplateCommon< T >::begin(), llvm::tgtok::Code, EmitCode(), EmitRecordWithAbbrev(), EmitVBR(), EmitVBR64(), llvm::SmallVectorImpl< T >::insert(), llvm::SmallVectorTemplateCommon< T >::size(), and llvm::bitc::UNABBREV_RECORD.
Referenced by WriteAttributeGroupTable(), WriteAttributeTable(), writeComdats(), WriteConstants(), WriteFunction(), WriteInstruction(), WriteMDNode(), WriteMetadataAttachment(), WriteModule(), WriteModuleInfo(), WriteModuleMetadata(), WriteModuleMetadataStore(), WriteStringRecord(), WriteTypeTable(), WriteUseList(), and WriteValueSymbolTable().
void llvm::BitstreamWriter::EmitRecordWithAbbrev | ( | unsigned | Abbrev, |
SmallVectorImpl< uintty > & | Vals | ||
) | [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 413 of file BitstreamWriter.h.
Referenced by EmitRecord().
void llvm::BitstreamWriter::EmitRecordWithArray | ( | unsigned | Abbrev, |
SmallVectorImpl< uintty > & | Vals, | ||
StringRef | Array | ||
) | [inline] |
EmitRecordWithArray - Just like EmitRecordWithBlob, works with records that end with an array.
Definition at line 436 of file BitstreamWriter.h.
void llvm::BitstreamWriter::EmitRecordWithArray | ( | unsigned | Abbrev, |
SmallVectorImpl< uintty > & | Vals, | ||
const char * | ArrayData, | ||
unsigned | ArrayLen | ||
) | [inline] |
Definition at line 441 of file BitstreamWriter.h.
void llvm::BitstreamWriter::EmitRecordWithBlob | ( | unsigned | Abbrev, |
SmallVectorImpl< uintty > & | Vals, | ||
StringRef | Blob | ||
) | [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 423 of file BitstreamWriter.h.
void llvm::BitstreamWriter::EmitRecordWithBlob | ( | unsigned | Abbrev, |
SmallVectorImpl< uintty > & | Vals, | ||
const char * | BlobData, | ||
unsigned | BlobLen | ||
) | [inline] |
Definition at line 428 of file BitstreamWriter.h.
void llvm::BitstreamWriter::EmitVBR | ( | uint32_t | Val, |
unsigned | NumBits | ||
) | [inline] |
Definition at line 147 of file BitstreamWriter.h.
References Emit(), and Threshold.
Referenced by EmitRecord(), EmitVBR64(), and EnterSubblock().
void llvm::BitstreamWriter::EmitVBR64 | ( | uint64_t | Val, |
unsigned | NumBits | ||
) | [inline] |
Definition at line 160 of file BitstreamWriter.h.
References Emit(), EmitVBR(), and Threshold.
Referenced by EmitRecord().
void llvm::BitstreamWriter::EnterBlockInfoBlock | ( | unsigned | CodeWidth | ) | [inline] |
EnterBlockInfoBlock - Start emitting the BLOCKINFO_BLOCK.
Definition at line 486 of file BitstreamWriter.h.
References llvm::bitc::BLOCKINFO_BLOCK_ID, and EnterSubblock().
Referenced by WriteBlockInfo().
void llvm::BitstreamWriter::EnterSubblock | ( | unsigned | BlockID, |
unsigned | CodeLen | ||
) | [inline] |
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(), and getBlockInfo().
Referenced by EnterBlockInfoBlock(), WriteAttributeGroupTable(), WriteAttributeTable(), WriteConstants(), WriteFunction(), WriteFunctionLocalMetadata(), WriteMetadataAttachment(), WriteModule(), WriteModuleMetadata(), WriteModuleMetadataStore(), WriteTypeTable(), WriteUseListBlock(), and WriteValueSymbolTable().
void llvm::BitstreamWriter::ExitBlock | ( | ) | [inline] |
Definition at line 229 of file BitstreamWriter.h.
References EmitCode(), llvm::bitc::END_BLOCK, and FlushToWord().
Referenced by WriteAttributeGroupTable(), WriteAttributeTable(), WriteBlockInfo(), WriteConstants(), WriteFunction(), WriteFunctionLocalMetadata(), WriteMetadataAttachment(), WriteModule(), WriteModuleMetadata(), WriteModuleMetadataStore(), WriteTypeTable(), WriteUseListBlock(), and WriteValueSymbolTable().
void llvm::BitstreamWriter::FlushToWord | ( | ) | [inline] |
Definition at line 139 of file BitstreamWriter.h.
Referenced by EnterSubblock(), and ExitBlock().
BlockInfo* llvm::BitstreamWriter::getBlockInfo | ( | unsigned | BlockID | ) | [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 EnterSubblock().
uint64_t llvm::BitstreamWriter::GetCurrentBitNo | ( | ) | const [inline] |
Retrieve the current position in the stream, in bits.
Definition at line 105 of file BitstreamWriter.h.