[CIR][NFC] Add missing code markers for Dtor_VectorDeleting#167969
Merged
andykaylor merged 2 commits intollvm:mainfrom Nov 13, 2025
Merged
[CIR][NFC] Add missing code markers for Dtor_VectorDeleting#167969andykaylor merged 2 commits intollvm:mainfrom
andykaylor merged 2 commits intollvm:mainfrom
Conversation
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.
Member
|
@llvm/pr-subscribers-clangir @llvm/pr-subscribers-clang Author: Andy Kaylor (andykaylor) ChangesThis adds some minimal code to mark locations where handling is needed for Dtor_VectorDeleting type dtors, which were added in #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. Full diff: https://github.com/llvm/llvm-project/pull/167969.diff 2 Files Affected:
diff --git a/clang/lib/CIR/CodeGen/CIRGenExprCXX.cpp b/clang/lib/CIR/CodeGen/CIRGenExprCXX.cpp
index ac126965a95a5..fec51347cad0e 100644
--- a/clang/lib/CIR/CodeGen/CIRGenExprCXX.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenExprCXX.cpp
@@ -708,6 +708,13 @@ void CIRGenFunction::emitCXXDeleteExpr(const CXXDeleteExpr *e) {
deleteTy = getContext().getBaseElementType(deleteTy);
ptr = ptr.withElementType(builder, convertTypeForMem(deleteTy));
+ if (e->isArrayForm() &&
+ cgm.getContext().getTargetInfo().emitVectorDeletingDtors(
+ cgm.getContext().getLangOpts())) {
+ cgm.errorNYI(e->getSourceRange(),
+ "emitCXXDeleteExpr: emitVectorDeletingDtors");
+ }
+
if (e->isArrayForm()) {
assert(!cir::MissingFeatures::deleteArray());
cgm.errorNYI(e->getSourceRange(), "emitCXXDeleteExpr: array delete");
diff --git a/clang/lib/CIR/CodeGen/CIRGenFunction.cpp b/clang/lib/CIR/CodeGen/CIRGenFunction.cpp
index b73071af2a5d4..885a32cf16862 100644
--- a/clang/lib/CIR/CodeGen/CIRGenFunction.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenFunction.cpp
@@ -738,7 +738,9 @@ void CIRGenFunction::emitDestructorBody(FunctionArgList &args) {
// outside of the function-try-block, which means it's always
// possible to delegate the destructor body to the complete
// destructor. Do so.
- if (dtorType == Dtor_Deleting) {
+ if (dtorType == Dtor_Deleting || dtorType == Dtor_VectorDeleting) {
+ if (cxxStructorImplicitParamValue && dtorType == Dtor_VectorDeleting)
+ cgm.errorNYI(dtor->getSourceRange(), "emitConditionalArrayDtorCall");
RunCleanupsScope dtorEpilogue(*this);
enterDtorCleanups(dtor, Dtor_Deleting);
if (haveInsertPoint()) {
@@ -771,6 +773,7 @@ void CIRGenFunction::emitDestructorBody(FunctionArgList &args) {
case Dtor_Comdat:
llvm_unreachable("not expecting a COMDAT");
case Dtor_Deleting:
+ case Dtor_VectorDeleting:
llvm_unreachable("already handled deleting case");
case Dtor_Complete:
|
erichkeane
approved these changes
Nov 13, 2025
Fznamznon
added a commit
to Fznamznon/llvm-project
that referenced
this pull request
Nov 21, 2025
…lvm#167969)" This reverts commit e6b9805.
ZequanWu
added a commit
to ZequanWu/llvm-project
that referenced
this pull request
Nov 21, 2025
…lvm#167969)" This reverts commit e6b9805. Because it depends on 4d10c11 which is also reverted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds some minimal code to mark locations where handling is needed for Dtor_VectorDeleting type dtors, which were added in #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.