Lines Matching refs:SemaRef
50 Sema &SemaRef, Expr *E,
212 Sema &SemaRef; member in __anon5b04668f0111::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 __anon5b04668f1811::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 __anon5b04668f1811::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 __anon5b04668f1911::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 __anon5b04668f1b11::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()
3837 SemaRef, VD, VD->getType().getNonLValueExprType(SemaRef.Context), in visitSubCaptures()
3858 DSAAttrChecker(DSAStackTy *S, Sema &SemaRef, CapturedStmt *CS) in DSAAttrChecker() argument
3859 : Stack(S), SemaRef(SemaRef), ErrorFound(false), CS(CS) { in DSAAttrChecker()
4622 static bool checkCancelRegion(Sema &SemaRef, OpenMPDirectiveKind CurrentRegion, in checkCancelRegion() argument
4633 SemaRef.Diag(StartLoc, diag::err_omp_wrong_cancel_region) in checkCancelRegion()
4638 static bool checkNestingOfRegions(Sema &SemaRef, const DSAStackTy *Stack, in checkNestingOfRegions() argument
4658 ((SemaRef.LangOpts.OpenMP <= 45 && CurrentRegion != OMPD_ordered) || in checkNestingOfRegions()
4659 (SemaRef.LangOpts.OpenMP >= 50 && CurrentRegion != OMPD_ordered && in checkNestingOfRegions()
4674 SemaRef.Diag(StartLoc, (CurrentRegion != OMPD_simd) in checkNestingOfRegions()
4677 << (SemaRef.LangOpts.OpenMP >= 50 ? 1 : 0); in checkNestingOfRegions()
4683 SemaRef.Diag(StartLoc, diag::err_omp_prohibited_region_atomic); in checkNestingOfRegions()
4693 SemaRef.Diag(StartLoc, diag::err_omp_orphaned_section_directive) in checkNestingOfRegions()
4733 (SemaRef.getLangOpts().OpenMP >= 50 && in checkNestingOfRegions()
4765 SemaRef.Diag(StartLoc, in checkNestingOfRegions()
4769 SemaRef.Diag(PreviousCriticalLoc, in checkNestingOfRegions()
4816 (SemaRef.LangOpts.OpenMP <= 45 && ParentRegion != OMPD_target) || in checkNestingOfRegions()
4817 (SemaRef.LangOpts.OpenMP >= 50 && ParentRegion != OMPD_unknown && in checkNestingOfRegions()
4826 SemaRef.LangOpts.OpenMP < 50 || in checkNestingOfRegions()
4875 SemaRef.Diag(StartLoc, diag::err_omp_orphaned_device_directive) in checkNestingOfRegions()
4878 SemaRef.Diag(StartLoc, diag::err_omp_prohibited_region) in checkNestingOfRegions()
5565 static ExprResult buildUserDefinedMapperRef(Sema &SemaRef, Scope *S,
7179 Sema &SemaRef; member in __anon5b04668f3411::OpenMPIterationSpaceChecker
7230 OpenMPIterationSpaceChecker(Sema &SemaRef, bool SupportsNonRectangular, in OpenMPIterationSpaceChecker() argument
7232 : SemaRef(SemaRef), SupportsNonRectangular(SupportsNonRectangular), in OpenMPIterationSpaceChecker()
7372 ExprResult Val = SemaRef.PerformOpenMPImplicitIntegerConversion( in setStep()
7390 NewStep->getIntegerConstantExpr(SemaRef.Context); in setStep()
7405 SemaRef.Diag(NewStep->getExprLoc(), in setStep()
7408 SemaRef.Diag(ConditionLoc, in setStep()
7415 SemaRef.CreateBuiltinUnaryOp(NewStep->getExprLoc(), UO_Minus, NewStep) in setStep()
7431 Sema &SemaRef; member in __anon5b04668f3411::__anon5b04668f3511::LoopCounterRefChecker
7441 SemaRef.Diag(E->getExprLoc(), diag::err_omp_stmt_depends_on_loop_counter) in checkDecl()
7452 VD->getNameForDiagnostic(OS, SemaRef.getPrintingPolicy(), in checkDecl()
7454 SemaRef.Diag(E->getExprLoc(), in checkDecl()
7457 SemaRef.Diag(VD->getLocation(), diag::note_previous_decl) << VD; in checkDecl()
7461 SemaRef.Diag(E->getExprLoc(), diag::err_omp_invariant_dependency); in checkDecl()
7471 DepDecl->getNameForDiagnostic(OS, SemaRef.getPrintingPolicy(), in checkDecl()
7473 SemaRef.Diag(E->getExprLoc(), in checkDecl()
7506 explicit LoopCounterRefChecker(Sema &SemaRef, DSAStackTy &Stack, in LoopCounterRefChecker() argument
7510 : SemaRef(SemaRef), Stack(Stack), CurLCDecl(CurLCDecl), in LoopCounterRefChecker()
7528 LoopCounterRefChecker LoopStmtChecker(SemaRef, Stack, LCDecl, IsInitializer, in doesDependOnLoopCounter()
7548 SemaRef.Diag(DefaultLoc, diag::err_omp_loop_not_canonical_init); in checkAndSetInit()
7582 SemaRef.Diag(S->getBeginLoc(), in checkAndSetInit()
7587 buildDeclRefExpr(SemaRef, Var, in checkAndSetInit()
7613 if (dependent() || SemaRef.CurContext->isDependentContext()) in checkAndSetInit()
7616 SemaRef.Diag(S->getBeginLoc(), diag::err_omp_loop_not_canonical_init) in checkAndSetInit()
7651 bool IneqCondIsCanonical = SemaRef.getLangOpts().OpenMP >= 50; in checkAndSetCond()
7653 SemaRef.Diag(DefaultLoc, diag::err_omp_loop_not_canonical_cond) in checkAndSetCond()
7707 if (dependent() || SemaRef.CurContext->isDependentContext()) in checkAndSetCond()
7709 SemaRef.Diag(CondLoc, diag::err_omp_loop_not_canonical_cond) in checkAndSetCond()
7738 if (dependent() || SemaRef.CurContext->isDependentContext()) in checkAndSetIncRHS()
7740 SemaRef.Diag(RHS->getBeginLoc(), diag::err_omp_loop_not_canonical_incr) in checkAndSetIncRHS()
7760 SemaRef.Diag(DefaultLoc, diag::err_omp_loop_not_canonical_incr) << LCDecl; in checkAndSetInc()
7772 return setStep(SemaRef in checkAndSetInc()
7796 return setStep(SemaRef in checkAndSetInc()
7816 if (dependent() || SemaRef.CurContext->isDependentContext()) in checkAndSetInc()
7818 SemaRef.Diag(S->getBeginLoc(), diag::err_omp_loop_not_canonical_incr) in checkAndSetInc()
7824 tryBuildCapture(Sema &SemaRef, Expr *Capture, in tryBuildCapture() argument
7826 if (SemaRef.CurContext->isDependentContext() || Capture->containsErrors()) in tryBuildCapture()
7828 if (Capture->isEvaluatable(SemaRef.Context, Expr::SE_AllowSideEffects)) in tryBuildCapture()
7829 return SemaRef.PerformImplicitConversion( in tryBuildCapture()
7834 return buildCapture(SemaRef, Capture, I->second); in tryBuildCapture()
7836 ExprResult Res = buildCapture(SemaRef, Capture, Ref); in tryBuildCapture()
7844 calculateNumIters(Sema &SemaRef, Scope *S, SourceLocation DefaultLoc, in calculateNumIters() argument
7848 ExprResult NewStep = tryBuildCapture(SemaRef, Step, Captures); in calculateNumIters()
7853 if (Optional<llvm::APSInt> Res = Lower->getIntegerConstantExpr(SemaRef.Context)) { in calculateNumIters()
7857 if (Optional<llvm::APSInt> Res = Step->getIntegerConstantExpr(SemaRef.Context)) { in calculateNumIters()
7895 if (Optional<llvm::APSInt> Res = Upper->getIntegerConstantExpr(SemaRef.Context)) { in calculateNumIters()
7918 uint64_t LowerSize = SemaRef.Context.getTypeSize(LowerTy); in calculateNumIters()
7919 uint64_t UpperSize = SemaRef.Context.getTypeSize(UpperTy); in calculateNumIters()
7922 QualType CastType = SemaRef.Context.getIntTypeForBitwidth( in calculateNumIters()
7925 SemaRef in calculateNumIters()
7927 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Upper).get(), in calculateNumIters()
7930 Lower = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Lower).get(); in calculateNumIters()
7931 NewStep = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, NewStep.get()); in calculateNumIters()
7946 SemaRef.BuildBinOp(S, DefaultLoc, BO_Sub, Diff.get(), NewStep.get()); in calculateNumIters()
7953 Diff = SemaRef.BuildBinOp( in calculateNumIters()
7955 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); in calculateNumIters()
7959 Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); in calculateNumIters()
7964 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Sub, Upper, Diff.get()); in calculateNumIters()
7968 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Sub, Upper, Lower); in calculateNumIters()
7973 SemaRef.Diag(Upper->getBeginLoc(), diag::err_omp_loop_diff_cxx) in calculateNumIters()
7983 Diff = SemaRef.BuildBinOp( in calculateNumIters()
7985 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); in calculateNumIters()
7992 SemaRef.BuildBinOp(S, DefaultLoc, BO_Add, Diff.get(), NewStep.get()); in calculateNumIters()
7999 Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); in calculateNumIters()
8004 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Div, Diff.get(), NewStep.get()); in calculateNumIters()
8017 !SemaRef.getLangOpts().CPlusPlus) in buildNumIterations()
8029 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MinValue); in buildNumIterations()
8033 ExprResult LBMinVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, in buildNumIterations()
8039 SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, LBMinVal.get(), LBVal); in buildNumIterations()
8043 LBMinVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, LBMinVal.get()); in buildNumIterations()
8049 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MaxValue); in buildNumIterations()
8053 ExprResult LBMaxVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, in buildNumIterations()
8059 SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, LBMaxVal.get(), LBVal); in buildNumIterations()
8063 LBMaxVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, LBMaxVal.get()); in buildNumIterations()
8067 Expr *LBMin = tryBuildCapture(SemaRef, LBMinVal.get(), Captures).get(); in buildNumIterations()
8068 Expr *LBMax = tryBuildCapture(SemaRef, LBMaxVal.get(), Captures).get(); in buildNumIterations()
8073 SemaRef.BuildBinOp(S, DefaultLoc, BO_LT, LBMin, LBMax); in buildNumIterations()
8077 tryBuildCapture(SemaRef, MinLessMaxRes.get(), Captures).get(); in buildNumIterations()
8083 ExprResult MinLB = SemaRef.ActOnConditionalOp(DefaultLoc, DefaultLoc, in buildNumIterations()
8091 ExprResult MaxLB = SemaRef.ActOnConditionalOp(DefaultLoc, DefaultLoc, in buildNumIterations()
8106 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MinValue); in buildNumIterations()
8110 ExprResult UBMinVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, in buildNumIterations()
8116 SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, UBMinVal.get(), UBVal); in buildNumIterations()
8120 UBMinVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, UBMinVal.get()); in buildNumIterations()
8126 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MaxValue); in buildNumIterations()
8130 ExprResult UBMaxVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, in buildNumIterations()
8136 SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, UBMaxVal.get(), UBVal); in buildNumIterations()
8140 UBMaxVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, UBMaxVal.get()); in buildNumIterations()
8144 Expr *UBMin = tryBuildCapture(SemaRef, UBMinVal.get(), Captures).get(); in buildNumIterations()
8145 Expr *UBMax = tryBuildCapture(SemaRef, UBMaxVal.get(), Captures).get(); in buildNumIterations()
8150 SemaRef.BuildBinOp(S, DefaultLoc, BO_GT, UBMin, UBMax); in buildNumIterations()
8154 tryBuildCapture(SemaRef, MinGreaterMaxRes.get(), Captures).get(); in buildNumIterations()
8160 ExprResult MaxUB = SemaRef.ActOnConditionalOp( in buildNumIterations()
8168 ExprResult MinUB = SemaRef.ActOnConditionalOp( in buildNumIterations()
8177 Expr *Upper = tryBuildCapture(SemaRef, UBExpr, Captures).get(); in buildNumIterations()
8178 Expr *Lower = tryBuildCapture(SemaRef, LBExpr, Captures).get(); in buildNumIterations()
8182 ExprResult Diff = calculateNumIters(SemaRef, S, DefaultLoc, Lower, Upper, in buildNumIterations()
8190 ASTContext &C = SemaRef.Context; in buildNumIterations()
8199 if (!SemaRef.Context.hasSameType(Diff.get()->getType(), Type)) { in buildNumIterations()
8200 Diff = SemaRef.PerformImplicitConversion( in buildNumIterations()
8211 SemaRef.Diag(DefaultLoc, diag::warn_omp_loop_64_bit_var) in buildNumIterations()
8217 if (!SemaRef.Context.hasSameType(Diff.get()->getType(), NewType)) { in buildNumIterations()
8218 Diff = SemaRef.PerformImplicitConversion(Diff.get(), NewType, in buildNumIterations()
8246 LBNonRect ? LBExpr : tryBuildCapture(SemaRef, LBExpr, Captures).get(); in buildMinMaxValues()
8248 UBNonRect ? UBExpr : tryBuildCapture(SemaRef, UBExpr, Captures).get(); in buildMinMaxValues()
8260 ExprResult Diff = calculateNumIters(SemaRef, S, DefaultLoc, Lower, Upper, in buildMinMaxValues()
8268 Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); in buildMinMaxValues()
8272 ExprResult NewStep = tryBuildCapture(SemaRef, Step, Captures); in buildMinMaxValues()
8275 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Mul, Diff.get(), NewStep.get()); in buildMinMaxValues()
8280 Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); in buildMinMaxValues()
8286 !SemaRef.Context.hasSameType( in buildMinMaxValues()
8288 SemaRef.Context.getUnsignedPointerDiffType())) { in buildMinMaxValues()
8289 Diff = SemaRef.PerformImplicitConversion( in buildMinMaxValues()
8290 Diff.get(), SemaRef.Context.getUnsignedPointerDiffType(), in buildMinMaxValues()
8299 Diff = SemaRef.BuildBinOp( in buildMinMaxValues()
8301 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Lower).get(), in buildMinMaxValues()
8308 Diff = SemaRef.BuildBinOp( in buildMinMaxValues()
8310 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Upper).get(), in buildMinMaxValues()
8317 if (SemaRef.Context.hasSameType(Diff.get()->getType(), VarType)) in buildMinMaxValues()
8318 Diff = SemaRef.PerformImplicitConversion(Diff.get(), VarType, in buildMinMaxValues()
8324 Sema::TentativeAnalysisScope Trap(SemaRef); in buildMinMaxValues()
8325 Diff = SemaRef.ActOnFinishFullExpr(Diff.get(), /*DiscardedValue=*/false); in buildMinMaxValues()
8351 return SemaRef.PerformImplicitConversion( in buildPreCond()
8352 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get(), in buildPreCond()
8353 SemaRef.Context.BoolTy, /*Action=*/Sema::AA_Casting, in buildPreCond()
8357 Sema::TentativeAnalysisScope Trap(SemaRef); in buildPreCond()
8359 ExprResult NewLB = tryBuildCapture(SemaRef, LB, Captures); in buildPreCond()
8360 ExprResult NewUB = tryBuildCapture(SemaRef, UB, Captures); in buildPreCond()
8365 SemaRef.BuildBinOp(S, DefaultLoc, in buildPreCond()
8371 if (!SemaRef.Context.hasSameUnqualifiedType(CondExpr.get()->getType(), in buildPreCond()
8372 SemaRef.Context.BoolTy)) in buildPreCond()
8373 CondExpr = SemaRef.PerformImplicitConversion( in buildPreCond()
8374 CondExpr.get(), SemaRef.Context.BoolTy, /*Action=*/Sema::AA_Casting, in buildPreCond()
8388 VD = SemaRef.isOpenMPCapturedDecl(LCDecl); in buildCounterVar()
8390 SemaRef, VD, VD->getType().getNonReferenceType(), DefaultLoc); in buildCounterVar()
8406 SemaRef, DefaultLoc, Type, LCDecl->getName(), in buildPrivateCounterVar()
8409 ? buildDeclRefExpr(SemaRef, cast<VarDecl>(LCDecl), Type, DefaultLoc) in buildPrivateCounterVar()
8413 return buildDeclRefExpr(SemaRef, PrivateVar, Type, DefaultLoc); in buildPrivateCounterVar()
8428 Expr *Cnt = SemaRef.DefaultLvalueConversion(Counter).get(); in buildOrderedLoopData()
8435 Cnt = SemaRef.BuildBinOp(S, Loc, BOK, Cnt, Inc).get(); in buildOrderedLoopData()
8441 !SemaRef.getLangOpts().CPlusPlus) in buildOrderedLoopData()
8446 : tryBuildCapture(SemaRef, LB, Captures).get(); in buildOrderedLoopData()
8448 ? tryBuildCapture(SemaRef, LB, Captures).get() in buildOrderedLoopData()
8454 SemaRef, S, DefaultLoc, Lower, Upper, Step, VarType, in buildOrderedLoopData()
8549 OpenMPDirectiveKind DKind, Stmt *S, Sema &SemaRef, DSAStackTy &DSA, in checkOpenMPIterationSpace() argument
8565 if (!For && (SemaRef.LangOpts.OpenMP <= 45 || !CXXFor)) { in checkOpenMPIterationSpace()
8566 SemaRef.Diag(S->getBeginLoc(), diag::err_omp_not_for) in checkOpenMPIterationSpace()
8572 SemaRef.Diag(DSA.getConstructLoc(), in checkOpenMPIterationSpace()
8577 SemaRef.Diag(CollapseLoopCountExpr->getExprLoc(), in checkOpenMPIterationSpace()
8581 SemaRef.Diag(OrderedLoopCountExpr->getExprLoc(), in checkOpenMPIterationSpace()
8590 OpenMPIterationSpaceChecker ISC(SemaRef, SupportsNonRectangular, DSA, in checkOpenMPIterationSpace()
8610 !(SemaRef.getLangOpts().CPlusPlus && VarType->isOverloadableType())) { in checkOpenMPIterationSpace()
8611 SemaRef.Diag(Init->getBeginLoc(), diag::err_omp_loop_variable_type) in checkOpenMPIterationSpace()
8612 << SemaRef.getLangOpts().CPlusPlus; in checkOpenMPIterationSpace()
8636 if (ISC.dependent() || SemaRef.CurContext->isDependentContext() || HasErrors) in checkOpenMPIterationSpace()
8727 buildCounterInit(Sema &SemaRef, Scope *S, SourceLocation Loc, ExprResult VarRef, in buildCounterInit() argument
8733 : tryBuildCapture(SemaRef, Start.get(), Captures); in buildCounterInit()
8736 if (!SemaRef.Context.hasSameType(NewStart.get()->getType(), in buildCounterInit()
8738 NewStart = SemaRef.PerformImplicitConversion( in buildCounterInit()
8746 SemaRef.BuildBinOp(S, Loc, BO_Assign, VarRef.get(), NewStart.get()); in buildCounterInit()
8752 Sema &SemaRef, Scope *S, SourceLocation Loc, ExprResult VarRef, in buildCounterUpdate() argument
8757 Iter = SemaRef.ActOnParenExpr(Loc, Loc, Iter.get()); in buildCounterUpdate()
8764 NewStep = tryBuildCapture(SemaRef, Step.get(), *Captures); in buildCounterUpdate()
8768 SemaRef.BuildBinOp(S, Loc, BO_Mul, Iter.get(), NewStep.get()); in buildCounterUpdate()
8776 ExprResult NewStart = SemaRef.ActOnParenExpr(Loc, Loc, Start.get()); in buildCounterUpdate()
8780 NewStart = tryBuildCapture(SemaRef, Start.get(), *Captures); in buildCounterUpdate()
8790 Sema::TentativeAnalysisScope Trap(SemaRef); in buildCounterUpdate()
8793 SemaRef.BuildBinOp(S, Loc, BO_Assign, VarRef.get(), NewStart.get()); in buildCounterUpdate()
8796 SemaRef.BuildBinOp(S, Loc, Subtract ? BO_SubAssign : BO_AddAssign, in buildCounterUpdate()
8799 Update = SemaRef.CreateBuiltinBinOp(Loc, BO_Comma, Update.get(), in buildCounterUpdate()
8807 Update = SemaRef.BuildBinOp(S, Loc, Subtract ? BO_Sub : BO_Add, in buildCounterUpdate()
8812 if (!SemaRef.Context.hasSameType(Update.get()->getType(), in buildCounterUpdate()
8814 Update = SemaRef.PerformImplicitConversion( in buildCounterUpdate()
8820 Update = SemaRef.BuildBinOp(S, Loc, BO_Assign, VarRef.get(), Update.get()); in buildCounterUpdate()
8827 static ExprResult widenIterationCount(unsigned Bits, Expr *E, Sema &SemaRef) { in widenIterationCount() argument
8830 ASTContext &C = SemaRef.Context; in widenIterationCount()
8837 return SemaRef.PerformImplicitConversion(E, NewType, Sema::AA_Converting, in widenIterationCount()
8843 static bool fitsInto(unsigned Bits, bool Signed, const Expr *E, Sema &SemaRef) { in fitsInto() argument
8847 E->getIntegerConstantExpr(SemaRef.Context)) in fitsInto()
8901 Expr *OrderedLoopCountExpr, Stmt *AStmt, Sema &SemaRef, in checkOpenMPLoop() argument
8906 bool SupportsNonPerfectlyNested = (SemaRef.LangOpts.OpenMP >= 50) && in checkOpenMPLoop()
8913 CollapseLoopCountExpr->EvaluateAsInt(Result, SemaRef.getASTContext())) { in checkOpenMPLoop()
8926 SemaRef.getASTContext())) { in checkOpenMPLoop()
8929 SemaRef.Diag(OrderedLoopCountExpr->getExprLoc(), in checkOpenMPLoop()
8932 SemaRef.Diag(CollapseLoopCountExpr->getExprLoc(), in checkOpenMPLoop()
8950 [DKind, &SemaRef, &DSA, NumLoops, NestedLoopCount, in checkOpenMPLoop()
8954 DKind, CurStmt, SemaRef, DSA, Cnt, NestedLoopCount, in checkOpenMPLoop()
8972 if (SemaRef.CurContext->isDependentContext()) in checkOpenMPLoop()
9010 SemaRef in checkOpenMPLoop()
9015 SemaRef); in checkOpenMPLoop()
9018 SemaRef in checkOpenMPLoop()
9023 SemaRef); in checkOpenMPLoop()
9028 ASTContext &C = SemaRef.Context; in checkOpenMPLoop()
9035 SemaRef.BuildBinOp(CurScope, PreCond.get()->getExprLoc(), BO_LAnd, in checkOpenMPLoop()
9042 LastIteration32 = SemaRef.BuildBinOp( in checkOpenMPLoop()
9044 SemaRef in checkOpenMPLoop()
9050 LastIteration64 = SemaRef.BuildBinOp( in checkOpenMPLoop()
9052 SemaRef in checkOpenMPLoop()
9061 if (SemaRef.getLangOpts().OpenMPOptimisticCollapse || in checkOpenMPLoop()
9068 LastIteration64.get(), SemaRef)))) in checkOpenMPLoop()
9075 SemaRef.Context.getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/0); in checkOpenMPLoop()
9077 SemaRef.Context.getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/1); in checkOpenMPLoop()
9086 LastIteration = SemaRef.BuildBinOp( in checkOpenMPLoop()
9089 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); in checkOpenMPLoop()
9096 bool IsConstant = LastIteration.get()->isIntegerConstantExpr(SemaRef.Context); in checkOpenMPLoop()
9100 tryBuildCapture(SemaRef, LastIteration.get(), Captures); in checkOpenMPLoop()
9104 NumIterations = SemaRef.BuildBinOp( in checkOpenMPLoop()
9106 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); in checkOpenMPLoop()
9119 VarDecl *LBDecl = buildVarDecl(SemaRef, InitLoc, VType, ".omp.lb"); in checkOpenMPLoop()
9120 LB = buildDeclRefExpr(SemaRef, LBDecl, VType, InitLoc); in checkOpenMPLoop()
9121 SemaRef.AddInitializerToDecl(LBDecl, in checkOpenMPLoop()
9122 SemaRef.ActOnIntegerConstant(InitLoc, 0).get(), in checkOpenMPLoop()
9126 VarDecl *UBDecl = buildVarDecl(SemaRef, InitLoc, VType, ".omp.ub"); in checkOpenMPLoop()
9127 UB = buildDeclRefExpr(SemaRef, UBDecl, VType, InitLoc); in checkOpenMPLoop()
9128 SemaRef.AddInitializerToDecl(UBDecl, LastIteration.get(), in checkOpenMPLoop()
9133 QualType Int32Ty = SemaRef.Context.getIntTypeForBitwidth(32, true); in checkOpenMPLoop()
9134 VarDecl *ILDecl = buildVarDecl(SemaRef, InitLoc, Int32Ty, ".omp.is_last"); in checkOpenMPLoop()
9135 IL = buildDeclRefExpr(SemaRef, ILDecl, Int32Ty, InitLoc); in checkOpenMPLoop()
9136 SemaRef.AddInitializerToDecl(ILDecl, in checkOpenMPLoop()
9137 SemaRef.ActOnIntegerConstant(InitLoc, 0).get(), in checkOpenMPLoop()
9142 buildVarDecl(SemaRef, InitLoc, StrideVType, ".omp.stride"); in checkOpenMPLoop()
9143 ST = buildDeclRefExpr(SemaRef, STDecl, StrideVType, InitLoc); in checkOpenMPLoop()
9144 SemaRef.AddInitializerToDecl(STDecl, in checkOpenMPLoop()
9145 SemaRef.ActOnIntegerConstant(InitLoc, 1).get(), in checkOpenMPLoop()
9150 ExprResult IsUBGreater = SemaRef.BuildBinOp(CurScope, InitLoc, BO_GT, in checkOpenMPLoop()
9152 ExprResult CondOp = SemaRef.ActOnConditionalOp( in checkOpenMPLoop()
9155 EUB = SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, UB.get(), in checkOpenMPLoop()
9157 EUB = SemaRef.ActOnFinishFullExpr(EUB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9166 buildVarDecl(SemaRef, InitLoc, VType, ".omp.comb.lb"); in checkOpenMPLoop()
9167 CombLB = buildDeclRefExpr(SemaRef, CombLBDecl, VType, InitLoc); in checkOpenMPLoop()
9168 SemaRef.AddInitializerToDecl( in checkOpenMPLoop()
9169 CombLBDecl, SemaRef.ActOnIntegerConstant(InitLoc, 0).get(), in checkOpenMPLoop()
9174 buildVarDecl(SemaRef, InitLoc, VType, ".omp.comb.ub"); in checkOpenMPLoop()
9175 CombUB = buildDeclRefExpr(SemaRef, CombUBDecl, VType, InitLoc); in checkOpenMPLoop()
9176 SemaRef.AddInitializerToDecl(CombUBDecl, LastIteration.get(), in checkOpenMPLoop()
9179 ExprResult CombIsUBGreater = SemaRef.BuildBinOp( in checkOpenMPLoop()
9182 SemaRef.ActOnConditionalOp(InitLoc, InitLoc, CombIsUBGreater.get(), in checkOpenMPLoop()
9184 CombEUB = SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, CombUB.get(), in checkOpenMPLoop()
9187 SemaRef.ActOnFinishFullExpr(CombEUB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9203 buildDeclRefExpr(SemaRef, PrevLBDecl, PrevLBDecl->getType(), InitLoc); in checkOpenMPLoop()
9205 buildDeclRefExpr(SemaRef, PrevUBDecl, PrevUBDecl->getType(), InitLoc); in checkOpenMPLoop()
9213 VarDecl *IVDecl = buildVarDecl(SemaRef, InitLoc, RealVType, ".omp.iv"); in checkOpenMPLoop()
9214 IV = buildDeclRefExpr(SemaRef, IVDecl, RealVType, InitLoc); in checkOpenMPLoop()
9220 : SemaRef.ActOnIntegerConstant(SourceLocation(), 0).get(); in checkOpenMPLoop()
9221 Init = SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, IV.get(), RHS); in checkOpenMPLoop()
9222 Init = SemaRef.ActOnFinishFullExpr(Init.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9230 : SemaRef.ActOnIntegerConstant(SourceLocation(), 0).get(); in checkOpenMPLoop()
9232 SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, IV.get(), CombRHS); in checkOpenMPLoop()
9234 SemaRef.ActOnFinishFullExpr(CombInit.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9249 SemaRef in checkOpenMPLoop()
9251 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()) in checkOpenMPLoop()
9254 SemaRef.ActOnFinishFullExpr(BoundUB, /*DiscardedValue*/ false).get(); in checkOpenMPLoop()
9260 ? SemaRef.BuildBinOp(CurScope, CondLoc, in checkOpenMPLoop()
9263 : SemaRef.BuildBinOp(CurScope, CondLoc, BO_LT, IV.get(), in checkOpenMPLoop()
9267 CombDistCond = SemaRef.BuildBinOp(CurScope, CondLoc, BO_LT, IV.get(), in checkOpenMPLoop()
9276 SemaRef in checkOpenMPLoop()
9279 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()) in checkOpenMPLoop()
9282 SemaRef.ActOnFinishFullExpr(BoundCombUB, /*DiscardedValue*/ false) in checkOpenMPLoop()
9286 SemaRef.BuildBinOp(CurScope, CondLoc, UseStrictCompare ? BO_LT : BO_LE, in checkOpenMPLoop()
9292 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, IV.get(), in checkOpenMPLoop()
9293 SemaRef.ActOnIntegerConstant(IncLoc, 1).get()); in checkOpenMPLoop()
9296 Inc = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, IV.get(), Inc.get()); in checkOpenMPLoop()
9297 Inc = SemaRef.ActOnFinishFullExpr(Inc.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9310 NextLB = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, LB.get(), ST.get()); in checkOpenMPLoop()
9315 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, LB.get(), NextLB.get()); in checkOpenMPLoop()
9317 SemaRef.ActOnFinishFullExpr(NextLB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9321 NextUB = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, UB.get(), ST.get()); in checkOpenMPLoop()
9326 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, UB.get(), NextUB.get()); in checkOpenMPLoop()
9328 SemaRef.ActOnFinishFullExpr(NextUB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9333 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, CombLB.get(), ST.get()); in checkOpenMPLoop()
9337 CombNextLB = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, CombLB.get(), in checkOpenMPLoop()
9339 CombNextLB = SemaRef.ActOnFinishFullExpr(CombNextLB.get(), in checkOpenMPLoop()
9345 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, CombUB.get(), ST.get()); in checkOpenMPLoop()
9349 CombNextUB = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, CombUB.get(), in checkOpenMPLoop()
9351 CombNextUB = SemaRef.ActOnFinishFullExpr(CombNextUB.get(), in checkOpenMPLoop()
9365 DistCond = SemaRef.BuildBinOp( in checkOpenMPLoop()
9370 SemaRef.BuildBinOp(CurScope, DistIncLoc, BO_Add, IV.get(), ST.get()); in checkOpenMPLoop()
9372 DistInc = SemaRef.BuildBinOp(CurScope, DistIncLoc, BO_Assign, IV.get(), in checkOpenMPLoop()
9375 SemaRef.ActOnFinishFullExpr(DistInc.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9382 SemaRef.BuildBinOp(CurScope, DistEUBLoc, BO_GT, UB.get(), PrevUB.get()); in checkOpenMPLoop()
9383 ExprResult CondOp = SemaRef.ActOnConditionalOp( in checkOpenMPLoop()
9385 PrevEUB = SemaRef.BuildBinOp(CurScope, DistIncLoc, BO_Assign, UB.get(), in checkOpenMPLoop()
9388 SemaRef.ActOnFinishFullExpr(PrevEUB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9396 SemaRef in checkOpenMPLoop()
9399 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()) in checkOpenMPLoop()
9402 SemaRef.ActOnFinishFullExpr(BoundPrevUB, /*DiscardedValue*/ false) in checkOpenMPLoop()
9406 SemaRef.BuildBinOp(CurScope, CondLoc, UseStrictCompare ? BO_LT : BO_LE, in checkOpenMPLoop()
9443 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get(); in checkOpenMPLoop()
9445 Prod = SemaRef.BuildBinOp(CurScope, UpdLoc, BO_Mul, Prod.get(), in checkOpenMPLoop()
9452 Iter = SemaRef.BuildBinOp(CurScope, UpdLoc, BO_Div, in checkOpenMPLoop()
9466 Prod = SemaRef.BuildBinOp(CurScope, UpdLoc, BO_Mul, in checkOpenMPLoop()
9470 Acc = SemaRef.BuildBinOp(CurScope, UpdLoc, BO_Sub, in checkOpenMPLoop()
9476 SemaRef, VD, IS.CounterVar->getType(), IS.CounterVar->getExprLoc(), in checkOpenMPLoop()
9479 buildCounterInit(SemaRef, CurScope, UpdLoc, CounterVar, in checkOpenMPLoop()
9486 SemaRef, CurScope, UpdLoc, CounterVar, IS.CounterInit, Iter, in checkOpenMPLoop()
9495 buildCounterUpdate(SemaRef, CurScope, UpdLoc, CounterVar, in checkOpenMPLoop()
9533 Built.CalcLastIteration = SemaRef in checkOpenMPLoop()
10405 Sema &SemaRef; member in __anon5b04668f3811::OpenMPAtomicUpdateChecker
10426 OpenMPAtomicUpdateChecker(Sema &SemaRef) in OpenMPAtomicUpdateChecker() argument
10427 : SemaRef(SemaRef), X(nullptr), E(nullptr), UpdateExpr(nullptr), in OpenMPAtomicUpdateChecker()
10479 X->IgnoreParenImpCasts()->Profile(XId, SemaRef.getASTContext(), in checkBinaryOperation()
10481 LHS->IgnoreParenImpCasts()->Profile(LHSId, SemaRef.getASTContext(), in checkBinaryOperation()
10483 RHS->IgnoreParenImpCasts()->Profile(RHSId, SemaRef.getASTContext(), in checkBinaryOperation()
10518 SemaRef.Diag(ErrorLoc, DiagId) << ErrorRange; in checkBinaryOperation()
10519 SemaRef.Diag(NoteLoc, NoteId) << ErrorFound << NoteRange; in checkBinaryOperation()
10522 if (SemaRef.CurContext->isDependentContext()) in checkBinaryOperation()
10566 E = SemaRef.ActOnIntegerConstant(OpLoc, /*uint64_t Val=*/1).get(); in checkStatement()
10591 SemaRef.Diag(ErrorLoc, DiagId) << ErrorRange; in checkStatement()
10592 SemaRef.Diag(NoteLoc, NoteId) << ErrorFound << NoteRange; in checkStatement()
10595 if (SemaRef.CurContext->isDependentContext()) in checkStatement()
10601 auto *OVEX = new (SemaRef.getASTContext()) in checkStatement()
10603 auto *OVEExpr = new (SemaRef.getASTContext()) in checkStatement()
10606 SemaRef.CreateBuiltinBinOp(OpLoc, Op, IsXLHSInRHSPart ? OVEX : OVEExpr, in checkStatement()
10610 Update = SemaRef.PerformImplicitConversion(Update.get(), X->getType(), in checkStatement()
13809 isNonNegativeIntegerValue(Expr *&ValExpr, Sema &SemaRef, OpenMPClauseKind CKind, in isNonNegativeIntegerValue() argument
13818 SemaRef.PerformOpenMPImplicitIntegerConversion(Loc, ValExpr); in isNonNegativeIntegerValue()
13825 ValExpr->getIntegerConstantExpr(SemaRef.Context)) { in isNonNegativeIntegerValue()
13829 SemaRef.Diag(Loc, diag::err_omp_negative_expression_in_clause) in isNonNegativeIntegerValue()
13838 getOpenMPCaptureRegionForClause(DKind, CKind, SemaRef.LangOpts.OpenMP); in isNonNegativeIntegerValue()
13840 !SemaRef.CurContext->isDependentContext()) { in isNonNegativeIntegerValue()
13841 ValExpr = SemaRef.MakeFullExpr(ValExpr).get(); in isNonNegativeIntegerValue()
13843 ValExpr = tryBuildCapture(SemaRef, ValExpr, Captures).get(); in isNonNegativeIntegerValue()
13844 *HelperValStmt = buildPreInits(SemaRef.Context, Captures); in isNonNegativeIntegerValue()
14831 static bool isValidInteropVariable(Sema &SemaRef, Expr *InteropVarExpr, in isValidInteropVariable() argument
14841 SemaRef.Diag(VarLoc, diag::err_omp_interop_variable_expected) << 0; in isValidInteropVariable()
14848 LookupResult Result(SemaRef, &SemaRef.Context.Idents.get("omp_interop_t"), in isValidInteropVariable()
14850 if (SemaRef.LookupName(Result, SemaRef.getCurScope())) { in isValidInteropVariable()
14862 SemaRef.Diag(VarLoc, diag::err_omp_implied_type_not_found) in isValidInteropVariable()
14868 if (!SemaRef.Context.hasSameType(InteropType, VarType)) { in isValidInteropVariable()
14869 SemaRef.Diag(VarLoc, diag::err_omp_interop_variable_wrong_type); in isValidInteropVariable()
14876 isConstNotMutableType(SemaRef, InteropVarExpr->getType())) { in isValidInteropVariable()
14877 SemaRef.Diag(VarLoc, diag::err_omp_interop_variable_expected) in isValidInteropVariable()
15939 TransformExprToCaptures(Sema &SemaRef, ValueDecl *FieldDecl) in TransformExprToCaptures() argument
15940 : BaseTransform(SemaRef), Field(FieldDecl), CapturedExpr(nullptr) {} in TransformExprToCaptures()
15945 CapturedExpr = buildCapture(SemaRef, Field, E, /*WithInit=*/false); in TransformMemberExpr()
15966 static NamedDecl *findAcceptableDecl(Sema &SemaRef, NamedDecl *D) { in findAcceptableDecl() argument
15967 assert(!LookupResult::isVisible(SemaRef, D) && "not in slow case"); in findAcceptableDecl()
15975 if (LookupResult::isVisible(SemaRef, ND)) in findAcceptableDecl()
15983 argumentDependentLookup(Sema &SemaRef, const DeclarationNameInfo &Id, in argumentDependentLookup() argument
15991 SemaRef.FindAssociatedClassesAndNamespaces(Loc, &OVE, AssociatedNamespaces, in argumentDependentLookup()
16027 if (!SemaRef.isVisible(D)) { in argumentDependentLookup()
16028 D = findAcceptableDecl(SemaRef, D); in argumentDependentLookup()
16041 buildDeclareReductionRef(Sema &SemaRef, SourceLocation Loc, SourceRange Range, in buildDeclareReductionRef() argument
16049 LookupResult Lookup(SemaRef, ReductionId, Sema::LookupOMPReductionName); in buildDeclareReductionRef()
16051 while (S && SemaRef.LookupParsedName(Lookup, S, &ReductionIdScopeSpec)) { in buildDeclareReductionRef()
16074 if (SemaRef.CurContext->isDependentContext() || Ty->isDependentType() || in buildDeclareReductionRef()
16092 SemaRef.Context, /*NamingClass=*/nullptr, in buildDeclareReductionRef()
16093 ReductionIdScopeSpec.getWithLocInContext(SemaRef.Context), ReductionId, in buildDeclareReductionRef()
16109 LookupResult Lookup(SemaRef, ReductionId, Sema::LookupOMPReductionName); in buildDeclareReductionRef()
16114 if (SemaRef.isCompleteType(Loc, Ty) || TyRec->isBeingDefined() || in buildDeclareReductionRef()
16117 SemaRef.LookupQualifiedName(Lookup, TyRec->getDecl()); in buildDeclareReductionRef()
16125 if (SemaRef.getLangOpts().CPlusPlus) in buildDeclareReductionRef()
16126 argumentDependentLookup(SemaRef, ReductionId, Loc, Ty, Lookups); in buildDeclareReductionRef()
16128 Lookups, [&SemaRef, Ty](ValueDecl *D) -> ValueDecl * { in buildDeclareReductionRef()
16130 SemaRef.Context.hasSameType(D->getType(), Ty)) in buildDeclareReductionRef()
16134 return SemaRef.BuildDeclRefExpr(VD, VD->getType().getNonReferenceType(), in buildDeclareReductionRef()
16136 if (SemaRef.getLangOpts().CPlusPlus) { in buildDeclareReductionRef()
16138 Lookups, [&SemaRef, Ty, Loc](ValueDecl *D) -> ValueDecl * { in buildDeclareReductionRef()
16140 SemaRef.IsDerivedFrom(Loc, Ty, D->getType()) && in buildDeclareReductionRef()
16147 if (SemaRef.IsDerivedFrom(Loc, Ty, VD->getType(), Paths)) { in buildDeclareReductionRef()
16148 if (!Paths.isAmbiguous(SemaRef.Context.getCanonicalType( in buildDeclareReductionRef()
16150 if (SemaRef.CheckBaseClassAccess( in buildDeclareReductionRef()
16153 SemaRef.BuildBasePathArray(Paths, BasePath); in buildDeclareReductionRef()
16154 return SemaRef.BuildDeclRefExpr( in buildDeclareReductionRef()
16162 SemaRef.Diag(Loc, diag::err_omp_not_resolved_reduction_identifier) in buildDeclareReductionRef()
17318 Expr *NumIterations, Sema &SemaRef, in FinishOpenMPLinearClause() argument
17329 Step = SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get(); in FinishOpenMPLinearClause()
17340 auto Res = getPrivateItem(SemaRef, SimpleRefExpr, ELoc, ERange); in FinishOpenMPLinearClause()
17354 SemaRef.Diag(ELoc, in FinishOpenMPLinearClause()
17370 buildDeclRefExpr(SemaRef, cast<VarDecl>(DE->getDecl()), in FinishOpenMPLinearClause()
17378 SemaRef, S, RefExpr->getExprLoc(), *CurPrivate, InitExpr, IV, Step, in FinishOpenMPLinearClause()
17382 Update = SemaRef.ActOnFinishFullExpr(Update.get(), DE->getBeginLoc(), in FinishOpenMPLinearClause()
17389 buildCounterUpdate(SemaRef, S, RefExpr->getExprLoc(), CapturedRef, in FinishOpenMPLinearClause()
17394 Final = SemaRef.ActOnFinishFullExpr(Final.get(), DE->getBeginLoc(), in FinishOpenMPLinearClause()
18060 static bool checkTypeMappable(SourceLocation SL, SourceRange SR, Sema &SemaRef, in checkTypeMappable() argument
18065 SemaRef.Diag(SL, diag::err_incomplete_type) << QTy << SR; in checkTypeMappable()
18068 if (FullCheck && !SemaRef.CurContext->isDependentContext() && in checkTypeMappable()
18069 !QTy.isTriviallyCopyableType(SemaRef.Context)) in checkTypeMappable()
18070 SemaRef.Diag(SL, diag::warn_omp_non_trivial_type_mapped) << QTy << SR; in checkTypeMappable()
18077 static bool checkArrayExpressionDoesNotReferToWholeSize(Sema &SemaRef, in checkArrayExpressionDoesNotReferToWholeSize() argument
18101 if (!LowerBound->EvaluateAsInt(Result, SemaRef.getASTContext())) in checkArrayExpressionDoesNotReferToWholeSize()
18125 if (!Length->EvaluateAsInt(Result, SemaRef.getASTContext())) in checkArrayExpressionDoesNotReferToWholeSize()
18135 static bool checkArrayExpressionDoesNotReferToUnitySize(Sema &SemaRef, in checkArrayExpressionDoesNotReferToUnitySize() argument
18161 if (!Length->EvaluateAsInt(Result, SemaRef.getASTContext())) in checkArrayExpressionDoesNotReferToUnitySize()
18205 Sema &SemaRef; member in __anon5b04668f4d11::MapBaseChecker
18220 if (SemaRef.getLangOpts().OpenMP < 50) { in emitErrorMsg()
18221 SemaRef.Diag(ELoc, in emitErrorMsg()
18225 SemaRef.Diag(ELoc, diag::err_omp_non_lvalue_in_map_or_motion_clauses) in emitErrorMsg()
18257 SemaRef.Diag(ELoc, diag::err_omp_expected_access_to_data_field) in VisitMemberExpr()
18273 SemaRef.Diag(ELoc, diag::err_omp_bit_fields_forbidden_in_clause) in VisitMemberExpr()
18293 SemaRef.Diag(ELoc, diag::err_omp_union_type_not_allowed) in VisitMemberExpr()
18320 SemaRef.Diag(ELoc, diag::err_omp_expected_base_var_name) in VisitArraySubscriptExpr()
18330 if (checkArrayExpressionDoesNotReferToWholeSize(SemaRef, AE, in VisitArraySubscriptExpr()
18337 AE->getIdx()->EvaluateAsInt(Result, SemaRef.getASTContext()) && in VisitArraySubscriptExpr()
18339 SemaRef.Diag(AE->getIdx()->getExprLoc(), in VisitArraySubscriptExpr()
18341 SemaRef.Diag(AE->getIdx()->getExprLoc(), in VisitArraySubscriptExpr()
18369 SemaRef.Diag(ELoc, diag::err_omp_expected_base_var_name) in VisitOMPArraySectionExpr()
18375 checkArrayExpressionDoesNotReferToWholeSize(SemaRef, OASE, CurType); in VisitOMPArraySectionExpr()
18377 checkArrayExpressionDoesNotReferToUnitySize(SemaRef, OASE, CurType); in VisitOMPArraySectionExpr()
18389 SemaRef.getLangOpts().OpenMP >= 50) { in VisitOMPArraySectionExpr()
18391 SemaRef.Diag(ELoc, diag::err_omp_section_length_undefined) in VisitOMPArraySectionExpr()
18398 SemaRef.Diag( in VisitOMPArraySectionExpr()
18411 OASE->getLength()->EvaluateAsInt(ResultR, SemaRef.getASTContext()) && in VisitOMPArraySectionExpr()
18413 SemaRef.Diag(OASE->getLength()->getExprLoc(), in VisitOMPArraySectionExpr()
18415 SemaRef.Diag(OASE->getLength()->getExprLoc(), in VisitOMPArraySectionExpr()
18420 SemaRef.getASTContext()) && in VisitOMPArraySectionExpr()
18422 SemaRef.Diag(OASE->getLowerBound()->getExprLoc(), in VisitOMPArraySectionExpr()
18424 SemaRef.Diag(OASE->getLowerBound()->getExprLoc(), in VisitOMPArraySectionExpr()
18445 if (SemaRef.getLangOpts().OpenMP < 50 || !UO->isLValue() || in VisitUnaryOperator()
18457 if (SemaRef.getLangOpts().OpenMP < 50 || !BO->getType()->isPointerType()) { in VisitBinaryOperator()
18503 Sema &SemaRef, OpenMPClauseKind CKind, OpenMPDirectiveKind DKind, in MapBaseChecker() argument
18506 : SemaRef(SemaRef), CKind(CKind), DKind(DKind), Components(Components), in MapBaseChecker()
18516 Sema &SemaRef, Expr *E, in checkMapClauseExpressionBase() argument
18521 MapBaseChecker Checker(SemaRef, CKind, DKind, CurComponents, NoDiagnose, ELoc, in checkMapClauseExpressionBase()
18525 if (SemaRef.getLangOpts().OpenMP >= 50 && !CurComponents.empty() && in checkMapClauseExpressionBase()
18536 SemaRef.Diag(ELoc, diag::err_array_section_does_not_specify_length) in checkMapClauseExpressionBase()
18548 Sema &SemaRef, DSAStackTy *DSAS, const ValueDecl *VD, const Expr *E, in checkMapConflicts() argument
18570 [&IsEnclosedByDataEnvironmentExpr, &SemaRef, VD, CurrentRegionOnly, ELoc, in checkMapConflicts()
18575 if (CKind == Kind && SemaRef.LangOpts.OpenMP >= 50) in checkMapConflicts()
18606 SemaRef.Diag(CI->getAssociatedExpression()->getExprLoc(), in checkMapConflicts()
18609 SemaRef.Diag(SI->getAssociatedExpression()->getExprLoc(), in checkMapConflicts()
18643 SemaRef, SI->getAssociatedExpression(), Type)) in checkMapConflicts()
18656 SemaRef.Diag(ELoc, diag::err_omp_map_shared_storage) << ERange; in checkMapConflicts()
18659 SemaRef.Diag(ELoc, diag::err_omp_once_referenced_in_target_update) in checkMapConflicts()
18662 SemaRef.Diag(RE->getExprLoc(), diag::note_used_here) in checkMapConflicts()
18695 SemaRef.Diag( in checkMapConflicts()
18699 SemaRef.Diag(RE->getExprLoc(), diag::note_used_here) in checkMapConflicts()
18708 SemaRef.Diag(DerivedLoc, diag::err_omp_same_pointer_dereferenced) in checkMapConflicts()
18710 SemaRef.Diag(RE->getExprLoc(), diag::note_used_here) in checkMapConflicts()
18743 SemaRef.Diag(ELoc, diag::err_omp_map_shared_storage) << ERange; in checkMapConflicts()
18746 SemaRef.Diag(ELoc, diag::err_omp_once_referenced_in_target_update) in checkMapConflicts()
18749 SemaRef.Diag(RE->getExprLoc(), diag::note_used_here) in checkMapConflicts()
18782 SemaRef.Diag(ELoc, in checkMapConflicts()
18785 SemaRef.Diag(EnclosingExpr->getExprLoc(), diag::note_used_here) in checkMapConflicts()
18795 static ExprResult buildUserDefinedMapperRef(Sema &SemaRef, Scope *S, in buildUserDefinedMapperRef() argument
18809 LookupResult Lookup(SemaRef, MapperId, Sema::LookupOMPMapperName); in buildUserDefinedMapperRef()
18812 while (S && SemaRef.LookupParsedName(Lookup, S, &MapperIdScopeSpec)) { in buildUserDefinedMapperRef()
18833 if (SemaRef.CurContext->isDependentContext() || Type->isDependentType() || in buildUserDefinedMapperRef()
18849 SemaRef.Context, /*NamingClass=*/nullptr, in buildUserDefinedMapperRef()
18850 MapperIdScopeSpec.getWithLocInContext(SemaRef.Context), MapperId, in buildUserDefinedMapperRef()
18858 SemaRef.Diag(Loc, diag::err_omp_mapper_wrong_type); in buildUserDefinedMapperRef()
18862 if (SemaRef.getLangOpts().CPlusPlus && !MapperIdScopeSpec.isSet()) in buildUserDefinedMapperRef()
18863 argumentDependentLookup(SemaRef, MapperId, Loc, Type, Lookups); in buildUserDefinedMapperRef()
18866 Lookups, [&SemaRef, Type](ValueDecl *D) -> ValueDecl * { in buildUserDefinedMapperRef()
18868 SemaRef.Context.hasSameType(D->getType(), Type)) in buildUserDefinedMapperRef()
18872 return SemaRef.BuildDeclRefExpr(VD, Type, VK_LValue, Loc); in buildUserDefinedMapperRef()
18876 Lookups, [&SemaRef, Type, Loc](ValueDecl *D) -> ValueDecl * { in buildUserDefinedMapperRef()
18878 SemaRef.IsDerivedFrom(Loc, Type, D->getType()) && in buildUserDefinedMapperRef()
18885 if (SemaRef.IsDerivedFrom(Loc, Type, VD->getType(), Paths)) { in buildUserDefinedMapperRef()
18886 if (!Paths.isAmbiguous(SemaRef.Context.getCanonicalType( in buildUserDefinedMapperRef()
18888 if (SemaRef.CheckBaseClassAccess( in buildUserDefinedMapperRef()
18891 return SemaRef.BuildDeclRefExpr(VD, Type, VK_LValue, Loc); in buildUserDefinedMapperRef()
18898 SemaRef.Diag(Loc, diag::err_omp_invalid_mapper) in buildUserDefinedMapperRef()
18936 Sema &SemaRef, DSAStackTy *DSAS, OpenMPClauseKind CKind, in checkMappableExpressionList() argument
18951 auto &DeclNames = SemaRef.getASTContext().DeclarationNames; in checkMappableExpressionList()
18953 &SemaRef.getASTContext().Idents.get("default"))); in checkMappableExpressionList()
18990 SemaRef, DSAS->getCurScope(), MapperIdScopeSpec, MapperId, in checkMappableExpressionList()
19004 if (SemaRef.getLangOpts().OpenMP < 50) { in checkMappableExpressionList()
19005 SemaRef.Diag( in checkMappableExpressionList()
19009 SemaRef.Diag(ELoc, diag::err_omp_non_lvalue_in_map_or_motion_clauses) in checkMappableExpressionList()
19021 SemaRef, SimpleExpr, CurComponents, CKind, DSAS->getCurrentDirective(), in checkMappableExpressionList()
19034 SemaRef, DSAS->getCurScope(), MapperIdScopeSpec, MapperId, in checkMappableExpressionList()
19069 SemaRef.Diag(ELoc, diag::err_omp_threadprivate_in_clause) in checkMappableExpressionList()
19071 reportOriginalDsa(SemaRef, DSAS, VD, DVar); in checkMappableExpressionList()
19083 if (checkMapConflicts(SemaRef, DSAS, CurDeclaration, SimpleExpr, in checkMappableExpressionList()
19087 (SemaRef.getLangOpts().OpenMP <= 45 || StartLoc.isValid()) && in checkMappableExpressionList()
19088 checkMapConflicts(SemaRef, DSAS, CurDeclaration, SimpleExpr, in checkMappableExpressionList()
19127 if (!checkTypeMappable(VE->getExprLoc(), VE->getSourceRange(), SemaRef, in checkMappableExpressionList()
19139 SemaRef.Diag(StartLoc, diag::err_omp_invalid_map_type_for_directive) in checkMappableExpressionList()
19153 SemaRef.Diag(StartLoc, diag::err_omp_invalid_map_type_for_directive) in checkMappableExpressionList()
19168 SemaRef.Diag(StartLoc, diag::err_omp_invalid_map_type_for_directive) in checkMappableExpressionList()
19183 if (VD && ((SemaRef.LangOpts.OpenMP <= 45 && in checkMappableExpressionList()
19188 SemaRef.Diag(ELoc, diag::err_omp_variable_in_given_clause_and_dsa) in checkMappableExpressionList()
19192 reportOriginalDsa(SemaRef, DSAS, CurDeclaration, DVar); in checkMappableExpressionList()
19200 SemaRef, DSAS->getCurScope(), MapperIdScopeSpec, MapperId, in checkMappableExpressionList()
20112 Sema &SemaRef, Decl *D) { in checkDeclInTargetContext() argument
20118 if (SemaRef.LangOpts.OpenMP >= 50 && in checkDeclInTargetContext()
20119 (SemaRef.getCurLambda(/*IgnoreNonLambdaCapturingScope=*/true) || in checkDeclInTargetContext()
20120 SemaRef.getCurBlock() || SemaRef.getCurCapturedRegion()) && in checkDeclInTargetContext()
20128 SemaRef.Diag(VD->getLocation(), in checkDeclInTargetContext()
20130 SemaRef.Diag(SL, diag::note_var_explicitly_captured_here) in checkDeclInTargetContext()
20137 SemaRef.Diag(VD->getLocation(), diag::warn_omp_not_in_target_context); in checkDeclInTargetContext()
20138 SemaRef.Diag(SL, diag::note_used_here) << SR; in checkDeclInTargetContext()
20142 Sema &SemaRef, DSAStackTy *Stack, in checkValueDeclInTarget() argument
20145 checkTypeMappable(SL, SR, SemaRef, Stack, VD->getType(), in checkValueDeclInTarget()