Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Frontend/InitPreprocessor.cpp
Show First 20 Lines • Show All 481 Lines • ▼ Show 20 Lines | static void InitializeStandardPredefinedMacros(const TargetInfo &TI, | ||||
if (LangOpts.SYCLIsDevice || LangOpts.SYCLIsHost) { | if (LangOpts.SYCLIsDevice || LangOpts.SYCLIsHost) { | ||||
// SYCL Version is set to a value when building SYCL applications | // SYCL Version is set to a value when building SYCL applications | ||||
if (LangOpts.getSYCLVersion() == LangOptions::SYCL_2017) | if (LangOpts.getSYCLVersion() == LangOptions::SYCL_2017) | ||||
Builder.defineMacro("CL_SYCL_LANGUAGE_VERSION", "121"); | Builder.defineMacro("CL_SYCL_LANGUAGE_VERSION", "121"); | ||||
else if (LangOpts.getSYCLVersion() == LangOptions::SYCL_2020) | else if (LangOpts.getSYCLVersion() == LangOptions::SYCL_2020) | ||||
Builder.defineMacro("SYCL_LANGUAGE_VERSION", "202001"); | Builder.defineMacro("SYCL_LANGUAGE_VERSION", "202001"); | ||||
} | } | ||||
if (LangOpts.DeclareSPIRVBuiltins) { | |||||
Builder.defineMacro("__SPIRV_BUILTIN_DECLARATIONS__"); | |||||
} | |||||
// Not "standard" per se, but available even with the -undef flag. | // Not "standard" per se, but available even with the -undef flag. | ||||
if (LangOpts.AsmPreprocessor) | if (LangOpts.AsmPreprocessor) | ||||
Builder.defineMacro("__ASSEMBLER__"); | Builder.defineMacro("__ASSEMBLER__"); | ||||
if (LangOpts.CUDA && !LangOpts.HIP) | if (LangOpts.CUDA && !LangOpts.HIP) | ||||
Builder.defineMacro("__CUDA__"); | Builder.defineMacro("__CUDA__"); | ||||
if (LangOpts.HIP) { | if (LangOpts.HIP) { | ||||
Builder.defineMacro("__HIP__"); | Builder.defineMacro("__HIP__"); | ||||
Builder.defineMacro("__HIPCC__"); | Builder.defineMacro("__HIPCC__"); | ||||
▲ Show 20 Lines • Show All 787 Lines • Show Last 20 Lines |