================ @@ -933,11 +934,19 @@ void OmpStructureChecker::CheckDistLinear( } } -void OmpStructureChecker::Leave(const parser::OpenMPLoopConstruct &) { +void OmpStructureChecker::Leave(const parser::OpenMPLoopConstruct &x) { if (llvm::omp::allSimdSet.test(GetContext().directive)) { ExitDirectiveNest(SIMDNest); } dirContext_.pop_back(); + + assert(!loopStack_.empty() && "Expecting non-empty loop stack"); + const LoopConstruct &top = loopStack_.back(); ---------------- tblah wrote:
nit: I think this variable will be unused on non-assertion builds https://github.com/llvm/llvm-project/pull/115397 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits