Lines Matching refs:SemaRef

53     Sema &SemaRef, Expr *E,
235 Sema &SemaRef; member in __anon7e4ded5b0111::DSAStackTy
340 explicit DSAStackTy(Sema &S) : SemaRef(S) {} in DSAStackTy()
468 const FunctionScopeInfo *CurFnScope = SemaRef.getCurFunction(); in pushFunction()
481 for (const FunctionScopeInfo *FSI : llvm::reverse(SemaRef.FunctionScopes)) { in popFunction()
676 SemaRef.Diag(CNew->getBeginLoc(), in hasDuplicateRequiresClause()
679 SemaRef.Diag(CPrev->getBeginLoc(), in hasDuplicateRequiresClause()
1528 static VarDecl *buildVarDecl(Sema &SemaRef, SourceLocation Loc, QualType Type, in buildVarDecl() argument
1531 DeclContext *DC = SemaRef.CurContext; in buildVarDecl()
1532 IdentifierInfo *II = &SemaRef.PP.getIdentifierTable().get(Name); in buildVarDecl()
1533 TypeSourceInfo *TInfo = SemaRef.Context.getTrivialTypeSourceInfo(Type, Loc); in buildVarDecl()
1535 VarDecl::Create(SemaRef.Context, DC, Loc, Loc, II, Type, TInfo, SC_None); in buildVarDecl()
1544 OMPReferencedVarAttr::CreateImplicit(SemaRef.Context, OrigRef)); in buildVarDecl()
1577 VarDecl *VD = buildVarDecl(SemaRef, SR.getBegin(), in addTaskgroupReductionData()
1578 SemaRef.Context.VoidPtrTy, ".task_red."); in addTaskgroupReductionData()
1580 buildDeclRefExpr(SemaRef, VD, SemaRef.Context.VoidPtrTy, SR.getBegin()); in addTaskgroupReductionData()
1602 VarDecl *VD = buildVarDecl(SemaRef, SR.getBegin(), in addTaskgroupReductionData()
1603 SemaRef.Context.VoidPtrTy, ".task_red."); in addTaskgroupReductionData()
1605 buildDeclRefExpr(SemaRef, VD, SemaRef.Context.VoidPtrTy, SR.getBegin()); in addTaskgroupReductionData()
1684 static bool isConstNotMutableType(Sema &SemaRef, QualType Type, in isConstNotMutableType() argument
1687 ASTContext &Context = SemaRef.getASTContext(); in isConstNotMutableType()
1691 const CXXRecordDecl *RD = AcceptIfMutable && SemaRef.getLangOpts().CPlusPlus in isConstNotMutableType()
1699 return IsConstant && !(SemaRef.getLangOpts().CPlusPlus && RD && in isConstNotMutableType()
1703 static bool rejectConstNotMutableType(Sema &SemaRef, const ValueDecl *D, in rejectConstNotMutableType() argument
1708 ASTContext &Context = SemaRef.getASTContext(); in rejectConstNotMutableType()
1710 if (isConstNotMutableType(SemaRef, Type, AcceptIfMutable, &IsClassType)) { in rejectConstNotMutableType()
1714 SemaRef.Diag(ELoc, Diag) << getOpenMPClauseName(CKind); in rejectConstNotMutableType()
1719 SemaRef.Diag(D->getLocation(), in rejectConstNotMutableType()
1743 SemaRef, VD, D->getType().getNonReferenceType(), in getTopDSA()
1754 SemaRef.getLangOpts().OpenMPUseTLS && in getTopDSA()
1755 SemaRef.getASTContext().getTargetInfo().isTLSSupported())) || in getTopDSA()
1759 SemaRef, VD, D->getType().getNonReferenceType(), D->getLocation()); in getTopDSA()
1764 if (SemaRef.getLangOpts().OpenMPCUDAMode && VD && in getTopDSA()
1776 buildDeclRefExpr(SemaRef, VD, D->getType().getNonReferenceType(), in getTopDSA()
1791 if (!SemaRef.isOpenMPCapturedByRef(D, in getTopDSA()
1795 buildDeclRefExpr(SemaRef, VD, D->getType().getNonReferenceType(), in getTopDSA()
1843 if (SemaRef.LangOpts.OpenMP <= 31) { in getTopDSA()
1848 if (isConstNotMutableType(SemaRef, D->getType())) { in getTopDSA()
2845 static void reportOriginalDsa(Sema &SemaRef, const DSAStackTy *Stack,
2977 Expr *NumIterations, Sema &SemaRef,
2984 Sema &SemaRef; member in __anon7e4ded5b1f11::VarDeclFilterCCC
2987 explicit VarDeclFilterCCC(Sema &S) : SemaRef(S) {} in VarDeclFilterCCC()
2992 SemaRef.isDeclInScope(ND, SemaRef.getCurLexicalContext(), in ValidateCandidate()
2993 SemaRef.getCurScope()); in ValidateCandidate()
3005 Sema &SemaRef; member in __anon7e4ded5b1f11::VarOrFuncDeclFilterCCC
3008 explicit VarOrFuncDeclFilterCCC(Sema &S) : SemaRef(S) {} in VarOrFuncDeclFilterCCC()
3013 return SemaRef.isDeclInScope(ND, SemaRef.getCurLexicalContext(), in ValidateCandidate()
3014 SemaRef.getCurScope()); in ValidateCandidate()
3166 Sema &SemaRef; member in __anon7e4ded5b2011::LocalVarRefChecker
3172 SemaRef.Diag(E->getBeginLoc(), in VisitDeclRefExpr()
3175 SemaRef.Diag(VD->getLocation(), diag::note_defined_here) in VisitDeclRefExpr()
3189 explicit LocalVarRefChecker(Sema &SemaRef) : SemaRef(SemaRef) {} in LocalVarRefChecker() argument
3560 static void reportOriginalDsa(Sema &SemaRef, const DSAStackTy *Stack, in reportOriginalDsa() argument
3565 SemaRef.Diag(DVar.RefExpr->getExprLoc(), diag::note_omp_explicit_dsa) in reportOriginalDsa()
3601 else if (D->getType().isConstant(SemaRef.getASTContext())) in reportOriginalDsa()
3608 SemaRef.Diag(ReportLoc, diag::note_omp_predetermined_dsa) in reportOriginalDsa()
3612 SemaRef.Diag(DVar.ImplicitDSALoc, diag::note_omp_implicit_dsa) in reportOriginalDsa()
3664 Sema &SemaRef; member in __anon7e4ded5b2211::DSAAttrChecker
3796 getVariableCategoryFromDecl(SemaRef.getLangOpts(), VD); in VisitDeclRefExpr()
3797 if (SemaRef.getLangOpts().OpenMP >= 50) { in VisitDeclRefExpr()
3819 if (SemaRef.getLangOpts().OpenMP > 50) { in VisitDeclRefExpr()
3838 if (SemaRef.LangOpts.OpenMP >= 50) in VisitDeclRefExpr()
3893 SemaRef.Diag(ELoc, diag::err_omp_reduction_in_task); in VisitDeclRefExpr()
3894 reportOriginalDsa(SemaRef, Stack, VD, DVar); in VisitDeclRefExpr()
3965 getVariableCategoryFromDecl(SemaRef.getLangOpts(), FD); in VisitMemberExpr()
3989 SemaRef.Diag(ELoc, diag::err_omp_reduction_in_task); in VisitMemberExpr()
3990 reportOriginalDsa(SemaRef, Stack, FD, DVar); in VisitMemberExpr()
4009 if (!checkMapClauseExpressionBase(SemaRef, E, CurComponents, OMPC_map, in VisitMemberExpr()
4121 SemaRef, VD, VD->getType().getNonLValueExprType(SemaRef.Context), in visitSubCaptures()
4143 DSAAttrChecker(DSAStackTy *S, Sema &SemaRef, CapturedStmt *CS) in DSAAttrChecker() argument
4144 : Stack(S), SemaRef(SemaRef), ErrorFound(false), CS(CS) { in DSAAttrChecker()
4965 static bool checkCancelRegion(Sema &SemaRef, OpenMPDirectiveKind CurrentRegion, in checkCancelRegion() argument
4976 SemaRef.Diag(StartLoc, diag::err_omp_wrong_cancel_region) in checkCancelRegion()
4981 static bool checkNestingOfRegions(Sema &SemaRef, const DSAStackTy *Stack, in checkNestingOfRegions() argument
5001 if (SemaRef.LangOpts.OpenMP >= 51 && Stack->isParentOrderConcurrent() && in checkNestingOfRegions()
5005 SemaRef.Diag(StartLoc, diag::err_omp_prohibited_region_order) in checkNestingOfRegions()
5010 ((SemaRef.LangOpts.OpenMP <= 45 && CurrentRegion != OMPD_ordered) || in checkNestingOfRegions()
5011 (SemaRef.LangOpts.OpenMP >= 50 && CurrentRegion != OMPD_ordered && in checkNestingOfRegions()
5026 SemaRef.Diag(StartLoc, (CurrentRegion != OMPD_simd) in checkNestingOfRegions()
5029 << (SemaRef.LangOpts.OpenMP >= 50 ? 1 : 0); in checkNestingOfRegions()
5035 SemaRef.Diag(StartLoc, diag::err_omp_prohibited_region_atomic); in checkNestingOfRegions()
5045 SemaRef.Diag(StartLoc, diag::err_omp_orphaned_section_directive) in checkNestingOfRegions()
5085 (SemaRef.getLangOpts().OpenMP >= 50 && in checkNestingOfRegions()
5120 SemaRef.Diag(StartLoc, in checkNestingOfRegions()
5124 SemaRef.Diag(PreviousCriticalLoc, in checkNestingOfRegions()
5175 (SemaRef.LangOpts.OpenMP <= 45 && ParentRegion != OMPD_target) || in checkNestingOfRegions()
5176 (SemaRef.LangOpts.OpenMP >= 50 && ParentRegion != OMPD_unknown && in checkNestingOfRegions()
5185 SemaRef.LangOpts.OpenMP < 50 || in checkNestingOfRegions()
5208 !(SemaRef.getLangOpts().OpenMPExtensions && in checkNestingOfRegions()
5252 SemaRef.Diag(StartLoc, diag::err_omp_orphaned_device_directive) in checkNestingOfRegions()
5255 SemaRef.Diag(StartLoc, diag::err_omp_prohibited_region) in checkNestingOfRegions()
5965 static ExprResult buildUserDefinedMapperRef(Sema &SemaRef, Scope *S,
7809 Sema &SemaRef; member in __anon7e4ded5b3b11::OpenMPIterationSpaceChecker
7861 OpenMPIterationSpaceChecker(Sema &SemaRef, bool SupportsNonRectangular, in OpenMPIterationSpaceChecker() argument
7863 : SemaRef(SemaRef), SupportsNonRectangular(SupportsNonRectangular), in OpenMPIterationSpaceChecker()
8002 ExprResult Val = SemaRef.PerformOpenMPImplicitIntegerConversion( in setStep()
8020 NewStep->getIntegerConstantExpr(SemaRef.Context); in setStep()
8034 SemaRef.Diag(NewStep->getExprLoc(), in setStep()
8037 SemaRef.Diag(ConditionLoc, in setStep()
8044 SemaRef.CreateBuiltinUnaryOp(NewStep->getExprLoc(), UO_Minus, NewStep) in setStep()
8060 Sema &SemaRef; member in __anon7e4ded5b3b11::__anon7e4ded5b3c11::LoopCounterRefChecker
8070 SemaRef.Diag(E->getExprLoc(), diag::err_omp_stmt_depends_on_loop_counter) in checkDecl()
8081 VD->getNameForDiagnostic(OS, SemaRef.getPrintingPolicy(), in checkDecl()
8083 SemaRef.Diag(E->getExprLoc(), in checkDecl()
8086 SemaRef.Diag(VD->getLocation(), diag::note_previous_decl) << VD; in checkDecl()
8090 SemaRef.Diag(E->getExprLoc(), diag::err_omp_invariant_dependency); in checkDecl()
8100 DepDecl->getNameForDiagnostic(OS, SemaRef.getPrintingPolicy(), in checkDecl()
8102 SemaRef.Diag(E->getExprLoc(), in checkDecl()
8135 explicit LoopCounterRefChecker(Sema &SemaRef, DSAStackTy &Stack, in LoopCounterRefChecker() argument
8139 : SemaRef(SemaRef), Stack(Stack), CurLCDecl(CurLCDecl), in LoopCounterRefChecker()
8157 LoopCounterRefChecker LoopStmtChecker(SemaRef, Stack, LCDecl, IsInitializer, in doesDependOnLoopCounter()
8177 SemaRef.Diag(DefaultLoc, diag::err_omp_loop_not_canonical_init); in checkAndSetInit()
8211 SemaRef.Diag(S->getBeginLoc(), in checkAndSetInit()
8216 buildDeclRefExpr(SemaRef, Var, in checkAndSetInit()
8242 if (dependent() || SemaRef.CurContext->isDependentContext()) in checkAndSetInit()
8245 SemaRef.Diag(S->getBeginLoc(), diag::err_omp_loop_not_canonical_init) in checkAndSetInit()
8280 bool IneqCondIsCanonical = SemaRef.getLangOpts().OpenMP >= 50; in checkAndSetCond()
8282 SemaRef.Diag(DefaultLoc, diag::err_omp_loop_not_canonical_cond) in checkAndSetCond()
8326 if (dependent() || SemaRef.CurContext->isDependentContext()) in checkAndSetCond()
8328 SemaRef.Diag(CondLoc, diag::err_omp_loop_not_canonical_cond) in checkAndSetCond()
8357 if (dependent() || SemaRef.CurContext->isDependentContext()) in checkAndSetIncRHS()
8359 SemaRef.Diag(RHS->getBeginLoc(), diag::err_omp_loop_not_canonical_incr) in checkAndSetIncRHS()
8379 SemaRef.Diag(DefaultLoc, diag::err_omp_loop_not_canonical_incr) << LCDecl; in checkAndSetInc()
8391 return setStep(SemaRef in checkAndSetInc()
8415 return setStep(SemaRef in checkAndSetInc()
8435 if (dependent() || SemaRef.CurContext->isDependentContext()) in checkAndSetInc()
8437 SemaRef.Diag(S->getBeginLoc(), diag::err_omp_loop_not_canonical_incr) in checkAndSetInc()
8443 tryBuildCapture(Sema &SemaRef, Expr *Capture, in tryBuildCapture() argument
8445 if (SemaRef.CurContext->isDependentContext() || Capture->containsErrors()) in tryBuildCapture()
8447 if (Capture->isEvaluatable(SemaRef.Context, Expr::SE_AllowSideEffects)) in tryBuildCapture()
8448 return SemaRef.PerformImplicitConversion( in tryBuildCapture()
8453 return buildCapture(SemaRef, Capture, I->second); in tryBuildCapture()
8455 ExprResult Res = buildCapture(SemaRef, Capture, Ref); in tryBuildCapture()
8463 calculateNumIters(Sema &SemaRef, Scope *S, SourceLocation DefaultLoc, in calculateNumIters() argument
8467 ExprResult NewStep = tryBuildCapture(SemaRef, Step, Captures); in calculateNumIters()
8473 Lower->getIntegerConstantExpr(SemaRef.Context)) { in calculateNumIters()
8478 Step->getIntegerConstantExpr(SemaRef.Context)) { in calculateNumIters()
8517 Upper->getIntegerConstantExpr(SemaRef.Context)) { in calculateNumIters()
8540 uint64_t LowerSize = SemaRef.Context.getTypeSize(LowerTy); in calculateNumIters()
8541 uint64_t UpperSize = SemaRef.Context.getTypeSize(UpperTy); in calculateNumIters()
8544 QualType CastType = SemaRef.Context.getIntTypeForBitwidth( in calculateNumIters()
8547 SemaRef in calculateNumIters()
8549 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Upper).get(), in calculateNumIters()
8552 Lower = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Lower).get(); in calculateNumIters()
8553 NewStep = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, NewStep.get()); in calculateNumIters()
8568 SemaRef.BuildBinOp(S, DefaultLoc, BO_Sub, Diff.get(), NewStep.get()); in calculateNumIters()
8575 Diff = SemaRef.BuildBinOp( in calculateNumIters()
8577 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); in calculateNumIters()
8581 Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); in calculateNumIters()
8586 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Sub, Upper, Diff.get()); in calculateNumIters()
8590 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Sub, Upper, Lower); in calculateNumIters()
8595 SemaRef.Diag(Upper->getBeginLoc(), diag::err_omp_loop_diff_cxx) in calculateNumIters()
8605 Diff = SemaRef.BuildBinOp( in calculateNumIters()
8607 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); in calculateNumIters()
8614 SemaRef.BuildBinOp(S, DefaultLoc, BO_Add, Diff.get(), NewStep.get()); in calculateNumIters()
8621 Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); in calculateNumIters()
8626 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Div, Diff.get(), NewStep.get()); in calculateNumIters()
8639 !SemaRef.getLangOpts().CPlusPlus) in buildNumIterations()
8651 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MinValue); in buildNumIterations()
8655 ExprResult LBMinVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, in buildNumIterations()
8661 SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, LBMinVal.get(), LBVal); in buildNumIterations()
8665 LBMinVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, LBMinVal.get()); in buildNumIterations()
8671 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MaxValue); in buildNumIterations()
8675 ExprResult LBMaxVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, in buildNumIterations()
8681 SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, LBMaxVal.get(), LBVal); in buildNumIterations()
8685 LBMaxVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, LBMaxVal.get()); in buildNumIterations()
8689 Expr *LBMin = tryBuildCapture(SemaRef, LBMinVal.get(), Captures).get(); in buildNumIterations()
8690 Expr *LBMax = tryBuildCapture(SemaRef, LBMaxVal.get(), Captures).get(); in buildNumIterations()
8695 SemaRef.BuildBinOp(S, DefaultLoc, BO_LT, LBMin, LBMax); in buildNumIterations()
8699 tryBuildCapture(SemaRef, MinLessMaxRes.get(), Captures).get(); in buildNumIterations()
8705 ExprResult MinLB = SemaRef.ActOnConditionalOp(DefaultLoc, DefaultLoc, in buildNumIterations()
8713 ExprResult MaxLB = SemaRef.ActOnConditionalOp(DefaultLoc, DefaultLoc, in buildNumIterations()
8728 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MinValue); in buildNumIterations()
8732 ExprResult UBMinVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, in buildNumIterations()
8738 SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, UBMinVal.get(), UBVal); in buildNumIterations()
8742 UBMinVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, UBMinVal.get()); in buildNumIterations()
8748 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MaxValue); in buildNumIterations()
8752 ExprResult UBMaxVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, in buildNumIterations()
8758 SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, UBMaxVal.get(), UBVal); in buildNumIterations()
8762 UBMaxVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, UBMaxVal.get()); in buildNumIterations()
8766 Expr *UBMin = tryBuildCapture(SemaRef, UBMinVal.get(), Captures).get(); in buildNumIterations()
8767 Expr *UBMax = tryBuildCapture(SemaRef, UBMaxVal.get(), Captures).get(); in buildNumIterations()
8772 SemaRef.BuildBinOp(S, DefaultLoc, BO_GT, UBMin, UBMax); in buildNumIterations()
8776 tryBuildCapture(SemaRef, MinGreaterMaxRes.get(), Captures).get(); in buildNumIterations()
8782 ExprResult MaxUB = SemaRef.ActOnConditionalOp( in buildNumIterations()
8790 ExprResult MinUB = SemaRef.ActOnConditionalOp( in buildNumIterations()
8799 Expr *Upper = tryBuildCapture(SemaRef, UBExpr, Captures).get(); in buildNumIterations()
8800 Expr *Lower = tryBuildCapture(SemaRef, LBExpr, Captures).get(); in buildNumIterations()
8804 ExprResult Diff = calculateNumIters(SemaRef, S, DefaultLoc, Lower, Upper, in buildNumIterations()
8812 ASTContext &C = SemaRef.Context; in buildNumIterations()
8821 if (!SemaRef.Context.hasSameType(Diff.get()->getType(), Type)) { in buildNumIterations()
8822 Diff = SemaRef.PerformImplicitConversion( in buildNumIterations()
8833 SemaRef.Diag(DefaultLoc, diag::warn_omp_loop_64_bit_var) in buildNumIterations()
8839 if (!SemaRef.Context.hasSameType(Diff.get()->getType(), NewType)) { in buildNumIterations()
8840 Diff = SemaRef.PerformImplicitConversion(Diff.get(), NewType, in buildNumIterations()
8868 LBNonRect ? LBExpr : tryBuildCapture(SemaRef, LBExpr, Captures).get(); in buildMinMaxValues()
8870 UBNonRect ? UBExpr : tryBuildCapture(SemaRef, UBExpr, Captures).get(); in buildMinMaxValues()
8882 ExprResult Diff = calculateNumIters(SemaRef, S, DefaultLoc, Lower, Upper, in buildMinMaxValues()
8890 Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); in buildMinMaxValues()
8894 ExprResult NewStep = tryBuildCapture(SemaRef, Step, Captures); in buildMinMaxValues()
8897 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Mul, Diff.get(), NewStep.get()); in buildMinMaxValues()
8902 Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); in buildMinMaxValues()
8908 !SemaRef.Context.hasSameType( in buildMinMaxValues()
8910 SemaRef.Context.getUnsignedPointerDiffType())) { in buildMinMaxValues()
8911 Diff = SemaRef.PerformImplicitConversion( in buildMinMaxValues()
8912 Diff.get(), SemaRef.Context.getUnsignedPointerDiffType(), in buildMinMaxValues()
8921 Diff = SemaRef.BuildBinOp( in buildMinMaxValues()
8923 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Lower).get(), in buildMinMaxValues()
8930 Diff = SemaRef.BuildBinOp( in buildMinMaxValues()
8932 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Upper).get(), in buildMinMaxValues()
8939 if (SemaRef.Context.hasSameType(Diff.get()->getType(), VarType)) in buildMinMaxValues()
8940 Diff = SemaRef.PerformImplicitConversion(Diff.get(), VarType, in buildMinMaxValues()
8946 Sema::TentativeAnalysisScope Trap(SemaRef); in buildMinMaxValues()
8947 Diff = SemaRef.ActOnFinishFullExpr(Diff.get(), /*DiscardedValue=*/false); in buildMinMaxValues()
8973 return SemaRef in buildPreCond()
8975 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get(), in buildPreCond()
8976 SemaRef.Context.BoolTy, /*Action=*/Sema::AA_Casting, in buildPreCond()
8981 Sema::TentativeAnalysisScope Trap(SemaRef); in buildPreCond()
8983 ExprResult NewLB = tryBuildCapture(SemaRef, LB, Captures); in buildPreCond()
8984 ExprResult NewUB = tryBuildCapture(SemaRef, UB, Captures); in buildPreCond()
8989 SemaRef.BuildBinOp(S, DefaultLoc, in buildPreCond()
8994 if (!SemaRef.Context.hasSameUnqualifiedType(CondExpr.get()->getType(), in buildPreCond()
8995 SemaRef.Context.BoolTy)) in buildPreCond()
8996 CondExpr = SemaRef.PerformImplicitConversion( in buildPreCond()
8997 CondExpr.get(), SemaRef.Context.BoolTy, /*Action=*/Sema::AA_Casting, in buildPreCond()
9011 VD = SemaRef.isOpenMPCapturedDecl(LCDecl); in buildCounterVar()
9013 SemaRef, VD, VD->getType().getNonReferenceType(), DefaultLoc); in buildCounterVar()
9029 SemaRef, DefaultLoc, Type, LCDecl->getName(), in buildPrivateCounterVar()
9032 ? buildDeclRefExpr(SemaRef, cast<VarDecl>(LCDecl), Type, DefaultLoc) in buildPrivateCounterVar()
9036 return buildDeclRefExpr(SemaRef, PrivateVar, Type, DefaultLoc); in buildPrivateCounterVar()
9051 Expr *Cnt = SemaRef.DefaultLvalueConversion(Counter).get(); in buildOrderedLoopData()
9058 Cnt = SemaRef.BuildBinOp(S, Loc, BOK, Cnt, Inc).get(); in buildOrderedLoopData()
9064 !SemaRef.getLangOpts().CPlusPlus) in buildOrderedLoopData()
9068 *TestIsLessOp ? Cnt : tryBuildCapture(SemaRef, LB, Captures).get(); in buildOrderedLoopData()
9070 *TestIsLessOp ? tryBuildCapture(SemaRef, LB, Captures).get() : Cnt; in buildOrderedLoopData()
9075 SemaRef, S, DefaultLoc, Lower, Upper, Step, VarType, in buildOrderedLoopData()
9171 OpenMPDirectiveKind DKind, Stmt *S, Sema &SemaRef, DSAStackTy &DSA, in checkOpenMPIterationSpace() argument
9187 if (!For && (SemaRef.LangOpts.OpenMP <= 45 || !CXXFor)) { in checkOpenMPIterationSpace()
9188 SemaRef.Diag(S->getBeginLoc(), diag::err_omp_not_for) in checkOpenMPIterationSpace()
9194 SemaRef.Diag(DSA.getConstructLoc(), in checkOpenMPIterationSpace()
9199 SemaRef.Diag(CollapseLoopCountExpr->getExprLoc(), in checkOpenMPIterationSpace()
9203 SemaRef.Diag(OrderedLoopCountExpr->getExprLoc(), in checkOpenMPIterationSpace()
9212 if (CXXFor && SemaRef.CurContext->isDependentContext()) in checkOpenMPIterationSpace()
9215 OpenMPIterationSpaceChecker ISC(SemaRef, SupportsNonRectangular, DSA, in checkOpenMPIterationSpace()
9235 !(SemaRef.getLangOpts().CPlusPlus && VarType->isOverloadableType())) { in checkOpenMPIterationSpace()
9236 SemaRef.Diag(Init->getBeginLoc(), diag::err_omp_loop_variable_type) in checkOpenMPIterationSpace()
9237 << SemaRef.getLangOpts().CPlusPlus; in checkOpenMPIterationSpace()
9261 if (ISC.dependent() || SemaRef.CurContext->isDependentContext() || HasErrors) in checkOpenMPIterationSpace()
9353 buildCounterInit(Sema &SemaRef, Scope *S, SourceLocation Loc, ExprResult VarRef, in buildCounterInit() argument
9359 : tryBuildCapture(SemaRef, Start.get(), Captures); in buildCounterInit()
9362 if (!SemaRef.Context.hasSameType(NewStart.get()->getType(), in buildCounterInit()
9364 NewStart = SemaRef.PerformImplicitConversion( in buildCounterInit()
9372 SemaRef.BuildBinOp(S, Loc, BO_Assign, VarRef.get(), NewStart.get()); in buildCounterInit()
9378 Sema &SemaRef, Scope *S, SourceLocation Loc, ExprResult VarRef, in buildCounterUpdate() argument
9383 Iter = SemaRef.ActOnParenExpr(Loc, Loc, Iter.get()); in buildCounterUpdate()
9390 NewStep = tryBuildCapture(SemaRef, Step.get(), *Captures); in buildCounterUpdate()
9394 SemaRef.BuildBinOp(S, Loc, BO_Mul, Iter.get(), NewStep.get()); in buildCounterUpdate()
9402 ExprResult NewStart = SemaRef.ActOnParenExpr(Loc, Loc, Start.get()); in buildCounterUpdate()
9406 NewStart = tryBuildCapture(SemaRef, Start.get(), *Captures); in buildCounterUpdate()
9416 Sema::TentativeAnalysisScope Trap(SemaRef); in buildCounterUpdate()
9419 SemaRef.BuildBinOp(S, Loc, BO_Assign, VarRef.get(), NewStart.get()); in buildCounterUpdate()
9422 SemaRef.BuildBinOp(S, Loc, Subtract ? BO_SubAssign : BO_AddAssign, in buildCounterUpdate()
9425 Update = SemaRef.CreateBuiltinBinOp(Loc, BO_Comma, Update.get(), in buildCounterUpdate()
9433 Update = SemaRef.BuildBinOp(S, Loc, Subtract ? BO_Sub : BO_Add, in buildCounterUpdate()
9438 if (!SemaRef.Context.hasSameType(Update.get()->getType(), in buildCounterUpdate()
9440 Update = SemaRef.PerformImplicitConversion( in buildCounterUpdate()
9446 Update = SemaRef.BuildBinOp(S, Loc, BO_Assign, VarRef.get(), Update.get()); in buildCounterUpdate()
9453 static ExprResult widenIterationCount(unsigned Bits, Expr *E, Sema &SemaRef) { in widenIterationCount() argument
9456 ASTContext &C = SemaRef.Context; in widenIterationCount()
9463 return SemaRef.PerformImplicitConversion(E, NewType, Sema::AA_Converting, in widenIterationCount()
9469 static bool fitsInto(unsigned Bits, bool Signed, const Expr *E, Sema &SemaRef) { in fitsInto() argument
9473 E->getIntegerConstantExpr(SemaRef.Context)) in fitsInto()
9527 Expr *OrderedLoopCountExpr, Stmt *AStmt, Sema &SemaRef, in checkOpenMPLoop() argument
9532 bool SupportsNonPerfectlyNested = (SemaRef.LangOpts.OpenMP >= 50) && in checkOpenMPLoop()
9539 CollapseLoopCountExpr->EvaluateAsInt(Result, SemaRef.getASTContext())) { in checkOpenMPLoop()
9552 SemaRef.getASTContext())) { in checkOpenMPLoop()
9555 SemaRef.Diag(OrderedLoopCountExpr->getExprLoc(), in checkOpenMPLoop()
9558 SemaRef.Diag(CollapseLoopCountExpr->getExprLoc(), in checkOpenMPLoop()
9576 [DKind, &SemaRef, &DSA, NumLoops, NestedLoopCount, in checkOpenMPLoop()
9580 DKind, CurStmt, SemaRef, DSA, Cnt, NestedLoopCount, in checkOpenMPLoop()
9594 [&SemaRef, &Captures](OMPLoopTransformationDirective *Transform) { in checkOpenMPLoop()
9600 DeclRefExpr *Ref = buildDeclRefExpr(SemaRef, D, D->getType(), in checkOpenMPLoop()
9609 if (SemaRef.CurContext->isDependentContext()) in checkOpenMPLoop()
9647 SemaRef in checkOpenMPLoop()
9652 SemaRef); in checkOpenMPLoop()
9655 SemaRef in checkOpenMPLoop()
9660 SemaRef); in checkOpenMPLoop()
9665 ASTContext &C = SemaRef.Context; in checkOpenMPLoop()
9672 SemaRef.BuildBinOp(CurScope, PreCond.get()->getExprLoc(), BO_LAnd, in checkOpenMPLoop()
9679 LastIteration32 = SemaRef.BuildBinOp( in checkOpenMPLoop()
9681 SemaRef in checkOpenMPLoop()
9687 LastIteration64 = SemaRef.BuildBinOp( in checkOpenMPLoop()
9689 SemaRef in checkOpenMPLoop()
9698 if (SemaRef.getLangOpts().OpenMPOptimisticCollapse || in checkOpenMPLoop()
9705 LastIteration64.get(), SemaRef)))) in checkOpenMPLoop()
9712 SemaRef.Context.getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/0); in checkOpenMPLoop()
9714 SemaRef.Context.getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/1); in checkOpenMPLoop()
9723 LastIteration = SemaRef.BuildBinOp( in checkOpenMPLoop()
9726 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); in checkOpenMPLoop()
9733 bool IsConstant = LastIteration.get()->isIntegerConstantExpr(SemaRef.Context); in checkOpenMPLoop()
9737 tryBuildCapture(SemaRef, LastIteration.get(), Captures); in checkOpenMPLoop()
9741 NumIterations = SemaRef.BuildBinOp( in checkOpenMPLoop()
9743 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); in checkOpenMPLoop()
9757 VarDecl *LBDecl = buildVarDecl(SemaRef, InitLoc, VType, ".omp.lb"); in checkOpenMPLoop()
9758 LB = buildDeclRefExpr(SemaRef, LBDecl, VType, InitLoc); in checkOpenMPLoop()
9759 SemaRef.AddInitializerToDecl(LBDecl, in checkOpenMPLoop()
9760 SemaRef.ActOnIntegerConstant(InitLoc, 0).get(), in checkOpenMPLoop()
9764 VarDecl *UBDecl = buildVarDecl(SemaRef, InitLoc, VType, ".omp.ub"); in checkOpenMPLoop()
9765 UB = buildDeclRefExpr(SemaRef, UBDecl, VType, InitLoc); in checkOpenMPLoop()
9766 SemaRef.AddInitializerToDecl(UBDecl, LastIteration.get(), in checkOpenMPLoop()
9771 QualType Int32Ty = SemaRef.Context.getIntTypeForBitwidth(32, true); in checkOpenMPLoop()
9772 VarDecl *ILDecl = buildVarDecl(SemaRef, InitLoc, Int32Ty, ".omp.is_last"); in checkOpenMPLoop()
9773 IL = buildDeclRefExpr(SemaRef, ILDecl, Int32Ty, InitLoc); in checkOpenMPLoop()
9774 SemaRef.AddInitializerToDecl(ILDecl, in checkOpenMPLoop()
9775 SemaRef.ActOnIntegerConstant(InitLoc, 0).get(), in checkOpenMPLoop()
9780 buildVarDecl(SemaRef, InitLoc, StrideVType, ".omp.stride"); in checkOpenMPLoop()
9781 ST = buildDeclRefExpr(SemaRef, STDecl, StrideVType, InitLoc); in checkOpenMPLoop()
9782 SemaRef.AddInitializerToDecl(STDecl, in checkOpenMPLoop()
9783 SemaRef.ActOnIntegerConstant(InitLoc, 1).get(), in checkOpenMPLoop()
9788 ExprResult IsUBGreater = SemaRef.BuildBinOp(CurScope, InitLoc, BO_GT, in checkOpenMPLoop()
9790 ExprResult CondOp = SemaRef.ActOnConditionalOp( in checkOpenMPLoop()
9793 EUB = SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, UB.get(), in checkOpenMPLoop()
9795 EUB = SemaRef.ActOnFinishFullExpr(EUB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9804 buildVarDecl(SemaRef, InitLoc, VType, ".omp.comb.lb"); in checkOpenMPLoop()
9805 CombLB = buildDeclRefExpr(SemaRef, CombLBDecl, VType, InitLoc); in checkOpenMPLoop()
9806 SemaRef.AddInitializerToDecl( in checkOpenMPLoop()
9807 CombLBDecl, SemaRef.ActOnIntegerConstant(InitLoc, 0).get(), in checkOpenMPLoop()
9812 buildVarDecl(SemaRef, InitLoc, VType, ".omp.comb.ub"); in checkOpenMPLoop()
9813 CombUB = buildDeclRefExpr(SemaRef, CombUBDecl, VType, InitLoc); in checkOpenMPLoop()
9814 SemaRef.AddInitializerToDecl(CombUBDecl, LastIteration.get(), in checkOpenMPLoop()
9817 ExprResult CombIsUBGreater = SemaRef.BuildBinOp( in checkOpenMPLoop()
9820 SemaRef.ActOnConditionalOp(InitLoc, InitLoc, CombIsUBGreater.get(), in checkOpenMPLoop()
9822 CombEUB = SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, CombUB.get(), in checkOpenMPLoop()
9825 SemaRef.ActOnFinishFullExpr(CombEUB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9841 buildDeclRefExpr(SemaRef, PrevLBDecl, PrevLBDecl->getType(), InitLoc); in checkOpenMPLoop()
9843 buildDeclRefExpr(SemaRef, PrevUBDecl, PrevUBDecl->getType(), InitLoc); in checkOpenMPLoop()
9851 VarDecl *IVDecl = buildVarDecl(SemaRef, InitLoc, RealVType, ".omp.iv"); in checkOpenMPLoop()
9852 IV = buildDeclRefExpr(SemaRef, IVDecl, RealVType, InitLoc); in checkOpenMPLoop()
9859 : SemaRef.ActOnIntegerConstant(SourceLocation(), 0).get(); in checkOpenMPLoop()
9860 Init = SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, IV.get(), RHS); in checkOpenMPLoop()
9861 Init = SemaRef.ActOnFinishFullExpr(Init.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9870 : SemaRef.ActOnIntegerConstant(SourceLocation(), 0).get(); in checkOpenMPLoop()
9872 SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, IV.get(), CombRHS); in checkOpenMPLoop()
9874 SemaRef.ActOnFinishFullExpr(CombInit.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9889 SemaRef in checkOpenMPLoop()
9891 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()) in checkOpenMPLoop()
9894 SemaRef.ActOnFinishFullExpr(BoundUB, /*DiscardedValue*/ false).get(); in checkOpenMPLoop()
9901 ? SemaRef.BuildBinOp(CurScope, CondLoc, in checkOpenMPLoop()
9904 : SemaRef.BuildBinOp(CurScope, CondLoc, BO_LT, IV.get(), in checkOpenMPLoop()
9908 CombDistCond = SemaRef.BuildBinOp(CurScope, CondLoc, BO_LT, IV.get(), in checkOpenMPLoop()
9917 SemaRef in checkOpenMPLoop()
9920 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()) in checkOpenMPLoop()
9923 SemaRef.ActOnFinishFullExpr(BoundCombUB, /*DiscardedValue*/ false) in checkOpenMPLoop()
9927 SemaRef.BuildBinOp(CurScope, CondLoc, UseStrictCompare ? BO_LT : BO_LE, in checkOpenMPLoop()
9933 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, IV.get(), in checkOpenMPLoop()
9934 SemaRef.ActOnIntegerConstant(IncLoc, 1).get()); in checkOpenMPLoop()
9937 Inc = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, IV.get(), Inc.get()); in checkOpenMPLoop()
9938 Inc = SemaRef.ActOnFinishFullExpr(Inc.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9952 NextLB = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, LB.get(), ST.get()); in checkOpenMPLoop()
9957 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, LB.get(), NextLB.get()); in checkOpenMPLoop()
9959 SemaRef.ActOnFinishFullExpr(NextLB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9963 NextUB = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, UB.get(), ST.get()); in checkOpenMPLoop()
9968 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, UB.get(), NextUB.get()); in checkOpenMPLoop()
9970 SemaRef.ActOnFinishFullExpr(NextUB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
9975 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, CombLB.get(), ST.get()); in checkOpenMPLoop()
9979 CombNextLB = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, CombLB.get(), in checkOpenMPLoop()
9981 CombNextLB = SemaRef.ActOnFinishFullExpr(CombNextLB.get(), in checkOpenMPLoop()
9987 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, CombUB.get(), ST.get()); in checkOpenMPLoop()
9991 CombNextUB = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, CombUB.get(), in checkOpenMPLoop()
9993 CombNextUB = SemaRef.ActOnFinishFullExpr(CombNextUB.get(), in checkOpenMPLoop()
10007 DistCond = SemaRef.BuildBinOp( in checkOpenMPLoop()
10012 SemaRef.BuildBinOp(CurScope, DistIncLoc, BO_Add, IV.get(), ST.get()); in checkOpenMPLoop()
10014 DistInc = SemaRef.BuildBinOp(CurScope, DistIncLoc, BO_Assign, IV.get(), in checkOpenMPLoop()
10017 SemaRef.ActOnFinishFullExpr(DistInc.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
10024 if (!SemaRef.Context.hasSameType(UB.get()->getType(), in checkOpenMPLoop()
10026 NewPrevUB = SemaRef.BuildCStyleCastExpr( in checkOpenMPLoop()
10028 SemaRef.Context.getTrivialTypeSourceInfo(UB.get()->getType()), in checkOpenMPLoop()
10033 ExprResult IsUBGreater = SemaRef.BuildBinOp(CurScope, DistEUBLoc, BO_GT, in checkOpenMPLoop()
10035 ExprResult CondOp = SemaRef.ActOnConditionalOp( in checkOpenMPLoop()
10037 PrevEUB = SemaRef.BuildBinOp(CurScope, DistIncLoc, BO_Assign, UB.get(), in checkOpenMPLoop()
10040 SemaRef.ActOnFinishFullExpr(PrevEUB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
10048 SemaRef in checkOpenMPLoop()
10051 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()) in checkOpenMPLoop()
10054 SemaRef.ActOnFinishFullExpr(BoundPrevUB, /*DiscardedValue*/ false) in checkOpenMPLoop()
10058 SemaRef.BuildBinOp(CurScope, CondLoc, UseStrictCompare ? BO_LT : BO_LE, in checkOpenMPLoop()
10094 ExprResult Prod = SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get(); in checkOpenMPLoop()
10096 Prod = SemaRef.BuildBinOp(CurScope, UpdLoc, BO_Mul, Prod.get(), in checkOpenMPLoop()
10104 SemaRef.BuildBinOp(CurScope, UpdLoc, BO_Div, Acc.get(), Prod.get()); in checkOpenMPLoop()
10117 Prod = SemaRef.BuildBinOp(CurScope, UpdLoc, BO_Mul, Iter.get(), in checkOpenMPLoop()
10121 Acc = SemaRef.BuildBinOp(CurScope, UpdLoc, BO_Sub, Acc.get(), Prod.get()); in checkOpenMPLoop()
10126 SemaRef, VD, IS.CounterVar->getType(), IS.CounterVar->getExprLoc(), in checkOpenMPLoop()
10129 buildCounterInit(SemaRef, CurScope, UpdLoc, CounterVar, in checkOpenMPLoop()
10136 SemaRef, CurScope, UpdLoc, CounterVar, IS.CounterInit, Iter, in checkOpenMPLoop()
10145 buildCounterUpdate(SemaRef, CurScope, UpdLoc, CounterVar, in checkOpenMPLoop()
10183 Built.CalcLastIteration = SemaRef in checkOpenMPLoop()
11377 Sema &SemaRef; member in __anon7e4ded5b4111::OpenMPAtomicUpdateChecker
11398 OpenMPAtomicUpdateChecker(Sema &SemaRef) in OpenMPAtomicUpdateChecker() argument
11399 : SemaRef(SemaRef), X(nullptr), E(nullptr), UpdateExpr(nullptr), in OpenMPAtomicUpdateChecker()
11450 X->IgnoreParenImpCasts()->Profile(XId, SemaRef.getASTContext(), in checkBinaryOperation()
11452 LHS->IgnoreParenImpCasts()->Profile(LHSId, SemaRef.getASTContext(), in checkBinaryOperation()
11454 RHS->IgnoreParenImpCasts()->Profile(RHSId, SemaRef.getASTContext(), in checkBinaryOperation()
11489 SemaRef.Diag(ErrorLoc, DiagId) << ErrorRange; in checkBinaryOperation()
11490 SemaRef.Diag(NoteLoc, NoteId) << ErrorFound << NoteRange; in checkBinaryOperation()
11493 if (SemaRef.CurContext->isDependentContext()) in checkBinaryOperation()
11537 E = SemaRef.ActOnIntegerConstant(OpLoc, /*uint64_t Val=*/1).get(); in checkStatement()
11562 SemaRef.Diag(ErrorLoc, DiagId) << ErrorRange; in checkStatement()
11563 SemaRef.Diag(NoteLoc, NoteId) << ErrorFound << NoteRange; in checkStatement()
11566 if (SemaRef.CurContext->isDependentContext()) in checkStatement()
11572 auto *OVEX = new (SemaRef.getASTContext()) in checkStatement()
11574 auto *OVEExpr = new (SemaRef.getASTContext()) in checkStatement()
11577 SemaRef.CreateBuiltinBinOp(OpLoc, Op, IsXLHSInRHSPart ? OVEX : OVEExpr, in checkStatement()
11581 Update = SemaRef.PerformImplicitConversion(Update.get(), X->getType(), in checkStatement()
16356 isNonNegativeIntegerValue(Expr *&ValExpr, Sema &SemaRef, OpenMPClauseKind CKind, in isNonNegativeIntegerValue() argument
16365 SemaRef.PerformOpenMPImplicitIntegerConversion(Loc, ValExpr); in isNonNegativeIntegerValue()
16372 ValExpr->getIntegerConstantExpr(SemaRef.Context)) { in isNonNegativeIntegerValue()
16376 SemaRef.Diag(Loc, diag::err_omp_negative_expression_in_clause) in isNonNegativeIntegerValue()
16385 getOpenMPCaptureRegionForClause(DKind, CKind, SemaRef.LangOpts.OpenMP); in isNonNegativeIntegerValue()
16387 !SemaRef.CurContext->isDependentContext()) { in isNonNegativeIntegerValue()
16388 ValExpr = SemaRef.MakeFullExpr(ValExpr).get(); in isNonNegativeIntegerValue()
16390 ValExpr = tryBuildCapture(SemaRef, ValExpr, Captures).get(); in isNonNegativeIntegerValue()
16391 *HelperValStmt = buildPreInits(SemaRef.Context, Captures); in isNonNegativeIntegerValue()
17565 static bool isValidInteropVariable(Sema &SemaRef, Expr *InteropVarExpr, in isValidInteropVariable() argument
17572 getPrivateItem(SemaRef, RefExpr, ELoc, ERange, in isValidInteropVariable()
17586 LookupResult Result(SemaRef, &SemaRef.Context.Idents.get("omp_interop_t"), in isValidInteropVariable()
17588 if (SemaRef.LookupName(Result, SemaRef.getCurScope())) { in isValidInteropVariable()
17600 SemaRef.Diag(VarLoc, diag::err_omp_implied_type_not_found) in isValidInteropVariable()
17606 if (!SemaRef.Context.hasSameType(InteropType, VarType)) { in isValidInteropVariable()
17607 SemaRef.Diag(VarLoc, diag::err_omp_interop_variable_wrong_type); in isValidInteropVariable()
17614 isConstNotMutableType(SemaRef, InteropVarExpr->getType())) { in isValidInteropVariable()
17615 SemaRef.Diag(VarLoc, diag::err_omp_interop_variable_expected) in isValidInteropVariable()
18676 TransformExprToCaptures(Sema &SemaRef, ValueDecl *FieldDecl) in TransformExprToCaptures() argument
18677 : BaseTransform(SemaRef), Field(FieldDecl), CapturedExpr(nullptr) {} in TransformExprToCaptures()
18682 CapturedExpr = buildCapture(SemaRef, Field, E, /*WithInit=*/false); in TransformMemberExpr()
18703 static NamedDecl *findAcceptableDecl(Sema &SemaRef, NamedDecl *D) { in findAcceptableDecl() argument
18704 assert(!LookupResult::isVisible(SemaRef, D) && "not in slow case"); in findAcceptableDecl()
18712 if (LookupResult::isVisible(SemaRef, ND)) in findAcceptableDecl()
18720 argumentDependentLookup(Sema &SemaRef, const DeclarationNameInfo &Id, in argumentDependentLookup() argument
18728 SemaRef.FindAssociatedClassesAndNamespaces(Loc, &OVE, AssociatedNamespaces, in argumentDependentLookup()
18764 if (!SemaRef.isVisible(D)) { in argumentDependentLookup()
18765 D = findAcceptableDecl(SemaRef, D); in argumentDependentLookup()
18778 buildDeclareReductionRef(Sema &SemaRef, SourceLocation Loc, SourceRange Range, in buildDeclareReductionRef() argument
18786 LookupResult Lookup(SemaRef, ReductionId, Sema::LookupOMPReductionName); in buildDeclareReductionRef()
18788 while (S && SemaRef.LookupParsedName(Lookup, S, &ReductionIdScopeSpec)) { in buildDeclareReductionRef()
18811 if (SemaRef.CurContext->isDependentContext() || Ty->isDependentType() || in buildDeclareReductionRef()
18829 SemaRef.Context, /*NamingClass=*/nullptr, in buildDeclareReductionRef()
18830 ReductionIdScopeSpec.getWithLocInContext(SemaRef.Context), ReductionId, in buildDeclareReductionRef()
18846 LookupResult Lookup(SemaRef, ReductionId, Sema::LookupOMPReductionName); in buildDeclareReductionRef()
18851 if (SemaRef.isCompleteType(Loc, Ty) || TyRec->isBeingDefined() || in buildDeclareReductionRef()
18854 SemaRef.LookupQualifiedName(Lookup, TyRec->getDecl()); in buildDeclareReductionRef()
18862 if (SemaRef.getLangOpts().CPlusPlus) in buildDeclareReductionRef()
18863 argumentDependentLookup(SemaRef, ReductionId, Loc, Ty, Lookups); in buildDeclareReductionRef()
18865 Lookups, [&SemaRef, Ty](ValueDecl *D) -> ValueDecl * { in buildDeclareReductionRef()
18867 SemaRef.Context.hasSameType(D->getType(), Ty)) in buildDeclareReductionRef()
18871 return SemaRef.BuildDeclRefExpr(VD, VD->getType().getNonReferenceType(), in buildDeclareReductionRef()
18873 if (SemaRef.getLangOpts().CPlusPlus) { in buildDeclareReductionRef()
18875 Lookups, [&SemaRef, Ty, Loc](ValueDecl *D) -> ValueDecl * { in buildDeclareReductionRef()
18877 SemaRef.IsDerivedFrom(Loc, Ty, D->getType()) && in buildDeclareReductionRef()
18884 if (SemaRef.IsDerivedFrom(Loc, Ty, VD->getType(), Paths)) { in buildDeclareReductionRef()
18885 if (!Paths.isAmbiguous(SemaRef.Context.getCanonicalType( in buildDeclareReductionRef()
18887 if (SemaRef.CheckBaseClassAccess( in buildDeclareReductionRef()
18890 SemaRef.BuildBasePathArray(Paths, BasePath); in buildDeclareReductionRef()
18891 return SemaRef.BuildDeclRefExpr( in buildDeclareReductionRef()
18899 SemaRef.Diag(Loc, diag::err_omp_not_resolved_reduction_identifier) in buildDeclareReductionRef()
20053 Expr *NumIterations, Sema &SemaRef, in FinishOpenMPLinearClause() argument
20064 Step = SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get(); in FinishOpenMPLinearClause()
20075 auto Res = getPrivateItem(SemaRef, SimpleRefExpr, ELoc, ERange); in FinishOpenMPLinearClause()
20089 SemaRef.Diag(ELoc, in FinishOpenMPLinearClause()
20105 buildDeclRefExpr(SemaRef, cast<VarDecl>(DE->getDecl()), in FinishOpenMPLinearClause()
20113 SemaRef, S, RefExpr->getExprLoc(), *CurPrivate, InitExpr, IV, Step, in FinishOpenMPLinearClause()
20117 Update = SemaRef.ActOnFinishFullExpr(Update.get(), DE->getBeginLoc(), in FinishOpenMPLinearClause()
20123 Final = SemaRef.BuildBinOp( in FinishOpenMPLinearClause()
20125 SemaRef.DefaultLvalueConversion(*CurPrivate).get()); in FinishOpenMPLinearClause()
20128 Final = SemaRef.ActOnFinishFullExpr(Final.get(), DE->getBeginLoc(), in FinishOpenMPLinearClause()
20812 static bool checkTypeMappable(SourceLocation SL, SourceRange SR, Sema &SemaRef, in checkTypeMappable() argument
20815 if (SemaRef.RequireCompleteType(SL, QTy, diag::err_incomplete_type)) in checkTypeMappable()
20817 if (FullCheck && !SemaRef.CurContext->isDependentContext() && in checkTypeMappable()
20818 !QTy.isTriviallyCopyableType(SemaRef.Context)) in checkTypeMappable()
20819 SemaRef.Diag(SL, diag::warn_omp_non_trivial_type_mapped) << QTy << SR; in checkTypeMappable()
20826 static bool checkArrayExpressionDoesNotReferToWholeSize(Sema &SemaRef, in checkArrayExpressionDoesNotReferToWholeSize() argument
20850 if (!LowerBound->EvaluateAsInt(Result, SemaRef.getASTContext())) in checkArrayExpressionDoesNotReferToWholeSize()
20874 if (!Length->EvaluateAsInt(Result, SemaRef.getASTContext())) in checkArrayExpressionDoesNotReferToWholeSize()
20884 static bool checkArrayExpressionDoesNotReferToUnitySize(Sema &SemaRef, in checkArrayExpressionDoesNotReferToUnitySize() argument
20910 if (!Length->EvaluateAsInt(Result, SemaRef.getASTContext())) in checkArrayExpressionDoesNotReferToUnitySize()
20954 Sema &SemaRef; member in __anon7e4ded5b5f11::MapBaseChecker
20969 if (SemaRef.getLangOpts().OpenMP < 50) { in emitErrorMsg()
20970 SemaRef.Diag(ELoc, in emitErrorMsg()
20974 SemaRef.Diag(ELoc, diag::err_omp_non_lvalue_in_map_or_motion_clauses) in emitErrorMsg()
21006 SemaRef.Diag(ELoc, diag::err_omp_expected_access_to_data_field) in VisitMemberExpr()
21022 SemaRef.Diag(ELoc, diag::err_omp_bit_fields_forbidden_in_clause) in VisitMemberExpr()
21042 SemaRef.Diag(ELoc, diag::err_omp_union_type_not_allowed) in VisitMemberExpr()
21069 SemaRef.Diag(ELoc, diag::err_omp_expected_base_var_name) in VisitArraySubscriptExpr()
21079 if (checkArrayExpressionDoesNotReferToWholeSize(SemaRef, AE, E->getType())) in VisitArraySubscriptExpr()
21085 AE->getIdx()->EvaluateAsInt(Result, SemaRef.getASTContext()) && in VisitArraySubscriptExpr()
21087 SemaRef.Diag(AE->getIdx()->getExprLoc(), in VisitArraySubscriptExpr()
21089 SemaRef.Diag(AE->getIdx()->getExprLoc(), in VisitArraySubscriptExpr()
21105 assert(!(SemaRef.getLangOpts().OpenMP < 50 && NoDiagnose) && in VisitOMPArraySectionExpr()
21120 SemaRef.Diag(ELoc, diag::err_omp_expected_base_var_name) in VisitOMPArraySectionExpr()
21126 checkArrayExpressionDoesNotReferToWholeSize(SemaRef, OASE, CurType); in VisitOMPArraySectionExpr()
21128 checkArrayExpressionDoesNotReferToUnitySize(SemaRef, OASE, CurType); in VisitOMPArraySectionExpr()
21140 SemaRef.getLangOpts().OpenMP >= 50) { in VisitOMPArraySectionExpr()
21142 SemaRef.Diag(ELoc, diag::err_omp_section_length_undefined) in VisitOMPArraySectionExpr()
21151 SemaRef.Diag(ELoc, in VisitOMPArraySectionExpr()
21164 OASE->getLength()->EvaluateAsInt(ResultR, SemaRef.getASTContext()) && in VisitOMPArraySectionExpr()
21166 SemaRef.Diag(OASE->getLength()->getExprLoc(), in VisitOMPArraySectionExpr()
21168 SemaRef.Diag(OASE->getLength()->getExprLoc(), in VisitOMPArraySectionExpr()
21173 SemaRef.getASTContext()) && in VisitOMPArraySectionExpr()
21175 SemaRef.Diag(OASE->getLowerBound()->getExprLoc(), in VisitOMPArraySectionExpr()
21177 SemaRef.Diag(OASE->getLowerBound()->getExprLoc(), in VisitOMPArraySectionExpr()
21198 if (SemaRef.getLangOpts().OpenMP < 50 || !UO->isLValue() || in VisitUnaryOperator()
21210 if (SemaRef.getLangOpts().OpenMP < 50 || !BO->getType()->isPointerType()) { in VisitBinaryOperator()
21254 Sema &SemaRef, OpenMPClauseKind CKind, OpenMPDirectiveKind DKind, in MapBaseChecker() argument
21257 : SemaRef(SemaRef), CKind(CKind), DKind(DKind), Components(Components), in MapBaseChecker()
21267 Sema &SemaRef, Expr *E, in checkMapClauseExpressionBase() argument
21272 MapBaseChecker Checker(SemaRef, CKind, DKind, CurComponents, NoDiagnose, ELoc, in checkMapClauseExpressionBase()
21276 if (SemaRef.getLangOpts().OpenMP >= 50 && !CurComponents.empty() && in checkMapClauseExpressionBase()
21287 SemaRef.Diag(ELoc, diag::err_array_section_does_not_specify_length) in checkMapClauseExpressionBase()
21299 Sema &SemaRef, DSAStackTy *DSAS, const ValueDecl *VD, const Expr *E, in checkMapConflicts() argument
21321 [&IsEnclosedByDataEnvironmentExpr, &SemaRef, VD, CurrentRegionOnly, ELoc, in checkMapConflicts()
21326 if (CKind == Kind && SemaRef.LangOpts.OpenMP >= 50) in checkMapConflicts()
21357 SemaRef.Diag(CI->getAssociatedExpression()->getExprLoc(), in checkMapConflicts()
21360 SemaRef.Diag(SI->getAssociatedExpression()->getExprLoc(), in checkMapConflicts()
21394 SemaRef, SI->getAssociatedExpression(), Type)) in checkMapConflicts()
21407 SemaRef.Diag(ELoc, diag::err_omp_map_shared_storage) << ERange; in checkMapConflicts()
21410 SemaRef.Diag(ELoc, diag::err_omp_once_referenced_in_target_update) in checkMapConflicts()
21413 SemaRef.Diag(RE->getExprLoc(), diag::note_used_here) in checkMapConflicts()
21446 SemaRef.Diag( in checkMapConflicts()
21450 SemaRef.Diag(RE->getExprLoc(), diag::note_used_here) in checkMapConflicts()
21459 SemaRef.Diag(DerivedLoc, diag::err_omp_same_pointer_dereferenced) in checkMapConflicts()
21461 SemaRef.Diag(RE->getExprLoc(), diag::note_used_here) in checkMapConflicts()
21494 SemaRef.Diag(ELoc, diag::err_omp_map_shared_storage) << ERange; in checkMapConflicts()
21497 SemaRef.Diag(ELoc, diag::err_omp_once_referenced_in_target_update) in checkMapConflicts()
21500 SemaRef.Diag(RE->getExprLoc(), diag::note_used_here) in checkMapConflicts()
21533 SemaRef.Diag(ELoc, in checkMapConflicts()
21536 SemaRef.Diag(EnclosingExpr->getExprLoc(), diag::note_used_here) in checkMapConflicts()
21546 static ExprResult buildUserDefinedMapperRef(Sema &SemaRef, Scope *S, in buildUserDefinedMapperRef() argument
21560 LookupResult Lookup(SemaRef, MapperId, Sema::LookupOMPMapperName); in buildUserDefinedMapperRef()
21563 while (S && SemaRef.LookupParsedName(Lookup, S, &MapperIdScopeSpec)) { in buildUserDefinedMapperRef()
21584 if (SemaRef.CurContext->isDependentContext() || Type->isDependentType() || in buildUserDefinedMapperRef()
21600 SemaRef.Context, /*NamingClass=*/nullptr, in buildUserDefinedMapperRef()
21601 MapperIdScopeSpec.getWithLocInContext(SemaRef.Context), MapperId, in buildUserDefinedMapperRef()
21609 SemaRef.Diag(Loc, diag::err_omp_mapper_wrong_type); in buildUserDefinedMapperRef()
21613 if (SemaRef.getLangOpts().CPlusPlus && !MapperIdScopeSpec.isSet()) in buildUserDefinedMapperRef()
21614 argumentDependentLookup(SemaRef, MapperId, Loc, Type, Lookups); in buildUserDefinedMapperRef()
21617 Lookups, [&SemaRef, Type](ValueDecl *D) -> ValueDecl * { in buildUserDefinedMapperRef()
21619 SemaRef.Context.hasSameType(D->getType(), Type)) in buildUserDefinedMapperRef()
21623 return SemaRef.BuildDeclRefExpr(VD, Type, VK_LValue, Loc); in buildUserDefinedMapperRef()
21627 Lookups, [&SemaRef, Type, Loc](ValueDecl *D) -> ValueDecl * { in buildUserDefinedMapperRef()
21629 SemaRef.IsDerivedFrom(Loc, Type, D->getType()) && in buildUserDefinedMapperRef()
21636 if (SemaRef.IsDerivedFrom(Loc, Type, VD->getType(), Paths)) { in buildUserDefinedMapperRef()
21637 if (!Paths.isAmbiguous(SemaRef.Context.getCanonicalType( in buildUserDefinedMapperRef()
21639 if (SemaRef.CheckBaseClassAccess( in buildUserDefinedMapperRef()
21642 return SemaRef.BuildDeclRefExpr(VD, Type, VK_LValue, Loc); in buildUserDefinedMapperRef()
21649 SemaRef.Diag(Loc, diag::err_omp_invalid_mapper) in buildUserDefinedMapperRef()
21687 Sema &SemaRef, DSAStackTy *DSAS, OpenMPClauseKind CKind, in checkMappableExpressionList() argument
21703 auto &DeclNames = SemaRef.getASTContext().DeclarationNames; in checkMappableExpressionList()
21705 &SemaRef.getASTContext().Idents.get("default"))); in checkMappableExpressionList()
21745 SemaRef, DSAS->getCurScope(), MapperIdScopeSpec, MapperId, in checkMappableExpressionList()
21759 if (SemaRef.getLangOpts().OpenMP < 50) { in checkMappableExpressionList()
21760 SemaRef.Diag( in checkMappableExpressionList()
21764 SemaRef.Diag(ELoc, diag::err_omp_non_lvalue_in_map_or_motion_clauses) in checkMappableExpressionList()
21776 checkMapClauseExpressionBase(SemaRef, SimpleExpr, CurComponents, CKind, in checkMappableExpressionList()
21789 SemaRef, DSAS->getCurScope(), MapperIdScopeSpec, MapperId, in checkMappableExpressionList()
21826 SemaRef.Diag(ELoc, diag::err_omp_threadprivate_in_clause) in checkMappableExpressionList()
21828 reportOriginalDsa(SemaRef, DSAS, VD, DVar); in checkMappableExpressionList()
21840 if (checkMapConflicts(SemaRef, DSAS, CurDeclaration, SimpleExpr, in checkMappableExpressionList()
21844 (SemaRef.getLangOpts().OpenMP <= 45 || StartLoc.isValid()) && in checkMappableExpressionList()
21845 checkMapConflicts(SemaRef, DSAS, CurDeclaration, SimpleExpr, in checkMappableExpressionList()
21884 if (!checkTypeMappable(VE->getExprLoc(), VE->getSourceRange(), SemaRef, in checkMappableExpressionList()
21897 SemaRef.getLangOpts().OpenMP >= 52)) { in checkMappableExpressionList()
21898 SemaRef.Diag(StartLoc, diag::err_omp_invalid_map_type_for_directive) in checkMappableExpressionList()
21912 MapType == OMPC_MAP_delete || SemaRef.getLangOpts().OpenMP >= 52)) { in checkMappableExpressionList()
21913 SemaRef.Diag(StartLoc, diag::err_omp_invalid_map_type_for_directive) in checkMappableExpressionList()
21927 SemaRef.Diag(StartLoc, in checkMappableExpressionList()
21943 SemaRef.Diag(StartLoc, diag::err_omp_invalid_map_type_for_directive) in checkMappableExpressionList()
21958 if (VD && ((SemaRef.LangOpts.OpenMP <= 45 && in checkMappableExpressionList()
21963 SemaRef.Diag(ELoc, diag::err_omp_variable_in_given_clause_and_dsa) in checkMappableExpressionList()
21967 reportOriginalDsa(SemaRef, DSAS, CurDeclaration, DVar); in checkMappableExpressionList()
21975 SemaRef, DSAS->getCurScope(), MapperIdScopeSpec, MapperId, in checkMappableExpressionList()
22948 Sema &SemaRef, Decl *D) { in checkDeclInTargetContext() argument
22954 if (SemaRef.LangOpts.OpenMP >= 50 && in checkDeclInTargetContext()
22955 (SemaRef.getCurLambda(/*IgnoreNonLambdaCapturingScope=*/true) || in checkDeclInTargetContext()
22956 SemaRef.getCurBlock() || SemaRef.getCurCapturedRegion()) && in checkDeclInTargetContext()
22965 SemaRef.Diag(VD->getLocation(), in checkDeclInTargetContext()
22967 SemaRef.Diag(SL, diag::note_var_explicitly_captured_here) in checkDeclInTargetContext()
22974 SemaRef.Diag(VD->getLocation(), diag::warn_omp_not_in_target_context); in checkDeclInTargetContext()
22975 SemaRef.Diag(SL, diag::note_used_here) << SR; in checkDeclInTargetContext()
22979 Sema &SemaRef, DSAStackTy *Stack, in checkValueDeclInTarget() argument
22982 checkTypeMappable(SL, SR, SemaRef, Stack, VD->getType(), in checkValueDeclInTarget()