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

Irina Dobrescu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 14 09:53:41 PST 2020


Rin added inline comments.


================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:193
 
+void OmpStructureChecker::CheckObjectListStructure(
+    const parser::CharBlock &source, const parser::OmpObjectList &objList) {
----------------
kiranchandramohan wrote:
> Can you reuse the following function?
> void OmpStructureChecker::CheckIsVarPartOfAnotherVar
Yes, this function wasn't yet here when I started working on this patch. I will reuse this function instead.


================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:431-471
-void OmpStructureChecker::Enter(const parser::OmpClause::Priority &x) {
-  CheckAllowed(llvm::omp::Clause::OMPC_priority);
-  RequiresPositiveParameter(llvm::omp::Clause::OMPC_priority, x.v);
-}
-void OmpStructureChecker::Enter(const parser::OmpClause::Private &) {
-  CheckAllowed(llvm::omp::Clause::OMPC_private);
-}
----------------
clementval wrote:
> kiranchandramohan wrote:
> > Why are all these removed in this patch?
> This would break any allowance check on these clauses. I don't see the reason to remove them in this patch. 
I think I was getting some errors about redefinition of those checks. I'll look into this and re add them next update.


================
Comment at: flang/lib/Semantics/resolve-directives.cpp:119
     Walk(std::get<std::list<parser::OpenACCDeclarativeConstruct>>(x.t));
-    return false;
+    return true;
   }
----------------
clementval wrote:
> kiranchandramohan wrote:
> > Why is this change in OpenACC required?
> Please revert this change. OpenACC part should not be touch for OpenMP related code. 
It's not, I will revert this next update.


================
Comment at: flang/test/Semantics/omp-allocate01.f90:25
+end subroutine allocate
\ No newline at end of file

----------------
kiranchandramohan wrote:
> Check newline in all test files.
Will do.


================
Comment at: flang/test/Semantics/omp-allocate03.f90:15
+  !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear in an ALLOCATE directive
+  !$omp allocate(my_var%array)
+  
----------------
I notice here I took care of only the DeclarativeAllocate case and not the Executable one. I will change this in the next update.


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