Lines Matching refs:decl
1 //===--- ASTReaderDecl.cpp - Decl Deserialization ---------------*- C++ -*-===//
11 // entrypoint for loading a decl.
53 ///\brief A flag to carry the information for a decl from the entity is
54 /// used. We use it to delay the marking of the canonical decl as used until
96 Decl *ReadDecl(const RecordData &R, unsigned &I) {
147 Decl *MergeWith;
151 RedeclarableResult(GlobalDeclID FirstID, Decl *MergeWith, bool IsKeyDecl)
162 Decl *getKnownMergeTarget() const { return MergeWith; }
228 static Decl *getMostRecentDeclImpl(Redeclarable<DeclT> *D);
229 static Decl *getMostRecentDeclImpl(...);
230 static Decl *getMostRecentDecl(Decl *D);
234 Redeclarable<DeclT> *D, Decl *Previous,
235 Decl *Canon);
237 static void attachPreviousDecl(ASTReader &Reader, Decl *D, Decl *Previous,
238 Decl *Canon);
241 static void attachLatestDeclImpl(Redeclarable<DeclT> *D, Decl *Latest);
243 static void attachLatestDecl(Decl *D, Decl *latest);
252 void Visit(Decl *D);
254 void UpdateDecl(Decl *D, ModuleFile &ModuleFile,
262 void VisitDecl(Decl *D);
450 void ASTDeclReader::Visit(Decl *D) {
453 // At this point we have deserialized and merged the decl and it is safe to
454 // update its canonical decl to signal that the entire entity is used.
499 void ASTDeclReader::VisitDecl(Decl *D) {
523 // Decl::getASTContext() internally which is unsafe during derialization.
532 // Avoid calling setAttrs() directly because it uses Decl::getASTContext()
608 // Delay type reading until after we have fully initialized the decl.
849 // We avoid getASTContext because a decl in the parent hierarchy may
923 MD->setObjCDeclQualifier((Decl::ObjCDeclQualifier)Record[Idx++]);
1324 VarDecl *decl = ReadDeclAs<VarDecl>(Record, Idx);
1330 captures.push_back(BlockDecl::Capture(decl, byRef, nested, copyExpr));
1976 if (Decl *InstD = ReadDecl(Record, Idx)) {
2093 if (Decl *InstD = ReadDecl(Record, Idx)) {
2242 Decl *MergeWith = nullptr;
2288 // Note that we need to load local redeclarations of this decl and build a
2289 // decl chain for them. This must happen *after* we perform the preloading
2485 inline void ASTReader::LoadedDecl(unsigned Index, Decl *D) {
2486 assert(!DeclsLoaded[Index] && "Decl loaded twice?");
2497 static bool isConsumerInterestedIn(Decl *D, bool HasBody) {
2890 if (!cast<Decl>(DC)->isFromASTFile()) {
2997 // check that the canonical definition of that context contains the decl.
3011 Decl *ASTDeclReader::getMostRecentDeclImpl(Redeclarable<DeclT> *D) {
3014 Decl *ASTDeclReader::getMostRecentDeclImpl(...) {
3018 Decl *ASTDeclReader::getMostRecentDecl(Decl *D) {
3023 #define DECL(TYPE, BASE) \
3024 case Decl::TYPE: \
3025 return getMostRecentDeclImpl(cast<TYPE##Decl>(D));
3028 llvm_unreachable("unknown decl kind");
3031 Decl *ASTReader::getMostRecentExistingDecl(Decl *D) {
3038 Decl *Previous, Decl *Canon) {
3047 Decl *Previous, Decl *Canon) {
3098 Decl *ToD) {
3133 void ASTDeclReader::attachPreviousDecl(ASTReader &Reader, Decl *D,
3134 Decl *Previous, Decl *Canon) {
3139 #define DECL(TYPE, BASE) \
3140 case Decl::TYPE: \
3141 attachPreviousDeclImpl(Reader, cast<TYPE##Decl>(D), Previous, Canon); \
3153 (Decl::IDNS_Ordinary | Decl::IDNS_Tag | Decl::IDNS_Type);
3163 void ASTDeclReader::attachLatestDeclImpl(Redeclarable<DeclT> *D, Decl *Latest) {
3170 void ASTDeclReader::attachLatestDecl(Decl *D, Decl *Latest) {
3175 #define DECL(TYPE, BASE) \
3176 case Decl::TYPE: \
3177 attachLatestDeclImpl(cast<TYPE##Decl>(D), Latest); \
3191 void ASTReader::markIncompleteDeclChain(Decl *D) {
3194 #define DECL(TYPE, BASE) \
3195 case Decl::TYPE: \
3196 ASTDeclReader::markIncompleteDeclChainImpl(cast<TYPE##Decl>(D)); \
3203 Decl *ASTReader::ReadDeclRecord(DeclID ID) {
3223 Decl *D = nullptr;
3447 // calls to Decl::getASTContext() by Decl's methods will find the
3483 void ASTReader::loadDeclUpdateRecords(serialization::DeclID ID, Decl *D) {
3520 // Load the pending visible updates for this decl context, if it has any.
3535 void ASTReader::loadPendingDeclChain(Decl *FirstLocal, uint64_t LocalOffset) {
3536 // Attach FirstLocal to the end of the decl chain.
3537 Decl *CanonDecl = FirstLocal->getCanonicalDecl();
3539 Decl *PrevMostRecent = ASTDeclReader::getMostRecentDecl(CanonDecl);
3552 assert(M && "imported decl from no module file");
3564 // FIXME: We have several different dispatches on decl kind here; maybe
3566 Decl *MostRecent = FirstLocal;
3715 void ASTDeclReader::UpdateDecl(Decl *D, ModuleFile &ModuleFile,
3723 Decl *MD = Reader.ReadDecl(ModuleFile, Record, Idx);
3724 assert(MD && "couldn't read decl from update record");