[all-commits] [llvm/llvm-project] c87be7: [win][clang] Align scalar deleting destructors wit...
Mariya Podchishchaeva via All-commits
all-commits at lists.llvm.org
Wed Sep 17 01:00:23 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: c87be722d60467dfc651186c1b1b058ce2e34644
https://github.com/llvm/llvm-project/commit/c87be722d60467dfc651186c1b1b058ce2e34644
Author: Mariya Podchishchaeva <mariya.podchishchaeva at intel.com>
Date: 2025-09-17 (Wed, 17 Sep 2025)
Changed paths:
M clang/docs/ReleaseNotes.rst
M clang/include/clang/AST/ASTMutationListener.h
M clang/include/clang/AST/DeclCXX.h
M clang/include/clang/Basic/ABIVersions.def
M clang/include/clang/Basic/TargetInfo.h
M clang/include/clang/Sema/Sema.h
M clang/include/clang/Serialization/ASTWriter.h
M clang/lib/AST/DeclCXX.cpp
M clang/lib/Basic/TargetInfo.cpp
M clang/lib/CodeGen/CGClass.cpp
M clang/lib/CodeGen/MicrosoftCXXABI.cpp
M clang/lib/Frontend/MultiplexConsumer.cpp
M clang/lib/Sema/SemaDeclCXX.cpp
M clang/lib/Sema/SemaExprCXX.cpp
M clang/lib/Serialization/ASTCommon.h
M clang/lib/Serialization/ASTReaderDecl.cpp
M clang/lib/Serialization/ASTWriter.cpp
M clang/lib/Serialization/ASTWriterDecl.cpp
M clang/test/CodeGenCXX/cxx2a-destroying-delete.cpp
M clang/test/CodeGenCXX/microsoft-abi-structors.cpp
A clang/test/Modules/Inputs/glob-delete-with-virtual-dtor/glob-delete-with-virtual-dtor.h
A clang/test/Modules/Inputs/glob-delete-with-virtual-dtor/module.modulemap
A clang/test/Modules/glob-delete-with-virtual-dtor.cpp
A clang/test/PCH/Inputs/glob-delete-with-virtual-dtor.h
A clang/test/PCH/glob-delete-with-virtual-dtor.cpp
Log Message:
-----------
[win][clang] Align scalar deleting destructors with MSABI (#139566)
While working on vector deleting destructors support
([GH19772](https://github.com/llvm/llvm-project/issues/19772)), I
noticed that MSVC produces different code in scalar deleting destructor
body depending on whether class defined its own operator delete. In
MSABI deleting destructors accept an additional implicit flag parameter
allowing some sort of flexibility. The mismatch I noticed is that
whenever a global operator delete is called, i.e. `::delete`, in the
code produced by MSVC the implicit flag argument has a value that makes
the 3rd bit set, i.e. "5" for scalar deleting destructors "7" for vector
deleting destructors.
Prior to this patch, clang handled `::delete` via calling global
operator delete direct after the destructor call and not calling class
operator delete in scalar deleting destructor body by passing "0" as
implicit flag argument value. This is fine until there is an attempt to
link binaries compiled with clang with binaries compiled with MSVC. The
problem is that in binaries produced by MSVC the callsite of the
destructor won't call global operator delete because it is assumed that
the destructor will do that and a destructor body generated by clang
will never do.
This patch removes call to global operator delete from the callsite and
add additional check of the 3rd bit of the implicit parameter inside of
scalar deleting destructor body.
---------
Co-authored-by: Tom Honermann <tom at honermann.net>
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list