mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
Allow the OSLog module to specify the log string section name
When building the `OSLog` module, look for a variable named
`osLogStringSectionName`. It must have a string literal as its
initializer, which provides the section name where the log strings
should be emitted. The `OSLog` module should contain something like
this:
let osLogStringSectionName = "__TEXT,__logit"
When not present, the compiler will default to
`__TEXT,__oslogstring,cstring_literals`, which was previously the
hardcoded section name. Now, OSLog can customize the name.
Implements rdar://171571056
This commit is contained in:
@@ -231,6 +231,9 @@ static bool readOptionsBlock(llvm::BitstreamCursor &cursor,
|
||||
case options_block::DEFERRED_CODE_GEN:
|
||||
extendedInfo.setDeferredCodeGen(true);
|
||||
break;
|
||||
case options_block::OSLOG_STRING_SECTION_NAME:
|
||||
extendedInfo.setOSLogStringSectionName(blobData);
|
||||
break;
|
||||
default:
|
||||
// Unknown options record, possibly for use by a future version of the
|
||||
// module format.
|
||||
@@ -1591,6 +1594,8 @@ ModuleFileSharedCore::ModuleFileSharedCore(
|
||||
ModulePackageName = extInfo.getModulePackageName();
|
||||
ModuleExportAsName = extInfo.getExportAsName();
|
||||
PublicModuleName = extInfo.getPublicModuleName();
|
||||
OSLogStringSectionName = extInfo.getOSLogStringSectionName();
|
||||
|
||||
SwiftInterfaceCompilerVersion =
|
||||
extInfo.getSwiftInterfaceCompilerVersion();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user