DIExpressions can get very long and have a lot of redundant operations. This function uses simple pattern matching to fold constant math that can be evaluated at compile time. The hope is that other people can contribute other patterns as well. I also couldn't see a good way of combining this with `DIExpression::constantFold` so it stands alone. This is part of a stack of patches and comes after https://github.com/llvm/llvm-project/pull/69768 https://github.com/llvm/llvm-project/pull/71717
12 KiB
12 KiB