[flang] [llvm] [Flang][OpenMP] Generate correct present checks for implicit maps of optional allocatables (PR #138210)
    via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon May  5 08:56:33 PDT 2025
    
    
  
================
@@ -151,16 +152,23 @@ class MapInfoFinalizationPass
     mlir::Location loc = boxMap->getLoc();
     assert(allocaBlock && "No alloca block found for this top level op");
     builder.setInsertionPointToStart(allocaBlock);
-    auto alloca = builder.create<fir::AllocaOp>(loc, descriptor.getType());
+
+    mlir::Type allocaType = descriptor.getType();
+    if (fir::isTypeWithDescriptor(allocaType) &&
+        !mlir::isa<fir::BaseBoxType>(descriptor.getType()))
----------------
jeanPerier wrote:
```suggestion
    if (fir::isBoxAddress(allocaType))
```
https://github.com/llvm/llvm-project/pull/138210
    
    
More information about the llvm-commits
mailing list