On 8/27/26 4:10 AM, Kito Cheng wrote:
The RISC-V psABI[1] says a function using a standard calling convention variant
has
to append an extra ABI tag to its mangled name, following the "ABI tags"
rule of the Itanium C++ ABI. The only variant listed so far is the
fixed-length vector calling convention, whose tag is
riscv_vls_cc_<ABI_VLEN>:
```c
__attribute__((riscv_vls_cc(128))) void foo();
```
now mangles as _Z3fooB16riscv_vls_cc_128v.
The C++ mangler cannot know about target attributes, so we adds a target
hook, TARGET_CXX_IMPLICIT_ABI_TAGS, that hands back extra tags for a decl.
NOTE: I tried to not adding the new hook by attaching abi_tag attribute,
however I tried to doing that on TARGET_INSERT_ATTRIBUTES and
doing some hack way on TARGET_ATTRIBUTE_TABLE during adding calling
convention attribute, but both are no work well.
How did that fail? Using TARGET_INSERT_ATTRIBUTES sounds promising to me.
Jason