diff options
author | Anders Carlsson <andersca@mac.com> | 2009-06-04 02:53:13 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-06-04 02:53:13 +0000 |
commit | 33da07db112f4877f6ab13e20db08b9bb86a0c2e (patch) | |
tree | 0ed308b6e49b3cb7f6f72271c3f78b9ed5f148ab /lib/CodeGen/CGExprScalar.cpp | |
parent | 8c0b203879f5e2064731700980c41199c692ca2c (diff) |
Use conditional temp destruction for || and &&.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72838 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprScalar.cpp')
-rw-r--r-- | lib/CodeGen/CGExprScalar.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index 950e9e5509..faa4f7611d 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -1290,8 +1290,10 @@ Value *ScalarExprEmitter::VisitBinLAnd(const BinaryOperator *E) { PI != PE; ++PI) PN->addIncoming(llvm::ConstantInt::getFalse(), *PI); + CGF.PushConditionalTempDestruction(); CGF.EmitBlock(RHSBlock); Value *RHSCond = CGF.EvaluateExprAsBool(E->getRHS()); + CGF.PopConditionalTempDestruction(); // Reaquire the RHS block, as there may be subblocks inserted. RHSBlock = Builder.GetInsertBlock(); @@ -1335,10 +1337,14 @@ Value *ScalarExprEmitter::VisitBinLOr(const BinaryOperator *E) { PI != PE; ++PI) PN->addIncoming(llvm::ConstantInt::getTrue(), *PI); + CGF.PushConditionalTempDestruction(); + // Emit the RHS condition as a bool value. CGF.EmitBlock(RHSBlock); Value *RHSCond = CGF.EvaluateExprAsBool(E->getRHS()); + CGF.PopConditionalTempDestruction(); + // Reaquire the RHS block, as there may be subblocks inserted. RHSBlock = Builder.GetInsertBlock(); |