mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add -emit-public-type-metadata-accessors to work around metadata linkage bug.
IRGen can introduce calls to type metadata accessors for types that should not be visible to the current translate, which can manifest in linker errors within a module (for references to private types when whole module optimization is disabled) or across modules (for references to private/internal types in another module). Introduce a new compiler flag `-emit-public-type-metadata-accessors` that emits all type metadata accessors with public linkage, to work around the problem in affected projects. This flag is intended to go away once we have a proper solution. This bug has been around in Swift "forever", but compiling the overlays using -enable-resilience has exacerbated the problem and caused regressions. This is a short-term fix to rdar://problem/40229755 while we work on the correct long-term fix.
This commit is contained in:
@@ -309,6 +309,9 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
}
|
||||
}
|
||||
|
||||
Opts.EmitPublicTypeMetadataAccessors =
|
||||
Args.hasArg(OPT_emit_public_type_metadata_accessors);
|
||||
|
||||
Opts.EnableNSKeyedArchiverDiagnostics =
|
||||
Args.hasFlag(OPT_enable_nskeyedarchiver_diagnostics,
|
||||
OPT_disable_nskeyedarchiver_diagnostics,
|
||||
|
||||
Reference in New Issue
Block a user