|
clang 24.0.0git
|
#include "/work/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/AST/ByteCode/Pointer.h"
Public Member Functions | |
| ArrayRef< PointerPathEntry > | path () const |
| OpaquePointer | withFieldType (const Type *FieldTy, std::optional< bool > PastEnd=std::nullopt) const |
| OpaquePointer | withPath (const PointerPathEntry *Path, unsigned PathLength, const Type *FieldTy, std::optional< bool > PastEnd=std::nullopt) const |
| OpaquePointer | withPastEnd (bool PastEnd) const |
| QualType | getObjectType () const |
| QualType | getFieldType () const |
| bool | isArrayElement () const |
| std::optional< size_t > | computeLayoutOffset (const ASTContext &ASTCtx) const |
| QualType | getSurroundingArray () const |
| If this is pointing to an array element, return the array. | |
| bool | isOnePastEnd () const |
| bool | isOnePastEndOrElementPastEnd () const |
| This is used in Pointer::isOnePastEnd(). | |
| bool | isConstexprUnknown () const |
| bool | isUnknownSizeArray () const |
| bool | isRoot () const |
| Check if the pointer has offset 0. | |
Public Attributes | |
| const ValueDecl * | Base = nullptr |
| llvm::PointerIntPair< const Type *, 2, unsigned > | FieldType = {} |
| const PointerPathEntry * | Path = nullptr |
| unsigned | PathLength = 0 |
| std::optional< size_t > OpaquePointer::computeLayoutOffset | ( | const ASTContext & | ASTCtx | ) | const |
Definition at line 1284 of file Pointer.cpp.
References clang::interp::Add(), clang::interp::PointerPathEntry::Array, clang::interp::PointerPathEntry::Base, clang::interp::PointerPathEntry::Field, clang::Type::getAsArrayTypeUnsafe(), clang::Type::getAsRecordDecl(), clang::ASTContext::getASTRecordLayout(), clang::ASTRecordLayout::getBaseClassOffset(), clang::ASTContext::getCanonicalTagType(), clang::ArrayType::getElementType(), clang::FieldDecl::getFieldIndex(), clang::ASTRecordLayout::getFieldOffset(), getObjectType(), clang::FieldDecl::getParent(), clang::CharUnits::getQuantity(), clang::ValueDecl::getType(), clang::ASTContext::getTypeSizeInChars(), clang::ASTContext::hasLayout(), clang::isa(), clang::Type::isArrayType(), clang::interp::PointerPathEntry::NegativeArray, path(), clang::ASTContext::toCharUnitsFromBits(), and clang::interp::validType().
|
inline |
Definition at line 476 of file Pointer.h.
References FieldType.
Referenced by clang::interp::getBase(), clang::interp::getField(), getSurroundingArray(), and isUnknownSizeArray().
|
inline |
Definition at line 469 of file Pointer.h.
References Base, and clang::T.
Referenced by computeFieldType(), computeLayoutOffset(), computeOpaquePtrOffset(), computeOpaqueSize(), clang::interp::evaluateBuiltinObjectSize(), getSurroundingArray(), isRoot(), and isUserWritingOffTheEnd().
| QualType OpaquePointer::getSurroundingArray | ( | ) | const |
If this is pointing to an array element, return the array.
Definition at line 1341 of file Pointer.cpp.
References clang::interp::PointerPathEntry::Array, clang::interp::PointerPathEntry::Base, clang::interp::PointerPathEntry::Field, clang::Type::getAsArrayTypeUnsafe(), clang::ArrayType::getElementType(), getFieldType(), getObjectType(), isArrayElement(), clang::Type::isArrayType(), clang::interp::PointerPathEntry::NegativeArray, Path, path(), and PathLength.
Referenced by clang::interp::addSubOffsetOpaque(), clang::interp::arrayElemPtrOpaque(), isOnePastEndOrElementPastEnd(), isUnknownSizeArray(), and pointsToCompleteObject().
|
inline |
Definition at line 482 of file Pointer.h.
References clang::interp::PointerPathEntry::Array, Path, and PathLength.
Referenced by clang::interp::addSubOffsetOpaque(), clang::interp::arrayElemPtrOpaque(), getSurroundingArray(), isUnknownSizeArray(), and pointsToCompleteObject().
|
inline |
Definition at line 493 of file Pointer.h.
References FieldType.
Referenced by withFieldType(), and withPath().
|
inline |
Definition at line 491 of file Pointer.h.
References FieldType.
Referenced by isOnePastEndOrElementPastEnd().
| bool OpaquePointer::isOnePastEndOrElementPastEnd | ( | ) | const |
This is used in Pointer::isOnePastEnd().
We cannot read from such pointers. We can of course never read from opaque pointers anyway but we diagnose one-past-the-end pointers differently.
In contrast, OpaquePointer::isOnePastEnd() only uses the past-end bit. That is used for the APValue conversion.
Definition at line 1429 of file Pointer.cpp.
References clang::interp::PointerPathEntry::Array, clang::Type::getAsArrayTypeUnsafe(), getSurroundingArray(), clang::Type::isArrayType(), isOnePastEnd(), Path, and PathLength.
| bool OpaquePointer::isRoot | ( | ) | const |
Check if the pointer has offset 0.
Definition at line 1372 of file Pointer.cpp.
References clang::interp::PointerPathEntry::Array, clang::interp::PointerPathEntry::Base, clang::interp::PointerPathEntry::Field, clang::Type::getAsArrayTypeUnsafe(), clang::ArrayType::getElementType(), getObjectType(), clang::Type::isArrayType(), clang::interp::PointerPathEntry::NegativeArray, and path().
| bool OpaquePointer::isUnknownSizeArray | ( | ) | const |
Definition at line 1401 of file Pointer.cpp.
References Base, clang::cast(), FieldType, getFieldType(), getSurroundingArray(), clang::isa(), isArrayElement(), and clang::Result.
|
inline |
Definition at line 439 of file Pointer.h.
References Path, and PathLength.
Referenced by computeFieldType(), computeLayoutOffset(), computeOpaquePtrOffset(), getSurroundingArray(), and isRoot().
|
inline |
Definition at line 442 of file Pointer.h.
References Base, FieldType, isConstexprUnknown(), Path, and PathLength.
Referenced by clang::interp::arrayElemPtrOpaque(), and clang::interp::LoadPopL().
|
inline |
Definition at line 461 of file Pointer.h.
References Base, FieldType, Path, and PathLength.
Referenced by clang::interp::addSubOffsetOpaque().
|
inline |
Definition at line 451 of file Pointer.h.
References Base, FieldType, isConstexprUnknown(), Path, and PathLength.
Referenced by clang::interp::addSubOffsetOpaque(), clang::interp::arrayElemPtrOpaque(), clang::interp::getBase(), and clang::interp::getField().
Definition at line 433 of file Pointer.h.
Referenced by clang::interp::Pointer::computeOffsetForComparison(), computeOpaqueSize(), clang::interp::evaluateBuiltinObjectSize(), getObjectType(), isUnknownSizeArray(), withFieldType(), withPastEnd(), and withPath().
Definition at line 435 of file Pointer.h.
Referenced by clang::interp::addSubOffsetOpaque(), getFieldType(), isConstexprUnknown(), isOnePastEnd(), isUnknownSizeArray(), withFieldType(), withPastEnd(), and withPath().
| const PointerPathEntry* clang::interp::OpaquePointer::Path = nullptr |
Definition at line 436 of file Pointer.h.
Referenced by clang::interp::addSubOffsetOpaque(), clang::interp::arrayElemPtrOpaque(), clang::interp::getBase(), clang::interp::getField(), getSurroundingArray(), isArrayElement(), isOnePastEndOrElementPastEnd(), isUserWritingOffTheEnd(), path(), withFieldType(), withPastEnd(), and withPath().
| unsigned clang::interp::OpaquePointer::PathLength = 0 |
Definition at line 437 of file Pointer.h.
Referenced by clang::interp::addSubOffsetOpaque(), clang::interp::arrayElemPtrOpaque(), computeFieldType(), computeOpaquePtrOffset(), clang::interp::getBase(), clang::interp::getField(), getSurroundingArray(), isArrayElement(), isOnePastEndOrElementPastEnd(), isUserWritingOffTheEnd(), path(), pointsToCompleteObject(), withFieldType(), withPastEnd(), and withPath().