[flang] [OpenMP] Implement no-multiple-appearance rule for DSA Clauses
DSA stands for Data-Sharing Attribute. This work is part of the Name Resolution for OpenMP framework (data-refs on clauses part) Based on 2.15.3: A list item that specifies a given variable may not appear in more than one clause on the same directive, except that a variable may be specified in both firstprivate and lastprivate clauses. Through a temporary `std::set` of `const Symbol *` to keep track of all the symbols on a certain OpenMP directive, we can determine whether a variable `Name` (or `Symbol`, more accurately) has already appeared on another DSA clause already, with the exception of FIRSTPRIVATE clause and LASTPRIVATE clause. This rule applies to `/COMMON block/` also and the source provenance shows on error message points to the `Name` between slashes. Added two more tests and changed some existing tests to accommodate this commit. I intend to keep the `omp-clause-validity01.f90` test to do the validity checks only. Original-commit: flang-compiler/f18@0d7828c21e8dfe02e470a861178b7747100516ae
Loading
Please sign in to comment