[flang-commits] [flang] [flang][OpenMP][RFC] Add support for COPYPRIVATE (PR #73128)

Leandro Lupori via flang-commits flang-commits at lists.llvm.org
Thu Nov 23 11:08:30 PST 2023


================
@@ -2368,7 +2368,8 @@ void OmpAttributeVisitor::CheckDataCopyingClause(
       // either 'private' or 'threadprivate' in enclosing context.
       if (!checkSymbol->test(Symbol::Flag::OmpThreadprivate) &&
           !(HasSymbolInEnclosingScope(symbol, currScope()) &&
-              symbol.test(Symbol::Flag::OmpPrivate))) {
+              (symbol.test(Symbol::Flag::OmpPrivate) ||
+                  symbol.test(Symbol::Flag::OmpFirstPrivate)))) {
----------------
luporl wrote:

1. As FIRSTPRIVATE provides a superset of the functionality provided by PRIVATE, I thought that using it would already imply that the variable is private. I also noticed that gfortran allows FIRSTPRIVATE but doesn't mention it explicitly:
> copyprivate variable 'aaa' is not threadprivate or private in outer context

 Do you think it would be better to mention FIRSTPRIVATE explicitly in the error message?

2. Sure, I'll add a semantic check for it.

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


More information about the flang-commits mailing list