clang 20.0.0git
Classes | Public Types | Public Member Functions | Friends | List of all members
clang::interp::Record Class Referencefinal

Structure/Class descriptor. More...

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/AST/Interp/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.
 
const std::string getName () const
 Returns the name of the underlying declaration.
 
bool isUnion () const
 Checks if the record is a 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.
 
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 46 of file Record.h.

◆ const_base_iter

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

Definition at line 84 of file Record.h.

◆ const_field_iter

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

Definition at line 76 of file Record.h.

◆ const_virtual_iter

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

Definition at line 95 of file Record.h.

◆ FieldList

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

Mapping from identifiers to field descriptors.

Definition at line 44 of file Record.h.

◆ VirtualBaseList

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

List of virtual base classes.

Definition at line 48 of file Record.h.

Member Function Documentation

◆ bases()

llvm::iterator_range< const_base_iter > clang::interp::Record::bases ( ) const
inline

◆ dump() [1/2]

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

Definition at line 105 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 296 of file Disasm.cpp.

References bases(), fields(), getName(), and virtual_bases().

◆ fields()

llvm::iterator_range< const_field_iter > clang::interp::Record::fields ( ) const
inline

◆ getBase() [1/3]

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

Returns a base descriptor.

Definition at line 45 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 51 of file Record.cpp.

References clang::Type::getAs(), and clang::T.

◆ getBase() [3/3]

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

Definition at line 90 of file Record.h.

References getNumBases().

◆ getDecl()

const RecordDecl * clang::interp::Record::getDecl ( ) const
inline

Returns the underlying declaration.

Definition at line 52 of file Record.h.

Referenced by clang::interp::CheckFieldsInitialized(), clang::interp::Pointer::toAPValue(), and clang::interp::MemberPointer::toPointer().

◆ getDestructor()

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

Returns the destructor of the record, if any.

Definition at line 70 of file Record.h.

Referenced by clang::interp::runRecordDestructor().

◆ getField() [1/2]

const Record::Field * Record::getField ( const FieldDecl FD) const

◆ getField() [2/2]

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

Definition at line 82 of file Record.h.

◆ getFullSize()

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

Returns the full size of the record, including records.

Definition at line 60 of file Record.h.

◆ getName()

const std::string Record::getName ( ) const

Returns the name of the underlying declaration.

Definition at line 31 of file Record.cpp.

References clang::Decl::getASTContext(), clang::ASTContext::getPrintingPolicy(), and clang::interp::Ret().

Referenced by dump().

◆ getNumBases()

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

◆ getNumFields()

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

◆ getNumVirtualBases()

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

Definition at line 100 of file Record.h.

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

◆ getSize()

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

Returns the size of the record.

Definition at line 58 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 59 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 101 of file Record.h.

◆ isUnion()

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

◆ virtual_bases()

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

Definition at line 96 of file Record.h.

Referenced by dump().

Friends And Related Function Documentation

◆ Program

friend class Program
friend

Definition at line 114 of file Record.h.


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