[clang][RISCV] Fix ABI handling of empty structs with hard FP calling conventions in C++
As reported in <https://github.com/llvm/llvm-project/issues/58929>, Clang's handling of empty structs in the case of small structs that may be eligible to be passed using the hard FP calling convention doesn't match g++. In general, C++ record fields are never empty unless [[no_unique_address]] is used, but the RISC-V FP ABI overrides this. After this patch, fields of structs that contain empty records will be ignored, even in C++, when considering eligibility for the FP calling convention ('flattening'). See also the relevant psABI issue <https://github.com/riscv-non-isa/riscv-elf-psabi-doc/issues/358> which seeks to clarify the documentation. Fixes https://github.com/llvm/llvm-project/issues/58929 Differential Revision: https://reviews.llvm.org/D142327
Loading
Please sign in to comment