[PATCH] D90538: [Flang][OpenMP] Fix 'Internal: no symbol found' for OpenMP aligned and linear clause.

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 2 13:14:56 PST 2020


kiranchandramohan added a comment.

Two more questions.



================
Comment at: flang/lib/Semantics/resolve-directives.cpp:272-289
+  bool Pre(const parser::OmpLinearClause &x) {
+    const std::list<parser::Name> *linearList{nullptr};
+    std::visit(common::visitors{
+                   [&](const parser::OmpLinearClause::WithoutModifier
+                           &linearWithoutModifier) {
+                     linearList = &(linearWithoutModifier.names);
+                   },
----------------
Would one of the following work and would it be better?

->
```
  bool Pre(const parser::OmpLinearClause::WithoutModifier &x) {
    ResolveOmpNameList(x.names, Symbol::Flag::OmpLinear);
    return false;
  }
  bool Pre(const parser::OmpLinearClause::WithModifier &x) {
    ResolveOmpNameList(x.names, Symbol::Flag::OmpLinear);
    return false;
  }
```

->
```
  bool Pre(const parser::OmpLinearClause &x) {
    std::visit(common::visitors{
                   [&](const parser::OmpLinearClause::WithoutModifier
                           &linearWithoutModifier) {
                     ResolveOmpNameList(linearWithoutModifier.names, Symbol::Flag::OmpLinear);
                   },
                   [&](const parser::OmpLinearClause::WithModifier
                           &linearWithModifier) {
                     ResolveOmpNameList(linearWithModifier.names, Symbol::Flag::OmpLinear);

                   },
               },
        x.u);
    return false;
  }
```


================
Comment at: flang/lib/Semantics/resolve-directives.cpp:288
+    }
+    return true;
+  }
----------------
Can this be false here?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90538/new/

https://reviews.llvm.org/D90538



More information about the llvm-commits mailing list