[PATCH] D92735: [Flang] [OpenMP] Add semantic checks for invalid branch into/from OpenMP constructs

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 24 14:59:28 PST 2021


kiranchandramohan added inline comments.


================
Comment at: flang/lib/Semantics/resolve-directives.cpp:240
+      }
+      targetLabels_.emplace(label, thisContext);
+      auto range{sourceLabels_.equal_range(label)};
----------------
Add a few comments on what is done on seeing a statement with a label.


================
Comment at: flang/lib/Semantics/resolve-directives.cpp:345
 
+  void Post(const parser::GotoStmt &gotoStmt) { CheckSourceLabel(gotoStmt.v); }
+  void Post(const parser::ComputedGotoStmt &computedGotoStmt) {
----------------
Add a few comments on what is done on seeing a statement which can cause a jump to a label.


================
Comment at: flang/lib/Semantics/resolve-directives.cpp:1504
+    if (!sourceContext) {
+      context_.Say(
+          source, "invalid entry to OpenMP structured block"_err_en_US);
----------------
Can the error message also contain the entry point into the OpenMP region? CheckBranchesIntoDoBody prints error messages like that


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

https://reviews.llvm.org/D92735



More information about the llvm-commits mailing list