[flang] [llvm] [Flang][OpenMP] Generate correct present checks for implicit maps of optional allocatables (PR #138210)

Sergio Afonso via llvm-commits llvm-commits at lists.llvm.org
Wed May 7 03:55:30 PDT 2025


================
@@ -251,9 +262,17 @@ genImplicitBoundsOps(fir::FirOpBuilder &builder, AddrAndBoundsInfo &info,
   llvm::SmallVector<mlir::Value> bounds;
 
   mlir::Value baseOp = info.rawInput;
-  if (mlir::isa<fir::BaseBoxType>(fir::unwrapRefType(baseOp.getType())))
+  if (mlir::isa<fir::BaseBoxType>(fir::unwrapRefType(baseOp.getType()))) {
+    // if it's an optional argument, it is possible it is not present, in which
----------------
skatrak wrote:

```suggestion
    // If it's an optional argument, it is possible it is not present, in which
```

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


More information about the llvm-commits mailing list