Skip to content

Commit c9db5ee

Browse files
committed
Add minor adjustment of swapping to using BaseBoxType checks
1 parent 9cdf318 commit c9db5ee

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

flang/lib/Lower/OpenMP.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,7 +1759,7 @@ static mlir::omp::MapInfoOp processDescriptorTypeMappings(
17591759
// !fir.ref<!fir.box<...>> to access the data we need to map we must
17601760
// perform an alloca and then store to it and retrieve the data from the new
17611761
// alloca.
1762-
if (fir::isAssumedShape(fir::unwrapRefType(descriptorAddr.getType()))) {
1762+
if (mlir::isa<fir::BaseBoxType>(descriptorAddr.getType())) {
17631763
mlir::OpBuilder::InsertPoint insPt = firOpBuilder.saveInsertionPoint();
17641764
firOpBuilder.setInsertionPointToStart(firOpBuilder.getAllocaBlock());
17651765
descriptor =
@@ -1777,7 +1777,7 @@ static mlir::omp::MapInfoOp processDescriptorTypeMappings(
17771777
mapCaptureType),
17781778
mlir::omp::VariableCaptureKind::ByRef, descDataBaseAddr.getType()));
17791779

1780-
// TODO: map the addendum segment of the descriptor, similarly to the abose
1780+
// TODO: map the addendum segment of the descriptor, similarly to the above
17811781
// base address/data pointer member.
17821782

17831783
return createMapInfoOp(

flang/lib/Optimizer/Dialect/FIRType.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,7 @@ bool isAllocatableOrPointerArray(mlir::Type ty) {
331331
}
332332

333333
bool isTypeWithDescriptor(mlir::Type ty) {
334-
if (fir::isPointerType(ty) || fir::isAllocatableType(ty) ||
335-
fir::isAssumedShape(ty))
334+
if (mlir::isa<fir::BaseBoxType>(unwrapRefType(ty)))
336335
return true;
337336
return false;
338337
}

0 commit comments

Comments
 (0)