Skip to content

Commit 97ebc97

Browse files
committed
[clang[OpenMP] Revert accidentally included changes from previous commit
1 parent e73cf2f commit 97ebc97

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

clang/lib/Sema/SemaOpenMP.cpp

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18601,22 +18601,14 @@ OMPClause *SemaOpenMP::ActOnOpenMPReductionClause(
1860118601
// worksharing-loop construct, a worksharing-loop SIMD construct, a simd
1860218602
// construct, a parallel worksharing-loop construct or a parallel
1860318603
// worksharing-loop SIMD construct.
18604-
// [5.2:136:1-4] A reduction clause with the inscan reduction-modifier may
18605-
// only appear on a worksharing-loop construct, a simd construct or a
18606-
// combined or composite construct for which any of the aforementioned
18607-
// constructs is a constituent construct and distribute is not a constituent
18608-
// construct.
18609-
if (Modifier == OMPC_REDUCTION_inscan) {
18610-
SmallVector<OpenMPDirectiveKind, 4> LeafOrComposite;
18611-
ArrayRef<OpenMPDirectiveKind> CurrentLOC = getLeafOrCompositeConstructs(
18612-
DSAStack->getCurrentDirective(), LeafOrComposite);
18613-
bool Valid = llvm::any_of(CurrentLOC, [](OpenMPDirectiveKind DK) {
18614-
return llvm::is_contained({OMPD_for, OMPD_simd, OMPD_for_simd}, DK);
18615-
});
18616-
if (!Valid) {
18617-
Diag(ModifierLoc, diag::err_omp_wrong_inscan_reduction);
18618-
return nullptr;
18619-
}
18604+
if (Modifier == OMPC_REDUCTION_inscan &&
18605+
(DSAStack->getCurrentDirective() != OMPD_for &&
18606+
DSAStack->getCurrentDirective() != OMPD_for_simd &&
18607+
DSAStack->getCurrentDirective() != OMPD_simd &&
18608+
DSAStack->getCurrentDirective() != OMPD_parallel_for &&
18609+
DSAStack->getCurrentDirective() != OMPD_parallel_for_simd)) {
18610+
Diag(ModifierLoc, diag::err_omp_wrong_inscan_reduction);
18611+
return nullptr;
1862018612
}
1862118613

1862218614
ReductionData RD(VarList.size(), Modifier);

0 commit comments

Comments
 (0)