From: Mike Stump Date: Mon, 7 Dec 2009 18:58:11 +0000 (+0000) Subject: Remove obsolete fallback code for objectsize. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4bda1e448757ddf076622caf011eeb050ca893f1;p=clang Remove obsolete fallback code for objectsize. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90780 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp index be4c27ce53..02bf97cacb 100644 --- a/lib/CodeGen/CGBuiltin.cpp +++ b/lib/CodeGen/CGBuiltin.cpp @@ -204,7 +204,6 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD, 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 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD, 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));