]> granicus.if.org Git - llvm/commit
[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)
commit66571bbb0a8676d62cff739a7e715a307f4140e4
tree808deb340e7385b268cd0365fa39957b0f0555c6
parent439700ccdd0ba55fb029895c0950f10b8543023d
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302704 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/APInt.cpp