Skip to content

Commit 865ca2e

Browse files
committed
R5: Addressing a few more review comments
1 parent 9b8dbd9 commit 865ca2e

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

flang/include/flang/Semantics/openmp-directive-sets.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,6 @@ static const OmpDirectiveSet allTeamsSet{
187187
// Directive sets for groups of multiple directives
188188
//===----------------------------------------------------------------------===//
189189

190-
// Directive sets for parent directives that do allow/not allow a construct
191-
static const OmpDirectiveSet scanAllowedSet{allDoSet | allSimdSet};
192-
193190
// Directive sets that form Composite constructs
194191
static const OmpDirectiveSet allDistributeParallelDoSet{
195192
allDistributeSet & allParallelSet & allDoSet};
@@ -293,6 +290,11 @@ static const OmpDirectiveSet workShareSet{
293290
} | allDoSet,
294291
};
295292

293+
//===----------------------------------------------------------------------===//
294+
// Directive sets for parent directives that do allow/not allow a construct
295+
static const OmpDirectiveSet scanParentAllowedSet{allDoSet | allSimdSet};
296+
//===----------------------------------------------------------------------===//
297+
296298
//===----------------------------------------------------------------------===//
297299
// Directive sets for allowed/not allowed nested directives
298300
//===----------------------------------------------------------------------===//

flang/lib/Semantics/check-omp-structure.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2990,7 +2990,7 @@ void OmpStructureChecker::CheckReductionModifier(
29902990
// or "simd" directive.
29912991
// The worksharing-loop directives are OMPD_do and OMPD_for. Only the
29922992
// former is allowed in Fortran.
2993-
if (!llvm::omp::scanAllowedSet.test(dirCtx.directive)) {
2993+
if (!llvm::omp::scanParentAllowedSet.test(dirCtx.directive)) {
29942994
context_.Say(GetContext().clauseSource,
29952995
"Modifier 'INSCAN' on REDUCTION clause is only allowed with "
29962996
"worksharing-loop, worksharing-loop simd, "

flang/lib/Semantics/resolve-directives.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1644,7 +1644,7 @@ bool OmpAttributeVisitor::Pre(
16441644
"Exactly one of `exclusive` or `inclusive` clause is expected"_err_en_US);
16451645
}
16461646
if (!parentContext ||
1647-
!llvm::omp::scanAllowedSet.test(parentContext->directive)) {
1647+
!llvm::omp::scanParentAllowedSet.test(parentContext->directive)) {
16481648
context_.Say(standaloneDir.source,
16491649
"Orphaned `omp scan` directives are prohibited; perhaps you forgot "
16501650
"to enclose the directive in to a worksharing loop, a worksharing "

0 commit comments

Comments
 (0)