clang 24.0.0git
clang::ASTDeclUnmerger Class Reference

Removes decls introduced in the discarding PTU and restores the redeclaration chain to previous state. More...

Inheritance diagram for clang::ASTDeclUnmerger:
[legend]

Public Member Functions

 ASTDeclUnmerger (Sema &S, TranslationUnitDecl *DiscardedTU)
void VisitDecl (Decl *D)
void VisitNamedDecl (NamedDecl *ND)
 Remove ND from its context and the lookup tables, and make the declaration it redeclares visible again.
template<typename DeclT>
NamedDecl * VisitRedeclarable (Redeclarable< DeclT > *DBase)
 Remove D like VisitNamedDecl() and restore its redeclaration chain to the previous state.
void VisitFunctionDecl (FunctionDecl *D)
void VisitNamespaceAliasDecl (NamespaceAliasDecl *D)
void VisitTypedefNameDecl (TypedefNameDecl *D)
void VisitUsingShadowDecl (UsingShadowDecl *D)
void VisitVarDecl (VarDecl *D)
void VisitTagDecl (TagDecl *D)
void VisitRedeclarableTemplateDecl (RedeclarableTemplateDecl *D)
void VisitNamespaceDecl (NamespaceDecl *D)
void VisitTranslationUnitDecl (TranslationUnitDecl *D)
Public Member Functions inherited from clang::declvisitor::Base< std::add_pointer, ASTDeclUnmerger, void >
void Visit (PTR(Decl) D)
void VisitDecl (PTR(Decl) D)

Detailed Description

Removes decls introduced in the discarding PTU and restores the redeclaration chain to previous state.

Definition at line 199 of file IncrementalParser.cpp.

Constructor & Destructor Documentation

◆ ASTDeclUnmerger()

clang::ASTDeclUnmerger::ASTDeclUnmerger ( Sema & S,
TranslationUnitDecl * DiscardedTU )
inline

Definition at line 264 of file IncrementalParser.cpp.

Member Function Documentation

◆ VisitDecl()

void clang::ASTDeclUnmerger::VisitDecl ( Decl * D)
inline

Definition at line 267 of file IncrementalParser.cpp.

◆ VisitFunctionDecl()

void clang::ASTDeclUnmerger::VisitFunctionDecl ( FunctionDecl * D)
inline

Definition at line 304 of file IncrementalParser.cpp.

References VisitRedeclarable().

◆ VisitNamedDecl()

void clang::ASTDeclUnmerger::VisitNamedDecl ( NamedDecl * ND)
inline

Remove ND from its context and the lookup tables, and make the declaration it redeclares visible again.

Called by VisitRedeclarable() before it restores the redeclaration chain, which hides that declaration.

Definition at line 275 of file IncrementalParser.cpp.

References clang::DeclContext::containsDecl(), clang::Decl::getDeclContext(), clang::Decl::getLexicalDeclContext(), clang::DeclContext::makeDeclVisibleInContext(), and clang::DeclContext::removeDecl().

Referenced by VisitRedeclarable().

◆ VisitNamespaceAliasDecl()

void clang::ASTDeclUnmerger::VisitNamespaceAliasDecl ( NamespaceAliasDecl * D)
inline

Definition at line 305 of file IncrementalParser.cpp.

References VisitRedeclarable().

◆ VisitNamespaceDecl()

void clang::ASTDeclUnmerger::VisitNamespaceDecl ( NamespaceDecl * D)
inline

Definition at line 335 of file IncrementalParser.cpp.

References VisitRedeclarable().

◆ VisitRedeclarable()

template<typename DeclT>
NamedDecl * clang::ASTDeclUnmerger::VisitRedeclarable ( Redeclarable< DeclT > * DBase)
inline

Remove D like VisitNamedDecl() and restore its redeclaration chain to the previous state.

Returns the surviving previous declaration, if any. DeclVisitor doesn't dispatch to it: Redeclarable is not a Decl class.

Definition at line 295 of file IncrementalParser.cpp.

References VisitNamedDecl().

Referenced by VisitFunctionDecl(), VisitNamespaceAliasDecl(), VisitNamespaceDecl(), VisitRedeclarableTemplateDecl(), VisitTagDecl(), VisitTypedefNameDecl(), VisitUsingShadowDecl(), and VisitVarDecl().

◆ VisitRedeclarableTemplateDecl()

void clang::ASTDeclUnmerger::VisitRedeclarableTemplateDecl ( RedeclarableTemplateDecl * D)
inline

◆ VisitTagDecl()

◆ VisitTranslationUnitDecl()

void clang::ASTDeclUnmerger::VisitTranslationUnitDecl ( TranslationUnitDecl * D)
inline

Definition at line 344 of file IncrementalParser.cpp.

◆ VisitTypedefNameDecl()

void clang::ASTDeclUnmerger::VisitTypedefNameDecl ( TypedefNameDecl * D)
inline

Definition at line 306 of file IncrementalParser.cpp.

References VisitRedeclarable().

◆ VisitUsingShadowDecl()

void clang::ASTDeclUnmerger::VisitUsingShadowDecl ( UsingShadowDecl * D)
inline

Definition at line 307 of file IncrementalParser.cpp.

References VisitRedeclarable().

◆ VisitVarDecl()

void clang::ASTDeclUnmerger::VisitVarDecl ( VarDecl * D)
inline

Definition at line 308 of file IncrementalParser.cpp.

References VisitRedeclarable().


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