| /llvm-project-15.0.7/clang-tools-extra/clangd/refactor/tweaks/ |
| H A D | DefineOutline.cpp | 74 findContextForNS(llvm::StringRef TargetNS, const DeclContext *CurContext) { in findContextForNS() argument 77 CurContext = CurContext->getEnclosingNamespaceContext(); in findContextForNS() 80 while (!CurContext->isTranslationUnit()) in findContextForNS() 81 CurContext = CurContext->getParent(); in findContextForNS() 82 return CurContext; in findContextForNS() 87 CurContext->isNamespace() in findContextForNS() 88 ? llvm::cast<NamespaceDecl>(CurContext)->getQualifiedNameAsString() in findContextForNS() 99 CurContext = CurContext->getParent(); in findContextForNS() 105 return CurContext; in findContextForNS()
|
| /llvm-project-15.0.7/clang-tools-extra/clangd/ |
| H A D | AST.cpp | 116 for (const DeclContext *CurContext = SourceContext; CurContext; in getQualification() local 117 CurContext = CurContext->getLookupParent()) { in getQualification() 119 if (CurContext->Encloses(DestContext)) in getQualification() 123 if (auto *TD = llvm::dyn_cast<TagDecl>(CurContext)) { in getQualification() 129 } else if (auto *NSD = llvm::dyn_cast<NamespaceDecl>(CurContext)) { in getQualification() 376 std::string printType(const QualType QT, const DeclContext &CurContext, in printType() argument 380 PrintingPolicy PP(CurContext.getParentASTContext().getPrintingPolicy()); in printType() 386 PrintCB(const DeclContext *CurContext) : CurContext(CurContext) {} in printType() argument 389 return DC->Encloses(CurContext); in printType() 393 const DeclContext *CurContext; in printType() member in clang::clangd::printType::PrintCB [all …]
|
| H A D | AST.h | 122 std::string printType(const QualType QT, const DeclContext &CurContext,
|
| /llvm-project-15.0.7/clang/lib/Sema/ |
| H A D | SemaModule.cpp | 352 ImportDecl::Create(Context, CurContext, ModuleLoc, Mod, Path[0].second); in ActOnModuleDecl() 492 checkModuleImportContext(*this, Mod, ImportLoc, CurContext); in ActOnModuleImport() 530 ImportDecl *Import = ImportDecl::Create(Context, CurContext, StartLoc, in ActOnModuleImport() 532 CurContext->addDecl(Import); in ActOnModuleImport() 581 checkModuleImportContext(*this, Mod, DirectiveLoc, CurContext, true); in ActOnModuleInclude() 622 checkModuleImportContext(*this, Mod, DirectiveLoc, CurContext, true); in ActOnModuleBegin() 635 for (auto *DC = CurContext; DC; DC = DC->getLexicalParent()) { in ActOnModuleBegin() 676 for (auto *DC = CurContext; DC; DC = DC->getLexicalParent()) { in ActOnModuleEnd() 708 ExportDecl *D = ExportDecl::Create(Context, CurContext, ExportLoc); in ActOnStartExportDecl() 713 CurContext->addDecl(D); in ActOnStartExportDecl() [all …]
|
| H A D | SemaCodeComplete.cpp | 390 if (isa<BlockDecl>(S.CurContext)) { in enterReturn() 1103 MaybeAddResult(Result, CurContext); in MaybeAddResult() 1278 AddResult(Result, CurContext, Hiding); in AddResult() 4143 if (S.CurContext->isFileContext()) in mapCodeCompletionContext() 4145 if (S.CurContext->isRecord()) in mapCodeCompletionContext() 4192 DeclContext *CurContext = S.CurContext; in MaybeAddOverrideCalls() local 4193 while (isa<BlockDecl>(CurContext)) in MaybeAddOverrideCalls() 4194 CurContext = CurContext->getParent(); in MaybeAddOverrideCalls() 6684 CurContext, nullptr, false); in CodeCompleteNamespaceDecl() 7093 if (isa<ObjCImplDecl>(CurContext)) in CodeCompleteObjCAtDirective() [all …]
|
| H A D | SemaCXXScopeSpec.cpp | 28 DeclContext *CurContext) { in getCurrentInstantiationOf() argument 36 Record->isCurrentInstantiation(CurContext)) in getCurrentInstantiationOf() 58 return ::getCurrentInstantiationOf(T, CurContext); in computeDeclContext() 187 return ::getCurrentInstantiationOf(T, CurContext); in getCurrentInstantiationOf() 816 DeclContext *DC = LookupCtx ? LookupCtx : CurContext; in BuildCXXNestedNameSpecifier() 1047 if (isa<ObjCContainerDecl>(CurContext) || isa<ObjCMethodDecl>(CurContext)) in ShouldEnterDeclaratorScope() 1072 return CurContext->getRedeclContext()->isFileContext(); in ShouldEnterDeclaratorScope()
|
| H A D | SemaDeclCXX.cpp | 11966 CurContext, in CheckUsingShadowDecl() 12368 CurContext->addDecl(D); in BuildUsingDeclaration() 12378 CurContext->addDecl(UD); in BuildUsingDeclaration() 12571 CurContext->addDecl(UD); in BuildUsingEnumDeclaration() 12603 CurContext->addDecl(UPD); in BuildUsingPackDecl() 16322 CurContext->addDecl(D); in ActOnStartLinkageSpecification() 16358 CurContext->addDecl(ED); in ActOnEmptyDeclaration() 16940 CurContext->addDecl(D); in ActOnFriendTypeDecl() 17064 DC = CurContext; in ActOnFriendFunctionDecl() 17147 DC = CurContext; in ActOnFriendFunctionDecl() [all …]
|
| H A D | SemaCoroutine.cpp | 191 auto *FD = dyn_cast<FunctionDecl>(S.CurContext); in isValidCoroutineContext() 193 S.Diag(Loc, isa<ObjCMethodDecl>(S.CurContext) in isValidCoroutineContext() 482 assert(isa<FunctionDecl>(CurContext) && "not in a function scope"); in buildCoroutinePromise() 483 auto *FD = cast<FunctionDecl>(CurContext); in buildCoroutinePromise() 591 assert(isa<FunctionDecl>(S.CurContext) && "not in a function scope"); in checkCoroutineContext() 638 S.Diag(cast<FunctionDecl>(S.CurContext)->getLocation(), in checkNoThrow() 704 auto *Fn = cast<FunctionDecl>(CurContext); in ActOnCoroutineBodyStart() 1656 VarDecl *Decl = VarDecl::Create(S.Context, S.CurContext, Loc, Loc, II, Type, in buildVarDecl() 1665 assert(isa<FunctionDecl>(CurContext) && "not in a function scope"); in buildCoroutineParameterMoves() 1666 auto *FD = cast<FunctionDecl>(CurContext); in buildCoroutineParameterMoves()
|
| H A D | SemaDecl.cpp | 1319 CurContext = DC; in PushDeclContext() 1326 CurContext = CurContext->getLexicalParent(); in PopDeclContext() 1345 CurContext = static_cast<decltype(CurContext)>(Context); in ActOnTagFinishSkippedDefinition() 1376 CurContext = DC; in EnterDeclaratorContext() 1453 CurContext = FD; in ActOnReenterFunctionContext() 1454 S->setEntity(CurContext); in ActOnReenterFunctionContext() 1470 CurContext = CurContext->getLexicalParent(); in ActOnExitFunctionContext() 1520 CurContext->addDecl(D); in PushOnScopeChains() 6566 DC = CurContext; in ActOnTypedefDeclarator() 10118 if (CurContext->isDependentContext() && CurContext->isRecord() in ActOnFunctionDeclarator() [all …]
|
| H A D | SemaOpenMP.cpp | 1500 DeclContext *DC = SemaRef.CurContext; in buildVarDecl() 3106 CurContext->addDecl(D); in ActOnOpenMPThreadprivateDirective() 3401 if (!CurContext->isFileContext()) { in ActOnOpenMPRequiresDirective() 3406 CurContext->addDecl(D); in ActOnOpenMPRequiresDirective() 3441 auto *Ctx = CurContext; in ActOnOpenMPAssumesDirective() 4557 DSAStack->setContext(CurContext); in ActOnOpenMPRegionStart() 4596 CurContext->addHiddenDecl(CED); in buildCaptureDecl() 18078 CurContext->addDecl(VDPrivate); in ActOnOpenMPFirstprivateClause() 21883 CurContext = DRD; in ActOnOpenMPDeclareReductionCombinerStart() 21943 CurContext = DRD; in ActOnOpenMPDeclareReductionInitializerStart() [all …]
|
| H A D | SemaDeclObjC.cpp | 1036 CurContext, in ActOnStartClassInterface() 1785 = ObjCProtocolDecl::Create(Context, CurContext, Ident, in ActOnForwardProtocolDeclaration() 1827 CurContext->addDecl(CDecl); in ActOnStartCategoryInterface() 1875 CurContext->addDecl(CDecl); in ActOnStartCategoryInterface() 1937 CurContext->addDecl(CDecl); in ActOnStartCategoryImplementation() 3814 switch (CurContext->getDeclKind()) { in getObjCContainerKind() 3820 if (cast<ObjCCategoryDecl>(CurContext)->IsClassExtension()) in getObjCContainerKind() 3980 auto *OCD = cast<ObjCContainerDecl>(CurContext); in ActOnAtEnd() 4720 if (!CurContext->isObjCContainer()) { in ActOnMethodDeclaration() 4725 Decl *ClassDecl = cast<ObjCContainerDecl>(CurContext); in ActOnMethodDeclaration() [all …]
|
| H A D | SemaLambda.cpp | 245 DeclContext *DC = CurContext; in createLambdaClosureType() 317 inTemplateInstantiation() || CurContext->isDependentContext(); in getCurrentMangleNumberContext() 324 isInInlineFunction(CurContext)) { in getCurrentMangleNumberContext() 401 Method->setLexicalDeclContext(CurContext); in startLambdaDefinition() 412 TemplateMethod->setLexicalDeclContext(CurContext); in startLambdaDefinition() 871 VarDecl *NewVD = VarDecl::Create(Context, CurContext, Loc, in createLambdaInitCaptureVarDecl() 1807 if (!CurContext->isDependentContext() && !IsImplicit && in BuildLambdaExpr() 1932 if (!CurContext->isDependentContext()) { in BuildLambdaExpr() 1990 BlockDecl *Block = BlockDecl::Create(Context, CurContext, ConvLocation); in BuildBlockForLambdaConversion()
|
| H A D | SemaStmt.cpp | 637 assert(!CurContext->isDependentContext() && in checkMustTailAttr() 703 if (isa<BlockDecl>(CurContext)) in checkMustTailAttr() 705 else if (isa<ObjCMethodDecl>(CurContext)) in checkMustTailAttr() 936 if (CurContext->isFunctionOrMethod()) { in ActOnIfStmt() 2398 SemaRef.CurContext->addHiddenDecl(Decl); in FinishForRangeVarDecl() 2439 DeclContext *DC = SemaRef.CurContext; in BuildForRangeVarDecl() 3622 if (!CurContext->isDependentContext()) in ActOnCapScopeReturnStmt() 4565 DeclContext *DC = CurContext; in ActOnSEHTryBlock() 4645 DeclContext *DC = CurContext; in CreateCapturedStmtRecordDecl() 4732 CurContext = CD; in ActOnCapturedRegionStart() [all …]
|
| H A D | SemaTemplate.cpp | 1779 SemanticContext = CurContext; in CheckClassTemplate() 2068 CurContext->addDecl(Friend); in CheckClassTemplate() 4523 CurContext->addDecl(Specialization); in ActOnVarTemplateSpecialization() 8650 CurContext->addDecl(Friend); in ActOnClassTemplateSpecialization() 8655 CurContext->addDecl(Specialization); in ActOnClassTemplateSpecialization() 8676 DeclContext *DC = CurContext; in ActOnConceptDefinition() 9497 DeclContext *CurContext = S.CurContext->getRedeclContext(); in CheckExplicitInstantiationScope() local 9499 if (CurContext->isRecord()) { in CheckExplicitInstantiationScope() 9514 if (CurContext->Encloses(OrigContext)) in CheckExplicitInstantiationScope() 9813 CurContext->addDecl(Specialization); in ActOnExplicitInstantiation() [all …]
|
| H A D | Sema.cpp | 192 CodeCompleter(CodeCompleter), CurContext(nullptr), in Sema() 518 FunctionDecl *fn = dyn_cast<FunctionDecl>(CurContext); in makeUnavailableInSystemHeader() 1421 DeclContext *DC = CurContext; in getFunctionLevelDeclContext() 1571 auto *FD = dyn_cast<FunctionDecl>(CurContext); in hasUncompilableErrorOccurred() 2266 !CurBSI->TheDecl->Encloses(CurContext)) { in getCurBlock() 2290 if (LSI->Lambda && !LSI->Lambda->Encloses(CurContext)) { in getEnclosingLambda() 2317 !CurLSI->Lambda->Encloses(CurContext)) { in getCurLambda()
|
| H A D | SemaLookup.cpp | 4409 Res = LabelDecl::Create(Context, CurContext, Loc, II, GnuLabelLoc); in LookupOrCreateLabel() 4419 if (Res && Res->getDeclContext() != CurContext) in LookupOrCreateLabel() 4423 Res = LabelDecl::Create(Context, CurContext, Loc, II); in LookupOrCreateLabel() 4836 : Context(Context), CurContextChain(buildContextChain(CurContext)) { in NamespaceSpecifierSet() 5087 if (isa<CXXMethodDecl>(SemaRef.CurContext) && in AddKeywordsToConsumer() 5088 cast<CXXMethodDecl>(SemaRef.CurContext)->isInstance()) in AddKeywordsToConsumer() 5168 if (getLangOpts().MSVCCompat && CurContext->isDependentContext() && in makeTypoCorrectionConsumer() 5169 isa<CXXMethodDecl>(CurContext)) in makeTypoCorrectionConsumer() 5559 CurContext(SemaRef.CurContext), MemberFn(ME) { in FunctionCallFilterCCC() 5595 CurContext->getParentASTContext().getLangOpts().CPlusPlus) in ValidateCandidate() [all …]
|
| H A D | SemaAttr.cpp | 553 !CurContext->getRedeclContext()->isFileContext()) { in ActOnPragmaFloatControl() 796 if (!CurContext->getRedeclContext()->isFileContext()) { in ActOnPragmaMSAllocText() 1153 if (!CurContext->getRedeclContext()->isFileContext()) { in ActOnPragmaMSOptimize() 1163 if (!CurContext->getRedeclContext()->isFileContext()) { in ActOnPragmaMSFunction()
|
| H A D | SemaAccess.cpp | 1473 EffectiveContext EC(S.CurContext); in CheckAccess() 1694 ObjectClass = cast<CXXConstructorDecl>(CurContext)->getParent(); in CheckConstructorAccess() 1828 EffectiveContext EC(CurContext); in CheckFriendAccess() 1941 EffectiveContext EC(CurContext); in IsSimplyAccessible()
|
| H A D | SemaObjCProperty.cpp | 193 ObjCContainerDecl *ClassDecl = cast<ObjCContainerDecl>(CurContext); in ActOnProperty() 419 ObjCCategoryDecl *CDecl = cast<ObjCCategoryDecl>(CurContext); in HandlePropertyInClassExtension() 421 DeclContext *DC = CurContext; in HandlePropertyInClassExtension() 1086 dyn_cast<ObjCContainerDecl>(CurContext); in ActOnPropertyImplDecl() 1424 ObjCPropertyImplDecl::Create(Context, CurContext, AtLoc, PropertyLoc, in ActOnPropertyImplDecl()
|
| H A D | SemaExprCXX.cpp | 1197 if (ThisTy.isNull() && isLambdaCallOperator(CurContext) && in getCurrentThisType() 1212 if (!ThisTy.isNull() && isLambdaCallOperator(CurContext)) in getCurrentThisType() 1214 CurContext, Context); in getCurrentThisType() 7517 FunctionDecl *CurFD = dyn_cast<FunctionDecl>(CurContext); in ActOnStartCXXMemberReference() 8244 assert(S.CurContext->isDependentContext()); in CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures() 8246 DeclContext *DC = S.CurContext; in CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures() 8832 DeclContext *DC = CurContext; in ActOnFinishFullExpr() 8957 auto *TParam = TemplateTypeParmDecl::Create(Context, CurContext, in ActOnCompoundRequirement() 9098 assert(CurContext && "DeclContext imbalance!"); in ActOnFinishRequiresExpr() 9099 CurContext = CurContext->getLexicalParent(); in ActOnFinishRequiresExpr() [all …]
|
| H A D | SemaExpr.cpp | 3421 if (BD->getDeclContext() != CurContext) { in BuildDeclarationNameExpr() 5416 CurContext->addDecl(VD); in ActOnOMPIteratorExpr() 5470 if (!CurContext->isDependentContext()) { in ActOnOMPIteratorExpr() 6566 } else if (S.CurContext->isDependentContext()) { in tryImplicitlyCaptureThisIfImplicitMemberFunctionAccessWithDependentArgs() 12613 DeclContext *DC = CurContext; in CheckCompareOperands() 13421 DeclContext *DC = S.CurContext, *Prev = nullptr; in isReferenceToNonConstCapture() 16177 CurContext->addDecl(Block); in ActOnBlockStart() 16181 CurContext = Block; in ActOnBlockStart() 17916 if (SemaRef.CurContext->isDependentContext()) in isOdrUseContext() 17942 bool IsRecursiveCall = CurContext == Func; in MarkFunctionReferenced() [all …]
|
| /llvm-project-15.0.7/clang/lib/AST/ |
| H A D | CXXInheritance.cpp | 117 CXXRecordDecl::isCurrentInstantiation(const DeclContext *CurContext) const { in isCurrentInstantiation() 120 for (; !CurContext->isFileContext(); CurContext = CurContext->getParent()) in isCurrentInstantiation() 121 if (CurContext->Equals(this)) in isCurrentInstantiation()
|
| /llvm-project-15.0.7/clang/include/clang/Sema/ |
| H A D | SemaInternal.h | 103 Namespaces(SemaRef.Context, SemaRef.CurContext, SS), in TypoCorrectionConsumer() 238 NamespaceSpecifierSet(ASTContext &Context, DeclContext *CurContext,
|
| H A D | TypoCorrection.h | 393 DeclContext *CurContext; variable
|
| /llvm-project-15.0.7/clang/lib/Interpreter/ |
| H A D | IncrementalParser.cpp | 163 S.CurContext = nullptr; in ParseOrWrapTopLevelDecl()
|