clang 22.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/ByteCode/Pointer.h"
Public Member Functions | |
Pointer () | |
Pointer (IntPointer &&IntPtr) | |
Pointer (Block *B) | |
Pointer (Block *B, uint64_t BaseAndOffset) | |
Pointer (const Pointer &P) | |
Pointer (Pointer &&P) | |
Pointer (uint64_t Address, const Descriptor *Desc, uint64_t Offset=0) | |
Pointer (const Function *F, uint64_t Offset=0) | |
Pointer (const Type *TypePtr, const Type *TypeInfoType, uint64_t Offset=0) | |
Pointer (Block *Pointee, unsigned Base, uint64_t Offset) | |
~Pointer () | |
Pointer & | operator= (const Pointer &P) |
Pointer & | operator= (Pointer &&P) |
bool | operator== (const Pointer &P) const |
Equality operators are just for tests. | |
bool | operator!= (const Pointer &P) const |
APValue | toAPValue (const ASTContext &ASTCtx) 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, QualType ResultType) const |
Converts the pointer to an APValue that is an rvalue. | |
Pointer | atIndex (uint64_t 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 | inUnion () const |
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 |
const FunctionPointer & | asFunctionPointer () const |
const TypeidPointer & | asTypeidPointer () const |
bool | isBlockPointer () const |
bool | isIntegralPointer () const |
bool | isFunctionPointer () const |
bool | isTypeidPointer () 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 | 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 | isDynamic () const |
Checks if the storage has been dynamically allocated. | |
bool | isStaticTemporary () const |
Checks if the storage is a static temporary. | |
bool | isMutable () const |
Checks if the field is mutable. | |
bool | isWeak () const |
bool | isActive () const |
Checks if the object is active. | |
bool | isBaseClass () const |
Checks if a structure is a base class. | |
bool | isVirtualBaseClass () const |
bool | isDummy () const |
Checks if the pointer points to a dummy value. | |
bool | isConst () const |
Checks if an object or a subfield is mutable. | |
bool | isConstInMutable () const |
bool | isVolatile () const |
Checks if an object or a subfield is volatile. | |
UnsignedOrNone | getDeclID () const |
Returns the declaration ID. | |
uint64_t | getByteOffset () const |
Returns the byte offset from the start. | |
unsigned | getNumElems () const |
Returns the number of elements. | |
const Block * | block () const |
const std::byte * | getRawAddress () const |
If backed by actual data (i.e. | |
int64_t | getIndex () const |
Returns the index into an array. | |
bool | isOnePastEnd () const |
Checks if the index is one past end. | |
bool | isPastEnd () const |
Checks if the pointer points past the end of the object. | |
bool | isElementPastEnd () const |
Checks if the pointer is an out-of-bounds element pointer. | |
bool | isZeroSizeArray () const |
Checks if the pointer is pointing to a zero-size array. | |
template<typename T> | |
T & | deref () const |
Dereferences the pointer, if it's live. | |
template<typename T> | |
T & | elem (unsigned I) const |
Dereferences the element at index I . | |
bool | isDereferencable () const |
Whether this block can be read from at all. | |
void | initialize () const |
Initializes a field. | |
void | initializeAllElements () const |
Initialize all elements of a primitive array at once. | |
bool | isInitialized () const |
Checks if an object was initialized. | |
bool | isElementInitialized (unsigned Index) const |
Like isInitialized(), but for primitive arrays. | |
bool | allElementsInitialized () const |
void | activate () const |
Activats a field. | |
void | deactivate () const |
Deactivates an entire strurcutre. | |
Lifetime | getLifetime () const |
void | endLifetime () const |
void | startLifetime () const |
ComparisonCategoryResult | compare (const Pointer &Other) const |
Compare two pointers. | |
bool | pointsToLiteral () const |
Whether this points to a block that's been created for a "literal lvalue", i.e. | |
bool | pointsToStringLiteral () const |
void | print (llvm::raw_ostream &OS) const |
Prints the pointer. | |
size_t | computeOffsetForComparison () const |
Compute an integer that can be used to compare this pointer to another one. |
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. | |
static bool | pointToSameBlock (const Pointer &A, const Pointer &B) |
Checks if both given pointers point to the same block. | |
static std::optional< std::pair< Pointer, Pointer > > | computeSplitPoint (const Pointer &A, const Pointer &B) |
Friends | |
class | Block |
class | DeadBlock |
class | MemberPointer |
class | InterpState |
struct | InitMap |
class | DynamicAllocator |
class | Program |
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 97 of file Pointer.h.
References Int, and clang::nullptr.
Referenced by activate(), atField(), atFieldSub(), atIndex(), compare(), computeOffsetForComparison(), computeSplitPoint(), expand(), getArray(), getBase(), getDeclPtr(), hasSameArray(), hasSameBase(), narrow(), operator!=(), operator=(), operator=(), operator==(), Pointer(), Pointer(), Pointer(), Pointer(), pointToSameBlock(), toAPValue(), and toRValue().
|
inline |
Pointer::Pointer | ( | Block * | B | ) |
Definition at line 26 of file Pointer.cpp.
Pointer::Pointer | ( | Block * | B, |
uint64_t | BaseAndOffset ) |
Definition at line 30 of file Pointer.cpp.
Pointer::Pointer | ( | const Pointer & | P | ) |
Definition at line 43 of file Pointer.cpp.
References clang::interp::Block, BS, Fn, clang::interp::Fn, Int, clang::interp::Int, Pointer(), Typeid, and clang::interp::Typeid.
Pointer::Pointer | ( | Pointer && | P | ) |
Definition at line 63 of file Pointer.cpp.
References clang::interp::Block, BS, Fn, clang::interp::Fn, Int, clang::interp::Int, Pointer(), Typeid, and clang::interp::Typeid.
|
inline |
|
inline |
Definition at line 33 of file Pointer.cpp.
Pointer::~Pointer | ( | ) |
Definition at line 82 of file Pointer.cpp.
References Block, BS, and isBlockPointer().
void Pointer::activate | ( | ) | const |
Activats a field.
Definition at line 560 of file Pointer.cpp.
References activate(), atField(), BS, deactivate(), std::function, getBase(), getRecord(), inUnion(), clang::interp::InlineDescriptor::IsActive, isRoot(), clang::interp::Record::isUnion(), and Pointer().
Referenced by clang::interp::Activate(), activate(), clang::interp::ActivateThisField(), clang::interp::CheckNewTypeMismatch(), clang::interp::copyRecord(), clang::interp::FinishInitActivate(), clang::interp::FinishInitActivatePop(), clang::interp::FinishInitGlobal(), and clang::interp::InitBitFieldActivate().
bool Pointer::allElementsInitialized | ( | ) | const |
Definition at line 543 of file Pointer.cpp.
References block(), BS, getFieldDesc(), clang::interp::Initialized, clang::interp::GlobalInlineDescriptor::InitState, isArrayRoot(), isRoot(), isStatic(), and clang::interp::Block::rawData().
Referenced by clang::interp::CheckArrayInitialized().
|
inlinenodiscard |
Definition at line 448 of file Pointer.h.
References BS, and isBlockPointer().
Referenced by clang::interp::DynamicAllocator::cleanup(), computeSplitPoint(), clang::interp::DeadBlock::DeadBlock(), hasSameBase(), initialize(), isInitialized(), and clang::interp::OffsetHelper().
|
inlinenodiscard |
Definition at line 456 of file Pointer.h.
References Fn, and isFunctionPointer().
Referenced by clang::interp::CallPtr(), clang::interp::OffsetHelper(), print(), toAPValue(), and toDiagnosticString().
|
inlinenodiscard |
Definition at line 452 of file Pointer.h.
References Int, and isIntegralPointer().
Referenced by computeOffsetForComparison(), clang::interp::getField(), clang::interp::GetPtrBase(), clang::interp::GetPtrBasePop(), clang::interp::OffsetHelper(), toAPValue(), and toDiagnosticString().
|
inlinenodiscard |
Definition at line 460 of file Pointer.h.
References isTypeidPointer(), and Typeid.
Referenced by computeOffsetForComparison(), and print().
Creates a pointer to a field.
Definition at line 173 of file Pointer.h.
References BS, isBlockPointer(), and Pointer().
Referenced by activate(), clang::interp::ActivateThisField(), clang::interp::CheckFieldsInitialized(), clang::interp::collectBlocks(), clang::interp::copyRecord(), clang::interp::endLifetimeRecurse(), enumerateData(), clang::interp::finishGlobalRecurse(), clang::interp::MemberPointer::getBase(), clang::interp::GetField(), clang::interp::getField(), clang::interp::GetFieldPop(), clang::interp::GetPtrBase(), clang::interp::GetPtrBasePop(), clang::interp::InitBitField(), clang::interp::InitBitFieldActivate(), clang::interp::InitField(), clang::interp::InitFieldActivate(), clang::interp::SetField(), clang::interp::SetThreeWayComparisonField(), clang::interp::startLifetimeRecurse(), clang::interp::MemberPointer::toPointer(), and clang::interp::zeroAll().
Subtract the given offset from the current Base and Offset of the pointer.
Definition at line 181 of file Pointer.h.
Referenced by clang::interp::MemberPointer::getBase(), and clang::interp::GetPtrDerivedPop().
|
inlinenodiscard |
Offsets a pointer inside an array.
Definition at line 156 of file Pointer.h.
References BS, elemSize(), Fn, getDeclDesc(), getFieldDesc(), getSize(), Int, isFunctionPointer(), isIntegralPointer(), and Pointer().
Referenced by clang::interp::arePotentiallyOverlappingStringLiterals(), clang::interp::ArrayDecay(), clang::interp::ArrayElem(), clang::interp::ArrayElemPop(), clang::interp::CheckArrayInitialized(), clang::interp::collectBlocks(), clang::interp::CopyArray(), clang::interp::copyComposite(), clang::interp::endLifetimeRecurse(), enumerateData(), clang::interp::finishGlobalRecurse(), clang::interp::InitElem(), clang::interp::InitElemPop(), clang::interp::interp__builtin_elementwise_countzeroes(), clang::interp::interp__builtin_is_aligned_up_down(), clang::interp::interp__builtin_memchr(), clang::interp::interp__builtin_nan(), clang::interp::interp__builtin_object_size(), clang::interp::interp__builtin_strcmp(), clang::interp::interp__builtin_strlen(), clang::interp::OffsetHelper(), clang::interp::RunDestructors(), clang::interp::startLifetimeRecurse(), and clang::interp::zeroAll().
|
inline |
Definition at line 599 of file Pointer.h.
Referenced by allElementsInitialized(), clang::interp::Call(), clang::interp::CheckConst(), clang::interp::CheckDestructor(), clang::interp::CheckFinalLoad(), clang::interp::CheckLoad(), clang::interp::CheckMutable(), clang::interp::CheckNewTypeMismatch(), clang::interp::CheckStore(), clang::interp::collectBlocks(), clang::interp::Free(), clang::interp::getField(), clang::interp::interp__builtin_is_within_lifetime(), clang::interp::interp__builtin_operator_delete(), clang::interp::interp__builtin_strlen(), isElementInitialized(), isInitialized(), operator=(), pointsToLiteral(), pointsToStringLiteral(), pointToSameBlock(), toAPValue(), and clang::interp::MemberPointer::toPointer().
|
inline |
If this pointer has an InlineDescriptor we can use to initialize.
Definition at line 441 of file Pointer.h.
References BS, and isBlockPointer().
Referenced by clang::interp::Activate(), clang::interp::ActivateThisField(), clang::interp::FinishInit(), clang::interp::FinishInitActivate(), clang::interp::FinishInitActivatePop(), clang::interp::FinishInitGlobal(), clang::interp::FinishInitPop(), and clang::interp::interp__builtin_overflowop().
|
inline |
Compare two pointers.
Definition at line 744 of file Pointer.h.
References clang::Equal, clang::Greater, hasSameBase(), clang::Less, clang::Other, Pointer(), and clang::Unordered.
size_t Pointer::computeOffsetForComparison | ( | ) | const |
Compute an integer that can be used to compare this pointer to another one.
This is usually NOT the same as the pointer offset regarding the AST record layout.
Definition at line 360 of file Pointer.cpp.
References asIntPointer(), asTypeidPointer(), elemSize(), expand(), getArray(), getBase(), getIndex(), clang::interp::Record::getNumVirtualBases(), getRecord(), isArrayElement(), isBaseClass(), isBlockPointer(), isIntegralPointer(), isOnePastEnd(), isRoot(), isTypeidPointer(), clang::interp::Record::isUnion(), isVirtualBaseClass(), clang::interp::InlineDescriptor::Offset, Pointer(), clang::Result, clang::interp::TypeidPointer::TypePtr, and clang::interp::IntPointer::Value.
Referenced by clang::interp::CmpHelperEQ< Pointer >().
|
static |
Definition at line 670 of file Pointer.cpp.
References asBlockPointer(), clang::interp::BlockPointer::Base, getBase(), isBlockPointer(), isRoot(), clang::interp::BlockPointer::Pointee, and Pointer().
Referenced by clang::interp::CmpHelper< Pointer >().
void Pointer::deactivate | ( | ) | const |
Deactivates an entire strurcutre.
Definition at line 614 of file Pointer.cpp.
Referenced by activate().
Dereferences the pointer, if it's live.
Definition at line 660 of file Pointer.h.
References BS, isArrayRoot(), isBlockPointer(), isDereferencable(), isLive(), and clang::T.
Referenced by clang::interp::assignInteger(), clang::interp::collectBlocks(), clang::interp::CopyArray(), clang::interp::copyComposite(), clang::interp::copyPrimitiveMemory(), clang::interp::copyPrimitiveMemory(), clang::interp::copyRecord(), clang::interp::DoBitCastPtr(), clang::interp::finishGlobalRecurse(), clang::interp::IncDecFloatHelper(), clang::interp::IncDecHelper(), clang::interp::IncDecPtrHelper(), clang::interp::InitElem(), clang::interp::InitElemPop(), clang::interp::InitField(), clang::interp::InitFieldActivate(), clang::interp::InitGlobal(), clang::interp::InitGlobalTemp(), clang::interp::interp__builtin_elementwise_countzeroes(), clang::interp::interp__builtin_memchr(), clang::interp::interp__builtin_nan(), clang::interp::interp__builtin_strcmp(), clang::interp::interp__builtin_strlen(), clang::interp::Load(), clang::interp::LoadPop(), clang::interp::readPointerToBuffer(), clang::interp::InterpFrame::setParam(), clang::interp::SetThreeWayComparisonField(), clang::interp::StoreActivate(), clang::interp::StoreActivatePop(), clang::interp::StoreBitFieldActivate(), clang::interp::StoreBitFieldActivatePop(), and toRValue().
Dereferences the element at index I
.
This is equivalent to atIndex(I).deref<T>().
Definition at line 676 of file Pointer.h.
References BS, clang::interp::Descriptor::getElemSize(), getFieldDesc(), getNumElems(), isBlockPointer(), isDereferencable(), isLive(), and clang::T.
Referenced by clang::interp::ArrayElem(), clang::interp::ArrayElemPop(), clang::interp::collectBlocks(), clang::interp::convertBoolVectorToInt(), clang::interp::copyComposite(), clang::interp::Program::createGlobalString(), clang::interp::Divc(), clang::interp::Context::evaluateStrlen(), clang::interp::interp__builtin_blend(), clang::interp::interp__builtin_elementwise_abs(), clang::interp::interp__builtin_elementwise_int_binop(), clang::interp::interp__builtin_elementwise_maxmin(), clang::interp::interp__builtin_elementwise_popcount(), clang::interp::interp__builtin_elementwise_triop(), clang::interp::interp__builtin_elementwise_triop_fp(), clang::interp::interp__builtin_ia32_pmul(), clang::interp::interp__builtin_select(), clang::interp::interp__builtin_vector_reduce(), and clang::interp::Mulc().
|
inline |
Returns the element size of the innermost field.
Definition at line 355 of file Pointer.h.
References BS, getDeclDesc(), clang::interp::Descriptor::getElemSize(), getFieldDesc(), clang::interp::Descriptor::getSize(), Int, and isIntegralPointer().
Referenced by clang::interp::arePotentiallyOverlappingStringLiterals(), atIndex(), computeOffsetForComparison(), clang::interp::Context::evaluateStrlen(), getIndex(), getIntegerRepresentation(), getNumElems(), clang::interp::interp__builtin_memcpy(), and clang::interp::OffsetHelper().
|
inline |
Definition at line 727 of file Pointer.h.
References BS, clang::interp::Ended, and isBlockPointer().
Referenced by clang::interp::endLifetimeRecurse().
|
inlinenodiscard |
Expands a pointer to the containing array, undoing narrowing.
Definition at line 221 of file Pointer.h.
References Block, BS, getDeclDesc(), clang::interp::Block::getDescriptor(), getSize(), inPrimitiveArray(), clang::interp::Descriptor::IsArray, isBlockPointer(), isElementPastEnd(), isRoot(), Next, and Pointer().
Referenced by clang::interp::AddOffset(), computeOffsetForComparison(), clang::interp::computePointerOffset(), clang::interp::ExpandPtr(), clang::interp::interp__builtin_memcpy(), clang::interp::interp__builtin_object_size(), clang::interp::pointsToLastObject(), and toAPValue().
|
inlinenodiscard |
Returns the parent array.
Definition at line 313 of file Pointer.h.
Referenced by computeOffsetForComparison(), clang::interp::computePointerOffset(), clang::interp::pointsToLastObject(), and toAPValue().
|
inlinenodiscard |
Returns a pointer to the object of which this pointer is a field.
Definition at line 304 of file Pointer.h.
Referenced by activate(), clang::interp::CallVirt(), clang::interp::CheckActive(), clang::interp::CheckNewTypeMismatch(), clang::interp::CheckVolatile(), computeOffsetForComparison(), clang::interp::computePointerOffset(), computeSplitPoint(), clang::interp::Free(), clang::interp::interp__builtin_memcpy(), clang::interp::interp__builtin_object_size(), clang::interp::pointsToLastObject(), and toAPValue().
|
inline |
Returns the byte offset from the start.
Definition at line 582 of file Pointer.h.
References Int, isIntegralPointer(), isOnePastEnd(), isTypeidPointer(), and Typeid.
Referenced by clang::interp::CheckDowncast(), clang::interp::CmpHelper< Pointer >(), clang::interp::getField(), clang::interp::interp__builtin_is_aligned_up_down(), and clang::interp::OffsetHelper().
|
inline |
Accessor for information about the declaration site.
Definition at line 279 of file Pointer.h.
References BS, Int, isBlockPointer(), isFunctionPointer(), isIntegralPointer(), and isTypeidPointer().
Referenced by atIndex(), clang::interp::CheckBCPResult(), clang::interp::CheckConstant(), clang::interp::CheckDowncast(), clang::interp::CheckExtern(), clang::interp::CheckFieldsInitialized(), clang::interp::CheckLiteralType(), clang::interp::Destroy(), clang::interp::DiagnoseUninitialized(), elemSize(), expand(), clang::interp::Free(), getDeclLoc(), getFieldDesc(), clang::interp::GetPtrDerivedPop(), getSource(), clang::interp::InitGlobalTemp(), clang::interp::InitGlobalTempComp(), clang::interp::interp__builtin_assume_aligned(), clang::interp::interp__builtin_is_aligned_up_down(), clang::interp::interp__builtin_is_within_lifetime(), clang::interp::interp__builtin_object_size(), clang::interp::interp__builtin_operator_delete(), isConst(), clang::interp::isConstexprUnknown(), isVolatile(), and toAPValue().
|
inline |
Returns the declaration ID.
Definition at line 573 of file Pointer.h.
References BS, and isBlockPointer().
Referenced by clang::interp::CheckConstant(), and CheckGlobal().
|
inline |
Definition at line 289 of file Pointer.h.
References getDeclDesc(), and clang::interp::Descriptor::getLocation().
Referenced by clang::interp::CheckDeleteSource(), and clang::interp::CheckLive().
|
inlinenodiscard |
Definition at line 352 of file Pointer.h.
Referenced by clang::interp::CheckDowncast(), and toAPValue().
|
inline |
Returns the element record type, if this is a non-primive array.
Definition at line 473 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 478 of file Pointer.h.
References getFieldDesc().
Referenced by clang::interp::CheckArrayInitialized(), clang::interp::CheckMutable(), clang::interp::CheckVolatile(), clang::interp::computePointerOffset(), clang::interp::DoBitCastPtr(), and clang::interp::pointsToLastObject().
|
inline |
Accessors for information about the innermost field.
Definition at line 323 of file Pointer.h.
References getDeclDesc(), Int, isIntegralPointer(), and isRoot().
Referenced by allElementsInitialized(), clang::interp::ArrayElem(), clang::interp::ArrayElemPop(), atIndex(), clang::interp::CallVirt(), clang::interp::checkConstructor(), clang::interp::CheckNewTypeMismatch(), clang::interp::CheckVolatile(), clang::interp::CmpHelperEQ< Pointer >(), clang::interp::collectBlocks(), clang::interp::computePointerOffset(), clang::interp::convertBoolVectorToInt(), clang::interp::copyComposite(), clang::interp::copyRecord(), clang::interp::DoBitCast(), clang::interp::DoBitCastPtr(), elem(), elemSize(), clang::interp::endLifetimeRecurse(), enumerateData(), clang::interp::Context::evaluateStrlen(), clang::interp::finishGlobalRecurse(), getElemRecord(), clang::interp::getElemType(), getField(), getOffset(), getRecord(), getSize(), getType(), hasSameArray(), inArray(), initialize(), initializeAllElements(), inPrimitiveArray(), clang::interp::interp__builtin_elementwise_abs(), clang::interp::interp__builtin_elementwise_countzeroes(), clang::interp::interp__builtin_elementwise_popcount(), clang::interp::interp__builtin_memchr(), clang::interp::interp__builtin_memcpy(), clang::interp::interp__builtin_nan(), clang::interp::interp__builtin_object_size(), clang::interp::interp__builtin_operator_delete(), clang::interp::interp__builtin_select(), clang::interp::interp__builtin_strcmp(), clang::interp::interp__builtin_strlen(), clang::interp::interp__builtin_vector_reduce(), isElementInitialized(), isField(), isInitialized(), isUnknownSizeArray(), clang::interp::isUserWritingOffTheEnd(), isZeroSizeArray(), clang::interp::OffsetHelper(), clang::interp::startLifetimeRecurse(), toAPValue(), toRValue(), and clang::interp::zeroAll().
|
inline |
Returns the index into an array.
Definition at line 609 of file Pointer.h.
References BS, elemSize(), getIntegerRepresentation(), getOffset(), isBlockPointer(), and isZero().
Referenced by clang::interp::arePotentiallyOverlappingStringLiterals(), clang::interp::CheckBCPResult(), computeOffsetForComparison(), clang::interp::computePointerOffset(), enumerateData(), clang::interp::Context::evaluateStrlen(), clang::interp::Free(), initialize(), clang::interp::interp__builtin_is_aligned_up_down(), clang::interp::interp__builtin_memchr(), clang::interp::interp__builtin_memcpy(), clang::interp::interp__builtin_strcmp(), clang::interp::interp__builtin_strlen(), isInitialized(), clang::interp::OffsetHelper(), clang::interp::SubPtr(), and toAPValue().
|
inline |
Definition at line 143 of file Pointer.h.
References BS, elemSize(), Fn, Int, isFunctionPointer(), and isIntegralPointer().
Referenced by clang::interp::CastPointerIntegral(), clang::interp::CastPointerIntegralAP(), clang::interp::CastPointerIntegralAPS(), clang::interp::CmpHelperEQ< Pointer >(), getIndex(), clang::interp::interp__builtin_atomic_lock_free(), clang::interp::interp__builtin_memcpy(), clang::interp::OffsetHelper(), and clang::interp::SubPtr().
|
inline |
Definition at line 719 of file Pointer.h.
References BS, isBlockPointer(), and clang::interp::Started.
Referenced by clang::interp::CheckFinalLoad(), clang::interp::CheckLoad(), clang::interp::CheckStore(), clang::interp::Destroy(), clang::interp::endLifetimeRecurse(), clang::interp::interp__builtin_is_within_lifetime(), and clang::interp::startLifetimeRecurse().
|
inline |
Returns the number of elements.
Definition at line 593 of file Pointer.h.
References elemSize(), getSize(), and isBlockPointer().
Referenced by clang::interp::arePotentiallyOverlappingStringLiterals(), clang::interp::computePointerOffset(), clang::interp::convertBoolVectorToInt(), elem(), clang::interp::Context::evaluateStrlen(), clang::interp::interp__builtin_blend(), clang::interp::interp__builtin_elementwise_abs(), clang::interp::interp__builtin_elementwise_countzeroes(), clang::interp::interp__builtin_elementwise_popcount(), clang::interp::interp__builtin_memcmp(), clang::interp::interp__builtin_memcpy(), clang::interp::interp__builtin_nan(), clang::interp::interp__builtin_select(), clang::interp::interp__builtin_vector_reduce(), clang::interp::OffsetHelper(), clang::interp::SubPtr(), and toAPValue().
|
inline |
Returns the offset into an array.
Definition at line 373 of file Pointer.h.
References BS, getFieldDesc(), and isBlockPointer().
Referenced by clang::interp::CmpHelperEQ< Pointer >(), getIndex(), and isOnePastEnd().
|
inline |
If backed by actual data (i.e.
a block pointer), return an address to that data.
Definition at line 603 of file Pointer.h.
References BS, and isBlockPointer().
Referenced by clang::interp::arePotentiallyOverlappingStringLiterals(), and clang::interp::Context::evaluateStrlen().
|
inline |
Returns the record descriptor of a class.
Definition at line 471 of file Pointer.h.
References clang::interp::Descriptor::ElemRecord, and getFieldDesc().
Referenced by activate(), clang::interp::CheckFieldsInitialized(), clang::interp::EvaluationResult::checkFullyInitialized(), clang::interp::CheckNewTypeMismatch(), computeOffsetForComparison(), clang::interp::computePointerOffset(), clang::interp::endLifetimeRecurse(), clang::interp::finishGlobalRecurse(), clang::interp::GetPtrDerivedPop(), clang::interp::pointsToLastObject(), clang::interp::SetThreeWayComparisonField(), clang::interp::startLifetimeRecurse(), toAPValue(), and clang::interp::MemberPointer::toPointer().
|
inline |
Returns the total size of the innermost field.
Definition at line 367 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 292 of file Pointer.h.
References Fn, clang::interp::Function::getDecl(), getDeclDesc(), clang::interp::Descriptor::getSource(), Int, isBlockPointer(), isFunctionPointer(), and isIntegralPointer().
|
inline |
Returns the type of the innermost field.
Definition at line 333 of file Pointer.h.
References BS, Fn, getFieldDesc(), clang::interp::Descriptor::getType(), getType(), inPrimitiveArray(), isFunctionPointer(), isTypeidPointer(), and Typeid.
Referenced by clang::interp::CallVirt(), clang::interp::CheckBCPResult(), clang::interp::CheckConst(), clang::interp::CheckDowncast(), clang::interp::EvaluationResult::checkFullyInitialized(), clang::interp::EvaluationResult::checkReturnValue(), clang::interp::CheckVolatile(), clang::interp::DoBitCastPtr(), clang::interp::Free(), getType(), clang::interp::interp__builtin_memchr(), clang::interp::interp__builtin_memcmp(), clang::interp::interp__builtin_memcpy(), clang::interp::interp__builtin_object_size(), clang::interp::SetThreeWayComparisonField(), toAPValue(), and toDiagnosticString().
Checks if two pointers can be subtracted.
Definition at line 642 of file Pointer.cpp.
References clang::interp::BlockPointer::Base, BS, getFieldDesc(), hasSameBase(), clang::interp::Descriptor::IsArray, and Pointer().
Checks if two pointers are comparable.
Definition at line 618 of file Pointer.cpp.
References asBlockPointer(), isFunctionPointer(), isIntegralPointer(), isTypeidPointer(), isZero(), clang::interp::BlockPointer::Pointee, and Pointer().
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 394 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 483 of file Pointer.cpp.
References asBlockPointer(), BS, getFieldDesc(), getIndex(), clang::interp::Descriptor::getNumElems(), clang::interp::Initialized, clang::interp::GlobalInlineDescriptor::InitState, isBlockPointer(), clang::interp::Descriptor::isPrimitiveArray(), isRoot(), isStatic(), clang::interp::BlockPointer::Pointee, and clang::interp::Block::rawData().
Referenced by clang::interp::CopyArray(), clang::interp::copyComposite(), clang::interp::copyRecord(), clang::interp::DoBitCastPtr(), enumerateData(), clang::interp::FinishInit(), clang::interp::FinishInitActivate(), clang::interp::FinishInitActivatePop(), clang::interp::FinishInitGlobal(), clang::interp::FinishInitPop(), clang::interp::Init(), clang::interp::InitBitField(), clang::interp::InitElem(), clang::interp::InitElemPop(), clang::interp::InitGlobal(), clang::interp::InitGlobalTemp(), clang::interp::InitPop(), clang::interp::interp__builtin_carryop(), clang::interp::interp__builtin_elementwise_countzeroes(), clang::interp::interp__builtin_overflowop(), clang::interp::SetField(), clang::interp::SetThreeWayComparisonField(), clang::interp::Store(), clang::interp::StoreBitField(), clang::interp::StoreBitFieldPop(), and clang::interp::StorePop().
void Pointer::initializeAllElements | ( | ) | const |
Initialize all elements of a primitive array at once.
This can be used in situations where we know we have initialized all elements of a primtive array.
Definition at line 530 of file Pointer.cpp.
References getFieldDesc(), and isArrayRoot().
Referenced by clang::interp::Program::createGlobalString(), clang::interp::interp__builtin_elementwise_abs(), clang::interp::interp__builtin_elementwise_int_binop(), clang::interp::interp__builtin_elementwise_popcount(), clang::interp::interp__builtin_elementwise_triop(), clang::interp::interp__builtin_elementwise_triop_fp(), and clang::interp::interp__builtin_select().
|
inline |
Checks if the structure is a primitive array.
Definition at line 406 of file Pointer.h.
References getFieldDesc(), isBlockPointer(), and clang::interp::Descriptor::isPrimitiveArray().
|
inline |
Definition at line 399 of file Pointer.h.
References BS, and isBlockPointer().
Referenced by activate(), clang::interp::CheckActive(), and clang::interp::CheckNewTypeMismatch().
|
inline |
Checks if the object is active.
Definition at line 533 of file Pointer.h.
References isBlockPointer(), and isRoot().
Referenced by clang::interp::CheckActive(), clang::interp::CheckFieldsInitialized(), clang::interp::CheckNewTypeMismatch(), clang::interp::copyRecord(), clang::interp::interp__builtin_is_within_lifetime(), and toRValue().
|
inline |
Checks if the pointer points to an array.
Definition at line 418 of file Pointer.h.
References clang::interp::BlockPointer::Base, BS, inArray(), and isBlockPointer().
Referenced by clang::interp::EvaluationResult::checkReturnValue(), computeOffsetForComparison(), clang::interp::computePointerOffset(), clang::interp::Free(), clang::interp::pointsToLastObject(), and toAPValue().
|
inline |
Whether this array refers to an array, but not to the first element.
Definition at line 391 of file Pointer.h.
Referenced by allElementsInitialized(), deref(), initializeAllElements(), and toAPValue().
|
inline |
Checks if a structure is a base class.
Definition at line 539 of file Pointer.h.
References isField().
Referenced by clang::interp::CallVirt(), computeOffsetForComparison(), clang::interp::computePointerOffset(), clang::interp::Free(), clang::interp::interp__builtin_memcpy(), clang::interp::interp__builtin_object_size(), and clang::interp::pointsToLastObject().
|
inline |
Definition at line 465 of file Pointer.h.
References clang::interp::Block.
Referenced by asBlockPointer(), atField(), canBeInitialized(), clang::interp::CheckConst(), clang::interp::CheckConstant(), clang::interp::CheckFinalLoad(), clang::interp::CheckLoad(), clang::interp::CheckNewTypeMismatch(), clang::interp::CheckPointerToIntegralCast(), clang::interp::CheckStore(), computeOffsetForComparison(), computeSplitPoint(), deref(), clang::interp::DoBitCast(), clang::interp::DoBitCastPtr(), clang::interp::DoMemcpy(), elem(), endLifetime(), expand(), clang::interp::ExpandPtr(), getDeclDesc(), getDeclID(), clang::interp::getField(), getIndex(), getLifetime(), getNumElems(), getOffset(), clang::interp::GetPtrBase(), clang::interp::GetPtrBasePop(), clang::interp::GetPtrDerivedPop(), getRawAddress(), getSize(), getSource(), inArray(), initialize(), inPrimitiveArray(), clang::interp::interp__builtin_assume_aligned(), clang::interp::interp__builtin_object_size(), clang::interp::interp__builtin_strcmp(), inUnion(), isActive(), isArrayElement(), clang::interp::isConstexprUnknown(), isConstInMutable(), isDereferencable(), isDummy(), isDynamic(), isElementInitialized(), isExtern(), isField(), isInitialized(), isLive(), isMutable(), isOnePastEnd(), isRoot(), isStatic(), isTemporary(), isUnknownSizeArray(), isVolatile(), isWeak(), isZero(), clang::interp::Load(), clang::interp::LoadPop(), narrow(), clang::interp::OffsetHelper(), operator=(), operator=(), operator==(), pointsToLiteral(), pointsToStringLiteral(), pointToSameBlock(), startLifetime(), clang::interp::SubPtr(), and ~Pointer().
|
inline |
Checks if an object or a subfield is mutable.
Definition at line 554 of file Pointer.h.
References getDeclDesc(), clang::interp::Descriptor::IsConst, isIntegralPointer(), and isRoot().
Referenced by clang::interp::CheckConst(), and clang::interp::CheckExtern().
|
inline |
Definition at line 559 of file Pointer.h.
References false, isBlockPointer(), and isRoot().
Referenced by clang::interp::CheckConst().
|
inline |
Whether this block can be read from at all.
This is only true for block pointers that point to a valid location inside that block.
Definition at line 694 of file Pointer.h.
References isBlockPointer(), and isPastEnd().
|
inline |
Checks if the pointer points to a dummy value.
Definition at line 544 of file Pointer.h.
References Block, BS, and isBlockPointer().
Referenced by clang::interp::Call(), clang::interp::CheckBCPResult(), clang::interp::CheckInvoke(), clang::interp::CheckPointerToIntegralCast(), clang::interp::CopyArray(), clang::interp::IncDecHelper(), clang::interp::IncDecPtrHelper(), clang::interp::interp__builtin_carryop(), clang::interp::interp__builtin_memchr(), clang::interp::interp__builtin_memcmp(), clang::interp::interp__builtin_memcpy(), clang::interp::interp__builtin_object_size(), clang::interp::interp__builtin_overflowop(), clang::interp::interp__builtin_strcmp(), clang::interp::isConstexprUnknown(), clang::interp::isUserWritingOffTheEnd(), and toRValue().
|
inline |
Checks if the storage has been dynamically allocated.
Definition at line 506 of file Pointer.h.
References BS, and isBlockPointer().
Referenced by clang::interp::CheckLive(), pointsToLiteral(), pointsToStringLiteral(), and toAPValue().
Like isInitialized(), but for primitive arrays.
Definition at line 454 of file Pointer.cpp.
References block(), BS, getFieldDesc(), clang::interp::Initialized, clang::interp::GlobalInlineDescriptor::InitState, isBlockPointer(), isInitialized(), clang::interp::Descriptor::isPrimitiveArray(), isRoot(), isStatic(), and clang::interp::Block::rawData().
Referenced by clang::interp::CheckArrayInitialized(), and isInitialized().
|
inline |
Checks if the pointer is an out-of-bounds element pointer.
Definition at line 648 of file Pointer.h.
Referenced by clang::interp::CheckRange(), expand(), print(), and clang::interp::SubPtr().
|
inline |
Checks if the storage is extern.
Definition at line 485 of file Pointer.h.
References BS, and isBlockPointer().
Referenced by clang::interp::CheckExtern(), and clang::interp::DiagnoseUninitialized().
|
inline |
Checks if the item is a field in an object.
Definition at line 271 of file Pointer.h.
References clang::interp::Descriptor::asDecl(), getFieldDesc(), isBlockPointer(), and isRoot().
Referenced by clang::interp::CheckLive(), clang::interp::CheckLoad(), clang::interp::computePointerOffset(), isBaseClass(), isVirtualBaseClass(), and toAPValue().
|
inline |
Definition at line 467 of file Pointer.h.
References clang::interp::Fn.
Referenced by asFunctionPointer(), atIndex(), clang::interp::CallPtr(), clang::interp::CheckBCPResult(), clang::interp::CheckPointerToIntegralCast(), clang::interp::CmpHelper< Pointer >(), clang::interp::CmpHelperEQ< Pointer >(), getDeclDesc(), getIntegerRepresentation(), getSource(), getType(), hasSameBase(), isWeak(), isZero(), isZeroSizeArray(), clang::interp::OffsetHelper(), operator=(), operator==(), toAPValue(), and toDiagnosticString().
bool Pointer::isInitialized | ( | ) | const |
Checks if an object was initialized.
Definition at line 432 of file Pointer.cpp.
References asBlockPointer(), block(), BS, getFieldDesc(), getIndex(), clang::interp::Initialized, clang::interp::GlobalInlineDescriptor::InitState, isBlockPointer(), isElementInitialized(), clang::interp::Descriptor::isPrimitiveArray(), isRoot(), and clang::interp::Block::rawData().
Referenced by clang::interp::CheckExtern(), clang::interp::CheckFieldsInitialized(), clang::interp::CheckFinalLoad(), clang::interp::CheckLoad(), clang::interp::copyRecord(), clang::interp::DecPtr(), clang::interp::DiagnoseUninitialized(), clang::interp::Program::dump(), clang::interp::IncPtr(), isElementInitialized(), clang::interp::Program::isGlobalInitialized(), and clang::interp::readPointerToBuffer().
|
inline |
Definition at line 466 of file Pointer.h.
References clang::interp::Int.
Referenced by asIntPointer(), atIndex(), clang::interp::CheckBCPResult(), computeOffsetForComparison(), elemSize(), getByteOffset(), getDeclDesc(), clang::interp::getField(), getFieldDesc(), getIntegerRepresentation(), clang::interp::GetPtrBase(), clang::interp::GetPtrBasePop(), getSource(), hasSameBase(), clang::interp::interp__builtin_atomic_lock_free(), clang::interp::interp__builtin_memcpy(), isConst(), isPastEnd(), isZero(), clang::interp::OffsetHelper(), operator=(), operator==(), toAPValue(), toDiagnosticString(), and toRValue().
|
inline |
Checks if the pointer is live.
Definition at line 265 of file Pointer.h.
References BS, and isBlockPointer().
Referenced by clang::interp::CheckConst(), clang::interp::EvaluationResult::checkFullyInitialized(), clang::interp::CheckLive(), clang::interp::CheckMutable(), clang::interp::CheckVolatile(), clang::interp::copyComposite(), deref(), clang::interp::DiagnoseUninitialized(), clang::interp::DoBitCast(), clang::interp::DoBitCastPtr(), elem(), and toRValue().
|
inline |
Checks if the field is mutable.
Definition at line 517 of file Pointer.h.
References isBlockPointer(), and isRoot().
Referenced by clang::interp::CheckConst(), and clang::interp::CheckMutable().
|
inline |
Checks if the index is one past end.
Definition at line 626 of file Pointer.h.
References BS, getOffset(), getSize(), isBlockPointer(), isPastEnd(), and isUnknownSizeArray().
Referenced by clang::interp::arePotentiallyOverlappingStringLiterals(), clang::interp::CheckRange(), clang::interp::CheckSubobject(), clang::interp::CmpHelperEQ< Pointer >(), computeOffsetForComparison(), clang::interp::computePointerOffset(), clang::interp::Free(), getByteOffset(), clang::interp::interp__builtin_is_within_lifetime(), narrow(), clang::interp::OffsetHelper(), and toAPValue().
|
inline |
Checks if the pointer points past the end of the object.
Definition at line 640 of file Pointer.h.
References BS, isIntegralPointer(), and isZero().
Referenced by isDereferencable(), isOnePastEnd(), and toRValue().
|
inline |
Pointer points directly to a block.
Definition at line 434 of file Pointer.h.
References BS, isBlockPointer(), and isZero().
Referenced by activate(), allElementsInitialized(), clang::interp::ArrayDecay(), clang::interp::EvaluationResult::checkReturnValue(), clang::interp::CheckVolatile(), computeOffsetForComparison(), computeSplitPoint(), expand(), clang::interp::Free(), getFieldDesc(), initialize(), isActive(), isConst(), isConstInMutable(), isElementInitialized(), isField(), isInitialized(), isMutable(), isVolatile(), clang::interp::pointsToLastObject(), and print().
|
inline |
Checks if the storage is static.
Definition at line 491 of file Pointer.h.
References BS, and isBlockPointer().
Referenced by allElementsInitialized(), clang::interp::CheckConstant(), CheckGlobal(), initialize(), isElementInitialized(), and isStaticTemporary().
|
inline |
Checks if the storage is a static temporary.
Definition at line 514 of file Pointer.h.
References isStatic(), and isTemporary().
|
inline |
Checks if the storage is temporary.
Definition at line 498 of file Pointer.h.
References BS, and isBlockPointer().
Referenced by clang::interp::CheckDeleteSource(), clang::interp::CheckLive(), and isStaticTemporary().
|
inline |
Definition at line 468 of file Pointer.h.
References clang::interp::Typeid.
Referenced by asTypeidPointer(), clang::interp::CheckBCPResult(), clang::interp::CmpHelper< Pointer >(), computeOffsetForComparison(), getByteOffset(), getDeclDesc(), getType(), hasSameBase(), isZero(), operator=(), and toAPValue().
|
inline |
Checks if the structure is an array of unknown size.
Definition at line 412 of file Pointer.h.
References getFieldDesc(), isBlockPointer(), and clang::interp::Descriptor::isUnknownSizeArray().
Referenced by clang::interp::ArrayDecay(), clang::interp::CheckArray(), clang::interp::CmpHelperEQ< Pointer >(), clang::interp::interp__builtin_memcpy(), isOnePastEnd(), narrow(), and toAPValue().
|
inline |
Definition at line 540 of file Pointer.h.
References isField().
Referenced by computeOffsetForComparison(), clang::interp::computePointerOffset(), and toAPValue().
|
inline |
Checks if an object or a subfield is volatile.
Definition at line 566 of file Pointer.h.
References getDeclDesc(), isBlockPointer(), isRoot(), and clang::interp::Descriptor::IsVolatile.
Referenced by clang::interp::CheckVolatile().
|
inline |
Definition at line 523 of file Pointer.h.
References BS, Fn, isBlockPointer(), and isFunctionPointer().
|
inline |
Checks if the pointer is null.
Definition at line 254 of file Pointer.h.
References BS, Fn, Int, isBlockPointer(), isFunctionPointer(), isIntegralPointer(), and isTypeidPointer().
Referenced by clang::interp::ArrayDecay(), clang::interp::Call(), clang::interp::CallPtr(), clang::interp::CheckBCPResult(), clang::interp::CheckFinalLoad(), clang::interp::EvaluationResult::checkFullyInitialized(), clang::interp::CheckLive(), clang::interp::CheckLoad(), clang::interp::CheckNonNullArgs(), clang::interp::CheckNull(), clang::interp::CheckPointerToIntegralCast(), clang::interp::CheckStore(), clang::interp::CmpHelperEQ< Pointer >(), clang::interp::Free(), getIndex(), hasSameBase(), clang::interp::interp__builtin_atomic_lock_free(), clang::interp::interp__builtin_is_within_lifetime(), clang::interp::interp__builtin_memchr(), clang::interp::interp__builtin_memcpy(), clang::interp::interp__builtin_object_size(), clang::interp::interp__builtin_operator_delete(), isPastEnd(), isRoot(), narrow(), pointsToLiteral(), pointsToStringLiteral(), clang::interp::MemberPointer::takeInstance(), toAPValue(), toDiagnosticString(), and toRValue().
|
inline |
Checks if the pointer is pointing to a zero-size array.
Definition at line 651 of file Pointer.h.
References getFieldDesc(), and isFunctionPointer().
Referenced by clang::interp::ArrayDecay(), clang::interp::CheckRange(), clang::interp::CheckRange(), clang::interp::Free(), and toAPValue().
|
inlinenodiscard |
Restricts the scope of an array element pointer.
Definition at line 188 of file Pointer.h.
References BS, inPrimitiveArray(), isBlockPointer(), isOnePastEnd(), isUnknownSizeArray(), isZero(), and Pointer().
Referenced by clang::interp::CheckArrayInitialized(), clang::interp::collectBlocks(), clang::interp::copyComposite(), clang::interp::endLifetimeRecurse(), enumerateData(), clang::interp::finishGlobalRecurse(), clang::interp::interp__builtin_object_size(), clang::interp::NarrowPtr(), clang::interp::RunDestructors(), clang::interp::startLifetimeRecurse(), and clang::interp::zeroAll().
Definition at line 93 of file Pointer.cpp.
References clang::interp::BlockPointer::Base, Block, block(), BS, Fn, Int, isBlockPointer(), isFunctionPointer(), isIntegralPointer(), isTypeidPointer(), Pointer(), and Typeid.
Definition at line 130 of file Pointer.cpp.
References Block, BS, Fn, Int, isBlockPointer(), Pointer(), and Typeid.
Equality operators are just for tests.
Definition at line 120 of file Pointer.h.
References clang::interp::BlockPointer::Base, BS, clang::interp::IntPointer::Desc, Fn, clang::interp::FunctionPointer::getFunction(), Int, isBlockPointer(), isFunctionPointer(), isIntegralPointer(), clang::interp::BlockPointer::Pointee, Pointer(), and clang::interp::IntPointer::Value.
bool Pointer::pointsToLiteral | ( | ) | const |
Whether this points to a block that's been created for a "literal lvalue", i.e.
a non-MaterializeTemporaryExpr Expr.
Definition at line 647 of file Pointer.cpp.
References clang::interp::Descriptor::asExpr(), block(), clang::interp::Block::getDescriptor(), clang::isa(), isBlockPointer(), isDynamic(), and isZero().
bool Pointer::pointsToStringLiteral | ( | ) | const |
Definition at line 658 of file Pointer.cpp.
References clang::interp::Descriptor::asExpr(), block(), clang::interp::Block::getDescriptor(), isBlockPointer(), isDynamic(), and isZero().
Referenced by clang::interp::CmpHelperEQ< Pointer >().
Checks if both given pointers point to the same block.
Definition at line 636 of file Pointer.cpp.
References block(), isBlockPointer(), and Pointer().
Referenced by clang::interp::interp__builtin_memcpy(), and clang::interp::runRecordDestructor().
void Pointer::print | ( | llvm::raw_ostream & | OS | ) | const |
Prints the pointer.
Definition at line 322 of file Pointer.cpp.
References asFunctionPointer(), asTypeidPointer(), Block, clang::interp::Block, BS, clang::interp::Fn, clang::interp::FunctionPointer::getFunction(), clang::interp::Block::getSize(), Int, clang::interp::Int, isElementPastEnd(), isRoot(), clang::interp::Typeid, clang::interp::TypeidPointer::TypeInfoType, and clang::interp::TypeidPointer::TypePtr.
Referenced by clang::interp::operator<<().
|
inline |
Definition at line 735 of file Pointer.h.
References BS, isBlockPointer(), and clang::interp::Started.
Referenced by clang::interp::startLifetimeRecurse().
APValue Pointer::toAPValue | ( | const ASTContext & | ASTCtx | ) | const |
Converts the pointer to an APValue.
Definition at line 167 of file Pointer.cpp.
References clang::APValue, clang::APValue::LValuePathEntry::ArrayIndex(), clang::interp::Descriptor::asDecl(), clang::interp::Descriptor::asExpr(), asFunctionPointer(), asIntPointer(), clang::interp::Descriptor::asValueDecl(), block(), clang::cast(), expand(), clang::CharUnits::fromQuantity(), getArray(), clang::Type::getAsRecordDecl(), clang::ASTContext::getASTRecordLayout(), getBase(), clang::ASTRecordLayout::getBaseClassOffset(), clang::interp::Descriptor::getDataType(), clang::interp::Function::getDecl(), clang::interp::Record::getDecl(), getDeclDesc(), getDeclPtr(), clang::RecordDecl::getDefinition(), clang::APValue::LValueBase::getDynamicAlloc(), clang::interp::Descriptor::getElemQualType(), clang::interp::Function::getExpr(), getFieldDesc(), clang::ASTRecordLayout::getFieldOffset(), getFieldOffset(), clang::interp::FunctionPointer::getFunction(), getIndex(), getNumElems(), getRecord(), clang::interp::Descriptor::getType(), getType(), clang::APValue::LValueBase::getTypeInfo(), clang::ASTContext::getTypeSizeInChars(), clang::ASTRecordLayout::getVBaseClassOffset(), isArrayElement(), isArrayRoot(), clang::Type::isArrayType(), isDynamic(), isField(), isFunctionPointer(), isIntegralPointer(), isOnePastEnd(), isTypeidPointer(), isUnknownSizeArray(), isVirtualBaseClass(), isZero(), isZeroSizeArray(), Pointer(), clang::ASTContext::toCharUnitsFromBits(), Typeid, and clang::CharUnits::Zero().
Referenced by clang::interp::interp__builtin_assume_aligned(), toDiagnosticString(), and toRValue().
std::string Pointer::toDiagnosticString | ( | const ASTContext & | Ctx | ) | const |
Converts the pointer to a string usable in diagnostics.
Definition at line 419 of file Pointer.cpp.
References asFunctionPointer(), asIntPointer(), clang::APValue::getAsString(), getType(), isFunctionPointer(), isIntegralPointer(), isZero(), toAPValue(), and clang::interp::FunctionPointer::toDiagnosticString().
Referenced by clang::interp::CheckDeleteSource(), clang::interp::CmpHelper< Pointer >(), clang::interp::CmpHelperEQ< Pointer >(), clang::interp::Destroy(), clang::interp::Free(), clang::interp::getField(), clang::interp::interp__builtin_memcpy(), clang::interp::interp__builtin_operator_delete(), and clang::interp::SubPtr().
Converts the pointer to an APValue that is an rvalue.
Definition at line 711 of file Pointer.cpp.
References clang::APValue, clang::interp::Descriptor::asFieldDecl(), bool, clang::interp::Context::classify(), deref(), clang::interp::Record::fields(), std::function, clang::interp::Floating::getAPFloat(), clang::APValue::getArrayInitializedElt(), clang::interp::Context::getASTContext(), clang::interp::Record::getBase(), clang::ASTContext::getCanonicalTagType(), clang::interp::Record::getField(), getFieldDesc(), clang::interp::Record::getNumBases(), clang::interp::Record::getNumFields(), clang::interp::Record::getNumVirtualBases(), clang::interp::Record::getVirtualBase(), INT_TYPE_SWITCH, isActive(), isDummy(), clang::Type::isFloatingType(), clang::Type::isIntegerType(), isIntegralPointer(), isLive(), clang::QualType::isNull(), isPastEnd(), isZero(), Ok, Pointer(), clang::Result, clang::T, toAPValue(), and TYPE_SWITCH.
|
friend |
Definition at line 780 of file Pointer.h.
References Block.
Referenced by Block, block(), expand(), isDummy(), operator=(), operator=(), Pointer(), Pointer(), Pointer(), print(), and ~Pointer().
|
friend |
|
friend |
Definition at line 785 of file Pointer.h.
References DynamicAllocator.
Referenced by DynamicAllocator.
|
friend |
|
friend |
|
friend |
|
friend |
BlockPointer clang::interp::Pointer::BS |
Definition at line 820 of file Pointer.h.
Referenced by activate(), allElementsInitialized(), asBlockPointer(), atField(), atFieldSub(), atIndex(), block(), canBeInitialized(), clang::interp::DynamicAllocator::cleanup(), clang::interp::Program::createGlobal(), clang::interp::DeadBlock::DeadBlock(), deref(), elem(), elemSize(), endLifetime(), expand(), getArray(), getBase(), getDeclDesc(), getDeclID(), getDeclPtr(), getIndex(), getIntegerRepresentation(), getLifetime(), getOffset(), getRawAddress(), getType(), hasSameArray(), initialize(), inUnion(), isArrayElement(), isArrayRoot(), isDummy(), isDynamic(), isElementInitialized(), isExtern(), isInitialized(), isLive(), isOnePastEnd(), isPastEnd(), isRoot(), isStatic(), isTemporary(), isWeak(), isZero(), narrow(), operator=(), operator=(), operator==(), Pointer(), Pointer(), Pointer(), print(), Program, startLifetime(), and ~Pointer().
FunctionPointer clang::interp::Pointer::Fn |
Definition at line 821 of file Pointer.h.
Referenced by asFunctionPointer(), atIndex(), getIntegerRepresentation(), getSource(), getType(), isWeak(), isZero(), operator=(), operator=(), operator==(), Pointer(), Pointer(), and Pointer().
IntPointer clang::interp::Pointer::Int |
Definition at line 819 of file Pointer.h.
Referenced by asIntPointer(), atIndex(), elemSize(), getByteOffset(), getDeclDesc(), getFieldDesc(), getIntegerRepresentation(), getSource(), isZero(), operator=(), operator=(), operator==(), Pointer(), Pointer(), Pointer(), Pointer(), Pointer(), and print().
TypeidPointer clang::interp::Pointer::Typeid |
Definition at line 822 of file Pointer.h.
Referenced by asTypeidPointer(), getByteOffset(), getType(), operator=(), operator=(), Pointer(), Pointer(), Pointer(), and toAPValue().