[flang-commits] [flang] [mlir] [MLIR][OpenMP][Flang] Normalize clause arguments names (PR #99505)

Sergio Afonso via flang-commits flang-commits at lists.llvm.org
Fri Jul 19 07:49:48 PDT 2024


================
@@ -179,46 +179,46 @@ struct PrivateClauseOps {
   llvm::SmallVector<Value> privateVars;
   // The list of symbols referring to delayed privatizer ops (i.e. `omp.private`
   // ops).
-  llvm::SmallVector<Attribute> privatizers;
+  llvm::SmallVector<Attribute> privateSyms;
 };
 
 struct ProcBindClauseOps {
-  ClauseProcBindKindAttr procBindKindAttr;
+  ClauseProcBindKindAttr procBindKind;
 };
 
 struct ReductionClauseOps {
   llvm::SmallVector<Value> reductionVars;
----------------
skatrak wrote:

The reason some clauses like `OrderClauseOps` have an argument with just the clause name is not only that it's the "main" argument, but also that it's a single value or attribute. However, this argument falls into the variadic arguments case, to which the "vars" suffix is added.

Maybe evaluating this case in isolation, the choice between `reductions` or `reductionVars` could be argued either way. But there are other cases where not adding the prefix makes it read weird, so for consistency I proposed adding it to all of them. For example: `linearVars` vs `linears`, `isDevicePtrVars` vs `isDevicePtrs` or `privateVars` vs `privates` (this one is particularly bad).

https://github.com/llvm/llvm-project/pull/99505


More information about the flang-commits mailing list