summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBuiltin.cpp
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2009-11-09 22:40:09 +0000
committerMike Stump <mrs@apple.com>2009-11-09 22:40:09 +0000
commit68ec7ee0e89ec08f84a39ace6064baaf7ac81d10 (patch)
tree5d09835cc2ca9b7a26db2b145b708621bfb744e2 /clang/lib/CodeGen/CGBuiltin.cpp
parent8483f12ac549e574d2d50ae4cc3929a36037999b (diff)
downloadbcm5719-llvm-68ec7ee0e89ec08f84a39ace6064baaf7ac81d10.tar.gz
bcm5719-llvm-68ec7ee0e89ec08f84a39ace6064baaf7ac81d10.zip
Enable the use of the new llvm objectsize intrinsic.
llvm-svn: 86607
Diffstat (limited to 'clang/lib/CodeGen/CGBuiltin.cpp')
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp6
1 files changed, 2 insertions, 4 deletions
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;
OpenPOWER on IntegriCloud