Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.0.0git
Public Member Functions |Friends |List of all members
llvm::DataExtractor::Cursor Class Reference

A class representing a position in aDataExtractor, 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 thisCursor.
 
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 thisCursor, if any.
 

Friends

class DataExtractor
 

Detailed Description

A class representing a position in aDataExtractor, 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 anError 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 theCursor offset. After clearing the error flag, one can again use theCursor object for parsing.

Definition at line54 of fileDataExtractor.h.

Constructor & Destructor Documentation

◆ Cursor()

llvm::DataExtractor::Cursor::Cursor(uint64_t Offset)
inlineexplicit

Construct a cursor for extraction from the given offset.

Definition at line62 of fileDataExtractor.h.

Member Function Documentation

◆ operator bool()

llvm::DataExtractor::Cursor::operatorbool()
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 calltakeError() instead.

Definition at line67 of fileDataExtractor.h.

◆ seek()

void llvm::DataExtractor::Cursor::seek(uint64_t NewOffSet)
inline

Set the cursor to the new offset. This does not impact the error state.

Definition at line74 of fileDataExtractor.h.

ReferencesOffset.

Referenced byllvm::ELFAttributeParser::parseSubsection().

◆ takeError()

Error llvm::DataExtractor::Cursor::takeError()
inline

Return error contained inside thisCursor, if any.

Clears the internalCursor state.

Definition at line78 of fileDataExtractor.h.

Referenced byllvm::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(), andllvm::GCOVBuffer::~GCOVBuffer().

◆ tell()

uint64_t llvm::DataExtractor::Cursor::tell() const
inline

Return the current position of thisCursor.

In the error state this is the position of theCursor before the first error was encountered.

Definition at line71 of fileDataExtractor.h.

ReferencesOffset.

Referenced bydecodeBBAddrMapImpl(),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(), andreadULEB128As().

Friends And Related Function Documentation

◆ DataExtractor

friend classDataExtractor
friend

Definition at line58 of fileDataExtractor.h.


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

Generated on Sun Jul 20 2025 15:55:57 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp