mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Warn about the use of internal bridging headers without library evolution
It's very, very easy to make a mistake that will cause broken serialized modules. Until that's no longer true, at least tell folks that they are heading into uncharted waters, as we do with `@_implementationOnly` imports.
This commit is contained in:
@@ -2129,6 +2129,13 @@ static bool ParseClangImporterArgs(ClangImporterOptions &Opts, ArgList &Args,
|
||||
Opts.BridgingHeaderIsInternal = importAsInternal;
|
||||
}
|
||||
|
||||
// Until we have some checking in place, internal bridging headers are a
|
||||
// bit unsafe without library evolution.
|
||||
if (Opts.BridgingHeaderIsInternal && !FrontendOpts.EnableLibraryEvolution) {
|
||||
Diags.diagnose(SourceLoc(),
|
||||
diag::internal_bridging_header_without_library_evolution);
|
||||
}
|
||||
|
||||
Opts.DisableSwiftBridgeAttr |= Args.hasArg(OPT_disable_swift_bridge_attr);
|
||||
|
||||
Opts.DisableOverlayModules |= Args.hasArg(OPT_emit_imported_modules);
|
||||
|
||||
Reference in New Issue
Block a user