forked from OSchip/llvm-project
Use conditional temp destruction for || and &&.
llvm-svn: 72838
This commit is contained in:
parent
7d313fc09b
commit
f47a3de83c
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue