In the OpenCL mode, the AltiVec mode must be off and checks must be strict

OpenCL is different from AltiVec in the way it supports vector literals.  OpenCL
is strict with regards to semantic checks.  For example, implicit conversions
and explicit casts between vectors of different types are disallowed.

Fixes PR10975. Submitted by: Anton Lokhmotov <Anton.lokhmotov@gmail.com>

llvm-svn: 140270
This commit is contained in:
Tobias Grosser
2011-09-21 18:28:29 +00:00
parent 37a7151b1f
commit 0a3a22fe66
3 changed files with 5 additions and 4 deletions

View File

@@ -1492,9 +1492,9 @@ void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK,
// OpenCL has some additional defaults.
if (LangStd == LangStandard::lang_opencl) {
Opts.OpenCL = 1;
Opts.AltiVec = 1;
Opts.AltiVec = 0;
Opts.CXXOperatorNames = 1;
Opts.LaxVectorConversions = 1;
Opts.LaxVectorConversions = 0;
Opts.DefaultFPContract = 1;
}