diff options
| author | Alexey Bataev <a.bataev@hotmail.com> | 2017-11-22 18:34:02 +0000 |
|---|---|---|
| committer | Alexey Bataev <a.bataev@hotmail.com> | 2017-11-22 18:34:02 +0000 |
| commit | 438388c2ad346ac76b5daea6d27e1ddf8da3aaaf (patch) | |
| tree | 623a48fd3fc6d72a68a82001a54168c78991b8e8 /clang/lib/Sema/SemaOpenMP.cpp | |
| parent | 0207b6fbbfc1922e5acf51110a604ebb36fe48b6 (diff) | |
| download | bcm5719-llvm-438388c2ad346ac76b5daea6d27e1ddf8da3aaaf.tar.gz bcm5719-llvm-438388c2ad346ac76b5daea6d27e1ddf8da3aaaf.zip | |
[OPENMP] Added missed checks for for [simd] based directives.
Added missed checks/analysis for safelen/simdlen clauses + linear clause
in for [simd] based directives.
llvm-svn: 318860
Diffstat (limited to 'clang/lib/Sema/SemaOpenMP.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaOpenMP.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index 290221a0de4..86ae4743231 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -6731,6 +6731,8 @@ StmtResult Sema::ActOnOpenMPTaskLoopSimdDirective( // clause must not be specified. if (checkReductionClauseWithNogroup(*this, Clauses)) return StmtError(); + if (checkSimdlenSafelenSpecified(*this, Clauses)) + return StmtError(); getCurFunction()->setHasBranchProtectedScope(); return OMPTaskLoopSimdDirective::Create(Context, StartLoc, EndLoc, @@ -6802,6 +6804,17 @@ StmtResult Sema::ActOnOpenMPDistributeParallelForDirective( assert((CurContext->isDependentContext() || B.builtAll()) && "omp for loop exprs were not built"); + if (!CurContext->isDependentContext()) { + // Finalize the clauses that need pre-built expressions for CodeGen. + for (auto C : Clauses) { + if (auto *LC = dyn_cast<OMPLinearClause>(C)) + if (FinishOpenMPLinearClause(*LC, cast<DeclRefExpr>(B.IterationVarRef), + B.NumIterations, *this, CurScope, + DSAStack)) + return StmtError(); + } + } + getCurFunction()->setHasBranchProtectedScope(); return OMPDistributeParallelForDirective::Create( Context, StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B); @@ -6835,6 +6848,17 @@ StmtResult Sema::ActOnOpenMPDistributeParallelForSimdDirective( assert((CurContext->isDependentContext() || B.builtAll()) && "omp for loop exprs were not built"); + if (!CurContext->isDependentContext()) { + // Finalize the clauses that need pre-built expressions for CodeGen. + for (auto C : Clauses) { + if (auto *LC = dyn_cast<OMPLinearClause>(C)) + if (FinishOpenMPLinearClause(*LC, cast<DeclRefExpr>(B.IterationVarRef), + B.NumIterations, *this, CurScope, + DSAStack)) + return StmtError(); + } + } + if (checkSimdlenSafelenSpecified(*this, Clauses)) return StmtError(); @@ -6871,6 +6895,17 @@ StmtResult Sema::ActOnOpenMPDistributeSimdDirective( assert((CurContext->isDependentContext() || B.builtAll()) && "omp for loop exprs were not built"); + if (!CurContext->isDependentContext()) { + // Finalize the clauses that need pre-built expressions for CodeGen. + for (auto C : Clauses) { + if (auto *LC = dyn_cast<OMPLinearClause>(C)) + if (FinishOpenMPLinearClause(*LC, cast<DeclRefExpr>(B.IterationVarRef), + B.NumIterations, *this, CurScope, + DSAStack)) + return StmtError(); + } + } + if (checkSimdlenSafelenSpecified(*this, Clauses)) return StmtError(); @@ -7329,6 +7364,9 @@ StmtResult Sema::ActOnOpenMPTargetTeamsDistributeParallelForSimdDirective( } } + if (checkSimdlenSafelenSpecified(*this, Clauses)) + return StmtError(); + getCurFunction()->setHasBranchProtectedScope(); return OMPTargetTeamsDistributeParallelForSimdDirective::Create( Context, StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B); @@ -7362,6 +7400,20 @@ StmtResult Sema::ActOnOpenMPTargetTeamsDistributeSimdDirective( assert((CurContext->isDependentContext() || B.builtAll()) && "omp target teams distribute simd loop exprs were not built"); + if (!CurContext->isDependentContext()) { + // Finalize the clauses that need pre-built expressions for CodeGen. + for (auto C : Clauses) { + if (auto *LC = dyn_cast<OMPLinearClause>(C)) + if (FinishOpenMPLinearClause(*LC, cast<DeclRefExpr>(B.IterationVarRef), + B.NumIterations, *this, CurScope, + DSAStack)) + return StmtError(); + } + } + + if (checkSimdlenSafelenSpecified(*this, Clauses)) + return StmtError(); + getCurFunction()->setHasBranchProtectedScope(); return OMPTargetTeamsDistributeSimdDirective::Create( Context, StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B); |

