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

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 9 10:45:58 PDT 2021


kiranchandramohan added a comment.

Two first comments. I will do a detailed review later.



================
Comment at: flang/lib/Semantics/resolve-directives.cpp:1346
+  for (const auto &clause : clauseList.v) {
+    if (const auto *allocator{
+            std::get_if<parser::OmpClause::Allocator>(&clause.u)})
----------------
This variable is not used and will cause a warning.


================
Comment at: flang/lib/Semantics/resolve-directives.cpp:1481
+                if (ResolveOmpObjectScope(name) == nullptr &&
+                    ompFlag == Symbol::Flag::OmpAllocateDirective) {
+                  context_.Say(designator.source, // 2.15.3
----------------
I think ResolveOmpObjectScope should only be called if it is an allocate directive. Please reorder the operands of the && operation. The omp-do01.f90 test will also pass.


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