diff options
author | Yaxun Liu <Yaxun.Liu@amd.com> | 2016-04-26 19:25:46 +0000 |
---|---|---|
committer | Yaxun Liu <Yaxun.Liu@amd.com> | 2016-04-26 19:25:46 +0000 |
commit | 382d355359c879472eaaf49e389f848fcf69003b (patch) | |
tree | bb8a96c5ca818e10446e0a83a3912265f85972c6 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | ff788aa0ee68097da3a24dbc5597c16932297c56 (diff) | |
download | bcm5719-llvm-382d355359c879472eaaf49e389f848fcf69003b.tar.gz bcm5719-llvm-382d355359c879472eaaf49e389f848fcf69003b.zip |
[OpenCL] Add predefined macros.
OpenCL spec requires __OPENCL_C_VERSION__ to be defined based on -cl-std option. This patch implements that.
The patch also defines __FAST_RELAXED_MATH__ based on -cl-fast-relaxed-math option.
Also fixed a test using -std=c99 for OpenCL program. Limit allowed language standard of OpenCL to be OpenCL standards.
Differential Revision: http://reviews.llvm.org/D19071
llvm-svn: 267590
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 6b3d76dfe68..67d116cee15 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1495,9 +1495,8 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, << A->getAsString(Args) << "C++/ObjC++"; break; case IK_OpenCL: - if (!Std.isC99()) - Diags.Report(diag::err_drv_argument_not_allowed_with) - << A->getAsString(Args) << "OpenCL"; + Diags.Report(diag::err_drv_argument_not_allowed_with) + << A->getAsString(Args) << "OpenCL"; break; case IK_CUDA: case IK_PreprocessedCuda: |