class RecordDecl

Declaration

class RecordDecl : public TagDecl { /* full declaration omitted */ };

Description

Represents a struct/union/class. For example: struct X; // Forward declaration, no "body". union Y { int A, B; }; // Has body with members A and B (FieldDecls). This decl will be marked invalid if *any* members are invalid.

Declared at: clang/include/clang/AST/Decl.h:3919

Inherits from: TagDecl

Member Variables

Inherited from DeclContext:

protected
protected FirstDecl = nullptr
protected LastDecl = nullptr

Inherited from Decl:

protected NextInContextAndBits
protected Access
protected FromASTFile
protected IdentifierNamespace
protected CacheValidAndLinkage

Method Overview

Inherited from TagDecl:

Inherited from DeclContext:

Inherited from TypeDecl:

Inherited from NamedDecl:

Inherited from Decl:

Methods

static clang::RecordDecl* Create(
    const clang::ASTContext& C,
    clang::TagDecl::TagKind TK,
    clang::DeclContext* DC,
    clang::SourceLocation StartLoc,
    clang::SourceLocation IdLoc,
    clang::IdentifierInfo* Id,
    clang::RecordDecl* PrevDecl = nullptr)

Declared at: clang/include/clang/AST/Decl.h:3953

Parameters

const clang::ASTContext& C
clang::TagDecl::TagKind TK
clang::DeclContext* DC
clang::SourceLocation StartLoc
clang::SourceLocation IdLoc
clang::IdentifierInfo* Id
clang::RecordDecl* PrevDecl = nullptr

static clang::RecordDecl* CreateDeserialized(
    const clang::ASTContext& C,
    unsigned int ID)

Declared at: clang/include/clang/AST/Decl.h:3956

Parameters

const clang::ASTContext& C
unsigned int ID

void LoadFieldsFromExternalStorage() const

Description

Deserialize just the fields.

Declared at: clang/include/clang/AST/Decl.h:4181

RecordDecl(clang::Decl::Kind DK,
           clang::TagDecl::TagKind TK,
           const clang::ASTContext& C,
           clang::DeclContext* DC,
           clang::SourceLocation StartLoc,
           clang::SourceLocation IdLoc,
           clang::IdentifierInfo* Id,
           clang::RecordDecl* PrevDecl)

Declared at: clang/include/clang/AST/Decl.h:3948

Parameters

clang::Decl::Kind DK
clang::TagDecl::TagKind TK
const clang::ASTContext& C
clang::DeclContext* DC
clang::SourceLocation StartLoc
clang::SourceLocation IdLoc
clang::IdentifierInfo* Id
clang::RecordDecl* PrevDecl

bool canPassInRegisters() const

Description

Determine whether this class can be passed in registers. In C++ mode, it must have at least one trivial, non-deleted copy or move constructor. FIXME: This should be set as part of completeDefinition.

Declared at: clang/include/clang/AST/Decl.h:4069

static bool classof(const clang::Decl* D)

Declared at: clang/include/clang/AST/Decl.h:4160

Parameters

const clang::Decl* D

static bool classofKind(clang::Decl::Kind K)

Declared at: clang/include/clang/AST/Decl.h:4161

Parameters

clang::Decl::Kind K

virtual void completeDefinition()

Description

Note that the definition of this type is now complete.

Declared at: clang/include/clang/AST/Decl.h:4158

clang::RecordDecl::field_iterator field_begin()
    const

Declared at: clang/include/clang/AST/Decl.h:4146

bool field_empty() const

Declared at: clang/include/clang/AST/Decl.h:4153

clang::RecordDecl::field_iterator field_end()
    const

Declared at: clang/include/clang/AST/Decl.h:4148

clang::RecordDecl::field_range fields() const

Declared at: clang/include/clang/AST/Decl.h:4145

const clang::FieldDecl* findFirstNamedDataMember()
    const

Description

Finds the first data member which has a name. nullptr is returned if no named data member exists.

Declared at: clang/include/clang/AST/Decl.h:4177

clang::RecordDecl::ArgPassingKind
getArgPassingRestrictions() const

Declared at: clang/include/clang/AST/Decl.h:4073

clang::RecordDecl* getDefinition() const

Description

Returns the RecordDecl that actually defines this struct/union/class. When determining whether or not a struct/union/class is completely defined, one should use this method as opposed to 'isCompleteDefinition'. 'isCompleteDefinition' indicates whether or not a specific RecordDecl is a completed definition, not whether or not the record type is defined. This method returns NULL if there is no RecordDecl that defines the struct/union/tag.

Declared at: clang/include/clang/AST/Decl.h:4130

clang::RecordDecl* getMostRecentDecl()

Declared at: clang/include/clang/AST/Decl.h:3966

const clang::RecordDecl* getMostRecentDecl() const

Declared at: clang/include/clang/AST/Decl.h:3969

const clang::RecordDecl* getPreviousDecl() const

Declared at: clang/include/clang/AST/Decl.h:3962

clang::RecordDecl* getPreviousDecl()

Declared at: clang/include/clang/AST/Decl.h:3958

bool hasFlexibleArrayMember() const

Declared at: clang/include/clang/AST/Decl.h:3973

bool hasLoadedFieldsFromExternalStorage() const

Declared at: clang/include/clang/AST/Decl.h:4009

bool hasNonTrivialToPrimitiveCopyCUnion() const

Declared at: clang/include/clang/AST/Decl.h:4058

bool hasNonTrivialToPrimitiveDefaultInitializeCUnion()
    const

Declared at: clang/include/clang/AST/Decl.h:4042

bool hasNonTrivialToPrimitiveDestructCUnion()
    const

Declared at: clang/include/clang/AST/Decl.h:4050

bool hasObjectMember() const

Declared at: clang/include/clang/AST/Decl.h:4000

bool hasVolatileMember() const

Declared at: clang/include/clang/AST/Decl.h:4003

bool isAnonymousStructOrUnion() const

Description

Whether this is an anonymous struct or union. To be an anonymous struct or union, it must have been declared without a name and there must be no objects of this type declared, e.g., is an anonymous union but neither of the following are:

Declared at: clang/include/clang/AST/Decl.h:3992

bool isCapturedRecord() const

Description

Determine whether this record is a record for captured variables in CapturedStmt construct.

Declared at: clang/include/clang/AST/Decl.h:4116

bool isInjectedClassName() const

Description

Determines whether this declaration represents the injected class name. The injected class name in C++ is the name of the class that appears inside the class itself. For example:

Declared at: clang/include/clang/AST/Decl.h:4108

bool isLambda() const

Description

Determine whether this record is a class describing a lambda function object.

Declared at: clang/include/clang/AST/Decl.h:4112

bool isMsStruct(const clang::ASTContext& C) const

Description

Get whether or not this is an ms_struct which can be turned on with an attribute, pragma, or -mms-bitfields commandline option.

Declared at: clang/include/clang/AST/Decl.h:4168

Parameters

const clang::ASTContext& C

bool isNonTrivialToPrimitiveCopy() const

Declared at: clang/include/clang/AST/Decl.h:4026

bool isNonTrivialToPrimitiveDefaultInitialize()
    const

Description

Functions to query basic properties of non-trivial C structs.

Declared at: clang/include/clang/AST/Decl.h:4018

bool isNonTrivialToPrimitiveDestroy() const

Declared at: clang/include/clang/AST/Decl.h:4034

bool isOrContainsUnion() const

Description

Returns whether this record is a union, or contains (at any nesting level) a union member. This is used by CMSE to warn about possible information leaks.

Declared at: clang/include/clang/AST/Decl.h:4137

bool isParamDestroyedInCallee() const

Declared at: clang/include/clang/AST/Decl.h:4081

bool isRandomized() const

Declared at: clang/include/clang/AST/Decl.h:4089

bool mayInsertExtraPadding(
    bool EmitRemark = false) const

Description

Whether we are allowed to insert extra padding between fields. These padding are added to help AddressSanitizer detect intra-object-overflow bugs.

Declared at: clang/include/clang/AST/Decl.h:4173

Parameters

bool EmitRemark = false

void reorderDecls(
    const SmallVectorImpl<clang::Decl*>& Decls)

Declared at: clang/include/clang/AST/Decl.h:4093

Parameters

const SmallVectorImpl<clang::Decl*>& Decls

void setAnonymousStructOrUnion(bool Anon)

Declared at: clang/include/clang/AST/Decl.h:3996

Parameters

bool Anon

void setArgPassingRestrictions(
    clang::RecordDecl::ArgPassingKind Kind)

Declared at: clang/include/clang/AST/Decl.h:4077

Parameters

clang::RecordDecl::ArgPassingKind Kind

void setCapturedRecord()

Description

Mark the record as a record for captured variables in CapturedStmt construct.

Declared at: clang/include/clang/AST/Decl.h:4120

void setHasFlexibleArrayMember(bool V)

Declared at: clang/include/clang/AST/Decl.h:3977

Parameters

bool V

void setHasLoadedFieldsFromExternalStorage(
    bool val) const

Declared at: clang/include/clang/AST/Decl.h:4013

Parameters

bool val

void setHasNonTrivialToPrimitiveCopyCUnion(bool V)

Declared at: clang/include/clang/AST/Decl.h:4062

Parameters

bool V

void setHasNonTrivialToPrimitiveDefaultInitializeCUnion(
    bool V)

Declared at: clang/include/clang/AST/Decl.h:4046

Parameters

bool V

void setHasNonTrivialToPrimitiveDestructCUnion(
    bool V)

Declared at: clang/include/clang/AST/Decl.h:4054

Parameters

bool V

void setHasObjectMember(bool val)

Declared at: clang/include/clang/AST/Decl.h:4001

Parameters

bool val

void setHasVolatileMember(bool val)

Declared at: clang/include/clang/AST/Decl.h:4005

Parameters

bool val

void setIsRandomized(bool V)

Declared at: clang/include/clang/AST/Decl.h:4091

Parameters

bool V

void setNonTrivialToPrimitiveCopy(bool V)

Declared at: clang/include/clang/AST/Decl.h:4030

Parameters

bool V

void setNonTrivialToPrimitiveDefaultInitialize(
    bool V)

Declared at: clang/include/clang/AST/Decl.h:4022

Parameters

bool V

void setNonTrivialToPrimitiveDestroy(bool V)

Declared at: clang/include/clang/AST/Decl.h:4038

Parameters

bool V

void setParamDestroyedInCallee(bool V)

Declared at: clang/include/clang/AST/Decl.h:4085

Parameters

bool V