diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 4 | ||||
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index a8d98b2608..7cb707b966 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -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; } diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 1d23f4f3b2..58b6258304 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -4248,7 +4248,8 @@ Sema::ActOnCastExpr(Scope *S, SourceLocation LParenLoc, // i.e. all the elements are integer constants. ParenExpr *PE = dyn_cast<ParenExpr>(CastExpr); ParenListExpr *PLE = dyn_cast<ParenListExpr>(CastExpr); - if (getLangOptions().AltiVec && castType->isVectorType() && (PE || PLE)) { + if ((getLangOptions().AltiVec || getLangOptions().OpenCL) + && castType->isVectorType() && (PE || PLE)) { if (PLE && PLE->getNumExprs() == 0) { Diag(PLE->getExprLoc(), diag::err_altivec_empty_initializer); return ExprError(); |