[clang] 18772de - [OpenCL] Add inc/dec/cmpxchg C++ legacy atomics with generic

Sven van Haastregt via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 26 01:46:50 PDT 2021


Author: Sven van Haastregt
Date: 2021-04-26T09:46:11+01:00
New Revision: 18772de1ecb1a23b483e29987ae708ab641b1134

URL: https://github.com/llvm/llvm-project/commit/18772de1ecb1a23b483e29987ae708ab641b1134
DIFF: https://github.com/llvm/llvm-project/commit/18772de1ecb1a23b483e29987ae708ab641b1134.diff

LOG: [OpenCL] Add inc/dec/cmpxchg C++ legacy atomics with generic

Mirror the remaining C++ for OpenCL specific builtins from opencl-c.h
to the TableGen builtin functions.

Fixes PR50041 (part 2).

Added: 
    

Modified: 
    clang/lib/Sema/OpenCLBuiltins.td

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/OpenCLBuiltins.td b/clang/lib/Sema/OpenCLBuiltins.td
index eb8034ee630c..efb540cd1967 100644
--- a/clang/lib/Sema/OpenCLBuiltins.td
+++ b/clang/lib/Sema/OpenCLBuiltins.td
@@ -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]>;
+    }
   }
 }
 


        


More information about the cfe-commits mailing list