================
@@ -95,6 +95,7 @@ CIRGenModule::CIRGenModule(mlir::MLIRContext &mlirContext,
// TODO(CIR): Should be updated once TypeSizeInfoAttr is upstreamed
const unsigned sizeTypeSize =
astContext.getTypeSize(astContext.getSignedSizeType());
+ SizeSizeInBytes = astContext.toCharUnitsFromBits(sizeTypeSize).getQuantity();
----------------
andykaylor wrote:
> Ah, huh... that is undefined behavior...
Oh, right. You caught me thinking like a C programmer (very old habit). I'm
pretty sure that is the intent of the original code though. This part, at
least, I can confidently fix. I agree with @bcardosolopes about the long-term
solution, but I will avoid introducing this union for now.
https://github.com/llvm/llvm-project/pull/145802
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits