Fix private constructor for ScaledNumber.
authorDiego Novillo <dnovillo@google.com>
Thu, 30 Apr 2015 13:22:48 +0000 (13:22 +0000)
committerDiego Novillo <dnovillo@google.com>
Thu, 30 Apr 2015 13:22:48 +0000 (13:22 +0000)
commit156f9e8a04e21fca4c50d8388723b7eb75a44b3c
tree8bcc1396e333a0131b399dcd30f550fbf0435e5d
parentc846f35a04382a4ca352132f0ed09620b0132c42
Fix private constructor for ScaledNumber.

Summary:
The private constructor for ScaledNumber was using uint64_t instead of
DigitsT. This was preventing instantiations of ScaledNumber with
anything other than uint64_t types.

In implementing the tests, I ran into another issue. Operators >>= and
<<= did not have variants for accepting other ScaledNumber as the shift
argument. This is expected by the SCALED_NUMBER_BOP.

It makes no sense to allow shifting a ScaledNumber by another
ScaledNumber, so the patch includes two new templates for shifting
ScaledNumbers.

Reviewers: dexonsmith

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D9350

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236232 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/ScaledNumber.h
unittests/Support/ScaledNumberTest.cpp