[clang] [win][clang] Align scalar deleting destructors with MSABI (PR #139566)
Tom Honermann via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 23 21:34:21 PDT 2025
================
@@ -2886,6 +2887,16 @@ class CXXDestructorDecl : public CXXMethodDecl {
return getCanonicalDecl()->OperatorDelete;
}
+ const FunctionDecl *getOperatorGlobalDelete() const {
+ return getCanonicalDecl()->OperatorGlobalDelete;
+ }
+
+ void setOperatorGlobalDelete(FunctionDecl *OD) {
+ auto *First = cast<CXXDestructorDecl>(getCanonicalDecl());
+ if (OD && !First->OperatorGlobalDelete)
+ First->OperatorGlobalDelete = OD;
----------------
tahonermann wrote:
Good question. Adding a parallel set of functions seems reasonable to me. It might also be reasonable to tie the updates together, but I think that might unnecessarily increase the serialized AST size for Itanium targets. Perhaps that can be avoided in either case; it isn't obvious to me.
While looking at this some more, I noticed that it looks like updates will be needed to `clang/lib/AST/ASTImporter.cpp` as well; see the call to `setOperatorDelete()` in `ASTNodeImporter::VisitFunctionDecl()`.
https://github.com/llvm/llvm-project/pull/139566
More information about the cfe-commits
mailing list