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
- public Pointer(clang::interp::Block * B)
- public Pointer(const clang::interp::Pointer & P)
- public Pointer(clang::interp::Pointer && P)
- public Pointer()
- private Pointer(clang::interp::Block * Pointee, unsigned int Base, unsigned int Offset)
- public void activate() const
- public clang::interp::Pointer atField(unsigned int Off) const
- public clang::interp::Pointer atIndex(unsigned int Idx) const
- public void deactivate() const
- public template <typename T>T & deref() const
- public template <typename T>T & elem(unsigned int I) const
- public size_t elemSize() const
- public clang::interp::Pointer expand() const
- public clang::interp::Pointer getArray() const
- public clang::interp::Pointer getBase() const
- public unsigned int getByteOffset() const
- public clang::interp::Descriptor * getDeclDesc() const
- public llvm::Optional<unsigned int> getDeclID() const
- public clang::SourceLocation getDeclLoc() const
- private clang::interp::InlineDescriptor * getDescriptor(unsigned int Offset) const
- public const clang::FieldDecl * getField() const
- public clang::interp::Descriptor * getFieldDesc() const
- public int64_t getIndex() const
- private clang::interp::InitMap *& getInitMap() const
- private clang::interp::InlineDescriptor * getInlineDesc() const
- public unsigned int getNumElems() const
- public unsigned int getOffset() const
- public clang::interp::Record * getRecord() const
- public size_t getSize() const
- public clang::QualType getType() const
- public static bool hasSameArray(const clang::interp::Pointer & A, const clang::interp::Pointer & B)
- public static bool hasSameBase(const clang::interp::Pointer & A, const clang::interp::Pointer & B)
- public bool inArray() const
- public bool inPrimitiveArray() const
- public void initialize() const
- public bool isActive() const
- public bool isArrayElement() const
- public bool isBaseClass() const
- public bool isConst() const
- public bool isElementPastEnd() const
- public bool isExtern() const
- public bool isField() const
- public bool isInitialized() const
- public bool isLive() const
- public bool isMutable() const
- public bool isOnePastEnd() const
- public bool isRoot() const
- public bool isStatic() const
- public bool isStaticTemporary() const
- public bool isTemporary() const
- public bool isUnion() const
- public bool isUnknownSizeArray() const
- public bool isZero() const
- public clang::interp::Pointer narrow() const
- public void print(llvm::raw_ostream & OS) const
- public clang::APValue toAPValue() const
- public ~Pointer()
Methods
¶Pointer(clang::interp::Block* B)
Pointer(clang::interp::Block* B)Declared at: clang/lib/AST/Interp/Pointer.h:43
Parameters
¶Pointer(const clang::interp::Pointer& P)
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)
Pointer(clang::interp::Pointer&& P)Declared at: clang/lib/AST/Interp/Pointer.h:45
Parameters
¶Pointer()
Pointer()Declared at: clang/lib/AST/Interp/Pointer.h:42
¶Pointer(clang::interp::Block* Pointee,
unsigned int Base,
unsigned int Offset)
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
void activate() constDescription
Activats a field.
Declared at: clang/lib/AST/Interp/Pointer.h:290
¶clang::interp::Pointer atField(
unsigned int Off) const
clang::interp::Pointer atField(
unsigned int Off) constDescription
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
clang::interp::Pointer atIndex(
unsigned int Idx) constDescription
Offsets a pointer inside an array.
Declared at: clang/lib/AST/Interp/Pointer.h:55
Parameters
- unsigned int Idx
¶void deactivate() const
void deactivate() constDescription
Deactivates an entire strurcutre.
Declared at: clang/lib/AST/Interp/Pointer.h:292
¶template <typename T>
T& deref() const
template <typename T>
T& deref() constDescription
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
template <typename T>
T& elem(unsigned int I) constDescription
Dereferences a primitive element.
Declared at: clang/lib/AST/Interp/Pointer.h:283
Templates
- T
Parameters
- unsigned int I
¶size_t elemSize() const
size_t elemSize() constDescription
Returns the element size of the innermost field.
Declared at: clang/lib/AST/Interp/Pointer.h:178
¶clang::interp::Pointer expand() const
clang::interp::Pointer expand() constDescription
Expands a pointer to the containing array, undoing narrowing.
Declared at: clang/lib/AST/Interp/Pointer.h:109
¶clang::interp::Pointer getArray() const
clang::interp::Pointer getArray() constDescription
Returns the parent array.
Declared at: clang/lib/AST/Interp/Pointer.h:158
¶clang::interp::Pointer getBase() const
clang::interp::Pointer getBase() constDescription
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
unsigned int getByteOffset() constDescription
Returns the byte offset from the start.
Declared at: clang/lib/AST/Interp/Pointer.h:252
¶clang::interp::Descriptor* getDeclDesc() const
clang::interp::Descriptor* getDeclDesc() constDescription
Accessor for information about the declaration site.
Declared at: clang/lib/AST/Interp/Pointer.h:144
¶llvm::Optional<unsigned int> getDeclID() const
llvm::Optional<unsigned int> getDeclID() constDescription
Returns the declaration ID.
Declared at: clang/lib/AST/Interp/Pointer.h:249
¶clang::SourceLocation getDeclLoc() const
clang::SourceLocation getDeclLoc() constDeclared at: clang/lib/AST/Interp/Pointer.h:145
¶clang::interp::InlineDescriptor* getDescriptor(
unsigned int Offset) const
clang::interp::InlineDescriptor* getDescriptor(
unsigned int Offset) constDescription
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
const clang::FieldDecl* getField() constDescription
Returns the field information.
Declared at: clang/lib/AST/Interp/Pointer.h:220
¶clang::interp::Descriptor* getFieldDesc() const
clang::interp::Descriptor* getFieldDesc() constDescription
Accessors for information about the innermost field.
Declared at: clang/lib/AST/Interp/Pointer.h:168
¶int64_t getIndex() const
int64_t getIndex() constDescription
Returns the index into an array.
Declared at: clang/lib/AST/Interp/Pointer.h:260
¶clang::interp::InitMap*& getInitMap() const
clang::interp::InitMap*& getInitMap() constDescription
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
clang::interp::InlineDescriptor* getInlineDesc()
constDescription
Returns the embedded descriptor preceding a field.
Declared at: clang/lib/AST/Interp/Pointer.h:316
¶unsigned int getNumElems() const
unsigned int getNumElems() constDescription
Returns the number of elements.
Declared at: clang/lib/AST/Interp/Pointer.h:257
¶unsigned int getOffset() const
unsigned int getOffset() constDescription
Returns the offset into an array.
Declared at: clang/lib/AST/Interp/Pointer.h:187
¶clang::interp::Record* getRecord() const
clang::interp::Record* getRecord() constDescription
Returns the record descriptor of a class.
Declared at: clang/lib/AST/Interp/Pointer.h:218
¶size_t getSize() const
size_t getSize() constDescription
Returns the total size of the innermost field.
Declared at: clang/lib/AST/Interp/Pointer.h:184
¶clang::QualType getType() const
clang::QualType getType() constDescription
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)
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)
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
bool inArray() constDescription
Checks if the innermost field is an array.
Declared at: clang/lib/AST/Interp/Pointer.h:203
¶bool inPrimitiveArray() const
bool inPrimitiveArray() constDescription
Checks if the structure is a primitive array.
Declared at: clang/lib/AST/Interp/Pointer.h:205
¶void initialize() const
void initialize() constDescription
Initializes a field.
Declared at: clang/lib/AST/Interp/Pointer.h:288
¶bool isActive() const
bool isActive() constDescription
Checks if the object is active.
Declared at: clang/lib/AST/Interp/Pointer.h:239
¶bool isArrayElement() const
bool isArrayElement() constDescription
Checks if the pointer points to an array.
Declared at: clang/lib/AST/Interp/Pointer.h:211
¶bool isBaseClass() const
bool isBaseClass() constDescription
Checks if a structure is a base class.
Declared at: clang/lib/AST/Interp/Pointer.h:241
¶bool isConst() const
bool isConst() constDescription
Checks if an object or a subfield is mutable.
Declared at: clang/lib/AST/Interp/Pointer.h:244
¶bool isElementPastEnd() const
bool isElementPastEnd() constDescription
Checks if the pointer is an out-of-bounds element pointer.
Declared at: clang/lib/AST/Interp/Pointer.h:274
¶bool isExtern() const
bool isExtern() constDescription
Checks if the storage is extern.
Declared at: clang/lib/AST/Interp/Pointer.h:226
¶bool isField() const
bool isField() constDescription
Checks if the item is a field in an object.
Declared at: clang/lib/AST/Interp/Pointer.h:141
¶bool isInitialized() const
bool isInitialized() constDescription
Checks if an object was initialized.
Declared at: clang/lib/AST/Interp/Pointer.h:237
¶bool isLive() const
bool isLive() constDescription
Checks if the pointer is live.
Declared at: clang/lib/AST/Interp/Pointer.h:139
¶bool isMutable() const
bool isMutable() constDescription
Checks if the field is mutable.
Declared at: clang/lib/AST/Interp/Pointer.h:235
¶bool isOnePastEnd() const
bool isOnePastEnd() constDescription
Checks if the index is one past end.
Declared at: clang/lib/AST/Interp/Pointer.h:269
¶bool isRoot() const
bool isRoot() constDescription
Pointer points directly to a block.
Declared at: clang/lib/AST/Interp/Pointer.h:213
¶bool isStatic() const
bool isStatic() constDescription
Checks if the storage is static.
Declared at: clang/lib/AST/Interp/Pointer.h:228
¶bool isStaticTemporary() const
bool isStaticTemporary() constDescription
Checks if the storage is a static temporary.
Declared at: clang/lib/AST/Interp/Pointer.h:232
¶bool isTemporary() const
bool isTemporary() constDescription
Checks if the storage is temporary.
Declared at: clang/lib/AST/Interp/Pointer.h:230
¶bool isUnion() const
bool isUnion() constDescription
Checks if the object is a union.
Declared at: clang/lib/AST/Interp/Pointer.h:223
¶bool isUnknownSizeArray() const
bool isUnknownSizeArray() constDescription
Checks if the structure is an array of unknown size.
Declared at: clang/lib/AST/Interp/Pointer.h:207
¶bool isZero() const
bool isZero() constDescription
Checks if the pointer is null.
Declared at: clang/lib/AST/Interp/Pointer.h:137
¶clang::interp::Pointer narrow() const
clang::interp::Pointer narrow() constDescription
Restricts the scope of an array element pointer.
Declared at: clang/lib/AST/Interp/Pointer.h:73
¶void print(llvm::raw_ostream& OS) const
void print(llvm::raw_ostream& OS) constDescription
Prints the pointer.
Declared at: clang/lib/AST/Interp/Pointer.h:300
Parameters
¶clang::APValue toAPValue() const
clang::APValue toAPValue() constDescription
Converts the pointer to an APValue.
Declared at: clang/lib/AST/Interp/Pointer.h:52
¶~Pointer()
~Pointer()Declared at: clang/lib/AST/Interp/Pointer.h:46