diff options
| author | Anders Carlsson <andersca@mac.com> | 2009-06-04 03:00:32 +0000 |
|---|---|---|
| committer | Anders Carlsson <andersca@mac.com> | 2009-06-04 03:00:32 +0000 |
| commit | 43c52cdc292c3b82b084c898eb91e18b14add353 (patch) | |
| tree | 020f8a480b9d59ada85cd3938a6dbfc1a7f1bbce /clang/lib/CodeGen/CGExprScalar.cpp | |
| parent | f47a3de83c2a39d5b28ca20a08892dafd1e85f8e (diff) | |
| download | bcm5719-llvm-43c52cdc292c3b82b084c898eb91e18b14add353.tar.gz bcm5719-llvm-43c52cdc292c3b82b084c898eb91e18b14add353.zip | |
Use PushConditionalTempDestruction/PopConditionalTempDestruction for the ternary operator.
llvm-svn: 72842
Diffstat (limited to 'clang/lib/CodeGen/CGExprScalar.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGExprScalar.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index faa4f7611d0..ed18d3247ac 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/lib/CodeGen/CGExprScalar.cpp @@ -1452,7 +1452,8 @@ VisitConditionalOperator(const ConditionalOperator *E) { CGF.getContext().BoolTy); Builder.CreateCondBr(CondBoolVal, LHSBlock, RHSBlock); } - + + CGF.PushConditionalTempDestruction(); CGF.EmitBlock(LHSBlock); // Handle the GNU extension for missing LHS. @@ -1462,12 +1463,15 @@ VisitConditionalOperator(const ConditionalOperator *E) { else // Perform promotions, to handle cases like "short ?: int" LHS = EmitScalarConversion(CondVal, E->getCond()->getType(), E->getType()); + CGF.PopConditionalTempDestruction(); LHSBlock = Builder.GetInsertBlock(); CGF.EmitBranch(ContBlock); + CGF.PushConditionalTempDestruction(); CGF.EmitBlock(RHSBlock); Value *RHS = Visit(E->getRHS()); + CGF.PopConditionalTempDestruction(); RHSBlock = Builder.GetInsertBlock(); CGF.EmitBranch(ContBlock); |

