[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #120449)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 18 13:09:08 PST 2024


================
@@ -1977,15 +1977,15 @@ def AtomicNandFetch : AtomicBuiltin {
   let Prototype = "void(...)";
 }
 
-def AtomicTestAndSet : Builtin {
+def AtomicTestAndSet : AtomicBuiltin {
   let Spellings = ["__atomic_test_and_set"];
-  let Attributes = [NoThrow];
+  let Attributes = [NoThrow, CustomTypeChecking];
   let Prototype = "bool(void volatile*, int)";
 }
 
-def AtomicClear : Builtin {
+def AtomicClear : AtomicBuiltin {
   let Spellings = ["__atomic_clear"];
-  let Attributes = [NoThrow];
+  let Attributes = [NoThrow, CustomTypeChecking];
----------------
efriedma-quic wrote:

For builtins that use custom type checking, we usually use something like `void(...)` instead of `void(void volatile*, int)`.  But as far as I remember, we ignore the signature anyway, so it doesn't matter very much.

https://github.com/llvm/llvm-project/pull/120449


More information about the cfe-commits mailing list