[PATCH] D97964: [flang][OpenMP] Add semantic check for occurrence of multiple list items in aligned clause for simd directive

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 6 14:58:10 PST 2021


kiranchandramohan added a subscriber: tskeith.
kiranchandramohan added inline comments.


================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:610
+    // A list-item cannot appear in more than one aligned clause
+    std::set<std::string> alignedVars = {};
+    bool foundErr = false;
----------------
I think alignedVars{} is preferred.


================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:619
+      for (auto const &var : alignedNameList) {
+        if (alignedVars.count(var.ToString()) == 1) {
+          context_.Say(
----------------
Would it be better use the symbol corresponding to the name? And use a SymbolSet to store the symbols associated with the variables?

@tskeith In general what is preferable, comparing names of variables or symbols associated with them?


================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:630
+      // Report only once for multiple error within the same directive
+      if (foundErr)
+        break;
----------------
Can this go into the condition portion of the for loop from which it is breaking?


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

https://reviews.llvm.org/D97964



More information about the llvm-commits mailing list