File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
flang/lib/Optimizer/OpenMP Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -550,7 +550,9 @@ class MapInfoFinalizationPass
550550 // iterations from previous function scopes.
551551 localBoxAllocas.clear ();
552552
553- // First, walk `omp.map.info` ops to see if any
553+ // First, walk `omp.map.info` ops to see if any of them have varPtrs
554+ // with an underlying type of fir.char<k, ?>, i.e a character
555+ // with dynamic length. If so, check if they need bounds added.
554556 func->walk ([&](mlir::omp::MapInfoOp op) {
555557 mlir::Value varPtr = op.getVarPtr ();
556558 mlir::Type underlyingVarType = fir::unwrapRefType (varPtr.getType ());
@@ -562,6 +564,8 @@ class MapInfoFinalizationPass
562564 if (!cType.hasDynamicLen ())
563565 return mlir::WalkResult::advance ();
564566
567+ if (!op.getBounds ().empty ())
568+ return mlir::WalkResult::advance ();
565569 // This means varPtr is a BlockArgument. I do not know how to get to a
566570 // fir.boxchar<> type of mlir::Value for varPtr. So, skipping this for
567571 // now.
You can’t perform that action at this time.
0 commit comments