From bcbd16fba9123a046216971714eed230e074cc7e Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Thu, 13 Nov 2025 13:33:35 -0600 Subject: [PATCH] [flang][OpenMP] Remove dead code left over after PR143715, NFC In PrivatizeAssociatedLoopIndexAndCheckLoopLevel we now descend all the way down the chain of nested OpenMPLoopDirectives ahead of time, so innerMostNest can only be a nullptr, or a DoConstruct. --- flang/lib/Semantics/resolve-directives.cpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/flang/lib/Semantics/resolve-directives.cpp b/flang/lib/Semantics/resolve-directives.cpp index 224c69163b85e..f1658943ab2e1 100644 --- a/flang/lib/Semantics/resolve-directives.cpp +++ b/flang/lib/Semantics/resolve-directives.cpp @@ -2446,22 +2446,6 @@ void OmpAttributeVisitor::PrivatizeAssociatedLoopIndexAndCheckLoopLevel( } } CheckAssocLoopLevel(level, GetAssociatedClause()); - } else if (const auto *loop{std::get_if< - common::Indirection>( - innerMostNest)}) { - const parser::OmpDirectiveSpecification &beginSpec{ - loop->value().BeginDir()}; - const parser::OmpDirectiveName &beginName{beginSpec.DirName()}; - if (beginName.v != llvm::omp::Directive::OMPD_unroll && - beginName.v != llvm::omp::Directive::OMPD_tile) { - context_.Say(GetContext().directiveSource, - "Only UNROLL or TILE constructs are allowed between an OpenMP Loop Construct and a DO construct"_err_en_US, - parser::ToUpperCaseLetters(llvm::omp::getOpenMPDirectiveName( - GetContext().directive, version) - .str())); - } else { - PrivatizeAssociatedLoopIndexAndCheckLoopLevel(loop->value()); - } } else { context_.Say(GetContext().directiveSource, "A DO loop must follow the %s directive"_err_en_US,