[flang-commits] [PATCH] D93051: [Flang][openmp] Add semantic checks for OpenMP critical construct.

sameeran joshi via Phabricator via flang-commits flang-commits at lists.llvm.org
Thu Dec 10 09:35:44 PST 2020


sameeranjoshi created this revision.
sameeranjoshi added reviewers: kiranchandramohan, clementval, kiranktp, tskeith, klausler.
Herald added subscribers: guansong, yaxunl.
sameeranjoshi requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.
Herald added a project: LLVM.

Name resolution was probably failing in bug reported at
https://bugs.llvm.org/show_bug.cgi?id=48145
as the omp critical construct needs a new symbol for the name which was
missing. This is fixed by creating a new symbol during name resolution
for a new flag `OmpCriticalLock`.

Upgrade to OMP-5.0 standard.

Checks for restrictions from OMP-5.0 are added.

- If a name is specified on a critical directive, the same name must also be specified on the

end critical directive.

- If no name appears on the critical directive, no name can appear on the end critical

directive.

- Unless the effect is as if hint(omp_sync_hint_none) was specified, the critical

construct must specify a name.

A new routine `CheckNameMatching` mostly follows `CheckEndName` from `resolve-labels.cpp`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D93051

Files:
  flang/include/flang/Parser/parse-tree.h
  flang/lib/Parser/openmp-parsers.cpp
  flang/lib/Parser/unparse.cpp
  flang/lib/Semantics/check-directive-structure.h
  flang/lib/Semantics/check-omp-structure.cpp
  flang/lib/Semantics/check-omp-structure.h
  flang/lib/Semantics/resolve-directives.cpp
  flang/test/Semantics/omp-clause-validity01.f90
  flang/test/Semantics/omp-sync-critical01.f90
  flang/test/Semantics/omp-sync-critical02.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93051.310940.patch
Type: text/x-patch
Size: 15792 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20201210/a0a895ae/attachment-0001.bin>


More information about the flang-commits mailing list