LLVM 20.0.0git
|
A class representing a position in a DataExtractor, as well as any error encountered during extraction. More...
#include "llvm/Support/DataExtractor.h"
Public Member Functions | |
Cursor (uint64_t Offset) | |
Construct a cursor for extraction from the given offset. | |
operator bool () | |
Checks whether the cursor is valid (i.e. | |
uint64_t | tell () const |
Return the current position of this Cursor. | |
void | seek (uint64_t NewOffSet) |
Set the cursor to the new offset. This does not impact the error state. | |
Error | takeError () |
Return error contained inside this Cursor, if any. | |
Friends | |
class | DataExtractor |
A class representing a position in a DataExtractor, as well as any error encountered during extraction.
It enables one to extract a sequence of values without error-checking and then checking for errors in bulk at the end. The class holds an Error object, so failing to check the result of the parse will result in a runtime error. The error flag is sticky and will cause all subsequent extraction functions to fail without even attempting to parse and without updating the Cursor offset. After clearing the error flag, one can again use the Cursor object for parsing.
Definition at line 54 of file DataExtractor.h.
|
inlineexplicit |
Construct a cursor for extraction from the given offset.
Definition at line 62 of file DataExtractor.h.
|
inlineexplicit |
Checks whether the cursor is valid (i.e.
no errors were encountered). In case of errors, this does not clear the error flag – one must call takeError() instead.
Definition at line 67 of file DataExtractor.h.
|
inline |
Set the cursor to the new offset. This does not impact the error state.
Definition at line 74 of file DataExtractor.h.
References Offset.
Referenced by llvm::ELFAttributeParser::parseSubsection().
|
inline |
Return error contained inside this Cursor, if any.
Clears the internal Cursor state.
Definition at line 78 of file DataExtractor.h.
Referenced by llvm::object::ELFFile< ELFT >::android_relas(), decodeBBAddrMapImpl(), llvm::object::decodeCrel(), llvm::ELFAttributeParser::parse(), llvm::DWARFDebugLine::LineTable::parse(), llvm::DWARFDebugLine::Prologue::parse(), llvm::ELFAttributeParser::parseSubsection(), llvm::ELFAttributeParser::~ELFAttributeParser(), and llvm::GCOVBuffer::~GCOVBuffer().
|
inline |
Return the current position of this Cursor.
In the error state this is the position of the Cursor before the first error was encountered.
Definition at line 71 of file DataExtractor.h.
References Offset.
Referenced by decodeBBAddrMapImpl(), llvm::AMDGPUDisassembler::decodeKernelDescriptorDirective(), llvm::ELFAttributeParser::parse(), llvm::DWARFDebugLine::LineTable::parse(), llvm::DWARFDebugLine::Prologue::parse(), llvm::ELFAttributeParser::parseAttributeList(), llvm::ELFAttributeParser::parseSubsection(), llvm::GCOVFile::readGCDA(), llvm::GCOVFile::readGCNO(), llvm::GCOVBuffer::readInt(), and readULEB128As().
|
friend |
Definition at line 58 of file DataExtractor.h.