[cxx-interop] Allow virtual methods to be renamed with swift_name

This commit is contained in:
susmonteiro
2025-07-02 16:09:02 +01:00
parent 98b1494b0c
commit b3e228845b
11 changed files with 165 additions and 131 deletions

View File

@@ -2125,6 +2125,8 @@ clang::CXXMethodDecl *SwiftDeclSynthesizer::synthesizeCXXForwardingMethod(
// convention.
newMethod->addAttr(clang::CFReturnsRetainedAttr::CreateImplicit(clangCtx));
}
if (auto swiftNameAttr = method->getAttr<clang::SwiftNameAttr>())
newMethod->addAttr(swiftNameAttr->clone(clangCtx));
llvm::SmallVector<clang::ParmVarDecl *, 4> params;
for (size_t i = 0; i < method->getNumParams(); ++i) {