Skip to content

Commit 16c326e

Browse files
committed
[Frontend] Re-enable imported AST verification
The reasons for disabling it appear to now be outdated. Re-enable it, and run it after the entire pipeline has finished to make sure we verify any decls deserialised during SIL/IRGen.
1 parent c6de4fa commit 16c326e

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

lib/FrontendTool/FrontendTool.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,6 +1209,9 @@ static bool emitAnyWholeModulePostTypeCheckSupplementaryOutputs(
12091209
static void performEndOfPipelineActions(CompilerInstance &Instance) {
12101210
assert(Instance.hasASTContext());
12111211

1212+
// Verify the AST for all the modules we've loaded.
1213+
Instance.getASTContext().verifyAllLoadedModules();
1214+
12121215
// Emit dependencies and index data.
12131216
emitReferenceDependenciesForAllPrimaryInputsIfNeeded(Instance);
12141217
emitIndexData(Instance);

lib/Sema/TypeChecker.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -379,20 +379,6 @@ void swift::performWholeModuleTypeChecking(SourceFile &SF) {
379379
diagnoseObjCMethodConflicts(SF);
380380
diagnoseObjCUnsatisfiedOptReqConflicts(SF);
381381
diagnoseUnintendedObjCMethodOverrides(SF);
382-
383-
// In whole-module mode, import verification is deferred until all files have
384-
// been type checked. This avoids caching imported declarations when a valid
385-
// type checker is not present. The same declaration may need to be fully
386-
// imported by subsequent files.
387-
//
388-
// FIXME: some playgrounds tests (playground_lvalues.swift) fail with
389-
// verification enabled.
390-
#if 0
391-
if (SF.Kind != SourceFileKind::SIL &&
392-
!Ctx.LangOpts.DebuggerSupport) {
393-
Ctx.verifyAllLoadedModules();
394-
}
395-
#endif
396382
}
397383

398384
bool swift::isAdditiveArithmeticConformanceDerivationEnabled(SourceFile &SF) {

0 commit comments

Comments
 (0)