Home | History | Annotate | Download | only in Serialization

Lines Matching defs:DECL

1 //===- ASTReaderDecl.cpp - Decl Deserialization ---------------------------===//
10 // entrypoint for loading a decl.
19 #include "clang/AST/Decl.h"
96 ///A flag to carry the information for a decl from the entity is
97 /// used. We use it to delay the marking of the canonical decl as used until
139 Decl *readDecl() {
181 Decl *MergeWith;
186 RedeclarableResult(Decl *MergeWith, GlobalDeclID FirstID, bool IsKeyDecl)
197 Decl *getKnownMergeTarget() const { return MergeWith; }
280 static Decl *getMostRecentDeclImpl(Redeclarable<DeclT> *D);
281 static Decl *getMostRecentDeclImpl(...);
282 static Decl *getMostRecentDecl(Decl *D);
284 static void mergeInheritableAttributes(ASTReader &Reader, Decl *D,
285 Decl *Previous);
289 Redeclarable<DeclT> *D, Decl *Previous,
290 Decl *Canon);
292 static void attachPreviousDecl(ASTReader &Reader, Decl *D, Decl *Previous,
293 Decl *Canon);
296 static void attachLatestDeclImpl(Redeclarable<DeclT> *D, Decl *Latest);
298 static void attachLatestDecl(Decl *D, Decl *latest);
308 void Visit(Decl *D);
310 void UpdateDecl(Decl *D, SmallVectorImpl<serialization::DeclID> &);
317 void VisitDecl(Decl *D);
525 void ASTDeclReader::Visit(Decl *D) {
528 // At this point we have deserialized and merged the decl and it is safe to
529 // update its canonical decl to signal that the entire entity is used.
560 void ASTDeclReader::VisitDecl(Decl *D) {
584 // Decl::getASTContext() internally which is unsafe during derialization.
593 // Avoid calling setAttrs() directly because it uses Decl::getASTContext()
611 ModulePrivate ? Decl::ModuleOwnershipKind::ModulePrivate
612 : Decl::ModuleOwnershipKind::VisibleWhenImported);
629 D->setModuleOwnershipKind(Decl::ModuleOwnershipKind::ModulePrivate);
669 // Delay type reading until after we have fully initialized the decl.
684 // linkage, if it exists. We cannot rely on our type to pull in this decl,
980 // We avoid getASTContext because a decl in the parent hierarchy may
1059 MD->setObjCDeclQualifier((Decl::ObjCDeclQualifier)Record.readInt());
1559 auto *decl = readDeclAs<VarDecl>();
1565 captures.push_back(BlockDecl::Capture(decl, byRef, nested, copyExpr));
1866 // Set decl definition data before reading it, so that during deserialization
2159 if (Decl *InstD = readDecl()) {
2274 if (Decl *InstD = readDecl()) {
2451 Decl *MergeWith = nullptr;
2497 // Note that we need to load local redeclarations of this decl and build a
2498 // decl chain for them. This must happen *after* we perform the preloading
2816 inline void ASTReader::LoadedDecl(unsigned Index, Decl *D) {
2817 assert(!DeclsLoaded[Index] && "Decl loaded twice?");
2827 static bool isConsumerInterestedIn(ASTContext &Ctx, Decl *D, bool HasBody) {
3064 if (!declaresSameEntity(cast<Decl>(X->getDeclContext()->getRedeclContext()),
3065 cast<Decl>(Y->getDeclContext()->getRedeclContext())))
3367 for (auto *D : merged_redecls(cast<Decl>(LexicalDC))) {
3385 auto *CanonDC = cast<Decl>(DC)->getCanonicalDecl();
3395 if (PrimaryDC && !cast<Decl>(PrimaryDC)->isFromASTFile()) {
3410 auto *CanonDC = cast<Decl>(DC)->getCanonicalDecl();
3499 // check that the canonical definition of that context contains the decl.
3513 Decl *ASTDeclReader::getMostRecentDeclImpl(Redeclarable<DeclT> *D) {
3517 Decl *ASTDeclReader::getMostRecentDeclImpl(...) {
3521 Decl *ASTDeclReader::getMostRecentDecl(Decl *D) {
3526 #define DECL(TYPE, BASE) \
3527 case Decl::TYPE: \
3528 return getMostRecentDeclImpl(cast<TYPE##Decl>(D));
3531 llvm_unreachable("unknown decl kind");
3534 Decl *ASTReader::getMostRecentExistingDecl(Decl *D) {
3538 void ASTDeclReader::mergeInheritableAttributes(ASTReader &Reader, Decl *D,
3539 Decl *Previous) {
3554 Decl *Previous, Decl *Canon) {
3564 Decl *Previous, Decl *Canon) {
3592 Decl *Previous, Decl *Canon) {
3653 Decl *ToD) {
3682 void ASTDeclReader::attachPreviousDecl(ASTReader &Reader, Decl *D,
3683 Decl *Previous, Decl *Canon) {
3688 #define DECL(TYPE, BASE) \
3689 case Decl::TYPE: \
3690 attachPreviousDeclImpl(Reader, cast<TYPE##Decl>(D), Previous, Canon); \
3702 (Decl::IDNS_Ordinary | Decl::IDNS_Tag | Decl::IDNS_Type);
3718 void ASTDeclReader::attachLatestDeclImpl(Redeclarable<DeclT> *D, Decl *Latest) {
3726 void ASTDeclReader::attachLatestDecl(Decl *D, Decl *Latest) {
3731 #define DECL(TYPE, BASE) \
3732 case Decl::TYPE: \
3733 attachLatestDeclImpl(cast<TYPE##Decl>(D), Latest); \
3748 void ASTReader::markIncompleteDeclChain(Decl *D) {
3751 #define DECL(TYPE, BASE) \
3752 case Decl::TYPE: \
3753 ASTDeclReader::markIncompleteDeclChainImpl(cast<TYPE##Decl>(D)); \
3760 Decl *ASTReader::ReadDeclRecord(DeclID ID) {
3789 Decl *D = nullptr;
3793 "ASTReader::readDeclRecord failed reading decl code: " +
4078 // calls to Decl::getASTContext() by Decl's methods will find the
4103 // we put the Decl in PendingDefinitions so we can pull the categories here.
4148 Decl *D = Record.D;
4158 // Check if this decl was interesting to the consumer. If we just loaded
4215 // Load the pending visible updates for this decl context, if it has any.
4230 void ASTReader::loadPendingDeclChain(Decl *FirstLocal, uint64_t LocalOffset) {
4231 // Attach FirstLocal to the end of the decl chain.
4232 Decl *CanonDecl = FirstLocal->getCanonicalDecl();
4234 Decl *PrevMostRecent = ASTDeclReader::getMostRecentDecl(CanonDecl);
4247 assert(M && "imported decl from no module file");
4271 // FIXME: We have several different dispatches on decl kind here; maybe
4273 Decl *MostRecent = FirstLocal;
4422 void ASTDeclReader::UpdateDecl(Decl *D,
4430 Decl *MD = Record.readDecl();
4431 assert(MD && "couldn't read decl from update record");