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 | 64029a8d04779aba767f1df24cd41dfdb6365740 (patch) | |
tree | 4185841608f048439832db37bea79b582e5a68ea /lib/Frontend/CompilerInvocation.cpp | |
parent | 9f60c2c4b52106e744425d7923d8ef7cf006323c (diff) | |
download | clang-64029a8d04779aba767f1df24cd41dfdb6365740.tar.gz |
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267590 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 6b3d76dfe6..67d116cee1 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/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: |