[OpenCL] Add inc/dec/cmpxchg C++ legacy atomics with generic
authorSven van Haastregt <sven.vanhaastregt@arm.com>
Mon, 26 Apr 2021 08:46:11 +0000 (09:46 +0100)
committerSven van Haastregt <sven.vanhaastregt@arm.com>
Mon, 26 Apr 2021 08:46:11 +0000 (09:46 +0100)
Mirror the remaining C++ for OpenCL specific builtins from opencl-c.h
to the TableGen builtin functions.

Fixes PR50041 (part 2).

clang/lib/Sema/OpenCLBuiltins.td

index eb8034e..efb540c 100644 (file)
@@ -1088,6 +1088,12 @@ let Extension = FuncExtOpenCLCxx in {
                     "atomic_or", "atomic_xor"] in {
       def : Builtin<name, [Type, PointerType<VolatileType<Type>, GenericAS>, Type]>;
     }
+    foreach name = ["atomic_inc", "atomic_dec"] in {
+      def : Builtin<name, [Type, PointerType<VolatileType<Type>, GenericAS>]>;
+    }
+    foreach name = ["atomic_cmpxchg"] in {
+      def : Builtin<name, [Type, PointerType<VolatileType<Type>, GenericAS>, Type, Type]>;
+    }
   }
 }