@@ -4240,10 +4240,10 @@ static TypeEntityReference
42404240getObjCClassByNameReference (IRGenModule &IGM, ClassDecl *cls) {
42414241 auto kind = TypeReferenceKind::DirectObjCClassName;
42424242 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 );
42474247
42484248 return TypeEntityReference (kind, ref);
42494249}
@@ -4801,7 +4801,7 @@ void IRGenModule::emitAccessibleFunction(StringRef sectionName,
48014801 // -- Field: Name (record name)
48024802 {
48034803 llvm::Constant *name =
4804- getAddrOfGlobalString (func.getFunctionName (), /* sectionName= */ " " ,
4804+ getAddrOfGlobalString (func.getFunctionName (),
48054805 /* willBeRelativelyAddressed=*/ true );
48064806 fields.addRelativeAddress (name);
48074807 }
@@ -6016,6 +6016,12 @@ Address IRGenFunction::createAlloca(llvm::Type *type,
60166016 return Address (alloca, type, alignment);
60176017}
60186018
6019+ llvm::Constant *IRGenModule::getAddrOfGlobalString (StringRef data,
6020+ const char *sectionName) {
6021+ return getAddrOfGlobalString (data, /* willBeRelativelyAddressed=*/ false ,
6022+ /* useOSLogSection=*/ false , sectionName);
6023+ }
6024+
60196025// / Get or create a global string constant.
60206026// /
60216027// / \returns an i8* with a null terminator; note that embedded nulls
@@ -6024,10 +6030,9 @@ Address IRGenFunction::createAlloca(llvm::Type *type,
60246030// / FIXME: willBeRelativelyAddressed is only needed to work around an ld64 bug
60256031// / resolving relative references to coalesceable symbols.
60266032// / 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) {
60316036 useOSLogSection = useOSLogSection &&
60326037 TargetInfo.OutputObjectFormat == llvm::Triple::MachO;
60336038
@@ -6069,11 +6074,9 @@ IRGenModule::getAddrOfGlobalIdentifierString(StringRef data,
60696074 if (Lexer::identifierMustAlwaysBeEscaped (data)) {
60706075 llvm::SmallString<256 > name;
60716076 Mangle::Mangler::appendRawIdentifierForRuntime (data, name);
6072- return getAddrOfGlobalString (name, /* sectionName=*/ " " ,
6073- willBeRelativelyAddressed);
6077+ return getAddrOfGlobalString (name, willBeRelativelyAddressed);
60746078 }
6075- return getAddrOfGlobalString (data, /* sectionName=*/ " " ,
6076- willBeRelativelyAddressed);
6079+ return getAddrOfGlobalString (data, willBeRelativelyAddressed);
60776080}
60786081
60796082// / Get or create a global UTF-16 string constant.
0 commit comments