[clang] 75af694 - [CodeGenObjC] Place property names in __objc_methname

Erik Pilkington via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 10 14:33:02 PDT 2020


Author: Erik Pilkington
Date: 2020-03-10T14:31:00-07:00
New Revision: 75af694a6da5157cc6a688c2fa77ff5200f46e11

URL: https://github.com/llvm/llvm-project/commit/75af694a6da5157cc6a688c2fa77ff5200f46e11
DIFF: https://github.com/llvm/llvm-project/commit/75af694a6da5157cc6a688c2fa77ff5200f46e11.diff

LOG: [CodeGenObjC] Place property names in __objc_methname

This allows the property name to deduplicate with the accessor method name.
rdar://58927964

Added: 
    

Modified: 
    clang/lib/CodeGen/CGObjCMac.cpp
    clang/test/CodeGenObjC/metadata-symbols-64.m

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp
index d6cfe41a9c87..0ab4fd8e224c 100644
--- a/clang/lib/CodeGen/CGObjCMac.cpp
+++ b/clang/lib/CodeGen/CGObjCMac.cpp
@@ -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;
   }
 

diff  --git a/clang/test/CodeGenObjC/metadata-symbols-64.m b/clang/test/CodeGenObjC/metadata-symbols-64.m
index bf02053013ab..3ff3261053a8 100644
--- a/clang/test/CodeGenObjC/metadata-symbols-64.m
+++ b/clang/test/CodeGenObjC/metadata-symbols-64.m
@@ -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


        


More information about the cfe-commits mailing list