My understanding is that __DATA,__data is a section that is atomized
by the linker and cannot have L symbols.
A simple testcase is
@protocol P
-(void) im0;
@end
@interface A<P>
@end
@implementation A
@end
where clang currently prints
.section __DATA,__data
...
L_OBJC_PROTOCOLEXT_P:
With the attached patch we print l_OBJC_PROTOCOLEXT_P.
Cheers,
Rafael
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index bd7c8bf..ca9f99b 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -2742,7 +2742,7 @@ CGObjCMac::EmitProtocolExtension(const ObjCProtocolDecl *PD,
llvm::ConstantStruct::get(ObjCTypes.ProtocolExtensionTy, Values);
// No special section, but goes in llvm.used
- return CreateMetadataVar("\01L_OBJC_PROTOCOLEXT_" + PD->getName(),
+ return CreateMetadataVar("\01l_OBJC_PROTOCOLEXT_" + PD->getName(),
Init,
0, 0, true);
}
diff --git a/test/CodeGenObjC/metadata-symbols-32.m b/test/CodeGenObjC/metadata-symbols-32.m
index 07515cf..61279e1 100644
--- a/test/CodeGenObjC/metadata-symbols-32.m
+++ b/test/CodeGenObjC/metadata-symbols-32.m
@@ -4,6 +4,8 @@
// CHECK: @"\01L_OBJC_METH_VAR_NAME_{{[0-9]*}}" = private global {{.*}}section "__TEXT,__cstring,cstring_literals", align 1
// CHECK: @"\01L_OBJC_METH_VAR_TYPE_{{[0-9]*}}" = private global {{.*}}section "__TEXT,__cstring,cstring_literals", align 1
+// CHECK: @"\01l_OBJC_PROTOCOLEXT_P" = private global
+// CHECK-NOT: section
// CHECK: @"\01L_OBJC_CLASS_NAME_{{[0-9]*}}" = private global {{.*}}section "__TEXT,__cstring,cstring_literals", align 1
// CHECK: @"\01L_OBJC_PROTOCOL_INSTANCE_METHODS_P" = private global {{.*}}section "__OBJC,__cat_inst_meth,regular,no_dead_strip", align 4
// CHECK: @"\01L_OBJC_PROTOCOL_CLASS_METHODS_P" = private global {{.*}}section "__OBJC,__cat_cls_meth,regular,no_dead_strip", align 4
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits