|
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 |
| bool | hasDeclBase () const |
| const VarDecl * | getBaseDecl () const |
| const Expr * | getBaseExpr () 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 | |
| DeclOrExpr | Base |
| 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 1398 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::ASTRecordLayout::getVBaseClassOffset(), clang::ASTContext::hasLayout(), clang::isa(), clang::Type::isArrayType(), clang::interp::PointerPathEntry::NegativeArray, path(), clang::ASTContext::toCharUnitsFromBits(), and validType().
|
inline |
|
inline |
|
inline |
Definition at line 482 of file Pointer.h.
References Base, and FieldType.
Referenced by clang::interp::addSubOffsetOpaque(), clang::interp::copyPrimitiveMemory(), clang::interp::copyPrimitiveMemory(), clang::interp::evaluateBuiltinObjectSize(), clang::interp::getBase(), clang::interp::getField(), getSurroundingArray(), clang::interp::InitGlobal(), isUnknownSizeArray(), and clang::interp::virtBaseHelper().
|
inline |
Definition at line 475 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 1460 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 |
|
inline |
Definition at line 488 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 499 of file Pointer.h.
References FieldType.
Referenced by withFieldType(), and withPath().
|
inline |
Definition at line 497 of file Pointer.h.
References FieldType.
Referenced by clang::interp::AddrOf(), clang::interp::copyPrimitiveMemory(), clang::interp::copyPrimitiveMemory(), clang::interp::InitGlobal(), and 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 1548 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 1491 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 1520 of file Pointer.cpp.
References Base, FieldType, getFieldType(), getSurroundingArray(), clang::isa(), isArrayElement(), and clang::Result.
|
inline |
Definition at line 442 of file Pointer.h.
References Path, and PathLength.
Referenced by computeFieldType(), computeLayoutOffset(), computeOpaquePtrOffset(), getSurroundingArray(), and isRoot().
|
inline |
Definition at line 448 of file Pointer.h.
References Base, FieldType, isConstexprUnknown(), Path, and PathLength.
Referenced by clang::interp::AddrOf(), clang::interp::arrayElemPtrOpaque(), and clang::interp::LoadPopL().
|
inline |
Definition at line 467 of file Pointer.h.
References Base, FieldType, Path, and PathLength.
Referenced by clang::interp::addSubOffsetOpaque().
|
inline |
Definition at line 457 of file Pointer.h.
References Base, FieldType, isConstexprUnknown(), Path, and PathLength.
Referenced by clang::interp::addSubOffsetOpaque(), clang::interp::arrayElemPtrOpaque(), clang::interp::copyPrimitiveMemory(), clang::interp::copyPrimitiveMemory(), clang::interp::getBase(), clang::interp::getField(), clang::interp::InitGlobal(), and clang::interp::virtBaseHelper().
| DeclOrExpr clang::interp::OpaquePointer::Base |
Definition at line 436 of file Pointer.h.
Referenced by clang::interp::evaluateBuiltinObjectSize(), getBaseDecl(), getBaseExpr(), getFieldType(), getObjectType(), hasDeclBase(), clang::interp::Pointer::hasSameBase(), isUnknownSizeArray(), clang::interp::Pointer::operator==(), withFieldType(), withPastEnd(), and withPath().
Definition at line 438 of file Pointer.h.
Referenced by clang::interp::AddrOf(), clang::interp::addSubOffsetOpaque(), getFieldType(), isConstexprUnknown(), isOnePastEnd(), isUnknownSizeArray(), withFieldType(), withPastEnd(), and withPath().
| const PointerPathEntry* clang::interp::OpaquePointer::Path = nullptr |
Definition at line 439 of file Pointer.h.
Referenced by clang::interp::addSubOffsetOpaque(), clang::interp::arrayElemPtrOpaque(), clang::interp::copyPrimitiveMemory(), clang::interp::copyPrimitiveMemory(), clang::interp::getBase(), clang::interp::getField(), getSurroundingArray(), clang::interp::InitGlobal(), isArrayElement(), isOnePastEndOrElementPastEnd(), isUserWritingOffTheEnd(), clang::interp::Pointer::operator==(), path(), clang::interp::virtBaseHelper(), withFieldType(), withPastEnd(), and withPath().
| unsigned clang::interp::OpaquePointer::PathLength = 0 |
Definition at line 440 of file Pointer.h.
Referenced by clang::interp::addSubOffsetOpaque(), clang::interp::arrayElemPtrOpaque(), computeFieldType(), computeOpaquePtrOffset(), clang::interp::copyPrimitiveMemory(), clang::interp::copyPrimitiveMemory(), clang::interp::getBase(), clang::interp::getField(), getSurroundingArray(), clang::interp::InitGlobal(), isArrayElement(), isOnePastEndOrElementPastEnd(), isUserWritingOffTheEnd(), clang::interp::Pointer::operator==(), path(), pointsToCompleteObject(), clang::interp::virtBaseHelper(), withFieldType(), withPastEnd(), and withPath().