summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorYaxun Liu <Yaxun.Liu@amd.com>2016-05-13 15:44:37 +0000
committerYaxun Liu <Yaxun.Liu@amd.com>2016-05-13 15:44:37 +0000
commit64936ce91dba4fe91655629ce1a25895f2af6f51 (patch)
tree193e74b8eb9cbefed8552d6d4ba102e062e737b0 /clang/lib/Frontend/InitPreprocessor.cpp
parent57cdcb07d69cddb702ca4a428eb5c6bdb2fa0a88 (diff)
downloadbcm5719-llvm-64936ce91dba4fe91655629ce1a25895f2af6f51.tar.gz
bcm5719-llvm-64936ce91dba4fe91655629ce1a25895f2af6f51.zip
[OpenCL] Add supported OpenCL extensions to target info.
Add supported OpenCL extensions to target info. It serves as default values to save the users of the burden setting each supported extensions and optional core features in command line. Differential Revision: http://reviews.llvm.org/D19484 llvm-svn: 269431
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r--clang/lib/Frontend/InitPreprocessor.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index 1c7793e285a..5d38d5f9503 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -938,6 +938,15 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
Builder.defineMacro("__CUDA_ARCH__");
}
+ // OpenCL definitions.
+ if (LangOpts.OpenCL) {
+#define OPENCLEXT(Ext) \
+ if (TI.getSupportedOpenCLOpts().is_##Ext##_supported( \
+ LangOpts.OpenCLVersion)) \
+ Builder.defineMacro(#Ext);
+#include "clang/Basic/OpenCLExtensions.def"
+ }
+
// Get other target #defines.
TI.getTargetDefines(LangOpts, Builder);
}
OpenPOWER on IntegriCloud