From 68ec7ee0e89ec08f84a39ace6064baaf7ac81d10 Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Mon, 9 Nov 2009 22:40:09 +0000 Subject: Enable the use of the new llvm objectsize intrinsic. llvm-svn: 86607 --- clang/lib/CodeGen/CGBuiltin.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'clang/lib/CodeGen/CGBuiltin.cpp') diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index c26921969a8..ab4b3bf8685 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -199,8 +199,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD, return RValue::get(Builder.CreateCall(F, ArgValue, "tmp")); } case Builtin::BI__builtin_object_size: { - // FIXME: We're awaiting the llvm intrincis. -#if 0 +#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[] = { @@ -211,8 +210,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD, EmitScalarExpr(E->getArg(0)), EmitScalarExpr(E->getArg(1)))); #else - // FIXME: Implement. For now we just always fail and pretend we - // don't know the object size. + // 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; -- cgit v1.2.3