diff options
Diffstat (limited to 'clang/lib/AST/ExprClassification.cpp')
-rw-r--r-- | clang/lib/AST/ExprClassification.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/clang/lib/AST/ExprClassification.cpp b/clang/lib/AST/ExprClassification.cpp index 0286c730ce4e..6998e28fd2ea 100644 --- a/clang/lib/AST/ExprClassification.cpp +++ b/clang/lib/AST/ExprClassification.cpp @@ -53,8 +53,12 @@ Cl Expr::ClassifyImpl(ASTContext &Ctx, SourceLocation *Loc) const { // Enable this assertion for testing. switch (kind) { - case Cl::CL_LValue: assert(getValueKind() == VK_LValue); break; - case Cl::CL_XValue: assert(getValueKind() == VK_XValue); break; + case Cl::CL_LValue: + assert(isLValue()); + break; + case Cl::CL_XValue: + assert(isXValue()); + break; case Cl::CL_Function: case Cl::CL_Void: case Cl::CL_AddressableVoid: @@ -64,7 +68,9 @@ Cl Expr::ClassifyImpl(ASTContext &Ctx, SourceLocation *Loc) const { case Cl::CL_ClassTemporary: case Cl::CL_ArrayTemporary: case Cl::CL_ObjCMessageRValue: - case Cl::CL_PRValue: assert(getValueKind() == VK_RValue); break; + case Cl::CL_PRValue: + assert(isPRValue()); + break; } Cl::ModifiableType modifiable = Cl::CM_Untested; @@ -89,7 +95,7 @@ static Cl::Kinds ClassifyExprValueKind(const LangOptions &Lang, const Expr *E, ExprValueKind Kind) { switch (Kind) { - case VK_RValue: + case VK_PRValue: return Lang.CPlusPlus ? ClassifyTemporary(E->getType()) : Cl::CL_PRValue; case VK_LValue: return Cl::CL_LValue; @@ -424,7 +430,7 @@ static Cl::Kinds ClassifyInternal(ASTContext &Ctx, const Expr *E) { // contains only one element. In that case, we look at that element // for an exact classification. Init list creation takes care of the // value kind for us, so we only need to fine-tune. - if (E->isRValue()) + if (E->isPRValue()) return ClassifyExprValueKind(Lang, E, E->getValueKind()); assert(cast<InitListExpr>(E)->getNumInits() == 1 && "Only 1-element init lists can be glvalues."); @@ -433,6 +439,9 @@ static Cl::Kinds ClassifyInternal(ASTContext &Ctx, const Expr *E) { case Expr::CoawaitExprClass: case Expr::CoyieldExprClass: return ClassifyInternal(Ctx, cast<CoroutineSuspendExpr>(E)->getResumeExpr()); + case Expr::SYCLUniqueStableNameExprClass: + return Cl::CL_PRValue; + break; } llvm_unreachable("unhandled expression kind in classification"); |