[all-commits] [llvm/llvm-project] 9fc2fa: [Clang] Re-write codegen for atomic_test_and_set a...

Oliver Stannard via All-commits all-commits at lists.llvm.org
Thu Dec 19 01:12:41 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9fc2fadbfcb34df5f72bdaed28a7874bf584eed7
      https://github.com/llvm/llvm-project/commit/9fc2fadbfcb34df5f72bdaed28a7874bf584eed7
  Author: Oliver Stannard <oliver.stannard at arm.com>
  Date:   2024-12-19 (Thu, 19 Dec 2024)

  Changed paths:
    M clang/include/clang/Basic/Builtins.td
    M clang/lib/AST/Expr.cpp
    M clang/lib/CodeGen/CGAtomic.cpp
    M clang/lib/CodeGen/CGBuiltin.cpp
    M clang/lib/Sema/SemaChecking.cpp
    A clang/test/CodeGen/atomic-test-and-set.c
    M clang/test/Sema/atomic-ops.c

  Log Message:
  -----------
  [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (#120449)

Re-write the sema and codegen for the atomic_test_and_set and
atomic_clear builtin functions to go via AtomicExpr, like the other
atomic builtins do. This simplifies the code, because AtomicExpr already
handles things like generating code for to dynamically select the memory
ordering, which was duplicated for these builtins. This also fixes a few
crash bugs, one when passing an integer to the pointer argument, and one
when using an array.

This also adds diagnostics for the memory orderings which are not valid
for atomic_clear according to
https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html, which
were missing before.

Fixes #111293.



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