diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2008-07-27 05:46:18 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2008-07-27 05:46:18 +0000 |
commit | d9f4bcda18bfbf79341edd9d381d4b6a3cffe655 (patch) | |
tree | 821b3ef94046fd65bc08452e43f91482f6e33998 /lib/AST/ExprConstant.cpp | |
parent | fde9fe7c314c425247ad5cccccc58a1c06fc718d (diff) |
Minor tweak plus a couple of FIXMEs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54119 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r-- | lib/AST/ExprConstant.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index 6b33bb6a61..adc52e236c 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -169,7 +169,7 @@ APValue PointerExprEvaluator::VisitCastExpr(const CastExpr* E) { return APValue(); } - if (SubExpr->getType()->isArithmeticType()) { + if (SubExpr->getType()->isIntegralType()) { llvm::APSInt Result(32); if (EvaluateInteger(SubExpr, Result, Info)) { Result.extOrTrunc((unsigned)Info.Ctx.getTypeSize(E->getType())); @@ -302,7 +302,12 @@ bool IntExprEvaluator::VisitBinaryOperator(const BinaryOperator *E) { if ((E->getOpcode() == BinaryOperator::LAnd && Result == 0) || (E->getOpcode() == BinaryOperator::LOr && Result != 0)) Info.isEvaluated = false; - + + // FIXME: Handle pointer subtraction + + // FIXME Maybe we want to succeed even where we can't evaluate the + // right side of LAnd/LOr? + // For example, see http://llvm.org/bugs/show_bug.cgi?id=2525 if (!EvaluateInteger(E->getRHS(), RHS, Info)) return false; Info.isEvaluated = OldEval; |