Skip to content

Commit 6ab91da

Browse files
committed
Use hlfir::mayHaveAllocatableComponent()
1 parent a807149 commit 6ab91da

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

flang/lib/Lower/OpenMP/DataSharingProcessor.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,7 @@ void DataSharingProcessor::cloneSymbol(const semantics::Symbol *sym) {
126126
assert(sb);
127127
mlir::Value addr = sb.getAddr();
128128
assert(addr);
129-
mlir::Type ty = addr.getType();
130-
131-
// Unwrap type
132-
while (auto eleTy = fir::dyn_cast_ptrOrBoxEleTy(ty))
133-
ty = eleTy;
134-
// For arrays, use its element type
135-
if (auto seqTy = mlir::dyn_cast<fir::SequenceType>(ty))
136-
ty = seqTy.getEleTy();
137-
return fir::isRecordWithAllocatableMember(ty);
129+
return hlfir::mayHaveAllocatableComponent(addr.getType());
138130
};
139131

140132
if (needInitClone()) {

0 commit comments

Comments
 (0)