[flang] [llvm] [flang][OpenMP] Update handling of DEPEND clause (PR #113620)
Krzysztof Parzyszek via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 25 06:02:19 PDT 2024
kparzysz wrote:
Background: The OpenMP spec states that a common block name cannot appear in the locator list, so I wanted to emit a diagnostic for this. That wasn't hard, but I was seeing an additional unexpected error about an unresolved symbol in the common block. I tracked it down to the symbol resolution never visiting common blocks in OmpObjectList.
The reason it happened is that `ResolveNamesVisitor` (which is the main driver of the AST walk) didn't have a Pre/Post handler for an individual `parser::Name` (which is used to represent a common block name). Instead, each potential owner of such a name would deal with it separately.
Moreover, in the `OmpAttributeVisitor` we had a Pre handler for OmpDependClause, which only visited the sink vector and returned "false". This return value would prevent recursing into that object any further. To allow visiting the OmpObjectList, without interfering with the clause traveral, I extracted the visit of the sink vector into its own handler. Finally, I added a post-visitor for OmpObjectList to resolve any remaining common blocks. [1]
[1] Named common blocks are valid list items. There are some clauses that disallow it. I don't think we handled all of that correctly in all cases, and this should get us closer to that.
https://github.com/llvm/llvm-project/pull/113620
More information about the llvm-commits
mailing list