https://github.com/MaskRay approved this pull request. LGTM. Eventually we should probably add a testing-only option to call `reset` early so that these stuff is more testable. https://github.com/llvm/llvm-project/pull/94945