================
@@ -132,13 +132,35 @@ struct CIRRecordLowering final {
void calculateZeroInit();
CharUnits getSize(mlir::Type Ty) {
+ auto intTy = mlir::dyn_cast<cir::IntType>(Ty);
+ // Just like with getAlignment, the storage size of a bitint is the
+ // full-memory layout (adjusted for alignment), not just its width. So we
+ // have to special case that here too.
+ if (intTy && intTy.isBitInt())
+ return CharUnits::fromQuantity(intTy.storageBitwidth(dataLayout.layout) /
+ 8);
return CharUnits::fromQuantity(dataLayout.layout.getTypeSize(Ty));
}
CharUnits getSizeInBits(mlir::Type ty) {
return CharUnits::fromQuantity(dataLayout.layout.getTypeSizeInBits(ty));
----------------
andykaylor wrote:
Does this need to be updated?
https://github.com/llvm/llvm-project/pull/218008
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits