class BitstreamWriter

Declaration

class BitstreamWriter { /* full declaration omitted */ };

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:27

Method Overview

  • public void BackpatchWord(uint64_t BitNo, unsigned int NewWord)
  • public void BackpatchWord64(uint64_t BitNo, uint64_t Val)
  • public BitstreamWriter(SmallVectorImpl<char> & O)
  • public void Emit(uint32_t Val, unsigned int NumBits)
  • public unsigned int EmitAbbrev(std::shared_ptr<BitCodeAbbrev> Abbv)
  • public unsigned int EmitBlockInfoAbbrev(unsigned int BlockID, std::shared_ptr<BitCodeAbbrev> Abbv)
  • public void EmitCode(unsigned int Val)
  • public template <typename Container>void EmitRecord(unsigned int Code, const Container & Vals, unsigned int Abbrev = 0)
  • public template <typename Container>void EmitRecordWithAbbrev(unsigned int Abbrev, const Container & Vals)
  • public template <typename Container>void EmitRecordWithArray(unsigned int Abbrev, const Container & Vals, const char * ArrayData, unsigned int ArrayLen)
  • public template <typename Container>void EmitRecordWithArray(unsigned int Abbrev, const Container & Vals, llvm::StringRef Array)
  • public template <typename Container>void EmitRecordWithBlob(unsigned int Abbrev, const Container & Vals, const char * BlobData, unsigned int BlobLen)
  • public template <typename Container>void EmitRecordWithBlob(unsigned int Abbrev, const Container & Vals, llvm::StringRef Blob)
  • public void EmitVBR(uint32_t Val, unsigned int NumBits)
  • public void EmitVBR64(uint64_t Val, unsigned int NumBits)
  • public void EnterBlockInfoBlock()
  • public void EnterSubblock(unsigned int BlockID, unsigned int CodeLen)
  • public void ExitBlock()
  • public void FlushToWord()
  • public unsigned int GetAbbrevIDWidth() const
  • public uint64_t GetCurrentBitNo() const
  • public void emitBlob(llvm::StringRef Bytes, bool ShouldEmitSize = true)
  • public template <class UIntTy>void emitBlob(ArrayRef<UIntTy> Bytes, bool ShouldEmitSize = true)
  • public llvm::BitstreamWriter::BlockInfo * getBlockInfo(unsigned int BlockID)
  • public ~BitstreamWriter()

Methods

void BackpatchWord(uint64_t BitNo,
                   unsigned int NewWord)

Description

Backpatch a 32-bit word in the output at the given bit offset with the specified value.

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:104

Parameters

uint64_t BitNo
unsigned int NewWord

void BackpatchWord64(uint64_t BitNo, uint64_t Val)

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:114

Parameters

uint64_t BitNo
uint64_t Val

BitstreamWriter(SmallVectorImpl<char>& O)

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:84

Parameters

SmallVectorImpl<char>& O

void Emit(uint32_t Val, unsigned int NumBits)

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:119

Parameters

uint32_t Val
unsigned int NumBits

unsigned int EmitAbbrev(
    std::shared_ptr<BitCodeAbbrev> Abbv)

Description

Emits the abbreviation \p Abbv to the stream.

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:490

Parameters

std::shared_ptr<BitCodeAbbrev> Abbv

unsigned int EmitBlockInfoAbbrev(
    unsigned int BlockID,
    std::shared_ptr<BitCodeAbbrev> Abbv)

Description

EmitBlockInfoAbbrev - Emit a DEFINE_ABBREV record for the specified BlockID.

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:532

Parameters

unsigned int BlockID
std::shared_ptr<BitCodeAbbrev> Abbv

void EmitCode(unsigned int Val)

Description

EmitCode - Emit the specified code.

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:177

Parameters

unsigned int Val

template <typename Container>
void EmitRecord(unsigned int Code,
                const Container& Vals,
                unsigned int Abbrev = 0)

Description

EmitRecord - Emit the specified record to the stream, using an abbrev if we have one to compress the output.

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:410

Templates

Container

Parameters

unsigned int Code
const Container& Vals
unsigned int Abbrev = 0

template <typename Container>
void EmitRecordWithAbbrev(unsigned int Abbrev,
                          const Container& Vals)

Description

EmitRecordWithAbbrev - Emit a record with the specified abbreviation. Unlike EmitRecord, the code for the record should be included in Vals as the first entry.

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:430

Templates

Container

Parameters

unsigned int Abbrev
const Container& Vals

template <typename Container>
void EmitRecordWithArray(unsigned int Abbrev,
                         const Container& Vals,
                         const char* ArrayData,
                         unsigned int ArrayLen)

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:459

Templates

Container

Parameters

unsigned int Abbrev
const Container& Vals
const char* ArrayData
unsigned int ArrayLen

template <typename Container>
void EmitRecordWithArray(unsigned int Abbrev,
                         const Container& Vals,
                         llvm::StringRef Array)

Description

EmitRecordWithArray - Just like EmitRecordWithBlob, works with records that end with an array.

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:454

Templates

Container

Parameters

unsigned int Abbrev
const Container& Vals
llvm::StringRef Array

template <typename Container>
void EmitRecordWithBlob(unsigned int Abbrev,
                        const Container& Vals,
                        const char* BlobData,
                        unsigned int BlobLen)

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:445

Templates

Container

Parameters

unsigned int Abbrev
const Container& Vals
const char* BlobData
unsigned int BlobLen

template <typename Container>
void EmitRecordWithBlob(unsigned int Abbrev,
                        const Container& Vals,
                        llvm::StringRef Blob)

Description

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.

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:440

Templates

Container

Parameters

unsigned int Abbrev
const Container& Vals
llvm::StringRef Blob

void EmitVBR(uint32_t Val, unsigned int NumBits)

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:146

Parameters

uint32_t Val
unsigned int NumBits

void EmitVBR64(uint64_t Val, unsigned int NumBits)

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:159

Parameters

uint64_t Val
unsigned int NumBits

void EnterBlockInfoBlock()

Description

EnterBlockInfoBlock - Start emitting the BLOCKINFO_BLOCK.

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:502

void EnterSubblock(unsigned int BlockID,
                   unsigned int CodeLen)

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:199

Parameters

unsigned int BlockID
unsigned int CodeLen

void ExitBlock()

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:228

void FlushToWord()

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:138

unsigned int GetAbbrevIDWidth() const

Description

Retrieve the number of bits currently used to encode an abbrev ID.

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:96

uint64_t GetCurrentBitNo() const

Description

Retrieve the current position in the stream, in bits.

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:93

void emitBlob(llvm::StringRef Bytes,
              bool ShouldEmitSize = true)

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:402

Parameters

llvm::StringRef Bytes
bool ShouldEmitSize = true

template <class UIntTy>
void emitBlob(ArrayRef<UIntTy> Bytes,
              bool ShouldEmitSize = true)

Description

Emit a blob, including flushing before and tail-padding.

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:384

Templates

UIntTy

Parameters

ArrayRef<UIntTy> Bytes
bool ShouldEmitSize = true

llvm::BitstreamWriter::BlockInfo* getBlockInfo(
    unsigned int BlockID)

Description

getBlockInfo - If there is block info for the specified ID, return it, otherwise return null.

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:187

Parameters

unsigned int BlockID

~BitstreamWriter()

Declared at: llvm/include/llvm/Bitstream/BitstreamWriter.h:87