@@ -1318,9 +1318,8 @@ static llvm::Constant *getObjCEncodingForTypes(IRGenModule &IGM,
13181318 encodingString += llvm::itostr (parmOffset);
13191319 encodingString += fixedParamsString;
13201320 encodingString += paramsString;
1321- return IGM.getAddrOfGlobalString (
1322- encodingString,
1323- /* sectionName=*/ " __TEXT,__objc_methtype,cstring_literals" );
1321+ return IGM.getAddrOfGlobalString (encodingString,
1322+ IRGenModule::ObjCMethodTypeSectionName);
13241323}
13251324
13261325static llvm::Constant *
@@ -1335,12 +1334,12 @@ getObjectEncodingFromClangNode(IRGenModule &IGM, Decl *d,
13351334 if (auto objcMethodDecl = dyn_cast<clang::ObjCMethodDecl>(clangDecl)) {
13361335 typeStr = clangASTContext.getObjCEncodingForMethodDecl (
13371336 objcMethodDecl, useExtendedEncoding /* extended*/ );
1338- sectionName = " __TEXT,__objc_methtype,cstring_literals " ;
1337+ sectionName = IRGenModule::ObjCMethodTypeSectionName ;
13391338 }
13401339 if (auto objcPropertyDecl = dyn_cast<clang::ObjCPropertyDecl>(clangDecl)) {
13411340 typeStr = clangASTContext.getObjCEncodingForPropertyDecl (objcPropertyDecl,
13421341 nullptr );
1343- sectionName = " __TEXT,__objc_methname,cstring_literals " ;
1342+ sectionName = IRGenModule::ObjCPropertyNameSectionName ;
13441343 }
13451344 if (!typeStr.empty ()) {
13461345 return IGM.getAddrOfGlobalString (typeStr.c_str (), sectionName);
@@ -1440,8 +1439,7 @@ irgen::emitObjCGetterDescriptorParts(IRGenModule &IGM, VarDecl *property) {
14401439 TypeStr += " @0:" ;
14411440 TypeStr += llvm::itostr (PtrSize.getValue ());
14421441 descriptor.typeEncoding = IGM.getAddrOfGlobalString (
1443- TypeStr.c_str (),
1444- /* sectionName=*/ " __TEXT,__objc_methtype,cstring_literals" );
1442+ TypeStr.c_str (), IRGenModule::ObjCMethodTypeSectionName);
14451443 descriptor.silFunction = nullptr ;
14461444 descriptor.impl = getObjCGetterPointer (IGM, property, descriptor.silFunction );
14471445 return descriptor;
@@ -1519,8 +1517,7 @@ irgen::emitObjCSetterDescriptorParts(IRGenModule &IGM,
15191517 clangASTContext.getObjCEncodingForType (clangType, TypeStr);
15201518 TypeStr += llvm::itostr (ParmOffset);
15211519 descriptor.typeEncoding = IGM.getAddrOfGlobalString (
1522- TypeStr.c_str (),
1523- /* sectionName=*/ " __TEXT,__objc_methtype,cstring_literals" );
1520+ TypeStr.c_str (), IRGenModule::ObjCMethodTypeSectionName);
15241521 descriptor.silFunction = nullptr ;
15251522 descriptor.impl = getObjCSetterPointer (IGM, property, descriptor.silFunction );
15261523 return descriptor;
@@ -1627,7 +1624,7 @@ void irgen::emitObjCIVarInitDestroyDescriptor(IRGenModule &IGM,
16271624 llvm::SmallString<8 > signature;
16281625 signature = " v" + llvm::itostr (ptrSize * 2 ) + " @0:" + llvm::itostr (ptrSize);
16291626 descriptor.typeEncoding = IGM.getAddrOfGlobalString (
1630- signature, /* sectionName= */ " __TEXT,__objc_methtype,cstring_literals " );
1627+ signature, IRGenModule::ObjCMethodTypeSectionName );
16311628
16321629 // / The third element is the method implementation pointer.
16331630 descriptor.impl = llvm::ConstantExpr::getBitCast (objcImpl, IGM.Int8PtrTy );
0 commit comments