[all-commits] [llvm/llvm-project] 7e9927: [CIR] Fix outdated bitfield iteration logic in acc...

Andres-Salamanca via All-commits all-commits at lists.llvm.org
Sat Aug 2 07:40:12 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7e9927127f47c9576f273329a7f7dcc718ad622b
      https://github.com/llvm/llvm-project/commit/7e9927127f47c9576f273329a7f7dcc718ad622b
  Author: Andres-Salamanca <andrealebarbaritos at gmail.com>
  Date:   2025-08-02 (Sat, 02 Aug 2025)

  Changed paths:
    M clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp
    M clang/test/CIR/CodeGen/bitfields.c

  Log Message:
  -----------
  [CIR] Fix outdated bitfield iteration logic in accumulateFields (#151741)

This PR fixes the outdated logic for accumulating bitfields in
`accumulateFields`. The old approach remained after the algorithm was
updated. A non-bitfield member would act as a barrier, causing
`accumulateBitFields` to receive an incomplete range of fields. As a
result, it failed to accumulate them properly when clipping was
necessary.

For reference, in ClangIR we already handle this correctly:

[https://github.com/llvm/clangir/blob/b647f4b97b1f936fd7700ec0fd0d896a12fe581b/clang/lib/CIR/CodeGen/CIRRecordLayoutBuilder.cpp#L711-L714](https://github.com/llvm/clangir/blob/b647f4b97b1f936fd7700ec0fd0d896a12fe581b/clang/lib/CIR/CodeGen/CIRRecordLayoutBuilder.cpp#L711-L714)



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list