https://github.com/sommerlukas approved this pull request. Approach looks good to me, I wonder if we can simplify the logic a bit, but that's more of a nit/personal taste. https://github.com/llvm/llvm-project/pull/195359