Skip to content

Commit

Permalink
[CodeGenObjC] Place property names in __objc_methname
Browse files Browse the repository at this point in the history
This allows the property name to deduplicate with the accessor method name.
rdar://58927964
  • Loading branch information
epilk committed Mar 10, 2020
1 parent 9769e1e commit 75af694
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion clang/lib/CodeGen/CGObjCMac.cpp
Expand Up @@ -4225,7 +4225,8 @@ CGObjCCommonMac::CreateCStringLiteral(StringRef Name, ObjCLabelType Type,
: "__TEXT,__cstring,cstring_literals";
break;
case ObjCLabelType::PropertyName:
Section = "__TEXT,__cstring,cstring_literals";
Section = NonFragile ? "__TEXT,__objc_methname,cstring_literals"
: "__TEXT,__cstring,cstring_literals";
break;
}

Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGenObjC/metadata-symbols-64.m
Expand Up @@ -17,7 +17,7 @@
// CHECK: @"_OBJC_METACLASS_RO_$_A" = internal global {{.*}} section "__DATA, __objc_const", align 8
// CHECK: @"_OBJC_$_INSTANCE_METHODS_A" = internal global {{.*}} section "__DATA, __objc_const", align 8
// CHECK: @"_OBJC_$_INSTANCE_VARIABLES_A" = internal global {{.*}} section "__DATA, __objc_const", align 8
// CHECK: @OBJC_PROP_NAME_ATTR_{{[0-9]*}} = private unnamed_addr constant {{.*}} section "__TEXT,__cstring,cstring_literals", align 1
// CHECK: @OBJC_PROP_NAME_ATTR_{{[0-9]*}} = private unnamed_addr constant {{.*}} section "__TEXT,__objc_methname,cstring_literals", align 1
// CHECK: @"_OBJC_$_PROP_LIST_A" = internal global {{.*}} section "__DATA, __objc_const", align 8
// CHECK: @"_OBJC_CLASS_RO_$_A" = internal global {{.*}} section "__DATA, __objc_const", align 8
// CHECK: @"_OBJC_$_CATEGORY_INSTANCE_METHODS_A_$_Cat" = internal global {{.*}} section "__DATA, __objc_const", align 8
Expand Down

0 comments on commit 75af694

Please sign in to comment.