I wrote a Clang warning [not pictured] to diagnose any use of T(x) which was not equivalent to static_cast<T>(x). Then I built Clang with that warning turned on. Here are all of the instances of "unsafe" T(x) that it identified in the codebase. Every single one is a cast from some pointer type to uintptr_t.
N.B.: The code in llvm/IR/SymbolTableListTraits.h looks absolutely crazy, and this will be the first time it's been touched in over a decade.
If this refactor is acceptable, I'll need someone to land it for me, as I don't have permissions.