[clang] Allow packing fields into tail padding of record fields (PR #122197)

2025-01-08 Thread Pavel Labath via cfe-commits
labath wrote: I don't feel qualified to review this, but thank you for working on it. https://github.com/llvm/llvm-project/pull/122197 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Allow packing fields into tail padding of record fields (PR #122197)

2025-01-08 Thread Eli Friedman via cfe-commits
@@ -803,10 +804,16 @@ bool ConstStructBuilder::Build(const InitListExpr *ILE, bool AllowOverwrite) { if (!AppendField(Field, Layout.getFieldOffset(FieldNo), EltInit, AllowOverwrite)) return false; - // After emitting a non-empty field

[clang] Allow packing fields into tail padding of record fields (PR #122197)

2025-01-08 Thread Eli Friedman via cfe-commits
@@ -389,14 +389,28 @@ void CGRecordLowering::accumulateFields(bool isNonVirtualBaseType) { // Empty fields have no storage. ++Field; } else { - // Use base subobject layout for the potentially-overlapping field, - // as it is done in RecordLayoutBuild

[clang] Allow packing fields into tail padding of record fields (PR #122197)

2025-01-08 Thread Eli Friedman via cfe-commits
@@ -389,14 +389,28 @@ void CGRecordLowering::accumulateFields(bool isNonVirtualBaseType) { // Empty fields have no storage. ++Field; } else { - // Use base subobject layout for the potentially-overlapping field, - // as it is done in RecordLayoutBuild

[clang] Allow packing fields into tail padding of record fields (PR #122197)

2025-01-08 Thread David Blaikie via cfe-commits
@@ -803,10 +804,16 @@ bool ConstStructBuilder::Build(const InitListExpr *ILE, bool AllowOverwrite) { if (!AppendField(Field, Layout.getFieldOffset(FieldNo), EltInit, AllowOverwrite)) return false; - // After emitting a non-empty field

[clang] Allow packing fields into tail padding of record fields (PR #122197)

2025-01-08 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie commented: Thanks! Looks plausible to me, would be great to get @Michael137's take on it, since he's been looking at this sort of thing a fair bit lately. https://github.com/llvm/llvm-project/pull/122197 ___ cfe-commits ma

[clang] Allow packing fields into tail padding of record fields (PR #122197)

2025-01-08 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie edited https://github.com/llvm/llvm-project/pull/122197 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Allow packing fields into tail padding of record fields (PR #122197)

2025-01-08 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff e93181bf13b289823810d3b43bcc3c2df1eda70b 54eaf769c085d8efeab957a5f385bca59a3f1f32 --e

[clang] Allow packing fields into tail padding of record fields (PR #122197)

2025-01-08 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Reid Kleckner (rnk) Changes Don't use isPotentiallyOverlapping to control behavior that allows overwriting previous field data, because the `[[no_unique_address]]` attribute is not available in any debug info, DWARF or PDB. Instea

[clang] Allow packing fields into tail padding of record fields (PR #122197)

2025-01-08 Thread Reid Kleckner via cfe-commits
https://github.com/rnk created https://github.com/llvm/llvm-project/pull/122197 Don't use isPotentiallyOverlapping to control behavior that allows overwriting previous field data, because the `[[no_unique_address]]` attribute is not available in any debug info, DWARF or PDB. Instead, just trust