[PATCH] D91920: [Flang] [OpenMP] Add semantic checks for OpenMP firstprivate , lastprivate and copyprivate clauses

Praveen G via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 22 11:01:35 PST 2020


praveen added a comment.

@kiranchandramohan  In the test file //omp-clause-validity01.f90// , the following no symbol found errors are not being thrown.

  !ERROR: Internal: no symbol found for 'i'
  !$omp taskwait depend(sink:i-1)
  
  !ERROR: Internal: no symbol found for 'first'
  !$omp critical (first)

Since the errors related to copyprivate clause in omp-clause-validity01.f90 (line numbers 324 and 340 above)  being thrown as part of the checks for //**copyprivate in resolve-directives.cpp**// are marked as //**fatal **//errors , the flag //**errorOnUnresolvedName_**// is being set to **false** and the no symbol found error is not being thrown.

   RewriteMutator(SemanticsContext &context)
   : errorOnUnresolvedName_{!context.AnyFatalError()},
      messages_{context.messages()} {}
  
  void RewriteMutator::Post(parser::Name &name) {
     if (!name.symbol && errorOnUnresolvedName_) {
       messages_.Say(name.source, "Internal: no symbol found for '%s'"_err_en_US,
         name.source);
      }
   }

Is it not necessary to throw the "no symbol found" error if there is any error marked as fatal while resolving the directives ?

Should all the checks related to copyprivate be moved to check-omp-structure.cpp?

Can you please suggest the approach to follow for these changes?

Thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91920



More information about the llvm-commits mailing list