[all-commits] [llvm/llvm-project] 7bf891: [Clang] Fix __builtin_clear_padding() for bitfield...

Victor Campos via All-commits all-commits at lists.llvm.org
Thu Sep 17 09:11:08 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7bf891b911830e8cabab28d055deb6396707b1e9
      https://github.com/llvm/llvm-project/commit/7bf891b911830e8cabab28d055deb6396707b1e9
  Author: Victor Campos <victor.campos at arm.com>
  Date:   2026-09-17 (Thu, 17 Sep 2026)

  Changed paths:
    M clang/lib/AST/ASTContext.cpp
    M clang/test/CodeGen/builtin-clear-padding-codegen.c
    M clang/test/CodeGenCXX/builtin-clear-padding-codegen.cpp

  Log Message:
  -----------
  [Clang] Fix __builtin_clear_padding() for bitfields (#216063)

This patch fixes the padding clearing logic for bitfields.

The padding clearing logic for bitfields is wrong for these cases:

 - Over-sized bitfields don't have their padding bits recognised as
   such.
 - In big endian mode, the occupied bits are wrongly determined because
   the different byte order is dismissed.

A big number of new tests have also been added to cover many different
scenarios that involve bitfields. Preexisting tests had their check
patterns regenerated with the updater script.

Assisted-by: Codex. Used to help debugging and to generate tests.



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