[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
Sun Mar 7 13:44:32 PST 2021


kiranchandramohan added inline comments.


================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:619
+      for (auto const &var : alignedNameList) {
+        if (alignedVars.count(var.ToString()) == 1) {
+          context_.Say(
----------------
tskeith wrote:
> kiranchandramohan wrote:
> > 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?
> You can have different symbols with the same name, so these aren't equivalent. In this case, I agree that SymbolSet seems appropriate.
> 
> Even when you want a set of names, it's better to save them as `parser::CharBlock` rather than making new `std::string` objects.
Thanks @tskeith.

@arnamoy10 if you switch to using symbols, then add a test which has a private clause in between the align clauses. 

```
align(x) private(x) align(x)
```



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

https://reviews.llvm.org/D97964



More information about the llvm-commits mailing list