Lines Matching refs:SemaRef
40 Sema &SemaRef, Expr *E,
167 Sema &SemaRef; member in __anon45dbc4930111::DSAStackTy
191 explicit DSAStackTy(Sema &S) : SemaRef(S) {} in DSAStackTy()
254 const FunctionScopeInfo *CurFnScope = SemaRef.getCurFunction(); in pushFunction()
265 for (const FunctionScopeInfo *FSI : llvm::reverse(SemaRef.FunctionScopes)) { in popFunction()
412 SemaRef.Diag(CNew->getBeginLoc(), in hasDuplicateRequiresClause()
415 SemaRef.Diag(CPrev->getBeginLoc(), in hasDuplicateRequiresClause()
933 static VarDecl *buildVarDecl(Sema &SemaRef, SourceLocation Loc, QualType Type, in buildVarDecl() argument
936 DeclContext *DC = SemaRef.CurContext; in buildVarDecl()
937 IdentifierInfo *II = &SemaRef.PP.getIdentifierTable().get(Name); in buildVarDecl()
938 TypeSourceInfo *TInfo = SemaRef.Context.getTrivialTypeSourceInfo(Type, Loc); in buildVarDecl()
940 VarDecl::Create(SemaRef.Context, DC, Loc, Loc, II, Type, TInfo, SC_None); in buildVarDecl()
949 OMPReferencedVarAttr::CreateImplicit(SemaRef.Context, OrigRef)); in buildVarDecl()
980 VarDecl *VD = buildVarDecl(SemaRef, SR.getBegin(), in addTaskgroupReductionData()
981 SemaRef.Context.VoidPtrTy, ".task_red."); in addTaskgroupReductionData()
983 buildDeclRefExpr(SemaRef, VD, SemaRef.Context.VoidPtrTy, SR.getBegin()); in addTaskgroupReductionData()
1003 VarDecl *VD = buildVarDecl(SemaRef, SR.getBegin(), in addTaskgroupReductionData()
1004 SemaRef.Context.VoidPtrTy, ".task_red."); in addTaskgroupReductionData()
1006 buildDeclRefExpr(SemaRef, VD, SemaRef.Context.VoidPtrTy, SR.getBegin()); in addTaskgroupReductionData()
1087 static bool isConstNotMutableType(Sema &SemaRef, QualType Type, in isConstNotMutableType() argument
1090 ASTContext &Context = SemaRef.getASTContext(); in isConstNotMutableType()
1094 const CXXRecordDecl *RD = AcceptIfMutable && SemaRef.getLangOpts().CPlusPlus in isConstNotMutableType()
1102 return IsConstant && !(SemaRef.getLangOpts().CPlusPlus && RD && in isConstNotMutableType()
1106 static bool rejectConstNotMutableType(Sema &SemaRef, const ValueDecl *D, in rejectConstNotMutableType() argument
1111 ASTContext &Context = SemaRef.getASTContext(); in rejectConstNotMutableType()
1113 if (isConstNotMutableType(SemaRef, Type, AcceptIfMutable, &IsClassType)) { in rejectConstNotMutableType()
1118 SemaRef.Diag(ELoc, Diag) << getOpenMPClauseName(CKind); in rejectConstNotMutableType()
1123 SemaRef.Diag(D->getLocation(), in rejectConstNotMutableType()
1146 SemaRef, VD, D->getType().getNonReferenceType(), in getTopDSA()
1157 SemaRef.getLangOpts().OpenMPUseTLS && in getTopDSA()
1158 SemaRef.getASTContext().getTargetInfo().isTLSSupported())) || in getTopDSA()
1162 SemaRef, VD, D->getType().getNonReferenceType(), D->getLocation()); in getTopDSA()
1167 if (SemaRef.getLangOpts().OpenMPCUDAMode && VD && in getTopDSA()
1181 buildDeclRefExpr(SemaRef, VD, D->getType().getNonReferenceType(), in getTopDSA()
1196 if (!SemaRef.isOpenMPCapturedByRef( in getTopDSA()
1199 buildDeclRefExpr(SemaRef, VD, D->getType().getNonReferenceType(), in getTopDSA()
1231 if (SemaRef.LangOpts.OpenMP <= 31) { in getTopDSA()
1236 if (isConstNotMutableType(SemaRef, D->getType())) { in getTopDSA()
1820 Expr *NumIterations, Sema &SemaRef,
1827 Sema &SemaRef; member in __anon45dbc4931011::VarDeclFilterCCC
1830 explicit VarDeclFilterCCC(Sema &S) : SemaRef(S) {} in VarDeclFilterCCC()
1835 SemaRef.isDeclInScope(ND, SemaRef.getCurLexicalContext(), in ValidateCandidate()
1836 SemaRef.getCurScope()); in ValidateCandidate()
1844 Sema &SemaRef; member in __anon45dbc4931011::VarOrFuncDeclFilterCCC
1847 explicit VarOrFuncDeclFilterCCC(Sema &S) : SemaRef(S) {} in VarOrFuncDeclFilterCCC()
1851 return SemaRef.isDeclInScope(ND, SemaRef.getCurLexicalContext(), in ValidateCandidate()
1852 SemaRef.getCurScope()); in ValidateCandidate()
1997 Sema &SemaRef; member in __anon45dbc4931111::LocalVarRefChecker
2003 SemaRef.Diag(E->getBeginLoc(), in VisitDeclRefExpr()
2006 SemaRef.Diag(VD->getLocation(), diag::note_defined_here) in VisitDeclRefExpr()
2020 explicit LocalVarRefChecker(Sema &SemaRef) : SemaRef(SemaRef) {} in LocalVarRefChecker() argument
2129 static void reportOriginalDsa(Sema &SemaRef, const DSAStackTy *Stack, in reportOriginalDsa() argument
2134 SemaRef.Diag(DVar.RefExpr->getExprLoc(), diag::note_omp_explicit_dsa) in reportOriginalDsa()
2170 else if (D->getType().isConstant(SemaRef.getASTContext())) in reportOriginalDsa()
2177 SemaRef.Diag(ReportLoc, diag::note_omp_predetermined_dsa) in reportOriginalDsa()
2181 SemaRef.Diag(DVar.ImplicitDSALoc, diag::note_omp_implicit_dsa) in reportOriginalDsa()
2189 Sema &SemaRef; member in __anon45dbc4931311::DSAAttrChecker
2215 SemaRef, VD, VD->getType().getNonLValueExprType(SemaRef.Context), in VisitSubCaptures()
2310 SemaRef.Diag(ELoc, diag::err_omp_reduction_in_task); in VisitDeclRefExpr()
2311 reportOriginalDsa(SemaRef, Stack, VD, DVar); in VisitDeclRefExpr()
2379 SemaRef.Diag(ELoc, diag::err_omp_reduction_in_task); in VisitMemberExpr()
2380 reportOriginalDsa(SemaRef, Stack, FD, DVar); in VisitMemberExpr()
2399 if (!checkMapClauseExpressionBase(SemaRef, E, CurComponents, OMPC_map, in VisitMemberExpr()
2476 DSAAttrChecker(DSAStackTy *S, Sema &SemaRef, CapturedStmt *CS) in DSAAttrChecker() argument
2477 : Stack(S), SemaRef(SemaRef), ErrorFound(false), CS(CS) {} in DSAAttrChecker()
3033 static bool checkCancelRegion(Sema &SemaRef, OpenMPDirectiveKind CurrentRegion, in checkCancelRegion() argument
3044 SemaRef.Diag(StartLoc, diag::err_omp_wrong_cancel_region) in checkCancelRegion()
3049 static bool checkNestingOfRegions(Sema &SemaRef, const DSAStackTy *Stack, in checkNestingOfRegions() argument
3076 SemaRef.Diag(StartLoc, (CurrentRegion != OMPD_simd) in checkNestingOfRegions()
3084 SemaRef.Diag(StartLoc, diag::err_omp_prohibited_region_atomic); in checkNestingOfRegions()
3094 SemaRef.Diag(StartLoc, diag::err_omp_orphaned_section_directive) in checkNestingOfRegions()
3161 SemaRef.Diag(StartLoc, in checkNestingOfRegions()
3165 SemaRef.Diag(PreviousCriticalLoc, in checkNestingOfRegions()
3254 SemaRef.Diag(StartLoc, diag::err_omp_orphaned_device_directive) in checkNestingOfRegions()
3257 SemaRef.Diag(StartLoc, diag::err_omp_prohibited_region) in checkNestingOfRegions()
3955 Sema &SemaRef; member in __anon45dbc4932111::OpenMPIterationSpaceChecker
3989 OpenMPIterationSpaceChecker(Sema &SemaRef, SourceLocation DefaultLoc) in OpenMPIterationSpaceChecker() argument
3990 : SemaRef(SemaRef), DefaultLoc(DefaultLoc), ConditionLoc(DefaultLoc) {} in OpenMPIterationSpaceChecker()
4109 ExprResult Val = SemaRef.PerformOpenMPImplicitIntegerConversion( in setStep()
4127 bool IsConstant = NewStep->isIntegerConstantExpr(Result, SemaRef.Context); in setStep()
4142 SemaRef.Diag(NewStep->getExprLoc(), in setStep()
4145 SemaRef.Diag(ConditionLoc, in setStep()
4152 SemaRef.CreateBuiltinUnaryOp(NewStep->getExprLoc(), UO_Minus, NewStep) in setStep()
4174 SemaRef.Diag(DefaultLoc, diag::err_omp_loop_not_canonical_init); in checkAndSetInit()
4206 SemaRef.Diag(S->getBeginLoc(), in checkAndSetInit()
4211 buildDeclRefExpr(SemaRef, Var, in checkAndSetInit()
4235 if (dependent() || SemaRef.CurContext->isDependentContext()) in checkAndSetInit()
4238 SemaRef.Diag(S->getBeginLoc(), diag::err_omp_loop_not_canonical_init) in checkAndSetInit()
4274 SemaRef.Diag(DefaultLoc, diag::err_omp_loop_not_canonical_cond) << LCDecl; in checkAndSetCond()
4327 if (dependent() || SemaRef.CurContext->isDependentContext()) in checkAndSetCond()
4329 SemaRef.Diag(CondLoc, diag::err_omp_loop_not_canonical_cond) in checkAndSetCond()
4358 if (dependent() || SemaRef.CurContext->isDependentContext()) in checkAndSetIncRHS()
4360 SemaRef.Diag(RHS->getBeginLoc(), diag::err_omp_loop_not_canonical_incr) in checkAndSetIncRHS()
4380 SemaRef.Diag(DefaultLoc, diag::err_omp_loop_not_canonical_incr) << LCDecl; in checkAndSetInc()
4392 return setStep(SemaRef in checkAndSetInc()
4416 return setStep(SemaRef in checkAndSetInc()
4436 if (dependent() || SemaRef.CurContext->isDependentContext()) in checkAndSetInc()
4438 SemaRef.Diag(S->getBeginLoc(), diag::err_omp_loop_not_canonical_incr) in checkAndSetInc()
4444 tryBuildCapture(Sema &SemaRef, Expr *Capture, in tryBuildCapture() argument
4446 if (SemaRef.CurContext->isDependentContext()) in tryBuildCapture()
4448 if (Capture->isEvaluatable(SemaRef.Context, Expr::SE_AllowSideEffects)) in tryBuildCapture()
4449 return SemaRef.PerformImplicitConversion( in tryBuildCapture()
4454 return buildCapture(SemaRef, Capture, I->second); in tryBuildCapture()
4456 ExprResult Res = buildCapture(SemaRef, Capture, Ref); in tryBuildCapture()
4468 SemaRef.getLangOpts().CPlusPlus) { in buildNumIterations()
4472 Expr *Upper = tryBuildCapture(SemaRef, UBExpr, Captures).get(); in buildNumIterations()
4473 Expr *Lower = tryBuildCapture(SemaRef, LBExpr, Captures).get(); in buildNumIterations()
4477 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Sub, Upper, Lower); in buildNumIterations()
4482 SemaRef.Diag(Upper->getBeginLoc(), diag::err_omp_loop_diff_cxx) in buildNumIterations()
4493 Diff = SemaRef.BuildBinOp( in buildNumIterations()
4495 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); in buildNumIterations()
4500 ExprResult NewStep = tryBuildCapture(SemaRef, Step, Captures); in buildNumIterations()
4503 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Add, Diff.get(), NewStep.get()); in buildNumIterations()
4508 Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); in buildNumIterations()
4513 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Div, Diff.get(), NewStep.get()); in buildNumIterations()
4519 ASTContext &C = SemaRef.Context; in buildNumIterations()
4528 if (!SemaRef.Context.hasSameType(Diff.get()->getType(), Type)) { in buildNumIterations()
4529 Diff = SemaRef.PerformImplicitConversion( in buildNumIterations()
4540 SemaRef.Diag(DefaultLoc, diag::warn_omp_loop_64_bit_var) in buildNumIterations()
4546 if (!SemaRef.Context.hasSameType(Diff.get()->getType(), NewType)) { in buildNumIterations()
4547 Diff = SemaRef.PerformImplicitConversion(Diff.get(), NewType, in buildNumIterations()
4562 bool Suppress = SemaRef.getDiagnostics().getSuppressAllDiagnostics(); in buildPreCond()
4563 SemaRef.getDiagnostics().setSuppressAllDiagnostics(/*Val=*/true); in buildPreCond()
4565 ExprResult NewLB = tryBuildCapture(SemaRef, LB, Captures); in buildPreCond()
4566 ExprResult NewUB = tryBuildCapture(SemaRef, UB, Captures); in buildPreCond()
4571 SemaRef.BuildBinOp(S, DefaultLoc, in buildPreCond()
4577 if (!SemaRef.Context.hasSameUnqualifiedType(CondExpr.get()->getType(), in buildPreCond()
4578 SemaRef.Context.BoolTy)) in buildPreCond()
4579 CondExpr = SemaRef.PerformImplicitConversion( in buildPreCond()
4580 CondExpr.get(), SemaRef.Context.BoolTy, /*Action=*/Sema::AA_Casting, in buildPreCond()
4583 SemaRef.getDiagnostics().setSuppressAllDiagnostics(Suppress); in buildPreCond()
4594 VD = SemaRef.isOpenMPCapturedDecl(LCDecl); in buildCounterVar()
4596 SemaRef, VD, VD->getType().getNonReferenceType(), DefaultLoc); in buildCounterVar()
4612 SemaRef, DefaultLoc, Type, LCDecl->getName(), in buildPrivateCounterVar()
4615 ? buildDeclRefExpr(SemaRef, cast<VarDecl>(LCDecl), Type, DefaultLoc) in buildPrivateCounterVar()
4619 return buildDeclRefExpr(SemaRef, PrivateVar, Type, DefaultLoc); in buildPrivateCounterVar()
4634 Expr *Cnt = SemaRef.DefaultLvalueConversion(Counter).get(); in buildOrderedLoopData()
4641 Cnt = SemaRef.BuildBinOp(S, Loc, BOK, Cnt, Inc).get(); in buildOrderedLoopData()
4648 SemaRef.getLangOpts().CPlusPlus) { in buildOrderedLoopData()
4651 TestIsLessOp.getValue() ? Cnt : tryBuildCapture(SemaRef, UB, Captures).get(); in buildOrderedLoopData()
4653 TestIsLessOp.getValue() ? tryBuildCapture(SemaRef, LB, Captures).get() : Cnt; in buildOrderedLoopData()
4657 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Sub, Upper, Lower); in buildOrderedLoopData()
4662 SemaRef.Diag(Upper->getBeginLoc(), diag::err_omp_loop_diff_cxx) in buildOrderedLoopData()
4672 Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); in buildOrderedLoopData()
4676 ExprResult NewStep = tryBuildCapture(SemaRef, Step, Captures); in buildOrderedLoopData()
4680 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Div, Diff.get(), NewStep.get()); in buildOrderedLoopData()
4754 OpenMPDirectiveKind DKind, Stmt *S, Sema &SemaRef, DSAStackTy &DSA, in checkOpenMPIterationSpace() argument
4765 SemaRef.Diag(S->getBeginLoc(), diag::err_omp_not_for) in checkOpenMPIterationSpace()
4771 SemaRef.Diag(DSA.getConstructLoc(), in checkOpenMPIterationSpace()
4776 SemaRef.Diag(CollapseLoopCountExpr->getExprLoc(), in checkOpenMPIterationSpace()
4780 SemaRef.Diag(OrderedLoopCountExpr->getExprLoc(), in checkOpenMPIterationSpace()
4788 OpenMPIterationSpaceChecker ISC(SemaRef, For->getForLoc()); in checkOpenMPIterationSpace()
4809 !(SemaRef.getLangOpts().CPlusPlus && VarType->isOverloadableType())) { in checkOpenMPIterationSpace()
4810 SemaRef.Diag(Init->getBeginLoc(), diag::err_omp_loop_variable_type) in checkOpenMPIterationSpace()
4811 << SemaRef.getLangOpts().CPlusPlus; in checkOpenMPIterationSpace()
4848 SemaRef.Diag(Init->getBeginLoc(), diag::err_omp_loop_var_dsa) in checkOpenMPIterationSpace()
4853 reportOriginalDsa(SemaRef, &DSA, LCDecl, DVar, /*IsLoopIterVar=*/true); in checkOpenMPIterationSpace()
4876 if (ISC.dependent() || SemaRef.CurContext->isDependentContext() || HasErrors) in checkOpenMPIterationSpace()
4943 buildCounterInit(Sema &SemaRef, Scope *S, SourceLocation Loc, ExprResult VarRef, in buildCounterInit() argument
4947 ExprResult NewStart = tryBuildCapture(SemaRef, Start.get(), Captures); in buildCounterInit()
4950 if (!SemaRef.Context.hasSameType(NewStart.get()->getType(), in buildCounterInit()
4952 NewStart = SemaRef.PerformImplicitConversion( in buildCounterInit()
4960 SemaRef.BuildBinOp(S, Loc, BO_Assign, VarRef.get(), NewStart.get()); in buildCounterInit()
4966 Sema &SemaRef, Scope *S, SourceLocation Loc, ExprResult VarRef, in buildCounterUpdate() argument
4970 Iter = SemaRef.ActOnParenExpr(Loc, Loc, Iter.get()); in buildCounterUpdate()
4977 NewStep = tryBuildCapture(SemaRef, Step.get(), *Captures); in buildCounterUpdate()
4981 SemaRef.BuildBinOp(S, Loc, BO_Mul, Iter.get(), NewStep.get()); in buildCounterUpdate()
4989 NewStart = tryBuildCapture(SemaRef, Start.get(), *Captures); in buildCounterUpdate()
4999 bool Suppress = SemaRef.getDiagnostics().getSuppressAllDiagnostics(); in buildCounterUpdate()
5000 SemaRef.getDiagnostics().setSuppressAllDiagnostics(/*Val=*/true); in buildCounterUpdate()
5002 SemaRef.BuildBinOp(S, Loc, BO_Assign, VarRef.get(), NewStart.get()); in buildCounterUpdate()
5005 SemaRef.BuildBinOp(S, Loc, Subtract ? BO_SubAssign : BO_AddAssign, in buildCounterUpdate()
5008 Update = SemaRef.CreateBuiltinBinOp(Loc, BO_Comma, Update.get(), in buildCounterUpdate()
5012 SemaRef.getDiagnostics().setSuppressAllDiagnostics(Suppress); in buildCounterUpdate()
5017 Update = SemaRef.BuildBinOp(S, Loc, Subtract ? BO_Sub : BO_Add, in buildCounterUpdate()
5022 if (!SemaRef.Context.hasSameType(Update.get()->getType(), in buildCounterUpdate()
5024 Update = SemaRef.PerformImplicitConversion( in buildCounterUpdate()
5030 Update = SemaRef.BuildBinOp(S, Loc, BO_Assign, VarRef.get(), Update.get()); in buildCounterUpdate()
5037 static ExprResult widenIterationCount(unsigned Bits, Expr *E, Sema &SemaRef) { in widenIterationCount() argument
5040 ASTContext &C = SemaRef.Context; in widenIterationCount()
5047 return SemaRef.PerformImplicitConversion(E, NewType, Sema::AA_Converting, in widenIterationCount()
5053 static bool fitsInto(unsigned Bits, bool Signed, const Expr *E, Sema &SemaRef) { in fitsInto() argument
5057 if (E->isIntegerConstantExpr(Result, SemaRef.Context)) in fitsInto()
5111 Expr *OrderedLoopCountExpr, Stmt *AStmt, Sema &SemaRef, in checkOpenMPLoop() argument
5119 if (CollapseLoopCountExpr->EvaluateAsInt(Result, SemaRef.getASTContext())) in checkOpenMPLoop()
5126 if (OrderedLoopCountExpr->EvaluateAsInt(EVResult, SemaRef.getASTContext())) { in checkOpenMPLoop()
5129 SemaRef.Diag(OrderedLoopCountExpr->getExprLoc(), in checkOpenMPLoop()
5132 SemaRef.Diag(CollapseLoopCountExpr->getExprLoc(), in checkOpenMPLoop()
5147 DKind, CurStmt, SemaRef, DSA, Cnt, NestedLoopCount, in checkOpenMPLoop()
5161 DKind, CurStmt, SemaRef, DSA, Cnt, NestedLoopCount, in checkOpenMPLoop()
5183 if (SemaRef.CurContext->isDependentContext()) in checkOpenMPLoop()
5221 SemaRef in checkOpenMPLoop()
5226 SemaRef); in checkOpenMPLoop()
5229 SemaRef in checkOpenMPLoop()
5234 SemaRef); in checkOpenMPLoop()
5239 ASTContext &C = SemaRef.Context; in checkOpenMPLoop()
5246 SemaRef.BuildBinOp(CurScope, PreCond.get()->getExprLoc(), BO_LAnd, in checkOpenMPLoop()
5253 LastIteration32 = SemaRef.BuildBinOp( in checkOpenMPLoop()
5255 SemaRef in checkOpenMPLoop()
5261 LastIteration64 = SemaRef.BuildBinOp( in checkOpenMPLoop()
5263 SemaRef in checkOpenMPLoop()
5272 if (SemaRef.getLangOpts().OpenMPOptimisticCollapse || in checkOpenMPLoop()
5279 LastIteration64.get(), SemaRef)))) in checkOpenMPLoop()
5286 SemaRef.Context.getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/0); in checkOpenMPLoop()
5288 SemaRef.Context.getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/1); in checkOpenMPLoop()
5297 LastIteration = SemaRef.BuildBinOp( in checkOpenMPLoop()
5300 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); in checkOpenMPLoop()
5309 LastIteration.get()->isIntegerConstantExpr(Result, SemaRef.Context); in checkOpenMPLoop()
5313 tryBuildCapture(SemaRef, LastIteration.get(), Captures); in checkOpenMPLoop()
5317 NumIterations = SemaRef.BuildBinOp( in checkOpenMPLoop()
5319 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); in checkOpenMPLoop()
5331 VarDecl *LBDecl = buildVarDecl(SemaRef, InitLoc, VType, ".omp.lb"); in checkOpenMPLoop()
5332 LB = buildDeclRefExpr(SemaRef, LBDecl, VType, InitLoc); in checkOpenMPLoop()
5333 SemaRef.AddInitializerToDecl(LBDecl, in checkOpenMPLoop()
5334 SemaRef.ActOnIntegerConstant(InitLoc, 0).get(), in checkOpenMPLoop()
5338 VarDecl *UBDecl = buildVarDecl(SemaRef, InitLoc, VType, ".omp.ub"); in checkOpenMPLoop()
5339 UB = buildDeclRefExpr(SemaRef, UBDecl, VType, InitLoc); in checkOpenMPLoop()
5340 SemaRef.AddInitializerToDecl(UBDecl, LastIteration.get(), in checkOpenMPLoop()
5345 QualType Int32Ty = SemaRef.Context.getIntTypeForBitwidth(32, true); in checkOpenMPLoop()
5346 VarDecl *ILDecl = buildVarDecl(SemaRef, InitLoc, Int32Ty, ".omp.is_last"); in checkOpenMPLoop()
5347 IL = buildDeclRefExpr(SemaRef, ILDecl, Int32Ty, InitLoc); in checkOpenMPLoop()
5348 SemaRef.AddInitializerToDecl(ILDecl, in checkOpenMPLoop()
5349 SemaRef.ActOnIntegerConstant(InitLoc, 0).get(), in checkOpenMPLoop()
5354 buildVarDecl(SemaRef, InitLoc, StrideVType, ".omp.stride"); in checkOpenMPLoop()
5355 ST = buildDeclRefExpr(SemaRef, STDecl, StrideVType, InitLoc); in checkOpenMPLoop()
5356 SemaRef.AddInitializerToDecl(STDecl, in checkOpenMPLoop()
5357 SemaRef.ActOnIntegerConstant(InitLoc, 1).get(), in checkOpenMPLoop()
5362 ExprResult IsUBGreater = SemaRef.BuildBinOp(CurScope, InitLoc, BO_GT, in checkOpenMPLoop()
5364 ExprResult CondOp = SemaRef.ActOnConditionalOp( in checkOpenMPLoop()
5367 EUB = SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, UB.get(), in checkOpenMPLoop()
5369 EUB = SemaRef.ActOnFinishFullExpr(EUB.get()); in checkOpenMPLoop()
5378 buildVarDecl(SemaRef, InitLoc, VType, ".omp.comb.lb"); in checkOpenMPLoop()
5379 CombLB = buildDeclRefExpr(SemaRef, CombLBDecl, VType, InitLoc); in checkOpenMPLoop()
5380 SemaRef.AddInitializerToDecl( in checkOpenMPLoop()
5381 CombLBDecl, SemaRef.ActOnIntegerConstant(InitLoc, 0).get(), in checkOpenMPLoop()
5386 buildVarDecl(SemaRef, InitLoc, VType, ".omp.comb.ub"); in checkOpenMPLoop()
5387 CombUB = buildDeclRefExpr(SemaRef, CombUBDecl, VType, InitLoc); in checkOpenMPLoop()
5388 SemaRef.AddInitializerToDecl(CombUBDecl, LastIteration.get(), in checkOpenMPLoop()
5391 ExprResult CombIsUBGreater = SemaRef.BuildBinOp( in checkOpenMPLoop()
5394 SemaRef.ActOnConditionalOp(InitLoc, InitLoc, CombIsUBGreater.get(), in checkOpenMPLoop()
5396 CombEUB = SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, CombUB.get(), in checkOpenMPLoop()
5398 CombEUB = SemaRef.ActOnFinishFullExpr(CombEUB.get()); in checkOpenMPLoop()
5414 buildDeclRefExpr(SemaRef, PrevLBDecl, PrevLBDecl->getType(), InitLoc); in checkOpenMPLoop()
5416 buildDeclRefExpr(SemaRef, PrevUBDecl, PrevUBDecl->getType(), InitLoc); in checkOpenMPLoop()
5424 VarDecl *IVDecl = buildVarDecl(SemaRef, InitLoc, RealVType, ".omp.iv"); in checkOpenMPLoop()
5425 IV = buildDeclRefExpr(SemaRef, IVDecl, RealVType, InitLoc); in checkOpenMPLoop()
5430 : SemaRef.ActOnIntegerConstant(SourceLocation(), 0).get(); in checkOpenMPLoop()
5431 Init = SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, IV.get(), RHS); in checkOpenMPLoop()
5432 Init = SemaRef.ActOnFinishFullExpr(Init.get()); in checkOpenMPLoop()
5440 : SemaRef.ActOnIntegerConstant(SourceLocation(), 0).get(); in checkOpenMPLoop()
5442 SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, IV.get(), CombRHS); in checkOpenMPLoop()
5443 CombInit = SemaRef.ActOnFinishFullExpr(CombInit.get()); in checkOpenMPLoop()
5452 ? SemaRef.BuildBinOp(CurScope, CondLoc, BO_LE, IV.get(), UB.get()) in checkOpenMPLoop()
5453 : SemaRef.BuildBinOp(CurScope, CondLoc, BO_LT, IV.get(), in checkOpenMPLoop()
5458 SemaRef.BuildBinOp( in checkOpenMPLoop()
5465 SemaRef.BuildBinOp(CurScope, CondLoc, BO_LE, IV.get(), CombUB.get()); in checkOpenMPLoop()
5470 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, IV.get(), in checkOpenMPLoop()
5471 SemaRef.ActOnIntegerConstant(IncLoc, 1).get()); in checkOpenMPLoop()
5474 Inc = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, IV.get(), Inc.get()); in checkOpenMPLoop()
5475 Inc = SemaRef.ActOnFinishFullExpr(Inc.get()); in checkOpenMPLoop()
5487 NextLB = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, LB.get(), ST.get()); in checkOpenMPLoop()
5492 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, LB.get(), NextLB.get()); in checkOpenMPLoop()
5493 NextLB = SemaRef.ActOnFinishFullExpr(NextLB.get()); in checkOpenMPLoop()
5497 NextUB = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, UB.get(), ST.get()); in checkOpenMPLoop()
5502 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, UB.get(), NextUB.get()); in checkOpenMPLoop()
5503 NextUB = SemaRef.ActOnFinishFullExpr(NextUB.get()); in checkOpenMPLoop()
5508 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, CombLB.get(), ST.get()); in checkOpenMPLoop()
5512 CombNextLB = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, CombLB.get(), in checkOpenMPLoop()
5514 CombNextLB = SemaRef.ActOnFinishFullExpr(CombNextLB.get()); in checkOpenMPLoop()
5519 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, CombUB.get(), ST.get()); in checkOpenMPLoop()
5523 CombNextUB = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, CombUB.get(), in checkOpenMPLoop()
5525 CombNextUB = SemaRef.ActOnFinishFullExpr(CombNextUB.get()); in checkOpenMPLoop()
5538 DistCond = SemaRef.BuildBinOp(CurScope, CondLoc, BO_LE, IV.get(), UB.get()); in checkOpenMPLoop()
5542 SemaRef.BuildBinOp(CurScope, DistIncLoc, BO_Add, IV.get(), ST.get()); in checkOpenMPLoop()
5544 DistInc = SemaRef.BuildBinOp(CurScope, DistIncLoc, BO_Assign, IV.get(), in checkOpenMPLoop()
5546 DistInc = SemaRef.ActOnFinishFullExpr(DistInc.get()); in checkOpenMPLoop()
5553 SemaRef.BuildBinOp(CurScope, DistEUBLoc, BO_GT, UB.get(), PrevUB.get()); in checkOpenMPLoop()
5554 ExprResult CondOp = SemaRef.ActOnConditionalOp( in checkOpenMPLoop()
5556 PrevEUB = SemaRef.BuildBinOp(CurScope, DistIncLoc, BO_Assign, UB.get(), in checkOpenMPLoop()
5558 PrevEUB = SemaRef.ActOnFinishFullExpr(PrevEUB.get()); in checkOpenMPLoop()
5563 SemaRef.BuildBinOp(CurScope, CondLoc, BO_LE, IV.get(), PrevUB.get()); in checkOpenMPLoop()
5596 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get(); in checkOpenMPLoop()
5598 Prod = SemaRef.BuildBinOp(CurScope, UpdLoc, BO_Mul, Prod.get(), in checkOpenMPLoop()
5605 Iter = SemaRef.BuildBinOp(CurScope, UpdLoc, BO_Div, in checkOpenMPLoop()
5619 Prod = SemaRef.BuildBinOp(CurScope, UpdLoc, BO_Mul, in checkOpenMPLoop()
5623 Acc = SemaRef.BuildBinOp(CurScope, UpdLoc, BO_Sub, in checkOpenMPLoop()
5629 SemaRef, VD, IS.CounterVar->getType(), IS.CounterVar->getExprLoc(), in checkOpenMPLoop()
5631 ExprResult Init = buildCounterInit(SemaRef, CurScope, UpdLoc, CounterVar, in checkOpenMPLoop()
5638 SemaRef, CurScope, UpdLoc, CounterVar, IS.CounterInit, Iter, in checkOpenMPLoop()
5647 SemaRef, CurScope, UpdLoc, CounterVar, IS.CounterInit, in checkOpenMPLoop()
5675 SemaRef.ActOnFinishFullExpr(CalcLastIteration.get()).get(); in checkOpenMPLoop()
6324 Sema &SemaRef; member in __anon45dbc4932311::OpenMPAtomicUpdateChecker
6345 OpenMPAtomicUpdateChecker(Sema &SemaRef) in OpenMPAtomicUpdateChecker() argument
6346 : SemaRef(SemaRef), X(nullptr), E(nullptr), UpdateExpr(nullptr), in OpenMPAtomicUpdateChecker()
6398 X->IgnoreParenImpCasts()->Profile(XId, SemaRef.getASTContext(), in checkBinaryOperation()
6400 LHS->IgnoreParenImpCasts()->Profile(LHSId, SemaRef.getASTContext(), in checkBinaryOperation()
6402 RHS->IgnoreParenImpCasts()->Profile(RHSId, SemaRef.getASTContext(), in checkBinaryOperation()
6437 SemaRef.Diag(ErrorLoc, DiagId) << ErrorRange; in checkBinaryOperation()
6438 SemaRef.Diag(NoteLoc, NoteId) << ErrorFound << NoteRange; in checkBinaryOperation()
6441 if (SemaRef.CurContext->isDependentContext()) in checkBinaryOperation()
6485 E = SemaRef.ActOnIntegerConstant(OpLoc, /*uint64_t Val=*/1).get(); in checkStatement()
6510 SemaRef.Diag(ErrorLoc, DiagId) << ErrorRange; in checkStatement()
6511 SemaRef.Diag(NoteLoc, NoteId) << ErrorFound << NoteRange; in checkStatement()
6514 if (SemaRef.CurContext->isDependentContext()) in checkStatement()
6520 auto *OVEX = new (SemaRef.getASTContext()) in checkStatement()
6522 auto *OVEExpr = new (SemaRef.getASTContext()) in checkStatement()
6525 SemaRef.CreateBuiltinBinOp(OpLoc, Op, IsXLHSInRHSPart ? OVEX : OVEExpr, in checkStatement()
6529 Update = SemaRef.PerformImplicitConversion(Update.get(), X->getType(), in checkStatement()
8923 static bool isNonNegativeIntegerValue(Expr *&ValExpr, Sema &SemaRef, in isNonNegativeIntegerValue() argument
8930 SemaRef.PerformOpenMPImplicitIntegerConversion(Loc, ValExpr); in isNonNegativeIntegerValue()
8937 if (ValExpr->isIntegerConstantExpr(Result, SemaRef.Context) && in isNonNegativeIntegerValue()
8941 SemaRef.Diag(Loc, diag::err_omp_negative_expression_in_clause) in isNonNegativeIntegerValue()
10487 TransformExprToCaptures(Sema &SemaRef, ValueDecl *FieldDecl) in TransformExprToCaptures() argument
10488 : BaseTransform(SemaRef), Field(FieldDecl), CapturedExpr(nullptr) {} in TransformExprToCaptures()
10493 CapturedExpr = buildCapture(SemaRef, Field, E, /*WithInit=*/false); in TransformMemberExpr()
10514 static NamedDecl *findAcceptableDecl(Sema &SemaRef, NamedDecl *D) { in findAcceptableDecl() argument
10515 assert(!LookupResult::isVisible(SemaRef, D) && "not in slow case"); in findAcceptableDecl()
10523 if (LookupResult::isVisible(SemaRef, ND)) in findAcceptableDecl()
10531 argumentDependentLookup(Sema &SemaRef, const DeclarationNameInfo &ReductionId, in argumentDependentLookup() argument
10539 SemaRef.FindAssociatedClassesAndNamespaces(Loc, &OVE, AssociatedNamespaces, in argumentDependentLookup()
10574 if (!SemaRef.isVisible(D)) { in argumentDependentLookup()
10575 D = findAcceptableDecl(SemaRef, D); in argumentDependentLookup()
10588 buildDeclareReductionRef(Sema &SemaRef, SourceLocation Loc, SourceRange Range, in buildDeclareReductionRef() argument
10596 LookupResult Lookup(SemaRef, ReductionId, Sema::LookupOMPReductionName); in buildDeclareReductionRef()
10598 while (S && SemaRef.LookupParsedName(Lookup, S, &ReductionIdScopeSpec)) { in buildDeclareReductionRef()
10621 if (SemaRef.CurContext->isDependentContext() || Ty->isDependentType() || in buildDeclareReductionRef()
10639 SemaRef.Context, /*NamingClass=*/nullptr, in buildDeclareReductionRef()
10640 ReductionIdScopeSpec.getWithLocInContext(SemaRef.Context), ReductionId, in buildDeclareReductionRef()
10656 LookupResult Lookup(SemaRef, ReductionId, Sema::LookupOMPReductionName); in buildDeclareReductionRef()
10661 if (SemaRef.isCompleteType(Loc, Ty) || TyRec->isBeingDefined() || in buildDeclareReductionRef()
10664 SemaRef.LookupQualifiedName(Lookup, TyRec->getDecl()); in buildDeclareReductionRef()
10672 argumentDependentLookup(SemaRef, ReductionId, Loc, Ty, Lookups); in buildDeclareReductionRef()
10674 Lookups, [&SemaRef, Ty](ValueDecl *D) -> ValueDecl * { in buildDeclareReductionRef()
10676 SemaRef.Context.hasSameType(D->getType(), Ty)) in buildDeclareReductionRef()
10680 return SemaRef.BuildDeclRefExpr(VD, Ty, VK_LValue, Loc); in buildDeclareReductionRef()
10682 Lookups, [&SemaRef, Ty, Loc](ValueDecl *D) -> ValueDecl * { in buildDeclareReductionRef()
10684 SemaRef.IsDerivedFrom(Loc, Ty, D->getType()) && in buildDeclareReductionRef()
10691 if (SemaRef.IsDerivedFrom(Loc, Ty, VD->getType(), Paths)) { in buildDeclareReductionRef()
10692 if (!Paths.isAmbiguous(SemaRef.Context.getCanonicalType( in buildDeclareReductionRef()
10694 if (SemaRef.CheckBaseClassAccess(Loc, VD->getType(), Ty, Paths.front(), in buildDeclareReductionRef()
10697 SemaRef.BuildBasePathArray(Paths, BasePath); in buildDeclareReductionRef()
10698 return SemaRef.BuildDeclRefExpr(VD, Ty, VK_LValue, Loc); in buildDeclareReductionRef()
10704 SemaRef.Diag(Loc, diag::err_omp_not_resolved_reduction_identifier) << Range; in buildDeclareReductionRef()
11703 Expr *NumIterations, Sema &SemaRef, in FinishOpenMPLinearClause() argument
11713 Step = SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get(); in FinishOpenMPLinearClause()
11724 auto Res = getPrivateItem(SemaRef, SimpleRefExpr, ELoc, ERange); in FinishOpenMPLinearClause()
11738 SemaRef.Diag(ELoc, in FinishOpenMPLinearClause()
11754 buildDeclRefExpr(SemaRef, cast<VarDecl>(DE->getDecl()), in FinishOpenMPLinearClause()
11762 buildCounterUpdate(SemaRef, S, RefExpr->getExprLoc(), *CurPrivate, in FinishOpenMPLinearClause()
11766 Update = SemaRef.ActOnFinishFullExpr(Update.get(), DE->getBeginLoc(), in FinishOpenMPLinearClause()
11773 buildCounterUpdate(SemaRef, S, RefExpr->getExprLoc(), CapturedRef, in FinishOpenMPLinearClause()
11777 Final = SemaRef.ActOnFinishFullExpr(Final.get(), DE->getBeginLoc(), in FinishOpenMPLinearClause()
12277 static bool checkTypeMappable(SourceLocation SL, SourceRange SR, Sema &SemaRef, in checkTypeMappable() argument
12282 SemaRef.Diag(SL, diag::err_incomplete_type) << QTy << SR; in checkTypeMappable()
12285 if (FullCheck && !SemaRef.CurContext->isDependentContext() && in checkTypeMappable()
12286 !QTy.isTrivialType(SemaRef.Context)) in checkTypeMappable()
12287 SemaRef.Diag(SL, diag::warn_omp_non_trivial_type_mapped) << QTy << SR; in checkTypeMappable()
12294 static bool checkArrayExpressionDoesNotReferToWholeSize(Sema &SemaRef, in checkArrayExpressionDoesNotReferToWholeSize() argument
12317 if (!LowerBound->EvaluateAsInt(Result, SemaRef.getASTContext())) in checkArrayExpressionDoesNotReferToWholeSize()
12341 if (!Length->EvaluateAsInt(Result, SemaRef.getASTContext())) in checkArrayExpressionDoesNotReferToWholeSize()
12351 static bool checkArrayExpressionDoesNotReferToUnitySize(Sema &SemaRef, in checkArrayExpressionDoesNotReferToUnitySize() argument
12376 if (!Length->EvaluateAsInt(Result, SemaRef.getASTContext())) in checkArrayExpressionDoesNotReferToUnitySize()
12388 Sema &SemaRef, Expr *E, in checkMapClauseExpressionBase() argument
12462 SemaRef.Diag(ELoc, diag::err_omp_expected_access_to_data_field) in checkMapClauseExpressionBase()
12478 SemaRef.Diag(ELoc, diag::err_omp_bit_fields_forbidden_in_clause) in checkMapClauseExpressionBase()
12498 SemaRef.Diag(ELoc, diag::err_omp_union_type_not_allowed) in checkMapClauseExpressionBase()
12522 SemaRef.Diag(ELoc, diag::err_omp_expected_base_var_name) in checkMapClauseExpressionBase()
12532 if (checkArrayExpressionDoesNotReferToWholeSize(SemaRef, CurE, in checkMapClauseExpressionBase()
12538 if (CurE->getIdx()->EvaluateAsInt(Result, SemaRef.getASTContext())) { in checkMapClauseExpressionBase()
12540 SemaRef.Diag(CurE->getIdx()->getExprLoc(), in checkMapClauseExpressionBase()
12542 SemaRef.Diag(CurE->getIdx()->getExprLoc(), in checkMapClauseExpressionBase()
12567 SemaRef.Diag(ELoc, diag::err_omp_expected_base_var_name) in checkMapClauseExpressionBase()
12573 checkArrayExpressionDoesNotReferToWholeSize(SemaRef, CurE, CurType); in checkMapClauseExpressionBase()
12575 checkArrayExpressionDoesNotReferToUnitySize(SemaRef, CurE, CurType); in checkMapClauseExpressionBase()
12589 SemaRef.Diag( in checkMapClauseExpressionBase()
12599 SemaRef.getASTContext())) { in checkMapClauseExpressionBase()
12601 SemaRef.Diag(CurE->getLength()->getExprLoc(), in checkMapClauseExpressionBase()
12603 SemaRef.Diag(CurE->getLength()->getExprLoc(), in checkMapClauseExpressionBase()
12608 ResultL, SemaRef.getASTContext())) { in checkMapClauseExpressionBase()
12610 SemaRef.Diag(CurE->getLowerBound()->getExprLoc(), in checkMapClauseExpressionBase()
12612 SemaRef.Diag(CurE->getLowerBound()->getExprLoc(), in checkMapClauseExpressionBase()
12624 SemaRef.Diag( in checkMapClauseExpressionBase()
12638 Sema &SemaRef, DSAStackTy *DSAS, const ValueDecl *VD, const Expr *E, in checkMapConflicts() argument
12660 [&IsEnclosedByDataEnvironmentExpr, &SemaRef, VD, CurrentRegionOnly, ELoc, in checkMapConflicts()
12692 SemaRef.Diag(CI->getAssociatedExpression()->getExprLoc(), in checkMapConflicts()
12695 SemaRef.Diag(SI->getAssociatedExpression()->getExprLoc(), in checkMapConflicts()
12726 SemaRef, SI->getAssociatedExpression(), Type)) in checkMapConflicts()
12739 SemaRef.Diag(ELoc, diag::err_omp_map_shared_storage) << ERange; in checkMapConflicts()
12742 SemaRef.Diag(ELoc, diag::err_omp_once_referenced_in_target_update) in checkMapConflicts()
12745 SemaRef.Diag(RE->getExprLoc(), diag::note_used_here) in checkMapConflicts()
12778 SemaRef.Diag( in checkMapConflicts()
12782 SemaRef.Diag(RE->getExprLoc(), diag::note_used_here) in checkMapConflicts()
12791 SemaRef.Diag(DerivedLoc, diag::err_omp_same_pointer_dereferenced) in checkMapConflicts()
12793 SemaRef.Diag(RE->getExprLoc(), diag::note_used_here) in checkMapConflicts()
12826 SemaRef.Diag(ELoc, diag::err_omp_map_shared_storage) << ERange; in checkMapConflicts()
12829 SemaRef.Diag(ELoc, diag::err_omp_once_referenced_in_target_update) in checkMapConflicts()
12832 SemaRef.Diag(RE->getExprLoc(), diag::note_used_here) in checkMapConflicts()
12865 SemaRef.Diag(ELoc, in checkMapConflicts()
12868 SemaRef.Diag(EnclosingExpr->getExprLoc(), diag::note_used_here) in checkMapConflicts()
12904 checkMappableExpressionList(Sema &SemaRef, DSAStackTy *DSAS, in checkMappableExpressionList() argument
12937 SemaRef.Diag(ELoc, in checkMappableExpressionList()
12949 SemaRef, SimpleExpr, CurComponents, CKind, /*NoDiagnose=*/false); in checkMappableExpressionList()
12989 SemaRef.Diag(ELoc, diag::err_omp_threadprivate_in_clause) in checkMappableExpressionList()
12991 reportOriginalDsa(SemaRef, DSAS, VD, DVar); in checkMappableExpressionList()
13003 if (checkMapConflicts(SemaRef, DSAS, CurDeclaration, SimpleExpr, in checkMappableExpressionList()
13007 checkMapConflicts(SemaRef, DSAS, CurDeclaration, SimpleExpr, in checkMappableExpressionList()
13028 if (!checkTypeMappable(VE->getExprLoc(), VE->getSourceRange(), SemaRef, in checkMappableExpressionList()
13040 SemaRef.Diag(StartLoc, diag::err_omp_invalid_map_type_for_directive) in checkMappableExpressionList()
13054 SemaRef.Diag(StartLoc, diag::err_omp_invalid_map_type_for_directive) in checkMappableExpressionList()
13067 SemaRef.Diag(ELoc, diag::err_omp_variable_in_given_clause_and_dsa) in checkMappableExpressionList()
13071 reportOriginalDsa(SemaRef, DSAS, CurDeclaration, DVar); in checkMappableExpressionList()
13661 Sema &SemaRef, Decl *D) { in checkDeclInTargetContext() argument
13667 SemaRef.Diag(VD->getLocation(), diag::warn_omp_not_in_target_context); in checkDeclInTargetContext()
13668 SemaRef.Diag(SL, diag::note_used_here) << SR; in checkDeclInTargetContext()
13672 Sema &SemaRef, DSAStackTy *Stack, in checkValueDeclInTarget() argument
13675 checkTypeMappable(SL, SR, SemaRef, Stack, VD->getType(), in checkValueDeclInTarget()