clang 19.0.0git
|
A pointer to a memory block, live or dead. More...
#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/AST/Interp/Pointer.h"
Public Member Functions | |
Pointer () | |
Pointer (Block *B) | |
Pointer (Block *B, unsigned BaseAndOffset) | |
Pointer (const Pointer &P) | |
Pointer (Pointer &&P) | |
Pointer (uint64_t Address, const Descriptor *Desc, unsigned Offset=0) | |
~Pointer () | |
void | operator= (const Pointer &P) |
void | operator= (Pointer &&P) |
bool | operator== (const Pointer &P) const |
Equality operators are just for tests. | |
bool | operator!= (const Pointer &P) const |
APValue | toAPValue () const |
Converts the pointer to an APValue. | |
std::string | toDiagnosticString (const ASTContext &Ctx) const |
Converts the pointer to a string usable in diagnostics. | |
uint64_t | getIntegerRepresentation () const |
std::optional< APValue > | toRValue (const Context &Ctx) const |
Converts the pointer to an APValue that is an rvalue. | |
Pointer | atIndex (unsigned Idx) const |
Offsets a pointer inside an array. | |
Pointer | atField (unsigned Off) const |
Creates a pointer to a field. | |
Pointer | atFieldSub (unsigned Off) const |
Subtract the given offset from the current Base and Offset of the pointer. | |
Pointer | narrow () const |
Restricts the scope of an array element pointer. | |
Pointer | expand () const |
Expands a pointer to the containing array, undoing narrowing. | |
bool | isZero () const |
Checks if the pointer is null. | |
bool | isLive () const |
Checks if the pointer is live. | |
bool | isField () const |
Checks if the item is a field in an object. | |
const Descriptor * | getDeclDesc () const |
Accessor for information about the declaration site. | |
SourceLocation | getDeclLoc () const |
DeclTy | getSource () const |
Returns the expression or declaration the pointer has been created for. | |
Pointer | getBase () const |
Returns a pointer to the object of which this pointer is a field. | |
Pointer | getArray () const |
Returns the parent array. | |
const Descriptor * | getFieldDesc () const |
Accessors for information about the innermost field. | |
QualType | getType () const |
Returns the type of the innermost field. | |
Pointer | getDeclPtr () const |
size_t | elemSize () const |
Returns the element size of the innermost field. | |
size_t | getSize () const |
Returns the total size of the innermost field. | |
unsigned | getOffset () const |
Returns the offset into an array. | |
bool | isArrayRoot () const |
Whether this array refers to an array, but not to the first element. | |
bool | inArray () const |
Checks if the innermost field is an array. | |
bool | inPrimitiveArray () const |
Checks if the structure is a primitive array. | |
bool | isUnknownSizeArray () const |
Checks if the structure is an array of unknown size. | |
bool | isArrayElement () const |
Checks if the pointer points to an array. | |
bool | isRoot () const |
Pointer points directly to a block. | |
bool | canBeInitialized () const |
If this pointer has an InlineDescriptor we can use to initialize. | |
const BlockPointer & | asBlockPointer () const |
const IntPointer & | asIntPointer () const |
bool | isBlockPointer () const |
bool | isIntegralPointer () const |
const Record * | getRecord () const |
Returns the record descriptor of a class. | |
const Record * | getElemRecord () const |
Returns the element record type, if this is a non-primive array. | |
const FieldDecl * | getField () const |
Returns the field information. | |
bool | isUnion () const |
Checks if the object is a union. | |
bool | isExtern () const |
Checks if the storage is extern. | |
bool | isStatic () const |
Checks if the storage is static. | |
bool | isTemporary () const |
Checks if the storage is temporary. | |
bool | isStaticTemporary () const |
Checks if the storage is a static temporary. | |
bool | isMutable () const |
Checks if the field is mutable. | |
bool | isWeak () const |
bool | isInitialized () const |
Checks if an object was initialized. | |
bool | isActive () const |
Checks if the object is active. | |
bool | isBaseClass () const |
Checks if a structure is a base class. | |
bool | isDummy () const |
Checks if the pointer points to a dummy value. | |
bool | isConst () const |
Checks if an object or a subfield is mutable. | |
std::optional< unsigned > | getDeclID () const |
Returns the declaration ID. | |
unsigned | getByteOffset () const |
Returns the byte offset from the start. | |
unsigned | getNumElems () const |
Returns the number of elements. | |
const Block * | block () const |
int64_t | getIndex () const |
Returns the index into an array. | |
bool | isOnePastEnd () const |
Checks if the index is one past end. | |
bool | isElementPastEnd () const |
Checks if the pointer is an out-of-bounds element pointer. | |
template<typename T > | |
T & | deref () const |
Dereferences the pointer, if it's live. | |
template<typename T > | |
T & | elem (unsigned I) const |
Dereferences a primitive element. | |
void | initialize () const |
Initializes a field. | |
void | activate () const |
Activats a field. | |
void | deactivate () const |
Deactivates an entire strurcutre. | |
ComparisonCategoryResult | compare (const Pointer &Other) const |
Compare two pointers. | |
void | print (llvm::raw_ostream &OS) const |
Prints the pointer. | |
Static Public Member Functions | |
static bool | hasSameBase (const Pointer &A, const Pointer &B) |
Checks if two pointers are comparable. | |
static bool | hasSameArray (const Pointer &A, const Pointer &B) |
Checks if two pointers can be subtracted. | |
Friends | |
class | Block |
class | DeadBlock |
struct | InitMap |
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.
In the simplest form, a Pointer has a Block* (the pointee) and both Base and Offset are 0, which means it will point to raw data.
The Base field is used to access metadata about the data. For primitive arrays, the Base is followed by an InitMap. In a variety of cases, the Base is preceded by an InlineDescriptor, which is used to track the initialization state, among other things.
The Offset field is used to access the actual data. In other words, the data the pointer decribes can be found at Pointee->rawData() + Pointer.Offset.
Pointee Offset │ │ │ │ ▼ ▼ ┌───────┬────────────┬─────────┬────────────────────────────┐ │ Block │ InlineDesc │ InitMap │ Actual Data │ └───────┴────────────┴─────────┴────────────────────────────┘ ▲ │ │ Base
|
inline |
Definition at line 86 of file Pointer.h.
References clang::interp::Int.
Referenced by atField(), atFieldSub(), atIndex(), expand(), getArray(), getBase(), getDeclPtr(), and narrow().
Pointer::Pointer | ( | Block * | B | ) |
Definition at line 22 of file Pointer.cpp.
Definition at line 26 of file Pointer.cpp.
Pointer::Pointer | ( | const Pointer & | P | ) |
Definition at line 29 of file Pointer.cpp.
References isBlockPointer().
Pointer::Pointer | ( | Pointer && | P | ) |
Definition at line 47 of file Pointer.cpp.
References clang::interp::Block, and P.
|
inline |
Pointer::~Pointer | ( | ) |
Definition at line 55 of file Pointer.cpp.
References isIntegralPointer().
void Pointer::activate | ( | ) | const |
Activats a field.
Definition at line 284 of file Pointer.cpp.
References clang::interp::InlineDescriptor::IsActive.
|
inline |
Definition at line 418 of file Pointer.h.
References isBlockPointer().
Referenced by atField(), atFieldSub(), atIndex(), block(), canBeInitialized(), deref(), elem(), elemSize(), expand(), getArray(), getBase(), getDeclDesc(), getDeclID(), getDeclPtr(), getFieldDesc(), getIndex(), getIntegerRepresentation(), getOffset(), getType(), hasSameBase(), isActive(), isArrayElement(), isArrayRoot(), isConst(), isDummy(), isExtern(), isField(), isLive(), isMutable(), isOnePastEnd(), isRoot(), isStatic(), isTemporary(), isUnknownSizeArray(), isZero(), narrow(), and operator==().
|
inline |
Definition at line 422 of file Pointer.h.
References isIntegralPointer().
Referenced by atField(), atIndex(), elemSize(), getByteOffset(), getDeclDesc(), getFieldDesc(), getIntegerRepresentation(), getSource(), isZero(), operator==(), toAPValue(), and toDiagnosticString().
Creates a pointer to a field.
Definition at line 154 of file Pointer.h.
References asBlockPointer(), asIntPointer(), isIntegralPointer(), and Pointer().
Referenced by clang::interp::CheckFieldsInitialized(), clang::interp::DoMemcpy(), clang::interp::GetField(), clang::interp::GetFieldPop(), clang::interp::GetPtrActiveField(), clang::interp::GetPtrBase(), clang::interp::GetPtrBasePop(), clang::interp::GetPtrField(), clang::interp::SetThreeWayComparisonField(), and toRValue().
Subtract the given offset from the current Base and Offset of the pointer.
Definition at line 163 of file Pointer.h.
References asBlockPointer(), and Pointer().
Referenced by clang::interp::GetPtrDerivedPop().
Offsets a pointer inside an array.
Definition at line 137 of file Pointer.h.
References asBlockPointer(), asIntPointer(), elemSize(), getDeclDesc(), getFieldDesc(), getSize(), isIntegralPointer(), and Pointer().
Referenced by clang::interp::ArrayDecay(), clang::interp::ArrayElem(), clang::interp::ArrayElemPop(), clang::interp::CheckArrayInitialized(), clang::interp::CmpHelperEQ< Pointer >(), clang::interp::Program::createGlobalString(), clang::interp::DoMemcpy(), clang::interp::interp__builtin_is_aligned_up_down(), clang::interp::interp__builtin_nan(), clang::interp::interp__builtin_strcmp(), clang::interp::interp__builtin_strlen(), clang::interp::OffsetHelper(), and toRValue().
|
inline |
Definition at line 540 of file Pointer.h.
References asBlockPointer(), and clang::interp::BlockPointer::Pointee.
Referenced by clang::interp::CheckConst().
|
inline |
If this pointer has an InlineDescriptor we can use to initialize.
Definition at line 411 of file Pointer.h.
References asBlockPointer(), clang::interp::BlockPointer::Base, isBlockPointer(), and clang::interp::BlockPointer::Pointee.
Referenced by clang::interp::FinishInit(), and clang::interp::FinishInitPop().
|
inline |
Compare two pointers.
Definition at line 608 of file Pointer.h.
References clang::Equal, clang::Greater, hasSameBase(), clang::Less, clang::Other, and clang::Unordered.
Referenced by clang::interp::CMP3().
void Pointer::deactivate | ( | ) | const |
Deactivates an entire strurcutre.
Definition at line 291 of file Pointer.cpp.
Referenced by clang::interp::GetPtrActiveField().
Dereferences the pointer, if it's live.
Definition at line 577 of file Pointer.h.
References asBlockPointer(), clang::interp::BlockPointer::Base, isArrayRoot(), isBlockPointer(), isLive(), clang::interp::BlockPointer::Pointee, clang::interp::Block::rawData(), and clang::T.
Referenced by clang::interp::ArrayElem(), clang::interp::ArrayElemPop(), clang::interp::assignInteger(), clang::interp::DoMemcpy(), clang::interp::GetGlobal(), clang::interp::GetLocal(), clang::interp::InterpFrame::getParam(), clang::interp::IncDecFloatHelper(), clang::interp::IncDecHelper(), clang::interp::IncDecPtrHelper(), clang::interp::interp__builtin_nan(), clang::interp::interp__builtin_strcmp(), clang::interp::interp__builtin_strlen(), clang::interp::Load(), clang::interp::LoadPop(), clang::interp::InterpFrame::setParam(), clang::interp::SetThreeWayComparisonField(), and toRValue().
Dereferences a primitive element.
Definition at line 592 of file Pointer.h.
References asBlockPointer(), clang::interp::Block::data(), getNumElems(), isBlockPointer(), clang::interp::BlockPointer::Pointee, and clang::T.
|
inline |
Returns the element size of the innermost field.
Definition at line 335 of file Pointer.h.
References asBlockPointer(), asIntPointer(), clang::interp::IntPointer::Desc, getDeclDesc(), clang::interp::Descriptor::getElemSize(), getFieldDesc(), clang::interp::Descriptor::getSize(), and isIntegralPointer().
Referenced by atIndex(), getIndex(), getIntegerRepresentation(), and getNumElems().
|
inline |
Expands a pointer to the containing array, undoing narrowing.
Definition at line 212 of file Pointer.h.
References asBlockPointer(), clang::interp::BlockPointer::Base, clang::interp::InlineDescriptor::Desc, getDeclDesc(), getSize(), inPrimitiveArray(), clang::interp::Descriptor::IsArray, isElementPastEnd(), clang::interp::InlineDescriptor::Offset, and Pointer().
Referenced by clang::interp::ExpandPtr().
|
inline |
Returns the parent array.
Definition at line 295 of file Pointer.h.
References asBlockPointer(), and Pointer().
Referenced by toAPValue().
|
inline |
Returns a pointer to the object of which this pointer is a field.
Definition at line 286 of file Pointer.h.
References asBlockPointer(), clang::interp::BlockPointer::Base, clang::interp::InlineDescriptor::Offset, and Pointer().
Referenced by CheckActive(), and toAPValue().
|
inline |
Returns the byte offset from the start.
Definition at line 527 of file Pointer.h.
References asIntPointer(), isIntegralPointer(), and clang::interp::IntPointer::Value.
Referenced by clang::interp::CmpHelper< Pointer >(), clang::interp::CmpHelperEQ< Pointer >(), and clang::interp::interp__builtin_is_aligned_up_down().
|
inline |
Accessor for information about the declaration site.
Definition at line 266 of file Pointer.h.
References asBlockPointer(), asIntPointer(), clang::interp::Block::Desc, clang::interp::IntPointer::Desc, isBlockPointer(), isIntegralPointer(), and clang::interp::BlockPointer::Pointee.
Referenced by atIndex(), clang::interp::CheckConstant(), clang::interp::CheckDummy(), clang::interp::CheckExtern(), clang::interp::CheckFieldsInitialized(), clang::interp::CheckGlobalInitialized(), clang::interp::CheckInitialized(), CheckTemporary(), elemSize(), expand(), getDeclLoc(), getFieldDesc(), getSource(), clang::interp::interp__builtin_is_aligned_up_down(), isConst(), isDummy(), isWeak(), and toAPValue().
|
inline |
Returns the declaration ID.
Definition at line 518 of file Pointer.h.
References asBlockPointer(), clang::interp::Block::getDeclID(), isBlockPointer(), and clang::interp::BlockPointer::Pointee.
Referenced by CheckGlobal(), and CheckTemporary().
|
inline |
Definition at line 274 of file Pointer.h.
References getDeclDesc(), and clang::interp::Descriptor::getLocation().
Referenced by clang::interp::CheckLive(), and CheckTemporary().
|
inline |
Definition at line 330 of file Pointer.h.
References asBlockPointer(), and Pointer().
|
inline |
Returns the element record type, if this is a non-primive array.
Definition at line 432 of file Pointer.h.
References clang::interp::Descriptor::ElemDesc, clang::interp::Descriptor::ElemRecord, and getFieldDesc().
Referenced by clang::interp::CheckArrayInitialized().
|
inline |
Returns the field information.
Definition at line 437 of file Pointer.h.
References clang::interp::Descriptor::asFieldDecl(), and getFieldDesc().
Referenced by CheckActive(), clang::interp::CheckArrayInitialized(), and clang::interp::CheckMutable().
|
inline |
Accessors for information about the innermost field.
Definition at line 306 of file Pointer.h.
References asBlockPointer(), asIntPointer(), clang::interp::InlineDescriptor::Desc, clang::interp::IntPointer::Desc, getDeclDesc(), isBlockPointer(), and isIntegralPointer().
Referenced by atIndex(), clang::interp::DoMemcpy(), elemSize(), getElemRecord(), getField(), clang::interp::GetGlobal(), getOffset(), getRecord(), getSize(), getType(), hasSameArray(), inArray(), initialize(), inPrimitiveArray(), clang::interp::interp__builtin_nan(), clang::interp::interp__builtin_strcmp(), clang::interp::interp__builtin_strlen(), isField(), isInitialized(), isUnknownSizeArray(), narrow(), and toAPValue().
|
inline |
Returns the index into an array.
Definition at line 543 of file Pointer.h.
References asBlockPointer(), elemSize(), getOffset(), isBlockPointer(), isElementPastEnd(), and isZero().
Referenced by initialize(), clang::interp::interp__builtin_is_aligned_up_down(), clang::interp::interp__builtin_strcmp(), clang::interp::interp__builtin_strlen(), isInitialized(), clang::interp::OffsetHelper(), clang::interp::SubPtr(), and toAPValue().
|
inline |
Definition at line 127 of file Pointer.h.
References asBlockPointer(), asIntPointer(), elemSize(), isIntegralPointer(), clang::interp::BlockPointer::Pointee, and clang::interp::IntPointer::Value.
Referenced by clang::interp::CastPointerIntegral().
|
inline |
Returns the number of elements.
Definition at line 534 of file Pointer.h.
References elemSize(), getSize(), and isIntegralPointer().
Referenced by elem(), clang::interp::interp__builtin_nan(), and clang::interp::OffsetHelper().
|
inline |
Returns the offset into an array.
Definition at line 353 of file Pointer.h.
References asBlockPointer(), clang::interp::BlockPointer::Base, and getFieldDesc().
Referenced by getIndex(), and isOnePastEnd().
|
inline |
Returns the record descriptor of a class.
Definition at line 430 of file Pointer.h.
References clang::interp::Descriptor::ElemRecord, and getFieldDesc().
Referenced by clang::interp::CheckFieldsInitialized(), clang::interp::EvaluationResult::checkFullyInitialized(), and clang::interp::SetThreeWayComparisonField().
|
inline |
Returns the total size of the innermost field.
Definition at line 347 of file Pointer.h.
References getFieldDesc(), clang::interp::Descriptor::getSize(), and isBlockPointer().
Referenced by atIndex(), expand(), getNumElems(), and isOnePastEnd().
|
inline |
Returns the expression or declaration the pointer has been created for.
Definition at line 277 of file Pointer.h.
References asIntPointer(), clang::interp::IntPointer::Desc, getDeclDesc(), clang::interp::Descriptor::getSource(), isBlockPointer(), and isIntegralPointer().
Referenced by hasSameBase().
|
inline |
Returns the type of the innermost field.
Definition at line 318 of file Pointer.h.
References asBlockPointer(), getFieldDesc(), clang::interp::Descriptor::getType(), getType(), and inPrimitiveArray().
Referenced by clang::interp::CheckConst(), clang::interp::EvaluationResult::checkFullyInitialized(), getType(), clang::interp::SetThreeWayComparisonField(), toDiagnosticString(), and toRValue().
Checks if two pointers can be subtracted.
Definition at line 309 of file Pointer.cpp.
References clang::interp::BlockPointer::Base, BS, getFieldDesc(), hasSameBase(), and clang::interp::Descriptor::IsArray.
Checks if two pointers are comparable.
Definition at line 295 of file Pointer.cpp.
References asBlockPointer(), getSource(), isIntegralPointer(), isZero(), and clang::interp::BlockPointer::Pointee.
Referenced by clang::interp::CmpHelper< Pointer >(), clang::interp::CmpHelperEQ< Pointer >(), compare(), hasSameArray(), and clang::interp::SubPtr().
|
inline |
Checks if the innermost field is an array.
Definition at line 375 of file Pointer.h.
References getFieldDesc(), clang::interp::Descriptor::IsArray, and isBlockPointer().
Referenced by isArrayElement(), isArrayRoot(), and clang::interp::OffsetHelper().
void Pointer::initialize | ( | ) | const |
Initializes a field.
Definition at line 243 of file Pointer.cpp.
References getFieldDesc(), getIndex(), clang::interp::Descriptor::getNumElems(), clang::interp::InlineDescriptor::IsInitialized, isIntegralPointer(), clang::interp::Descriptor::isPrimitiveArray(), and isStatic().
Referenced by clang::interp::DoMemcpy(), clang::interp::FinishInit(), clang::interp::FinishInitPop(), clang::interp::InitPop(), clang::interp::interp__builtin_carryop(), clang::interp::interp__builtin_overflowop(), clang::interp::SetThreeWayComparisonField(), clang::interp::Store(), clang::interp::StoreBitField(), clang::interp::StoreBitFieldPop(), and clang::interp::StorePop().
|
inline |
Checks if the structure is a primitive array.
Definition at line 381 of file Pointer.h.
References getFieldDesc(), isBlockPointer(), and clang::interp::Descriptor::isPrimitiveArray().
|
inline |
Checks if the object is active.
Definition at line 487 of file Pointer.h.
References asBlockPointer(), clang::interp::BlockPointer::Base, clang::interp::InlineDescriptor::IsActive, and isBlockPointer().
Referenced by CheckActive(), and toRValue().
|
inline |
Checks if the pointer points to an array.
Definition at line 399 of file Pointer.h.
References asBlockPointer(), clang::interp::BlockPointer::Base, inArray(), and isBlockPointer().
Referenced by toAPValue().
|
inline |
Whether this array refers to an array, but not to the first element.
Definition at line 370 of file Pointer.h.
References asBlockPointer(), clang::interp::BlockPointer::Base, and inArray().
Referenced by clang::interp::CmpHelperEQ< Pointer >(), and deref().
|
inline |
Checks if a structure is a base class.
Definition at line 495 of file Pointer.h.
References clang::interp::InlineDescriptor::IsBase, and isField().
|
inline |
Definition at line 426 of file Pointer.h.
References clang::interp::Block.
Referenced by asBlockPointer(), canBeInitialized(), clang::interp::CheckConst(), deref(), elem(), getDeclDesc(), getDeclID(), getFieldDesc(), getIndex(), getSize(), getSource(), inArray(), inPrimitiveArray(), isActive(), isArrayElement(), isDummy(), isExtern(), isMutable(), isTemporary(), isUnknownSizeArray(), isWeak(), isZero(), clang::interp::Load(), clang::interp::LoadPop(), narrow(), clang::interp::OffsetHelper(), operator=(), operator==(), Pointer(), and print().
|
inline |
Checks if an object or a subfield is mutable.
Definition at line 508 of file Pointer.h.
References asBlockPointer(), getDeclDesc(), clang::interp::InlineDescriptor::IsConst, clang::interp::Descriptor::IsConst, and isIntegralPointer().
Referenced by clang::interp::CheckConst().
|
inline |
Checks if the pointer points to a dummy value.
Definition at line 497 of file Pointer.h.
References asBlockPointer(), getDeclDesc(), isBlockPointer(), and clang::interp::Descriptor::isDummy().
Referenced by clang::interp::ArrayDecay(), clang::interp::CheckDummy(), clang::interp::CmpHelperEQ< Pointer >(), clang::interp::Decf(), clang::interp::DecfPop(), clang::interp::IncDecHelper(), clang::interp::IncDecPtrHelper(), clang::interp::Incf(), clang::interp::IncfPop(), clang::interp::interp__builtin_overflowop(), clang::interp::interp__builtin_strcmp(), isUnknownSizeArray(), clang::interp::OffsetHelper(), toAPValue(), and toRValue().
|
inline |
Checks if the pointer is an out-of-bounds element pointer.
Definition at line 574 of file Pointer.h.
Referenced by clang::interp::CheckRange(), expand(), getIndex(), and isOnePastEnd().
|
inline |
Checks if the storage is extern.
Definition at line 443 of file Pointer.h.
References asBlockPointer(), isBlockPointer(), clang::interp::Block::isExtern(), and clang::interp::BlockPointer::Pointee.
Referenced by clang::interp::CheckExtern(), and clang::interp::GetGlobal().
|
inline |
Checks if the item is a field in an object.
Definition at line 256 of file Pointer.h.
References asBlockPointer(), clang::interp::Descriptor::asDecl(), clang::interp::BlockPointer::Base, getFieldDesc(), and isIntegralPointer().
Referenced by clang::interp::CheckLive(), isBaseClass(), and toAPValue().
bool Pointer::isInitialized | ( | ) | const |
Checks if an object was initialized.
Definition at line 216 of file Pointer.cpp.
References getFieldDesc(), getIndex(), clang::interp::InlineDescriptor::IsInitialized, isIntegralPointer(), clang::interp::Descriptor::isPrimitiveArray(), and isStatic().
Referenced by clang::interp::CheckArrayInitialized(), clang::interp::CheckExtern(), clang::interp::CheckFieldsInitialized(), clang::interp::CheckGlobalInitialized(), clang::interp::CheckInitialized(), and clang::interp::Program::dump().
|
inline |
Definition at line 427 of file Pointer.h.
References clang::interp::Int.
Referenced by asIntPointer(), atField(), atIndex(), clang::interp::CheckConstant(), elemSize(), getByteOffset(), getDeclDesc(), getFieldDesc(), getIntegerRepresentation(), getNumElems(), getSource(), hasSameBase(), initialize(), isConst(), isField(), isInitialized(), isLive(), isOnePastEnd(), isStatic(), isWeak(), isZero(), operator=(), operator==(), toAPValue(), toDiagnosticString(), and ~Pointer().
|
inline |
Checks if the pointer is live.
Definition at line 250 of file Pointer.h.
References asBlockPointer(), clang::interp::Block::IsDead, isIntegralPointer(), and clang::interp::BlockPointer::Pointee.
Referenced by clang::interp::CheckConst(), clang::interp::CheckInitialized(), clang::interp::CheckLive(), clang::interp::CheckMutable(), deref(), clang::interp::DoMemcpy(), and toRValue().
|
inline |
Checks if the field is mutable.
Definition at line 467 of file Pointer.h.
References asBlockPointer(), clang::interp::BlockPointer::Base, isBlockPointer(), and clang::interp::InlineDescriptor::IsFieldMutable.
Referenced by clang::interp::CheckMutable().
|
inline |
Checks if the index is one past end.
Definition at line 564 of file Pointer.h.
References asBlockPointer(), getOffset(), getSize(), isElementPastEnd(), and isIntegralPointer().
Referenced by clang::interp::CheckRange(), clang::interp::CheckSubobject(), narrow(), and toAPValue().
|
inline |
Pointer points directly to a block.
Definition at line 405 of file Pointer.h.
References asBlockPointer().
|
inline |
Checks if the storage is static.
Definition at line 449 of file Pointer.h.
References asBlockPointer(), isIntegralPointer(), clang::interp::Block::isStatic(), and clang::interp::BlockPointer::Pointee.
Referenced by CheckGlobal(), initialize(), isInitialized(), and isStaticTemporary().
|
inline |
Checks if the storage is a static temporary.
Definition at line 464 of file Pointer.h.
References isStatic(), and isTemporary().
Referenced by CheckTemporary().
|
inline |
Checks if the storage is temporary.
Definition at line 456 of file Pointer.h.
References asBlockPointer(), isBlockPointer(), clang::interp::Block::isTemporary(), and clang::interp::BlockPointer::Pointee.
Referenced by clang::interp::CheckLive(), and isStaticTemporary().
bool clang::interp::Pointer::isUnion | ( | ) | const |
Checks if the object is a union.
|
inline |
Checks if the structure is an array of unknown size.
Definition at line 387 of file Pointer.h.
References asBlockPointer(), getFieldDesc(), isBlockPointer(), isDummy(), and clang::interp::Descriptor::isUnknownSizeArray().
Referenced by clang::interp::ArrayDecay(), clang::interp::CheckArray(), narrow(), and toAPValue().
|
inline |
Definition at line 475 of file Pointer.h.
References getDeclDesc(), isBlockPointer(), and isIntegralPointer().
|
inline |
Checks if the pointer is null.
Definition at line 243 of file Pointer.h.
References asBlockPointer(), asIntPointer(), isBlockPointer(), isIntegralPointer(), clang::interp::BlockPointer::Pointee, and clang::interp::IntPointer::Value.
Referenced by clang::interp::ArrayDecay(), clang::interp::EvaluationResult::checkFullyInitialized(), clang::interp::CheckLive(), clang::interp::CheckNonNullArgs(), clang::interp::CheckNull(), clang::interp::CmpHelperEQ< Pointer >(), getIndex(), hasSameBase(), clang::interp::interp__builtin_atomic_lock_free(), narrow(), clang::interp::SubPtr(), toAPValue(), toDiagnosticString(), and toRValue().
|
inline |
Restricts the scope of an array element pointer.
Definition at line 170 of file Pointer.h.
References asBlockPointer(), clang::interp::BlockPointer::Base, getFieldDesc(), inPrimitiveArray(), isBlockPointer(), isOnePastEnd(), isUnknownSizeArray(), isZero(), and Pointer().
Referenced by clang::interp::CheckArrayInitialized(), clang::interp::Program::createGlobalString(), clang::interp::NarrowPtr(), and toRValue().
void Pointer::operator= | ( | const Pointer & | P | ) |
Definition at line 65 of file Pointer.cpp.
References clang::interp::Block, clang::interp::Block::cleanup(), clang::interp::Int, isBlockPointer(), isIntegralPointer(), and P.
void Pointer::operator= | ( | Pointer && | P | ) |
Definition at line 93 of file Pointer.cpp.
References clang::interp::Block, clang::interp::Block::cleanup(), clang::interp::Int, isBlockPointer(), isIntegralPointer(), and P.
Equality operators are just for tests.
Definition at line 106 of file Pointer.h.
References asBlockPointer(), asIntPointer(), clang::interp::BlockPointer::Base, isBlockPointer(), isIntegralPointer(), P, clang::interp::BlockPointer::Pointee, and clang::interp::IntPointer::Value.
void Pointer::print | ( | llvm::raw_ostream & | OS | ) | const |
APValue Pointer::toAPValue | ( | ) | const |
Converts the pointer to an APValue.
Definition at line 120 of file Pointer.cpp.
References clang::APValue::LValuePathEntry::ArrayIndex(), clang::interp::Descriptor::asDecl(), clang::interp::Descriptor::asExpr(), asIntPointer(), clang::interp::Descriptor::asValueDecl(), clang::CharUnits::fromQuantity(), getArray(), getBase(), getDeclDesc(), getFieldDesc(), getIndex(), isArrayElement(), isDummy(), isField(), isIntegralPointer(), isOnePastEnd(), isUnknownSizeArray(), isZero(), and clang::CharUnits::Zero().
Referenced by toDiagnosticString().
std::string Pointer::toDiagnosticString | ( | const ASTContext & | Ctx | ) | const |
Converts the pointer to a string usable in diagnostics.
Definition at line 206 of file Pointer.cpp.
References asIntPointer(), clang::APValue::getAsString(), getType(), isIntegralPointer(), isZero(), and toAPValue().
Referenced by clang::interp::CmpHelper< Pointer >().
Converts the pointer to an APValue that is an rvalue.
Definition at line 315 of file Pointer.cpp.
References atField(), atIndex(), bool, clang::interp::Context::classify(), deref(), clang::interp::Record::fields(), clang::interp::Floating::getAPFloat(), clang::APValue::getArrayInitializedElt(), clang::interp::Context::getASTContext(), clang::interp::Record::getBase(), clang::interp::Record::getField(), clang::interp::Record::getNumBases(), clang::interp::Record::getNumFields(), clang::interp::Record::getNumVirtualBases(), clang::ASTContext::getRecordType(), getType(), clang::interp::Record::getVirtualBase(), INT_TYPE_SWITCH, isActive(), isDummy(), clang::Type::isFloatingType(), clang::Type::isIntegerType(), isLive(), isZero(), narrow(), clang::Result, clang::T, TYPE_SWITCH, and clang::CharUnits::Zero().
BlockPointer clang::interp::Pointer::BS |
Definition at line 667 of file Pointer.h.
Referenced by hasSameArray(), and clang::interp::Block::replacePointer().
IntPointer clang::interp::Pointer::Int |