class BitstreamCursor

Declaration

class BitstreamCursor : private SimpleBitstreamCursor { /* full declaration omitted */ };

Description

This represents a position within a bitcode file, implemented on top of a SimpleBitstreamCursor. Unlike iterators, BitstreamCursors are heavy-weight objects that should not be passed by value.

Declared at: llvm/include/llvm/Bitstream/BitstreamReader.h:339

Inherits from: SimpleBitstreamCursor

Member Variables

public static const size_t MaxChunkSize = sizeof(unsigned long) * 8

Method Overview

Methods

BitstreamCursor(ArrayRef<uint8_t> BitcodeBytes)

Declared at: llvm/include/llvm/Bitstream/BitstreamReader.h:363

Parameters

ArrayRef<uint8_t> BitcodeBytes

BitstreamCursor(llvm::StringRef BitcodeBytes)

Declared at: llvm/include/llvm/Bitstream/BitstreamReader.h:365

Parameters

llvm::StringRef BitcodeBytes

BitstreamCursor(
    llvm::MemoryBufferRef BitcodeBytes)

Declared at: llvm/include/llvm/Bitstream/BitstreamReader.h:367

Parameters

llvm::MemoryBufferRef BitcodeBytes

BitstreamCursor()

Declared at: llvm/include/llvm/Bitstream/BitstreamReader.h:362

llvm::Error EnterSubBlock(
    unsigned int BlockID,
    unsigned int* NumWordsP = nullptr)

Description

Having read the ENTER_SUBBLOCK abbrevid, and enter the block.

Declared at: llvm/include/llvm/Bitstream/BitstreamReader.h:497

Parameters

unsigned int BlockID
unsigned int* NumWordsP = nullptr

llvm::Error ReadAbbrevRecord()

Declared at: llvm/include/llvm/Bitstream/BitstreamReader.h:541

bool ReadBlockEnd()

Declared at: llvm/include/llvm/Bitstream/BitstreamReader.h:499

Expected<Optional<llvm::BitstreamBlockInfo>>
ReadBlockInfoBlock(
    bool ReadBlockInfoNames = false)

Description

Read and return a block info block from the bitstream. If an error was encountered, return None.

Declared at: llvm/include/llvm/Bitstream/BitstreamReader.h:549

Parameters

bool ReadBlockInfoNames = false
Whether to read block/record name information in the BlockInfo block. Only llvm-bcanalyzer uses this.

Expected<unsigned int> ReadCode()

Declared at: llvm/include/llvm/Bitstream/BitstreamReader.h:455

Expected<unsigned int> ReadSubBlockID()

Description

Having read the ENTER_SUBBLOCK code, read the BlockID for the block.

Declared at: llvm/include/llvm/Bitstream/BitstreamReader.h:461

llvm::Error SkipBlock()

Description

Having read the ENTER_SUBBLOCK abbrevid and a BlockID, skip over the body of this block.

Declared at: llvm/include/llvm/Bitstream/BitstreamReader.h:465

Expected<llvm::BitstreamEntry> advance(
    unsigned int Flags = 0)

Description

Advance the current bitstream, returning the next entry in the stream.

Declared at: llvm/include/llvm/Bitstream/BitstreamReader.h:399

Parameters

unsigned int Flags = 0

Expected<llvm::BitstreamEntry>
advanceSkippingSubblocks(unsigned int Flags = 0)

Description

This is a convenience function for clients that don't expect any subblocks. This just skips over them automatically.

Declared at: llvm/include/llvm/Bitstream/BitstreamReader.h:438

Parameters

unsigned int Flags = 0

const llvm::BitCodeAbbrev* getAbbrev(
    unsigned int AbbrevID)

Description

Return the abbreviation for the specified AbbrevId.

Declared at: llvm/include/llvm/Bitstream/BitstreamReader.h:524

Parameters

unsigned int AbbrevID

unsigned int getAbbrevIDWidth() const

Description

Return the number of bits used to encode an abbrev #.

Declared at: llvm/include/llvm/Bitstream/BitstreamReader.h:385

Expected<unsigned int> readRecord(
    unsigned int AbbrevID,
    SmallVectorImpl<uint64_t>& Vals,
    llvm::StringRef* Blob = nullptr)

Declared at: llvm/include/llvm/Bitstream/BitstreamReader.h:534

Parameters

unsigned int AbbrevID
SmallVectorImpl<uint64_t>& Vals
llvm::StringRef* Blob = nullptr

void setBlockInfo(llvm::BitstreamBlockInfo* BI)

Description

Set the block info to be used by this BitstreamCursor to interpret abbreviated records.

Declared at: llvm/include/llvm/Bitstream/BitstreamReader.h:553

Parameters

llvm::BitstreamBlockInfo* BI

Expected<unsigned int> skipRecord(
    unsigned int AbbrevID)

Description

Read the current record and discard it, returning the code for the record.

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

Parameters

unsigned int AbbrevID