[PATCH] D94884: [Clang][OpenMP] Include header for CUDA builtin vars into OpenMP wrapper header

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 19 10:54:37 PST 2021


tra added inline comments.


================
Comment at: clang/lib/Headers/__clang_cuda_builtin_vars.h:40
 
+#ifdef __cplusplus
 #define __CUDA_DEVICE_BUILTIN(FIELD, INTRINSIC)                                \
----------------
Perhaps we should move all C++-related code under `#ifdef __cplusplus` intead of cherry-picking them all one by one and let the compilation fail if some C code references builtin vars.


================
Comment at: clang/lib/Headers/__clang_cuda_builtin_vars.h:48
+#else
+#define __CUDA_DEVICE_BUILTIN(FIELD, INTRINSIC) unsigned int FIELD;
+#endif
----------------
Can we generate a sensible error instead?
I'd rather fail in an obvious way during compilation than compile successfully into somethings that will not do what the user expected.




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94884



More information about the cfe-commits mailing list