[cfe-commits] r79947 - in /cfe/trunk: lib/CodeGen/CGObjCMac.cpp test/CodeGenObjC/ivar-layout-no-optimize.m
Chris Lattner
clattner at apple.com
Mon Aug 24 15:38:51 PDT 2009
On Aug 24, 2009, at 2:55 PM, Fariborz Jahanian wrote:
> Author: fjahanian
> Date: Mon Aug 24 16:55:06 2009
> New Revision: 79947
>
> URL: http://llvm.org/viewvc/llvm-project?rev=79947&view=rev
> Log:
> Remove ivarlayout bitmap optimization, instead if all zeros,
> put out the bitmap when all objects are scanned.
Thanks Fariborz, if this optimization is going to be illegal, the code
should just be removed instead of #if 0'd out.
-Chris
>
> Added:
> cfe/trunk/test/CodeGenObjC/ivar-layout-no-optimize.m
> Modified:
> cfe/trunk/lib/CodeGen/CGObjCMac.cpp
>
> Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=79947&r1=79946&r2=79947&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Mon Aug 24 16:55:06 2009
> @@ -3354,11 +3354,13 @@
> printf("0x%x%s", s[i], s[i] != 0 ? ", " : "");
> printf("\n");
> }
> -
> +// Turn off this optimization.
> +#if 0
> // if ivar_layout bitmap is all 1 bits (nothing skipped) then use
> NULL as
> // final layout.
> if (ForStrongLayout && !BytesSkipped)
> return llvm::Constant::getNullValue(PtrTy);
> +#endif
> llvm::GlobalVariable * Entry =
> CreateMetadataVar("\01L_OBJC_CLASS_NAME_",
> llvm::ConstantArray::get(VMContext,
> BitMap.c_str()),
>
> Added: cfe/trunk/test/CodeGenObjC/ivar-layout-no-optimize.m
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/ivar-layout-no-optimize.m?rev=79947&view=auto
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- cfe/trunk/test/CodeGenObjC/ivar-layout-no-optimize.m (added)
> +++ cfe/trunk/test/CodeGenObjC/ivar-layout-no-optimize.m Mon Aug 24
> 16:55:06 2009
> @@ -0,0 +1,18 @@
> +// RUN: clang-cc -fobjc-gc -triple x86_64-apple-darwin -O0 -S %s -o
> %t-64.s &&
> +// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
> +// RUN: true
> +
> + at interface NSObject {
> + id isa;
> +}
> + at end
> +
> + at interface AllPointers : NSObject {
> + id foo;
> + void *__strong bar; NSObject *bletch;}
> + at end
> + at implementation AllPointers
> + at end
> +
> +// CHECK-LP64: L_OBJC_CLASS_NAME_6:
> +// CHECK-LP64-NEXT: .asciz "\004"
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list