[Lldb-commits] [clang] [lldb] Reland [MS][clang] Add support for vector deleting destructors (PR #165598)
Eli Friedman via lldb-commits
lldb-commits at lists.llvm.org
Wed Nov 5 13:33:01 PST 2025
================
@@ -8281,3 +8281,53 @@ void CodeGenModule::moveLazyEmissionStates(CodeGenModule *NewBuilder) {
NewBuilder->ABI->MangleCtx = std::move(ABI->MangleCtx);
}
+
+bool CodeGenModule::classNeedsVectorDestructor(const CXXRecordDecl *RD) {
+ if (!Context.getTargetInfo().emitVectorDeletingDtors(Context.getLangOpts()))
+ return false;
+ CXXDestructorDecl *Dtor = RD->getDestructor();
+ // The compiler can't know if new[]/delete[] will be used outside of the DLL,
+ // so just force vector deleting destructor emission if dllexport is present.
+ // This matches MSVC behavior.
+ if (Dtor && Dtor->isVirtual() && Dtor->isDefined() &&
+ Dtor->hasAttr<DLLExportAttr>())
----------------
efriedma-quic wrote:
Does this catch the case where the class is marked dllexport?
https://github.com/llvm/llvm-project/pull/165598
More information about the lldb-commits
mailing list