clang 23.0.0git
clang::interp::Record Class Referencefinal

Structure/Class descriptor. More...

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/AST/ByteCode/Record.h"

Classes

struct  Base
 Describes a base class. More...
struct  Field
 Describes a record field. More...

Public Types

using FieldList = llvm::SmallVector<Field, 8>
 Mapping from identifiers to field descriptors.
using BaseList = llvm::SmallVector<Base, 8>
 Mapping from identifiers to base classes.
using VirtualBaseList = llvm::SmallVector<Base, 0>
 List of virtual base classes.
using const_field_iter = FieldList::const_iterator
using const_base_iter = BaseList::const_iterator
using const_virtual_iter = VirtualBaseList::const_iterator

Public Member Functions

const RecordDeclgetDecl () const
 Returns the underlying declaration.
std::string getName () const
 Returns the name of the underlying declaration.
bool isUnion () const
 Checks if the record is a union.
bool isAnonymousUnion () const
 Checks if the record is an anonymous union.
unsigned getSize () const
 Returns the size of the record.
unsigned getFullSize () const
 Returns the full size of the record, including records.
const CXXDestructorDeclgetDestructor () const
 Returns the destructor of the record, if any.
bool hasPtrField () const
 If this record (or any of its bases) contains a field of type PT_Ptr.
bool hasTrivialDtor () const
 Returns true for anonymous unions and records with no destructor or for those with a trivial destructor.
llvm::iterator_range< const_field_iterfields () const
unsigned getNumFields () const
const FieldgetField (unsigned I) const
const FieldgetField (const FieldDecl *FD) const
 Returns a field.
llvm::iterator_range< const_base_iterbases () const
unsigned getNumBases () const
const BasegetBase (unsigned I) const
const BasegetBase (QualType T) const
 Returns a base descriptor.
const BasegetBase (const RecordDecl *FD) const
 Returns a base descriptor.
llvm::iterator_range< const_virtual_itervirtual_bases () const
unsigned getNumVirtualBases () const
const BasegetVirtualBase (unsigned I) const
const BasegetVirtualBase (const RecordDecl *RD) const
 Returns a virtual base descriptor.
void dump (llvm::raw_ostream &OS, unsigned Indentation=0, unsigned Offset=0) const
void dump () const

Friends

class Program

Detailed Description

Structure/Class descriptor.

Definition at line 25 of file Record.h.

Member Typedef Documentation

◆ BaseList

using clang::interp::Record::BaseList = llvm::SmallVector<Base, 8>

Mapping from identifiers to base classes.

Definition at line 55 of file Record.h.

◆ const_base_iter

using clang::interp::Record::const_base_iter = BaseList::const_iterator

Definition at line 97 of file Record.h.

◆ const_field_iter

using clang::interp::Record::const_field_iter = FieldList::const_iterator

Definition at line 85 of file Record.h.

◆ const_virtual_iter

using clang::interp::Record::const_virtual_iter = VirtualBaseList::const_iterator

Definition at line 112 of file Record.h.

◆ FieldList

using clang::interp::Record::FieldList = llvm::SmallVector<Field, 8>

Mapping from identifiers to field descriptors.

Definition at line 53 of file Record.h.

◆ VirtualBaseList

using clang::interp::Record::VirtualBaseList = llvm::SmallVector<Base, 0>

List of virtual base classes.

Definition at line 57 of file Record.h.

Member Function Documentation

◆ bases()

◆ dump() [1/2]

void clang::interp::Record::dump ( ) const
inline

Definition at line 124 of file Record.h.

References dump().

Referenced by dump().

◆ dump() [2/2]

LLVM_DUMP_METHOD void Record::dump ( llvm::raw_ostream & OS,
unsigned Indentation = 0,
unsigned Offset = 0 ) const

Definition at line 542 of file Disasm.cpp.

References bases(), fields(), getName(), clang::Indent(), and virtual_bases().

◆ fields()

◆ getBase() [1/3]

const Record::Base * Record::getBase ( const RecordDecl * FD) const

Returns a base descriptor.

Definition at line 52 of file Record.cpp.

◆ getBase() [2/3]

const Record::Base * Record::getBase ( QualType T) const

Returns a base descriptor.

Definition at line 58 of file Record.cpp.

◆ getBase() [3/3]

const Base * clang::interp::Record::getBase ( unsigned I) const
inline

◆ getDecl()

◆ getDestructor()

const CXXDestructorDecl * clang::interp::Record::getDestructor ( ) const
inline

Returns the destructor of the record, if any.

Definition at line 73 of file Record.h.

Referenced by hasTrivialDtor(), and clang::interp::runRecordDestructor().

◆ getField() [1/2]

const Field * clang::interp::Record::getField ( const FieldDecl * FD) const
inline

Returns a field.

Definition at line 93 of file Record.h.

References clang::FieldDecl::getFieldIndex().

◆ getField() [2/2]

◆ getFullSize()

unsigned clang::interp::Record::getFullSize ( ) const
inline

Returns the full size of the record, including records.

Definition at line 71 of file Record.h.

◆ getName()

std::string Record::getName ( ) const

Returns the name of the underlying declaration.

Definition at line 37 of file Record.cpp.

References clang::interp::Ret().

Referenced by dump().

◆ getNumBases()

unsigned clang::interp::Record::getNumBases ( ) const
inline

◆ getNumFields()

◆ getNumVirtualBases()

unsigned clang::interp::Record::getNumVirtualBases ( ) const
inline

◆ getSize()

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

Returns the size of the record.

Definition at line 69 of file Record.h.

Referenced by clang::interp::Program::getOrCreateRecord().

◆ getVirtualBase() [1/2]

const Record::Base * Record::getVirtualBase ( const RecordDecl * RD) const

Returns a virtual base descriptor.

Definition at line 64 of file Record.cpp.

◆ getVirtualBase() [2/2]

const Base * clang::interp::Record::getVirtualBase ( unsigned I) const
inline

Definition at line 118 of file Record.h.

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

◆ hasPtrField()

bool clang::interp::Record::hasPtrField ( ) const
inline

If this record (or any of its bases) contains a field of type PT_Ptr.

Definition at line 79 of file Record.h.

Referenced by clang::interp::collectBlocks(), clang::interp::Program::getOrCreateRecord(), and clang::interp::isOrHasPtr().

◆ hasTrivialDtor()

bool Record::hasTrivialDtor ( ) const

Returns true for anonymous unions and records with no destructor or for those with a trivial destructor.

Definition at line 45 of file Record.cpp.

References getDestructor(), isAnonymousUnion(), and clang::FunctionDecl::isTrivial().

◆ isAnonymousUnion()

bool clang::interp::Record::isAnonymousUnion ( ) const
inline

Checks if the record is an anonymous union.

Definition at line 67 of file Record.h.

Referenced by hasTrivialDtor().

◆ isUnion()

◆ virtual_bases()

llvm::iterator_range< const_virtual_iter > clang::interp::Record::virtual_bases ( ) const
inline

Definition at line 113 of file Record.h.

Referenced by ctorRecord(), dtorRecord(), dump(), and needsRecordDtor().

◆ Program

friend class Program
friend

Definition at line 133 of file Record.h.

References Program.

Referenced by Program.


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