In performTypeChecking, defer verifyAllLoadedModules in WMO mode. #14250
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Suggested by Jordan Rose.
Defer per-file verification in whole-module mode. Verifying imports between
files could cause the importer to cache declarations without adding them to the
ASTContext. This happens when the importer registers a declaration without a
valid TypeChecker instance, as is the case during verification. A subsequent
file may require that declaration to be fully imported (e.g. to synthesized a
function body), but since it has already been cached, it will never be added to
the ASTContext. The solution is to skip verification and avoid caching
it. Instead, loaded modules are now verified in WMO mode once during
performWholeModuleTypeChecking.
Fixes rdar:36801676 [Edge][swift 4.1] SIL verification failed: external
declarations of SILFunctions with shared visibility is not allowed.