Part of the _BitInt feature in C2x (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2763.pdf) is a new macro in limits.h named BITINT_MAXWIDTH that can be used to determine the maximum width of a bit-precise integer type. This macro must expand to a value that is at least as large as ULLONG_WIDTH.
This adds an implementation-defined macro named __BITINT_MAXWIDTH__ to specify that value, which is used by limits.h for the standard macro. This gives us a migration path in the future should a target ever need to support something different than llvm::IntegerType::MAX_INT_BITS.
Could you do an assert that TI.getMaxBitIntWidth() is not greater than the LLVM maximum (just somewhere, here seemed to make the most sense).