[Clang][LoongArch] Fix ABI handling of empty structs in C++ to match GCC behaviour
authorWeining Lu <luweining@loongson.cn>
Mon, 7 Aug 2023 09:49:18 +0000 (17:49 +0800)
committerTobias Hieta <tobias@hieta.se>
Tue, 8 Aug 2023 07:57:50 +0000 (09:57 +0200)
commited4284a91f819e83bb0a021d8c76d85bf91036f9
treef9b7cd0ad5ee640aa7decc92ff5da3b2aab74d14
parentaf23bb51b5bb8c797fae63d12932c0282ddd35e4
[Clang][LoongArch] Fix ABI handling of empty structs in C++ to match GCC behaviour

GCC doesn't ignore non-zero-length array of empty structures in C++
while clang does. What this patch did is to match GCC's behaviour
although this rule is not documented in psABI.

Similar to D142327 for RISCV.

Reviewed By: xry111, xen0n

Differential Revision: https://reviews.llvm.org/D156116
clang/docs/ReleaseNotes.rst
clang/lib/CodeGen/Targets/LoongArch.cpp
clang/test/CodeGen/LoongArch/abi-lp64d-empty-structs.c