implement code generation for scalar stmt expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41656 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/CodeGen/CGExprScalar.cpp b/CodeGen/CGExprScalar.cpp
index 1499054..db0e6bf 100644
--- a/CodeGen/CGExprScalar.cpp
+++ b/CodeGen/CGExprScalar.cpp
@@ -129,6 +129,8 @@
     return CGF.EmitCallExpr(E).getVal();
   }
   
+  Value *VisitStmtExpr(const StmtExpr *E);
+  
   // Unary Operators.
   Value *VisitPrePostIncDec(const UnaryOperator *E, bool isInc, bool isPre);
   Value *VisitUnaryPostDec(const UnaryOperator *E) {
@@ -437,6 +439,11 @@
                                        DestTy);
 }
 
+Value *ScalarExprEmitter::VisitStmtExpr(const StmtExpr *E) {
+  return CGF.EmitCompoundStmt(*E->getSubStmt(), true).getVal();
+}
+
+
 //===----------------------------------------------------------------------===//
 //                             Unary Operators
 //===----------------------------------------------------------------------===//