aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CIR/CodeGen/CIRGenModule.cpp
diff options
context:
space:
mode:
authorAndy Kaylor <akaylor@nvidia.com>2025-06-27 09:43:26 -0700
committerGitHub <noreply@github.com>2025-06-27 09:43:26 -0700
commit74cabdb806aea341f6bdcc57e2377882f08a4684 (patch)
treeca9d284148a32a7aa31448c7b8bcd037a6b70d04 /clang/lib/CIR/CodeGen/CIRGenModule.cpp
parent3e9fd4966d7333a0bd7fcf3b4a7828d0545af90b (diff)
downloadllvm-74cabdb806aea341f6bdcc57e2377882f08a4684.zip
llvm-74cabdb806aea341f6bdcc57e2377882f08a4684.tar.gz
llvm-74cabdb806aea341f6bdcc57e2377882f08a4684.tar.bz2
[CIR] Add basic support for operator new (#145802)
This adds the code to handle operator new expressions in ClangIR.
Diffstat (limited to 'clang/lib/CIR/CodeGen/CIRGenModule.cpp')
-rw-r--r--clang/lib/CIR/CodeGen/CIRGenModule.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/CIR/CodeGen/CIRGenModule.cpp b/clang/lib/CIR/CodeGen/CIRGenModule.cpp
index 63cd55a..0f38d9a 100644
--- a/clang/lib/CIR/CodeGen/CIRGenModule.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenModule.cpp
@@ -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());
+ SizeAlignInBytes = astContext.toCharUnitsFromBits(sizeTypeSize).getQuantity();
// In CIRGenTypeCache, UIntPtrTy and SizeType are fields of the same union
UIntPtrTy =
cir::IntType::get(&getMLIRContext(), sizeTypeSize, /*isSigned=*/false);