diff options
author | Anders Carlsson <andersca@mac.com> | 2010-01-24 00:20:05 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-01-24 00:20:05 +0000 |
commit | 60ddba67a883d76743feef04b8dcff262cb87d59 (patch) | |
tree | a775d17551673c6de5a185ab5447ccbb19dce583 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 0bd52403d456bd33a15c2c4a53cfadda10f70e77 (diff) | |
download | bcm5719-llvm-60ddba67a883d76743feef04b8dcff262cb87d59.tar.gz bcm5719-llvm-60ddba67a883d76743feef04b8dcff262cb87d59.zip |
Fix a nasty bug where temporaries weren't marked as being conditional in some cases.
llvm-svn: 94341
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index f0a5c64d2fd..5db441197e1 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -431,7 +431,11 @@ void CodeGenFunction::EmitBranchOnBoolExpr(const Expr *Cond, EmitBranchOnBoolExpr(CondBOp->getLHS(), LHSTrue, FalseBlock); EmitBlock(LHSTrue); + // Any temporaries created here are conditional. + StartConditionalBranch(); EmitBranchOnBoolExpr(CondBOp->getRHS(), TrueBlock, FalseBlock); + FinishConditionalBranch(); + return; } else if (CondBOp->getOpcode() == BinaryOperator::LOr) { // If we have "0 || X", simplify the code. "1 || X" would have constant @@ -454,7 +458,11 @@ void CodeGenFunction::EmitBranchOnBoolExpr(const Expr *Cond, EmitBranchOnBoolExpr(CondBOp->getLHS(), TrueBlock, LHSFalse); EmitBlock(LHSFalse); + // Any temporaries created here are conditional. + StartConditionalBranch(); EmitBranchOnBoolExpr(CondBOp->getRHS(), TrueBlock, FalseBlock); + FinishConditionalBranch(); + return; } } |