[clang] [OpenMP 6.0] Parse/Sema support for reduction over private variable with reduction clause. (PR #129938)
Alexey Bataev via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 19 13:42:28 PDT 2025
================
@@ -3757,6 +3768,31 @@ class OMPReductionClause final
/// reduction copies.
void setRHSExprs(ArrayRef<Expr *> RHSExprs);
+ /// Set the list private reduction flags
+ void setPrivateVariableReductionFlags(ArrayRef<bool> Flags) {
+ assert(Flags.size() == varlist_size() &&
+ "Number of private flags does not match vars");
+ llvm::copy(Flags, getTrailingObjects<bool>());
+ }
+
+ /// Get the list of help private variable reduction flags
+ MutableArrayRef<bool> getPrivateVariableReductionFlags() {
+ return MutableArrayRef<bool>(getTrailingObjects<bool>(), varlist_size());
----------------
alexey-bataev wrote:
```suggestion
return MutableArrayRef(getTrailingObjects<bool>(), varlist_size());
```
?
https://github.com/llvm/llvm-project/pull/129938
More information about the cfe-commits
mailing list