[PATCH] D131639: [OpenMP] Remove 'stdbool.h' from OpenMP header wrappers

Joseph Huber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 11 08:57:24 PDT 2022


jhuber6 updated this revision to Diff 451875.
jhuber6 added a comment.

Changing bool usage to use `_Bool` if compiling for C so we don't need to include the extra header for this single declaration.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131639/new/

https://reviews.llvm.org/D131639

Files:
  clang/lib/Headers/__clang_hip_libdevice_declares.h
  clang/lib/Headers/openmp_wrappers/__clang_openmp_device_functions.h


Index: clang/lib/Headers/openmp_wrappers/__clang_openmp_device_functions.h
===================================================================
--- clang/lib/Headers/openmp_wrappers/__clang_openmp_device_functions.h
+++ clang/lib/Headers/openmp_wrappers/__clang_openmp_device_functions.h
@@ -40,7 +40,6 @@
 
 // Import types which will be used by __clang_hip_libdevice_declares.h
 #ifndef __cplusplus
-#include <stdbool.h>
 #include <stdint.h>
 #endif
 
Index: clang/lib/Headers/__clang_hip_libdevice_declares.h
===================================================================
--- clang/lib/Headers/__clang_hip_libdevice_declares.h
+++ clang/lib/Headers/__clang_hip_libdevice_declares.h
@@ -311,8 +311,13 @@
 typedef _Float16 __2f16 __attribute__((ext_vector_type(2)));
 typedef short __2i16 __attribute__((ext_vector_type(2)));
 
+#ifdef __cplusplus
 __device__ __attribute__((const)) float __ockl_fdot2(__2f16 a, __2f16 b,
                                                      float c, bool s);
+#else
+__device__ __attribute__((const)) float __ockl_fdot2(__2f16 a, __2f16 b,
+                                                     float c, _Bool s);
+#endif
 __device__ __attribute__((const)) __2f16 __ocml_ceil_2f16(__2f16);
 __device__ __attribute__((const)) __2f16 __ocml_fabs_2f16(__2f16);
 __device__ __2f16 __ocml_cos_2f16(__2f16);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131639.451875.patch
Type: text/x-patch
Size: 1341 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220811/da3c1f37/attachment.bin>


More information about the cfe-commits mailing list