[Serialization] Add flag to force unsafe recovery from some xref failures

Intro a deserialization mode controlled by the flag
`-experimental-force-workaround-broken-modules` to attempt unsafe
recovery from deserialization failures caused by project issues.

The one issue handled at this time is when a type moves from one module
to another. With this new mode the compiler may be able to pick a
matching type in a different module. This is risky to use, but may help
in a pinch for a client to fix and issue in a library over which they
have no control.
This commit is contained in:
Alexis Laferrière
2023-05-09 11:28:50 -07:00
parent 144d7eb8a0
commit 642980cbb1
6 changed files with 53 additions and 10 deletions

View File

@@ -564,6 +564,8 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
Opts.EnableDeserializationSafety
= A->getOption().matches(OPT_enable_deserialization_safety);
}
Opts.ForceWorkaroundBrokenModules
|= Args.hasArg(OPT_force_workaround_broken_modules);
// Whether '/.../' regex literals are enabled. This implies experimental
// string processing.