|
LLVM
10.0.0
|
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. More... | |
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. More... | |
| uint64_t | getCurrentByteNo () const |
| ArrayRef< uint8_t > | getBitcodeBytes () const |
| Error | JumpToBit (uint64_t BitNo) |
| Reset the stream to the specified bit number. More... | |
| const uint8_t * | getPointerToByte (uint64_t ByteNo, uint64_t NumBytes) |
| Get a pointer into the bitstream at the specified byte offset. More... | |
| const uint8_t * | getPointerToBit (uint64_t BitNo, uint64_t NumBytes) |
| Get a pointer into the bitstream at the specified bit offset. More... | |
| Error | fillCurWord () |
| Expected< word_t > | Read (unsigned NumBits) |
| Expected< uint32_t > | ReadVBR (unsigned NumBits) |
| Expected< uint64_t > | ReadVBR64 (unsigned NumBits) |
| void | SkipToFourByteBoundary () |
| size_t | SizeInBytes () const |
| Return the size of the stream in bytes. More... | |
| void | skipToEnd () |
| Skip to the end of the file. More... | |
Static Public Attributes | |
| static const constexpr size_t | MaxChunkSize = sizeof(word_t) * 8 |
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.
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 103 of file BitstreamReader.h.
|
inlineexplicit |
Definition at line 105 of file BitstreamReader.h.
|
inlineexplicit |
Definition at line 107 of file BitstreamReader.h.
|
inline |
Definition at line 115 of file BitstreamReader.h.
References llvm::ArrayRef< T >::size().
Referenced by llvm::BitcodeAnalyzer::analyze(), llvm::remarks::BitstreamParserHelper::atEndOfStream(), llvm::BitstreamCursor::BitstreamCursor(), llvm::BitstreamCursor::EnterSubBlock(), parseBlock(), and readIdentificationCode().
Definition at line 110 of file BitstreamReader.h.
References llvm::ArrayRef< T >::size().
Referenced by llvm::BitstreamCursor::BitstreamCursor(), hasInvalidBitcodeHeader(), and llvm::BitstreamCursor::readRecord().
|
inline |
Definition at line 163 of file BitstreamReader.h.
References B, llvm::createStringError(), llvm::ArrayRef< T >::data(), llvm::ArrayRef< T >::size(), and llvm::Error::success().
Referenced by llvm::BitstreamCursor::BitstreamCursor().
|
inline |
Definition at line 127 of file BitstreamReader.h.
Referenced by analyzeHeader(), llvm::BitstreamCursor::BitstreamCursor(), llvm::getBitcodeFileContents(), and llvm::BitcodeAnalyzer::printStats().
|
inline |
Return the bit # of the bit we are reading.
Definition at line 120 of file BitstreamReader.h.
Referenced by llvm::BitstreamCursor::BitstreamCursor(), llvm::getBitcodeFileContents(), isBlock(), jumpToValueSymbolTable(), llvm::MetadataLoader::MetadataLoaderImpl::parseMetadata(), llvm::BitcodeAnalyzer::printStats(), llvm::BitstreamCursor::readRecord(), and llvm::MetadataLoader::MetadataLoaderImpl::upgradeDebugIntrinsics().
|
inline |
Definition at line 125 of file BitstreamReader.h.
Referenced by llvm::BitstreamCursor::BitstreamCursor(), and llvm::getBitcodeFileContents().
|
inline |
Get a pointer into the bitstream at the specified bit offset.
The bit offset must be on a byte boundary.
Definition at line 158 of file BitstreamReader.h.
References assert().
|
inline |
Get a pointer into the bitstream at the specified byte offset.
Definition at line 151 of file BitstreamReader.h.
References llvm::ArrayRef< T >::data().
Referenced by llvm::BitstreamCursor::BitstreamCursor().
|
inline |
Reset the stream to the specified bit number.
Definition at line 130 of file BitstreamReader.h.
References assert(), and llvm::Error::success().
Referenced by llvm::BitstreamCursor::BitstreamCursor(), llvm::BitcodeModule::getLTOInfo(), llvm::BitcodeModule::getSummary(), isBlock(), jumpToValueSymbolTable(), and llvm::BitcodeModule::readSummary().
Definition at line 189 of file BitstreamReader.h.
References assert(), llvm::createStringError(), llvm::BitmaskEnumDetail::Mask(), and R2.
Referenced by llvm::BitstreamCursor::BitstreamCursor(), llvm::BitstreamCursor::EnterSubBlock(), hasInvalidBitcodeHeader(), llvm::remarks::BitstreamParserHelper::parseMagic(), readAbbreviatedField(), llvm::BitstreamCursor::ReadAbbrevRecord(), llvm::BitstreamCursor::readRecord(), and ReadSignature().
Definition at line 232 of file BitstreamReader.h.
References llvm::Expected< T >::get().
Referenced by llvm::BitstreamCursor::BitstreamCursor(), llvm::BitstreamCursor::EnterSubBlock(), llvm::BitstreamCursor::ReadAbbrevRecord(), llvm::BitstreamCursor::readRecord(), and llvm::BitstreamCursor::skipRecord().
Definition at line 259 of file BitstreamReader.h.
References llvm::Expected< T >::get().
Referenced by llvm::BitstreamCursor::BitstreamCursor(), readAbbreviatedField(), llvm::BitstreamCursor::ReadAbbrevRecord(), llvm::BitstreamCursor::readRecord(), and llvm::BitstreamCursor::skipRecord().
|
inline |
Return the size of the stream in bytes.
Definition at line 298 of file BitstreamReader.h.
References llvm::ArrayRef< T >::size().
Referenced by llvm::BitstreamCursor::BitstreamCursor().
|
inline |
Skip to the end of the file.
Definition at line 301 of file BitstreamReader.h.
References llvm::ArrayRef< T >::size().
Referenced by llvm::BitstreamCursor::BitstreamCursor(), llvm::BitstreamCursor::readRecord(), and llvm::remarks::BitstreamParserHelper::skipToEnd().
|
inline |
Definition at line 284 of file BitstreamReader.h.
Referenced by llvm::BitstreamCursor::EnterSubBlock(), and llvm::BitstreamCursor::readRecord().
Definition at line 100 of file BitstreamReader.h.
1.8.13