[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)
Michael Buch via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 1 03:22:41 PDT 2024
================
@@ -137,6 +137,16 @@ bool isEmptyField(ASTContext &Context, const FieldDecl *FD, bool AllowArrays,
bool isEmptyRecord(ASTContext &Context, QualType T, bool AllowArrays,
bool AsIfNoUniqueAddr = false);
+/// isEmptyFieldForLayout - Return true iff the field is "empty", that is,
+/// either a zero-width bit-field or an \ref isEmptyRecordForLayout.
+bool isEmptyFieldForLayout(const ASTContext &Context, const FieldDecl *FD);
+
+/// isEmptyRecordForLayout - Return true iff a structure contains only empty
+/// base classes (per \ref isEmptyRecordForLayout) and fields (per
+/// \ref isEmptyFieldForLayout). Note, C++ record fields are considered empty
+/// if the [[no_unique_address]] attribute would have made them empty.
+bool isEmptyRecordForLayout(const ASTContext &Context, QualType T);
----------------
Michael137 wrote:
I put those here just to have them next to `isEmptyRecord`/`isEmptyField`, which are used outside the implementation of `ABIInfo`. But agree with your point. These should probably all live in `CGRecordLayout` instead
https://github.com/llvm/llvm-project/pull/96422
More information about the cfe-commits
mailing list