LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | List of all members
llvm::BitstreamWriter Class Reference

#include <BitstreamWriter.h>

Public Member Functions

 BitstreamWriter (SmallVectorImpl< char > &O)
 
 ~BitstreamWriter ()
 
uint64_t GetCurrentBitNo () const
 Retrieve the current position in the stream, in bits. More...
 
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. More...
 
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. More...
 
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)
inlineexplicit

Definition at line 96 of file BitstreamWriter.h.

llvm::BitstreamWriter::~BitstreamWriter ( )
inline

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 140 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 492 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 534 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 188 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 432 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 455 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 460 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 442 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 447 of file BitstreamWriter.h.

void llvm::BitstreamWriter::EmitVBR ( uint32_t  Val,
unsigned  NumBits 
)
inline

Definition at line 157 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 170 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 505 of file BitstreamWriter.h.

References llvm::bitc::BLOCKINFO_BLOCK_ID, and EnterSubblock().

Referenced by WriteBlockInfo().

void llvm::BitstreamWriter::EnterSubblock ( unsigned  BlockID,
unsigned  CodeLen 
)
inline
void llvm::BitstreamWriter::ExitBlock ( )
inline
void llvm::BitstreamWriter::FlushToWord ( )
inline

Definition at line 149 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 198 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 115 of file BitstreamWriter.h.


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