[flang-commits] [flang] [flang][OpenMP] Make static duration variables default to shared DSA (PR #142783)
Leandro Lupori via flang-commits
flang-commits at lists.llvm.org
Thu Jun 5 11:37:53 PDT 2025
================
@@ -2310,6 +2310,8 @@ void OmpAttributeVisitor::CreateImplicitSymbols(const Symbol *symbol) {
bool targetDir = llvm::omp::allTargetSet.test(dirContext.directive);
bool parallelDir = llvm::omp::allParallelSet.test(dirContext.directive);
bool teamsDir = llvm::omp::allTeamsSet.test(dirContext.directive);
+ bool isStaticStorageDuration =
+ symbol->flags().test(Symbol::Flag::InDataStmt);
----------------
luporl wrote:
`InDataStmt` is present only when the variable has an initializer.
In `implicit_dsa_test9_mod`, if `complex tm3a/(0,0)/` is replaced by `complex tm3a` the test fails.
You could try to do something similar to what is done in `IsSymbolPrivate`, checking, for instance, if the symbol owner is a module, if it has the SAVE attribute, etc. BTW, it would be good to review its logic.
Also, some flags are present only in the original symbol (and not in host association or use symbols), so it's better to use `symbol->GetUltimate().flags()`, as `CreateImplicitSymbols` is called for each `parser::Name`.
https://github.com/llvm/llvm-project/pull/142783
More information about the flang-commits
mailing list