clang 22.0.0git
clang::ASTDeclMerger Class Reference

Public Member Functions

 ASTDeclMerger (ASTReader &Reader)
void mergeLambda (CXXRecordDecl *D, RedeclarableResult &Redecl, Decl &Context, unsigned Number)
 Attempt to merge D with a previous declaration of the same lambda, which is found by its index within its context declaration, if it has one.
template<typename T>
void mergeRedeclarableImpl (Redeclarable< T > *D, T *Existing, GlobalDeclID KeyDeclID)
 Attempts to merge the given declaration (D) with another declaration of the same entity.
template<typename T>
void mergeRedeclarable (Redeclarable< T > *D, T *Existing, RedeclarableResult &Redecl)
void mergeTemplatePattern (RedeclarableTemplateDecl *D, RedeclarableTemplateDecl *Existing, bool IsKeyDecl)
 Merge together the pattern declarations from two template declarations.
void MergeDefinitionData (CXXRecordDecl *D, struct CXXRecordDecl::DefinitionData &&NewDD)
void MergeDefinitionData (ObjCInterfaceDecl *D, struct ObjCInterfaceDecl::DefinitionData &&NewDD)
void MergeDefinitionData (ObjCProtocolDecl *D, struct ObjCProtocolDecl::DefinitionData &&NewDD)

Detailed Description

Definition at line 103 of file ASTReaderDecl.cpp.

Constructor & Destructor Documentation

◆ ASTDeclMerger()

clang::ASTDeclMerger::ASTDeclMerger ( ASTReader & Reader)
inline

Definition at line 107 of file ASTReaderDecl.cpp.

Member Function Documentation

◆ MergeDefinitionData() [1/3]

void ASTDeclMerger::MergeDefinitionData ( CXXRecordDecl * D,
struct CXXRecordDecl::DefinitionData && NewDD )

◆ MergeDefinitionData() [2/3]

void ASTDeclMerger::MergeDefinitionData ( ObjCInterfaceDecl * D,
struct ObjCInterfaceDecl::DefinitionData && NewDD )

Definition at line 1283 of file ASTReaderDecl.cpp.

References clang::ObjCInterfaceDecl::getODRHash().

◆ MergeDefinitionData() [3/3]

void ASTDeclMerger::MergeDefinitionData ( ObjCProtocolDecl * D,
struct ObjCProtocolDecl::DefinitionData && NewDD )

Definition at line 1394 of file ASTReaderDecl.cpp.

References clang::ObjCProtocolDecl::getODRHash().

◆ mergeLambda()

void ASTDeclMerger::mergeLambda ( CXXRecordDecl * D,
RedeclarableResult & Redecl,
Decl & Context,
unsigned IndexInContext )

Attempt to merge D with a previous declaration of the same lambda, which is found by its index within its context declaration, if it has one.

We can't look up lambdas in their enclosing lexical or semantic context in general, because for lambdas in variables, both of those might be a namespace or the translation unit.

Definition at line 2880 of file ASTReaderDecl.cpp.

References clang::cast(), clang::TagDecl::isFirstDecl(), and mergeRedeclarable().

◆ mergeRedeclarable()

template<typename T>
void clang::ASTDeclMerger::mergeRedeclarable ( Redeclarable< T > * D,
T * Existing,
RedeclarableResult & Redecl )
inline

Definition at line 121 of file ASTReaderDecl.cpp.

References mergeRedeclarableImpl(), and clang::T.

Referenced by mergeLambda(), and mergeTemplatePattern().

◆ mergeRedeclarableImpl()

template<typename T>
void ASTDeclMerger::mergeRedeclarableImpl ( Redeclarable< T > * D,
T * Existing,
GlobalDeclID KeyDeclID )

Attempts to merge the given declaration (D) with another declaration of the same entity.

Parameters
KeyDeclIDthe decl ID of the key declaration
D.GlobalDeclID() if
isnot a key declaration. See the comments of ASTReader::KeyDecls for the explanation of key declaration.

Definition at line 2966 of file ASTReaderDecl.cpp.

References assert_cast(), clang::Redeclarable< decl_type >::First, clang::CXXRecordDecl::getCanonicalDecl(), clang::DeclIDBase::isValid(), mergeTemplatePattern(), clang::Redeclarable< decl_type >::PreviousDeclLink(), clang::Redeclarable< decl_type >::RedeclLink, and clang::T.

Referenced by mergeRedeclarable().

◆ mergeTemplatePattern()

void ASTDeclMerger::mergeTemplatePattern ( RedeclarableTemplateDecl * D,
RedeclarableTemplateDecl * Existing,
bool IsKeyDecl )

Merge together the pattern declarations from two template declarations.

Definition at line 2923 of file ASTReaderDecl.cpp.

References clang::cast(), clang::TemplateDecl::getTemplatedDecl(), MergeDefinitionData(), mergeRedeclarable(), and clang::Result.

Referenced by mergeRedeclarableImpl().


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