File tree Expand file tree Collapse file tree 2 files changed +17
-17
lines changed
llvm/include/llvm/Frontend/OpenMP Expand file tree Collapse file tree 2 files changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -795,25 +795,9 @@ bool ConstructDecompositionT<C, H>::applyClause(
795
795
// assigned to which leaf constructs.
796
796
797
797
// [5.2:340:33]
798
- auto canMakePrivateCopy = [](llvm::omp::Clause id) {
799
- switch (id) {
800
- // Clauses with "privatization" property:
801
- case llvm::omp::Clause::OMPC_firstprivate:
802
- case llvm::omp::Clause::OMPC_in_reduction:
803
- case llvm::omp::Clause::OMPC_lastprivate:
804
- case llvm::omp::Clause::OMPC_linear:
805
- case llvm::omp::Clause::OMPC_private:
806
- case llvm::omp::Clause::OMPC_reduction:
807
- case llvm::omp::Clause::OMPC_task_reduction:
808
- return true ;
809
- default :
810
- return false ;
811
- }
812
- };
813
-
814
798
bool applied = applyIf (node, [&](const auto &leaf) {
815
799
return llvm::any_of (leaf.clauses , [&](const ClauseTy *n) {
816
- return canMakePrivateCopy (n->id );
800
+ return llvm::omp::isPrivatizingClause (n->id );
817
801
});
818
802
});
819
803
Original file line number Diff line number Diff line change @@ -48,6 +48,22 @@ static constexpr inline bool canHaveIterator(Clause C) {
48
48
}
49
49
}
50
50
51
+ // Can clause C create a private copy of a variable.
52
+ static constexpr inline bool isPrivatizingClause (Clause C) {
53
+ switch (C) {
54
+ case OMPC_firstprivate:
55
+ case OMPC_in_reduction:
56
+ case OMPC_lastprivate:
57
+ case OMPC_linear:
58
+ case OMPC_private:
59
+ case OMPC_reduction:
60
+ case OMPC_task_reduction:
61
+ return true ;
62
+ default :
63
+ return false ;
64
+ }
65
+ }
66
+
51
67
static constexpr unsigned FallbackVersion = 52 ;
52
68
LLVM_ABI ArrayRef<unsigned > getOpenMPVersions ();
53
69
You can’t perform that action at this time.
0 commit comments