Lines Matching defs:DC
304 const DeclContext *DC = D->getDeclContext();
305 while (DC->getDeclKind() != Decl::TranslationUnit) {
306 if (isa<FunctionDecl>(DC) || isa<BlockDecl>(DC))
307 Ret = cast<Decl>(DC);
308 DC = DC->getParent();
706 for (const DeclContext *DC = D->getDeclContext();
707 !isa<TranslationUnitDecl>(DC);
708 DC = DC->getParent()) {
709 const auto *ND = dyn_cast<NamespaceDecl>(DC);
1148 const DeclContext *DC = getDeclContext()->getRedeclContext();
1149 if (DC->isTranslationUnit())
1308 LinkageInfo LinkageComputer::getLVForClosure(const DeclContext *DC,
1314 Owner = dyn_cast<NamedDecl>(DC);
1759 for (const DeclContext *DC : llvm::reverse(Contexts)) {
1760 if (const auto *Spec = dyn_cast<ClassTemplateSpecializationDecl>(DC)) {
1766 } else if (const auto *ND = dyn_cast<NamespaceDecl>(DC)) {
1773 } else if (const auto *RD = dyn_cast<RecordDecl>(DC)) {
1778 } else if (const auto *FD = dyn_cast<FunctionDecl>(DC)) {
1799 } else if (const auto *ED = dyn_cast<EnumDecl>(DC)) {
1812 OS << *cast<NamedDecl>(DC);
2123 VarDecl::VarDecl(Kind DK, ASTContext &C, DeclContext *DC,
2127 : DeclaratorDecl(DK, DC, IdLoc, Id, T, TInfo, StartLoc),
2140 VarDecl *VarDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation StartL,
2143 return new (C, DC) VarDecl(Var, C, DC, StartL, IdL, Id, T, TInfo, S);
2205 const DeclContext *DC = D.getDeclContext();
2206 if (DC->isRecord())
2221 const DeclContext *DC = D.getDeclContext();
2222 if (DC->isRecord()) {
2918 ParmVarDecl *ParmVarDecl::Create(ASTContext &C, DeclContext *DC,
2923 return new (C, DC) ParmVarDecl(ParmVar, C, DC, StartLoc, IdLoc, Id, T, TInfo,
3040 FunctionDecl::FunctionDecl(Kind DK, ASTContext &C, DeclContext *DC,
3047 : DeclaratorDecl(DK, DC, NameInfo.getLoc(), NameInfo.getName(), T, TInfo,
3531 for (const DeclContext *DC = getDeclContext();
3532 DC->isNamespace();
3533 DC = DC->getParent()) {
3534 if (const auto *Namespace = cast<NamespaceDecl>(DC)) {
4571 FieldDecl *FieldDecl::Create(const ASTContext &C, DeclContext *DC,
4576 return new (C, DC) FieldDecl(Decl::Field, DC, StartLoc, IdLoc, Id, T, TInfo,
4740 TagDecl::TagDecl(Kind DK, TagKind TK, const ASTContext &C, DeclContext *DC,
4743 : TypeDecl(DK, DC, L, Id, StartL), DeclContext(DK), redeclarable_base(C),
4876 EnumDecl::EnumDecl(ASTContext &C, DeclContext *DC, SourceLocation StartLoc,
4879 : TagDecl(Enum, TagTypeKind::Enum, C, DC, IdLoc, Id, PrevDecl, StartLoc) {
4893 EnumDecl *EnumDecl::Create(ASTContext &C, DeclContext *DC,
4898 auto *Enum = new (C, DC) EnumDecl(C, DC, StartLoc, IdLoc, Id, PrevDecl,
5034 DeclContext *DC, SourceLocation StartLoc,
5037 : TagDecl(DK, TK, C, DC, IdLoc, Id, PrevDecl, StartLoc) {
5057 RecordDecl *RecordDecl::Create(const ASTContext &C, TagKind TK, DeclContext *DC,
5060 RecordDecl *R = new (C, DC) RecordDecl(Record, TK, C, DC,
5262 BlockDecl::BlockDecl(DeclContext *DC, SourceLocation CaretLoc)
5263 : Decl(Block, DC, CaretLoc), DeclContext(Block) {
5329 TranslationUnitDecl *DC,
5334 new (C, DC, additionalSizeToAlloc<char>(Arg.size() + 1))
5335 PragmaCommentDecl(DC, CommentLoc, CommentKind);
5351 PragmaDetectMismatchDecl::Create(const ASTContext &C, TranslationUnitDecl *DC,
5356 new (C, DC, additionalSizeToAlloc<char>(ValueStart + Value.size() + 1))
5357 PragmaDetectMismatchDecl(DC, Loc, ValueStart);
5376 TranslationUnitDecl *DC) {
5377 return new (C, DC) ExternCContextDecl(DC);
5382 LabelDecl *LabelDecl::Create(ASTContext &C, DeclContext *DC,
5384 return new (C, DC) LabelDecl(DC, IdentL, II, nullptr, IdentL);
5387 LabelDecl *LabelDecl::Create(ASTContext &C, DeclContext *DC,
5391 return new (C, DC) LabelDecl(DC, IdentL, II, nullptr, GnuLabelL);
5429 ImplicitParamDecl *ImplicitParamDecl::Create(ASTContext &C, DeclContext *DC,
5433 return new (C, DC) ImplicitParamDecl(C, DC, IdLoc, Id, Type, ParamKind);
5447 FunctionDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc,
5453 FunctionDecl *New = new (C, DC) FunctionDecl(
5454 Function, C, DC, StartLoc, NameInfo, T, TInfo, SC, UsesFPIntrin,
5466 BlockDecl *BlockDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L) {
5467 return new (C, DC) BlockDecl(DC, L);
5474 OutlinedFunctionDecl::OutlinedFunctionDecl(DeclContext *DC, unsigned NumParams)
5475 : Decl(OutlinedFunction, DC, SourceLocation()),
5480 DeclContext *DC,
5482 return new (C, DC, additionalSizeToAlloc<ImplicitParamDecl *>(NumParams))
5483 OutlinedFunctionDecl(DC, NumParams);
5503 CapturedDecl::CapturedDecl(DeclContext *DC, unsigned NumParams)
5504 : Decl(Captured, DC, SourceLocation()), DeclContext(Captured),
5507 CapturedDecl *CapturedDecl::Create(ASTContext &C, DeclContext *DC,
5509 return new (C, DC, additionalSizeToAlloc<ImplicitParamDecl *>(NumParams))
5510 CapturedDecl(DC, NumParams);
5525 EnumConstantDecl::EnumConstantDecl(const ASTContext &C, DeclContext *DC,
5528 : ValueDecl(EnumConstant, DC, L, Id, T), Init((Stmt *)E) {
5547 IndirectFieldDecl::IndirectFieldDecl(ASTContext &C, DeclContext *DC,
5551 : ValueDecl(IndirectField, DC, L, N, T), Chaining(CH.data()),
5560 IndirectFieldDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,
5563 return new (C, DC) IndirectFieldDecl(C, DC, L, Id, T, CH);
5581 TypedefDecl *TypedefDecl::Create(ASTContext &C, DeclContext *DC,
5585 return new (C, DC) TypedefDecl(C, DC, StartLoc, IdLoc, Id, TInfo);
5632 TypeAliasDecl *TypeAliasDecl::Create(ASTContext &C, DeclContext *DC,
5637 return new (C, DC) TypeAliasDecl(C, DC, StartLoc, IdLoc, Id, TInfo);
5664 FileScopeAsmDecl *FileScopeAsmDecl::Create(ASTContext &C, DeclContext *DC,
5668 return new (C, DC) FileScopeAsmDecl(DC, Str, AsmLoc, RParenLoc);
5684 DeclContext *DC = C.getTranslationUnitDecl();
5686 return new (C, DC) TopLevelStmtDecl(DC, Loc, Statement);
5692 TopLevelStmtDecl(/*DC=*/nullptr, SourceLocation(), /*S=*/nullptr);
5707 EmptyDecl *EmptyDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L) {
5708 return new (C, DC) EmptyDecl(DC, L);
5715 HLSLBufferDecl::HLSLBufferDecl(DeclContext *DC, bool CBuffer,
5718 : NamedDecl(Decl::Kind::HLSLBuffer, DC, IDLoc, DeclarationName(ID)),
5738 DeclContext *DC = LexicalParent;
5740 new (C, DC) HLSLBufferDecl(DC, CBuffer, KwLoc, ID, IDLoc, LBrace);
5765 ImportDecl::ImportDecl(DeclContext *DC, SourceLocation StartLoc,
5768 : Decl(Import, DC, StartLoc), ImportedModule(Imported),
5776 ImportDecl::ImportDecl(DeclContext *DC, SourceLocation StartLoc,
5778 : Decl(Import, DC, StartLoc), ImportedModule(Imported),
5783 ImportDecl *ImportDecl::Create(ASTContext &C, DeclContext *DC,
5786 return new (C, DC,
5788 ImportDecl(DC, StartLoc, Imported, IdentifierLocs);
5791 ImportDecl *ImportDecl::CreateImplicit(ASTContext &C, DeclContext *DC,
5795 ImportDecl *Import = new (C, DC, additionalSizeToAlloc<SourceLocation>(1))
5796 ImportDecl(DC, StartLoc, Imported, EndLoc);
5829 ExportDecl *ExportDecl::Create(ASTContext &C, DeclContext *DC,
5831 return new (C, DC) ExportDecl(DC, ExportLoc);