[flang-commits] [flang] [llvm] [Flang] Add semantic check for usage of COPYPRIVATE and NOWAIT clauses (PR #73486)

Leandro Lupori via flang-commits flang-commits at lists.llvm.org
Mon Nov 27 11:17:47 PST 2023


================
@@ -745,7 +745,12 @@ void OmpStructureChecker::Enter(const parser::OmpEndLoopDirective &x) {
   // 2.7.1 end-do -> END DO [nowait-clause]
   // 2.8.3 end-do-simd -> END DO SIMD [nowait-clause]
   case llvm::omp::Directive::OMPD_do:
+    PushContextAndClauseSets(dir.source, llvm::omp::Directive::OMPD_end_do);
+    SetClauseSets(dir.v);
----------------
luporl wrote:

Won't `SetClauseSets()` just overwrite the clauses set by `PushContextAndClauseSets()`?
Wouldn't it be better to use `PushContext(dir.source, llvm::omp::Directive::OMPD_end_do)` followed by `SetClauseSets(dir.v)`?

https://github.com/llvm/llvm-project/pull/73486


More information about the flang-commits mailing list