@@ -4240,10 +4240,10 @@ static TypeEntityReference
4240
4240
getObjCClassByNameReference (IRGenModule &IGM, ClassDecl *cls) {
4241
4241
auto kind = TypeReferenceKind::DirectObjCClassName;
4242
4242
SmallString<64 > objcRuntimeNameBuffer;
4243
- auto ref =
4244
- IGM. getAddrOfGlobalString ( cls->getObjCRuntimeName (objcRuntimeNameBuffer),
4245
- IRGenModule::ObjCClassNameSectionName ,
4246
- /* willBeRelativelyAddressed =*/ true );
4243
+ auto ref = IGM. getAddrOfGlobalString (
4244
+ cls->getObjCRuntimeName (objcRuntimeNameBuffer),
4245
+ /* willBeRelativelyAddressed= */ true ,
4246
+ /* useOSLogSection =*/ false , IRGenModule::ObjCClassNameSectionName );
4247
4247
4248
4248
return TypeEntityReference (kind, ref);
4249
4249
}
@@ -4801,7 +4801,7 @@ void IRGenModule::emitAccessibleFunction(StringRef sectionName,
4801
4801
// -- Field: Name (record name)
4802
4802
{
4803
4803
llvm::Constant *name =
4804
- getAddrOfGlobalString (func.getFunctionName (), /* sectionName= */ " " ,
4804
+ getAddrOfGlobalString (func.getFunctionName (),
4805
4805
/* willBeRelativelyAddressed=*/ true );
4806
4806
fields.addRelativeAddress (name);
4807
4807
}
@@ -6016,6 +6016,12 @@ Address IRGenFunction::createAlloca(llvm::Type *type,
6016
6016
return Address (alloca, type, alignment);
6017
6017
}
6018
6018
6019
+ llvm::Constant *IRGenModule::getAddrOfGlobalString (StringRef data,
6020
+ const char *sectionName) {
6021
+ return getAddrOfGlobalString (data, /* willBeRelativelyAddressed=*/ false ,
6022
+ /* useOSLogSection=*/ false , sectionName);
6023
+ }
6024
+
6019
6025
// / Get or create a global string constant.
6020
6026
// /
6021
6027
// / \returns an i8* with a null terminator; note that embedded nulls
@@ -6024,10 +6030,9 @@ Address IRGenFunction::createAlloca(llvm::Type *type,
6024
6030
// / FIXME: willBeRelativelyAddressed is only needed to work around an ld64 bug
6025
6031
// / resolving relative references to coalesceable symbols.
6026
6032
// / It should be removed when fixed. rdar://problem/22674524
6027
- llvm::Constant *
6028
- IRGenModule::getAddrOfGlobalString (StringRef data, StringRef sectionName,
6029
- bool willBeRelativelyAddressed,
6030
- bool useOSLogSection) {
6033
+ llvm::Constant *IRGenModule::getAddrOfGlobalString (
6034
+ StringRef data, bool willBeRelativelyAddressed, bool useOSLogSection,
6035
+ StringRef sectionName) {
6031
6036
useOSLogSection = useOSLogSection &&
6032
6037
TargetInfo.OutputObjectFormat == llvm::Triple::MachO;
6033
6038
@@ -6069,11 +6074,9 @@ IRGenModule::getAddrOfGlobalIdentifierString(StringRef data,
6069
6074
if (Lexer::identifierMustAlwaysBeEscaped (data)) {
6070
6075
llvm::SmallString<256 > name;
6071
6076
Mangle::Mangler::appendRawIdentifierForRuntime (data, name);
6072
- return getAddrOfGlobalString (name, /* sectionName=*/ " " ,
6073
- willBeRelativelyAddressed);
6077
+ return getAddrOfGlobalString (name, willBeRelativelyAddressed);
6074
6078
}
6075
- return getAddrOfGlobalString (data, /* sectionName=*/ " " ,
6076
- willBeRelativelyAddressed);
6079
+ return getAddrOfGlobalString (data, willBeRelativelyAddressed);
6077
6080
}
6078
6081
6079
6082
// / Get or create a global UTF-16 string constant.
0 commit comments