PTGV = new llvm::GlobalVariable(
CGM.getModule(),
Init->getType(), false,
- llvm::GlobalValue::WeakAnyLinkage,
+ llvm::GlobalValue::PrivateLinkage,
Init,
ProtocolName);
+ assertPrivateName(PTGV);
PTGV->setSection("__DATA, __objc_protorefs, coalesced, no_dead_strip");
- PTGV->setVisibility(llvm::GlobalValue::HiddenVisibility);
CGM.AddUsedGlobal(PTGV);
return CGF.Builder.CreateLoad(PTGV);
}
// contents for protocols which were referenced but never defined.
Entry =
new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ProtocolnfABITy,
- false, llvm::GlobalValue::WeakAnyLinkage, 0,
+ false, llvm::GlobalValue::PrivateLinkage, 0,
"\01l_OBJC_PROTOCOL_$_" + PD->getName());
Entry->setSection("__DATA,__datacoal_nt,coalesced");
}
+ assertPrivateName(Entry);
return Entry;
}
if (Entry) {
// Already created, update the initializer.
- assert(Entry->getLinkage() == llvm::GlobalValue::WeakAnyLinkage);
Entry->setInitializer(Init);
} else {
Entry =
new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ProtocolnfABITy,
- false, llvm::GlobalValue::WeakAnyLinkage, Init,
+ false, llvm::GlobalValue::PrivateLinkage, Init,
"\01l_OBJC_PROTOCOL_$_" + PD->getName());
Entry->setAlignment(
CGM.getDataLayout().getABITypeAlignment(ObjCTypes.ProtocolnfABITy));
Protocols[PD->getIdentifier()] = Entry;
}
- Entry->setVisibility(llvm::GlobalValue::HiddenVisibility);
+ assertPrivateName(Entry);
CGM.AddUsedGlobal(Entry);
// Use this protocol meta-data to build protocol list table in section
// __DATA, __objc_protolist
llvm::GlobalVariable *PTGV =
new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ProtocolnfABIPtrTy,
- false, llvm::GlobalValue::WeakAnyLinkage, Entry,
+ false, llvm::GlobalValue::PrivateLinkage, Entry,
"\01l_OBJC_LABEL_PROTOCOL_$_" + PD->getName());
+ assertPrivateName(PTGV);
PTGV->setAlignment(
CGM.getDataLayout().getABITypeAlignment(ObjCTypes.ProtocolnfABIPtrTy));
PTGV->setSection("__DATA, __objc_protolist, coalesced, no_dead_strip");
- PTGV->setVisibility(llvm::GlobalValue::HiddenVisibility);
CGM.AddUsedGlobal(PTGV);
return Entry;
}
messageRef = new llvm::GlobalVariable(CGM.getModule(),
init->getType(),
/*constant*/ false,
- llvm::GlobalValue::WeakAnyLinkage,
+ llvm::GlobalValue::PrivateLinkage,
init,
messageRefName);
- messageRef->setVisibility(llvm::GlobalValue::HiddenVisibility);
messageRef->setAlignment(16);
messageRef->setSection("__DATA, __objc_msgrefs, coalesced");
}
-
+ assertPrivateName(messageRef);
+
bool requiresnullCheck = false;
if (CGM.getLangOpts().ObjCAutoRefCount && method)
for (ObjCMethodDecl::param_const_iterator i = method->param_begin(),
// CHECK: @"\01l_OBJC_$_CLASS_METHODS_A" = private global {{.*}} section "__DATA, __objc_const", align 8
// CHECK: @"\01l_OBJC_$_PROTOCOL_INSTANCE_METHODS_P" = private global {{.*}} section "__DATA, __objc_const", align 8
// CHECK: @"\01l_OBJC_$_PROTOCOL_CLASS_METHODS_P" = private global {{.*}} section "__DATA, __objc_const", align 8
-// CHECK: @"\01l_OBJC_PROTOCOL_$_P" = weak hidden global {{.*}} section "__DATA,__datacoal_nt,coalesced", align 8
-// CHECK: @"\01l_OBJC_LABEL_PROTOCOL_$_P" = weak hidden global {{.*}} section "__DATA, __objc_protolist, coalesced, no_dead_strip", align 8
+// CHECK: @"\01l_OBJC_PROTOCOL_$_P" = private global {{.*}} section "__DATA,__datacoal_nt,coalesced", align 8
+// CHECK: @"\01l_OBJC_LABEL_PROTOCOL_$_P" = private global {{.*}} section "__DATA, __objc_protolist, coalesced, no_dead_strip", align 8
// CHECK: @"\01l_OBJC_CLASS_PROTOCOLS_$_A" = private global {{.*}} section "__DATA, __objc_const", align 8
// CHECK: @"\01l_OBJC_METACLASS_RO_$_A" = private global {{.*}} section "__DATA, __objc_const", align 8
// CHECK: @"\01l_OBJC_$_INSTANCE_METHODS_A" = private global {{.*}} section "__DATA, __objc_const", align 8
// CHECK: @"\01L_OBJC_CLASSLIST_SUP_REFS_$_{{[0-9]*}}" = private global {{.*}} section "__DATA, __objc_superrefs, regular, no_dead_strip", align 8
// CHECK: @"OBJC_CLASS_$_B" = external global
// CHECK: @"\01L_OBJC_CLASSLIST_REFERENCES_$_{{[0-9]*}}" = private global {{.*}} section "__DATA, __objc_classrefs, regular, no_dead_strip", align 8
-// CHECK: @"\01l_objc_msgSend_fixup_alloc" = weak hidden global {{.*}} section "__DATA, __objc_msgrefs, coalesced", align 16
+// CHECK: @"\01l_objc_msgSend_fixup_alloc" = private global {{.*}} section "__DATA, __objc_msgrefs, coalesced", align 16
// CHECK: @"\01L_OBJC_LABEL_CLASS_$" = private global {{.*}} section "__DATA, __objc_classlist, regular, no_dead_strip", align 8
// CHECK: @"\01L_OBJC_LABEL_CATEGORY_$" = private global {{.*}} section "__DATA, __objc_catlist, regular, no_dead_strip", align 8
// CHECK: @objc_msgSend_fpret(