summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprScalar.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-01-13 02:03:06 +0000
committerJohn McCall <rjmccall@apple.com>2011-01-13 02:03:06 +0000
commit294c2db42bbef486b55297fcde31e89a88998c69 (patch)
tree51478972e9d835130185b1750413451adb78003a /clang/lib/CodeGen/CGExprScalar.cpp
parent8cf302a1e7ff8896980edbb073541a648748a751 (diff)
downloadbcm5719-llvm-294c2db42bbef486b55297fcde31e89a88998c69.tar.gz
bcm5719-llvm-294c2db42bbef486b55297fcde31e89a88998c69.zip
Ensure an insertion point at the end of a statement-expression.
Fixes PR8967. llvm-svn: 123360
Diffstat (limited to 'clang/lib/CodeGen/CGExprScalar.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprScalar.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp
index f80304d6de6..fde9f03ba7f 100644
--- a/clang/lib/CodeGen/CGExprScalar.cpp
+++ b/clang/lib/CodeGen/CGExprScalar.cpp
@@ -1204,8 +1204,10 @@ Value *ScalarExprEmitter::EmitCastExpr(CastExpr *CE) {
}
Value *ScalarExprEmitter::VisitStmtExpr(const StmtExpr *E) {
- return CGF.EmitCompoundStmt(*E->getSubStmt(),
- !E->getType()->isVoidType()).getScalarVal();
+ RValue value = CGF.EmitCompoundStmt(*E->getSubStmt(),
+ !E->getType()->isVoidType());
+ CGF.EnsureInsertPoint();
+ return value.getScalarVal();
}
Value *ScalarExprEmitter::VisitBlockDeclRefExpr(const BlockDeclRefExpr *E) {
OpenPOWER on IntegriCloud