LLVM 22.0.0git
|
This represents a position within a bitstream. More...
#include "llvm/Bitstream/BitstreamReader.h"
Public Types | |
using | word_t = size_t |
This is the current data we have pulled from the stream but have not returned to the client. | |
Public Member Functions | |
SimpleBitstreamCursor ()=default | |
SimpleBitstreamCursor (ArrayRef< uint8_t > BitcodeBytes) | |
SimpleBitstreamCursor (StringRef BitcodeBytes) | |
SimpleBitstreamCursor (MemoryBufferRef BitcodeBytes) | |
bool | canSkipToPos (size_t pos) const |
bool | AtEndOfStream () |
uint64_t | GetCurrentBitNo () const |
Return the bit # of the bit we are reading. | |
uint64_t | getCurrentByteNo () const |
ArrayRef< uint8_t > | getBitcodeBytes () const |
Error | JumpToBit (uint64_t BitNo) |
Reset the stream to the specified bit number. | |
const uint8_t * | getPointerToByte (uint64_t ByteNo, uint64_t NumBytes) |
Get a pointer into the bitstream at the specified byte offset. | |
const uint8_t * | getPointerToBit (uint64_t BitNo, uint64_t NumBytes) |
Get a pointer into the bitstream at the specified bit offset. | |
Error | fillCurWord () |
Expected< word_t > | Read (unsigned NumBits) |
Expected< uint32_t > | ReadVBR (const unsigned NumBits) |
Expected< uint64_t > | ReadVBR64 (const unsigned NumBits) |
void | SkipToFourByteBoundary () |
size_t | SizeInBytes () const |
Return the size of the stream in bytes. | |
void | skipToEnd () |
Skip to the end of the file. | |
bool | isSizePlausible (size_t Size) const |
Check whether a reservation of Size elements is plausible. | |
This represents a position within a bitstream.
There may be multiple independent cursors reading within one bitstream, each maintaining their own local state.
Definition at line 80 of file BitstreamReader.h.
using llvm::SimpleBitstreamCursor::word_t = size_t |
This is the current data we have pulled from the stream but have not returned to the client.
This is specifically and intentionally defined to follow the word size of the host machine for efficiency. We use word_t in places that are aware of this to make it perfectly explicit what is going on.
Definition at line 90 of file BitstreamReader.h.
|
default |
|
inlineexplicit |
Definition at line 101 of file BitstreamReader.h.
|
inlineexplicit |
Definition at line 103 of file BitstreamReader.h.
|
inlineexplicit |
Definition at line 105 of file BitstreamReader.h.
|
inline |
Definition at line 113 of file BitstreamReader.h.
References llvm::ArrayRef< T >::size().
|
inline |
Definition at line 108 of file BitstreamReader.h.
References llvm::ArrayRef< T >::size().
Referenced by JumpToBit().
|
inline |
Definition at line 161 of file BitstreamReader.h.
References B, llvm::createStringError(), llvm::ArrayRef< T >::data(), llvm::ArrayRef< T >::size(), and llvm::Error::success().
Referenced by Read().
Definition at line 125 of file BitstreamReader.h.
|
inline |
Return the bit # of the bit we are reading.
Definition at line 118 of file BitstreamReader.h.
Referenced by getCurrentByteNo().
|
inline |
Definition at line 123 of file BitstreamReader.h.
References GetCurrentBitNo().
|
inline |
Get a pointer into the bitstream at the specified bit offset.
The bit offset must be on a byte boundary.
Definition at line 156 of file BitstreamReader.h.
References assert(), and getPointerToByte().
Referenced by llvm::BitstreamCursor::readRecord().
|
inline |
Get a pointer into the bitstream at the specified byte offset.
Definition at line 149 of file BitstreamReader.h.
References llvm::ArrayRef< T >::data().
Referenced by getPointerToBit().
|
inline |
Check whether a reservation of Size elements is plausible.
Definition at line 316 of file BitstreamReader.h.
References llvm::ArrayRef< T >::size(), and Size.
Referenced by llvm::BitstreamCursor::readRecord().
Reset the stream to the specified bit number.
Definition at line 128 of file BitstreamReader.h.
References assert(), canSkipToPos(), llvm::Read, and llvm::Error::success().
Definition at line 186 of file BitstreamReader.h.
References assert(), llvm::createStringError(), fillCurWord(), and R2.
Definition at line 229 of file BitstreamReader.h.
References assert(), llvm::createStringError(), llvm::Expected< T >::get(), and llvm::Read.
Definition at line 264 of file BitstreamReader.h.
References assert(), llvm::createStringError(), llvm::Expected< T >::get(), and llvm::Read.
|
inline |
Return the size of the stream in bytes.
Definition at line 310 of file BitstreamReader.h.
References llvm::ArrayRef< T >::size().
|
inline |
Skip to the end of the file.
Definition at line 313 of file BitstreamReader.h.
References llvm::ArrayRef< T >::size().
|
inline |
Definition at line 296 of file BitstreamReader.h.
Referenced by llvm::BitstreamCursor::EnterSubBlock(), llvm::BitstreamCursor::ReadBlockEnd(), llvm::BitstreamCursor::readRecord(), llvm::BitstreamCursor::SkipBlock(), and llvm::BitstreamCursor::skipRecord().