[fir] Remove unused fct recordTypeCanBeMemCopied

Remove unused fct added with 47f759309e
This commit is contained in:
Valentin Clement 2021-11-30 17:01:39 +01:00
parent c8f2139eb0
commit eb97c89cac
No known key found for this signature in database
GPG Key ID: 086D54783C928776
1 changed files with 0 additions and 20 deletions

View File

@ -594,23 +594,3 @@ fir::factory::createExtents(fir::FirOpBuilder &builder, mlir::Location loc,
: builder.createIntegerConstant(loc, idxTy, ext));
return extents;
}
/// Can the assignment of this record type be implement with a simple memory
/// copy ?
static bool recordTypeCanBeMemCopied(fir::RecordType recordType) {
if (fir::hasDynamicSize(recordType))
return false;
for (auto [_, fieldType] : recordType.getTypeList()) {
// Derived type component may have user assignment (so far, we cannot tell
// in FIR, so assume it is always the case, TODO: get the actual info).
if (fir::unwrapSequenceType(fieldType).isa<fir::RecordType>())
return false;
// Allocatable components need deep copy.
if (auto boxType = fieldType.dyn_cast<fir::BoxType>())
if (boxType.getEleTy().isa<fir::HeapType>())
return false;
}
// Constant size components without user defined assignment and pointers can
// be memcopied.
return true;
}