diff options
| author | Nate Begeman <natebegeman@mac.com> | 2009-06-28 19:12:57 +0000 | 
|---|---|---|
| committer | Nate Begeman <natebegeman@mac.com> | 2009-06-28 19:12:57 +0000 | 
| commit | 886448d694f3775c645e84bc85f874d8261fc25d (patch) | |
| tree | e22da7a311d1c3a327a79b2ac237eb1381792df7 /clang/lib | |
| parent | 55e070031f8cf0b5b95d2d39f6ab85cf29f232aa (diff) | |
| download | bcm5719-llvm-886448d694f3775c645e84bc85f874d8261fc25d.tar.gz bcm5719-llvm-886448d694f3775c645e84bc85f874d8261fc25d.zip  | |
Fix incorrect AST's being produced, noticed by Eli.
The issue this was working around is no longer present in TOT clang.
llvm-svn: 74411
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 14 | 
1 files changed, 4 insertions, 10 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 6e111651066..fe284f73b0d 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -3623,15 +3623,12 @@ inline QualType Sema::CheckVectorOperands(SourceLocation Loc, Expr *&lex,      std::swap(rhsType, lhsType);    } -  // Handle the case of an ext vector and scalar +  // Handle the case of an ext vector and scalar.    if (const ExtVectorType *LV = lhsType->getAsExtVectorType()) {      QualType EltTy = LV->getElementType();      if (EltTy->isIntegralType() && rhsType->isIntegralType()) {        if (Context.getIntegerTypeOrder(EltTy, rhsType) >= 0) { -        ImpCastExprToType(rex, EltTy); -        rex = new (Context) CStyleCastExpr(lhsType, rex, lhsType, -                                           rex->getSourceRange().getBegin(), -                                           rex->getSourceRange().getEnd()); +        ImpCastExprToType(rex, lhsType);          if (swapped) std::swap(rex, lex);          return lhsType;        } @@ -3639,17 +3636,14 @@ inline QualType Sema::CheckVectorOperands(SourceLocation Loc, Expr *&lex,      if (EltTy->isRealFloatingType() && rhsType->isScalarType() &&          rhsType->isRealFloatingType()) {        if (Context.getFloatingTypeOrder(EltTy, rhsType) >= 0) { -        ImpCastExprToType(rex, EltTy); -        rex = new (Context) CStyleCastExpr(lhsType, rex, lhsType, -                                           rex->getSourceRange().getBegin(), -                                           rex->getSourceRange().getEnd()); +        ImpCastExprToType(rex, lhsType);          if (swapped) std::swap(rex, lex);          return lhsType;        }      }    } -  // You cannot convert between vector values of different size. +  // Vectors of different size or scalar and non-ext-vector are errors.    Diag(Loc, diag::err_typecheck_vector_not_convertable)      << lex->getType() << rex->getType()      << lex->getSourceRange() << rex->getSourceRange();  | 

