mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
IRGen: re-enable generate static arrays in read-only data sections.
So far, static arrays had to be put into a writable section, because the isa pointer and the (immortal) ref count field were initialized dynamically at the first use of such an array.
But with a new runtime library, which exports the symbols for the (immortal) ref count field and the isa pointer, it's possible to put the whole array into a read-only section. I.e. make it a constant global.
rdar://94185998
This reverts the revert commit df353ff3c0.
Also, I added a frontend option to disable this optimization: `-disable-readonly-static-objects`
This commit is contained in:
@@ -2329,6 +2329,10 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
|
||||
Opts.NoPreallocatedInstantiationCaches = true;
|
||||
}
|
||||
|
||||
if (Args.hasArg(OPT_disable_readonly_static_objects)) {
|
||||
Opts.DisableReadonlyStaticObjects = true;
|
||||
}
|
||||
|
||||
// Default to disabling swift async extended frame info on anything but
|
||||
// darwin. Other platforms are unlikely to have support for extended frame
|
||||
// pointer information.
|
||||
|
||||
Reference in New Issue
Block a user