From e11ede5e90ee193dde179fe1a9ac9af718ede3db Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Wed, 12 Mar 2025 16:18:07 +0100 Subject: Revert "[MS][clang] Add support for vector deleting destructors (#126240)" This caused link errors when building with sancov. See comment on the PR. > Whereas it is UB in terms of the standard to delete an array of objects > via pointer whose static type doesn't match its dynamic type, MSVC > supports an extension allowing to do it. > Aside from array deletion not working correctly in the mentioned case, > currently not having this extension implemented causes clang to generate > code that is not compatible with the code generated by MSVC, because > clang always puts scalar deleting destructor to the vftable. This PR > aims to resolve these problems. > > Fixes https://github.com/llvm/llvm-project/issues/19772 This reverts commit d6942d54f677000cf713d2b0eba57b641452beb4. --- clang/lib/CodeGen/CodeGenModule.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.h') diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index e7c9238..6deb467 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -528,9 +528,6 @@ private: /// that we don't re-emit the initializer. llvm::DenseMap DelayedCXXInitPosition; - /// To remember which types did require a vector deleting dtor. - llvm::SmallPtrSet RequireVectorDeletingDtor; - typedef std::pair GlobalInitData; @@ -1547,7 +1544,6 @@ public: void EmitGlobal(GlobalDecl D); bool TryEmitBaseDestructorAsAlias(const CXXDestructorDecl *D); - void EmitDefinitionAsAlias(GlobalDecl Alias, GlobalDecl Target); llvm::GlobalValue *GetGlobalValue(StringRef Ref); @@ -1815,8 +1811,6 @@ public: // behavior. So projects like the Linux kernel can rely on it. return !getLangOpts().CPlusPlus; } - void requireVectorDestructorDefinition(const CXXRecordDecl *RD); - bool classNeedsVectorDestructor(const CXXRecordDecl *RD); private: bool shouldDropDLLAttribute(const Decl *D, const llvm::GlobalValue *GV) const; -- cgit v1.1