diff options
| author | Nuno Lopes <nunoplopes@sapo.pt> | 2008-11-16 22:06:39 +0000 |
|---|---|---|
| committer | Nuno Lopes <nunoplopes@sapo.pt> | 2008-11-16 22:06:39 +0000 |
| commit | 527b5a685873045bee7c283da64e98c58608126d (patch) | |
| tree | 6ab106e2d05e7bcc624da8fa6159fd084c5f0b56 /clang/lib | |
| parent | 9ddf7bedf9582001c33e0d9d64ff17b858c8819c (diff) | |
| download | bcm5719-llvm-527b5a685873045bee7c283da64e98c58608126d.tar.gz bcm5719-llvm-527b5a685873045bee7c283da64e98c58608126d.zip | |
use HandleConversionToBool() to check if a given cond is foldable (per Eli's comment)
llvm-svn: 59429
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 727678662db..07f6c5476d0 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -730,11 +730,11 @@ bool IntExprEvaluator::VisitBinaryOperator(const BinaryOperator *E) { } 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 |

