Lines Matching defs:LSI

95     const clang::sema::LambdaScopeInfo *LSI =
124 if (LSI->ImpCaptureStyle == sema::LambdaScopeInfo::ImpCap_None) {
125 if (IsCapturingVariable && !LSI->isCaptured(VarToCapture))
127 if (IsCapturingThis && !LSI->isCXXThisCaptured())
237 getGenericLambdaTemplateParameterList(LambdaScopeInfo *LSI, Sema &SemaRef) {
238 if (!LSI->GLTemplateParameterList && !LSI->TemplateParams.empty()) {
239 LSI->GLTemplateParameterList = TemplateParameterList::Create(
242 /*L angle loc*/ LSI->ExplicitTemplateParamsRange.getBegin(),
243 LSI->TemplateParams,
244 /*R angle loc*/LSI->ExplicitTemplateParamsRange.getEnd(),
245 LSI->RequiresClause.get());
247 return LSI->GLTemplateParameterList;
511 static void buildLambdaScopeReturnType(Sema &S, LambdaScopeInfo *LSI,
515 LSI->HasImplicitReturnType = false;
516 LSI->ReturnType = CallOperator->getReturnType();
517 if (!LSI->ReturnType->isDependentType() && !LSI->ReturnType->isVoidType())
518 S.RequireCompleteType(CallOperator->getBeginLoc(), LSI->ReturnType,
521 LSI->HasImplicitReturnType = true;
525 void Sema::buildLambdaScope(LambdaScopeInfo *LSI, CXXMethodDecl *CallOperator,
530 LSI->CallOperator = CallOperator;
532 LSI->Lambda = LambdaClass;
534 LSI->ImpCaptureStyle = LambdaScopeInfo::ImpCap_LambdaByval;
536 LSI->ImpCaptureStyle = LambdaScopeInfo::ImpCap_LambdaByref;
537 LSI->CaptureDefaultLoc = CaptureDefaultLoc;
538 LSI->IntroducerRange = IntroducerRange;
539 LSI->ExplicitParams = ExplicitParams;
540 LSI->Mutable = Mutable;
543 void Sema::finishLambdaExplicitCaptures(LambdaScopeInfo *LSI) {
544 LSI->finishedExplicitCaptures();
551 LambdaScopeInfo *LSI = getCurLambda();
552 assert(LSI && "Expected a lambda scope");
553 assert(LSI->NumExplicitTemplateParams == 0 &&
555 assert(LSI->TemplateParams.empty() &&
560 LSI->TemplateParams.append(TParams.begin(), TParams.end());
561 LSI->NumExplicitTemplateParams = TParams.size();
562 LSI->ExplicitTemplateParamsRange = {LAngleLoc, RAngleLoc};
563 LSI->RequiresClause = RequiresClause;
878 void Sema::addInitCapture(LambdaScopeInfo *LSI, VarDecl *Var, bool ByRef) {
880 LSI->addCapture(Var, /*isBlock=*/false, ByRef,
1018 LambdaScopeInfo *LSI = getCurrentLambdaScopeUnsafe(*this);
1024 getGenericLambdaTemplateParameterList(LSI, *this);
1029 Method->setLexicalDeclContext(LSI->Lambda);
1036 LSI->Lambda->addDecl(TemplateMethod);
1039 LSI->Lambda->addDecl(Method);
1041 LSI->Lambda->setLambdaIsGeneric(TemplateParams);
1042 LSI->Lambda->setLambdaTypeInfo(MethodTyInfo);
1048 Method->setType(buildTypeForLambdaCallOperator(*this, LSI->Lambda,
1061 buildLambdaScopeReturnType(*this, LSI, Method, HasExplicitResultType);
1067 LambdaScopeInfo *LSI = getCurLambda();
1068 assert(LSI && "LambdaScopeInfo should be on stack!");
1071 LSI->ImpCaptureStyle = LambdaScopeInfo::ImpCap_LambdaByval;
1073 LSI->ImpCaptureStyle = LambdaScopeInfo::ImpCap_LambdaByref;
1074 LSI->CaptureDefaultLoc = Intro.DefaultLoc;
1075 LSI->IntroducerRange = Intro.Range;
1076 LSI->AfterParameterList = false;
1078 assert(LSI->NumExplicitTemplateParams == 0);
1109 LSI->Lambda = Class;
1112 LSI->CallOperator = Method;
1138 if (LSI->isCXXThisCaptured()) {
1140 << "'this'" << SourceRange(LSI->getCXXThisCapture().getLocation())
1168 if (!LSI->Captures.empty())
1169 LSI->ExplicitCaptureRanges[LSI->Captures.size() - 1] = C->ExplicitRange;
1327 addInitCapture(LSI, cast<VarDecl>(Var), C->Kind == LCK_ByRef);
1333 if (!LSI->Captures.empty())
1334 LSI->ExplicitCaptureRanges[LSI->Captures.size() - 1] = C->ExplicitRange;
1336 finishLambdaExplicitCaptures(LSI);
1337 LSI->ContainsUnexpandedParameterPack |= ContainsUnexpandedParameterPack;
1344 LambdaScopeInfo *LSI = getCurrentLambdaScopeUnsafe(*this);
1345 LSI->Mutable = MutableLoc.isValid();
1346 ContextRAII Context(*this, LSI->CallOperator, /*NewThisContext*/ false);
1360 !LSI->Lambda->getParent()->isFunctionOrMethod() &&
1369 LambdaScopeInfo *LSI = getCurrentLambdaScopeUnsafe(*this);
1370 PushDeclContext(LambdaScope, LSI->CallOperator);
1374 Param->setOwningFunction(LSI->CallOperator);
1384 getGenericLambdaTemplateParameterList(LSI, *this);
1386 AddTemplateParametersToLambdaCallOperator(LSI->CallOperator, LSI->Lambda,
1388 LSI->Lambda->setLambdaIsGeneric(true);
1389 LSI->ContainsUnexpandedParameterPack |=
1392 LSI->AfterParameterList = true;
1399 LambdaScopeInfo *LSI = getCurrentLambdaScopeUnsafe(*this);
1400 LSI->CallOperator->setConstexprKind(DS.getConstexprSpecifier());
1417 CXXRecordDecl *Class = LSI->Lambda;
1418 CXXMethodDecl *Method = LSI->CallOperator;
1423 LSI->ExplicitParams = ParamInfo.getNumTypeObjects() != 0;
1472 for (auto &&C : LSI->Captures) {
1507 getGenericLambdaTemplateParameterList(LSI, *this);
1555 LSI->CallOperator->isConsteval()
1559 LSI->CallOperator->isConsteval();
1561 getLangOpts().CPlusPlus20 && LSI->CallOperator->isImmediateEscalating();
1566 LambdaScopeInfo *LSI = cast<LambdaScopeInfo>(FunctionScopes.back());
1577 CXXRecordDecl *Class = LSI->Lambda;
1955 LambdaScopeInfo LSI = *cast<LambdaScopeInfo>(FunctionScopes.back());
1957 if (LSI.CallOperator->hasAttr<SYCLKernelEntryPointAttr>())
1958 SYCL().CheckSYCLEntryPointFunctionDecl(LSI.CallOperator);
1960 ActOnFinishFunctionBody(LSI.CallOperator, Body);
1962 return BuildLambdaExpr(StartLoc, Body->getEndLoc(), &LSI);
2081 LambdaScopeInfo *LSI) {
2085 SourceLocation CaptureDefaultLoc = LSI->CaptureDefaultLoc;
2087 mapImplicitCaptureStyle(LSI->ImpCaptureStyle);
2097 CallOperator = LSI->CallOperator;
2098 Class = LSI->Lambda;
2099 IntroducerRange = LSI->IntroducerRange;
2100 ExplicitParams = LSI->ExplicitParams;
2101 ExplicitResultType = !LSI->HasImplicitReturnType;
2102 LambdaCleanup = LSI->Cleanup;
2103 ContainsUnexpandedParameterPack = LSI->ContainsUnexpandedParameterPack;
2123 for (unsigned I = 0, N = LSI->Captures.size(); I != N; ++I) {
2124 const Capture &From = LSI->Captures[I];
2130 bool IsImplicit = I >= LSI->NumExplicitCaptures;
2135 SourceRange CaptureRange = LSI->ExplicitCaptureRanges[I];
2146 bool IsLast = (I + 1) == LSI->NumExplicitCaptures;
2262 DiagnoseShadowingLambdaDecls(LSI);
2294 maybeAddDeclWithEffects(LSI->CallOperator);