diff options
| author | Sam McCall <sam.mccall@gmail.com> | 2018-04-24 20:08:05 +0000 |
|---|---|---|
| committer | Sam McCall <sam.mccall@gmail.com> | 2018-04-24 20:08:05 +0000 |
| commit | bdc0fe55d12430a3bab9a69716cd12bd922eb1d5 (patch) | |
| tree | 7d03092cd875b2d8f64d181dd9274987c474bc9b | |
| parent | f2650df77db1bcc3b9010bdedcdc79fcd5e82ca1 (diff) | |
| download | bcm5719-llvm-bdc0fe55d12430a3bab9a69716cd12bd922eb1d5.tar.gz bcm5719-llvm-bdc0fe55d12430a3bab9a69716cd12bd922eb1d5.zip | |
[Support] fix countLeadingZeros for types shorter than int
llvm-svn: 330762
| -rw-r--r-- | llvm/include/llvm/Support/MathExtras.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h index a37a16784e2..739dcc758d0 100644 --- a/llvm/include/llvm/Support/MathExtras.h +++ b/llvm/include/llvm/Support/MathExtras.h @@ -455,7 +455,7 @@ std::size_t countLeadingOnes(T Value, ZeroBehavior ZB = ZB_Width) { static_assert(std::numeric_limits<T>::is_integer && !std::numeric_limits<T>::is_signed, "Only unsigned integral types are allowed."); - return countLeadingZeros(~Value, ZB); + return countLeadingZeros<T>(~Value, ZB); } /// \brief Count the number of ones from the least significant bit to the first @@ -471,7 +471,7 @@ std::size_t countTrailingOnes(T Value, ZeroBehavior ZB = ZB_Width) { static_assert(std::numeric_limits<T>::is_integer && !std::numeric_limits<T>::is_signed, "Only unsigned integral types are allowed."); - return countTrailingZeros(~Value, ZB); + return countTrailingZeros<T>(~Value, ZB); } namespace detail { |

