r360359 - [CodeGen][ObjC] Remove the leading `l_` from ObjC symbols and make
Akira Hatanaka via cfe-commits
cfe-commits at lists.llvm.org
Thu May 9 10:43:52 PDT 2019
Author: ahatanak
Date: Thu May 9 10:43:52 2019
New Revision: 360359
URL: http://llvm.org/viewvc/llvm-project?rev=360359&view=rev
Log:
[CodeGen][ObjC] Remove the leading `l_` from ObjC symbols and make
private symbols in the __DATA segment internal.
This prevents the linker from removing the symbol names. Keeping the
symbols visible enables tools to collect various information about the
symbols, for example, tools that discover whether or not a symbol gets
dirtied.
rdar://problem/48887111
Differential Revision: https://reviews.llvm.org/D61454
Modified:
cfe/trunk/lib/CodeGen/CGObjCMac.cpp
cfe/trunk/test/CodeGenObjC/arc.m
cfe/trunk/test/CodeGenObjC/boxing.m
cfe/trunk/test/CodeGenObjC/exceptions-asm-attribute.m
cfe/trunk/test/CodeGenObjC/externally-initialized-selectors.m
cfe/trunk/test/CodeGenObjC/forward-protocol-metadata-symbols.m
cfe/trunk/test/CodeGenObjC/instance-method-metadata.m
cfe/trunk/test/CodeGenObjC/interface-layout-64.m
cfe/trunk/test/CodeGenObjC/metadata-class-properties.m
cfe/trunk/test/CodeGenObjC/metadata-symbols-32.m
cfe/trunk/test/CodeGenObjC/metadata-symbols-64.m
cfe/trunk/test/CodeGenObjC/metadata_symbols.m
cfe/trunk/test/CodeGenObjC/mrc-weak.m
cfe/trunk/test/CodeGenObjC/non-lazy-classes.m
cfe/trunk/test/CodeGenObjC/private-extern-selector-reference.m
cfe/trunk/test/CodeGenObjC/property-category-impl.m
cfe/trunk/test/CodeGenObjC/property-list-in-class.m
cfe/trunk/test/CodeGenObjC/property-list-in-extension.m
cfe/trunk/test/CodeGenObjC/protocol-comdat.m
cfe/trunk/test/CodeGenObjC/protocols.m
cfe/trunk/test/CodeGenObjC/section-name.m
cfe/trunk/test/CodeGenObjC/sections.m
cfe/trunk/test/CodeGenObjCXX/externally-initialized-selectors.mm
cfe/trunk/test/CodeGenObjCXX/mrc-weak.mm
Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=360359&r1=360358&r2=360359&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Thu May 9 10:43:52 2019
@@ -1809,6 +1809,28 @@ static bool hasObjCExceptionAttribute(AS
return false;
}
+static llvm::GlobalValue::LinkageTypes
+getLinkageTypeForObjCMetadata(CodeGenModule &CGM, StringRef Section) {
+ if (CGM.getTriple().isOSBinFormatMachO() &&
+ (Section.empty() || Section.startswith("__DATA")))
+ return llvm::GlobalValue::InternalLinkage;
+ return llvm::GlobalValue::PrivateLinkage;
+}
+
+/// A helper function to create an internal or private global variable.
+static llvm::GlobalVariable *
+finishAndCreateGlobal(ConstantInitBuilder::StructBuilder &Builder,
+ const llvm::Twine &Name, CodeGenModule &CGM) {
+ std::string SectionName;
+ if (CGM.getTriple().isOSBinFormatMachO())
+ SectionName = "__DATA, __objc_const";
+ auto *GV = Builder.finishAndCreateGlobal(
+ Name, CGM.getPointerAlign(), /*constant*/ false,
+ getLinkageTypeForObjCMetadata(CGM, SectionName));
+ GV->setSection(SectionName);
+ return GV;
+}
+
/* *** CGObjCMac Public Interface *** */
CGObjCMac::CGObjCMac(CodeGen::CodeGenModule &cgm) : CGObjCCommonMac(cgm),
@@ -3105,7 +3127,7 @@ CGObjCMac::EmitProtocolExtension(const O
values.add(classProperties);
// No special section, but goes in llvm.used
- return CreateMetadataVar("\01l_OBJC_PROTOCOLEXT_" + PD->getName(), values,
+ return CreateMetadataVar("_OBJC_PROTOCOLEXT_" + PD->getName(), values,
StringRef(), CGM.getPointerAlign(), true);
}
@@ -3338,9 +3360,9 @@ void CGObjCMac::GenerateCategory(const O
// If there is no category @interface then there can be no properties.
if (Category) {
- Values.add(EmitPropertyList("\01l_OBJC_$_PROP_LIST_" + ExtName.str(),
+ Values.add(EmitPropertyList("_OBJC_$_PROP_LIST_" + ExtName.str(),
OCD, Category, ObjCTypes, false));
- Values.add(EmitPropertyList("\01l_OBJC_$_CLASS_PROP_LIST_" + ExtName.str(),
+ Values.add(EmitPropertyList("_OBJC_$_CLASS_PROP_LIST_" + ExtName.str(),
OCD, Category, ObjCTypes, true));
} else {
Values.addNullPointer(ObjCTypes.PropertyListPtrTy);
@@ -3686,8 +3708,8 @@ CGObjCMac::EmitClassExtension(const ObjC
// Properties.
llvm::Constant *propertyList =
- EmitPropertyList((isMetaclass ? Twine("\01l_OBJC_$_CLASS_PROP_LIST_")
- : Twine("\01l_OBJC_$_PROP_LIST_"))
+ EmitPropertyList((isMetaclass ? Twine("_OBJC_$_CLASS_PROP_LIST_")
+ : Twine("_OBJC_$_PROP_LIST_"))
+ ID->getName(),
ID, ID->getClassInterface(), ObjCTypes, isMetaclass);
@@ -3935,9 +3957,10 @@ llvm::GlobalVariable *CGObjCCommonMac::C
StringRef Section,
CharUnits Align,
bool AddToUsed) {
+ llvm::GlobalValue::LinkageTypes LT =
+ getLinkageTypeForObjCMetadata(CGM, Section);
llvm::GlobalVariable *GV =
- Init.finishAndCreateGlobal(Name, Align, /*constant*/ false,
- llvm::GlobalValue::PrivateLinkage);
+ Init.finishAndCreateGlobal(Name, Align, /*constant*/ false, LT);
if (!Section.empty())
GV->setSection(Section);
if (AddToUsed)
@@ -3951,9 +3974,10 @@ llvm::GlobalVariable *CGObjCCommonMac::C
CharUnits Align,
bool AddToUsed) {
llvm::Type *Ty = Init->getType();
+ llvm::GlobalValue::LinkageTypes LT =
+ getLinkageTypeForObjCMetadata(CGM, Section);
llvm::GlobalVariable *GV =
- new llvm::GlobalVariable(CGM.getModule(), Ty, false,
- llvm::GlobalValue::PrivateLinkage, Init, Name);
+ new llvm::GlobalVariable(CGM.getModule(), Ty, false, LT, Init, Name);
if (!Section.empty())
GV->setSection(Section);
GV->setAlignment(Align.getQuantity());
@@ -6000,10 +6024,15 @@ void CGObjCNonFragileABIMac::AddModuleCl
Symbols.size()),
Symbols);
+ // Section name is obtained by calling GetSectionName, which returns
+ // sections in the __DATA segment on MachO.
+ assert((!CGM.getTriple().isOSBinFormatMachO() ||
+ SectionName.startswith("__DATA")) &&
+ "SectionName expected to start with __DATA on MachO");
+ llvm::GlobalValue::LinkageTypes LT =
+ getLinkageTypeForObjCMetadata(CGM, SectionName);
llvm::GlobalVariable *GV =
- new llvm::GlobalVariable(CGM.getModule(), Init->getType(), false,
- llvm::GlobalValue::PrivateLinkage,
- Init,
+ new llvm::GlobalVariable(CGM.getModule(), Init->getType(), false, LT, Init,
SymbolName);
GV->setAlignment(CGM.getDataLayout().getABITypeAlignment(Init->getType()));
GV->setSection(SectionName);
@@ -6182,7 +6211,7 @@ llvm::GlobalVariable * CGObjCNonFragileA
const ObjCInterfaceDecl *OID = ID->getClassInterface();
assert(OID && "CGObjCNonFragileABIMac::BuildClassRoTInitializer");
- values.add(EmitProtocolList("\01l_OBJC_CLASS_PROTOCOLS_$_"
+ values.add(EmitProtocolList("_OBJC_CLASS_PROTOCOLS_$_"
+ OID->getObjCRuntimeNameAsString(),
OID->all_referenced_protocol_begin(),
OID->all_referenced_protocol_end()));
@@ -6191,29 +6220,23 @@ llvm::GlobalVariable * CGObjCNonFragileA
values.addNullPointer(ObjCTypes.IvarListnfABIPtrTy);
values.add(GetIvarLayoutName(nullptr, ObjCTypes));
values.add(EmitPropertyList(
- "\01l_OBJC_$_CLASS_PROP_LIST_" + ID->getObjCRuntimeNameAsString(),
+ "_OBJC_$_CLASS_PROP_LIST_" + ID->getObjCRuntimeNameAsString(),
ID, ID->getClassInterface(), ObjCTypes, true));
} else {
values.add(EmitIvarList(ID));
values.add(BuildWeakIvarLayout(ID, beginInstance, endInstance, hasMRCWeak));
values.add(EmitPropertyList(
- "\01l_OBJC_$_PROP_LIST_" + ID->getObjCRuntimeNameAsString(),
+ "_OBJC_$_PROP_LIST_" + ID->getObjCRuntimeNameAsString(),
ID, ID->getClassInterface(), ObjCTypes, false));
}
llvm::SmallString<64> roLabel;
llvm::raw_svector_ostream(roLabel)
- << ((flags & NonFragileABI_Class_Meta) ? "\01l_OBJC_METACLASS_RO_$_"
- : "\01l_OBJC_CLASS_RO_$_")
+ << ((flags & NonFragileABI_Class_Meta) ? "_OBJC_METACLASS_RO_$_"
+ : "_OBJC_CLASS_RO_$_")
<< ClassName;
- llvm::GlobalVariable *CLASS_RO_GV =
- values.finishAndCreateGlobal(roLabel, CGM.getPointerAlign(),
- /*constant*/ false,
- llvm::GlobalValue::PrivateLinkage);
- if (CGM.getTriple().isOSBinFormatMachO())
- CLASS_RO_GV->setSection("__DATA, __objc_const");
- return CLASS_RO_GV;
+ return finishAndCreateGlobal(values, roLabel, CGM);
}
/// Build the metaclass object for a class.
@@ -6445,7 +6468,7 @@ llvm::Value *CGObjCNonFragileABIMac::Gen
llvm::ConstantExpr::getBitCast(GetOrEmitProtocol(PD),
ObjCTypes.getExternalProtocolPtrTy());
- std::string ProtocolName("\01l_OBJC_PROTOCOL_REFERENCE_$_");
+ std::string ProtocolName("_OBJC_PROTOCOL_REFERENCE_$_");
ProtocolName += PD->getObjCRuntimeNameAsString();
CharUnits Align = CGF.getPointerAlign();
@@ -6480,7 +6503,7 @@ llvm::Value *CGObjCNonFragileABIMac::Gen
///
void CGObjCNonFragileABIMac::GenerateCategory(const ObjCCategoryImplDecl *OCD) {
const ObjCInterfaceDecl *Interface = OCD->getClassInterface();
- const char *Prefix = "\01l_OBJC_$_CATEGORY_";
+ const char *Prefix = "_OBJC_$_CATEGORY_";
llvm::SmallString<64> ExtCatName(Prefix);
ExtCatName += Interface->getObjCRuntimeNameAsString();
@@ -6516,14 +6539,14 @@ void CGObjCNonFragileABIMac::GenerateCat
SmallString<256> ExtName;
llvm::raw_svector_ostream(ExtName) << Interface->getObjCRuntimeNameAsString() << "_$_"
<< OCD->getName();
- values.add(EmitProtocolList("\01l_OBJC_CATEGORY_PROTOCOLS_$_"
+ values.add(EmitProtocolList("_OBJC_CATEGORY_PROTOCOLS_$_"
+ Interface->getObjCRuntimeNameAsString() + "_$_"
+ Category->getName(),
Category->protocol_begin(),
Category->protocol_end()));
- values.add(EmitPropertyList("\01l_OBJC_$_PROP_LIST_" + ExtName.str(),
+ values.add(EmitPropertyList("_OBJC_$_PROP_LIST_" + ExtName.str(),
OCD, Category, ObjCTypes, false));
- values.add(EmitPropertyList("\01l_OBJC_$_CLASS_PROP_LIST_" + ExtName.str(),
+ values.add(EmitPropertyList("_OBJC_$_CLASS_PROP_LIST_" + ExtName.str(),
OCD, Category, ObjCTypes, true));
} else {
values.addNullPointer(ObjCTypes.ProtocolListnfABIPtrTy);
@@ -6535,11 +6558,7 @@ void CGObjCNonFragileABIMac::GenerateCat
values.addInt(ObjCTypes.IntTy, Size);
llvm::GlobalVariable *GCATV =
- values.finishAndCreateGlobal(ExtCatName.str(), CGM.getPointerAlign(),
- /*constant*/ false,
- llvm::GlobalValue::PrivateLinkage);
- if (CGM.getTriple().isOSBinFormatMachO())
- GCATV->setSection("__DATA, __objc_const");
+ finishAndCreateGlobal(values, ExtCatName.str(), CGM);
CGM.addCompilerUsedGlobal(GCATV);
DefinedCategories.push_back(GCATV);
@@ -6598,36 +6617,36 @@ CGObjCNonFragileABIMac::emitMethodList(T
bool forProtocol;
switch (kind) {
case MethodListType::CategoryInstanceMethods:
- prefix = "\01l_OBJC_$_CATEGORY_INSTANCE_METHODS_";
+ prefix = "_OBJC_$_CATEGORY_INSTANCE_METHODS_";
forProtocol = false;
break;
case MethodListType::CategoryClassMethods:
- prefix = "\01l_OBJC_$_CATEGORY_CLASS_METHODS_";
+ prefix = "_OBJC_$_CATEGORY_CLASS_METHODS_";
forProtocol = false;
break;
case MethodListType::InstanceMethods:
- prefix = "\01l_OBJC_$_INSTANCE_METHODS_";
+ prefix = "_OBJC_$_INSTANCE_METHODS_";
forProtocol = false;
break;
case MethodListType::ClassMethods:
- prefix = "\01l_OBJC_$_CLASS_METHODS_";
+ prefix = "_OBJC_$_CLASS_METHODS_";
forProtocol = false;
break;
case MethodListType::ProtocolInstanceMethods:
- prefix = "\01l_OBJC_$_PROTOCOL_INSTANCE_METHODS_";
+ prefix = "_OBJC_$_PROTOCOL_INSTANCE_METHODS_";
forProtocol = true;
break;
case MethodListType::ProtocolClassMethods:
- prefix = "\01l_OBJC_$_PROTOCOL_CLASS_METHODS_";
+ prefix = "_OBJC_$_PROTOCOL_CLASS_METHODS_";
forProtocol = true;
break;
case MethodListType::OptionalProtocolInstanceMethods:
- prefix = "\01l_OBJC_$_PROTOCOL_INSTANCE_METHODS_OPT_";
+ prefix = "_OBJC_$_PROTOCOL_INSTANCE_METHODS_OPT_";
forProtocol = true;
break;
case MethodListType::OptionalProtocolClassMethods:
- prefix = "\01l_OBJC_$_PROTOCOL_CLASS_METHODS_OPT_";
+ prefix = "_OBJC_$_PROTOCOL_CLASS_METHODS_OPT_";
forProtocol = true;
break;
}
@@ -6646,11 +6665,7 @@ CGObjCNonFragileABIMac::emitMethodList(T
}
methodArray.finishAndAddTo(values);
- auto *GV = values.finishAndCreateGlobal(prefix + name, CGM.getPointerAlign(),
- /*constant*/ false,
- llvm::GlobalValue::PrivateLinkage);
- if (CGM.getTriple().isOSBinFormatMachO())
- GV->setSection("__DATA, __objc_const");
+ llvm::GlobalVariable *GV = finishAndCreateGlobal(values, prefix + name, CGM);
CGM.addCompilerUsedGlobal(GV);
return llvm::ConstantExpr::getBitCast(GV, ObjCTypes.MethodListnfABIPtrTy);
}
@@ -6790,13 +6805,9 @@ llvm::Constant *CGObjCNonFragileABIMac::
ivars.finishAndAddTo(ivarList);
ivarList.fillPlaceholderWithInt(ivarCountSlot, ObjCTypes.IntTy, ivarCount);
- const char *Prefix = "\01l_OBJC_$_INSTANCE_VARIABLES_";
- llvm::GlobalVariable *GV =
- ivarList.finishAndCreateGlobal(Prefix + OID->getObjCRuntimeNameAsString(),
- CGM.getPointerAlign(), /*constant*/ false,
- llvm::GlobalValue::PrivateLinkage);
- if (CGM.getTriple().isOSBinFormatMachO())
- GV->setSection("__DATA, __objc_const");
+ const char *Prefix = "_OBJC_$_INSTANCE_VARIABLES_";
+ llvm::GlobalVariable *GV = finishAndCreateGlobal(
+ ivarList, Prefix + OID->getObjCRuntimeNameAsString(), CGM);
CGM.addCompilerUsedGlobal(GV);
return llvm::ConstantExpr::getBitCast(GV, ObjCTypes.IvarListnfABIPtrTy);
}
@@ -6864,7 +6875,7 @@ llvm::Constant *CGObjCNonFragileABIMac::
// isa is NULL
values.addNullPointer(ObjCTypes.ObjectPtrTy);
values.add(GetClassName(PD->getObjCRuntimeNameAsString()));
- values.add(EmitProtocolList("\01l_OBJC_$_PROTOCOL_REFS_"
+ values.add(EmitProtocolList("_OBJC_$_PROTOCOL_REFS_"
+ PD->getObjCRuntimeNameAsString(),
PD->protocol_begin(),
PD->protocol_end()));
@@ -6877,13 +6888,13 @@ llvm::Constant *CGObjCNonFragileABIMac::
values.add(methodLists.emitMethodList(this, PD,
ProtocolMethodLists::OptionalClassMethods));
values.add(EmitPropertyList(
- "\01l_OBJC_$_PROP_LIST_" + PD->getObjCRuntimeNameAsString(),
+ "_OBJC_$_PROP_LIST_" + PD->getObjCRuntimeNameAsString(),
nullptr, PD, ObjCTypes, false));
uint32_t Size =
CGM.getDataLayout().getTypeAllocSize(ObjCTypes.ProtocolnfABITy);
values.addInt(ObjCTypes.IntTy, Size);
values.addInt(ObjCTypes.IntTy, 0);
- values.add(EmitProtocolMethodTypes("\01l_OBJC_$_PROTOCOL_METHOD_TYPES_"
+ values.add(EmitProtocolMethodTypes("_OBJC_$_PROTOCOL_METHOD_TYPES_"
+ PD->getObjCRuntimeNameAsString(),
methodLists.emitExtendedTypesArray(this),
ObjCTypes));
@@ -6892,7 +6903,7 @@ llvm::Constant *CGObjCNonFragileABIMac::
values.addNullPointer(ObjCTypes.Int8PtrTy);
values.add(EmitPropertyList(
- "\01l_OBJC_$_CLASS_PROP_LIST_" + PD->getObjCRuntimeNameAsString(),
+ "_OBJC_$_CLASS_PROP_LIST_" + PD->getObjCRuntimeNameAsString(),
nullptr, PD, ObjCTypes, true));
if (Entry) {
@@ -6976,11 +6987,7 @@ CGObjCNonFragileABIMac::EmitProtocolList
array.finishAndAddTo(values);
values.fillPlaceholderWithInt(countSlot, ObjCTypes.LongTy, count);
- GV = values.finishAndCreateGlobal(Name, CGM.getPointerAlign(),
- /*constant*/ false,
- llvm::GlobalValue::PrivateLinkage);
- if (CGM.getTriple().isOSBinFormatMachO())
- GV->setSection("__DATA, __objc_const");
+ GV = finishAndCreateGlobal(values, Name, CGM);
CGM.addCompilerUsedGlobal(GV);
return llvm::ConstantExpr::getBitCast(GV,
ObjCTypes.ProtocolListnfABIPtrTy);
@@ -7091,7 +7098,7 @@ CGObjCNonFragileABIMac::EmitVTableMessag
// except normal, non-super message-sends.
// FIXME: don't use this for that.
llvm::FunctionCallee fn = nullptr;
- std::string messageRefName("\01l_");
+ std::string messageRefName("_");
if (CGM.ReturnSlotInterferesWithArgs(MSI.CallInfo)) {
if (isSuper) {
fn = ObjCTypes.getMessageSendSuper2StretFixupFn();
@@ -7245,12 +7252,14 @@ CGObjCNonFragileABIMac::EmitClassRefFrom
NotForDefinition);
}
- Entry = new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ClassnfABIPtrTy,
- false, llvm::GlobalValue::PrivateLinkage,
- ClassGV, "OBJC_CLASSLIST_REFERENCES_$_");
+ std::string SectionName =
+ GetSectionName("__objc_classrefs", "regular,no_dead_strip");
+ Entry = new llvm::GlobalVariable(
+ CGM.getModule(), ObjCTypes.ClassnfABIPtrTy, false,
+ getLinkageTypeForObjCMetadata(CGM, SectionName), ClassGV,
+ "OBJC_CLASSLIST_REFERENCES_$_");
Entry->setAlignment(Align.getQuantity());
- Entry->setSection(GetSectionName("__objc_classrefs",
- "regular,no_dead_strip"));
+ Entry->setSection(SectionName);
CGM.addCompilerUsedGlobal(Entry);
}
return CGF.Builder.CreateAlignedLoad(Entry, Align);
@@ -7280,12 +7289,14 @@ CGObjCNonFragileABIMac::EmitSuperClassRe
if (!Entry) {
auto ClassGV = GetClassGlobal(ID, /*metaclass*/ false, NotForDefinition);
- Entry = new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ClassnfABIPtrTy,
- false, llvm::GlobalValue::PrivateLinkage,
- ClassGV, "OBJC_CLASSLIST_SUP_REFS_$_");
+ std::string SectionName =
+ GetSectionName("__objc_superrefs", "regular,no_dead_strip");
+ Entry = new llvm::GlobalVariable(
+ CGM.getModule(), ObjCTypes.ClassnfABIPtrTy, false,
+ getLinkageTypeForObjCMetadata(CGM, SectionName), ClassGV,
+ "OBJC_CLASSLIST_SUP_REFS_$_");
Entry->setAlignment(Align.getQuantity());
- Entry->setSection(GetSectionName("__objc_superrefs",
- "regular,no_dead_strip"));
+ Entry->setSection(SectionName);
CGM.addCompilerUsedGlobal(Entry);
}
return CGF.Builder.CreateAlignedLoad(Entry, Align);
@@ -7301,14 +7312,14 @@ llvm::Value *CGObjCNonFragileABIMac::Emi
llvm::GlobalVariable * &Entry = MetaClassReferences[ID->getIdentifier()];
if (!Entry) {
auto MetaClassGV = GetClassGlobal(ID, /*metaclass*/ true, NotForDefinition);
-
- Entry = new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ClassnfABIPtrTy,
- false, llvm::GlobalValue::PrivateLinkage,
- MetaClassGV, "OBJC_CLASSLIST_SUP_REFS_$_");
+ std::string SectionName =
+ GetSectionName("__objc_superrefs", "regular,no_dead_strip");
+ Entry = new llvm::GlobalVariable(
+ CGM.getModule(), ObjCTypes.ClassnfABIPtrTy, false,
+ getLinkageTypeForObjCMetadata(CGM, SectionName), MetaClassGV,
+ "OBJC_CLASSLIST_SUP_REFS_$_");
Entry->setAlignment(Align.getQuantity());
-
- Entry->setSection(GetSectionName("__objc_superrefs",
- "regular,no_dead_strip"));
+ Entry->setSection(SectionName);
CGM.addCompilerUsedGlobal(Entry);
}
@@ -7398,12 +7409,14 @@ Address CGObjCNonFragileABIMac::EmitSele
llvm::Constant *Casted =
llvm::ConstantExpr::getBitCast(GetMethodVarName(Sel),
ObjCTypes.SelectorPtrTy);
- Entry = new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.SelectorPtrTy,
- false, llvm::GlobalValue::PrivateLinkage,
- Casted, "OBJC_SELECTOR_REFERENCES_");
+ std::string SectionName =
+ GetSectionName("__objc_selrefs", "literal_pointers,no_dead_strip");
+ Entry = new llvm::GlobalVariable(
+ CGM.getModule(), ObjCTypes.SelectorPtrTy, false,
+ getLinkageTypeForObjCMetadata(CGM, SectionName), Casted,
+ "OBJC_SELECTOR_REFERENCES_");
Entry->setExternallyInitialized(true);
- Entry->setSection(GetSectionName("__objc_selrefs",
- "literal_pointers,no_dead_strip"));
+ Entry->setSection(SectionName);
Entry->setAlignment(Align.getQuantity());
CGM.addCompilerUsedGlobal(Entry);
}
Modified: cfe/trunk/test/CodeGenObjC/arc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/arc.m?rev=360359&r1=360358&r2=360359&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/arc.m (original)
+++ cfe/trunk/test/CodeGenObjC/arc.m Thu May 9 10:43:52 2019
@@ -634,11 +634,11 @@ void test21(unsigned n) {
// rdar://problem/12492434
// Note that we set the flag saying that we need destruction *and*
// the flag saying that we don't also need construction.
-// CHECK-GLOBALS: @"\01l_OBJC_CLASS_RO_$_Test23" = private global [[RO_T:%.*]] { i32 390,
+// CHECK-GLOBALS: @"_OBJC_CLASS_RO_$_Test23" = internal global [[RO_T:%.*]] { i32 390,
@interface Test23 { id x; } @end
@implementation Test23 @end
-// CHECK-GLOBALS: @"\01l_OBJC_CLASS_RO_$_Test24" = private global [[RO_T:%.*]] { i32 130,
+// CHECK-GLOBALS: @"_OBJC_CLASS_RO_$_Test24" = internal global [[RO_T:%.*]] { i32 130,
@interface Test24 {} @end
@implementation Test24 @end
Modified: cfe/trunk/test/CodeGenObjC/boxing.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/boxing.m?rev=360359&r1=360358&r2=360359&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/boxing.m (original)
+++ cfe/trunk/test/CodeGenObjC/boxing.m Thu May 9 10:43:52 2019
@@ -57,17 +57,17 @@ typedef signed char BOOL;
// CHECK: [[STRUCT_NSCONSTANT_STRING_TAG:%.*]] = type { i32*, i32, i8*, i64 }
// CHECK: [[WithIntMeth:@.*]] = private unnamed_addr constant [15 x i8] c"numberWithInt:\00"
-// CHECK: [[WithIntSEL:@.*]] = private externally_initialized global i8* getelementptr inbounds ([15 x i8], [15 x i8]* [[WithIntMeth]]
+// CHECK: [[WithIntSEL:@.*]] = internal externally_initialized global i8* getelementptr inbounds ([15 x i8], [15 x i8]* [[WithIntMeth]]
// CHECK: [[WithCharMeth:@.*]] = private unnamed_addr constant [16 x i8] c"numberWithChar:\00"
-// CHECK: [[WithCharSEL:@.*]] = private externally_initialized global i8* getelementptr inbounds ([16 x i8], [16 x i8]* [[WithCharMeth]]
+// CHECK: [[WithCharSEL:@.*]] = internal externally_initialized global i8* getelementptr inbounds ([16 x i8], [16 x i8]* [[WithCharMeth]]
// CHECK: [[WithBoolMeth:@.*]] = private unnamed_addr constant [16 x i8] c"numberWithBool:\00"
-// CHECK: [[WithBoolSEL:@.*]] = private externally_initialized global i8* getelementptr inbounds ([16 x i8], [16 x i8]* [[WithBoolMeth]]
+// CHECK: [[WithBoolSEL:@.*]] = internal externally_initialized global i8* getelementptr inbounds ([16 x i8], [16 x i8]* [[WithBoolMeth]]
// CHECK: [[WithIntegerMeth:@.*]] = private unnamed_addr constant [19 x i8] c"numberWithInteger:\00"
-// CHECK: [[WithIntegerSEL:@.*]] = private externally_initialized global i8* getelementptr inbounds ([19 x i8], [19 x i8]* [[WithIntegerMeth]]
+// CHECK: [[WithIntegerSEL:@.*]] = internal externally_initialized global i8* getelementptr inbounds ([19 x i8], [19 x i8]* [[WithIntegerMeth]]
// CHECK: [[WithUnsignedIntegerMeth:@.*]] = private unnamed_addr constant [27 x i8] c"numberWithUnsignedInteger:\00"
-// CHECK: [[WithUnsignedIntegerSEL:@.*]] = private externally_initialized global i8* getelementptr inbounds ([27 x i8], [27 x i8]* [[WithUnsignedIntegerMeth]]
+// CHECK: [[WithUnsignedIntegerSEL:@.*]] = internal externally_initialized global i8* getelementptr inbounds ([27 x i8], [27 x i8]* [[WithUnsignedIntegerMeth]]
// CHECK: [[stringWithUTF8StringMeth:@.*]] = private unnamed_addr constant [22 x i8] c"stringWithUTF8String:\00"
-// CHECK: [[stringWithUTF8StringSEL:@.*]] = private externally_initialized global i8* getelementptr inbounds ([22 x i8], [22 x i8]* [[stringWithUTF8StringMeth]]
+// CHECK: [[stringWithUTF8StringSEL:@.*]] = internal externally_initialized global i8* getelementptr inbounds ([22 x i8], [22 x i8]* [[stringWithUTF8StringMeth]]
// CHECK: [[STR0:.*]] = private unnamed_addr constant [4 x i8] c"abc\00", section "__TEXT,__cstring,cstring_literals", align 1
// CHECK: [[UNNAMED_CFSTRING:.*]] = private global [[STRUCT_NSCONSTANT_STRING_TAG]] { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([4 x i8], [4 x i8]* [[STR0]], i32 0, i32 0), i64 3 }, section "__DATA,__cfstring", align 8
Modified: cfe/trunk/test/CodeGenObjC/exceptions-asm-attribute.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/exceptions-asm-attribute.m?rev=360359&r1=360358&r2=360359&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/exceptions-asm-attribute.m (original)
+++ cfe/trunk/test/CodeGenObjC/exceptions-asm-attribute.m Thu May 9 10:43:52 2019
@@ -15,7 +15,7 @@
// CHECK-X86_64: @"OBJC_EHTYPE_$_MySecretNamespace.EH1" = weak global {{.*}}, align 8
// CHECK-X86_64: @"OBJC_EHTYPE_$_MySecretNamespace.EH2" = external global
// CHECK-X86_64: @"OBJC_EHTYPE_$_MySecretNamespace.EH3" = global {{.*}}, section "__DATA,__objc_const", align 8
-// CHECK-X86_64: @"OBJC_LABEL_CLASS_$" = private global {{.*}}, section "__DATA,__objc_classlist,regular,no_dead_strip", align 8
+// CHECK-X86_64: @"OBJC_LABEL_CLASS_$" = internal global {{.*}}, section "__DATA,__objc_classlist,regular,no_dead_strip", align 8
// CHECK-X86_64: define internal void @"\01-[A im0]"
// CHECK-X86_64: define internal void @"\01-[A(Cat) im1]"
@@ -39,7 +39,7 @@
// CHECK-ARMV6: @"OBJC_EHTYPE_$_MySecretNamespace.EH1" = weak global {{.*}}, align 4
// CHECK-ARMV6: @"OBJC_EHTYPE_$_MySecretNamespace.EH2" = external global
// CHECK-ARMV6: @"OBJC_EHTYPE_$_MySecretNamespace.EH3" = global {{.*}}, section "__DATA,__objc_const", align 4
-// CHECK-ARMV6: @"OBJC_LABEL_CLASS_$" = private global {{.*}}, section "__DATA,__objc_classlist,regular,no_dead_strip", align 4
+// CHECK-ARMV6: @"OBJC_LABEL_CLASS_$" = internal global {{.*}}, section "__DATA,__objc_classlist,regular,no_dead_strip", align 4
// CHECK-ARMV6: define internal void @"\01-[A im0]"
// CHECK-ARMV6: define internal void @"\01-[A(Cat) im1]"
Modified: cfe/trunk/test/CodeGenObjC/externally-initialized-selectors.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/externally-initialized-selectors.m?rev=360359&r1=360358&r2=360359&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/externally-initialized-selectors.m (original)
+++ cfe/trunk/test/CodeGenObjC/externally-initialized-selectors.m Thu May 9 10:43:52 2019
@@ -1,7 +1,8 @@
-// RUN: %clang_cc1 -fobjc-runtime=macosx-fragile-10.5 -o - -emit-llvm %s | FileCheck %s
-// RUN: %clang_cc1 -o - -emit-llvm %s | FileCheck %s
+// RUN: %clang_cc1 -fobjc-runtime=macosx-fragile-10.5 -o - -emit-llvm %s | FileCheck -check-prefix=FRAGILE %s
+// RUN: %clang_cc1 -o - -emit-llvm %s | FileCheck -check-prefix=NONFRAGILE %s
-// CHECK: @OBJC_SELECTOR_REFERENCES_ = private externally_initialized global
+// NONFRAGILE: @OBJC_SELECTOR_REFERENCES_ = internal externally_initialized global
+// FRAGILE: @OBJC_SELECTOR_REFERENCES_ = private externally_initialized global
void test(id x) {
[x doSomething];
Modified: cfe/trunk/test/CodeGenObjC/forward-protocol-metadata-symbols.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/forward-protocol-metadata-symbols.m?rev=360359&r1=360358&r2=360359&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/forward-protocol-metadata-symbols.m (original)
+++ cfe/trunk/test/CodeGenObjC/forward-protocol-metadata-symbols.m Thu May 9 10:43:52 2019
@@ -20,20 +20,20 @@ int main() {
// CHECK: @"_OBJC_PROTOCOL_$_P0" = weak hidden global
// CHECK: @"_OBJC_LABEL_PROTOCOL_$_P0" = weak hidden global
-// CHECK: @"\01l_OBJC_CLASS_PROTOCOLS_$_A" = private global
-// CHECK: @"\01l_OBJC_PROTOCOL_REFERENCE_$_P0" = weak hidden global
+// CHECK: @"_OBJC_CLASS_PROTOCOLS_$_A" = internal global
+// CHECK: @"_OBJC_PROTOCOL_REFERENCE_$_P0" = weak hidden global
// CHECK: llvm.used = appending global [3 x i8*]
// CHECK-SAME: "_OBJC_PROTOCOL_$_P0"
// CHECK-SAME: "_OBJC_LABEL_PROTOCOL_$_P0"
-// CHECK-SAME: "\01l_OBJC_PROTOCOL_REFERENCE_$_P0"
+// CHECK-SAME: "_OBJC_PROTOCOL_REFERENCE_$_P0"
// CHECK: llvm.compiler.used = appending global [7 x i8*]
// CHECK-SAME: OBJC_CLASS_NAME_
// CHECK-SAME: OBJC_METH_VAR_NAME_
// CHECK-SAME: OBJC_METH_VAR_TYPE_
-// CHECK-SAME: "\01l_OBJC_$_CLASS_METHODS_A"
+// CHECK-SAME: "_OBJC_$_CLASS_METHODS_A"
// CHECK-SAME: OBJC_CLASS_NAME_.1
-// CHECK-SAME: "\01l_OBJC_CLASS_PROTOCOLS_$_A"
+// CHECK-SAME: "_OBJC_CLASS_PROTOCOLS_$_A"
// CHECK-SAME: "OBJC_LABEL_CLASS_$"
// CHECK-SAME: section "llvm.metadata"
Modified: cfe/trunk/test/CodeGenObjC/instance-method-metadata.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/instance-method-metadata.m?rev=360359&r1=360358&r2=360359&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/instance-method-metadata.m (original)
+++ cfe/trunk/test/CodeGenObjC/instance-method-metadata.m Thu May 9 10:43:52 2019
@@ -27,7 +27,7 @@
@synthesize prop;
@end
-// CHECK: l_OBJC_$_INSTANCE_METHODS_Bar:
+// CHECK: _OBJC_$_INSTANCE_METHODS_Bar:
// CHECK-NEXT: .long 24
// CHECK-NEXT: .long 2
// CHECK-NEXT: .quad L_OBJC_METH_VAR_NAME_
Modified: cfe/trunk/test/CodeGenObjC/interface-layout-64.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/interface-layout-64.m?rev=360359&r1=360358&r2=360359&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/interface-layout-64.m (original)
+++ cfe/trunk/test/CodeGenObjC/interface-layout-64.m Thu May 9 10:43:52 2019
@@ -2,24 +2,24 @@
// CHECK: @"OBJC_IVAR_$_I3._iv2" = global i64 8, section "__DATA, __objc_ivar", align 8
// CHECK: @"OBJC_IVAR_$_I3._iv3" = global i64 12, section "__DATA, __objc_ivar", align 8
-// CHECK: _OBJC_CLASS_RO_$_I3" = private global {{.*}} { i32 0, i32 8, i32 13
+// CHECK: _OBJC_CLASS_RO_$_I3" = internal global {{.*}} { i32 0, i32 8, i32 13
// CHECK: @"OBJC_IVAR_$_I4._iv4" = global i64 13, section "__DATA, __objc_ivar", align 8
-// CHECK: _OBJC_CLASS_RO_$_I4" = private global {{.*}} { i32 0, i32 13, i32 14, {{.*}}
+// CHECK: _OBJC_CLASS_RO_$_I4" = internal global {{.*}} { i32 0, i32 13, i32 14, {{.*}}
// CHECK: @"OBJC_IVAR_$_I5._iv6_synth" = hidden global i64 16, section "__DATA, __objc_ivar", align 8
// CHECK: @"OBJC_IVAR_$_I5._iv7_synth" = hidden global i64 20, section "__DATA, __objc_ivar", align 8
// CHECK: @"OBJC_IVAR_$_I5._iv5" = global i64 14, section "__DATA, __objc_ivar", align 8
-// CHECK: _OBJC_CLASS_RO_$_I5" = private global {{.*}} { i32 0, i32 14, i32 24, {{.*}}
+// CHECK: _OBJC_CLASS_RO_$_I5" = internal global {{.*}} { i32 0, i32 14, i32 24, {{.*}}
// CHECK: @"OBJC_IVAR_$_I6.iv0" = global i64 0, section "__DATA, __objc_ivar", align 8
-// CHECK: _OBJC_CLASS_RO_$_I6" = private global {{.*}} { i32 2, i32 0, i32 1, {{.*}}
+// CHECK: _OBJC_CLASS_RO_$_I6" = internal global {{.*}} { i32 2, i32 0, i32 1, {{.*}}
// CHECK: @"OBJC_IVAR_$_I8.b" = global i64 8, section "__DATA, __objc_ivar", align 8
-// CHECK: _OBJC_CLASS_RO_$_I8" = private global {{.*}} { i32 0, i32 8, i32 16, {{.*}}
+// CHECK: _OBJC_CLASS_RO_$_I8" = internal global {{.*}} { i32 0, i32 8, i32 16, {{.*}}
// CHECK: @"OBJC_IVAR_$_I9.iv0" = global i64 0, section "__DATA, __objc_ivar", align 8
-// CHECK: _OBJC_CLASS_RO_$_I9" = private global {{.*}} { i32 2, i32 0, i32 4, {{.*}}
+// CHECK: _OBJC_CLASS_RO_$_I9" = internal global {{.*}} { i32 2, i32 0, i32 4, {{.*}}
// CHECK: @"OBJC_IVAR_$_I10.iv1" = global i64 4, section "__DATA, __objc_ivar", align 8
-// CHECK: _OBJC_CLASS_RO_$_I10" = private global {{.*}} { i32 0, i32 4, i32 5, {{.*}}
-// CHECK: _OBJC_CLASS_RO_$_I11" = private global {{.*}} { i32 0, i32 5, i32 5, {{.*}}
+// CHECK: _OBJC_CLASS_RO_$_I10" = internal global {{.*}} { i32 0, i32 4, i32 5, {{.*}}
+// CHECK: _OBJC_CLASS_RO_$_I11" = internal global {{.*}} { i32 0, i32 5, i32 5, {{.*}}
// CHECK: @"OBJC_IVAR_$_I12.iv2" = global i64 8, section "__DATA, __objc_ivar", align 8
-// CHECK: _OBJC_CLASS_RO_$_I12" = private global {{.*}} { i32 0, i32 8, i32 12, {{.*}}
+// CHECK: _OBJC_CLASS_RO_$_I12" = internal global {{.*}} { i32 0, i32 8, i32 12, {{.*}}
/*
Compare to:
Modified: cfe/trunk/test/CodeGenObjC/metadata-class-properties.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/metadata-class-properties.m?rev=360359&r1=360358&r2=360359&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/metadata-class-properties.m (original)
+++ cfe/trunk/test/CodeGenObjC/metadata-class-properties.m Thu May 9 10:43:52 2019
@@ -2,33 +2,33 @@
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-NULL %s
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.11 -emit-llvm -o - -fobjc-runtime=macosx-fragile-10.5 %s | FileCheck -check-prefix=CHECK-FRAGILE %s
-// CHECK: @"\01l_OBJC_$_CLASS_PROP_LIST_Proto" = private global {{.*}} section "__DATA, __objc_const", align 8
-// CHECK: @"_OBJC_PROTOCOL_$_Proto" = {{.*}} global %struct._protocol_t { {{.*}} i32 96, i32 {{.*}} @"\01l_OBJC_$_CLASS_PROP_LIST_Proto" {{.*}} }
-// CHECK: @"\01l_OBJC_$_CLASS_PROP_LIST_Foo_$_Category" = private global {{.*}} section "__DATA, __objc_const", align 8
-// CHECK: @"\01l_OBJC_$_CATEGORY_Foo_$_Category" = private global %struct._category_t { {{.*}} @"\01l_OBJC_$_CLASS_PROP_LIST_Foo_$_Category" {{.*}}, i32 64 }, section "__DATA, __objc_const", align 8
+// CHECK: @"_OBJC_$_CLASS_PROP_LIST_Proto" = internal global {{.*}} section "__DATA, __objc_const", align 8
+// CHECK: @"_OBJC_PROTOCOL_$_Proto" = {{.*}} global %struct._protocol_t { {{.*}} i32 96, i32 {{.*}} @"_OBJC_$_CLASS_PROP_LIST_Proto" {{.*}} }
+// CHECK: @"_OBJC_$_CLASS_PROP_LIST_Foo_$_Category" = internal global {{.*}} section "__DATA, __objc_const", align 8
+// CHECK: @"_OBJC_$_CATEGORY_Foo_$_Category" = internal global %struct._category_t { {{.*}} @"_OBJC_$_CLASS_PROP_LIST_Foo_$_Category" {{.*}}, i32 64 }, section "__DATA, __objc_const", align 8
-// CHECK: @"\01l_OBJC_$_CLASS_PROP_LIST_C" = private global {{.*}} section "__DATA, __objc_const", align 8
-// CHECK: @"\01l_OBJC_METACLASS_RO_$_C" = private global %struct._class_ro_t { {{.*}} @"\01l_OBJC_$_CLASS_PROP_LIST_C" {{.*}} }, section "__DATA, __objc_const", align 8
+// CHECK: @"_OBJC_$_CLASS_PROP_LIST_C" = internal global {{.*}} section "__DATA, __objc_const", align 8
+// CHECK: @"_OBJC_METACLASS_RO_$_C" = internal global %struct._class_ro_t { {{.*}} @"_OBJC_$_CLASS_PROP_LIST_C" {{.*}} }, section "__DATA, __objc_const", align 8
// CHECK: !{i32 1, !"Objective-C Class Properties", i32 64}
-// CHECK-NULL-NOT: @"\01l_OBJC_$_CLASS_PROP_LIST_Proto"
+// CHECK-NULL-NOT: @"_OBJC_$_CLASS_PROP_LIST_Proto"
// CHECK-NULL: @"_OBJC_PROTOCOL_$_Proto" = {{.*}} global %struct._protocol_t { {{.*}} %struct._prop_list_t* null, i32 96, i32 {{.*}} %struct._prop_list_t* null }
-// CHECK-NULL-NOT: @"\01l_OBJC_$_CLASS_PROP_LIST_Foo_$_Category" = private global {{.*}} section "__DATA, __objc_const", align 8
-// CHECK-NULL: @"\01l_OBJC_$_CATEGORY_Foo_$_Category" = private global %struct._category_t { {{.*}} %struct._prop_list_t* null, %struct._prop_list_t* null, {{.*}} }, section "__DATA, __objc_const", align 8
+// CHECK-NULL-NOT: @"_OBJC_$_CLASS_PROP_LIST_Foo_$_Category" = internal global {{.*}} section "__DATA, __objc_const", align 8
+// CHECK-NULL: @"_OBJC_$_CATEGORY_Foo_$_Category" = internal global %struct._category_t { {{.*}} %struct._prop_list_t* null, %struct._prop_list_t* null, {{.*}} }, section "__DATA, __objc_const", align 8
-// CHECK-NULL-NOT: @"\01l_OBJC_$_CLASS_PROP_LIST_C" = private global {{.*}} section "__DATA, __objc_const", align 8
-// CHECK-NULL: @"\01l_OBJC_METACLASS_RO_$_C" = private global %struct._class_ro_t { {{.*}} %struct._prop_list_t* null }, section "__DATA, __objc_const", align 8
+// CHECK-NULL-NOT: @"_OBJC_$_CLASS_PROP_LIST_C" = internal global {{.*}} section "__DATA, __objc_const", align 8
+// CHECK-NULL: @"_OBJC_METACLASS_RO_$_C" = internal global %struct._class_ro_t { {{.*}} %struct._prop_list_t* null }, section "__DATA, __objc_const", align 8
// CHECK-NULL: !{i32 1, !"Objective-C Class Properties", i32 64}
// CHECK-FRAGILE: @"OBJC_$_CLASS_PROP_PROTO_LIST_Proto" = private global {{.*}} section "__OBJC,__property,regular,no_dead_strip", align 8
-// CHECK-FRAGILE: @"\01l_OBJC_PROTOCOLEXT_Proto" = private global %struct._objc_protocol_extension { i32 48, {{.*}} @"OBJC_$_CLASS_PROP_PROTO_LIST_Proto" {{.*}} }, align 8
-// CHECK-FRAGILE: @"\01l_OBJC_$_CLASS_PROP_LIST_Foo_Category" = private global {{.*}} section "__OBJC,__property,regular,no_dead_strip", align 8
-// CHECK-FRAGILE: @OBJC_CATEGORY_Foo_Category = private global %struct._objc_category { {{.*}}, i32 64, {{.*}} @"\01l_OBJC_$_CLASS_PROP_LIST_Foo_Category" {{.*}} }, section "__OBJC,__category,regular,no_dead_strip", align 8
+// CHECK-FRAGILE: @_OBJC_PROTOCOLEXT_Proto = internal global %struct._objc_protocol_extension { i32 48, {{.*}} @"OBJC_$_CLASS_PROP_PROTO_LIST_Proto" {{.*}} }, align 8
+// CHECK-FRAGILE: @"_OBJC_$_CLASS_PROP_LIST_Foo_Category" = private global {{.*}} section "__OBJC,__property,regular,no_dead_strip", align 8
+// CHECK-FRAGILE: @OBJC_CATEGORY_Foo_Category = private global %struct._objc_category { {{.*}}, i32 64, {{.*}} @"_OBJC_$_CLASS_PROP_LIST_Foo_Category" {{.*}} }, section "__OBJC,__category,regular,no_dead_strip", align 8
-// CHECK-FRAGILE: @"\01l_OBJC_$_CLASS_PROP_LIST_C" = private global {{.*}} section "__OBJC,__property,regular,no_dead_strip", align 8
-// CHECK-FRAGILE: @OBJC_CLASSEXT_C = private global %struct._objc_class_extension { {{.*}} @"\01l_OBJC_$_CLASS_PROP_LIST_C" {{.*}} }, section "__OBJC,__class_ext,regular,no_dead_strip", align 8
+// CHECK-FRAGILE: @"_OBJC_$_CLASS_PROP_LIST_C" = private global {{.*}} section "__OBJC,__property,regular,no_dead_strip", align 8
+// CHECK-FRAGILE: @OBJC_CLASSEXT_C = private global %struct._objc_class_extension { {{.*}} @"_OBJC_$_CLASS_PROP_LIST_C" {{.*}} }, section "__OBJC,__class_ext,regular,no_dead_strip", align 8
// CHECK-FRAGILE: !{i32 1, !"Objective-C Class Properties", i32 64}
Modified: cfe/trunk/test/CodeGenObjC/metadata-symbols-32.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/metadata-symbols-32.m?rev=360359&r1=360358&r2=360359&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/metadata-symbols-32.m (original)
+++ cfe/trunk/test/CodeGenObjC/metadata-symbols-32.m Thu May 9 10:43:52 2019
@@ -3,7 +3,7 @@
// CHECK: .lazy_reference .objc_class_name_J0
// CHECK: @OBJC_METH_VAR_TYPE_{{.*}} = private unnamed_addr constant {{.*}}section "__TEXT,__cstring,cstring_literals", align 1
-// CHECK: @"\01l_OBJC_PROTOCOLEXT_P" = private global {{.*}}}, align
+// CHECK: @_OBJC_PROTOCOLEXT_P = internal global {{.*}}}, align
// CHECK: @OBJC_CLASS_NAME_{{[0-9]*}} = private unnamed_addr constant {{.*}}section "__TEXT,__cstring,cstring_literals", align 1
// CHECK: @OBJC_METH_VAR_NAME_{{.*}} = private unnamed_addr constant {{.*}}section "__TEXT,__cstring,cstring_literals", align 1
// CHECK: @OBJC_PROTOCOL_INSTANCE_METHODS_P = private global {{.*}}section "__OBJC,__cat_inst_meth,regular,no_dead_strip", align 4
@@ -15,7 +15,7 @@
// CHECK: @OBJC_INSTANCE_VARIABLES_A = private global {{.*}}section "__OBJC,__instance_vars,regular,no_dead_strip", align 4
// CHECK: @OBJC_INSTANCE_METHODS_A = private global {{.*}}section "__OBJC,__inst_meth,regular,no_dead_strip", align 4
// CHECK: @OBJC_PROP_NAME_ATTR_{{[0-9]*}} = private unnamed_addr constant {{.*}}section "__TEXT,__cstring,cstring_literals", align 1
-// CHECK: @"\01l_OBJC_$_PROP_LIST_A" = private global {{.*}}section "__OBJC,__property,regular,no_dead_strip", align 4
+// CHECK: @"_OBJC_$_PROP_LIST_A" = private global {{.*}}section "__OBJC,__property,regular,no_dead_strip", align 4
// CHECK: @OBJC_CLASSEXT_A = private global {{.*}}section "__OBJC,__class_ext,regular,no_dead_strip", align 4
// CHECK: @OBJC_CLASS_A = private global {{.*}}section "__OBJC,__class,regular,no_dead_strip", align 4
// CHECK: @OBJC_CATEGORY_INSTANCE_METHODS_A_Cat = private global {{.*}}section "__OBJC,__cat_inst_meth,regular,no_dead_strip", align 4
Modified: cfe/trunk/test/CodeGenObjC/metadata-symbols-64.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/metadata-symbols-64.m?rev=360359&r1=360358&r2=360359&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/metadata-symbols-64.m (original)
+++ cfe/trunk/test/CodeGenObjC/metadata-symbols-64.m Thu May 9 10:43:52 2019
@@ -8,29 +8,29 @@
// CHECK: @OBJC_CLASS_NAME_{{[0-9]*}} = private unnamed_addr constant {{.*}} section "__TEXT,__objc_classname,cstring_literals", align 1
// CHECK: @OBJC_METH_VAR_NAME_{{[0-9]*}} = private unnamed_addr constant {{.*}} section "__TEXT,__objc_methname,cstring_literals", align 1
// CHECK: @OBJC_METH_VAR_TYPE_{{[0-9]*}} = private unnamed_addr constant {{.*}} section "__TEXT,__objc_methtype,cstring_literals", align 1
-// 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: @"_OBJC_$_CLASS_METHODS_A" = internal global {{.*}} section "__DATA, __objc_const", align 8
+// CHECK: @"_OBJC_$_PROTOCOL_INSTANCE_METHODS_P" = internal global {{.*}} section "__DATA, __objc_const", align 8
+// CHECK: @"_OBJC_$_PROTOCOL_CLASS_METHODS_P" = internal global {{.*}} section "__DATA, __objc_const", align 8
// CHECK: @"_OBJC_PROTOCOL_$_P" = weak hidden global {{.*}}, align 8
// CHECK: @"_OBJC_LABEL_PROTOCOL_$_P" = weak hidden 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_$_INSTANCE_VARIABLES_A" = private global {{.*}} section "__DATA, __objc_const", align 8
+// CHECK: @"_OBJC_CLASS_PROTOCOLS_$_A" = internal global {{.*}} section "__DATA, __objc_const", align 8
+// 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: @"\01l_OBJC_$_PROP_LIST_A" = private global {{.*}} section "__DATA, __objc_const", align 8
-// CHECK: @"\01l_OBJC_CLASS_RO_$_A" = private global {{.*}} section "__DATA, __objc_const", align 8
-// CHECK: @"\01l_OBJC_$_CATEGORY_INSTANCE_METHODS_A_$_Cat" = private global {{.*}} section "__DATA, __objc_const", align 8
-// CHECK: @"\01l_OBJC_$_CATEGORY_CLASS_METHODS_A_$_Cat" = private global {{.*}} section "__DATA, __objc_const", align 8
-// CHECK: @"\01l_OBJC_$_CATEGORY_A_$_Cat" = private global {{.*}} section "__DATA, __objc_const", align 8
-// CHECK: @"OBJC_CLASSLIST_SUP_REFS_$_{{[0-9]*}}" = private global {{.*}} section "__DATA,__objc_superrefs,regular,no_dead_strip", align 8
-// CHECK: @OBJC_SELECTOR_REFERENCES_ = private externally_initialized global {{.*}} section "__DATA,__objc_selrefs,literal_pointers,no_dead_strip"
-// CHECK: @"OBJC_CLASSLIST_SUP_REFS_$_{{[\.0-9]*}}" = private global {{.*}} section "__DATA,__objc_superrefs,regular,no_dead_strip", align 8
+// 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
+// CHECK: @"_OBJC_$_CATEGORY_CLASS_METHODS_A_$_Cat" = internal global {{.*}} section "__DATA, __objc_const", align 8
+// CHECK: @"_OBJC_$_CATEGORY_A_$_Cat" = internal global {{.*}} section "__DATA, __objc_const", align 8
+// CHECK: @"OBJC_CLASSLIST_SUP_REFS_$_{{[0-9]*}}" = internal global {{.*}} section "__DATA,__objc_superrefs,regular,no_dead_strip", align 8
+// CHECK: @OBJC_SELECTOR_REFERENCES_ = internal externally_initialized global {{.*}} section "__DATA,__objc_selrefs,literal_pointers,no_dead_strip"
+// CHECK: @"OBJC_CLASSLIST_SUP_REFS_$_{{[\.0-9]*}}" = internal global {{.*}} section "__DATA,__objc_superrefs,regular,no_dead_strip", align 8
// CHECK: @"OBJC_CLASS_$_B" = external global
-// CHECK: @"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: @"OBJC_LABEL_CLASS_$" = private global {{.*}} section "__DATA,__objc_classlist,regular,no_dead_strip", align 8
-// CHECK: @"OBJC_LABEL_CATEGORY_$" = private global {{.*}} section "__DATA,__objc_catlist,regular,no_dead_strip", align 8
+// CHECK: @"OBJC_CLASSLIST_REFERENCES_$_{{[0-9]*}}" = internal global {{.*}} section "__DATA,__objc_classrefs,regular,no_dead_strip", align 8
+// CHECK: @_objc_msgSend_fixup_alloc = weak hidden global {{.*}} section "__DATA,__objc_msgrefs,coalesced", align 16
+// CHECK: @"OBJC_LABEL_CLASS_$" = internal global {{.*}} section "__DATA,__objc_classlist,regular,no_dead_strip", align 8
+// CHECK: @"OBJC_LABEL_CATEGORY_$" = internal global {{.*}} section "__DATA,__objc_catlist,regular,no_dead_strip", align 8
// CHECK: @objc_msgSend_fpret(
// CHECK: @objc_msgSend_fixup(
Modified: cfe/trunk/test/CodeGenObjC/metadata_symbols.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/metadata_symbols.m?rev=360359&r1=360358&r2=360359&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/metadata_symbols.m (original)
+++ cfe/trunk/test/CodeGenObjC/metadata_symbols.m Thu May 9 10:43:52 2019
@@ -14,7 +14,7 @@
// CHECK-X86_64: @"OBJC_EHTYPE_$_EH1" = weak global {{.*}}, align 8
// CHECK-X86_64: @"OBJC_EHTYPE_$_EH2" = external global
// CHECK-X86_64: @"OBJC_EHTYPE_$_EH3" = global {{.*}}, section "__DATA,__objc_const", align 8
-// CHECK-X86_64: @"OBJC_LABEL_CLASS_$" = private global {{.*}}, section "__DATA,__objc_classlist,regular,no_dead_strip", align 8
+// CHECK-X86_64: @"OBJC_LABEL_CLASS_$" = internal global {{.*}}, section "__DATA,__objc_classlist,regular,no_dead_strip", align 8
// CHECK-X86_64: define internal void @"\01-[A im0]"
// CHECK-X86_64: define internal void @"\01-[A(Cat) im1]"
@@ -38,7 +38,7 @@
// CHECK-ARMV6: @"OBJC_EHTYPE_$_EH1" = weak global {{.*}}, align 4
// CHECK-ARMV6: @"OBJC_EHTYPE_$_EH2" = external global
// CHECK-ARMV6: @"OBJC_EHTYPE_$_EH3" = global {{.*}}, section "__DATA,__objc_const", align 4
-// CHECK-ARMV6: @"OBJC_LABEL_CLASS_$" = private global {{.*}}, section "__DATA,__objc_classlist,regular,no_dead_strip", align 4
+// CHECK-ARMV6: @"OBJC_LABEL_CLASS_$" = internal global {{.*}}, section "__DATA,__objc_classlist,regular,no_dead_strip", align 4
// CHECK-ARMV6: define internal void @"\01-[A im0]"
// CHECK-ARMV6: define internal void @"\01-[A(Cat) im1]"
Modified: cfe/trunk/test/CodeGenObjC/mrc-weak.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/mrc-weak.m?rev=360359&r1=360358&r2=360359&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/mrc-weak.m (original)
+++ cfe/trunk/test/CodeGenObjC/mrc-weak.m Thu May 9 10:43:52 2019
@@ -15,7 +15,7 @@
// CHECK-MODERN: @"OBJC_IVAR_$_HighlyAlignedSubclass.ivar2" = global i64 24,
// CHECK-MODERN: @"OBJC_IVAR_$_HighlyAlignedSubclass.ivar" = global i64 16,
// CHECK-MODERN: @OBJC_CLASS_NAME_{{.*}} = {{.*}} c"\02\00"
-// CHECK-MODERN: @"\01l_OBJC_CLASS_RO_$_HighlyAlignedSubclass" = {{.*}} {
+// CHECK-MODERN: @"_OBJC_CLASS_RO_$_HighlyAlignedSubclass" = {{.*}} {
// CHECK-FRAGILE: @OBJC_INSTANCE_VARIABLES_HighlyAlignedSubclass = {{.*}}, i32 8 }, {{.*}}, i32 12 }]
// CHECK-FRAGILE: @OBJC_CLASS_NAME_{{.*}} = {{.*}} c"\02\00"
// CHECK-FRAGILE: @OBJC_CLASS_HighlyAlignedSubclass
@@ -27,7 +27,7 @@
@implementation HighlyAlignedSubclass @end
// CHECK-MODERN: @OBJC_CLASS_NAME_{{.*}} = {{.*}} c"\01\00"
-// CHECK-MODERN: @"\01l_OBJC_CLASS_RO_$_Foo" = {{.*}} { i32 772
+// CHECK-MODERN: @"_OBJC_CLASS_RO_$_Foo" = {{.*}} { i32 772
// 772 == 0x304
// ^ HasMRCWeakIvars
// ^ HasCXXDestructorOnly
Modified: cfe/trunk/test/CodeGenObjC/non-lazy-classes.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/non-lazy-classes.m?rev=360359&r1=360358&r2=360359&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/non-lazy-classes.m (original)
+++ cfe/trunk/test/CodeGenObjC/non-lazy-classes.m Thu May 9 10:43:52 2019
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -Wno-objc-root-class -emit-llvm -o - %s | FileCheck %s
-// CHECK: @"OBJC_LABEL_NONLAZY_CLASS_$" = private global [3 x {{.*}}]{{.*}}@"OBJC_CLASS_$_A"{{.*}},{{.*}}@"OBJC_CLASS_$_D"{{.*}},{{.*}}"OBJC_CLASS_$_E"{{.*}} section "__DATA,__objc_nlclslist,regular,no_dead_strip", align 8
-// CHECK: @"OBJC_LABEL_NONLAZY_CATEGORY_$" = private global [2 x {{.*}}] {{.*}}@"\01l_OBJC_$_CATEGORY_A_$_Cat"{{.*}},{{.*}}@"\01l_OBJC_$_CATEGORY_E_$_MyCat"{{.*}}, section "__DATA,__objc_nlcatlist,regular,no_dead_strip", align 8
+// CHECK: @"OBJC_LABEL_NONLAZY_CLASS_$" = internal global [3 x {{.*}}]{{.*}}@"OBJC_CLASS_$_A"{{.*}},{{.*}}@"OBJC_CLASS_$_D"{{.*}},{{.*}}"OBJC_CLASS_$_E"{{.*}} section "__DATA,__objc_nlclslist,regular,no_dead_strip", align 8
+// CHECK: @"OBJC_LABEL_NONLAZY_CATEGORY_$" = internal global [2 x {{.*}}] {{.*}}@"_OBJC_$_CATEGORY_A_$_Cat"{{.*}},{{.*}}@"_OBJC_$_CATEGORY_E_$_MyCat"{{.*}}, section "__DATA,__objc_nlcatlist,regular,no_dead_strip", align 8
@interface A @end
@implementation A
Modified: cfe/trunk/test/CodeGenObjC/private-extern-selector-reference.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/private-extern-selector-reference.m?rev=360359&r1=360358&r2=360359&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/private-extern-selector-reference.m (original)
+++ cfe/trunk/test/CodeGenObjC/private-extern-selector-reference.m Thu May 9 10:43:52 2019
@@ -15,4 +15,4 @@ __attribute__((visibility("default"))) _
@end
// CHECK: @"OBJC_METACLASS_$_ObserverQuery" = global %struct._class_t
-// CHECK: @OBJC_SELECTOR_REFERENCES_ = private externally_initialized global
+// CHECK: @OBJC_SELECTOR_REFERENCES_ = internal externally_initialized global
Modified: cfe/trunk/test/CodeGenObjC/property-category-impl.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/property-category-impl.m?rev=360359&r1=360358&r2=360359&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/property-category-impl.m (original)
+++ cfe/trunk/test/CodeGenObjC/property-category-impl.m Thu May 9 10:43:52 2019
@@ -15,6 +15,6 @@
@end
-// CHECK: l_OBJC_$_PROP_LIST_Foo_$_Category" = private global
-// CHECK: l_OBJC_$_CATEGORY_Foo_$_Category" = private global
-// CHECK: l_OBJC_$_PROP_LIST_Foo_$_Category
+// CHECK: _OBJC_$_PROP_LIST_Foo_$_Category" = internal global
+// CHECK: _OBJC_$_CATEGORY_Foo_$_Category" = internal global
+// CHECK: _OBJC_$_PROP_LIST_Foo_$_Category
Modified: cfe/trunk/test/CodeGenObjC/property-list-in-class.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/property-list-in-class.m?rev=360359&r1=360358&r2=360359&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/property-list-in-class.m (original)
+++ cfe/trunk/test/CodeGenObjC/property-list-in-class.m Thu May 9 10:43:52 2019
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s
-// CHECK: l_OBJC_$_PROP_LIST_C2" = private global { i32, i32, [3 x %struct._prop_t] } { i32 16, i32 3
+// CHECK: _OBJC_$_PROP_LIST_C2" = internal global { i32, i32, [3 x %struct._prop_t] } { i32 16, i32 3
@protocol P
@property int i;
Modified: cfe/trunk/test/CodeGenObjC/property-list-in-extension.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/property-list-in-extension.m?rev=360359&r1=360358&r2=360359&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/property-list-in-extension.m (original)
+++ cfe/trunk/test/CodeGenObjC/property-list-in-extension.m Thu May 9 10:43:52 2019
@@ -18,7 +18,7 @@ __attribute__((objc_root_class))
// Metadata for _myprop should be present, and PROP_LIST for Foo should have
// only one entry.
// CHECK: = private unnamed_addr constant [12 x i8] c"Ti,V_myprop\00",
-// CHECK: @"\01l_OBJC_$_PROP_LIST_Foo" = private global { i32, i32, [1 x %struct._prop_t] }
+// CHECK: @"_OBJC_$_PROP_LIST_Foo" = internal global { i32, i32, [1 x %struct._prop_t] }
// Readonly property in interface made readwrite in a category:
__attribute__((objc_root_class))
@@ -44,4 +44,4 @@ __attribute__((objc_root_class))
// CHECK: [[evolvingsetter:@OBJC_PROP_NAME_ATTR[^ ]+]] = private unnamed_addr constant [18 x i8] c"Ti,V_evolvingprop\00",
// CHECK: [[booleanmetadata:@OBJC_PROP_NAME_ATTR[^ ]+]] = private unnamed_addr constant [34 x i8] c"Ti,N,GisBooleanProp,V_booleanProp\00"
// CHECK: [[weakmetadata:@OBJC_PROP_NAME_ATTR[^ ]+]] = private unnamed_addr constant [23 x i8] c"T@\22Foo\22,W,N,V_weakProp\00"
-// CHECK: @"\01l_OBJC_$_PROP_LIST_FooRO" = private global { i32, i32, [3 x %struct._prop_t] }{{.*}}[[evolvinggetter]]{{.*}}[[evolvingsetter]]{{.*}}[[booleanmetadata]]
+// CHECK: @"_OBJC_$_PROP_LIST_FooRO" = internal global { i32, i32, [3 x %struct._prop_t] }{{.*}}[[evolvinggetter]]{{.*}}[[evolvingsetter]]{{.*}}[[booleanmetadata]]
Modified: cfe/trunk/test/CodeGenObjC/protocol-comdat.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/protocol-comdat.m?rev=360359&r1=360358&r2=360359&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/protocol-comdat.m (original)
+++ cfe/trunk/test/CodeGenObjC/protocol-comdat.m Thu May 9 10:43:52 2019
@@ -20,8 +20,8 @@ _Bool f(void) {
// CHECK: $"_OBJC_PROTOCOL_$_P" = comdat any
// CHECK: $"_OBJC_LABEL_PROTOCOL_$_P" = comdat any
-// CHECK: $"\01l_OBJC_PROTOCOL_REFERENCE_$_Q" = comdat any
-// CHECK: $"\01l_OBJC_PROTOCOL_REFERENCE_$_R" = comdat any
+// CHECK: $"_OBJC_PROTOCOL_REFERENCE_$_Q" = comdat any
+// CHECK: $"_OBJC_PROTOCOL_REFERENCE_$_R" = comdat any
// CHECK: @"_OBJC_PROTOCOL_$_P" = {{.*}}, comdat
// CHECK: @"_OBJC_LABEL_PROTOCOL_$_P" = {{.*}}, comdat
Modified: cfe/trunk/test/CodeGenObjC/protocols.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/protocols.m?rev=360359&r1=360358&r2=360359&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/protocols.m (original)
+++ cfe/trunk/test/CodeGenObjC/protocols.m Thu May 9 10:43:52 2019
@@ -1,19 +1,19 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
-// CHECK: @"\01l_OBJC_$_PROTOCOL_METHOD_TYPES_P1" = private global
+// CHECK: @"_OBJC_$_PROTOCOL_METHOD_TYPES_P1" = internal global
// CHECK: @[[PROTO_P1:"_OBJC_PROTOCOL_\$_P1"]] = weak hidden
// CHECK: @[[LABEL_PROTO_P1:"_OBJC_LABEL_PROTOCOL_\$_P1"]] = weak hidden global %{{.*}}* @[[PROTO_P1]]
// CHECK: @[[PROTO_P2:"_OBJC_PROTOCOL_\$_P2"]] = weak hidden
// CHECK: @[[LABEL_PROTO_P2:"_OBJC_LABEL_PROTOCOL_\$_P2"]] = weak hidden global %{{.*}}* @[[PROTO_P2]]
-// CHECK: @"\01l_OBJC_$_PROTOCOL_REFS_P3" = private global { i64, [3 x %{{.*}}] } { i64 2, [3 x %{{.*}}*] [%{{.*}}* @[[PROTO_P1]], %{{.*}}* @[[PROTO_P2]], %{{.*}}* null] }
+// CHECK: @"_OBJC_$_PROTOCOL_REFS_P3" = internal global { i64, [3 x %{{.*}}] } { i64 2, [3 x %{{.*}}*] [%{{.*}}* @[[PROTO_P1]], %{{.*}}* @[[PROTO_P2]], %{{.*}}* null] }
// CHECK: @[[PROTO_P3:"_OBJC_PROTOCOL_\$_P3"]] = weak hidden
// CHECK: @[[LABEL_PROTO_P3:"_OBJC_LABEL_PROTOCOL_\$_P3"]] = weak hidden global %{{.*}}* @[[PROTO_P3]]
-// CHECK: "\01l_OBJC_PROTOCOL_REFERENCE_$_P3" = weak hidden global %{{.*}}* bitcast (%{{.*}}* @[[PROTO_P3]] to %{{.*}}*)
+// CHECK: "_OBJC_PROTOCOL_REFERENCE_$_P3" = weak hidden global %{{.*}}* bitcast (%{{.*}}* @[[PROTO_P3]] to %{{.*}}*)
// CHECK: @[[PROTO_P0:"_OBJC_PROTOCOL_\$_P0"]] = weak hidden
// CHECK: @[[LABEL_PROTO_P0:"_OBJC_LABEL_PROTOCOL_\$_P0"]] = weak hidden global %{{.*}}* @[[PROTO_P0]]
-// CHECK: "\01l_OBJC_PROTOCOL_REFERENCE_$_P0" = weak hidden global %0* bitcast (%{{.*}}* @[[PROTO_P0]] to %{{.*}}*)
-// CHECK: "\01l_OBJC_PROTOCOL_REFERENCE_$_P1" = weak hidden global %0* bitcast (%{{.*}}* @[[PROTO_P1]] to %{{.*}}*)
-// CHECK: "\01l_OBJC_PROTOCOL_REFERENCE_$_P2" = weak hidden global %0* bitcast (%{{.*}}* @[[PROTO_P2]] to %{{.*}}*)
+// CHECK: "_OBJC_PROTOCOL_REFERENCE_$_P0" = weak hidden global %0* bitcast (%{{.*}}* @[[PROTO_P0]] to %{{.*}}*)
+// CHECK: "_OBJC_PROTOCOL_REFERENCE_$_P1" = weak hidden global %0* bitcast (%{{.*}}* @[[PROTO_P1]] to %{{.*}}*)
+// CHECK: "_OBJC_PROTOCOL_REFERENCE_$_P2" = weak hidden global %0* bitcast (%{{.*}}* @[[PROTO_P2]] to %{{.*}}*)
void p(const char*, ...);
Modified: cfe/trunk/test/CodeGenObjC/section-name.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/section-name.m?rev=360359&r1=360358&r2=360359&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/section-name.m (original)
+++ cfe/trunk/test/CodeGenObjC/section-name.m Thu May 9 10:43:52 2019
@@ -31,15 +31,15 @@ __declspec(dllexport)
// CHECK-NOT: @"OBJC_IVAR_$_Interface._property" = {{.*}} section "__DATA, __objc_ivar"
// CHECK-NOT: @"OBJC_CLASS_$_Interface" = {{.*}} section "__DATA, __objc_data"
// CHECK-NOT: @"OBJC_METACLASS_$_Interface" = {{.*}} section "__DATA, __objc_data"
-// CHECK-NOT: @"\01l_OBJC_$_CLASS_METHODS_Interface" = {{.*}} section "__DATA, __objc_const"
-// CHECK-NOT: @"\01l_OBJC_$_PROTOCOL_INSTANCE_METHODS_Protocol" = {{.*}} section "__DATA, __objc_const"
-// CHECK-NOT: @"\01l_OBJC_$_PROTOCOL_METHOD_TYPES_Protocol" = {{.*}} section "__DATA, __objc_const"
-// CHECK-NOT: @"\01l_OBJC_CLASS_PROTOCOLS_$_Interface" = {{.*}} section "__DATA, __objc_const"
-// CHECK-NOT: @"\01l_OBJC_METACLASS_RO_$_" = {{.*}} section "__DATA, __objc_const"
-// CHECK-NOT: @"\01l_OBJC_$_INSTANCE_METHODS_Interface" = {{.*}} section "__DATA, __objc_const"
-// CHECK-NOT: @"\01l_OBJC_$_INSTANCE_VARIABLES_Interface" = {{.*}} section "__DATA, __objc_const"
-// CHECK-NOT: @"\01l_OBJC_$_PROP_LIST_Interface" = {{.*}} section "__DATA, __objc_const"
-// CHECK-NOT: @"\01l_OBJC_CLASS_RO_$_Interface" = {{.*}} section "__DATA, __objc_const"
-// CHECK-NOT: @"\01l_OBJC_$_CATEGORY_INSTANCE_METHODS_Interface_$_Category" = {{.*}} section "__DATA, __objc_const"
-// CHECK-NOT: @"\01l_OBJC_$_CATEGORY_Interface_$_Category" = {{.*}} section "__DATA, __objc_const"
+// CHECK-NOT: @"_OBJC_$_CLASS_METHODS_Interface" = {{.*}} section "__DATA, __objc_const"
+// CHECK-NOT: @"_OBJC_$_PROTOCOL_INSTANCE_METHODS_Protocol" = {{.*}} section "__DATA, __objc_const"
+// CHECK-NOT: @"_OBJC_$_PROTOCOL_METHOD_TYPES_Protocol" = {{.*}} section "__DATA, __objc_const"
+// CHECK-NOT: @"_OBJC_CLASS_PROTOCOLS_$_Interface" = {{.*}} section "__DATA, __objc_const"
+// CHECK-NOT: @"_OBJC_METACLASS_RO_$_" = {{.*}} section "__DATA, __objc_const"
+// CHECK-NOT: @"_OBJC_$_INSTANCE_METHODS_Interface" = {{.*}} section "__DATA, __objc_const"
+// CHECK-NOT: @"_OBJC_$_INSTANCE_VARIABLES_Interface" = {{.*}} section "__DATA, __objc_const"
+// CHECK-NOT: @"_OBJC_$_PROP_LIST_Interface" = {{.*}} section "__DATA, __objc_const"
+// CHECK-NOT: @"_OBJC_CLASS_RO_$_Interface" = {{.*}} section "__DATA, __objc_const"
+// CHECK-NOT: @"_OBJC_$_CATEGORY_INSTANCE_METHODS_Interface_$_Category" = {{.*}} section "__DATA, __objc_const"
+// CHECK-NOT: @"_OBJC_$_CATEGORY_Interface_$_Category" = {{.*}} section "__DATA, __objc_const"
Modified: cfe/trunk/test/CodeGenObjC/sections.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/sections.m?rev=360359&r1=360358&r2=360359&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/sections.m (original)
+++ cfe/trunk/test/CodeGenObjC/sections.m Thu May 9 10:43:52 2019
@@ -34,39 +34,42 @@ _Bool f(J *j) {
return [I class] == @protocol(P);
}
-// CHECK-COFF: @"OBJC_CLASSLIST_SUP_REFS_$_" = {{.*}}, section ".objc_superrefs$B"
-// CHECK-COFF: @OBJC_SELECTOR_REFERENCES_ = {{.*}}, section ".objc_selrefs$B"
-// CHECK-COFF: @"OBJC_CLASSLIST_REFERENCES_$_" = {{.*}}, section ".objc_classrefs$B"
-// CHECK-COFF: @"\01l_objc_msgSend_fixup_class" = {{.*}}, section ".objc_msgrefs$B"
+// CHECK-COFF: @"_OBJC_$_CLASS_METHODS_I" = private
+// CHECK-COFF: @"OBJC_CLASSLIST_SUP_REFS_$_" = private {{.*}}, section ".objc_superrefs$B"
+// CHECK-COFF: @OBJC_SELECTOR_REFERENCES_ = private {{.*}}, section ".objc_selrefs$B"
+// CHECK-COFF: @"OBJC_CLASSLIST_REFERENCES_$_" = private {{.*}}, section ".objc_classrefs$B"
+// CHECK-COFF: @_objc_msgSend_fixup_class = {{.*}}, section ".objc_msgrefs$B"
// CHECK-COFF: @"_OBJC_LABEL_PROTOCOL_$_P" = {{.*}}, section ".objc_protolist$B"
-// CHECK-COFF: @"\01l_OBJC_PROTOCOL_REFERENCE_$_P" = {{.*}}, section ".objc_protorefs$B"
-// CHECK-COFF: @"OBJC_LABEL_CLASS_$" = {{.*}}, section ".objc_classlist$B"
-// CHECK-COFF: @"OBJC_LABEL_NONLAZY_CLASS_$" = {{.*}}, section ".objc_nlclslist$B"
-// CHECK-COFF: @"OBJC_LABEL_CATEGORY_$" = {{.*}}, section ".objc_catlist$B"
-// CHECK-COFF: @"OBJC_LABEL_NONLAZY_CATEGORY_$" = {{.*}}, section ".objc_nlcatlist$B"
+// CHECK-COFF: @"_OBJC_PROTOCOL_REFERENCE_$_P" = {{.*}}, section ".objc_protorefs$B"
+// CHECK-COFF: @"OBJC_LABEL_CLASS_$" = private {{.*}}, section ".objc_classlist$B"
+// CHECK-COFF: @"OBJC_LABEL_NONLAZY_CLASS_$" = private {{.*}}, section ".objc_nlclslist$B"
+// CHECK-COFF: @"OBJC_LABEL_CATEGORY_$" = private {{.*}}, section ".objc_catlist$B"
+// CHECK-COFF: @"OBJC_LABEL_NONLAZY_CATEGORY_$" = private {{.*}}, section ".objc_nlcatlist$B"
// CHECK-COFF: !{{[0-9]+}} = !{i32 1, !"Objective-C Image Info Section", !".objc_imageinfo$B"}
-// CHECK-ELF: @"OBJC_CLASSLIST_SUP_REFS_$_" = {{.*}}, section "objc_superrefs"
-// CHECK-ELF: @OBJC_SELECTOR_REFERENCES_ = {{.*}}, section "objc_selrefs"
-// CHECK-ELF: @"OBJC_CLASSLIST_REFERENCES_$_" = {{.*}}, section "objc_classrefs"
-// CHECK-ELF: @"\01l_objc_msgSend_fixup_class" = {{.*}}, section "objc_msgrefs"
+// CHECK-ELF: @"_OBJC_$_CLASS_METHODS_I" = private
+// CHECK-ELF: @"OBJC_CLASSLIST_SUP_REFS_$_" = private {{.*}}, section "objc_superrefs"
+// CHECK-ELF: @OBJC_SELECTOR_REFERENCES_ = private {{.*}}, section "objc_selrefs"
+// CHECK-ELF: @"OBJC_CLASSLIST_REFERENCES_$_" = private {{.*}}, section "objc_classrefs"
+// CHECK-ELF: @_objc_msgSend_fixup_class = {{.*}}, section "objc_msgrefs"
// CHECK-ELF: @"_OBJC_LABEL_PROTOCOL_$_P" = {{.*}}, section "objc_protolist"
-// CHECK-ELF: @"\01l_OBJC_PROTOCOL_REFERENCE_$_P" = {{.*}}, section "objc_protorefs"
-// CHECK-ELF: @"OBJC_LABEL_CLASS_$" = {{.*}}, section "objc_classlist"
-// CHECK-ELF: @"OBJC_LABEL_NONLAZY_CLASS_$" = {{.*}}, section "objc_nlclslist"
-// CHECK-ELF: @"OBJC_LABEL_CATEGORY_$" = {{.*}}, section "objc_catlist"
-// CHECK-ELF: @"OBJC_LABEL_NONLAZY_CATEGORY_$" = {{.*}}, section "objc_nlcatlist"
+// CHECK-ELF: @"_OBJC_PROTOCOL_REFERENCE_$_P" = {{.*}}, section "objc_protorefs"
+// CHECK-ELF: @"OBJC_LABEL_CLASS_$" = private {{.*}}, section "objc_classlist"
+// CHECK-ELF: @"OBJC_LABEL_NONLAZY_CLASS_$" = private {{.*}}, section "objc_nlclslist"
+// CHECK-ELF: @"OBJC_LABEL_CATEGORY_$" = private {{.*}}, section "objc_catlist"
+// CHECK-ELF: @"OBJC_LABEL_NONLAZY_CATEGORY_$" = private {{.*}}, section "objc_nlcatlist"
// CHECK-ELF: !{{[0-9]+}} = !{i32 1, !"Objective-C Image Info Section", !"objc_imageinfo"}
-// CHECK-MACHO: @"OBJC_CLASSLIST_SUP_REFS_$_" = {{.*}}, section "__DATA,__objc_superrefs,regular,no_dead_strip"
-// CHECK-MACHO: @OBJC_SELECTOR_REFERENCES_ = {{.*}}, section "__DATA,__objc_selrefs,literal_pointers,no_dead_strip"
-// CHECK-MACHO: @"OBJC_CLASSLIST_REFERENCES_$_" = {{.*}}, section "__DATA,__objc_classrefs,regular,no_dead_strip"
-// CHECK-MACHO: @"\01l_objc_msgSend_fixup_class" = {{.*}}, section "__DATA,__objc_msgrefs,coalesced"
+// CHECK-MACHO: @"_OBJC_$_CLASS_METHODS_I" = internal {{.*}}, section "__DATA, __objc_const"
+// CHECK-MACHO: @"OBJC_CLASSLIST_SUP_REFS_$_" = internal {{.*}}, section "__DATA,__objc_superrefs,regular,no_dead_strip"
+// CHECK-MACHO: @OBJC_SELECTOR_REFERENCES_ = internal {{.*}}, section "__DATA,__objc_selrefs,literal_pointers,no_dead_strip"
+// CHECK-MACHO: @"OBJC_CLASSLIST_REFERENCES_$_" = internal {{.*}}, section "__DATA,__objc_classrefs,regular,no_dead_strip"
+// CHECK-MACHO: @_objc_msgSend_fixup_class = {{.*}}, section "__DATA,__objc_msgrefs,coalesced"
// CHECK-MACHO: @"_OBJC_LABEL_PROTOCOL_$_P" = {{.*}}, section "__DATA,__objc_protolist,coalesced,no_dead_strip"
-// CHECK-MACHO: @"\01l_OBJC_PROTOCOL_REFERENCE_$_P" = {{.*}}, section "__DATA,__objc_protorefs,coalesced,no_dead_strip"
-// CHECK-MACHO: @"OBJC_LABEL_CLASS_$" = {{.*}}, section "__DATA,__objc_classlist,regular,no_dead_strip"
-// CHECK-MACHO: @"OBJC_LABEL_NONLAZY_CLASS_$" = {{.*}}, section "__DATA,__objc_nlclslist,regular,no_dead_strip"
-// CHECK-MACHO: @"OBJC_LABEL_CATEGORY_$" = {{.*}}, section "__DATA,__objc_catlist,regular,no_dead_strip"
-// CHECK-MACHO: @"OBJC_LABEL_NONLAZY_CATEGORY_$" = {{.*}}, section "__DATA,__objc_nlcatlist,regular,no_dead_strip"
+// CHECK-MACHO: @"_OBJC_PROTOCOL_REFERENCE_$_P" = {{.*}}, section "__DATA,__objc_protorefs,coalesced,no_dead_strip"
+// CHECK-MACHO: @"OBJC_LABEL_CLASS_$" = internal {{.*}}, section "__DATA,__objc_classlist,regular,no_dead_strip"
+// CHECK-MACHO: @"OBJC_LABEL_NONLAZY_CLASS_$" = internal {{.*}}, section "__DATA,__objc_nlclslist,regular,no_dead_strip"
+// CHECK-MACHO: @"OBJC_LABEL_CATEGORY_$" = internal {{.*}}, section "__DATA,__objc_catlist,regular,no_dead_strip"
+// CHECK-MACHO: @"OBJC_LABEL_NONLAZY_CATEGORY_$" = internal {{.*}}, section "__DATA,__objc_nlcatlist,regular,no_dead_strip"
// CHECK-MACHO: !{{[0-9]+}} = !{i32 1, !"Objective-C Image Info Section", !"__DATA,__objc_imageinfo,regular,no_dead_strip"}
Modified: cfe/trunk/test/CodeGenObjCXX/externally-initialized-selectors.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/externally-initialized-selectors.mm?rev=360359&r1=360358&r2=360359&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/externally-initialized-selectors.mm (original)
+++ cfe/trunk/test/CodeGenObjCXX/externally-initialized-selectors.mm Thu May 9 10:43:52 2019
@@ -1,7 +1,8 @@
-// RUN: %clang_cc1 -fobjc-runtime=macosx-fragile-10.5 -o - -emit-llvm %s | FileCheck %s
-// RUN: %clang_cc1 -o - -emit-llvm %s | FileCheck %s
+// RUN: %clang_cc1 -fobjc-runtime=macosx-fragile-10.5 -o - -emit-llvm %s | FileCheck -check-prefix=FRAGILE %s
+// RUN: %clang_cc1 -o - -emit-llvm %s | FileCheck -check-prefix=NONFRAGILE %s
-// CHECK: @OBJC_SELECTOR_REFERENCES_ = private externally_initialized global
+// NONFRAGILE: @OBJC_SELECTOR_REFERENCES_ = internal externally_initialized global
+// FRAGILE: @OBJC_SELECTOR_REFERENCES_ = private externally_initialized global
void test(id x) {
[x doSomething];
Modified: cfe/trunk/test/CodeGenObjCXX/mrc-weak.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/mrc-weak.mm?rev=360359&r1=360358&r2=360359&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/mrc-weak.mm (original)
+++ cfe/trunk/test/CodeGenObjCXX/mrc-weak.mm Thu May 9 10:43:52 2019
@@ -7,7 +7,7 @@
@end
// CHECK-MODERN: @OBJC_CLASS_NAME_{{.*}} = {{.*}} c"\01\00"
-// CHECK-MODERN: @"\01l_OBJC_CLASS_RO_$_Foo" = {{.*}} { i32 772
+// CHECK-MODERN: @"_OBJC_CLASS_RO_$_Foo" = {{.*}} { i32 772
// 772 == 0x304
// ^ HasMRCWeakIvars
// ^ HasCXXDestructorOnly
More information about the cfe-commits
mailing list