[clang] [lldb] Reland [MS][clang] Add support for vector deleting destructors (PR #165598)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 5 13:33:01 PST 2025


================
@@ -370,6 +370,18 @@ class ASTContext : public RefCountedBase<ASTContext> {
   mutable llvm::DenseSet<const FunctionDecl *> DestroyingOperatorDeletes;
   mutable llvm::DenseSet<const FunctionDecl *> TypeAwareOperatorNewAndDeletes;
 
+  /// Global and array operators delete are only required for MSVC deleting
+  /// destructors support. Store them here to avoid keeping 4 pointers that are
+  /// not always used in each redeclaration of the destructor.
+  mutable llvm::DenseMap<const CXXDestructorDecl *, FunctionDecl *>
+      OperatorDeletesForVirtualDtor;
+  mutable llvm::DenseMap<const CXXDestructorDecl *, FunctionDecl *>
+      GlobalOperatorDeletesForVirtualDtor;
+  mutable llvm::DenseMap<const CXXDestructorDecl *, FunctionDecl *>
+      ArrayOperatorDeletesForVirtualDtor;
+  mutable llvm::DenseMap<const CXXDestructorDecl *, FunctionDecl *>
+      GlobalArrayOperatorDeletesForVirtualDtor;
----------------
efriedma-quic wrote:

I was just wondering if we could make this more efficient, but if it's common that parts aren't used, it probably isn't worth it.

https://github.com/llvm/llvm-project/pull/165598


More information about the cfe-commits mailing list