[PATCH] D92672: [flang][openacc] Enforce restriction on routine directive and clauses

sameeran joshi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 16 04:28:28 PST 2020


sameeranjoshi added a comment.

Thanks for patch.
A few comments below.



================
Comment at: flang/include/flang/Parser/parse-tree.h:3823
+  UNION_CLASS_BOILERPLATE(AccBindClause);
+  std::variant<Name, ScalarDefaultCharExpr> u;
+  CharBlock source;
----------------
Sorry I couldn't find where is this defined in standard.
Could you please point that?


================
Comment at: flang/lib/Semantics/check-acc-structure.cpp:221
+    const Scope &containingScope{GetProgramUnitContaining(scope)};
+    if (containingScope.kind() == Scope::Kind::Module) {
+      context_.Say(GetContext().directiveSource,
----------------
Where is the check for `inside subroutine/function as well as inside interface` done?
Sorry I might be missing something, but I see you check only for the module scope of the construct.


================
Comment at: flang/lib/Semantics/check-acc-structure.cpp:224
+          "ROUTINE directive without name must appear within the specification "
+          "port of a subroutine or function definition, or within an interface "
+          "body for a subroutine or function in an interface block"_err_en_US);
----------------
part


================
Comment at: flang/test/Semantics/acc-routine-validity.f90:19
+
+  !ERROR: Internal: no symbol found for 'dummy'
+  !$acc routine(dummy) seq
----------------
Why isn't it getting resolved though having a resolving function defined above?
Do you think there is a need for a more better resolver, which I tried in 
https://reviews.llvm.org/D93051 with the latest diff?


================
Comment at: flang/test/Semantics/acc-routine-validity.f90:79
+
+end module openacc_routine_validity
----------------
Tests for `allowedOnceClauses` ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92672



More information about the llvm-commits mailing list