Integer type sizes may have up to IntegerType::MAX_INT_BITS, which is currently 1<<23, so nothing that fits into an unsigned int will not be legal. However, having a uint64_t passed here avoids bugs due to truncation from uint64_t, as in PR26972.
Alternatively, we can require always checking for < UINT_MAX (or, better yet, for < MAX_INT_BITS) explicitly before calling DataLayout::isLegalInteger(), but that would make code like "DL.isLegalInteger(DL.getTypeSizeInBits(Ty))" (which we currently have in several places) wrong.