<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">Hi,</div><div class="">I would like to discuss the path towards enabling a new debug info verifier pass by default.</div><div class="">This should improve the debug experience of users at `-Onone`.</div><div class=""><br class=""></div><div class="">## Problem Description</div><div class="">Mandatory passes which run at `-Onone` can attach a wrong scope when they create instructions.</div><div class="">This may result in wrong debug informations generated and degraded debugger experience.</div><div class=""><br class=""></div><div class="">Examples of bugs of this kind recently fixed:</div><div class=""><a href="https://github.com/apple/swift/pull/13919" class="">https://github.com/apple/swift/pull/13919</a></div><div class=""><a href="https://github.com/apple/swift/pull/13890" class="">https://github.com/apple/swift/pull/13890</a></div><div class=""><a href="https://github.com/apple/swift/pull/13856" class="">https://github.com/apple/swift/pull/13856</a></div><div class=""><a href="https://github.com/apple/swift/pull/13854" class="">https://github.com/apple/swift/pull/13854</a></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">## Proposed solution</div><div class=""><div class=""><br class=""></div><div class="">There’s currently nothing preventing compiler writers to attach the wrong scope, so, I’m going to check in a verifier pass to find holes in SIL debug scopes at -Onone.&nbsp;</div><div class="">Reference:&nbsp;<a href="https://github.com/apple/swift/pull/13491" class="">https://github.com/apple/swift/pull/13491</a>&nbsp;, which contains the code and a description of the heuristic used.</div></div><div class=""><br class=""></div><div class="">## Plan to enable this by default</div><div class=""><br class=""></div><div class="">I fixed all the bugs that have been found on the testsuite, but this seems to find still issues on larger projects (most notably, swiftpm), so for now this is disabled (but can be enabled using a flag [-Xllvm -verify-di-holes]). I’m working to&nbsp;</div><div class=""><br class=""></div><div class="">I would really appreciate if the community can test their swift projects with this flag enabled and report bugs.</div><div class="">I would also appreciate general feedback on the path forward.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class=""><br class=""></div><div class="">—</div><div class="">Davide</div></body></html>