clang 22.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, 2>
 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 FieldgetField (const FieldDecl *FD) const
 Returns a field.
const BasegetBase (const RecordDecl *FD) const
 Returns a base descriptor.
const BasegetBase (QualType T) const
 Returns a base descriptor.
const BasegetVirtualBase (const RecordDecl *RD) const
 Returns a virtual base descriptor.
const CXXDestructorDeclgetDestructor () const
 Returns the destructor of the record, if any.
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
llvm::iterator_range< const_base_iterbases () const
unsigned getNumBases () const
const BasegetBase (unsigned I) const
llvm::iterator_range< const_virtual_itervirtual_bases () const
unsigned getNumVirtualBases () const
const BasegetVirtualBase (unsigned I) const
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 47 of file Record.h.

◆ const_base_iter

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

Definition at line 91 of file Record.h.

◆ const_field_iter

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

Definition at line 83 of file Record.h.

◆ const_virtual_iter

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

Definition at line 102 of file Record.h.

◆ FieldList

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

Mapping from identifiers to field descriptors.

Definition at line 45 of file Record.h.

◆ VirtualBaseList

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

List of virtual base classes.

Definition at line 49 of file Record.h.

Member Function Documentation

◆ bases()

◆ dump() [1/2]

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

Definition at line 112 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 501 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 53 of file Record.cpp.

Referenced by clang::interp::Pointer::toRValue(), and clang::interp::Compiler< Emitter >::visitInitList().

◆ getBase() [2/3]

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

Returns a base descriptor.

Definition at line 59 of file Record.cpp.

References clang::T.

◆ getBase() [3/3]

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

Definition at line 97 of file Record.h.

References getNumBases().

◆ 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]

◆ getField() [2/2]

const Field * clang::interp::Record::getField ( unsigned I) const
inline

Definition at line 89 of file Record.h.

◆ getFullSize()

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

Returns the full size of the record, including records.

Definition at line 63 of file Record.h.

◆ getName()

std::string Record::getName ( ) const

Returns the name of the underlying declaration.

Definition at line 32 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 61 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 65 of file Record.cpp.

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

◆ getVirtualBase() [2/2]

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

Definition at line 108 of file Record.h.

◆ 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 40 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 59 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 103 of file Record.h.

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

◆ Program

friend class Program
friend

Definition at line 121 of file Record.h.

References Program.

Referenced by Program.


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