summaryrefslogtreecommitdiff
path: root/flang/lib/Lower/OpenMP/ClauseProcessor.cpp
diff options
context:
space:
mode:
authorKareem Ergawy <kareem.ergawy@amd.com>2025-05-30 06:22:29 +0200
committerGitHub <noreply@github.com>2025-05-30 06:22:29 +0200
commitf5d3470d425f9ee99436bfdc0c1ae1ce03bab385 (patch)
tree2ae0414f956f4d6818a0e1dac487738cc1f98784 /flang/lib/Lower/OpenMP/ClauseProcessor.cpp
parentbfd7024b0d665de02abbfc7b16f593020d2c12c9 (diff)
[flang][OpenMP] Allow structure component in `task depend` clauses (#141923)
Even though the spec (version 5.2) prohibits strcuture components from being specified in `depend` clauses, this restriction is not sensible. This PR rectifies the issue by lifting that restriction and allowing structure components in `depend` clauses (which is allowed by OpenMP 6.0).
Diffstat (limited to 'flang/lib/Lower/OpenMP/ClauseProcessor.cpp')
-rw-r--r--flang/lib/Lower/OpenMP/ClauseProcessor.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/flang/lib/Lower/OpenMP/ClauseProcessor.cpp b/flang/lib/Lower/OpenMP/ClauseProcessor.cpp
index a1fff6c5b7d9..f9a6f9506f51 100644
--- a/flang/lib/Lower/OpenMP/ClauseProcessor.cpp
+++ b/flang/lib/Lower/OpenMP/ClauseProcessor.cpp
@@ -947,6 +947,11 @@ bool ClauseProcessor::processDepend(lower::SymMap &symMap,
converter.getCurrentLocation(), converter, expr, symMap, stmtCtx);
dependVar = entity.getBase();
}
+ } else if (evaluate::isStructureComponent(*object.ref())) {
+ SomeExpr expr = *object.ref();
+ hlfir::EntityWithAttributes entity = convertExprToHLFIR(
+ converter.getCurrentLocation(), converter, expr, symMap, stmtCtx);
+ dependVar = entity.getBase();
} else {
semantics::Symbol *sym = object.sym();
dependVar = converter.getSymbolAddress(*sym);