[flang-commits] [flang] [flang][OpenMP] Privatize vars referenced in statement functions (PR #103390)
Leandro Lupori via flang-commits
flang-commits at lists.llvm.org
Tue Aug 13 12:11:12 PDT 2024
================
@@ -2126,23 +2152,59 @@ void OmpAttributeVisitor::Post(const parser::Name &name) {
// it would have the private flag set.
// This would make x appear to be defined in p2, causing it to be
// privatized in p2 and its privatization in p1 to be skipped.
- auto makePrivateSymbol = [&](Symbol::Flag flag) {
- Symbol *hostSymbol =
- lastDeclSymbol ? lastDeclSymbol : &symbol->GetUltimate();
- lastDeclSymbol = DeclarePrivateAccessEntity(
- *hostSymbol, flag, context_.FindScope(dirContext.directiveSource));
- return lastDeclSymbol;
+ // TODO Move the lambda functions below to a separate class.
----------------
luporl wrote:
It would be better to either:
1. Move the lambda functions below to a separate class, or
2. Move the code that handles Implicitly determined DSAs to a separate function and, to handle statement functions, call it for each symbol referenced in them.
This code shall be refactored if the current approach to handle privatization of statement functions' symbols is approved by reviewers.
https://github.com/llvm/llvm-project/pull/103390
More information about the flang-commits
mailing list