Lines Matching refs:SemaRef

50     Sema &SemaRef, Expr *E,
212 Sema &SemaRef; member in __anon4581b7f80111::DSAStackTy
315 explicit DSAStackTy(Sema &S) : SemaRef(S) {} in DSAStackTy()
445 const FunctionScopeInfo *CurFnScope = SemaRef.getCurFunction(); in pushFunction()
458 for (const FunctionScopeInfo *FSI : llvm::reverse(SemaRef.FunctionScopes)) { in popFunction()
654 SemaRef.Diag(CNew->getBeginLoc(), in hasDuplicateRequiresClause()
657 SemaRef.Diag(CPrev->getBeginLoc(), in hasDuplicateRequiresClause()
1395 static VarDecl *buildVarDecl(Sema &SemaRef, SourceLocation Loc, QualType Type, in buildVarDecl() argument
1398 DeclContext *DC = SemaRef.CurContext; in buildVarDecl()
1399 IdentifierInfo *II = &SemaRef.PP.getIdentifierTable().get(Name); in buildVarDecl()
1400 TypeSourceInfo *TInfo = SemaRef.Context.getTrivialTypeSourceInfo(Type, Loc); in buildVarDecl()
1402 VarDecl::Create(SemaRef.Context, DC, Loc, Loc, II, Type, TInfo, SC_None); in buildVarDecl()
1411 OMPReferencedVarAttr::CreateImplicit(SemaRef.Context, OrigRef)); in buildVarDecl()
1445 VarDecl *VD = buildVarDecl(SemaRef, SR.getBegin(), in addTaskgroupReductionData()
1446 SemaRef.Context.VoidPtrTy, ".task_red."); in addTaskgroupReductionData()
1448 buildDeclRefExpr(SemaRef, VD, SemaRef.Context.VoidPtrTy, SR.getBegin()); in addTaskgroupReductionData()
1471 VarDecl *VD = buildVarDecl(SemaRef, SR.getBegin(), in addTaskgroupReductionData()
1472 SemaRef.Context.VoidPtrTy, ".task_red."); in addTaskgroupReductionData()
1474 buildDeclRefExpr(SemaRef, VD, SemaRef.Context.VoidPtrTy, SR.getBegin()); in addTaskgroupReductionData()
1553 static bool isConstNotMutableType(Sema &SemaRef, QualType Type, in isConstNotMutableType() argument
1556 ASTContext &Context = SemaRef.getASTContext(); in isConstNotMutableType()
1560 const CXXRecordDecl *RD = AcceptIfMutable && SemaRef.getLangOpts().CPlusPlus in isConstNotMutableType()
1568 return IsConstant && !(SemaRef.getLangOpts().CPlusPlus && RD && in isConstNotMutableType()
1572 static bool rejectConstNotMutableType(Sema &SemaRef, const ValueDecl *D, in rejectConstNotMutableType() argument
1577 ASTContext &Context = SemaRef.getASTContext(); in rejectConstNotMutableType()
1579 if (isConstNotMutableType(SemaRef, Type, AcceptIfMutable, &IsClassType)) { in rejectConstNotMutableType()
1584 SemaRef.Diag(ELoc, Diag) << getOpenMPClauseName(CKind); in rejectConstNotMutableType()
1589 SemaRef.Diag(D->getLocation(), in rejectConstNotMutableType()
1613 SemaRef, VD, D->getType().getNonReferenceType(), in getTopDSA()
1624 SemaRef.getLangOpts().OpenMPUseTLS && in getTopDSA()
1625 SemaRef.getASTContext().getTargetInfo().isTLSSupported())) || in getTopDSA()
1629 SemaRef, VD, D->getType().getNonReferenceType(), D->getLocation()); in getTopDSA()
1634 if (SemaRef.getLangOpts().OpenMPCUDAMode && VD && in getTopDSA()
1647 buildDeclRefExpr(SemaRef, VD, D->getType().getNonReferenceType(), in getTopDSA()
1662 if (!SemaRef.isOpenMPCapturedByRef( in getTopDSA()
1666 buildDeclRefExpr(SemaRef, VD, D->getType().getNonReferenceType(), in getTopDSA()
1714 if (SemaRef.LangOpts.OpenMP <= 31) { in getTopDSA()
1719 if (isConstNotMutableType(SemaRef, D->getType())) { in getTopDSA()
2608 static void reportOriginalDsa(Sema &SemaRef, const DSAStackTy *Stack,
2740 Expr *NumIterations, Sema &SemaRef,
2747 Sema &SemaRef; member in __anon4581b7f81811::VarDeclFilterCCC
2750 explicit VarDeclFilterCCC(Sema &S) : SemaRef(S) {} in VarDeclFilterCCC()
2755 SemaRef.isDeclInScope(ND, SemaRef.getCurLexicalContext(), in ValidateCandidate()
2756 SemaRef.getCurScope()); in ValidateCandidate()
2769 Sema &SemaRef; member in __anon4581b7f81811::VarOrFuncDeclFilterCCC
2772 explicit VarOrFuncDeclFilterCCC(Sema &S) : SemaRef(S) {} in VarOrFuncDeclFilterCCC()
2777 return SemaRef.isDeclInScope(ND, SemaRef.getCurLexicalContext(), in ValidateCandidate()
2778 SemaRef.getCurScope()); in ValidateCandidate()
2930 Sema &SemaRef; member in __anon4581b7f81911::LocalVarRefChecker
2936 SemaRef.Diag(E->getBeginLoc(), in VisitDeclRefExpr()
2939 SemaRef.Diag(VD->getLocation(), diag::note_defined_here) in VisitDeclRefExpr()
2953 explicit LocalVarRefChecker(Sema &SemaRef) : SemaRef(SemaRef) {} in LocalVarRefChecker() argument
3309 static void reportOriginalDsa(Sema &SemaRef, const DSAStackTy *Stack, in reportOriginalDsa() argument
3314 SemaRef.Diag(DVar.RefExpr->getExprLoc(), diag::note_omp_explicit_dsa) in reportOriginalDsa()
3350 else if (D->getType().isConstant(SemaRef.getASTContext())) in reportOriginalDsa()
3357 SemaRef.Diag(ReportLoc, diag::note_omp_predetermined_dsa) in reportOriginalDsa()
3361 SemaRef.Diag(DVar.ImplicitDSALoc, diag::note_omp_implicit_dsa) in reportOriginalDsa()
3413 Sema &SemaRef; member in __anon4581b7f81b11::DSAAttrChecker
3536 getVariableCategoryFromDecl(SemaRef.getLangOpts(), VD); in VisitDeclRefExpr()
3537 if (SemaRef.getLangOpts().OpenMP >= 50) { in VisitDeclRefExpr()
3559 if (SemaRef.getLangOpts().OpenMP > 50) { in VisitDeclRefExpr()
3579 if (SemaRef.LangOpts.OpenMP >= 50) in VisitDeclRefExpr()
3635 SemaRef.Diag(ELoc, diag::err_omp_reduction_in_task); in VisitDeclRefExpr()
3636 reportOriginalDsa(SemaRef, Stack, VD, DVar); in VisitDeclRefExpr()
3701 getVariableCategoryFromDecl(SemaRef.getLangOpts(), FD); in VisitMemberExpr()
3725 SemaRef.Diag(ELoc, diag::err_omp_reduction_in_task); in VisitMemberExpr()
3726 reportOriginalDsa(SemaRef, Stack, FD, DVar); in VisitMemberExpr()
3745 if (!checkMapClauseExpressionBase(SemaRef, E, CurComponents, OMPC_map, in VisitMemberExpr()
3842 SemaRef, VD, VD->getType().getNonLValueExprType(SemaRef.Context), in visitSubCaptures()
3863 DSAAttrChecker(DSAStackTy *S, Sema &SemaRef, CapturedStmt *CS) in DSAAttrChecker() argument
3864 : Stack(S), SemaRef(SemaRef), ErrorFound(false), CS(CS) { in DSAAttrChecker()
4633 static bool checkCancelRegion(Sema &SemaRef, OpenMPDirectiveKind CurrentRegion, in checkCancelRegion() argument
4644 SemaRef.Diag(StartLoc, diag::err_omp_wrong_cancel_region) in checkCancelRegion()
4649 static bool checkNestingOfRegions(Sema &SemaRef, const DSAStackTy *Stack, in checkNestingOfRegions() argument
4669 ((SemaRef.LangOpts.OpenMP <= 45 && CurrentRegion != OMPD_ordered) || in checkNestingOfRegions()
4670 (SemaRef.LangOpts.OpenMP >= 50 && CurrentRegion != OMPD_ordered && in checkNestingOfRegions()
4685 SemaRef.Diag(StartLoc, (CurrentRegion != OMPD_simd) in checkNestingOfRegions()
4688 << (SemaRef.LangOpts.OpenMP >= 50 ? 1 : 0); in checkNestingOfRegions()
4694 SemaRef.Diag(StartLoc, diag::err_omp_prohibited_region_atomic); in checkNestingOfRegions()
4704 SemaRef.Diag(StartLoc, diag::err_omp_orphaned_section_directive) in checkNestingOfRegions()
4744 (SemaRef.getLangOpts().OpenMP >= 50 && in checkNestingOfRegions()
4776 SemaRef.Diag(StartLoc, in checkNestingOfRegions()
4780 SemaRef.Diag(PreviousCriticalLoc, in checkNestingOfRegions()
4827 (SemaRef.LangOpts.OpenMP <= 45 && ParentRegion != OMPD_target) || in checkNestingOfRegions()
4828 (SemaRef.LangOpts.OpenMP >= 50 && ParentRegion != OMPD_unknown && in checkNestingOfRegions()
4837 SemaRef.LangOpts.OpenMP < 50 || in checkNestingOfRegions()
4886 SemaRef.Diag(StartLoc, diag::err_omp_orphaned_device_directive) in checkNestingOfRegions()
4889 SemaRef.Diag(StartLoc, diag::err_omp_prohibited_region) in checkNestingOfRegions()
5576 static ExprResult buildUserDefinedMapperRef(Sema &SemaRef, Scope *S,
7195 Sema &SemaRef; member in __anon4581b7f83411::OpenMPIterationSpaceChecker
7246 OpenMPIterationSpaceChecker(Sema &SemaRef, bool SupportsNonRectangular, in OpenMPIterationSpaceChecker() argument
7248 : SemaRef(SemaRef), SupportsNonRectangular(SupportsNonRectangular), in OpenMPIterationSpaceChecker()
7388 ExprResult Val = SemaRef.PerformOpenMPImplicitIntegerConversion( in setStep()
7406 NewStep->getIntegerConstantExpr(SemaRef.Context); in setStep()
7421 SemaRef.Diag(NewStep->getExprLoc(), in setStep()
7424 SemaRef.Diag(ConditionLoc, in setStep()
7431 SemaRef.CreateBuiltinUnaryOp(NewStep->getExprLoc(), UO_Minus, NewStep) in setStep()
7447 Sema &SemaRef; member in __anon4581b7f83411::__anon4581b7f83511::LoopCounterRefChecker
7457 SemaRef.Diag(E->getExprLoc(), diag::err_omp_stmt_depends_on_loop_counter) in checkDecl()
7468 VD->getNameForDiagnostic(OS, SemaRef.getPrintingPolicy(), in checkDecl()
7470 SemaRef.Diag(E->getExprLoc(), in checkDecl()
7473 SemaRef.Diag(VD->getLocation(), diag::note_previous_decl) << VD; in checkDecl()
7477 SemaRef.Diag(E->getExprLoc(), diag::err_omp_invariant_dependency); in checkDecl()
7487 DepDecl->getNameForDiagnostic(OS, SemaRef.getPrintingPolicy(), in checkDecl()
7489 SemaRef.Diag(E->getExprLoc(), in checkDecl()
7522 explicit LoopCounterRefChecker(Sema &SemaRef, DSAStackTy &Stack, in LoopCounterRefChecker() argument
7526 : SemaRef(SemaRef), Stack(Stack), CurLCDecl(CurLCDecl), in LoopCounterRefChecker()
7544 LoopCounterRefChecker LoopStmtChecker(SemaRef, Stack, LCDecl, IsInitializer, in doesDependOnLoopCounter()
7564 SemaRef.Diag(DefaultLoc, diag::err_omp_loop_not_canonical_init); in checkAndSetInit()
7598 SemaRef.Diag(S->getBeginLoc(), in checkAndSetInit()
7603 buildDeclRefExpr(SemaRef, Var, in checkAndSetInit()
7629 if (dependent() || SemaRef.CurContext->isDependentContext()) in checkAndSetInit()
7632 SemaRef.Diag(S->getBeginLoc(), diag::err_omp_loop_not_canonical_init) in checkAndSetInit()
7667 bool IneqCondIsCanonical = SemaRef.getLangOpts().OpenMP >= 50; in checkAndSetCond()
7669 SemaRef.Diag(DefaultLoc, diag::err_omp_loop_not_canonical_cond) in checkAndSetCond()
7713 if (dependent() || SemaRef.CurContext->isDependentContext()) in checkAndSetCond()
7715 SemaRef.Diag(CondLoc, diag::err_omp_loop_not_canonical_cond) in checkAndSetCond()
7744 if (dependent() || SemaRef.CurContext->isDependentContext()) in checkAndSetIncRHS()
7746 SemaRef.Diag(RHS->getBeginLoc(), diag::err_omp_loop_not_canonical_incr) in checkAndSetIncRHS()
7766 SemaRef.Diag(DefaultLoc, diag::err_omp_loop_not_canonical_incr) << LCDecl; in checkAndSetInc()
7778 return setStep(SemaRef in checkAndSetInc()
7802 return setStep(SemaRef in checkAndSetInc()
7822 if (dependent() || SemaRef.CurContext->isDependentContext()) in checkAndSetInc()
7824 SemaRef.Diag(S->getBeginLoc(), diag::err_omp_loop_not_canonical_incr) in checkAndSetInc()
7830 tryBuildCapture(Sema &SemaRef, Expr *Capture, in tryBuildCapture() argument
7832 if (SemaRef.CurContext->isDependentContext() || Capture->containsErrors()) in tryBuildCapture()
7834 if (Capture->isEvaluatable(SemaRef.Context, Expr::SE_AllowSideEffects)) in tryBuildCapture()
7835 return SemaRef.PerformImplicitConversion( in tryBuildCapture()
7840 return buildCapture(SemaRef, Capture, I->second); in tryBuildCapture()
7842 ExprResult Res = buildCapture(SemaRef, Capture, Ref); in tryBuildCapture()
7850 calculateNumIters(Sema &SemaRef, Scope *S, SourceLocation DefaultLoc, in calculateNumIters() argument
7854 ExprResult NewStep = tryBuildCapture(SemaRef, Step, Captures); in calculateNumIters()
7859 if (Optional<llvm::APSInt> Res = Lower->getIntegerConstantExpr(SemaRef.Context)) { in calculateNumIters()
7863 if (Optional<llvm::APSInt> Res = Step->getIntegerConstantExpr(SemaRef.Context)) { in calculateNumIters()
7901 if (Optional<llvm::APSInt> Res = Upper->getIntegerConstantExpr(SemaRef.Context)) { in calculateNumIters()
7924 uint64_t LowerSize = SemaRef.Context.getTypeSize(LowerTy); in calculateNumIters()
7925 uint64_t UpperSize = SemaRef.Context.getTypeSize(UpperTy); in calculateNumIters()
7928 QualType CastType = SemaRef.Context.getIntTypeForBitwidth( in calculateNumIters()
7931 SemaRef in calculateNumIters()
7933 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Upper).get(), in calculateNumIters()
7936 Lower = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Lower).get(); in calculateNumIters()
7937 NewStep = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, NewStep.get()); in calculateNumIters()
7952 SemaRef.BuildBinOp(S, DefaultLoc, BO_Sub, Diff.get(), NewStep.get()); in calculateNumIters()
7959 Diff = SemaRef.BuildBinOp( in calculateNumIters()
7961 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); in calculateNumIters()
7965 Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); in calculateNumIters()
7970 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Sub, Upper, Diff.get()); in calculateNumIters()
7974 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Sub, Upper, Lower); in calculateNumIters()
7979 SemaRef.Diag(Upper->getBeginLoc(), diag::err_omp_loop_diff_cxx) in calculateNumIters()
7989 Diff = SemaRef.BuildBinOp( in calculateNumIters()
7991 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); in calculateNumIters()
7998 SemaRef.BuildBinOp(S, DefaultLoc, BO_Add, Diff.get(), NewStep.get()); in calculateNumIters()
8005 Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); in calculateNumIters()
8010 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Div, Diff.get(), NewStep.get()); in calculateNumIters()
8023 !SemaRef.getLangOpts().CPlusPlus) in buildNumIterations()
8035 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MinValue); in buildNumIterations()
8039 ExprResult LBMinVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, in buildNumIterations()
8045 SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, LBMinVal.get(), LBVal); in buildNumIterations()
8049 LBMinVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, LBMinVal.get()); in buildNumIterations()
8055 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MaxValue); in buildNumIterations()
8059 ExprResult LBMaxVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, in buildNumIterations()
8065 SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, LBMaxVal.get(), LBVal); in buildNumIterations()
8069 LBMaxVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, LBMaxVal.get()); in buildNumIterations()
8073 Expr *LBMin = tryBuildCapture(SemaRef, LBMinVal.get(), Captures).get(); in buildNumIterations()
8074 Expr *LBMax = tryBuildCapture(SemaRef, LBMaxVal.get(), Captures).get(); in buildNumIterations()
8079 SemaRef.BuildBinOp(S, DefaultLoc, BO_LT, LBMin, LBMax); in buildNumIterations()
8083 tryBuildCapture(SemaRef, MinLessMaxRes.get(), Captures).get(); in buildNumIterations()
8089 ExprResult MinLB = SemaRef.ActOnConditionalOp(DefaultLoc, DefaultLoc, in buildNumIterations()
8097 ExprResult MaxLB = SemaRef.ActOnConditionalOp(DefaultLoc, DefaultLoc, in buildNumIterations()
8112 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MinValue); in buildNumIterations()
8116 ExprResult UBMinVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, in buildNumIterations()
8122 SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, UBMinVal.get(), UBVal); in buildNumIterations()
8126 UBMinVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, UBMinVal.get()); in buildNumIterations()
8132 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MaxValue); in buildNumIterations()
8136 ExprResult UBMaxVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, in buildNumIterations()
8142 SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, UBMaxVal.get(), UBVal); in buildNumIterations()
8146 UBMaxVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, UBMaxVal.get()); in buildNumIterations()
8150 Expr *UBMin = tryBuildCapture(SemaRef, UBMinVal.get(), Captures).get(); in buildNumIterations()
8151 Expr *UBMax = tryBuildCapture(SemaRef, UBMaxVal.get(), Captures).get(); in buildNumIterations()
8156 SemaRef.BuildBinOp(S, DefaultLoc, BO_GT, UBMin, UBMax); in buildNumIterations()
8160 tryBuildCapture(SemaRef, MinGreaterMaxRes.get(), Captures).get(); in buildNumIterations()
8166 ExprResult MaxUB = SemaRef.ActOnConditionalOp( in buildNumIterations()
8174 ExprResult MinUB = SemaRef.ActOnConditionalOp( in buildNumIterations()
8183 Expr *Upper = tryBuildCapture(SemaRef, UBExpr, Captures).get(); in buildNumIterations()
8184 Expr *Lower = tryBuildCapture(SemaRef, LBExpr, Captures).get(); in buildNumIterations()
8188 ExprResult Diff = calculateNumIters(SemaRef, S, DefaultLoc, Lower, Upper, in buildNumIterations()
8196 ASTContext &C = SemaRef.Context; in buildNumIterations()
8205 if (!SemaRef.Context.hasSameType(Diff.get()->getType(), Type)) { in buildNumIterations()
8206 Diff = SemaRef.PerformImplicitConversion( in buildNumIterations()
8217 SemaRef.Diag(DefaultLoc, diag::warn_omp_loop_64_bit_var) in buildNumIterations()
8223 if (!SemaRef.Context.hasSameType(Diff.get()->getType(), NewType)) { in buildNumIterations()
8224 Diff = SemaRef.PerformImplicitConversion(Diff.get(), NewType, in buildNumIterations()
8252 LBNonRect ? LBExpr : tryBuildCapture(SemaRef, LBExpr, Captures).get(); in buildMinMaxValues()
8254 UBNonRect ? UBExpr : tryBuildCapture(SemaRef, UBExpr, Captures).get(); in buildMinMaxValues()
8266 ExprResult Diff = calculateNumIters(SemaRef, S, DefaultLoc, Lower, Upper, in buildMinMaxValues()
8274 Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); in buildMinMaxValues()
8278 ExprResult NewStep = tryBuildCapture(SemaRef, Step, Captures); in buildMinMaxValues()
8281 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Mul, Diff.get(), NewStep.get()); in buildMinMaxValues()
8286 Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); in buildMinMaxValues()
8292 !SemaRef.Context.hasSameType( in buildMinMaxValues()
8294 SemaRef.Context.getUnsignedPointerDiffType())) { in buildMinMaxValues()
8295 Diff = SemaRef.PerformImplicitConversion( in buildMinMaxValues()
8296 Diff.get(), SemaRef.Context.getUnsignedPointerDiffType(), in buildMinMaxValues()
8305 Diff = SemaRef.BuildBinOp( in buildMinMaxValues()
8307 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Lower).get(), in buildMinMaxValues()
8314 Diff = SemaRef.BuildBinOp( in buildMinMaxValues()
8316 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Upper).get(), in buildMinMaxValues()
8323 if (SemaRef.Context.hasSameType(Diff.get()->getType(), VarType)) in buildMinMaxValues()
8324 Diff = SemaRef.PerformImplicitConversion(Diff.get(), VarType, in buildMinMaxValues()
8330 Sema::TentativeAnalysisScope Trap(SemaRef); in buildMinMaxValues()
8331 Diff = SemaRef.ActOnFinishFullExpr(Diff.get(), /*DiscardedValue=*/false); in buildMinMaxValues()
8357 return SemaRef.PerformImplicitConversion( in buildPreCond()
8358 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get(), in buildPreCond()
8359 SemaRef.Context.BoolTy, /*Action=*/Sema::AA_Casting, in buildPreCond()
8363 Sema::TentativeAnalysisScope Trap(SemaRef); in buildPreCond()
8365 ExprResult NewLB = tryBuildCapture(SemaRef, LB, Captures); in buildPreCond()
8366 ExprResult NewUB = tryBuildCapture(SemaRef, UB, Captures); in buildPreCond()
8371 SemaRef.BuildBinOp(S, DefaultLoc, in buildPreCond()
8377 if (!SemaRef.Context.hasSameUnqualifiedType(CondExpr.get()->getType(), in buildPreCond()
8378 SemaRef.Context.BoolTy)) in buildPreCond()
8379 CondExpr = SemaRef.PerformImplicitConversion( in buildPreCond()
8380 CondExpr.get(), SemaRef.Context.BoolTy, /*Action=*/Sema::AA_Casting, in buildPreCond()
8394 VD = SemaRef.isOpenMPCapturedDecl(LCDecl); in buildCounterVar()
8396 SemaRef, VD, VD->getType().getNonReferenceType(), DefaultLoc); in buildCounterVar()
8412 SemaRef, DefaultLoc, Type, LCDecl->getName(), in buildPrivateCounterVar()
8415 ? buildDeclRefExpr(SemaRef, cast<VarDecl>(LCDecl), Type, DefaultLoc) in buildPrivateCounterVar()
8419 return buildDeclRefExpr(SemaRef, PrivateVar, Type, DefaultLoc); in buildPrivateCounterVar()
8434 Expr *Cnt = SemaRef.DefaultLvalueConversion(Counter).get(); in buildOrderedLoopData()
8441 Cnt = SemaRef.BuildBinOp(S, Loc, BOK, Cnt, Inc).get(); in buildOrderedLoopData()
8447 !SemaRef.getLangOpts().CPlusPlus) in buildOrderedLoopData()
8452 : tryBuildCapture(SemaRef, LB, Captures).get(); in buildOrderedLoopData()
8454 ? tryBuildCapture(SemaRef, LB, Captures).get() in buildOrderedLoopData()
8460 SemaRef, S, DefaultLoc, Lower, Upper, Step, VarType, in buildOrderedLoopData()
8555 OpenMPDirectiveKind DKind, Stmt *S, Sema &SemaRef, DSAStackTy &DSA, in checkOpenMPIterationSpace() argument
8571 if (!For && (SemaRef.LangOpts.OpenMP <= 45 || !CXXFor)) { in checkOpenMPIterationSpace()
8572 SemaRef.Diag(S->getBeginLoc(), diag::err_omp_not_for) in checkOpenMPIterationSpace()
8578 SemaRef.Diag(DSA.getConstructLoc(), in checkOpenMPIterationSpace()
8583 SemaRef.Diag(CollapseLoopCountExpr->getExprLoc(), in checkOpenMPIterationSpace()
8587 SemaRef.Diag(OrderedLoopCountExpr->getExprLoc(), in checkOpenMPIterationSpace()
8596 OpenMPIterationSpaceChecker ISC(SemaRef, SupportsNonRectangular, DSA, in checkOpenMPIterationSpace()
8616 !(SemaRef.getLangOpts().CPlusPlus && VarType->isOverloadableType())) { in checkOpenMPIterationSpace()
8617 SemaRef.Diag(Init->getBeginLoc(), diag::err_omp_loop_variable_type) in checkOpenMPIterationSpace()
8618 << SemaRef.getLangOpts().CPlusPlus; in checkOpenMPIterationSpace()
8642 if (ISC.dependent() || SemaRef.CurContext->isDependentContext() || HasErrors) in checkOpenMPIterationSpace()
8733 buildCounterInit(Sema &SemaRef, Scope *S, SourceLocation Loc, ExprResult VarRef, in buildCounterInit() argument
8739 : tryBuildCapture(SemaRef, Start.get(), Captures); in buildCounterInit()
8742 if (!SemaRef.Context.hasSameType(NewStart.get()->getType(), in buildCounterInit()
8744 NewStart = SemaRef.PerformImplicitConversion( in buildCounterInit()
8752 SemaRef.BuildBinOp(S, Loc, BO_Assign, VarRef.get(), NewStart.get()); in buildCounterInit()
8758 Sema &SemaRef, Scope *S, SourceLocation Loc, ExprResult VarRef, in buildCounterUpdate() argument
8763 Iter = SemaRef.ActOnParenExpr(Loc, Loc, Iter.get()); in buildCounterUpdate()
8770 NewStep = tryBuildCapture(SemaRef, Step.get(), *Captures); in buildCounterUpdate()
8774 SemaRef.BuildBinOp(S, Loc, BO_Mul, Iter.get(), NewStep.get()); in buildCounterUpdate()
8782 ExprResult NewStart = SemaRef.ActOnParenExpr(Loc, Loc, Start.get()); in buildCounterUpdate()
8786 NewStart = tryBuildCapture(SemaRef, Start.get(), *Captures); in buildCounterUpdate()
8796 Sema::TentativeAnalysisScope Trap(SemaRef); in buildCounterUpdate()
8799 SemaRef.BuildBinOp(S, Loc, BO_Assign, VarRef.get(), NewStart.get()); in buildCounterUpdate()
8802 SemaRef.BuildBinOp(S, Loc, Subtract ? BO_SubAssign : BO_AddAssign, in buildCounterUpdate()
8805 Update = SemaRef.CreateBuiltinBinOp(Loc, BO_Comma, Update.get(), in buildCounterUpdate()
8813 Update = SemaRef.BuildBinOp(S, Loc, Subtract ? BO_Sub : BO_Add, in buildCounterUpdate()
8818 if (!SemaRef.Context.hasSameType(Update.get()->getType(), in buildCounterUpdate()
8820 Update = SemaRef.PerformImplicitConversion( in buildCounterUpdate()
8826 Update = SemaRef.BuildBinOp(S, Loc, BO_Assign, VarRef.get(), Update.get()); in buildCounterUpdate()
8833 static ExprResult widenIterationCount(unsigned Bits, Expr *E, Sema &SemaRef) { in widenIterationCount() argument
8836 ASTContext &C = SemaRef.Context; in widenIterationCount()
8843 return SemaRef.PerformImplicitConversion(E, NewType, Sema::AA_Converting, in widenIterationCount()
8849 static bool fitsInto(unsigned Bits, bool Signed, const Expr *E, Sema &SemaRef) { in fitsInto() argument
8853 E->getIntegerConstantExpr(SemaRef.Context)) in fitsInto()
8907 Expr *OrderedLoopCountExpr, Stmt *AStmt, Sema &SemaRef, in checkOpenMPLoop() argument
8912 bool SupportsNonPerfectlyNested = (SemaRef.LangOpts.OpenMP >= 50) && in checkOpenMPLoop()
8919 CollapseLoopCountExpr->EvaluateAsInt(Result, SemaRef.getASTContext())) { in checkOpenMPLoop()
8932 SemaRef.getASTContext())) { in checkOpenMPLoop()
8935 SemaRef.Diag(OrderedLoopCountExpr->getExprLoc(), in checkOpenMPLoop()
8938 SemaRef.Diag(CollapseLoopCountExpr->getExprLoc(), in checkOpenMPLoop()
8956 [DKind, &SemaRef, &DSA, NumLoops, NestedLoopCount, in checkOpenMPLoop()
8960 DKind, CurStmt, SemaRef, DSA, Cnt, NestedLoopCount, in checkOpenMPLoop()
8974 [&SemaRef, &Captures](OMPLoopBasedDirective *Transform) { in checkOpenMPLoop()
8987 DeclRefExpr *Ref = buildDeclRefExpr(SemaRef, D, D->getType(), in checkOpenMPLoop()
8996 if (SemaRef.CurContext->isDependentContext()) in checkOpenMPLoop()
9034 SemaRef in checkOpenMPLoop()
9039 SemaRef); in checkOpenMPLoop()
9042 SemaRef in checkOpenMPLoop()
9047 SemaRef); in checkOpenMPLoop()
9052 ASTContext &C = SemaRef.Context; in checkOpenMPLoop()
9059 SemaRef.BuildBinOp(CurScope, PreCond.get()->getExprLoc(), BO_LAnd, in checkOpenMPLoop()
9066 LastIteration32 = SemaRef.BuildBinOp( in checkOpenMPLoop()
9068 SemaRef in checkOpenMPLoop()
9074 LastIteration64 = SemaRef.BuildBinOp( in checkOpenMPLoop()
9076 SemaRef in checkOpenMPLoop()
9085 if (SemaRef.getLangOpts().OpenMPOptimisticCollapse || in checkOpenMPLoop()
9092 LastIteration64.get(), SemaRef)))) in checkOpenMPLoop()
9099 SemaRef.Context.getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/0); in checkOpenMPLoop()
9101 SemaRef.Context.getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/1); in checkOpenMPLoop()
9110 LastIteration = SemaRef.BuildBinOp( in checkOpenMPLoop()
9113 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); in checkOpenMPLoop()
9120 bool IsConstant = LastIteration.get()->isIntegerConstantExpr(SemaRef.Context); in checkOpenMPLoop()
9124 tryBuildCapture(SemaRef, LastIteration.get(), Captures); in checkOpenMPLoop()
9128 NumIterations = SemaRef.BuildBinOp( in checkOpenMPLoop()
9130 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); in checkOpenMPLoop()
9143 VarDecl *LBDecl = buildVarDecl(SemaRef, InitLoc, VType, ".omp.lb"); in checkOpenMPLoop()
9144 LB = buildDeclRefExpr(SemaRef, LBDecl, VType, InitLoc); in checkOpenMPLoop()
9145 SemaRef.AddInitializerToDecl(LBDecl, in checkOpenMPLoop()
9146 SemaRef.ActOnIntegerConstant(InitLoc, 0).get(), in checkOpenMPLoop()
9150 VarDecl *UBDecl = buildVarDecl(SemaRef, InitLoc, VType, ".omp.ub"); in checkOpenMPLoop()
9151 UB = buildDeclRefExpr(SemaRef, UBDecl, VType, InitLoc); in checkOpenMPLoop()
9152 SemaRef.AddInitializerToDecl(UBDecl, LastIteration.get(), in checkOpenMPLoop()
9157 QualType Int32Ty = SemaRef.Context.getIntTypeForBitwidth(32, true); in checkOpenMPLoop()
9158 VarDecl *ILDecl = buildVarDecl(SemaRef, InitLoc, Int32Ty, ".omp.is_last"); in checkOpenMPLoop()
9159 IL = buildDeclRefExpr(SemaRef, ILDecl, Int32Ty, InitLoc); in checkOpenMPLoop()
9160 SemaRef.AddInitializerToDecl(ILDecl, in checkOpenMPLoop()
9161 SemaRef.ActOnIntegerConstant(InitLoc, 0).get(), in checkOpenMPLoop()
9166 buildVarDecl(SemaRef, InitLoc, StrideVType, ".omp.stride"); in checkOpenMPLoop()
9167 ST = buildDeclRefExpr(SemaRef, STDecl, StrideVType, InitLoc); in checkOpenMPLoop()
9168 SemaRef.AddInitializerToDecl(STDecl, in checkOpenMPLoop()
9169 SemaRef.ActOnIntegerConstant(InitLoc, 1).get(), in checkOpenMPLoop()
9174 ExprResult IsUBGreater = SemaRef.BuildBinOp(CurScope, InitLoc, BO_GT, in checkOpenMPLoop()
9176 ExprResult CondOp = SemaRef.ActOnConditionalOp( in checkOpenMPLoop()
9179 EUB = SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, UB.get(), in checkOpenMPLoop()
9181 EUB = SemaRef.ActOnFinishFullExpr(EUB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9190 buildVarDecl(SemaRef, InitLoc, VType, ".omp.comb.lb"); in checkOpenMPLoop()
9191 CombLB = buildDeclRefExpr(SemaRef, CombLBDecl, VType, InitLoc); in checkOpenMPLoop()
9192 SemaRef.AddInitializerToDecl( in checkOpenMPLoop()
9193 CombLBDecl, SemaRef.ActOnIntegerConstant(InitLoc, 0).get(), in checkOpenMPLoop()
9198 buildVarDecl(SemaRef, InitLoc, VType, ".omp.comb.ub"); in checkOpenMPLoop()
9199 CombUB = buildDeclRefExpr(SemaRef, CombUBDecl, VType, InitLoc); in checkOpenMPLoop()
9200 SemaRef.AddInitializerToDecl(CombUBDecl, LastIteration.get(), in checkOpenMPLoop()
9203 ExprResult CombIsUBGreater = SemaRef.BuildBinOp( in checkOpenMPLoop()
9206 SemaRef.ActOnConditionalOp(InitLoc, InitLoc, CombIsUBGreater.get(), in checkOpenMPLoop()
9208 CombEUB = SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, CombUB.get(), in checkOpenMPLoop()
9211 SemaRef.ActOnFinishFullExpr(CombEUB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9227 buildDeclRefExpr(SemaRef, PrevLBDecl, PrevLBDecl->getType(), InitLoc); in checkOpenMPLoop()
9229 buildDeclRefExpr(SemaRef, PrevUBDecl, PrevUBDecl->getType(), InitLoc); in checkOpenMPLoop()
9237 VarDecl *IVDecl = buildVarDecl(SemaRef, InitLoc, RealVType, ".omp.iv"); in checkOpenMPLoop()
9238 IV = buildDeclRefExpr(SemaRef, IVDecl, RealVType, InitLoc); in checkOpenMPLoop()
9244 : SemaRef.ActOnIntegerConstant(SourceLocation(), 0).get(); in checkOpenMPLoop()
9245 Init = SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, IV.get(), RHS); in checkOpenMPLoop()
9246 Init = SemaRef.ActOnFinishFullExpr(Init.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9254 : SemaRef.ActOnIntegerConstant(SourceLocation(), 0).get(); in checkOpenMPLoop()
9256 SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, IV.get(), CombRHS); in checkOpenMPLoop()
9258 SemaRef.ActOnFinishFullExpr(CombInit.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9273 SemaRef in checkOpenMPLoop()
9275 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()) in checkOpenMPLoop()
9278 SemaRef.ActOnFinishFullExpr(BoundUB, /*DiscardedValue*/ false).get(); in checkOpenMPLoop()
9284 ? SemaRef.BuildBinOp(CurScope, CondLoc, in checkOpenMPLoop()
9287 : SemaRef.BuildBinOp(CurScope, CondLoc, BO_LT, IV.get(), in checkOpenMPLoop()
9291 CombDistCond = SemaRef.BuildBinOp(CurScope, CondLoc, BO_LT, IV.get(), in checkOpenMPLoop()
9300 SemaRef in checkOpenMPLoop()
9303 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()) in checkOpenMPLoop()
9306 SemaRef.ActOnFinishFullExpr(BoundCombUB, /*DiscardedValue*/ false) in checkOpenMPLoop()
9310 SemaRef.BuildBinOp(CurScope, CondLoc, UseStrictCompare ? BO_LT : BO_LE, in checkOpenMPLoop()
9316 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, IV.get(), in checkOpenMPLoop()
9317 SemaRef.ActOnIntegerConstant(IncLoc, 1).get()); in checkOpenMPLoop()
9320 Inc = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, IV.get(), Inc.get()); in checkOpenMPLoop()
9321 Inc = SemaRef.ActOnFinishFullExpr(Inc.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9334 NextLB = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, LB.get(), ST.get()); in checkOpenMPLoop()
9339 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, LB.get(), NextLB.get()); in checkOpenMPLoop()
9341 SemaRef.ActOnFinishFullExpr(NextLB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9345 NextUB = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, UB.get(), ST.get()); in checkOpenMPLoop()
9350 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, UB.get(), NextUB.get()); in checkOpenMPLoop()
9352 SemaRef.ActOnFinishFullExpr(NextUB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9357 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, CombLB.get(), ST.get()); in checkOpenMPLoop()
9361 CombNextLB = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, CombLB.get(), in checkOpenMPLoop()
9363 CombNextLB = SemaRef.ActOnFinishFullExpr(CombNextLB.get(), in checkOpenMPLoop()
9369 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, CombUB.get(), ST.get()); in checkOpenMPLoop()
9373 CombNextUB = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, CombUB.get(), in checkOpenMPLoop()
9375 CombNextUB = SemaRef.ActOnFinishFullExpr(CombNextUB.get(), in checkOpenMPLoop()
9389 DistCond = SemaRef.BuildBinOp( in checkOpenMPLoop()
9394 SemaRef.BuildBinOp(CurScope, DistIncLoc, BO_Add, IV.get(), ST.get()); in checkOpenMPLoop()
9396 DistInc = SemaRef.BuildBinOp(CurScope, DistIncLoc, BO_Assign, IV.get(), in checkOpenMPLoop()
9399 SemaRef.ActOnFinishFullExpr(DistInc.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9406 if (!SemaRef.Context.hasSameType(UB.get()->getType(), in checkOpenMPLoop()
9408 NewPrevUB = SemaRef.BuildCStyleCastExpr( in checkOpenMPLoop()
9410 SemaRef.Context.getTrivialTypeSourceInfo(UB.get()->getType()), in checkOpenMPLoop()
9415 ExprResult IsUBGreater = SemaRef.BuildBinOp(CurScope, DistEUBLoc, BO_GT, in checkOpenMPLoop()
9417 ExprResult CondOp = SemaRef.ActOnConditionalOp( in checkOpenMPLoop()
9419 PrevEUB = SemaRef.BuildBinOp(CurScope, DistIncLoc, BO_Assign, UB.get(), in checkOpenMPLoop()
9422 SemaRef.ActOnFinishFullExpr(PrevEUB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9430 SemaRef in checkOpenMPLoop()
9433 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()) in checkOpenMPLoop()
9436 SemaRef.ActOnFinishFullExpr(BoundPrevUB, /*DiscardedValue*/ false) in checkOpenMPLoop()
9440 SemaRef.BuildBinOp(CurScope, CondLoc, UseStrictCompare ? BO_LT : BO_LE, in checkOpenMPLoop()
9477 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get(); in checkOpenMPLoop()
9479 Prod = SemaRef.BuildBinOp(CurScope, UpdLoc, BO_Mul, Prod.get(), in checkOpenMPLoop()
9486 Iter = SemaRef.BuildBinOp(CurScope, UpdLoc, BO_Div, in checkOpenMPLoop()
9500 Prod = SemaRef.BuildBinOp(CurScope, UpdLoc, BO_Mul, in checkOpenMPLoop()
9504 Acc = SemaRef.BuildBinOp(CurScope, UpdLoc, BO_Sub, in checkOpenMPLoop()
9510 SemaRef, VD, IS.CounterVar->getType(), IS.CounterVar->getExprLoc(), in checkOpenMPLoop()
9513 buildCounterInit(SemaRef, CurScope, UpdLoc, CounterVar, in checkOpenMPLoop()
9520 SemaRef, CurScope, UpdLoc, CounterVar, IS.CounterInit, Iter, in checkOpenMPLoop()
9529 buildCounterUpdate(SemaRef, CurScope, UpdLoc, CounterVar, in checkOpenMPLoop()
9567 Built.CalcLastIteration = SemaRef in checkOpenMPLoop()
10440 Sema &SemaRef; member in __anon4581b7f83a11::OpenMPAtomicUpdateChecker
10461 OpenMPAtomicUpdateChecker(Sema &SemaRef) in OpenMPAtomicUpdateChecker() argument
10462 : SemaRef(SemaRef), X(nullptr), E(nullptr), UpdateExpr(nullptr), in OpenMPAtomicUpdateChecker()
10514 X->IgnoreParenImpCasts()->Profile(XId, SemaRef.getASTContext(), in checkBinaryOperation()
10516 LHS->IgnoreParenImpCasts()->Profile(LHSId, SemaRef.getASTContext(), in checkBinaryOperation()
10518 RHS->IgnoreParenImpCasts()->Profile(RHSId, SemaRef.getASTContext(), in checkBinaryOperation()
10553 SemaRef.Diag(ErrorLoc, DiagId) << ErrorRange; in checkBinaryOperation()
10554 SemaRef.Diag(NoteLoc, NoteId) << ErrorFound << NoteRange; in checkBinaryOperation()
10557 if (SemaRef.CurContext->isDependentContext()) in checkBinaryOperation()
10601 E = SemaRef.ActOnIntegerConstant(OpLoc, /*uint64_t Val=*/1).get(); in checkStatement()
10626 SemaRef.Diag(ErrorLoc, DiagId) << ErrorRange; in checkStatement()
10627 SemaRef.Diag(NoteLoc, NoteId) << ErrorFound << NoteRange; in checkStatement()
10630 if (SemaRef.CurContext->isDependentContext()) in checkStatement()
10636 auto *OVEX = new (SemaRef.getASTContext()) in checkStatement()
10638 auto *OVEExpr = new (SemaRef.getASTContext()) in checkStatement()
10641 SemaRef.CreateBuiltinBinOp(OpLoc, Op, IsXLHSInRHSPart ? OVEX : OVEExpr, in checkStatement()
10645 Update = SemaRef.PerformImplicitConversion(Update.get(), X->getType(), in checkStatement()
14147 isNonNegativeIntegerValue(Expr *&ValExpr, Sema &SemaRef, OpenMPClauseKind CKind, in isNonNegativeIntegerValue() argument
14156 SemaRef.PerformOpenMPImplicitIntegerConversion(Loc, ValExpr); in isNonNegativeIntegerValue()
14163 ValExpr->getIntegerConstantExpr(SemaRef.Context)) { in isNonNegativeIntegerValue()
14167 SemaRef.Diag(Loc, diag::err_omp_negative_expression_in_clause) in isNonNegativeIntegerValue()
14176 getOpenMPCaptureRegionForClause(DKind, CKind, SemaRef.LangOpts.OpenMP); in isNonNegativeIntegerValue()
14178 !SemaRef.CurContext->isDependentContext()) { in isNonNegativeIntegerValue()
14179 ValExpr = SemaRef.MakeFullExpr(ValExpr).get(); in isNonNegativeIntegerValue()
14181 ValExpr = tryBuildCapture(SemaRef, ValExpr, Captures).get(); in isNonNegativeIntegerValue()
14182 *HelperValStmt = buildPreInits(SemaRef.Context, Captures); in isNonNegativeIntegerValue()
15214 static bool isValidInteropVariable(Sema &SemaRef, Expr *InteropVarExpr, in isValidInteropVariable() argument
15224 SemaRef.Diag(VarLoc, diag::err_omp_interop_variable_expected) << 0; in isValidInteropVariable()
15231 LookupResult Result(SemaRef, &SemaRef.Context.Idents.get("omp_interop_t"), in isValidInteropVariable()
15233 if (SemaRef.LookupName(Result, SemaRef.getCurScope())) { in isValidInteropVariable()
15245 SemaRef.Diag(VarLoc, diag::err_omp_implied_type_not_found) in isValidInteropVariable()
15251 if (!SemaRef.Context.hasSameType(InteropType, VarType)) { in isValidInteropVariable()
15252 SemaRef.Diag(VarLoc, diag::err_omp_interop_variable_wrong_type); in isValidInteropVariable()
15259 isConstNotMutableType(SemaRef, InteropVarExpr->getType())) { in isValidInteropVariable()
15260 SemaRef.Diag(VarLoc, diag::err_omp_interop_variable_expected) in isValidInteropVariable()
16322 TransformExprToCaptures(Sema &SemaRef, ValueDecl *FieldDecl) in TransformExprToCaptures() argument
16323 : BaseTransform(SemaRef), Field(FieldDecl), CapturedExpr(nullptr) {} in TransformExprToCaptures()
16328 CapturedExpr = buildCapture(SemaRef, Field, E, /*WithInit=*/false); in TransformMemberExpr()
16349 static NamedDecl *findAcceptableDecl(Sema &SemaRef, NamedDecl *D) { in findAcceptableDecl() argument
16350 assert(!LookupResult::isVisible(SemaRef, D) && "not in slow case"); in findAcceptableDecl()
16358 if (LookupResult::isVisible(SemaRef, ND)) in findAcceptableDecl()
16366 argumentDependentLookup(Sema &SemaRef, const DeclarationNameInfo &Id, in argumentDependentLookup() argument
16374 SemaRef.FindAssociatedClassesAndNamespaces(Loc, &OVE, AssociatedNamespaces, in argumentDependentLookup()
16410 if (!SemaRef.isVisible(D)) { in argumentDependentLookup()
16411 D = findAcceptableDecl(SemaRef, D); in argumentDependentLookup()
16424 buildDeclareReductionRef(Sema &SemaRef, SourceLocation Loc, SourceRange Range, in buildDeclareReductionRef() argument
16432 LookupResult Lookup(SemaRef, ReductionId, Sema::LookupOMPReductionName); in buildDeclareReductionRef()
16434 while (S && SemaRef.LookupParsedName(Lookup, S, &ReductionIdScopeSpec)) { in buildDeclareReductionRef()
16457 if (SemaRef.CurContext->isDependentContext() || Ty->isDependentType() || in buildDeclareReductionRef()
16475 SemaRef.Context, /*NamingClass=*/nullptr, in buildDeclareReductionRef()
16476 ReductionIdScopeSpec.getWithLocInContext(SemaRef.Context), ReductionId, in buildDeclareReductionRef()
16492 LookupResult Lookup(SemaRef, ReductionId, Sema::LookupOMPReductionName); in buildDeclareReductionRef()
16497 if (SemaRef.isCompleteType(Loc, Ty) || TyRec->isBeingDefined() || in buildDeclareReductionRef()
16500 SemaRef.LookupQualifiedName(Lookup, TyRec->getDecl()); in buildDeclareReductionRef()
16508 if (SemaRef.getLangOpts().CPlusPlus) in buildDeclareReductionRef()
16509 argumentDependentLookup(SemaRef, ReductionId, Loc, Ty, Lookups); in buildDeclareReductionRef()
16511 Lookups, [&SemaRef, Ty](ValueDecl *D) -> ValueDecl * { in buildDeclareReductionRef()
16513 SemaRef.Context.hasSameType(D->getType(), Ty)) in buildDeclareReductionRef()
16517 return SemaRef.BuildDeclRefExpr(VD, VD->getType().getNonReferenceType(), in buildDeclareReductionRef()
16519 if (SemaRef.getLangOpts().CPlusPlus) { in buildDeclareReductionRef()
16521 Lookups, [&SemaRef, Ty, Loc](ValueDecl *D) -> ValueDecl * { in buildDeclareReductionRef()
16523 SemaRef.IsDerivedFrom(Loc, Ty, D->getType()) && in buildDeclareReductionRef()
16530 if (SemaRef.IsDerivedFrom(Loc, Ty, VD->getType(), Paths)) { in buildDeclareReductionRef()
16531 if (!Paths.isAmbiguous(SemaRef.Context.getCanonicalType( in buildDeclareReductionRef()
16533 if (SemaRef.CheckBaseClassAccess( in buildDeclareReductionRef()
16536 SemaRef.BuildBasePathArray(Paths, BasePath); in buildDeclareReductionRef()
16537 return SemaRef.BuildDeclRefExpr( in buildDeclareReductionRef()
16545 SemaRef.Diag(Loc, diag::err_omp_not_resolved_reduction_identifier) in buildDeclareReductionRef()
17701 Expr *NumIterations, Sema &SemaRef, in FinishOpenMPLinearClause() argument
17712 Step = SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get(); in FinishOpenMPLinearClause()
17723 auto Res = getPrivateItem(SemaRef, SimpleRefExpr, ELoc, ERange); in FinishOpenMPLinearClause()
17737 SemaRef.Diag(ELoc, in FinishOpenMPLinearClause()
17753 buildDeclRefExpr(SemaRef, cast<VarDecl>(DE->getDecl()), in FinishOpenMPLinearClause()
17761 SemaRef, S, RefExpr->getExprLoc(), *CurPrivate, InitExpr, IV, Step, in FinishOpenMPLinearClause()
17765 Update = SemaRef.ActOnFinishFullExpr(Update.get(), DE->getBeginLoc(), in FinishOpenMPLinearClause()
17772 buildCounterUpdate(SemaRef, S, RefExpr->getExprLoc(), CapturedRef, in FinishOpenMPLinearClause()
17777 Final = SemaRef.ActOnFinishFullExpr(Final.get(), DE->getBeginLoc(), in FinishOpenMPLinearClause()
18443 static bool checkTypeMappable(SourceLocation SL, SourceRange SR, Sema &SemaRef, in checkTypeMappable() argument
18448 SemaRef.Diag(SL, diag::err_incomplete_type) << QTy << SR; in checkTypeMappable()
18451 if (FullCheck && !SemaRef.CurContext->isDependentContext() && in checkTypeMappable()
18452 !QTy.isTriviallyCopyableType(SemaRef.Context)) in checkTypeMappable()
18453 SemaRef.Diag(SL, diag::warn_omp_non_trivial_type_mapped) << QTy << SR; in checkTypeMappable()
18460 static bool checkArrayExpressionDoesNotReferToWholeSize(Sema &SemaRef, in checkArrayExpressionDoesNotReferToWholeSize() argument
18484 if (!LowerBound->EvaluateAsInt(Result, SemaRef.getASTContext())) in checkArrayExpressionDoesNotReferToWholeSize()
18508 if (!Length->EvaluateAsInt(Result, SemaRef.getASTContext())) in checkArrayExpressionDoesNotReferToWholeSize()
18518 static bool checkArrayExpressionDoesNotReferToUnitySize(Sema &SemaRef, in checkArrayExpressionDoesNotReferToUnitySize() argument
18544 if (!Length->EvaluateAsInt(Result, SemaRef.getASTContext())) in checkArrayExpressionDoesNotReferToUnitySize()
18588 Sema &SemaRef; member in __anon4581b7f85411::MapBaseChecker
18603 if (SemaRef.getLangOpts().OpenMP < 50) { in emitErrorMsg()
18604 SemaRef.Diag(ELoc, in emitErrorMsg()
18608 SemaRef.Diag(ELoc, diag::err_omp_non_lvalue_in_map_or_motion_clauses) in emitErrorMsg()
18640 SemaRef.Diag(ELoc, diag::err_omp_expected_access_to_data_field) in VisitMemberExpr()
18656 SemaRef.Diag(ELoc, diag::err_omp_bit_fields_forbidden_in_clause) in VisitMemberExpr()
18676 SemaRef.Diag(ELoc, diag::err_omp_union_type_not_allowed) in VisitMemberExpr()
18703 SemaRef.Diag(ELoc, diag::err_omp_expected_base_var_name) in VisitArraySubscriptExpr()
18713 if (checkArrayExpressionDoesNotReferToWholeSize(SemaRef, AE, in VisitArraySubscriptExpr()
18720 AE->getIdx()->EvaluateAsInt(Result, SemaRef.getASTContext()) && in VisitArraySubscriptExpr()
18722 SemaRef.Diag(AE->getIdx()->getExprLoc(), in VisitArraySubscriptExpr()
18724 SemaRef.Diag(AE->getIdx()->getExprLoc(), in VisitArraySubscriptExpr()
18752 SemaRef.Diag(ELoc, diag::err_omp_expected_base_var_name) in VisitOMPArraySectionExpr()
18758 checkArrayExpressionDoesNotReferToWholeSize(SemaRef, OASE, CurType); in VisitOMPArraySectionExpr()
18760 checkArrayExpressionDoesNotReferToUnitySize(SemaRef, OASE, CurType); in VisitOMPArraySectionExpr()
18772 SemaRef.getLangOpts().OpenMP >= 50) { in VisitOMPArraySectionExpr()
18774 SemaRef.Diag(ELoc, diag::err_omp_section_length_undefined) in VisitOMPArraySectionExpr()
18781 SemaRef.Diag( in VisitOMPArraySectionExpr()
18794 OASE->getLength()->EvaluateAsInt(ResultR, SemaRef.getASTContext()) && in VisitOMPArraySectionExpr()
18796 SemaRef.Diag(OASE->getLength()->getExprLoc(), in VisitOMPArraySectionExpr()
18798 SemaRef.Diag(OASE->getLength()->getExprLoc(), in VisitOMPArraySectionExpr()
18803 SemaRef.getASTContext()) && in VisitOMPArraySectionExpr()
18805 SemaRef.Diag(OASE->getLowerBound()->getExprLoc(), in VisitOMPArraySectionExpr()
18807 SemaRef.Diag(OASE->getLowerBound()->getExprLoc(), in VisitOMPArraySectionExpr()
18828 if (SemaRef.getLangOpts().OpenMP < 50 || !UO->isLValue() || in VisitUnaryOperator()
18840 if (SemaRef.getLangOpts().OpenMP < 50 || !BO->getType()->isPointerType()) { in VisitBinaryOperator()
18886 Sema &SemaRef, OpenMPClauseKind CKind, OpenMPDirectiveKind DKind, in MapBaseChecker() argument
18889 : SemaRef(SemaRef), CKind(CKind), DKind(DKind), Components(Components), in MapBaseChecker()
18899 Sema &SemaRef, Expr *E, in checkMapClauseExpressionBase() argument
18904 MapBaseChecker Checker(SemaRef, CKind, DKind, CurComponents, NoDiagnose, ELoc, in checkMapClauseExpressionBase()
18908 if (SemaRef.getLangOpts().OpenMP >= 50 && !CurComponents.empty() && in checkMapClauseExpressionBase()
18919 SemaRef.Diag(ELoc, diag::err_array_section_does_not_specify_length) in checkMapClauseExpressionBase()
18931 Sema &SemaRef, DSAStackTy *DSAS, const ValueDecl *VD, const Expr *E, in checkMapConflicts() argument
18953 [&IsEnclosedByDataEnvironmentExpr, &SemaRef, VD, CurrentRegionOnly, ELoc, in checkMapConflicts()
18958 if (CKind == Kind && SemaRef.LangOpts.OpenMP >= 50) in checkMapConflicts()
18989 SemaRef.Diag(CI->getAssociatedExpression()->getExprLoc(), in checkMapConflicts()
18992 SemaRef.Diag(SI->getAssociatedExpression()->getExprLoc(), in checkMapConflicts()
19026 SemaRef, SI->getAssociatedExpression(), Type)) in checkMapConflicts()
19039 SemaRef.Diag(ELoc, diag::err_omp_map_shared_storage) << ERange; in checkMapConflicts()
19042 SemaRef.Diag(ELoc, diag::err_omp_once_referenced_in_target_update) in checkMapConflicts()
19045 SemaRef.Diag(RE->getExprLoc(), diag::note_used_here) in checkMapConflicts()
19078 SemaRef.Diag( in checkMapConflicts()
19082 SemaRef.Diag(RE->getExprLoc(), diag::note_used_here) in checkMapConflicts()
19091 SemaRef.Diag(DerivedLoc, diag::err_omp_same_pointer_dereferenced) in checkMapConflicts()
19093 SemaRef.Diag(RE->getExprLoc(), diag::note_used_here) in checkMapConflicts()
19126 SemaRef.Diag(ELoc, diag::err_omp_map_shared_storage) << ERange; in checkMapConflicts()
19129 SemaRef.Diag(ELoc, diag::err_omp_once_referenced_in_target_update) in checkMapConflicts()
19132 SemaRef.Diag(RE->getExprLoc(), diag::note_used_here) in checkMapConflicts()
19165 SemaRef.Diag(ELoc, in checkMapConflicts()
19168 SemaRef.Diag(EnclosingExpr->getExprLoc(), diag::note_used_here) in checkMapConflicts()
19178 static ExprResult buildUserDefinedMapperRef(Sema &SemaRef, Scope *S, in buildUserDefinedMapperRef() argument
19192 LookupResult Lookup(SemaRef, MapperId, Sema::LookupOMPMapperName); in buildUserDefinedMapperRef()
19195 while (S && SemaRef.LookupParsedName(Lookup, S, &MapperIdScopeSpec)) { in buildUserDefinedMapperRef()
19216 if (SemaRef.CurContext->isDependentContext() || Type->isDependentType() || in buildUserDefinedMapperRef()
19232 SemaRef.Context, /*NamingClass=*/nullptr, in buildUserDefinedMapperRef()
19233 MapperIdScopeSpec.getWithLocInContext(SemaRef.Context), MapperId, in buildUserDefinedMapperRef()
19241 SemaRef.Diag(Loc, diag::err_omp_mapper_wrong_type); in buildUserDefinedMapperRef()
19245 if (SemaRef.getLangOpts().CPlusPlus && !MapperIdScopeSpec.isSet()) in buildUserDefinedMapperRef()
19246 argumentDependentLookup(SemaRef, MapperId, Loc, Type, Lookups); in buildUserDefinedMapperRef()
19249 Lookups, [&SemaRef, Type](ValueDecl *D) -> ValueDecl * { in buildUserDefinedMapperRef()
19251 SemaRef.Context.hasSameType(D->getType(), Type)) in buildUserDefinedMapperRef()
19255 return SemaRef.BuildDeclRefExpr(VD, Type, VK_LValue, Loc); in buildUserDefinedMapperRef()
19259 Lookups, [&SemaRef, Type, Loc](ValueDecl *D) -> ValueDecl * { in buildUserDefinedMapperRef()
19261 SemaRef.IsDerivedFrom(Loc, Type, D->getType()) && in buildUserDefinedMapperRef()
19268 if (SemaRef.IsDerivedFrom(Loc, Type, VD->getType(), Paths)) { in buildUserDefinedMapperRef()
19269 if (!Paths.isAmbiguous(SemaRef.Context.getCanonicalType( in buildUserDefinedMapperRef()
19271 if (SemaRef.CheckBaseClassAccess( in buildUserDefinedMapperRef()
19274 return SemaRef.BuildDeclRefExpr(VD, Type, VK_LValue, Loc); in buildUserDefinedMapperRef()
19281 SemaRef.Diag(Loc, diag::err_omp_invalid_mapper) in buildUserDefinedMapperRef()
19319 Sema &SemaRef, DSAStackTy *DSAS, OpenMPClauseKind CKind, in checkMappableExpressionList() argument
19334 auto &DeclNames = SemaRef.getASTContext().DeclarationNames; in checkMappableExpressionList()
19336 &SemaRef.getASTContext().Idents.get("default"))); in checkMappableExpressionList()
19373 SemaRef, DSAS->getCurScope(), MapperIdScopeSpec, MapperId, in checkMappableExpressionList()
19387 if (SemaRef.getLangOpts().OpenMP < 50) { in checkMappableExpressionList()
19388 SemaRef.Diag( in checkMappableExpressionList()
19392 SemaRef.Diag(ELoc, diag::err_omp_non_lvalue_in_map_or_motion_clauses) in checkMappableExpressionList()
19404 SemaRef, SimpleExpr, CurComponents, CKind, DSAS->getCurrentDirective(), in checkMappableExpressionList()
19417 SemaRef, DSAS->getCurScope(), MapperIdScopeSpec, MapperId, in checkMappableExpressionList()
19452 SemaRef.Diag(ELoc, diag::err_omp_threadprivate_in_clause) in checkMappableExpressionList()
19454 reportOriginalDsa(SemaRef, DSAS, VD, DVar); in checkMappableExpressionList()
19466 if (checkMapConflicts(SemaRef, DSAS, CurDeclaration, SimpleExpr, in checkMappableExpressionList()
19470 (SemaRef.getLangOpts().OpenMP <= 45 || StartLoc.isValid()) && in checkMappableExpressionList()
19471 checkMapConflicts(SemaRef, DSAS, CurDeclaration, SimpleExpr, in checkMappableExpressionList()
19510 if (!checkTypeMappable(VE->getExprLoc(), VE->getSourceRange(), SemaRef, in checkMappableExpressionList()
19522 SemaRef.Diag(StartLoc, diag::err_omp_invalid_map_type_for_directive) in checkMappableExpressionList()
19536 SemaRef.Diag(StartLoc, diag::err_omp_invalid_map_type_for_directive) in checkMappableExpressionList()
19551 SemaRef.Diag(StartLoc, diag::err_omp_invalid_map_type_for_directive) in checkMappableExpressionList()
19566 if (VD && ((SemaRef.LangOpts.OpenMP <= 45 && in checkMappableExpressionList()
19571 SemaRef.Diag(ELoc, diag::err_omp_variable_in_given_clause_and_dsa) in checkMappableExpressionList()
19575 reportOriginalDsa(SemaRef, DSAS, CurDeclaration, DVar); in checkMappableExpressionList()
19583 SemaRef, DSAS->getCurScope(), MapperIdScopeSpec, MapperId, in checkMappableExpressionList()
20500 Sema &SemaRef, Decl *D) { in checkDeclInTargetContext() argument
20506 if (SemaRef.LangOpts.OpenMP >= 50 && in checkDeclInTargetContext()
20507 (SemaRef.getCurLambda(/*IgnoreNonLambdaCapturingScope=*/true) || in checkDeclInTargetContext()
20508 SemaRef.getCurBlock() || SemaRef.getCurCapturedRegion()) && in checkDeclInTargetContext()
20516 SemaRef.Diag(VD->getLocation(), in checkDeclInTargetContext()
20518 SemaRef.Diag(SL, diag::note_var_explicitly_captured_here) in checkDeclInTargetContext()
20525 SemaRef.Diag(VD->getLocation(), diag::warn_omp_not_in_target_context); in checkDeclInTargetContext()
20526 SemaRef.Diag(SL, diag::note_used_here) << SR; in checkDeclInTargetContext()
20530 Sema &SemaRef, DSAStackTy *Stack, in checkValueDeclInTarget() argument
20533 checkTypeMappable(SL, SR, SemaRef, Stack, VD->getType(), in checkValueDeclInTarget()