summaryrefslogtreecommitdiff
path: root/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
commitc2c90011a688c04a4e980282f08c267e081c4b00 (patch)
treef543ec6056c1b38c7b6bc1ae2fb4b4b1090734e1 /lib/CodeGen/CGExpr.cpp
parenta02411e4d58b1730bea2a990822858ecc31e8eb1 (diff)
downloadclang-c2c90011a688c04a4e980282f08c267e081c4b00.tar.gz
clang-c2c90011a688c04a4e980282f08c267e081c4b00.tar.bz2
clang-c2c90011a688c04a4e980282f08c267e081c4b00.tar.xz
Change the interface to ConstantFoldsToSimpleInteger to not encode
a bool + success into one tri-state integer, simplifying things. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126592 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r--lib/CodeGen/CGExpr.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 2abaadff4b..e358496f82 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/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);