summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-02-27 23:02:32 +0000
committerChris Lattner <sabre@nondot.org>2011-02-27 23:02:32 +0000
commit41c6ab538ab6ff6c71164d9c2be8200c46096838 (patch)
tree58f20a82508bee8c7f0f9080936d2b1b41e21478 /clang/lib/CodeGen/CGExpr.cpp
parent2ca62f910d07f9ca45b6d49e2a6ac231f7d08aba (diff)
downloadbcm5719-llvm-41c6ab538ab6ff6c71164d9c2be8200c46096838.tar.gz
bcm5719-llvm-41c6ab538ab6ff6c71164d9c2be8200c46096838.zip
Change the interface to ConstantFoldsToSimpleInteger to not encode
a bool + success into one tri-state integer, simplifying things. llvm-svn: 126592
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 2abaadff4b6..e358496f824 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -1715,10 +1715,10 @@ EmitConditionalOperatorLValue(const AbstractConditionalOperator *expr) {
}
const Expr *condExpr = expr->getCond();
-
- if (int condValue = ConstantFoldsToSimpleInteger(condExpr)) {
+ bool CondExprBool;
+ if (ConstantFoldsToSimpleInteger(condExpr, CondExprBool)) {
const Expr *live = expr->getTrueExpr(), *dead = expr->getFalseExpr();
- if (condValue == -1) std::swap(live, dead);
+ if (!CondExprBool) std::swap(live, dead);
if (!ContainsLabel(dead))
return EmitLValue(live);
OpenPOWER on IntegriCloud