clang API Documentation

Classes | Public Member Functions | Static Public Member Functions
clang::ASTDeclReader Class Reference
Inheritance diagram for clang::ASTDeclReader:
Inheritance graph
[legend]
Collaboration diagram for clang::ASTDeclReader:
Collaboration graph
[legend]

List of all members.

Classes

class  FindExistingResult
 Class used to capture the result of searching for an existing declaration of a specific kind and name, along with the ability to update the place where this result was found (the declaration chain hanging off an identifier or the DeclContext we searched in) if requested.
class  RedeclarableResult
 RAII class used to capture the first ID within a redeclaration chain and to introduce it into the list of pending redeclaration chains on destruction.

Public Member Functions

 ASTDeclReader (ASTReader &Reader, ModuleFile &F, DeclID thisDeclID, unsigned RawLocation, const RecordData &Record, unsigned &Idx)
bool hasPendingBody () const
 Determine whether this declaration has a pending body.
void Visit (Decl *D)
void UpdateDecl (Decl *D, ModuleFile &ModuleFile, const RecordData &Record)
void VisitDecl (Decl *D)
void VisitTranslationUnitDecl (TranslationUnitDecl *TU)
void VisitNamedDecl (NamedDecl *ND)
void VisitLabelDecl (LabelDecl *LD)
void VisitNamespaceDecl (NamespaceDecl *D)
void VisitUsingDirectiveDecl (UsingDirectiveDecl *D)
void VisitNamespaceAliasDecl (NamespaceAliasDecl *D)
void VisitTypeDecl (TypeDecl *TD)
RedeclarableResult VisitTypedefNameDecl (TypedefNameDecl *TD)
void VisitTypedefDecl (TypedefDecl *TD)
void VisitTypeAliasDecl (TypeAliasDecl *TD)
void VisitUnresolvedUsingTypenameDecl (UnresolvedUsingTypenameDecl *D)
RedeclarableResult VisitTagDecl (TagDecl *TD)
void VisitEnumDecl (EnumDecl *ED)
RedeclarableResult VisitRecordDeclImpl (RecordDecl *RD)
void VisitRecordDecl (RecordDecl *RD)
RedeclarableResult VisitCXXRecordDeclImpl (CXXRecordDecl *D)
void VisitCXXRecordDecl (CXXRecordDecl *D)
RedeclarableResult VisitClassTemplateSpecializationDeclImpl (ClassTemplateSpecializationDecl *D)
void VisitClassTemplateSpecializationDecl (ClassTemplateSpecializationDecl *D)
void VisitClassTemplatePartialSpecializationDecl (ClassTemplatePartialSpecializationDecl *D)
void VisitClassScopeFunctionSpecializationDecl (ClassScopeFunctionSpecializationDecl *D)
RedeclarableResult VisitVarTemplateSpecializationDeclImpl (VarTemplateSpecializationDecl *D)
void VisitVarTemplateSpecializationDecl (VarTemplateSpecializationDecl *D)
void VisitVarTemplatePartialSpecializationDecl (VarTemplatePartialSpecializationDecl *D)
void VisitTemplateTypeParmDecl (TemplateTypeParmDecl *D)
void VisitValueDecl (ValueDecl *VD)
void VisitEnumConstantDecl (EnumConstantDecl *ECD)
void VisitUnresolvedUsingValueDecl (UnresolvedUsingValueDecl *D)
void VisitDeclaratorDecl (DeclaratorDecl *DD)
void VisitFunctionDecl (FunctionDecl *FD)
void VisitCXXMethodDecl (CXXMethodDecl *D)
void VisitCXXConstructorDecl (CXXConstructorDecl *D)
void VisitCXXDestructorDecl (CXXDestructorDecl *D)
void VisitCXXConversionDecl (CXXConversionDecl *D)
void VisitFieldDecl (FieldDecl *FD)
void VisitMSPropertyDecl (MSPropertyDecl *FD)
void VisitIndirectFieldDecl (IndirectFieldDecl *FD)
RedeclarableResult VisitVarDeclImpl (VarDecl *D)
void VisitVarDecl (VarDecl *VD)
void VisitImplicitParamDecl (ImplicitParamDecl *PD)
void VisitParmVarDecl (ParmVarDecl *PD)
void VisitNonTypeTemplateParmDecl (NonTypeTemplateParmDecl *D)
DeclID VisitTemplateDecl (TemplateDecl *D)
RedeclarableResult VisitRedeclarableTemplateDecl (RedeclarableTemplateDecl *D)
void VisitClassTemplateDecl (ClassTemplateDecl *D)
void VisitVarTemplateDecl (VarTemplateDecl *D)
void VisitFunctionTemplateDecl (FunctionTemplateDecl *D)
void VisitTemplateTemplateParmDecl (TemplateTemplateParmDecl *D)
void VisitTypeAliasTemplateDecl (TypeAliasTemplateDecl *D)
void VisitUsingDecl (UsingDecl *D)
void VisitUsingShadowDecl (UsingShadowDecl *D)
void VisitLinkageSpecDecl (LinkageSpecDecl *D)
void VisitFileScopeAsmDecl (FileScopeAsmDecl *AD)
void VisitImportDecl (ImportDecl *D)
void VisitAccessSpecDecl (AccessSpecDecl *D)
void VisitFriendDecl (FriendDecl *D)
void VisitFriendTemplateDecl (FriendTemplateDecl *D)
void VisitStaticAssertDecl (StaticAssertDecl *D)
void VisitBlockDecl (BlockDecl *BD)
void VisitCapturedDecl (CapturedDecl *CD)
void VisitEmptyDecl (EmptyDecl *D)
std::pair< uint64_t, uint64_t > VisitDeclContext (DeclContext *DC)
template<typename T >
RedeclarableResult VisitRedeclarable (Redeclarable< T > *D)
template<typename T >
void mergeRedeclarable (Redeclarable< T > *D, RedeclarableResult &Redecl, DeclID TemplatePatternID=0)
 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, DeclID TemplatePatternID=0)
 Attempts to merge the given declaration (D) with another declaration of the same entity.
template<typename T >
void mergeMergeable (Mergeable< T > *D)
 Attempts to merge the given declaration (D) with another declaration of the same entity, for the case where the entity is not actually redeclarable. This happens, for instance, when merging the fields of identical class definitions from two different modules.
void mergeTemplatePattern (RedeclarableTemplateDecl *D, RedeclarableTemplateDecl *Existing, DeclID DsID)
 Merge together the pattern declarations from two template declarations.
void VisitObjCMethodDecl (ObjCMethodDecl *D)
void VisitObjCContainerDecl (ObjCContainerDecl *D)
void VisitObjCInterfaceDecl (ObjCInterfaceDecl *D)
void VisitObjCIvarDecl (ObjCIvarDecl *D)
void VisitObjCProtocolDecl (ObjCProtocolDecl *D)
void VisitObjCAtDefsFieldDecl (ObjCAtDefsFieldDecl *D)
void VisitObjCCategoryDecl (ObjCCategoryDecl *D)
void VisitObjCImplDecl (ObjCImplDecl *D)
void VisitObjCCategoryImplDecl (ObjCCategoryImplDecl *D)
void VisitObjCImplementationDecl (ObjCImplementationDecl *D)
void VisitObjCCompatibleAliasDecl (ObjCCompatibleAliasDecl *D)
void VisitObjCPropertyDecl (ObjCPropertyDecl *D)
void VisitObjCPropertyImplDecl (ObjCPropertyImplDecl *D)
void VisitOMPThreadPrivateDecl (OMPThreadPrivateDecl *D)
template<>
void attachPreviousDeclImpl (ASTReader &Reader, Redeclarable< FunctionDecl > *D, Decl *Previous)

Static Public Member Functions

template<typename DeclT >
static void attachPreviousDeclImpl (ASTReader &Reader, Redeclarable< DeclT > *D, Decl *Previous)
static void attachPreviousDeclImpl (ASTReader &Reader,...)
static void attachPreviousDecl (ASTReader &Reader, Decl *D, Decl *Previous)
template<typename DeclT >
static void attachLatestDeclImpl (Redeclarable< DeclT > *D, Decl *Latest)
static void attachLatestDeclImpl (...)
static void attachLatestDecl (Decl *D, Decl *latest)
template<typename DeclT >
static void markIncompleteDeclChainImpl (Redeclarable< DeclT > *D)
static void markIncompleteDeclChainImpl (...)
static void setNextObjCCategory (ObjCCategoryDecl *Cat, ObjCCategoryDecl *Next)

Detailed Description

Definition at line 37 of file ASTReaderDecl.cpp.


Constructor & Destructor Documentation

clang::ASTDeclReader::ASTDeclReader ( ASTReader Reader,
ModuleFile &  F,
DeclID  thisDeclID,
unsigned  RawLocation,
const RecordData &  Record,
unsigned Idx 
) [inline]

Definition at line 211 of file ASTReaderDecl.cpp.


Member Function Documentation

void ASTDeclReader::attachLatestDecl ( Decl D,
Decl latest 
) [static]

Definition at line 2830 of file ASTReaderDecl.cpp.

References clang::Decl::getKind().

template<typename DeclT >
void ASTDeclReader::attachLatestDeclImpl ( Redeclarable< DeclT > *  D,
Decl Latest 
) [static]

Definition at line 2823 of file ASTReaderDecl.cpp.

References clang::Redeclarable< decl_type >::RedeclLink.

void ASTDeclReader::attachLatestDeclImpl (   ...) [static]

Definition at line 2826 of file ASTReaderDecl.cpp.

void ASTDeclReader::attachPreviousDecl ( ASTReader Reader,
Decl D,
Decl Previous 
) [static]
template<typename DeclT >
void ASTDeclReader::attachPreviousDeclImpl ( ASTReader Reader,
Redeclarable< DeclT > *  D,
Decl Previous 
) [static]

Definition at line 2741 of file ASTReaderDecl.cpp.

References clang::Redeclarable< decl_type >::RedeclLink.

void ASTDeclReader::attachPreviousDeclImpl ( ASTReader Reader,
  ... 
) [static]

Definition at line 2790 of file ASTReaderDecl.cpp.

template<>
void clang::ASTDeclReader::attachPreviousDeclImpl ( ASTReader Reader,
Redeclarable< FunctionDecl > *  D,
Decl Previous 
)

Determine whether this declaration has a pending body.

Definition at line 234 of file ASTReaderDecl.cpp.

template<typename DeclT >
void ASTDeclReader::markIncompleteDeclChainImpl ( Redeclarable< DeclT > *  D) [static]

Definition at line 2844 of file ASTReaderDecl.cpp.

References clang::Redeclarable< decl_type >::RedeclLink.

Definition at line 2847 of file ASTReaderDecl.cpp.

template<typename T >
void ASTDeclReader::mergeMergeable ( Mergeable< T > *  D)

Attempts to merge the given declaration (D) with another declaration of the same entity, for the case where the entity is not actually redeclarable. This happens, for instance, when merging the fields of identical class definitions from two different modules.

Definition at line 2201 of file ASTReaderDecl.cpp.

template<typename T >
void ASTDeclReader::mergeRedeclarable ( Redeclarable< T > *  D,
RedeclarableResult &  Redecl,
DeclID  TemplatePatternID = 0 
)

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

Definition at line 2082 of file ASTReaderDecl.cpp.

References clang::CXXRecordDecl::getCanonicalDecl(), and clang::serialization::NUM_PREDEF_DECL_IDS.

template<typename T >
void ASTDeclReader::mergeRedeclarable ( Redeclarable< T > *  D,
T *  Existing,
RedeclarableResult &  Redecl,
DeclID  TemplatePatternID = 0 
)

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

Definition at line 2159 of file ASTReaderDecl.cpp.

References clang::CXXRecordDecl::getCanonicalDecl(), and clang::Redeclarable< decl_type >::RedeclLink.

Merge together the pattern declarations from two template declarations.

Definition at line 2117 of file ASTReaderDecl.cpp.

References clang::TemplateDecl::getTemplatedDecl().

static void clang::ASTDeclReader::setNextObjCCategory ( ObjCCategoryDecl Cat,
ObjCCategoryDecl Next 
) [inline, static]

Definition at line 241 of file ASTReaderDecl.cpp.

void ASTDeclReader::UpdateDecl ( Decl D,
ModuleFile &  ModuleFile,
const RecordData &  Record 
)

Definition at line 3511 of file ASTReaderDecl.cpp.

References clang::Decl::addAttr(), clang::ASTContext::adjustDeducedFunctionResultType(), clang::TemplateArgumentList::CreateCopy(), forAllLaterRedecls(), clang::ASTReader::getContext(), clang::ASTContext::getFunctionType(), clang::ClassTemplateSpecializationDecl::getSpecializedTemplateOrPartial(), clang::isUnresolvedExceptionSpec(), merged_redecls(), clang::serialization::MK_ExplicitModule, clang::serialization::MK_ImplicitModule, clang::ASTReader::ReadAttributes(), clang::ASTReader::ReadCXXCtorInitializers(), clang::ASTReader::ReadDecl(), clang::ASTReader::ReadDeclAs(), clang::ASTReader::ReadSourceLocation(), clang::ASTReader::ReadTemplateArgumentList(), clang::ASTReader::readType(), Record, clang::NamespaceDecl::setAnonymousNamespace(), clang::FunctionDecl::setImplicitlyInline(), clang::DeclaratorDecl::setInnerLocStart(), clang::ClassTemplateSpecializationDecl::setInstantiationOf(), clang::ASTContext::setManglingNumber(), clang::ClassTemplateSpecializationDecl::setPointOfInstantiation(), clang::ASTContext::setStaticLocalNumber(), clang::CXXRecordDecl::setTemplateSpecializationKind(), clang::serialization::UPD_CXX_ADDED_ANONYMOUS_NAMESPACE, clang::serialization::UPD_CXX_ADDED_FUNCTION_DEFINITION, clang::serialization::UPD_CXX_ADDED_IMPLICIT_MEMBER, clang::serialization::UPD_CXX_ADDED_TEMPLATE_SPECIALIZATION, clang::serialization::UPD_CXX_DEDUCED_RETURN_TYPE, clang::serialization::UPD_CXX_INSTANTIATED_CLASS_DEFINITION, clang::serialization::UPD_CXX_INSTANTIATED_STATIC_DATA_MEMBER, clang::serialization::UPD_CXX_RESOLVED_EXCEPTION_SPEC, clang::serialization::UPD_DECL_MARKED_OPENMP_THREADPRIVATE, clang::serialization::UPD_DECL_MARKED_USED, clang::serialization::UPD_MANGLING_NUMBER, and clang::serialization::UPD_STATIC_LOCAL_NUMBER.

void ASTDeclReader::Visit ( Decl D)

Definition at line 362 of file ASTReaderDecl.cpp.

References Record.

Definition at line 1607 of file ASTReaderDecl.cpp.

References clang::AccessSpecDecl::setColonLoc().

Definition at line 1868 of file ASTReaderDecl.cpp.

References Record.

Definition at line 1853 of file ASTReaderDecl.cpp.

Definition at line 266 of file ASTReaderDecl.cpp.

Definition at line 1592 of file ASTReaderDecl.cpp.

Definition at line 1586 of file ASTReaderDecl.cpp.

References Record.

Definition at line 263 of file ASTReaderDecl.cpp.

ASTDeclReader::RedeclarableResult ASTDeclReader::VisitCXXRecordDeclImpl ( CXXRecordDecl D)

Definition at line 606 of file ASTReaderDecl.cpp.

References Record, and clang::DeclaratorDecl::setInnerLocStart().

std::pair< uint64_t, uint64_t > ASTDeclReader::VisitDeclContext ( DeclContext DC)

Definition at line 2045 of file ASTReaderDecl.cpp.

Definition at line 2040 of file ASTReaderDecl.cpp.

Definition at line 999 of file ASTReaderDecl.cpp.

References clang::NamedDecl::getDeclName(), and Record.

Definition at line 1612 of file ASTReaderDecl.cpp.

References Record.

Definition at line 1625 of file ASTReaderDecl.cpp.

References Record.

Definition at line 1095 of file ASTReaderDecl.cpp.

Definition at line 1597 of file ASTReaderDecl.cpp.

Definition at line 1026 of file ASTReaderDecl.cpp.

References Record.

Definition at line 1179 of file ASTReaderDecl.cpp.

References Record, and clang::LabelDecl::setLocStart().

Definition at line 1020 of file ASTReaderDecl.cpp.

References Record.

Definition at line 1208 of file ASTReaderDecl.cpp.

References Record.

Definition at line 911 of file ASTReaderDecl.cpp.

Definition at line 970 of file ASTReaderDecl.cpp.

References Record, and clang::ObjCCategoryImplDecl::setIdentifier().

Definition at line 965 of file ASTReaderDecl.cpp.

References Record, and clang::ObjCImplDecl::setClassInterface().

Definition at line 2218 of file ASTReaderDecl.cpp.

References clang::OMPThreadPrivateDecl::varlist_size().

Definition at line 261 of file ASTReaderDecl.cpp.

ASTDeclReader::RedeclarableResult ASTDeclReader::VisitRecordDeclImpl ( RecordDecl RD)
template<typename T >
ASTDeclReader::RedeclarableResult ASTDeclReader::VisitRedeclarable ( Redeclarable< T > *  D)

Definition at line 2053 of file ASTReaderDecl.cpp.

References getKind(), and clang::Redeclarable< decl_type >::RedeclLink.

ASTDeclReader::RedeclarableResult ASTDeclReader::VisitRedeclarableTemplateDecl ( RedeclarableTemplateDecl D)

Definition at line 2032 of file ASTReaderDecl.cpp.

ASTDeclReader::RedeclarableResult ASTDeclReader::VisitTagDecl ( TagDecl TD)

Definition at line 1639 of file ASTReaderDecl.cpp.

References clang::TemplateDecl::init().

Definition at line 466 of file ASTReaderDecl.cpp.

Definition at line 502 of file ASTReaderDecl.cpp.

References Record, and clang::TypeAliasDecl::setDescribedAliasTemplate().

Definition at line 2028 of file ASTReaderDecl.cpp.

Definition at line 477 of file ASTReaderDecl.cpp.

References Record, and clang::TypeDecl::setLocStart().

Definition at line 497 of file ASTReaderDecl.cpp.

ASTDeclReader::RedeclarableResult ASTDeclReader::VisitTypedefNameDecl ( TypedefNameDecl TD)

Definition at line 1258 of file ASTReaderDecl.cpp.

References Record.

Definition at line 1241 of file ASTReaderDecl.cpp.

References Record.

Definition at line 1230 of file ASTReaderDecl.cpp.

References Record, and clang::UsingShadowDecl::setTargetDecl().

Definition at line 593 of file ASTReaderDecl.cpp.

References Record, and clang::ValueDecl::setType().

Definition at line 295 of file ASTReaderDecl.cpp.

ASTDeclReader::RedeclarableResult ASTDeclReader::VisitVarDeclImpl ( VarDecl D)

TODO: Unify with ClassTemplateDecl version? May require unifying ClassTemplateDecl and VarTemplateDecl beyond TemplateDecl...

Definition at line 1738 of file ASTReaderDecl.cpp.

References clang::VarTemplateDecl::getCommonPtr(), and clang::VarTemplateDecl::Common::LazySpecializations.

TODO: Unify with ClassTemplatePartialSpecializationDecl version? May require unifying ClassTemplate(Partial)SpecializationDecl and VarTemplate(Partial)SpecializationDecl with a new data structure Template(Partial)SpecializationDecl, and using Template(Partial)SpecializationDecl as input type.

Definition at line 1962 of file ASTReaderDecl.cpp.

Definition at line 276 of file ASTReaderDecl.cpp.

TODO: Unify with ClassTemplateSpecializationDecl version? May require unifying ClassTemplate(Partial)SpecializationDecl and VarTemplate(Partial)SpecializationDecl with a new data structure Template(Partial)SpecializationDecl, and using Template(Partial)SpecializationDecl as input type.

Definition at line 1900 of file ASTReaderDecl.cpp.

References AttributeLangSupport::C, clang::TemplateArgumentList::CreateCopy(), clang::VarTemplateDecl::getCommonPtr(), clang::Decl::isCanonicalDecl(), clang::VarTemplateDecl::Common::PartialSpecializations, Record, and clang::VarTemplateDecl::Common::Specializations.


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