]> granicus.if.org Git - clang/commitdiff
Update and move around comments.
authorEric Christopher <echristo@apple.com>
Tue, 19 Jan 2010 22:58:35 +0000 (22:58 +0000)
committerEric Christopher <echristo@apple.com>
Tue, 19 Jan 2010 22:58:35 +0000 (22:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93942 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ExprConstant.cpp

index dfff2099cbd6d183fa7cfae8f551bba6e1005882..c8d4e2b2b6ea5946dc148f9da8408767b0d8fbfa 100644 (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);