From 7e4857931bfe27bb355275bc7ec1eaa44612dfff Mon Sep 17 00:00:00 2001 From: John McCall Date: Tue, 30 Nov 2010 10:13:06 +0000 Subject: Introduce an r-value to l-value cast kind. I'm not promising anything about the reliability of this yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120422 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExpr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/CodeGen/CGExpr.cpp') diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index ce25b7ff25..c28e405797 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -1789,8 +1789,7 @@ LValue CodeGenFunction::EmitCastLValue(const CastExpr *E) { llvm_unreachable("dependent cast kind in IR gen!"); case CK_NoOp: - if (E->getSubExpr()->Classify(getContext()).getKind() - != Expr::Classification::CL_PRValue) { + if (!E->getSubExpr()->isRValue()) { LValue LV = EmitLValue(E->getSubExpr()); if (LV.isPropertyRef() || LV.isKVCRef()) { QualType QT = E->getSubExpr()->getType(); @@ -1805,6 +1804,7 @@ LValue CodeGenFunction::EmitCastLValue(const CastExpr *E) { } // Fall through to synthesize a temporary. + case CK_LValueToRValue: case CK_BitCast: case CK_ArrayToPointerDecay: case CK_FunctionToPointerDecay: -- cgit v1.2.3