================
@@ -115,8 +115,7 @@ class ClauseProcessor {
   bool processMap(
       mlir::Location currentLocation, Fortran::lower::StatementContext 
&stmtCtx,
       mlir::omp::MapClauseOps &result,
-      llvm::SmallVectorImpl<const Fortran::semantics::Symbol *> *mapSyms =
-          nullptr,
+      llvm::SmallVectorImpl<const Fortran::semantics::Symbol *> *mapSyms,
----------------
skatrak wrote:

If `mapSyms` is no longer optional, then it should be passed as a reference 
rather than as a pointer here. However, I don't think it should be, since it's 
not always needed by the caller (at least currently).

I think the proper solution would be to do something like this in `processMap`:
```c++
llvm::SmallVector<const Fortran::semantics::Symbol *> localMapSyms;
llvm::SmallVectorImpl<const Fortran::semantics::Symbol *> *ptrMapSyms =
    mapSyms ? mapSyms : &localMapSyms;
// Use ptrMapSyms instead of mapSyms...
```
Let me know what you think.

https://github.com/llvm/llvm-project/pull/82853
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to