LLVM  3.7.0
Classes | Public Member Functions | List of all members
llvm::BitstreamReader Class Reference

This class is used to read from an LLVM bitcode stream, maintaining information that is global to decoding the entire file. More...

#include <BitstreamReader.h>

Classes

struct  BlockInfo
 This contains information emitted to BLOCKINFO_BLOCK blocks. More...
 

Public Member Functions

 BitstreamReader ()
 
 BitstreamReader (const unsigned char *Start, const unsigned char *End)
 
 BitstreamReader (std::unique_ptr< MemoryObject > BitcodeBytes)
 
 BitstreamReader (BitstreamReader &&Other)
 
BitstreamReaderoperator= (BitstreamReader &&Other)
 
void init (const unsigned char *Start, const unsigned char *End)
 
MemoryObjectgetBitcodeBytes ()
 
void CollectBlockInfoNames ()
 This is called by clients that want block/record name information. More...
 
bool isIgnoringBlockInfoNames ()
 
bool hasBlockInfoRecords () const
 Return true if we've already read and processed the block info block for this Bitstream. More...
 
const BlockInfogetBlockInfo (unsigned BlockID) const
 If there is block info for the specified ID, return it, otherwise return null. More...
 
BlockInfogetOrCreateBlockInfo (unsigned BlockID)
 
void takeBlockInfo (BitstreamReader &&Other)
 Takes block info from the other bitstream reader. More...
 

Detailed Description

This class is used to read from an LLVM bitcode stream, maintaining information that is global to decoding the entire file.

While a file is being read, multiple cursors can be independently advanced or skipped around within the file. These are represented by the BitstreamCursor class.

Definition at line 31 of file BitstreamReader.h.

Constructor & Destructor Documentation

llvm::BitstreamReader::BitstreamReader ( )
inline

Definition at line 54 of file BitstreamReader.h.

llvm::BitstreamReader::BitstreamReader ( const unsigned char *  Start,
const unsigned char *  End 
)
inline

Definition at line 57 of file BitstreamReader.h.

References init().

llvm::BitstreamReader::BitstreamReader ( std::unique_ptr< MemoryObject BitcodeBytes)
inline

Definition at line 62 of file BitstreamReader.h.

llvm::BitstreamReader::BitstreamReader ( BitstreamReader &&  Other)
inline

Definition at line 65 of file BitstreamReader.h.

References Other.

Member Function Documentation

void llvm::BitstreamReader::CollectBlockInfoNames ( )
inline

This is called by clients that want block/record name information.

Definition at line 85 of file BitstreamReader.h.

MemoryObject& llvm::BitstreamReader::getBitcodeBytes ( )
inline
const BlockInfo* llvm::BitstreamReader::getBlockInfo ( unsigned  BlockID) const
inline

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

Definition at line 99 of file BitstreamReader.h.

Referenced by llvm::BitstreamCursor::EnterSubBlock(), and getOrCreateBlockInfo().

BlockInfo& llvm::BitstreamReader::getOrCreateBlockInfo ( unsigned  BlockID)
inline

Definition at line 111 of file BitstreamReader.h.

References getBlockInfo().

Referenced by llvm::BitstreamCursor::ReadBlockInfoBlock().

bool llvm::BitstreamReader::hasBlockInfoRecords ( ) const
inline

Return true if we've already read and processed the block info block for this Bitstream.

We only process it for the first cursor that walks over it.

Definition at line 95 of file BitstreamReader.h.

Referenced by llvm::BitstreamCursor::ReadBlockInfoBlock(), and takeBlockInfo().

void llvm::BitstreamReader::init ( const unsigned char *  Start,
const unsigned char *  End 
)
inline

Definition at line 77 of file BitstreamReader.h.

References llvm::getNonStreamedMemoryObject().

Referenced by BitstreamReader().

bool llvm::BitstreamReader::isIgnoringBlockInfoNames ( )
inline

Definition at line 86 of file BitstreamReader.h.

Referenced by llvm::BitstreamCursor::ReadBlockInfoBlock().

BitstreamReader& llvm::BitstreamReader::operator= ( BitstreamReader &&  Other)
inline

Definition at line 69 of file BitstreamReader.h.

References Other, and std::swap().

void llvm::BitstreamReader::takeBlockInfo ( BitstreamReader &&  Other)
inline

Takes block info from the other bitstream reader.

This is a "take" operation because BlockInfo records are non-trivial, and indeed rather expensive.

Definition at line 125 of file BitstreamReader.h.

References hasBlockInfoRecords(), and Other.


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