[cfe-commits] r59429 - /cfe/trunk/lib/AST/ExprConstant.cpp

Nuno Lopes nunoplopes at sapo.pt
Sun Nov 16 14:06:39 PST 2008


Author: nlopes
Date: Sun Nov 16 16:06:39 2008
New Revision: 59429

URL: http://llvm.org/viewvc/llvm-project?rev=59429&view=rev
Log:
use HandleConversionToBool() to check if a given cond is foldable (per Eli's comment)

Modified:
    cfe/trunk/lib/AST/ExprConstant.cpp

Modified: cfe/trunk/lib/AST/ExprConstant.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprConstant.cpp?rev=59429&r1=59428&r2=59429&view=diff

==============================================================================
--- cfe/trunk/lib/AST/ExprConstant.cpp (original)
+++ cfe/trunk/lib/AST/ExprConstant.cpp Sun Nov 16 16:06:39 2008
@@ -730,11 +730,11 @@
 }
 
 bool IntExprEvaluator::VisitConditionalOperator(const ConditionalOperator *E) {
-  llvm::APSInt Cond(32);
-  if (!EvaluateInteger(E->getCond(), Cond, Info))
+  bool Cond;
+  if (!HandleConversionToBool(E->getCond(), Cond, Info))
     return false;
 
-  return Visit(Cond != 0 ? E->getTrueExpr() : E->getFalseExpr());
+  return Visit(Cond ? E->getTrueExpr() : E->getFalseExpr());
 }
 
 /// VisitSizeAlignOfExpr - Evaluate a sizeof or alignof with a result as the





More information about the cfe-commits mailing list