OSDN Git Service

[Flang][openmp][5/5] Make dist_schedule clause part of OmpClause
authorsameeran joshi <sameeranjayant.joshi@amd.com>
Mon, 21 Dec 2020 17:14:22 +0000 (22:44 +0530)
committerSameeran joshi <joshisameeran17@gmail.com>
Tue, 22 Dec 2020 09:02:33 +0000 (14:32 +0530)
commit1a6f43991ff7e5249f24660074f0dd784aeecd5f
tree15c856a8c2f76b26f5b52243fa2ede27a916acec
parent2f5569f6f67a30f7774f7c2d2f3d726752a862ae
[Flang][openmp][5/5] Make dist_schedule clause part of OmpClause

After discussion in `D93482` we found that the some of the clauses were not
following the common OmpClause convention.

The benefits of using OmpClause:
- Functionalities from structure checker are mostly aligned to work with
  `llvm::omp::Clause`.
- The unparsing as well can take advantage.
- Homogeneity with OpenACC and rest of the clauses in OpenMP.
- Could even generate the parser with TableGen, when there is homogeneity.
- It becomes confusing when to use `flangClass` and `flangClassValue` inside
  TableGen, if incase we generate parser using TableGen we could have only a
  single `let expression`.

This patch makes `OmpDistScheduleClause` clause part of `OmpClause`.
The unparse function for `OmpDistScheduleClause` is adapted since the keyword
and parenthesis are issued by the corresponding unparse function for
`parser::OmpClause::DistSchedule`.

Reviewed By: clementval, kiranktp

Differential Revision: https://reviews.llvm.org/D93644
flang/include/flang/Parser/dump-parse-tree.h
flang/include/flang/Parser/parse-tree.h
flang/lib/Parser/openmp-parsers.cpp
flang/lib/Parser/unparse.cpp
flang/lib/Semantics/check-omp-structure.cpp
flang/lib/Semantics/check-omp-structure.h
llvm/include/llvm/Frontend/OpenMP/OMP.td