[cfe-commits] r93942 - /cfe/trunk/lib/AST/ExprConstant.cpp

Eric Christopher echristo at apple.com
Tue Jan 19 14:58:35 PST 2010


Author: echristo
Date: Tue Jan 19 16:58:35 2010
New Revision: 93942

URL: http://llvm.org/viewvc/llvm-project?rev=93942&view=rev
Log:
Update and move around comments.

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=93942&r1=93941&r2=93942&view=diff

==============================================================================
--- cfe/trunk/lib/AST/ExprConstant.cpp (original)
+++ cfe/trunk/lib/AST/ExprConstant.cpp Tue Jan 19 16:58:35 2010
@@ -971,6 +971,8 @@
   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 @@
           }
         }
 
-    // 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);





More information about the cfe-commits mailing list