[libcxxabi][Demangle] Don't drop ctor/dtor name for abi-tagged structures
authorMichael Buch <michaelbuch12@gmail.com>
Tue, 7 Mar 2023 13:18:07 +0000 (13:18 +0000)
committerMichael Buch <michaelbuch12@gmail.com>
Sun, 19 Mar 2023 11:03:54 +0000 (11:03 +0000)
commit4601bcdb7ed3168053aa6d70abedb17c3fffa0d2
tree94fef7286b5d203ac5cab90db15e1df5a564d869
parent50b58e89a122fdc20616ad6d6dd3a802206454d2
[libcxxabi][Demangle] Don't drop ctor/dtor name for abi-tagged structures

Before this patch we would demangle abi-tagged structures as follows:
```
$ c++filt -n _ZN1SB5OuterC2Ev
S[abi:Outer]:()

$ c++filt -n _ZN1SB5OuterD2Ev
S[abi:Outer]::~()
```

This is because `Node::getBaseName` was unimplemented for the
`AbiTagAttr` node, which meant that when we tried printing `CtorDtorName`
where its `Basename` `Node` was an `AbiTagAttr`, we'd drop the
name.

Addresses https://github.com/llvm/llvm-project/issues/61213

Differential Revision: https://reviews.llvm.org/D145492
libcxxabi/src/demangle/ItaniumDemangle.h
libcxxabi/test/test_demangle.pass.cpp
llvm/include/llvm/Demangle/ItaniumDemangle.h
llvm/test/tools/llvm-cxxfilt/abitag.test