[PATCH] D139741: [clang][CodeGen] Use base subobject type layout for potentially-overlapping fields

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 25 09:57:19 PST 2023


efriedma added inline comments.


================
Comment at: clang/lib/CodeGen/CGRecordLayoutBuilder.cpp:370
+  const auto StorageAlignment = getAlignment(StorageType);
+  if (LayoutSize % StorageAlignment || Layout.getDataSize() % StorageAlignment)
     Packed = true;
----------------
Should this be `if (Layout.getSize() % StorageAlignment || Layout.getDataSize() % StorageAlignment)`?  The dependency on isNoUniqueAddress is a bit confusing.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139741/new/

https://reviews.llvm.org/D139741



More information about the cfe-commits mailing list