aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorSimon Tatham <simon.tatham@arm.com>2022-06-10 11:25:53 +0100
committerSimon Tatham <simon.tatham@arm.com>2022-06-10 11:27:24 +0100
commitceb21fa4e49ddc8478371b41250f206082c5c67e (patch)
tree7c4b0aedbbe68922ea7200f188beafd957fff99f /flang/lib/Frontend/CompilerInvocation.cpp
parentceef00d33d01ab4154117fb554ae94476df586b2 (diff)
downloadllvm-ceb21fa4e49ddc8478371b41250f206082c5c67e.zip
llvm-ceb21fa4e49ddc8478371b41250f206082c5c67e.tar.gz
llvm-ceb21fa4e49ddc8478371b41250f206082c5c67e.tar.bz2
[ARM] Fix how size-0 bitfields affect homogeneous aggregates.
By both AAPCS32 and AAPCS64, the test for whether an aggregate qualifies as homogeneous (either HFA or HVA) is based on the data layout alone. So any logical member of the structure that does not affect the data layout also should not affect homogeneity. In particular, an empty bitfield ('int : 0') should make no difference. In fact, clang considered it to make a difference in C but not in C++, and justified that policy as compatible with gcc. But that's considered a bug in gcc as well (at least for Arm targets), and it's fixed in gcc 12.1. This fix mimics gcc's: zero-sized bitfields are now ignored in all languages for the Arm (32- and 64-bit) ABIs. But I've left the previous behaviour unchanged in other ABIs, by means of adding an ABIInfo::isZeroLengthBitfieldPermittedInHomogeneousAggregate query method which the Arm subclasses override. Reviewed By: lenary Differential Revision: https://reviews.llvm.org/D127197
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions