Lines Matching refs:DC

36 /// For the given DC, return the DC that is safe to perform lookups on.  This is
37 /// the DC we actually want to work with most of the time.
38 const DeclContext *CanonicalizeDC(const DeclContext *DC) {
39 if (isa<LinkageSpecDecl>(DC))
40 return DC->getRedeclContext();
41 return DC;
45 LookupSameContext(Source<TranslationUnitDecl *> SourceTU, const DeclContext *DC,
47 DC = CanonicalizeDC(DC);
48 if (DC->isTranslationUnit()) {
52 LookupSameContext(SourceTU, DC->getParent(), ReverseImporter);
54 // If we couldn't find the parent DC in this TranslationUnit, give up.
57 auto *ND = cast<NamedDecl>(DC);
82 SearchResultDecl->getKind() == DC->getDeclKind())
217 << (void*)FromOrigins.at(FromDC).DC
280 void ExternalASTMerger::ForEachMatchingDC(const DeclContext *DC,
282 if (Origins.count(DC)) {
283 ExternalASTMerger::DCOrigin Origin = Origins[DC];
285 Callback(Importer, Importer.GetReverse(), Origin.DC);
293 if (auto SourceDC = LookupSameContext(SourceTU, DC, Reverse)) {
301 << " asserting for (DeclContext*)" << (const void*)DC
304 assert(DidCallback && "Couldn't find a source context matching our DC");
375 const bool DoRecord = !FoundFromDC || !IsSameDC(FoundFromDC.get(), Origin.DC);
381 << " to record origin (DeclContext*)" << (void*)Origin.DC
394 Importer.ASTImporter::MapImported(cast<Decl>(Origin.DC), const_cast<Decl*>(cast<Decl>(ToDC)));
479 bool ExternalASTMerger::FindExternalVisibleDeclsByName(const DeclContext *DC,
489 ForEachMatchingDC(DC,
524 SetExternalVisibleDeclsForName(DC, Name, Decls);
529 const DeclContext *DC, llvm::function_ref<bool(Decl::Kind)> IsKindWeWant,
531 ForEachMatchingDC(DC, [&](ASTImporter &Forward, ASTImporter &Reverse,
538 IsSameDC((*ImportedDeclOrErr)->getDeclContext(), DC));