Skip to content

Commit a470a91

Browse files
Do not handle BoxCharType in hasDynamicSize because hasDynamicSize helper is supposed
to return false for pointer-like types which boxchar is. Clients should use a "preprocessing" helper such as dyn_cast_ptrOrBoxEleTy before calling hasDynamicSize as shown below bool HasDynamicSize = fir::hasDynamicSize(fir::dyn_cast_ptrOrBoxEleTy(boxCharType));
1 parent 7fc7fea commit a470a91

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

flang/lib/Optimizer/Dialect/FIRType.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,6 @@ bool hasDynamicSize(mlir::Type t) {
285285
return true;
286286
if (auto rec = mlir::dyn_cast<fir::RecordType>(t))
287287
return hasDynamicSize(rec);
288-
if (auto boxChar = mlir::dyn_cast<fir::BoxCharType>(t)) {
289-
return characterWithDynamicLen(boxChar.getEleTy());
290-
}
291288
return false;
292289
}
293290

0 commit comments

Comments
 (0)