Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[objc_direct] do not add direct properties to the serialization array
If we do, then the property_list_t length is wrong and class_getProperty gets very sad. Signed-off-by: Pierre Habouzit <phabouzit@apple.com> Radar-Id: rdar://problem/58804805 Differential Revision: https://reviews.llvm.org/D73219 (cherry picked from commit 52311d0)
- Loading branch information
Showing
2 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// RUN: %clang_cc1 -emit-llvm -fobjc-arc -triple x86_64-apple-darwin10 %s -o - | FileCheck %s | ||
|
||
__attribute__((objc_root_class)) | ||
@interface A | ||
@property(direct, readonly) int i; | ||
@end | ||
|
||
__attribute__((objc_root_class)) | ||
@interface B | ||
@property(direct, readonly) int i; | ||
@property(readonly) int j; | ||
@end | ||
|
||
// CHECK-NOT: @"__OBJC_$_PROP_LIST_A" | ||
@implementation A | ||
@synthesize i = _i; | ||
@end | ||
|
||
// CHECK: @"_OBJC_$_PROP_LIST_B" = internal global { i32, i32, [1 x %struct._prop_t] } { i32 16, i32 1 | ||
@implementation B | ||
@synthesize i = _i; | ||
@synthesize j = _j; | ||
@end |