[PATCH] D90210: [flang] [OpenMP 4.5] Add semantic checks for OpenMP Private clause

Tim Keith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 25 16:36:58 PST 2020


tskeith added inline comments.


================
Comment at: flang/lib/Semantics/resolve-directives.cpp:1213-1217
+  // Identify all the namelist objects
+  GetNamelistSymbols(namelistSymbols, currScope().parent());
+  if (ultimateScope.IsModule()) {
+    GetNamelistSymbols(namelistSymbols, ultimateScope);
+  }
----------------
kiranchandramohan wrote:
> kiranchandramohan wrote:
> > Calling GetNamelistSymbols for finding all the namelist objects each time CheckObjectInNameList (for each variable in the private list) is called seems to be not optimal.
> > 
> > @tskeith Is there a better way to check whether a variable is part of a namelist?
> I checked with others,  what Peter suggested is to collect all the namelist groups' symbols once and then use it for the private clause checks. Can you try that?
Another option would be to add an `InNamelist` flag to Symbol::Flags, similar to `InDataStmt`. It's probably easy to set that in `resolve-names.cpp`.


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

https://reviews.llvm.org/D90210



More information about the llvm-commits mailing list