[llvm] [NFC][LLVM][IR] Adopt vadiadic `isa<>` (PR #137001)
Rahul Joshi via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 24 14:05:34 PDT 2025
jurahul wrote:
Note that beyond the brevity gain, it can also make code easier to read by not having to repeat the input argument multiple times. That way, when looking at `isa<X, Y, Z>(a1)` vs `isa<X>(a1) || isa<Y>(a1) || isa<Z>(a1)` I know instantly that the same a1 is tested for all X/Y/Z classes, as opposed to something like isa<X>(a1) || isa<Y>(a2), since we don't need to repeat a1 and I don't need to verify if it's the same a1 being tested in a || chain of these. Subtle bugs in the code can be avoided as well by having to not repeat the input arg multiple times.
As a result, I can see it goes both ways in terms of code readability. It seems what you are suggesting is that if folks happen to use, we ok?
https://github.com/llvm/llvm-project/pull/137001
More information about the llvm-commits
mailing list