clang 20.0.0git
|
Provides common interface for the Decls that can be redeclared. More...
#include "clang/AST/Redeclarable.h"
Classes | |
class | DeclLink |
class | redecl_iterator |
Iterates through all the redeclarations of the same decl. More... | |
Public Types | |
using | redecl_range = llvm::iterator_range< redecl_iterator > |
Public Member Functions | |
Redeclarable (const ASTContext &Ctx) | |
decl_type * | getPreviousDecl () |
Return the previous declaration of this declaration or NULL if this is the first declaration. | |
const decl_type * | getPreviousDecl () const |
decl_type * | getFirstDecl () |
Return the first declaration of this declaration or itself if this is the only declaration. | |
const decl_type * | getFirstDecl () const |
Return the first declaration of this declaration or itself if this is the only declaration. | |
bool | isFirstDecl () const |
True if this is the first declaration in its redeclaration chain. | |
decl_type * | getMostRecentDecl () |
Returns the most recent (re)declaration of this declaration. | |
const decl_type * | getMostRecentDecl () const |
Returns the most recent (re)declaration of this declaration. | |
void | setPreviousDecl (decl_type *PrevDecl) |
Set the previous declaration. | |
redecl_range | redecls () const |
Returns an iterator range for all the redeclarations of the same decl. | |
redecl_iterator | redecls_begin () const |
redecl_iterator | redecls_end () const |
Protected Member Functions | |
decl_type * | getNextRedeclaration () const |
Static Protected Member Functions | |
static DeclLink | PreviousDeclLink (decl_type *D) |
static DeclLink | LatestDeclLink (const ASTContext &Ctx) |
Protected Attributes | |
DeclLink | RedeclLink |
Points to the next redeclaration in the chain. | |
decl_type * | First |
Friends | |
class | ASTDeclMerger |
class | ASTDeclReader |
class | ASTDeclWriter |
class | IncrementalParser |
Provides common interface for the Decls that can be redeclared.
Definition at line 84 of file Redeclarable.h.
using clang::Redeclarable< decl_type >::redecl_range = llvm::iterator_range<redecl_iterator> |
Definition at line 293 of file Redeclarable.h.
|
inline |
Definition at line 199 of file Redeclarable.h.
|
inline |
Return the first declaration of this declaration or itself if this is the only declaration.
Definition at line 217 of file Redeclarable.h.
References clang::Redeclarable< decl_type >::First.
Referenced by clang::ASTContext::addCopyConstructorForExceptionObject(), clang::Sema::BuildVarTemplateInstantiation(), DiagnoseNamespaceInlineMismatch(), clang::Sema::FinalizeDeclaration(), clang::ASTContext::getCanonicalNestedNameSpecifier(), clang::ASTContext::getCopyConstructorForExceptionObject(), clang::ASTContext::getInlineVariableDefinitionKind(), clang::Redeclarable< decl_type >::getMostRecentDecl(), clang::Sema::InstantiateVariableDefinition(), clang::Sema::InstantiateVariableInitializer(), clang::SemaCUDA::isEmptyConstructor(), clang::SemaCUDA::isEmptyDestructor(), clang::ASTContext::isMSStaticDataMemberInlineDefinition(), clang::Sema::MaybeSuggestAddingStaticToDecl(), clang::Sema::MergeFunctionDecl(), mergeParamDeclAttributes(), clang::ASTContext::setNonKeyFunction(), and clang::JSONNodeDumper::VisitNamespaceDecl().
|
inline |
Return the first declaration of this declaration or itself if this is the only declaration.
Definition at line 221 of file Redeclarable.h.
References clang::Redeclarable< decl_type >::First.
|
inline |
Returns the most recent (re)declaration of this declaration.
Definition at line 227 of file Redeclarable.h.
References clang::Redeclarable< decl_type >::getFirstDecl().
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::ASTContext::adjustDeducedFunctionResultType(), clang::CodeGen::CGOpenMPRuntime::emitDeclareSimdFunction(), clang::SemaOpenMP::finalizeOpenMPDelayedAnalysis(), clang::ASTContext::forEachMultiversionedFunctionVersion(), clang::CodeGen::CGCXXABI::isEmittedWithConstantInitializer(), clang::Sema::MergeCompatibleFunctionDecls(), clang::Sema::MergeCXXFunctionDecl(), clang::Sema::MergeVarDecl(), clang::Sema::MergeVarDeclTypes(), clang::Sema::PerformPendingInstantiations(), ShouldRemoveFromUnused(), clang::ASTNodeImporter::VisitFunctionDecl(), clang::ASTNodeImporter::VisitFunctionTemplateDecl(), clang::ASTNodeImporter::VisitVarDecl(), and clang::ASTNodeImporter::VisitVarTemplateDecl().
|
inline |
Returns the most recent (re)declaration of this declaration.
Definition at line 232 of file Redeclarable.h.
References clang::Redeclarable< decl_type >::getFirstDecl().
|
inlineprotected |
Definition at line 189 of file Redeclarable.h.
References clang::Redeclarable< decl_type >::DeclLink::getPrevious(), and clang::Redeclarable< decl_type >::RedeclLink.
Referenced by clang::Redeclarable< decl_type >::getPreviousDecl().
|
inline |
Return the previous declaration of this declaration or NULL if this is the first declaration.
Definition at line 205 of file Redeclarable.h.
References clang::Redeclarable< decl_type >::getNextRedeclaration(), clang::Redeclarable< decl_type >::DeclLink::isFirst(), and clang::Redeclarable< decl_type >::RedeclLink.
Referenced by clang::Sema::ActOnFunctionDeclarator(), clang::SemaOpenMP::ActOnOpenMPCall(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::ActOnVarTemplateSpecialization(), clang::ASTContext::adjustDeducedFunctionResultType(), clang::ASTDeclReader::attachPreviousDeclImpl(), clang::Sema::BuildVariableInstantiation(), clang::Sema::CheckCompleteVariableDeclaration(), clang::Sema::DeduceVariableDeclarationType(), clang::FunctionDecl::doesDeclarationForceExternallyVisibleDefinition(), clang::CodeGen::CGOpenMPRuntime::emitDeclareSimdFunction(), FindPossiblePrototype(), clang::RedeclarableTemplateDecl::getCommonPtr(), clang::FunctionDecl::isMSExternInline(), clang::Sema::MergeCXXFunctionDecl(), clang::Sema::MergeVarDeclTypes(), OnlyHasInlineBuiltinDeclaration(), PreviousDeclsHaveMultiVersionAttribute(), redeclForcesDefMSVC(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), clang::ASTNodeImporter::VisitFunctionTemplateDecl(), and clang::ASTNodeImporter::VisitVarTemplateDecl().
|
inline |
Definition at line 210 of file Redeclarable.h.
|
inline |
True if this is the first declaration in its redeclaration chain.
Definition at line 224 of file Redeclarable.h.
References clang::Redeclarable< decl_type >::DeclLink::isFirst(), and clang::Redeclarable< decl_type >::RedeclLink.
Referenced by clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnVariableDeclarator(), clang::ASTDeclReader::mergeRedeclarable(), and clang::JSONNodeDumper::VisitNamespaceDecl().
|
inlinestaticprotected |
Definition at line 170 of file Redeclarable.h.
References clang::Redeclarable< decl_type >::DeclLink::LatestLink.
|
inlinestaticprotected |
Definition at line 166 of file Redeclarable.h.
References D, and clang::Redeclarable< decl_type >::DeclLink::PreviousLink.
Referenced by clang::ASTDeclMerger::mergeRedeclarableImpl(), and clang::ASTDeclReader::VisitRedeclarable().
|
inline |
Returns an iterator range for all the redeclarations of the same decl.
It will iterate at least once (when this decl is the only one).
Definition at line 297 of file Redeclarable.h.
Referenced by CheckDeclarationCausesMultiVersioning(), clang::checkUnsafeBufferUsage(), createOverloadsForFixedParams(), clang::VarDecl::getDefinition(), clang::ASTContext::getInlineVariableDefinitionKind(), clang::VarDecl::hasDefinition(), clang::Sema::inferNullableClassAttribute(), clang::Sema::InheritedConstructorInfo::InheritedConstructorInfo(), clang::Sema::MergeFunctionDecl(), clang::Redeclarable< decl_type >::redecls_begin(), clang::Redeclarable< decl_type >::redecls_end(), clang::CodeGen::CodeGenModule::SetLLVMFunctionAttributesForDefinition(), and clang::Sema::UpdateExceptionSpec().
|
inline |
Definition at line 303 of file Redeclarable.h.
References clang::Redeclarable< decl_type >::redecls().
|
inline |
Definition at line 304 of file Redeclarable.h.
References clang::Redeclarable< decl_type >::redecls().
Referenced by clang::Sema::MergeFunctionDecl().
void clang::Redeclarable< decl_type >::setPreviousDecl | ( | decl_type * | PrevDecl | ) |
Set the previous declaration.
If PrevDecl is NULL, set this as the first and only declaration.
Definition at line 4978 of file Decl.h.
References clang::First, clang::Decl::IDNS_Ordinary, clang::Decl::IDNS_Tag, and clang::Decl::IDNS_Type.
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::ASTContext::addTranslationUnitDecl(), clang::Sema::BuildUsingShadowDecl(), clang::Sema::CheckClassTemplate(), clang::TemplateDeclInstantiator::InstantiateTypeAliasTemplateDecl(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), clang::Sema::MergeTypedefNameDecl(), clang::Sema::MergeVarDecl(), clang::ASTNodeImporter::VisitClassTemplateDecl(), clang::ASTNodeImporter::VisitFunctionDecl(), clang::ASTNodeImporter::VisitFunctionTemplateDecl(), clang::ASTNodeImporter::VisitVarDecl(), clang::ASTNodeImporter::VisitVarTemplateDecl(), and clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl().
|
friend |
Definition at line 194 of file Redeclarable.h.
|
friend |
Definition at line 195 of file Redeclarable.h.
|
friend |
Definition at line 196 of file Redeclarable.h.
|
friend |
Definition at line 197 of file Redeclarable.h.
|
protected |
Definition at line 187 of file Redeclarable.h.
Referenced by clang::Redeclarable< decl_type >::getFirstDecl().
|
protected |
Points to the next redeclaration in the chain.
If isFirst() is false, this is a link to the previous declaration of this same Decl. If isFirst() is true, this is the first declaration and Link points to the latest declaration. For example:
#1 int f(int x, int y = 1); // <pointer to #3, true> #2 int f(int x = 0, int y); // <pointer to #1, false> #3 int f(int x, int y) { return x + y; } // <pointer to #2, false>
If there is only one declaration, it is <pointer to self, true>
Definition at line 185 of file Redeclarable.h.
Referenced by clang::Redeclarable< decl_type >::getNextRedeclaration(), clang::Redeclarable< decl_type >::getPreviousDecl(), and clang::Redeclarable< decl_type >::isFirstDecl().