Enable the use of the new llvm objectsize intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86607 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp
index c269219..ab4b3bf 100644
--- a/lib/CodeGen/CGBuiltin.cpp
+++ b/lib/CodeGen/CGBuiltin.cpp
@@ -199,8 +199,7 @@
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 @@
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;