https://github.com/DavidTruby commented: I think you still don't need any of the shared_ptr usage here, there's no shared ownership semantics. If you change all these to unique_ptr then I think the patch would look good to me. https://github.com/llvm/llvm-project/pull/116406