[all-commits] [llvm/llvm-project] c4ef80: [Clang] Re-write codegen for atomic_test_and_set a...
Oliver Stannard via All-commits
all-commits at lists.llvm.org
Wed Jan 22 02:48:26 PST 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: c4ef805b0bda16f734276086b0984583c2e21db6
https://github.com/llvm/llvm-project/commit/c4ef805b0bda16f734276086b0984583c2e21db6
Author: Oliver Stannard <oliver.stannard at arm.com>
Date: 2025-01-22 (Wed, 22 Jan 2025)
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 (#121943)
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 https://github.com/llvm/llvm-project/issues/111293.
This is a re-land of #120449, modified to allow any non-const pointer
type for the first argument.
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