[flang-commits] [flang] [flang][OpenMP] Fix copyprivate semantic checks (PR #95799)

Leandro Lupori via flang-commits flang-commits at lists.llvm.org
Mon Jul 22 11:56:30 PDT 2024


================
@@ -2540,20 +2554,58 @@ void ResolveOmpTopLevelParts(
   });
 }
 
-void OmpAttributeVisitor::CheckDataCopyingClause(
-    const parser::Name &name, const Symbol &symbol, Symbol::Flag ompFlag) {
-  const auto *checkSymbol{&symbol};
+static bool IsSymbolInCommonBlock(const Symbol &symbol) {
+  // If there are many symbols in common blocks, going through them all can be
----------------
luporl wrote:

Thanks for the review!

Comment changed to a TODO.

For now I don't expect the current implementation of `IsSymbolInCommonBlock` to have a big impact on performance, since it's used only when checking symbols in `copyprivate` clauses. But on programs with an unusually high number of symbols in common blocks and `copyprivate` clauses, or if this predicate function starts to be used within other checks, then it could be a problem.

https://github.com/llvm/llvm-project/pull/95799


More information about the flang-commits mailing list