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

Shilei Tian via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 19 12:14:24 PST 2021


tianshilei1992 marked 2 inline comments as done.
tianshilei1992 added inline comments.


================
Comment at: clang/lib/Headers/__clang_cuda_builtin_vars.h:40
 
+#ifdef __cplusplus
 #define __CUDA_DEVICE_BUILTIN(FIELD, INTRINSIC)                                \
----------------
tra wrote:
> 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.
Finally I decided to only include the header in C++ mode. For C mode, everything is unchanged, which means compilation error will still be emitted because the variables are not defined.


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