================
@@ -1222,9 +1222,24 @@ void CIRGenFunction::emitCXXDeleteExpr(const
CXXDeleteExpr *e) {
}
if (e->isArrayForm()) {
- assert(!cir::MissingFeatures::deleteArray());
- cgm.errorNYI(e->getSourceRange(), "emitCXXDeleteExpr: array delete");
- return;
+ // To handle this for cases that require array cookie, we will need to
+ // add target-specific handling during the lowering of delete_array in
+ // CXXABILowering, but we can emit a better diagnostic here.
+ if (e->doesUsualArrayDeleteWantSize() || deleteTy.isDestructedType()) {
+ cgm.errorNYI(e->getSourceRange(),
+ "emitCXXDeleteExpr: array delete requires cookies");
+ }
+ const FunctionDecl *operatorDelete = e->getOperatorDelete();
+ cir::FuncOp operatorDeleteFn = cgm.getAddrOfFunction(operatorDelete);
+ mlir::FlatSymbolRefAttr deleteFn = mlir::FlatSymbolRefAttr::get(
+ builder.getContext(), operatorDeleteFn.getSymNameAttr());
----------------
xlauko wrote:
nit: context can be inferred:
```suggestion
operatorDeleteFn.getSymNameAttr());
```
https://github.com/llvm/llvm-project/pull/185538
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits