From 41c6ab538ab6ff6c71164d9c2be8200c46096838 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 27 Feb 2011 23:02:32 +0000 Subject: Change the interface to ConstantFoldsToSimpleInteger to not encode a bool + success into one tri-state integer, simplifying things. llvm-svn: 126592 --- clang/lib/CodeGen/CGExpr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'clang/lib/CodeGen/CGExpr.cpp') 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); -- cgit v1.2.3