[PATCH] D90184: [flang][openacc] Semantic check for cache directive

Valentin Clement via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 24 12:54:04 PST 2020

clementval marked 2 inline comments as done.
clementval added inline comments.

Comment at: flang/lib/Semantics/resolve-directives.cpp:440-450
+  const evaluate::DataRef dataRef{*(name.symbol)};
+  return std::visit(
+      common::visitors{
+          [](const evaluate::SymbolRef &ref) { return ref->Rank() > 0; },
+          [](const evaluate::ArrayRef &aref) {
+            return aref.base().IsSymbol() ||
+                aref.base().GetComponent().base().Rank() == 0;
kiranchandramohan wrote:
> #just-saying: It will be useful if there is some general guidelines on when to use evaluate::DataRef.
Sure, maybe adding something in the semantic check documentation would make sense. What do you think? 

Comment at: flang/test/Semantics/acc-clause-validity.f90:499
+  !$acc cache(t%arr)
+  !ERROR: Only array element or subarray are allowed in CACHE directive
kiranchandramohan wrote:
> Can you add one more test with arr(1:5)%s?
I added couple of tests in that sense `arr(1:5)%s` is not possible since `arr` and `s` are member of `t` at the same level. 

  rG LLVM Github Monorepo



More information about the llvm-commits mailing list