[CUDA][HIP] Add pre-defined macro `__CLANG_RDC__`
authorYaxun (Sam) Liu <yaxun.liu@amd.com>
Tue, 30 Nov 2021 19:45:16 +0000 (14:45 -0500)
committerYaxun (Sam) Liu <yaxun.liu@amd.com>
Tue, 7 Dec 2021 23:08:16 +0000 (18:08 -0500)
commitd55f05d9f7dc8aa0468a9db19d84671acf05823a
treee6c1747c39ab2e436915bd781a6ec7113886ca31
parentf75885977cefe4d5ebbe51f85b353bb9989dd777
[CUDA][HIP] Add pre-defined macro `__CLANG_RDC__`

nvcc defines __CUDACC_RDC__ for both host and
device compilation when -rdc=true is specified
(https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#nvcc-identification-macro)

This patch defines __CLANG_RDC__ when -fgpu-rdc
is specified for CUDA/HIP.

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D114812
clang/lib/Frontend/InitPreprocessor.cpp
clang/test/Preprocessor/predefined-macros.c