GCC Middle and Back End API Reference
ana::string_scan Struct Reference

#include <string-scan.h>

Collaboration diagram for ana::string_scan:

Public Types

enum class  state { found_nul , found_poison , beyond_domain , cannot_scan }
using byte_offset_type = concrete_byte_offset

Public Member Functions

 string_scan (byte_offset_type byte_offset, enum statestate statestate)
 string_scan (byte_offset_type byte_offset, enum poison_kind poison_kind_)
bool operator== (const string_scan &other) const
void dump_to_pp (pretty_printer *pp) const
void dump () const

Static Public Member Functions

static string_scan found_nul (byte_offset_type byte_offset)
static string_scan found_poison (byte_offset_type byte_offset, enum poison_kind poison_kind_)
static string_scan beyond_domain (byte_offset_type byte_offset)
static string_scan cannot_scan (byte_offset_type byte_offset)
static const char * state_to_string (enum state s)

Data Fields

byte_offset_type m_byte_offset
enum state m_state
enum poison_kind m_poison_kind

Detailed Description

A class representing the result of a scan through a bit_vector,
bit_contents, or constant at some start offset looking for the first of:
- NUL terminator (if any), or
- an access that will trigger a diagnostic (if any), e.g. uninitialized, or
- exhausting the domain of the input

Records what happened, and the offset at which it happened.  The
offset is relative to the start of the buffer, rather than the given
start offset, i.e. they are both in the same "coordinate system".
For exhausted data, this will be the index of one past the last
valid element, i.e. the size of the bit_vector/constant.   

Member Typedef Documentation

◆ byte_offset_type

Member Enumeration Documentation

◆ state

enum class ana::string_scan::state
strong
Enumerator
found_nul 
found_poison 
beyond_domain 
cannot_scan 

Constructor & Destructor Documentation

◆ string_scan() [1/2]

ana::string_scan::string_scan ( byte_offset_type byte_offset,
enum state state )
inline

◆ string_scan() [2/2]

ana::string_scan::string_scan ( byte_offset_type byte_offset,
enum poison_kind poison_kind_ )
inline

Member Function Documentation

◆ beyond_domain()

string_scan ana::string_scan::beyond_domain ( byte_offset_type byte_offset)
inlinestatic

References beyond_domain, and string_scan().

◆ cannot_scan()

string_scan ana::string_scan::cannot_scan ( byte_offset_type byte_offset)
inlinestatic

References cannot_scan, and string_scan().

◆ dump()

void ana::string_scan::dump ( ) const

◆ dump_to_pp()

void ana::string_scan::dump_to_pp ( pretty_printer * pp) const

◆ found_nul()

string_scan ana::string_scan::found_nul ( byte_offset_type byte_offset)
inlinestatic

References found_nul, and string_scan().

◆ found_poison()

string_scan ana::string_scan::found_poison ( byte_offset_type byte_offset,
enum poison_kind poison_kind_ )
inlinestatic

References string_scan().

Referenced by string_scan().

◆ operator==()

bool ana::string_scan::operator== ( const string_scan & other) const
inline

◆ state_to_string()

const char * ana::string_scan::state_to_string ( enum state s)
static

Field Documentation

◆ m_byte_offset

byte_offset_type ana::string_scan::m_byte_offset

◆ m_poison_kind

enum poison_kind ana::string_scan::m_poison_kind

Referenced by string_scan(), and string_scan().

◆ m_state

enum state ana::string_scan::m_state

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