File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
lib/SILOptimizer/Transforms Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -383,7 +383,25 @@ struct OwnershipModelEliminator : SILModuleTransform {
383
383
continue ;
384
384
385
385
// Verify here to make sure ownership is correct before we strip.
386
- F.verify ();
386
+ {
387
+ // Add a pretty stack trace entry to tell users who see a verification
388
+ // failure triggered by this verification check that they need to re-run
389
+ // with -sil-verify-all to actually find the pass that introduced the
390
+ // verification error.
391
+ //
392
+ // DISCUSSION: This occurs due to the crash from the verification
393
+ // failure happening in the pass itself. This causes us to dump the
394
+ // SILFunction and emit a msg that this pass (OME) is the culprit. This
395
+ // is generally correct for most passes, but not for OME since we are
396
+ // verifying before we have even modified the function to ensure that
397
+ // all ownership invariants have been respected before we lower
398
+ // ownership from the function.
399
+ llvm::PrettyStackTraceString silVerifyAllMsgOnFailure (
400
+ " Found verification error when verifying before lowering "
401
+ " ownership. Please re-run with -sil-verify-all to identify the "
402
+ " actual pass that introduced the verification error." );
403
+ F.verify ();
404
+ }
387
405
388
406
if (stripOwnership (F)) {
389
407
auto InvalidKind =
You can’t perform that action at this time.
0 commit comments