[clang] [CIR] Add basic support for operator new (PR #145802)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 26 10:04:19 PDT 2025
================
@@ -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:
The union is there to guarantee that both members have the same value, so we could set either one. The fact that I'm only using one in this PR is an artifact of the partial implementation, and the fact that the union is initialized with the one I'm not using is just a matter of reproducing the way it's done in the original code.
https://github.com/llvm/llvm-project/pull/145802
More information about the cfe-commits
mailing list