clang API Documentation
Provides common interface for the Decls that can be redeclared. More...
#include <Redeclarable.h>
Classes | |
class | DeclLink |
class | redecl_iterator |
Iterates through all the redeclarations of the same decl. More... | |
Public Types | |
typedef llvm::iterator_range < redecl_iterator > | redecl_range |
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. If PrevDecl is NULL, set this as the first and only declaration. | |
redecl_range | redecls () const |
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). | |
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. | |
Friends | |
class | ASTDeclReader |
class | ASTDeclWriter |
Provides common interface for the Decls that can be redeclared.
Definition at line 26 of file Redeclarable.h.
typedef llvm::iterator_range<redecl_iterator> clang::Redeclarable< decl_type >::redecl_range |
Reimplemented in clang::UsingShadowDecl, clang::TagDecl, clang::NamespaceAliasDecl, clang::TypedefNameDecl, clang::ObjCProtocolDecl, clang::FunctionDecl, clang::ObjCInterfaceDecl, clang::VarDecl, clang::RedeclarableTemplateDecl, and clang::NamespaceDecl.
Definition at line 226 of file Redeclarable.h.
clang::Redeclarable< decl_type >::Redeclarable | ( | const ASTContext & | Ctx | ) | [inline] |
Definition at line 123 of file Redeclarable.h.
decl_type* clang::Redeclarable< decl_type >::getFirstDecl | ( | ) | [inline] |
Return the first declaration of this declaration or itself if this is the only declaration.
Definition at line 140 of file Redeclarable.h.
Referenced by clang::Sema::BuildVarTemplateInstantiation(), clang::Sema::CheckFunctionDeclaration(), clang::Sema::FinalizeDeclaration(), clang::Redeclarable< VarDecl >::getMostRecentDecl(), clang::ASTContext::isMSStaticDataMemberInlineDefinition(), clang::Sema::MarkUnusedFileScopedDecl(), clang::Sema::MaybeSuggestAddingStaticToDecl(), clang::Sema::MergeFunctionDecl(), clang::ASTContext::setNonKeyFunction(), clang::Redeclarable< decl_type >::setPreviousDecl(), clang::ASTDeclWriter::VisitCXXMethodDecl(), clang::ASTDeclWriter::VisitEnumDecl(), clang::ASTDeclReader::VisitNamespaceDecl(), clang::ASTDeclWriter::VisitRecordDecl(), clang::ASTDeclWriter::VisitRedeclarable(), clang::ASTDeclWriter::VisitTypedefDecl(), and clang::ASTDeclWriter::VisitVarDecl().
const decl_type* clang::Redeclarable< decl_type >::getFirstDecl | ( | ) | const [inline] |
Return the first declaration of this declaration or itself if this is the only declaration.
Definition at line 149 of file Redeclarable.h.
decl_type* clang::Redeclarable< decl_type >::getMostRecentDecl | ( | ) | [inline] |
Returns the most recent (re)declaration of this declaration.
Reimplemented in clang::RecordDecl, clang::EnumDecl, clang::VarTemplatePartialSpecializationDecl, clang::VarTemplateSpecializationDecl, clang::ClassTemplateDecl, clang::CXXMethodDecl, clang::ClassTemplatePartialSpecializationDecl, clang::ClassTemplateSpecializationDecl, and clang::CXXRecordDecl.
Definition at line 160 of file Redeclarable.h.
Referenced by clang::ASTContext::adjustDeducedFunctionResultType(), basicGVALinkageForFunction(), clang::RedeclarableTemplateDecl::SpecEntryTraits< FunctionTemplateSpecializationInfo >::getMostRecentDecl(), clang::Sema::InstantiateFunctionDefinition(), clang::Sema::MarkFunctionReferenced(), clang::Sema::MergeCompatibleFunctionDecls(), clang::Sema::MergeVarDecl(), clang::Sema::PerformPendingInstantiations(), ShouldRemoveFromUnused(), clang::ASTDeclWriter::VisitTypedefDecl(), and clang::ASTDeclWriter::VisitVarDecl().
const decl_type* clang::Redeclarable< decl_type >::getMostRecentDecl | ( | ) | const [inline] |
Returns the most recent (re)declaration of this declaration.
Reimplemented in clang::RecordDecl, clang::EnumDecl, clang::ClassTemplateDecl, clang::CXXMethodDecl, and clang::CXXRecordDecl.
Definition at line 165 of file Redeclarable.h.
decl_type* clang::Redeclarable< decl_type >::getNextRedeclaration | ( | ) | const [inline, protected] |
Definition at line 118 of file Redeclarable.h.
Referenced by clang::Redeclarable< VarDecl >::getPreviousDecl().
decl_type* clang::Redeclarable< decl_type >::getPreviousDecl | ( | ) | [inline] |
Return the previous declaration of this declaration or NULL if this is the first declaration.
Reimplemented in clang::RecordDecl, clang::EnumDecl, clang::VarTemplateDecl, clang::TypeAliasTemplateDecl, clang::ClassTemplateDecl, clang::FunctionTemplateDecl, and clang::CXXRecordDecl.
Definition at line 128 of file Redeclarable.h.
Referenced by clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnFinishFunctionBody(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::ActOnVarTemplateSpecialization(), clang::Sema::AddInitializerToDecl(), clang::ASTContext::adjustDeducedFunctionResultType(), clang::Sema::BuildVariableInstantiation(), clang::Sema::CheckCompleteVariableDeclaration(), clang::FunctionDecl::doesDeclarationForceExternallyVisibleDefinition(), dumpPreviousDeclImpl(), clang::RedeclarableTemplateDecl::getCommonPtr(), clang::Redeclarable< VarDecl >::getFirstDecl(), getLVForLocalDecl(), getLVForNamespaceScopeDecl(), clang::Redeclarable< VarDecl >::getPreviousDecl(), clang::ADLResult::insert(), clang::FunctionDecl::isMSExternInline(), clang::Sema::MarkFunctionReferenced(), clang::Sema::MergeCXXFunctionDecl(), redeclForcesDefMSVC(), clang::Sema::SetDeclDeleted(), ShouldWarnAboutMissingPrototype(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), clang::ASTDeclWriter::VisitParmVarDecl(), clang::ASTDeclWriter::VisitRedeclarable(), and clang::ASTDeclWriter::VisitVarTemplatePartialSpecializationDecl().
const decl_type* clang::Redeclarable< decl_type >::getPreviousDecl | ( | ) | const [inline] |
Reimplemented in clang::RecordDecl, clang::EnumDecl, clang::VarTemplateDecl, clang::TypeAliasTemplateDecl, clang::ClassTemplateDecl, clang::FunctionTemplateDecl, and clang::CXXRecordDecl.
Definition at line 133 of file Redeclarable.h.
bool clang::Redeclarable< decl_type >::isFirstDecl | ( | ) | const [inline] |
True if this is the first declaration in its redeclaration chain.
Definition at line 157 of file Redeclarable.h.
Referenced by clang::Sema::ActOnFinishFunctionBody(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnVariableDeclarator(), clang::ASTDeclWriter::VisitClassTemplateDecl(), clang::ASTDeclWriter::VisitFunctionTemplateDecl(), clang::ASTDeclWriter::VisitRedeclarableTemplateDecl(), and clang::ASTDeclWriter::VisitVarTemplateDecl().
static DeclLink clang::Redeclarable< decl_type >::LatestDeclLink | ( | const ASTContext & | Ctx | ) | [inline, static, protected] |
Definition at line 101 of file Redeclarable.h.
static DeclLink clang::Redeclarable< decl_type >::PreviousDeclLink | ( | decl_type * | D | ) | [inline, static, protected] |
Definition at line 97 of file Redeclarable.h.
redecl_range clang::Redeclarable< decl_type >::redecls | ( | ) | const [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 230 of file Redeclarable.h.
Referenced by clang::Sema::DefineUsedVTables(), clang::VarDecl::getActingDefinition(), clang::VarDecl::getDefinition(), getInterestingTagDecl(), hasAnyExplicitStorageClass(), clang::VarDecl::hasDefinition(), clang::Sema::isAcceptableTagRedeclaration(), clang::Sema::MarkFunctionReferenced(), clang::Redeclarable< VarDecl >::redecls_begin(), clang::Redeclarable< VarDecl >::redecls_end(), clang::CodeGen::CodeGenFunction::StartFunction(), clang::Sema::UpdateExceptionSpec(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
redecl_iterator clang::Redeclarable< decl_type >::redecls_begin | ( | ) | const [inline] |
Definition at line 236 of file Redeclarable.h.
redecl_iterator clang::Redeclarable< decl_type >::redecls_end | ( | ) | const [inline] |
Definition at line 237 of file Redeclarable.h.
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 3684 of file Decl.h.
References clang::Redeclarable< decl_type >::getFirstDecl(), clang::Decl::IDNS_Ordinary, clang::Decl::IDNS_Tag, and clang::Decl::IDNS_Type.
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::Sema::ActOnNamespaceAliasDef(), clang::Sema::BuildUsingShadowDecl(), clang::ClassTemplateDecl::Create(), clang::Sema::MergeTypedefNameDecl(), and clang::Sema::MergeVarDecl().
friend class ASTDeclReader [friend] |
Reimplemented in clang::EnumDecl, clang::TagDecl, clang::UsingShadowDecl, clang::VarTemplateDecl, clang::NamespaceAliasDecl, clang::VarTemplatePartialSpecializationDecl, clang::VarTemplateSpecializationDecl, clang::CXXConversionDecl, clang::CXXDestructorDecl, clang::CXXConstructorDecl, clang::TypeAliasTemplateDecl, clang::FunctionDecl, clang::ClassTemplateDecl, clang::ClassTemplatePartialSpecializationDecl, clang::CXXRecordDecl, clang::ObjCProtocolDecl, clang::ClassTemplateSpecializationDecl, clang::ObjCInterfaceDecl, clang::FunctionTemplateDecl, clang::VarDecl, clang::RedeclarableTemplateDecl, and clang::NamespaceDecl.
Definition at line 239 of file Redeclarable.h.
friend class ASTDeclWriter [friend] |
Reimplemented in clang::TagDecl, clang::UsingShadowDecl, clang::VarTemplateDecl, clang::VarTemplatePartialSpecializationDecl, clang::VarTemplateSpecializationDecl, clang::CXXConversionDecl, clang::CXXDestructorDecl, clang::CXXConstructorDecl, clang::TypeAliasTemplateDecl, clang::FunctionDecl, clang::ClassTemplateDecl, clang::ClassTemplatePartialSpecializationDecl, clang::CXXRecordDecl, clang::ObjCProtocolDecl, clang::ClassTemplateSpecializationDecl, clang::ObjCInterfaceDecl, clang::FunctionTemplateDecl, clang::RedeclarableTemplateDecl, and clang::NamespaceDecl.
Definition at line 240 of file Redeclarable.h.
DeclLink clang::Redeclarable< decl_type >::RedeclLink [protected] |
Points to the next redeclaration in the chain.
If NextIsPrevious() is true, this is a link to the previous declaration of this same Decl. If NextIsLatest() 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 116 of file Redeclarable.h.
Referenced by clang::ASTDeclReader::attachLatestDeclImpl(), clang::ASTDeclReader::attachPreviousDeclImpl(), clang::Redeclarable< VarDecl >::getNextRedeclaration(), clang::Redeclarable< VarDecl >::getPreviousDecl(), clang::Redeclarable< VarDecl >::isFirstDecl(), clang::ASTDeclReader::markIncompleteDeclChainImpl(), clang::ASTDeclReader::mergeRedeclarable(), and clang::ASTDeclReader::VisitRedeclarable().