class Pointer

Declaration

class Pointer { /* full declaration omitted */ };

Description

A pointer to a memory block, live or dead. This object can be allocated into interpreter stack frames. If pointing to a live block, it is a link in the chain of pointers pointing to the block.

Declared at: clang/lib/AST/Interp/Pointer.h:36

Member Variables

private clang::interp::Block* Pointee = nullptr
The block the pointer is pointing to.
private unsigned int Base = 0
Start of the current subfield.
private unsigned int Offset = 0
Offset into the block.
private clang::interp::Pointer* Prev = nullptr
Previous link in the pointer chain.
private clang::interp::Pointer* Next = nullptr
Next link in the pointer chain.
private static const unsigned int PastEndMark = (unsigned int)-1
private static const unsigned int RootPtrMark = (unsigned int)-1

Method Overview

Methods

Pointer(clang::interp::Block* B)

Declared at: clang/lib/AST/Interp/Pointer.h:43

Parameters

clang::interp::Block* B

Pointer(const clang::interp::Pointer& P)

Declared at: clang/lib/AST/Interp/Pointer.h:44

Parameters

const clang::interp::Pointer& P

Pointer(clang::interp::Pointer&& P)

Declared at: clang/lib/AST/Interp/Pointer.h:45

Parameters

clang::interp::Pointer&& P

Pointer()

Declared at: clang/lib/AST/Interp/Pointer.h:42

Pointer(clang::interp::Block* Pointee,
        unsigned int Base,
        unsigned int Offset)

Declared at: clang/lib/AST/Interp/Pointer.h:313

Parameters

clang::interp::Block* Pointee
unsigned int Base
unsigned int Offset

void activate() const

Description

Activats a field.

Declared at: clang/lib/AST/Interp/Pointer.h:290

clang::interp::Pointer atField(
    unsigned int Off) const

Description

Creates a pointer to a field.

Declared at: clang/lib/AST/Interp/Pointer.h:67

Parameters

unsigned int Off

clang::interp::Pointer atIndex(
    unsigned int Idx) const

Description

Offsets a pointer inside an array.

Declared at: clang/lib/AST/Interp/Pointer.h:55

Parameters

unsigned int Idx

void deactivate() const

Description

Deactivates an entire strurcutre.

Declared at: clang/lib/AST/Interp/Pointer.h:292

template <typename T>
T& deref() const

Description

Dereferences the pointer, if it's live.

Declared at: clang/lib/AST/Interp/Pointer.h:277

Templates

T

template <typename T>
T& elem(unsigned int I) const

Description

Dereferences a primitive element.

Declared at: clang/lib/AST/Interp/Pointer.h:283

Templates

T

Parameters

unsigned int I

size_t elemSize() const

Description

Returns the element size of the innermost field.

Declared at: clang/lib/AST/Interp/Pointer.h:178

clang::interp::Pointer expand() const

Description

Expands a pointer to the containing array, undoing narrowing.

Declared at: clang/lib/AST/Interp/Pointer.h:109

clang::interp::Pointer getArray() const

Description

Returns the parent array.

Declared at: clang/lib/AST/Interp/Pointer.h:158

clang::interp::Pointer getBase() const

Description

Returns a pointer to the object of which this pointer is a field.

Declared at: clang/lib/AST/Interp/Pointer.h:148

unsigned int getByteOffset() const

Description

Returns the byte offset from the start.

Declared at: clang/lib/AST/Interp/Pointer.h:252

clang::interp::Descriptor* getDeclDesc() const

Description

Accessor for information about the declaration site.

Declared at: clang/lib/AST/Interp/Pointer.h:144

llvm::Optional<unsigned int> getDeclID() const

Description

Returns the declaration ID.

Declared at: clang/lib/AST/Interp/Pointer.h:249

clang::SourceLocation getDeclLoc() const

Declared at: clang/lib/AST/Interp/Pointer.h:145

clang::interp::InlineDescriptor* getDescriptor(
    unsigned int Offset) const

Description

Returns a descriptor at a given offset.

Declared at: clang/lib/AST/Interp/Pointer.h:319

Parameters

unsigned int Offset

const clang::FieldDecl* getField() const

Description

Returns the field information.

Declared at: clang/lib/AST/Interp/Pointer.h:220

clang::interp::Descriptor* getFieldDesc() const

Description

Accessors for information about the innermost field.

Declared at: clang/lib/AST/Interp/Pointer.h:168

int64_t getIndex() const

Description

Returns the index into an array.

Declared at: clang/lib/AST/Interp/Pointer.h:260

clang::interp::InitMap*& getInitMap() const

Description

Returns a reference to the pointer which stores the initialization map.

Declared at: clang/lib/AST/Interp/Pointer.h:325

clang::interp::InlineDescriptor* getInlineDesc()
    const

Description

Returns the embedded descriptor preceding a field.

Declared at: clang/lib/AST/Interp/Pointer.h:316

unsigned int getNumElems() const

Description

Returns the number of elements.

Declared at: clang/lib/AST/Interp/Pointer.h:257

unsigned int getOffset() const

Description

Returns the offset into an array.

Declared at: clang/lib/AST/Interp/Pointer.h:187

clang::interp::Record* getRecord() const

Description

Returns the record descriptor of a class.

Declared at: clang/lib/AST/Interp/Pointer.h:218

size_t getSize() const

Description

Returns the total size of the innermost field.

Declared at: clang/lib/AST/Interp/Pointer.h:184

clang::QualType getType() const

Description

Returns the type of the innermost field.

Declared at: clang/lib/AST/Interp/Pointer.h:175

static bool hasSameArray(
    const clang::interp::Pointer& A,
    const clang::interp::Pointer& B)

Description

Checks if two pointers can be subtracted.

Declared at: clang/lib/AST/Interp/Pointer.h:297

Parameters

const clang::interp::Pointer& A
const clang::interp::Pointer& B

static bool hasSameBase(
    const clang::interp::Pointer& A,
    const clang::interp::Pointer& B)

Description

Checks if two pointers are comparable.

Declared at: clang/lib/AST/Interp/Pointer.h:295

Parameters

const clang::interp::Pointer& A
const clang::interp::Pointer& B

bool inArray() const

Description

Checks if the innermost field is an array.

Declared at: clang/lib/AST/Interp/Pointer.h:203

bool inPrimitiveArray() const

Description

Checks if the structure is a primitive array.

Declared at: clang/lib/AST/Interp/Pointer.h:205

void initialize() const

Description

Initializes a field.

Declared at: clang/lib/AST/Interp/Pointer.h:288

bool isActive() const

Description

Checks if the object is active.

Declared at: clang/lib/AST/Interp/Pointer.h:239

bool isArrayElement() const

Description

Checks if the pointer points to an array.

Declared at: clang/lib/AST/Interp/Pointer.h:211

bool isBaseClass() const

Description

Checks if a structure is a base class.

Declared at: clang/lib/AST/Interp/Pointer.h:241

bool isConst() const

Description

Checks if an object or a subfield is mutable.

Declared at: clang/lib/AST/Interp/Pointer.h:244

bool isElementPastEnd() const

Description

Checks if the pointer is an out-of-bounds element pointer.

Declared at: clang/lib/AST/Interp/Pointer.h:274

bool isExtern() const

Description

Checks if the storage is extern.

Declared at: clang/lib/AST/Interp/Pointer.h:226

bool isField() const

Description

Checks if the item is a field in an object.

Declared at: clang/lib/AST/Interp/Pointer.h:141

bool isInitialized() const

Description

Checks if an object was initialized.

Declared at: clang/lib/AST/Interp/Pointer.h:237

bool isLive() const

Description

Checks if the pointer is live.

Declared at: clang/lib/AST/Interp/Pointer.h:139

bool isMutable() const

Description

Checks if the field is mutable.

Declared at: clang/lib/AST/Interp/Pointer.h:235

bool isOnePastEnd() const

Description

Checks if the index is one past end.

Declared at: clang/lib/AST/Interp/Pointer.h:269

bool isRoot() const

Description

Pointer points directly to a block.

Declared at: clang/lib/AST/Interp/Pointer.h:213

bool isStatic() const

Description

Checks if the storage is static.

Declared at: clang/lib/AST/Interp/Pointer.h:228

bool isStaticTemporary() const

Description

Checks if the storage is a static temporary.

Declared at: clang/lib/AST/Interp/Pointer.h:232

bool isTemporary() const

Description

Checks if the storage is temporary.

Declared at: clang/lib/AST/Interp/Pointer.h:230

bool isUnion() const

Description

Checks if the object is a union.

Declared at: clang/lib/AST/Interp/Pointer.h:223

bool isUnknownSizeArray() const

Description

Checks if the structure is an array of unknown size.

Declared at: clang/lib/AST/Interp/Pointer.h:207

bool isZero() const

Description

Checks if the pointer is null.

Declared at: clang/lib/AST/Interp/Pointer.h:137

clang::interp::Pointer narrow() const

Description

Restricts the scope of an array element pointer.

Declared at: clang/lib/AST/Interp/Pointer.h:73

void print(llvm::raw_ostream& OS) const

Description

Prints the pointer.

Declared at: clang/lib/AST/Interp/Pointer.h:300

Parameters

llvm::raw_ostream& OS

clang::APValue toAPValue() const

Description

Converts the pointer to an APValue.

Declared at: clang/lib/AST/Interp/Pointer.h:52

~Pointer()

Declared at: clang/lib/AST/Interp/Pointer.h:46