diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-08-24 21:55:06 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-08-24 21:55:06 +0000 |
commit | 6d9eae69a07d6ea55bad53eff217ea2f0737e5a0 (patch) | |
tree | 7858059df7d897d2bcaa6c3003270fcd759dac2a | |
parent | 9983cc110422a2e976191a0ce6ac4f1d7b634cc0 (diff) |
Remove ivarlayout bitmap optimization, instead if all zeros,
put out the bitmap when all objects are scanned.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79947 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/CGObjCMac.cpp | 4 | ||||
-rw-r--r-- | test/CodeGenObjC/ivar-layout-no-optimize.m | 18 |
2 files changed, 21 insertions, 1 deletions
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index f97b80aa40..ab53ddea55 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -3354,11 +3354,13 @@ llvm::Constant *CGObjCCommonMac::BuildIvarLayout( 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()), diff --git a/test/CodeGenObjC/ivar-layout-no-optimize.m b/test/CodeGenObjC/ivar-layout-no-optimize.m new file mode 100644 index 0000000000..d7796bc279 --- /dev/null +++ b/test/CodeGenObjC/ivar-layout-no-optimize.m @@ -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 + +@interface NSObject { + id isa; +} +@end + +@interface AllPointers : NSObject { + id foo; + void *__strong bar; NSObject *bletch;} +@end +@implementation AllPointers +@end + +// CHECK-LP64: L_OBJC_CLASS_NAME_6: +// CHECK-LP64-NEXT: .asciz "\004" |