[all-commits] [llvm/llvm-project] 4c5a93: [ABI] Handle C++20 [[no_unique_address]] attribute
Ulrich Weigand via All-commits
all-commits at lists.llvm.org
Fri Jul 10 05:01:41 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 4c5a93bd58bad70e91ac525b0e020bd5119a321a
https://github.com/llvm/llvm-project/commit/4c5a93bd58bad70e91ac525b0e020bd5119a321a
Author: Ulrich Weigand <ulrich.weigand at de.ibm.com>
Date: 2020-07-10 (Fri, 10 Jul 2020)
Changed paths:
M clang/lib/CodeGen/TargetInfo.cpp
M clang/test/CodeGen/systemz-abi.cpp
Log Message:
-----------
[ABI] Handle C++20 [[no_unique_address]] attribute
Many platform ABIs have special support for passing aggregates that
either just contain a single member of floatint-point type, or else
a homogeneous set of members of the same floating-point type.
When making this determination, any extra "empty" members of the
aggregate type will typically be ignored. However, in C++ (at least
in all prior versions), no data member would actually count as empty,
even if it's type is an empty record -- it would still be considered
to take up at least one byte of space, and therefore make those ABI
special cases not apply.
This is now changing in C++20, which introduced the [[no_unique_address]]
attribute. Members of empty record type, if they also carry this
attribute, now do *not* take up any space in the type, and therefore
the ABI special cases for single-element or homogeneous aggregates
should apply.
The C++ Itanium ABI has been updated accordingly, and GCC 10 has
added support for this new case. This patch now adds support to
LLVM. This is cross-platform; it affects all platforms that use
the single-element or homogeneous aggregate ABI special case and
implement this using any of the following common subroutines
in lib/CodeGen/TargetInfo.cpp:
isEmptyField
isEmptyRecord
isSingleElementStruct
isHomogeneousAggregate
More information about the All-commits
mailing list