Author: Krzysztof Parzyszek Date: 2024-07-15T09:10:11-05:00 New Revision: 97ebc9794941d9e73792ab9deab7abafaf750a17
URL: https://github.com/llvm/llvm-project/commit/97ebc9794941d9e73792ab9deab7abafaf750a17 DIFF: https://github.com/llvm/llvm-project/commit/97ebc9794941d9e73792ab9deab7abafaf750a17.diff LOG: [clang[OpenMP] Revert accidentally included changes from previous commit Added: Modified: clang/lib/Sema/SemaOpenMP.cpp Removed: ################################################################################ diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index c1a58fc7f2076..bc6894018065f 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -18601,22 +18601,14 @@ OMPClause *SemaOpenMP::ActOnOpenMPReductionClause( // worksharing-loop construct, a worksharing-loop SIMD construct, a simd // construct, a parallel worksharing-loop construct or a parallel // worksharing-loop SIMD construct. - // [5.2:136:1-4] A reduction clause with the inscan reduction-modifier may - // only appear on a worksharing-loop construct, a simd construct or a - // combined or composite construct for which any of the aforementioned - // constructs is a constituent construct and distribute is not a constituent - // construct. - if (Modifier == OMPC_REDUCTION_inscan) { - SmallVector<OpenMPDirectiveKind, 4> LeafOrComposite; - ArrayRef<OpenMPDirectiveKind> CurrentLOC = getLeafOrCompositeConstructs( - DSAStack->getCurrentDirective(), LeafOrComposite); - bool Valid = llvm::any_of(CurrentLOC, [](OpenMPDirectiveKind DK) { - return llvm::is_contained({OMPD_for, OMPD_simd, OMPD_for_simd}, DK); - }); - if (!Valid) { - Diag(ModifierLoc, diag::err_omp_wrong_inscan_reduction); - return nullptr; - } + if (Modifier == OMPC_REDUCTION_inscan && + (DSAStack->getCurrentDirective() != OMPD_for && + DSAStack->getCurrentDirective() != OMPD_for_simd && + DSAStack->getCurrentDirective() != OMPD_simd && + DSAStack->getCurrentDirective() != OMPD_parallel_for && + DSAStack->getCurrentDirective() != OMPD_parallel_for_simd)) { + Diag(ModifierLoc, diag::err_omp_wrong_inscan_reduction); + return nullptr; } ReductionData RD(VarList.size(), Modifier); _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits