diff options
| author | Anders Carlsson <andersca@mac.com> | 2009-08-07 22:21:05 +0000 |
|---|---|---|
| committer | Anders Carlsson <andersca@mac.com> | 2009-08-07 22:21:05 +0000 |
| commit | f10e414e4eacf5d590121f15a53175a3022a9beb (patch) | |
| tree | 5381be310c1a29c898b73e0b830821bd8e7d7afe /clang/lib/Sema/SemaExpr.cpp | |
| parent | c7e8e795fa50719d64dc64b9bc1dc4673ed58557 (diff) | |
| download | bcm5719-llvm-f10e414e4eacf5d590121f15a53175a3022a9beb.tar.gz bcm5719-llvm-f10e414e4eacf5d590121f15a53175a3022a9beb.zip | |
More CastKind work.
llvm-svn: 78415
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 51ebd079a49..684c2dafdba 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -2972,9 +2972,9 @@ Sema::ActOnInitList(SourceLocation LBraceLoc, MultiExprArg initlist, /// CheckCastTypes - Check type constraints for casting between types. bool Sema::CheckCastTypes(SourceRange TyR, QualType castType, Expr *&castExpr, - bool FunctionalStyle) { + CastExpr::CastKind& Kind, bool FunctionalStyle) { if (getLangOptions().CPlusPlus) - return CXXCheckCStyleCast(TyR, castType, castExpr, FunctionalStyle); + return CXXCheckCStyleCast(TyR, castType, castExpr, Kind, FunctionalStyle); UsualUnaryConversions(castExpr); @@ -3087,17 +3087,20 @@ bool Sema::CheckExtVectorCast(SourceRange R, QualType DestTy, QualType SrcTy) { Action::OwningExprResult Sema::ActOnCastExpr(SourceLocation LParenLoc, TypeTy *Ty, SourceLocation RParenLoc, ExprArg Op) { + CastExpr::CastKind Kind = CastExpr::CK_Unknown; + assert((Ty != 0) && (Op.get() != 0) && "ActOnCastExpr(): missing type or expr"); Expr *castExpr = Op.takeAs<Expr>(); QualType castType = QualType::getFromOpaquePtr(Ty); - if (CheckCastTypes(SourceRange(LParenLoc, RParenLoc), castType, castExpr)) + if (CheckCastTypes(SourceRange(LParenLoc, RParenLoc), castType, castExpr, + Kind)) return ExprError(); return Owned(new (Context) CStyleCastExpr(castType.getNonReferenceType(), - CastExpr::CK_Unknown, castExpr, - castType, LParenLoc, RParenLoc)); + Kind, castExpr, castType, + LParenLoc, RParenLoc)); } /// Note that lhs is not null here, even if this is the gnu "x ?: y" extension. |

