From e61c9e80a108b5db7e5f0e702f0e455d737c6390 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sat, 30 May 2009 23:30:54 +0000 Subject: [PATCH] Add lvalue irgen support for CXXBindTemporaryExpr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72649 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExpr.cpp | 15 +++++++++++++-- lib/CodeGen/CGExprAgg.cpp | 1 - lib/CodeGen/CodeGenFunction.h | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 505677bc7d..de2c2744d5 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -191,8 +191,10 @@ LValue CodeGenFunction::EmitLValue(const Expr *E) { return EmitCXXConditionDeclLValue(cast(E)); case Expr::CXXTemporaryObjectExprClass: case Expr::CXXConstructExprClass: - return EmitCXXConstructLValue(cast(E)); - + return EmitCXXConstructLValue(cast(E)); + case Expr::CXXBindTemporaryExprClass: + return EmitCXXBindTemporaryLValue(cast(E)); + case Expr::ObjCMessageExprClass: return EmitObjCMessageExprLValue(cast(E)); case Expr::ObjCIvarRefExprClass: @@ -1207,6 +1209,15 @@ LValue CodeGenFunction::EmitCXXConstructLValue(const CXXConstructExpr *E) { return LValue::MakeAddr(Temp, E->getType().getCVRQualifiers()); } +LValue +CodeGenFunction::EmitCXXBindTemporaryLValue(const CXXBindTemporaryExpr *E) { + LValue LV = EmitLValue(E->getSubExpr()); + + // FIXME: Record the value and dest ptr. + + return LV; +} + LValue CodeGenFunction::EmitObjCMessageExprLValue(const ObjCMessageExpr *E) { // Can only get l-value for message expression returning aggregate type RValue RV = EmitObjCMessageExpr(E); diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp index 343163ff2c..140ecc4aca 100644 --- a/lib/CodeGen/CGExprAgg.cpp +++ b/lib/CodeGen/CGExprAgg.cpp @@ -304,7 +304,6 @@ void AggExprEmitter::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) { Visit(E->getSubExpr()); // FIXME: Record the value and dest ptr. - Val->dump(); } void diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index 4411348a58..939b8f8e9b 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -654,6 +654,7 @@ public: LValue EmitCXXConditionDeclLValue(const CXXConditionDeclExpr *E); LValue EmitCXXConstructLValue(const CXXConstructExpr *E); + LValue EmitCXXBindTemporaryLValue(const CXXBindTemporaryExpr *E); LValue EmitObjCMessageExprLValue(const ObjCMessageExpr *E); LValue EmitObjCIvarRefLValue(const ObjCIvarRefExpr *E); -- 2.40.0