https://github.com/steakhal commented: Looks correct to me. Btw, do you think the invalidation should cause pointer escape? I have no opinion. I rarely use this api. Wdyt? https://github.com/llvm/llvm-project/pull/109838