diff options
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r-- | lib/Sema/Sema.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index 6143492ea7..120035c923 100644 --- a/lib/Sema/Sema.cpp +++ b/lib/Sema/Sema.cpp @@ -191,8 +191,7 @@ Sema::~Sema() { /// If there is already an implicit cast, merge into the existing one. /// The result is of the given category. void Sema::ImpCastExprToType(Expr *&Expr, QualType Ty, - CastExpr::CastKind Kind, - ImplicitCastExpr::ResultCategory Category, + CastKind Kind, ExprValueKind VK, const CXXCastPath *BasePath) { QualType ExprTy = Context.getCanonicalType(Expr->getType()); QualType TypeTy = Context.getCanonicalType(Ty); @@ -224,21 +223,18 @@ void Sema::ImpCastExprToType(Expr *&Expr, QualType Ty, if (ImplicitCastExpr *ImpCast = dyn_cast<ImplicitCastExpr>(Expr)) { if (ImpCast->getCastKind() == Kind && (!BasePath || BasePath->empty())) { ImpCast->setType(Ty); - ImpCast->setCategory(Category); + ImpCast->setValueKind(VK); return; } } - Expr = ImplicitCastExpr::Create(Context, Ty, Kind, Expr, BasePath, Category); + Expr = ImplicitCastExpr::Create(Context, Ty, Kind, Expr, BasePath, VK); } -ImplicitCastExpr::ResultCategory Sema::CastCategory(Expr *E) { +ExprValueKind Sema::CastCategory(Expr *E) { Expr::Classification Classification = E->Classify(Context); - return Classification.isRValue() ? - ImplicitCastExpr::RValue : - (Classification.isLValue() ? - ImplicitCastExpr::LValue : - ImplicitCastExpr::XValue); + return Classification.isRValue() ? VK_RValue : + (Classification.isLValue() ? VK_LValue : VK_XValue); } void Sema::DeleteExpr(ExprTy *E) { |