[flang-commits] [flang] [flang][OpenMP][Semantics] resolve objects in the flush arg list (PR #139522)

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Mon May 12 07:59:40 PDT 2025


================
@@ -409,6 +409,19 @@ class OmpAttributeVisitor : DirectiveAttributeVisitor<llvm::omp::Directive> {
   }
   void Post(const parser::OpenMPDepobjConstruct &) { PopContext(); }
 
+  bool Pre(const parser::OpenMPFlushConstruct &x) {
+    PushContext(x.source, llvm::omp::Directive::OMPD_flush);
+    for (auto &arg : x.v.Arguments().v) {
+      if (auto *locator{std::get_if<parser::OmpLocator>(&arg.u)}) {
+        if (auto *object{std::get_if<parser::OmpObject>(&locator->u)}) {
+          ResolveOmpObject(*object, Symbol::Flag::OmpDependObject);
----------------
kiranchandramohan wrote:

Assuming this is a copy paste error. This is not a `DependObject`, so I think adding the `Symbol::Flag::OmpDependObject` is probably not right.

What do we want to do here? Is it just resolving the names in the flush argument list to the appropriate Fortran declarations? If so, we should use `ResolveName`.

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


More information about the flang-commits mailing list