[clang] [CIR] Add limited support for array new (PR #161095)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 30 14:17:06 PDT 2025


================
@@ -75,3 +76,20 @@ void CIRGenCXXABI::setCXXABIThisValue(CIRGenFunction &cgf,
   assert(getThisDecl(cgf) && "no 'this' variable for function");
   cgf.cxxabiThisValue = thisPtr;
 }
+
+CharUnits CIRGenCXXABI::getArrayCookieSize(const CXXNewExpr *E) {
+  if (!requiresArrayCookie(E))
+    return CharUnits::Zero();
+
+  cgm.errorNYI(E->getSourceRange(), "CIRGenCXXABI::getArrayCookieSize");
+  return CharUnits::Zero();
+}
+
+bool CIRGenCXXABI::requiresArrayCookie(const CXXNewExpr *E) {
----------------
andykaylor wrote:

```suggestion
bool CIRGenCXXABI::requiresArrayCookie(const CXXNewExpr *e) {
```

https://github.com/llvm/llvm-project/pull/161095


More information about the cfe-commits mailing list