From ce90181751246f240302a930ca853cb5b1fb95c5 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Wed, 19 Dec 2018 18:16:37 +0000 Subject: [OPENMP]Mark the loop as started when initialized. Need to mark the loop as started when the initialization statement is found. It is required to prevent possible incorrect loop iteraton variable detection during template instantiation and fix the compiler crash during the codegen. llvm-svn: 349657 --- clang/lib/Sema/SemaOpenMP.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/lib/Sema/SemaOpenMP.cpp') diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index c207ba9bd32..4fe8d3dd593 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -4649,6 +4649,7 @@ void Sema::ActOnOpenMPLoopInitialization(SourceLocation ForLoc, Stmt *Init) { unsigned AssociatedLoops = DSAStack->getAssociatedLoops(); if (AssociatedLoops > 0 && isOpenMPLoopDirective(DSAStack->getCurrentDirective())) { + DSAStack->loopStart(); OpenMPIterationSpaceChecker ISC(*this, ForLoc); if (!ISC.checkAndSetInit(Init, /*EmitDiags=*/false)) { if (ValueDecl *D = ISC.getLoopDecl()) { -- cgit v1.2.3