diff options
| author | Alexey Bataev <a.bataev@hotmail.com> | 2017-12-04 21:30:42 +0000 |
|---|---|---|
| committer | Alexey Bataev <a.bataev@hotmail.com> | 2017-12-04 21:30:42 +0000 |
| commit | c2e88a8a6b03b7cdbeef807b60f030ba10abcfa8 (patch) | |
| tree | 4657c5ccbbffd8d145243e8ce72597a70898bb22 /clang/lib/CodeGen | |
| parent | 68ba772cc0fcc2997f0e7827dd01f42f85161b7d (diff) | |
| download | bcm5719-llvm-c2e88a8a6b03b7cdbeef807b60f030ba10abcfa8.tar.gz bcm5719-llvm-c2e88a8a6b03b7cdbeef807b60f030ba10abcfa8.zip | |
[OPENMP] Fix PR35486: crash when collapsing loops with dependent iteration spaces.
Though it is incorrect from point of view of OpenMP standard to have
dependent iteration space in OpenMP loops, compiler should not crash.
Patch fixes this problem.
llvm-svn: 319700
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGStmtOpenMP.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp index 72847fa2827..f96d4f3fd65 100644 --- a/clang/lib/CodeGen/CGStmtOpenMP.cpp +++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -121,6 +121,9 @@ public: /// of used expression from loop statement. class OMPLoopScope : public CodeGenFunction::RunCleanupsScope { void emitPreInitStmt(CodeGenFunction &CGF, const OMPLoopDirective &S) { + CodeGenFunction::OMPPrivateScope PreCondScope(CGF); + CGF.EmitOMPPrivateLoopCounters(S, PreCondScope); + (void)PreCondScope.Privatize(); if (auto *LD = dyn_cast<OMPLoopDirective>(&S)) { if (auto *PreInits = cast_or_null<DeclStmt>(LD->getPreInits())) { for (const auto *I : PreInits->decls()) |

