clang  10.0.0svn
Classes | Public Member Functions | Public Attributes | List of all members
clang::interp::Descriptor Struct Reference

Describes a memory block created by an allocation site. More...

#include "/opt/doxygen-docs/src/llvm/tools/clang/lib/AST/Interp/Descriptor.h"

Collaboration diagram for clang::interp::Descriptor:
Collaboration graph
[legend]

Classes

struct  UnknownSize
 Token to denote structures of unknown size. More...
 

Public Member Functions

 Descriptor (const DeclTy &D, PrimType Type, bool IsConst, bool IsTemporary, bool IsMutable)
 Allocates a descriptor for a primitive. More...
 
 Descriptor (const DeclTy &D, PrimType Type, size_t NumElems, bool IsConst, bool IsTemporary, bool IsMutable)
 Allocates a descriptor for an array of primitives. More...
 
 Descriptor (const DeclTy &D, PrimType Type, bool IsTemporary, UnknownSize)
 Allocates a descriptor for an array of primitives of unknown size. More...
 
 Descriptor (const DeclTy &D, Descriptor *Elem, unsigned NumElems, bool IsConst, bool IsTemporary, bool IsMutable)
 Allocates a descriptor for an array of composites. More...
 
 Descriptor (const DeclTy &D, Descriptor *Elem, bool IsTemporary, UnknownSize)
 Allocates a descriptor for an array of composites of unknown size. More...
 
 Descriptor (const DeclTy &D, Record *R, bool IsConst, bool IsTemporary, bool IsMutable)
 Allocates a descriptor for a record. More...
 
QualType getType () const
 
SourceLocation getLocation () const
 
const DeclasDecl () const
 
const ExprasExpr () const
 
const ValueDeclasValueDecl () const
 
const FieldDeclasFieldDecl () const
 
const RecordDeclasRecordDecl () const
 
unsigned getSize () const
 Returns the size of the object without metadata. More...
 
unsigned getAllocSize () const
 Returns the allocated size, including metadata. More...
 
unsigned getElemSize () const
 returns the size of an element when the structure is viewed as an array. More...
 
unsigned getNumElems () const
 Returns the number of elements stored in the block. More...
 
bool isPrimitiveArray () const
 Checks if the descriptor is of an array of primitives. More...
 
bool isZeroSizeArray () const
 Checks if the descriptor is of an array of zero size. More...
 
bool isUnknownSizeArray () const
 Checks if the descriptor is of an array of unknown size. More...
 
bool isPrimitive () const
 Checks if the descriptor is of a primitive. More...
 
bool isArray () const
 Checks if the descriptor is of an array. More...
 

Public Attributes

Record *const ElemRecord = nullptr
 Pointer to the record, if block contains records. More...
 
Descriptor *const ElemDesc = nullptr
 Descriptor of the array element. More...
 
const bool IsConst = false
 Flag indicating if the block is mutable. More...
 
const bool IsMutable = false
 Flag indicating if a field is mutable. More...
 
const bool IsTemporary = false
 Flag indicating if the block is a temporary. More...
 
const bool IsArray = false
 Flag indicating if the block is an array. More...
 
const BlockCtorFn CtorFn = nullptr
 Storage management methods. More...
 
const BlockDtorFn DtorFn = nullptr
 
const BlockMoveFn MoveFn = nullptr
 

Detailed Description

Describes a memory block created by an allocation site.

Definition at line 51 of file Descriptor.h.

Constructor & Destructor Documentation

◆ Descriptor() [1/6]

Descriptor::Descriptor ( const DeclTy D,
PrimType  Type,
bool  IsConst,
bool  IsTemporary,
bool  IsMutable 
)

Allocates a descriptor for a primitive.

Definition at line 188 of file Descriptor.cpp.

◆ Descriptor() [2/6]

Descriptor::Descriptor ( const DeclTy D,
PrimType  Type,
size_t  NumElems,
bool  IsConst,
bool  IsTemporary,
bool  IsMutable 
)

Allocates a descriptor for an array of primitives.

Definition at line 197 of file Descriptor.cpp.

◆ Descriptor() [3/6]

Descriptor::Descriptor ( const DeclTy D,
PrimType  Type,
bool  IsTemporary,
UnknownSize   
)

Allocates a descriptor for an array of primitives of unknown size.

Definition at line 207 of file Descriptor.cpp.

◆ Descriptor() [4/6]

Descriptor::Descriptor ( const DeclTy D,
Descriptor Elem,
unsigned  NumElems,
bool  IsConst,
bool  IsTemporary,
bool  IsMutable 
)

Allocates a descriptor for an array of composites.

Definition at line 216 of file Descriptor.cpp.

◆ Descriptor() [5/6]

Descriptor::Descriptor ( const DeclTy D,
Descriptor Elem,
bool  IsTemporary,
UnknownSize   
)

Allocates a descriptor for an array of composites of unknown size.

Definition at line 227 of file Descriptor.cpp.

◆ Descriptor() [6/6]

Descriptor::Descriptor ( const DeclTy D,
Record R,
bool  IsConst,
bool  IsTemporary,
bool  IsMutable 
)

Allocates a descriptor for a record.

Definition at line 236 of file Descriptor.cpp.

Member Function Documentation

◆ asDecl()

const Decl* clang::interp::Descriptor::asDecl ( ) const
inline

◆ asExpr()

const Expr* clang::interp::Descriptor::asExpr ( ) const
inline

Definition at line 113 of file Descriptor.h.

Referenced by getType(), and clang::interp::Pointer::toAPValue().

◆ asFieldDecl()

const FieldDecl* clang::interp::Descriptor::asFieldDecl ( ) const
inline

Definition at line 119 of file Descriptor.h.

References asDecl().

Referenced by clang::interp::Pointer::getField().

◆ asRecordDecl()

const RecordDecl* clang::interp::Descriptor::asRecordDecl ( ) const
inline

Definition at line 123 of file Descriptor.h.

References asDecl().

◆ asValueDecl()

const ValueDecl* clang::interp::Descriptor::asValueDecl ( ) const
inline

Definition at line 115 of file Descriptor.h.

References asDecl().

Referenced by getType(), and clang::interp::Pointer::toAPValue().

◆ getAllocSize()

unsigned clang::interp::Descriptor::getAllocSize ( ) const
inline

◆ getElemSize()

unsigned clang::interp::Descriptor::getElemSize ( ) const
inline

returns the size of an element when the structure is viewed as an array.

Definition at line 136 of file Descriptor.h.

Referenced by clang::interp::Pointer::elemSize(), and getNumElems().

◆ getLocation()

SourceLocation Descriptor::getLocation ( ) const

Definition at line 253 of file Descriptor.cpp.

References clang::interp::align().

Referenced by clang::interp::Pointer::getDeclLoc().

◆ getNumElems()

unsigned clang::interp::Descriptor::getNumElems ( ) const
inline

Returns the number of elements stored in the block.

Definition at line 139 of file Descriptor.h.

References getElemSize(), and getSize().

Referenced by ctorArrayDesc(), ctorArrayTy(), dtorArrayDesc(), dtorArrayTy(), clang::interp::Pointer::initialize(), moveArrayDesc(), and moveArrayTy().

◆ getSize()

unsigned clang::interp::Descriptor::getSize ( ) const
inline

Returns the size of the object without metadata.

Definition at line 128 of file Descriptor.h.

References isUnknownSizeArray().

Referenced by clang::interp::Pointer::elemSize(), getNumElems(), and clang::interp::Pointer::getSize().

◆ getType()

QualType Descriptor::getType ( ) const

Definition at line 245 of file Descriptor.cpp.

References asExpr(), and asValueDecl().

Referenced by clang::interp::Pointer::getType().

◆ isArray()

bool clang::interp::Descriptor::isArray ( ) const
inline

Checks if the descriptor is of an array.

Definition at line 154 of file Descriptor.h.

References IsArray.

◆ isPrimitive()

bool clang::interp::Descriptor::isPrimitive ( ) const
inline

Checks if the descriptor is of a primitive.

Definition at line 151 of file Descriptor.h.

References ElemRecord.

◆ isPrimitiveArray()

bool clang::interp::Descriptor::isPrimitiveArray ( ) const
inline

Checks if the descriptor is of an array of primitives.

Definition at line 144 of file Descriptor.h.

References ElemDesc.

Referenced by clang::interp::Pointer::initialize(), clang::interp::Pointer::inPrimitiveArray(), and clang::interp::Pointer::isInitialized().

◆ isUnknownSizeArray()

bool clang::interp::Descriptor::isUnknownSizeArray ( ) const
inline

Checks if the descriptor is of an array of unknown size.

Definition at line 148 of file Descriptor.h.

Referenced by getSize(), and clang::interp::Pointer::isUnknownSizeArray().

◆ isZeroSizeArray()

bool clang::interp::Descriptor::isZeroSizeArray ( ) const
inline

Checks if the descriptor is of an array of zero size.

Definition at line 146 of file Descriptor.h.

Member Data Documentation

◆ CtorFn

const BlockCtorFn clang::interp::Descriptor::CtorFn = nullptr

Storage management methods.

Definition at line 83 of file Descriptor.h.

Referenced by ctorArrayDesc(), and clang::interp::Block::invokeCtor().

◆ DtorFn

const BlockDtorFn clang::interp::Descriptor::DtorFn = nullptr

Definition at line 84 of file Descriptor.h.

Referenced by clang::interp::InterpState::deallocate(), and dtorArrayDesc().

◆ ElemDesc

Descriptor* const clang::interp::Descriptor::ElemDesc = nullptr

Descriptor of the array element.

Definition at line 72 of file Descriptor.h.

Referenced by ctorArrayDesc(), dtorArrayDesc(), isPrimitiveArray(), and moveArrayDesc().

◆ ElemRecord

Record* const clang::interp::Descriptor::ElemRecord = nullptr

Pointer to the record, if block contains records.

Definition at line 70 of file Descriptor.h.

Referenced by ctorRecord(), dtorRecord(), clang::interp::Pointer::getRecord(), isPrimitive(), and moveRecord().

◆ IsArray

const bool clang::interp::Descriptor::IsArray = false

Flag indicating if the block is an array.

Definition at line 80 of file Descriptor.h.

Referenced by clang::interp::Pointer::expand(), clang::interp::Pointer::hasSameArray(), clang::interp::Pointer::inArray(), and isArray().

◆ IsConst

const bool clang::interp::Descriptor::IsConst = false

Flag indicating if the block is mutable.

Definition at line 74 of file Descriptor.h.

Referenced by ctorArrayDesc(), clang::interp::Block::invokeCtor(), and clang::interp::Pointer::isConst().

◆ IsMutable

const bool clang::interp::Descriptor::IsMutable = false

Flag indicating if a field is mutable.

Definition at line 76 of file Descriptor.h.

Referenced by ctorArrayDesc(), and clang::interp::Block::invokeCtor().

◆ IsTemporary

const bool clang::interp::Descriptor::IsTemporary = false

Flag indicating if the block is a temporary.

Definition at line 78 of file Descriptor.h.

Referenced by clang::interp::Block::isTemporary().

◆ MoveFn

const BlockMoveFn clang::interp::Descriptor::MoveFn = nullptr

Definition at line 85 of file Descriptor.h.

Referenced by clang::interp::InterpState::deallocate(), and moveArrayDesc().


The documentation for this struct was generated from the following files: