[PATCH] D73219: [objc_direct] do not add direct properties to the serialization array
Pierre Habouzit via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 23 23:01:58 PST 2020
This revision was automatically updated to reflect the committed changes.
MadCoder marked an inline comment as done.
Closed by commit rG52311d0483ee: [objc_direct] do not add direct properties to the serialization array (authored by MadCoder).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73219/new/
https://reviews.llvm.org/D73219
Files:
clang/lib/CodeGen/CGObjCMac.cpp
clang/test/CodeGenObjC/direct-properties.m
Index: clang/test/CodeGenObjC/direct-properties.m
===================================================================
--- /dev/null
+++ clang/test/CodeGenObjC/direct-properties.m
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -emit-llvm -fobjc-arc -triple x86_64-apple-darwin10 %s -o - | FileCheck %s
+
+__attribute__((objc_root_class))
+ at interface A
+ at property(direct, readonly) int i;
+ at end
+
+__attribute__((objc_root_class))
+ at interface B
+ at property(direct, readonly) int i;
+ at property(readonly) int j;
+ at end
+
+// CHECK-NOT: @"__OBJC_$_PROP_LIST_A"
+ at implementation A
+ at synthesize i = _i;
+ at end
+
+// CHECK: @"_OBJC_$_PROP_LIST_B" = internal global { i32, i32, [1 x %struct._prop_t] } { i32 16, i32 1
+ at implementation B
+ at synthesize i = _i;
+ at synthesize j = _j;
+ at end
Index: clang/lib/CodeGen/CGObjCMac.cpp
===================================================================
--- clang/lib/CodeGen/CGObjCMac.cpp
+++ clang/lib/CodeGen/CGObjCMac.cpp
@@ -3291,6 +3291,8 @@
for (auto *PD : ClassExt->properties()) {
if (IsClassProperty != PD->isClassProperty())
continue;
+ if (PD->isDirectProperty())
+ continue;
PropertySet.insert(PD->getIdentifier());
Properties.push_back(PD);
}
@@ -3302,6 +3304,8 @@
// class extension.
if (!PropertySet.insert(PD->getIdentifier()).second)
continue;
+ if (PD->isDirectProperty())
+ continue;
Properties.push_back(PD);
}
@@ -3327,8 +3331,6 @@
values.addInt(ObjCTypes.IntTy, Properties.size());
auto propertiesArray = values.beginArray(ObjCTypes.PropertyTy);
for (auto PD : Properties) {
- if (PD->isDirectProperty())
- continue;
auto property = propertiesArray.beginStruct(ObjCTypes.PropertyTy);
property.add(GetPropertyName(PD->getIdentifier()));
property.add(GetPropertyTypeString(PD, Container));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73219.240095.patch
Type: text/x-patch
Size: 1862 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200124/423f6267/attachment-0001.bin>
More information about the cfe-commits
mailing list