[PATCH] D106538: [flang][OpenMP] Add semantic check for cancellation nesting

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 6 15:57:24 PDT 2021


kiranchandramohan accepted this revision.
kiranchandramohan added a comment.
This revision is now accepted and ready to land.

LGTM. Thanks for the patch and the patience.



================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:885
+    const parser::CharBlock &source, const parser::OmpCancelType::Type &type) {
+  if (CurrentDirectiveIsNested()) {
+    OmpDirectiveSet allowedTaskgroupSet{
----------------
Nit: Add a comment here on what is checked in the if portion.


================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:904
+        eligibleCancellation = true;
+        if (dirContext_.size() >= 3) {
+          if (GetContextParent().directive == llvm::omp::Directive::OMPD_task ||
----------------
Nit: Can you add a comment signifying the importance of 3?


================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:957
+    }
+  } else {
+    switch (type) {
----------------
Nit: Add a comment here on what is checked in the else portion.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106538/new/

https://reviews.llvm.org/D106538



More information about the llvm-commits mailing list