From: Eric Christopher Date: Tue, 19 Jan 2010 22:58:35 +0000 (+0000) Subject: Update and move around comments. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b2aaf51ed73a4774322a39a0dd59d0fe7e3258c0;p=clang Update and move around comments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93942 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index dfff2099cb..c8d4e2b2b6 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -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);