|
clang 24.0.0git
|
A pointer to a memory block, live or dead. More...
#include "/work/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 Type *Ty, uint64_t Offset=0, std::optional< bool > IsNull=std::nullopt) | |
| Pointer (const Function *F, uint64_t Offset=0) | |
| Pointer (const Type *TypePtr, const Type *TypeInfoType, uint64_t Offset=0) | |
| Pointer (const Expr *Base, unsigned Id) | |
| Pointer (StringPointer Str, uint64_t Offset=0) | |
| Pointer (DeclOrExpr DOE, bool ConstexprUnknown=false) | |
| Pointer (OpaquePointer OP, uint64_t Offset=0) | |
| Pointer (Block *Pointee, unsigned Base, uint64_t Offset) | |
| Pointer (PtrView V) | |
| ~Pointer () | |
| Pointer & | operator= (const Pointer &P) |
| Pointer & | operator= (Pointer &&P) |
| bool | operator== (const Pointer &P) const |
| 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 |
| PtrView | view () 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 |
| DeclOrExpr | 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. | |
| const VarDecl * | getRootVarDecl () const |
| const ValueDecl * | getRootValueDecl () const |
| const Expr * | getRootExpr () const |
| 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. | |
| const BlockPointer & | asBlockPointer () const |
| const IntPointer & | asIntPointer () const |
| const FunctionPointer & | asFunctionPointer () const |
| const TypeidPointer & | asTypeidPointer () const |
| const StringPointer & | asStringPointer () const |
| const OpaquePointer & | asOpaquePointer () const |
| bool | isBlockPointer () const |
| bool | isIntegralPointer () const |
| bool | isFunctionPointer () const |
| bool | isTypeidPointer () const |
| bool | isStringPointer () const |
| bool | isOpaquePointer () 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 | 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. | |
| bool | canDeref (PrimType T) const |
| Checks whether the pointer can be dereferenced to the given PrimType. | |
| template<typename T> | |
| T & | deref () const |
| Dereferences the pointer, if it's live. | |
| template<typename T> | |
| T | load () const |
| template<typename T> | |
| T & | elem (unsigned I) const |
Dereferences the element at index I. | |
| template<typename T> | |
| T | loadElem (unsigned I) const |
| bool | isConstexprUnknown () const |
| bool | isDereferencable () const |
| Whether this block can be read from at all. | |
| bool | isReadablePointerType () const |
| void | initialize () const |
| Initializes a field. | |
| void | initializeElement (unsigned Index) const |
| Initialized the given element of a primitive array. | |
| 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 |
| bool | allElementsAlive () const |
| bool | isElementAlive (unsigned Index) const |
| void | activate () const |
| Activates a field. | |
| void | deactivate () const |
| Deactivates an entire strurcutre. | |
| Lifetime | getLifetime () const |
| void | startLifetime () const |
| Start the lifetime of this pointer. | |
| void | endLifetime () const |
| Ends the lifetime of the pointer. | |
| void | setLifeState (Lifetime L) const |
| Pointer | stripBaseCasts () const |
| Strip base casts from this Pointer. | |
| 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 | pointsToLabel () const |
| Whether this points to a block created for an AddrLabelExpr. | |
| const AddrLabelExpr * | getPointedToLabel () const |
| Returns the AddrLabelExpr the Pointer points to, if any. | |
| void | print (llvm::raw_ostream &OS) const |
| Prints the pointer. | |
| std::optional< size_t > | computeOffsetForComparison (const ASTContext &ASTCtx) const |
| Compute an integer that can be used to compare this pointer to another one. | |
| std::optional< size_t > | computeLayoutOffset (const ASTContext &ASTCtx) const |
| Compute the pointer offset as given by the ASTRecordLayout. | |
Static Public Member Functions | |
| static bool | hasSameBase (const Pointer &A, const Pointer &B) |
| Checks if two pointers are comparable. | |
| static bool | elemsOfSameArray (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< PtrView, PtrView > > | computeSplitPoint (const Pointer &A, const Pointer &B) |
Friends | |
| class | Block |
| class | DeadBlock |
| class | MemberPointer |
| class | InterpState |
| 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->data() + Pointer.Offset.
/// Pointee Offset /// │ │ /// │ │ /// ▼ ▼ /// ┌───────┬────────────┬─────────┬────────────────────────────┐ /// │ Block │ InlineDesc │ InitMap │ Actual Data │ /// └───────┴────────────┴─────────┴────────────────────────────┘ /// ▲ /// │ /// │ /// Base ///
|
inline |
Definition at line 550 of file Pointer.h.
References Int.
Referenced by atField(), atFieldSub(), atIndex(), compare(), computeSplitPoint(), elemsOfSameArray(), expand(), getArray(), getBase(), getDeclPtr(), hasSameBase(), narrow(), operator!=(), operator=(), operator=(), operator==(), Pointer(), Pointer(), Pointer(), Pointer(), Pointer(), pointToSameBlock(), and stripBaseCasts().
|
inline |
| Pointer::Pointer | ( | Block * | B | ) |
Definition at line 37 of file Pointer.cpp.
| Pointer::Pointer | ( | Block * | B, |
| uint64_t | BaseAndOffset ) |
Definition at line 39 of file Pointer.cpp.
| Pointer::Pointer | ( | const Pointer & | P | ) |
Definition at line 51 of file Pointer.cpp.
References clang::interp::Block, BS, Fn, clang::interp::Fn, Int, clang::interp::Int, Opaque, clang::interp::Opaque, Pointer(), Str, clang::interp::String, Typeid, and clang::interp::Typeid.
| Pointer::Pointer | ( | Pointer && | P | ) |
Definition at line 77 of file Pointer.cpp.
References clang::interp::Block, BS, Fn, clang::interp::Fn, Int, clang::interp::Int, Opaque, clang::interp::Opaque, Pointer(), Str, clang::interp::String, Typeid, and clang::interp::Typeid.
|
inline |
Definition at line 557 of file Pointer.h.
References clang::interp::Address, Int, and IsNull.
|
inline |
Definition at line 568 of file Pointer.h.
References Str, and clang::interp::String.
|
inline |
Definition at line 570 of file Pointer.h.
References Str, and clang::interp::String.
|
inline |
Definition at line 573 of file Pointer.h.
References clang::interp::DeclOrExpr::getType(), clang::QualType::getTypePtr(), and Opaque.
|
inline |
Definition at line 42 of file Pointer.cpp.
|
inlineexplicit |
| Pointer::~Pointer | ( | ) |
Definition at line 102 of file Pointer.cpp.
References Block, BS, and isBlockPointer().
|
inline |
Activates a field.
Definition at line 1251 of file Pointer.h.
References clang::isBlockPointer(), and view().
| bool Pointer::allElementsAlive | ( | ) | const |
Definition at line 879 of file Pointer.cpp.
References clang::interp::InitMap::allElementsAlive(), clang::interp::InitMapPtr::allInitialized(), block(), clang::interp::Block::getBlockDesc(), getFieldDesc(), clang::interp::InitMapPtr::hasInitMap(), clang::interp::Initialized, clang::interp::GlobalInlineDescriptor::InitState, and isArrayRoot().
|
inline |
Definition at line 1242 of file Pointer.h.
References getFieldDesc(), isArrayRoot(), and view().
|
inlinenodiscard |
Definition at line 849 of file Pointer.h.
References BS, and clang::isBlockPointer().
Referenced by computeSplitPoint(), and clang::interp::DeadBlock::DeadBlock().
|
inlinenodiscard |
Definition at line 857 of file Pointer.h.
References Fn, and isFunctionPointer().
Referenced by toAPValue().
|
inlinenodiscard |
Definition at line 853 of file Pointer.h.
References Int, and isIntegralPointer().
Referenced by toAPValue(), and toDiagnosticString().
|
inlinenodiscard |
Definition at line 869 of file Pointer.h.
References isOpaquePointer(), and Opaque.
Referenced by inArray(), isArrayRoot(), and clang::interp::PtrPtrCast().
|
inlinenodiscard |
Definition at line 865 of file Pointer.h.
References isStringPointer(), and Str.
Referenced by clang::interp::DoMemcpy(), enumeratePointerFields(), clang::interp::getElemType(), clang::interp::interp__builtin_nan(), and clang::interp::interp__builtin_strlen().
|
inlinenodiscard |
Definition at line 861 of file Pointer.h.
References isTypeidPointer(), and Typeid.
Referenced by computeLayoutOffset(), computeOffsetForComparison(), hasSameBase(), and print().
Creates a pointer to a field.
Definition at line 633 of file Pointer.h.
References atField(), clang::Off, Pointer(), Pointer, and view().
Referenced by atField(), clang::interp::MemberPointer::getBase(), and clang::interp::MemberPointer::toPointer().
Subtract the given offset from the current Base and Offset of the pointer.
Definition at line 639 of file Pointer.h.
References BS, clang::Off, Pointer(), and Pointer.
Referenced by clang::interp::MemberPointer::getBase().
|
inlinenodiscard |
Offsets a pointer inside an array.
Definition at line 617 of file Pointer.h.
References atIndex(), clang::interp::Block, Fn, clang::interp::Fn, Int, clang::interp::Int, Pointer(), Pointer, Str, clang::interp::String, and view().
Referenced by atIndex(), clang::interp::BitCast(), clang::interp::interp__builtin_elementwise_countzeroes(), clang::interp::interp__builtin_nan(), and clang::interp::RunDestructors().
|
inline |
Definition at line 1014 of file Pointer.h.
References Block, BS, and clang::isBlockPointer().
Referenced by allElementsAlive(), clang::interp::collectBlocks(), hasSameBase(), isConstexprUnknown(), clang::interp::lval(), clang::interp::lvalFields(), operator=(), pointToSameBlock(), toAPValue(), and clang::interp::MemberPointer::toPointer().
Checks whether the pointer can be dereferenced to the given PrimType.
Definition at line 1087 of file Pointer.h.
References getFieldDesc(), clang::isBlockPointer(), isStringPointer(), clang::interp::PT_Sint16, clang::interp::PT_Sint32, clang::interp::PT_Sint8, clang::interp::PT_Uint16, clang::interp::PT_Uint32, clang::interp::PT_Uint8, Str, and clang::T.
Referenced by toRValue().
|
inline |
Compare two pointers.
Definition at line 1291 of file Pointer.h.
References clang::Equal, clang::Greater, hasSameBase(), clang::Less, clang::Other, Pointer(), and clang::Unordered.
| std::optional< size_t > Pointer::computeLayoutOffset | ( | const ASTContext & | ASTCtx | ) | const |
Compute the pointer offset as given by the ASTRecordLayout.
Returns the result in bytes.
Definition at line 605 of file Pointer.cpp.
References asTypeidPointer(), clang::interp::Block, clang::cast(), clang::interp::PtrView::expand(), clang::interp::Fn, clang::interp::PtrView::getArray(), clang::ASTContext::getASTRecordLayout(), clang::interp::PtrView::getBase(), clang::ASTRecordLayout::getBaseClassOffset(), clang::ASTContext::getCanonicalTagType(), clang::interp::PtrView::getDeclDesc(), clang::interp::Descriptor::getElemQualType(), clang::interp::PtrView::getField(), clang::interp::PtrView::getFieldDesc(), clang::FieldDecl::getFieldIndex(), clang::ASTRecordLayout::getFieldOffset(), clang::interp::PtrView::getIndex(), getIntegerRepresentation(), clang::FieldDecl::getParent(), clang::CharUnits::getQuantity(), getRecordDecl(), clang::interp::Descriptor::getType(), clang::ValueDecl::getType(), clang::ASTContext::getTypeSizeInChars(), clang::ASTRecordLayout::getVBaseClassOffset(), clang::ASTContext::hasLayout(), Int, clang::interp::Int, clang::interp::Descriptor::isArray(), clang::interp::PtrView::isArrayElement(), clang::interp::PtrView::isBaseClass(), clang::interp::PtrView::isOnePastEnd(), clang::interp::PtrView::isPastEnd(), clang::interp::PtrView::isRoot(), clang::interp::PtrView::isVirtualBaseClass(), Opaque, clang::interp::Opaque, clang::Result, Str, clang::interp::String, clang::T, clang::ASTContext::toCharUnitsFromBits(), clang::interp::Typeid, clang::interp::TypeidPointer::TypePtr, validType(), and view().
Referenced by computeOffsetForComparison(), and clang::interp::SubPtr().
| std::optional< size_t > Pointer::computeOffsetForComparison | ( | const ASTContext & | ASTCtx | ) | const |
Compute an integer that can be used to compare this pointer to another one.
Compute an offset that can be used to compare the pointer to another one with the same base.
This is usually NOT the same as the pointer offset regarding the AST record layout.
To get accurate results, we basically have to compute the lvalue offset using the ASTRecordLayout.
This function will fail if we're trying to get the type size of a forward declaration.
Definition at line 524 of file Pointer.cpp.
References asTypeidPointer(), clang::interp::Block, computeLayoutOffset(), clang::interp::PtrView::elemSize(), clang::interp::PtrView::expand(), clang::interp::Fn, clang::interp::PtrView::getArray(), clang::ASTContext::getASTRecordLayout(), clang::interp::PtrView::getBase(), clang::interp::PtrView::getDeclDesc(), clang::interp::PtrView::getField(), clang::FieldDecl::getFieldIndex(), clang::ASTRecordLayout::getFieldOffset(), clang::interp::PtrView::getIndex(), clang::interp::PtrView::getInlineDesc(), getIntegerRepresentation(), clang::CharUnits::getQuantity(), clang::interp::PtrView::getRecord(), clang::interp::Descriptor::getType(), clang::ValueDecl::getType(), clang::ASTContext::getTypeSizeInChars(), clang::ASTContext::hasLayout(), Int, clang::interp::Int, clang::interp::PtrView::isArrayElement(), clang::interp::PtrView::isBaseClass(), clang::interp::PtrView::isOnePastEnd(), clang::interp::PtrView::isRoot(), clang::interp::PtrView::isVirtualBaseClass(), clang::interp::InlineDescriptor::Offset, clang::interp::Opaque, clang::Result, Str, clang::interp::String, clang::T, clang::ASTContext::toCharUnitsFromBits(), clang::interp::Typeid, clang::interp::TypeidPointer::TypePtr, validType(), and view().
Referenced by clang::interp::CmpHelper< Pointer >(), and clang::interp::CmpHelperEQ< Pointer >().
|
static |
Definition at line 1065 of file Pointer.cpp.
References asBlockPointer(), clang::interp::PtrView::Base, getBase(), clang::interp::PtrView::getFieldDesc(), clang::interp::Descriptor::isArray(), isBlockPointer(), isRoot(), clang::interp::PtrView::isRoot(), clang::interp::BlockPointer::Pointee, Pointer(), and view().
Referenced by clang::interp::CmpHelper< Pointer >().
|
inline |
Dereferences the pointer, if it's live.
Definition at line 1110 of file Pointer.h.
References BS, clang::isBlockPointer(), isDereferencable(), isLive(), clang::T, and view().
Referenced by clang::interp::assignIntegral(), clang::interp::InitGlobal(), clang::interp::interp__builtin_elementwise_countzeroes(), and clang::interp::interp__builtin_stdc_memreverse8().
Dereferences the element at index I.
This is equivalent to atIndex(I).deref<T>().
Definition at line 1148 of file Pointer.h.
References BS, getFieldDesc(), getNumElems(), clang::isBlockPointer(), isDereferencable(), isLive(), clang::T, and view().
Referenced by clang::interp::convertBoolVectorToInt(), clang::interp::CopyArray(), clang::interp::Divc(), clang::interp::interp__builtin_elementwise_abs(), clang::interp::interp__builtin_elementwise_fp_binop(), clang::interp::interp__builtin_elementwise_int_binop(), clang::interp::interp__builtin_elementwise_int_unaryop(), clang::interp::interp__builtin_elementwise_maxmin(), clang::interp::interp__builtin_elementwise_triop(), clang::interp::interp__builtin_elementwise_triop_fp(), clang::interp::interp__builtin_ia32_addsub(), clang::interp::interp__builtin_ia32_cmp_mask(), clang::interp::interp__builtin_ia32_cvt_mask2vec(), clang::interp::interp__builtin_ia32_cvt_vec2mask(), clang::interp::interp__builtin_ia32_cvtpd2ps(), clang::interp::interp__builtin_ia32_cvtsd2ss(), clang::interp::interp__builtin_ia32_dbpsadbw(), clang::interp::interp__builtin_ia32_extract_vector(), clang::interp::interp__builtin_ia32_extract_vector_masked(), clang::interp::interp__builtin_ia32_gfni_affine(), clang::interp::interp__builtin_ia32_gfni_mul(), clang::interp::interp__builtin_ia32_insert_subvector(), clang::interp::interp__builtin_ia32_mpsadbw(), clang::interp::interp__builtin_ia32_multishiftqb(), clang::interp::interp__builtin_ia32_pack(), clang::interp::interp__builtin_ia32_pclmulqdq(), clang::interp::interp__builtin_ia32_pmul(), clang::interp::interp__builtin_ia32_psadbw(), clang::interp::interp__builtin_ia32_select(), clang::interp::interp__builtin_ia32_select_scalar(), clang::interp::interp__builtin_ia32_shift_with_count(), clang::interp::interp__builtin_ia32_shufbitqmb_mask(), clang::interp::interp__builtin_ia32_shuffle_generic(), clang::interp::interp__builtin_ia32_test_op(), clang::interp::interp__builtin_ia32_vcvtps2ph(), clang::interp::interp__builtin_ia32_vec_ext(), clang::interp::interp__builtin_ia32_vec_set(), clang::interp::interp__builtin_ia32_vpconflict(), clang::interp::interp__builtin_ia32_vpdp(), clang::interp::interp__builtin_nan(), clang::interp::interp__builtin_scalar_fp_round_mask_binop(), clang::interp::interp__builtin_vector_reduce(), clang::interp::interp_builtin_horizontal_fp_binop(), clang::interp::interp_builtin_horizontal_int_binop(), clang::interp::interp_builtin_ia32_cvt_scalar_to_int(), clang::interp::interp_builtin_ia32_cvt_vector_to_int(), and clang::interp::Mulc().
|
inline |
Returns the element size of the innermost field.
Definition at line 758 of file Pointer.h.
References isIntegralPointer(), isStringPointer(), Str, and view().
Referenced by getIntegerRepresentation(), and toAPValue().
Checks if two pointers can be subtracted.
Definition at line 1002 of file Pointer.cpp.
References clang::interp::BlockPointer::Base, BS, getField(), hasSameBase(), isBaseClass(), isBlockPointer(), Pointer(), and V.
Referenced by clang::interp::SubPtr().
|
inline |
Ends the lifetime of the pointer.
This works for pointer with an InlineDescriptor as well as primitive array elements. This function is used by std::destroy_at.
Definition at line 1275 of file Pointer.h.
References clang::interp::Ended, and setLifeState().
|
inlinenodiscard |
Expands a pointer to the containing array, undoing narrowing.
Definition at line 653 of file Pointer.h.
References expand(), clang::isBlockPointer(), Pointer(), Pointer, and view().
Referenced by clang::interp::CheckNewTypeMismatch(), expand(), clang::interp::interp__builtin_memcpy(), clang::interp::operator<<(), and pointsToLastObject().
|
inlinenodiscard |
Returns the parent array.
Definition at line 715 of file Pointer.h.
References getArray(), Pointer(), Pointer, and view().
Referenced by getArray(), clang::interp::operator<<(), and pointsToLastObject().
|
inlinenodiscard |
Returns a pointer to the object of which this pointer is a field.
Definition at line 713 of file Pointer.h.
References getBase(), Pointer(), Pointer, and view().
Referenced by computeSplitPoint(), getBase(), and pointsToLastObject().
|
inline |
Returns the byte offset from the start.
Definition at line 993 of file Pointer.h.
References clang::isBlockPointer(), isOnePastEnd(), and clang::interp::PtrView::PastEndMark.
Referenced by clang::interp::interp__builtin_strlen(), and clang::interp::PtrPtrCast().
|
inline |
Accessor for information about the declaration site.
Definition at line 690 of file Pointer.h.
References BS, and clang::isBlockPointer().
Referenced by clang::interp::CheckLiteralType(), getDeclLoc(), getFieldDesc(), getRootExpr(), getRootValueDecl(), getSource(), and toAPValue().
|
inline |
Returns the declaration ID.
Definition at line 984 of file Pointer.h.
References BS, and clang::isBlockPointer().
|
inline |
Definition at line 698 of file Pointer.h.
References getDeclDesc().
|
inlinenodiscard |
|
inline |
|
inline |
Returns the field information.
Definition at line 890 of file Pointer.h.
References getFieldDesc().
Referenced by elemsOfSameArray(), and pointsToLastObject().
|
inline |
Accessors for information about the innermost field.
Definition at line 718 of file Pointer.h.
References getDeclDesc(), clang::isBlockPointer(), and isRoot().
Referenced by allElementsAlive(), allElementsInitialized(), clang::interp::BitCast(), clang::interp::CallVirt(), canDeref(), clang::interp::checkConstructor(), clang::interp::convertBoolVectorToInt(), clang::interp::CopyArray(), clang::interp::DoBitCastPtr(), clang::interp::DoMemcpy(), elem(), clang::interp::getElemType(), clang::interp::GetField(), getField(), clang::interp::GetFieldPop(), getSize(), initializeAllElements(), clang::interp::interp__builtin_elementwise_abs(), clang::interp::interp__builtin_elementwise_countzeroes(), clang::interp::interp__builtin_elementwise_int_unaryop(), clang::interp::interp__builtin_ia32_cvt_mask2vec(), clang::interp::interp__builtin_ia32_cvt_vec2mask(), clang::interp::interp__builtin_ia32_extract_vector(), clang::interp::interp__builtin_ia32_extract_vector_masked(), clang::interp::interp__builtin_ia32_insert_subvector(), clang::interp::interp__builtin_ia32_select(), clang::interp::interp__builtin_ia32_vcvtps2ph(), clang::interp::interp__builtin_ia32_vec_ext(), clang::interp::interp__builtin_nan(), clang::interp::interp__builtin_strlen(), clang::interp::interp__builtin_vector_reduce(), isElementAlive(), isUnknownSizeArray(), isZeroSizeArray(), loadElem(), and clang::interp::operator<<().
|
inline |
Returns the index into an array.
Definition at line 1032 of file Pointer.h.
References getIntegerRepresentation(), clang::isBlockPointer(), isOpaquePointer(), isStringPointer(), Opaque, and view().
Referenced by clang::interp::arePotentiallyOverlappingStringLiterals(), clang::interp::DoMemcpy(), enumeratePointerFields(), clang::interp::interp__builtin_memcpy(), clang::interp::interp__builtin_strcmp(), clang::interp::interp__builtin_strlen(), and clang::interp::operator<<().
|
inline |
Definition at line 599 of file Pointer.h.
References BS, elemSize(), Fn, Int, isFunctionPointer(), and isIntegralPointer().
Referenced by clang::interp::CmpHelperEQ< Pointer >(), computeLayoutOffset(), computeOffsetForComparison(), getIndex(), and clang::interp::interp__builtin_memcpy().
|
inline |
Definition at line 1261 of file Pointer.h.
References clang::isBlockPointer(), clang::interp::Started, and view().
|
inline |
Returns the number of elements.
Definition at line 1000 of file Pointer.h.
References clang::isBlockPointer(), isOpaquePointer(), isStringPointer(), Opaque, Str, and view().
Referenced by clang::interp::arePotentiallyOverlappingStringLiterals(), clang::interp::convertBoolVectorToInt(), elem(), clang::interp::interp__builtin_elementwise_abs(), clang::interp::interp__builtin_elementwise_countzeroes(), clang::interp::interp__builtin_elementwise_int_unaryop(), clang::interp::interp__builtin_ia32_cmp_mask(), clang::interp::interp__builtin_ia32_cvt_mask2vec(), clang::interp::interp__builtin_ia32_cvt_vec2mask(), clang::interp::interp__builtin_ia32_cvtpd2ps(), clang::interp::interp__builtin_ia32_extract_vector(), clang::interp::interp__builtin_ia32_extract_vector_masked(), clang::interp::interp__builtin_ia32_gfni_mul(), clang::interp::interp__builtin_ia32_insert_subvector(), clang::interp::interp__builtin_ia32_movmsk_op(), clang::interp::interp__builtin_ia32_phminposuw(), clang::interp::interp__builtin_ia32_pternlog(), clang::interp::interp__builtin_ia32_select(), clang::interp::interp__builtin_ia32_test_op(), clang::interp::interp__builtin_ia32_vec_ext(), clang::interp::interp__builtin_memcmp(), clang::interp::interp__builtin_memcpy(), clang::interp::interp__builtin_nan(), clang::interp::interp__builtin_strcmp(), clang::interp::interp__builtin_vector_reduce(), clang::interp::interp_builtin_ia32_cvt_vector_to_int(), and loadElem().
|
inline |
Returns the offset into an array.
Definition at line 775 of file Pointer.h.
References clang::interp::PtrView::PastEndMark, and view().
|
inline |
Returns the AddrLabelExpr the Pointer points to, if any.
Definition at line 1319 of file Pointer.h.
References getRootExpr().
Referenced by clang::interp::SubPtr().
|
inline |
If backed by actual data (i.e.
a block or string pointer), return an address to that data.
Definition at line 1021 of file Pointer.h.
References BS, clang::StringLiteral::getBytes(), clang::StringLiteral::getCharByteWidth(), clang::isBlockPointer(), isStringPointer(), and Str.
|
inline |
Returns the record descriptor of a class.
Definition at line 882 of file Pointer.h.
References clang::isBlockPointer(), and view().
Referenced by pointsToLastObject(), and clang::interp::MemberPointer::toPointer().
| const Expr * Pointer::getRootExpr | ( | ) | const |
Definition at line 1324 of file Pointer.cpp.
References clang::interp::Descriptor::asExpr(), getDeclDesc(), isBlockPointer(), isOpaquePointer(), isStringPointer(), Opaque, and Str.
Referenced by clang::interp::arePotentiallyOverlappingStringLiterals(), getPointedToLabel(), and pointsToLiteral().
| const ValueDecl * Pointer::getRootValueDecl | ( | ) | const |
Definition at line 1316 of file Pointer.cpp.
References clang::interp::Descriptor::asValueDecl(), getDeclDesc(), isBlockPointer(), isOpaquePointer(), and Opaque.
Referenced by getRootVarDecl().
| const VarDecl * Pointer::getRootVarDecl | ( | ) | const |
Definition at line 1312 of file Pointer.cpp.
References getRootValueDecl().
|
inline |
Returns the total size of the innermost field.
Definition at line 769 of file Pointer.h.
References getFieldDesc(), and clang::isBlockPointer().
|
inline |
Returns the expression or declaration the pointer has been created for.
Definition at line 701 of file Pointer.h.
References Fn, clang::interp::Function::getDecl(), getDeclDesc(), clang::isBlockPointer(), and isFunctionPointer().
|
inline |
Returns the type of the innermost field.
Definition at line 728 of file Pointer.h.
References clang::interp::Block, Fn, clang::interp::Fn, Int, clang::interp::Int, Opaque, clang::interp::Opaque, Str, clang::interp::String, Typeid, clang::interp::Typeid, and view().
Referenced by clang::interp::DoBitCastPtr(), clang::interp::getElemType(), clang::interp::interp__builtin_memcmp(), clang::interp::interp__builtin_memcpy(), clang::interp::lval(), clang::interp::SubPtr(), and toDiagnosticString().
Checks if two pointers are comparable.
Definition at line 950 of file Pointer.cpp.
References asTypeidPointer(), clang::interp::DeclOrExpr::asVarDecl(), clang::interp::Descriptor::asVarDecl(), clang::interp::OpaquePointer::Base, clang::interp::Block, block(), BS, clang::interp::Fn, clang::interp::Block::getDescriptor(), clang::interp::StringPointer::getLiteral(), clang::VarDecl::getMostRecentDecl(), clang::interp::StringPointer::ID, clang::interp::Int, isBlockPointer(), clang::interp::DeclOrExpr::isExpr(), isOpaquePointer(), clang::interp::DeclOrExpr::isVarDecl(), isZero(), Opaque, clang::interp::Opaque, clang::interp::BlockPointer::Pointee, Pointer(), Str, clang::interp::String, clang::interp::Typeid, and clang::interp::TypeidPointer::TypePtr.
Referenced by clang::interp::CMP3(), clang::interp::CmpHelper< Pointer >(), clang::interp::CmpHelperEQ< Pointer >(), compare(), elemsOfSameArray(), and clang::interp::SubPtr().
|
inline |
Checks if the innermost field is an array.
Definition at line 797 of file Pointer.h.
References asOpaquePointer(), clang::interp::Block, clang::interp::Opaque, clang::interp::String, and view().
Referenced by clang::interp::interp__builtin_memcpy().
|
inline |
Initializes a field.
Definition at line 1214 of file Pointer.h.
References clang::isBlockPointer(), and view().
Referenced by clang::interp::InitGlobal(), clang::interp::interp__builtin_carryop(), clang::interp::interp__builtin_elementwise_countzeroes(), clang::interp::interp__builtin_overflowop(), and clang::interp::interp__builtin_stdc_memreverse8().
| 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 861 of file Pointer.cpp.
References getFieldDesc(), and isArrayRoot().
Referenced by clang::interp::interp__builtin_elementwise_abs(), clang::interp::interp__builtin_elementwise_fp_binop(), clang::interp::interp__builtin_elementwise_int_binop(), clang::interp::interp__builtin_elementwise_int_unaryop(), clang::interp::interp__builtin_elementwise_triop(), clang::interp::interp__builtin_elementwise_triop_fp(), clang::interp::interp__builtin_ia32_cvt_mask2vec(), clang::interp::interp__builtin_ia32_cvtpd2ps(), clang::interp::interp__builtin_ia32_cvtsd2ss(), clang::interp::interp__builtin_ia32_extract_vector(), clang::interp::interp__builtin_ia32_extract_vector_masked(), clang::interp::interp__builtin_ia32_insert_subvector(), clang::interp::interp__builtin_ia32_multishiftqb(), clang::interp::interp__builtin_ia32_select(), clang::interp::interp__builtin_ia32_select_scalar(), clang::interp::interp__builtin_ia32_shift_with_count(), clang::interp::interp__builtin_ia32_shuffle_generic(), clang::interp::interp__builtin_ia32_vec_set(), clang::interp::interp__builtin_ia32_vpconflict(), and clang::interp::interp__builtin_ia32_vpdp().
|
inline |
Initialized the given element of a primitive array.
Definition at line 1220 of file Pointer.h.
References view().
Referenced by clang::interp::CopyArray().
|
inline |
Checks if the structure is a primitive array.
Definition at line 818 of file Pointer.h.
References clang::isBlockPointer(), and view().
|
inline |
Definition at line 811 of file Pointer.h.
References BS, clang::isBlockPointer(), and view().
|
inline |
Checks if the object is active.
Definition at line 953 of file Pointer.h.
References clang::isBlockPointer(), and view().
|
inline |
Checks if the pointer points to an array.
Definition at line 832 of file Pointer.h.
References clang::isBlockPointer(), and view().
Referenced by clang::interp::operator<<(), and pointsToLastObject().
|
inline |
Whether this array refers to an array, but not to the first element.
Definition at line 782 of file Pointer.h.
References asOpaquePointer(), clang::interp::Block, clang::interp::Opaque, clang::interp::String, and view().
Referenced by allElementsAlive(), allElementsInitialized(), clang::interp::BitCast(), initializeAllElements(), and clang::interp::operator<<().
|
inline |
Checks if a structure is a base class.
Definition at line 959 of file Pointer.h.
References view().
Referenced by elemsOfSameArray(), clang::interp::IsBaseClass(), clang::interp::operator<<(), and pointsToLastObject().
|
inline |
Definition at line 874 of file Pointer.h.
References clang::interp::Block.
Referenced by clang::interp::BitCast(), clang::interp::CallVirt(), computeSplitPoint(), clang::interp::CopyArray(), clang::interp::DoBitCastPtr(), clang::interp::DoMemcpy(), clang::interp::DoMemcpy(), elemsOfSameArray(), clang::interp::GetField(), clang::interp::GetFieldPop(), getRootExpr(), getRootValueDecl(), hasSameBase(), clang::interp::interp__builtin_memcpy(), clang::interp::interp__builtin_nan(), clang::interp::interp__builtin_overflowop(), clang::interp::interp__builtin_strlen(), clang::interp::lval(), clang::interp::lvalFields(), clang::interp::Memcpy(), clang::interp::operator<<(), operator=(), operator=(), pointToSameBlock(), clang::interp::SubPtr(), toAPValue(), toRValue(), clang::interp::TrivialCopy(), and ~Pointer().
|
inline |
Checks if an object or a subfield is mutable.
Definition at line 966 of file Pointer.h.
References clang::isBlockPointer(), isIntegralPointer(), isStringPointer(), and view().
|
inline |
Definition at line 1186 of file Pointer.h.
References block(), clang::isBlockPointer(), isOpaquePointer(), and Opaque.
Referenced by clang::interp::CmpHelperEQ< Pointer >(), clang::interp::interp__builtin_strlen(), isDereferencable(), toAPValue(), and clang::interp::TrivialCopy().
|
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 1196 of file Pointer.h.
References clang::isBlockPointer(), isConstexprUnknown(), isDummy(), and isPastEnd().
Referenced by deref(), elem(), load(), and loadElem().
|
inline |
Checks if the pointer points to a dummy value.
Definition at line 963 of file Pointer.h.
References isOpaquePointer().
Referenced by clang::interp::Call(), clang::interp::CopyArray(), clang::interp::interp__builtin_overflowop(), clang::interp::interp__builtin_strcmp(), isDereferencable(), clang::interp::isReadable(), clang::interp::Memcpy(), clang::interp::operator<<(), toRValue(), and clang::interp::TrivialCopy().
|
inline |
Checks if the storage has been dynamically allocated.
Definition at line 918 of file Pointer.h.
References BS, and clang::isBlockPointer().
Referenced by pointsToLiteral(), and toAPValue().
Definition at line 750 of file Pointer.cpp.
References clang::interp::InitMapPtr::allInitialized(), getFieldDesc(), clang::interp::InitMapPtr::hasInitMap(), and clang::interp::InitMap::isElementAlive().
Like isInitialized(), but for primitive arrays.
Definition at line 1236 of file Pointer.h.
References clang::isBlockPointer(), and view().
Referenced by clang::interp::interp__builtin_nan().
|
inline |
Checks if the pointer is an out-of-bounds element pointer.
Definition at line 1073 of file Pointer.h.
References clang::interp::PtrView::PastEndMark.
Referenced by print().
|
inline |
Checks if the storage is extern.
Definition at line 897 of file Pointer.h.
References clang::isBlockPointer(), and view().
|
inline |
Checks if the item is a field in an object.
Definition at line 682 of file Pointer.h.
References clang::isBlockPointer(), and view().
|
inline |
Definition at line 876 of file Pointer.h.
References clang::interp::Fn.
Referenced by asFunctionPointer(), clang::interp::CmpHelper< Pointer >(), clang::interp::CmpHelperEQ< Pointer >(), getIntegerRepresentation(), getSource(), clang::interp::interp__builtin_memcmp(), and isZeroSizeArray().
|
inline |
Checks if an object was initialized.
Definition at line 1228 of file Pointer.h.
References clang::isBlockPointer(), and view().
Referenced by clang::interp::Program::dump(), clang::interp::Program::isGlobalInitialized(), and clang::interp::operator<<().
|
inline |
Definition at line 875 of file Pointer.h.
References clang::interp::Int.
Referenced by asIntPointer(), elemSize(), clang::interp::getElemType(), getIntegerRepresentation(), clang::interp::interp__builtin_memcpy(), isConst(), isPastEnd(), toDiagnosticString(), and toRValue().
|
inline |
Checks if the pointer is live.
Definition at line 676 of file Pointer.h.
References clang::isBlockPointer(), and view().
Referenced by deref(), clang::interp::DoBitCastPtr(), elem(), clang::interp::isReadable(), load(), loadElem(), clang::interp::operator<<(), and toRValue().
|
inline |
Checks if the field is mutable.
Definition at line 929 of file Pointer.h.
References clang::isBlockPointer(), and view().
|
inline |
Checks if the index is one past end.
Definition at line 1047 of file Pointer.h.
References BS, clang::isBlockPointer(), isOpaquePointer(), isStringPointer(), Opaque, Str, and view().
Referenced by clang::interp::arePotentiallyOverlappingStringLiterals(), clang::interp::CmpHelperEQ< Pointer >(), getByteOffset(), clang::interp::interp__builtin_strlen(), clang::interp::isReadable(), clang::interp::operator<<(), toAPValue(), and toRValue().
|
inline |
Definition at line 879 of file Pointer.h.
References clang::interp::Opaque.
Referenced by asOpaquePointer(), clang::interp::CallVirt(), clang::interp::getElemType(), getIndex(), getNumElems(), getRootExpr(), getRootValueDecl(), hasSameBase(), clang::interp::IncDecPtrHelper(), isConstexprUnknown(), isDummy(), isOnePastEnd(), isRoot(), isUnknownSizeArray(), isZeroSizeArray(), and pointsToLabel().
|
inline |
Checks if the pointer points past the end of the object.
Definition at line 1063 of file Pointer.h.
References BS, isIntegralPointer(), isStringPointer(), isZero(), and Str.
Referenced by isDereferencable(), and toRValue().
|
inline |
Definition at line 1209 of file Pointer.h.
References clang::interp::Block, and clang::interp::String.
Referenced by clang::interp::DoMemcpy(), clang::interp::interp__builtin_memcmp(), clang::interp::interp__builtin_strcmp(), and clang::interp::isReadable().
|
inline |
Pointer points directly to a block.
Definition at line 839 of file Pointer.h.
References clang::isBlockPointer(), isOpaquePointer(), isZero(), Opaque, and view().
Referenced by computeSplitPoint(), getFieldDesc(), pointsToLastObject(), and print().
|
inline |
Checks if the storage is static.
Definition at line 903 of file Pointer.h.
References BS, and clang::isBlockPointer().
Referenced by isStaticTemporary().
|
inline |
Checks if the storage is a static temporary.
Definition at line 926 of file Pointer.h.
References isStatic(), and isTemporary().
|
inline |
Definition at line 878 of file Pointer.h.
References clang::interp::String.
Referenced by clang::interp::arePotentiallyOverlappingStringLiterals(), asStringPointer(), canDeref(), clang::interp::CmpHelperEQ< Pointer >(), clang::interp::DoMemcpy(), elemSize(), enumeratePointerFields(), clang::interp::getElemType(), getIndex(), getNumElems(), getRawAddress(), getRootExpr(), clang::interp::interp__builtin_nan(), clang::interp::interp__builtin_strlen(), isConst(), isOnePastEnd(), isPastEnd(), load(), and loadElem().
|
inline |
Checks if the storage is temporary.
Definition at line 910 of file Pointer.h.
References BS, and clang::isBlockPointer().
Referenced by isStaticTemporary().
|
inline |
Definition at line 877 of file Pointer.h.
References clang::interp::Typeid.
Referenced by asTypeidPointer(), and clang::interp::CmpHelper< Pointer >().
|
inline |
Checks if the structure is an array of unknown size.
Definition at line 824 of file Pointer.h.
References getFieldDesc(), clang::isBlockPointer(), isOpaquePointer(), and Opaque.
Referenced by clang::interp::CmpHelperEQ< Pointer >(), clang::interp::GetField(), clang::interp::GetFieldPop(), clang::interp::interp__builtin_memcpy(), and clang::interp::interp__builtin_strcmp().
|
inline |
|
inline |
Checks if an object or a subfield is volatile.
Definition at line 977 of file Pointer.h.
References clang::isBlockPointer(), and view().
|
inline |
Definition at line 935 of file Pointer.h.
References clang::interp::Block, BS, Fn, clang::interp::Fn, Opaque, and clang::interp::Opaque.
|
inline |
Checks if the pointer is null.
Definition at line 660 of file Pointer.h.
References clang::interp::Block, BS, Fn, clang::interp::Fn, Int, clang::interp::Int, clang::interp::Opaque, clang::interp::String, and clang::interp::Typeid.
Referenced by clang::interp::Call(), clang::interp::CheckNonNullArgs(), clang::interp::CmpHelperEQ< Pointer >(), hasSameBase(), clang::interp::interp__builtin_memcpy(), isPastEnd(), isRoot(), clang::interp::operator<<(), pointsToLabel(), pointsToLiteral(), clang::interp::MemberPointer::takeInstance(), toAPValue(), toDiagnosticString(), and toRValue().
|
inline |
Checks if the pointer is pointing to a zero-size array.
Definition at line 1076 of file Pointer.h.
References getFieldDesc(), isFunctionPointer(), and isOpaquePointer().
Referenced by toAPValue(), and toRValue().
Definition at line 1119 of file Pointer.h.
References BS, clang::StringLiteral::getCodeUnit(), clang::StringLiteral::getLength(), clang::isBlockPointer(), isDereferencable(), clang::interp::isFixedSizeIntegralType(), isLive(), isStringPointer(), Str, clang::T, and view().
Referenced by clang::interp::interp__builtin_load8(), clang::interp::interp__builtin_memchr(), and toRValue().
Definition at line 1159 of file Pointer.h.
References BS, clang::StringLiteral::getCodeUnit(), getFieldDesc(), clang::StringLiteral::getLength(), getNumElems(), clang::isBlockPointer(), isDereferencable(), clang::interp::isFixedSizeIntegralType(), isLive(), isStringPointer(), Str, clang::T, and view().
Referenced by clang::interp::interp__builtin_nan(), and clang::interp::interp__builtin_strcmp().
|
inlinenodiscard |
Restricts the scope of an array element pointer.
Definition at line 646 of file Pointer.h.
References clang::isBlockPointer(), narrow(), Pointer(), Pointer, and view().
Referenced by narrow(), and clang::interp::RunDestructors().
Definition at line 113 of file Pointer.cpp.
References clang::interp::BlockPointer::Base, Block, clang::interp::Block, block(), BS, Fn, clang::interp::Fn, Int, clang::interp::Int, isBlockPointer(), Opaque, clang::interp::Opaque, Pointer(), Str, clang::interp::String, Typeid, and clang::interp::Typeid.
Definition at line 159 of file Pointer.cpp.
References Block, clang::interp::Block, BS, Fn, clang::interp::Fn, Int, clang::interp::Int, isBlockPointer(), Opaque, clang::interp::Opaque, Pointer(), Str, clang::interp::String, Typeid, and clang::interp::Typeid.
Definition at line 205 of file Pointer.cpp.
References clang::interp::PointerPathEntry::Array, clang::interp::OpaquePointer::Base, clang::interp::PointerPathEntry::Base, clang::interp::StringPointer::Base, clang::interp::Block, clang::interp::PointerPathEntry::FD, clang::interp::PointerPathEntry::Field, Fn, clang::interp::Fn, clang::interp::FunctionPointer::Func, clang::interp::IntPointer::getType(), clang::interp::PointerPathEntry::Index, Int, clang::interp::Int, clang::interp::PointerPathEntry::Kind, clang::interp::PointerPathEntry::NegativeArray, Opaque, clang::interp::Opaque, clang::interp::OpaquePointer::Path, clang::interp::OpaquePointer::PathLength, Pointer(), clang::interp::PointerPathEntry::RD, Str, clang::interp::String, clang::interp::Typeid, clang::interp::IntPointer::Value, and view().
| bool Pointer::pointsToLabel | ( | ) | const |
Whether this points to a block created for an AddrLabelExpr.
Definition at line 1055 of file Pointer.cpp.
References isOpaquePointer(), isZero(), and Opaque.
Referenced by clang::interp::SubPtr().
| 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 1044 of file Pointer.cpp.
References getRootExpr(), clang::isa(), isDynamic(), and isZero().
Checks if both given pointers point to the same block.
Definition at line 996 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 466 of file Pointer.cpp.
References asTypeidPointer(), Block, clang::interp::Block, BS, Fn, clang::interp::Fn, clang::interp::Block::getSize(), Int, clang::interp::Int, isElementPastEnd(), isRoot(), Opaque, clang::interp::Opaque, Str, clang::interp::String, clang::interp::Typeid, clang::interp::TypeidPointer::TypeInfoType, and clang::interp::TypeidPointer::TypePtr.
Referenced by clang::interp::operator<<().
|
inline |
Definition at line 1277 of file Pointer.h.
References clang::isBlockPointer(), and view().
Referenced by endLifetime(), and startLifetime().
|
inline |
Start the lifetime of this pointer.
This works for pointer with an InlineDescriptor as well as primitive array elements. Pointers are usually alive by default, unless the underlying object has been allocated with std::allocator. This function is used by std::construct_at.
Definition at line 1271 of file Pointer.h.
References setLifeState(), and clang::interp::Started.
|
inlinenodiscard |
Strip base casts from this Pointer.
The result is either a root pointer or something that isn't a base class anymore.
Definition at line 1286 of file Pointer.h.
References Pointer(), Pointer, stripBaseCasts(), and view().
Referenced by clang::interp::CallVirt(), clang::interp::interp__builtin_memcpy(), and stripBaseCasts().
| APValue Pointer::toAPValue | ( | const ASTContext & | ASTCtx | ) | const |
Converts the pointer to an APValue.
Definition at line 249 of file Pointer.cpp.
References clang::APValue, clang::interp::PointerPathEntry::Array, clang::APValue::LValuePathEntry::ArrayIndex(), clang::interp::Descriptor::asDecl(), clang::interp::Descriptor::asExpr(), asFunctionPointer(), asIntPointer(), clang::interp::Descriptor::asValueDecl(), clang::interp::PointerPathEntry::Base, clang::interp::Block, block(), clang::cast(), elemSize(), clang::interp::PointerPathEntry::Field, clang::interp::Fn, clang::CharUnits::fromQuantity(), clang::interp::FunctionPointer::Func, clang::Type::getAsRecordDecl(), clang::ASTContext::getASTRecordLayout(), clang::ASTRecordLayout::getBaseClassOffset(), clang::interp::Descriptor::getDataType(), clang::interp::Function::getDecl(), clang::interp::Record::getDecl(), getDeclDesc(), clang::RecordDecl::getDefinition(), clang::interp::Descriptor::getDynAllocKind(), clang::APValue::LValueBase::getDynamicAlloc(), clang::interp::Descriptor::getElemQualType(), clang::interp::Function::getExpr(), clang::ASTRecordLayout::getFieldOffset(), getFieldOffset(), clang::CharUnits::getQuantity(), clang::APValue::LValueBase::getTypeInfo(), clang::ASTContext::getTypeSizeInChars(), clang::ASTRecordLayout::getVBaseClassOffset(), clang::ASTContext::hasLayout(), clang::interp::Int, isBlockPointer(), isConstexprUnknown(), isDynamic(), isOnePastEnd(), isZero(), isZeroSizeArray(), clang::interp::PointerPathEntry::NegativeArray, Opaque, clang::interp::Opaque, clang::Result, Str, clang::interp::String, clang::ASTContext::toCharUnitsFromBits(), Typeid, clang::interp::Typeid, validType(), view(), and clang::CharUnits::Zero().
Referenced by toDiagnosticString(), and toRValue().
| std::string Pointer::toDiagnosticString | ( | const ASTContext & | Ctx | ) | const |
Converts the pointer to a string usable in diagnostics.
Definition at line 713 of file Pointer.cpp.
References asIntPointer(), clang::APValue::getAsString(), clang::Type::getPointeeType(), getType(), isIntegralPointer(), clang::Type::isLValueReferenceType(), isZero(), and toAPValue().
Referenced by clang::interp::CmpHelper< Pointer >(), clang::interp::CmpHelperEQ< Pointer >(), clang::interp::interp__builtin_memcpy(), and clang::interp::SubPtr().
Converts the pointer to an APValue that is an rvalue.
Definition at line 1277 of file Pointer.cpp.
References canDeref(), clang::interp::Context::classify(), clang::interp::Context::getASTContext(), isBlockPointer(), isDummy(), clang::Type::isFunctionType(), isIntegralPointer(), isLive(), clang::QualType::isNull(), isOnePastEnd(), isPastEnd(), isZero(), isZeroSizeArray(), load(), clang::Result, clang::T, toAPValue(), toRValue(), TYPE_SWITCH, and view().
Referenced by toRValue().
|
inline |
Definition at line 607 of file Pointer.h.
References BS, and clang::isBlockPointer().
Referenced by activate(), allElementsInitialized(), atField(), atIndex(), clang::interp::Call(), clang::interp::collectBlocks(), computeLayoutOffset(), computeOffsetForComparison(), computeSplitPoint(), deref(), clang::interp::DoMemcpy(), elem(), elemSize(), enumeratePointerFields(), expand(), getArray(), getBase(), getElemRecord(), clang::interp::GetField(), clang::interp::GetFieldPop(), getIndex(), getLifetime(), getNumElems(), getOffset(), getRecord(), getType(), inArray(), initialize(), initializeElement(), inPrimitiveArray(), clang::interp::interp__builtin_strlen(), inUnion(), isActive(), isArrayElement(), isArrayRoot(), isBaseClass(), isConst(), isElementInitialized(), isExtern(), isField(), isInitialized(), isLive(), isMutable(), isOnePastEnd(), isRoot(), isVirtualBaseClass(), isVolatile(), load(), loadElem(), narrow(), operator==(), setLifeState(), stripBaseCasts(), toAPValue(), and toRValue().
|
friend |
Definition at line 1336 of file Pointer.h.
References Block.
Referenced by Block, block(), operator=(), operator=(), Pointer(), Pointer(), Pointer(), print(), and ~Pointer().
|
friend |
|
friend |
Definition at line 1340 of file Pointer.h.
References DynamicAllocator.
Referenced by DynamicAllocator.
|
friend |
|
friend |
|
friend |
| BlockPointer clang::interp::Pointer::BS |
Definition at line 1372 of file Pointer.h.
Referenced by asBlockPointer(), atFieldSub(), block(), clang::interp::DeadBlock::DeadBlock(), deref(), elem(), elemsOfSameArray(), getDeclDesc(), getDeclID(), getDeclPtr(), getIntegerRepresentation(), getRawAddress(), hasSameBase(), inUnion(), isDynamic(), isOnePastEnd(), isPastEnd(), isStatic(), isTemporary(), isWeak(), isZero(), load(), loadElem(), clang::interp::Block::movePointersTo(), operator=(), operator=(), Pointer(), Pointer(), Pointer(), print(), Program, clang::interp::Block::removePointers(), view(), and ~Pointer().
| FunctionPointer clang::interp::Pointer::Fn |
Definition at line 1373 of file Pointer.h.
Referenced by asFunctionPointer(), atIndex(), getIntegerRepresentation(), getSource(), getType(), isWeak(), isZero(), operator=(), operator=(), operator==(), Pointer(), Pointer(), Pointer(), and print().
| IntPointer clang::interp::Pointer::Int |
Definition at line 1371 of file Pointer.h.
Referenced by asIntPointer(), atIndex(), computeLayoutOffset(), computeOffsetForComparison(), getIntegerRepresentation(), getType(), isZero(), operator=(), operator=(), operator==(), Pointer(), Pointer(), Pointer(), Pointer(), Pointer(), and print().
| OpaquePointer clang::interp::Pointer::Opaque |
Definition at line 1376 of file Pointer.h.
Referenced by asOpaquePointer(), computeLayoutOffset(), getIndex(), getNumElems(), getRootExpr(), getRootValueDecl(), getType(), hasSameBase(), isConstexprUnknown(), isOnePastEnd(), isRoot(), isUnknownSizeArray(), isWeak(), operator=(), operator=(), operator==(), Pointer(), Pointer(), Pointer(), Pointer(), pointsToLabel(), print(), and toAPValue().
| StringPointer clang::interp::Pointer::Str |
Definition at line 1375 of file Pointer.h.
Referenced by asStringPointer(), atIndex(), canDeref(), computeLayoutOffset(), computeOffsetForComparison(), elemSize(), getNumElems(), getRawAddress(), getRootExpr(), getType(), hasSameBase(), isOnePastEnd(), isPastEnd(), load(), loadElem(), operator=(), operator=(), operator==(), Pointer(), Pointer(), Pointer(), Pointer(), print(), and toAPValue().
| TypeidPointer clang::interp::Pointer::Typeid |
Definition at line 1374 of file Pointer.h.
Referenced by asTypeidPointer(), getType(), operator=(), operator=(), Pointer(), Pointer(), Pointer(), and toAPValue().