Closed
Description
It looks as though the switch case:
case Type::TargetExtTyID: {
Type *LayoutTy = cast<TargetExtType>(Ty)->getLayoutType();
return getAlignment(LayoutTy, abi_or_pref);
}
in DataLayout.cpp::getAlignment
is unreachable due to the initial assert:
assert(Ty->isSized() && "Cannot getTypeInfo() on a type that is unsized!");
.
Type::isSized() has the following case which returns false for TargetExtTyID:
if (getTypeID() != StructTyID && getTypeID() != ArrayTyID &&
!isVectorTy() && getTypeID() != TargetExtTyID)
return false;
Do we need to improve the check in isSized with for example:
if (getTypeID() == TargetExtTyID)
return getLayoutType()->isSized();
?