[cfe-commits] r150058 - in /cfe/trunk/lib/CodeGen: CGExpr.cpp CodeGenFunction.h
Eli Friedman
eli.friedman at gmail.com
Tue Feb 7 21:34:56 PST 2012
Author: efriedma
Date: Tue Feb 7 23:34:55 2012
New Revision: 150058
URL: http://llvm.org/viewvc/llvm-project?rev=150058&view=rev
Log:
A little bit of lambda IRGen.
Modified:
cfe/trunk/lib/CodeGen/CGExpr.cpp
cfe/trunk/lib/CodeGen/CodeGenFunction.h
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=150058&r1=150057&r2=150058&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Tue Feb 7 23:34:55 2012
@@ -686,6 +686,8 @@
return EmitCXXConstructLValue(cast<CXXConstructExpr>(E));
case Expr::CXXBindTemporaryExprClass:
return EmitCXXBindTemporaryLValue(cast<CXXBindTemporaryExpr>(E));
+ case Expr::LambdaExprClass:
+ return EmitLambdaLValue(cast<LambdaExpr>(E));
case Expr::ExprWithCleanupsClass: {
const ExprWithCleanups *cleanups = cast<ExprWithCleanups>(E);
@@ -2359,6 +2361,15 @@
return MakeAddrLValue(Slot.getAddr(), E->getType());
}
+LValue
+CodeGenFunction::EmitLambdaLValue(const LambdaExpr *E) {
+ if (E->capture_begin() != E->capture_end())
+ return EmitUnsupportedLValue(E, "lambda expression");
+
+ AggValueSlot Slot = CreateAggTemp(E->getType(), "temp.lvalue");
+ return MakeAddrLValue(Slot.getAddr(), E->getType());
+}
+
LValue CodeGenFunction::EmitObjCMessageExprLValue(const ObjCMessageExpr *E) {
RValue RV = EmitObjCMessageExpr(E);
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=150058&r1=150057&r2=150058&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Tue Feb 7 23:34:55 2012
@@ -2117,6 +2117,7 @@
LValue EmitCXXConstructLValue(const CXXConstructExpr *E);
LValue EmitCXXBindTemporaryLValue(const CXXBindTemporaryExpr *E);
+ LValue EmitLambdaLValue(const LambdaExpr *E);
LValue EmitCXXTypeidLValue(const CXXTypeidExpr *E);
LValue EmitObjCMessageExprLValue(const ObjCMessageExpr *E);
More information about the cfe-commits
mailing list