Skip to content

Commit 5e7032e

Browse files
committed
[CIR][NFC] Add missing code markers for Dtor_VectorDeleting
This adds some minimal code to mark locations where handling is needed for Dtor_VectorDeleting type dtors, which were added in llvm#165598 This is not a comprehensive mark-up of the missing code, as some code will be needed in places where the surrounding function has larger missing pieces in CIR currently. This fixes a warning for an uncovered switch case that was causing CI builds to fail.
1 parent ebc35f8 commit 5e7032e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

clang/lib/CIR/CodeGen/CIRGenExprCXX.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,13 @@ void CIRGenFunction::emitCXXDeleteExpr(const CXXDeleteExpr *e) {
708708
deleteTy = getContext().getBaseElementType(deleteTy);
709709
ptr = ptr.withElementType(builder, convertTypeForMem(deleteTy));
710710

711+
if (e->isArrayForm() &&
712+
cgm.getContext().getTargetInfo().emitVectorDeletingDtors(
713+
cgm.getContext().getLangOpts())) {
714+
cgm.errorNYI(e->getSourceRange(),
715+
"emitCXXDeleteExpr: emitVectorDeletingDtors");
716+
}
717+
711718
if (e->isArrayForm()) {
712719
assert(!cir::MissingFeatures::deleteArray());
713720
cgm.errorNYI(e->getSourceRange(), "emitCXXDeleteExpr: array delete");

clang/lib/CIR/CodeGen/CIRGenFunction.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,9 @@ void CIRGenFunction::emitDestructorBody(FunctionArgList &args) {
738738
// outside of the function-try-block, which means it's always
739739
// possible to delegate the destructor body to the complete
740740
// destructor. Do so.
741-
if (dtorType == Dtor_Deleting) {
741+
if (dtorType == Dtor_Deleting || dtorType == Dtor_VectorDeleting) {
742+
if (cxxStructorImplicitParamValue && dtorType == Dtor_VectorDeleting)
743+
cgm.errorNYI(dtor->getSourceRange(), "emitConditionalArrayDtorCall");
742744
RunCleanupsScope dtorEpilogue(*this);
743745
enterDtorCleanups(dtor, Dtor_Deleting);
744746
if (haveInsertPoint()) {
@@ -771,6 +773,7 @@ void CIRGenFunction::emitDestructorBody(FunctionArgList &args) {
771773
case Dtor_Comdat:
772774
llvm_unreachable("not expecting a COMDAT");
773775
case Dtor_Deleting:
776+
case Dtor_VectorDeleting:
774777
llvm_unreachable("already handled deleting case");
775778

776779
case Dtor_Complete:

0 commit comments

Comments
 (0)