[cfe-commits] r90780 - /cfe/trunk/lib/CodeGen/CGBuiltin.cpp

Mike Stump mrs at apple.com
Mon Dec 7 10:58:11 PST 2009


Author: mrs
Date: Mon Dec  7 12:58:11 2009
New Revision: 90780

URL: http://llvm.org/viewvc/llvm-project?rev=90780&view=rev
Log:
Remove obsolete fallback code for objectsize.

Modified:
    cfe/trunk/lib/CodeGen/CGBuiltin.cpp

Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=90780&r1=90779&r2=90780&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Mon Dec  7 12:58:11 2009
@@ -204,7 +204,6 @@
     return RValue::get(Builder.CreateCall(F, ArgValue, "tmp"));
   }
   case Builtin::BI__builtin_object_size: {
-#if 1
     // We pass this builtin onto the optimizer so that it can
     // figure out the object size in more complex cases.
     const llvm::Type *ResType[] = {
@@ -214,15 +213,6 @@
     return RValue::get(Builder.CreateCall2(F,
                                            EmitScalarExpr(E->getArg(0)),
                                            EmitScalarExpr(E->getArg(1))));
-#else
-    // FIXME: Remove after testing.
-    llvm::APSInt TypeArg = E->getArg(1)->EvaluateAsInt(CGM.getContext());
-    const llvm::Type *ResType = ConvertType(E->getType());
-    //    bool UseSubObject = TypeArg.getZExtValue() & 1;
-    bool UseMinimum = TypeArg.getZExtValue() & 2;
-    return RValue::get(
-      llvm::ConstantInt::get(ResType, UseMinimum ? 0 : -1LL));
-#endif
   }
   case Builtin::BI__builtin_prefetch: {
     Value *Locality, *RW, *Address = EmitScalarExpr(E->getArg(0));





More information about the cfe-commits mailing list