Skip to content

Commit f06f614

Browse files
authored
Merge pull request #42108 from eeckstein/verify-none
PassManager: disable verification of analysis with -sil-verify-none
2 parents c3adbfb + eaeaa02 commit f06f614

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

include/swift/SILOptimizer/PassManager/PassManager.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,7 @@ class SILPassManager {
329329
~SILPassManager();
330330

331331
/// Verify all analyses.
332-
void verifyAnalyses() const {
333-
for (auto *A : Analyses) {
334-
A->verify();
335-
}
336-
}
332+
void verifyAnalyses() const;
337333

338334
/// Precompute all analyses.
339335
void forcePrecomputeAnalyses(SILFunction *F) {
@@ -348,11 +344,7 @@ class SILPassManager {
348344
/// Discussion: We leave it up to the analyses to decide how to implement
349345
/// this. If no override is provided the SILAnalysis should just call the
350346
/// normal verify method.
351-
void verifyAnalyses(SILFunction *F) const {
352-
for (auto *A : Analyses) {
353-
A->verify(F);
354-
}
355-
}
347+
void verifyAnalyses(SILFunction *F) const;
356348

357349
void executePassPipelinePlan(const SILPassPipelinePlan &Plan);
358350

lib/SILOptimizer/PassManager/PassManager.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,24 @@ void SILPassManager::runModulePass(unsigned TransIdx) {
726726
}
727727
}
728728

729+
void SILPassManager::verifyAnalyses() const {
730+
if (Mod->getOptions().VerifyNone)
731+
return;
732+
733+
for (auto *A : Analyses) {
734+
A->verify();
735+
}
736+
}
737+
738+
void SILPassManager::verifyAnalyses(SILFunction *F) const {
739+
if (Mod->getOptions().VerifyNone)
740+
return;
741+
742+
for (auto *A : Analyses) {
743+
A->verify(F);
744+
}
745+
}
746+
729747
void SILPassManager::executePassPipelinePlan(const SILPassPipelinePlan &Plan) {
730748
for (const SILPassPipeline &Pipeline : Plan.getPipelines()) {
731749
setStageName(Pipeline.Name);

0 commit comments

Comments
 (0)