[all-commits] [llvm/llvm-project] 698d44: [clang] Add builtin to clear padding bytes (prewor...

Hui via All-commits all-commits at lists.llvm.org
Wed May 27 00:48:52 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 698d44bf9ff61cd8c924bcf406c29c9988d5ea5e
      https://github.com/llvm/llvm-project/commit/698d44bf9ff61cd8c924bcf406c29c9988d5ea5e
  Author: Hui <hui.xie1990 at gmail.com>
  Date:   2026-05-27 (Wed, 27 May 2026)

  Changed paths:
    M clang/include/clang/Basic/Builtins.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/CodeGen/CGBuiltin.cpp
    M clang/lib/Sema/SemaChecking.cpp
    A clang/test/CodeGen/builtin-clear-padding-codegen.c
    A clang/test/CodeGenCXX/builtin-clear-padding-codegen.cpp
    A clang/test/Sema/builtin-clear-padding.c
    A clang/test/SemaCXX/builtin-clear-padding.cpp
    A libcxx/test/libcxx/atomics/builtin_clear_padding.pass.cpp

  Log Message:
  -----------
  [clang] Add builtin to clear padding bytes (prework for P0528R3) (#75371)

Add builtin to clear padding bytes. This is the pre-work to implement
`std::atomic::compare_exchange_[weak/strong]` that ignores padding bits.
PR draft here: https://github.com/llvm/llvm-project/pull/76180

This PR picked up this patch from 3 years ago
https://reviews.llvm.org/D87974

The above patch no longer works as things changed quite a lot. I've made
some changes on top of the above patch:


it handles:
- struct
- builtin types with paddings (like `long double` and types with
`__attribute__((ext_vector_type(N)))`
- _Complex long double
- constant array
- union
- bit field
- types with virtual functions
- types with virtual bases

---------

Co-authored-by: zoecarver <z.zoelec2 at gmail.com>



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