[APInt] Make toString use udivrem instead of calling the divide helper method directl...
authorCraig Topper <craig.topper@gmail.com>
Wed, 10 May 2017 18:15:24 +0000 (18:15 +0000)
committerCraig Topper <craig.topper@gmail.com>
Wed, 10 May 2017 18:15:24 +0000 (18:15 +0000)
commitecb97da1081225c0014177db63ec1f698d597c68
tree86112466d070b143b5cb94b9f953fec9d6cdb1cb
parent6271bc71466d84239e2234af31fa3ba2f32e27a1
[APInt] Make toString use udivrem instead of calling the divide helper method directly. Do a better job of reusing allocations while looping. NFCI

This lets toString take advantage of the degenerate case checks in udivrem and is just generally cleaner.

One minor downside of this is that the divisor APInt now needs to be the same size as Tmp which requires an additional allocation. But we were doing a poor job of reusing allocations before so the new code should still be an improvement.

llvm-svn: 302704
llvm/lib/Support/APInt.cpp