From 61664b6263b7159245344450cc77e7968face3a9 Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Tue, 17 Oct 2017 14:28:14 +0000 Subject: [OpenMP] Implement omp_is_initial_device() as builtin This allows to return the static value that we know at compile time. Differential Revision: https://reviews.llvm.org/D38968 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316001 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/Builtins.def | 3 +++ include/clang/Basic/Builtins.h | 1 + 2 files changed, 4 insertions(+) (limited to 'include/clang/Basic') diff --git a/include/clang/Basic/Builtins.def b/include/clang/Basic/Builtins.def index fef46da2d7..8e276e8445 100644 --- a/include/clang/Basic/Builtins.def +++ b/include/clang/Basic/Builtins.def @@ -1434,6 +1434,9 @@ LANGBUILTIN(__builtin_load_halff, "fhC*", "nc", ALL_OCLC_LANGUAGES) BUILTIN(__builtin_os_log_format_buffer_size, "zcC*.", "p:0:nut") BUILTIN(__builtin_os_log_format, "v*v*cC*.", "p:0:nt") +// OpenMP 4.0 +LANGBUILTIN(omp_is_initial_device, "i", "nc", OMP_LANG) + // Builtins for XRay BUILTIN(__xray_customevent, "vcC*z", "") diff --git a/include/clang/Basic/Builtins.h b/include/clang/Basic/Builtins.h index 093adf15a9..963c72ea82 100644 --- a/include/clang/Basic/Builtins.h +++ b/include/clang/Basic/Builtins.h @@ -38,6 +38,7 @@ enum LanguageID { MS_LANG = 0x10, // builtin requires MS mode. OCLC20_LANG = 0x20, // builtin for OpenCL C 2.0 only. OCLC1X_LANG = 0x40, // builtin for OpenCL C 1.x only. + OMP_LANG = 0x80, // builtin requires OpenMP. ALL_LANGUAGES = C_LANG | CXX_LANG | OBJC_LANG, // builtin for all languages. ALL_GNU_LANGUAGES = ALL_LANGUAGES | GNU_LANG, // builtin requires GNU mode. ALL_MS_LANGUAGES = ALL_LANGUAGES | MS_LANG, // builtin requires MS mode. -- cgit v1.2.3