[clang] [MS][clang] Add support for vector deleting destructors (PR #126240)
Mariya Podchishchaeva via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 20 08:17:24 PST 2025
================
@@ -7919,3 +7919,38 @@ void CodeGenModule::moveLazyEmissionStates(CodeGenModule *NewBuilder) {
NewBuilder->ABI->MangleCtx = std::move(ABI->MangleCtx);
}
+
+bool CodeGenModule::classNeedsVectorDestructor(const CXXRecordDecl *RD) {
+ CXXDestructorDecl *Dtor = RD->getDestructor();
----------------
Fznamznon wrote:
Well, I'm relatively new to MSVC ABI, so in most cases I was trying to follow @tahonermann's findings from https://github.com/llvm/llvm-project/issues/19772 , this particularly implements this comment https://github.com/llvm/llvm-project/issues/19772#issuecomment-2270313429 . That does seem rational, because the compiler can't know if new[]/delete[] will be used outside of the DLL. And it seems adding dllexport does trigger MSVC to generate vector destructors. The comments to https://developercommunity.visualstudio.com/t/delete-calls-scalar-deleting-destructor-instead-of/346875 also suggest so.
I'm not yet familiar with "local vftable constructor closues" though...
https://github.com/llvm/llvm-project/pull/126240
More information about the cfe-commits
mailing list