[flang-commits] [PATCH] D94087: [flang][openmp]At most one threads, simd and depend clause can appear on OpenMP ORDERED construct.
Kiran Chandramohan via Phabricator via flang-commits
flang-commits at lists.llvm.org
Tue Jan 19 15:00:33 PST 2021
kiranchandramohan requested changes to this revision.
kiranchandramohan added inline comments.
This revision now requires changes to proceed.
================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:138
-void OmpStructureChecker::Leave(const parser::OpenMPBlockConstruct &) {
+void OmpStructureChecker::Leave(const parser::OpenMPBlockConstruct &x) {
+ const auto &beginBlockDir{std::get<parser::OmpBeginBlockDirective>(x.t)};
----------------
Why is this handled on Leave and not Enter like others?
================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:239
void OmpStructureChecker::Leave(
- const parser::OpenMPSimpleStandaloneConstruct &) {
+ const parser::OpenMPSimpleStandaloneConstruct &x) {
+ const auto &beginStandaloneDir{
----------------
Same question here.
================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:838-875
+ const parser::OmpDependClause::Source *foundSource{nullptr};
+ const parser::OmpDependClause::Source *foundSourceFromEnd{nullptr};
+ const parser::OmpDependClause::Sink *foundSink{nullptr};
+ for (const auto *vecElem : ompDependVector) {
+ foundSource = std::get_if<parser::OmpDependClause::Source>(&vecElem->u);
+ if (foundSource != nullptr) {
+ break;
----------------
```
struct OmpDependenceType {
ENUM_CLASS(Type, In, Out, Inout, Source, Sink)
WRAPPER_CLASS_BOILERPLATE(OmpDependenceType, Type);
};
struct OmpDependClause {
....
struct InOut {
TUPLE_CLASS_BOILERPLATE(InOut);
std::tuple<OmpDependenceType, std::list<Designator>> t;
};
std::variant<Source, Sink, InOut> u;
};
```
Can you use OmpDependenceType in OmpDependClause to simplify this logic? I think you can just count the source, sink and print out the error messages.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94087/new/
https://reviews.llvm.org/D94087
More information about the flang-commits
mailing list