Lines Matching defs:DC
295 auto *DC = getFriendObjectKind() || isLocalExternDecl()
297 return DC->isDependentContext() || isTemplateDecl() ||
302 if (auto *DC = dyn_cast<DeclContext>(this))
303 if (DC->isFileContext())
317 const DeclContext *DC =
319 return cast<Decl>(DC)->getTemplateDepth();
323 for (const DeclContext *DC = LexicalParent ? getLexicalDeclContext()
325 DC && !DC->isFileContext(); DC = DC->getParent())
326 if (DC->isFunctionOrMethod())
327 return DC;
363 void Decl::setDeclContext(DeclContext *DC) {
364 DeclCtx = DC;
367 void Decl::setLexicalDeclContext(DeclContext *DC) {
368 if (DC == getLexicalDeclContext())
372 setDeclContextsImpl(getDeclContext(), DC, getASTContext());
374 getMultipleDC()->LexicalDC = DC;
380 setModuleOwnershipKind(getModuleOwnershipKindForChildOf(DC));
382 setLocalOwningModule(cast<Decl>(DC)->getOwningModule());
421 for (const DeclContext *DC = getDeclContext(); DC; DC = DC->getParent()) {
422 if (const auto *ND = dyn_cast<NamespaceDecl>(DC))
431 const DeclContext *DC = getDeclContext();
432 return DC && DC->getNonTransparentContext()->isStdNamespace();
436 const auto *DC = dyn_cast<DeclContext>(this);
437 return DC && DC->isFileContext();
517 DeclContext *DC = getDeclContext();
518 assert(DC && "This decl is not contained in a translation unit!");
520 while (!DC->isTranslationUnit()) {
521 DC = DC->getParent();
522 assert(DC && "This decl is not contained in a translation unit!");
525 return cast<TranslationUnitDecl>(DC);
1119 const DeclContext *DC = getLexicalDeclContext();
1121 while (DC && !isa<ExportDecl>(DC))
1122 DC = DC->getLexicalParent();
1124 return isa_and_nonnull<ExportDecl>(DC);
1182 static Decl::Kind getKind(const DeclContext *DC) { return DC->getDeclKind(); }
1386 static bool isLinkageSpecContext(const DeclContext *DC,
1388 while (DC->getDeclKind() != Decl::TranslationUnit) {
1389 if (DC->getDeclKind() == Decl::LinkageSpec)
1390 return cast<LinkageSpecDecl>(DC)->getLanguage() == ID;
1391 DC = DC->getLexicalParent();
1401 const DeclContext *DC = this;
1402 while (DC->getDeclKind() != Decl::TranslationUnit) {
1403 if (DC->getDeclKind() == Decl::LinkageSpec &&
1404 cast<LinkageSpecDecl>(DC)->getLanguage() == LinkageSpecLanguageIDs::C)
1405 return cast<LinkageSpecDecl>(DC);
1406 DC = DC->getLexicalParent();
1415 bool DeclContext::Encloses(const DeclContext *DC) const {
1417 return getPrimaryContext()->Encloses(DC);
1419 for (; DC; DC = DC->getParent())
1420 if (!isa<LinkageSpecDecl>(DC) && !isa<ExportDecl>(DC) &&
1421 DC->getPrimaryContext() == this)
1427 DeclContext *DC = this;
1428 while (DC->isTransparentContext()) {
1429 DC = DC->getParent();
1430 assert(DC && "All transparent contexts should have a parent!");
1432 return DC;
1606 ExternalASTSource::SetNoExternalVisibleDeclsForName(const DeclContext *DC,
1608 ASTContext &Context = DC->getParentASTContext();
1610 if (!(Map = DC->LookupPtr))
1611 Map = DC->CreateStoredDeclsMap(Context);
1612 if (DC->hasNeedToReconcileExternalVisibleStorage())
1613 DC->reconcileExternalVisibleStorage();
1621 ExternalASTSource::SetExternalVisibleDeclsForName(const DeclContext *DC,
1624 ASTContext &Context = DC->getParentASTContext();
1626 if (!(Map = DC->LookupPtr))
1627 Map = DC->CreateStoredDeclsMap(Context);
1628 if (DC->hasNeedToReconcileExternalVisibleStorage())
1629 DC->reconcileExternalVisibleStorage();
1738 auto *DC = D->getDeclContext();
1740 StoredDeclsMap *Map = DC->getPrimaryContext()->LookupPtr;
1750 } while (DC->isTransparentContext() && (DC = DC->getParent()));
1804 assert(this == getPrimaryContext() && "buildLookup called on non-primary DC");
1815 for (auto *DC : Contexts) {
1816 if (DC->hasExternalLexicalStorage()) {
1817 bool LoadedDecls = DC->LoadLexicalDeclsFromExternalStorage();
1827 for (auto *DC : Contexts)
1828 buildLookupImpl(DC, hasExternalVisibleStorage());
1878 "lookupImpl should only be called with primary DC!");
1880 "We shouldn't lookup in transparent DC.");
2039 DeclContext *DC = this;
2040 while (DC->isRecord()) {
2041 OutermostRD = cast<RecordDecl>(DC);
2042 DC = DC->getLexicalParent();
2075 assert(this == getPrimaryContext() && "expected a primary DC");