diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2013-05-24 20:51:59 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2013-05-24 20:51:59 +0000 |
commit | a0cfb8f21baf94fb8c40ff90bfc043de1ef700ec (patch) | |
tree | b852de3113a75e1d69c50f8fb2f864afc639ac48 /include/llvm/Support/MathExtras.h | |
parent | 7932798384725834bd77f934e3408e5cca29c131 (diff) | |
download | external_llvm-a0cfb8f21baf94fb8c40ff90bfc043de1ef700ec.tar.gz external_llvm-a0cfb8f21baf94fb8c40ff90bfc043de1ef700ec.tar.bz2 external_llvm-a0cfb8f21baf94fb8c40ff90bfc043de1ef700ec.zip |
[Support][MathExtras] Add missing include and disable _BitScan{Forward,Reverse}64 on non x64 MSVC systems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182671 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/MathExtras.h')
-rw-r--r-- | include/llvm/Support/MathExtras.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/Support/MathExtras.h b/include/llvm/Support/MathExtras.h index d77a1cb7e7..ba65fcbff2 100644 --- a/include/llvm/Support/MathExtras.h +++ b/include/llvm/Support/MathExtras.h @@ -14,6 +14,7 @@ #ifndef LLVM_SUPPORT_MATHEXTRAS_H #define LLVM_SUPPORT_MATHEXTRAS_H +#include "llvm/Support/Compiler.h" #include "llvm/Support/SwapByteOrder.h" #include "llvm/Support/type_traits.h" @@ -86,6 +87,7 @@ inline std::size_t countTrailingZeros<uint32_t>(uint32_t Val, ZeroBehavior ZB) { #endif } +#if !defined(_MSC_VER) || defined(_M_X64) template <> inline std::size_t countTrailingZeros<uint64_t>(uint64_t Val, ZeroBehavior ZB) { if (ZB != ZB_Undefined && Val == 0) @@ -100,6 +102,7 @@ inline std::size_t countTrailingZeros<uint64_t>(uint64_t Val, ZeroBehavior ZB) { #endif } #endif +#endif /// \brief Count number of 0's from the most significant bit to the least /// stopping at the first 1. @@ -148,6 +151,7 @@ inline std::size_t countLeadingZeros<uint32_t>(uint32_t Val, ZeroBehavior ZB) { #endif } +#if !defined(_MSC_VER) || defined(_M_X64) template <> inline std::size_t countLeadingZeros<uint64_t>(uint64_t Val, ZeroBehavior ZB) { if (ZB != ZB_Undefined && Val == 0) @@ -162,6 +166,7 @@ inline std::size_t countLeadingZeros<uint64_t>(uint64_t Val, ZeroBehavior ZB) { #endif } #endif +#endif /// \brief Get the index of the first set bit starting from the least /// significant bit. |