@@ -166,8 +166,8 @@ class CanonicalizationOfOmp {
166166 std::get<parser::OmpBeginLoopDirective>(ompLoopCons->t );
167167 auto &beginLoopDirective =
168168 std::get<parser::OmpLoopDirective>(beginDirective.t );
169- if (( beginLoopDirective.v == llvm::omp::Directive::OMPD_unroll ||
170- beginLoopDirective.v == llvm::omp::Directive::OMPD_tile) ) {
169+ if (beginLoopDirective.v == llvm::omp::Directive::OMPD_unroll ||
170+ beginLoopDirective.v == llvm::omp::Directive::OMPD_tile) {
171171 // iterate through the remaining block items to find the end directive
172172 // for the unroll/tile directive.
173173 parser::Block::iterator endIt;
@@ -188,18 +188,15 @@ class CanonicalizationOfOmp {
188188 }
189189 RewriteOpenMPLoopConstruct (*ompLoopCons, block, nextIt);
190190 auto &ompLoop =
191- std::get<std::optional<std::variant<parser::DoConstruct,
192- common::Indirection<parser::OpenMPLoopConstruct>>>>(x.t );
193- ompLoop = std::optional<std::variant<parser::DoConstruct,
194- common::Indirection<parser::OpenMPLoopConstruct>>>{
195- std::variant<parser::DoConstruct,
196- common::Indirection<parser::OpenMPLoopConstruct>>{
191+ std::get<std::optional<parser::NestedConstruct>>(x.t );
192+ ompLoop = std::optional<parser::NestedConstruct>{
193+ parser::NestedConstruct{
197194 common::Indirection{std::move (*ompLoopCons)}}};
198195 nextIt = block.erase (nextIt);
199196 } else {
200- messages_.Say (dir .source ,
201- " Only OpenMP Loop Transformation Constructs can be nested within OpenMPLoopConstruct's " _err_en_US,
202- parser::ToUpperCaseLetters (dir .source .ToString ()));
197+ messages_.Say (beginLoopDirective .source ,
198+ " Only Loop Transformation Constructs or Loop Nests can be nested within Loop Constructs " _err_en_US,
199+ parser::ToUpperCaseLetters (beginLoopDirective .source .ToString ()));
203200 }
204201 } else {
205202 missingDoConstruct (dir);
0 commit comments