Lines Matching defs:LSI
92 const clang::sema::LambdaScopeInfo *LSI =
121 if (LSI->ImpCaptureStyle == sema::LambdaScopeInfo::ImpCap_None) {
122 if (IsCapturingVariable && !LSI->isCaptured(VarToCapture))
124 if (IsCapturingThis && !LSI->isCXXThisCaptured())
234 getGenericLambdaTemplateParameterList(LambdaScopeInfo *LSI, Sema &SemaRef) {
235 if (!LSI->GLTemplateParameterList && !LSI->TemplateParams.empty()) {
236 LSI->GLTemplateParameterList = TemplateParameterList::Create(
239 /*L angle loc*/ LSI->ExplicitTemplateParamsRange.getBegin(),
240 LSI->TemplateParams,
241 /*R angle loc*/LSI->ExplicitTemplateParamsRange.getEnd(),
242 LSI->RequiresClause.get());
244 return LSI->GLTemplateParameterList;
508 static void buildLambdaScopeReturnType(Sema &S, LambdaScopeInfo *LSI,
512 LSI->HasImplicitReturnType = false;
513 LSI->ReturnType = CallOperator->getReturnType();
514 if (!LSI->ReturnType->isDependentType() && !LSI->ReturnType->isVoidType())
515 S.RequireCompleteType(CallOperator->getBeginLoc(), LSI->ReturnType,
518 LSI->HasImplicitReturnType = true;
522 void Sema::buildLambdaScope(LambdaScopeInfo *LSI, CXXMethodDecl *CallOperator,
527 LSI->CallOperator = CallOperator;
529 LSI->Lambda = LambdaClass;
531 LSI->ImpCaptureStyle = LambdaScopeInfo::ImpCap_LambdaByval;
533 LSI->ImpCaptureStyle = LambdaScopeInfo::ImpCap_LambdaByref;
534 LSI->CaptureDefaultLoc = CaptureDefaultLoc;
535 LSI->IntroducerRange = IntroducerRange;
536 LSI->ExplicitParams = ExplicitParams;
537 LSI->Mutable = Mutable;
540 void Sema::finishLambdaExplicitCaptures(LambdaScopeInfo *LSI) {
541 LSI->finishedExplicitCaptures();
548 LambdaScopeInfo *LSI = getCurLambda();
549 assert(LSI && "Expected a lambda scope");
550 assert(LSI->NumExplicitTemplateParams == 0 &&
552 assert(LSI->TemplateParams.empty() &&
557 LSI->TemplateParams.append(TParams.begin(), TParams.end());
558 LSI->NumExplicitTemplateParams = TParams.size();
559 LSI->ExplicitTemplateParamsRange = {LAngleLoc, RAngleLoc};
560 LSI->RequiresClause = RequiresClause;
875 void Sema::addInitCapture(LambdaScopeInfo *LSI, VarDecl *Var, bool ByRef) {
877 LSI->addCapture(Var, /*isBlock=*/false, ByRef,
1015 LambdaScopeInfo *LSI = getCurrentLambdaScopeUnsafe(*this);
1021 getGenericLambdaTemplateParameterList(LSI, *this);
1024 Method->setLexicalDeclContext(LSI->Lambda);
1031 LSI->Lambda->addDecl(TemplateMethod);
1034 LSI->Lambda->addDecl(Method);
1036 LSI->Lambda->setLambdaIsGeneric(TemplateParams);
1037 LSI->Lambda->setLambdaTypeInfo(MethodTyInfo);
1043 Method->setType(buildTypeForLambdaCallOperator(*this, LSI->Lambda,
1056 buildLambdaScopeReturnType(*this, LSI, Method, HasExplicitResultType);
1062 LambdaScopeInfo *LSI = getCurLambda();
1063 assert(LSI && "LambdaScopeInfo should be on stack!");
1066 LSI->ImpCaptureStyle = LambdaScopeInfo::ImpCap_LambdaByval;
1068 LSI->ImpCaptureStyle = LambdaScopeInfo::ImpCap_LambdaByref;
1069 LSI->CaptureDefaultLoc = Intro.DefaultLoc;
1070 LSI->IntroducerRange = Intro.Range;
1071 LSI->AfterParameterList = false;
1073 assert(LSI->NumExplicitTemplateParams == 0);
1104 LSI->Lambda = Class;
1107 LSI->CallOperator = Method;
1131 if (LSI->isCXXThisCaptured()) {
1133 << "'this'" << SourceRange(LSI->getCXXThisCapture().getLocation())
1161 if (!LSI->Captures.empty())
1162 LSI->ExplicitCaptureRanges[LSI->Captures.size() - 1] = C->ExplicitRange;
1320 addInitCapture(LSI, cast<VarDecl>(Var), C->Kind == LCK_ByRef);
1326 if (!LSI->Captures.empty())
1327 LSI->ExplicitCaptureRanges[LSI->Captures.size() - 1] = C->ExplicitRange;
1329 finishLambdaExplicitCaptures(LSI);
1330 LSI->ContainsUnexpandedParameterPack |= ContainsUnexpandedParameterPack;
1337 LambdaScopeInfo *LSI = getCurrentLambdaScopeUnsafe(*this);
1338 LSI->Mutable = MutableLoc.isValid();
1339 ContextRAII Context(*this, LSI->CallOperator, /*NewThisContext*/ false);
1353 !LSI->Lambda->getParent()->isFunctionOrMethod() &&
1362 LambdaScopeInfo *LSI = getCurrentLambdaScopeUnsafe(*this);
1363 PushDeclContext(LambdaScope, LSI->CallOperator);
1367 Param->setOwningFunction(LSI->CallOperator);
1377 getGenericLambdaTemplateParameterList(LSI, *this);
1379 AddTemplateParametersToLambdaCallOperator(LSI->CallOperator, LSI->Lambda,
1381 LSI->Lambda->setLambdaIsGeneric(true);
1382 LSI->ContainsUnexpandedParameterPack |=
1385 LSI->AfterParameterList = true;
1392 LambdaScopeInfo *LSI = getCurrentLambdaScopeUnsafe(*this);
1393 LSI->CallOperator->setConstexprKind(DS.getConstexprSpecifier());
1410 CXXRecordDecl *Class = LSI->Lambda;
1411 CXXMethodDecl *Method = LSI->CallOperator;
1416 LSI->ExplicitParams = ParamInfo.getNumTypeObjects() != 0;
1462 for (auto &&C : LSI->Captures) {
1497 getGenericLambdaTemplateParameterList(LSI, *this);
1545 LSI->CallOperator->isConsteval()
1549 LSI->CallOperator->isConsteval();
1551 getLangOpts().CPlusPlus20 && LSI->CallOperator->isImmediateEscalating();
1556 LambdaScopeInfo *LSI = cast<LambdaScopeInfo>(FunctionScopes.back());
1567 CXXRecordDecl *Class = LSI->Lambda;
1947 LambdaScopeInfo LSI = *cast<LambdaScopeInfo>(FunctionScopes.back());
1948 ActOnFinishFunctionBody(LSI.CallOperator, Body);
1949 return BuildLambdaExpr(StartLoc, Body->getEndLoc(), &LSI);
2068 LambdaScopeInfo *LSI) {
2072 SourceLocation CaptureDefaultLoc = LSI->CaptureDefaultLoc;
2074 mapImplicitCaptureStyle(LSI->ImpCaptureStyle);
2084 CallOperator = LSI->CallOperator;
2085 Class = LSI->Lambda;
2086 IntroducerRange = LSI->IntroducerRange;
2087 ExplicitParams = LSI->ExplicitParams;
2088 ExplicitResultType = !LSI->HasImplicitReturnType;
2089 LambdaCleanup = LSI->Cleanup;
2090 ContainsUnexpandedParameterPack = LSI->ContainsUnexpandedParameterPack;
2110 for (unsigned I = 0, N = LSI->Captures.size(); I != N; ++I) {
2111 const Capture &From = LSI->Captures[I];
2117 bool IsImplicit = I >= LSI->NumExplicitCaptures;
2122 SourceRange CaptureRange = LSI->ExplicitCaptureRanges[I];
2133 bool IsLast = (I + 1) == LSI->NumExplicitCaptures;
2249 DiagnoseShadowingLambdaDecls(LSI);