[PATCH] D91159: [flang]Add General Semantic Checks for Allocate Directive

Irina Dobrescu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 18 03:53:12 PST 2020


Rin marked 7 inline comments as done.
Rin added inline comments.


================
Comment at: flang/lib/Semantics/resolve-directives.cpp:1057
+void OmpAttributeVisitor::Post(const parser::OpenMPExecutableAllocate &x) {
+  if (inTarget && !hasAllocator)
+    // TODO: expand this check to exclude the case when a requires
----------------
clementval wrote:
> I would remove those two globals and for the `inTarget` you can query the context stack. There is an example in OpenACC (https://github.com/llvm/llvm-project/blob/d02eac0c000984865dd1ce2474715538f8439470/flang/lib/Semantics/check-acc-structure.cpp#L67)
> 
> For the `hasAllocator` you can probably go through the list here to get the information. 
Thanks for your example @clementval. It was really helpful.


================
Comment at: flang/lib/Semantics/resolve-directives.cpp:1136
 
+Symbol *OmpAttributeVisitor::ResolveOmpObjectScope(const parser::Name *name) {
+
----------------
clementval wrote:
> Can you reuse the `ResolveOmpName` function instead of this one? 
I don't see how ResolveOmpName checks the Scope similarly to the way ResolveOmpObjectScope does. I'm not sure how I could reuse it. I'll take another look at it though.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91159



More information about the llvm-commits mailing list