Update and move around comments.

llvm-svn: 93942
This commit is contained in:
Eric Christopher 2010-01-19 22:58:35 +00:00
parent 6a4491b8c7
commit 99469702a3
1 changed files with 4 additions and 1 deletions

View File

@ -971,6 +971,8 @@ bool IntExprEvaluator::VisitCallExpr(const CallExpr *E) {
case Builtin::BI__builtin_object_size: {
const Expr *Arg = E->getArg(0)->IgnoreParens();
Expr::EvalResult Base;
// TODO: Perhaps we should let LLVM lower this?
if (Arg->EvaluateAsAny(Base, Info.Ctx)
&& Base.Val.getKind() == APValue::LValue
&& !Base.HasSideEffects)
@ -992,7 +994,8 @@ bool IntExprEvaluator::VisitCallExpr(const CallExpr *E) {
}
}
// TODO: Perhaps we should let LLVM lower this?
// If evaluating the argument has side-effects we can't determine
// the size of the object and lower it to unknown now.
if (E->getArg(0)->HasSideEffects(Info.Ctx)) {
if (E->getArg(1)->EvaluateAsInt(Info.Ctx).getZExtValue() <= 1)
return Success(-1ULL, E);