[PATCH] D81583: Update SystemZ ABI to handle C++20 [[no_unique_address]] attribute
Eli Friedman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 7 13:46:44 PDT 2020
efriedma added a comment.
I'm tempted to say this is a bugfix for the implementation of no_unique_address, and just fix it globally for all ABIs. We're never going to get anything done here if we require a separate patch for each ABI variant clang supports.
================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:524
+ if (isa<CXXRecordDecl>(RT->getDecl()) &&
+ !(AllowNoUniqueAddr && FD->hasAttr<NoUniqueAddressAttr>()))
return false;
----------------
Does this do the right thing with a field that's an array of empty classes?
================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:7245
// do count. So do anonymous bitfields that aren't zero-sized.
- if (getContext().getLangOpts().CPlusPlus &&
- FD->isZeroLengthBitField(getContext()))
- continue;
+ if (getContext().getLangOpts().CPlusPlus) {
+ if (FD->isZeroLengthBitField(getContext()))
----------------
Only loosely relevant to this patch, but checking getLangOpts().CPlusPlus here seems weird; doesn't that break calling functions defined in C from C++ code?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81583/new/
https://reviews.llvm.org/D81583
More information about the cfe-commits
mailing list