[cfe-commits] r86607 - in /cfe/trunk: lib/CodeGen/CGBuiltin.cpp test/CodeGen/object-size.c
Mike Stump
mrs at apple.com
Mon Nov 9 14:40:09 PST 2009
Author: mrs
Date: Mon Nov 9 16:40:09 2009
New Revision: 86607
URL: http://llvm.org/viewvc/llvm-project?rev=86607&view=rev
Log:
Enable the use of the new llvm objectsize intrinsic.
Modified:
cfe/trunk/lib/CodeGen/CGBuiltin.cpp
cfe/trunk/test/CodeGen/object-size.c
Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=86607&r1=86606&r2=86607&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Mon Nov 9 16:40:09 2009
@@ -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;
Modified: cfe/trunk/test/CodeGen/object-size.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/object-size.c?rev=86607&r1=86606&r2=86607&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/object-size.c (original)
+++ cfe/trunk/test/CodeGen/object-size.c Mon Nov 9 16:40:09 2009
@@ -46,8 +46,8 @@
}
void test5() {
- // CHECK: movb $0, %al
- // CHECK-NEXT: testb %al, %al
+ // CHECK: movq $-1, %rax
+ // CHECK-NEXT: cmpq $-1, %rax
// CHECK: call ___inline_strcpy_chk
strcpy(gp, "Hi there");
}
More information about the cfe-commits
mailing list