Lines Matching refs:SemaRef
55 Sema &SemaRef, Expr *E,
240 Sema &SemaRef; member in __anon8e68b8fa0111::DSAStackTy
345 explicit DSAStackTy(Sema &S) : SemaRef(S) {} in DSAStackTy()
473 const FunctionScopeInfo *CurFnScope = SemaRef.getCurFunction(); in pushFunction()
486 for (const FunctionScopeInfo *FSI : llvm::reverse(SemaRef.FunctionScopes)) { in popFunction()
699 SemaRef.Diag(CNew->getBeginLoc(), in hasDuplicateRequiresClause()
702 SemaRef.Diag(CPrev->getBeginLoc(), in hasDuplicateRequiresClause()
1548 static VarDecl *buildVarDecl(Sema &SemaRef, SourceLocation Loc, QualType Type, in buildVarDecl() argument
1551 DeclContext *DC = SemaRef.CurContext; in buildVarDecl()
1552 IdentifierInfo *II = &SemaRef.PP.getIdentifierTable().get(Name); in buildVarDecl()
1553 TypeSourceInfo *TInfo = SemaRef.Context.getTrivialTypeSourceInfo(Type, Loc); in buildVarDecl()
1555 VarDecl::Create(SemaRef.Context, DC, Loc, Loc, II, Type, TInfo, SC_None); in buildVarDecl()
1564 OMPReferencedVarAttr::CreateImplicit(SemaRef.Context, OrigRef)); in buildVarDecl()
1597 VarDecl *VD = buildVarDecl(SemaRef, SR.getBegin(), in addTaskgroupReductionData()
1598 SemaRef.Context.VoidPtrTy, ".task_red."); in addTaskgroupReductionData()
1600 buildDeclRefExpr(SemaRef, VD, SemaRef.Context.VoidPtrTy, SR.getBegin()); in addTaskgroupReductionData()
1622 VarDecl *VD = buildVarDecl(SemaRef, SR.getBegin(), in addTaskgroupReductionData()
1623 SemaRef.Context.VoidPtrTy, ".task_red."); in addTaskgroupReductionData()
1625 buildDeclRefExpr(SemaRef, VD, SemaRef.Context.VoidPtrTy, SR.getBegin()); in addTaskgroupReductionData()
1704 static bool isConstNotMutableType(Sema &SemaRef, QualType Type, in isConstNotMutableType() argument
1707 ASTContext &Context = SemaRef.getASTContext(); in isConstNotMutableType()
1711 const CXXRecordDecl *RD = AcceptIfMutable && SemaRef.getLangOpts().CPlusPlus in isConstNotMutableType()
1719 return IsConstant && !(SemaRef.getLangOpts().CPlusPlus && RD && in isConstNotMutableType()
1723 static bool rejectConstNotMutableType(Sema &SemaRef, const ValueDecl *D, in rejectConstNotMutableType() argument
1728 ASTContext &Context = SemaRef.getASTContext(); in rejectConstNotMutableType()
1730 if (isConstNotMutableType(SemaRef, Type, AcceptIfMutable, &IsClassType)) { in rejectConstNotMutableType()
1734 SemaRef.Diag(ELoc, Diag) << getOpenMPClauseName(CKind); in rejectConstNotMutableType()
1739 SemaRef.Diag(D->getLocation(), in rejectConstNotMutableType()
1763 SemaRef, VD, D->getType().getNonReferenceType(), in getTopDSA()
1774 SemaRef.getLangOpts().OpenMPUseTLS && in getTopDSA()
1775 SemaRef.getASTContext().getTargetInfo().isTLSSupported())) || in getTopDSA()
1779 SemaRef, VD, D->getType().getNonReferenceType(), D->getLocation()); in getTopDSA()
1784 if (SemaRef.getLangOpts().OpenMPCUDAMode && VD && in getTopDSA()
1796 buildDeclRefExpr(SemaRef, VD, D->getType().getNonReferenceType(), in getTopDSA()
1811 if (!SemaRef.isOpenMPCapturedByRef(D, in getTopDSA()
1815 buildDeclRefExpr(SemaRef, VD, D->getType().getNonReferenceType(), in getTopDSA()
1863 if (SemaRef.LangOpts.OpenMP <= 31) { in getTopDSA()
1868 if (isConstNotMutableType(SemaRef, D->getType())) { in getTopDSA()
2869 static void reportOriginalDsa(Sema &SemaRef, const DSAStackTy *Stack,
3001 Expr *NumIterations, Sema &SemaRef,
3008 Sema &SemaRef; member in __anon8e68b8fa1e11::VarDeclFilterCCC
3011 explicit VarDeclFilterCCC(Sema &S) : SemaRef(S) {} in VarDeclFilterCCC()
3016 SemaRef.isDeclInScope(ND, SemaRef.getCurLexicalContext(), in ValidateCandidate()
3017 SemaRef.getCurScope()); in ValidateCandidate()
3029 Sema &SemaRef; member in __anon8e68b8fa1e11::VarOrFuncDeclFilterCCC
3032 explicit VarOrFuncDeclFilterCCC(Sema &S) : SemaRef(S) {} in VarOrFuncDeclFilterCCC()
3037 return SemaRef.isDeclInScope(ND, SemaRef.getCurLexicalContext(), in ValidateCandidate()
3038 SemaRef.getCurScope()); in ValidateCandidate()
3190 Sema &SemaRef; member in __anon8e68b8fa1f11::LocalVarRefChecker
3196 SemaRef.Diag(E->getBeginLoc(), in VisitDeclRefExpr()
3199 SemaRef.Diag(VD->getLocation(), diag::note_defined_here) in VisitDeclRefExpr()
3213 explicit LocalVarRefChecker(Sema &SemaRef) : SemaRef(SemaRef) {} in LocalVarRefChecker() argument
3584 static void reportOriginalDsa(Sema &SemaRef, const DSAStackTy *Stack, in reportOriginalDsa() argument
3589 SemaRef.Diag(DVar.RefExpr->getExprLoc(), diag::note_omp_explicit_dsa) in reportOriginalDsa()
3625 else if (D->getType().isConstant(SemaRef.getASTContext())) in reportOriginalDsa()
3632 SemaRef.Diag(ReportLoc, diag::note_omp_predetermined_dsa) in reportOriginalDsa()
3636 SemaRef.Diag(DVar.ImplicitDSALoc, diag::note_omp_implicit_dsa) in reportOriginalDsa()
3688 Sema &SemaRef; member in __anon8e68b8fa2111::DSAAttrChecker
3821 getVariableCategoryFromDecl(SemaRef.getLangOpts(), VD); in VisitDeclRefExpr()
3822 if (SemaRef.getLangOpts().OpenMP >= 50) { in VisitDeclRefExpr()
3844 if (SemaRef.getLangOpts().OpenMP > 50) { in VisitDeclRefExpr()
3863 if (SemaRef.LangOpts.OpenMP >= 50) in VisitDeclRefExpr()
3918 SemaRef.Diag(ELoc, diag::err_omp_reduction_in_task); in VisitDeclRefExpr()
3919 reportOriginalDsa(SemaRef, Stack, VD, DVar); in VisitDeclRefExpr()
3990 getVariableCategoryFromDecl(SemaRef.getLangOpts(), FD); in VisitMemberExpr()
4014 SemaRef.Diag(ELoc, diag::err_omp_reduction_in_task); in VisitMemberExpr()
4015 reportOriginalDsa(SemaRef, Stack, FD, DVar); in VisitMemberExpr()
4034 if (!checkMapClauseExpressionBase(SemaRef, E, CurComponents, OMPC_map, in VisitMemberExpr()
4146 SemaRef, VD, VD->getType().getNonLValueExprType(SemaRef.Context), in visitSubCaptures()
4168 DSAAttrChecker(DSAStackTy *S, Sema &SemaRef, CapturedStmt *CS) in DSAAttrChecker() argument
4169 : Stack(S), SemaRef(SemaRef), ErrorFound(false), CS(CS) { in DSAAttrChecker()
4980 static bool checkCancelRegion(Sema &SemaRef, OpenMPDirectiveKind CurrentRegion, in checkCancelRegion() argument
4991 SemaRef.Diag(StartLoc, diag::err_omp_wrong_cancel_region) in checkCancelRegion()
4996 static bool checkNestingOfRegions(Sema &SemaRef, const DSAStackTy *Stack, in checkNestingOfRegions() argument
5016 if (SemaRef.LangOpts.OpenMP >= 51 && Stack->isParentOrderConcurrent() && in checkNestingOfRegions()
5020 SemaRef.Diag(StartLoc, diag::err_omp_prohibited_region_order) in checkNestingOfRegions()
5025 ((SemaRef.LangOpts.OpenMP <= 45 && CurrentRegion != OMPD_ordered) || in checkNestingOfRegions()
5026 (SemaRef.LangOpts.OpenMP >= 50 && CurrentRegion != OMPD_ordered && in checkNestingOfRegions()
5041 SemaRef.Diag(StartLoc, (CurrentRegion != OMPD_simd) in checkNestingOfRegions()
5044 << (SemaRef.LangOpts.OpenMP >= 50 ? 1 : 0); in checkNestingOfRegions()
5050 SemaRef.Diag(StartLoc, diag::err_omp_prohibited_region_atomic); in checkNestingOfRegions()
5060 SemaRef.Diag(StartLoc, diag::err_omp_orphaned_section_directive) in checkNestingOfRegions()
5077 if (SemaRef.LangOpts.OpenMP >= 50 && CurrentRegion == OMPD_loop && in checkNestingOfRegions()
5082 SemaRef.Diag(StartLoc, diag::err_omp_prohibited_region) in checkNestingOfRegions()
5112 (SemaRef.getLangOpts().OpenMP >= 50 && in checkNestingOfRegions()
5147 SemaRef.Diag(StartLoc, in checkNestingOfRegions()
5151 SemaRef.Diag(PreviousCriticalLoc, in checkNestingOfRegions()
5205 (SemaRef.LangOpts.OpenMP <= 45 && ParentRegion != OMPD_target) || in checkNestingOfRegions()
5206 (SemaRef.LangOpts.OpenMP >= 50 && ParentRegion != OMPD_unknown && in checkNestingOfRegions()
5215 SemaRef.LangOpts.OpenMP < 50 || in checkNestingOfRegions()
5238 !(SemaRef.getLangOpts().OpenMPExtensions && in checkNestingOfRegions()
5282 SemaRef.Diag(StartLoc, diag::err_omp_orphaned_device_directive) in checkNestingOfRegions()
5285 SemaRef.Diag(StartLoc, diag::err_omp_prohibited_region) in checkNestingOfRegions()
5996 static ExprResult buildUserDefinedMapperRef(Sema &SemaRef, Scope *S,
7960 Sema &SemaRef; member in __anon8e68b8fa3a11::OpenMPIterationSpaceChecker
8012 OpenMPIterationSpaceChecker(Sema &SemaRef, bool SupportsNonRectangular, in OpenMPIterationSpaceChecker() argument
8014 : SemaRef(SemaRef), SupportsNonRectangular(SupportsNonRectangular), in OpenMPIterationSpaceChecker()
8153 ExprResult Val = SemaRef.PerformOpenMPImplicitIntegerConversion( in setStep()
8171 NewStep->getIntegerConstantExpr(SemaRef.Context); in setStep()
8185 SemaRef.Diag(NewStep->getExprLoc(), in setStep()
8188 SemaRef.Diag(ConditionLoc, in setStep()
8195 SemaRef.CreateBuiltinUnaryOp(NewStep->getExprLoc(), UO_Minus, NewStep) in setStep()
8211 Sema &SemaRef; member in __anon8e68b8fa3a11::__anon8e68b8fa3b11::LoopCounterRefChecker
8221 SemaRef.Diag(E->getExprLoc(), diag::err_omp_stmt_depends_on_loop_counter) in checkDecl()
8232 VD->getNameForDiagnostic(OS, SemaRef.getPrintingPolicy(), in checkDecl()
8234 SemaRef.Diag(E->getExprLoc(), in checkDecl()
8237 SemaRef.Diag(VD->getLocation(), diag::note_previous_decl) << VD; in checkDecl()
8241 SemaRef.Diag(E->getExprLoc(), diag::err_omp_invariant_dependency); in checkDecl()
8251 DepDecl->getNameForDiagnostic(OS, SemaRef.getPrintingPolicy(), in checkDecl()
8253 SemaRef.Diag(E->getExprLoc(), in checkDecl()
8286 explicit LoopCounterRefChecker(Sema &SemaRef, DSAStackTy &Stack, in LoopCounterRefChecker() argument
8290 : SemaRef(SemaRef), Stack(Stack), CurLCDecl(CurLCDecl), in LoopCounterRefChecker()
8308 LoopCounterRefChecker LoopStmtChecker(SemaRef, Stack, LCDecl, IsInitializer, in doesDependOnLoopCounter()
8328 SemaRef.Diag(DefaultLoc, diag::err_omp_loop_not_canonical_init); in checkAndSetInit()
8362 SemaRef.Diag(S->getBeginLoc(), in checkAndSetInit()
8367 buildDeclRefExpr(SemaRef, Var, in checkAndSetInit()
8393 if (dependent() || SemaRef.CurContext->isDependentContext()) in checkAndSetInit()
8396 SemaRef.Diag(S->getBeginLoc(), diag::err_omp_loop_not_canonical_init) in checkAndSetInit()
8431 bool IneqCondIsCanonical = SemaRef.getLangOpts().OpenMP >= 50; in checkAndSetCond()
8433 SemaRef.Diag(DefaultLoc, diag::err_omp_loop_not_canonical_cond) in checkAndSetCond()
8477 if (dependent() || SemaRef.CurContext->isDependentContext()) in checkAndSetCond()
8479 SemaRef.Diag(CondLoc, diag::err_omp_loop_not_canonical_cond) in checkAndSetCond()
8508 if (dependent() || SemaRef.CurContext->isDependentContext()) in checkAndSetIncRHS()
8510 SemaRef.Diag(RHS->getBeginLoc(), diag::err_omp_loop_not_canonical_incr) in checkAndSetIncRHS()
8530 SemaRef.Diag(DefaultLoc, diag::err_omp_loop_not_canonical_incr) << LCDecl; in checkAndSetInc()
8542 return setStep(SemaRef in checkAndSetInc()
8566 return setStep(SemaRef in checkAndSetInc()
8586 if (dependent() || SemaRef.CurContext->isDependentContext()) in checkAndSetInc()
8588 SemaRef.Diag(S->getBeginLoc(), diag::err_omp_loop_not_canonical_incr) in checkAndSetInc()
8594 tryBuildCapture(Sema &SemaRef, Expr *Capture, in tryBuildCapture() argument
8597 if (SemaRef.CurContext->isDependentContext() || Capture->containsErrors()) in tryBuildCapture()
8599 if (Capture->isEvaluatable(SemaRef.Context, Expr::SE_AllowSideEffects)) in tryBuildCapture()
8600 return SemaRef.PerformImplicitConversion( in tryBuildCapture()
8605 return buildCapture(SemaRef, Capture, I->second, Name); in tryBuildCapture()
8607 ExprResult Res = buildCapture(SemaRef, Capture, Ref, Name); in tryBuildCapture()
8615 calculateNumIters(Sema &SemaRef, Scope *S, SourceLocation DefaultLoc, in calculateNumIters() argument
8619 ExprResult NewStep = tryBuildCapture(SemaRef, Step, Captures, ".new_step"); in calculateNumIters()
8625 Lower->getIntegerConstantExpr(SemaRef.Context)) { in calculateNumIters()
8630 Step->getIntegerConstantExpr(SemaRef.Context)) { in calculateNumIters()
8669 Upper->getIntegerConstantExpr(SemaRef.Context)) { in calculateNumIters()
8692 uint64_t LowerSize = SemaRef.Context.getTypeSize(LowerTy); in calculateNumIters()
8693 uint64_t UpperSize = SemaRef.Context.getTypeSize(UpperTy); in calculateNumIters()
8696 QualType CastType = SemaRef.Context.getIntTypeForBitwidth( in calculateNumIters()
8699 SemaRef in calculateNumIters()
8701 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Upper).get(), in calculateNumIters()
8704 Lower = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Lower).get(); in calculateNumIters()
8705 NewStep = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, NewStep.get()); in calculateNumIters()
8720 SemaRef.BuildBinOp(S, DefaultLoc, BO_Sub, Diff.get(), NewStep.get()); in calculateNumIters()
8727 Diff = SemaRef.BuildBinOp( in calculateNumIters()
8729 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); in calculateNumIters()
8733 Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); in calculateNumIters()
8738 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Sub, Upper, Diff.get()); in calculateNumIters()
8742 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Sub, Upper, Lower); in calculateNumIters()
8747 SemaRef.Diag(Upper->getBeginLoc(), diag::err_omp_loop_diff_cxx) in calculateNumIters()
8757 Diff = SemaRef.BuildBinOp( in calculateNumIters()
8759 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); in calculateNumIters()
8766 SemaRef.BuildBinOp(S, DefaultLoc, BO_Add, Diff.get(), NewStep.get()); in calculateNumIters()
8773 Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); in calculateNumIters()
8778 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Div, Diff.get(), NewStep.get()); in calculateNumIters()
8791 !SemaRef.getLangOpts().CPlusPlus) in buildNumIterations()
8803 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MinValue); in buildNumIterations()
8807 ExprResult LBMinVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, in buildNumIterations()
8813 SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, LBMinVal.get(), LBVal); in buildNumIterations()
8817 LBMinVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, LBMinVal.get()); in buildNumIterations()
8823 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MaxValue); in buildNumIterations()
8827 ExprResult LBMaxVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, in buildNumIterations()
8833 SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, LBMaxVal.get(), LBVal); in buildNumIterations()
8837 LBMaxVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, LBMaxVal.get()); in buildNumIterations()
8842 tryBuildCapture(SemaRef, LBMinVal.get(), Captures, ".lb_min").get(); in buildNumIterations()
8844 tryBuildCapture(SemaRef, LBMaxVal.get(), Captures, ".lb_max").get(); in buildNumIterations()
8849 SemaRef.BuildBinOp(S, DefaultLoc, BO_LT, LBMin, LBMax); in buildNumIterations()
8853 tryBuildCapture(SemaRef, MinLessMaxRes.get(), Captures, ".min_less_max") in buildNumIterations()
8860 ExprResult MinLB = SemaRef.ActOnConditionalOp(DefaultLoc, DefaultLoc, in buildNumIterations()
8868 ExprResult MaxLB = SemaRef.ActOnConditionalOp(DefaultLoc, DefaultLoc, in buildNumIterations()
8876 SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, IS.CounterVar, LBVal); in buildNumIterations()
8889 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MinValue); in buildNumIterations()
8893 ExprResult UBMinVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, in buildNumIterations()
8899 SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, UBMinVal.get(), UBVal); in buildNumIterations()
8903 UBMinVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, UBMinVal.get()); in buildNumIterations()
8909 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MaxValue); in buildNumIterations()
8913 ExprResult UBMaxVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, in buildNumIterations()
8919 SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, UBMaxVal.get(), UBVal); in buildNumIterations()
8923 UBMaxVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, UBMaxVal.get()); in buildNumIterations()
8928 tryBuildCapture(SemaRef, UBMinVal.get(), Captures, ".ub_min").get(); in buildNumIterations()
8930 tryBuildCapture(SemaRef, UBMaxVal.get(), Captures, ".ub_max").get(); in buildNumIterations()
8935 SemaRef.BuildBinOp(S, DefaultLoc, BO_GT, UBMin, UBMax); in buildNumIterations()
8938 Expr *MinGreaterMax = tryBuildCapture(SemaRef, MinGreaterMaxRes.get(), in buildNumIterations()
8946 ExprResult MaxUB = SemaRef.ActOnConditionalOp( in buildNumIterations()
8954 ExprResult MinUB = SemaRef.ActOnConditionalOp( in buildNumIterations()
8963 Expr *Upper = tryBuildCapture(SemaRef, UBExpr, Captures, ".upper").get(); in buildNumIterations()
8964 Expr *Lower = tryBuildCapture(SemaRef, LBExpr, Captures, ".lower").get(); in buildNumIterations()
8968 ExprResult Diff = calculateNumIters(SemaRef, S, DefaultLoc, Lower, Upper, in buildNumIterations()
8976 ASTContext &C = SemaRef.Context; in buildNumIterations()
8985 if (!SemaRef.Context.hasSameType(Diff.get()->getType(), Type)) { in buildNumIterations()
8986 Diff = SemaRef.PerformImplicitConversion( in buildNumIterations()
8997 SemaRef.Diag(DefaultLoc, diag::warn_omp_loop_64_bit_var) in buildNumIterations()
9003 if (!SemaRef.Context.hasSameType(Diff.get()->getType(), NewType)) { in buildNumIterations()
9004 Diff = SemaRef.PerformImplicitConversion(Diff.get(), NewType, in buildNumIterations()
9032 LBNonRect ? LBExpr : tryBuildCapture(SemaRef, LBExpr, Captures).get(); in buildMinMaxValues()
9034 UBNonRect ? UBExpr : tryBuildCapture(SemaRef, UBExpr, Captures).get(); in buildMinMaxValues()
9046 ExprResult Diff = calculateNumIters(SemaRef, S, DefaultLoc, Lower, Upper, in buildMinMaxValues()
9054 Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); in buildMinMaxValues()
9058 ExprResult NewStep = tryBuildCapture(SemaRef, Step, Captures, ".new_step"); in buildMinMaxValues()
9061 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Mul, Diff.get(), NewStep.get()); in buildMinMaxValues()
9066 Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); in buildMinMaxValues()
9072 !SemaRef.Context.hasSameType( in buildMinMaxValues()
9074 SemaRef.Context.getUnsignedPointerDiffType())) { in buildMinMaxValues()
9075 Diff = SemaRef.PerformImplicitConversion( in buildMinMaxValues()
9076 Diff.get(), SemaRef.Context.getUnsignedPointerDiffType(), in buildMinMaxValues()
9085 Diff = SemaRef.BuildBinOp( in buildMinMaxValues()
9087 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Lower).get(), in buildMinMaxValues()
9094 Diff = SemaRef.BuildBinOp( in buildMinMaxValues()
9096 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Upper).get(), in buildMinMaxValues()
9103 if (SemaRef.Context.hasSameType(Diff.get()->getType(), VarType)) in buildMinMaxValues()
9104 Diff = SemaRef.PerformImplicitConversion(Diff.get(), VarType, in buildMinMaxValues()
9110 Sema::TentativeAnalysisScope Trap(SemaRef); in buildMinMaxValues()
9111 Diff = SemaRef.ActOnFinishFullExpr(Diff.get(), /*DiscardedValue=*/false); in buildMinMaxValues()
9137 return SemaRef in buildPreCond()
9139 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get(), in buildPreCond()
9140 SemaRef.Context.BoolTy, /*Action=*/Sema::AA_Casting, in buildPreCond()
9145 Sema::TentativeAnalysisScope Trap(SemaRef); in buildPreCond()
9147 ExprResult NewLB = tryBuildCapture(SemaRef, LB, Captures); in buildPreCond()
9148 ExprResult NewUB = tryBuildCapture(SemaRef, UB, Captures); in buildPreCond()
9153 SemaRef.BuildBinOp(S, DefaultLoc, in buildPreCond()
9158 if (!SemaRef.Context.hasSameUnqualifiedType(CondExpr.get()->getType(), in buildPreCond()
9159 SemaRef.Context.BoolTy)) in buildPreCond()
9160 CondExpr = SemaRef.PerformImplicitConversion( in buildPreCond()
9161 CondExpr.get(), SemaRef.Context.BoolTy, /*Action=*/Sema::AA_Casting, in buildPreCond()
9175 VD = SemaRef.isOpenMPCapturedDecl(LCDecl); in buildCounterVar()
9177 SemaRef, VD, VD->getType().getNonReferenceType(), DefaultLoc); in buildCounterVar()
9193 SemaRef, DefaultLoc, Type, LCDecl->getName(), in buildPrivateCounterVar()
9196 ? buildDeclRefExpr(SemaRef, cast<VarDecl>(LCDecl), Type, DefaultLoc) in buildPrivateCounterVar()
9200 return buildDeclRefExpr(SemaRef, PrivateVar, Type, DefaultLoc); in buildPrivateCounterVar()
9215 Expr *Cnt = SemaRef.DefaultLvalueConversion(Counter).get(); in buildOrderedLoopData()
9222 Cnt = SemaRef.BuildBinOp(S, Loc, BOK, Cnt, Inc).get(); in buildOrderedLoopData()
9228 !SemaRef.getLangOpts().CPlusPlus) in buildOrderedLoopData()
9232 *TestIsLessOp ? Cnt : tryBuildCapture(SemaRef, LB, Captures).get(); in buildOrderedLoopData()
9234 *TestIsLessOp ? tryBuildCapture(SemaRef, LB, Captures).get() : Cnt; in buildOrderedLoopData()
9239 SemaRef, S, DefaultLoc, Lower, Upper, Step, VarType, in buildOrderedLoopData()
9351 OpenMPDirectiveKind DKind, Stmt *S, Sema &SemaRef, DSAStackTy &DSA, in checkOpenMPIterationSpace() argument
9367 if (!For && (SemaRef.LangOpts.OpenMP <= 45 || !CXXFor)) { in checkOpenMPIterationSpace()
9368 OpenMPDirectiveKind DK = (SemaRef.getLangOpts().OpenMP < 50 || in checkOpenMPIterationSpace()
9372 SemaRef.Diag(S->getBeginLoc(), diag::err_omp_not_for) in checkOpenMPIterationSpace()
9378 SemaRef.Diag(DSA.getConstructLoc(), in checkOpenMPIterationSpace()
9383 SemaRef.Diag(CollapseLoopCountExpr->getExprLoc(), in checkOpenMPIterationSpace()
9387 SemaRef.Diag(OrderedLoopCountExpr->getExprLoc(), in checkOpenMPIterationSpace()
9396 if (CXXFor && SemaRef.CurContext->isDependentContext()) in checkOpenMPIterationSpace()
9399 OpenMPIterationSpaceChecker ISC(SemaRef, SupportsNonRectangular, DSA, in checkOpenMPIterationSpace()
9419 !(SemaRef.getLangOpts().CPlusPlus && VarType->isOverloadableType())) { in checkOpenMPIterationSpace()
9420 SemaRef.Diag(Init->getBeginLoc(), diag::err_omp_loop_variable_type) in checkOpenMPIterationSpace()
9421 << SemaRef.getLangOpts().CPlusPlus; in checkOpenMPIterationSpace()
9445 if (ISC.dependent() || SemaRef.CurContext->isDependentContext() || HasErrors) in checkOpenMPIterationSpace()
9536 Expr *Cnt = SemaRef in checkOpenMPIterationSpace()
9544 SemaRef.ActOnIntegerConstant(DoacrossC->getColonLoc(), /*Val=*/1) in checkOpenMPIterationSpace()
9568 buildCounterInit(Sema &SemaRef, Scope *S, SourceLocation Loc, ExprResult VarRef, in buildCounterInit() argument
9574 : tryBuildCapture(SemaRef, Start.get(), Captures); in buildCounterInit()
9577 if (!SemaRef.Context.hasSameType(NewStart.get()->getType(), in buildCounterInit()
9579 NewStart = SemaRef.PerformImplicitConversion( in buildCounterInit()
9587 SemaRef.BuildBinOp(S, Loc, BO_Assign, VarRef.get(), NewStart.get()); in buildCounterInit()
9593 Sema &SemaRef, Scope *S, SourceLocation Loc, ExprResult VarRef, in buildCounterUpdate() argument
9598 Iter = SemaRef.ActOnParenExpr(Loc, Loc, Iter.get()); in buildCounterUpdate()
9605 NewStep = tryBuildCapture(SemaRef, Step.get(), *Captures); in buildCounterUpdate()
9609 SemaRef.BuildBinOp(S, Loc, BO_Mul, Iter.get(), NewStep.get()); in buildCounterUpdate()
9617 ExprResult NewStart = SemaRef.ActOnParenExpr(Loc, Loc, Start.get()); in buildCounterUpdate()
9621 NewStart = tryBuildCapture(SemaRef, Start.get(), *Captures); in buildCounterUpdate()
9631 Sema::TentativeAnalysisScope Trap(SemaRef); in buildCounterUpdate()
9634 SemaRef.BuildBinOp(S, Loc, BO_Assign, VarRef.get(), NewStart.get()); in buildCounterUpdate()
9637 SemaRef.BuildBinOp(S, Loc, Subtract ? BO_SubAssign : BO_AddAssign, in buildCounterUpdate()
9640 Update = SemaRef.CreateBuiltinBinOp(Loc, BO_Comma, Update.get(), in buildCounterUpdate()
9648 Update = SemaRef.BuildBinOp(S, Loc, Subtract ? BO_Sub : BO_Add, in buildCounterUpdate()
9653 if (!SemaRef.Context.hasSameType(Update.get()->getType(), in buildCounterUpdate()
9655 Update = SemaRef.PerformImplicitConversion( in buildCounterUpdate()
9661 Update = SemaRef.BuildBinOp(S, Loc, BO_Assign, VarRef.get(), Update.get()); in buildCounterUpdate()
9668 static ExprResult widenIterationCount(unsigned Bits, Expr *E, Sema &SemaRef) { in widenIterationCount() argument
9671 ASTContext &C = SemaRef.Context; in widenIterationCount()
9678 return SemaRef.PerformImplicitConversion(E, NewType, Sema::AA_Converting, in widenIterationCount()
9684 static bool fitsInto(unsigned Bits, bool Signed, const Expr *E, Sema &SemaRef) { in fitsInto() argument
9688 E->getIntegerConstantExpr(SemaRef.Context)) in fitsInto()
9742 Expr *OrderedLoopCountExpr, Stmt *AStmt, Sema &SemaRef, in checkOpenMPLoop() argument
9747 bool SupportsNonPerfectlyNested = (SemaRef.LangOpts.OpenMP >= 50) && in checkOpenMPLoop()
9754 CollapseLoopCountExpr->EvaluateAsInt(Result, SemaRef.getASTContext())) { in checkOpenMPLoop()
9767 SemaRef.getASTContext())) { in checkOpenMPLoop()
9770 SemaRef.Diag(OrderedLoopCountExpr->getExprLoc(), in checkOpenMPLoop()
9773 SemaRef.Diag(CollapseLoopCountExpr->getExprLoc(), in checkOpenMPLoop()
9791 [DKind, &SemaRef, &DSA, NumLoops, NestedLoopCount, in checkOpenMPLoop()
9795 DKind, CurStmt, SemaRef, DSA, Cnt, NestedLoopCount, in checkOpenMPLoop()
9809 [&SemaRef, &Captures](OMPLoopTransformationDirective *Transform) { in checkOpenMPLoop()
9815 DeclRefExpr *Ref = buildDeclRefExpr(SemaRef, D, D->getType(), in checkOpenMPLoop()
9824 if (SemaRef.CurContext->isDependentContext()) in checkOpenMPLoop()
9862 SemaRef in checkOpenMPLoop()
9867 SemaRef); in checkOpenMPLoop()
9870 SemaRef in checkOpenMPLoop()
9875 SemaRef); in checkOpenMPLoop()
9880 ASTContext &C = SemaRef.Context; in checkOpenMPLoop()
9887 SemaRef.BuildBinOp(CurScope, PreCond.get()->getExprLoc(), BO_LAnd, in checkOpenMPLoop()
9894 LastIteration32 = SemaRef.BuildBinOp( in checkOpenMPLoop()
9896 SemaRef in checkOpenMPLoop()
9902 LastIteration64 = SemaRef.BuildBinOp( in checkOpenMPLoop()
9904 SemaRef in checkOpenMPLoop()
9913 if (SemaRef.getLangOpts().OpenMPOptimisticCollapse || in checkOpenMPLoop()
9920 LastIteration64.get(), SemaRef)))) in checkOpenMPLoop()
9927 SemaRef.Context.getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/0); in checkOpenMPLoop()
9929 SemaRef.Context.getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/1); in checkOpenMPLoop()
9938 LastIteration = SemaRef.BuildBinOp( in checkOpenMPLoop()
9941 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); in checkOpenMPLoop()
9948 bool IsConstant = LastIteration.get()->isIntegerConstantExpr(SemaRef.Context); in checkOpenMPLoop()
9952 tryBuildCapture(SemaRef, LastIteration.get(), Captures); in checkOpenMPLoop()
9956 NumIterations = SemaRef.BuildBinOp( in checkOpenMPLoop()
9958 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); in checkOpenMPLoop()
9972 VarDecl *LBDecl = buildVarDecl(SemaRef, InitLoc, VType, ".omp.lb"); in checkOpenMPLoop()
9973 LB = buildDeclRefExpr(SemaRef, LBDecl, VType, InitLoc); in checkOpenMPLoop()
9974 SemaRef.AddInitializerToDecl(LBDecl, in checkOpenMPLoop()
9975 SemaRef.ActOnIntegerConstant(InitLoc, 0).get(), in checkOpenMPLoop()
9979 VarDecl *UBDecl = buildVarDecl(SemaRef, InitLoc, VType, ".omp.ub"); in checkOpenMPLoop()
9980 UB = buildDeclRefExpr(SemaRef, UBDecl, VType, InitLoc); in checkOpenMPLoop()
9981 SemaRef.AddInitializerToDecl(UBDecl, LastIteration.get(), in checkOpenMPLoop()
9986 QualType Int32Ty = SemaRef.Context.getIntTypeForBitwidth(32, true); in checkOpenMPLoop()
9987 VarDecl *ILDecl = buildVarDecl(SemaRef, InitLoc, Int32Ty, ".omp.is_last"); in checkOpenMPLoop()
9988 IL = buildDeclRefExpr(SemaRef, ILDecl, Int32Ty, InitLoc); in checkOpenMPLoop()
9989 SemaRef.AddInitializerToDecl(ILDecl, in checkOpenMPLoop()
9990 SemaRef.ActOnIntegerConstant(InitLoc, 0).get(), in checkOpenMPLoop()
9995 buildVarDecl(SemaRef, InitLoc, StrideVType, ".omp.stride"); in checkOpenMPLoop()
9996 ST = buildDeclRefExpr(SemaRef, STDecl, StrideVType, InitLoc); in checkOpenMPLoop()
9997 SemaRef.AddInitializerToDecl(STDecl, in checkOpenMPLoop()
9998 SemaRef.ActOnIntegerConstant(InitLoc, 1).get(), in checkOpenMPLoop()
10003 ExprResult IsUBGreater = SemaRef.BuildBinOp(CurScope, InitLoc, BO_GT, in checkOpenMPLoop()
10005 ExprResult CondOp = SemaRef.ActOnConditionalOp( in checkOpenMPLoop()
10008 EUB = SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, UB.get(), in checkOpenMPLoop()
10010 EUB = SemaRef.ActOnFinishFullExpr(EUB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
10019 buildVarDecl(SemaRef, InitLoc, VType, ".omp.comb.lb"); in checkOpenMPLoop()
10020 CombLB = buildDeclRefExpr(SemaRef, CombLBDecl, VType, InitLoc); in checkOpenMPLoop()
10021 SemaRef.AddInitializerToDecl( in checkOpenMPLoop()
10022 CombLBDecl, SemaRef.ActOnIntegerConstant(InitLoc, 0).get(), in checkOpenMPLoop()
10027 buildVarDecl(SemaRef, InitLoc, VType, ".omp.comb.ub"); in checkOpenMPLoop()
10028 CombUB = buildDeclRefExpr(SemaRef, CombUBDecl, VType, InitLoc); in checkOpenMPLoop()
10029 SemaRef.AddInitializerToDecl(CombUBDecl, LastIteration.get(), in checkOpenMPLoop()
10032 ExprResult CombIsUBGreater = SemaRef.BuildBinOp( in checkOpenMPLoop()
10035 SemaRef.ActOnConditionalOp(InitLoc, InitLoc, CombIsUBGreater.get(), in checkOpenMPLoop()
10037 CombEUB = SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, CombUB.get(), in checkOpenMPLoop()
10040 SemaRef.ActOnFinishFullExpr(CombEUB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
10056 buildDeclRefExpr(SemaRef, PrevLBDecl, PrevLBDecl->getType(), InitLoc); in checkOpenMPLoop()
10058 buildDeclRefExpr(SemaRef, PrevUBDecl, PrevUBDecl->getType(), InitLoc); in checkOpenMPLoop()
10066 VarDecl *IVDecl = buildVarDecl(SemaRef, InitLoc, RealVType, ".omp.iv"); in checkOpenMPLoop()
10067 IV = buildDeclRefExpr(SemaRef, IVDecl, RealVType, InitLoc); in checkOpenMPLoop()
10074 : SemaRef.ActOnIntegerConstant(SourceLocation(), 0).get(); in checkOpenMPLoop()
10075 Init = SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, IV.get(), RHS); in checkOpenMPLoop()
10076 Init = SemaRef.ActOnFinishFullExpr(Init.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
10085 : SemaRef.ActOnIntegerConstant(SourceLocation(), 0).get(); in checkOpenMPLoop()
10087 SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, IV.get(), CombRHS); in checkOpenMPLoop()
10089 SemaRef.ActOnFinishFullExpr(CombInit.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
10104 SemaRef in checkOpenMPLoop()
10106 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()) in checkOpenMPLoop()
10109 SemaRef.ActOnFinishFullExpr(BoundUB, /*DiscardedValue*/ false).get(); in checkOpenMPLoop()
10116 ? SemaRef.BuildBinOp(CurScope, CondLoc, in checkOpenMPLoop()
10119 : SemaRef.BuildBinOp(CurScope, CondLoc, BO_LT, IV.get(), in checkOpenMPLoop()
10123 CombDistCond = SemaRef.BuildBinOp(CurScope, CondLoc, BO_LT, IV.get(), in checkOpenMPLoop()
10132 SemaRef in checkOpenMPLoop()
10135 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()) in checkOpenMPLoop()
10138 SemaRef.ActOnFinishFullExpr(BoundCombUB, /*DiscardedValue*/ false) in checkOpenMPLoop()
10142 SemaRef.BuildBinOp(CurScope, CondLoc, UseStrictCompare ? BO_LT : BO_LE, in checkOpenMPLoop()
10148 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, IV.get(), in checkOpenMPLoop()
10149 SemaRef.ActOnIntegerConstant(IncLoc, 1).get()); in checkOpenMPLoop()
10152 Inc = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, IV.get(), Inc.get()); in checkOpenMPLoop()
10153 Inc = SemaRef.ActOnFinishFullExpr(Inc.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
10167 NextLB = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, LB.get(), ST.get()); in checkOpenMPLoop()
10172 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, LB.get(), NextLB.get()); in checkOpenMPLoop()
10174 SemaRef.ActOnFinishFullExpr(NextLB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
10178 NextUB = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, UB.get(), ST.get()); in checkOpenMPLoop()
10183 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, UB.get(), NextUB.get()); in checkOpenMPLoop()
10185 SemaRef.ActOnFinishFullExpr(NextUB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
10190 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, CombLB.get(), ST.get()); in checkOpenMPLoop()
10194 CombNextLB = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, CombLB.get(), in checkOpenMPLoop()
10196 CombNextLB = SemaRef.ActOnFinishFullExpr(CombNextLB.get(), in checkOpenMPLoop()
10202 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, CombUB.get(), ST.get()); in checkOpenMPLoop()
10206 CombNextUB = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, CombUB.get(), in checkOpenMPLoop()
10208 CombNextUB = SemaRef.ActOnFinishFullExpr(CombNextUB.get(), in checkOpenMPLoop()
10222 DistCond = SemaRef.BuildBinOp( in checkOpenMPLoop()
10227 SemaRef.BuildBinOp(CurScope, DistIncLoc, BO_Add, IV.get(), ST.get()); in checkOpenMPLoop()
10229 DistInc = SemaRef.BuildBinOp(CurScope, DistIncLoc, BO_Assign, IV.get(), in checkOpenMPLoop()
10232 SemaRef.ActOnFinishFullExpr(DistInc.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
10239 if (!SemaRef.Context.hasSameType(UB.get()->getType(), in checkOpenMPLoop()
10241 NewPrevUB = SemaRef.BuildCStyleCastExpr( in checkOpenMPLoop()
10243 SemaRef.Context.getTrivialTypeSourceInfo(UB.get()->getType()), in checkOpenMPLoop()
10248 ExprResult IsUBGreater = SemaRef.BuildBinOp(CurScope, DistEUBLoc, BO_GT, in checkOpenMPLoop()
10250 ExprResult CondOp = SemaRef.ActOnConditionalOp( in checkOpenMPLoop()
10252 PrevEUB = SemaRef.BuildBinOp(CurScope, DistIncLoc, BO_Assign, UB.get(), in checkOpenMPLoop()
10255 SemaRef.ActOnFinishFullExpr(PrevEUB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
10263 SemaRef in checkOpenMPLoop()
10266 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()) in checkOpenMPLoop()
10269 SemaRef.ActOnFinishFullExpr(BoundPrevUB, /*DiscardedValue*/ false) in checkOpenMPLoop()
10273 SemaRef.BuildBinOp(CurScope, CondLoc, UseStrictCompare ? BO_LT : BO_LE, in checkOpenMPLoop()
10309 ExprResult Prod = SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get(); in checkOpenMPLoop()
10311 Prod = SemaRef.BuildBinOp(CurScope, UpdLoc, BO_Mul, Prod.get(), in checkOpenMPLoop()
10319 SemaRef.BuildBinOp(CurScope, UpdLoc, BO_Div, Acc.get(), Prod.get()); in checkOpenMPLoop()
10332 Prod = SemaRef.BuildBinOp(CurScope, UpdLoc, BO_Mul, Iter.get(), in checkOpenMPLoop()
10336 Acc = SemaRef.BuildBinOp(CurScope, UpdLoc, BO_Sub, Acc.get(), Prod.get()); in checkOpenMPLoop()
10341 SemaRef, VD, IS.CounterVar->getType(), IS.CounterVar->getExprLoc(), in checkOpenMPLoop()
10344 buildCounterInit(SemaRef, CurScope, UpdLoc, CounterVar, in checkOpenMPLoop()
10351 SemaRef, CurScope, UpdLoc, CounterVar, IS.CounterInit, Iter, in checkOpenMPLoop()
10360 buildCounterUpdate(SemaRef, CurScope, UpdLoc, CounterVar, in checkOpenMPLoop()
10396 Built.CalcLastIteration = SemaRef in checkOpenMPLoop()
11641 Sema &SemaRef; member in __anon8e68b8fa4111::OpenMPAtomicUpdateChecker
11662 OpenMPAtomicUpdateChecker(Sema &SemaRef) in OpenMPAtomicUpdateChecker() argument
11663 : SemaRef(SemaRef), X(nullptr), E(nullptr), UpdateExpr(nullptr), in OpenMPAtomicUpdateChecker()
11714 X->IgnoreParenImpCasts()->Profile(XId, SemaRef.getASTContext(), in checkBinaryOperation()
11716 LHS->IgnoreParenImpCasts()->Profile(LHSId, SemaRef.getASTContext(), in checkBinaryOperation()
11718 RHS->IgnoreParenImpCasts()->Profile(RHSId, SemaRef.getASTContext(), in checkBinaryOperation()
11753 SemaRef.Diag(ErrorLoc, DiagId) << ErrorRange; in checkBinaryOperation()
11754 SemaRef.Diag(NoteLoc, NoteId) << ErrorFound << NoteRange; in checkBinaryOperation()
11757 if (SemaRef.CurContext->isDependentContext()) in checkBinaryOperation()
11801 E = SemaRef.ActOnIntegerConstant(OpLoc, /*uint64_t Val=*/1).get(); in checkStatement()
11830 SemaRef.Diag(ErrorLoc, DiagId) << ErrorRange; in checkStatement()
11831 SemaRef.Diag(NoteLoc, NoteId) << ErrorFound << NoteRange; in checkStatement()
11834 if (SemaRef.CurContext->isDependentContext()) in checkStatement()
11840 auto *OVEX = new (SemaRef.getASTContext()) in checkStatement()
11842 auto *OVEExpr = new (SemaRef.getASTContext()) in checkStatement()
11845 SemaRef.CreateBuiltinBinOp(OpLoc, Op, IsXLHSInRHSPart ? OVEX : OVEExpr, in checkStatement()
11849 Update = SemaRef.PerformImplicitConversion(Update.get(), X->getType(), in checkStatement()
16654 isNonNegativeIntegerValue(Expr *&ValExpr, Sema &SemaRef, OpenMPClauseKind CKind, in isNonNegativeIntegerValue() argument
16663 SemaRef.PerformOpenMPImplicitIntegerConversion(Loc, ValExpr); in isNonNegativeIntegerValue()
16670 ValExpr->getIntegerConstantExpr(SemaRef.Context)) { in isNonNegativeIntegerValue()
16674 SemaRef.Diag(Loc, diag::err_omp_negative_expression_in_clause) in isNonNegativeIntegerValue()
16683 getOpenMPCaptureRegionForClause(DKind, CKind, SemaRef.LangOpts.OpenMP); in isNonNegativeIntegerValue()
16685 !SemaRef.CurContext->isDependentContext()) { in isNonNegativeIntegerValue()
16686 ValExpr = SemaRef.MakeFullExpr(ValExpr).get(); in isNonNegativeIntegerValue()
16688 ValExpr = tryBuildCapture(SemaRef, ValExpr, Captures).get(); in isNonNegativeIntegerValue()
16689 *HelperValStmt = buildPreInits(SemaRef.Context, Captures); in isNonNegativeIntegerValue()
17892 static bool isValidInteropVariable(Sema &SemaRef, Expr *InteropVarExpr, in isValidInteropVariable() argument
17899 getPrivateItem(SemaRef, RefExpr, ELoc, ERange, in isValidInteropVariable()
17913 LookupResult Result(SemaRef, &SemaRef.Context.Idents.get("omp_interop_t"), in isValidInteropVariable()
17915 if (SemaRef.LookupName(Result, SemaRef.getCurScope())) { in isValidInteropVariable()
17927 SemaRef.Diag(VarLoc, diag::err_omp_implied_type_not_found) in isValidInteropVariable()
17933 if (!SemaRef.Context.hasSameType(InteropType, VarType)) { in isValidInteropVariable()
17934 SemaRef.Diag(VarLoc, diag::err_omp_interop_variable_wrong_type); in isValidInteropVariable()
17941 isConstNotMutableType(SemaRef, InteropVarExpr->getType())) { in isValidInteropVariable()
17942 SemaRef.Diag(VarLoc, diag::err_omp_interop_variable_expected) in isValidInteropVariable()
19015 TransformExprToCaptures(Sema &SemaRef, ValueDecl *FieldDecl) in TransformExprToCaptures() argument
19016 : BaseTransform(SemaRef), Field(FieldDecl), CapturedExpr(nullptr) {} in TransformExprToCaptures()
19021 CapturedExpr = buildCapture(SemaRef, Field, E, /*WithInit=*/false); in TransformMemberExpr()
19042 static NamedDecl *findAcceptableDecl(Sema &SemaRef, NamedDecl *D) { in findAcceptableDecl() argument
19043 assert(!LookupResult::isVisible(SemaRef, D) && "not in slow case"); in findAcceptableDecl()
19051 if (LookupResult::isVisible(SemaRef, ND)) in findAcceptableDecl()
19059 argumentDependentLookup(Sema &SemaRef, const DeclarationNameInfo &Id, in argumentDependentLookup() argument
19067 SemaRef.FindAssociatedClassesAndNamespaces(Loc, &OVE, AssociatedNamespaces, in argumentDependentLookup()
19103 if (!SemaRef.isVisible(D)) { in argumentDependentLookup()
19104 D = findAcceptableDecl(SemaRef, D); in argumentDependentLookup()
19117 buildDeclareReductionRef(Sema &SemaRef, SourceLocation Loc, SourceRange Range, in buildDeclareReductionRef() argument
19125 LookupResult Lookup(SemaRef, ReductionId, Sema::LookupOMPReductionName); in buildDeclareReductionRef()
19127 while (S && SemaRef.LookupParsedName(Lookup, S, &ReductionIdScopeSpec)) { in buildDeclareReductionRef()
19150 if (SemaRef.CurContext->isDependentContext() || Ty->isDependentType() || in buildDeclareReductionRef()
19168 SemaRef.Context, /*NamingClass=*/nullptr, in buildDeclareReductionRef()
19169 ReductionIdScopeSpec.getWithLocInContext(SemaRef.Context), ReductionId, in buildDeclareReductionRef()
19185 LookupResult Lookup(SemaRef, ReductionId, Sema::LookupOMPReductionName); in buildDeclareReductionRef()
19190 if (SemaRef.isCompleteType(Loc, Ty) || TyRec->isBeingDefined() || in buildDeclareReductionRef()
19193 SemaRef.LookupQualifiedName(Lookup, TyRec->getDecl()); in buildDeclareReductionRef()
19201 if (SemaRef.getLangOpts().CPlusPlus) in buildDeclareReductionRef()
19202 argumentDependentLookup(SemaRef, ReductionId, Loc, Ty, Lookups); in buildDeclareReductionRef()
19204 Lookups, [&SemaRef, Ty](ValueDecl *D) -> ValueDecl * { in buildDeclareReductionRef()
19206 SemaRef.Context.hasSameType(D->getType(), Ty)) in buildDeclareReductionRef()
19210 return SemaRef.BuildDeclRefExpr(VD, VD->getType().getNonReferenceType(), in buildDeclareReductionRef()
19212 if (SemaRef.getLangOpts().CPlusPlus) { in buildDeclareReductionRef()
19214 Lookups, [&SemaRef, Ty, Loc](ValueDecl *D) -> ValueDecl * { in buildDeclareReductionRef()
19216 SemaRef.IsDerivedFrom(Loc, Ty, D->getType()) && in buildDeclareReductionRef()
19223 if (SemaRef.IsDerivedFrom(Loc, Ty, VD->getType(), Paths)) { in buildDeclareReductionRef()
19224 if (!Paths.isAmbiguous(SemaRef.Context.getCanonicalType( in buildDeclareReductionRef()
19226 if (SemaRef.CheckBaseClassAccess( in buildDeclareReductionRef()
19229 SemaRef.BuildBasePathArray(Paths, BasePath); in buildDeclareReductionRef()
19230 return SemaRef.BuildDeclRefExpr( in buildDeclareReductionRef()
19238 SemaRef.Diag(Loc, diag::err_omp_not_resolved_reduction_identifier) in buildDeclareReductionRef()
20418 Expr *NumIterations, Sema &SemaRef, in FinishOpenMPLinearClause() argument
20429 Step = SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get(); in FinishOpenMPLinearClause()
20440 auto Res = getPrivateItem(SemaRef, SimpleRefExpr, ELoc, ERange); in FinishOpenMPLinearClause()
20454 SemaRef.Diag(ELoc, in FinishOpenMPLinearClause()
20470 buildDeclRefExpr(SemaRef, cast<VarDecl>(DE->getDecl()), in FinishOpenMPLinearClause()
20478 SemaRef, S, RefExpr->getExprLoc(), *CurPrivate, InitExpr, IV, Step, in FinishOpenMPLinearClause()
20482 Update = SemaRef.ActOnFinishFullExpr(Update.get(), DE->getBeginLoc(), in FinishOpenMPLinearClause()
20488 Final = SemaRef.BuildBinOp( in FinishOpenMPLinearClause()
20490 SemaRef.DefaultLvalueConversion(*CurPrivate).get()); in FinishOpenMPLinearClause()
20493 Final = SemaRef.ActOnFinishFullExpr(Final.get(), DE->getBeginLoc(), in FinishOpenMPLinearClause()
20867 ProcessOpenMPDoacrossClauseCommon(Sema &SemaRef, bool IsSource, in ProcessOpenMPDoacrossClauseCommon() argument
20878 TotalDepCount = OrderedCountExpr->EvaluateKnownConstInt(SemaRef.Context); in ProcessOpenMPDoacrossClauseCommon()
20895 SemaRef.Diag(ELoc, diag::err_omp_depend_sink_unexpected_expr); in ProcessOpenMPDoacrossClauseCommon()
20907 if (SemaRef.CurContext->isDependentContext()) { in ProcessOpenMPDoacrossClauseCommon()
20938 auto Res = getPrivateItem(SemaRef, LHS, ELoc, ERange); in ProcessOpenMPDoacrossClauseCommon()
20948 SemaRef.Diag(OOLoc, diag::err_omp_depend_sink_expected_plus_minus); in ProcessOpenMPDoacrossClauseCommon()
20952 ExprResult RHSRes = SemaRef.VerifyPositiveIntegerConstantInClause( in ProcessOpenMPDoacrossClauseCommon()
20957 if (!SemaRef.CurContext->isDependentContext() && in ProcessOpenMPDoacrossClauseCommon()
20963 SemaRef.Diag(ELoc, diag::err_omp_depend_sink_expected_loop_iteration) in ProcessOpenMPDoacrossClauseCommon()
20966 SemaRef.Diag(ELoc, diag::err_omp_depend_sink_expected_loop_iteration) in ProcessOpenMPDoacrossClauseCommon()
20974 if (!SemaRef.CurContext->isDependentContext() && !IsSource && in ProcessOpenMPDoacrossClauseCommon()
20978 SemaRef.Diag(EndLoc, diag::err_omp_depend_sink_expected_loop_iteration) in ProcessOpenMPDoacrossClauseCommon()
21227 static bool checkTypeMappable(SourceLocation SL, SourceRange SR, Sema &SemaRef, in checkTypeMappable() argument
21230 if (SemaRef.RequireCompleteType(SL, QTy, diag::err_incomplete_type)) in checkTypeMappable()
21232 if (FullCheck && !SemaRef.CurContext->isDependentContext() && in checkTypeMappable()
21233 !QTy.isTriviallyCopyableType(SemaRef.Context)) in checkTypeMappable()
21234 SemaRef.Diag(SL, diag::warn_omp_non_trivial_type_mapped) << QTy << SR; in checkTypeMappable()
21241 static bool checkArrayExpressionDoesNotReferToWholeSize(Sema &SemaRef, in checkArrayExpressionDoesNotReferToWholeSize() argument
21265 if (!LowerBound->EvaluateAsInt(Result, SemaRef.getASTContext())) in checkArrayExpressionDoesNotReferToWholeSize()
21289 if (!Length->EvaluateAsInt(Result, SemaRef.getASTContext())) in checkArrayExpressionDoesNotReferToWholeSize()
21299 static bool checkArrayExpressionDoesNotReferToUnitySize(Sema &SemaRef, in checkArrayExpressionDoesNotReferToUnitySize() argument
21325 if (!Length->EvaluateAsInt(Result, SemaRef.getASTContext())) in checkArrayExpressionDoesNotReferToUnitySize()
21369 Sema &SemaRef; member in __anon8e68b8fa6111::MapBaseChecker
21384 if (SemaRef.getLangOpts().OpenMP < 50) { in emitErrorMsg()
21385 SemaRef.Diag(ELoc, in emitErrorMsg()
21389 SemaRef.Diag(ELoc, diag::err_omp_non_lvalue_in_map_or_motion_clauses) in emitErrorMsg()
21421 SemaRef.Diag(ELoc, diag::err_omp_expected_access_to_data_field) in VisitMemberExpr()
21437 SemaRef.Diag(ELoc, diag::err_omp_bit_fields_forbidden_in_clause) in VisitMemberExpr()
21457 SemaRef.Diag(ELoc, diag::err_omp_union_type_not_allowed) in VisitMemberExpr()
21484 SemaRef.Diag(ELoc, diag::err_omp_expected_base_var_name) in VisitArraySubscriptExpr()
21494 if (checkArrayExpressionDoesNotReferToWholeSize(SemaRef, AE, E->getType())) in VisitArraySubscriptExpr()
21500 AE->getIdx()->EvaluateAsInt(Result, SemaRef.getASTContext()) && in VisitArraySubscriptExpr()
21502 SemaRef.Diag(AE->getIdx()->getExprLoc(), in VisitArraySubscriptExpr()
21504 SemaRef.Diag(AE->getIdx()->getExprLoc(), in VisitArraySubscriptExpr()
21520 assert(!(SemaRef.getLangOpts().OpenMP < 50 && NoDiagnose) && in VisitOMPArraySectionExpr()
21535 SemaRef.Diag(ELoc, diag::err_omp_expected_base_var_name) in VisitOMPArraySectionExpr()
21541 checkArrayExpressionDoesNotReferToWholeSize(SemaRef, OASE, CurType); in VisitOMPArraySectionExpr()
21543 checkArrayExpressionDoesNotReferToUnitySize(SemaRef, OASE, CurType); in VisitOMPArraySectionExpr()
21555 SemaRef.getLangOpts().OpenMP >= 50) { in VisitOMPArraySectionExpr()
21557 SemaRef.Diag(ELoc, diag::err_omp_section_length_undefined) in VisitOMPArraySectionExpr()
21566 SemaRef.Diag(ELoc, in VisitOMPArraySectionExpr()
21579 OASE->getLength()->EvaluateAsInt(ResultR, SemaRef.getASTContext()) && in VisitOMPArraySectionExpr()
21581 SemaRef.Diag(OASE->getLength()->getExprLoc(), in VisitOMPArraySectionExpr()
21583 SemaRef.Diag(OASE->getLength()->getExprLoc(), in VisitOMPArraySectionExpr()
21588 SemaRef.getASTContext()) && in VisitOMPArraySectionExpr()
21590 SemaRef.Diag(OASE->getLowerBound()->getExprLoc(), in VisitOMPArraySectionExpr()
21592 SemaRef.Diag(OASE->getLowerBound()->getExprLoc(), in VisitOMPArraySectionExpr()
21613 if (SemaRef.getLangOpts().OpenMP < 50 || !UO->isLValue() || in VisitUnaryOperator()
21625 if (SemaRef.getLangOpts().OpenMP < 50 || !BO->getType()->isPointerType()) { in VisitBinaryOperator()
21669 Sema &SemaRef, OpenMPClauseKind CKind, OpenMPDirectiveKind DKind, in MapBaseChecker() argument
21672 : SemaRef(SemaRef), CKind(CKind), DKind(DKind), Components(Components), in MapBaseChecker()
21682 Sema &SemaRef, Expr *E, in checkMapClauseExpressionBase() argument
21687 MapBaseChecker Checker(SemaRef, CKind, DKind, CurComponents, NoDiagnose, ELoc, in checkMapClauseExpressionBase()
21691 if (SemaRef.getLangOpts().OpenMP >= 50 && !CurComponents.empty() && in checkMapClauseExpressionBase()
21702 SemaRef.Diag(ELoc, diag::err_array_section_does_not_specify_length) in checkMapClauseExpressionBase()
21714 Sema &SemaRef, DSAStackTy *DSAS, const ValueDecl *VD, const Expr *E, in checkMapConflicts() argument
21736 [&IsEnclosedByDataEnvironmentExpr, &SemaRef, VD, CurrentRegionOnly, ELoc, in checkMapConflicts()
21741 if (CKind == Kind && SemaRef.LangOpts.OpenMP >= 50) in checkMapConflicts()
21772 SemaRef.Diag(CI->getAssociatedExpression()->getExprLoc(), in checkMapConflicts()
21775 SemaRef.Diag(SI->getAssociatedExpression()->getExprLoc(), in checkMapConflicts()
21809 SemaRef, SI->getAssociatedExpression(), Type)) in checkMapConflicts()
21822 SemaRef.Diag(ELoc, diag::err_omp_map_shared_storage) << ERange; in checkMapConflicts()
21825 SemaRef.Diag(ELoc, diag::err_omp_once_referenced_in_target_update) in checkMapConflicts()
21828 SemaRef.Diag(RE->getExprLoc(), diag::note_used_here) in checkMapConflicts()
21861 SemaRef.Diag( in checkMapConflicts()
21865 SemaRef.Diag(RE->getExprLoc(), diag::note_used_here) in checkMapConflicts()
21874 SemaRef.Diag(DerivedLoc, diag::err_omp_same_pointer_dereferenced) in checkMapConflicts()
21876 SemaRef.Diag(RE->getExprLoc(), diag::note_used_here) in checkMapConflicts()
21909 SemaRef.Diag(ELoc, diag::err_omp_map_shared_storage) << ERange; in checkMapConflicts()
21912 SemaRef.Diag(ELoc, diag::err_omp_once_referenced_in_target_update) in checkMapConflicts()
21915 SemaRef.Diag(RE->getExprLoc(), diag::note_used_here) in checkMapConflicts()
21948 SemaRef.Diag(ELoc, in checkMapConflicts()
21951 SemaRef.Diag(EnclosingExpr->getExprLoc(), diag::note_used_here) in checkMapConflicts()
21961 static ExprResult buildUserDefinedMapperRef(Sema &SemaRef, Scope *S, in buildUserDefinedMapperRef() argument
21975 LookupResult Lookup(SemaRef, MapperId, Sema::LookupOMPMapperName); in buildUserDefinedMapperRef()
21978 while (S && SemaRef.LookupParsedName(Lookup, S, &MapperIdScopeSpec)) { in buildUserDefinedMapperRef()
21999 if (SemaRef.CurContext->isDependentContext() || Type->isDependentType() || in buildUserDefinedMapperRef()
22015 SemaRef.Context, /*NamingClass=*/nullptr, in buildUserDefinedMapperRef()
22016 MapperIdScopeSpec.getWithLocInContext(SemaRef.Context), MapperId, in buildUserDefinedMapperRef()
22024 SemaRef.Diag(Loc, diag::err_omp_mapper_wrong_type); in buildUserDefinedMapperRef()
22028 if (SemaRef.getLangOpts().CPlusPlus && !MapperIdScopeSpec.isSet()) in buildUserDefinedMapperRef()
22029 argumentDependentLookup(SemaRef, MapperId, Loc, Type, Lookups); in buildUserDefinedMapperRef()
22032 Lookups, [&SemaRef, Type](ValueDecl *D) -> ValueDecl * { in buildUserDefinedMapperRef()
22034 SemaRef.Context.hasSameType(D->getType(), Type)) in buildUserDefinedMapperRef()
22038 return SemaRef.BuildDeclRefExpr(VD, Type, VK_LValue, Loc); in buildUserDefinedMapperRef()
22042 Lookups, [&SemaRef, Type, Loc](ValueDecl *D) -> ValueDecl * { in buildUserDefinedMapperRef()
22044 SemaRef.IsDerivedFrom(Loc, Type, D->getType()) && in buildUserDefinedMapperRef()
22051 if (SemaRef.IsDerivedFrom(Loc, Type, VD->getType(), Paths)) { in buildUserDefinedMapperRef()
22052 if (!Paths.isAmbiguous(SemaRef.Context.getCanonicalType( in buildUserDefinedMapperRef()
22054 if (SemaRef.CheckBaseClassAccess( in buildUserDefinedMapperRef()
22057 return SemaRef.BuildDeclRefExpr(VD, Type, VK_LValue, Loc); in buildUserDefinedMapperRef()
22064 SemaRef.Diag(Loc, diag::err_omp_invalid_mapper) in buildUserDefinedMapperRef()
22102 Sema &SemaRef, DSAStackTy *DSAS, OpenMPClauseKind CKind, in checkMappableExpressionList() argument
22118 auto &DeclNames = SemaRef.getASTContext().DeclarationNames; in checkMappableExpressionList()
22120 &SemaRef.getASTContext().Idents.get("default"))); in checkMappableExpressionList()
22160 SemaRef, DSAS->getCurScope(), MapperIdScopeSpec, MapperId, in checkMappableExpressionList()
22174 if (SemaRef.getLangOpts().OpenMP < 50) { in checkMappableExpressionList()
22175 SemaRef.Diag( in checkMappableExpressionList()
22179 SemaRef.Diag(ELoc, diag::err_omp_non_lvalue_in_map_or_motion_clauses) in checkMappableExpressionList()
22191 checkMapClauseExpressionBase(SemaRef, SimpleExpr, CurComponents, CKind, in checkMappableExpressionList()
22204 SemaRef, DSAS->getCurScope(), MapperIdScopeSpec, MapperId, in checkMappableExpressionList()
22241 SemaRef.Diag(ELoc, diag::err_omp_threadprivate_in_clause) in checkMappableExpressionList()
22243 reportOriginalDsa(SemaRef, DSAS, VD, DVar); in checkMappableExpressionList()
22255 if (checkMapConflicts(SemaRef, DSAS, CurDeclaration, SimpleExpr, in checkMappableExpressionList()
22259 (SemaRef.getLangOpts().OpenMP <= 45 || StartLoc.isValid()) && in checkMappableExpressionList()
22260 checkMapConflicts(SemaRef, DSAS, CurDeclaration, SimpleExpr, in checkMappableExpressionList()
22299 if (!checkTypeMappable(VE->getExprLoc(), VE->getSourceRange(), SemaRef, in checkMappableExpressionList()
22312 SemaRef.getLangOpts().OpenMP >= 52)) { in checkMappableExpressionList()
22313 SemaRef.Diag(StartLoc, diag::err_omp_invalid_map_type_for_directive) in checkMappableExpressionList()
22327 MapType == OMPC_MAP_delete || SemaRef.getLangOpts().OpenMP >= 52)) { in checkMappableExpressionList()
22328 SemaRef.Diag(StartLoc, diag::err_omp_invalid_map_type_for_directive) in checkMappableExpressionList()
22342 SemaRef.Diag(StartLoc, in checkMappableExpressionList()
22358 SemaRef.Diag(StartLoc, diag::err_omp_invalid_map_type_for_directive) in checkMappableExpressionList()
22373 if (VD && ((SemaRef.LangOpts.OpenMP <= 45 && in checkMappableExpressionList()
22378 SemaRef.Diag(ELoc, diag::err_omp_variable_in_given_clause_and_dsa) in checkMappableExpressionList()
22382 reportOriginalDsa(SemaRef, DSAS, CurDeclaration, DVar); in checkMappableExpressionList()
22390 SemaRef, DSAS->getCurScope(), MapperIdScopeSpec, MapperId, in checkMappableExpressionList()
23376 Sema &SemaRef, Decl *D) { in checkDeclInTargetContext() argument
23382 if (SemaRef.LangOpts.OpenMP >= 50 && in checkDeclInTargetContext()
23383 (SemaRef.getCurLambda(/*IgnoreNonLambdaCapturingScope=*/true) || in checkDeclInTargetContext()
23384 SemaRef.getCurBlock() || SemaRef.getCurCapturedRegion()) && in checkDeclInTargetContext()
23393 SemaRef.Diag(VD->getLocation(), in checkDeclInTargetContext()
23395 SemaRef.Diag(SL, diag::note_var_explicitly_captured_here) in checkDeclInTargetContext()
23402 SemaRef.Diag(VD->getLocation(), diag::warn_omp_not_in_target_context); in checkDeclInTargetContext()
23403 SemaRef.Diag(SL, diag::note_used_here) << SR; in checkDeclInTargetContext()
23407 Sema &SemaRef, DSAStackTy *Stack, in checkValueDeclInTarget() argument
23410 checkTypeMappable(SL, SR, SemaRef, Stack, VD->getType(), in checkValueDeclInTarget()