tcwzxx wrote:
> > Given that the mangleCXXRecordDecl function is used outside of the
> > `MangleVTable` , I think the ABI compatibility logic should be moved to
> > mangleCXXCtorVTable
>
> Could you elaborate on how to separate just the ABI compatibility logic from
> `mangleCXXRecordDecl`?
>
> Wouldn't you have to move the code to `mangleCXXVTable` and `mangleCXXVTT`
> too? I'm not sure we want to duplicate code in multiple functions.
This compatibility occurs only here. My last patch wasn't perfect.
```C++
void mangleCXXRecordDecl(const CXXRecordDecl *Record, bool
DontAddSubstitutionForCompat = false);
void ItaniumMangleContextImpl::mangleCXXCtorVTable(const CXXRecordDecl *RD,
int64_t Offset,
const CXXRecordDecl *Type,
raw_ostream &Out) {
// <special-name> ::= TC <type> <offset number> _ <base type>
CXXNameMangler Mangler(*this, Out);
Mangler.getStream() << "_ZTC";
bool CompatibilityForV19 =
getASTContext().getLangOpts().getClangABICompat() <=
clang::LangOptionsBase::ClangABI::Ver19;
Mangler.mangleCXXRecordDecl(RD, CompatibilityForV19);
Mangler.getStream() << Offset;
Mangler.getStream() << '_';
Mangler.mangleCXXRecordDecl(Type);
}
```
https://github.com/llvm/llvm-project/pull/138947
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits