Implement CodeGen support for the 'CXXConditionDeclExpr' expression node, which represents a 'condition' declaration, e.g: "if (int x=0) {...}".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56045 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index f8dc9dc..cafe576 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -121,6 +121,9 @@
case Expr::StringLiteralClass:
return EmitStringLiteralLValue(cast<StringLiteral>(E));
+ case Expr::CXXConditionDeclExprClass:
+ return EmitCXXConditionDeclLValue(cast<CXXConditionDeclExpr>(E));
+
case Expr::ObjCMessageExprClass:
return EmitObjCMessageExprLValue(cast<ObjCMessageExpr>(E));
case Expr::ObjCIvarRefExprClass:
@@ -786,6 +789,12 @@
E->getType().getCVRQualifiers());
}
+LValue
+CodeGenFunction::EmitCXXConditionDeclLValue(const CXXConditionDeclExpr *E) {
+ EmitLocalBlockVarDecl(*E->getVarDecl());
+ return EmitDeclRefLValue(E);
+}
+
LValue CodeGenFunction::EmitObjCMessageExprLValue(const ObjCMessageExpr *E) {
// Can only get l-value for message expression returning aggregate type
RValue RV = EmitObjCMessageExpr(E);