Skip to content

Commit 923fafb

Browse files
author
Chandra Ghale
committed
Addressed Review comments
1 parent 4499a73 commit 923fafb

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

clang/include/clang/AST/OpenMPClause.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3772,7 +3772,7 @@ class OMPReductionClause final
37723772
void setPrivateVariableReductionFlags(ArrayRef<bool> Flags) {
37733773
assert(Flags.size() == varlist_size() &&
37743774
"Number of private flags does not match vars");
3775-
std::copy(Flags.begin(), Flags.end(), getTrailingObjects<bool>());
3775+
llvm::copy(Flags,getTrailingObjects<bool>());
37763776
}
37773777

37783778
/// Get the list of help private variable reduction flags

clang/lib/Sema/SemaOpenMP.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18955,18 +18955,16 @@ static bool actOnOMPReductionKindClause(
1895518955
OpenMPDirectiveKind CurrDir = Stack->getCurrentDirective();
1895618956
OpenMPDirectiveKind ParentDir = Stack->getParentDirective();
1895718957
// Check if the construct is orphaned (has no enclosing OpenMP context)
18958-
IsOrphaned = (ParentDir == OMPD_unknown);
18959-
IsPrivate =
18958+
IsOrphaned = ParentDir == OMPD_unknown;
18959+
// OpenMP 6.0: Private DSA check
18960+
IsPrivate = (S.getLangOpts().OpenMP > 52) &&
1896018961
((isOpenMPPrivate(DVar.CKind) && DVar.CKind != OMPC_reduction &&
1896118962
isOpenMPWorksharingDirective(CurrDir) &&
1896218963
!isOpenMPParallelDirective(CurrDir) &&
1896318964
!isOpenMPTeamsDirective(CurrDir) &&
1896418965
!isOpenMPSimdDirective(ParentDir)) ||
1896518966
(IsOrphaned && DVar.CKind == OMPC_unknown) ||
1896618967
RD.OrigSharingModifier != OMPC_ORIGINAL_SHARING_shared);
18967-
// Disable private handling for OpenMP versions <= 5.2
18968-
if (S.getLangOpts().OpenMP <= 52)
18969-
IsPrivate = false;
1897018968

1897118969
// OpenMP [2.14.3.6, Restrictions, p.1]
1897218970
// A list item that appears in a reduction clause of a worksharing

clang/lib/Serialization/ASTReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11724,7 +11724,7 @@ void OMPClauseReader::VisitOMPReductionClause(OMPReductionClause *C) {
1172411724
unsigned NumFlags = Record.readInt();
1172511725
SmallVector<bool, 16> Flags;
1172611726
Flags.reserve(NumFlags);
11727-
for (unsigned i = 0; i != NumFlags; ++i)
11727+
for (unsigned I : llvm::seq<unsigned>(NumFlags))
1172811728
Flags.push_back(Record.readInt());
1172911729
C->setPrivateVariableReductionFlags(Flags);
1173011730
}

clang/lib/Serialization/ASTWriter.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8022,7 +8022,6 @@ void OMPClauseWriter::VisitOMPReductionClause(OMPReductionClause *C) {
80228022
}
80238023
auto PrivateFlags = C->private_var_reduction_flags();
80248024
Record.push_back(std::distance(PrivateFlags.begin(), PrivateFlags.end()));
8025-
// Record.push_back(PrivateFlags.size());
80268025
for (bool Flag : PrivateFlags)
80278026
Record.push_back(Flag);
80288027
}

0 commit comments

Comments
 (0)