• Home
  • Raw
  • Download

Lines Matching refs:SemaRef

49     Sema &SemaRef, Expr *E,
211 Sema &SemaRef; member in __anon0bb9e2bb0111::DSAStackTy
314 explicit DSAStackTy(Sema &S) : SemaRef(S) {} in DSAStackTy()
444 const FunctionScopeInfo *CurFnScope = SemaRef.getCurFunction(); in pushFunction()
457 for (const FunctionScopeInfo *FSI : llvm::reverse(SemaRef.FunctionScopes)) { in popFunction()
653 SemaRef.Diag(CNew->getBeginLoc(), in hasDuplicateRequiresClause()
656 SemaRef.Diag(CPrev->getBeginLoc(), in hasDuplicateRequiresClause()
1394 static VarDecl *buildVarDecl(Sema &SemaRef, SourceLocation Loc, QualType Type, in buildVarDecl() argument
1397 DeclContext *DC = SemaRef.CurContext; in buildVarDecl()
1398 IdentifierInfo *II = &SemaRef.PP.getIdentifierTable().get(Name); in buildVarDecl()
1399 TypeSourceInfo *TInfo = SemaRef.Context.getTrivialTypeSourceInfo(Type, Loc); in buildVarDecl()
1401 VarDecl::Create(SemaRef.Context, DC, Loc, Loc, II, Type, TInfo, SC_None); in buildVarDecl()
1410 OMPReferencedVarAttr::CreateImplicit(SemaRef.Context, OrigRef)); in buildVarDecl()
1444 VarDecl *VD = buildVarDecl(SemaRef, SR.getBegin(), in addTaskgroupReductionData()
1445 SemaRef.Context.VoidPtrTy, ".task_red."); in addTaskgroupReductionData()
1447 buildDeclRefExpr(SemaRef, VD, SemaRef.Context.VoidPtrTy, SR.getBegin()); in addTaskgroupReductionData()
1470 VarDecl *VD = buildVarDecl(SemaRef, SR.getBegin(), in addTaskgroupReductionData()
1471 SemaRef.Context.VoidPtrTy, ".task_red."); in addTaskgroupReductionData()
1473 buildDeclRefExpr(SemaRef, VD, SemaRef.Context.VoidPtrTy, SR.getBegin()); in addTaskgroupReductionData()
1552 static bool isConstNotMutableType(Sema &SemaRef, QualType Type, in isConstNotMutableType() argument
1555 ASTContext &Context = SemaRef.getASTContext(); in isConstNotMutableType()
1559 const CXXRecordDecl *RD = AcceptIfMutable && SemaRef.getLangOpts().CPlusPlus in isConstNotMutableType()
1567 return IsConstant && !(SemaRef.getLangOpts().CPlusPlus && RD && in isConstNotMutableType()
1571 static bool rejectConstNotMutableType(Sema &SemaRef, const ValueDecl *D, in rejectConstNotMutableType() argument
1576 ASTContext &Context = SemaRef.getASTContext(); in rejectConstNotMutableType()
1578 if (isConstNotMutableType(SemaRef, Type, AcceptIfMutable, &IsClassType)) { in rejectConstNotMutableType()
1583 SemaRef.Diag(ELoc, Diag) << getOpenMPClauseName(CKind); in rejectConstNotMutableType()
1588 SemaRef.Diag(D->getLocation(), in rejectConstNotMutableType()
1612 SemaRef, VD, D->getType().getNonReferenceType(), in getTopDSA()
1623 SemaRef.getLangOpts().OpenMPUseTLS && in getTopDSA()
1624 SemaRef.getASTContext().getTargetInfo().isTLSSupported())) || in getTopDSA()
1628 SemaRef, VD, D->getType().getNonReferenceType(), D->getLocation()); in getTopDSA()
1633 if (SemaRef.getLangOpts().OpenMPCUDAMode && VD && in getTopDSA()
1646 buildDeclRefExpr(SemaRef, VD, D->getType().getNonReferenceType(), in getTopDSA()
1661 if (!SemaRef.isOpenMPCapturedByRef( in getTopDSA()
1665 buildDeclRefExpr(SemaRef, VD, D->getType().getNonReferenceType(), in getTopDSA()
1713 if (SemaRef.LangOpts.OpenMP <= 31) { in getTopDSA()
1718 if (isConstNotMutableType(SemaRef, D->getType())) { in getTopDSA()
2592 static void reportOriginalDsa(Sema &SemaRef, const DSAStackTy *Stack,
2724 Expr *NumIterations, Sema &SemaRef,
2731 Sema &SemaRef; member in __anon0bb9e2bb1811::VarDeclFilterCCC
2734 explicit VarDeclFilterCCC(Sema &S) : SemaRef(S) {} in VarDeclFilterCCC()
2739 SemaRef.isDeclInScope(ND, SemaRef.getCurLexicalContext(), in ValidateCandidate()
2740 SemaRef.getCurScope()); in ValidateCandidate()
2753 Sema &SemaRef; member in __anon0bb9e2bb1811::VarOrFuncDeclFilterCCC
2756 explicit VarOrFuncDeclFilterCCC(Sema &S) : SemaRef(S) {} in VarOrFuncDeclFilterCCC()
2761 return SemaRef.isDeclInScope(ND, SemaRef.getCurLexicalContext(), in ValidateCandidate()
2762 SemaRef.getCurScope()); in ValidateCandidate()
2914 Sema &SemaRef; member in __anon0bb9e2bb1911::LocalVarRefChecker
2920 SemaRef.Diag(E->getBeginLoc(), in VisitDeclRefExpr()
2923 SemaRef.Diag(VD->getLocation(), diag::note_defined_here) in VisitDeclRefExpr()
2937 explicit LocalVarRefChecker(Sema &SemaRef) : SemaRef(SemaRef) {} in LocalVarRefChecker() argument
3235 static void reportOriginalDsa(Sema &SemaRef, const DSAStackTy *Stack, in reportOriginalDsa() argument
3240 SemaRef.Diag(DVar.RefExpr->getExprLoc(), diag::note_omp_explicit_dsa) in reportOriginalDsa()
3276 else if (D->getType().isConstant(SemaRef.getASTContext())) in reportOriginalDsa()
3283 SemaRef.Diag(ReportLoc, diag::note_omp_predetermined_dsa) in reportOriginalDsa()
3287 SemaRef.Diag(DVar.ImplicitDSALoc, diag::note_omp_implicit_dsa) in reportOriginalDsa()
3331 Sema &SemaRef; member in __anon0bb9e2bb1b11::DSAAttrChecker
3449 getVariableCategoryFromDecl(SemaRef.getLangOpts(), VD); in VisitDeclRefExpr()
3450 if (SemaRef.getLangOpts().OpenMP >= 50) { in VisitDeclRefExpr()
3534 SemaRef.Diag(ELoc, diag::err_omp_reduction_in_task); in VisitDeclRefExpr()
3535 reportOriginalDsa(SemaRef, Stack, VD, DVar); in VisitDeclRefExpr()
3622 SemaRef.Diag(ELoc, diag::err_omp_reduction_in_task); in VisitMemberExpr()
3623 reportOriginalDsa(SemaRef, Stack, FD, DVar); in VisitMemberExpr()
3642 if (!checkMapClauseExpressionBase(SemaRef, E, CurComponents, OMPC_map, in VisitMemberExpr()
3728 SemaRef, VD, VD->getType().getNonLValueExprType(SemaRef.Context), in visitSubCaptures()
3744 DSAAttrChecker(DSAStackTy *S, Sema &SemaRef, CapturedStmt *CS) in DSAAttrChecker() argument
3745 : Stack(S), SemaRef(SemaRef), ErrorFound(false), CS(CS) { in DSAAttrChecker()
4489 static bool checkCancelRegion(Sema &SemaRef, OpenMPDirectiveKind CurrentRegion, in checkCancelRegion() argument
4500 SemaRef.Diag(StartLoc, diag::err_omp_wrong_cancel_region) in checkCancelRegion()
4505 static bool checkNestingOfRegions(Sema &SemaRef, const DSAStackTy *Stack, in checkNestingOfRegions() argument
4525 ((SemaRef.LangOpts.OpenMP <= 45 && CurrentRegion != OMPD_ordered) || in checkNestingOfRegions()
4526 (SemaRef.LangOpts.OpenMP >= 50 && CurrentRegion != OMPD_ordered && in checkNestingOfRegions()
4541 SemaRef.Diag(StartLoc, (CurrentRegion != OMPD_simd) in checkNestingOfRegions()
4544 << (SemaRef.LangOpts.OpenMP >= 50 ? 1 : 0); in checkNestingOfRegions()
4550 SemaRef.Diag(StartLoc, diag::err_omp_prohibited_region_atomic); in checkNestingOfRegions()
4560 SemaRef.Diag(StartLoc, diag::err_omp_orphaned_section_directive) in checkNestingOfRegions()
4600 (SemaRef.getLangOpts().OpenMP >= 50 && in checkNestingOfRegions()
4632 SemaRef.Diag(StartLoc, in checkNestingOfRegions()
4636 SemaRef.Diag(PreviousCriticalLoc, in checkNestingOfRegions()
4682 (SemaRef.LangOpts.OpenMP <= 45 && ParentRegion != OMPD_target) || in checkNestingOfRegions()
4683 (SemaRef.LangOpts.OpenMP >= 50 && ParentRegion != OMPD_unknown && in checkNestingOfRegions()
4692 SemaRef.LangOpts.OpenMP < 50 || in checkNestingOfRegions()
4741 SemaRef.Diag(StartLoc, diag::err_omp_orphaned_device_directive) in checkNestingOfRegions()
4744 SemaRef.Diag(StartLoc, diag::err_omp_prohibited_region) in checkNestingOfRegions()
6445 Sema &SemaRef; member in __anon0bb9e2bb3211::OpenMPIterationSpaceChecker
6494 OpenMPIterationSpaceChecker(Sema &SemaRef, DSAStackTy &Stack, in OpenMPIterationSpaceChecker() argument
6496 : SemaRef(SemaRef), Stack(Stack), DefaultLoc(DefaultLoc), in OpenMPIterationSpaceChecker()
6636 ExprResult Val = SemaRef.PerformOpenMPImplicitIntegerConversion( in setStep()
6654 NewStep->getIntegerConstantExpr(SemaRef.Context); in setStep()
6669 SemaRef.Diag(NewStep->getExprLoc(), in setStep()
6672 SemaRef.Diag(ConditionLoc, in setStep()
6679 SemaRef.CreateBuiltinUnaryOp(NewStep->getExprLoc(), UO_Minus, NewStep) in setStep()
6695 Sema &SemaRef; member in __anon0bb9e2bb3211::__anon0bb9e2bb3311::LoopCounterRefChecker
6704 SemaRef.Diag(E->getExprLoc(), diag::err_omp_stmt_depends_on_loop_counter) in checkDecl()
6715 VD->getNameForDiagnostic(OS, SemaRef.getPrintingPolicy(), in checkDecl()
6717 SemaRef.Diag(E->getExprLoc(), in checkDecl()
6720 SemaRef.Diag(VD->getLocation(), diag::note_previous_decl) << VD; in checkDecl()
6730 DepDecl->getNameForDiagnostic(OS, SemaRef.getPrintingPolicy(), in checkDecl()
6732 SemaRef.Diag(E->getExprLoc(), in checkDecl()
6765 explicit LoopCounterRefChecker(Sema &SemaRef, DSAStackTy &Stack, in LoopCounterRefChecker() argument
6768 : SemaRef(SemaRef), Stack(Stack), CurLCDecl(CurLCDecl), in LoopCounterRefChecker()
6785 LoopCounterRefChecker LoopStmtChecker(SemaRef, Stack, LCDecl, IsInitializer, in doesDependOnLoopCounter()
6805 SemaRef.Diag(DefaultLoc, diag::err_omp_loop_not_canonical_init); in checkAndSetInit()
6839 SemaRef.Diag(S->getBeginLoc(), in checkAndSetInit()
6844 buildDeclRefExpr(SemaRef, Var, in checkAndSetInit()
6870 if (dependent() || SemaRef.CurContext->isDependentContext()) in checkAndSetInit()
6873 SemaRef.Diag(S->getBeginLoc(), diag::err_omp_loop_not_canonical_init) in checkAndSetInit()
6908 bool IneqCondIsCanonical = SemaRef.getLangOpts().OpenMP >= 50; in checkAndSetCond()
6910 SemaRef.Diag(DefaultLoc, diag::err_omp_loop_not_canonical_cond) in checkAndSetCond()
6964 if (dependent() || SemaRef.CurContext->isDependentContext()) in checkAndSetCond()
6966 SemaRef.Diag(CondLoc, diag::err_omp_loop_not_canonical_cond) in checkAndSetCond()
6995 if (dependent() || SemaRef.CurContext->isDependentContext()) in checkAndSetIncRHS()
6997 SemaRef.Diag(RHS->getBeginLoc(), diag::err_omp_loop_not_canonical_incr) in checkAndSetIncRHS()
7017 SemaRef.Diag(DefaultLoc, diag::err_omp_loop_not_canonical_incr) << LCDecl; in checkAndSetInc()
7029 return setStep(SemaRef in checkAndSetInc()
7053 return setStep(SemaRef in checkAndSetInc()
7073 if (dependent() || SemaRef.CurContext->isDependentContext()) in checkAndSetInc()
7075 SemaRef.Diag(S->getBeginLoc(), diag::err_omp_loop_not_canonical_incr) in checkAndSetInc()
7081 tryBuildCapture(Sema &SemaRef, Expr *Capture, in tryBuildCapture() argument
7083 if (SemaRef.CurContext->isDependentContext() || Capture->containsErrors()) in tryBuildCapture()
7085 if (Capture->isEvaluatable(SemaRef.Context, Expr::SE_AllowSideEffects)) in tryBuildCapture()
7086 return SemaRef.PerformImplicitConversion( in tryBuildCapture()
7091 return buildCapture(SemaRef, Capture, I->second); in tryBuildCapture()
7093 ExprResult Res = buildCapture(SemaRef, Capture, Ref); in tryBuildCapture()
7101 calculateNumIters(Sema &SemaRef, Scope *S, SourceLocation DefaultLoc, in calculateNumIters() argument
7105 ExprResult NewStep = tryBuildCapture(SemaRef, Step, Captures); in calculateNumIters()
7110 if (Optional<llvm::APSInt> Res = Lower->getIntegerConstantExpr(SemaRef.Context)) { in calculateNumIters()
7114 if (Optional<llvm::APSInt> Res = Step->getIntegerConstantExpr(SemaRef.Context)) { in calculateNumIters()
7152 if (Optional<llvm::APSInt> Res = Upper->getIntegerConstantExpr(SemaRef.Context)) { in calculateNumIters()
7175 uint64_t LowerSize = SemaRef.Context.getTypeSize(LowerTy); in calculateNumIters()
7176 uint64_t UpperSize = SemaRef.Context.getTypeSize(UpperTy); in calculateNumIters()
7179 QualType CastType = SemaRef.Context.getIntTypeForBitwidth( in calculateNumIters()
7182 SemaRef in calculateNumIters()
7184 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Upper).get(), in calculateNumIters()
7187 Lower = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Lower).get(); in calculateNumIters()
7188 NewStep = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, NewStep.get()); in calculateNumIters()
7203 SemaRef.BuildBinOp(S, DefaultLoc, BO_Sub, Diff.get(), NewStep.get()); in calculateNumIters()
7210 Diff = SemaRef.BuildBinOp( in calculateNumIters()
7212 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); in calculateNumIters()
7216 Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); in calculateNumIters()
7221 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Sub, Upper, Diff.get()); in calculateNumIters()
7225 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Sub, Upper, Lower); in calculateNumIters()
7230 SemaRef.Diag(Upper->getBeginLoc(), diag::err_omp_loop_diff_cxx) in calculateNumIters()
7240 Diff = SemaRef.BuildBinOp( in calculateNumIters()
7242 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); in calculateNumIters()
7249 SemaRef.BuildBinOp(S, DefaultLoc, BO_Add, Diff.get(), NewStep.get()); in calculateNumIters()
7256 Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); in calculateNumIters()
7261 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Div, Diff.get(), NewStep.get()); in calculateNumIters()
7274 !SemaRef.getLangOpts().CPlusPlus) in buildNumIterations()
7289 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MinValue); in buildNumIterations()
7293 ExprResult LBMinVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, in buildNumIterations()
7299 SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, LBMinVal.get(), LBVal); in buildNumIterations()
7303 LBMinVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, LBMinVal.get()); in buildNumIterations()
7309 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MaxValue); in buildNumIterations()
7313 ExprResult LBMaxVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, in buildNumIterations()
7319 SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, LBMaxVal.get(), LBVal); in buildNumIterations()
7323 LBMaxVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, LBMaxVal.get()); in buildNumIterations()
7327 Expr *LBMin = tryBuildCapture(SemaRef, LBMinVal.get(), Captures).get(); in buildNumIterations()
7328 Expr *LBMax = tryBuildCapture(SemaRef, LBMaxVal.get(), Captures).get(); in buildNumIterations()
7333 SemaRef.BuildBinOp(S, DefaultLoc, BO_LT, LBMin, LBMax); in buildNumIterations()
7337 tryBuildCapture(SemaRef, MinLessMaxRes.get(), Captures).get(); in buildNumIterations()
7343 ExprResult MinLB = SemaRef.ActOnConditionalOp(DefaultLoc, DefaultLoc, in buildNumIterations()
7351 ExprResult MaxLB = SemaRef.ActOnConditionalOp(DefaultLoc, DefaultLoc, in buildNumIterations()
7369 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MinValue); in buildNumIterations()
7373 ExprResult UBMinVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, in buildNumIterations()
7379 SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, UBMinVal.get(), UBVal); in buildNumIterations()
7383 UBMinVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, UBMinVal.get()); in buildNumIterations()
7389 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MaxValue); in buildNumIterations()
7393 ExprResult UBMaxVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, in buildNumIterations()
7399 SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, UBMaxVal.get(), UBVal); in buildNumIterations()
7403 UBMaxVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, UBMaxVal.get()); in buildNumIterations()
7407 Expr *UBMin = tryBuildCapture(SemaRef, UBMinVal.get(), Captures).get(); in buildNumIterations()
7408 Expr *UBMax = tryBuildCapture(SemaRef, UBMaxVal.get(), Captures).get(); in buildNumIterations()
7413 SemaRef.BuildBinOp(S, DefaultLoc, BO_GT, UBMin, UBMax); in buildNumIterations()
7417 tryBuildCapture(SemaRef, MinGreaterMaxRes.get(), Captures).get(); in buildNumIterations()
7423 ExprResult MaxUB = SemaRef.ActOnConditionalOp( in buildNumIterations()
7431 ExprResult MinUB = SemaRef.ActOnConditionalOp( in buildNumIterations()
7440 Expr *Upper = tryBuildCapture(SemaRef, UBExpr, Captures).get(); in buildNumIterations()
7441 Expr *Lower = tryBuildCapture(SemaRef, LBExpr, Captures).get(); in buildNumIterations()
7446 calculateNumIters(SemaRef, S, DefaultLoc, Lower, Upper, Step, VarType, in buildNumIterations()
7453 ASTContext &C = SemaRef.Context; in buildNumIterations()
7462 if (!SemaRef.Context.hasSameType(Diff.get()->getType(), Type)) { in buildNumIterations()
7463 Diff = SemaRef.PerformImplicitConversion( in buildNumIterations()
7474 SemaRef.Diag(DefaultLoc, diag::warn_omp_loop_64_bit_var) in buildNumIterations()
7480 if (!SemaRef.Context.hasSameType(Diff.get()->getType(), NewType)) { in buildNumIterations()
7481 Diff = SemaRef.PerformImplicitConversion(Diff.get(), NewType, in buildNumIterations()
7509 LBNonRect ? LBExpr : tryBuildCapture(SemaRef, LBExpr, Captures).get(); in buildMinMaxValues()
7511 UBNonRect ? UBExpr : tryBuildCapture(SemaRef, UBExpr, Captures).get(); in buildMinMaxValues()
7524 calculateNumIters(SemaRef, S, DefaultLoc, Lower, Upper, Step, VarType, in buildMinMaxValues()
7531 Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); in buildMinMaxValues()
7535 ExprResult NewStep = tryBuildCapture(SemaRef, Step, Captures); in buildMinMaxValues()
7538 Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Mul, Diff.get(), NewStep.get()); in buildMinMaxValues()
7543 Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); in buildMinMaxValues()
7549 !SemaRef.Context.hasSameType( in buildMinMaxValues()
7551 SemaRef.Context.getUnsignedPointerDiffType())) { in buildMinMaxValues()
7552 Diff = SemaRef.PerformImplicitConversion( in buildMinMaxValues()
7553 Diff.get(), SemaRef.Context.getUnsignedPointerDiffType(), in buildMinMaxValues()
7562 Diff = SemaRef.BuildBinOp( in buildMinMaxValues()
7564 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Lower).get(), in buildMinMaxValues()
7571 Diff = SemaRef.BuildBinOp( in buildMinMaxValues()
7573 SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Upper).get(), in buildMinMaxValues()
7580 if (SemaRef.Context.hasSameType(Diff.get()->getType(), VarType)) in buildMinMaxValues()
7581 Diff = SemaRef.PerformImplicitConversion(Diff.get(), VarType, in buildMinMaxValues()
7587 Sema::TentativeAnalysisScope Trap(SemaRef); in buildMinMaxValues()
7588 Diff = SemaRef.ActOnFinishFullExpr(Diff.get(), /*DiscardedValue=*/false); in buildMinMaxValues()
7614 return SemaRef.PerformImplicitConversion( in buildPreCond()
7615 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get(), in buildPreCond()
7616 SemaRef.Context.BoolTy, /*Action=*/Sema::AA_Casting, in buildPreCond()
7620 Sema::TentativeAnalysisScope Trap(SemaRef); in buildPreCond()
7622 ExprResult NewLB = tryBuildCapture(SemaRef, LB, Captures); in buildPreCond()
7623 ExprResult NewUB = tryBuildCapture(SemaRef, UB, Captures); in buildPreCond()
7628 SemaRef.BuildBinOp(S, DefaultLoc, in buildPreCond()
7634 if (!SemaRef.Context.hasSameUnqualifiedType(CondExpr.get()->getType(), in buildPreCond()
7635 SemaRef.Context.BoolTy)) in buildPreCond()
7636 CondExpr = SemaRef.PerformImplicitConversion( in buildPreCond()
7637 CondExpr.get(), SemaRef.Context.BoolTy, /*Action=*/Sema::AA_Casting, in buildPreCond()
7651 VD = SemaRef.isOpenMPCapturedDecl(LCDecl); in buildCounterVar()
7653 SemaRef, VD, VD->getType().getNonReferenceType(), DefaultLoc); in buildCounterVar()
7669 SemaRef, DefaultLoc, Type, LCDecl->getName(), in buildPrivateCounterVar()
7672 ? buildDeclRefExpr(SemaRef, cast<VarDecl>(LCDecl), Type, DefaultLoc) in buildPrivateCounterVar()
7676 return buildDeclRefExpr(SemaRef, PrivateVar, Type, DefaultLoc); in buildPrivateCounterVar()
7691 Expr *Cnt = SemaRef.DefaultLvalueConversion(Counter).get(); in buildOrderedLoopData()
7698 Cnt = SemaRef.BuildBinOp(S, Loc, BOK, Cnt, Inc).get(); in buildOrderedLoopData()
7704 !SemaRef.getLangOpts().CPlusPlus) in buildOrderedLoopData()
7709 : tryBuildCapture(SemaRef, LB, Captures).get(); in buildOrderedLoopData()
7711 ? tryBuildCapture(SemaRef, LB, Captures).get() in buildOrderedLoopData()
7716 ExprResult Diff = calculateNumIters(SemaRef, S, DefaultLoc, Lower, Upper, in buildOrderedLoopData()
7811 OpenMPDirectiveKind DKind, Stmt *S, Sema &SemaRef, DSAStackTy &DSA, in checkOpenMPIterationSpace() argument
7824 if (!For && (SemaRef.LangOpts.OpenMP <= 45 || !CXXFor)) { in checkOpenMPIterationSpace()
7825 SemaRef.Diag(S->getBeginLoc(), diag::err_omp_not_for) in checkOpenMPIterationSpace()
7831 SemaRef.Diag(DSA.getConstructLoc(), in checkOpenMPIterationSpace()
7836 SemaRef.Diag(CollapseLoopCountExpr->getExprLoc(), in checkOpenMPIterationSpace()
7840 SemaRef.Diag(OrderedLoopCountExpr->getExprLoc(), in checkOpenMPIterationSpace()
7849 OpenMPIterationSpaceChecker ISC(SemaRef, DSA, in checkOpenMPIterationSpace()
7869 !(SemaRef.getLangOpts().CPlusPlus && VarType->isOverloadableType())) { in checkOpenMPIterationSpace()
7870 SemaRef.Diag(Init->getBeginLoc(), diag::err_omp_loop_variable_type) in checkOpenMPIterationSpace()
7871 << SemaRef.getLangOpts().CPlusPlus; in checkOpenMPIterationSpace()
7895 if (ISC.dependent() || SemaRef.CurContext->isDependentContext() || HasErrors) in checkOpenMPIterationSpace()
7985 buildCounterInit(Sema &SemaRef, Scope *S, SourceLocation Loc, ExprResult VarRef, in buildCounterInit() argument
7991 : tryBuildCapture(SemaRef, Start.get(), Captures); in buildCounterInit()
7994 if (!SemaRef.Context.hasSameType(NewStart.get()->getType(), in buildCounterInit()
7996 NewStart = SemaRef.PerformImplicitConversion( in buildCounterInit()
8004 SemaRef.BuildBinOp(S, Loc, BO_Assign, VarRef.get(), NewStart.get()); in buildCounterInit()
8010 Sema &SemaRef, Scope *S, SourceLocation Loc, ExprResult VarRef, in buildCounterUpdate() argument
8015 Iter = SemaRef.ActOnParenExpr(Loc, Loc, Iter.get()); in buildCounterUpdate()
8022 NewStep = tryBuildCapture(SemaRef, Step.get(), *Captures); in buildCounterUpdate()
8026 SemaRef.BuildBinOp(S, Loc, BO_Mul, Iter.get(), NewStep.get()); in buildCounterUpdate()
8034 ExprResult NewStart = SemaRef.ActOnParenExpr(Loc, Loc, Start.get()); in buildCounterUpdate()
8038 NewStart = tryBuildCapture(SemaRef, Start.get(), *Captures); in buildCounterUpdate()
8048 Sema::TentativeAnalysisScope Trap(SemaRef); in buildCounterUpdate()
8051 SemaRef.BuildBinOp(S, Loc, BO_Assign, VarRef.get(), NewStart.get()); in buildCounterUpdate()
8054 SemaRef.BuildBinOp(S, Loc, Subtract ? BO_SubAssign : BO_AddAssign, in buildCounterUpdate()
8057 Update = SemaRef.CreateBuiltinBinOp(Loc, BO_Comma, Update.get(), in buildCounterUpdate()
8065 Update = SemaRef.BuildBinOp(S, Loc, Subtract ? BO_Sub : BO_Add, in buildCounterUpdate()
8070 if (!SemaRef.Context.hasSameType(Update.get()->getType(), in buildCounterUpdate()
8072 Update = SemaRef.PerformImplicitConversion( in buildCounterUpdate()
8078 Update = SemaRef.BuildBinOp(S, Loc, BO_Assign, VarRef.get(), Update.get()); in buildCounterUpdate()
8085 static ExprResult widenIterationCount(unsigned Bits, Expr *E, Sema &SemaRef) { in widenIterationCount() argument
8088 ASTContext &C = SemaRef.Context; in widenIterationCount()
8095 return SemaRef.PerformImplicitConversion(E, NewType, Sema::AA_Converting, in widenIterationCount()
8101 static bool fitsInto(unsigned Bits, bool Signed, const Expr *E, Sema &SemaRef) { in fitsInto() argument
8105 E->getIntegerConstantExpr(SemaRef.Context)) in fitsInto()
8159 Expr *OrderedLoopCountExpr, Stmt *AStmt, Sema &SemaRef, in checkOpenMPLoop() argument
8168 CollapseLoopCountExpr->EvaluateAsInt(Result, SemaRef.getASTContext())) { in checkOpenMPLoop()
8181 SemaRef.getASTContext())) { in checkOpenMPLoop()
8184 SemaRef.Diag(OrderedLoopCountExpr->getExprLoc(), in checkOpenMPLoop()
8187 SemaRef.Diag(CollapseLoopCountExpr->getExprLoc(), in checkOpenMPLoop()
8205 DKind, CurStmt, SemaRef, DSA, Cnt, NestedLoopCount, in checkOpenMPLoop()
8222 CurStmt, SemaRef.LangOpts.OpenMP >= 50); in checkOpenMPLoop()
8226 DKind, CurStmt, SemaRef, DSA, Cnt, NestedLoopCount, in checkOpenMPLoop()
8250 CurStmt, SemaRef.LangOpts.OpenMP >= 50); in checkOpenMPLoop()
8255 if (SemaRef.CurContext->isDependentContext()) in checkOpenMPLoop()
8293 SemaRef in checkOpenMPLoop()
8298 SemaRef); in checkOpenMPLoop()
8301 SemaRef in checkOpenMPLoop()
8306 SemaRef); in checkOpenMPLoop()
8311 ASTContext &C = SemaRef.Context; in checkOpenMPLoop()
8318 SemaRef.BuildBinOp(CurScope, PreCond.get()->getExprLoc(), BO_LAnd, in checkOpenMPLoop()
8325 LastIteration32 = SemaRef.BuildBinOp( in checkOpenMPLoop()
8327 SemaRef in checkOpenMPLoop()
8333 LastIteration64 = SemaRef.BuildBinOp( in checkOpenMPLoop()
8335 SemaRef in checkOpenMPLoop()
8344 if (SemaRef.getLangOpts().OpenMPOptimisticCollapse || in checkOpenMPLoop()
8351 LastIteration64.get(), SemaRef)))) in checkOpenMPLoop()
8358 SemaRef.Context.getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/0); in checkOpenMPLoop()
8360 SemaRef.Context.getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/1); in checkOpenMPLoop()
8369 LastIteration = SemaRef.BuildBinOp( in checkOpenMPLoop()
8372 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); in checkOpenMPLoop()
8379 bool IsConstant = LastIteration.get()->isIntegerConstantExpr(SemaRef.Context); in checkOpenMPLoop()
8383 tryBuildCapture(SemaRef, LastIteration.get(), Captures); in checkOpenMPLoop()
8387 NumIterations = SemaRef.BuildBinOp( in checkOpenMPLoop()
8389 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); in checkOpenMPLoop()
8401 VarDecl *LBDecl = buildVarDecl(SemaRef, InitLoc, VType, ".omp.lb"); in checkOpenMPLoop()
8402 LB = buildDeclRefExpr(SemaRef, LBDecl, VType, InitLoc); in checkOpenMPLoop()
8403 SemaRef.AddInitializerToDecl(LBDecl, in checkOpenMPLoop()
8404 SemaRef.ActOnIntegerConstant(InitLoc, 0).get(), in checkOpenMPLoop()
8408 VarDecl *UBDecl = buildVarDecl(SemaRef, InitLoc, VType, ".omp.ub"); in checkOpenMPLoop()
8409 UB = buildDeclRefExpr(SemaRef, UBDecl, VType, InitLoc); in checkOpenMPLoop()
8410 SemaRef.AddInitializerToDecl(UBDecl, LastIteration.get(), in checkOpenMPLoop()
8415 QualType Int32Ty = SemaRef.Context.getIntTypeForBitwidth(32, true); in checkOpenMPLoop()
8416 VarDecl *ILDecl = buildVarDecl(SemaRef, InitLoc, Int32Ty, ".omp.is_last"); in checkOpenMPLoop()
8417 IL = buildDeclRefExpr(SemaRef, ILDecl, Int32Ty, InitLoc); in checkOpenMPLoop()
8418 SemaRef.AddInitializerToDecl(ILDecl, in checkOpenMPLoop()
8419 SemaRef.ActOnIntegerConstant(InitLoc, 0).get(), in checkOpenMPLoop()
8424 buildVarDecl(SemaRef, InitLoc, StrideVType, ".omp.stride"); in checkOpenMPLoop()
8425 ST = buildDeclRefExpr(SemaRef, STDecl, StrideVType, InitLoc); in checkOpenMPLoop()
8426 SemaRef.AddInitializerToDecl(STDecl, in checkOpenMPLoop()
8427 SemaRef.ActOnIntegerConstant(InitLoc, 1).get(), in checkOpenMPLoop()
8432 ExprResult IsUBGreater = SemaRef.BuildBinOp(CurScope, InitLoc, BO_GT, in checkOpenMPLoop()
8434 ExprResult CondOp = SemaRef.ActOnConditionalOp( in checkOpenMPLoop()
8437 EUB = SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, UB.get(), in checkOpenMPLoop()
8439 EUB = SemaRef.ActOnFinishFullExpr(EUB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
8448 buildVarDecl(SemaRef, InitLoc, VType, ".omp.comb.lb"); in checkOpenMPLoop()
8449 CombLB = buildDeclRefExpr(SemaRef, CombLBDecl, VType, InitLoc); in checkOpenMPLoop()
8450 SemaRef.AddInitializerToDecl( in checkOpenMPLoop()
8451 CombLBDecl, SemaRef.ActOnIntegerConstant(InitLoc, 0).get(), in checkOpenMPLoop()
8456 buildVarDecl(SemaRef, InitLoc, VType, ".omp.comb.ub"); in checkOpenMPLoop()
8457 CombUB = buildDeclRefExpr(SemaRef, CombUBDecl, VType, InitLoc); in checkOpenMPLoop()
8458 SemaRef.AddInitializerToDecl(CombUBDecl, LastIteration.get(), in checkOpenMPLoop()
8461 ExprResult CombIsUBGreater = SemaRef.BuildBinOp( in checkOpenMPLoop()
8464 SemaRef.ActOnConditionalOp(InitLoc, InitLoc, CombIsUBGreater.get(), in checkOpenMPLoop()
8466 CombEUB = SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, CombUB.get(), in checkOpenMPLoop()
8469 SemaRef.ActOnFinishFullExpr(CombEUB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
8485 buildDeclRefExpr(SemaRef, PrevLBDecl, PrevLBDecl->getType(), InitLoc); in checkOpenMPLoop()
8487 buildDeclRefExpr(SemaRef, PrevUBDecl, PrevUBDecl->getType(), InitLoc); in checkOpenMPLoop()
8495 VarDecl *IVDecl = buildVarDecl(SemaRef, InitLoc, RealVType, ".omp.iv"); in checkOpenMPLoop()
8496 IV = buildDeclRefExpr(SemaRef, IVDecl, RealVType, InitLoc); in checkOpenMPLoop()
8501 : SemaRef.ActOnIntegerConstant(SourceLocation(), 0).get(); in checkOpenMPLoop()
8502 Init = SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, IV.get(), RHS); in checkOpenMPLoop()
8503 Init = SemaRef.ActOnFinishFullExpr(Init.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
8511 : SemaRef.ActOnIntegerConstant(SourceLocation(), 0).get(); in checkOpenMPLoop()
8513 SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, IV.get(), CombRHS); in checkOpenMPLoop()
8515 SemaRef.ActOnFinishFullExpr(CombInit.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
8530 SemaRef in checkOpenMPLoop()
8532 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()) in checkOpenMPLoop()
8535 SemaRef.ActOnFinishFullExpr(BoundUB, /*DiscardedValue*/ false).get(); in checkOpenMPLoop()
8540 ? SemaRef.BuildBinOp(CurScope, CondLoc, in checkOpenMPLoop()
8543 : SemaRef.BuildBinOp(CurScope, CondLoc, BO_LT, IV.get(), in checkOpenMPLoop()
8547 CombDistCond = SemaRef.BuildBinOp(CurScope, CondLoc, BO_LT, IV.get(), in checkOpenMPLoop()
8556 SemaRef in checkOpenMPLoop()
8559 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()) in checkOpenMPLoop()
8562 SemaRef.ActOnFinishFullExpr(BoundCombUB, /*DiscardedValue*/ false) in checkOpenMPLoop()
8566 SemaRef.BuildBinOp(CurScope, CondLoc, UseStrictCompare ? BO_LT : BO_LE, in checkOpenMPLoop()
8572 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, IV.get(), in checkOpenMPLoop()
8573 SemaRef.ActOnIntegerConstant(IncLoc, 1).get()); in checkOpenMPLoop()
8576 Inc = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, IV.get(), Inc.get()); in checkOpenMPLoop()
8577 Inc = SemaRef.ActOnFinishFullExpr(Inc.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
8589 NextLB = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, LB.get(), ST.get()); in checkOpenMPLoop()
8594 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, LB.get(), NextLB.get()); in checkOpenMPLoop()
8596 SemaRef.ActOnFinishFullExpr(NextLB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
8600 NextUB = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, UB.get(), ST.get()); in checkOpenMPLoop()
8605 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, UB.get(), NextUB.get()); in checkOpenMPLoop()
8607 SemaRef.ActOnFinishFullExpr(NextUB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
8612 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, CombLB.get(), ST.get()); in checkOpenMPLoop()
8616 CombNextLB = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, CombLB.get(), in checkOpenMPLoop()
8618 CombNextLB = SemaRef.ActOnFinishFullExpr(CombNextLB.get(), in checkOpenMPLoop()
8624 SemaRef.BuildBinOp(CurScope, IncLoc, BO_Add, CombUB.get(), ST.get()); in checkOpenMPLoop()
8628 CombNextUB = SemaRef.BuildBinOp(CurScope, IncLoc, BO_Assign, CombUB.get(), in checkOpenMPLoop()
8630 CombNextUB = SemaRef.ActOnFinishFullExpr(CombNextUB.get(), in checkOpenMPLoop()
8644 DistCond = SemaRef.BuildBinOp( in checkOpenMPLoop()
8649 SemaRef.BuildBinOp(CurScope, DistIncLoc, BO_Add, IV.get(), ST.get()); in checkOpenMPLoop()
8651 DistInc = SemaRef.BuildBinOp(CurScope, DistIncLoc, BO_Assign, IV.get(), in checkOpenMPLoop()
8654 SemaRef.ActOnFinishFullExpr(DistInc.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
8661 SemaRef.BuildBinOp(CurScope, DistEUBLoc, BO_GT, UB.get(), PrevUB.get()); in checkOpenMPLoop()
8662 ExprResult CondOp = SemaRef.ActOnConditionalOp( in checkOpenMPLoop()
8664 PrevEUB = SemaRef.BuildBinOp(CurScope, DistIncLoc, BO_Assign, UB.get(), in checkOpenMPLoop()
8667 SemaRef.ActOnFinishFullExpr(PrevEUB.get(), /*DiscardedValue*/ false); in checkOpenMPLoop()
8675 SemaRef in checkOpenMPLoop()
8678 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()) in checkOpenMPLoop()
8681 SemaRef.ActOnFinishFullExpr(BoundPrevUB, /*DiscardedValue*/ false) in checkOpenMPLoop()
8685 SemaRef.BuildBinOp(CurScope, CondLoc, UseStrictCompare ? BO_LT : BO_LE, in checkOpenMPLoop()
8722 SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get(); in checkOpenMPLoop()
8724 Prod = SemaRef.BuildBinOp(CurScope, UpdLoc, BO_Mul, Prod.get(), in checkOpenMPLoop()
8731 Iter = SemaRef.BuildBinOp(CurScope, UpdLoc, BO_Div, in checkOpenMPLoop()
8745 Prod = SemaRef.BuildBinOp(CurScope, UpdLoc, BO_Mul, in checkOpenMPLoop()
8749 Acc = SemaRef.BuildBinOp(CurScope, UpdLoc, BO_Sub, in checkOpenMPLoop()
8755 SemaRef, VD, IS.CounterVar->getType(), IS.CounterVar->getExprLoc(), in checkOpenMPLoop()
8758 buildCounterInit(SemaRef, CurScope, UpdLoc, CounterVar, in checkOpenMPLoop()
8765 SemaRef, CurScope, UpdLoc, CounterVar, IS.CounterInit, Iter, in checkOpenMPLoop()
8774 buildCounterUpdate(SemaRef, CurScope, UpdLoc, CounterVar, in checkOpenMPLoop()
8812 Built.CalcLastIteration = SemaRef in checkOpenMPLoop()
9614 Sema &SemaRef; member in __anon0bb9e2bb3511::OpenMPAtomicUpdateChecker
9635 OpenMPAtomicUpdateChecker(Sema &SemaRef) in OpenMPAtomicUpdateChecker() argument
9636 : SemaRef(SemaRef), X(nullptr), E(nullptr), UpdateExpr(nullptr), in OpenMPAtomicUpdateChecker()
9688 X->IgnoreParenImpCasts()->Profile(XId, SemaRef.getASTContext(), in checkBinaryOperation()
9690 LHS->IgnoreParenImpCasts()->Profile(LHSId, SemaRef.getASTContext(), in checkBinaryOperation()
9692 RHS->IgnoreParenImpCasts()->Profile(RHSId, SemaRef.getASTContext(), in checkBinaryOperation()
9727 SemaRef.Diag(ErrorLoc, DiagId) << ErrorRange; in checkBinaryOperation()
9728 SemaRef.Diag(NoteLoc, NoteId) << ErrorFound << NoteRange; in checkBinaryOperation()
9731 if (SemaRef.CurContext->isDependentContext()) in checkBinaryOperation()
9775 E = SemaRef.ActOnIntegerConstant(OpLoc, /*uint64_t Val=*/1).get(); in checkStatement()
9800 SemaRef.Diag(ErrorLoc, DiagId) << ErrorRange; in checkStatement()
9801 SemaRef.Diag(NoteLoc, NoteId) << ErrorFound << NoteRange; in checkStatement()
9804 if (SemaRef.CurContext->isDependentContext()) in checkStatement()
9810 auto *OVEX = new (SemaRef.getASTContext()) in checkStatement()
9812 auto *OVEExpr = new (SemaRef.getASTContext()) in checkStatement()
9815 SemaRef.CreateBuiltinBinOp(OpLoc, Op, IsXLHSInRHSPart ? OVEX : OVEExpr, in checkStatement()
9819 Update = SemaRef.PerformImplicitConversion(Update.get(), X->getType(), in checkStatement()
12748 isNonNegativeIntegerValue(Expr *&ValExpr, Sema &SemaRef, OpenMPClauseKind CKind, in isNonNegativeIntegerValue() argument
12757 SemaRef.PerformOpenMPImplicitIntegerConversion(Loc, ValExpr); in isNonNegativeIntegerValue()
12764 ValExpr->getIntegerConstantExpr(SemaRef.Context)) { in isNonNegativeIntegerValue()
12768 SemaRef.Diag(Loc, diag::err_omp_negative_expression_in_clause) in isNonNegativeIntegerValue()
12777 getOpenMPCaptureRegionForClause(DKind, CKind, SemaRef.LangOpts.OpenMP); in isNonNegativeIntegerValue()
12779 !SemaRef.CurContext->isDependentContext()) { in isNonNegativeIntegerValue()
12780 ValExpr = SemaRef.MakeFullExpr(ValExpr).get(); in isNonNegativeIntegerValue()
12782 ValExpr = tryBuildCapture(SemaRef, ValExpr, Captures).get(); in isNonNegativeIntegerValue()
12783 *HelperValStmt = buildPreInits(SemaRef.Context, Captures); in isNonNegativeIntegerValue()
14576 TransformExprToCaptures(Sema &SemaRef, ValueDecl *FieldDecl) in TransformExprToCaptures() argument
14577 : BaseTransform(SemaRef), Field(FieldDecl), CapturedExpr(nullptr) {} in TransformExprToCaptures()
14582 CapturedExpr = buildCapture(SemaRef, Field, E, /*WithInit=*/false); in TransformMemberExpr()
14603 static NamedDecl *findAcceptableDecl(Sema &SemaRef, NamedDecl *D) { in findAcceptableDecl() argument
14604 assert(!LookupResult::isVisible(SemaRef, D) && "not in slow case"); in findAcceptableDecl()
14612 if (LookupResult::isVisible(SemaRef, ND)) in findAcceptableDecl()
14620 argumentDependentLookup(Sema &SemaRef, const DeclarationNameInfo &Id, in argumentDependentLookup() argument
14628 SemaRef.FindAssociatedClassesAndNamespaces(Loc, &OVE, AssociatedNamespaces, in argumentDependentLookup()
14664 if (!SemaRef.isVisible(D)) { in argumentDependentLookup()
14665 D = findAcceptableDecl(SemaRef, D); in argumentDependentLookup()
14678 buildDeclareReductionRef(Sema &SemaRef, SourceLocation Loc, SourceRange Range, in buildDeclareReductionRef() argument
14686 LookupResult Lookup(SemaRef, ReductionId, Sema::LookupOMPReductionName); in buildDeclareReductionRef()
14688 while (S && SemaRef.LookupParsedName(Lookup, S, &ReductionIdScopeSpec)) { in buildDeclareReductionRef()
14711 if (SemaRef.CurContext->isDependentContext() || Ty->isDependentType() || in buildDeclareReductionRef()
14729 SemaRef.Context, /*NamingClass=*/nullptr, in buildDeclareReductionRef()
14730 ReductionIdScopeSpec.getWithLocInContext(SemaRef.Context), ReductionId, in buildDeclareReductionRef()
14746 LookupResult Lookup(SemaRef, ReductionId, Sema::LookupOMPReductionName); in buildDeclareReductionRef()
14751 if (SemaRef.isCompleteType(Loc, Ty) || TyRec->isBeingDefined() || in buildDeclareReductionRef()
14754 SemaRef.LookupQualifiedName(Lookup, TyRec->getDecl()); in buildDeclareReductionRef()
14762 if (SemaRef.getLangOpts().CPlusPlus) in buildDeclareReductionRef()
14763 argumentDependentLookup(SemaRef, ReductionId, Loc, Ty, Lookups); in buildDeclareReductionRef()
14765 Lookups, [&SemaRef, Ty](ValueDecl *D) -> ValueDecl * { in buildDeclareReductionRef()
14767 SemaRef.Context.hasSameType(D->getType(), Ty)) in buildDeclareReductionRef()
14771 return SemaRef.BuildDeclRefExpr(VD, VD->getType().getNonReferenceType(), in buildDeclareReductionRef()
14773 if (SemaRef.getLangOpts().CPlusPlus) { in buildDeclareReductionRef()
14775 Lookups, [&SemaRef, Ty, Loc](ValueDecl *D) -> ValueDecl * { in buildDeclareReductionRef()
14777 SemaRef.IsDerivedFrom(Loc, Ty, D->getType()) && in buildDeclareReductionRef()
14784 if (SemaRef.IsDerivedFrom(Loc, Ty, VD->getType(), Paths)) { in buildDeclareReductionRef()
14785 if (!Paths.isAmbiguous(SemaRef.Context.getCanonicalType( in buildDeclareReductionRef()
14787 if (SemaRef.CheckBaseClassAccess( in buildDeclareReductionRef()
14790 SemaRef.BuildBasePathArray(Paths, BasePath); in buildDeclareReductionRef()
14791 return SemaRef.BuildDeclRefExpr( in buildDeclareReductionRef()
14799 SemaRef.Diag(Loc, diag::err_omp_not_resolved_reduction_identifier) in buildDeclareReductionRef()
15931 Expr *NumIterations, Sema &SemaRef, in FinishOpenMPLinearClause() argument
15942 Step = SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get(); in FinishOpenMPLinearClause()
15953 auto Res = getPrivateItem(SemaRef, SimpleRefExpr, ELoc, ERange); in FinishOpenMPLinearClause()
15967 SemaRef.Diag(ELoc, in FinishOpenMPLinearClause()
15983 buildDeclRefExpr(SemaRef, cast<VarDecl>(DE->getDecl()), in FinishOpenMPLinearClause()
15991 SemaRef, S, RefExpr->getExprLoc(), *CurPrivate, InitExpr, IV, Step, in FinishOpenMPLinearClause()
15995 Update = SemaRef.ActOnFinishFullExpr(Update.get(), DE->getBeginLoc(), in FinishOpenMPLinearClause()
16002 buildCounterUpdate(SemaRef, S, RefExpr->getExprLoc(), CapturedRef, in FinishOpenMPLinearClause()
16007 Final = SemaRef.ActOnFinishFullExpr(Final.get(), DE->getBeginLoc(), in FinishOpenMPLinearClause()
16673 static bool checkTypeMappable(SourceLocation SL, SourceRange SR, Sema &SemaRef, in checkTypeMappable() argument
16678 SemaRef.Diag(SL, diag::err_incomplete_type) << QTy << SR; in checkTypeMappable()
16681 if (FullCheck && !SemaRef.CurContext->isDependentContext() && in checkTypeMappable()
16682 !QTy.isTriviallyCopyableType(SemaRef.Context)) in checkTypeMappable()
16683 SemaRef.Diag(SL, diag::warn_omp_non_trivial_type_mapped) << QTy << SR; in checkTypeMappable()
16690 static bool checkArrayExpressionDoesNotReferToWholeSize(Sema &SemaRef, in checkArrayExpressionDoesNotReferToWholeSize() argument
16714 if (!LowerBound->EvaluateAsInt(Result, SemaRef.getASTContext())) in checkArrayExpressionDoesNotReferToWholeSize()
16738 if (!Length->EvaluateAsInt(Result, SemaRef.getASTContext())) in checkArrayExpressionDoesNotReferToWholeSize()
16748 static bool checkArrayExpressionDoesNotReferToUnitySize(Sema &SemaRef, in checkArrayExpressionDoesNotReferToUnitySize() argument
16774 if (!Length->EvaluateAsInt(Result, SemaRef.getASTContext())) in checkArrayExpressionDoesNotReferToUnitySize()
16818 Sema &SemaRef; member in __anon0bb9e2bb4911::MapBaseChecker
16833 if (SemaRef.getLangOpts().OpenMP < 50) { in emitErrorMsg()
16834 SemaRef.Diag(ELoc, in emitErrorMsg()
16838 SemaRef.Diag(ELoc, diag::err_omp_non_lvalue_in_map_or_motion_clauses) in emitErrorMsg()
16870 SemaRef.Diag(ELoc, diag::err_omp_expected_access_to_data_field) in VisitMemberExpr()
16886 SemaRef.Diag(ELoc, diag::err_omp_bit_fields_forbidden_in_clause) in VisitMemberExpr()
16906 SemaRef.Diag(ELoc, diag::err_omp_union_type_not_allowed) in VisitMemberExpr()
16933 SemaRef.Diag(ELoc, diag::err_omp_expected_base_var_name) in VisitArraySubscriptExpr()
16943 if (checkArrayExpressionDoesNotReferToWholeSize(SemaRef, AE, in VisitArraySubscriptExpr()
16950 AE->getIdx()->EvaluateAsInt(Result, SemaRef.getASTContext()) && in VisitArraySubscriptExpr()
16952 SemaRef.Diag(AE->getIdx()->getExprLoc(), in VisitArraySubscriptExpr()
16954 SemaRef.Diag(AE->getIdx()->getExprLoc(), in VisitArraySubscriptExpr()
16982 SemaRef.Diag(ELoc, diag::err_omp_expected_base_var_name) in VisitOMPArraySectionExpr()
16988 checkArrayExpressionDoesNotReferToWholeSize(SemaRef, OASE, CurType); in VisitOMPArraySectionExpr()
16990 checkArrayExpressionDoesNotReferToUnitySize(SemaRef, OASE, CurType); in VisitOMPArraySectionExpr()
17002 SemaRef.getLangOpts().OpenMP >= 50) { in VisitOMPArraySectionExpr()
17004 SemaRef.Diag(ELoc, diag::err_omp_section_length_undefined) in VisitOMPArraySectionExpr()
17011 SemaRef.Diag( in VisitOMPArraySectionExpr()
17024 OASE->getLength()->EvaluateAsInt(ResultR, SemaRef.getASTContext()) && in VisitOMPArraySectionExpr()
17026 SemaRef.Diag(OASE->getLength()->getExprLoc(), in VisitOMPArraySectionExpr()
17028 SemaRef.Diag(OASE->getLength()->getExprLoc(), in VisitOMPArraySectionExpr()
17033 SemaRef.getASTContext()) && in VisitOMPArraySectionExpr()
17035 SemaRef.Diag(OASE->getLowerBound()->getExprLoc(), in VisitOMPArraySectionExpr()
17037 SemaRef.Diag(OASE->getLowerBound()->getExprLoc(), in VisitOMPArraySectionExpr()
17058 if (SemaRef.getLangOpts().OpenMP < 50 || !UO->isLValue() || in VisitUnaryOperator()
17070 if (SemaRef.getLangOpts().OpenMP < 50 || !BO->getType()->isPointerType()) { in VisitBinaryOperator()
17108 Sema &SemaRef, OpenMPClauseKind CKind, OpenMPDirectiveKind DKind, in MapBaseChecker() argument
17111 : SemaRef(SemaRef), CKind(CKind), DKind(DKind), Components(Components), in MapBaseChecker()
17121 Sema &SemaRef, Expr *E, in checkMapClauseExpressionBase() argument
17126 MapBaseChecker Checker(SemaRef, CKind, DKind, CurComponents, NoDiagnose, ELoc, in checkMapClauseExpressionBase()
17130 if (SemaRef.getLangOpts().OpenMP >= 50 && !CurComponents.empty() && in checkMapClauseExpressionBase()
17141 SemaRef.Diag(ELoc, diag::err_array_section_does_not_specify_length) in checkMapClauseExpressionBase()
17153 Sema &SemaRef, DSAStackTy *DSAS, const ValueDecl *VD, const Expr *E, in checkMapConflicts() argument
17175 [&IsEnclosedByDataEnvironmentExpr, &SemaRef, VD, CurrentRegionOnly, ELoc, in checkMapConflicts()
17209 SemaRef.Diag(CI->getAssociatedExpression()->getExprLoc(), in checkMapConflicts()
17212 SemaRef.Diag(SI->getAssociatedExpression()->getExprLoc(), in checkMapConflicts()
17246 SemaRef, SI->getAssociatedExpression(), Type)) in checkMapConflicts()
17259 SemaRef.Diag(ELoc, diag::err_omp_map_shared_storage) << ERange; in checkMapConflicts()
17262 SemaRef.Diag(ELoc, diag::err_omp_once_referenced_in_target_update) in checkMapConflicts()
17265 SemaRef.Diag(RE->getExprLoc(), diag::note_used_here) in checkMapConflicts()
17298 SemaRef.Diag( in checkMapConflicts()
17302 SemaRef.Diag(RE->getExprLoc(), diag::note_used_here) in checkMapConflicts()
17311 SemaRef.Diag(DerivedLoc, diag::err_omp_same_pointer_dereferenced) in checkMapConflicts()
17313 SemaRef.Diag(RE->getExprLoc(), diag::note_used_here) in checkMapConflicts()
17346 SemaRef.Diag(ELoc, diag::err_omp_map_shared_storage) << ERange; in checkMapConflicts()
17349 SemaRef.Diag(ELoc, diag::err_omp_once_referenced_in_target_update) in checkMapConflicts()
17352 SemaRef.Diag(RE->getExprLoc(), diag::note_used_here) in checkMapConflicts()
17385 SemaRef.Diag(ELoc, in checkMapConflicts()
17388 SemaRef.Diag(EnclosingExpr->getExprLoc(), diag::note_used_here) in checkMapConflicts()
17398 static ExprResult buildUserDefinedMapperRef(Sema &SemaRef, Scope *S, in buildUserDefinedMapperRef() argument
17412 LookupResult Lookup(SemaRef, MapperId, Sema::LookupOMPMapperName); in buildUserDefinedMapperRef()
17415 while (S && SemaRef.LookupParsedName(Lookup, S, &MapperIdScopeSpec)) { in buildUserDefinedMapperRef()
17436 if (SemaRef.CurContext->isDependentContext() || Type->isDependentType() || in buildUserDefinedMapperRef()
17452 SemaRef.Context, /*NamingClass=*/nullptr, in buildUserDefinedMapperRef()
17453 MapperIdScopeSpec.getWithLocInContext(SemaRef.Context), MapperId, in buildUserDefinedMapperRef()
17461 SemaRef.Diag(Loc, diag::err_omp_mapper_wrong_type); in buildUserDefinedMapperRef()
17465 if (SemaRef.getLangOpts().CPlusPlus && !MapperIdScopeSpec.isSet()) in buildUserDefinedMapperRef()
17466 argumentDependentLookup(SemaRef, MapperId, Loc, Type, Lookups); in buildUserDefinedMapperRef()
17469 Lookups, [&SemaRef, Type](ValueDecl *D) -> ValueDecl * { in buildUserDefinedMapperRef()
17471 SemaRef.Context.hasSameType(D->getType(), Type)) in buildUserDefinedMapperRef()
17475 return SemaRef.BuildDeclRefExpr(VD, Type, VK_LValue, Loc); in buildUserDefinedMapperRef()
17479 Lookups, [&SemaRef, Type, Loc](ValueDecl *D) -> ValueDecl * { in buildUserDefinedMapperRef()
17481 SemaRef.IsDerivedFrom(Loc, Type, D->getType()) && in buildUserDefinedMapperRef()
17488 if (SemaRef.IsDerivedFrom(Loc, Type, VD->getType(), Paths)) { in buildUserDefinedMapperRef()
17489 if (!Paths.isAmbiguous(SemaRef.Context.getCanonicalType( in buildUserDefinedMapperRef()
17491 if (SemaRef.CheckBaseClassAccess( in buildUserDefinedMapperRef()
17494 return SemaRef.BuildDeclRefExpr(VD, Type, VK_LValue, Loc); in buildUserDefinedMapperRef()
17501 SemaRef.Diag(Loc, diag::err_omp_invalid_mapper) in buildUserDefinedMapperRef()
17539 Sema &SemaRef, DSAStackTy *DSAS, OpenMPClauseKind CKind, in checkMappableExpressionList() argument
17554 auto &DeclNames = SemaRef.getASTContext().DeclarationNames; in checkMappableExpressionList()
17556 &SemaRef.getASTContext().Idents.get("default"))); in checkMappableExpressionList()
17593 SemaRef, DSAS->getCurScope(), MapperIdScopeSpec, MapperId, in checkMappableExpressionList()
17607 if (SemaRef.getLangOpts().OpenMP < 50) { in checkMappableExpressionList()
17608 SemaRef.Diag( in checkMappableExpressionList()
17612 SemaRef.Diag(ELoc, diag::err_omp_non_lvalue_in_map_or_motion_clauses) in checkMappableExpressionList()
17624 SemaRef, SimpleExpr, CurComponents, CKind, DSAS->getCurrentDirective(), in checkMappableExpressionList()
17637 SemaRef, DSAS->getCurScope(), MapperIdScopeSpec, MapperId, in checkMappableExpressionList()
17672 SemaRef.Diag(ELoc, diag::err_omp_threadprivate_in_clause) in checkMappableExpressionList()
17674 reportOriginalDsa(SemaRef, DSAS, VD, DVar); in checkMappableExpressionList()
17686 if (checkMapConflicts(SemaRef, DSAS, CurDeclaration, SimpleExpr, in checkMappableExpressionList()
17690 (SemaRef.getLangOpts().OpenMP <= 45 || StartLoc.isValid()) && in checkMappableExpressionList()
17691 checkMapConflicts(SemaRef, DSAS, CurDeclaration, SimpleExpr, in checkMappableExpressionList()
17729 if (!checkTypeMappable(VE->getExprLoc(), VE->getSourceRange(), SemaRef, in checkMappableExpressionList()
17743 SemaRef.Diag(StartLoc, diag::err_omp_invalid_map_type_for_directive) in checkMappableExpressionList()
17757 SemaRef.Diag(StartLoc, diag::err_omp_invalid_map_type_for_directive) in checkMappableExpressionList()
17772 SemaRef.Diag(StartLoc, diag::err_omp_invalid_map_type_for_directive) in checkMappableExpressionList()
17787 if (VD && ((SemaRef.LangOpts.OpenMP <= 45 && in checkMappableExpressionList()
17792 SemaRef.Diag(ELoc, diag::err_omp_variable_in_given_clause_and_dsa) in checkMappableExpressionList()
17796 reportOriginalDsa(SemaRef, DSAS, CurDeclaration, DVar); in checkMappableExpressionList()
17804 SemaRef, DSAS->getCurScope(), MapperIdScopeSpec, MapperId, in checkMappableExpressionList()
18682 Sema &SemaRef, Decl *D) { in checkDeclInTargetContext() argument
18688 if (SemaRef.LangOpts.OpenMP >= 50 && in checkDeclInTargetContext()
18689 (SemaRef.getCurLambda(/*IgnoreNonLambdaCapturingScope=*/true) || in checkDeclInTargetContext()
18690 SemaRef.getCurBlock() || SemaRef.getCurCapturedRegion()) && in checkDeclInTargetContext()
18700 SemaRef.Diag(VD->getLocation(), in checkDeclInTargetContext()
18702 SemaRef.Diag(SL, diag::note_var_explicitly_captured_here) in checkDeclInTargetContext()
18709 SemaRef.Diag(VD->getLocation(), diag::warn_omp_not_in_target_context); in checkDeclInTargetContext()
18710 SemaRef.Diag(SL, diag::note_used_here) << SR; in checkDeclInTargetContext()
18714 Sema &SemaRef, DSAStackTy *Stack, in checkValueDeclInTarget() argument
18717 checkTypeMappable(SL, SR, SemaRef, Stack, VD->getType(), in checkValueDeclInTarget()