LLVM API Documentation

Classes | Public Member Functions
llvm::BitstreamWriter Class Reference

#include <BitstreamWriter.h>

List of all members.

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)

Detailed Description

Definition at line 25 of file BitstreamWriter.h.


Constructor & Destructor Documentation

llvm::BitstreamWriter::BitstreamWriter ( SmallVectorImpl< char > &  O) [inline, explicit]

Definition at line 96 of file BitstreamWriter.h.

Definition at line 99 of file BitstreamWriter.h.


Member Function Documentation

void llvm::BitstreamWriter::Emit ( uint32_t  Val,
unsigned  NumBits 
) [inline]
void llvm::BitstreamWriter::Emit64 ( uint64_t  Val,
unsigned  NumBits 
) [inline]

Definition at line 130 of file BitstreamWriter.h.

References Emit().

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().

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().

template<typename uintty >
void llvm::BitstreamWriter::EmitRecord ( unsigned  Code,
SmallVectorImpl< uintty > &  Vals,
unsigned  Abbrev = 0 
) [inline]
template<typename uintty >
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().

template<typename uintty >
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.

template<typename uintty >
void llvm::BitstreamWriter::EmitRecordWithArray ( unsigned  Abbrev,
SmallVectorImpl< uintty > &  Vals,
const char *  ArrayData,
unsigned  ArrayLen 
) [inline]

Definition at line 441 of file BitstreamWriter.h.

template<typename uintty >
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.

template<typename uintty >
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().

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 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.


The documentation for this class was generated from the following file: