[cfe-commits] r54119 - /cfe/trunk/lib/AST/ExprConstant.cpp
Eli Friedman
eli.friedman at gmail.com
Sat Jul 26 22:46:19 PDT 2008
Author: efriedma
Date: Sun Jul 27 00:46:18 2008
New Revision: 54119
URL: http://llvm.org/viewvc/llvm-project?rev=54119&view=rev
Log:
Minor tweak plus a couple of FIXMEs.
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=54119&r1=54118&r2=54119&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ExprConstant.cpp (original)
+++ cfe/trunk/lib/AST/ExprConstant.cpp Sun Jul 27 00:46:18 2008
@@ -169,7 +169,7 @@
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 @@
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;
More information about the cfe-commits
mailing list