[PATCH] D113399: [flang][OpenMP] Add semantic checks of nesting of region about ordered construct
Kiran Chandramohan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 12 10:27:24 PDT 2022
kiranchandramohan requested changes to this revision.
kiranchandramohan added a comment.
This revision now requires changes to proceed.
I have a few comments, mostly Nits.
================
Comment at: flang/lib/Semantics/check-directive-structure.h:271
+ // Check if the given clause is present in the given context
+ const PC *FindClause(DirectiveContext &context, C type) {
+ auto it{context.clauseInfo.find(type)};
----------------
Can you move this closer to the `FindClause` function above and define the above `FindClause` function in terms of this?
```
const PC *FindClause(C type) {
return FindClause(GetContext(), type);
}
```
================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:764-769
+ bool isNestedInDo = false;
+ bool isNestedInDoSIMD = false;
+ bool isNestedInSIMD = false;
+ bool noOrderedClause = false;
+ bool isOrderedClauseWithPara = false;
+ bool isCloselyNestedRegion = true;
----------------
Nit: for all above please use braced initialization
================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:808
+ FindClause(llvm::omp::Clause::OMPC_simd) &&
+ (!isNestedInDoSIMD && !isNestedInSIMD))
+ context_.Say(GetContext().directiveSource,
----------------
Nit: Use curlies
================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:812
+ "SIMD or worksharing-loop SIMD region"_err_en_US);
+ if (isNestedInDo && (noOrderedClause || isOrderedClauseWithPara))
+ context_.Say(GetContext().directiveSource,
----------------
Nit: Use curlies
================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:1140
+ std::int64_t numVar = sinkVectors->v.size();
+ if (orderedValue != numVar)
+ context_.Say(itr->second->source,
----------------
Nit: curlies
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113399/new/
https://reviews.llvm.org/D113399
More information about the llvm-commits
mailing list